What is this type of detent mechanism called?

Question: I'm trying to find out what this common rotary detent mechanism is actually called. I see them in all sorts of cheap plastic toys, and I'd like to see if I can find them for sale, but I don't know what to search for! I modeled this one in blender for a personal project. If it's not clear in the image, the inner barrel has 4 springs that quantize the rotation of the outer ring. Is this (or something similar) something I could find in bulk, or are they always designed ad-hoc?
Comment: Looks like a custom job, some kind variation on a flat radial-finger-spring. Nice shape for an EDM part. You might well find it on Alibaba, but no telling what the vendor would call it.
Comment: http://www.ehcknobs.com/pdfs/Detent%20Knob.pdf
Comment: @Phil Sweet - Yeah, that's a ball and spring style detent. Serves the same purpose, but I'm trying to reduce my part count, and make it completely from injection-molded plastic.
Comment: If you buy it, the parts count is 1 :)
Answer: Pretty sure that is some kind of pawl and spring disconnect.  Similar to what gives a bike casette the ratcheting connection, but yours is bi-directional like a ball detent.
Closest cheap thing I could find is a rotary selector switch.  It'd have extra electrical connections that you may not want or need.  They tend not to have many positions though; I've used an 8 position one that had nice ball detents.
Comment: It seems that pawls are specifically used with ratchets to prevent rotation in one direction. I can't seem to find a single example of a bi-directional analog, except for a ball detent, but I'm trying to minimize the number of parts I need. I can tell that you understand the functionality I described, and I appreciate the quick reply!
Comment: most common pawls are used in ratchets but term applies to any lever that stops motion- in this case motion between two rotating components.  a good bit of design needs to go into these so depending on budget and quantity you may need to just approach a shaft coupler manufacturer.  they do tend to have modular reconfigurable designs ready to roll though.
Comment: I think a shaft coupler manufacturer would be overkill in my case. I'm just making a small plastic counter with a numbered disk that rotates under a window. This pawl and gear will be the most complicated part, so if I can find a wholesaler, I could design the other parts around it and have them injection molded cheaply. Plenty of places offer kits of assorted gears and such, but I guess I might have to design this part myself.
Comment: if you're going to injection mold, some already make integrated ones of these in cheap plastic toys.  cheap plastic gears are also injection molded.  you can also start with a 3d printed prototype; even one at 2X the scale to make it easier to produce.
Comment: Yeah, my plan is to prototype with a 3d printer, then get quotes on injection molding. It just seems like such a ubiquitous component, I'm surprised there isn't anyone that has them in stock by the thousands, like the gear kits you can find at hobby shops.
Answer: The way I understand it, this mechanism performs very much like the notched scroll wheel of some mice.

Although, probably that is not seem to be the same size or transfer the same load as the one you have in your picture.
Comment: Very similar, yes. I don't need a specific load transfer; that's something I can fiddle with later if need be. It's just meant for a mechanical selector dial with discrete positions, like an old-school television dial, sans the electronics.
Comment: @Adam an unpowered stepping motor can provide the detent feel


Can you use a micro SD card from raspberry pi B+ on the raspberry pi 2 model B?

Question: Can you use a micro SD card from raspberry pi B+ on the raspberry pi 2 model B?
Comment: I'd suggest an edit: obviously one can use micro SD cards both on the B+ and model 2 (as they both use micro SD cards). The question here should emphasize more on the OS on that card (which is of course intended and already answered as such ;) )
Answer: You will need a new kernel, which should be installed on Raspbian regardless of model (meaning, you can do it on the B+) if you:
sudo apt-get update
sudo apt-get upgrade

If the Pi 2 then fails to boot but produces kernel error messages, edit config.txt in the first partition.  Find the kernel= and change what's there to:
kernel=kernel7.img

If it doesn't exist, create it (but if it didn't exist I think it should have worked properly in the first place).
The kernel is currently the only difference for Raspbian; armv7 is backward compatible with armv6, so the userland works.  This other pi distros should work the same way -- you just need an armv7 kernel.   If there isn't one, you should be able to use the kernel7.img from Raspbian.  Make sure you also install the modules, which means copying /lib/modules/3.X.X-v7 over (X.X is probably 18.5, the -v7 is what's important).
If you do want to use that route -- copying in a kernel and modules because you cannot or do not want to upgrade the OS -- see here about how to mount an SD card image to get the files out.  Remember, the kernel will be in the first partition, the modules in the second.
Comment: Yes, this is exactly why I mentioned it.
Answer: In the element14 webpage (http://www.element14.com/community/docs/DOC-73878/l/raspberry-pi-2-model-b-frequently-asked-questions-faqs), you can find:
Will the microSD card and Operating System from my previous model of Raspberry Pi work with the Raspberry Pi 2 Model B?
If you are using Raspbian, you will have to update it first. On your existing Raspberry Pi you can run the following commands from the terminal:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

Alternatively, you can download the latest SD Card image from raspberrypi.org/downloads
Comment: Note that if you've actually updated in the past 6+ months, you don't have to do this.  Also, if you are already using a jessie image (check `/etc/issue` -- jessie is v. 8) *don't* do a `dist-upgrade`.  In fact, you should not have to do a `dist-upgrade` from wheezy either, if you do not want to.  That should have a Pi 2 kernel (and modules), which is the only difference.


What sorting algorithm does visual c++ use in std::sort

Question: I've been searching for a while now, but i can't find what algorithm does visual c++ use for the std::sort function, i know the GNU Standard C++ library uses Introsort, but there doesn't seem to be any sources saying which one Microsoft's visual c++ use!
Comment: The implementation is in the headers, you can see for yourself. My guess would be Introsort, but I haven't checked.
Comment: How do i check the headers, i am just learning this stuff, i don't even know what do you mean by headers.
Comment: Write a program that calls `sort`, run it under debugger, press F7 (Step Into) to step into the actual implementation. Header is the file that you `#include`.
Comment: Oh right, thank, i should've thought of that myself!.
Answer: Use the source Luke :) its quicksort (MSVC 2013) or some times heap sort or even insertion sort (based on the size of the container)
<code>template<class _RanIt,
    class _Diff> inline
    void _Sort(_RanIt _First, _RanIt _Last, _Diff _Ideal)
    {   // order [_First, _Last), using operator<
    _Diff _Count;
    for (; _ISORT_MAX < (_Count = _Last - _First) && 0 < _Ideal; )
        {   // divide and conquer by quicksort
</code>
Comment: So say the input is an array of size 5 million, will it use exclusively quicksort ?
Comment: @user2968505 it will start w/ quicksort and then for smaller partitions heap sort or insertion sort will be used
Comment: so basically it's a hybrid between the three, right (that source is a little opaque to me since I don't have much experience with C)? Also I dig the pun and am totally going to steal that sometime.
Answer: If I remember correctly, the implementation uses an algorithm called introsort, a hybrid of quicksort, heapsort, and insertion sort. The basic idea is as follows:

Run quicksort, stopping on any subrange whose length is below a preset threshold.
If during the quicksort the recursion depth exceeds a certain limit, stop running quicksort and use heapsort instead.
At the end, run insertion sort on the whole array. Since the elements are all close to their final positions, this will only take time O(n).

The advantage of introsort is that in the common case, it uses quicksort (very fast) until insertion sort is better, getting the advantages of both. In the event that the quicksort starts to degenerate, it uses heapsort, which is O(n log n) worst-case but slightly slower than quicksort on average, to guarantee O(n log n) worst-case runtimes. Overall, it's a very fast, in-place sorting algorithm.
Hope this helps!


Adjective for 'pertaining to (social) class'?

Question: How would one refer to the description of a (socioeconomic) class? For instance, racial and cultural would be adjectives referring to race and culture, but what would you use for something pertaining to a (socioeconomic) class? Neither classist nor classical would work, as they both convey something completely unrelated.
Comment: You have the concepts all mixed up. Do you need a broad term for the 'class' descriptor or a generic one for use with each '(such as socioeconomic) class'?
Comment: I need an adjective to refer to "class" (specifically social class, or status) in the same way that "racial" and "cultural" refer to race and culture. Socioeconomic would work, but I'm just curious if there's a good word to complete a sentence such as "Racial, cultural, and class- factors".
Comment: You may say, 'Racial, cultural and social factors' . Social in this case would be  understood as referred to social conditions ( status, class), I think.
Answer: If you mean to describe someone as being of a certain status or in a certain class of society, the word socio-economic functions well as an adjective.

People in higher socio-economic groups benefit from...

The term classist is someone who has a negative attitude towards people of a certain social standing.  This kind of mentality is referred to as 'classism', which is a belief system centred around displaying, thinking or vocalising prejudice towards social classes.
The term classical is generally used to refer to things of an ancient or traditional nature, like mythology (Classical Greek mythology), music (the Classical era of music), architecture (Classical Roman buildings), art, dance and other cultural concepts.  Using this word to describe someone's social class would give the wrong impression and skew your meaning.
Comment: Socioeconomic accomplishes essentially what I was looking for. It would complete a sentence such as "Racial, cultural, and socioeconomic factors" in a way that makes sense. I'm still curious though if there's a good adjective to refer to class in the same way that racial refers to race.
Comment: Well, not all good adjectives have to end in 'al'.  Like 'botanic' vs 'botanical'.
Answer: status:
a social or professional position, condition, or standing to which varying degrees of responsibility, privilege, and esteem are attached.
Comment: Or in this case, its adjectival derivatives _status-based_ and _status-related_.
Comment: I agree, my answer is actually based on the original question by OP who was looking for a term, not specifically and adjective. The question was later re-edited.
Answer: You can use class as an adjective as well, as in class discrimination corresponding to 'racial discrimination'.


Debug logs on triggers

Question: I have a requirement to capture logs related Account and Opportunity triggers. I have configured 'Traced Entity Type' to 'Apex Trigger' , 'Traced Entity Name' to 'Account Trigger' and 'Debug Level' to 'SFDC Dev Console'. But still I couldn't capture any logs. What is the way to retrieve trigger specific logs ?
Comment: worth looking at logging patterns such as in Dan Appleman's Advanced Apex 4th edition book or Andrew Fawcett's Logging with Platform Events
Answer: To see trigger executions, I set my debug as:
Traced Entity Type: User
Traced Entity Name: My User
Then if you are the one executing the DML operation which fires the trigger you will be able to see each trigger that is executed (As long as your debug level has apex code as info/finest).
Comment: Thanks for your reply. We have a user that does involve in many integrations. Some of the transactions are giving SOQL 101 errors. We need to capture these logs and troubleshoot the trigger execution. So considering this what is the better strategy to capture the logs ?
Comment: I would recommend putting in more system.debug() statements into your trigger, i would add them before and after each soql query. Generally when i am getting soql limits i look at my code to ensure im not doing any queries inside of for loops (keep in mind calling other methods which have a query from a trigger for loop is easy to overlook) as well as making sure you are using the proper execution context. (updating the object in before, updating child objects in after context)
Comment: Thank you so much.

Debug logs on triggers


What are good alcohol-free staples to include in a home bar?

Question: I love entertaining and try to keep our home bar stocked with liquors needed for the most commonly requested cocktails. I also try to keep beer, wine, soda, and seltzers on hand when I know people will be dropping over. I love playing bartender for my guests. I have a number of friends who do not drink alcohol. Aside from sodas, teas, and waters, I'd love to have more festive options on hand for guests who don't drink. I've had someone recommend Seedlip to me which I haven't tried yet. I'm curious if others have experience with non-alcoholic spirits. What do you recommend investing in for a home bar so that guests who don't partake in drinking feel more included?
Comment: Not really my thing, but if you google "mocktail recipes" you'll get lots of hits. Should provide ideas for ingredients.
Comment: What do you actually consider ***"staples"***? Is it food and drinks or simply one or the other?
Comment: @KenGraham I was thinking beverages. I'm looking for ideas for guests who might want something more festive than a soda or juice but don't drink alcohol.
Answer: There are several zero-proof brands out now that make quite tasty pseudo-liquors (Ritual is one excellent brand). Zero proof gin is essentially a botanical "tonic" that can you use 1-to-1 like traditional gin in a cocktail. If you like to play bartender, you might enjoy getting a small collection of zero-proof liquor alternatives.
In addition to the ones marketed as "zero proof gin/whiskey/etc", You can find many other zero proof alternatives to traditional liquors that can help you build lower proof, or zero proof cocktails. Versin Aperitif can be substituted for sweet vermouth; San Pellegrino sanbitter makes a decent Campari substitute. Fee Brothers and some other brands have zero proof bitters in a wide variety of flavors. You might find that if you search for your favorite cocktail ingredients specifically, you'll find decent alternatives without the punch.
It's also important to pay attention to labels to match your guests' preferences & needs. For example, Angostura bitters are 45% alcohol, but you normally just use a few drops. If you want ZERO proof (what the US FDA calls "alcohol-free"), steer clear of them (ex, they are haram for Muslims). But if you just want very low alcohol (what the US FDA calls "non-alcoholic"), then it might not matter. "Non-alcoholic" beer usually has a small amount of alcohol, which the FDA considers an insignificant amount, but your guests may feel differently.
Answer: O'Doul's Original Non-Alcoholic Beer is very, very popular here in BC. My father-in-law drinks it quite often, as well as many of my friends and associates.

If you're interested in truly "non-alcoholic", in lieu of "alcohol-free" there are also many Mocktail recipes that won't disappoint you in a home bar!
If you would like a juice recommendation. Then Oasis Pineapple Juice is one I would gladly give. 100% juice and no sugar added! Besides, it tastes great.
Comment: In the US, there's a legal difference between "alcohol-free" (zero alcohol) and "non-alcoholic" (very low alcohol). For some folks that doesn't matter, but for others, it can be an important difference.
Comment: I certainly have guests who cannot have *any* alcohol. It may not be an important distinction to you, but folks reading this answer may have guests who find that to be important. (And the OP may have asked for "alcohol free" intentionally)
Comment: @AMtwo For a home bar, I see little need to be that particular, IMO.
Answer: Lumette products would be a good addition for zero proof cocktails incorporated into your home bar.
https://enjoylumette.com


How to boot via grub2 rescue promt on UEFI system?

Question: I installed Ubuntu 16.04 by booting from a USB, choosing "Try Ubuntu without installing", and then inserting another USB and directing the installer to install there. I told the installer to instal the bootloader on /dev/sdc2 which is the ESP. I know the bootloader was indeed installed because I can see the shim and GRUB EFI files on that partition now.
However, when I tried to boot after installing, instead of giving me the boot menu it only booted to the rescue prompt:
grub rescue>

I then found that my ESP partition is hd0,gpt2 while I expected hd1,gpt2 (using grub's naming scheme here).
I looked through similar questions but unfortunately I only found information about BIOS systems and not EFI, where / also contains /boot(/efi). I am looking for a way how to proceed with / on hd0,gtp3 and the grub efi files on the other disk. The kernel and initrd are both located inside of the ESP, the problem must be at another point.
How can I fix this?
Output of ls:
(hd0) (hd0,gpt5) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1) (hd1) (hd1,gpt8) (hd1,gpt7) (hd1,gpt6) (hd1,gpt5) (hd1,gpt4) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1)

