Given a TASK_ID, what is the most efficient way to retrieve the latest version of each file?  Here is an example table I am working with.  ID    TASK_ID    FILENAME    VERSION_NUMBER    RANDOM_COLUMN 1     1          a.txt       1                 112 2     1          b.txt       1                 231231 3     1          c.txt       1                 234356 4     1          a.txt       2                 35 5     1          b.txt       2                 84 6     1          b.txt       3                 97604 7     2          aa.txt      1                 6956 8     2          bb.txt      1                 9760054   This is what I have so far.  SELECT FILENAME, TASK_ID, MAX(VERSION_NUMBER) FROM TABLE_NAME GROUP BY FILENAME, TASK_ID HAVING TASK_ID = '1';   Unfortunately, the above only gives me the 3 columns I have in the SELECT statement instead of the entire row and adding more columns will give me an error.  FILENAME    TASK_ID    MAX(VERSION_NUMBER) a.txt       1          2 b.txt       1          3 c.txt       1          1   How might I go about getting the entire row?  I plan on adding this SQL query to a Query annotation within a Spring Repository and run it as a native query. Is that the best way?  EDIT: I ended up with this SQL query, which gets what I want, but I am not sure whether this is correct or how efficient it is.  SELECT ta.* FROM TABLE_NAME ta INNER JOIN (SELECT FILENAME, TASK_ID, MAX(VERSION_NUMBER) vn   FROM TABLE_NAME   GROUP BY FILENAME, TASK_ID   HAVING TASK_ID = '1') sq ON ta.FILENAME = sq.FILENAME AND ta.TASK_ID = sq.TASK_ID AND ta.VERSION_NUMBER = sq.vn;   Result of above SQL query  ID    TASK_ID    FILENAME    VERSION_NUMBER    RANDOM_COLUMN 3     1          c.txt       1                 234356 4     1          a.txt       2                 35 6     1          b.txt       3                 97604
Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.
Is volunteer work allowed in the US while visiting under the VWP or a B1/B2 visa? I am going to Santa Monica for 4 weeks to polish my English in July and would like to volunteer at the Planetary Society located in Pasadena.  I am a Swiss citizen and have a biometric passport. However, I don't have any special visa, as there is no visa needed for the school I am attending and using the Visa Waiver Program, I am allowed to stay up to 90 days in the US.  Am I allowed to do volunteer work during my stay? Is there a law that you can add or multiply to both sides of an equation? Is the subset $[0, \sqrt2] ∩\mathbb{Q} ⊂ \mathbb{Q}$ closed, bounded, compact? Letting $\mathbb{Q}$ be equipped with the Euclidean metric.  What I can work out is that it is bounded as its contained in the closed ball of radius ${\sqrt2}/{2}$ centred at ${\sqrt2}/{2} $.  Its not compact as it can be expressed as union of the two disjoint open sets $[0,{\sqrt2}/{2}) $and$ ({\sqrt2}/{2}, \sqrt2)$ (though I'm not sure if this makes it not compact in $\mathbb{Q}$ or just $\mathbb{R}$).  And its not closed as the sequence of truncations of $\sqrt2$ in $\mathbb{Q}$ converges to $\sqrt2$ Server 2008 Net Send or Msg? I have a Windows 2008 server running as a domain controller. The details are as follows:  Domain: corp Server Name: oxygen   The workstations are all running Windows XP SP3 and have fixed IP addresses.  I am trying to use the net send functionality to be able to send simple messages to either individual machines/users and also to all machines. This is so I can send a message to a user to alert them about something, or likewise alert everyone of something such as the server being rebooted.  Is this possible using Windows Server 2008? If so, what would the command be? Why is the picture not inserted? pgfplots fillbetween with multiple curves I have a TikZ picture like this:  \begin{tikzpicture}   \begin{axis}[     axis lines=middle,     xmin=-0.5,xmax=3.5,ymin=-0.5,ymax=3.5   ]   \addplot[very thick,blue, samples=300, domain=0:3, name path=A] {sqrt(x)};    \addplot[very thick,yellow!70!red, samples=300, domain=0:3, name path=B] {9-3*x};    \addplot[very thick,red!90!teal, samples=300, domain=0:3, name path=C] {3};    \addplot[very thick,green!70!magenta, samples=300, domain=0:3, name path=D] coordinates{(1/9,-6) (1/9,6)};   \end{axis} \end{tikzpicture}     I’d like to fill the area enclosed by these four curves.  Similar questions have been answered using pgfplots’s fillbetween package, but it only seems to support filling between two curves. What are my options? bash: ./program: cannot execute binary file: Exec format error I'm trying to run a program, but an error happens like this:  bash: ./program: cannot execute binary file: Exec format error   The result of file program was:  program: ELF-32-bit LSB executable, ARM, EABI4 version 1 (SYSV), dynamically linked(uses share libs), for GNU/LINUX 2.6.16, not stripped   How can I fix this error?  I'm using Ubuntu 14.04.2 (amd64) with VMware. I also tried with Ubuntu i386, but result was same. What is the equivalent of Windows System Properties or Device Manager? I am new to Ubuntu. In Windows, if I want to know my system properties/configuration, I can see it by going to Control Panel and clicking on the System icon. I can also get a detailed list of the hardware detected/installed by going to the Device Manager.  What are the equivalents of these features in Ubuntu, where a user can see his or her system properties and hardware configuration, like RAM, CPU/processor, hard disk capacity, etc.?    Example of Windows System Properties: Show that if $n$ is not divisible by $2$ or by $3$, then $n^2-1$ is divisible by $24$.   I thought I would do the following ... As $n$ is not divisible by $2$ and $3$ then $$n=2k+1\;\text{or}\\n=3k+1\;\text{or}\\n=3k+2\;\;\;\;$$for some $n\in\mathbb{N}$. And then make induction over $k$ in each case.$$24\mid (2k+1)^2-1\;\text{or}\\24\mid (3k+1)^2-1\;\text{or}\\24\mid (3k+2)^2-1\;\;\;\;$$This question is in a text of Euclidean Division I'm reviewing, and I wonder if there is a simpler, faster, or direct this way. Using R, I have fitted a linear model for a single response variable from a mix of continuous and discrete predictors. This is uber-basic, but I'm having trouble grasping how a coefficient for a discrete factor works.   Concept: Obviously, the coefficient of the continuous variable 'x' is applied in the form y = coefx(varx) + intercept but how does that work for a factor z if the factor is non-numeric? y = coefx(varx) + coefz(factorz???) + intercept   Specific: I have fitted a model in R as lm(log(c) ~ log(d) + h + a + f + h:a) where h and f are discrete, non-numeric factors. The coefficients are:  Coefficients:               Estimate  (Intercept)  -0.679695  log(d)        1.791294  h1            0.870735   h2           -0.447570   h3            0.542033    a             0.037362   f1           -0.588362   f2            0.816825  f3            0.534440 h1:a         -0.085658 h2:a         -0.034970  h3:a         -0.040637   How do I use these to create the predictive equation:  log(c) =  1.791294(log(d)) + 0.037362(a) + h??? + f???? + h:a???? + -0.679695   Or am I doing it wrong?   I THINK that that concept is if the subject falls in category h1 and f2, the equation becomes:   log(c) =  1.791294(log(d)) + 0.037362(a) +  0.870735  + 0.816825  + h:a???? + -0.679695   But I'm really not clear on how the h:a interactive term gets parsed. Thanks for going easy on me. How are the measurements used by Nielsen evolving to meet new methods of content delivery and viewing? I was interested to find out that in the 1950s, Nielsen used devices in the homes of the families that were surveyed to record their viewing preferences, and only later introduced their system of using a diary to record habits:  ...in 1950...This information was collected on a device that was attached to a television that recorded what was being watched.  In 1953, the company began sending out diaries to a smaller sample of homes (“Nielsen families”) within the survey to have them record what they had watched from   So, presumably as multiple different viewers in the home were considered in the sample, the means through which the ratings were recorded changed. Given that so many people are able to record shows digitally and watch when convenient and that so many view their favorites on outlets such as iTunes, how have the Nielsen ratings systems adapted (or how does the company plan to adapt them) to capture our modern viewing preferences? While a DVR-recorded show still technically makes its original &quot;timeslot&quot; relevant to the equation, will Nielsen consider timeslot-specific data a hindrance to comparisons between those shows viewed on cable and the same show viewed on iTunes? Map a function across a list conditionally How can I implement "cut outs" for lighting in OpenGL? Polynomials with integer coefficients such that $p(a)=b,p(b)=c,p(c)=a$ How do I run executable scripts in Nautilus? When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts? Given the following groups, what is the maximum possible order for an element for   (a) $S_5$ (b) $S_6$ (c) $S_7$ (d) $S_{10}$ (e) $S_{15}$  My book justifies the answer as          (a) The greatest order is $6$ and comes from a product of disjoint cycles of length 2 and 3          (b) The greatest order is $6$ and comes from a cycle of length $6$      The other answers were justified exactly the same way, that is (c) 12, (d) 30, (e) 105  I do not understand how in (a) we even got the number "6" from $S_5$ and what disjoint cycles they are referring to. Could someone at least justify one for me? In the following snippet:  public class a {     public void otherMethod(){}     public void doStuff(String str, InnerClass b){}     public void method(a){         doStuff("asd",             new InnerClass(){                 public void innerMethod(){                     otherMethod();                 }             }         );     } }   Is there a keyword to refer to the outer class from the inner class?  Basically what I want to do is outer.otherMethod(), or something of the like, but can't seem to find anything. Expected time to roll all 1 through 6 on a die What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic? What is the difference between old style and new style classes in Python? Rendered aspect ratio different from the viewport's camera view Why would there be a difference in aspect ratio between a rendered image, and the camera perspective in the viewport? My render is getting squashed to fit a different aspect ratio.  Here is a scene with a circle and emission shader.  Camera perspective in the viewport:   Render: