Archive for the ‘Ravi’ Category

I swear to god

Monday, December 5th, 2005

If OpenOffice 2.0 asks me to independently download one more file that isn’t part of the ports tree, I’m going to find the dev team and blow their goddamn heads off. Hey guys: if the compile process requires four files that you aren’t allowed to include in the distribution, then tell me about all of them up-front instead of mentioning one failed dependency and exiting, leaving 3 more unfulfilled dependencies waiting patiently like tripwires in the makefile jungle.

Wednesday, November 16th, 2005

“Control-shift-backspace makes my terminal do weird things.” – Ted Wang

In praise of functions that don’t do anything

Tuesday, November 15th, 2005

Most functions do something. I mean, that’s why they are called ‘functions’ and not ‘nothing’, right? But lately, I’ve come to appreciate the value of functions that don’t do anything at all.

The two most obvious examples of functions that don’t do anything at all are boolean operators with just the right parameters. For instance, the truth value of X AND 1 is the same as the truth value of X, and the truth value of X OR 1 is the same as the truth value of X.

“Why,” I hear you ask, “would anyone need a value that they already have, and why would they spend a cycle or two on it?”

“And,” I reply, “that is a very good question! But fear not, for I am about to reveal the answer!”

Suppose you are writing a function that does something. In this case, it’s an function that makes an SQL query and returns a result set. Let’s say your database is pretty simple for the sake of example. It’s got a table, Author, which has just two fields: authorId (a unique identifier), and name (the name of the author). Book, which has fields bookId (the unique identifier of a book), name (the name of the book), and authorId (which ties a Book record to an Author record). So something pretty obvious to do would be to return a set of all the book names, associated with the names of their authors.


$my_query = "SELECT Book.name, Author.name
FROM Book, Author
WHERE Author.authorId = Book.authorId
";

$result = db_object->query($my_query);

And that’s about as simple as it gets. Another simple task would be to only list the books by a particular author:

$author = some_other_function();

$my_query = "SELECT Book.name, Author.name
FROM Book, Author
WHERE Author.authorId = Book.authorId
AND Author.authorId = '$author'
";

$result = db_object->query($my_query);

Hopefully you’d have a bunch of junk in there to protect against sequel injection attacks, but I’m ignoring that for now. Ok, suppose we want to get all the books written by a list of authors. If some_other_function()returns a list, our query won’t work. Let’s tinker with it some more.

$authors = some_other_function();

$my_query = "SELECT Book.name, Author.name
FROM Book, Author
WHERE Author.authorId = Book.authorId
";

if ($authors) {
//this way, some_other_function() can return either a
//list or a scalar, and we don't have to care
if (!is_array($authors)) {
$authors = array($authors);
}
$my_query .= " AND (";
for ($i = 0; $i < count($authors); $i++) {
if ($i != 0) { $my_query .= " OR "; }
$my_query .= " Author.authorId = '".$authors[$i]."';
}
$my_query .= " )";
}

$result = db_object->query($my_query);

Now, we can handle lists or scalars. Unfortunately, an empty list might end up being a problem, since an empty set of parenthesis doesn’t have a truth value of 0 like you’d hope for (in MySQL, at least, and probably other databases as well). Plus, the loop is a little awkward – having that weird if statement whose block gets passed up on the first run seems to detract from its readability. And, if the list isn’t integer-indexed, the whole thing goes to hell. We can use a foreach loop instead, but then we have $i as a non-loop variable, sort of butting in there and costing a couple lines (and the associated readability) but not doing much. On the other hand, a function that doesn’t do anything can save the day (take that, sub-space!):

$authors = some_other_function();

$my_query = "SELECT Book.name, Author.name
FROM Book, Author
WHERE Author.authorId = Book.authorId
";

if ($authors) {
//this way, some_other_function() can return either a
//list or a scalar, and we don't have to care
if (!is_array($authors)) { $authors = array($authors); }
$my_query .= " AND (0 ";
foreach ($authors as $author) {
$my_query .= " OR Author.authorId = '$author' ";
}
$my_query .= " )";
}

$result = db_object->query($my_query);

The possible error condition disappears without a test (an empty list of authors will return no results), and the function is more readable. All thanks to a no-op.

it was meta, but I enjoyed it anyway

Monday, October 31st, 2005

