Jan
12
2012
wrathematics
My last post of substance was all about improving your performance using R to answer programming questions that might be asked during a job interview. So let's say you nailed the interview and got the job, but you desperately want to be fired for grand incompetence. Never fear, your pal at librestats once again has your back.
The sleep sort
First, we'll tackle the sleep sort after an important
Read more >>
5 comments | tags: Parallel R, Programming, R | posted in R
Jan
10
2012
wrathematics
My time as a grad student will soon draw to a close. With this comes the terrifying realisation that I'm going to start applying for jobs and, hopefully, interviewing soon, forever leaving my comfortable security blanket of academia.
With that horrible thought in mind, I've been doing some poking around to see what various kinds of technical interviews are like. Apparently, it is not entirely
Read more >>
3 comments | tags: ggplot2, Monte Carlo, Parallel R, Programming, R | posted in R
Nov
27
2011
wrathematics
Problem: What is the greatest product of four adjacent numbers in any direction (up, down, left, right, or diagonally) in the 20×20 grid?
Commentary: Well, it's been a while since I've posted anything. Once again, the semester and research get the better of me.
As for this problem, like several before it I will be passing off some things to the shell for convenience. This can
Read more >>
no comments | tags: Project Euler, R | posted in Project Euler Solutions
Sep
14
2011
wrathematics
So maybe I'm a strange guy, but I think fork bombs are really funny. What's a fork bomb? The basic premise is that you spawn a process that spawns a process that spawns a process..., ad infinitum.
The most beautiful example of a fork bomb, and really one of the most beautiful lines of code ever, was created by Denis Rolo:
Aside from looking like the gnarliest smiley face ever, running
Read more >>
3 comments | tags: Parallel R, Programming, R | posted in R
Aug
29
2011
wrathematics
So that mean old boss of mine is at it again. This morning I came in beaming about how many people had read my post How Much of R is Written in R (thanks by the way!). He then asks me about one little line in that post; the one about how if you looked at the contributed packages, you'd overwhelmingly see them written in R, and that this is what really matters.
He asked if I had bothered to verify
Read more >>
5 comments | tags: R, Shell Scripting | posted in R
Aug
27
2011
wrathematics
My boss sent me an email (on my day off!) asking me just how much of R is written in the R language. This is very simple if you use R and a Unix-like system. It also gives me a good excuse to defend the title of this blog. It's librestats, not projecteulerstats, afterall.
So I grabbed the R-2.13.1 source package from the cran and wrote up a little script that would look at all .R, .c, and .f
Read more >>
18 comments | tags: R, Shell Scripting | posted in R
Aug
26
2011
wrathematics
Problem: Find the sum of all the primes below two million.
Commentary: If you're not careful, this problem can really get you in R. In poking around the internet, there are a few solutions to this problem, but all the ones I've tested are slow. Some, even from people who are better at R than me, are VERY slow. That linked one in particular took 6 minutes and 8.728000 seconds to complete. My
Read more >>
no comments | tags: Primes, Project Euler, R | posted in Project Euler Solutions
Aug
24
2011
wrathematics
Problem: There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc.
Commentary: I'm not proud of this solution. Every time I would look at this solution, I just knew there was something really obvious I was missing--that I was doing this in the most bone-headed way possible. So then I finally just gave up and checked the writeup at Project Euler, and yep,
Read more >>
no comments | tags: Project Euler, R | posted in Project Euler Solutions