Tuesday, October 26, 2004

The Nude Pundit

I'm not kidding about this Rude Pundit thing, guys. You have got to read today's entry, for example:
So when Rehnquist tries to say he's thinking retirement now, too late for an appointment before the election, and with the potential loss of the Senate even if he wins, Cheney snaps. He pulls the tube out of Rehnquist's neck and whips out his cock. Rehnquist, wide-eyed, now wishing he had chosen death over the horror that is about to happen, gasps for air. "Gonna have to fuck your neck-hole, Bill," Cheney says, slapping his cock around, trying to get an erection, thinking about Mary and her partner 69ing, thinking about dismembered Iraqi children, all the things that usually make him hard.
My fucking Guile thread cancellation thing doesn't work at all. I'm totally frustrated with it and stymied. Euchhh. I did, however, fix a database thing that wasn't working in gzochi. Whatever.

Does Krasdale make anything that's not cheap and delicious? Their onion rings and seasoned fries: Delightful. Their frozen pizza: Sublime. Their waffles: Transcendant, and certainly light-years ahead of Eggo. Jesus. Their frozen mixed veggies: Gave me extremely painful mud-butt. So that's one thing.

I thought I whined about grad-school recommendations already in this thing, but going back through the archives, I can't find it. Well, I asked this professor of mine for a recommendation back in August, and he made me jump through all of these hoops, basically, to get it. So I finally e-mail him all the information he'd asked for, and I don't hear squat from him -- at all. Not even any indication that he'd received any of my hard-won information that he'd asked for. And I sort of forget about it for a while. And then I realize, I gave him Nov. 2nd as a deadline for it, and it's practically Nov. 2nd now. So I e-mail him to politely ask how things are going, and he writes back almost immediately explaining that he just had decided to ignore a bunch of his old e-mail but that he'd get right on my thing. Deek!

Oh yeah, and THE YANKEES WIN THE PENNANT!

Tuesday, October 19, 2004

Partisan Hackery

I don't feel like working on computer stuff just right now, so here is a 'blog entry. The laptop -- she is'a doing'a great! X Windows is not as 3-D accelerated as it could be, but it is accelerated, which is more than I could say for my old SiS. Also, I have to use Xine instead of all that fancy new GNOME Gstreamer stuff, because Gstreamer is... how you say. Not so good yet.
STEWART: See, the thing is, we need your help. Right now, you're helping the politicians and the corporations. And we're left out there to mow our lawns.

BEGALA: By beating up on them? You just said we're too rough on them when they make mistakes.

STEWART: No, no, no, you're not too rough on them. You're part of their strategies. You are partisan, what do you call it, hacks.

What is that I just quoted, right there? If you haven't seen it, I encourage you to click here. It is delightful. I'll quote some more of it in a bit. Go here, too: Rude Pundit. I recommend this one and this one and this one.

One computer thing I've been doing is working on this GNU system called Guile, which is an embeddable Scheme interpreter. I use Guile as the workhorse for gzochi's game-design language -- actually, Guile Scheme is gzochi's game-design language, and I embed Guile to make the games run. One problem, though, that I've had since day one, is that Guile's thread support is a bit shaky. Wait a second, have I explained threads in the blog before? Sometimes I like to explain some of this technical stuff so that if people like Devlin, for example, who are somewhat technically naive, but who have some vested interest in understanding stuff can know what I'm talking about.

So: Many times you will be writing a program, and you will want to start doing two things at once -- say, you want to listen for keys getting typed at the keyboard but you also want to be printing out messages you're getting from an Internet connection and you also want to be playing some music or something. Well, given that a program (as conceived of by most programming languages) is a sequential list of things to be done, it is hard to make more than one thing appear to happen at once. I mean, more than one thing cannot be done at once, but if you switch back and forth very quickly, you can give the user the impression that these things are happening at once. And if you want to do this yourself, you would have to say, in your program, "Okay, read a little bit from the keyboard, and now write some stuff to the screen, wait, go back to the keyboard, okay play a few notes of music, back to the screen, etc." That's a pain. So the operating system will very often give you a hand with this, in the form of "threads." You tell the operating system, via your program, that you have several disparate lists of instructions you want it to execute, several "mini-programs," say, called threads, and the system will start executing them all and will handle all of the switching between them for you. You don't have to worry about it, for the most part, until they have to interact with each other in any way, and then you have to worry a lot. But that's what threads are, anyway. Here's some more Jon Stewart:
BEGALA: Let me get this straight. If the indictment is -- if the indictment is -- and I have seen you say this -- that...

STEWART: Yes.

BEGALA: And that CROSSFIRE reduces everything, as I said in the intro, to left, right, black, white.

STEWART: Yes.

BEGALA: Well, it's because, see, we're a debate show.

STEWART: No, no, no, no, that would be great.

