Sorting values in large dictionary fetched from mysql in python
How do I sort a dictionary by value?
How do I tackle this combinatorics problem about married couples around a table? Can one of Newton's Laws of motion be derived from other Newton's Laws of motion? Can one derive Newton's  second and third laws from the first law or   first and third laws from the second law or  first and second  laws from the third  law  I think Newton's laws of motions are independent to each other. They can not be derived from one another. Please share the idea. I don't really know how to anticipate the changes in an option's price.  If I have an call set to expire the following Friday at $10 above the current share price, I know in the absence of other changes it loses value with each day that passes getting closer to its expiration. (Talking about American options.) But it gains value as the share price gets closer to the strike price.  So, if two days pass but the stock goes up $3, would the option have gained value or lost value? Is there any way to calculate this? How do I build a house for my NPCs? I read on the wiki that people will move in under the following conditions:   You do something to please them An empty house is available with a light source, table, and chair (also with walls).   I have a house which is about 7x8, then a roof space above that; about half the area. I could put furniture up there too, but will anyone move in? Force "portrait" orientation mode Editing Photoshop (PSD) files on Ubuntu? I was wondering that is it possible to edit PSD files on Ubuntu (like with Gimp). Actually, I need to edit layers. I haven't managed to do it. It would be nice if there is a chance! :) When you have a link from lets say twitter that is t.co/foo that links back to your website how does that effect SEO and how do the major search engines handle Shortened URLs? I have installed Ubuntu Server on an old desktop, and I'm new to this.  I had set it up and was trying to connect through Putty but that was not working.  When I tried ifconfig there was no eth0 IP address, and logging onto the router showed the only device connected by ethernet is the printer.  However, the ethernet cable is plugged into the server and is showing the green light by it.  I tried opening /etc/networking/interfaces but this shows the following:  source /etc/network/interfaces.d/*  # The loopback network interface auto lo iface lo inet loopback   I tried adding 'auto eth0' after this and saving but made no difference, and have tried sudo ifconfig eth0 up which didn't do anything either.  sudo lshw -C network says that the network is DISABLED.  Any ideas to help get this up and running?  EDIT: Running command lspci -knn | grep Eth -A3 results in the following:  02:05.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8110SC/8169SC Gigabit Ethernet [10ec:8167] (rev 10)          Subsytem: Gigabyte Technology Co., Ltd GA-MA69G-S3H Motherboard [1458:e000]          Kernel driver in use: r8169          Kernel modules: r8169 Use of the comment package Story about a deadly alien creature on another planet that has some chemical in its body that makes it faster Why is plain-hash-then-encrypt not a secure MAC? Possible to change where Android Virtual Devices are saved? I have found film reels some with tails of film others not. Is there a way of telling if they have been exposed/used in a camera? Film types are for 35mm and one Kodak Advantix. Is using "fruits" as the plural of "fruit" acceptable? Why do I get the error "failed unmounting /var" during shutdown? I have a fresh install of Debian 9.0.0. It has a separate 1 GB partition for /var formatted at ext4. When I shutdown from the terminal, using shutdown -h now, there is a bright-red error message stating "failed unmounting /var".  What is the fix for this error? Attributing contributions to academic work that occur in Stack Exchange How to install Flash player on Ubuntu? Even though I have the latest Adobe Flash player 11.2 for Linux in Firefox -   - a particular online flash game still requests that I update to the latest flash player.  I've tried this online game on my laptop (Windows 8 with Flash Player 11.8) and it has no problems.  Is there a way to trick Ubuntu or this game into thinking Flash Player 11.8 is "installed"? So, I was just assaulted by a trio of fairly well armed thugs while walking out of Riften. Before attacking me, they informed me that they were 'here to teach me a lesson.'  After dispatching them in due course, I found this on the body of what I can only assume to be the leader, given his vastly superior armaments:   Orgnar is the innkeeper in Riverwood. Now, I admit, I've stolen a fair amount, but I pride myself on having never been caught. My total bounty to date is at zero. So, how did he figure out that I stole something, why is he taking the law into his own hands, and if I go back to Riverwood, am I going to get shanked? What are attention mechanisms exactly? Attention mechanisms have been used in various Deep Learning papers in the last few years. Ilya Sutskever, head of research at Open AI, has enthusiastically praised them:    Eugenio Culurciello at Purdue University has claimed that RNNs and LSTMs should be abandoned in favor of purely attention-based neural networks:    This seems an exaggeration, but it's undeniable that purely attention-based models have done quite well in sequence modeling tasks: we all know about the aptly named paper from Google,   However, what exactly are attention-based models? I've yet to find a clear explanation of such models. Suppose I want to forecast the new values of a multivariate time series, given its historical values. It's quite clear how to do that with an RNN having LSTM cells. How would I do the same with an attention-based model? Can there be an option to allocate rep from any site account for offering a bounty? I think it would be useful if we had an option when deciding to open a bounty on a question that we could choose to allocate rep from one site even though the bounty is being offered on another site.  For instance I would like to use my rep from SO for putting a bounty on a question that resides on SF. I don't have enough rep on SF to make it enticing. So when you click on "start a bounty" you get sliders for each site that you can pull your rep from, maybe make it where you need to burn up all your rep for the site that your asking the question on and then allocate more rep from other ones, if you have it.  thanks devinb for clearing up my question with your comments! " transfer rep INTO a bounty. But you can't transfer rep across accounts. So, the rep you'd 'lose' from SO would never actually go into your SF account, it would go straight onto a bounty on whatever question." – devinb