I want to order a dict by the value of a key. I read this tutorial to sort a dict but it doesn't specify how to order a dict by key or I don't understand how .  I read this data from a json named tweets.json with the following code  with open('tweets.json') as json_file:  json_data = json.load(json_file)   {   "json_data": [     {       "Tweets": "Today, it was my great honor to welcome and host the 2018 @NASCAR Cup Series Champion, @JoeyLogano and @Team_Penske to the @WhiteHouse! ",        "date": "Tue, 30 Apr 2019 23:21:16 GMT",        "id": 1123366738463162368,        "len": 159,        "likes": 23487,        "retweets": 5278,        "sentiment": 1,        "source": "Twitter for iPhone"     },      {       "Tweets": "....embargo, together with highest-level sanctions, will be placed on the island of Cuba. Hopefully, all Cuban soldiers will promptly and peacefully return to their island!",        "date": "Tue, 30 Apr 2019 21:09:13 GMT",        "id": 1123333508078997505,        "len": 172,        "likes": 69469,        "retweets": 22433,        "sentiment": 1,        "source": "Twitter for iPhone"     },      {       "Tweets": "If Cuban Troops and Militia do not immediately CEASE military and other operations for the purpose of causing death and destruction to the Constitution of Venezuela, a full and complete....",        "date": "Tue, 30 Apr 2019 21:09:13 GMT",        "id": 1123333506346749952,        "len": 189,        "likes": 75502,        "retweets": 28047,        "sentiment": 1,        "source": "Twitter for iPhone"     }    ] }   I want to use this function OrderedDict() but I don't know how to specify the key likes  How I can sort this dict by the key likes ?
I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the list: [{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]  When sorted by name, it should become: [{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}]
I want to extend my volume. However the unallocated space lies ahead of the volume. Is it possible to extend this volume without converting it to a dynamic volume?     I tried to use diskpart with the extend command but it doesn't work. Makes sense because the instructions says that the unallocated space has to be behind the volume. What does 'per unit frequency' refer to? We were discussing Kirchoff's theorem on blackbody radiation in class today and the equation was: $$e_{f}= J(f,T)$$  $e_f$ was defined as power per unit area per unit frequency. What does per unit frequency refer to here? I know what per unit time means but don't understand 'per unit frequency'. Folders Completely Hidden Except via Save As I'm using an audio program called Supercollider on Windows 10. I have saved some files in a folder called "tunes" from SC via Save As, but Windows Explorer and CMD both seem unable to recognise access or recognise the "tunes" folder.  C:\Users\HP&gt;cd "C:\Program Files (x86)\SuperCollider-3.7.2\supercollider-robin\tunes" The system cannot find the path specified.  C:\Program Files (x86)\SuperCollider-3.7.2\supercollider-robin&gt;dir/a doesn't show it either.  However, when saving from SC with Save As, it's there clear as day. I can even shift+right-click to get the path: "C:\Program Files (x86)\SuperCollider-3.7.2\supercollider-robin\tunes"  This makes no sense to me. Can anyone explain and tell me how to access my folder tunes folder please? When should I use "a" versus "an" in front of a word beginning with the letter h? A basic grammar rule is to use an instead of a before a vowel sound. Given that historic is not pronounced with a silent h, I use “a historic”. Is this correct? What about heroic? Should be “It was a heroic act” or “It was an heroic act”?  I remember reading somewhere that the h is sometimes silent, in which case it’s an, and when the h is pronounced, it’s a. But then I also remember reading that it depends on which syllable is stressed. And I also think I read somewhere that it might differ between British and American English.  Personally, I pronounce the h, and believe that a is correct. I find that it sounds incorrect to use an and pronounce heroic without the h.  So how do I know when to use a and when to use an with a word beginning with the letter h? Are both acceptable or is there one that is correct? How to quickly send commands to nested tmux sessions? I have the following in my .tmux.conf  set -g prefix M-j bind-key j  send-prefix   I need to press (Atl+J) + (J) + bound-key to send something to the nested tmux session. I feel it is rather slow. Is there any better way? For example, I would love to be able to do (Alt+J) + (2x bound-key) to do stuff in the nested session. I constantly execute commands in the top tmux session instead of executing them in the nested one. Also, how come everybody binds prefix to C-a? I find it awfully slow and unpleasant to type this combination. Am I missing something? How to use AP Style commas after dates I was wondering how you are supposed to use commas after full dates in AP style. I've been told to always put a comma after the year, like in the sentence:  On April 4th, 2012, I found a cat.  However, I thought the following might be an exception:  April 4th, 2012 brought the death of my cat.  Notice how there's no comma after &quot;2012.&quot;  My teacher disagreed and told me that the AP style dictates that we always put commas after dates like that. The way I reasoned through it is by replacing the dates with the word &quot;Monday&quot;  On Monday, I found a cat. Monday brought the death of my cat.  And you wouldn't write  Monday, brought the death of my cat.  TL;DR Which one is correct?  April 4th, 2012 brought the death of my cat.  or  April 4th, 2012, brought the death of my cat. I have customer data from 2 brands. The data structure are the same, but I expected the customer behaviour to be different in different brand.  So I could train 2 models, 1 for each brand, or I could train one model on both brands, but flag which brand the customers belongs to within the data.  So my question is, would training on both brands with flags be too much more work for the Machine Learning (I'm using neural network), and therefore be harder to achieve good accuracy than to have dedicated models for each brand? Why are there two Address lines in Address forms? Experience and a quick Google Images search suggests that it's standard to provide two fields for Address/Street. A colleague argues that it's perceived as two alternative addresses, and that the fact that there's only one country, state, zip, phone just makes it more confusing. I tried to think of a good explanation for having two fields but couldn't. To the reason of "there are some very long addresses" he replies "then why don't they use a multiline input field which would make it clearer that it's the same address".  So, what's the reason? And is it only standard for the US or for Europe as well? When I installed the latest update of Ubuntu, I was asked for the username but I do not remember what my username is. How do I find out what my username is? Is there a word that describes a parent whose child has died?   Along the lines of "orphan", "widow", and "widower", is there a single word for a parent who has lost a child (of any age)? Question Close Updates This week we rolled out a series of changes to  of the question close workflow.  You can read more about the details of these changes .    For context, the overall effort to improve the question close experience will be optimized for Stack Overflow. Given Stack Overflow’s scale, many of the pain points we hear about with question closing and reopening are unique to Stack Overflow and won’t make sense for other network sites. However some  changes are general improvements that should improve usability and guidance overall. Wherever possible, we plan to roll these changes out network wide as well. Any time we roll out a change network wide, we’ll make sure to cross-post here. This first phase is being rolled out to the network and is why I’m posting today.  Let us know if you run into any issues or have questions regarding the network here. What are the origins of the word "nice"? Should OK button be on left of Cancel button or vice versa?   Are there any studies suggesting either of the solutions? Finding an old flight number How can I find an old flight number from over three years ago? I am trying to make a claim for a delay of over five hours. They sent us to the wrong destination and lost our luggage. Can't get Freeglut to work with Haskell on Windows Re-install Ubuntu without losing data in home folder Recently I installed Ubuntu 12.10 x64 Server Edition on my PC. Unfortunately, I attempted to install a lightweight desktop but due to the fact that I have an old graphics card, the PC does not perform so well. I am thinking of re-installing an Ubuntu version but I do not want to lose the contents in my home folder. Is there any way to do that with a Live CD? Troubleshooting "Windows cannot be installed to this disk. The selected disk has an MBR partition table" I recently bought a desktop computer with Windows 7 Home Premium x64 preloaded (OEM). I tried to install Windows 7 Ultimate x64 on this computer but I was presented with the following error message:     Windows cannot be installed to this disk. The selected disk has an MBR   partition table. On EFI systems, Windows can only be installed to GPT   disks.   The 1TB HDD on this computer has three partitions:   SYSTEM 100 NTFS - Healthy (System, Active Primary Partition)  OS (C:) 9148.04 GB NTFS - Healthy (Boot, Page File, Crash Dump, Primary Partition)  HP_RECOVERY (D:) 13.37 GB NTFS - Healthy (PrimarynPartition)   I'm trying to install a clean copy of Windows. How to make foam with bubbles (beer, bath) My goal is create realistic foam. I mean really realistic foam with bubbles, no only SSS shader and done :-).   Use particle system's is not enough, because bubbles overlaps and black artifact's appear.  Any ideas? Some reference images and something about bubbles:    EDIT:  I want this for 360° turntable animation. Bubbles and foam does not to be animated, but should be good keep reasonable render time.  Of course, if someone know how to make it animated I glad to learn it and I'm sure I'm not only one. But my priority is realistic look, not animation.  Only for clarification: I don't need to know how to make bubbles in beer (there is very good tutorial by Andy Price), please focus only on foam. Beer is not important. The replier's From email address is modified when Marketing Cloud RMM forwards an email to the routing address We've set up RMM to forward replies to routing address and SFMC adds our subdomain to the replier's From email address (i.e. replier@gmail.com becomes replier.gmail.com@oursubdomain.com). However, their reply-to address remains the same.  It seems like DMARC Forward Reply Rewrite is enabled, but we were advised not to touch it as that may affect email deliverability.  Is there any workaround to this? And what will happen if we disable this feature? I have the following image    that was created with this code:  \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{tikz} \usepackage{tkz-euclide}  \begin{document} \usetkzobj{all} \begin{tikzpicture}     \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]     \tkzSetUpLine[line width=1]     \tkzDefPoints{0/0/A, 3/0/B', 2/2/C, 4/4/C'}     \tkzDefLine[parallel=through C](B',C') \tkzGetPoint{Phelper}     \tkzInterLL(A,B')(C,Phelper) \tkzGetPoint{B}     \tkzDrawLine[add=0 and 0.2](A,B')     \tkzDrawLine[add=0 and 0.2](A,C')     \tkzDrawSegment(B',C')      \node at ($(A)+(-0.1,-0.2)$)  {$A$};     \node at ($(B')+(0.2,-0.2)$)  {$B'$};     \node at ($(C')+(0,0.4)$)  {$C'$};     \node at ($(B)+(0.2,-0.2)$)  {$B$};     \node at ($(C)+(0.28,0.5)$)  {$C$};     \tkzDrawPolygon[ultra thick,color=blue,fill=blue!20](A,B',C')      \tkzDrawPolygon[line width=0.3pt,color=red,fill=red!20](A,B,C)      \tkzDrawPoints(A,B',C',B,C)     \tkzLabelSegment[below,red](A,B){$c$}     \tkzLabelSegment[left,red](A,C){$b$}     \tkzLabelSegment[right,red](B,C){$a$}     \tkzLabelSegment[below,blue,pos=0.8](A,B'){$c'$}     \tkzLabelSegment[left,blue,pos=0.8](A,C'){$b'$}     \tkzLabelSegment[right,blue](B',C'){$a'$} \end{tikzpicture} \end{document}   As you might notice, the space above C' is bigger than necessary. This is because of Phelper. I need Phelper for the construction, but it should not influence the image size in any way. I've tried to get Phelper closer to C, but that seems not to be possible.  How can I stop defined (but not visible) points from influencing image size?  Please note: I wrap code like this in a figure. So images like the one above are only a part of the whole document. So working with standalone does not solve my problem.