How are we able to sort a HashMap&lt;key, ArrayList&gt;?  I want to sort on the basis of a value in the ArrayList.
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?
How to make Unicode charset in cmd.exe by default? What do you call the functions that make a composite function.  Example : $e^{\sin x} $ is made up of $\sin x$ in the argument of $e^x$  So what are $\sin x$ and $e^x$ called here in this context? Basic functions or something?   (Please don't tell me the former is trig and latter is exponential function, I know that, but that's not what I'm asking here, please try to understand)  Hope I made myself clear. Per-site Meta post didn't populate Moderator Inbox Per  I'm posting this issue.  I'm a moderator over on Sci-fi &amp; Fantasy.SE.  My moderator inbox missed :    The Meta Question in question should show up after the moderator message and before the new meta question, as it was posted on Jan 2 (it's currently Jan 6, so '2 days ago' is Jan 4). Mathematica envelope for the bottom of a plot, a generic function Behavior of $\sum a_n x^n$ given $\sum |a_n - a_{n-1}| < \infty$ Let $(a_n)_{n=0}^{\infty}$  be a sequence of real numbers satisfying $\sum_{1}^{\infty} |a_n - a_{n-1}| &lt; \infty$   Which of the following conclusions must then be true?  The series $\sum a_nx^n$ converges   Nowhere on $ \mathbb{R}$ Everywhere on $  \mathbb{R}$ On some interval containing $(-1,1)$ Only on $(-1,1)$   What I have tried is Make an inequality with $|a -b| \leq |a| +|b|$ .. but i cant proceed further .. Any sort of help will be deeply appreciable . String output: format or concat in C#? Let's say that you want to output or concat strings. Which of the following styles do you prefer?   var p = new { FirstName = "Bill", LastName = "Gates" }; Console.WriteLine("{0} {1}", p.FirstName, p.LastName); Console.WriteLine(p.FirstName + " " + p.LastName);   Do you rather use format or do you simply concat strings? What is your favorite? Is one of these hurting your eyes?  Do you have any rational arguments to use one and not the other?  I'd go for the second one. We use unit length Quaternion to represent rotations. Following is a general rotation matrix obtained ${\begin{bmatrix}m_{00} &amp; m_{01}&amp;m_{02} \\ m_{10} &amp; m_{11}&amp;m_{12}\\  m_{20} &amp; m_{21}&amp;m_{22}\end{bmatrix}}_{3\times 3}\tag 1 $.   How do I accurately calculate quaternion $q = q_1i+q_2j+q_3k+q_4$for this matrix?Means   how can we write $q_i$s interms of given $m_{ij}$  accurately? How can I cast int to enum? How can an int be cast to an enum in C#? As an Indian citizen, can I apply and have both a B1 and F1 visa? How to block specific websites without using Parental Controls? How do I disable negative scaling? By default blender allows you to scale past 0 - how do I prevent this?  i.e. it's common in other 3D modelling software to resize a set of vertices against an axis to align them - however this isn't possible when negative scaling is enabled. I'm having a bit of a trouble with the below question     Given $G$ is an undirected graph, the degree of a vertex $v$, denoted by $\mathrm{deg}(v)$, in graph $G$ is the number of neighbors of $v$.   Prove that the number of vertices of odd degree in any graph $G$ is even. Let $f(\sin x)$ be a given function of $\sin x$.   How would I show that $\int_0^\pi xf(\sin x)dx=\frac{1}{2}\pi\int_0^\pi f(\sin x)dx$? If Cooper wanted to stay, why did he send the NASA Coordinates? In Interstellar, after Cooper arrives in the Tesseract, Cooper tries to send the message STAY to his daughter in the past so she won't let him go on the mission. If that was his intention then why did he send the coordinates of NASA afterwards? If he didn't send the coordinates, he wouldn't have found NASA or go into space, he would have stayed. Terms for collections of animals As I watched the murder of crows sitting on the line above my house this evening, I got wondering where all of the collective nouns for animals (pod of whales, gaggle of geese, pride of lions) came from and why we need so many.    If sheep can be a flock, why can't whales, geese, lions, and crows? How do I install different (upgrade or downgrade) PHP version in still supported Ubuntu release? I am trying to update to install PHP 5.5, 5.6 or 7.0 in Ubuntu 12.04/14.04/16.04 LTS, and I can only get PHP 5.3.10 for Ubuntu 12.04, PHP 5.5.9 for Ubuntu 14.04 or PHP 7.0.4 for Ubuntu 16.04 using official repositories (using apt-get).  I'm not really sure how to do a manual update – as I need:   to play around with the new(est) PHP features to install older PHP version due support in the software Backslash escaping in code regions in comments I've noticed that in comments, when you create `code region` with backticks, the backslash will still work as an escape character within that region (but it should not, IMHO).  To clarify:   In comments, `\\` will be rendered as \, but it should be rendered as \\ In the post body itself, `\\` will be rendered as \\ (i.e., correctly)   This is especially confusing when you enter regular expressions into a comment, since backslash-escaping is very common there, and confusion increases if you are dealing with a regex that is double-escaped for representation in a string.   At some point you lose track how many backslashes you must make so the comment renders correctly, or you don't notice fast enough (or at all) and the comment contains wrong code where the same markup in a question or answer would come out as perfectly correct.   It's just that comments can't be corrected anymore after the grace period, leaving you with the choice of either deleting the comment, thus crippling the conversation, or engaging in a trial-and-error game of writing another comment with even more backslashes to explain the issue.  My question is two-fold:   Will this error be corrected? If yes, existing comments should probably be searched and "fixed" by a routine that tries to do the right thing (this is probably somewhere between hard and impossible) Or, can I rest assured that never ever the behavior of the backslash in comments is going to be changed, so I can start working around this issue by hand, knowing that they won't start displaying incorrectly at some point in the future? Proving that $AB-BA=cI$ for nontrivial $c \in \mathbb{C}$ I have a homework question I can`t solve:  Let $X$ be a normed linear space, $A,B \in B(X)$. Show that there exists no nontrivial $c \in \mathbb{C} $ such that $AB-BA=cI$.  Thanks alot already guys! I seem to have a professor who gives impossible homework problems.  The hint he gave: $A^{n}B-BA^{n}=ncA^{n-1}$, $n \in \mathbb{N}$ I'm just going to throw this out there, but Google indexes Stack Overflow really quickly Using Replace Geometry to replace selected feature with circle in ArcGIS Desktop? I have a polygon shapefile and I want replace every irregular polygon with a circle.  I think I can do it with the Replace Geometry tool. But once the Replace Geometry tool is selected, draw a polygon mode is immediately entered. If I select the circle tool in the Draw tool window, the Replace Geometry tool becomes inactive.  Is there any way to use the Replace Geometry tool to draw a circle polygon?