output of ls (hd0,gpt2)/:
syslininux/ vmlinuz.efi inird.lz efi/

content of /media/ubuntu/ba6e9aff-b9b7-4c4f-8441-98db8ec7a08a/boot/grub/grub.cfg:
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ba6e9aff-b9b7-4c4f-8441-98db8ec7a08a' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod ext2
set root='hd2,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd2,gpt3 --hint-efi=hd2,gpt3 --hint-baremetal=ahci2,gpt3  ba6e9aff-b9b7-4c4f-8441-98db8ec7a08a
else
  search --no-floppy --fs-uuid --set=root ba6e9aff-b9b7-4c4f-8441-98db8ec7a08a
fi
linux   /boot/vmlinuz-4.4.0-28-generic.efi.signed root=UUID=ba6e9aff-b9b7-4c4f-8441-98db8ec7a08a ro  quiet splash $vt_handoff
initrd  /boot/initrd.img-4.4.0-28-generic  }

Update:
i reinstalled with grub-install /dev/sdb2 grub into /dev/sdb2 but most grubfiles are still in /dev/sdb3 so grub can't access it because it don't know how to load the ext2.mod. Part of the output was using x86_64-efi arch.
I messed a bit with the rescue console and getting slowly better but I may have found the cause, why it can't access it. The grub rescue mode only acceptes only i386-pc modfiles, but all installed modfiles are x86_64-efi ones.
Comment: It was? I'm glad to hear it, but I suggested various things in chat. Could you please post an answer explaining what you did?
Comment: arrasndly not, I wrote this coment to soon, sure I will
Comment: it was a incomlete EFI implentation, that caused it. I could work around it see answer.
Answer: All this simply because somebody didn't fully implement the UEFI specification.
All you have to do is boot a live system and:
sudo mount -U <UUID of your ESP> /mnt
sudo mkdir /mnt/EFI/BOOT
sudo cp -v /mnt/boot/<your-vendor>/grubx64.efi /mnt/EFI/BOOT/

and then shutdown, remove the live system and reboot.
More info about the path used can be found here.


reluctance of the transformer windings

Question: are the reluctance of both the transformer winding same? if that's so ? how ?
because reluctance =  effective length of wire/ (permeability X area ) , so is this ratio in both the sides always the same?
Comment: Transformer performance is largely affected by "Leakage Reactance" than winding reactance, which one you meant? What you see in equivalent circuit is leakage reactance and has to do with leakage flux.
Answer: I've altered this answer because it was getting down voted and the only reason I can summize is that the embedded picture was too small to read so I've taken the main points and re-written them below.
Windings don't have reluctance - the magnetic core that a transformer (or inductor) is made from has magnetic reluctance. It's a bit like ohms law but for magnetics.

Ohms law is resistance = volts/amp whereas for a magnetic core,
Reluctance = ampere-turn/weber

So if you have 1 amp passing through ten turns producing 1 weber of magnetic flux you have a reluctance of 10 turns per henry. Yes ampere-turns per weber reduce to turns per henry.

because reluctance = effective length of wire/ (permeability X area )

Reluctance is also the length of the core divided by magnetic permeability and area of the core. The only consideration of wire length comes when you make turns
Comment: OK who is this phantom down voter?
Comment: Oh another down vote. Can anyone explain why?
Comment: +1.  Your answer is correct (of course).  Helping null the down votes.
Answer: It seems that you are talking about "Leakage Reactance" as referred to primary and secondary windings of a transformer.
That reactance is actually a fictious reactance and it's formula has "not so easily measurable" parameters cause it deals with leakage flux paths, instead usual practice is to calculate overall reactance of transformer by short circuit test.
And no, leakage reactance as referred to primary and that referred to secondary need not to be equal.

reluctance of the transformer windings


Oops - I added corn sugar at the start of boil, recipe said "add at 10 minutes to go."

Question: First time extract brewer here - I brewed today using a kit with 6.75 lbs of extract and 1 lb of corn sugar. I mistakenly added the corn sugar after adding the extract to 3 gallons of water at the start of the boil. I followed the rest of the receipt: first hops for 60 minutes, then aroma hops at the end of the boil. I cooled the wort and transferred it to a 6.5 gal carboy, added tap water to reach 5 gallons, and pitched the liquid yeast. Curious what the impact is of boiling the sugar for 60 minutes instead of the 10 minutes the recipe called for.  Thanks.
Answer: It shouldn't make a difference, unless you were doing a fairly high gravity beer. The additional solids could affect hop utilization as noted here and reduce the bitterness, but it wouldn't "ruin" your beer either way.
For consistency, if it comes out tasting great you should note in your brew log that you added the sugar at the start of boil, so if you remake the recipe you repeat the same process.
Comment: Thank you! After a slightly nervous evening, I found vigorous fermentation this morning at ~15 hours after pitching. I'm keeping a detailed log to learn from... Have a great weekend folks.
Comment: It really makes no difference at all.  I always add at the beginning of the boil so I don't forget it later.
Comment: With long boil (2, 3 hours) it might add caramel flavor to beer. At 4 hours difference is radical - still, that's my experience with my specific beer.
Answer: Glad to hear it turned out well. The only reason to add the sugar towards the end of the boil is to avoid caramelizatiom and maillard reactions. These are more prevalent when using direct heating methods like stove or burner top boils as the heating is concentrated on the kettle.
This is sometimes done intentionally to give a different flavour profile. Keep brew and tasting notes to see if there's a notable difference if you change it next time.


