I have an array like this:  message_list = [     {         "Main_body": "test msg",         "emp_name": "test",         "emp_salary": "5000 USD"     } ]   Its length (e.g., message_list.length) is 1.  Now I have another array like this:   added_user_data = [     {         "PostSharedLog": {             userids: "2,4,5"         },         "created": "2123123"     },      {         "PostSharedLog": {             userids: "3,1"         },         "created": "2123147"     } ]   Its length (added_user_data.length) is 2.  I want to push the above array added_user_data into message_list.   I tried doing it inside a for loop, now since the length of message_list is 1, for the second iteration, the values do not get pushed since message_list[1] does not exist and is undefined. But I still want to create message_list[1] even if it does not exist.  if i do the below :   for(var k =0;&lt;count(added_user_data.length);k++) {       message_list[k].PostSharedLog = added_user_data[k].PostSharedLog ;  }   It only appends the first row from the array added_user_data  and gives an output like this when i print out message_list :  [{          "Main_body": "test msg",         "emp_name": "test",         "emp_salary": "5000 USD",          "PostSharedLog": {             userids: "2,4,5"         } }]   The second iteration does not append anything at all .   I would like to see the below :   [{              "Main_body": "test msg",             "emp_name": "test",             "emp_salary": "5000 USD",              "PostSharedLog": {                 userids: "2,4,5"             },             "PostSharedLog": {                 userids: "3,1"             }    }]
How do I append an object (such as a string or number) to an array in JavaScript?
Adding columns to production tables What's the best way to add columns to large production tables on SQL Server 2008 R2? According to Microsoft's books online:     The changes specified in ALTER TABLE are implemented immediately. If the changes require modifications of the rows in the table, ALTER TABLE updates the rows. ALTER TABLE acquires a schema modify lock on the table to make sure that no other connections reference even the metadata for the table during the change, except online index operations that require a very short SCH-M lock at the end.   (http://msdn.microsoft.com/en-us/library/ms190273.aspx)  On a large table with millions of rows, this can take a while. Is taking an outage the only option? What's the best way to handle this kind of situation? Python import coding style I've discovered a new pattern.  Is this pattern well known or what is the opinion about it?  Basically, I have a hard time scrubbing up and down source files to figure out what module imports are available and so forth, so now, instead of  import foo from bar.baz import quux  def myFunction():     foo.this.that(quux)   I move all my imports into the function where they're actually used., like this:  def myFunction():     import foo     from bar.baz import quux      foo.this.that(quux)   This does a few things.  First, I rarely accidentally pollute my modules with the contents of other modules.  I could set the __all__ variable for the module, but then I'd have to update it as the module evolves, and that doesn't help the namespace pollution for code that actually lives in the module.  Second, I rarely end up with a litany of imports at the top of my modules, half or more of which I no longer need because I've refactored it.  Finally, I find this pattern MUCH easier to read, since every referenced name is right there in the function body. Gravitational waves and time Vertical line for the the right margin in Notepad++ Sudden increase in timing when summing over 250 entries Error Code: 1215. Cannot add foreign key constraint (foreign keys) Enabling CORS in GeoServer (jetty)? I hope somebody has already figured this one out. I just installed Geoserver 2.9 on a vanilla Ubuntu 16.04 distro. The Geoserver 2.8 method of enabling CORS with the shanbe.hezoun class does no longer work with Jetty 9.2.13.  There are mentions that CORS support is already packaged with Jetty 9.2.13 in the jetty-servlets.jar.  The Jetty lib which is compiled with Geoserver contains a jetty-servlet-9.2.13.v20150730.jar in geoserver/lib but not jetty-servlets.9.2.13.v20150730.jar. Are these supposed to be the same jar with a different name?  It should be possible to enable CORS either in geoserver/etc/webdefault.xml or in geoserver/webapps/geoserver/WEB-INF/web.xml.  My understanding is that the webdefault.xml is applied first and the web.xml thereafter.  I have tried following filter in both xml. I haven't got as far as adding a filter mapping. Adding the filter alone will cause the Geoserver/Jetty service to not start proper.  &lt;filter&gt;     &lt;filter-name&gt;cross-origin&lt;/filter-name&gt;     &lt;filter-class&gt;org.eclipse.jetty.servlets.CrossOriginFilter&lt;/filter-class&gt; &lt;/filter&gt; What methods can I use to infer a distribution if I know only three percentiles?  For example, I know that in a certain data set, the fifth percentile is 8,135, the 50th percentile is 11,259, and the 95th percentile is 23,611.  I want to be able to go from any other number to its percentile.  It's not  my data, and those are all the statistics I have.  It's clear that the distribution isn't normal.  The only other information I have is that this data represents government per-capita funding for different school districts.  I know enough about statistics to know that this problem has no definite solution, but not enough to know how to go about finding good guesses.  Would a lognormal distribution be appropriate?  What tools can I use to perform the regression (or do I need to do it myself)? List of PDOStatement::bindParam data_type parameters Some things I know:  omega_1 is the first uncountable ordinal, made up of all of the countable ordinals f is not necessarily continuous    For this proof, I currently have x as a condensation point in my range, and I know that (x - (1/n) , x + (1/n) ) is uncountable and everything to the left and right of this interval is countable. I understand that I want to shrink this interval small enough just to x (which will be my constant), making everything around x eventually countable. I also understand that this will eventually make all of the elements in omega_1 go to x but I am having a hard time seeing where my contradiction comes in. I also am struggling with writing this proof in a presentable fashion.   Thank you! Code coverage for wrapper class is 0% Why is this power adapter transformerless? How do you implement Coroutines in C++ Can I accept an already rejected edit (to my own post)? Today,  to one of . Before I got to see the notification, the edit already was rejected by other people (three rejections, one approval).  But the edit was actually a good one (like most edit proposals to my post I get to see) – a correction of syntax errors, so I would have definitively approved it.  (The suggested edit didn't change the main point of the answer, which was about the API to use, but it made the code example of my answer actually usable. I didn't compile it when writing my answer, it was late at the evening.)  So I did edit my post to include the proposed change, so the proposal is not fully lost. But the proposer only got the negative feedback from the rejection, and none of the reputation bonus an accepted edit gives.  My suggestion: Could there be added a way a post author can accept edits which were already rejected by other users?  Also, is there some way I can contact the rejectors and teach them not to reject good edits? I'm going on a vacation from Europe to the US and was planning of bringing along some Xbox360 or PS3 games, but now I'm curious if they will be compatible with my European Xbox.  In that past there would be a clear difference between NTSC and PAL games, but is this still the case with the current gen of consoles? I am trying to rename my Windows / Boot Camp partition from "EFI Boot" to "Boot Camp" or "Windows". But I do not figure out where to rename.   I tried bless command on the NTFS Volume, I tried creating the folders "System/Library/CoreServices" and copied the .disklabel file into it (or also blessit) but nothing changed.  Finally I got the Volume Icon on Boot Selection to work by copying the icns File onto the EFI partition. Also tried blesson the EFI partition – but this also do not work.  So I have my Icon, but I also would like to rename it – how can I do this?  Systems are Windows 10 and macOS Mojave. Proof of $f^{-1}(B_{1}\setminus B_{2}) = f^{-1}(B_{1})\setminus f^{-1}(B_{2})$ I want to prove the following equation:  $$ f^{-1}(B_{1}\setminus B_{2}) = f^{-1}(B_{1})\setminus f^{-1}(B_{2}) $$  Is this a valid proof? I am not sure, because at one point I am looking at $f(x) \in B_1$, but then $x \in f^{-1}(B_1)$ could be actually some different points.  $$\begin{align*} x \in f^{-1}(B_{1}\setminus B_{2}) &amp;\iff f(x) \in B_{1}\setminus B_{2} \\ &amp;\iff f(x) \in B_{1} \land f(x) \notin B_{2} \\ &amp;\iff x \in f^{-1}(B_{1}) \land x \notin f^{-1}(B_{2}) \\ &amp;\iff x \in f^{-1}(B_{1})\setminus f^{-1}(B_{2}) \end{align*}$$ Is there a proof for this Fibonacci relationship? I was looking at the decomposition of Fibonacci numbers using the definition of $F_n = F_{n-1} + F_{n-2}$, and noted the pattern in the coefficients of the terms were Fibonacci numbers. It appears to hold, and I believe it's true, but I haven't seen a proof for it. Does one exist?  $F_n = 1F_{n-1} + 1F_{n-2}$ $F_n = 2F_{n-2} + 1F_{n-3}$ $F_n = 3F_{n-3} + 2F_{n-4}$ $F_n = 5F_{n-4} + 3F_{n-5}$ etc  This can be generalized to $F_n = F_xF_{n-(x-1)}+F_{x-1}F_{n-x}$ Permanently turn off new Google Maps and go back to old one I found new Google Maps slow, useless (routes with only two points) and wrong. Is there any way, I can turn it off completely and go back to favored old Google Maps? Or is this &mdash; as with everything in Google &mdash; one way trip?  I found  text on this matter, but it seems useless. I have the feeling, that it discuss something completely different. It says about lite indicator in bottom-right corner. I don't have something like that. And provided links, that should switch new Google Maps engine between WebGL and canvas-based, simply doesn't work. All of them opens new window with annoying advertisment about new maps.  I even tried pasing part of URL, they're talking about (force=canvas) into any URL that my new Google Maps uses. Of course without any luck.  So... is there any way, I can get rid of new Google Maps, once and permanently?  UPDATE: In these days (April, 2015) Google , that soon new Google Maps will be the only one available. To my extremely negative surprise, this question will become invalid soon! :( SOQL results returning RecordTypeId which is not included in query I am running this script from developer console.  List&lt;Account&gt; lstAccount = [SELECT Id, Name, BillingStreet From Account LIMIT 1]; System.debug(lstAccount);   Debug Log:     23:47:04:012 USER_DEBUG [5]|DEBUG|(Account:{Id=0019000001nNLGEAA4, Name=Acct_nm001, BillingStreet=xyz Road, RecordTypeId=01290000000iaNiAAI})   I never queried for RecordtypeId in SOQL, but it is included in the list.  Although, if I run the query from the query editor, it is not showing RecordtypeId column.   Is this by design? Then why not Salesforce is not providing us audit fields in the first scenario.