How to get max of one date in a table in sql
Fetch the row which has the Max value for a column
How do I upload a file to an SFTP server in C# (.NET)? Does a free .NET library exist with which I can upload a file to a SFTP (SSH FTP) server, which throws exceptions on problems with the upload and allows the monitoring of its progress? Making extra parameters optional I've setup a very specific function and it works well but I'd like to make the parameters optional but I can't get a handle on the regex bit:  add_rewrite_rule('whats-on/([^/]+)/([^/]+)/([^/]+)/?$', 'index.php?page_id=71&amp;event_year=$matches[1]&amp;event_month=$matches[2]&amp;event_day=$matches[3]','top');   /whats-on/2012/01/25 I'll show all events on this date.  /whats-on/2012/01 goes to 404 but I'd like the parameter to be optional so I can show all January dates and the same for /whats-on/2012 all dates in year 2012  Any help will gratefully received - thanks Payment from Apple for developer Is there any way to backtrack to previous areas? Why does the reputation need to be publicly displayed? According to the documentation, they're pretty much interchangeable.  Is there a stylistic reason to use one over the other? How to Query all opportunities ids from account I write a sample query to fetch account Ids from cases of a particular record type.Then i wrote another sample query parent to child relationship to fetch opportunity ids from accounts.  My sample code  List&lt;Case&gt; c=new List&lt;Case&gt;(); c=[Select Id,accountId from case where RecordTypeId = '01290000000sF3L']; List&lt;Id&gt; accountIds= new List&lt;Id&gt;(); List&lt;Account&gt; accounts=new List&lt;Account&gt;(); List&lt;Opportunity&gt; opps=new List&lt;Opportunity&gt;(); for(Case cl:c)  { accountIds.add(cl.accountId); } accounts=[Select Id,name,(select Id,name from opportunities) from account        where Id in:accountIds]; System.debug('Data in accounts '+accounts);   But my issue is how to get opportunity id from above Soql accounts means how to add those opportunity id's to the list.  for(Account ao:accounts) { //How to fetch Opportunity ids from above account list. } Why does Windows only show about 3.5 GB of my 4 GB of RAM? I just want to know if it's possible to get Cain and abel installed in ubuntu, it would really help my work instead of dual booting back to my windows 7 just to use it. THanks! Why can't I log into my minecraft account Why did Dumbledore 'put on' the Resurrection Stone (Ring)? Dumbledore put on Marvolo's ring, knowing that it was the Resurrection Stone which was on the ring. He also knew (even though he &quot;lost his head&quot; in his excitement to see his family again) that the ring was a Horcrux and would &quot;surely carry a curse&quot;:  When I discovered it, after all those years, buried in the abandoned home of the Gaunts - the Hallow I had craved most of all, though in my youth I had wanted it for very different reasons - I lost my head, Harry. I quite forgot that it was now a Horcrux, that the ring was sure to carry a curse. I picked it up, and I put it on...  -Deathly Hallows, Ch 35 - KING'S CROSS Now when Harry realised that the Resurrection Stone was inside the Snitch, all he had to do was turn it three times for it to 'work':  He closed his eyes and turned the stone over in his hand three times. He knew it had happened, because he heard slight movements around him that suggested frail bodies shifting their footing on the earthy, twig-strewn ground that marked the outer edge of the forest.  -Deathly Hallows, Ch 34 - THE FOREST AGAIN I may be missing something, but did Dumbledore incorrectly use the Resurrection Stone? or did Harry just 'think' that he had to turn it thrice? I'm assuming the answer may have been that Dumbledore wanted to have the ring on, and then turn it thrice whenever he felt like conjuring up his family; or that he simply &quot;lost his head&quot;; but he surely didn't need to put it on right? What is the correct way to use the Resurrection Stone? Why is the shape of lightning or an electric spark a zig-zag line? Why is the shape of the  (or an electric spark) always of a zig-zag nature? Why is it never just a straight line?     . Find all solutions of the equation $n^m=x^2+py^2$ which satisfy the following properties Prove or disprove that,     There always exists a solution of the equation, $$n^m=x^2+py^2$$ with odd $x$ and $y$ and for all $m\geq k$ for some positive integral $k$. Here $p$ is an odd prime and $n\in 2\mathbb{N}$. Is $k$ dependent on $n$? If so then find a way to calculate the value of $k$.   This is basically one of my conjecture which I am trying to prove for quite sometime. Unfortunately, I have progressed very little in this problem. So far I have been only able to prove that for all $m\geq3$ , $n=2$ and $p=7$ there is always a solution of the equation meeting the constraints.   Any idea how to tackle the problem?    Update  After D. Burde's answer of the original problem (see below) I am now interested in finding all $(n,m,p)$ triplets such that the equation holds. Any ideas regarding this problem? I am trying to create an spritz app. Everything was working fine, but since yesterday I keep getting this error:     ./spritz: line 176: syntax error: unexpected end of file   I have checked the script file and everything seems perfect. I am confused, I have an if statement at last and it looks correct! Here is the last portion:  #checks if speed is 150 157 if [[ $2 -eq 150 ]]; 158 then 159 starttime=$SECONDS 160      FS=$'\n' 161      for j in `grep --color=always -iP '\b[^aeiou\s]*[aeiou][^aeiou\s]*\K[aeiou]' $1`; 162      do 163            #Reads the text file in the centre of the screen 164            echo "                                                    ___________________" 165            echo "                                                             $j"; 166            echo "                                                    ___________________" 167            echo "                                                                               Speed 150 wpm" 168            sleep  0.9; 169            clear; 170       done 171 endtime=$(($SECONDS - $starttime)) 172            echo "You read $words_read words in $endtime seconds!" 173       exit 8 174 fi   What could cause that error? As mentioned in the , Ubuntu 18.04 LTS will not have a 32 bit Desktop Image Installer. But in the  it has  32bit Desktop Images.  This is little off topic, but I'm confused. Linear regression prediction interval How to attach CGPDFDocument/CGPDFPage to MFMailComposeViewController Is Stack Overflow merging two different accounts by email without the user's consent? I had one account through Google with email X and another account through myopenid.com. I happened to add the same email X to this myopenid.com account. My intention was to stop using the Google account in favor of the new myopenid.com account.   After some time asking and answering questions with my openid.com account I am astonished to find out that it is now merged into my Google account. That creates all kinds of privacy issues. I thought the email on my Stack Overflow account was private. Did I miss anything here?  To be clear, I wanted to preserve my privacy in the second account, but now since all my recent questions were transferred to the old account, my privacy is completely lost.  And it looks like there is no verification for the email field in my profile, so if Stack Overflow is using that info to merge, there is a very serious security bug. If it is merging based on something else, that's even worse. I think your account belongs to that user here. Let me merge it. Terrible! limit of integral $n\int_{0}^{1} x^n f(x) \text{d}x$ as $n\rightarrow \infty$ I am trying to solve the following problem at the level of a senior undergrad analysis level. So, the problem is as follows: We are given a function $f$ which is continuous on the interval $\left [ 0,1 \right ]$, and the question is to find the limit: $$\lim_{n\rightarrow \infty}\int_{0}^{1}x^{n}f(x)dx\;.$$ The second part of the problem is to deduce the following limit: $$\lim_{n\rightarrow \infty}n\int_{0}^{1}x^{n}f(x)dx\;.$$  For the first part: I just did the following: For every $0\leq x&lt; 1$: $x\leq M$, where $0&lt; M&lt; 1$. Then: $$\int_{0}^{1}x^{n}f(x)dx\leq M^{n}\int_{0}^{1}f(x)dx\;.$$ Then: $$\lim_{n\rightarrow \infty }\int_{0}^{1}x^{n}f(x)dx\leq \lim_{n\rightarrow \infty }M^{n}\int_{0}^{1}f(x)dx= 0.\int_{0}^{1}f(x)dx=0\;,$$ so $$\lim_{n\rightarrow \infty }\int_{0}^{1}x^{n}f(x)dx=\lim_{n\rightarrow \infty }f(1)\int_{0}^{1}1dx=f(1)\;.$$ Does that make sense? If not, please show me the correct one.  As for the second part, I have no idea what to do. Any help? How to minimize residual sum of squares of an exponential fit? I have the following data and would like to fit a negative exponential growth model to it:  Days &lt;- c( 1,5,12,16,22,27,36,43) Emissions &lt;- c( 936.76, 1458.68, 1787.23, 1840.04, 1928.97, 1963.63, 1965.37, 1985.71) plot(Days, Emissions) fit &lt;- nls(Emissions ~ a* (1-exp(-b*Days)), start = list(a = 2000, b = 0.55)) curve((y = 1882 * (1 - exp(-0.5108*x))), from = 0, to =45, add = T, col = "green", lwd = 4)   The code is working and a fitting line is plotted. However, the fit is visually not ideal, and the residual sum of squares seems to be quite huge (147073).   How can we improve our fit? Does the data allow a better fit at all?  We could not find a solution to this challenge on the net. Any direct help or linkage to other websites/posts is greatly appreciated.