BEGALA: It's like saying The Weather Channel reduces everything to a storm front.

STEWART: I would love to see a debate show.

BEGALA: We're 30 minutes in a 24-hour day where we have each side on, as best we can get them, and have them fight it out.

STEWART: No, no, no, no, that would be great. To do a debate would be great. But that's like saying pro wrestling is a show about athletic competition.
Right, so Guile, when I started investigating it, supported a form of threading, which I needed, because the games being hosted by the gzochi server would need to be able to evaluate Scheme code concurrently with each other, but it was a weird, custom kind that wouldn't interact well with the operating system's normal threads. But the Guile people are in the middle of writing a new version and they've fixed that aspect of their thread stuff, and I'm excited about it. However, it looked like they still hadn't fixed this other thing, which is that their thread support didn't entail letting you cancel running threads.

See, sometimes one thread will be running and another thread will discover that there's no point in having the first thread keep going and that it should be shut down; for native Unix (and Windows) threads, this second thread can do just that, by telling the system to cancel the first thread. It gets a little bit complicated, though, because this first thread might be in possession of some resources that can only be held by one thread at a time -- for example, maybe a thread has exclusive rights to write to a particular file. If the thread is cancelled, the file stays inaccessible to everyone else. To get around this, most thread implementations allow you to install what're called cleanup handlers for threads, which are sections of code that get run when a thread is cancelled. So, for example, before you "lock" a file to write to it in a particular thread, you install a cleanup handler that unlocks the file, so that if the thread is cancelled in the middle of writing, the file gets unlocked for later use. More Stewart:
STEWART: But the thing is that this -- you're doing theater, when you should be doing debate, which would be great.

BEGALA: We do, do...

STEWART: It's not honest. What you do is not honest. What you do is partisan hackery. And I will tell you why I know it.

CARLSON: You had John Kerry on your show and you sniff his throne and you're accusing us of partisan hackery?

STEWART: Absolutely.

CARLSON: You've got to be kidding me. He comes on and you...

STEWART: You're on CNN. The show that leads into me is puppets making crank phone calls.
So Guile didn't have thread cancellation, which is something I needed, so that threads of Scheme evaluation that took too long wouldn't get the game "stuck." Well, I figured since the new version was in active development, I'd take a shot at it myself. Here's how I did it:

Every Scheme thread created by Guile has some information associated with it, such as a value to return to other threads that are waiting for it to finish, etc. I take that information, and add a little bit more to it: A list of expressions that need to be evaluated when the thread receives a cancellation signal. See, Scheme's what's known as a functional language, so expressions (instead of instructions in a so-called imperative language) are the basic unit of currency. So before you put a lock on some resource in your new Guile thread, you add a cleanup handler to my list of handlers -- so that you can clean up if you get cancelled while you're using the resource -- and then when you're done, you uninstall the handler. It wasn't super hard to do.

Here are the problems so far: Guile does this fancy dynamic library thing when it loads which makes it rather difficult to debug, so it took me a while even to begin to make progress debugging things. Also, threads that aren't created by Guile are not straightforward to cover with the cancellation cleanup policy I described above -- think of it like this: You embed Guile as an interpreter for Scheme code in your C program. You have a thread of C code initialize Guile and start intepreting Scheme for you. Your Scheme-interpreting-C-thread represents, in a way, Scheme-thread #1. Let's say the Scheme code you're interpreting launches another thread of Scheme code -- this thread is Scheme-thread #2, and will also, at it's core, be C code interpreting Scheme code, but this thread is covered by the cancellation policy, whereas Scheme-thread #1 is not. I think that's a feature, not a bug.

We'll see if they like it.

More computer shit: So Raymond Chen just posted this thing about how application developers chronically misuse the Windows API -- e.g., storing application data in like, undisplayed components of the widget set -- and then Microsoft had to go out of their way to work around this so their program would still work in the next version of Windows; he says (used without permission):
The moral of the story: Even if you change something that nobody should be relying on, there's a decent chance that somebody is relying on it.

