Merging an array but keeping values that weren't in the other array
Merging arrays with the same keys
What software programs are used to draw physics diagrams, and what are their relative merits? Undoubtedly, people use a variety of programs to draw diagrams for physics, but I am not familiar with many of them.  I usually hand-draw things in  which is powerful in some regards, but it is time consuming to do things like draw circles or arrows because I make them from more primitive tools.  It is also difficult to be precise.    I know some people use LaTeX, but I am not quite sure how versatile or easy it is.  The only other tools I know are Microsoft Paint and the tools built into Microsoft Office.  So, which tools are commonly used by physicists?  What are their good and bad points (features, ease of use, portability, etc.)?  I am looking for a tool with high flexibility and minimal learning curve/development time.  While I would like to hand-draw and drag-and-drop pre-made shapes, I also want to specify the exact locations of curves and shapes with equations when I need better precision. Moreover, minimal programming functionality would be nice additional feature (i.e. the ability to run through a loop that draws a series of lines with a varying parameter).  Please recommend few pieces of softwares if they are good for different situations. I wrote a bash script as below:  #!/bin/bash echo "Enter a file name" read filename import -window root $HOME/Desktop/$filename.png   I expected this script to take a screen shot and save the image with the given filename on my desktop.  Problem:  My Ubuntu terminal is giving error:     import: Command Not Found I usually disconnect my cellphone from the charger some time after it's fully charged because I'm afraid the battery could lose capacity over time if I don't. However, I believe modern electronics should be able to handle this kind of scenario and automatically stop charging the battery once it's full. Does this apply to modern Android phones? Or do I need to continue disconnecting it all the time? How do I calculate $\lim_{x\rightarrow 0} x\ln x$ I was thinking about the reasons behind $0^0=1$ and I remember one of my friends studying math arguing about the continuity of the function $x^x$ in $0$. But when I write as $$x^x=e^{x\ln x}$$ I am now looking at $$\lim_{x\rightarrow 0} x\ln x$$ Graphically I can see in Mathematica that it goes to $0.$ But I can't calculate by using a Taylor expansion, because I can't expand log around $0$. How do you prove that? Objects disappear when looking through camera When I go to camera perspective, there are parts of my object that I can't see. I tried adding and deleting my camera a lot of times and positioning it so that the objects I would like to see on my camera view will be seen but to no avail, I still get the same problem.    What could be wrong with my camera set-up? How can I enable Hardmode? Analytic continuation of a power series 2 Another Qual question here,  For the function $$\sum_{n=0}^\infty z^{2^n}$$,  Prove the following:  i) $f$ converges to a function analytic in the open unit disk $D$,  ii) $f(z) =z+f(z^2)$ and  iii) $f(z)$ can not be analytically continued past any point on the unit circle.  I can even see (ii) very easily, but I can not see how can I prove rigorously (i) and  (iii). Help please. "Disappear" as a transitive verb Inverse Fourier transform of Gaussian I need to calculate the Inverse Fourier Transform of this Gaussian function:  $\frac{1}{\sqrt{2\pi}} exp(\frac{-k^2 \sigma^2}{2})$  where $\sigma &gt; 0$, namely I have to calculate the following integral: $\int{\frac{1}{\sqrt{2\pi}} \exp(\frac{-k^2 \sigma^2}{2})} \exp(ikx) dk$.  How can I do that? If I am not wrong (in which case please correct me) the result should be $\frac{1}{\sqrt{2\pi}\sigma}exp(\frac{-x^2}{2\sigma^2})$...but I don't know how to get there! Avoiding if statement inside a for loop? "'void' type not allowed here" error (Java) Oracle 11g: increasing buffer cache with AMM On a 2-node RAC we have enabled Automatic Memory Management. The advisor views indicate that increasing the buffer cache by 4 GB will half the physical reads, and we have 4 GB to give.   How must we do this? By increasing memory_target and letting Oracle grab more memory for the buffer cache? Or by explicitly setting a value for db_cache_size (which now is zero)? I have a variable, x, and I want to know whether it is pointing to a function or not.  I had hoped I could do something like:  &gt;&gt;&gt; isinstance(x, function)   But that gives me:  Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in ? NameError: name 'function' is not defined   The reason I picked that is because  &gt;&gt;&gt; type(x) &lt;type 'function'&gt; Flattening a shallow list in Python Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?  I tried to flatten such a list with a nested list comprehension, like this:  [image for image in menuitem for menuitem in list_of_menuitems]   But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined.  After googling and looking around on Stack Overflow, I got the desired results with a reduce statement:  reduce(list.__add__, map(lambda x: list(x), list_of_menuitems))   But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object.  Conclusion:   Thanks to everyone who contributed to this question.  Here is a summary of what I learned.  I'm also making this a community wiki in case others want to add to or correct these observations.  My original reduce statement is redundant and is better written this way:  &gt;&gt;&gt; reduce(list.__add__, (list(mi) for mi in list_of_menuitems))   This is the correct syntax for a nested list comprehension (Brilliant summary !):  &gt;&gt;&gt; [image for mi in list_of_menuitems for image in mi]   But neither of these methods are as efficient as using itertools.chain:  &gt;&gt;&gt; from itertools import chain &gt;&gt;&gt; list(chain(*list_of_menuitems))   And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so:  &gt;&gt;&gt; chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) &gt;&gt;&gt; print(list(chain)) &gt;&gt;&gt; [1, 2, 3, 5, 89, 6] Is there any way to add if elif and else in drivers?  Given the way we do if and else, here are two examples out of few other things i tried to get the statement right but unable to do so:  var-3.5 if (var&lt;0) var+3.5 elif (var&gt;0) else 1  var-3.5 if (var&lt;0) elif var+3.5 (var&gt;0) else 1   And also if there's any other way to add multiple if/else similarly? If $f$ is measurable and $fg$ is in $L^1$ for all $g \in L^q$, must $f \in L^p$? Let $f$ be a measurable function on a measure space $X$ and suppose that $fg \in L^1$ for all $g\in L^q$. Must $f$ be in $L^p$, for $p$ the conjugate of $q$? If we assume that $\|fg\|_1 \leq C\|g\|_q$ for some constant $C$, this follows from the Riesz Representation theorem. But what if we aren't given that such a $C$ exists? Normal subgroups of $S_4$ Can anyone tell me how to find all normal subgroups of the symmetric group $S_4$?  In particular are $H=\{e,(1 2)(3 4)\}$ and $K=\{e,(1 2)(3 4), (1 3)(2 4),(1 4)(2 3)\}$ normal subgroups? New tab in chromium is empty Bump and color data in a single brush? Is there any way to paint onto a bump map and diffuse map at the same time, so that the strokes match up? Like a multi-layer brush that uses a greyscale texture for the bump layer and a color texture for the diffuse color?  Here's a rough sculpt to demonstrate what I'm imagining:    The GIF above shows how such a brush could be made. The black and white height map would be the displacement brush, transferring its greyscale data to the bump map texture and the green one would transfer its color data to the diffuse map texture.  The resulting brush images:      Making the brush is one thing, but is it possible to use such a brush? Let $E$ be an empty set. Then, $\sup(E) = -\infty$ and $\inf(E)=+\infty$. I thought it is only meaningful to talk about $\inf(E)$ and $\sup(E)$ if $E$ is non-empty and bounded?   Thank you.