Jquery fileupload not giving me correct path
How to resolve the C:\fakepath?
The shortcode produced by this function - a list of all sites in a multisite - outputs above the content in the loop, no matter where it is placed in the editor.  I've looked at the other related questions and answers on WPSE and realize that it has to do with the function using echo instead of return, but it's not as easy as replacing the instances of echo with return in the function below. Or adding echo=0 with a WP function like wp_list_pages()  Any ideas? Where is the function that needs to be returned instead of echoed?  // Output a single menu item function projects_menu_entry($id, $title, $link_self) {     global $blog_id;     if ($link_self || $id != $blog_id) {         echo '&lt;li&gt;';         if ($id == $blog_id) {             echo '&lt;strong&gt;';         }         $url = get_home_url($id);         if (substr($url, -1) != '/') {             // Note: I added a "/" to the end of the URL because WordPress             // wasn't doing that automatically in v3.0.4             $url .= '/';         }         echo '&lt;a href="' . $url . '"&gt;' . $title . '&lt;/a&gt;';         if ($id == $blog_id) {             echo '&lt;/strong&gt;';         }         echo '&lt;/li&gt;';     } }  // Output the whole menu // If $link_self is false, skip the current site - used to display the menu on the homepage function projects_menu($link_self = true) {     global $wpdb;      echo '&lt;ul&gt;';      projects_menu_entry(1, 'Home', $link_self);      $blogs = $wpdb-&gt;get_results("         SELECT blog_id         FROM {$wpdb-&gt;blogs}         WHERE site_id = '{$wpdb-&gt;siteid}'         AND spam = '0'         AND deleted = '0'         AND archived = '0'         AND blog_id != 1     ");      $sites = array();     foreach ($blogs as $blog) {         $sites[$blog-&gt;blog_id] = get_blog_option($blog-&gt;blog_id, 'blogname');     }      natsort($sites);     foreach ($sites as $blog_id =&gt; $blog_title) {         projects_menu_entry($blog_id, $blog_title, $link_self);     }     echo '&lt;/ul&gt;'; }  // Adds a [bloglist] shortcode  function bloglist_shortcode($atts) {     projects_menu(false); }  add_shortcode('bloglist', 'bloglist_shortcode'); Generalized RBF Kernels There is the notion of Generalized RBF Kernels, for example in "Towards Optimal Bag-of-Features for Object Categorization and Semantic Video Retrieval" from Jiang (1) or in formula (2.72) in  (2).  They define: Gen. RBF Kernel: $e^{-pd(x,y)}$, where (1) says d can be any distance function and (2) requires it to be a metric.  I now have been wondering for a long time: Is a function defined by $e^{-pd(x,y)}$ where d is a metric always a Mercer's Kernel? I think in (2) it sounds like it, but if it were true, not many people know of it, since they are still looking to prove that $e^{-EMD(x,y)}$ is a kernel, where EMD = Earth Mover's Distance, which is a metric.  If its not a Mercer's Kernel - do you know of any counter example? Why is echo a shell built in command? $ which echo echo: shell built-in command. $ which ls /bin/ls $ which cat /bin/cat   Why is echo not an independent utility like ls, ps, cat etc? Why is it shell specific? Any good reasons? I have embedded a Python interpreter in a C program.  Suppose the C program reads some bytes from a file into a char array and learns (somehow) that the bytes represent text with a certain encoding (e.g., ISO 8859-1, Windows-1252, or UTF-8).  How do I decode the contents of this char array into a Python string?  The Python string should in general be of type unicode—for instance, a 0x93 in Windows-1252 encoded input becomes a u'\u0201c'.  I have attempted to use PyString_Decode, but it always fails when there are non-ASCII characters in the string.  Here is an example that fails:  #include &lt;Python.h&gt; #include &lt;stdio.h&gt;  int main(int argc, char *argv[]) {      char c_string[] = { (char)0x93, 0 };      PyObject *py_string;       Py_Initialize();       py_string = PyString_Decode(c_string, 1, "windows_1252", "replace");      if (!py_string) {           PyErr_Print();           return 1;      }      return 0; }   The error message is UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 0: ordinal not in range(128), which indicates that the ascii encoding is used even though we specify windows_1252 in the call to PyString_Decode.  The following code works around the problem by using PyString_FromString to create a Python string of the undecoded bytes, then calling its decode method:  #include &lt;Python.h&gt; #include &lt;stdio.h&gt;  int main(int argc, char *argv[]) {      char c_string[] = { (char)0x93, 0 };      PyObject *raw, *decoded;       Py_Initialize();       raw = PyString_FromString(c_string);      printf("Undecoded: ");      PyObject_Print(raw, stdout, 0);      printf("\n");      decoded = PyObject_CallMethod(raw, "decode", "s", "windows_1252");      Py_DECREF(raw);      printf("Decoded: ");      PyObject_Print(decoded, stdout, 0);      printf("\n");      return 0; } A clarification in a limit While reading this  I do not understand that how can we claim that there exist a polynomial with the properties, even if it exist then how is it same for the function and the inverse. Is there PvP in Diablo 3? How does it work? Do we know anything about Aragorn's first time in Moria? When the Company is forced to abandon their attempt to cross the Misty Mountains via the Redhorn Gate (the pass of Caradhras), Gandalf proposes they go "neither over the mountains, nor round them, but under them," via Moria. During the debate Aragorn remarks:     "I too once passed the Dirmrill Gate but though I also came out again, the memory is very evil. I do not wish to enter Moria a second time."    I haven't read much beyond the LOTR trilogy other than The Silmarillion. Does Tolkien ever describe Aragorn's first visit to Moria anywhere? Proving $\sum\limits_{k=1}^{n}{\frac{1}{\sqrt{k}}\ge\sqrt{n}}$ with induction What is an uninterruptible process? Sometimes whenever I write a program in Linux and it crashes due to a bug of some sort, it will become an uninterruptible process and continue running forever until I restart my computer (even if I log out).  My questions are:   What causes a process to become uninterruptible? How do I stop that from happening? This is probably a dumb question, but is there any way to interrupt it without restarting my computer? Website giving pronunciations of English words recorded in different dialects? I'm aware that there are certain websites around that provide recorded examples of English words pronounced in different accents/dialects.  Could anybody list some of them? Finding the limit $\lim \limits_{n \to \infty}\ (\cos \frac x 2 \cdot\cos \frac x 4\cdot \cos \frac x 8\cdots \cos \frac x {2^n}) $ I am trying to prove the statement:  If $X\sim\mathcal{N}(0,\sigma_1^2)$ and $Y\sim\mathcal{N}(0,\sigma_2^2)$ are independent random variables, then $\frac{XY}{\sqrt{X^2+Y^2}}$ is also a Normal random variable.  For the special case $\sigma_1=\sigma_2=\sigma$ (say), we have the well-known result that $\frac{XY}{\sqrt{X^2+Y^2}}\sim\mathcal{N}\left(0,\frac{\sigma^2}{4}\right)$ whenever $X$ and $Y$ are independent $\mathcal{N}(0,\sigma^2)$ variables. In fact, it is more generally known that $\frac{XY}{\sqrt{X^2+Y^2}},\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}}$ are independent $\mathcal{N}\left(0,\frac{\sigma^2}{4}\right)$ variables. A proof of the last result follows by using the transformation $(X,Y)\to(R,\Theta)\to(U,V)$ where $x=r\cos\theta,y=r\sin\theta$ and $u=\frac{r}{2}\sin(2\theta),v=\frac{r}{2}\cos(2\theta)$. Indeed, here $U=\frac{XY}{\sqrt{X^2+Y^2}}$ and $V=\frac{X^2-Y^2}{2\sqrt{X^2+Y^2}}$. I tried to imitate this proof for the problem at hand but it appears to get messy. If I haven't made any error, then for $(u,v)\in\mathbb{R}^2$ I end up with the joint density of $(U,V)$ as $$f_{U,V}(u,v)=\frac{2}{\sigma_1\sigma_2\pi}\exp\left[-\sqrt{u^2+v^2}\left(\frac{\sqrt{u^2+v^2}+v}{\sigma_1^2}+\frac{\sqrt{u^2+v^2}-v}{\sigma_2^2}\right)\right]$$ I have the multiplier $2$ above as the transformation is not one-to-one. So density of $U$ would be given by $\displaystyle \int_{\mathbb{R}}f_{U,V}(u,v)\,\mathrm{d}v$, which isn't readily evaluated. Now I am interested to know if there is a proof where I can only work with $U$ and don't have to consider some $V$ to show that $U$ is Normal. Finding the CDF of $U$ doesn't look so promising to me at the moment. I would also like to do the same for the case $\sigma_1=\sigma_2=\sigma$. That is, if $X$ and $Y$ are independent $\mathcal{N}(0,\sigma^2)$ variables then I wish to show that $Z=\frac{2XY}{\sqrt{X^2+Y^2}}\sim\mathcal{N}(0,\sigma^2)$ without using a change of variables. If somehow I can argue that $Z\stackrel{d}{=}X$, then I'm done. So two questions here, the general case and then the particular case. Related posts on Math.S.E: . . Edit. This problem is in fact due to L. Shepp as I found out in the exercises of An Introduction to Probability Theory and Its Applications (Vol. II) by Feller, alongwith a possible hint:  Surely, $U=\frac{XY}{\sqrt{X^2+Y^2}}=\frac{1}{\sqrt{\frac{1}{X^2}+\frac{1}{Y^2}}}$ and I have the density of $\frac{1}{X^2}$ at hand. Let's see what I could do now. Apart from this, a little help with the integral above is also welcome. Since the equation of mechanics are of second order in time, we know that for $N$ degrees of freedom we have to specify $2N$ initial conditions. One of them is the initial time $t_0$ and the rest of them, $2N-1$ are initial positions and velocity. Any function of these initial condition is a constant of motion, by definition. Also, there should be exactly $2N-1$ algebraically independent constants of motion.  On the other hand, Noether's procedure gives us integrals of motion as a result of variational symmetries of the action. These integrals of motion are also conserved but they are not always $2N-1$ in number. In consequence, we classify the system by their integrability.  So, what is the difference between the  and ? Why do non- have less integrals of motion when they should always have $2N-1$ constants of motion? How to delete duplicate LiDAR points? How can I delete duplicate LiDAR points? I incorrectly read the same las twice and saved as a one file resulting in duplicate XY points.  How should I delete these duplicate points? Running shell command and capturing the output Phantom spaces in listings I have a problem with SQL code in a PDF document. For code representation I'm using the listings package. Everything works perfect until I copy-paste that code from the created PDF document. I get some phantom spaces in string type. When people are reading my PDF document, they need to copy-paste some of the code. Visually the code looks good in PDF, but when I try to copy-paste my code to NotePad or any other editor I get some unexpected spaces in strings. In the example below, when I copy-paste my SQL code, instead of getting:  SELECT ST_Area(the_geom)   FROM katastar   WHERE kc_broj = '1414';   I get  SELECT ST_Area(the_geom)   FROM katastar   WHERE kc_broj = ' 1414 ';   See the spaces in between quotes.  \documentclass{article} \usepackage{listings,xcolor}  \lstset{  tabsize=4,         basicstyle=\scriptsize,         %upquote=false,         aboveskip=\baselineskip,         columns=fixed,         showstringspaces=false,         extendedchars=true,         breaklines=true,         prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},  frame=single,         showtabs=false,         showspaces=false,         identifierstyle=\ttfamily,         keywordstyle=\color[rgb]{0,0,1},         commentstyle=\color[rgb]{0.133,0.545,0.133},         stringstyle=\color[rgb]{0.627,0.126,0.941},  language=SQL }  \begin{document} \begin{lstlisting} SELECT ST_Area(the_geom)   FROM katastar   WHERE kc_broj = '1414'; \end{lstlisting} \end{document} How to hook into the CPT's title placeholder? I want to change the default placeholder text in my Custom Post Type title field. This isn't possible while registering a new post type.  The following screenshot describes it. I read this book in the mid-nineties, probably written in the 80s or 90s.  It’s set in the near future, where the world has experienced a sudden glaciation.  Most of the United States and Europe is now covered with ice.  Civilization has collapsed for the most part. The protagonist is a drifter with strange-colored eyes (yellow, I think).  Because of his weird eyes, he’s never really fit in anywhere.  He moves from place to place just trying to survive, but somehow he discovers that the new ice-age did not occur naturally.  It was engineered by extraterrestrials, to make their work easier.  They’re looking for the plans for a super-weapon - a weapon that can cause any star to go nova.  A rival group of aliens hid the plans for this weapon by encoding the information in the human genome millions of years ago.  The marker to identify humans who carry this gene is - you guessed it - yellow-colored eyes. split file lines based on first field I have file with content like below and want to convert my output like below   Input  1,a,b,c 2,b,c 3,e,f 4,l  Required output  1,a 1,b 1,c 2,b 2,c 3,e 3,f 4,l    Values on first field is unique and no duplicate lines for 1st field in the input.  I am new to scripting and not sure how can we do this. I know that RAM disks are fast, faster than any disk, but they lose their contents on a shutdown of the operating system. The capacity is limited to the RAM. Is there a useful implementation on a new 64-bit Windows 2008 server?