(I'm sure there will be the usual chorus of people who will say, "You should've just broken them." What if I told you that one of the programs that does this is a widly-used system administration tool? Eh, that probably wouldn't change your mind.)
Some guy posted the following comment, which I think is a nice counterpoint (again, used without permission):
Although it really is amusing to read all those stories about "bad guys" who did something wrong and nowadays we have a few megs of code only to catch them, what is the real moral in that?

The only lesson I have learned is that I can use any dirty trick I want, if my app would be important enough that MS would test it (and then make sure it won't break). Why should I use ACT if MS will do that for me (and "repair" Windows accordingly)? (And if my app is not important enough, I'll just post some info about the trick to a newsgroup, someone else's important app will use it.)
Raymond didn't have anything to say on that one, last time I checked. Imagine how good Windows could be if Microsoft didn't take this retarded tack when it came to developing it!

Friday, October 15, 2004

The Inevitable Cave

Yeah, so I caved and bought a laptop, an IBM Thinkpad T41. It was killing me not being able to get any work done, and I told myself it would only be a waste of time not to get one now instead of like... later. I'm not going to say how much I paid for it, but I saved, say, $800 bucks, by buying it gently used off some dude on craigslist. He was getting rid of it because he wanted to buy a Thinkpad T41P or some shit. He wanted to talk my ear off about it and about this new GPS thing he bought for his car. I was lucky to get away.

Oh, one cool / irritating thing about this new thing is that it comes built-in with this hard drive shock-protection system, wherein this driver can detect when the laptop's being moved, so that... well, I don't know what practical application it actually has, but the Windows version of the software that come pre-installed seems to think that it's a great idea to literally suspend all PCI / IDE activity while the machine's getting moved around. Retarded. Fortunately, you can switch it off, and there's also this awesome display you can pull up with this little 3-D model of your laptop and if you tilt your laptop left, the little model tilts left, too. I could play with that all day.

So now I'm downloading a Knoppix CD that I boot off of to resize the Windows XP partition so that there's room for Debian (I'm keepin' XP this time around, for driver compatibility purposes and because the guy gave me Office 2003 and Photoshop for free). There's apparently this little unmarked, unpartitioned chunk of disk space at the end of the drive that I'm not supposed to overwrite because that's where IBM keeps a bunch of setup files and system restore data. What?! Retarded.

Umm... As soon as I get Linux set up, I'm going to set about adding thread cancellation support to Guile. That should be fun, if it's at all possible. Uh.

You talk big, little Devlin, but I think you'll find that even if people all deserve to be loved in some kind of intrinsic way, which I'm not really willing to take on faith, there's just too damn many of them out there, and their numbers are increasing all the time. Some of them have just got to go. And if one of them is me, so be it; just let me finish up this weblog entry first.

Today my usual Boss was having me take an inventory of sorts of every goddamn thing that we need to test in our software, and he was just sort of standing over my shoulder for a while not saying or doing anything, so I said, as a joke, "Are you jealous that I get to do all of this?" And I guess he wasn't really paying attention because he said, softly, "Hmmm. No." and just sort of wandered away.

Thursday, October 14, 2004

Dawn Of The Shred

Guys, I don't know how strongly I can recommend Shaun of the Dead, but I will do my best: I heartily recommend that you go see Shaun of the Dead. There, that was easy! (It's really good.)

My goddamn fucking laptop is fucked up again. I tried to turn it on the other day and the Wireless card didn't pick anything up. So I checked the router, the modem, fucking everything, and it all turned out to be okay. Then I started poking around in the dmesg output, and it tells me that it's been "Disabling IRQ #11" during startup -- according to my fucking BIOS that's the fucking IRQ like all of my fucking PCI devices are listening to! The sound card, the PCMCIA slot, the onboard ethernet, the USB subsystem, the... fuck! So I start removing kernel modules, hoping that maybe it's a kernel problem, even though I haven't switched kernels in like a year, but no dice. I try to boot off a fresh Fedora Core 3 CD, and I get the same shit. I try to boot off a fresh Debian Sarge CD, I get a kernel panic. I install Windows XP, it makes functional the sound card and the onboard ethernet, but not the PCMCIA socket. I do an install of Fedora Core 3, and I'm back to square one again.

So here's what I've got: A 2.4 GHz laptop that can't get on the Internet and can't play sound. Oh yeah, and you can never unplug it because I had to superglue the power cord in place so it would stay charged after the fucking AC intake port just snapped in half. And the fucking case stopped latching 2 weeks after I got it. But I've got a 2.4 GHz laptop that pretty much works, except it doesn't work very much under Linux.

I need a new Linux machine so that I can continue my work. It's driving me crazy. The purchase anxiety... it's driving me crazy. These laptops, they're like... $1500! Jesus fuck. I don't know what to do. I need guidance. Any priests out there? Should I get a Thinkpad? Or a Dell? This is my one hobby. And I feel super-guilty getting rid of this laptop. Maybe Mer can use it?

Thursday, October 07, 2004

And Now, Andy Rooney

A shot in the arm from my friend Billy, whom you all may know better as "Razor" or whatever it is you're always calling him:
It gets me really upset to see a lot of you fucking people saying that Cheney performed in any way well in that debate. What. Did. You. Watch? Are you insane? Edwards was a truth-telling (or relatively truth-telling) machine. Cheney had nothing to say. Did you just hear me? Nothing.

He had no answers. He mumbled. He looked like an evil villain. He muttered statistics that shouldn't have confused ANYBODY in their transparent bullshityness, but they did. He confused Amherst college kids. You fucking retards. Why are you buying into this even-handedness that the press is imposing on us? There is absolutely no time for that. Edwards squashed Cheney like a fucking bug, and all of America saw it, and in a few days, if all goes well, the real polls will come out (just like they did after the last Kerry/Bush debate) and they will show that 90% of fucking America concedes an all out victory for John Fucking Edwards. You fucking nitwits.

How the fuck can democrats think they have a chance of standing up to these bullies, these ogres, when all they do is give PUSSY FAGGOT ANSWERS AND EVEN-HANDED ANALYSES THAT AREN'T EVEN ACCURATE?! Why don't you fucking people out there who think that they fucking "split" or that Cheney had the "upper hand" watch the fucking debate again simply with an eye to who is more persuasive? With an eye to who is more correct?!

WHO THE FUCK ARE YOU PEOPLE? You're as bad as the fucking liberal, pussy, bitch-ass media, who are also rolling over backwards to suck Bush's cock while Cheney fucks them up the ass. You guys suck.

Wednesday, October 06, 2004

In Which I Show My True Colors

Me: I mean jesus
Me: he blew it
Maggie: greater good julian. greater good.
Me: Can I vote for Kerry/Cheney?
Me: Cheney believes in gay marriage and hoarding money
Me: JUST WHAT I BELIEVE IN
Maggie: that's true
Maggie: we can't vote for president/vice-president seperately, can we?
Me: not unless you write it in
Maggie: do it
Maggie: make a statement

Monday, October 04, 2004

Bloodweiser: King of Fears

Here's what I did on my first day of vacation, scallywags:
  • Tidied up the apartment
  • Did the dishes, including getting that algae-like gunk off the baking tray
  • Vacuumed the carpet, including fixing the fucking Dust-Buster knockoff thing we have because that rubber band thing inside it kept slipping off
  • Baked cookies
  • Played Morrowind
  • Played Halo
  • Played Final Fantasy Chronicles
  • Donated some of my old books to the NYPL
  • Made another goddamn vet appointment for the cat
  • Programmed

As far as I'm concerned, each of you falls into one of three categories:So which is it, punks?

Sunday, October 03, 2004

Eat Shit: I Am On Vacation

That's right, dick-lickers! A whole week. (I am literally going to kill myself, probably.)

To borrow some pages from Devlin's lexicon, it took them forever on Friday to get the goddamn build out. And the whole day, it was all, "Okay, don't get involved in any side projects, because the build is going to be out any second." And then the build came out and it was obviously bad and they didn't get it rebuilt until 7:30 PM. 7:30! I know that doesn't mean much to you guys who have to work until like 4:00 AM every day, but we... well, it's different. And that was too late to give us a build. So we actually just played Freeciv all day; I thought I'd kick everyone's ass, but this new QA guy apparently plays a lot of Freeciv and kicked my ass instead.

Then I went over to The Rase's place and she and I and the charming Asta peeped on some Bananas. Is it just me or does anyone else find those unevenly-cut slapstick moments in early Woody Allen movies (like in this one, the part where he's undressing to have sex with this revolutionary chick and he keeps waving his jacket around) kind of disturbing? It looks like you're watching a home video of someone about to commit a crime.

