JAVA UUID use only numeric characters to generate random UUID
How do I generate random integers within a specific range in Java?
I have a problem with energy conservation in case of interfering waves.  Imagine two harmonic waves with amplitudes $A$. They both carry energy that is proportional to $A^2$, so the total energy is proportional to $2A^2$. When they interfere, the amplitude raises to $2A$, so energy is now proportional to $4A^2$ and bigger than before.  The equivalent question is what happens to the energy with the superposition of two waves that interfere destructively.  Also, if someone could comment on the statement about this problem in my physics book (Bykow, Butikow, Kondratiew):      The sources of the waves work with increased power during the interference because they feel the wave from the other source. How to spawn a Giant with equipment? I really want to spawn Giant with armor and swords. Because Giants are strong, and great challenge if spawned with enchanted diamond armor and a diamond sword. Connect iPhone to Mac Without Charging I am developing iOS apps and I hate, that always when I connect my iPhone to my Mac to install and test an app, the iPhone gets charged. Is there any possibility to connect my iPhone to my Mac without charging the phone?    My Environment: -  iPhone 4S (No Jailbreak) -  MacBook Air3,2 (Late 2010) Subject-verb inversion / verb-subject-object -- is this correct? I recently read the following in a schoolbook:     Wrote the researchers, "[...]"   I wonder if this is correct English. I have seen it a couple of more times. Is this just a matter of preference? English doesn't really have a very liberal word order, unless you're writing poetry or the like.  Can anyone tell me what this is called? I found some information on subject-verb inversion, but it only seems to be when the object is in front, but in this case, the word order is verb-subject-object. Pagenumbers aligned raggedleft in scrartcl with tocstyle? When trying to typeset a table of contents with KOMAscriptand tocstyle(alpha 0.2d), I finally managed to change the font of the pagenumbers (like the rest of the document to CMSS) with \settocfeature{pagenumberhook}{\changefont{cmss}{m}{n}}, however now the page numbers are aligned at the left and not at the right side!   So how can I change that back to an alignment on the right side of the page numbers like that, but with the sans serif font?   Example:  \documentclass[11pt, a4paper]{scrartcl} \usepackage[ngerman]{babel} \usepackage{blindtext}  \newcommand{\changefont}[3]{ \fontfamily{#1} \fontseries{#2} \fontshape{#3} \selectfont}  \usepackage[]{tocstyle} \usetocstyle{classic} %\settocstylefeature[1]{entryvskip}{10pt} %\settocstylefeature[2]{entryvskip}{3pt} %\settocstylefeature[1]{entryhook}{\bfseries} \settocfeature{pagenumberhook}{\changefont{cmss}{m}{n}}  \begin{document}  \changefont{cmss}{m}{n}  \tableofcontents  \newpage  \blinddocument \blinddocument \blinddocument  \end{document} Primefaces growl is not working in all the pages Find the limit $\lim_{n\rightarrow\infty}\sum_{k=1}^{n}\frac{1}{k+n}$ $$\lim_{n\rightarrow\infty}\sum_{k=1}^{n}\frac{1}{k+n}$$  Could you please give me a hint how to find this limit? can I change value of $_SERVER['DOCUMENT_ROOT']? Find duplicate files What is a NullPointerException, and how do I fix it? What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? XSD extend a complex type Using methods from another class in the main? Call to a member function on a non-object Trajectory of a photon around a Schwarzschild black hole? Consider a photon coming from the infinity in a unbounded orbit to a Schwarzschild black hole (Schwarzschild radius $r_{s}$) (see  for illustration). Its impact parameter is $b$ and its distance of closest approach is $r_{0}$ with $$b^2=\frac{r_{0}^{3}}{r_{0}-r_{s}}$$.  Then its trajectory in polar coordinates is defined by :  $$\frac{d\varphi}{dr} = \frac{1}{r^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{r}\right)\frac{1}{r^2}}}$$  Consequently : $$\varphi\left(r\right) = \int_{r_{0}}^{r} \frac{dp}{p^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{p}\right)\frac{1}{p^2}}}$$  and one can compute the total deviation using :  $\Delta\varphi = 2\times\left(\lim_{r\to+\infty}\varphi\left(r\right)-\frac{\pi}{2}\right)$  But my question is : how can I plot/draw the trajectory using the integral expression of $\varphi\left(r\right)$ ?    Because if I compute : $$f\left(r\right) = 2\times\left(\int_{r_{0}}^{r} \frac{dp}{p^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{p}\right)\frac{1}{p^2}}}-\frac{\pi}{2}\right)$$ I obtain $f\left(r_{0}\right) = -\pi$, and then $f$ increases up to zero, crosses zero, and tends to its positive value at infinity $\Delta\varphi$. It does not make sense for me and I do not understand how to compute the trajectory from that.    If I compute : $$g\left(r\right) = \int_{r_{0}}^{r} \frac{dp}{p^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{p}\right)\frac{1}{p^2}}}$$ it starts from $0$, and increase up to $\frac{\pi}{2}+\frac{\Delta\varphi}{2}$.    I would like to compute the trajectory in the $\left(x, y\right)$ plane, so how to use the values of $f\left(r\right)$ or $g\left(r\right)$ to compute the function $y\left(x\right)$ ? Possible Duplicate:          This is something I haven't quite figured out yet, but I have been using function(){}() just because my VIM syntax highlight screws up if I add the parenthesis, although I've seen (function(){})() around many times, maybe its an IE thing?  edit:  var singleton = function() {     // code }();  var singleton = (function() {     // code })(); How can I pass a class member function as a callback? I'm using an API that requires me to pass a function pointer as a callback. I'm trying to use this API from my class but I'm getting compilation errors.   Here is what I did from my constructor:  m_cRedundencyManager-&gt;Init(this-&gt;RedundencyManagerCallBack);   This doesn't compile - I get the following error:      Error  8 error C3867: 'CLoggersInfra::RedundencyManagerCallBack': function call missing argument list; use '&amp;CLoggersInfra::RedundencyManagerCallBack' to create a pointer to member   I tried the suggestion to use &amp;CLoggersInfra::RedundencyManagerCallBack - didn't work for me.   Any suggestions/explanation for this??  I'm using VS2008.  Thanks!! I'm learning C#, so I made a little C# program that says Hello, World!, then compiled it with mono-csc and ran it with mono:  $ mono-csc Hello.cs $ mono Hello.exe Hello, World!   I noticed that when I hit TAB in bash, Hello.exe was marked executable. Indeed, it runs by just a shell loading the filename!   Hello.exe is not an ELF file with a funny file extension:  $ readelf -a Hello.exe readelf: Error: Not an ELF file - it has the wrong magic bytes at the start $ xxd Hello.exe | head -n1 00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000  MZ..............   MZ means it's a Microsoft Windows statically linked executable. Drop it onto a Windows box, and it will (should) run.  I have wine installed, but wine, being a compatibility layer for Windows apps, takes about 5x as long to run Hello.exe as mono and executing it directly do, so it's not wine that runs it.  I'm assuming there's some mono kernel module installed with mono that intercepts the exec syscall/s, or catches binaries that begin with 4D 5A, but lsmod | grep mono and friends return an error.   What's going on here, and how does the kernel know that this executable is special?    Just for proof it's not my shell working magic, I used  (aka sh) to run it and it still runs natively.    Here's the program in full, since a commenter was curious:  using System;  class Hello {   /// &lt;summary&gt;   ///   The main entry point for the application   /// &lt;/summary&gt;   [STAThread]   public static void Main(string[] args) {     System.Console.Write("Hello, World!\n");   } } How to protect SHTML pages from crawlers/spiders/scrapers? I have A LOT of SHTML pages I want to protect from crawlers, spiders &amp; scrapers.   I understand the limitations of SSIs. An implementation of the following can be suggested in conjunction with any technology/technologies you wish:     The idea is that if you request too many pages too fast you're added to a blacklist for 24 hrs and shown a captcha instead of content, upon every page you request. If you enter the captcha correctly you've removed from the blacklist.   There is a whitelist so GoogleBot, etc. will never get blocked.   Which is the best/easiest way to implement this idea?  Server = IIS    Cleaning out the old tuples from a DB every 24 hrs is easily done so no need to explain that. How to do integer & float calculations, in bash or other languages/frameworks? Using echo "20+5" literally produces the text "20+5".  What command can I use to get the numeric sum, 25 in this case?  Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.  I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line. We were taught that an independent clause must have a complete thought/idea.     This is the only mammal that can fly.     How can "This is the only mammal" be treated as an independent clause?            It was a grammar lesson and there was no context there. In this situation how can I decide that it is an independent clause? Though for sure, there should be an independent clause in a correct sentence, and the clause starting with 'that' is not independent. But by this way, I can't fit it with the rule that every independent clause must have a complete thought. A simple sentence must have an independent clause. If the sentence has no independent clause how we can call it a sentence? Can even two dependent clauses form a sentence?