I want merge two object by id with java script, but i don't know how  var personData = {     person1 : {         uid: 112233,         city: "esfahan",         postalCode: 2345672345,         phoneNumber: "03111234234",         position: "ui designer"     }}  var additionalPersonData = {     person12: {         uid: 112233,         firstName: "reza",         lastName: "hosseini"     }}      So that the output should look like:   result = [  {   uid: 112233,   firstName: "reza",   lastName: "hosseini"   city: "isfahan",   postalCode: 2345672345,   phoneNumber: "03111234234",   position: "ui designer" }]
I need to be able to merge two (very simple) JavaScript objects at runtime.  For example I'd like to:  var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' }  obj1.merge(obj2);  //obj1 now has three properties: food, car, and animal   Does anyone have a script for this or know of a built in way to do this?  I do not need recursion, and I do not need to merge functions, just methods on flat objects.
I'm looking into the technique of 'hanging' meat, and whether there are 'home' applications that would be safe and have a beneficial effect.  Now, there are a lot of (possible) synonyms that muddle the waters (for me). There's hanging, dry-aging, faisandage (for game birds), and more. What I'm looking for is the 1-3 day (near) room-temperature storage of meat and the spoiling / enzyme process that will cause a flavor change. Feel free to help me along by clarifying the answer.  Basically:   Is there any (good) use for this technique / process for supermarket / butcher cuts of meat? What should be taken in consideration for safe execution? How to use AT commands in Android by 'root' the phone We have various Android devices from Spike, Samsung, Micromax, etc. How can we issue AT commands from Android to the modem? We searched in Google Play but did not find any app related to this.   suggests:     [F]irst you have to root the phone...`    How can we do this? What's the best solution to check a users country? Who owns R2-D2 & C-3PO in the Prequel trilogy? Is there any concrete evidence that Anakin officially owned R2-D2 or C-3PO?  I found this episode of Star Wars: Clone Wars that shows it, but it's fairly vague... How do I set an environment variable on the command line and have it appear in commands? If I run  export TEST=foo echo $TEST   It outputs foo.  If I run  TEST=foo echo $TEST   It does not. How can I get this functionality without using export or a script? Regex matches but shouldn't Why don't Muggle-born wizards use Muggle technology to fight Death Eaters? How is the "charge on a capacitor" defined when two plates are unequally charged? In Concepts of Physics by Dr.. H.C.Verma, in the chapter on "Capacitors", in page 144, under the topic "Capacitor and Capacitance" the following statement is given:     A combination of two conductors placed close to each other is called a capacitor. One of the conductors is given a positive charge and the other is given an equal negative charge. The conductor with the positive charge is called the positive plate and the other is called the negative plate. The charge on the positive plate is called the charge on the capacitor …   Note that the term charge on a capacitor does not mean the total charge given to the capacitor.   (Emphasis mine)  According to the above statement, "the charge on the capacitor" is the charge on the positive plate when both positive and negative plates of a capacitor are equally charged? How to extend this definition when the two plates are unequally charged?   Suppose we supply charges $+Q_1$ and $-Q_2$ to the positive and the negative plates respectively. After electrostatic conditions are attained, I determined the charge distribution on the four surfaces - outer surfaces and inner surfaces of the two plates. The charge on the outer surfaces of the two plates are equal to $\frac{Q_1-Q_2}{2}$. The magnitude of charge on the inner surface of the two plates is $\frac{Q_1+Q_2}{2}$.   Now coming to my doubt, if the "charge on the capacitor" is the charge on the positive plate, which surface of the positive plate should I want to consider - the outer one or the inner one? And what is the reason for this choice? It seems to me that, a capacitor with unequal charges on its plates is not a capacitor in the first place (inferred from the statement above). How do I split a string, breaking at a particular character? How can I make Windows Paint save by default as JPEG format? Every time I want to save an image I've pasted into the  application, it chooses a BMP/DIB format (which is the worst for saving things from the clipboard).  How can I hack Paint into defaulting to the JPEG format when saving images?  I am using Windows XP SP3 and Paint 5.1 at the moment. I hope though that any hacks might be generic and I'd be able to use them across all my Windows machines. How to keep VLC player in minimized mode? I'm using VLC media player which can play almost all kinds of audio and video formats. While listening to audio, I keep VLC in minimized mode and can work on other windows. But when I select to listen video songs mixing with audio songs, VLC is maximizing itself to play every video song in the playing list, which is really annoying in the middle of work.  So how can I keep always VLC player in minimized mode while playing a list of songs mixed with audio and video songs? Creating a gradient-based legend I have a map with graduated symbology, with 328 unique values. I would like to add a legend to my map (as in the picture), illustrating that light blue indicates low values and dark blue high values.  I have done this in ArcGIS before. Is there a way to do this in QGIS as well? Unicoin Bug: Automining Returns Diminishing I'm using the auto-mining script from one of the meta posts here and it doesn't works!  At first I got steady returns but the returns seem to diminish over time. Using Fiddler I confirmed that the server seems to release less and less coins.  This is unacceptable! I am a loyal customer paying nothing and I demand that my auto-mining script continues to yield returns forever!  If you cannot deliver on that please refund what I have payed for using this site.  Plz advise!    In case you didn't notice: This is a parody of over-demanding, leeching askers on Stack Overflow. From time to time certain chat rooms (JavaScript and probably PHP, too) attract the attention of a fellow help vampire who thinks he can start sucking from the people in there.  Often their message end up being flagged as offensive (and those flags are likely to be validated, too, because people are annoyed by such behaviour) but it's kind of an inappropriate use of those flags.  I'm proposing a new chat flag type, which is especially meant for help vampires. Flagging it would present the flag to 10k users and owners of the room where the flag originated (no matter how much rep they have). When the flag is validated it would cause messages from this user to be shown with a low opacity for maybe three hours. It could also notify the user that help vampirism is a bad thing and that he needs to improve his behaviour.  Repeated flags of this type - obviously with some time in between in case multiple message which are really part of the same conversation are flagged - should then result in a temporary ban from the room where the messages got flagged. If that doesn't help the next step would probably be a temporary ban from all chat rooms.    For clarification, I'm not talking about the quick "this line doesn't work, why?" stuff but the kind of help vampires who get cocky even though they just got e.g. a link to a SO question which has a perfectly fine and fitting answer. Because hey, you didn't give them teh codez! I was wondering what the cardinality of the set of all real sequences is. A random search through this site says that it is equal to the cardinality of the real numbers. This is very surprising to me, since the cardinality of all rational sequences is the same as the cardinality of reals, and it seemed fairly intuitive to me that if cardinality of a set $A$ is strictly greater than the cardinality of the set $B$, then cardinality of $A^{\mathbb{N}}$ should be strictly greater than cardinality of $B^{\mathbb{N}}$. It turns out to be false.  Some technical answers have appeared in this forum elsewhere but I do not understand them. As I am not an expert in this topic, could some one explain me in simple terms why this is happening?  Also is the cardinality of all functions from reals to reals also the same as the cardinality of reals? I got a stomach flu or I got the stomach flu or I got stomach flu? When I googled stomach flu, there were many questions and statements like      How do you get the stomach flu?    Or     Difference between a stomach flu and food poisoning    Or      Six facts about stomach flu   When do you use the, a or nothing? And which should I use for a sentence like "I got a stomach flu from someone" ? OK...before everyone blasts this with references to the relativistic invariance of the physical laws, time dilation, etc let me add some context. Also, I am an amateur with an interest in physics, so I don't know the details of the physics. However, I have read enough about the cosmological principle and cosmic time to develop this "confusion" .  Based on evidence gathered to-date, it appears that the universe is both , as evidenced by observations and the . This principle, when combined with the FLRW metric, allows space-time to be divided into non-intersecting slices and therefore establish a "cosmic time."   Now, the existance of such a time in no way suggests that it is the "right" time or a true "now", hence violating relativity -- although some presentist philosophers (e.g., W.L. Craig) have tried to make this argument, but it is not generally accepted in philosophical circles.  However, this leaves me confused about an apparent disconnect between relativity and the cosmological principle:  Isotropy only holds if we are at rest relative to the cosmic microwave background radiation (universal rest frame), o/w anisotropy is present - yet each reference frame is supposed to allow equally valid observations. How can these two be reconciled when most reference frames would lead us to conclude that the universe is NOT isotropic?  It seems that only by appealing to the idea of being at rest relative to "universal rest frame" can we explain away any discrepancies from isotropy as due to "peculiar motion". However, doesn't this give this "universal rest frame" and its associated time an empirically privileged status, even though physical laws work just fine in every reference frame?   For example (pardon any abuse of astronomy): if look off in some part of space and see only quasars, and then in another part of space and see only brown dwarfs, but I measure both as apparently the same distance from me, then can I conclude that we are in motion, since otherwise we would have an empirical contradiction (kind of like finding dinosaur and human remains in the same strata)?  Any help on where I am going wrong would be helpful. Intuitively, I don't think there should be a way to establish absolute ordering between space-like separated events, but the above reasoning suggests otherwise. What makes a good tag separator? I'm building an application to allow technical people to enter configuration changes.  I'd like to add tags to each change.  Right now I'm using spaces, commas and semicolons.  It appears SO uses spaces and requires hyphens to make multiple words.  I read something that leads me to believe that WordPress uses commas and that a space isn't a separator.  Is there any best practice out there?  Has anyone had any good or bad experiences? Print LIST of unicode chars without escape characters I just upgraded linux-firmware package and after that I used $ sudo update-initramfs -u -k all but I got some errors:  $ sudo update-initramfs -u -k all [sudo] password for piotrek:  update-initramfs: Generating /boot/initrd.img-4.4.0-34-generic Warning: No support for locale: en_US.utf8 update-initramfs: Generating /boot/initrd.img-4.4.0-31-generic Warning: No support for locale: en_US.utf8 update-initramfs: Generating /boot/initrd.img-4.4.0-13-generic WARNING: missing /lib/modules/4.4.0-13-generic Ensure all necessary drivers are built into the linux image! depmod: ERROR: could not open directory /lib/modules/4.4.0-13-generic: No such file or directory depmod: FATAL: could not search modules: No such file or directory Warning: No support for locale: en_US.utf8 depmod: WARNING: could not open /var/tmp/mkinitramfs_LJbkti/lib/modules/4.4.0-13-generic/modules.order: No such file or directory depmod: WARNING: could not open /var/tmp/mkinitramfs_LJbkti/lib/modules/4.4.0-13-generic/modules.builtin: No such file or directory   I'm sure I don't have kernel 4.4.0-13. I might have had it some time ago but removed it:   $ apt list --installed | grep linux-  WARNING: apt does not have a stable CLI interface. Use with caution in scripts.  linux-base/xenial,xenial,now 4.0ubuntu1 all [installed,automatic] linux-firmware/now 1.159 all [installed,local] linux-headers-4.4.0-31/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.4.0-31.50 all [installed] linux-headers-4.4.0-31-generic/xenial-updates,xenial-security,now 4.4.0-31.50 amd64 [installed] linux-headers-4.4.0-34/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.4.0-34.53 all [installed] linux-headers-4.4.0-34-generic/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed] linux-image-4.4.0-31-generic/xenial-updates,xenial-security,now 4.4.0-31.50 amd64 [installed] linux-image-4.4.0-34-generic/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed] linux-image-extra-4.4.0-31-generic/xenial-updates,xenial-security,now 4.4.0-31.50 amd64 [installed] linux-image-extra-4.4.0-34-generic/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed] linux-libc-dev/xenial-updates,xenial-security,now 4.4.0-34.53 amd64 [installed] linux-sound-base/xenial,xenial,now 1.0.25+dfsg-0ubuntu5 all [installed] syslinux-common/xenial,xenial,now 3:6.03+dfsg-11ubuntu1 all [installed] syslinux-legacy/xenial,now 2:3.63+dfsg-2ubuntu8 amd64 [installed]   How to fix those update-initramfs errors?