I want to update an object that could look like this:  currentObject = {     someValue : "value",     myObject : {         attribute1 : "foo",         attribute2 : "bar"     } };   .. with an object that contains some changes i.e.:  updateObject = {     myObject : {         attribute2 : "hello world"     } };   At the end I would like to have currentObject updated so that:  currentObject.myObject.attribute2 == "hello world"   That should be posible for other objects as well.. As a solution I thought about iterating over the object and somehow take care of the namespace. But I wonder if there is an easy solution for that problem by using a library like jQuery or prototype.
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.
In mathematics, we like talking about idempotent matrices. In a masters program that I am currently enrolled in, I have heard one professor pronounce it one way, and another professor pronounce it another way. The  explains it better than I could:  Is there a correct pronunciation for idempotent? Is it like omnipotent (om-nip-o-tent), so id-EMP-o-tent, or is it more like the two seperate words idem + potent I'd say EYE-dm-POT-nt, but then I speak Brit. Charles Matthews 07:57, 30 Jun 2004 (UTC) Ditto, but then I speak Australian ;) Dysprosia 08:01, 30 Jun 2004 (UTC) Actually the British is more like EYE-dm-PO-tnt, I guess. Charles Matthews I'd just like to pedantically point out that it would be pronounced i-DEM-po-tent because because syllable onsets are maximized. daesotho 20:33, 21 Oct 2004 (UTC) The American pronunciation puts primary stress on the second syllable ('dem') and secondary stress on the fourth syllable ('tence'). Could somebody more familiar with IPA than I am please add this to the article as an accepted pronunciation? My American dictionary says |ˈīdemˌpōtənt| for the adjective. I speak American (non-natively) and I wouldn't stress the second syllable for itempotence. My only question is, right now it says /ˌaɪdɪmˈpoʊtəns/ -- but can't it be stressed on the first syllable too? Should we add /'aɪdɪmˌpoʊtəns/ as an alternative? -- 87.160.141.177 (talk) 14:50, 3 June 2011 (UTC) And by the way I think it's silly giving a pronounciation guide as this is just imposing a particular accent. (For what it's worth I pronounce idempotent with a short 'i', as in the word 'id'). Alex Selby I agree with Alex Selby - the pronunciation guide should be extended to show the variation, or removed. Strictly, there's no reason for the first i to be long (neuter idem has a short first syllable in Latin), and I can't find any authoritative source which advocates the pronunciation given. Ms7821 (talk) 22:59, 15 July 2015 (UTC)  Is there a &quot;correct&quot; pronunciation for this word? I have Ubuntu 16.04 with GNOME shell. I set ctrl+shift for the "Modifiers-only switch to next source" option.   This shortcut conflicts with apps hot-keys. I can't use ctrl+shift+i to open devtools in Chrome, it just switches the layout. In VS code IDE if I press shortcuts with ctrl+shift (for example ctrl+shift+f), shortcuts work but always switch a keyboard layout. When I used Windows this problem didn't exist.  Can I set the ctrl+shift shortcut in such a way that it causes a switch action only after the keys are released and only if this 2 keys were pressed (without additional keys)? I am really satisfied that $(x \to a) ≠(x=a)$ and if that is not right , Then all the process of $Limits$ is dividing by zero and that is a crime.  Since $(x \to a) + h = (x=a)$ , $h ≠ 0$,So Why does $f(x \to a) = f(x = a)$ ?  NOTE:I am talking about continuous function. Reduce file size without losing quality I would like to save files in Photoshop but keep them as small as possible.   I use Save for Web (and Devices) and save as a JPEG. Here are the settings I used:     I really do not want to lower the quality settings because I use text and sometimes I see artifacts if the setting is too low.   This produces file sizes of several hundred kilobytes depending on size of image. While this isn't a huge issue these images are used for the web and smaller is better. What are techniques without reducing quality to reduce the file size?   Update:  To add some more information here:   Many of the images I use and create get sent via email. This severally limits what I can do with placing of text using HTML and CSS over the image.   Also I use a variety of fonts. Some I could use for the web using CSS's @font-face but you can run into large file sizes and in some cases you cannot upload the font to the web legally. I could use a service like  but again many fonts I use are not available with Typekit.   Here is an example image: For users running Java application or applets in the browser, what difference does it make running either Sun Java or OpenJDK?  EDIT  Oracle will be , and basing the proprietary implementation on OpenJDK. Can we expect similar experience in running Java apps using either OpenJDK or Oracle JDK? 'both in terms of' or 'in terms of both'? How can I typeset this accented, dotless i? See the rough sketch above. I am able to typeset the accented i shown in the middle (for which I used the \v macro) and, obviously, the plain and simple i shown on the left also. However, I can't figure out how to typeset the one shown on the right. How can I do that? Why can't enum's constructor access static fields and methods? This is perfectly valid with a class, but is not allowed with an enum.  What I'm trying to do is store my enum instances in a static Map. Consider this example code which allows lookup by abbreivation:  public enum Day {     Sunday("Sun"), Monday("Mon"), Tuesday("Tue"), Wednesday("Wed"), Thursday("Thu"), Friday("Fri"), Saturday("Sat");      private final String abbreviation;      private static final Map&lt;String, Day&gt; ABBREV_MAP = new HashMap&lt;String, Day&gt;();      private Day(String abbreviation) {         this.abbreviation = abbreviation;         ABBREV_MAP.put(abbreviation, this);  // Not valid     }      public String getAbbreviation() {         return abbreviation;     }      public static Day getByAbbreviation(String abbreviation) {         return ABBREV_MAP.get(abbreviation);     } }   This will not work as enum doesn't allow static references in its constructor. It however works just find if implemented as a class:  public static final Day SUNDAY = new Day("Sunday", "Sun"); private Day(String name, String abbreviation) {     this.name = name;     this.abbreviation = abbreviation;     ABBREV_MAP.put(abbreviation, this);  // Valid } Are there massless bosons at scales above electroweak scale? Spontaneous electroweak symmetry breaking (i.e. $SU(2)\times U(1)\to U(1)_{em}$ ) is at scale about 100 Gev. So, for , gauge bosons $Z$ &amp; $W$ have masses about 100 GeV. But before this spontaneous symmetry breaking ( i.e. Energy > 100 GeV) the symmetry $SU(2)\times U(1)$ is not broken, and therefore gauge bosons are massless.  The same thing happens when we go around energy about $10^{16}$ GeV, where we have the Grand Unification between electroweak and strong interactions, in some bigger group ($SU(5)$, $SO(10)$ or others). So theoretically we should find gauge bosons $X$ and $Y$ with masses about $10^{16}$ GeV after GUT symmetry breaks into the Standard Model gauge group $SU(3)\times SU(2)\times U(1)$, and we should find massless X and Y bosons at bigger energies (where GUT isn't broken).  So this is what happened in the early universe: when temperature decreased, spontaneous symmetry breaking happened and firstly $X$ &amp; $Y$ gauge bosons obtained mass and finally $Z$ &amp; $W$ bosons obtained mass.   Now, I ask: have I understood this correctly? In other words, if we make experiments at energy above the electroweak scale (100 GeV) we are where $SU(2)\times U(1)$ isn't broken and then we should (experimentally) find $SU(2)$ and $U(1)$ massless gauge bosons, i.e. $W^1$, $W^2$, $W^3$ and $B$ with zero mass? But this is strange, because if I remember well in LHC we have just make experiments at energy about 1 TeV, but we haven't discovered any massless gauge bosons. Attacks of the MAC construction $\mathcal{H}(m\mathbin\|k)$ for common hashes $\mathcal{H}$? Consider a common practically-collision-resistant hash function $\mathcal{H}$ (e.g. , , , ), perhaps based on the  as are the first three. We define a  $\mathcal{C}$ $$(k,m) \mapsto \mathcal{C}(k,m)=\mathcal{H}(m\mathbin\|k)$$ where $\mathbin\|$ denotes concatenation, $k$ is a secret key (constant, or at least of fixed size), and $m$ is a message (possibly of variable length). Assume that an adversary can (iteratively) submit queries with $m_j$ and obtain $C(k,m_j)$, and wants to obtain $k$ or otherwise compute $C(k,m)$ for some $m\ne m_j$.  That MAC $\mathcal{C}$ is not trivially bad. In particular, if $\mathcal{H}$ was indistinguishable from a random function in the , $\mathcal{C}$ would be secure. And even though $\mathcal{H}$ may have the , it does not turn into a devastating attack on $\mathcal{C}$.  The less impractical generic attack that I see is that if a collision was known for $\mathcal{H}$ with the colliding messages of moderate identical length, it could be deduced countless collisions for $\mathcal{C}$. Hence security is demonstrably not better than collision-resistance of $\mathcal{H}$ (for identical-length messages). We could assume that $k$ is half the size of the result of $\mathcal{H}$, and hope that the security is about  or  or , 280, 2128, 2256 hash rounds for SHA-1, RIPEMD-160, SHA-256, SHA-512.   What are the known attacks against $\mathcal{C}$ (better than the above), and their cost, for each of these common hashes?  Is there hope for an argument that an attack against $\mathcal{C}$ would turn into an attack of similar cost against $\mathcal{H}$, or hint of the contrary?  Update: this  is of interest, but I fail to find that it really answers the present question.  Update 2: I am aware that the construction considered is weaker than , and in particular is vulnerable to collision on $\mathcal H$; I stated that, and that it is thus pointless to have the key wider hopeless to target security against some attacks better than half the hash's size. I'm asking exactly what cryptanalytic attack better than finding a collision on $\mathcal H$ there are. There is room for such an attack only by exploiting a weakness in the structure or/and the round function of a concrete $\mathcal H$. What does a program do when it's sent SIGKILL signal? When I used killall -9 name to kill a program, the state become zombie. Some minutes later, it stopped really. So, what's happening during those minutes? In the first book, Harry sees his Gringotts vault for the first time.  (Quotes thanks to Slytherincess!)     Griphook unlocked the door. A lot of green smoke came billowing out, and as it cleared, Harry gasped. Inside were mounds of gold coins. Columns of silver. Heaps of little bronze Knuts.      "All yours," smiled Hagrid.      All Harry's -- it was incredible. The Dursleys couldn't have known about this or they'd have had it from him faster than blinking. How often had they complained how much Harry cost them to keep? And all the time there had been a small fortune belonging to him, buried deep under London.      Hagrid helped Harry pile some of it into a bag. "The gold ones are Galleons," he explained. "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enough. Right, that should be enough fer a couple o' terms, we'll keep the rest safe for yeh."      Harry Potter and the Sorcerer's Stone - pages 58-59 - US Hardcover Edition   Jk Rowling posts in the Harry Potter Lexicon      JKR has stated in an interview (Comic Relief 2001) that she estimates the value of one Galleon to be "about five pounds," which works out to around US$9.75 (the exchange rate at the time of the interview was US$7.33). In the introduction to both QA and FB, US$250-million is stated to be the equivelent of 34 million Galleons. That also works out to a value of £5 to the Galleon, at the exchange rate of the time. The price listed on the back of the books, however, is not correct, since US$3.99 would equal less than half a British pound, or 8 sickles and 15 knuts. The book instead incorrectly lists US$3.99 as being equal to 14 sickles and 3 knuts. (Unfortunately, CNN.com uses this incorrect value for their Knuts-to-dollars converter.)      This gives us approximate values as follows:      1 bronze Knut = £0.01 (US about 2 cents)      1 silver Sickle = £0.29 (about US$0.57)      1 Galleon = £5.00 (more or less US$9.75)      These rates vary as the exchange rate fluctuates - see the Wizarding World Currency Converter for the current rate.   Now looking at the quote      Hagrid helped Harry pile some of it into a bag.   and     Right, that should be enough fer a couple o' terms, we'll keep the rest safe for yeh.   Obviously "some" is unspecified, but presuming the costs of ...     Typical elementary-school textbooks cost more than $100 each   He would be carrying at least 10 galleons for each school book, and going by the list of books just for his first year,  (Thanks Ibid!)     COURSE BOOKS      All students should have a copy of each of the following:         The Standard Book of Spells (Grade 1) by Miranda Goshawk   A History of Magic by Bathilda Bagshot   Magical Theory by Adalbert Waffling   A Beginners’ Guide to Transfiguration by Emeric Switch   One Thousand Magical Herbs and Fungi by Phyllida Spore   Magical Drafts and Potions by Arsenius Jigger   Fantastic Beasts and Where to Find Them by Newt Scamander   The Dark Forces: A Guide to Self-Protection by Quentin Trimble         (Harry Potter and Philospher's Stone, Chapter 5)   That's 80 Galleons just for books. This does not include the list of other expenses Harry has for his school years (wand, potion reagents, etc.)  How many Galleons is "some" or is Diagon Alley selling supplies for third world prices?  Sidenote, is this just a case of bad JK maths? Before the seasonal flu vaccine was recommended for all healthy adults, people in developed countries might get vaccinated against on the order of 10 different pathogens and develop immunity for some more via natural exposure.  Now the same person is expected to take a seasonal flu vaccine for a new strain every year - won't this put them in an uncharted territory as far as effects on the immune systems are concerned within a couple of decades? Data Recovery - How to Restore Deleted / Formatted Files on HD Micro SD Card Background:    I put in a friend's SD Card to format it because it was having problems. Then I put mine back in and I think my phone formatted my SD Card. I had a ton of pictures on there that are now gone! I put the card into the computer and there's only 2mb of cache files on there and none of the original directories.   I already tried the following freeware recovery applications:         Neither of them were able to retrieve any files. Undelete took 1minute to scan for files and came up with 0 files.  Recuva took 10 minutes for their "deep scan" which doesn't seem thorough enough at all for this 8GB SD Card. I need something that's a lot more heavy duty.  I don't mind paying for an application to get the data back if necessary...   Questions:     Which application can I use to recover my deleted picture files from my 8GB HD Micro SD Card?   Why did Anroid format my SD card?   How can I tell if it's a phone problem, data problem, or SD Card problem? Let $G = \mathbb{R} / \mathbb{Q}$. Is this an interesting group to study?  Is it isomorphic to any more natural mathematical objects? Sums and products of algebraic numbers How does one go about proving that the sums and products of two algebraic numbers over a field $F$ (say $a,b\in K$, where $K/F$ is a field extension) is also algebraic?   If we call $f_a$ and $f_b$ the min. poly's of $a$ and $b$, then I'm assuming the answer involves such polynomials. Perhaps looking at their roots in splitting fields for both of them? And finding a "big" splitting field, constructed from those two other ones?      In particular, I'd like a way of explicitly constructing the minimal polynomials $\ f_{ab}$ of $ab$ and $f_{a+b}$ of $a+b$.     I read somewhere that $g(x)=\Pi_j\Pi_i (x-\alpha_i\beta_j)$ works for $ab$, where the $\alpha_i$ and $\beta_j$ are the roots of $f_a$ and $f_b$, respectively, but I do not know why $g(x)\in F[x]$.  Similar remarks for $a+b$ The limit of truncated sums of harmonic series, $\lim\limits_{k\to\infty}\sum_{n=k+1}^{2k}{\frac{1}{n}}$ What is the sum of the 'second half' of the harmonic series?  $$\lim_{k\to\infty}\sum\limits_{n=k+1}^{2k}{\frac{1}{n}} =~ ?$$  More precisely, what is the limit of the above sequence of partial sums? I faced with a problem after update,   I missed 2 buttons from above panel, System menu (including shutdown, suspend &amp; …) and User (including log out &amp; …)  how can I restore them !?... Ctrl+Alt+← can usually be set to restart X, however I can't find the option to allow this (it is disabled by default).  I have looked in System-&gt;Preferences-&gt;Keyboard and System-&gt;Preferences-&gt;Keyboard Shortcuts but I can't find an option to enable it.  Where can I change this setting? Text formatting now allowed in comments (List of proven and disproven abilities)