How to sort a ConcurrentSkipListMap by value? I'm trying to sort a ConcurrentSkipListMap by value in Java, here is my code :  ConcurrentSkipListMap&lt;String,Float&gt; cslMap = new ConcurrentSkipListMap(new Comparator() {     public int compare(Object o1,Object o2) {         return ((Comparable)((Map.Entry)(o1)).getValue()).compareTo(((Map.Entry)(o2)).getValue());     } }); cslMap_Map.put("B",0.2f); cslMap_Map.put("A",0.1f); cslMap_Map.put("C",1f);   Got an error message when compiling it:     Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map$Entry   What's the correct way to do it ?  Thanks for the answers, but in it's Java doc, it says "The map is sorted according to the natural ordering of its keys, or by a Comparator provided at map creation time", so how to supply it with a Comparator that sort by its values ?
Sort a Map by values I am relatively new to Java, and often find that I need to sort a Map&lt;Key, Value&gt; on the values.  Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key.  Is there an easier way?
A book suggests that we should not interchange "so" and "so that". "So" means "therefore", and "so that" means "in order that". However, it seems to me that in many cases they don't actually have a difference. For example:     Alice got up at 5:00 A.M., so that she could drive her son to school.   If I substitute "so that" with "so", this sentence presents the exact same causal relation to me:     Alice got up at 5:00 A.M., so she could drive her son to school.   I must have missed something here, since English is my second language. Could somebody explain the difference? canonical-livepatch, Doesn't seem to patch anything For a more comprehensive list of monitoring tools and their features, check out .   As the question states, what are the most commonly used tools used for this task and what are their strengths and weaknesses? How do I get the value of a textbox using jQuery? In De Broglie's Explanation for Bohr's Quantization Condition, why do we not use 2πr = n λ/2, why do we use 2πr = n λ? In de Broglie's explanation for Bohr's quantization condition, why do we not use $2\pi r = n\lambda/2$, why do we use $2\pi r = n\lambda$?  We know that in waves on strings, for standing waves creation in a string between two rigid supports, we use "Length of String" $ = n \lambda/2$. Why do we not use a similar concept here? $\delta$ differential notation Various textbooks that I am currently consulting (including Spacecraft Dynamics and Control An Introduction - Anton H.J. De Ruiter | Christopher J. Damaren | James R. Forbes Section 1.4, page 32) use $\delta$, not $d$ or $\partial$ to express an infinitesimal quantity. In the context of the reference text above, the symbol is used as part of a general definition for the derivative of a vector. Specifically, given   $$\mathbf{\vec{r}}=\mathcal{\vec{F^{T}_{1}}}\mathbf{\vec{r_{1}}}$$   where   $$\mathcal{\vec{F^{T}_{1}}}$$   is a vectrix   $$[\mathbf{\vec{x_1}} \phantom{s} \mathbf{\vec{y_1}} \phantom{s} \mathbf{\vec{z_1}}].$$  The time derivative of the vector is defined as   $$\dot{\mathbf{\vec{r}}}\triangleq \lim_{\delta t\to 0}\frac{\delta\mathbf{\vec{r}}}{\delta t}.$$  In this context, what is the difference between $\frac{\delta\mathbf{\vec{r}}}{\delta t}$ and $\frac{d \mathbf{\vec{r}}}{d t}$ ?  Note about thermodynamic use of $\delta$: My understanding is that $\delta$ is used in thermodynamic equations to express path dependence of a scalar quantity such as heat or work. What does it mean in the context of an abstract physical vector? How can I check the version of the available package in the Ubuntu repositories without installing it? We built our eCommerce web site using Angular as a single page application.  We have implemented a spinner that runs until the page is responding with the expected content. We have some category pages which were crawled and indexed by Google but which are no longer available on the site. What is the best practice for old pages?  Should I create &quot;404 Not Found&quot; pages for them instead of saying &quot;loading&quot; forever? Is setting a no index meta tag enough? Do small title edits constitute trivial edits? I need an approach to allow delegated admins (i.e., non-Administators) to add members to Public Groups and Collaboration Groups (the GroupMember and CollaborationGroupMember objects).  I added a custom object (UserGroupRequest__c) to capture which Users should be added/removed to which Groups.    I've also built a batchable class to process the requests.  However, GroupMember is a Setup object, and CollaborationGroupMember is not.  So this doesn't work if I combine the operations in a single batchable class.  Should I instead be using 2 batch classes, calling one from the finish method of the other?    Any recommendations on how best to proceed?  Am I way off base?    Would a trigger on the Request object perhaps be better? I'm guessing that there may be a permission problem if this is attempted via a trigger as the delegated admins won't be able to add users to public Groups.  Also, I'm guessing the trigger approach would run into the same mixed DML issue - on Insert of the Custom object, I would need to Insert/Delete from GroupMember and from CollaborationGroupMember, and then perform a 2nd update on the Custom object to indicate that processing was completed... If I select a feature and run self.iface.actionIdentify().trigger() it will open the identify window but won't open the selected feature's data, how can I make it open the data of the selected feature? UITableViewCell content overlaps delete button when in editing mode in iOS7 How do I make 'X-Axis Mirror' available in Pose Mode? More often that not, while posing an armature, I want to mirror the pose across the X-axis, so that when I move "brow.L", "brow.R" also moves in the same way.  You can copy and paste a mirrored pose, or select both bones prior to performing a transform, but both of these options aren't particularly good workflow wise.  In edit mode, in the tools panel, under options you can enable "X-Axis Mirror" to copy all transforms across the X-axis in real time, but this option is not available in pose mode.  I'm not very experienced with python, but edit source reveals:  col.prop(ob.data, "use_mirror_x")   My understanding is that "use_mirror_x" refers to a boolean property, but I have no idea how to find where that boolean property is defined or if it would be possible to modify it to get the same result in pose mode.  Any advice on this is appreciated. Maybe there's a better way to achieve this?  Thanks. Can one create a video from sequence of meshes that you already have using blender? If I have a sequence of .obj (or any other readable format) files created from my own simulation code (say cloth simulation), can I use the rendering capabilities of blender to generate a video?   Is there a way to set the material properties for frame 1 and use the same or rest of the frames while the corresponding meshes are imported afresh from that ones I provide? Finding all differentiable $f(z) = u(x) + iv(y)$ in $\mathbb{C}$ where $u(x),v(y)$ are real valued functions.   I’m not sure what to do. Would $f$ be differentiable simply if and only if both $u$ and $v$ were differentiable?   My thinking is that if the limit $$ \lim_{h \to 0}\frac{f(z+h)-f(z)}{h} $$  exists then it would be equal to  $$ \lim_{h \to 0}\frac{u(x+h)-u(x)}{h} + i\lim_{h \to 0}\frac{v(y+h)-v(y)}{h} $$  and therefore would exist if they existed. But that doesn’t seem quite right.  I also thought about using Cauchy-Riemann equations, but seeing that I’m trying to find ones that are differentiable rather than those that aren’t, I thought they wouldn’t be of much help. Can I leave the UK and come back in, on a Tourist visa? I know people prefer using CorelDraw or Adobe Illustrator, but I want to know if there is a technique I can follow to use Adobe Photoshop to make vector Images. How can I take a self-portrait without using a remote?  My camera is a Canon Powershot SX210 IS. I do not have a remote, but I do have a tripod. What is the difference between the examples below?  Generally, in a newspaper, news is based on past tense (things which have already happened).   Then why are headlines written in ways that says: He Kills (shouldn't it be: He Killed)?  For example:  Parliament passes bill vs. Parliament passed bill  Also  He kills his friend vs. He killed his friend  Please help. How to add tags to files in Windows 7 so that they appear in search results In Windows 7, I want to add tags to my files (PDF, Word, Images etc) so that they appear directly in the search results, regardless of their content, title etc.    shows how to search by tag, but it does not tell how to add a tag in any file.  In the long term, I'm planning to add such tags programmatically as well.