How can we sort a dictionary in python using the internal state of the value?  For example:  myDict = {'a': {'day': [0, 1, 2, 5], 'week': [4, 3, 1, 2, 3]},           'b': {'day': [0, 6, 2, 5], 'week': [4, 3, 1, 2, 3]}}   I want to sort the dictionary keys by the second value of the day list for their corresponding value dictionaries.
I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary.  I can sort on the keys, but how can I sort based on the values?  Note: I have read Stack Overflow question here  and probably could change my code to have a list of dictionaries, but since I do not really need a list of dictionaries I wanted to know if there is a simpler solution to sort either in ascending or descending order.
How can I revert a config file back to the originally installed version after I have edited it? Possible to bake texture to new UV map? I have a finished model where the UV maps overlap - lots of wood that isn't detailed to be particular to the model.    I'd like to re-map the texture so that specific details can be added. I'd like to rebuild the UV map into non-overlapping islands, without losing the current texture application, and preferably without manually pulling apart the islands.  Is this possible? Auto-inserting Stack Overflow affiliate into all Amazon links We have officially discontinued the Amazon book affiliate remnant ads, since despite our best efforts they don't perform well for our audience and cannot be made to perform well.  We've often wondered,   I'm thinking this isn't a problem; it has gotten lots of support historically. So we're going to go ahead and do it, so the company Amazon account is still getting some use, and we benefit a little.   To be clear: from this point on, all Amazon links posted on all sites will automatically be rewritten to add our affiliate link. We have a clever affiliate redirect that geolocates the IP address and redirects to the appropriate regional Amazon store (amazon.uk, amazon.ca, et cetera).  If you have any feedback on this, or suggestions, as they say &hellip; speak now or forever hold your peace! How much time do I have to wait before I can sell another car? I was wondering: How much time does it take until the cooldown resets and I can sell another car in the GTA Online LS Customs Garage? Does higher education exist in Harry Potter? I (as a middle-school student) was wondering how virtual particles even conserve energy of the entire system? I don't mean just the particle's energy, but conservation with respect to the surroundings?  Let me explain more, Einstein proved that $E = mc^2$ and equivalently, we can say $m = \frac{E}{c^2}$ . We however know mass causes curvature in space-time (gravity well). Now that statement being completely valid we can use Quantum Fluctuation, implying energy and time can be related by the relation:  $\Delta{E}\Delta{t}\approx\frac{\hbar}{2}$ and by that simple relation we can make the following points:   As the energy increases, the time allowed to be "borrowed" decreases, before it gives it back to the universe. As time increases, the energy allowed to be "borrowed" decreases.    These are completely satisfactory points I've made, I believe.  Now, I have read that the vacuum is filled with constantly bubbling virtual particles that get created from the energy "borrowed" by the above relation and is destroyed again, which satisfies the energy conservation laws.   This seems to imply that  in the short time the virtual particle exists, they must have a very small mass which is: $m_{1} = \frac{\Delta{E}}{c^2}$ and using basic classical mechanics rather than GR (for sake of simplicity) we calculate that the gravitational force mediated by this short-lived virtual particle;  $F_{g}= G\frac{m_1 * m_x}{r^2}$   where $m_x$ is an particle\mass in question. Nevertheless since we know the force set upon an object moves the object in a direction, we can say it would increase its kinetic energy by this factor: $F_g = \frac{1}{2}mv^2$ which is equal to $G\frac{m_1 * m_x}{r^2} = \frac{1}{2}mv^2$.  Surely, this implies that every time quantum fluctuations happen, energy of real-particles\masses increases and therefore violates energy conservation, but what prevents this violation from taking place?  If virtual particles are not really present and interact with objects like I thought, how can Hawking radiation (currently a large concept in black hole physics) then be accepted in physics community? What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them.  If so, why not promote 64-bit over 32-bit? Ubuntu not detecting second monitor I'm running Ubuntu 12.04 on a Lenovo x61s Thinkpad. As the screen's rather small and I want to do some video editing, I thought I'd plug in a monitor and use that. The monitor is Relisys JM777 (quite old).  When I plug it into my other computer, which is running Windows 7, it immediately mirrors the display; but when plugged into the Lenovo the monitor screen remains blank. The graphics card on the Lenovo is a "VGA compatible controller" according to SysInfo.   Anybody got any suggestions for getting this monitor to work? I'm quite new to Linux. To tell about a guess about a case in the past, why use "would+have+past participle" instead of "must+have+past participle? I have seen this sentence in an article on bbc, which is about how people lived thousands of years ago. &quot;When this Neolithic home was built, it would have had a cosy roof of turf..&quot; When I read it, I got confused. Because the fact seems as a simple past situation or guessing/assumption about something in the past. it simply gives information about a past event, eg &quot;when I was a child, I had a blue toy car. I have been making a lot of research on whether or not this structure &quot;would+have+past participle&quot; could be used instead of the simple past or &quot;must+have+past participle&quot;, but I could not find any satisfying explanation. Almost all grammer contents cover this structure is used when we imagine the opposite of what actually happened in the past eg. &quot;referring to a missed opportunity&quot; (eg. &quot;if you had come to the party, you would have seen Tom.&quot;), But, in this case of this sentence, &quot;type 3 conditional&quot; is irrelevant. It is not an if sentence,  It simply gives information about how this house was like or was probably like when it was built long ago. Just like it would be If and old lady would want to tell about &quot;how she was like when she was a child years ago. she would simply say &quot;when I was a child, I had long curly hair.**. So &quot;when I was a child, I would have had long curly hair.&quot; would be wrong. So, my question is: 1-Does this structure &quot;would+have+past participle&quot; completely replace simple past sentences? or can be it be used instead of simple past? 2- If this structure was simply used because the author was not %100 sure about the fact as it was a long long time ago -so he wanted to make a guess or assumption, why did he not simply use &quot;must+have+past participle&quot; or &quot;it was likely that blah blah&quot; which must be used for guessing or assumptions about past happenings. Would it not have made more sense if it was like: &quot;When this Neolithic home was built, it must have had a cosy roof of turf. How to use d3.min and d3.max within a d3.json command Why does paper become translucent when smeared with oil but not (so much) with water? When I smear oil onto a scrap of paper and rub it in, the paper becomes quite translucent; but when I attempt the same with water it doesn't as much. Why? Does anybody know where to download the QGIS toolbar icons? Including all the jars in a directory within the Java classpath I would like to know the equipment and the step by step process, as I have already tried to do it, but it didn't work.  I have already watched several videos, but it is not the same to talk to someone that really loves, and knows how to do it. I don't know anybody that knows how to brew anything xD How do I get the current location of an iframe? Limiting double to 3 decimal places Update Windows 8 Enterprise to Windows 8.1 Enterprise KMS activation So it is shown that volume license packages of Windows 8, like Pro and Enterprise, are unavailable for upgrading.  I received a link last night to download the Windows 8.1 Enterprise 90-day Evaluation, but it will replace my current Windows 8 Enterprise version.  Is it known when these versions will become available for upgrade? I've been waiting patiently for weeks to get this upgrade.  Thanks. Rainbow Six Siege Insane Load times? Computer or Internet? I have a high-end computer with decent ethernet yet whenever I join a game in Siege everyone finishes loading and it takes me 1-5 minutes. Is this because of my internet or computer?   Specs:  CPU - i7-7700k GPU - GTX 1080 16GG RAM 5900 RPM 4TB Hard drive So I have a torus, and I need it to "telescope" open -- kind of like Pacman's death animation, but with a torus instead of a sphere.  I'm very new to 3D modeling/animating so I really have no clue how to tackle this problem.  Any advice to help me get pointed in the right direction would be most appreciated :) Limiting range of value types in C++