This weekend was the 19th annual Bridge School Benefit Concert, at Shoreline Amphitheater in Mountain View.

Bridge School seems to draw a vastly different lineup every year. This year was the Year of the Fogey. Neil Young was opening, like he does every year (Bridge School is his pet project) and Crosby, Stills, Nash, and Young were closing. In between were Los Lobos, who I used to love when I was a little kid, Emmy Lou Harris, John Mellencamp, and a couple other acts, including the newer groups Good Charlotte (personally I think they should be forced to rename themselves into Not That Bad Charlotte until they come up with some killer songs) and Bright Eyes.

The reason I say that Bridge School is quite meta is that it involves a lot of experiences that aren’t really immediate and are more based on evoking some other feeling… like the first time you heard Ohio, tripping in the back of a VW bus down by the river. New songs? We haven’t heard of those. Except for Mellencamp, who had not one, but two political protest songs that are probably the least poetic songs in the history of folk rock. Fucker. I hate you now. ‘This is the first time in six years that I’ve smelled freedom in this country,’ my ass. What? Are you psychic? Did you actually start hating the Bush presidency before, you know, there was a GOD DAMN ELECTION? Fuck off.

Anyway, there was nothing at Bridge School that could compare with Vanilla Ice’s performance of the Ninja Rap, but I think that selling out is on the rise again, and maybe Ice is going to lose his record. I say this because Emmy Lou Harris came out on stage to sing with Bright Eyes (who, by the way, are essentially the polar opposite of the White Stripes; when the White Stripes play, you find yourself wondering where all the extra musicians must be hiding, because you are hearing way more than two people could possibly produce, but when Bright Eyes play, it’s like, how can you possibly need SEVEN GODDAMN PEOPLE to play this song?) and she was reading the words during the song. I mean that as literally as it can be said: she had on her reading glasses, and she was holding a sheet of paper with the words, often holding her breath for the first part of the line and then joining in, because she didn’t really know the melody. Wow. Yeah, Emmy Lou. You’re hip. You’re with it. Young people are totally going to find you relevant in their lives. Oh yeah, you also brought out Linda Ronstadt to randomly sing with you for one song as a ’surprise’. Nothing gets a bunch of aging hippies harder than a cheap cameo from several decades ago.

Speaking of age disparity, I thought it was funny that the only people smoking pot were over 50. I’m sure Crosby, Stills, Nash, and Young were quite a bunch of dangerous, revolutionary hooligans in their day, but the only young people who listen to them are complete squares like me. Funny how the times change. Also, my girlfriend’s dad was at the show (this guy is older than dirt, but cooler than Freon in Fresno) and, while me and the ladyfriend just brought some iced tea, Old Man Dodson snuck in a big-ass flask of brandy. I can’t decide whether I should keep doing the ‘Don’t worry, Mr. Dodson, I’m a swell, upstanding guy who will take good care of your precious angel’ shtick, or just grab a shot glass and ask him to pass the vodka.

Winner for the ’surprisingly least-powered-by-nostalgaia’ moment was Jerry Lee Lewis. I had no nostalgaia for him, because frankly, I didn’t even know he was still alive. But good god, the man can wail. Man. I wonder if I can score a copy of him covering You Win Again. Hank Williams never sounded so good. And yeah, he played Great Balls of Fire, and it was incredible, and the crowd knew it. People got up off their asses and shook it, and I’ll be damned if the Killer didn’t get ten times the applause that Neil Young and his folk-ass band drew. And now, for the rest of my life, I can say that Alexis and I shook our asses with Jerry Lee Lewis. Damn.

Where did all the digital watches go?

Thursday, October 20th, 2005

Some of you may have noticed the slogan of TooMeta.com: Nobody Wears Digital Watches. It’s the fastest way I could think of to summarize what I see as the major theme of this website; namely, the failure of technology as savior. But it’s also an interesting point to think about.

There are some people who stubbornly maintain that digital watches are infinitely superior to analog watches, and that analog watches prosper solely because of the sheep mentality of consumers, which leads them to choose status over functionality. And, to some extent, that guy in the link is right: that $22,000 unreadable watch does exist solely as a status symbol. And yes, the dials are pretty cluttered on the ‘help, my barometer had sex with a dashboard’ watch. But I think there’s more to it than that.

