Right now to make a new object out of an existing object I stringify it, then parse it into a new variable. Is there a better way?  eg:  let newObject = JSON.parse(  JSON.stringify(originalObject)  )
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.
Why multiple capacitors in parallel? Wondering why you would choose to use smaller capacitors in parallel vs one bigger one.  Here's an example:      Is this a component size and track width choice?  Thanks! How do we see? Where do the photons disappear? I know that the light is reflected from a object to my eyes, but I don't understand exactly how. The photons appear from the light source and disappear in my eye! Can someone explain the phenomenon of where the photons go and do to allow us to see? Bold code in a question Frequently when I ask a question I have to include quite a bit of code for reference purposes.    It would be nice to be able to bold the important lines in the code.  For example this code:  &lt;DataTrigger Value="True"&gt;     &lt;DataTrigger.Binding&gt;         &lt;MultiBinding Converter="{StaticResource DisableWorkItemConverter}"&gt;             &lt;Binding ElementName="MainForm" Path="PickedWorkItemID"/&gt;             &lt;Binding Path="Id"/&gt;         &lt;/MultiBinding&gt;     &lt;/DataTrigger.Binding&gt;     &lt;Setter Property="IsEnabled" Value="False"/&gt;     &lt;Setter Property="IsSelected" Value="False"/&gt; &lt;/DataTrigger&gt;   Is not way long, but the important part (as seen in ) is the second to last line.  However, if I try to bold it, it ends up looking like this:  &lt;DataTrigger Value="True"&gt;     &lt;DataTrigger.Binding&gt;         &lt;MultiBinding Converter="{StaticResource DisableWorkItemConverter}"&gt;             &lt;Binding ElementName="MainForm" Path="PickedWorkItemID"/&gt;             &lt;Binding Path="Id"/&gt;         &lt;/MultiBinding&gt;     &lt;/DataTrigger.Binding&gt;     &lt;Setter Property="IsEnabled" Value="False"/&gt;     **&lt;Setter Property="IsSelected" Value="False"/&gt;** &lt;/DataTrigger&gt;   Not what I was going for.  It would be nice to be able to draw attention to specific lines of code when needed.    (One suggestion of a different color background sounds nice too (ie a yellow background to draw the eye to the relevant code.)  If there is some other way to bold in code please let me know. Calculating the expected values of the min/max of 2 random variables Number of Homomorphisms from $\Bbb{Z}_m$ to $\Bbb{Z}_n$ This question coutesy of Allan Clark's "Elements of Abstract Algebra" (60$\zeta$).   Find the number of homomorphisms from $\Bbb{Z}_m\to \Bbb{Z}_n$ as a function of $m$ and $n$.  This is stumping me, can anyone help? How to show that $\mathbb{Q}$ is not $G_\delta$ What are the rules for calling the base class constructor? What are the C++ rules for calling the base class constructor from a derived class? For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an implicit call to a no-arg super constructor is assumed - giving you a compile error if that's missing). What is the value of $i^{i^{i^\ldots}}$? What is the value of $i^{i^{i^\ldots}}$?   My effort is the following: If $z, \alpha \in \mathbb{C}$ with $z \neq 0$ then we can write $z^{\alpha}=e^{\alpha \log z} = e^{\alpha [ \log |z|+i \text{ Arg z} + 2 \pi i m]}$ where $ m=0, \pm 1, \pm 2, \ldots$  and Arg z is the principle argument of the complex number $z$. But in above expression we don't have the finite no of exponents, so I am not sure how should I use this formula to the solve above problem. Thanks and Regards! This is something that always annoys me when putting an A4 letter in a oblong envelope: one has to estimate where to put the creases when folding the letter. I normally start from the bottom and on eye estimate where to fold. Then I turn the letter over and fold bottom to top. Most of the time ending up with three different areas. There must be a way to do this exactly, without using any tools (ruler, etc.). Why is looping over find's output bad practice? This question is inspired by    I see these constructs  for file in `find . -type f -name ...`; do smth with ${file}; done   and  for dir in $(find . -type d -name ...); do smth with ${dir}; done   being used here almost on a daily basis even if some people take the time to comment on those posts explaining why this kind of stuff should be avoided... Seeing the number of such posts (and the fact that sometimes those comments are simply ignored) I thought I might as well ask a question:  Why is looping over find's output bad practice and what's the proper way to run one or more commands for each file name/path returned by find ? Where does Mac OS X come from? May $y=e^x$ be satisfied with both $x$ and $y$ be positive integers?  I think it is not possible as $e$ ,a transcendental number, when multiplied by itself would never result in rational number.  Am I right? Are there any disadvantages to using your companions for transporting Power Armor After I read that companions don't drain the fusion core of a Power Armor when wearing it, I decided to try giving my armor to Nick so I'll always have it close by if I need it.  But I was wondering if there are any other drawbacks to that. For example, does the Armor get damaged or destroyed when the companion is under fire? How is using a transformer for isolation safer than directly connecting to the power grid? How is using a 1:1 transformer safer than using the mains straight off? Is it because you can limit the current coming from the transformer whereas straight from the mains its not current limited? I fail to see how its "safer" when playing with electricity is dangerous. Could someone please explain why it is considered safer to be isolated by a transformer. Equaling 3 Displays Total (or 2, if the laptop display cannot be used).  I work at home on two large monitors, but at the office on a laptop with a single large monitor. Is it possible to attach two (or more?) external monitors to a laptop without having them clone each-others display? How is it possible that quantum phenomenons (e.g. superposition) are possible when all quantum particles are being constantly observed? I don't understand how quantum mechanics (and therefore also quantum computers) can work  given that while we work with quantum states, particles that this quantum state consist of cannot be observed, which is the most fundamental requirement.  If I am not mistaken, by "observed" we mean interaction with any other particle (photon, gluon, electron or whatever else). So my very important questions:   Aren't the particles this quantum state consists of interacting with each other? Why doesn't that cause the state to collapse? Aren't all particles in the universe interacting with Higgs field and gravitons etc? Why doesn't that cause every quantum state to collapse?   I feel there is something very fundamental in quantum mechanics that I am not aware of, hence I would be very pleased to have these questions answered. I have a quick question about updating my references from Bibtex.  I am using TexStudio as my Latex editor.  I have to make changes to some of the references.  I put the changes in the "references.bib" file.  I then compile the Bibtex and the main document I'm working on.  Sometimes the changes show up, and sometimes they don't, and I haven't figured out why. I have even gone as far as trying to delete the references by changing the filename, but the original references still appear.  Here's what I put in my main document:   \newpage %Puts in References  \bibliographystyle{unsrt}  \bibliography{references}   My references.bib file shows all the changes I have made.  Any suggestions are appreciated! How can we print line numbers to the log in java How to print line numbers to the log. Say when outputting some information to the log, I also want to print the line number where that output is in the source code. As we can see in the stack trace, it displays the line number where the exception has occurred. Stack trace is available on the exception object.  Other alternative could be like manually including the line number when printing to the log. Is there any other way? I am not asking about the two factor authentication process where the user needs to enter both a password and a one-time-password.  Gmail recently (I don't know from when exactly) changed their login process which is depicted in the following screenshot:     So, the new steps are as follows:   Enter email   Click Next  Enter password   Click Sign In    as opposed to the previous and usual way of logging in:   Enter email and password   Click Sign In    Isn't the new process non-user friendly requiring extra user interactions?  Since, Google does not usually make UX blunders can you explain the reasoning behind the new process? I'm looking for details like user interaction simplicity or any other hidden advantages.  Note: The question  doesn't cover the reason behind the change while Mervin Johnsingh's answer cites Google's reason. This doesn't work:  tar xf /tmp/foo.tar.gz foo/bar tar: foo/bar: Not found in archive   It's not obvious to me what would do this beyond extracting it in place and moving the files over.