Tuesday, December 22, 2009

Better Dictionary: Wordnik

Ok, thanks to Google for putting their dictionary out there, which I wrote about a couple of posts ago, but the quality of the results pales in comparison to Wordnik, which I've just discovered. It won't do language translation for you, but as far as the English language is concerned, this is pure word porn. So here's an updated bookmarklet for you:

wordnik

Just drag that to your bookmarks bar, select a word or phrase on the page, and click. Happy bonus: just clicking on the bookmarklet without highlighting a word first will give you a random word (thanks to Wordnik, not me). Cool!

Tuesday, December 15, 2009

Chrome Frame's Shifty User-Agent

One of the security measures we have in place at Wesabe is to invalidate a session and log the user out if their User-Agent or IP address subnet changes between requests. However, we recently had a number of complaints that users were getting logged out prematurely. Looking at one user's session in the logs, I noticed that their user agent string had "chromeframe/4.0" appended for some requests, but not others. It turns out that Google's Chrome Frame only modifies the user agent for top-level requests, and not for subsequent requests sent as that page loads:

It was a compromise to keep code complexity down. In order to tag every request from IE...we have to have hooks in place at many more places (not to mention supporting the different things IE6, 7 and 8 do). So, as a compromise we decided to keep it down to only the single hook that allows us to tag top level requests.


This fix on our side was to just strip the chromeframe identifier from the user agent string, although it makes me wonder what other browser extensions cause similar issues and whether invalidating a session when the user agent changes is even a worthwhile security measure.

Friday, December 4, 2009

Google Dictionary Bookmarklet

Google recently launched a decent dictionary, so for you logophiles, here's a bookmarklet that will bring up the definition of whatever text you have selected on the page: gDefine. Just drag it to your bookmarks toolbar, then double-click a word somewhere and click the button to get a definition.

It is set to use the English dictionary, but if you want to use it in a different language (or even translate between languages), just change the langpair parameter from en|en to, say, fr|fr for French, de|de for German, etc. (try a search on the Google Dictionary site in the language you want and look to see what the langpair parameter is in the url). Also, the hl parameter controls the language of the results page, so if you want your results to be in that language as well (as opposed to English), change that accordingly.

Here are a few to get you started:

gDefine (French)
gDefine (Spanish)
gDefine (German)

And translations:

gTranslate (French>English)
gTranslate (English>French)

Enjoy!

Thursday, November 12, 2009

Tuesday, November 10, 2009

Wanted: 7 Fearless Engineers! (via Rich Coad)



Wanted: 7 Fearless Engineers! (via Rich Coad)

cyoa

cyoa:

Impressive analysis of Choose Your Own Adventure books, a fixture of my childhood.

Wednesday, October 28, 2009

We Could Use More of This

There’s a weekly Tuesday evening Ultimate Frisbee game at a field near my house (sadly, I haven’t gotten out to play in ages). Now that it’s getting dark early, they need the lights on in order to play. The city is usually pretty stingy with the lights, but this just came through on the mailing list:




So here’s the deal with the lights for the lower field….The lady (I forget her name) wants us to help out with getting supplies for their cooking class: taco stuff, corn dogs and fries (maybe potatoes), chicken and rice, stuff like that to teach cooking with. The reason is, the state is cutting back on funding and she asks us for donations of food to help out with the class. In turn she said we could have the field and lights as long as we turn off the lights when we’re done and if the soccer teams try to take over she will deal with them for us. Not a bad deal, plus we’re able to help the families and do a barter.



So: Bring food and play Tuesday night!




I love it.

Wednesday, August 12, 2009

Sunday, March 1, 2009

MySQL-Style Output for the Rails Console

While poking around the database in my rails console, I often found myself jumping to the mysql console just so I could get an easier-to-digest view of the data. I finally had enough of this silliness and wrote up a quick function to dump of set of ActiveRecord objects in the mysql report format.

>> report(records, :id, :amount, :created_at)
+------+-----------+--------------------------------+
| id | amount | created_at |
+------+-----------+--------------------------------+
| 8301 | $12.40 | Sat Feb 28 09:20:47 -0800 2009 |
| 6060 | $39.62 | Sun Feb 15 14:45:38 -0800 2009 |
| 6061 | $167.52 | Sun Feb 15 14:45:38 -0800 2009 |
| 6067 | $12.00 | Sun Feb 15 14:45:40 -0800 2009 |
| 6059 | $1,000.00 | Sun Feb 15 14:45:38 -0800 2009 |
+------+-----------+--------------------------------+
5 rows in set


Grab it from GitHub and stick it in your .irbrc.