Using a GridView (XtraGridView) to display contents of a Hashtable

Question: I have many kinds of objects - the design is such that is not practical to create a subclass for every conceivable combination of attributes. Instead, I have a Hashtable called Attributes that holds the data for each one.
I'm trying to display the contents of Attributes in an XtraGridView/GridView. I'd like each of the key/value pairs to appear in a subview. Like so:
+-----------------------------------------+
| Attributes                              |
|     Key1            |  Value1           |
|     Key2            |  Value2           |
|     Key3            |  Value3           |
+-----------------------------------------+
Any way to do this?
Answer: You just have to specify the Hashtable as the GridView's DataSource.
http://forums.asp.net/t/1173224.aspx
Or you can always transform your data into a Datatable object and then pass THAT to the GridView's DataSource.


How do i use my op8 weapons again?

Question: Basically, my friend is op8 and he got me op8 by going to distruct peak and doing all of that stuff you need to do there, then I went on my normal story mode so i could complete it (as i had only done the first few missions) and i was still op8 and everything. After completing it i went onto true vault hunter mode and it wont let me use my op8 guns. Ive looked everywhere on the internet for answers to this but cant find anything anywhere. My friends say i need to change the game mode to op8 but i dont know what theyre going on about because i cant find it anywhere. If you could help it would be appreciated.
Comment: https://gaming.stackexchange.com/questions/162920/what-happened-to-my-op8-weapons duplicate?
Answer: When you finish True Vault Hunter mode it unlocks Ultimate Vault Hunter mode. You must complete Ultimate Vault hunter mode to unlock Overpower Level 1, if you complete Overpower Level 1 it will unlock Overpower Level 2. You must complete Overpower Level 7 in story mode and load Overpower Level 8 to use Overpower Level 8 weapons and gear.

How do i use my op8 weapons again?


Field Equipment: Geneq SXBlue II with iPad and ArcGIS Collector app

Question: My company just recently purchased a Geneq SXBlue II GNSS receiver to be pair with an iPad and the Collector for ArcGIS app.  I have heard great things about the submeter accuracy of the unit; however, the biologists on my team want the ability to see the PDOP per point and want the GPS to only capture the point if it meets a certain PDOP threshold, just like our Trimble GeoXT unit does.  I believe there is an ability to change the PDOP threshold on the GPS receiver, but does anyone have experience with how or if the Collector app lets you know if the threshold has not been met? Does it simply not take the point? Give you a message?
Comment: Duplicate Question? http://gis.stackexchange.com/questions/131022/collector-for-arcgis-pdop-and-gps-collection-configuration-settings
Comment: Looks like GNSS metadata will be supported at 10.4. https://blogs.esri.com/esri/arcgis/2016/05/03/collector-for-arcgis-10-4-beta/
Answer: Currently, Collector GIS doesn't make use of GNSS metadata and it will not report estimated accuracy less than 1 meter.  The SXB2GNSS is only a gps/gnss receiver and provides no control over if a point is taken or not, regardless of PDOP...that is the software's function.  ESRI is, from what I hear, updating Collector to use GNSS metadata (PDOP, etc) to report estimated accuracy below a meter...i.e. submeter.  If you want to be sure your PDOP threshold isn't exceeded, you can use BT GPS app (for Android OS) found at Google Play and/or Lefebure's NTRIP client from their website.  Both are free apps and can run alongside Collector...just have to switch back/forth before each point is taken.  I heard Collector will be updated sometime in March??


Export from Blender to Photoshop with same camera angle

Question: I want to export 3d model from Blender to Photoshop - with same angle and position of camera. I exported as collada and obj, but when I import them in Photoshop, camera is not in same position. How can I export it, to get exactly same scene in Photoshop, as in Blender? Thanks
Answer: Photoshop has its own camera. We cannot import the Blender camera position.
But, you made me think of a solution:
Select the object and so the camera. Make a parentCtrl+P.
Select just the camera.
Go to front view 1.
Now go to View > Align View > Align Active Camera to View.
The camera now has the same position as Photoshop camera and the object has the same view because it is parented to the camera.
Once exported, the object can be opened in Photoshop as you see it in Blender. More or less.
Remember to undo the changes you made in Blender.
Answer: I have never done an export to Photoshop, but in other applications the mess up is because Blender uses Z as the vertical axis while the other application uses the X or Y axis as the vertical. The exporter may have an option to automatically adjust for that. I'm not sure if that is the problem or not. Scale can also be a problem.


Is it possible to determine the location of a phone in relation to another phone (or just get accurate GPS data) based on bluetooth or wifi?

Question: I want to determine the location or the direction of a phone in relation to another phone using wifi or Bluetooth since GPS is not accurate enough indoors. Is this possible? I have tried googling it, but I have not been able to find a sufficient answer.
Thank you for your help!
Comment: It does not seem possible to use wifi or bluetooth to determine location. Wifi doesn't provide anything about location or position of a device (assuming a single wifi router), at best you could get signal strength and try to extrapolate something from there. Bluetooth is similar, you could perhaps check signal strength or measure timing between devices. But interior walls, or human hands holding a device, or appliances, or any number of things make either approach seem unlikely to be useful.
Answer: No, you can't-  you don't get enough data.  Let's say you have 2 phones A and B.  A can broadcast a message over bluetooth (this works the same for any other radio type, including wifi).  The receiver B can determine it's strength when it receives it.  From that and knowing how strong it was when sent, it can know its approximate distance.  So you don't know what direction A is, but you know how far he is.  And that's all you can get. So you know B is in a circlearound A (this isn't 100% accurate as due to signal noise you're actually in a 2d- ring, but lets assume a perfect world here).
Now imagine A is at a fixed point.  Now lets add in phone C, at another fixed point.  If you got a message from A and from C and did the same signal strength math, you now B's distance from A and C.  Two circles, one around A and C.  B will need to be at one of the crossing points-  there will be 2 of them.  You don't know which.
Now add in D.  You now have 3 circles.  All 3 will cross at only 1 point.  That's B's location.  It takes 3 fixed points to find someone.  In museums and other indoor places that do location tracking, you'll see dozens of bluetooth beacons, each with their own id, and you triangulate based on which ones you can see at all and which are closest.
That's finding your location relative to fixed points.  With non-fixed points, to find someone you'd need to become the 3 points yourself.  Imagine B stands still.  A can make a reading.  Then he can move 10 feet away.  Take another reading.  Move 10 feet away (not all in one line).  Now you have 3 readings and can figure out where B is using the same math as above.  Please note that to use this, you have to know very accurately exactly how far and in what directions you moved between the 3 points.  If you don't, you won't get any accuracy.  It doesn't matter what direction you moved, but you need to know that and the distance exactly.
Now if B is moving, that math will be off.  But given the short distances involved it would probably be close enough to find them.
(all this assumes elevation isn't invloved, if it is you need more points).
Now if you're willing to take a hardware based answer-  if you have something on the phone that can block the bluetooth signal and you can adjust physically you could get directionality by blocking it to all but a 30 degree cone, trying to read the signal, and moving the blocker until you can.  Then you know the direction to within 30 degrees and the distance.  But my guess is you're not willing to have them carry lead phone cases :)


get mysql time zone in php

Question: how do i get the srver time zone exept of the date("e") function i need somthing that will check the os time zone and not depends on the php ini and stuff like that...
i need this becouse i need to know the mysql time zone
if i run a query for select global_time_zone i got the result "system" and i need a result like "amrica/new york"
Answer: If it's a linux server you could do
<code>$timezone = file_get_contents('/etc/timezone');
</code>
I don't know of any native php functions that would do this, nor do I really see the point? What's wrong with getting the ini specified timezone (which defaults to the server timezone)?

get mysql time zone in php


how to animate section header of collectionview in tvOS app?

Question:  Need to animate the section header title when the collection cell below the header is focused. Just like if you go to "movies itunes"  app on apple tv and go to top movies tab, if you look at the playlists below, when you scroll through items, the header animates, up and down to not to overlap with focused cell. any help is appreciated tvos screen shot link
Answer: I can't exactly provide the code; but this is basically what you're going to want to do.
1 - Create an intermediary class headingRouter; whose purpose will be to mediate between the scrollView header (collectionView or tableView) and the cell selection. An instance of heading router will live on your collectionView main level methods. You could use a delegate pattern to abstract out the image logic to the router and then on the collectionView; conform to the delegate in order to update the view in question.
2 - Headers and footers are what is called a supplementary view; so they can be assigned any custom subclass of uiView. In this headerView; you should have a method that takes in an identifier, possibly id and changes the image displayed. You can animate this change with a fade if you want it to look like iTunes.
3 - On your focused cell section; have the cells have an identifier that is assigned during the cellForRowAt method in your delegate/datasource methods. When a specific view is focused; using one of the various collection/tableView methods; you want to take that id; pass it to your headingRouter, which in turn will notify your header to change it's image to the corresponding image (possible held in cache) to the image you're focusing.
This is more the logic of implementation; but you haven't posted any code, so there isn't much of the way of specifics. You could do without the Router class but this is a cleaner solution.
Cheers
Comment: thanks for answering this after 3 years of my posting this questions. i have quit that company already and that issue is still there ,;-)


Feynman diagram representation of variational derivative of S-matrix

