I need to get name and supervisor name  Table name:user  id | name | -----------  1 | David   2 | Frank  3 | Shane  4 | Franchich   Another table name: details  user_id | supervisor_id| ----------------------------   1 | 4   2 | 3   3 | 4   I have tried like :  select      name as user name  from user, details  WHERE details.user_id=user.id    but failed   Now I want to get result like  User Name | Supervisor Name ------------------------------ David | Franchich Frank | Shane Shane | Franchich   So how is it possible ?
I have 2 tables. One (domains) has domain ids, and domain names (dom_id, dom_url).  the other contains actual data, 2 of which columns require a TO and FROM domain names. So I have 2 columns rev_dom_from and rev_dom_for, both of which store the domain name id, from the domains table.  Simple.  Now I need to actually display both domain names on the webpage. I know how to display one or the other, via the LEFT JOIN domains ON reviews.rev_dom_for = domains.dom_url query, and then you echo out the dom_url, which would echo out the domain name in the rev_dom_for column.  But how would I make it echo out the 2nd domain name, in the dom_rev_from column?
When can uncountable nouns be countable? How to draw arrows between circled coefficients of polynomials using tikz After reading Gonzalo's answer to , I thought  I would be able to modify it so that I could have the corresponding coefficients circled and an arrow going from one circle to the next. For example, I would like the coefficient of x^2 on the left, a, circled and the coefficient of x^2 on the right, 5 circled, then a curved arrow drawn between the two circles. How might I achieve this? Also, how would I add some text along the path of the arrow? I reproduce his code here.  \documentclass{article} \usepackage{amsmath} \usepackage{tikz} \usetikzlibrary{calc}  \newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}  \begin{document}  \begin{equation}   a\tikzmark{a}x^2 + bx + c = 5\tikzmark{b}x^2 + bx + c.   \begin{tikzpicture}[overlay,remember picture,out=315,in=225,distance=0.4cm]     \draw[-&gt;,red,shorten &gt;=3pt,shorten &lt;=3pt] (a.center) to (b.center);   \end{tikzpicture} \end{equation}  \end{document} Limit FTP access only to the /var/www with vsftpd I am running vsftpd as ftp server on my linux (rasbian), I log in to the machine as a root user.  I would like to be still locked to using only /var/www, how can I configure vsftpd conf to accomplish it? Why is a conservative force defined as the negative gradient of a potential? I'm learning about work in my dynamics class right now. We have defined the work on a particle due to the force field from point A to point B as the curve Integral over the force field from point A to B. From math I know that if a vector field has a potential, we only need to evaluate the potential at point B minus the potential at point A to get the result of the curve Integral. In the text that I'm reading, it's explained that if the integral over a force-field is path-independent, then the force field $F = -{\rm grad}(V)$, where $V$ is the potential. Why is it defined as the negative gradient? Doesn't one determine the potential from $F$ mathematically. Why do we impose the sign on the potential? EM algorithm gaussian mixtures- derivation I'm trying to make sense of a derivation I'm following from the lecture notes of Stanford's ML course.  Specifically the notes are here:   I'm particular I'm interested in the step where they are optimizing the lower bound of the log-likelihood by finding the derivative of that function w.r.t the mean (top of page 7). I'm a bit stuck on going from line 1 to line 2 in that sequence.  To copy here (using abbreviated notation for space):  $$ \nabla \mu_s \sum_{i=1}^{m}\sum_{j=1}^{k} w_j^{(i)}\log\frac{\alpha_j \exp\psi_{j}^{(i)}\phi_j}{w_j^{(i)}}  \qquad(1) $$ $$ \nabla \mu_s \sum_{i=1}^{m}\sum_{j=1}^{k} w_j^{(i)}\psi_{j}^{(i)}\qquad(2) $$ where $\psi_{j}^{(i)} =-\frac{1}{2}(x^{(i)}-\mu_j)^T\Sigma^{-1}_{j}(x^{(i)}-\mu_j)$ and $\alpha_j=\frac{1}{(2\pi)^{n/2}|\Sigma_j|^{1/2}}$.  The quantity $\mu_s$ is the mean (of a multivariate gaussian distribution) for class $s$.    In short, I'm not sure how they get from (1) to (2).  From just changing the log of (1) I see:  $$ \nabla \mu_s \sum_{i=1}^{m}\sum_{j=1}^{k} w_j^{(i)}\log \left(\alpha_j \exp\psi_{j}^{(i)}\phi_j\right) - w_j^{(i)}\log w_j^{(i)} \qquad(1) $$  To get to their form (2) my impression is that they take pre-emptively discard terms that would contain derivatives of $w_j^{(i)}$ (w.r.t. $\mu_s$).  At least if you assume that much, you get to (2).  However, as they show earlier in that PDF,  $$ w_j^{(i)} = p(z^{(i)}=j | x^{(i)}) =\frac{p(x^{(i)}|z^{(i)}=j)p(z^{(i)}=j) }{\sum_j p(x^{(i)},z^{(i)}=j) } $$ i.e. this quantity is the posterior distribution of the class labels.  Intuitively, it seems like $\partial w_j^{(i)}/ \partial \mu_s$ should be non-zero.  After all, changing the location of the mean $\mu_s$ would change your posterior probability for a particular class given the same data.  (Right?).  Just from a mechanical point of view, $\partial w_j^{(i)}/\partial \mu_j$ would seemingly have some non-zero terms since $p(x^{(i)}|z^{(i)}=j) \sim \mathcal{N}(\mu_j, \Sigma_j)$.  If I work through the algebra, I get  $$ \frac{\partial w_j^{(i)}}{\partial \mu_j} = w_j^{(i)}(1-w_j^{(i)})\frac{\partial \psi^{(i)}_{j}}{\partial \mu_j} $$  What am I missing here?  If I take the log-likelihood (without even thinking about EM algorithm),    $$ \ell = \sum_{i=1}^{m}\log \sum_{j=1}^{k}p(x^{(i)}|z^{(i)}=j)p(z^{(i)}=j) $$ and differentiate w.r.t $\mu_s$, I correctly get  $$ \mu_s^* = \frac{\sum_{i=1}^{m}w_s^{(i)}x^{(i)}}{\sum_{i=1}^{m}w_s^{(i)}} $$  so I'm comfortable with the eventual result, just not the intermediate steps. ZIP Code (US Postal Code) validation I thought people would be working on little code projects together, but I don't see them, so here's an easy one:  Code that validates a valid US Zip Code. I know there are ZIP code databases out there, but there are still uses, like web pages, quick validation, and also the fact that zip codes keep getting issued, so you might want to use weak validation.  I wrote a little bit about zip codes in a side project on my wiki/blog:    There is also a new, weird type of zip code.     I can do the javascript code, but it would be interesting to see how many languages we can get here. In my experience, "finite" is pronounced (IPA) ˈfaɪnaɪt while "infinite" is ˈɪnfɪnɪt.  In general, the prefix "in" negates an adjective, but does not change the pronunciation. Based on this, I would expect ˈɪnfaɪnaɪt.  Is there a reason for this "deviation from the norm"? Are there dialects/regions that actually say ˈɪnfaɪnaɪt (or ˈfɪnɪt, for that matter)? What is the difference between Fact and Truth? I'm curious about the difference between Fact and Truth. I was searching on the internet if I could find it. But still I'm confused about the exact meaning. I first read the forum discussion here  where an author has given two examples for each like below     A fact is a reality that cannot be logically disputed or rejected. If   I say "fire is hot," I don't care how great your reasoning skills are,   if you touch fire your skin will burn (and don't give me that "but   people can walk on hot coals!" bull. There's a difference between the   transfer of heat through conduction and training one's body to deal   with the agonizing pain of said conduction). Now when I say this, I am   not speaking a truth, I am speaking a fact. If you say "fire is not   hot," you are not lying, you are incorrect. Facts are concrete   realities that no amount of reasoning will change. When one   acknowledges a fact, they are doing just that. Facts are not   discovered, facts are not created, facts are simply acknowledged.      A truth on the other hand, is almost the opposite. Truths are those   things that are not simply acknowledged, but must be discovered, or   created. If I say "God exists," and I possess strong reasoning for the   affirmative of that statement, then God really does exist, that is a   reality. However, if another individual possesses strong reasoning for   the negative, and because of this reasoning they believe that God does   not exist, then that is also a reality. If we were to debate our   ideologies, and my reasoning appeared stronger than theirs, they may   choose to adopt my belief that God does exist. If they do, then the   existence of God is just as true as the nonexistence of God which they   believed a week ago. Truths, as opposed to fact, are much more fluid   and malleable than their empirical counterparts.   and followed by further discussion.  Then I found this . Article from above link says like below:     Facts are notes and lyrics on sheet music.  Truth is what the singer   gives to the listener when she’s brave enough to open up and sing from   her heart.   But still curious about the difference between both of them.  In our daily life, in general conversation, we generally use these both terms interchangeably. Then what is the difference? Are they synonym or have specific difference? My /boot partition hit 100% and now I can't upgrade. Can't remove old kernels to make room My first issue was when I tried to apt-get update or apt-get upgrade. On upgrade I get the following error:  You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: linux-image-server : Depends: linux-image-3.2.0-27-generic but it is not installed E: Unmet dependencies. Try using -f.   I tried running apt-get install -f and this was the output(after saying yes on prompt)  (Reading database ... 186183 files and directories currently installed.) Unpacking linux-image-3.2.0-27-generic (from .../linux-image-3.2.0-27-generic_3.2.0-27.43_amd64.deb) ... Done. dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-27-generic_3.2.0-27.43_amd64.deb (--unpack):  failed in write on buffer copy for backend dpkg-deb during `./boot/System.map-3.2.0-27-generic': No space left on device  No apport report written because the error message indicates a disk full error                                                                           dpkg-deb:    error: subprocess paste was killed by signal (Broken pipe) Examining /etc/kernel/postrm.d . run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-27-generic   /boot/vmlinuz-3.2.0-27-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-27-generic /boot/vmlinuz-3.2.0-27-generic Errors were encountered while processing: /var/cache/apt/archives/linux-image-3.2.0-27-generic_3.2.0-27.43_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)   I tried running apt-get autoremove and it gives me the same error as apt-get upgrade.  When I run df, I get this for /boot:  /dev/sda1                    233191     230297         0 100% /boot   So, I read elsewhere that I should try to purge old kernels. I checked for what kernels I had with:  $ dpkg -l linux-image-\* | grep ^ii ii  linux-image-2.6.38-13-server  2.6.38-13.52  Linux kernel image for version 2.6.38 on x86_64 ii  linux-image-3.0.0-13-server   3.0.0-13.22   Linux kernel image for version 3.0.0  on x86_64 ii  linux-image-3.0.0-14-server   3.0.0-14.23   Linux kernel image for version 3.0.0  on x86_64 ii  linux-image-3.0.0-15-server   3.0.0-15.26   Linux kernel image for version 3.0.0  on x86_64 ii  linux-image-3.0.0-16-server   3.0.0-16.29   Linux kernel image for version 3.0.0  on x86_64 ii  linux-image-3.0.0-17-server   3.0.0-17.30   Linux kernel image for version 3.0.0  on x86_64 ii  linux-image-3.2.0-24-generic  3.2.0-24.39   Linux kernel image for version 3.2.0  on 64 bit x86 SMP ii  linux-image-3.2.0-25-generic  3.2.0-25.40   Linux kernel image for version 3.2.0  on 64 bit x86 SMP ii  linux-image-3.2.0-26-generic  3.2.0-26.41   Linux kernel image for version 3.2.0  on 64 bit x86 SMP   When I try to remove the oldest with this:  $ sudo apt-get purge linux-image-2.6.38-13-server Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: linux-image-server : Depends: linux-image-3.2.0-27-generic but it is not going to be     installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).   How can I free up or extend boot without messing up my installation? I have enabled storing Desktop &amp; Document Folders in iCloud. I keep my Xcode projects on Desktop. Every hour or so, iCloud will store files, inside of Pods folder present alongside the Xcode Project in iCloud. This is very tedious as I then have to click on each one of them one-by-one to re-download.  How can I prevent iCloud from downloading my files in this manner, for this specific Xcode project?  I have tried disabling iCloud for Desktop, but this results in me losing all my Desktop folders/files, so I could rather not go this route. Return a blank when cell reference is blank I am using the following formula in a Google Sheets to calculate the number of days between two dates (dates are in columns G and AL):  =ARRAYFORMULA(if(row(A:A)=1, "Readmission Days", (G:G)-(AL:AL)))   It has to be an array because I am working with a Google Forms and entries are automatically populated into new rows.  The problem is that some of the cells in col AL are blank, so the formula is reading those dates as something else and returning a very large number. Also, when both cells are blank, the formula returns a 0, messing up my data.  How can I include something to ignore blank cells or just return a blank when one or both cell references is blank? Cleaning PCBs... using water? I found  where a technician with a lot of experience seems to clean his PCBs using water, and then he just puts it in the sun so it can dry. I was just amazed to see the circuit keeps working as intended, he says he keeps doing this all the time and several times, however I doubt this is normal.  Which leave me some questions:   What are the recommended methods to clean huge PCBs like the one in the video? What happens to charged capacitors when water shorts them out? Solder joints do not get any kind of corrosion? Is the antisolder mask waterproof? Disable flagging on old chat messages In response to the effect  is referring, I am proposing one of two possible scenarios:   Disallow flags on chat messages older than X hours, or Remove old flagged posts from the transcript, but no suspension occurs (as in the aforementioned question). I have recently purchased a hybrid bike with suspension (not sure if that is relevant to this question). It came with two pieces of plastic. Any ideas what they may be for? What else can you do in the turn you ready an action? Prove that $k[x,y,z,w]/(xy-zw)$, the coordinate ring of $V(xy-zw) \subset \mathbb{A}^4$, is not a unique factorization domain I want to show that $k[x,y,z,w]/(xy-zw)$, the coordinate ring of $V(xy-zw)\subset\mathbb{A}^4$, is not a unique factorization domain.    Morally, all we need to do is find some nonzero element that can be written in two distinct ways as a product of irreducible elements, but nothing is coming to mind immediately. Thoughts? My dev team is getting ready to start a new project. The shop has been a "VB shop" since the days of VB3, but the prevailing opinion now is that we're a ".NET shop" and since C# was created specifically for .NET, whereas VB.NET was a retrofit, we've decided to move forward writing C# only. The controversy revolves around the question of whether the Microsoft.VisualBasic namespace has a legitimate place in new development or if it is only for backward compatibility for VB6 (and older) code. A further, and more interesting question is whether the code "under" the Microsoft.VisualBasic namespace is even .NET code of if it is really the old VB runtime carefully packaged in a .NET wrapper, making it in fact a COM interop control (similar to how WinForms wraps the non-.NET Win32 windowing API but exposes only .NET APIs for consumption).  To make this even more confusing, our dev team has a Microsoft Consulting Services consultant telling us Microsoft no longer supports Visual Basic, including the VB runtime underlying the Microsoft.VisualBasic namespace.  What I'm looking for are links -- preferably to unimpeachable Microsoft sources -- to documentation that definitively answers this question one way or the other. I've already tried several search permutations on Google and not gotten any closer to getting to the bottom of this question.  EDIT: Apparently I didn't make my question clear. I'm not asking if VB.NET is true .NET code. I'm trying to determine if whatever is "under" the Microsoft.VisualBasic namespace is .NET code or if it's the old VB6 runtime carefully packaged and exposed as .NET code. Someone already said that 9/10 of the namespace simply wraps code from elsewhere in .NET; what about that other 1/10? Find a combinatorial argument for the following binomial identity:   $$n(n+1)2^{n-2} = \sum_{k=1}^{n}k^2\binom{n}{k} .$$   Algebraic proofs can be found at  , and a related identity at  . Leave bash script running on remote terminal while not logged in? I have a bash script that takes several hours to run.  While it's running, I would like to do other things, which may involve logging out or disconnecting from the internet (my script runs network tests on various computers).  I understand that there is a command that would allow me to run my tests from a remote terminal and logout of the terminal while it runs.  Does anyone know what this command is? Unable to boot into Windows after installing Ubuntu, how to fix?