Apply function to subset of data frame
How to select the rows with maximum values in each group with dplyr?
$2+2 = 5$? error in proof $$\begin{align} 2+2 &amp;= 4 - \frac92 +\frac92\\ &amp;= \sqrt{\left(4-\frac92\right)^2} +\frac92\\ &amp;= \sqrt{16 -2\times4\times\frac92 +\left(\frac92\right)^2} + \frac92\\ &amp;= \sqrt{16 -36 + \left(\frac92\right)^2} +\frac92\\ &amp;= \sqrt {-20 +\left(\frac92\right)^2} + \frac92\\ &amp;= \sqrt{25-45 +\left(\frac92\right)^2} +\frac92\\ &amp;= \sqrt {5^2 -2\times5\times\frac92 + \left(\frac92\right) ^2} + \frac92\\ &amp;= \sqrt {\left(5-\frac92\right)^2} +\frac92\\ &amp;= 5 + \frac92 - \frac92 \\ &amp;= 5\end{align}$$  Where did I go wrong Facebook changed how their API serves profile pictures that are requested with a non-application scope UID. Now because before Graph API 2 all applications shared the original UID, if users like me has joined Stack Exchange websites before  2, rolling out their profile pictures are not shown properly. Facebook suggests to use an access token to query those profile pictures, either an application access token or a user access token. A user access token is not a reliable option at all, because it would only work for users who joined website with Facebook and are currently logged in. Application access tokens, by the way, can be used by creating sort of a proxy that would retrieve a profile picture from Facebook and display it. Yet still it's not perfect. I think the best solution is to communicate with Facebook and ask them to offer an opportunity to convert old Graph API 1 UID's to application scope user IDs. I've created a script that runs every night on my Linux server that uses mysqldump to back up each of my MySQL databases to .sql files and packages them together as a compressed .tar file.  The next step I want to accomplish is to send that tar file through email to a remote email server for safekeeping.  I've been able to send the raw script in the body an email by piping the backup text file to mailx like so:  $ cat mysqldbbackup.sql | mailx backup@email.com   cat echoes the backup file's text which is piped into the mailx program with the recipient's email address passed as an argument.  While this accomplishes what I need, I think it could be one step better, Is there any way, using shell scripts or otherwise, to send the compressed .tar file to an outgoing email message as an attachment?  This would beat having to deal with very long email messages which contain header data and often have word-wrapping issues etc. Should my first trip be to the country which issued my Schengen Visa? In case, if I get a multiple-entry Schengen visa in one of the embassies in Ukraine, Kyiv - should my first trip be to the country which issued the visa?  Any there any requirements of this sort? Does this condition vary depending on embassy which issued the visa?  What are the possible consequences on not visiting that country first? Does it somehow depend on country where the embassy is (i.e. non-Schengen and not EU members)? What are the functions that are their own inverse?  (thus functions where $ f(f(x)) = x $ for a large domain)  I always thought there were only 4:  $f(x) = x , f(x) = -x , f(x) = \frac {1}{x} $ and $ f(x) = \frac {-1}{x} $   Later I heard about a fifth one     $$f(x) = \ln\left(\frac {e^x+1}{e^x-1}\right) $$ (for $x &gt; 0$)  This made me wonder are there more? What are conditions that apply to all these functions to get more, etc. Why does a translation matrix need extra row? I was trying to change my username and also my home directory (/home/username) and my system started to crash. I deleted the passwd file but I had a backup named passwd_bkp. I tried to rename this passwd_bkp as passwd and it did not work. No commands were being executed... I was in a terminal window.   I restarted my system and now I cannot log in. GRUB gives two options: Linux and recovery mode.   I tried to open a sessions as root but it says the filesystem is corrupted. I cannot access my files.  Did I lose all my files? How to automatically restart a linux background process if it fails? Properties of the greatest common divisor: $\gcd(a, b) = \gcd(a, b-a)$ and $\gcd(a, b) = \gcd(a, b \text{ mod } a)$ Prove that (a) gcd(a, b) = gcd (a, b – a) (b) Let r be the remainder if we divide b by a. Then gcd(a, b) = gcd(a, r).  I solved part a like: Assume a=pcommonpa b=pcommonpb gcd (a,b) = pcommon b-a = pcommon*(pb-pa)  So: gcd(a, b-a) = common again But I need help for part b guys I can solve it but I need a mathematical expression. Return to 1st image on slideshow If I have the function $f(x)$ and I want to apply it $n$ times, what is the notation to use?  For example, would $f(f(x))$ be $f_2(x)$, $f^2(x)$, or anything less cumbersome than $f(f(x))$? This is important especially since I am trying to couple this with a limit toward infinity. Windows 7 Automatically Connecting To Unsecured Wireless Networks On Startup Most of the questions on this topic related to folks connecting to somebody else's wireless network when their own was available and could remedy the situation by going to their connections and unchecking the "connect automatically" box.  See this: "  " as an example.  In my situation, I've noticed that Win 7 will automatically connect to any unsecured wifi network - even if I have never connected to it in the past.  If I am traveling and boot Win 7, it will start and connect to what appears to be the best signaled unsecured network without prompting me for confirmation (note: in the above link, "Naveen" seems to have same problem).  Obviously, that is a security concern to me.  Further, when I open "Network and Sharing" and "Manage wireless networks"  the network is not displayed (probably because I labelled it a public network).  Again, these are new, never connected with before, wireless networks.  I always promptly disconnect from them but don't want to have to be on constant guard for an auto connection to a malicious network.  This began about a month ago, as I recall, Win 7 did not behave like this in the past, I didn't monkey with wifi settings, and don't use a 3rd party connection manager.  I did have to download some internet security certificates for army website access but I don't think that should mess with network settings.  Any ideas how I can tell Win7 cease automatically connecting to networks or, at least, to prompt me for a confirmation before connecting? Does a first generation iPod touch have the ability to download apps and use emojis? I am getting a 1st gen iPod touch for a friend and I was wondering if you can download like apps and games on it and if it has emojis? It would help to get an answer before I buy it! I have two LED lamps in my corridor, and when I switch them off, they keep emitting light (not very strong, but it's annoying at night).  What can it be? How can I fix it? Page returns 404 with POST variables, but not without I have a problem with my page. I'm trying to make a "Contact Us" page. It's working perfectly fine design-wise. But when I try to send the form to the same page as origin. It returns 404 error.  It only happens when I'm sending the form. I've tried both with GET and POST requests. Nothing seems to work.  I've even commented out the PHPMailer part. It's caused entirely by the extra variables.  If it helps anything, they're "name", "email" and "message". Why we usually do not exceed ARMA(5,5) models in practice? Is there any mathematical justification for this? What should a main game loop do? Generally, what are the core things that one should do in the game loop, and what are some things that one shouldn't do in the game loop? Are there attacks that break collision resistance but not preimage resistance? Are there any examples of attacks on hash functions which:   break collision resistance and second preimage resistant, or break collision resistance and preimage resistant?   I have looked at Rogaway's paper1, but it seems complicated, hence was wondering if a succinct example exists.  1)  Phillip Rogaway and Tom Shrimpton. Fast Software Encryption (FSE) 2004, LNCS vol. 3017, pp. 371&ndash;388, Springer, 2004. What's the starting wealth for higher levels? The PHB only gives starting wealth for Level 1 PCs. Based on my experience in other games, specifically Pathfinder, I would expect to get more at higher levels. Where can I find an appropriate table or calculation? When I upload an image to Stack Overflow, I cannot see my JPEG file in my post. It's all blank. I've tried it with different files, but gotten the same result.