Photo

May 30, 2010
@ 12:35 am
Permalink

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


Photo

Dec 12, 2009
@ 11:10 pm
Permalink

Ok, so maybe I have too much time on my hands.

Ok, so maybe I have too much time on my hands.


Photo

Dec 11, 2009
@ 12:08 pm
Permalink

Finally presented on memcached for my database class. Watch the slideshow {slideshare}

Finally presented on memcached for my database class. Watch the slideshow {slideshare}


Photo

Nov 16, 2009
@ 1:17 pm
Permalink

P289 Introduction to Algorithms, Second Edition CLRS

In what cases do you run line 17?

Not really hard to figure out, but a lot more ambiguous than it needs to be.

P289 Introduction to Algorithms, Second Edition CLRS

In what cases do you run line 17?

Not really hard to figure out, but a lot more ambiguous than it needs to be.


Text

Nov 1, 2009
@ 9:43 pm
Permalink

Red-Black Tree

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.


Text

Oct 29, 2009
@ 11:02 pm
Permalink

First solution

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


Text

Oct 29, 2009
@ 3:12 pm
Permalink

Now Hiring

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:

  • use a reasonable dictionary of your choice
  • potential word pairs are: “ear, era” ; “revies, revise” ; “burglaries, burglarise”
  • “shear, era” is not a valid pair because “she” != “e”
  • “bell, bell” is not a valid pair because the last two letters are not distinct
  • this will be benchmarked

I’ll post with my answer later.


Photo

Oct 20, 2009
@ 1:48 pm
Permalink

Figure 12-1. Psalm 23, printed by Donald Knuth&#8217;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).

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).


Text

Oct 14, 2009
@ 4:12 pm
Permalink

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/


Text

Oct 13, 2009
@ 4:02 pm
Permalink

Why’s Guide, Paperback

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.


Text

Oct 11, 2009
@ 3:00 pm
Permalink

Defending Fluff

Fluff all by itself is certainly a bad thing. No doubt about it. On the other hand, Fluff sandwiched between meaningful information can be a great thing.

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.


Text

Oct 5, 2009
@ 1:24 am
Permalink

Ruby is awesome.

How come nobody told me, or why didn’t I listen?


Text

Oct 3, 2009
@ 4:25 pm
Permalink

why’s (poignant) Guide to Ruby, paperback style

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.


Photo

Oct 2, 2009
@ 6:31 pm
Permalink

from xkcd

from xkcd


Quote

Oct 2, 2009
@ 6:29 pm
Permalink

Well, I was just totally sold by Adam, the idea being that if it walks like a duck and talks like a duck, it’s a duck, right? So if this duck is not giving you the noise that you want, you’ve got to just punch that duck until it returns what you expect.

Patrick Ewing