2008.05.06 13:10 EDT
dear sweden
dear sweden,
in the spirit of Cinco de Mayo and a recent visit to the local "Mexican Restaurant", it should be brought to your attention that the following items are not typically considered mexican food:
- lamb and lentil stew
- hummus
- pizza salad
- taco pie
yours truly,
sean
2008.03.20 12:16 EDT
ur doin it wrong
...or how not to code your web application plzkthx.
![[ur doin it wrong!]](/img/wrong-mike.jpg)
so last summer, whilst back home chillin with the peeps, i had a most unfortunate traffic enforcement related incident, the details of which are entirely uninteresting but which left me approximately $400 poorer nonetheless. although it presently doesn't affect me to have such infractions on my record (what not owning a car and living on a different continent and everything), i decided to get my record clean via online traffic school. thankfully, the state of california in their infinite wisdom has decided to outsource such a service to anyone willing to pony up the money for a permit and a domain name, thus there were a number of options from which i the consumer could select.
so, off i went in search of an agreable online service to clear my ticket, with an emphasis towards fast, cheap, and ideally not too dressed up in flash/java. i ended up settling on a to-remain-unnamed .com site whose name seemed to suggest that it was capable of meeting my requisite goals. the site was decidedly "web 1.0", which was sort of what i was looking for, but this was like something written in the mid 90's with an HTML 3.5 book or something. but i digress.
the format of the "traffic school" was a 12 chapter lesson book, with alternating "text" and multiple-choice "quiz" subsections. the text was maybe 10 minutes worth of reading and the quiz another 10 minutes. the site let you freely go back and forth between the text and quiz, and you could do this all at your own pace, so really you could skip the text and answer the questions directly. what more, if you didn't answer enough questions to advance to the next chapter, you could re-take the quiz at no penalty. of course all of these aspects were proudly and prominently listed on the site, and played a significant part in my decision to use the site. so... so far, so good.
however, after making my way a few chapters in, i came across a rather annoying bug in the site, which caused the answers to the quiz to be reset to blank just as i hit the "submit" button. the first time i thought i must have done something wrong, so i tried again. and again. great. thank you so much for wasting my precious time.
it was pretty clear that there was some sketchy use of javascript going on, so i thought i would take a look-see at the code. turns out the "submit" button didn't submit anything at all, but instead calculated a score based on answers that were stored in the web page itself:
ans[1]="1"; ans[2]="2";ans[3]="1";ans[4]="3";ans[5]="4";ans[6]="1";ans[7]="1";ans[8]="1";ans[9]="1";ans[10]="1";
ans[11] = "2";
function Engine(question, answer) {
if (answer == ans[question])
{ done[question] = 1;
}else
{ done[question] = 0;
}
score = done[1]+done[2]+done[3]+done[4]+done[5]+done[6]+done[7]+done[8]+done[9]+done[10]+done[11];
}
heh. it doesn't take a professional programmer to figure out what's going on there. but wait... it gets better. this is the function that gets called when the quiz is "submitted":
function display() {
document.forms[0].reset() ;
document.forms[1].reset() ;
document.forms[2].reset() ;
document.forms[3].reset() ;
document.forms[4].reset() ;
document.forms[5].reset() ;
document.forms[6].reset() ;
document.forms[7].reset() ;
document.forms[8].reset() ;
document.forms[9].reset() ;
document.forms[10].reset() ;
if (score==11)
{
window.location="passed5.php?id=XXXX"
}
else
{
window.location="result5.php?id=XXXX"
}
}
where XXXX is a unique identifier for the
particular user. in other words, if some javascript decides you
have reached a certain score, it redirects your browser to a
"you've passed" page, which will record your success no
questions asked before forwarding you to the next chapter. now,
what do you suppose the following snippet of shell script might
do?
# i leave it as an exercise to the reader to find the correct value for ${site}
for n in `seq 1 12`; do
wget --user-agent "l33t h4x0r" -O/dev/null http://${site}/passed${n}.php?id=XXXX
done
srsly. wtf.
and for the record, i by no means am implying that i might have done such a thing.
2008.03.18 17:40 EDT
ölmannen
last week was particularly trying for some reason, guess just general frustrations with stuff at current $assignment from $work. a debian developer that i know was going to be in malmö for a few hours while in transit between stockholm and his home town in germany, so i used the excuse to ninja-vanish from work and try to meet up with him. i think my friend/samarbetare christoffer was feeling the same, and he also new this guy, so we went into malmö together.
unfortunately, the effort to find our common friend resulted in failure. but since we were already in malmö, we used it as an excuse to stop for a few beers at the bishop's arms, which is in all honesty what we would probably have done had we found him too.
after taking our libations with a helping of pommes frites, we decided to head over to a friend of christoffer's, who would very soon be meeting with ölmannen, a character of simultaneously shady and awesome nature. apparently the deal is you call this guy (i imagine some bat-signal like spotlight, or a flashing red phone or something), and 20 minutes later he rolls by your pad. you get in his car, which for some reason is always a different and brand new model (SUV, porsche, audi, et c), and he drives you around the block, during which time you give him a relatively small sum of money (by swedish standards anyway) for a relatively large sum of beer. he drops you of, you exchange farewells, and then the evening's entertainment continues, reinforced with new supplies lest no one should be thirsty.
okay, so maybe i'm just dressing up what is essentially a black market smuggler... but it's not just any fly-by-night operator. it's ölmannen.
2008.03.09 05:39 EDT
s05e10
just watched the season 5 (and ultimate) finale for the wire yesterday, and am now filled with a bittersweet mix of emotions--similar to what i feel looking at an empty glass which recently held the contents of a bottle of westvleteren 12.
so sad that it's over now, but, damn it was good....
but at least there's another westvleteren in my cabinet :)
2008.03.08 07:07 EST
weekend in utrecht
last weekend i took a railway excursion down to visit annika in holland. the schedule was kinda compressed and a bit hectic, but fun!
i left straight from work on friday, went down to copenhagen and took an overnight train which arrived the next morning in utrecht. the train ride itself was a bit of an adventure. i shared my compartment with a canadian (who i immediately identified as such, due to his pronunciation of certain words like "been" and "about") and an older french couple. the canadian was on his way down to cologne, while the french couple were on their way back to paris after a week up in kiruna. my french was a little rusty but it was fun to get some practice, and they seemed surprised to find "un americain qui parle français et suedois, pas mal!" :)
i ended up spending most of the evening in the dining car, however... where i was literally yelled at by one of the german service staff because from what i can tell (and was explained later) were reasons nothing other than he was in a bad mood. in hindsight i wish i had the presence of mind to be a little more self-rightous about it, but nonetheless was pleased that i at least got out a "what crawled up your ass and died?" while the oppurtunity was there.
i met a nice guy about my age from cologne (or köln, as they say) with whom i passed most of the evening discussing topics varying from the problems of guaranteed job security in a social state to open source software and the concept of copyright in the digital age. throw in a few bottles of weissbier and it's not a too unpleasant way to pass the time.
once in utrecht, i got the whirlwind tour of the town from annika. first impression: bikes. lots of bikes. i mean, lund is almost overflowing with bikes, but this town is like beijing or something. beyond that, the town is really pretty, with canals, and an old church/belltower, lots of trendy shops/cafés, and great belgian beers at unbelievably low prices. and while traditional dutch cuisine may leave a bit to be desired, they certainly make up for it with vast quantities of deliciously unhealthy fast foods, treats, and snacks. i hold up the stroopwaffel as an example of their ability to excel in such a category.
later that night we went back to her pad, and i met her roomates mark and hester, who were both really kind and seemed like fun people. we made some noodles with peanut sauce for dinner, and watched s05e9 of the wire before turning in.
the next day was mostly a repeat of the previous, though at a much more laid back pace. we had tea and snacks, browsed through some of the shops, and stopped at a belgian beer bar for a few tasty ones and some pomme frites (with mayo, of course!). after that we slowly ambled back to the train station and picked up some travel food, and did our reluctant good-byes while trying to avoid the obvious cliché of waving to/from a train as it rolls away.
the train ride back was mostly uneventful, and the next morning i got back into copenhagen and rolled into work at around 11:00 or so. with a full stack of stroopwaffels in my bag, which i made the unfortunate decision of sharing with my coworkers, 'cause now they're all gone :(