Javascript reference not changing I am trying to understand the following           var obj1 = {             value: "first value"         };          var obj2 = {             value: "second value"         };          var  obj3 = obj2;          function change(obj1, obj2) {             obj1.value = "asdasd";             obj2 = "lol";         }          change(obj1, obj2);          console.log("1",obj1.value);//"asdasd"         console.log("2",obj2.value);//"secondvalue"   why only obj1.value is changed ??
Is JavaScript a pass-by-reference or pass-by-value language? The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?
How to roll perception checks for characters who aren't actively looking without arousing suspicion? This applies to all d20 systems, but with an example from the from the Pathfinder  (emphasis mine):  Stonecunning: Dwarves receive a +2 bonus on Perception checks to potentially notice unusual stonework, such as traps and hidden doors located in stone walls or floors. They receive a check to notice such features whenever they pass within 10 feet of them, whether or not they are actively looking.  In this case, does the GM roll the check in secret or ask the player roll the check? If the GM asks the player to roll for the check, what stops situations like:  GM: (interrupting) &quot;Gimli, Roll a perception check.&quot; Dwarf player: &quot;Oh, it's a natural one, I guess I don't see anything.&quot; Human player: &quot;Okay, I'll roll a perception check for anything unusual in this room. Nice! 19. How about 19, does 19 work for you?&quot; GM: &quot;Gimli, everything looks kosher to you. Aragon, you notice a rock coloured tarp on the ground here, covering what looks like a pit trap.&quot;  In this case, by telling the dwarf to roll his &quot;free&quot; perception check, he's telegraphed to the players that there is something to notice. How can this be fixed, without bluffing checks for nothing in particular to throw off the signal to noise ratio of similar checks? Portrait for phone, landscape for Tablet (Android-Layout) How to perform two-sample t-tests in R by inputting sample statistics rather than the raw data? Let's say we have the statistics given below  gender mean sd n f 1.666667 0.5773503 3 m 4.500000 0.5773503 4   How do you perform a two-sample t-test (to see if there is a significant difference between the means of men and women in some variable) using statistics like this rather than actual data?  I couldn't find anywhere on the internet how to do this. Most of the tutorials and even the manual deal with the test with the actual data set only. How do I join several objects into one? How to debug an unmet dependencies problem? Example code required for how to access embedded .Net image resources in C# It's very easy to mark an image file to become an embedded resource however how does one access the image thereafter. Please can I have some example code? How to make a JTable non-editable Why does the SUID bit have no effect when applied to directories in Linux? I clearly see that I can set it with 'chmod u+s'. But why does it not have "any" effect. What is the reason for implementing a way to SET it but not implementing any effect? How to debug hadoop mapreduce jobs from eclipse? Positive operator has a positive spectrum? Is there a word for people who always act too friendly in order to curry favor with their acquaintances? Is there a single noun or adjective for a person who is always flattering friends and acquaintances, not only to be liked and accepted but, at other times, to curry favor with them as well ?  I'm not looking for regionalisms but a word that will be understood in any English speaking country. How to force a web browser NOT to cache images Background  I am writing and using a very simple CGI-based (Perl) content management tool for two pro-bono websites. It provides the website administrator with HTML forms for events where they fill the fields (date, place, title, description, links, etc.) and save it. On that form I allow the administrator to upload an image related to the event. On the HTML page displaying the form, I am also showing a preview of the picture uploaded (HTML img tag).  The Problem  The problem happens when the administrator wants to change the picture. He would just have to hit the "browse" button, pick a new picture and press ok. And this works fine.  Once the image is uploaded, my back-end CGI handles the upload and reloads the form properly.  The problem is that the image shown does not get refreshed. The old image is still shown, even though the database holds the right image. I have narrowed it down to the fact that the IMAGE IS CACHED in the web browser. If the administrator hits the RELOAD button in Firefox/Explorer/Safari, everything gets refreshed fine and the new image just appears.  My Solution - Not Working  I am trying to control the cache by writing a HTTP Expires instruction with a date very far in the past.  Expires: Mon, 15 Sep 2003 1:00:00 GMT   Remember that I am on the administrative side and I don't really care if the pages takes a little longer to load because they are always expired.  But, this does not work either.  Notes  When uploading an image, its filename is not kept in the database. It is renamed as Image.jpg (to simply things out when using it). When replacing the existing image with a new one, the name doesn't change either. Just the content of the image file changes.  The webserver is provided by the hosting service/ISP. It uses Apache.  Question  Is there a way to force the web browser to NOT cache things from this page, not even images?  I am juggling with the option to actually "save the filename" with the database. This way, if the image is changed, the src of the IMG tag will also change. However, this requires a lot of changes throughout the site and I rather not do it if I have a better solution. Also, this will still not work if the new image uploaded has the same name (say the image is photoshopped a bit and re-uploaded). The model used to open the store is incompatible with the one used to create the store “How to Ask Questions in Private Beta” is listed in every site’s help centre When I go to /help/asking on any Stack Exchange site (), there is a link to How to Ask Questions in Private Beta (). It starts with:  Welcome to the private beta for [site] The tone and quality of the questions asked during this temporary private beta are critically important. If the private beta doesn't produce enough high quality expert level questions, it won’t proceed onward to the public beta. To help ensure your site makes it out of private beta, here are some tips:  There is no disclaimer or similar that this is outdated. This may lead to unnecessary confusion. I understand that that it is useful to keep this page in public pages for documentary purposes, as it may be linked in early Meta discussions, but it should:  not be listed in the table of contents (/help/asking) have a disclaimer Installing to SDCard by default I recently tried to change a bulb using an adaptor (converting from a E27 to B22 fitting). After switching on the light fitting the fuse had blown. After inspection it turns out the adapter is faulty and must have caused a short-circuit.  After removing the bulb and resetting the switch in the main fuse box, I am now unable to operate the switch on the wall to turn the fitting off (the switch physically won't click).   Is there something I can do to fix the problem?  Thanks, Why is unity feedback used? In a sequence $a_1, a_2,\dots$ of real numbers it is observed that $a_p=\sqrt{2}$, $a_q=\sqrt{3}$, and $a_r=\sqrt{5}$, where $1\leq p&lt;q&lt;r$ are positive integers. Then $a_p$, $a_q$, $a_r$ can be terms of (A) an arithmetic progression (B) a harmonic progression (C) an arithmetic progression if and only if $p$, $q$, and $r$ are perfect squares (D) neither an arithmetic progression nor a harmonic progression  I have tried using the definition of AP and argued that if the first option is true then $\frac{\sqrt{3}-\sqrt{2}}{\sqrt{5}-\sqrt{3}}=\frac{q-p}{r-q}$  is true which implies that the left hand side is an rational number. I don't know whether the left hand side is a rational number or not. I am stuck here. Also, I don't know how correct this approach is. How do I approach and solve this problem? How do I vertically center a single cell within a table? How do I convert two lists into a dictionary?