Hello, everyone.  Is there a way in python to insert all items from one dictionary to another inside variable assignment?  dict1 = {"a": 1, "b": 2, "c": 3} dict2 = {"d": 4, #INSERT THERE ALL FROM "dict1"#, "e": -1}   Maybe there's smth like {key: value for key, value in temp.items()} or other "hack"?  I know that there's update() method and I've already applied it, but it looks a bit weird. Order of entries matters so to build dict in proper order I need to write next code :  dict1 = {"a": 1, "b": 2, "c": 3} dict2 = {"d: 4"} dict2.update(dict1) dict2.update({"e": -1, "f": -2})   Hope there's a way to do it more "nice".
I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged (i.e. taking the union).  The update() method would be what I need, if it returned its result instead of modifying a dictionary in-place. &gt;&gt;&gt; x = {'a': 1, 'b': 2} &gt;&gt;&gt; y = {'b': 10, 'c': 11} &gt;&gt;&gt; z = x.update(y) &gt;&gt;&gt; print(z) None &gt;&gt;&gt; x {'a': 1, 'b': 10, 'c': 11}  How can I get that final merged dictionary in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.)
Query with BETWEEN returns Zero or ONE Scale camera to fit screen size unity My background and gameobjects are 2d sprites not UI images ,I want to know how to make my background scale with screen size and positions of 2d sprits on it don't change after building game (webGl) like scale canvas with screen size and anchor points in UI elements .  Before building the game   After building Introduce a  "general reference" close reason There is a certain amount of questions that are absolutely trivial in nature: How to format a date, how to concatenate a string, et cetera. Questions that could be solved by taking a look into the manual.  Random examples from the tags I frequent:                What those OPs need is a link to the right manual, which we should give them. But the question serves no purpose. They don't even have a use by being searchable,  because any sane search query would lead to the actual manual as the first hit.  Jeff discusses the possibility of introducing a new close reason for this over at  According to Robert's suggestion there, it could go like this:     general reference: this question is too basic; the answer is indexed in any number of general internet reference sources designed specifically to find that type of information.   Please please implement this.  Add a field (like the "enter duplicate ID here" popup) for users to suggest the correct manual link:    The suggested links would then be shown in a block in the top section of the question, like duplicate links.   Also, the amount of reputation earnable from these trivial questions is appalling. I'm sure a great portion of most high-rep users' points (including mine) is from answering "what was that function for replacing a string again?" type questions. This dilutes the value of reputation as a measure of true expertise a great deal.  I would suggest that answers to questions that get closed as "general reference" are made community wiki retroactively, taking away any reputation earned. I was hoping to find a more "mathematical" proof, instead of proving logically $\displaystyle \sum_{k = 0}^n {n \choose k}^2= {2n \choose n}$.  I already know the logical Proof:  $${n \choose k}^2 = {n \choose k}{ n \choose n-k}$$  Hence summation can be expressed as:  $$\binom{n}{0}\binom{n}{n} + \binom{n}{1}\binom{n}{n-1} + \cdots + \binom{n}{n}\binom{n}{0}$$  One can think of it as choosing $n$ people from a group of $2n$  (imagine dividing a group of $2n$ into $2$ groups of $n$ people each. I can get $k$ people from group $1$ and another $n-k$ people from group $2$. We do this from $k = 0$ to $n$. "As part of" versus "as a part of" "export PS1=" for customizing shell prompt How does ServerName and ServerAlias work? What does $(command) & do? I saw the following syntax in a bash script:   &gt;$(command) &amp;   I know that the ampersand &amp; at the end makes a command run in the background, but I have never seen it in combination with the dollar sign plus the brackets around the command.  What does it do? I know that there is no vector space having precisely $6$ elements. Does every set have a group structure? Anyone knows what software tool is used to draw these circuit schematics I was reading online and found this site:   I was very curious how this professor drew all these circuit diagrams in his lecture notes (such as this one: ). They just look very very good.   And example is shown below:      To be more specific about what I mean, by "publication quality" I mean the following:   The software must output vector graphics, such as eps, or windows meta files. It would be good to have control over the style of the graphics, such the style of the components, line width, figure size, etc. It would be good to have a graphical user interface. I understand LaTeX is very powerful but it's just too painful to write a 100 line script to generate a circuit diagram.   So in short, I'm not really looking for a schematic capture program. I'm looking for a program that can generate pretty circuit schematic illustrations so that I can put them in papers and presentations.  (I am aware of other posts on this forum, such as this one: .  None of the software mentioned in that post seems to get you publication quality figures.) Updated Ubuntu 16.04, now I'm running Kali? Updated Ubuntu 16.04 today using the software updater. Now my PC is running Kali? There were something like 2Gb of updates, which I thought at first was because I haven't updated in a while. Now I'm thinking that it was downloading Kali. Here's a  of the new boot-up process.  The screen will continue to flicker for another 30 seconds or so, then stop flickering leaving the text on the screen. I tried switching the display manager from gdm to lightdm, which will boot me straight to the console and without flickering, but still no desktop.  I'm not altogether sure how I managed to accomplish this. It must have been when I was trying to get Katoolin running.  Any tips as to how I can either get the desktop or revert the updates?  Contents of cat /etc/lsb-rolling:  DISTRIB_ID=Kali DISTRIB_RELEASE=kali-rolling DISTRIB_CODENAME=kali-rolling DISTRIB_DESCRIPTION="Kali GNU/Linux Rolling" "be accorded someone" or "be accorded to someone"? When the verb accord means "give or grant", should the passive voice be accorded someone or accorded to someone?  I came across several sentences in a book:     The attention accorded husband-wife relations in Muslim teachings thus confirmed the indigenous view of matrimony as a desirable state, with the birth of children considered essential for the full attainment of adulthood.      Similar processes occurred in Daoism, which percolated into Vietnam from southern China but never received the official patronage accorded Confucianism.   Shouldn't it be "accorded to husband-wife relations", as "given to husband-wife relations"? Fibonacci sequence and Euclidean algorithm's connection. Can I have dynamic custom variables in Word? I'm basically trying to create a variable in a document, let's say the name of a person, so that I can change the value in a single place and it updates through the whole document.  I've been reading about Fields and about a DOCVARIABLE, but I can't find where to edit the value (right clic didn't show an "edit" option). I'm using Word 2011 for Mac (that's what we have at work right now) so I'm wondering whether this version of Word is just not intuitive, or I cannot have variables like that in Word and I'm misinterpreting the documentation.  This is what I intend to do:  Hello, my name is PERSON_NAME, I have PERSON_AGE years old.   You get the idea.  PS: We actually want to modify the variables' values from our app, rather than from Word itself, kind of like injecting values to a .*docx file. Proof/Derivation of Closed form of Binomial Expression $\sum\limits_{k=0}^{2n}(-1)^k\binom{2n}{k}^2$ The binomial expression given as follows: $$\sum_{k=0}^{2n}\left(-1\right)^{k}\binom{2n}{k}^{2}$$ results nicely into the following closed form: $$(-1)^{n}\binom{2n}{n}$$ I wish to know how exactly is it being done? I haven't been able to make much progress in solving it. My approach: \begin{align} \sum_{k=0}^{2n}(-1)^{k}\binom{2n}{k}^{2} = \binom{2n}{0}^{2} - \binom{2n}{1}^{2} + \binom{2n}{2}^{2} - ... -\binom{2n}{2n-1}^{2} + \binom{2n}{2n}^{2} \\ = \binom{2n}{0}.\binom{2n}{0} - \binom{2n}{1}.\binom{2n}{1} + \binom{2n}{2}.\binom{2n}{2} - ... -\binom{2n}{2n-1}.\binom{2n}{2n-1} + \binom{2n}{2n}.\binom{2n}{2n} \\ \text{By Symmetry of binomial coefficients} \\ = \binom{2n}{2n}.\binom{2n}{0} - \binom{2n}{2n -1}.\binom{2n}{1} + \binom{2n}{2n-2}.\binom{2n}{2} - ... -\binom{2n}{1}.\binom{2n}{2n-1} + \binom{2n}{0}.\binom{2n}{2n} \\ = \binom{2n}{2n}.\binom{2n}{0} + \binom{2n}{2n -1}.\binom{2n}{1} + \binom{2n}{2n-2}.\binom{2n}{2} + ... +\binom{2n}{1}.\binom{2n}{2n-1} + \binom{2n}{0}.\binom{2n}{2n} - 2.\left(\binom{2n}{2n -1}.\binom{2n}{1} + \binom{2n}{2n -3}.\binom{2n}{3} + ... + \binom{2n}{1}.\binom{2n}{2n-1}\right) \\ \text{By Vandermond's identity, first component, i.e.not enclosed within -2.(...) evaluates to C(4n, 2n)} \\ \binom{4n}{2n} - 2.(\binom{2n}{2n -1}.\binom{2n}{1} + \binom{2n}{2n -3}.\binom{2n}{3} + ... + \binom{2n}{1}.\binom{2n}{2n-1}) \end{align} I'm lost beyond this point. It will be extremely helpful if someone can direct me in the right direction or provide the answer to this perplexing and challenging problem. Thank you. Mirror Modifier making ugly smoothing on mirrored faces The model is vivisected right down the middle along the z axis. The right leg is rendering funny and I assume if I can get that fixed everything else will fall into place. I tried flipping normals, changing shading types - can't think of anything else to do. Convert particle system to animated meshes Capistrano for Django What are these auxiliary file descriptors? While poking around /proc/self folder for my mksh shell,  I found a peculiar thing: in /proc/self/fd/* there are all the standard file descriptors (0 for stdin, 1 for stdout, and 2 stderr) some file descriptors, but also some extra ones - 24, 25, 3. And I technically can list them with a glob in the shell:  $ for fd in /proc/self/fd/* ; do echo $fd ; done                                                       /proc/self/fd/0 /proc/self/fd/1 /proc/self/fd/2 /proc/self/fd/24 /proc/self/fd/25 /proc/self/fd/3   But when I try to stat them or use find on them, they are reported as non-existent.  $ find  /proc/self/fd/*                                                                                /proc/self/fd/0 /proc/self/fd/1 /proc/self/fd/2 find: ‘/proc/self/fd/24’: No such file or directory find: ‘/proc/self/fd/25’: No such file or directory /proc/self/fd/3   Same occurs in bash , but just with just one auxiliary file descriptor.  $ for fd in /proc/self/fd/* ; do echo $fd; done /proc/self/fd/0 /proc/self/fd/1 /proc/self/fd/2 /proc/self/fd/255 /proc/self/fd/3  $ find /proc/self/fd/* /proc/self/fd/0 /proc/self/fd/1 /proc/self/fd/2 find: ‘/proc/self/fd/255’: No such file or directory /proc/self/fd/3   Question is: what are those additional file descriptors? What is their purpose? How do people come up with difficult math Olympiad questions?