February 24th, 2005

  • evan

gator

An executive from Claria (aka Gator, spyware company) is one of 20 members of a federal privacy advistory board.

Google tends to have lots of visitors for lunch 'cause the food is good and free. I was eating lunch with some friends of friends and we discovered that one of the people present actually worked for Claria. As my mind raced to think of how to change the subject, Christophe immediately asked: "How do you sleep at night?"
  • evan

ruby wart

I'm still a huge Ruby fan, and I really do like the way that you call argumentless functions without parens and the way that affects the rest of the language.

But the way procs and blocks are different is lame:
["a", "b c"].map { |x| CGI.escape(x) }
=> ["a", "b+c"]  # the result i want

["a", "b c"].map(CGI.escape)
ArgumentError: wrong number of arguments (0 for 1)

p = Proc.new { |x| CGI.escape(x) }
["a", "b c"].map(&p)
=> ["a", "b+c"]

["a", "b c"].map(&CGI.escape)
ArgumentError: wrong number of arguments (0 for 1)



I run into a similar pattern all the time writing Python at work and it's equally lame:
>>> map(upper, ['abc', 'def'])  # i know this won't work
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'upper' is not defined
>>> map(lambda x: x.upper(), ['abc', 'def'])
['ABC', 'DEF']

So my code ends up littered with more readable but still lame [x.foo() for x in list] over and over.


Perl worked around it with the implicit variable, which makes the language-purity-types shudder but I think is a pretty clever way to design it.
% perl -e '$,=":"; print map { $_ + 1 } (1,2,3)'
2:3:4
  • evan

lj greasemonkeying

Tony made a Greasemonkey script that pops up userpics when you mouseover LJ links. Rad!

(For example, when I mouseover the above link to his LJ I see his picture pop up like a tooltip.)

I think Greasemonkey is a minor step towards a new view of the web, where the end-user controls what they actually get from a website. The logical conclusion is to use sites as feeds (as RSS has done for most blogs for me -- I don't ever look at the author's websites). I don't think the Greasemonkey ideal will ever be integrated into a major browser because it's trivial to Greasemonkey out e.g. ads from all pages you visit. But all that means is that the power will remain in the hands of people who can take the extra step.