Question: For quite some time I am struggling to understand section 6.4 in Weinberg volume 1. He observes there that if interaction hamiltonian density is extended by coupling to c-number fields $\epsilon$,
$$ \mathcal H_{\mathrm{int}}(x) \mapsto \mathcal H_{\mathrm{int}}(x) + \epsilon(x) o(x), $$
where $o$ are some operators in the interaction picture then S matrix becomes a functional of $\epsilon$. This functional can be calculated using Feynman rules. That is quite clear. However he then claims that if we calculate variational derivative with respect to $\epsilon$ at $\epsilon=0$ we get sum of terms represented by Feynmann diagrams with only internal lines meeting at $o(x)$ vertices. I don't understand what is the reason for discarding diagrams with external lines flowing into the $o(x)$ vertices. Explicitly, I obtained the formula (which is also written down one page later in Weinberg)
$$ \left. \frac{\delta^r S_{\beta \alpha}[\epsilon]}{\delta \epsilon(y_1)...\delta\epsilon(y_r)} \right|_{\epsilon=0} = \sum_{n=0}^{\infty} (-i)^{n+r} \langle \beta | T \left\{ \prod_{i=1}^n \left[ \int \mathrm d x_i \mathcal H_{\mathrm{int}}(x_i) \right] o(y_1)...o(y_r) \right\} |\alpha \rangle . $$
It seems to me that field operators in $o(y)$ can be contracted with initial and final states, just as these in $\mathcal H_{\mathrm{int}}$. What is the difference here?
Answer: In Feynman diagrams in coordinate representation, external lines are those with one end fixed (i.e. having fixed coordinate which does not take part in integrations) and the other end being internal vertex.
In your formula, if the operators $o(y_i)$ are of one-particle nature (i.e. contain $\Psi$ or $\Psi^+$ but not their products), then you have $r$ external lines starting from $y_1,\ldots,y_r$. See Fig. 1: it is an example for $r=4$, external lines are blue.
When the operators $o(y_i)$ are two-particle (for example, current operators like $\Psi^+\hat{J}\Psi$), we have rather external vertices with coordinates $y_1,\ldots,y_r$, each of them being a source for two external lines (see Fig. 2, external lines are blue).
As for the initial and final states $|\alpha\rangle$ and $\langle\beta|$: if they depend on its own coordinates, this can introduce additional external vertices to the diagram. For example, if $|\alpha\rangle=\Psi(z_\alpha)|0\rangle$, $|\beta\rangle=\Psi(z_\beta)|0\rangle$, you will get additional external vertices with the coordinates $z_\alpha$ and $z_\beta$. If $|\alpha\rangle=\Psi^+(z_\alpha)\Psi(z_\alpha)$, it will correspond to two-particle vertex, and so on.
Comment: If I have a particle in initial state, do I get diagrams with line of initial particle terminating at $o(y)$ vertex?
Comment: If I understood correctly the procedure of further calculations, initial and final states are eventually reduced just to several additional external operators.
For example, if the initial state is a one-particle excited state like $|\alpha\rangle=\int dx\:f(x)\Psi^+(x)|0>$, then we get the "external" $\Psi^+(x)$.
If $o(y)$ is also a one-particle operator, then the pairing $\langle To(y)\Psi^+(x)\rangle$ (corresponding to the line you are talking about) will result in a disconnected diagrams, which are usually cancelled.
Comment: You are right that pairing of $o(y)$ with initial or final state will result in a disconnected diagram, unless we are talking about one particle to vacuum (or vice versa) transition. However, Weinberg explicitly states in his book that he is also considering the case of multi-particle operators. I think these should give genuine contributions to the connected part of $S$-matrix.
Comment: Honestly, I don't understand why do we need to use arbitrary initial and final states $|\alpha\rangle$ and $|\beta\rangle$ instead of averaging over vacuum or Fermi sphere (as in solid state physics) if we already introduced the operators $o(y)$ which can play the same role of external field sources at initial, final or intermediate times. Maybe it is more convenient for further calculations.


Expectation value in terms of Dirac function in Quantum Mechanics

Question: Recently, I started with principles of Quantum Mechanics by R. Shankar, and I got stuck at a part in my calculation of the Expectation value of Position and Momentum operator in the case where the particle is in one of the states. Starting with the Momentum operator, the eigenstates are given by:$$\psi_p(x)=\sqrt\frac{1}{2\pi}e^{i\frac{p}{\hbar}x}$$ Here $\psi_p(x)$ represents the eigenstate for the eigenvalue p, and the $\sqrt\frac{1}{2\pi}$ factor is the normalize the above factor.
In order to find the Expectation value of momentum when the system in in eigenstate $|p\rangle(\psi_p(x)=\langle x|p\rangle)$ where $|p\rangle$ refers to the eigenstate for the eigenvalue $p$.$$\langle P\rangle=\langle \psi|P|\psi\rangle$$ where $|\psi\rangle$ refers the the state of the system and P is the momentum operator(which is $\frac{\hbar}{i}\frac{d}{dx}$). Now If I assume that my particle is in one of the eigenstate $|p\rangle(|\psi\rangle =|p\rangle)$ then the equation for expectation value becomes:$$\langle P\rangle=\langle p|P|p\rangle$$ $$\langle P\rangle=\int_{-\infty}^{\infty}{\int_{-\infty}^{\infty}{\langle p|x\rangle\langle x|P|x'\rangle\langle x'|p\rangle}dxdx'}$$ and we know $\langle P\rangle=\frac{\hbar}{i}\delta'(x-x')$ and thus,  $$\langle P\rangle=\frac{\hbar}{2\pi i}\int_{-\infty}^{\infty}{\int_{-\infty}^{\infty}{e^{-i\frac{p}{\hbar}x}\delta'(x-x')e^{i\frac{p}{\hbar}x'}}dx'dx}$$ $$\langle P\rangle=\frac{p}{2\pi}\int_{-\infty}^{\infty}{e^{-i\frac{p}{\hbar}x}e^{i\frac{p}{\hbar}x}dx}$$ and we can say that:$$\langle P\rangle=p\delta(0)$$ How can the expectation value have direac delta function? Isn't this meaning and infinite amount of momentum? Where am I wrong in my calculations? I tried doing the same with the $X$ operator and failed brutally(It will be helpful If someone can do this calculation.).
Comment: You can shorten the calculation (completely analogous for the position operator, just replace $p\to x$ and $P\to X$). Indeed, formally, you have $\langle p|p^\prime\rangle=\delta(p-p^\prime)$ and $P|p\rangle=p|p\rangle$ and hence $\langle p|P|p\rangle=p\delta(0)$. This last expression is, as you noted, not well-defined. The problem is that objects like $|p\rangle$ are in a strict sense not vectors of the underlying Hilbert space, but they turn out as a useful tool in QM. But you have to follow certain rules to don't run into paradoxes and undefined expressions. This is one of such instances.
Comment: I would like to point out that $\vert p \rangle$ is normalized only in the sense that it has $1$ as completion relation and that $\delta$ is a distribution meaning it cannot be evaluated at a specif point (only integrated on an integral).
Comment: @TobiasFünke So does this mean the we cannot determine the absolute value of momentum doing a measurement?
Answer: The position and momentum observables are both unphysical idealisations of real measurements. In reality a measurement is a result of coupling a system $S$ with a measurement device $M$ in some environment $E$ and is described by some Hamiltonian $H$ that depends on the observables of $S$, $M$ and $E$. There are various kinds of models of such couplings and mathematical techniques for studying the kinds of states that they give rise to, for a survey see
https://arxiv.org/abs/1911.06282
The real states are usually something like Gaussians involving position and momentum and delta functions are an unphysical limit of those real states. As such the delta functions either don't appear at all or they are used as they should be in integrals where they don't give rise to infinite quantities.


Change of duration of stay

Question: My initial travel plan was to stay seven days in Germany, four days in Switzerland and five days in Italy.  I approached the German consulate and secured a visa.
Now due to issues I will be staying only one day in Germany and rest of trip stays the same. Will this create an issue when I try to enter Germany?
Answer: It could be a problem if you are suspected of fraud. If you can document the issues that prompted your change of plans, you are unlikely to have a problem.
If you are very worried and if you have enough time, you can ask to have your visa revoked and apply for a visa from Italy.
Answer: I don't think it will be an issue.
Your visa into Germany gets you into all Schengen countries. Once in the Shengen area, your visa will only be checked again once you leave Shengen area. Security checks do take place at airports (and randomly sometimes on trains or on the street), but only to confirm the person named in the passport and you are the same person. If your visa is in order, and you are not making problems, you will be fine. (About ten days ago I traveled from Hamburg Zurich Barcelona with a non-EU passport holder and we only got checked during boarding in Hamburg)
Business travelers have changes to their agenda regularly and even if you are not traveling for personal reasons, I don't see anyone being bothered.
Before someone points out that Switzerland is not Schengen, yes, I know - but it has special relationship for the free movement of people, not goods.
Best of luck!
Comment: Switzerland is "Schengen", actually, it's the EU it's not part of.
Comment: Apart from that, two remarks: It's true that entering through Germany make things slightly easier but visa holders typically have to answer a few questions at the border. If you are asked where you want to go and for how long, you will therefore have to lie (a bad idea in general) or admit Germany is not your main destination (which may or may not be a problem but makes the lack of systematic border checks moot because the German border guards will evaluate your plans then and there, long before you set foot in Switzerland).
Comment: Secondly, how you look and behave *and the type of visa you have* play a great role. If you are smartly dressed, have a multiple-entry visa (they are intended specifically to offer that kind of flexibility) and many stamps showing you already went in and out of the area without violating the rules, you are exceedingly unlikely to have any problem. A young guy visiting for the first time could face a bit more scrutiny than your average businessman.

Change of duration of stay


Why is it the case that when we try to fit an OLS model to a system with more variables than observations, that the residuals are zero?

Question: I am trying to fit an OLS model to some data, where the number of variables $k$ is greater than the number of observations, $N$. In this case, it is obvious that we will have a infinite amount of solutions for $\hat{\beta} =(X^TX)^{-1}X^TY$. However, I fail to see why the residuals, $Y-X\hat{\beta}$ will be zero for no matter what solution I choose, as long as we are not in the case where there exist NO solutions.
Comment: You are asking why any set $E \subset \mathbb{R}^N$ having more than $N$ vectors must span the entire space. *In general, it does not,* showing that what is "obvious" is not necessarily true. This suggests that you (as well as the three answers appearing so far) are making some unstated assumptions, which must be tantamount to supposing the variables are of maximal rank. (But if $E$ does span, then--this is the very definition of spanning--*any* vector $Y$ can be written as a linear combination of $E$, leaving zero residual.)
Answer: This is the same as when you have more equations than you have unknowns. Imagine you have only 2 observations and two independent variables. This means you are trying to fit a plane to two points. It doesn't matter how those two points are arranged, there exists some plane (actually infinite different planes) that will pass through both of them, hence 0 error (i.e. zero residuals). This same concepts extends to higher dimensions.
This does not mean you can just choose any values for $\beta$, have have to choose the right ones that describe a plane that passes through your points. However there will still be an infinite choice of correct solutions.
If you go down to even fewer dimensions, i.e. one point and one independent variable (assuming an offset), that becomes the problem of fitting a straight line through a single point. Let's say the point is at (1,1) we could fit the line with $\beta_0=0$ and $\beta_1=1$, but we could also fit the line with $\beta_0=2$ and $\beta_1=-1$. We have infinite such choices. However we can't just pick any old values. For example $\beta_0=1$ and $\beta_1=1$ won't pass through the point and so the solution is not valid. But for valid solutions, the error is exactly zero, because the line passes exactly through the point. In higher dimensions just think of a hyperplane passing perfectly through every single point, therefore zero residual.
Answer: This is an example of overfitting. With $k \geq N$ you get a model that has a "perfect" fit to the data, so your predictions are the same as values of dependent variable, and so $y - \hat y = 0$.
Answer: When there are equal or more parameters than observations, you have one or more ways to fit the model perfectly. It simply becomes linear equation system.


When did people first become concerned about mercury in fish?

Question: I can't find any information about the history of mercury in fish as a public health concern. When was it first recognized that fish contain higher levels of mercury than land animals? How long have we had the technology to measure the amount of mercury in fish?
(moved from chemistry.stackexchange.com)
Comment: I find this an interesting question: while it has been known for many years that some fish had dangerous levels of Hg, I think the general public became more aware when a couple of actors J. Piven and Daphne Zuniga actually became symptomatic due to fish consumption. This was in the past 20 years and prior to that I think most people's concern was mild -- the sentiment was, "One will die anyway..." of course, mercury poisoning is an exceptionally bad and protracted way to die and it may only affect quality of life severely without killing a person.
Comment: Prior to the actors there were cases of industrial malpractice in Japan and the awful case of seed that had been deliberately treated with mercury as a fungicide being used instead of for planting to make bread. But while this increased perhaps awareness of Hg as a toxin, people perhaps continued to view levels in fish as a minor concern -- one just needed to avoid acute exposure. Note that dentists to this day use Hg in fillings although they call them "amalgams" or "silver" fillings and argue that mercury is somehow safe when combined with silver and mislead using table salt as an analogy.
Answer: must... not... write  ....  L****Y....
From ScienceDirect,

Investigations into the presence of mercury in food have been carried
  out in a comparatively small number of foods in the UK since 1966.
  There's considerably more info, several articles, at that page.

From  TheOldGreyLady ,possibly paywalled,

Rise in Mercury Is Found In Eaters of Certain Fish By DAVID BIRDJAN.
  January 14, 1971, Page 74 The New York Times Archives The chemist
  whose findings last month led to the recall of mercury‐tainted tuna
  and swordfish reported yesterday that he had found as much as five
  times the mercury in per sons who ate those fish regu larly compared
  with those who did not. [...]His discovery was believed to be the first time
  that high levels of mercury had been found in ocean fish. Before that
  time, only fresh‐water fish in bodies of water polluted mainly by
  industrial waste had been, declared unfit for consumption.

and medscape wanders over to Japan, which had a terrible industrial pollution problem,

In 1961, researchers in Japan correlated elevated urinary mercury
  levels with the features of the previously mysterious Minamata
  disease. Before the etiology of Minamata disease was discovered, it
  plagued the residents around Minamata Bay in Japan with tremors,
  sensory loss, ataxia, and visual field constriction. (See
  Presentation.) 3
Minamata disease is an example of organic toxicity. In Minamata Bay, a
  factory discharged inorganic mercury into the water. The mercury was
  methylated by bacteria and subsequently ingested by fish.

Finally, from a WHO pamphlet, suggesting a start-date for a reasonably reliable test methodology,

The methods summarized in Table I have been selected from a large
  number of publications. They are typical of the various methods
  available for analysis of total mercury and its inorganic or organic
  species. All represent a considerable improvement on the original
  "dithizone" method. This method was widely used up to the introduction
  of atomic absorption in the late 1960s. Basically it involved the
  formation of a coloured complex with dithizone after all the mercury
  in the sample had been converted to Hg++ compounds by oxidation in
  strong acids.

A Paper from 1953  describes that "dithizone" methodology.
Comment: Must...not...ask... "is it LUCKY?"  No. No it's not.
Comment: Wow! You found a lot of stuff that I didn't find. The dithizone methodology is interesting. I'm still a bit curious. Who carried out the investigations in 1966? In December 1970? Who was the first scientist to say "Hey, fish has a lot of mercury in it"? Also confused by the "L****Y" riddle. ... Anyway, thanks for what you put together.


How do I find out of my OS X 10.9.4 is 32 bit or 64 bit?

Question: How do I determine if my OS X 10.9.4 is a 32 bit or 64 bit operating system?
I've looked at "About This Mac" but don't understand what the processor information (i.e. 3.5 GHz Intel Core i7) translates into as refers to "bits.
Answer: I do not believe that Mavericks shipped with a 32-bit version. You are probably running 64-bit OS X.
All of the Core i3, i5, and i7 Mac computers have 64-bit processors.
Apple Support document
To determine if you are running a 32-bit or 64-bit version of OS X, open a Terminal and type:
uname -a
On a 64-bit OS, the output will end with RELEASE_X86_64 x86_64. On a 32-bit OS, the output will end with RELEASE_I386 i386.
OSXDaily article
Comment: Thank you for early (and helpful) response. Could you be so kind as to advise how to "open a terminal"?
Comment: Yes. Open Spotlight (CMD+SPACE) and type "Terminal" and click the little black box icon that appears. It is also known as a "command prompt." Or just open `/Applications/Utilities` and double-click Terminal.
Comment: Awesome...thanks again for the rapid and useful response.
Comment: Glad to help :)
Answer: Easy - it's 64-bit.
Mavericks is 64-bit only :)
Answer: OS X doesn't really have a single overall mode -- it can easily run different components (different processes, the kernel, etc) in different modes. It also has a multi-architecture binary format, so a single program can include both 32- and 64-bit code, and the OS will simply run it in whatever seems to be the most appropriate mode at the moment.
Over the history of OS X, it's gradually morphed from 32-bit only (through 10.2 I think), to fully 32+64-bit capable (10.6), to mostly-64-bit-only (10.8-10.9). Starting in 10.8, Apple removed the 32-bit versions of the kernel and most built-in apps, meaning that it'll only run on 64-bit CPUs. But it's still fully capable of running old 32-bit programs, and there are even a number of system programs that can run in either mode (again, to provide compatibility with old 32-bit software). The most visible example of this is the System Preferences, which normally runs in 64-bit mode, but can quit & relaunch itself in 32-bit mode to run old 32-bit-only preference panes (if you can still find one).
Note that there've never been separate 32- and 64-but versions of OS X. 10.6, for example, would install exactly the same on a 32- or 64-bit computer, and then decide at runtime which mode each program should run in.
Summary: it's not an entirely a meaningful question, but to the extent that it's meaningful Mavericks is a 64-bit OS.