Standards: most computer users love the existence of standards, unless they’re proprietary, except when they are usable for free, but not if Microsoft likes them. Worrying about the subtle politics of standards isn’t relevant to this argument, though, because, in digital watches, they don’t exist. Everybody knows how to set the time on an analog watch. Everybody. You pull out the little knob on the right, and you turn it until the hands are pointing to where you’d like them, and them you push it back in. If it’s a pocketwatch, the knob may be on the top. “Oh come on,” a digital watch fanatic will say, “It only takes a few minutes to learn how to use a digital watch. I bet your VCR still flashes TWELVE TWELVE TWELVE, you moron.” And they’re right (about the few minutes, not about the VCR), but a) it’s an extra hassle, b) you’ll have to re-learn obscure features every time you need them (b-sub-1: you might have to learn how to cancel obscure features when you enable them by accident), and c) digital watch interfaces, even after you learn them, are clunkily slow. To set the time on a digital watch, you’ll typically follow a sequence like, ‘Hold the TIME button for 5 seconds, at which point the LCD should time start blinking. Press MODE until the hour is set as desired. Press ALARM to advance to the minutes. Press MODE until the minutes are set as desired. Press ALARM to advance to seconds. At this point, pressing MODE resets the seconds to 00. Press TIME to save the changes and exit, or press ALARM to go back to the hour.’

My boss has a Rolex that gains five minutes a week. If I’d paid as much as he did for a watch that couldn’t tell time, I would be pissed the fuck off. But it’s not really a problem to him. He just pops the knob, twiddles it for a couple seconds (sub: dials are wonderful input devices, because they support both frobnicating and tuning; Apple figured this out for iPod and look where it got them), and pushes it back in. Just like you do with every other analog watch. Here’s a brilliant idea for digital watchmakers: use a digital knob that just happens to function exactly like a regular old analog knob. It’s the year 2005; don’t tell me it’s too complicated because I built more complicated circuits than that in college.

Design: digital watches tend to be ugly. I know a lot of geeks will say that only brainless masses follow trends in clothing and so forth and so on, but I think there’s a difference between being trendy and having a frickin’ sense of aesthetics. And all that chunky black matte plastic is god damn bitch-ass ugly. OK? It is. And why are digital watches covered with ads for themselves? Sure, laptop computers have all kinds of ENERGY STAR COMPLIANT INTEL INSIDE POWERX 3D ULTRA WIZARD stickers on the actual computer body… but they’re just stickers. You can take them off if you aren’t a total retard. Digital watch? You’re stuck advertising UBERQUARTZ PANEL 100M DEPTH SHOCKPROOF ACCUROSCOPE 3000 for as long as you’ve got the damn thing.

Some companies do make digital watches with steel cases and wristbands, trying to go for a ‘classier’ look. Then they make the digits an inch tall and warped and distorted, complete with scrolling animation as the seconds tick, so reading your watch is like reading an odometer through a fish bowl. I’ve seen a digital watch that would have looked perfectly respectable, if only it didn’t have a matrix display that looped an animation of a DRAGON BREATHING FIRE THAT TURNS INTO KANJI. Hey man, can I get some V-TEC stickers with that?

There are plenty of good reasons why nobody wears digital watches. We’ll be sure to talk more about them later.

Bot-Net Architecture Pioneers Arrested

Tuesday, October 11th, 2005

Dutch authorities have arrested three bold pioneers of the Bot-Net Architecture For Windows™ which TooMeta.com is currently developing. Having constructed a network of over 100,000 machines, and having put it to use for productive activities such as phising and cyber-extortion, this trio caught our attention not only as obvious up-and-comers, but also as heralds for the power of the Bot-Net Architecture™.

While we at TooMeta.com are saddened and disappointed to hear of the arrest, we are confident that the Bot-Net Architecture™ will continue to be a shareholder value-enhancing tool for any business which works in technology. And upgrades are always on the way! The next upcoming release of the Bot-Net Architecture™ includes patented TooMetamorph technology which prevents antivirus systems from mistaking the Bot-Net™ handshake initiation protocol for a Trojan or other malicious code. Just think – if the (obviously immoral, if not illegal) predations of Norton, Symantac, McAfee, and other terrorist cyber-luddites couldn’t stop three guys from assembling a computing cluster with 100,000 systems, what can the fully-unleashed capabilities of the Bot-Net Architecture™ do for you?

