Deep clone object in Javascript except Object.assign
What is the most efficient way to deep clone an object in JavaScript?
In most fiction I've read or encountered, the change occurs as a simple consequence of the lunar cycle. Though from what I know of Harry Potter, the change that takes place is due to sighting the full moon (as occurs in the third movie, Prisoner of Azkaban) where the gang, plus Lupin, Severus, Sirius and Pettigrew emerge from the Whomping Willow and upon sighting the full moon he begins to change.  Is this the trigger for werewolves in the Potterverse? If not, why did he (Lupin as an example, though for any werewolf in general) not change whilst in the shrieking shack that night?  Edit: This  addresses Lupin's change but I'm after more general information about werewolves. Intuition on proof of Cauchy Schwarz inequality To prove Cauchy Schwarz inequality for two vectors $x$ and $y$ we take the inner product of $w$ and $w$ where $w=y-kx$ where $k=\frac{(x,y)}{|x|^2}$ ($(x,y)$ is the inner product of $x$ and $y$) and use the fact that $(w,w) \ge0$ . I want to know the intuition behind this selection. I know that if we assume this we will be able to prove the theorem, but the intuition is not clear to me. In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob] Compute Engine - 1000 GB disk cant decrease size i have a huuuuge problem.  Created a snapshot and image from my instance...instance has 1000GB of disk.  Now i need to reduce it but everytime i try to create an image or a snapshot from that, i get the same error "Disk need to be at least 1000GB".  There is a way to reduce disk size directly on instance? Some workaround? I have float raster and now I want to convert it to vector. How is it possible with the Python GDAL library?  I have tried with gdal_polygonize.py of GDAL utilities on the command line and it worked excellently. But this utility is based on GDALPolygonize() of C++ library and I want to C++ method GDALFPolygonize() to be used instead, which manipulates float raster data as far as I know. Was or is? Confusion How can I create launchers on my desktop? In older versions it was easy to create a launcher on my desktop. All I had to do is right click on my desktop and select the "create launcher" option.  How can I create such launchers now? the (surely simplistic) model of a bipolar junction transistor one is taught in foundational physics course appears to be symmetric. - So, what is the difference between the collector and the emitter of a real BJT? If the transistor were symmetric one would not make this distinction...  Also:   Do BJTs have a 0.6V voltage drop like diodes? Are BJTs conductive in both directions, i.e. E-C and C-E?   Many thanks. If I have an adjacency matrix for a graph, can I do a series of matrix operations on the adjacency matrix to find the connected components of the graph? Explain reflection laws at the atomic level Evaluate $$I=\int_{0}^{1}\frac{x\log x}{\log(1-x)}dx$$   I try to change it to:$$I=\int_{0}^{1}\frac{(1-x)\log(1-x)}{\log x}dx$$ but I can't do next steps,help me ,thank you very much. Search for text files where two different words exist (any order, any line) I'm looking for a way to search files where two word instances exist in the same file.  I've been using the following to perform my searches up to this point:  find . -exec grep -l "FIND ME" {} \;   The problem I'm running into is that if there isn't exactly one space that between "FIND" and "ME", the search result does not yield the file.  How do I adapt the former search string where both words "FIND" and "ME exist in a file as opposed to "FIND ME"?  I'm using AIX. Setting git default flags on commands How to prove that if $a\equiv b \pmod{kn}$ then $a^k\equiv b^k \pmod{k^2n}$ I have 16GB of system RAM. On startup with no applications open except the task-manager Windows is using about 3gb of RAM. I looked in the processes tab, but nothing seems to be out of the ordinary. How can I find out why my Windows is using so much RAM.    all processes from all users      Reading from the poolmon it seems that my wireless broadcom driver is using about 0.4GB of of RAM. Even if I remove  it would still be using  2.6GB on start-up, which is still too much.      After reinstalling the wireless driver associated with the memory leak. I have a new screenshot and would like to confirm that it was indeed a memory leak. Understanding the -exec option of `find` I find myself constantly looking up the syntax of  find . -name "FILENAME"  -exec rm {} \;   mainly because I don't see how exactly the -exec part works. What is the meaning of the braces, the backslash and the semicolon? Are there other use cases for that syntax? Show that $\frac{X}{X+Y}\sim Beta(\alpha,\beta)$ Let IG denote Inverse-Gamma distribution   .   If $X\sim IG(\alpha,1)$ and $Y\sim IG(\beta,1)$. Show that   $\frac{X}{X+Y}\sim Beta(\alpha,\beta)$   I tried with jacobian transformation taking $Z=\frac{X}{X+Y}$ and $W=Y$ then $$X=\frac{WZ}{1-Z};Y=W$$  $$\frac{\partial(z,w)}{\partial(x,y)}=\frac{1}{(1-z)^2}$$  $$f_{z,w}(z,w)=f_x(\frac{wz}{1-z})f_y(w)(1-z)^2$$ $$f_{z,w}(z,w)=\frac{1}{\Gamma{(a)}}(\frac{wz}{1-z})^{-\alpha-1}e^{-\frac{(1-z)}{wz}}\frac{1}{\Gamma{(\beta)}}w^{-\beta-1}e^{-\frac{1}{w}}(1-z)^2$$  but I'm stuck, in some place I read that $\frac{X}{X+Y}$ is a type 3 Beta distribution, but I can't show that. What does the factorial of a negative number signify? I understand that the factorial gives the number of arrangements. For example: the factorial of zero i.e. an empty set ( doesn't occur) is 1.   As the empty set can be arranged only in 1 way - i.e. by filling nothing. Now, let's take an example: 5 distinct seats. How many ways 5 distinct seats can be arranged? - 5! ways i.e. 120.  So, basically, factorial gives us the arrangements. Now, the question is why do we need to know the factorial of a negative number?, let's say -5. How can we imagine that there are -5 seats, and we need to arrange it? Something, which doesn't exist shouldn't have an arrangement right? Can someone please throw some light on it?. I saw some research done on the formula - GUI/Unity crashing in 16.04 LTS after updates 2018-01-04, compiz segfaults Getting new files to inherit group permissions on Linux I am having a problem with permissions on a Linux server. I am used to BSD. When a directory is owned by a group the user who owns it isn't in such as www-data, files created in it will be owned by that group. This is important because I want files to be readable by the webserver (which I will not run as root) but so a user can still put new files in the directory. I can't put the users in www-data because then they can read every other users websites.   I want the webserver to read all websites, I want users to be able to change their own.  The permissions are set like this on the folders at the moment....  drwxr-x--- 3 john www-data 4096 Feb 17 21:27 john   It is standard behavior on BSD for permissions to work this way. How do I get Linux to do this?