Internal energy + energy of electron

Question: Internal energy of a system composed of molecules or atoms is the mean energy of all these particles in the system (energy as kinetic energy, potential energy etc..). But what I am seeing that we are not taking into consideration the energy levels of electron inside the atom. My question is: Why we are excluding the energy of electrons of atoms (since electrons are part of the atom structure). Hope somebody can clarify it for me
Comment: if you compute it in a chemical reaction with a tool like QFT, all accounts, furhermore if you know the distributions differences of particular states like the electrons levels
Comment: The electron itself has a weak mass 511 keV/c² , the energy levels are of the magnitude of 1/2 to some 10 eV/c². Sometimes, it accounts, but most time not
Comment: but in chemical reaction, it is due to energy levels of electron that light is emitted no?
Comment: yes , it's a matter of electrons levels. Are you particularly thinking to the photochemistry ?
Comment: I am not into chemistry but when we calculate the difference of gibbs free energy of a chemical reaction, do we take into consideration electrons levels ?
Answer: I do not think many people attempt to find the absolute total internal energy of a system.  Rather they will pick and choose what needs to be counted to suit their purposes.  If interested in statistical mechanics then treated atoms as billiard balls which can rotate and vibrate, have translational kinetic energy and potential energy due to the inter atomic forces is good enough.  For ideal gases just stick to the translational (thermal) kinetic energy.
If you are designing a heat engine then microscopic parameters are not need and the internal energy will be quantified via parameters such as temperature, mass, specific heat capacity etc.  When discussing the energy changes for 1 kg of steam I doubt whether the binding energy of the electrons is ever mentioned?

Internal energy + energy of electron


What are all the secret achievements in Paradise Island?

Question: In the game Paradise Island (Paradise Island: Exotic on iOS), what are all the secret achievements?
Comment: So far the only one I've got is `Hot Dogs Fan` - build 15 hot dog stands, and some of the others seem to follow a similar pattern. No idea about the rest though.
Answer: Ok, I've found a decent list, here are the secret achievements. Note that all of the structures must be on the map at once to gain the award (you can't build 14, demolish one, then build another).
Hot Dogs Fan: Build 15 hot dog stands
Simple Solution fan: Build 15 cabins
Trifles Fan: Build 15 gift shops
Spa Salons Fan: Build 10 sunny centers
Mega Party Goer: Build 10 disco
Aristocrat: Build 3 golf clubs
Casinos Fan: Build 5 crystal casinos
Altitude Lover: Build 2 galaxy restaurants
We Remember about the Defender: Build 2 gold defenders
Amusement Park: Build 2 observation wheels
Great Pyramids: Build 3 pyramids
Lord of Excitement: Build 3 pearl casinos
Master of Bowling: Build 3 Bowling clubs
Following the Montgolfier Brothers: Build 3 Ballon launch platforms
The Sun Only: Have all power generated by solar stations, remove all windmills


Is there a version of the Return Times Theorem for Dunford-Schwartz operators?