Friday, September 30th, 2005

Ideas: what about a sort of pseudo-Norquist future where the government hasn’t exactly been ‘drowned in the bathtub’, just sort of put out to pasture? Wouldn’t it be funny if police departments didn’t have enough funding to operate vehicles, so the officers were all riding bicycles and taking public transit to the scene of the crime?

Introducing: the Bot-Net Architecture™ For Windows

Monday, September 26th, 2005

Every day, they’re out there. While you brush your teeth, while you drive to work, while you sleep soundly in your bed, hackers, script kiddies and other miscreants are waging global war on the internet. Viruses and worms exploit vulnerabilities in all sorts of systems and applications, turning ordinary computers into a world-wide ‘botnets’ to do the grunt work in the nefarious schemes of spammers, crackers, and identity thieves.

Isn’t it time you put them to some good use?

Introducing the Bot-Net Architecture™ For Windows, a multithreaded, object-oriented API capable of leveraging the exciting power of botnets in all the ways your imagination can dream of. Acquire resources, control systems, expand networks with the push of a button – it’s that easy. Since all the work is done on remote computers, Bot-Net™ requires virtually no CPU time or memory, keeping your hardware costs low. But just because they are remote systems doesn’t mean they have to act like remote systems – Bot-Net™ handles all the complexities of the network transparently and seamlessly: you make a local function call, and in a suburb of London, some yuppy sprays latte foam all over his 17″ PowerBook when Safari tells him that he’s just helped you steal $11 million from the Teamsters Union.

Bot-Net™: Who do you want to own today?

Sparks will fuck you up

Monday, September 26th, 2005

Just for the record, Sparks will F you the H up. No kidding. I was up til 4 AM Sunday. Keeroist.

Alliance is so terrible

Monday, September 26th, 2005

There’s a whole genre of posts dedicated to rah-rah team boosterism and ‘OMG WE OWNZ JOO NOOBS’. I hate shit like that; it’s stupid and doesn’t serve any purpose.

That being said, the Alliance is pathetic.

When I was with the Alliance on Kilrogg, I thought that maybe it was just a fluke of that server. After spending some time in Warsong Gulch, I became informally associated with some top-notch people who would send me invites when they didn’t have enough regulars to fill out the roster. All-in-all, I would say there were two such groups on Kilrogg, though they never really had official membership and sometimes shared members. The thing is, there were at least five groups on the Horde side of equal ability.

Anyway, I play on Crushridge and Kil’jaden now, both Horde, and I can now say, it’s not just Kilrogg. On Crushridge, I’m halfway to Honored with Warsong Gulch, and I have lost exactly TWO games. So that’s something like 48 wins, 2 losses. Some nights, we have deliberately let the Alliance score a flag cap just because we don’t want to demoralize them – after all, if they don’t get back in the queue, we’re screwed.

In world PvP (Crushridge and Kil’jaden are PvP servers), I’ve never lost a one-on-one fight to an Alliance player who was at or below my level. Of course, I’ve never been attacked one-on-one by an Alliance player who was at or below my level, either. Either they attack weaker players, or they gang up in giant gank squads. Always. At level 31, my hunter got ganked in Stranglethorn by a 34 rogue. I started using the ‘freeze trap->flare while you quest’ method to reverse gank him; after I killed him twice, he came back with a 36 (!) rogue and they killed me together. I teamed up with a 32 hunter, and the next time those rogues came, we shipped them back to Darnassus in a box. And again. And again. And then they come back with a level ?? rogue and wipe us out, with plenty of /spit to go around. Wow. What studs. The best part is, I can totally imagine them on /1 whining “waaaahh someone come help this f4gg0t asshole hunter is camping me”.

Kil’jaden works pretty much the same way. A five-man gank squad, levels 30-36, attacks my four-man party, levels 24-30, and we beat them. Freaking sad. And two minutes later, you guessed it, level ?? rogue is on us. And we even made her drink a potion before we died.

So why does the Alliance blow goats? Does the Alliance turn players into bad PvPers? Are bad PvPers naturally drawn to the Alliance? On servers where Horde outnumbers the Alliance, is it the other way around? I don’t know, but I am interested in finding out.