Weird examples in javascript, why I can't reassign a global variable's value through a function's parameter?
Is JavaScript a pass-by-reference or pass-by-value language?
I have a Spring MVC web app which uses Spring Security.  I want to know the username of the currently logged in user.  I'm using the code snippet given below .  Is this the accepted way?    I don't like having a call to a static method inside this controller - that defeats the whole purpose of Spring, IMHO.  Is there a way to configure the app to have the current SecurityContext, or current Authentication, injected instead?      @RequestMapping(method = RequestMethod.GET)   public ModelAndView showResults(final HttpServletRequest request...) {     final String currentUser = SecurityContextHolder.getContext().getAuthentication().getName();     ...   } Is there a service that I can use to check if my machine will be able to run a certain game? Dini's Theorem - Proof. I'd like to prove the following:  If $f_j$ are continuous functions on a compact set $K$, and $f_{1}(x) \leq f_{2}(x) \leq \dots$ for all $x \in K$, and the $f_j$ converge pointwise to a continuous function $f$ on $K$ then in fact the $f_j$ converge uniformly to $f$ on $K$.  Attempt:  Let $g_{j}(x) = f(x) - f_{j}(x)$ for all $j$. Then, since $f_j \rightarrow f$ pointwise, we see $g_j \rightarrow 0$ pointwise.  Now, let $\varepsilon &gt; 0$ . And examine { $x \in K : g_{j}(x) &lt; \varepsilon$ }.  I've been told that the next step should be to  show that { $x \in K : g_{j}(x) &lt; \varepsilon$ } is equal to the intersection of $K$ with some open set $U_j$. But I'm not certain why this is true?   Advice? Insight? Determining if an Object is of primitive type I have an Object[] array, and I am trying to find the ones that are primitives. I've tried to use Class.isPrimitive(), but it seems I'm doing something wrong:  int i = 3; Object o = i;  System.out.println(o.getClass().getName() + ", " +                    o.getClass().isPrimitive());   prints java.lang.Integer, false.  Is there a right way or some alternative? Solving $4x = e^x$ without graphing and looking for intersection Simplify $\arctan (\frac{1}{2}\tan (2A)) + \arctan (\cot (A)) + \arctan (\cot ^{3}(A)) $ How to simplify $$\arctan \left(\frac{1}{2}\tan (2A)\right) +  \arctan (\cot (A)) + \arctan (\cot ^{3}(A)) $$ for  $0&lt; A&lt; \pi /4$?  This is one of the problems in a book I'm using. It is actually an objective question , with 4 options given , so i just put $A=\pi /4$ (even though technically its disallowed as $0&lt; A&lt; \pi /4$) and got the answer as $\pi $ which was one of the options , so that must be the answer (and it is weirdly written in options as $4 \arctan (1) $ ).  Still , I'm not able to actually solve this problem. I know the formula for sum of three arctans , but it gets just too messy and looks hard to simplify and it is not obvious that the answer will be constant for all $0&lt; A&lt; \pi /4$. And I don't know of any other way to approach such problems. How do I write an Apex unit test? How to keep vehicles upgrades equipped in Jetpack Joyride? I have Jetpack Joyride for Android, but every time I start the game I have to equip the magnetic upgrades to all vehicles, except the teleporter, which is the only one already equipped.  I had once a game crash that undid my last 2 magnets purchases, so I ended up with only the teleporter and 20k less in cash. After that, I've bought every vehicle magnet, but still the only one that will remain equipped is the teleport.  Anyone already found some similar bug? How could I fix this, it's kinda annoying have to mannually enable 5 different upgrades every time I want to play. The situation is as below:  -------|----------------------------        |  stump |batsmen2   broken|batsmen1  here  |  -------|----------------------------   Is it a runout in the above situation? I was viewing some old posts on Stack Overflow (two-year-old posts) and found that due to "fast technology trend changing," some of them are no longer valid. Stack Overflow (and the Stack Exchange sites generally) should have some sort of criteria to tag questions as Obsolete, or a vote-based system to mark them as such.  I am not in favour of closing obsolete questions. Sending packets captured with Wireshark How can I form a word like "quadruple" for any number I want? I'm not sure what these are called, but how can I form a word like "quadruple" for any number I want? Like 5× as much is quintuple, what is 31× as much or 147× as much? I want to know how they are formed so I can make my own.  Similarly, how do I construct the prefixes, such as unicycle, bicycle, tricycle, quadricycle? I figured out 12 is duodeci-, but how can I form any prefix like this? Do I need a bus/train/plane ticket out of Thailand in order to get a Visa-on-Arrival? How do I enumerate the properties of a JavaScript object? When I type uname -a, it gives the following output.  Linux mars 2.6.9-67.0.15.ELsmp #1 SMP Tue Apr 22 13:50:33 EDT 2008 i686 i686 i386 GNU/Linux   How can I know from this that the given OS is 32 or 64 bit?  This is useful when writing configure scripts, for example: what architecture am I building for? Generalized mean value theorem I know and understand the mean value theorem. But at the moment I don't have the intuition to understand the generalized mean value theorem     If $f$ and $g$ are continuous on the closed interval $[a,b]$ and differentiable on the open interval $(a,b)$, then there exists a point $c\in(a,b)$ where$$[f(b)-f(a)]g'(c)=[g(b)-g(a)]f'(c).$$If $g'$ is never zero on $(a,b)$, then the conclusion can be stated as$$\frac{f'(c)}{g'(c)}=\frac{f(b)-f(a)}{g(b)-g(a)}.$$   What is the intuition? And how can you prove this (generally) ? What is Reflection in Java Can anyone explain? Prove that $\phi(n) \geq \sqrt{n}/2$ So I'm trying to prove the following two inequalities: $$\frac{\sqrt{n}}{2} \leq \phi(n) \leq n.$$ The upper bound we get from simply noting that $\phi(n) = n \prod_{p | n}\left( 1 - \frac{1}{p}\right)$ and the fact that $(1 - \frac{1}{p}) \leq 1$. But how can we get the lower bound? I tried using the same expression for $\phi(n)$ but it seems to not really give me the inequality. Can you help? GParted can't resize partition, but unallocated partition is available Why do we use "./" (dot slash) to execute a file in Linux/UNIX? Why do we use ./filename to execute a file in linux?  Why not just enter it like other commands gcc, ls etc...