How can i update a dictionary with keys from a list dict_keys and values from a list dict_values? I have tried using for loop in this way: for i in dict dict_keys:     for o in dict_values:         dict(i) = o
Imagine that you have the following list. keys = ['name', 'age', 'food'] values = ['Monty', 42, 'spam']  What is the simplest way to produce the following dictionary? a_dict = {'name': 'Monty', 'age': 42, 'food': 'spam'}
Integrate $\int_{0}^{\pi}{\frac{x\cos{x}}{1+\sin^{2}{x}}dx}$ Is there a word or phrase to define several words linked by hyphens, such as in "a sit-back-and-wait-for-it attitude" some more examples:   "And she gave me that aren't-I-just-gorgeous smile." "The I-did-it-my-way approach." "A from-this-day-forward-I-have-no-son scene." How to use aes-encryption in PostgreSQL? I tried aes-encryption by using following statement:  SELECT encrypt('test', 'key', 'aes');   which worked, but I am not able to decrypt the value. I inserted it in a field of datatype bytea but I'm not sure if that was the right way.   SELECT decrypt(pw, 'key', 'aes') FROM table WHERE ID = 1;   gives me the error     ERROR:  function decrypt(bytea, unknown, unknown) does not exist   LINE 1: SELECT decrypt(pw, 'key', 'aes') FROM tabelle WHERE ID = 7;                  ^   HINT:  No function matches the given name and argument types. You might need to add explicit type casts.   Does that really mean that encrypt() is an existing function, but not decrypt()? How else could I retreive aes-encrypted values? Proving the identity $\sum_{k=1}^n {k^3} = \big(\sum_{k=1}^n k\big)^2$ without induction Auto-mounting network shares per user I have a server that has a number of CIFS shares that need to be accessed on a per-user basis. For example, I have a Music share which I have full access to, but my wife has read-only access.  When either myself or my wife log into our Ubuntu 11.04 laptop I would like these shares to be automatically mounted per user. Now I understand that if I mount as -t cifs without specifying a user then it will use the USER environment variable. However, I also need to specify a password, so how can I do that when each user has a different password?  I think my questions are:   Is there a way for me to have a per-user /etc/fstab? If not, is there a way to specify that a mount is only applicable to a certain user? Also, the share password is always the same as the local password. Is there a way to specify that this password should just pass through from the client to server rather than having to specify it in a credentials file somewhere?   Or maybe I'm missing something and there's a completely different solution. Can anyone help? Where do object file "Version References" come from? form in a .tpl.php file This is the code in my template.php file.  function studiga_theme_theme($existing, $type, $theme, $path) {         $items['add_property_form'] = array(         'render element' =&gt; 'form',         'template' =&gt; 'node--14',         'path' =&gt; drupal_get_path('theme', 'studiga_theme') . '/templates/node',     );      return $items; }    function custom_add_property_form($form, &amp;$form_state) {     $form['first_name'] = array(         '#type' =&gt; 'textfield',         '#attributes' =&gt; array('placeholder' =&gt; t('First name')),     );     $form['last_name'] = array(         '#type' =&gt; 'textfield',         '#attributes' =&gt; array('placeholder' =&gt; t('Last name')),     );     $form['address'] = array(         '#type' =&gt; 'textfield',         '#attributes' =&gt; array('placeholder' =&gt; t('Address')),     );     $form['city'] = array(         '#type' =&gt; 'textfield',         '#attributes' =&gt; array('placeholder' =&gt; t('City')),     );     $form['state'] = array(         '#type' =&gt; 'select',         '#options' =&gt; array(             'default' =&gt; 'State',             '...' =&gt; '...',         ),     );     $form['zip'] = array(         '#type' =&gt; 'textfield',         '#attributes' =&gt; array('placeholder' =&gt; t('Zip')),     );     $form['email'] = array(         '#type' =&gt; 'textfield',         '#attributes' =&gt; array('placeholder' =&gt; t('Email')),     );     $form['phone'] = array(         '#type' =&gt; 'textfield',         '#attributes' =&gt; array('placeholder' =&gt; t('Phone')),     );     $form['submit'] = array(         '#type' =&gt; 'submit',         '#value' =&gt; 'Submit',     );      return $form; }   This is the code in node--14.tpl.php.                                          Contact Information                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  &lt;div class="row"&gt;     &lt;div class="small-12 medium-12 large-8 large-offset-2 columns"&gt;         &lt;?php print render($form['submit']); ?&gt;     &lt;/div&gt; &lt;/div&gt;     But no fields are appearing - what am I doing wrong? You can't have a straight forward  in a tpl.php file can you? In classic OLS regression it is well-known that $(\mathbf{I}-\mathbf{H})\mathbf{y}=\mathbf{r}$, where $\mathbf{I}$ is the identity matrix, $\mathbf{H}$ is the , $\mathbf{y}$ is the vector of response (dependent) values, and $\mathbf{r}$ is the vector of residuals.  My question is whether the scalar $\mathbf{y}^T(\mathbf{I}-\mathbf{H})\mathbf{y}=\mathbf{y}^T\mathbf{r}=\mathbf{y}^T\mathbf{y}-\mathbf{y}^T\mathbf{\hat{y}}$ has some meaningful interpretation. Is there an official Marvel Cinematic Universe viewing order? I'm planning on re-watching the currently-released 5 Marvel films prior to seeing The Avengers.  Have Marvel released any sort of official viewing order?  Captain America: The First Avenger seems like the hardest one for me to place in order with the rest.  It takes place prior to the other films, but has the greatest number of references to the other films.  So should it be watched first, or last?  The rest of them are relatively clear, as they're chronological in the order they're released, with the possible exception of The Incredible Hulk and Iron Man 2 happening at the same time. is there a quick way to sort the items of a select element? Or I have to resort to writing javascript?  Please any ideas.  &lt;select size="4" name="lstALL" multiple="multiple" id="lstALL" tabindex="12" style="font-size:XX-Small;height:95%;width:100%;"&gt; &lt;option value="0"&gt; XXX&lt;/option&gt; &lt;option value="1203"&gt;ABC&lt;/option&gt; &lt;option value="1013"&gt;MMM&lt;/option&gt; &lt;/select&gt; This appears to be related to the behavior originally suggested in .  It appears to be the same issue raised in , but this post has specific steps to reproduce the issue.  Here's what happened on one site in the network earlier today:   A question was posted much earlier Someone came along, and as an unregistered, new user with no other activity, posted a spam answer to that question at 04:36:54 UTC That same user posted a comment on their own answer with the same spam link at 04:37:31 UTC The answer was deleted as spam via community votes at 07:32:07 UTC A high-rep user saw the comment and raised a custom flag on it as being spammy at 07:32:54 UTC The unregistered user account was destroyed by a moderator at 08:13:10 UTC The comment now shows as "deleted by Anonymous" with a deletion time of 08:13:10 UTC The flag on the comment remains, but the only options are "Edit" and "Decline"; there is no "Delete" action   That there is no "Delete" action possible on the flag is reasonable, since the comment is now deleted. However, the flag is/was legitimate, so to decline the flag would be wrong. There's also nothing to leave while editing out the spammy part of the comment, as the comment consists solely of the same spam URL.  There is also no undelete option on the comment, so it's not possible to undelete the comment and then mark the flag as helpful by re-deleting the comment.  Effectively, this means that while the comment itself is effectively gone, the flag on it is in limbo and there is no good choice for what to do with the flag.  When deleting comments normally, my understanding is that any flags associated with those comments are automatically marked as helpful. However, it appears that the deletion of comments when destroying the user who posted them does not do that.  Therefore, I suggest that whenever comments are deleted as part of the owning user being destroyed, any pending flags against those comments should be marked as helpful at the same time.  It would also be a nice touch if those comments showed as deleted by Community♦, instead of Anonymous, but that's less of a concern in my case. How do we prove $n^n \mid m^m \Rightarrow n \mid m$? I'm not sure I've got this right. When proving $a^n \mid b^n \Rightarrow a \mid b$, can we do this indirectly? In short,  "Suppose $a$ does not divide $b$, this implies that $a^n$ does not divide $b^n$. But $a^n \mid b^n$, hence $a$ divides $b$."  How about $n^n \mid m^m \Rightarrow n \mid m$? Can we do this the same way? How do I create directory if it doesn't exist to create a file? Calculating the average of variably sized blocks of numbers within a column? Which are the standard commands available in every Linux based distribution? Let $\alpha, \beta \in \mathbb{C}$, such that $\alpha + \beta$, and $\alpha\beta$ are algebraic. Show that $\alpha$ and $\beta$ are algebraic. Let $\alpha, \beta \in \mathbb{C}$,  such that $\alpha + \beta$, and $\alpha\beta$ are algebraic. Show that $\alpha$ and $\beta$ are algebraic.   attempt: Suppose $\alpha, \beta \in \mathbb{C}$ such that $\alpha + \beta$, and $\alpha\beta$ are algebraic.  Let $\alpha + \beta$, $\alpha\beta$ are algebraic be algebraic over $F$. And let $\alpha, \beta \in K$, where $K$ is an extension of $F$.  then $\alpha + \beta $ and $\alpha\beta$ lie in the extension $K = F(\alpha,\beta)$, which is finite over $F$.  so $[F(\alpha, \beta) : F] = [F(\alpha, \beta): F(\alpha + \beta, \alpha\beta)][F(\alpha + \beta, \alpha\beta) : F] \leq 2[F(\alpha + \beta, \alpha \beta) : F] $, since $\alpha + \beta$ and $\alpha \beta$ are roots .   So $[F(\alpha + \beta) : F]$ is finite and in the extension $F(\alpha,\beta)/F$ the elements must be algebraic over $F$, then $\alpha , \beta$ are algebraic.  Can someone please verify this? Or help me give a better approach. Thank you! How to calculate last four digits of $2^{2017}$? can u suggest me any short trick of solving these kind of problems. How to find last four digits of any number raised to some power ? Ignore citations in captions in list of figures when numbering When using the \cite command in figure captions and the ieeetr bibliography style, then  BibTeX numbers the citations as appearing earlier than they do in reality (i.e. the first citation in the document ends up being [42]).  Is there any way to get BibTeX to ignore the \listoffigures section when numbering? In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim &ndash; does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this? When did UX start being called UX? When did people start talking about User Experience as a role/domain similar to the way that it's used today?  The earliest reference I can find is the Norman, Miller, Henderson CHI 95 piece on Apple's set up (Donald Norman, Jim Miller, Austin Henderson: What You See, Some of What's in the Future, And How We Go About Doing It: HI at Apple Computer. Proceedings of CHI 1995, Denver, Colorado, USA)  Anything earlier?  [Edit - after @Andrew's nice answer we have 1993 as an earlier date     "I invented the term because I thought Human Interface and usability   were too narrow: I wanted to cover all aspects of the person's   experience with a system, including industrial design, graphics, the   interface, the physical interaction, and the manual." - Don Norman   ]  (I'm writing a talk on communities of practice relating to UX - and want to get my time lines right ;-)