I think its supposed to be simple, but somehow, I don't get what I'm doing wrong.  I have this code:  var currentPosition = {     x:10000,     y:10000 };  var directions = "v&gt;v&lt;"; var housesVisited = [{x:10000, y:10000}];  function createHouseCoordinates(data){     for(var x = 0; x&lt;4; x++){         if(data[x]=="^"){            currentPosition.x += 1;           } else if(data[x]=="v"){            currentPosition.x -= 1;         } else if(data[x]=="&gt;"){            currentPosition.y += 1;         } else if(data[x]=="&lt;"){            currentPosition.y -= 1;           }     housesVisited.push(currentPosition);     } }  createHouseCoordinates(directions); console.log(housesVisited);   It is supposed to take directions in the form of symbols, modify the current location, and create an array of objects that lists all locations that were visited. The result of the above, when I run it, gives me this (basically the end position):  [ { x: 10000, y: 10000 }, { x: 9998, y: 10000 }, { x: 9998, y: 10000 }, { x: 9998, y: 10000 }, { x: 9998, y: 10000 } ]   I was expecting:  [ { x: 10000, y: 10000 }, { x: 9999, y: 10000 }, { x: 9999, y: 10001 }, { x: 9998, y: 10001 }, { x: 9998, y: 10000 } ]   What am I doing wrong? What should I read up on to understand this better..? Thanks in advance!
What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but . I've done things like obj = JSON.parse(JSON.stringify(o)); but question the efficiency.  I've also seen recursive copying functions with various flaws.  I'm surprised no canonical solution exists.
Nikkor f/1.8G 35mm or 50mm? I'm new to photography. I got a Nikon D3100 with the 18-55 kit lens.  I was looking to buy a f/1.8 prime lens, and I found two options:   AF-S DX NIKKOR 35mm f/1.8G   AF-S DX NIKKOR 50mm f/1.8G   How should I go for choosing one or the other? Dynamic Symlinks I have built my app for different architectures and would like to create a "dynamic symlink" which takes me to the right version based on a variable.   If the machine I am currently logged in to, is x86, then the symlink should take me to that build.  A mocked example of what I want to do:  $ uname -i x86_64  $ ls -ltr  lrwxr-xr-x  1 dogbane gg     4 Feb 16 15:40 mylink -&gt; @sys/ drwxrwxr-x  2 dogbane gg  2048 Feb 16 15:40 x86_64/ drwxrwxr-x  2 dogbane gg  2048 Feb 16 15:40 i386/  $ cd mylink  $ pwd -P ~/x86_64   Is this possible?   I know I can use cd $(uname -i), but want something simpler. I know how to CALCULATE dot product, but still don't understand MEANING of it.  I mean, If I have to explain vector addition I would say that "Sum of two vectors give you the third vector that has the same effect as other two combined"  But I don't know how to explain dot product. For example we have two vectors: v=(3,1) and w=(2,4). Dot product of these two is 3*2 + 1*4 = 10. What does this result (10) tell us? Suppose I know that I can find the $\gcd$ of two integers with the Euclidean algorithm. What is the 'extension' so I can use this method also for polynomials?  Edit: I found an easy answer with less rigor which is approachable without knowledge of matrices:    also the first 3 subchapters of How do I install Ubuntu to a USB key? (without using Startup Disk Creator) Benevolent aliens who (initially) refuse to show themselves This is a sci-fi book where aliens arrive on Earth and push Earth towards world peace, but refuse to reveal themselves physically. When the aliens finally do show themselves, we find that they       look like .   I recall that the aliens seemed benevolent, but that humanity did not like the direction they were being told to go. I cannot remember the ending or if the aliens turned out to be truly benevolent. Why are properties lost in the Cayley–Dickson construction? Proving that $\left( \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} \right) \lvert f(z) \rvert^2 = 4 \lvert f'(z) \rvert^2$ Given $f$ entire show that $$ \left( \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2} \right) \lvert f(z) \rvert^2 = 4 \lvert f'(z) \rvert^2 $$ I've come close to getting the exact answer by writing $f(z)$ as $u(x,y)+iv(x,y)$ and realizing the Laplacian of f is equal to zero. This leads to a lot of cancellations but I'm still making mistakes in my computations and I can't figure out where. Any help is appreciated. Reading Photoshop PSD Files with Layers (There are a few existing questions on Photoshop alternatives, but none seem to focus on reading PSD files specifically)  Say I'm a programmer working with a web designer and would like to implement a design she's produced as a PSD file using Photoshop. It's a fairly complicated design using overlays/animating layers, so the ability to examine the PSD file and turn individual layers on and off is necessary.   Is there an app available in Ubuntu that can read PSD files created by Photoshop?  Alternatively, is there a more linux-friendly file format that Photoshop can export to and still preserve layers? Is there a deb package to install Firefox ESR? I would like to have  on my system but I would like to install it via apt-get. Is there a special package to install this?  Download link would be: Background - I am doing my PhD in atmospheric physics/photobiology.  Here is a scenario:   The experiments are complete - the results are far better than expected  Successfully got the computer program to work properly and have developed another Papers are published Much of the thesis is drafted   The light at the end of the tunnel is most definitely no longer an oncoming train.  But, at this stage, you just don't feel like working on the thesis, you do other things like cleaning, reading, watching movies - procrastination gets worse, and worse despite the submission deadline coming closer.     The procrastination resulting in more apathy towards the project, despite being fully aware of how much work has been put into the project, how much has been achieved and how little, comparatively, needs to be done.  What strategies are there to overcome this academic-apathy, particularly in this late stage of the thesis? I am looking for a proof possibly using the sandwich theorem and/or Bernoulli's inequality for proving the following statement:  If $x&gt;0$ then $x^{1/n}$ tends to $1$. Custom Tools not Saving in Toolbar on Startup/ Normal.mxt? I am trying to save some tools that I have created into the default toolbar layout that is present when ArcMap 10.1 is launched.  It is possible to change the arrangement of toolbars, add new ones and even add in existing tools, but any custom tools I set in the commands category "geoprocessing tools" are gone and do not appear in the toolbar. How can I save these custom tools to the default layout that appears on startup?  Update:  Saving a document with the custom tools added and reopening it preserves the tools, but opening a template (10.1 mxd) containing the tools, then opening and older document will cause the tools to disappear. Oddly enough, any other changes made after the custom tools were added are preseved.  Update (03/18/2014):  I have upgraded to 10.2 and this has still not been fixed. I did not see this issue in the 10.21 changelog so I doubt it will address it. For those interested in this issue, I have started a forum post on the ESRI forums . How do you open a command line? How do you access the command line or run option to put the commands into the system? I think my question relates to a fundamental of 3D modeling that I haven't picked up on yet. It's very simple:  Let's say I have a flat quad. A plane on the XY plane inserted into am empty blender file is a great example. Now let's say I start moving each of the 4 vertices around on in any direction, especially the Z axis.   At this point, there would still be one face, but its extremely unlikely that the face would be planar (I just learned this word). So blender does its best to make sense of what this should look like.  The problem I'm having is that it seems like my quads are always like this, but they never look the way I want. There are edges and seams that look like they are dangling in space, and what tends to happen is that my mesh looks great when viewed from most angles, but if you look at it from just the right angle, you notice the dangling edges or sometimes even some kind of impossible geometry. And so I might try to nudge the problematic vertices around, but this often seems to either make it worse, or just hide the bad geometry until you see it from a different angle.  For me, this always seems to happen whenever I'm trying to move vertices to add roundness to something that is originally square.   There is another question on here about how to actually flatten the quads. That's great, and I might use some of the techniques mentioned there. My question is:   Why does this happen? (Can someone explain this better?) What are some tips and tricks to avoid this situation? What are some tips and tricks to mitigate this situation?   EDIT Here is an illustration:  The overall mesh as viewed from a distance looks decent (for my skill level)    But if you get closer and look from a certain angle...    Super close up:    The "edge" that is pointed to by the arrow is not actually an edge, but some kind of artifact created when blender tries to show the quad. The way the vertices are positioned, it shouldn't actually be possible to see the sliver of the face that I marked in red, since this face is supposed to be around the corner from the edges. The edges should form the silhouette on the right side of my figure.     Here is the side view. Maybe it is the angled topology that skews the face in a funny way?  But I'm not looking for help with this one particular issue, but rather a better understanding of why this happens, and ideas to prevent this in future models. "He was telling me that he is going..." vs. "He told me that he is going..." I've been racking my brain trying to think of a grammatically correct sentence that uses same without the earlier in the same (see!) phrase.  It is the same It is the very same I have 10 things all the same I have 10 of the same things The same boy as last time did it again The boy did the same thing as last time  I am discounting same-day dry cleaning and any similar phrases that might crop up because using a hyphen is acceptable which suggests it's an atomic phrase and it sounds awkward if inverted:  They have a same-day dry cleaning service. Their dry cleaning service is same-day. - Sounds odd but might be acceptable in some situations Their dry cleaning service is done on the same day. - Sounds better  So I don't think it's possible when same is used by itself. Can someone either explain why same must always have the before it or provide a grammatically correct counter-example? Which Windows 7 log file contains device connection/disconnection information? Windows 7 frequently plays the usb/new device connection/disconnection sound. It happens both when the computer is idle and under load. All usb device connections have been checked (though I can't rule out a bad cable yet). I thought a good way to track down the issue would be to wait for the sound and then check the log file for the latest connected/disconnected device. I just need to know which log file has this information.  Edit: I'm going to leave the answer accepted, however the issue persists. I get that sound seemingly randomly throughout the day. Anyone else have any ideas? help you learn vs. help you to learn Source:  by Douglas Crockford (2008) Example:  My goal here is to help you to learn to think in JavaScript. I will show you the components of the language and start you on the process of discovering the ways those components can be put together.  Although it is usually the case that you mostly hear people say something like &quot;this will help you become a better person&quot;, is there any particular reason as to why he chose not to leave out the to and say help you to learn instead? If you've got something interesting to say, could you please elaborate on it as well? I would very much like to receive some coherent explanation and get this thing finally straight. The only time I know of, though, that you would use the to is when you say it like this:  It helps a lot to think of the rather difficult concept of classes used in modern software development as mere blueprints that architects and builders use to build houses. In life, it really helps to know your times tables by heart because not all the time do you have a calculator on you.  Because the aspect of the verb &quot;help&quot; is a little bit different here. But in all other cases, help do or help you do something is by far more common. I tried logging in with a Google account, but I got the following error: