14 Nov 2002 BenFrantzDale   » (Journeyer)

Life: After always planing on persuing a PhD directly after college, over the last week I have begun to strongly consider doing the job thing first. Two reasons: (1) A break from school should give me some perspective. (2) I really don't know what I want to study. I like CS, but I don't want to just do coding; I'd really like to do some Mechanical Engineering, among other things.

Computers: I mentioned a while ago my screen has been flickering (on my '99 ThinkPad 600E). Today I got the second-hand replacement inverter in the mail, installed it, and it works! Cool! It's definately worth $45 to keep this thing limping along for the rest of the year.

Fun Fact: You know how you can have polygonal region of an image be clickable on a web page? For literally years I've wondered what algorithm is used to determine if the mouse is in the polygon or not. (I'd assumed it either involved drawing the region in a bitmap and testing pixels on it, or testing what sides of what lines the point was on something like that.)

It turns out it's done like this: Let the polygon be bounded by the points p_1, . . . , p_n, and suppose you click at point x. Take the sum of the angles: p_1,x,p_2 + p_2,x,p_3 +...+ p_n,x,p_1. If x is in the polygon, that sum will be 360 degrees (or more---a 5-pointed star, for example). If not, the sum will be zero. This is definately the coolest thing I've learned this week.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!