I am working on a dictionary that maps names to votes received. I need associate the name with the most votes, assigning it to the variable win.   So far:  vote = {}  for key in vote:     vote(max(key)) = win   How do I associate win to the name, because I believe my error now is that I am associating it to the highest number.  Thank you for your help.
I have a dictionary: keys are strings, values are integers.  Example:   stats = {'a':1000, 'b':3000, 'c': 100}   I'd like to get 'b' as an answer, since it's the key with a higher value.  I did the following, using an intermediate list with reversed key-value tuples:  inverse = [(value, key) for key, value in stats.items()] print max(inverse)[1]   Is that one the better (or even more elegant) approach?
How to properly render smoke on a transparent background? Predicting the number of decimal digits needed to express a rational number Why is $L^1(\mathbb{R}^n) \cap L^2(\mathbb{R}^n)$ dense in $ L^2(\mathbb{R}^n)$? Diplomacy Attacking a Territory as they move If I convince Turkey, to move Army Bul to Gre, would I be able to send Army Ser to Bul and take the area? Why, logically, is proof by contradiction valid? In my flagging summary under the statistics, there is 1 flag listed as "disputed".  This is the first time I've ever seen a disputed flag in my summary, so I'm just curious, what is a disputed flag? How would you even dispute a flag? Is this the same as voting a flag as invalid? Why is super.super.method(); not allowed in Java? Cardinality of order types in $\mathbb{N}$ Let be the next equivalence relation on $B= \{R \subseteq \mathbb{N}\times\mathbb{N} \ | \ R \ is \ a \ well-order \ on \  \mathbb{N}\}$ : $$"R \equiv R' \leftrightarrow \ (\mathbb{N},R) \cong (\mathbb{N},R') \ are \ well-ordering \ sets \  isomorphic" $$  Which is the cardinality of $B/\equiv$?  Firstly, we can notice that each well-ordering set is isomorphic to an ordinal $\alpha \ $such that $\alpha &lt; \aleph_{1}$, and so it is enough to count how many ordinals are isomorphic to a subset of $\mathbb{N}$. For example, if we consider $A$ the set of the even numbers and $B$ the set of odd numbers with the usual order relation, $A \oplus B$ is isomorphic to $\omega + \omega$. Another example could be: if we consider the order of $\mathbb{N}$ that we use in Sharkowski Theorem, that order is isomorphic to $ \omega^{2} + \omega$. Working with prime numbers we could build also $\omega^{n} \ \forall n \in \mathbb{N}$, and so $\omega^{\omega}$ and maybe something bigger. However, we know that each countable ordinal is isomorphic to a subset of $\mathbb{Q}$, but I bet that the same result is not true for $\mathbb{N}$ because it is "too small".  What can I do? My machine was updated today to Ubuntu 16.04.2. However, the kernel is still "4.4.0-62-generic". What happened (it seemed that the principal advantage of the 16.04.2 version was the update of the kernel to 4.8) ? Do I have to make a fresh install ? show that if $a | c$ and $b | c$, then $ab | c$ when $a$ is coprime to $b$. Given two numbers $a$ and $b$, where $a$ is co-prime to $b$,     Show that for any number $c$, if $a|c$ and $b | c$ then $ab| c$. Is the reverse also true? In other words, if $ab |c$ and $a$ is co-prime to $b$, then do we have $a | c$ as well as $b|c$? How to align the camera in a solved motion tracked scene? I have been having an issue with my floor plane and object when using a solved camera after tracking some footage. I get a solve error of between 0.05 and 0.4 on my solves which is good and not the issue I've been having. However when I go to orient the camera I will snap it to an origin and adjust the scale. The plane and object are not aligned, but could be fixed if I could just rotate around them (much like in PF Track). I would think the pivot point for the camera, if I have it locked to view, would be the origin (where my plane and object are), but it seems to be just some arbitrary point out in space which makes manually fixing the alignment very difficult. I'm wondering if there is any way to fix this so the pivot point is in fact in the center, or if there are any other suggestions to go about this problem. WordPress site displaying 404 for any page apart from index My WordPress site is returning a 404 not found error on any page apart from the homepage and /wp-admin. I have no absolutely no idea why this is. My Permalinks are set up to use /year/month/date/post-title/ (e.g www.domain.com/2014/04/28/sample-post/). When I change the permalinks to the default (?p=123) it works fine, but not on any of the other ones.  Here is the contents of the .htaccess file:  &lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] &lt;/IfModule&gt;   I have also installed the plugin 'Debug This', which provides details on the Rewrite Rules. However because it's a pretty big list and unformatted it would look quite bad, I've put it in a jsfiddle, here:   I think that's all the details I have, I've disabled all plugins and stuff like that. Thanks for any help.  EDIT: ok so I've since discovered a bit more info. I also forgot to say that the host for the site is Heroku (I'm building for a client and for some reason he's insisting I use Heroku, which is bad choice for WP I know but I can't persuade him otherwise so that's life). I recently installed , which also installed Nginx. So I'm assuming that's whats broken my Permalinks. I then found , which seems to be about the issue I'm having, which links to this page on the Nginx Documentation. Problem is I've never used Nginx before so I don't know where to put all the code it's got in the first section entitled Abridged Basic Setup. Can someone help me out? Thank you :) Do the Imperials know they are evil? I'm trying to find $\int x^x \, dx$, but the only thing I know how to do is this:  Let $u=x^x$.  $$\begin{align} \int x^x \, dx&amp;=\int u \, du\\[6pt] &amp;=\frac{u^2}{2}\\[6pt] &amp;=\dfrac{\left(x^x\right)^2}{2}\\[6pt] &amp;=\frac{x^{2x}}{2} \end{align}$$  But it's certain that this isn't the correct way to evaluate that, and the answer must be wrong. What does `mv ./*` without specifying destination do? I accidentally forgot to specify destination before hitting the Return key. Where does mv ./* without specifying destination move the files and directories under current directory to? I can describe "IMHO" as an acronym for "in my humble opinion."  How can I describe the reverse processes of translating the acronym into the actual phrase?  That is to say, if "IMHO" is the acronym, what do we call "in my humble opinion"? How do I restore iPhone 6s stuck on connect to iTunes screen/Apple logo I'm not really sure how, but after I woke up today, my phone was just displaying the loading spinner and doesn't start up anymore. It's weird because my phone turned off last night and suspecting that it was probably out of charge, I thought charging it overnight would fix the problem.   So, my iPhone is currently stuck on the iTunes/Apple Logo loop. When I put it into DFU/Recovery Mode and connect it to iTunes, it isn't able to restore it. It keeps throwing "Network Connection Problems" -- it downloads iOS 10 for a bit and suddenly stops downloading, throwing the error. I've also tried downloading a custom .ipsw from  but it seems that the file is corrupted whenever iTunes tries to unpack it.   Any thoughts on how I could go about fixing this?   Note - I don't have a jailbroken iPhone. When initiating a battle it starts off in AR mode, but then warns me saying my phone's orientation is not detected. I am then forced to turn off AR mode. Has anybody experienced this? If so, what are the solutions?    Per comments, I am unsure this is a permissions issue. I have everything turned on. What are the solutions to $z^4+1=0$? I own a notebook running Ubuntu 16.04 with Unity DE that does not have any keyboard LEDs to indicate NUM-Lock or CAPS-Lock states.  It would be useful for me to see them anyway, ideally through an indicator in Unity's panel.   Please note that I only want to see the states of NUM-Lock, CAPS-Lock and optionally Scroll-Lock. I do not want to see whether any other modifier keys like Shift, Ctrl, Alt, Super etc. are currently pressed. I only want a replacement for my missing LEDs.  Are there any working indicators available?    I already have read , but it does not suit my needs. indicator-xkbmod only displays a wrong icon but does not react on keyboard NUM-/CAPS-Lock status changes, kbstate is for KDE only and key-mon does not show the NUM-/CAPS-Lock states but indicates key presses to modifier keys.