I got a query that joined some tables together, some have identical names, for example id is twice in the result, and when I try to echo the id, it displays the wrong one.   How can I solve that?  My query:  $content = " SELECT ct.*       , fe.*       , cn.*   FROM web_content ct   JOIN web_fieldsandfilters_elements fe      ON fe.item_id = ct.id   JOIN web_fieldsandfilters_connections cn      ON cn.element_id = fe.id  WHERE ct.alias = '".$conn-&gt;real_escape_string($_GET['alias'])."'     AND ct.state = 1   ORDER      BY ct.ordering ";   I would like to be able to just display it like this:   echo $contentcr[0]['id_ct'];   I want to still retrieve everything from web_content (which I named ct) but also name the id row differently. How can I do that?
I have two tables in my database:  NEWS table with columns:   id - the news id  user - the user id of the author)   USERS table with columns:   id - the user id   I want to execute this SQL:   SELECT * FROM news JOIN users ON news.user = user.id    When I get the results in PHP I would like to get associative array and get column names by $row['column-name']. How do I get the news ID and the user ID, having the same column name?
How to fix lsregister failing associations after reboot? Number of possible combinations of x numbers that sum to y I want to find out the number of possible combinations of $x$ numbers that sum to $y$. For example, I want to calculate all combination of 5 numbers, which their sum equals to 10.  An asymptotic approixmation is also useful. This question seems to be very close to number partitioning, with the difference that a number can be 0. See:    All possible partitions for sum 10 and 3 positions that can be zero, are 63 possiblities: (numbers shown as 3 digits)  019 028 037 046 055 064 073 082 091 109 118 127 136 145 154 163 172 181 190 208 217 226 235 244 253 262 271 280 307 316 325 334 343 352 361 370 406 415 424 433 442 451 460 505 514 523 532 541 550 604 613 622 631 640 703 712 721 730 802 811 820 901 910 Compare 2 files and remove any lines in file2 when they match values found in file1 Why doesn't the Java SDK installer set JAVA_HOME? I always wondered why I have to manually set the JAVA_HOME environment variable after installing the Java SDK.     JAVA_HOME=c:\Program Files\Java\jdk1.6.0_12   Visual Studio at least provides a batch file to set these kind of environment variables:     call "c:\Program Files\Microsoft Visual   Studio 9.0\VC\vcvarsall.bat"   Does Java have something similar? I'm trying to make a build script that should simply work after installing the Java SDK. I don't want people to mess with environment variables on their PC. I know how to detect when resistors are arranged in parallel or series arrangement and I can also find their equivalent resistance in simple circuits or when resistances are connected in form of triangle but what happens when the arrangement is complex like this :   Which resistors are parallel and which are in series ? How can I find the equivalent resistance in such cases ? Is there rule or method for figuring this out ? Convergence of sequence of real numbers and (sub)subsequence Let $(x_n)_{n\in \mathbb{N}}$ be a sequence of real numbers. A well known result is:     The sequence $(x_n)_{n\in \mathbb{N}}$ converges to $a\in \mathbb{R}$ if and only if every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ converges to $a\in \mathbb{R}$.   Now, I'm working on an exercise which essentialy asks to prove the following:     The sequence $(x_n)_{n\in \mathbb{N}}$ converges to $a\in \mathbb{R}$ if and only if for every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ there is a (sub)subsequence $(x_{n_{k_j}})_{j\in \mathbb{N}}$ which converges to $a$.   Now, one direction is trivial. If in fact $(x_n)_{n\in \mathbb{N}}$ converges to $a$, then by the result I've mentioned, every subsequence of $(x_{n})_{n\in \mathbb{N}}$ converges to $a$. Let then $(x_{n_k})_{k\in \mathbb{N}}$ be an arbitrary subsequence. In that case, we know that it is a subsequence of itself, and hence we've found a (sub)subsequence which converges to $a$.  The other way around seems quite complicated for me. The reason is as follows: I must assume that every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ has a (sub)subsequence which converges to $a$ and the proof that the original one converges to $a$.  My problem is exactly that "a". If it had all (sub)subsequences converging to $a$, then by the result i've mentionted, the subsequence $(x_{n_k})_{k\in \mathbb{N}}$ would converge to $a$. In that case, we would have every subsequence converging to $a$ and the result would follow.  My idea to prove the claim was then:  First remember that a subsequence is the restriction of the original one $x: \mathbb{N}\to \mathbb{R}$ to an infinite subset $\mathbb{N}'\subset \mathbb{N}$. In that case a (sub)subsequence is the restriction of $\tilde{x} = x|\mathbb{N}'$ to an infinite subset $\mathbb{N}''\subset \mathbb{N}$. But since $\tilde{x}$ is the restriction of $x$ to $\mathbb{N}'$ and since $\mathbb{N}''\subset \mathbb{N}'$, the restriction of $\tilde{x}$ to $\mathbb{N}''$ is itself the restriction of $x$ to $\mathbb{N}''$.  In other words, every (sub)subsequence can be viewed as a subsequence of the original one. Considering this, by hypothesis every subsequence has a (sub)subsequence which converges to $a$. But by this argument, this means that we can replace every subsequence with a convergent one. And then we can use the result I stated.  Is my idea correct? Is this really the way to prove the claim? My only doubt is that I need every subsequence converging to $a$ to use the result. In this case I can't see how I can argue that this implies every subsequence converges to $a$.  How can I finish this proof? Do "owed" and "due" mean the opposite? can't type lower cased e in amazon ec2 (Amazon Linux) After a few days of operation on my new ec2 build, the following happens:   I log into SSH, everything is fine, I do my coding I return the next day, and log into SSH I cannot type a lower cased e anymore--I get the error ding when I type it I try to ssh from a different computer, same problem I reboot the server, same problem I open nano or vi and e works fine, just not in bash or sh I terminate the server, create a new one, install from scratch, a few days later it happens again   This is baffling! Where do I even start to troubleshoot?  My Local Machine Setup(s):   windows XP or 7 putty (latest) or cygwin/openssh   The EC2 setup   Amazon Linux (default options) node.js iptables forwarding port 80 to node on port 8003 emacs, npm, and openssl-devel no other mods       Output of stty -a while I can't type an e  sh-4.1$ stty -a speed 38400 baud; rows 30; columns 95; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &lt;undef&gt;; eol2 = &lt;undef&gt;; swtch = &lt;undef&gt;; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8 opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke   In case it helps someone else with a similar issue, I created a script (called sub) to convert upper-cased E to lower-cased, then echo the command back. Then I run it in backticks to get an e on the command line::  #!/bin/sh echo ${@//E/e}  &gt; `sub Emacs /Etc/profilE`   UPDATES   This breaks for all users In bash only (csh works fine) In emacs edit mode only   I've created  and hone in the solution. Today, on C.SE, I reviewed some 'Late Answers' and First Posts.  I was not even near my daily vote limit.  And yet, I was given a message that said      comments disabled on deleted / locked posts / reviews   It seems I was not the only one either:   The workaround, of course, was simply to go back and provide the guidance - but was this a design or a bug?  If it is design, why would you want to discourage the feedback? Especially with first posts, there is often a high percentage of 'didn't read the FAQ' usage, which can best be addressed by gently providing guidance. (e.g. "Unfortunately, this doesn't answer the question" or "This reads like a comment" or "This really isn't on-topic here - can I suggest you checkout our [faq]" etc...)  Timely first post guidance goes a long way towards making good users.   If it was a bug, was other functionality silently rolled out? Using StartCoroutine() and WaitForSeconds() I am trying to perform two operations. First I want to increase the size of a GameObject and then delay for 0.1s before returning it back to its original size. However, when I try using StartCoroutine(), it keeps giving me the error :  An object reference is required to access not-static members   even though I made my Delay() function static. Can somebody please tell me what I'm doing wrong?  public static void MoveSelected(int choice) {     GameObject rock1 = GameObject.Find("Rock1");     GameObject paper1 = GameObject.Find("Paper1");     GameObject scissors1 = GameObject.Find("Scissors1");      Vector3 scl;      if (choice == 1)     {         scl = rock1.transform.localScale;         scl.x *= 1.1f;         scl.y *= 1.1f;         rock1.transform.localScale = scl;          StartCoroutine(Delay());          scl.x /= 1.1f;         scl.y /= 1.1f;         rock1.transform.localScale = scl;     }     else if (choice == 2)     {         scl = paper1.transform.localScale;         scl.x *= 1.1f;         scl.y *= 1.1f;         paper1.transform.localScale = scl;          StartCoroutine(Delay());          scl.x /= 1.1f;         scl.y /= 1.1f;         rock1.transform.localScale = scl;     }     else if (choice == 3)     {         scl = scissors1.transform.localScale;         scl.x *= 1.1f;         scl.y *= 1.1f;         scissors1.transform.localScale = scl;          StartCoroutine(Delay());          scl.x /= 1.1f;         scl.y /= 1.1f;         rock1.transform.localScale = scl;     }  }  static IEnumerator Delay() {     yield return new WaitForSeconds(0.1f); } The entire answer is moving when hovering the bounty button It's just a minor CSS issue. See the following gif: I set up a new VPS instance of Ubuntu and am wondering what the easiest way is to get up and running with a basic LAMP stack (i.e. which packages are required, which configuration options need to be tweaked, if any, etc.). Given a $k$-manifold $M$, such that $\partial M$ is a $(k-1)$-manifold, there is a standard way in which $\partial M$ inherits the orientation of $M$. So if $M$ is oriented by the form field $\omega$, then $\omega_\partial=\omega(v_{\text{out}},v_1,\dots,v_{k-1})$ orients $\partial M$, where the $v_1,\dots,v_{k-1}$ are basis vectors for a tangent space on a point of the boundary, and $v_\text{out}$ is an outward pointing vector (see here: , which follows the exposition of Hubbard &amp; Hubbard).  In practice I find this very difficult to interpret. How can one find this $v_\text{out}$ in practice?   For instance, take $M$ to be defined by $z=x^2+y^2$ for $x\ge0$ (technically a manifold with boundary, in fact a half-paraboloid). It's a fact that $\partial M$ is defined by the parabola $z=y^2$. If $M$ is oriented by $dx\wedge dy$, how does this induce an orientation on the boundary (in fact we should obtain a 1-form that induces an orientation on the boundary)?   Note: I find the whole discussion of boundary orientation to be rather clumsy in its exposition. In the case of surfaces inducing orientations on boundary curves, I was originally taught to imagine that the normal vector that induces the surface orientation is me walking on the surface. This normal should walk along the boundary such that the surface lies to its left. OK - but how does this translate to the $v_{\text{out}}$ interpretation, so that we can generalize to other dimensions easily?)  Edit: An ideal answer would merge the intuitive approach with the rigorous approach, if possible. I would grateful to anybody who could help order my (at present confused) understanding! enclosing a lstlisting environment inside my own environment using matlab-prettifier I've just started using matlab-prettifier.    Since the line \begin{lstlisting}[style=Matlab-editor] is a lot to type, I created my own environment:  \newenvironment{myMP}      {\begin{samepage}\begin{lstlisting}[style=Matlab-editor]}      {\end{lstlisting}\end{samepage}}   I've used this syntax many times before, but in this case it doesn't work.  Is there any reason why I can't enclose the lstlisting inside my own one?  Here's sample code, illustrating the problem.  \documentclass{minimal} \usepackage[framed]{matlab-prettifier}%For matlab code \newenvironment{myMP}      {\begin{samepage} \begin{lstlisting}[style=Matlab-editor]}      {\end{lstlisting} \end{samepage}} \begin{document} \begin{myMP} matlab word \end{myMP} \end{document}   When I run this with pdflatex it returns a *, indicating that the environment wasn't closed properly.  Thanks! Delete commits from a branch in Git How to add upload field in a custom taxonomy? Currently there is not enough space on by /boot partition/folder and the sofware update can not be performed.   Question: how should I correctly free-up some space in that directory?  Here is the listing:  root@mindaugas-ubuntu-14:/boot# ls -la total 156607 drwxr-xr-x  4 root root     3072 Kov 12 09:37 . drwxr-xr-x 24 root root     4096 Kov 23 23:36 .. -rw-r--r--  1 root root  1163858 Rgs  4  2014 abi-3.13.0-36-generic -rw-r--r--  1 root root  1164720 Grd 16 03:17 abi-3.13.0-44-generic -rw-r--r--  1 root root  1164967 Sau 13 22:12 abi-3.13.0-45-generic -rw-r--r--  1 root root  1164852 Kov 10 22:43 abi-3.13.0-46-generic -rw-r--r--  1 root root   165671 Rgs  4  2014 config-3.13.0-36-generic -rw-r--r--  1 root root   165748 Grd 16 03:17 config-3.13.0-44-generic -rw-r--r--  1 root root   165748 Sau 13 22:12 config-3.13.0-45-generic -rw-r--r--  1 root root   165748 Kov 10 22:43 config-3.13.0-46-generic drwxr-xr-x  5 root root     1024 Kov 12 09:37 grub -rw-r--r--  1 root root 29225220 Rgs 25  2014 initrd.img-3.13.0-36-generic -rw-r--r--  1 root root 29264463 Sau 24 20:22 initrd.img-3.13.0-44-generic -rw-r--r--  1 root root 29267419 Vas 23 20:30 initrd.img-3.13.0-45-generic -rw-r--r--  1 root root 29268175 Kov 12 09:37 initrd.img-3.13.0-46-generic drwx------  2 root root    12288 Rgs 14  2014 lost+found -rw-r--r--  1 root root   176500 Kov 12  2014 memtest86+.bin -rw-r--r--  1 root root   178176 Kov 12  2014 memtest86+.elf -rw-r--r--  1 root root   178680 Kov 12  2014 memtest86+_multiboot.bin -rw-------  1 root root  3386479 Rgs  4  2014 System.map-3.13.0-36-generic -rw-------  1 root root  3388834 Grd 16 03:17 System.map-3.13.0-44-generic -rw-------  1 root root  3389258 Sau 13 22:12 System.map-3.13.0-45-generic -rw-------  1 root root  3389458 Kov 10 22:43 System.map-3.13.0-46-generic -rw-------  1 root root  5806848 Rgs  4  2014 vmlinuz-3.13.0-36-generic -rw-------  1 root root  5814496 Grd 16 03:17 vmlinuz-3.13.0-44-generic -rw-------  1 root root  5814112 Sau 13 22:12 vmlinuz-3.13.0-45-generic -rw-------  1 root root  5814592 Kov 10 22:43 vmlinuz-3.13.0-46-generic   There was a mention of it here:      $ sudo apt-get remove linux-image-2.6.31-21-generic   but will it delete all the files? Is there a way to get a background in CSS to stretch or scale to fill its container? How to prove a finite field is not ordered? I have a set S={0,1}, and the addition and multiplication rules are  \begin{array}{c|cc} +&amp;0&amp;1\\ \hline 0&amp;0&amp;1\\ 1&amp;1&amp;0 \end{array}  \begin{array}{c|cc} *&amp;0&amp;1\\ \hline 0&amp;0&amp;0\\ 1&amp;0&amp;1 \end{array}  It is sure that it is a field. How can I prove this field can be ordered or not? I would like to use Class.newInstance() but the class I am instantiating does not have a nullary constructor. Therefore I need to be able to pass in constructor arguments. Is there a way to do this?