Question: Bourgain's "Return Times Theorem" establishes that if $(\Omega_{j},\mathcal{F}_{j},\mathbb{P}_{j},T_{j})$ ($j=1,2$) are measure-preserving Dynamical systems (i.e. $(\Omega_{j},\mathcal{F}_{j},\mathbb{P}_{j})$ are probability spaces and $T_{j}:\Omega_{j}\to\Omega_{j}$ are measure-preserving transformations), then for every $p_{1}>1$ and every $X\in L^{p_{1}}_{\mathbb{P}_{1}}$, there exists $\Omega_{1,X}$ (depending only on $X$) with $\mathbb{P}_{1}\Omega_{1,X}=1$ such that, if $p_{2}=p_{1}/(p_{1}-1)$ is the conjugate of $p_{1}$, then for every $Y\in L^{p_{2}}_{\mathbb{P}_{2}}$  and every $(\omega_{1},\omega_{2})\in \Omega_{1,X}\times\Omega_{2}$
$$\frac{1}{n}\sum_{k=0}^{n-1}T_{1}^{k}X(\omega_{1})T_{2}^{k}Y(\omega_{2}) \,\,\,\,\,\,\,\,(1)$$
is convergent, where $T^{k}_{j}Z=Z \circ T^{k}_{j}$ is the $k-$th iterate of the "Koopman" operator $Z\mapsto Z\circ T_{j}$ in $L^{p_{j}}_{\mathbb{P}_{j}}$ (the reason for this pedantic presentation will be cleared below). See for instance this entry of Tao's blog and the references therein for a more detailed discussion.
As indicated by Tao in his post, the Return Times Theorem comes as an answer to a natural question arising from the "automatic" extension of Birkhoff's Ergodic theorem to double recurrence.
Now, Birkhoff's ergodic theorem is a particular instance of the following satement: if $T$ is a positive contraction in $L^p_{\mathbb{P}}$ for every $p\geq 1$ (a positive Dunford-Schwartz operator), then for every $p\geq 1$ and every $Z\in L^{p}_{\mathbb{P}}$
$$\frac{1}{n}\sum_{k=0}^{n-1}T^{k}Z$$
converges $\mathbb{P}-$a.s. The proof of this theorem can be found for instance in the recent book by Eisner et.al.
Question: Is there a version of the Return Times Theorem for (positive) Dunford-Schwartz operators?
In other words. Can we prove the existence of $\Omega_{1,X}$ as above such that (1) holds in $\Omega_{1,X}\times\Omega_{2}$ if we replace $T_{1}$ and $T_{2}$ by positive Dunford-Schwartz operators in the corresponding $L^{p}-$spaces?
Motivation: (Besides natural curiosity) I want to prove that for a certain Dunford-Schwartz operator $T$ and a given $Z\in L^{2}_{\mathbb{P}}$, the averages
$$\frac{1}{n}\sum_{k=0}^{n-1}|T^{k}Z|^{2} \,\,\,\,(2)$$
are $\mathbb{P}-$a.s. convergent. This claim would follow from an affirmative answer to the question by considering $T_{1}=T_{2}=T$ and $Z=X=\bar{Y}$ (the complex conjugate of $Y$).
As a matter of fact, (2) can be proved, using results by Assani, under the assumptions that $T$ and $T^{*}$ preserve the constant function $\mathbf{1}$ (which is actually verified by my particular operator) and that $Z\in L^{p}_{\mathbb{P}}$ for some $p>2$, but I haven't found so far an argument for the case $p=2$ (if you can give one please do so).
Thank you!
Answer: I've heard the following from Michael Lin: both Koopman operators in the return times theorem can be replaced by Dunford--Schwartz operators, see
Çömez, Doğan; Lin, Michael; Olsen, James, Weighted ergodic theorems for mean ergodic (L_{1})-contractions, Trans. Am. Math. Soc. 350, No. 1, 101-117 (1998). ZBL0888.47006.


Pocket hole disaster! What am I doing wrong?

