David's Mumblings

Whitespace-sensitive languages

category: Programming
I really, really do not like whitespace-sensitive programming languages. The following code does not parse in Ruby 1.8.6:


if ($idf.size != $freq_table.size
    || $all_words.size != $word_indices.size
    || $word_indices.size != $idf.size) then
  raise "bad data: size mismatch"
end


To make it parse, you must either add backslashes at the end of the lines, or make it all one line. Either solution is IMHO terrible.

I don't get it. The parser should be able to tell that the expression isn't complete, not only due to the first parenthesis (which is optional), but also due to the fact that the "then" that accompanies the "if" has not yet been reached.

Ruby has many nice features but IMHO this is really not one of them... ^ TOP

Posted on 04/29/08 at 11:05:42 by dchaley (David Haley)
1 comment


Timing

category: General
What better time to spill coffee down your leg than immediately upon arriving at work?

I applied liberal amounts of water in an effort to wash out as much of the stain as possible, but I suspect that I'll have a coffee streak all day. Not to mention that I smell slightly of coffee. Perhaps I can pass it off as the newest fashion...! ^ TOP

Posted on 04/29/08 at 11:01:37 by dchaley (David Haley)
No comments


No more email subscriptions

category: General
(Phew, three posts in just a few minutes!)

Due to *bleep* *BEEP* *censored* spammers, we have turned off the email subscription system for the blogs. If you were already subscribed, you will remain subscribed, however no future subscriptions can be made. If you still wish to subscribe and use a feed aggregator of some kind, I suggest that you use the blog's Atom feed. ^ TOP

Posted on 04/15/08 at 03:13:16 by dchaley (David Haley)
No comments


Taxes

category: General
I just finished filing my 2007 taxes. Meh. I owed quite a bit, because I did some consulting work for which I had no withholding, and an internship, for which I also had no withholding. (Interestingly enough, they decided to pay me as a contractor of sorts rather than an employee.) TurboTax decided that I had a business due to the consulting work. I didn't really check if that penalized me or helped me.

Next year's taxes will be interesting again, since I will owe money to both California and New York. It will be more complicated than in 2006, because for 2008 I will have been a permanent resident in both states (for each half of the year). Sigh... ^ TOP

Posted on 04/15/08 at 03:10:04 by dchaley (David Haley)
No comments


Running Resumed

category: General
I was very very bad and had not been running for two months and 14 days. Finally, tonight, I went running again. I was a little out of shape, but not nearly as much as I thought I would be. I used to be doing just under 0.1 miles per minute; tonight I was at 0.091 miles per minute. (I typically run for about 35 minutes, of which the last five are "slow down" walking.) I hope to get back to running at least twice a week; I'll need to take it easy to make sure I don't get shin splints again.

On an interesting note, there is a direct (and in retrospect obvious) correlation between rate of weight loss and amount of exercise. While I stayed more or less stable (+/- a kg or two) while not exercising (beyond biking to class), while running I was losing almost 1kg per week. It's interesting to have the data to back this up with actual empirical evidence. Hopefully, I will get on track with both the running, and the ~25min bike ride to and from work. ^ TOP

Posted on 04/15/08 at 03:04:52 by dchaley (David Haley)
No comments