Does instanceof operator generate a lot of overhead ? Why?
The performance impact of using instanceof in Java
How to retrieve all keys (or values) from a std::map and put them into a vector? This is one of the possible ways I come out:  struct RetrieveKey {     template &lt;typename T&gt;     typename T::first_type operator()(T keyValuePair) const     {         return keyValuePair.first;     } };  map&lt;int, int&gt; m; vector&lt;int&gt; keys;  // Retrieve all keys transform(m.begin(), m.end(), back_inserter(keys), RetrieveKey());  // Dump all keys copy(keys.begin(), keys.end(), ostream_iterator&lt;int&gt;(cout, "\n"));   Of course, we can also retrieve all values from the map by defining another functor RetrieveValues.  Is there any other way to achieve this easily? (I'm always wondering why std::map does not include a member function for us to do so.) By 18 years of age, I want a brand new car that's $43,668 I'm from Arizona and I will be 18 in 4 months. I make about $1,200 a month from my job. I have $600 in my bank account and I don't plan to  spend any of it until I'm  18.     I'm looking to get a brand new Jeep Wrangler Rubicon that costs about  $43,000. The down payment is 10% (about $5,000) with an APR of  4.28%. The duration is 60 months with a monthly payment of  $800.  I don't have any credit. My friend suggested that I ask my parents to put my name on one of their credit cards so that I can build some credit. I'm not sure how that works. Can someone suggest a good way of going about this so I can get this car on or around my birthday?  My mom does finance work  for a big company and she told me that I should get a cheaper car. I really want this one and I'm willing to work for it. I'm getting a second job to get more money rolling in. My mom said that the only way that this would work is if I have a down payment of $15-20k. She also said that not everyone qualifies  for a car like this one. What can get me to qualify ASAP when I turn 18? Low-RAM Linux Distro Specifically for serving static sites I'm looking for a near-zero-configuration linux distro that is designed specifically for serving static web sites and nothing else on a low-RAM machine (I'm planning on 128MB, but the option of less would be nice).  Any ideas of a linux distro specifically tuned for serving static sites in a small footprint? Intuitive explanation of unit root How would you explain intuitively what is a unit root, in the context of the unit root test?   I'm thinking in ways of explaining much like I've founded in .  The case with unit root is that I know (little, by the way) that the unit root test is used to test for stationarity in a time series, but it's just it.   How would you go to explain it to the layperson, or to a person who has studied a very basic probability and statistics course?  UPDATE  I accepted whuber's answer as it is what most reflect what I asked here. But I urge everybody that came here to read Patrick's and Michael's answers also, as they are the natural "next step" in understanding the Unit Root. They use mathematics, but in a very intuitive way. hello everyone I have a little problem, how do I bring up the menu in the circle? when I select another object the menu becomes non-existent I am travelling to Calgary from Delhi. I have an Air India flight from Delhi to Dubai then British Airways flight from Dubai to London and Air Canada flight from London to Calgary. My query is "Do I require a transit visa." Plz help as I am travelling in four days How to install Ubuntu on portable external Hard Drive? I want to update my sources.list file with the fastest server from the command line in a fresh Ubuntu Server install. I know this is trivially easy with the GUI, but there doesn't seem to be a simple way to do it from from the command line? I Need to Shrink My Database - I just freed a lot of space This question is asked in various forms here but the question boils down to:  I know shrinking a database is risky. In this case, I've removed so much data and I'll never use it again.   How can I shrink my database? What files do I shrink?  What should my considerations be while doing this?  Should I do anything after? What if it is a large database? Can I shrink it in smaller increments? A challenge on the parabola Good Night ... Here I am editing the question and explaining the purpose of the same ... Mathematics course, and I love this science, I am very curious, and these days, studying a book of calculus found in (book from the library of the University) a sheet full of challenges, to share with a colleague, he gave me this challenge, which he also failed to respond ... I tried, I tried, I used the formulas of quadratic equation, and I've been trying since Friday (here in Brazil is Sunday at 22:33), and could not, and I ask your help, and please believe me, I struggled, tried to make substitutions, tried both, and I'm confused ... I must find the values of $ a, b $ and $ c $?  Consider a parabola whose roots, other are $x'$ and $x''$, and such that $x'=-x''$ where $x'&gt; 0$. Let $$A = (x', 0)$$ $$B = (x'', 0)$$ and $V$ the vertex of the parabola. Suppose that the equation of this parabola is $$y = ax^2 +bx+ c$$. Calculate the value of the discriminant $$\Delta=b^2-4ac$$, so that the triangle is equilateral AVB. Why is 8 so special? I have been reading about multi-dimensional numbers, and found out that it's been proven that the Octonions are the composition algebra of the largest dimension. I was wondering why, despite having infinitely many different dimensions of numbers, the only composition algebras are of 1, 2, 4, and 8 dimensions. What's so special about 8? To apply for a Schengen business visa, you need a letter from the company in the Member state inviting you. My company is based in the UK, owns properties in Schengen countries, and I have to inspect their condition.  What letter do I get? How do I get the local machine name in C#? Nth max salary in Oracle I'm new in this computer terms. So anyone can explain to me what "virtual cores" and "hyperthreading" are at greatest detail a layman can understand?  People told me that virtual cores are imaginary cores acting like a physical core. If that is so, then can I make my AMD v105 processor single core a dual core processor?   Is it also possible to hyperthread my CPU? Are these functions built in? The  page indicates "the hats get put back in their boxes on January 4th". Aside from the pure terror that sentence seems to invoke, I was curious of exactly when this is going to be.  I know that the hats have caused a bit of a time warp at times (for example the starred chat hats). Will this be true of the removal process as well?  Do we get our hats until 23:39 UTC Jan 4th, are they removed at the end of UTC Jan 3rd? First, this question is motivated by the imprecise question: Is there a sensible notion of parity (evenness and oddness) for real numbers?   Here are some properties a notion of parity for $\mathbb{R}$ should have:    It should be an equivalence relation on $\mathbb{R}$ with exactly two equivalence classes.  Each equivalence class should be dense in $\mathbb{R}$. There should be some kind of symmetry between the two equivalence classes. (This is intentionally imprecise.)   If we divide $\mathbb{R}$ into rationals and irrationals, this lacks symmetry, since the rationals have measure zero and are countable, while the rationals have infinite measure and are uncountable.   So we could require that each equivalence class be uncountable and/or have positive (or infinite) measure. Then take one equivalence class to be the rationals, union with countably many fat cantor sets with positive measure, and the other class its complement. Then both classes are now dense, uncountable, and have infinite measure. But again, symmetry is lacking. One of these classes is "uncountable everywhere" and has "positive measure everywhere" while the other does not.   I propose some definitions: A subset $A \subset \mathbb{R}$ is uncountable everywhere if for any open interval $(a,b)$, the intersection $A \cap (a,b)$ is uncountable. A subset $A \subset \mathbb{R}$ has positive measure everywhere if for every open interval $(a,b)$, the intersection $A \cap (a,b)$ has positive measure. We can see immediately that having positive measure everywhere implies being uncountable everywhere, since a positive measure set must be uncountable.   Finally, my questions:    Is there a partition of $\mathbb{R}$ into two sets that are both uncountable everywhere?  Is there a partition of $\mathbb{R}$ into two sets that both have positive measure everywhere?  Is there a partition of $\mathbb{R}$ into two sets that split each interval $(a,b)$ into two parts of equal measure?   Potential generalizations for extra credit: What about partitions of $\mathbb{R}$ with $n$ equivalence classes, where $n \in \mathbb{N}$, or even with countably many, or even uncountably many equivalence classes?  Note: If you've seen these definitions of uncountable everywhere or positive measure everywhere somewhere under a different name, please let me know. I've never found anything where other people were thinking about these notions.  EDIT: By "measure," I mean Lebesgue outer measure, so we don't have to worry about anything being measurable. Does this seemingly elementary question require König's theorem? How is Angular Momentum Conserved when Mass is Released? I am not a physicist (math/comp-sci) but I understand that Angular Momentum is supposed to be conserved.  I find this confusing because there seems to be many simple, common cases where a restrained, revolving body, when released seems to lose it's angular momentum.  For example, let's say that a hammer thrower is revolving a 10kg hammer around herself at a 1 meter distance from their combined center of mass every second.  Taking the hammer as a point-mass, then before release, the hammer and the thrower each have an angular momentum of      $l\omega = (mr^2)*(2\Pi) = (10*1*1)*(2*3.14..) =~ 62.8 kg\text{-}m^2/s$   Now, after the hammer is released, the thrower still has her same angular momentum (also 62.8), but the hammer no longer seems to have any.  Yes, I know that the hammer is still rotating (spinning) as it did when it was revolving around the thrower, so that angular momentum seems to be conserved, but the angular momentum from revolution (orbiting) seems to be gone.  AFAIK, it's not transferred to it's spin angular momentum (observation seems to bear this out).  Nor is it transferred to the thrower.  Besides having no mechanism for this (she let go of it), if it did, we would have noticed hammer throwers being knocked over by having their angular momentum suddenly doubled.  So where does it go?  Or is it not actually conserved in this case? Convert a string to an enum in C# What's the best way to convert a string to an enumeration value in C#? I have an HTML select tag containing the values of an enumeration. When the page is posted, I want to pick up the value (which will be in the form of a string) and convert it to the corresponding enumeration value. In an ideal world, I could do something like this: StatusEnum MyStatus = StatusEnum.Parse(&quot;Active&quot;);  but that isn't a valid code.