Question: I have two pieces of maple veneer plywood (3/4" thick) that I want to put together with pocket holes (controversial, I know, just hear me out). I have a Mullark pocket hole jig that I am clamping to the wood. I have all the settings right. My problem is that the jig is making a whole mess of the veneer. First, it breaks a lot of the wood, second, the hole cannot fit the regular coarse pocket hole screw inside, and so third, I cannot put in a wood plug in any way it looks good. What am I doing wrong?  Also, my jig works fine with pine.
Answer: I'm not familiar with that jig but did a quick google search to take a look. Is it this one?

First, you need to set the depth on the jig to the thickness of the board. Measure the thickness, don't just go by the named dimensions of the wood, they are often not the same. This will position the hole properly so that the screw head sits below the surface of the panel.
Two, you then will set your stop collar on the drill bit so you drill the proper depth of the hole. Your manual should give you instructions on how to set both depth and the stop collar. Read it.
As far as the tearout, the bit has to be sharp, and make sure you have your drill at full speed and take it slow. Might do well to put some painters tape on the surface of the panel to help with tear out. If you do this, be sure to set the depth with the tape in place.
Practice all of this on some scrap wood to get the setup correct.
Comment: Yes, that's the one! I noticed that, if I put one screw through the pocket hole, it doesn't come out right in the middle of the board but higher, which suggests the drill bit is not going deep enough, which would exain why the screw just sits on the edge and doesn't really go in the "pocket". My bit may not be sharp enough. Thank you so much for your help!
Comment: The depth of the drill bit will affect whether the screw head goes below the surface of the board. The thickness which you set on the jig will affect where the screw comes out of on the other side. Always use test pieces to make sure everything is set up right before you do anything with the actual pieces.
Comment: Clamp the jig to the edge of the board first so that you can see where the bit will travel through the board.  Then set the collar on the bit to stop it where it needs to.  The tearing of the veneer looks to me like your drill is too slow.


Is it anti-pattern to alter domain model on front end?

Question: We are making a quiz application, I'm trying to integrate my Angular 2 UI with the REST api.
Our Quiz domain model consist of the following (simplified) hierarchy:

Quiz
Category
Question
Choice

where parent doesn't know it's children, but child knows it's parent. For example, Choice has a reference for a Question, but Question doesn't have reference to choice. We chose this approach to be able to fetch the quiz data more flexible and modular approach, also avoiding circular references.
However, in front end it's counter-intuitive to use inverted linking, as views are built naturally layer-by-layer iterating deeper in the domain object structure. It makes sense to render view for Question first, and render sub-view for Choices after. It just seems impossible with the current domain model, where I should start from Choice.
My question is, if it's common or approved to convert the domain model on the front end, so I wold gather all data and add Choice reference to Question afterwards, making the model compatible for top-down approach? And of course convert it back when POSTing to REST api.
Does this indicate bad design, or is it approved to alter the domain model?
Comment: This question is not suitable for SO. Perhaps you might try to ask some moderator to move it to [programmers.SE](http://programmers.stackexchange.com/help/on-topic).
Answer: It's not "convert domain model on front-end" because your front-end is not playing with domain model. It's playing with Data Transfer Object (json object returned from calling server API in this case). So feel free to do everything you want with DTO on client.


Is a shared Google Photos album publicly searchable?

Question: I'd like to share a Google Photos album only with one person and allow them to view and edit the album, but I do NOT want the album or any photos to come up in search results. I saw that the only way to share an album results in generating a publicly accessible link. Does this action also result in the photos and/or the album being searchable by the public?
Comment: This question has been bumped by Community user 15 times. While the link might be helpful, questions should be self-contained. On the other hand, the question is based on an unreliable source. It doesn't quote official documentation or include information about what supports their claim.
Answer: It depends on how you share it. If you share it with one person (or more people) like this than not:

If you will share it via links on the bottom then it's kind of public:
Comment: Don't think this answers the question. "It's kind of public." But is it searchable?
Comment: if you mean if it's searchable via googling it - it's not. but if you tweet it then that tweet could be searched.
Comment: @MikeEng, in the second case, anyone, including search engines, can follow the generated URL and see the album. The last time I checked though, Google deliberately refrains from indexing the photos.


Mastercard Black travel Insurance in UK

Question: My mother in law is traveling to the UK (Britain and Scotland) and bought her ticket using a master card black. I know this means she is covered by the master card black insurance. Will this be enough to enter to the UK?
Comment: What do you mean by "enough"?  As far as I know, one can legally enter the UK without any travel insurance at all.
Answer: There are no restrictions to entering the uk without travel or medical insurance.
The uk health system will treat any emergency without question, but US national are not entitled to full free treatment (unlike eu citizens, with which there is a reciprocal agreement), so the hospital, or gp would may be seeking payment for the services given, especially if you are admitted to hospital.  The nhs website says
If you are taken to A&E (accident and emergency department), a minor injuries unit or walk-in centre for emergency treatment then this is free of charge. However, if you are admitted to hospital for any other emergency treatment a charge may be incurred. You should not go to A&E for non-emergencies, but see a GP instead.
But treatment for emergencies would not be denied just because you don't have insurance, but ongoing would be charged
Having said that, because the uk has a national health service any treatment would be given at cost, there is no profit motive.  This doesn't mean that it would be cheap however.
I would say that for any international travel good insurance is important, especially as things like medevac back to your home country following and accident would be expensive.
MasterCard black insurance should be sufficient
http://www.mastercard.com/tt/personal/es/findacard/CreditCard/black_card.html
But remember most travel insurance won't cover an existing condition, so check with them for any exclusions

Mastercard Black travel Insurance in UK


Using Convolution Theorem to find the Laplace transform

Question: In previous questions I have used Laplace transform to find the inverse Laplace transform.
I have worked through this work booklet (http://www3.ul.ie/~mlc/support/Loughborough%20website/chap20/20_6.pdf ) and understand convolution theorem.However, this question threw me off perhaps the particular layout is the problem.
Part A which I understand how to was
$$
f(t) =
\begin{cases}
2 & \text{ } 0 \leq t < T  \\
1       &  t  \geq T
\end{cases}
$$
Part B however I dont understand
I know the convolution theorem is
$$ \int^t_0 f(t-x)g(x)\ dx =$$
But how to apply that to
Use convolution theorem to find the Laplace transform of
$$ \int^t_0 du f_T(t-u)f_s (u), t>0 $$
where fs(t) is the function in (1) replaced with T replaced by S
Answer: The LT of a convolution of two functions is the product of the individual LTs.  If you recall, we found that
$$\hat{f_T}(p) = \frac{2 - e^{-p T}}{p}$$
Thus, the LT of the above convolution is simply
$$\hat{h_{S*T}}(p) = \left ( \frac{2 - e^{-p S}}{p} \right )\left ( \frac{2 - e^{-p T}}{p} \right )$$
Comment: so essentially what
 $$ \int^t_0 du f_T(t-u)f_s (u), t>0 $$ means is

to find the Laplace transform using convolution

We find the laplace transform using the previous method and then we multiply the laplace transform by itself but replacing t by s for the first function ?
Comment: @SF: that is the long and short of it.
Comment: do I need to evaluate

$$\hat{h_{S*T}}(p) = \left ( \frac{2 - e^{-p S}}{p} \right )\left ( \frac{2 - e^{-p T}}{p} \right )$$

between 0 and t ?

in my workbook we would replace the first t with (t-x) and the 2nd t with x . that does not apply in this case
Comment: @SF: No, this is the transform.  An interesting exercise is to actually evaluate that convolution - it is not trivial so far as I can see.  But you were asked to find the transform which, as I showed, is rather straightforward.


The Concept of Instantaneous Velocity

Question: The concept of instantaneous velocity really becomes counter-intuitive to me when I really think deeply about it. Instantaneous velocity is the velocity of something at an instant of time; however, at the very next instant the velocity changes. In general, speed tells us how quickly something is changing its position with respect to some point in space. Then by instantaneous velocity we mean that the object at some instant is changing its position with respect to time, but may change to a velocity much faster. But if it is changing its position with that rate then the time passes by and that instant as well and at another instant the velocity is different. Did it even move with that velocity for a moment? I'm sorry that I'm not exactly able to tell you what my problem is; however, it is something like I've described.
Comment: Do you understand what the derivate is? And wrt. _But if it is changing its position with that rate then the time passes by and that instant as well and at another instant the velocity is different._ velocity can be constant.
Comment: http://en.wikipedia.org/wiki/Calculus and http://en.wikipedia.org/wiki/Differential_calculus
Comment: I do, but that does not seem to help me much.
Answer:
Instantaneous speed is the speed of something at an instant of time...

It may not be productive to think of instantaneous speed in this way.  The concept of instantaneous speed should be no more difficult to grasp than the concept of instantaneous slope which is to say that it is to be understood in the context of limits.
Recall that, in words, the instantaneous slope of a curve at a point is the slope of the line tangent to the curve at that point.  This slope is just the limit of the average slope of the curve as the displacement from that point goes to zero.
Now, if we measure a particle's position at one instant and at another later instant, the average speed is just the ratio of the change in position to the change in time:
$$\bar v = \dfrac{\Delta x}{\Delta t}$$
Now, imagine taking the position measurements closer and closer together in time.  Assuming the limit exists, the instantaneous speed is simply the limit of the average speed as the time between position measurements goes to zero.
Answer: Maybe it helps to change your perspective. Consider a record spining on a record table with constant rotational speed, and you note that at some time the part of the record under the needle has speed $\vec{v}_A$ where A is the location of the needle. Now some time later the same part of the record has different speed because it is located elsewhere, but under the needle the speed is still $\vec{v}_A$ (with a different part of the record being observed).
So when the body (record) goes through constant motion the spatial velocity (velocity at any fixed point in space) is constant also. The instantaneous velocity reflects the velocity of whatever part you are observing (in our case point A).
Now the non-constant speed case. Again at any instant the spatial velocity is some value of time $\vec{v}_A(t)$. Since the point of observation is fixed in space (and time) the instantaneous velocity is well defined. The time derivative $\dot{\vec{v}_A}$ is called the spatial acceleration which is different from the material acceleration (the acceleration of a point on the moving body). When the rotational acceleration is zero so is the spatial acceleration. The instananeous velocity is constant in this case. In general the instanteneous velocity although varies, it always answers the question what is the speed of rigid body under an observation point.
As a side note, at any instant, if you observe the instanteneous velocity to be $\vec{v}_A$ under a point located at $\vec{r}_A$, and the body is rotating with $\vec{\omega}$ then the instant center of rotation is located at
$$\vec{r}_{cen} = \vec{r}_A + \frac{\vec{\omega} \times \vec{v}_A}{|\vec{v}_A|^2} $$
where $\times$ is the vector cross product, and $|\cdot|$ is the magnitude of a vector. The instant center of rotation is the point in space (actually a line) with either zero velocity, or velocity that is only parallel to the rotation axis.
Example
A record is rotating with $\vec{\omega} = 10 \hat{k}$, and I observe the speed under the needle located at $\vec{r}_A = (4.5, 1.2, 0)$ as $\vec{v}_A = (8.4,4.7,0)$ where is the center of rotation of the record (or frisby!)
$$\vec{r}_{cen} = (4.5,1.2,0) + \frac{ (0,0,10) \times (8.4,4.7,0) }{|(0,0,10)|^2}
\\ = (4.5,1.2,0) + \frac{ (-47,84,0) }{100} = (4.03, 2.04, 0) $$
Verification
In the problem above check the instantenous velocity at A.
$$\vec{v}_A = \vec{\omega} \times (\vec{r}_A - \vec{r}_{cen}) \\
 = (0,0,10) \times (0.47, -0.84, 0) = (8.4, 4.7, 0) \; \checkmark$$
Answer: Anything that changes in speed will do so as a result of momentum transfer into the object. This requires some interaction with other forces. Force fields are the source of momentum transfer, this transfer takes some time, thus we get acceleration.

The Concept of Instantaneous Velocity


how to add gaze input timer to trigger an action after gazing for 3secs?

Question: I am new to unity and VR. I have been using google cardboard SDK to create VR apps in unity and am stuck at gazetimer. I want to trigger an action only if the user looks at any object for 3secs but have not been able to do so. Please help
Comment: generally use Invoke and InvokeRepeating for timers in Unity.  go to forum.unity3d or gamedev for general discussions on technique.
Answer: Please see a similar question and answer here Use Gaze Input duration to select UI text in Google Cardboard
In summary, create a script to time the gaze, by cumulatively adding Time.deltaTime on each frame when the object is gazed at. When gaze time hits a pre-specified duration, trigger the button's OnClick event.
On the object, activate the script's gaze timing functions using event triggers Pointer Enter and Pointer Exit. See screenshot:
Answer: VR Camera usually contains a main camera and eye cameras (right and left).  Since Main camera's center point will always be the center of the eyes of the user's point of view, you could use Raycast from its transform.position to its transform.forward and check whether it hits your object. Then simply add a timer which will call the action after it reaches the duration you have set.
For example:
using UnityEngine;
using System;

[RequireComponent(typeof(Collider))]
public class LookableObject : MonoBehaviour {

    [SerializeField]
    Transform cam; // This is the main camera.
    // You can alternately use Camera.main if you've tagged it as MainCamera

    [SerializeField]
    float gazeDuration; // How long it should be gazed to trigger the action

    public Action OnGazeAction; // Your object's action after being gazed

    Collider gazeArea; // Your object's collider

    float timer; // Gaze timer

    public void Start () {
        gazeArea = GetComponent<Collider> ();
    }

    public void Update () {
        RaycastHit hit;

        if (Physics.Raycast (cam.position, cam.forward, out hit, 1000f)) {
            if (hit.collider == gazeArea) {

                timer += Time.deltaTime;

                if (timer >= gazeDuration) {
                    if (OnGazeAction != null)
                        OnGazeAction ();
                }

            } else {
                timer = 0f;
            }
        } else {
            timer = 0f;
        }
    }
}

Hope you get the idea.
Comment: this is a terrible approach. if you have 100 objects in the scene they will do 100 raycasts per frame. You can at least attach Physics Raycaster to the main camera and do hit checking every frame. But this is exactly what Cardboard SDK's GazeInputModule does. I came here because I need to tweak GazeInputModule so that it sends OnPointerXXX commands to objects after timed gaze. No luck so far...
Comment: @NikaKasradze This was just an example of using raycast. I would suggest to attach the raycast only on one script on your camera, then call the delegate from the hit object, therefore only 1 raycast per frame. But yes I think my sample seems a bit misleading here... will update my answer later.


Silver Mark Translation Help

Question: I have several silver cups that I recently purchased. The seller said they were brought back to the US during the Korean war, most likely in the mid 20th century. I was told that the mark is most likely hanja. I would like to learn more about the history of these pieces and any help translating the mark would be greatly appreciated.
Comment: It's written in 초서(草書), or cursive Hanja. There are few people who can read it in Korea nowadays.

The first character is 長. You'll get a more accurate answer if you post it on a chinese language forum.
Comment: I think only those professors researching old Korean history could read this... Koreans don't write or read hanja that much anymore.
Answer: This isn't Korean, it's Japanese. The characters are 「長翁齋・장옹재」 , pointing to the given name of an Edo Period Japanese metalsmith/artisan named 「鈴木長翁齋」 (Japanese: 「鈴木長翁斎」, Suzuki Chō'ōsai).
If you Google image search "鈴木長翁斎", you can see some of his silverwork (and his son's work, who is self-styled as Chō'ōsai the Second, 「長二齋」 or 「二代鈴木長翁齋」). For example,

Silver Mark Translation Help


Descriptor conversion problem

Question: CRSAPublicKey* publicKey;

const CRSAPublicKey &iRSAPublicKey= *publicKey;

iEncryptor = CRSAPKCS1v15Encryptor::NewL(iRSAPublicKey);

My problem is on the second line, because I have to pass a reference to function, for that I am creating reference from pointer.
I don't know whether I am doing this right or wrong. First line compiles but on second line it crashes.
Answer: If you need to pass a rfeference to a function, there is no need to create an intermediate named value:
CRSAPublicKey* publicKey = .... // initialise pointer somehow

iEncryptor = CRSAPKCS1v15Encryptor::NewL( * publickey );

Answer: You are declaring the publicKey variable but you never initialize it. Using an uninitialized pointer leads easily to KERN-EXEC 3.
Answer: to avoid confusion, you should only prefix member variables with i. Its important as it allows you to ensure that you destroy them in an appropriate fashion (i.e. in the destructor rather than the clean up stack).
On topic, your first line of code should be something loosely along the lines of:
CRSAPublicKey* publicKey=CRSAPublicKey::NewLC();

Descriptor conversion problem


Whats the difference between MAC vs hash

Question: What is the difference between the two algorithms?
One difference that I know of, is that MAC is keyed and hash is not.
Comment: The same question is also on Stackoverflow: [What is the Difference between a Hash and MAC (Message Authentication code)?](https://stackoverflow.com/questions/2836100/what-is-the-difference-between-a-hash-and-mac-message-authentication-code)
Answer: A cryptographic hash function is a completely public, deterministic hash function which everybody can compute over arbitrary inputs. It takes as input a sequence of bits (any sequence of bits; some hash functions are formally limited to inputs of, say, less 264 bits, aka "2 millions of terabytes") and outputs values in a rather small space, typically a sequence of bits with a fixed size (e.g. always 160 bits with the standard hash function SHA-1). Good cryptographic hash functions respect some conditions which boil down to, informally, that they mix input data so thoroughly that we cannot figure it out afterwards.
A message authentication code is an algorithm which takes as input a message and a secret key and produces a fixed-sized output which can be later on verified to match the message; the verification also requires the same secret key. Contrary to hash functions where everything is known and attackers are fighting against mathematics, MAC make sense in models where there are entities with knowledge of a secret. What we expect from a good MAC is unforgeability: it should be infeasible to compute a pair message+MAC value which successfully verifies with a given key K without knowing K exactly and in its entirety.
Hash functions and MAC are thus distinct kind of algorithms with distinct properties and used in really distinct situations.
Some MAC algorithms (but certainly not all of them) can be thought of as "hash functions with a key" but this is a restrictive view. HMAC is a well-known MAC construction, which itself builds on an underlying hash function in a smart way. Indeed, security properties and models for hash functions and MAC are sufficiently distinct from each other that slapping a hash function and a key together does not necessarily yield a secure MAC, even if the hash function is secure (see the length extension attack which illustrates that point).
To some extent, we can state that a MAC algorithm which can operate securely without an IV must exhibit some hash-like properties (that's the reason I like HMAC: without an IV, it is much harder to get it wrong when implementing it). However, the Devil is in the details.
Comment: As you mentioned, a hash function can form the basis for a MAC. Block ciphers are the other building block of MACs and are called a CBC-MAC. The blocker cipher used in these functions can differ between implementations--DES, AES, etc.
Answer: They are two totally different primitives.  A MAC is used for message authentication, and is a symmetrically keyed primitive.  A hash function can be used for many purposes, and has no special key input.  MAC is an acronym of "message authentication code".
Don't be confused by the fact that some MAC algorithms (e.g., SHA1-HMAC) work by using a hash function as a subroutine.  They're very different beasts.

Some examples of MAC algorithms: CMAC, SHA1-HMAC, MD5-HMAC, UMAC, Poly1305-AES.
Some examples of cryptographic hash functions: SHA256, SHA1, MD5.
Comment: HMAC is one of the algorithms which allows us  to calculate MAC.
Answer: To make it simple: usually a MAC is a Hash value encrypted with a secret key.
For example, attackers can forge message and calculate a new hash, but he can't do so if the system requires hash to be encrypted with a secret key.
Comment: This answer is not accurate.  This is not a helpful way to think about a MAC, nor is it typically how a MAC algorithm works.
Comment: I don't know that that's the best way of looking at it.  I don't think there's much of a distinction between integrity vs authenticity, when we're dealing with an active attacker who might modify messages transmitted.  As for calling it "encryption", that is highly misleading and I strongly encourage you to avoid using that terminology: it does not correspond to how cryptographers talk, and in my experience, it often misleads inexperienced listeners.
Comment: Hash is used to ensure message integrity, MAC is used for both integrity and authenticy.
Most MAC alghoritms - is a combination of hash function with a secret key, which I call for simplicity "encryption" of hash value with a key
http://en.wikipedia.org/wiki/File:MAC.svg
Comment: MACs are rarely constructed by encrypting a hash. For many types of encryption that'd be very weak. For example it'd suck with stream ciphers. It'd require a 256 bit hash and a 256 bit block cipher to be as secure as a normal 128 bit MAC.
Comment: @D.W. can you please advise a book with proper terminology and information on how to avoid the situation when "an active attacker might modify messages transmitted"?
Answer: Found this to the point answer from another forum.
These types of cryptographic primitive can be distinguished by the security goals they fulfill (in the simple protocol of "appending to a message"):
Integrity: Can the recipient be confident that the message has not been accidentally modified?
Authentication: Can the recipient be confident that the message originates from the sender?
Non-repudiation: If the recipient passes the message and the proof to a third party, can the third party be confident that the message originated from the sender? (Please note that I am talking about non-repudiation in the cryptographic sense, not in the legal sense.)
Also important is this question:
Keys: Does the primitive require a shared secret key, or public-private keypairs?
I think the short answer is best explained with a table:
<code>Cryptographic primitive | Hash |    MAC    | Digital
Security Goal           |      |           | signature
------------------------+------+-----------+-------------
Integrity               |  Yes |    Yes    |   Yes
Authentication          |  No  |    Yes    |   Yes
Non-repudiation         |  No  |    No     |   Yes
------------------------+------+-----------+-------------
Kind of keys            | none | symmetric | asymmetric
                        |      |    keys   |    keys
</code>
Please remember that authentication without confidence in the keys used is useless. For digital signatures, a recipient must be confident that the verification key actually belongs to the sender. For MACs, a recipient must be confident that the shared symmetric key has only been shared with the sender.
Click here for more info
Comment: Please provide a link to where this answer came from.
Comment: Some other people now have changed these definitions: a hash function does not provide integrity, while authentication is what we now call integrity (cf. crypto.stanford.edu/~dabo/cryptobook ). This change is for the best imo


Want to move windows sharepoint services 2 database from sql server 2005 to sql server 2008

Question: I Want to move windows sharepoint services 2 database which is currently running on sql server 2005 (Same server for WSS and sql server) to a separate Sql Server 2008 r2 (Clustered servers). The database has been copied, renamed and set up on a new clustered sql server 2008R2 server. It is running ok. It is the Windows SharePoint Services side that I need advice in what do I need to change on the IIS/SharePoint side to get my SharePoint Web site to work with the database on the 2008R2 clustered server.
Answer: Yes, it is entirely possible to move a database from SQL 2005 to 2008 and you have a number of options on how to do this:

Detach, move and then attach the database files
Perform a backup and restore from the old server to the new
Use the copy database wizard on SQL 2008 to pull the database across from SQL 2005


Where does 나름 come from?

Question: The word 나름, as in ~기 나름이다 or 나름대로, appears to be formed by nominalizing 나르다. Is this the correct etymology or does 나름 come from something else?
Comment: I don't know the correct etymology but as far as I know, 나르다 has nothing to do with 나름.
Answer: The bound noun 나름 has been used for at least a century. Nonetheless, Korean dictionaries and several books I consult provide no etymology for it, which means either or all of the following:

나름 has always been 나름 from the beginning (No characters have changed).
나름 is originally a nominalization of the verb 나르다.

According to the standard dictionary, 나르다 was 나ᄅᆞ다 in the early 17th century; however, I could not find 나ᄅᆞᆷ in old documents. If it is true that 나ᄅᆞᆷ never existed (In other words, if Number 1 is true), it means that 나름 was formed after 나ᄅᆞ다 had become 나르다. Considering that the nominalizing suffix -ㅁ was used even in the 15th century (그림 is an example), it is practically impossible for me to say when people started using 나름 as either a nominalization or a bound noun.
For Number 2, this is part of the guidelines for compiling the standard dictionary:

... 표제어가 크게 형태적 변화를 겪은 경우에 어원적 분석을 제시하되, 다음과 같은 경우는 원칙적으로 어원적 분석을 하지 않는다.
가) 용언이 포함된 복합어에서 용언의 활용형을 어간과 어미(또는 접사)로 분석하여 어원 정보로 제시하지 않는다. 어미 '-(으)ㅁ'이 결합되어 형성된 명사의 경우나 '용언의 활용형+(보조)용언'의 구성을 갖는 합성동사의 경우가 그것이다. ...

Briefly, it says that in principle, they do not analyze etymologically the headword that is a noun made from a verb/adjective stem + -(으)ㅁ. Because some other bound nouns (for example, 두름) are originally nominalizations (두르- (the stem of 두르다) + -ㅁ = 두름), I believe that 나름 can be explained as 나르- + -ㅁ.
You might think that 나름 does not relate semantically to 나르다. Then, you should also think about how far 두르다 and 두름 are. There is a reason I mentioned the two terms: bound nouns and nominalizations. If bound nouns were not different in meaning or usage from nominalizations, why would lexicographers have listed bound nouns? There must be differences.
If we consider the nominalization 나름 and some nouns containing 운(運), such as 운반 and 수운, we can say that 나름 and 운(運) have the same primary meaning. Although 운 alone means luck (when it is used as a whole word), it originally means carrying (Regarding why 運 means luck, please refer to this). When 운길 means 물건을 운반하는 길, it is a synonym for 나름길, the compound of 나름 and 길. What I would like to say is that like 운(運), 나름 can have a meaning that is different from the primary meaning and may not be easily understood.
The nominalization 나름 (carrying) refers to an action, then it is natural to think about the method, environment, or result, which leads to the bound noun 나름. It is defined as follows:

A bound noun used to indicate that something depends on the extent or shape of something else or how something else is done.

A bound noun used to refer to one's unique way of doing something, or his/her personality or situation.

Haven't you noticed that carrying something means doing something or having something here? I think it makes quite a bit of sense. Coincidence or not, English sentences like "I carried out the task," and "These procedures carry no risk," also say that carry can sometimes be understood as to do or to have. I am not saying that what I have said is the correct etymology (Actually, who knows?) but that you can understand the meanings of the bound noun 나름 in this way.

Where does 나름 come from?


Default values for panelizer and fieldable panel panes

Question: I have a template being applied to a node with a few different fieldable panel panes on it. I can create a new piece of content and it's page will load with the template applied and all of the FPP's right where they should be.
Say I make 10 pieces of content and they all have that same template. If I go to one of them and add something to an FPP on it and then save as custom that FPP will be modified the same way on all 10 pages. If I use the inline editor and remove the panel with content, save as custom, and then add that panel back it will be empty.
If I have a blank panels template and go to all 10 pages one at a time and add the FPPs to them and save them each as custom then the FPPs will stay unique.
I need to be able to load the complete template with the content panes already there but have them all be empty when the page is initially made.
Is there anyway to assign a panel a default value of nothing?
Answer: The methods hook_entity_insert() / hook_entity_update() don't check whether an entity has dedicated panelizer settings or not and just always saves the panelizer object found for it. Which can be the defaults of course.
The attached patch looks worse than it actually is. It basically introduces the property entity_custom_panelizer which indicates if a panelizer setting is dedicated to the entity or not.
And the hooks hook_entity_insert() / hook_entity_update() only save the settings into the panelizer_entity if the flag is set.
I really hope I didn't miss something but first smoke-tests look promising.