Showing posts with label led zeppelin. Show all posts
Showing posts with label led zeppelin. Show all posts

Sunday, July 21, 2013

How to make a sandwich in Javascript

Michelle, if you're reading this, start getting ready for our open mic duet. Don't even worry about the set list, I'll take full responsibility for picking the songs I like. Here's some that you might want to learn how to sing:

by Wings:
Let me roll it
Band on the run

by Blue Oyster Cult:
Burning for you
Take me away
Astronomy

by Led Zeppelin:
That's the way
D'yer M'ker
Houses of the Holy

by Dusty Springfield:
Son of a preacher man

by Save Ferris:
Come on Eileen (their cover rocks, you play the power chords, I'll practice the crazy ska rhythm)

by Squeeze:
Tempted

by Bogushevskaya:
Cafe Ekipazh

Let me know which ones you don't absolutely love so I can convince you otherwise. Everyone else go listen to these and imagine how well they'd sound if they sounded slightly worse. Pretty fantastic? Agree.

One and a half more days of freedom and then my favorite girl will be back to torture me. I need to think about what kind of things I can do now that I can't when she's around. Other than tell vicious lies on this blog with impunity, or sleep with other women. I guess I should get all my bad singing, bad drawing, and bad dancing out of the way so she doesn't have to do too much criticizing right after a hard week's rocking in Korea.

And now, a cool trick from today's JavaScript camp. I've used this before, but never in the general form:

function partial(fn) {
var args = [].slice.call(arguments, 1);
return function() {
return fn.apply(null, args.concat(arguments));
};
}

What this allows you to do is precreate functions when you know some arguments ahead of time. So for example, if you have a sandwich function:

function sandwich(bottom, top, middle) {
return {
bottom: bottom,
middle: middle,
top:top
}
}

...and you know a "good" sandwich always has a pancake on the bottom and a pop-tart on top, you can make yourself a shortcut function easily:

var goodSandwich = partial(sandwich, 'pancake', 'pop-tart');

This essentially hardcodes the (bottom, top) set of parameters and gives you back a function that expects only one parameter - 'middle'. So now you can use the goodSandwich function to make sandwiches with different contents but the same shell:

// equivalent to sandwich('pancake', 'pop-tart', 'turkey')
var goodTurkeySandwich = goodSandwich('turkey');

// equivalent to sandwich('pancake', 'pop-tart', 'Mark')
var goodMarkSandwich = goodSandwich('Mark');

// equivalent to sandwich('pancake', 'pop-tart', 'cheeseburger')
var goodCheeseburgerSandwich = goodSandwich('cheeseburger');

// equivalent to sandwich('pancake', 'pop-tart', sandwich('pancake', 'pop-tart', 'cheeseburger'))
var doubleDecker = goodSandwich(goodSandwich('cheeseburger'));

Mm, a cheeseburger wrapped in two pancakes and two pop-tarts. That'll get you bulimic in no time.

Wednesday, November 12, 2008

Sugar

The last couple days have proved that it is possible to survive eating only sugar. I don't mean sustain oneself and not starve. I mean eat Tootsie Rolls for breakfast, pudding for dinner, and a 60%-40% Tootsie-Roll-to-pudding split for brunch, lunch and 2nd lunch, AND (this is the important part) not die or lose more than four teeth a day. I have accomplished this feat singlehandedly and have not even felt any side effects, though I wouldn't recommend it to the average weakling. The only hard part of this most worthy endeavor is getting Tootsie Rolls into your mouth when your arm and head are shaking at different frequencies.

Yesterday introduced me to a wonderful new show - Manswers. "You've got questions, we've got MANSWERS!" In one half hour session with Manswers, I learned invaluable street smarts. I now know three ways to survive a tiger attack, how tiny my bikini can be without getting me arrested, how much more the average pimp is making than I am, what set of sexual preferences makes a girl easier to get into bed, and why chickens and humans have identical tastes in women. Compare this to what I learned in four years of college - that it's only a temporary respite before you need to get a job, and I think we can agree America needs to rethink the education system.

I've been learning some Led Zeppelin songs lately. It's tremendous fun. It's also a bit like putting on glasses that flip your perception of left and right and then running around the house at top speed, but applied to rhythm instead of vision. I've realized now how relatively sane most rock/metal bands' music is when it comes to time signature. 4/4 time, 3/4, 9/8, even 7/8 are manageable when the whole song sticks to one or two, but in Zeppelin songs, you're liable to have measures thrown in seemingly at random with half a beat missing, or an extra three. And then, when you're back in 4/4 and you think it's smooth sailing, you get taken again. They mercilessly throw you a 9/8 riff over that 4/4 and your brain-fingers connection melts right down. Awesome.

...

We just went to Starbucks again. This time we planned out the whole operation and the result was a resounding success. We managed to spend somewhere between twelve and thirteen dollars from Mario's giftcard on two drinks and two scones. This is quite an achievement when you consider that twenty five dollars feeds the two of us for a week.

Wednesday, June 25, 2008

Long Day

Mom's looking over my shoulder, so I can't unleash my full writing potential. Half will do.

Went to Hana's house today. They were definitely unprepared to entertain me. I was counting on at least some singing, money showering, and "we're not worthy"'s accompanied by heads banging against the floor, but all I got was a good meal and an even better serving of boooring. They all camped out in the den and watched a recorded Turkey-Germany soccer match, and no amount tears or begging succeeded in making them tell me to shut up and go home. I don't understand, if you have a match taped and can watch it any time, why would you ever watch it? Especially when I'm around waiting to be entertained.

Mom's learning Stairway to Heaven so she can go to Guitar Center and piss them off - all guitar stores have Stairway to Heaven on their blacklists. Luckily for them, she only practices once every couple of months, usually in different and not always consecutive years.

Chun studying for MCATs is reflecting poorly on my self-esteem. Every now and then, she'll come at me with a "hey, I've got a really easy question for ya...," just to make sure I feel like a moron when I can't even understand what it's asking. I of course proceed to do just that, and she has her fill of laughs. Then she leaves me and returns to her career-building, while I frantically shake my computer upside down so my tears don't short its circuits.

Michelle's having a sleepover today, so there are suddenly two Michelles in the house (her friend is also a Michelle). This is pretty much your classic domestic nightmare. Right now they're upstairs and judging from the sounds, they're either mudwrestling, practicing dropkicks, or sacrificing an uncooperative goat. I hear thud after thud, and lots of giggling that'll soon make its way downstairs, meet Mom, and seamlessly become sobbing if not screaming.