Adam Hinz: The Blog
Continuing with continuations
On 2006-06-24 at 6/24/2006 01:52:00 AM...
[music] The Beatles - Kansas City (Hey Hey Hey Hey)My Awesome function of the day:
(define until
(lambda (in c k)
(cond
[(null? in) (cons (k '()) '())]
[(equal? (car in) c) (cons (k '()) (cdr in))]
[else (until (cdr in) c (lambda (v) (k (cons (car in) v))))])))
(until '(#\a #\b #\d #\& #\c a b c) #\& (lambda (v) v))
=> ((#\a #\b #\d) #\c a b c)
Hinzy out
That's like saying "you don't like apples, so you don't like any fruit at all."
On 2006-06-22 at 6/22/2006 04:29:00 AM...
Scheme/JS interpreter news: I think the bottleneck is in my read function. I forgot how deeply recursive that thing is, and javascript just cannot do it (apparantely, this is especially true in IE).Ideas:
1. CPS the read function? Then maybe trampoline it. I really don't want to do that.
2. I could also try and write an imperative version of it. That's actually how I originally tried to tackle it, but it didn't work so well.
3. Snakes on the plane?
In other news, I've been thinking about the relationship between xml and a scheme list. I was thinking that you could easily represent xml structures as scheme lists. Turns out the people at LAML already did that, but I thought "what the hell" and quickly made my own brief version. I'm not going to upload it now. But I will later.
Anyway, in addition to my summer research project, I've been thinking about programming for the web in a functional language, like Scheme, and right now it seems like it would make a lot of sense. Thankfully, other people seem to think so too (read: paul graham). Also I think that LAML implementation has a cgi module for running Scheme programs through a web server. I think I will attempt that next week.
The Great and the Typical
On 2006-06-19 at 6/19/2006 05:33:00 PM...
[music] Caesars - Out Ther'eMy new favorite place to get any work done is at the Union in a room I call the "Grandeur Living Space." It's one of the quietest places I've found, with the exception of a trashcan being pushed by a janitor every 15 minutes.
It also has a whole slew of couches, chairs, and (get this) desks! Some of the desks even have lamps.
The couches are arranged in "meeting formation," that is, they are facing each other, so if a group project was the goal, it could be accommated (assuming a low noise volume).
It's a very fancy room. There are picture frames on the wall, mini-chandeliers, and grand arched windows. The walls are hard-wood with designs in them. One of my favorite areas, the part with the working fireplace, is actually walled with limestone.
The white baby grand piano is also a nice touch of elegance.
As I said before, I like this room. It's very fancy, air-conditioned, and most of all, it's very, very quiet. That's why I was surprised today by the huge number of people congregating here today.
Did I say people? What I meant to say was old people.
What's so bad about old people? After all, they are the "Greatest Generation." When I think of old people, I think of my grandma quietly sitting in front of the TV watching Columbo (at an inaudible level) and quietly doing a crossword people. I swear I have never heard her raise her voice louder than, say, 60 dB (not that I measure that or anything).
That's why I was surprised to find myself trying to drown out the small talk of 50 congregating old people in the library-like atmosphere.
Actually, the sound didn't bother me. I can usually find a way to ignore what's going on around me (headphones, fox news). However there's one thing that cannot be avoided: Interaction.
I have to admit, I was a bit surprised when one of these old people tapped me on the shoulder to ask me what I was doing. I may have even jumped.
"What's that you're studying?" inquired the curios old guy.
"Oh, I'm just doing some reading," a typical vague answer for me, but in this case it was true. I was reading about poison ivy. Did you know scratching it doesn't actually make it spread because the urushiol is already embedded in your skin. Scratching does cause to you run the risk of infection, however.
"Are you taking classes for the summer?"
"Actually I'm doing research for a professor...(insert my generic description of what I'm doing, even though I know he's already disinterested)."
"Now what are you studying?"
"Here? Computer science."
"I see. Are you taking any classes?"
"No, just the research."
"And where are you from?"
What is with this guy and all questions? Why can't he mingle amongst his fellow old people?
After an awkward silence or two, he wandered away. Good. I can now return to whatever it was I was working on. What was it? Poison ivy, that's right. I wish that old guy would get poison ivy. Did you know if you eat it, you could get a rash inside your throat and die?
A few minutes later, wouldn't you know it, the guy reterned. I hesitantly pull off my headphones and give him my attention.
"Do you know who this guy is?" he said, pointing to a head-statue of Wendell Lewis Willkie.
"No..." I said, with a slight laugh.
Cue old-person-behavior.
"It fascinates me how much there is to know. Whatever it is you're researching...computer...that you can do this research here and not know the history of this place."
Um.
He continued, "Willkie ran for president. Did you know that? He ran for president against Franklin Deleno Roosevelt in, well, I don't remember the year. He was a lawyer, had a Phd in law, or something."
Another awkward silence. This seems to be my best defense.
"Well, good luck."
At this point, all the old people in the room start filing away into a sideroom in the adjacent hallway.
Within two mintues, my favorite room is restored to its peace and tranquility, quietly waiting to house another army of old people.
Unplug the revolving fan
On 2006-06-02 at 6/02/2006 09:50:00 PM...
[music] Belle and Sebastian - A Century of FakersIn my elementary school health class, I was promised broad shoulders when I got older. Did I miss something?
Although, shoulders can be too broad. I once saw a guy with square shoulders. I wouldn't want to be that guy.