i'm kind of new in sql, right now I'm trying to get the best average for each group(GRP) and i have this table.      i'm tryng to get something like this, but im not sure how to do it
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.
What's the difference between dot syntax and square bracket syntax? Evaluating $\int\limits_0^{\pi} \frac{dx}{1+2\sin^2x}$ After making u substitution two times, I am getting indefinite integral as $$\int\limits\dfrac{dx}{1+2\sin^2x} = \dfrac{\arctan(\sqrt{3}\tan(x))}{\sqrt{3}}+ C$$  I am stuck at working the bounds because I am getting $0$ but the answer needs to be $\pi/\sqrt{3}$.  I think $\arctan(x)$ is defined in $-\pi/2 \lt x\lt\pi/2$ while making u substitution. However I don't see how to use this observation to my advantage. Can anybody help in getting the answer and understanding whats going on. Thanks ! The $ l^{\infty} $-norm is equal to the limit of the $ l^{p} $-norms. Terminal icon in window titlebar is stretched out over window control buttons A while ago I upgraded from Ubuntu 17.04 to Ubuntu 17.10 and everything is working fine except for the fact that the icon in the window title bar of my Terminal seems to be stretched out to some ridiculous size.    This only seems to happen in the Terminal window. The Nautilus icon is completely fine.    The problem seems to go away if I login into an Xorg session instead of a Wayland one. I've looked around and didn't find any immediate solution to this. Any help would be greatly appreciated. Left ideals of $M_n(K)$ How does "failure" work in Dungeon World? How does it move the story forward? I am having trouble understanding the specifics of failure in Dungeon World. According to the rules, a GM should "make a move" against players when they fail, and that's alright, I get that.  What I don't get is how a GM is supposed to advance the plot by doing so. Let's take an example:  Rick the Fighter is climbing a massive chain that serves to hold down the wizards tower, preventing it from drifting off. He makes the move Defy Danger, to avoid slipping of, since it's raining hard, and the chain is slippery with algae and moss. He rolls and get a score of 5, meaning he fails.  In the above situation, he fails climbing the chain, so the GM should make a move. I have a hard time seeing what move would advance the story here, since I feel that the failure would imply that he doesn't get to the tower.  Is this one of those situations, where you just skip making a roll, and just let the players climb the chain, or does anyone have any idea how to handle the move, so that the story is advanced somehow?  I just want to be able to give the players some dangers that aren't traps and monsters, and I thought that a flying wizards tower was cool. I'm having a hard time seeing how I can advance the story on a failure in this situation.    Let me elaborate on the problem. I will not say that it's wrong to make the players succeed with some "cost", even on a failed roll, it just makes true "failure" impossible. That's my beef about it. The players will eventually succeed at anything that doesn't outright kill them. Let $X$ and $Y$ be topological spaces. A function $f: X \rightarrow Y$ is defined as continuous if for each open set $U \subset Y$, $f^{-1}(U)$ is open in $X$. This definition makes sense to me when $X$ and $Y$ are metric spaces- it is equivalent to the usual $\epsilon-\delta$ definition. But why is this a good definition when $X$ and $Y$ are not metric spaces?  How should we think about this definition intuitively? How to call gdal_translate from Python code? Is it possible to use some gdal API to call gdal_translate from Python code? I do not mean simply executing the gdal_translate.exe from the file system, but rather call it somehow in code so I do not need to know the exact directory the gdal_translate executable is in? On this  there are more than 50 links to Stack Overflow questions. However, the last 6 links aren't converted to titles (http://facebook.stackoverflow.com/questions/6530420/control-the-image-that-facebook-shows-when-i-like-a-url should be converted to ).   However:  all http://facebook.stackoverflow.com/... into http://stackoverflow.com/... fixes this, both in the preview and the final result. Also, the preview won't show any title for http://facebook.stackoverflow.com/... links.  My question is, what limitations does this converting have? How are these question titles retreived? Via API? Through database?  I'm not sure about title, feel free to edit that I would like to be able to execute a SOQL query that will allow me to see which users have access to a certain record type for a certain object.  For example, if I have a case record type called Phone Team, I would like to make a query that returns the names of all the users that have been assigned the Phone Team record type, as can be seen in the native user interface in a profile's Object Settings page.  So far I have managed to get a query that can get the names of all the users that have, for example, read access to the case object:  SELECT Assignee.Name FROM PermissionSetAssignment      WHERE PermissionSetId IN          (SELECT ParentId FROM ObjectPermissions WHERE SObjectType = 'Case'               AND PermissionsRead = true AND Parent.IsOwnedByProfile = true)   However, there doesn't seem to be any way to access record type assignment in the same way that you can object permissions.  I see from  that the info can be obtained via the metadata API, but I would much prefer to do it by SOQL if possible.  Thanks How do I convince someone that $1+1=2$ may not necessarily be true? Me and my friend were arguing over this &quot;fact&quot; that we all know and hold dear. However, I do know that $1+1=2$ is an axiom. That is why I beg to differ. Neither of us have the required mathematical knowledge to convince each other. And that is why, we decided to turn to Math Stackexchange for help. What would be stack's opinion? I am attempting to set a value in a textarea field using jquery with the following code:  $("textarea#ExampleMessage").attr("value", result.exampleMessage);   The issue is, once this code executes, it is not altering the text in the textarea?  However when performing an alert($("textarea#ExampleMessage").attr("value")) the newly set value is returned? Bezout's identity in $F[x]$ Let $F$ be a field and $F[x]$ a polynomial ring. Let $p(x)$ be an irreducible polynomial.  Show that $\gcd(p(x),q(x)) = 1\Longrightarrow \exists r(x),s(x)$ such that $r(x)p(x)+s(x)q(x) = 1$.  I know the proof for Bezout's identity for , but this proof uses the notion of absolute value, which cannot be applied to a polynomial ring.   I am thinking about a way to prove the statement: Use the Euclidean algorithm to compute $\gcd(p(x),q(x))$ and show that the result is $1$, and somehow go backwards to obtain $r(x)p(x)+s(x)q(x) = 1$, but it is a bit messy, and I'm not yet able to see it completely.  Please offer some help. If you have some other methods, that would be great, too. Superluminal neutrinos I was quite surprised to read this all over the news today:     Elusive, nearly massive subatomic particles called neutrinos appear to travel just faster than light, a team of physicists in Europe reports. If so, the observation would wreck Einstein's theory of special relativity, which demands that nothing can travel faster than light.   &mdash;  Apparently a CERN/Gran Sasso team measured a faster-than-light speed for neutrinos.   Is this even remotely possible? If so, would it be a real violation of Lorentz invariance or an "" effect?   The ; a webcast is/was planned .  News conference video A 10th level Drow warlock (for instance) has the following Drow Magic racial trait (PHB p. 24), in addition to its warlock spellcasting abilities:  You know the dancing lights cantrip. When you reach 3rd level, you can cast the faerie fire spell once per day. When you reach 5th level, you can also cast the darkness spell once per day. Charisma is your spellcasting ability for these spells.  Can the Drow warlock cast faerie fire (which is not on the warlock spell list) using a warlock spell slot? Can it cast darkness (which is on the warlock spell list) using a warlock spell slot?  The  says this about the Magic Initiate feat:  If you’re a spellcaster, can you pick your own class when you gain the Magic Initiate feat? Yes, the feat doesn’t say you can’t. For example, if you’re a wizard and gain the Magic Initiate feat, you can choose wizard and thereby learn two more wizard cantrips and another 1st-level wizard spell. If you have spell slots, can you use them to cast the 1st-level spell you learn with the Magic Initiate feat? Yes, but only if the class you pick for the feat is one of your classes. For example, if you pick sorcerer and you are a sorcerer, the Spellcasting feature for that class tells you that you can use your spell slots to cast the sorcerer spells you know, so you can use your spell slots to cast the 1st-level sorcerer spell you learn from Magic Initiate. Similarly, if you are a wizard and pick that class for the feat, you learn a 1st-level wizard spell, which you could add to your spellbook and subsequently prepare.  But this specifically requires you to pick the feat for one of your classes to be able to cast the spell learnt using your class spell slots, and does not seem directly applicable. A Warlock can use warlock Pact Magic spell slots to cast spells learnt from levels of another spellcasting class, per the multiclass spellcasting rules (PHB p. 164):  If you have both the Spellcasting class feature and the Pact Magic class feature from the warlock class, you can use the spell slots you gain from the Pact Magic feature to cast spells you know or have prepared from classes with the Spellcasting class feature, and you can use the spell slots you gain from the Spellcasting class feature to cast warlock spells you know.  Similarly, if the warlock has learnt the invocation Mask of Many Faces (PHB p. 112)...  You can cast disguise self at will, without expending a spell slot.  ...Can the warlock cast disguise self using a spell slot, e.g. to decrease the chance it can be dispelled? There's something funky about some titles in revision histories here on Meta Stack Exchange Question is :  Suppose $X$ is a topological space of infinite cardinality which is homeomorphic to $X\times X$. Then which of the following is true:   $X$ is not connected. $X$ is not compact $X$ is not homeomorphic to a subset of $\mathbb{R}$ None of the above.   I guess first two options are false.  We do have possibility that product of two connected spaces is connected.  So, $X\times X$ is connected if $X$ is connected. So I guess there is no problem.  We do have possibility that product of two compact spaces is compact.  So, $X\times X$ is compact if $X$ is compact. So I guess there is no problem.  I understand that this is not the proof to exclude first two options but I guess the chance is more for them to be false.  So, only thing I have problem with is third option.  I could do nothing for that third option..  I would be thankful if some one can help me out to clear this.  Thank you :) Turning live() into on() in jQuery I'm having some trouble understanding a proof on  on Number Theory and I was wondering if you guys could give me some help. The problem is that I don't understand the last implication on the proof for example 1.1     Example 1.1. Let x and y be integers. Prove that 2x + 3y is divisible by 17 iff 9x + 5y is divisible by 17.      Solution. 17 | (2x + 3y) ⇒ 17 | [13(2x + 3y)], or 17 | (26x + 39y) ⇒ 17 | (9x + 5y)       conversely, 17 | (9x + 5y) ⇒ 17 | [4(9x + 5y)], or 17 | (36x + 20y) ⇒ 17 | (2x + 3y).   My problem is that I don't understand how does 17 | (26x + 39y) imply 17 | (9x + 5y). If you could elaborate on this step I would be most grateful.  I'm sorry if this is an obvious question but I am a beginner and I just can't get it.  Thanks for your help in advance. Suppose $f:X\rightarrow Y$ is a surjection and you want to show that there exists $g:Y\rightarrow X$ s.t. $f\circ g=\mathrm{id}_Y$. You need the AC to show this.  However, suppose $f$ is a injection and you want show there is $g$ s.t. $g\circ f=\mathrm{id}_X$. Then, according to my textbook, you don't need the AC to show this.  This is counterintuitive to me, because it's like you need a special axiom to claim that an infinite product of big sets is nonempty, while you don't need one to claim that an infinite product of singleton sets is nonempty, which seems smaller than the former.  So why don't you need the AC to show the latter?  EDIT: $X$ should be nonempty.  EDIT 2: I realized (after asking this) that my question mostly concerns whether the AC is needed to say that an infinite product of finite sets is nonempty, and why.