I have a HashMap&lt;Object, Student&gt; where the Object is the ID of the Student, and the Student is an object from Student.  How can I resort the HashMap by the Students name, student-&gt;getName()?
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?
Filter subscription email is not being delivered (June 2019 - Feb 2020) I have created a custom filter in  and specified that I would like to get email updates:  However, I never got a confirmation mail nor any notifications based on my filter. I tried the &quot;resent confirmation mail&quot; button on the right hand sidebar:  But again nothing happens. The mail address should be fine  I used it for all kinds of notifications from Stack Exchange. For example the rep recalculation email arrived just fine on this address.  I retyped it several times to make sure there really isn't any typo  I double checked that it did not end up in the spam filter  I don't think it is a problem with my particular email provider, users with other mail providers seem to have the same problem, see     This is possibly related to , but this claims to be &quot;status complete&quot;.   EDIT: Although the &quot;status-completed&quot; tag was added, the problem still persists  EDIT 2: As of Feb 2020, it finally works Why do universal constants have the values they do? This is meant to be a generic question of the type that we get repeatedly on this site, in different versions:        Why do universal constants have the values they do? Can we predict their values theoretically? Do they change over time? How would the world be different if a particular constant had a different value? On my work computer I have two USB hard drives that I use rarely. They have a power save mode that sends them into sleep after a couple of minutes of them being idle.   Whenever I open a context menu on a file, the drives are woken up (most likely caused by the "send to" handler).  So I eject the drive, but I can't find a way to get it back, other than unplugging and replugging it in.  Is there a way to unmount the drives, and then remount them only when I actually need them? (On Windows 7 Ultimate.) How to include graphics with spaces in their path? Tikz /.style with two parameters How do I pass two parameters to a tikz style?  I would like to do something like this:  \begin{tikzpicture}[     transformer/.style={draw, cylinder, gray!80, rotate=90, minimum height=#1, minimum width=#2},   And then, I want to use this style in a node:  \node [transformer{2.3cm}{1cm}] () at (0,0.6) {}; With the following circuits as examples :    and    How will the current I know how much to flow? Would any other wave travel first in the circuit and then come back and say so much current should flow? Passing functions to setTimeout in a loop: always the last value? Why not use the Lagrangian, instead of the Hamiltonian, in nonrelativistic QM? Can you use the /testfor command in minecraft 1.8 to find out if a player has died ?  I need it for my map, where 2 players (Only) are pitted against eachother. I want it so that when one of them dies, it will detect the death and declare the victor. How do I install, update and remove GNOME Shell Extensions? I am running Ubuntu GNOME and would like to know how exactly I can install, uninstall, upgrade, deactivate, and activate GNOME Shell Extensions. Man/Tree Symbiosis It was an old book... I'm pretty sure it was a book, and pre-1990's I think. The basic plot was this man somehow interacted with this tree, and as a result he became a carrier of the tree's 'seed'. They were in a symbiotic relationship: the man got a much longer life, more strength, etc.; but when he did die the tree would grow up from his body. When I dip a paper towel in a cup of water the water gets drawn up due to . How is this reconciled with conservation of energy, as it would seem on the surface that the potential energy of the system has gone up with no work being done? I have the following shortcut which opens an SSH instance. How can I modify it so that when SSH closes, the terminal stays open?  [Desktop Entry] Terminal=true Type=Application Name[en_US]=ssh Icon=/logo_sprite.png Exec=gnome-terminal --geometry=... --window-with-profile=... --title=... -e 'bash -c "ssh -t -i ~/dsa.key cle@12.210.9.17 sudo -s"' What is the name of the operation $v^T H v$? To find out how something is called is the one thing I don't know how to use Google for.  If I have a vector $v$ and a symmetric matrix $H$, then the operation $v^T H v$ gives me some sort of projection of the matrix $H$ on the vector $v$. For example if $H$ is the Hessian, the operation gives me the second derivative in the direction of $v$.  What is the name of this operation? I got a UK visa for one month (restricted validity). It expires on November 4. Pakistani citizens are eligible to apply for a Turkish e visa if they have a valid UK visa. I want to visit Istanbul for a couple of days - from October 31 to November 2. Would I be eligible to still apply for an e visa?   My visa is for single entry. It's valid from October 4 to November 4. Converting vector layer to raster using QGIS? In qgis in the raster menu there is an item "convert vector to raster".  This behaves strangely - I do not understand how it is supposed to work.  I can select a vector file, an attribute and an output raster. But, for some reason the output file is only accepted if it exists and even if I select an existing raster nothing seems to happen.  Also I do not understand how the program knows what kind of raster to create, what cell-size, projection etc.  How can I convert vector to raster? How to zero out a drive? I'm currently running Ubuntu 12.04 and want to completely format my laptop so I can install Windows 7 (replace Ubuntu).   When I put in my bootable USB with the OS it just shows a black screen with a white blinking cursor on the top left corner. I wait for hours (to be specific 5 whole hours) waiting for something to happen but I get nothing, so I pull out the USB and my Ubuntu 12.04 loads up.  Repeated this several times with putting different boot priority options on top-est that relate to USB but the results are same. I go and visit some sites on the net like this  that say I have to zero out my hard drive.   My question is how?  Note: Erasing out all my data is no problem cause I have nothing important to backup.  If I have to lose my primary OS (Ubuntu 12.04) in the process I am ready to as my aim is just to install Windows 7 successfully. Please don't answer that there is something wrong with my USB or my USB reader/port/hardware or the content inside the USB cause they all works fine on my brothers PC as it boots up flawlessly. Conditional Expectation of Bernoulli R.V. Let $X_1, X_2,\ldots, X_n$ be iid bernoulli r.v. with parameter $p$. Let $S=X_1+\cdots+X_n$ and $Y=X_1X_2$. Compute $\mathbb{E}(Y\mid S)$.  I know that $\mathbb{E}(X_1\mid S) = S/n$. So If I could split $\mathbb{E}(Y\mid S)$ into two then I would be done. But I don't think that is allowed. How to proceed? The square of an integer is congruent to 0 or 1 mod 4 This is a question from the free Harvard online abstract algebra .  I'm posting my solutions here to get some feedback on them.  For a fuller explanation, see  post.  This problem is from assignment 6.  The notes from this lecture can be found .     a) Prove that the square $a^2$ of an integer $a$ is congruent to 0 or 1 modulo 4.   b) What are the possible values of $a^2$ modulo 8?   a) Let $a$ be an integer. Then $a=4q+r, 0\leq r&lt;4$ with $\bar{a}=\bar{r}$.  Then we have $a^2=a\cdot a=(4q+r)^2=16q^2+8qr+r^2=4(4q^2+2qr)+r^2, 0\leq r^2&lt;4$ with $\bar{a^2}=\bar{r^2}$.  So then the possible values for $r$ with $r^2&lt;4$ are 0,1.  Then $\bar{a^2}=\bar{0}$ or $\bar{1}$.  b) Let $a$ be an integer. Then $a=8q+r, 0\leq r&lt;8$ with $\bar{a}=\bar{r}$.  Then we have $a^2=a\cdot a=(8q+r)^2=64q^2+16qr+r^2=8(8q^2+2qr)+r^2, 0\leq r^2&lt;8$ with $\bar{a^2}=\bar{r^2}$.  So then the possible values for $r$ with $r^2&lt;8$ are 0,1,and 2.  Then $\bar{a^2}=\bar{0}$, $\bar{1}$ or $\bar{4}$.  Again, I welcome any critique of my reasoning and/or my style as well as alternative solutions to the problem.  Thanks. plotting 3d points: z-axis is squashed