Iterating through a HashMap containing objects java
How do I efficiently iterate over each entry in a Java Map?
How can I revert a config file back to the originally installed version after I have edited it? I want to revert a file in /etc/ back to its originally-installed form. I have edited the file since it was installed. How can I revert this config file? Apt is smart enough not to overwrite edited config files, so how do I tell it that I want it to do so?  For argument's sake, let's say that I want to revert the file /etc/foo.conf from the package foo. Why does the zoom sometimes stop at a point? Exporting video to .mov in Blender 2.79 In the past, Blender (at least the Mac version) has had the ability to encode video files as .mov, the format used by Quicktime Player. However, with Blender 2.79 this feature seems to have vanished, for both the Internal and Cycles render engines. The release log happens to have the entry "Video encoding settings have been simplified, along with the addition of a Constant Rate Factor (CRF) mode" which I suppose could be the cause.  Does anyone know what happened—whether it is the aformentioned reason or something else—and how to export videos as Quicktime .mov in Blender 2.79? Why do I get blurry pictures when I take a lens attachment off? Verify the identity: $\tan^{-1} x +\tan^{-1} (1/x) = \pi /2$ Verify the identity: $\tan^{-1} x + \tan^{-1} (1/x) = \frac\pi 2, x &gt; 0$  $$\alpha= \tan^{-1} x$$  $$\beta = \tan^{-1} (1/x)$$  $$\tan \alpha = x$$  $$\tan \beta = 1/x$$  $$\tan^{-1}[\tan(\alpha + \beta)]$$  $$\tan^{-1}\left [{\tan\alpha + \tan\beta\over 1 - \tan\alpha \tan\beta} \right]$$  $$\tan^{-1}\left[ {x + 1/x\over 1- x/x }\right]$$  $$\tan^{-1}\left[{x + (1/x)\over 0} \right]$$  I can't find out what I'm doing wrong.. Expected number of games played in a game with 'win by two' rule. Calvin and Hobbes play a match consisting of a series of games, where Calvin has probability p of winning each game (independently). They play with a “win by two”” rule: the first player to win two games more than his opponent wins the match. What is the expected number of games played? My attempt: I use Markov chains. Let $S$ denote that starting state, $W$ and $L$ denote the states where Calvin and Hobbes win respectively. Then, I have $$\mu_S = 1+ p\mu_W+q\mu_L $$ $$\mu_W = 1+ q\mu_S $$ $$\mu_L = 1+ p\mu_S $$ where $\mu_j$ denote the expected number of games from state $j$. Solving the system, I get the solution $\mu_S = \frac{2}{1-2pq}$ which I think is correct. I however would like to know how to approach it with geometric distribution instead of Markov chains. I read one solution where the number of games is given as $1+\text{Geom}(p^2+q^2)$ but I do not understand it. My understanding is that for the game to stop, the required probability is $p^2 + q^2$ since this is the probability that either Calvin or Hobbes win two games in a row. How to use this information in a Geometric random variable? Thanks. Should I use the first or last bits from a SHA-256 hash? I have the need for a hexadecimal token that is smaller than the normal length of the hexadecimal representation of a  hash.  Should I take the first bits or the last bits? Which of them contain the most entropy? Effects:  +25 attack damage +15% life steal +40% attack speed Passive  Unique: Your attacks deal 5% of the target's current health in physical damage (60 max vs minions and monsters). Active   Unique: Drains target champion, dealing 15% of the champion's maximum Health in physical damage and healing you by the same amount. Additionally you steal 30% of their movement speed for 4 seconds - 60 second cooldown. (500 range)  Cost: 3200g VS.   Effects:  +70 attack damage +12% life steal Passive: Gain +1 attack damage and +0.2% life steal per kill (maximum +30 attack damage and +6% life steal). Half of the bonuses are lost upon death.  Cost: 3200g What is better for what situations, and when should you build BT instead of BotRK and Vice Versa. Which provides more lifesteal, the only variable being the stats of the weapon? I find myself constantly questioning my decision on which weapon to get and would really love some in depth answers. Would be great if any examples given were given from the ADC side of the house. Do the topologies with the same convergent sequences coincide? Do the same sequential convergence in two topologies the result are the same topologies? Let $X$ be topological  space with topologies $\tau$, $\tau'$. Let $(x_{n})\in X$ and $x\in X$ and $(x_{n})\rightarrow x$ with $\tau$ if and only if $(x_{n})\rightarrow x$ with $\tau'$. Do the two topologies on $X$ coincide? Performance difference between dot notation versus method call in Objective-C How can I use function's parameter in it? Let $x_{1},x_{2},\cdots,x_{n}$ be real numbers. Show that     $$\sum_{i,j=1}^{n}|x_{i}+x_{j}|\ge n\sum_{i=1}^{n}|x_{i}|.$$   I think this problem may be solved using nice methods, but I can't find them yet; I know this may be of use: $$|a|+|b|\ge |a+b|.$$ But I can't make it work. Thank you everyone. Do we really need a [source-code] tag? The  tag doesn't appear to be very useful.  It's used in a variety of ways (for reading, writing, showing, transforming, compiling, translating, obfuscating, obtaining, ... source code) on 1747 questions right now, and doesn't appear to be adding any classification value to the site.  Can we get rid of it? How to deal with cross-thread access exceptions? When to use "If I was" vs. "If I were"? If I was... If I were...   When is it correct to use "If I was" vs. "If I were" in standard English? No error message if the URL is very long I entered a URL with a very long parameter on Stack Exchange.  I have type this url    It shows a blank screen , does not shown any messages.    We need to show a “Page Not Found” message, same as what you did on other Stack Exchange pages. I am just a high school student, and I haven't seen much in mathematics (calculus and abstract algebra).  Mathematics is a system of axioms which you choose yourself for a set of undefined entities, such that those entities satisfy certain basic rules you laid down in the first place on your own.  Now using these laid-down rules and a set of other rules for a subject called logic which was established similarly, you define certain quantities and name them using the undefined entities and then go on to prove certain statements called theorems.  Now what is a proof exactly? Suppose in an exam, I am asked to prove Pythagoras' theorem. Then I prove it using only one certain system of axioms and logic. It isn't proved in all the axiom-systems in which it could possibly hold true, and what stops me from making another set of axioms that have Pythagoras' theorem as an axiom, and then just state in my system/exam "this is an axiom, hence can't be proven".  EDIT : How is the term "wrong" defined in mathematics then ? You can say that proving fermat's last theorem using the number-theory axioms was a difficult task but then it can be taken as an axiom in another set of axioms .  Is mathematics as rigorous and as thought-through as it is believed and expected to be ? It seems to me that there many loopholes in problems as well as the subject in-itself, but there is a false backbone of rigour that seems true until you start questioning the very fundamentals . Find the image of (1,1,1) by T Why does HMAC use two different keys? Suppose $H$ is a hash function; why is $$H(k\mathbin\|H(k\mathbin\|m))$$ not secure?  See this . In there, indeed two keys are used and the mac algorithm is $$H(k_1\mathbin\|H(k_2\mathbin\|m)).$$ Why don't we use $$H(k\mathbin\|H(k\mathbin\|m)),$$ which has only one key? How does Mathematica integrate?