I have a Python dictionary like this:  {    'apple': datetime.datetime(2012, 12, 20, 0, 0, tzinfo=&lt;UTC&gt;),    'orange': datetime.datetime(2012, 2, 4, 0, 0, tzinfo=&lt;UTC&gt;),    'raspberry': datetime.datetime(2013, 1, 9, 0, 0, tzinfo=&lt;UTC&gt;) }   What is the best way to sort the dictionary by the datetime values? I am looking for a list output with the keys in order from most recent to oldest.
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.
I have just fitted a new screen to my iPhone 5s, and i need to restore it to factory settings.  One problem though, it's disabled for over 23,000,000 minutes and the home button doesn't work.  Does anyone know how I can restore it? How to use enum values in f:selectItem(s) When and why will a compiler initialise memory to 0xCD, 0xDD, etc. on malloc/free/new/delete? Are there any rules on the positioning adverbs should take in a sentence? For example:     Ever wish you could share information broadly   Could it be rewritten to:     Ever wish you could broadly share information   Are there any rules for the position of the adverbs. Today I started having the following issues in Pokémon GO:   I can't spin pokéStops and get rewards When I catch pokémon, even the lowest CP ones, they escape every time. I've tried using razz berries, that doesn't work. Neither does using great balls.   I do have Internet. I'm not on wifi. I can send messages and browse Internet.  NOTE: I did try to modify my gps location and I was unsuccessful. I only got a pokémon or two and deleted them immediately. I do apologize for trying to hack it but I'm now fully legit. macOS app for showing external HDD usage statistics? I'm planning on selling a used external HDD on eBay.  Are there any applications for Mac out there (preferably free) that can show me statistics about the usage history for the drive so that I can let potential buyers know the condition more precisely? Fibonacci combinatorial identity: $F_{2n} = {n \choose 0} F_0 + {n\choose 1} F_1 + ... {n\choose n} F_n$ Can someone explain how to prove the following identity involving Fibonacci sequence  $F_n$  $F_{2n} = {n \choose 0} F_0 + {n\choose 1} F_1 + ... {n\choose n} F_n$ ? So I was searching for one of my own websites on Google: http://www.botlibre.com  and to my surprise found some clones of my website, like:  http://83waystowasteyourtime.adidas.com  and:  http:// mediaiq.astral.comm  My question are:   Why are they creating clones of my website?  Some kind of SEO scheme or what? What gain could they be getting? How do they have a URL at adidas.com and astral.comm?  I assume it's not Adidas steeling my content. How do I shutdown these sites and stop people from stealing my content? (on Tomcat) I am trying to think of a non-colloquial word or phrase that means "practice what you preach." I would appreciate any suggestions. Thank you! Every real number in $[0,1]$ has a decimal expansion $0.d_1d_2d_3...$, so construct an infinite tree rooted at 0 where each node has branches leading to $\{0,1,2,3,4,5,6,7,8,9\} $, and let each path through the tree represent the successive decimal digits of a real number. To enumerate them, go through the tree breadth-first i.e. layer-by-layer. How can I cast int to enum? How can an int be cast to an enum in C#? Sockets: Discover port availability using Java Is there anything in the physics that enforces the wave function to be $C^2$? Are weak solutions to the Schroedinger equation physical? I am reading the beginning chapters of Griffiths and he doesn't mention anything. Uninstall kubuntu-desktop I installed kubuntu-desktop using sudo apt-get install kubuntu-desktop but I no longer want to use KDE.  How do I remove all the packages that were installed by this command ?  Thank you I just upgraded my texlive distribution and can no longer insert space in table rows using \\[x pt] syntax when colortbl is loaded.  It seems that recent changes to array.sty might be the problem as this is the only package to change recently.  Can anyone suggest a workaround?  MWE  \listfiles \documentclass{article} \usepackage{colortbl} \begin{document} \begin{tabular}{l}   \hline   No space below with \texttt{colortbl.sty} loaded. \\[10mm]   \hline \end{tabular} \end{document}   File versions in use:   article.cls    2014/09/29 v1.4h Standard LaTeX document class   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option) colortbl.sty    2012/02/13 v1.0a Color table columns (DPC)    array.sty    2018/04/07 v2.4g Tabular extension package (FMi)    color.sty    2016/07/10 v1.1e Standard LaTeX Color (DPC)    color.cfg    2016/01/02 v1.6 sample color configuration   pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex Verification that $\lim_{x \to a}\frac{f(x)-f(a)}{x-a}$ and $\lim_{h\to 0}\frac{f(a+h) -f(a)}{h}$ are equivalent definitions of the derivative. I wanted to verify that for definition of the derivative it is true that:  $$ \lim_{x \to a}\frac{f(x)-f(a)}{x-a}= \lim_{h\to 0}\frac{f(a+h) -f(a)}{h}$$  If I denote $h=x-a$,  we can  let $x\to a$, this means that $h \to 0$. Also notice that $f(x)=f(a+h)$ $$ \lim_{x \to a}\frac{f(x)-f(a)}{x-a}=\lim_{h \to 0}\frac{f(a+h)-f(a)}{h}$$ As desired. Is the main idea here really just to use a variable substitution? I suppose there is some formal theorem I also use here that when $f(x) \to y$  we can let $g(f(x)) \to g(y)$ if the function $g$ is continuous. Can a concentration spell be cast without actually concentrating on it for an "instant" effect? What's the physical meaning of the imaginary component of impedance? As you know, impedance is defined as a complex number.  Ideal capacitors: $$ \frac {1} {j \omega C} \hspace{0.5 pc} \mathrm{or} \hspace{0.5 pc} \frac {1} {sC} $$  Ideal inductors: $$ j \omega L \hspace{0.5 pc} \mathrm{or} \hspace{0.5 pc} sL $$  I know that the reason why they 'invented' the concept of impedance is because it makes it easy to work with circuits in the frequency domain (or complex frequency domain).  However, since in real-life circuits both voltages and currents are real numbers, I'm wondering if there is any actual physical meaning behind the imaginary component of impedance. How to troubleshoot unwanted white spaces smartly? Why is there a white space on the left side?  \documentclass{standalone} \usepackage{asymptote} \begin{document} \noindent \begin{asy} size(10cm,10cm); draw((0,0)--(100,100)); draw((0,100)--(100,0)); dot((50,50)); \end{asy} \end{document} I'm not particularly fond of apps cluttering my $HOME directory with their own files or directories. It's rarely a problem, because most apps have the courtesy to hide their data by prefixing it with a dot or conforming to the ~/.config standard. But not snap.  Q1: Have I misunderstood this directory?  Is ~/snap really a directory which I'm supposed to enter and access on a daily basis on a par with ~/downloads, ~/pictures, ~/work, etc?  Q2: In any case: Can I move it e.g. ~/.snap?  I can't find anything like /etc/snap, /etc/default/snap, or ~/.config/snap to tweak things. I tried export SNAP_USER_DATA=$HOME/.snap but it didn't work.