The length of time before the raptors catch you if you run at different angles. See http://xkcd.com/135/ and http://news.ycombinator.com/item?id=1389131
The length of time before the raptors catch you if you run at different angles. See http://xkcd.com/135/ and http://news.ycombinator.com/item?id=1389131
For algs I’m working on a sinatra webapp that will display an interactive red-black tree. It looks cool, but some things are still broken. You can check it out at redblack.samwarmuth.com.
Here’s my first solution to the problem in the previous post. I feel like there has to be a way to make this faster, but I’m not sure it’s possible to bring it below linear time (the read’s going to be linear anyway, right?). Well, this is a pretty naïve start, but it’s decently fast.
require 'set'
possible = Set.new
results = {}
File.open("english_list.txt","r").each_line do |term|
term.chomp!
next if term.length < 3
transposed = "" << term[0...-2] << term[-1] << term[-2]
possible.add term
results[term] = transposed if (term[-2] > term[-1])&&(possible.include?(transposed))
end
results.each {|key, value| puts key + ", " + value}
Works just fine on this wordlist
I’m not, but citrusbyte is. There’s a question they’re asking all applicants to answer. I’m not exactly in the market for a full time job, but it sounded like fun:
Given a dictionary, output all word pairs where both words share all their letters except the last two, which are distinct and reversed. Notes:
I’ll post with my answer later.
Figure 12-1. Psalm 23, printed by Donald Knuth’s METAFONT program. It starts out in an old-fashioned, highly serifed typeface and gradually modulates into a modernistic, sans-serif typeface. Each step, imperceptible on its own, is accomplished by making a tiny shift in 28 parameters governing the overall appearance of the computerized alphabet.
Douglas Hofstadter, Metamagical Themas: Questing for the Essence of Mind and Pattern (Google Books Link)
Originally from The Concept of a Meta-Font by Donald Knuth (no link available).
Sure, this guy watches The Office way too much, but that doesn’t make it any less brilliant. http://www.ribbonfarm.com/2009/10/07/the-gervais-principle-or-the-office-according-to-the-office/
Just got the 5 copies of the poignant guide. They look really good, with one shortcoming: the code is pretty faint. It’s a black and white printing of a color document, so the text is gray already, but as it is fairly small, the printer dots are clearly visible. The effect isn’t unlike a dot matrix display. I’ll hopefully fix it soon, but for now, these are definitely passable, especially for $6.
The best use of Fluff to further learning I’m aware of is Why’s (poignant) Guide to Ruby. Some reviews are critical of it because there is often storyline that has nothing to do with Ruby, and that ‘fluff’ hurts the person learning ruby. The logic there goes something like “if you’re spending time reading something random, that’s time spent not learning ruby.”

Sometimes, not learning new things is a good thing. Ruby is hard. Programming is hard. Learning in general is hard. If it’s not hard, you’re not learning much. You can’t just continue learning hard things for hours at a time: that’s one sure path to brain overload.
You could read a hard book for a bit, relax for a bit, read the book some more. But it’s more than likely that you’ll get sidetracked while you relax. The beauty of W(p)GTR, and other books like it, is that it provides a sort of ‘structured fluff.’ It gives you something to think about, a break from thinking hard, but keeps you reading the book, and eventually brings you back to the task at hand.
As PG discusses in Disconnecting Distractions, “The key [to avoiding distraction] seems to be visibility. The biggest ingredient in most bad habits is denial. So you have to make it so that you can’t merely slip into doing the thing you’re trying to avoid.” By keeping you in the book, even just floating along with the story, the author is keeping you from being distracted by something else.
This is the main reason that I was able to shoot through W(p)GTR this weekend without ever programming in ruby before. It’s possible that _why could have compressed the ‘knowledge’ of the guide into 100 or 75 pages, but it would have been much harder for me to read it all at once. It’s extended to 175 pages, interspersed with inane tidbits and random storyline.
I’ll admit that this is only a single example, and there are many other possible reasons that W(p)GTR is so successful in its aim. But to me, the idea really rings true.
Also, if you haven’t read (or at least looked at) the poignant Guide, I can’t recommend it enough. And it’s CC Share-alike, so there’s no barrier to entry. Here’s a link to the book online.
If you’re more of a fan of hard-copy, you can buy the book from lulu for 6 dollars plus shipping. Quite the deal.
How come nobody told me, or why didn’t I listen?
Going through W(p)GtR today, I really wished that I had a hardcopy to look at. Seeing as it’s CC Share-Alike and a fully formatted PDF is available, I assumed I’d be able to find it easily on amazon. Amazon autocompletes “why’s poignant guide to ruby”, but the only book that might actually be it is this. Not exactly promising, and $20 + shipping. So I whipped something up on lulu: Why’s (poignant) Guide to Ruby.
A much better price ($9.99+shipping). I’m not sure how all of the formatting is going to work out (the preview is messed up, but everything else looks fine), so I would suggest waiting until I get my copy (6-10 business days) before buying it yourself. Once I get it, I’ll get some pictures of the finished product.
If it looks really good, I might even buy a bunch of extra copies (discount from lulu) and ship them out to people media mail (lulu shipping is expensive). If I do that, I might be able to get the price plus shipping under $10. That would be pretty awesome.
from xkcd