T < x < B

Too long to tweet, too short to blog.
Dec 01
Permalink
Even such a simple command as ‘wait until either the UI thread or the networking thread comes up with something’ is a source of ongoing pain in most languages, but is built into Go as a core concept using select.
Permalink

At one point I got into a small argument with some guy about how I thought “markdown string”.to_html was a really stupid idea, and he just thought it was obvious and wonderful, and that I clearly didn’t understand object oriented programming.

I think it’s when people try to tell me about how I don’t understand object oriented programming (because how could someone understand such things if they use Python?) that gets me a bit testy.

ActiveResource’s Hash.to_xml method is similarly nutty, as though there was just some canonical way to turn any hash into an XML structure.

Nov 08
Permalink
It looks like Python (with extensions like numpy) is becoming a standard tool for many sciences that need to process large amounts of data, from neuroimaging to astronomy.
Nov 06
Permalink
Nov 03
Permalink
If you really understood how complex it is to write a correct threaded program, you would be concerned, not about yourself (because you are clearly one of the brilliant few to whom threading is transparently obvious), but about all the other programmers who aren’t as smart as you are. Such brilliant people exist; they look at something and the answer seems obvious and they don’t understand why it isn’t obvious to everyone else. But (1) those aren’t most programmers and (2) I generally find that this kind of overconfidence eventually produces catastrophic results.
Nov 01
Permalink
As in high school, the winners are the ones who don’t take it too seriously and understand what they’re trying to accomplish. Get stuck in the never ending drama (worrying about what irrelevant people think) and you’ll never get anything done. The only thing worse than coming in second place in the race for student council president is… winning.
Oct 28
Permalink
Oct 20
Permalink

Hacker's Delight Theorem D4

The (informal) proof of Hacker’s Delight Theorem D4:

The largest possible fractional part resulting from the division is . In order for the output value of the floor function to change, you need to roll over to the next highest integer (even in the negative numbers — remember that we’re strictly adding a positive x); therefore, you need at least a positive delta of to achieve this, which is impossible, because it contradicts the upper bounds on x we set forth initially.

Oct 16
Permalink

setjmp in Cython

Found this nice little demo of how to use setjmp in Cython through Google Code:

cdef extern from "setjmp.h":
   struct __jump_buf_tag:
       pass
   ctypedef __jump_buf_tag jmp_buf
   int setjmp(jmp_buf __env)
From http://sage.math.washington.edu/home/dfdeshom/sage/devel/sage-darcs.tar.gz

Oct 11
Permalink
My favorite slide from the &#8220;How to write more clearly&#8230;&#8221; presentation by Michael A. Covington.

My favorite slide from the “How to write more clearly…” presentation by Michael A. Covington.

Sep 20
Permalink

Steal my idea: receipt processing device/software

I hate receipts. I’m always suckered into taking them so I have proof in case I ripped off; however, the point is mostly moot because I have no automated way of checking whether I’m being ripped off, and I’ll be damned if I’m going to manually manage my micro-finances.

Create a pen-holder sized device that just scans receipts, OCRs the values, runs some simple classification AI on it, and aggregates data into something I can spit out as a CSV every month and check against my credit card statements. If it flattened and stored the receipts somewhere I can shred them every month, that would be even better.

Sep 09
Permalink
The circle of life! (via Josh Susser at http://blog.hasmanythrough.com/2009/9/3/circle-of-death )

The circle of life! (via Josh Susser at http://blog.hasmanythrough.com/2009/9/3/circle-of-death )

Sep 05
Permalink

Usability and style guides

The more I read about usability the more I’m convinced that projects should have mandatory style guides, enforced by auto-linters. The less choices that the programmer has to think about in their style, the more they can focus on the task of programming.

I’m also of the opinion that auto-completion in IDEs, when not explicitly requested, is more distracting then helpful; however, I can see how it might increase the rate of code production for slower typists to a point of marginal utility.

Jul 11
Permalink

Attempted escapees

I look at the dead bees on the windowsill and think it’s funny, then realize that’s how unjust imprisoners must feel. Then I realize how lame that train of thought was.