I’ve had a mind to do an Euler tour of the bridges of New York, specifically those in and out of Manhattan. Yesterday a few friends and I made our attempt.
Our tour was an Euler tour in the historical sense, not quite the mathematical sense (I guess a valid Euler tour would start and finish in the same place). The graph illustrating the bridges (at least those traversable on bicycle) looks something like this:
The basic idea of an Euler tour is to traverse each edge (bridge) exactly once. Notice this can only happen in the above graph if you start in New Jersey and end in Manhattan.
In order to cross all the bridges of Manhattan, we originally thought we’d take the Path to the New Jersey side of the George Washington Bridge, but we were dismayed that Hoboken (the highest stop on the path) wasn’t so close to the bridge. Also my girlfriend and I had decided to rent a tandem bike:
The rental shop was on W 104 st in Manhattan so we conceded to cross the GW twice, essentially invalidating or at least delaying our Euler tour.
Here’s the map we used to find our way from bridge to bridge:
The ordering of the bridges was to be as follows:
George Washington
Broadway Ave
207 St
181 St
Macombs Dam
145 St
138 St
3 Ave
Willis Ave
Triborough
Ward’s Island Pedestrian
Queensborough
Williamsburg
Manhattan
Brooklyn
…which is almost how it was executed.
Unfortunately the pedestrian walkway from Ward’s Island to Manhattan is not open in the winter and we didn’t find this out until we saw it statically gaping from Randall’s Island. Thus we had to also cross the Triborough bridge twice.
My girlfriend and I, on the tandem bike, crossed 11 of the 15 bridges above. We covered about 42.5 kilometers (≈26.4 miles ≈ 1 marathon) in total before we were getting too nervous about returning our rental in time. Here’s a rough sketch of our route on the map:
The rest of our group made it over 14 of the 15 (all but that pedestrian walkway).
My friend recently attended an interview with the New York City Teaching Fellows program (NYCTF). It was a group interview and each candidate had to prepare a 5 minute lesson plan to present to the others. My friend told me that one of the candidates presented a lesson plan for an second grade science class. The subject was gravity and the lesson was about why a book falls faster than a feather. Why heavier objects fall faster than lighter objects. Here’s a scan of the handout the candidate wrote up:
If you don’t understand why this it’s not just funny but scary, you could review about gravity on wikipedia.
I’m thinking of drafting a letter to NYCTF. But I’m at a loss of words what it should say. Obviously they shouldn’t have to account for an applicant’s ignorance, but how can I feel comfortable that this candidate won’t be in front of a second grade science classroom next year?
I challenge the internet to start a new genre of robot poetry. It can be humans reading robot generated poetry, robots reading human poetry, robots reading robots poetry or even just human poetry about robots and the reading there involved.
Here’s a little something to get the ball rolling as they say:
By the way, I generated the above on my Mac (10.5) using this command:
say -v Alex -o row-your-boat.aiff "Row, row, row your boat. Gently, down the stream. Merrily, Merrily? Merrily. Life, is but a dream"
This could probably get more elaborate and use the containing directories to set album and artist tags. For now here is a bash script to set the titles based on the current file name. This uses a program called tagmp3.
artist="Artist"
album="Ablum"
for filename in *.mp3;
do title=`echo $filename | sed 's/.mp3$//g'`;
tagmp3 set "%A:$arrtist %a:$album %t:$title" $filename;
done
I have given my girlfriend a subscription to the New York Times crossword puzzle which she (graciously?) allows me to use. Using the help of the decode_crossword.pl perl script, I have made a bash script to log in to nytimes.com, grab today’s puzzle in .puz format and convert it to pdf so I can easily print and view it. Here’s the script (replace userid and password with your own):
#!/bin/bash
if test -z $1 ; then
date=`date +%b%d%y`
else
date="$1"
fi
#
# log in to nytimes and save cookies
wget --post-data \
"USERID=youremail%40gmail.com&PASSWORD=yourpassword&is_continue=true" \
--save-cookies=cookies.txt --keep-session-cookies \
-O /dev/null\
http://www.nytimes.com/auth/login &>/dev/null
# download puzzle
wget --load-cookies=cookies.txt \
http://select.nytimes.com/premium/xword/$date.puz &>/dev/null
# get rid of cookies
rm cookies.txt
# convert to pdf
./decode_crossword -P $date.puz | ps2pdf - $date.pdf &>/dev/null
# get rid of .puz version
rm $date.puz
Update: NYTimes changed their login routine so now you should use something like:
#!/bin/bash
if test -z $1 ; then
date=`date +%b%d%y`
else
date="$1"
fi
wget \
--no-check-certificate \
https://myaccount.nytimes.com/auth/login \
-O login.html \
&>/dev/null
token=`grep token login.html | sed -e "s/^.*value=\"\([A-z0-9]*\)\".*$/\\1/g"`
expires=`grep expires login.html | sed -e "s/^.*value=\"\([A-z0-9]*\)\".*$/\\1/g"`
# log in as annie, should get rid of her password from this
wget --post-data \
"userid=youremail%40gmail.com&password=yourpassword&is_continue=false&remember=true&token=$token&expires=$expires" \
--save-cookies=cookies.txt --keep-session-cookies \
--no-check-certificate \
-O /dev/null \
https://myaccount.nytimes.com/auth/login \
&>/dev/null
# download puzzle
wget --load-cookies=cookies.txt \
http://select.nytimes.com/premium/xword/$date.puz &>/dev/null
# get rid of cookies
rm cookies.txt
# get rid of login cache
rm login.html
# convert to pdf
./decode_crossword -P $date.puz | ps2pdf - $date.pdf &>/dev/null
# get rid of .puz version
rm $date.puz
The music clock is an invisible clock. It tells the time through musical
tones. For now, it reads the hour and the minutes mod 12. Hopefully I will be
able to explore this idea and come up with a universally understandable and
recognizable system.
I use ajax requests and ruby and sox on the backend to make this work.
On OS X 10.4 I used to be able to “tab through” the options of the “Don’t save, Cancel, Save…” dialog. On 10.5 the glowing tab tracer does not show up, but finally I’ve found the keyboard shortcuts to each.
This is a hack to have your browser load all search results when a page is using jQuery’s infinite scroll feature, like this site: http://instantwatcher.com/titles/all?infinite=1.
Here’s the client side javascript to keep auto-scrolling this page to the bottom, thus triggering infinite scroll to load more results. It runs until there are no more results to load:
I run this on Safari using this short applescript:
tell application "Safari"
set doc to front document
set this_url to URL of doc
do JavaScript "
function scrollToBottom(){
bottom = document.body.scrollHeight;
current = window.innerHeight+ document.body.scrollTop;
if((bottom-current) >0){
window.scrollTo(0, bottom);
setTimeout ( 'scrollToBottom()', 1000 );
}
};
scrollToBottom();
" in doc
end tell