Okay, you guys remember that thing I wrote about that asshole guy yelling at the subway intercom? I'm pretty sure I saw the same fucking dude on the way home. He's this pudgy guy with a neat little beard / goatee and not too much hair on his head, but it's all curly and greasy, and he's got this ugly little crooked mushmouth of a mouth. So the F train was pretty crowded, and I'm standing next to this guy and he's hugging his girlfriend really close in this way that strongly suggests he's never had a girlfriend before, and what's more, he's fucking whispering all this shit to her. He's like -- and this guy is like a 70% vocal match for The Comic Book Guy -- he's like, "I am so sorry for those things I said at the party. I was tired and I wanted to go home and... it was rude... and selfish... I swear I will never behave that way ever again." Jesus Christ. And then at 2nd Ave., a couple of people got on that this guy and he's girlfriend seemed to know, and he starts talking to them real loud:
(Indicating his girlfriend) "This is the first Friday night she's had off in years, and we just had the most random evening. We met this Taiwanese tourist and took him around all the downtown attractions. He's staying in an apartment in Chelsea, but he's afraid of all the gays. You know, all the gays in Chelsea. So we're drinking and talking about, you know, smoking pot, and he says he's afraid to smoke pot because when he does he feels like a giant Taiwanese penis. Yeah, he literally said that! So, I'm like, 'Hey man, that's cool. It's all good.'"
You monster. Jesus Christ. Guess where he lives. That's right -- Carroll Gardens. One more reason to drop a nuke on all of us. Right. Now.

The thing is, I kept thinking, "Oh god, who is this girl who is going out with this monster?" And she looked pretty hot from behind, a little like my friend Emily from Amherst. But then she turned around, and you know what? She was ugly.