Daishkyu hinan shite kudasai!

Oh no, there goes Tokyo, go go Godzilla!

Posted by wee on 05/28/2003 at 01:09 AM | Main Page | Category: Random Stuff | Comments (4)
Don't invite them into your house

Bill Gates came to speak at my workplace today. I had zero urge to see him or hear him talk, the trollish multi-billionaire. The man is a vampire. He is to the computer literate as ripple is to a hobo. He's the Jim Jones of the computer age. You can tell who drank his kool-aid by the "innovation" gibberish they spew. Name one product MicroSoft has actually developed all by themselves. I dare you.

He offers "to devote a lot of money to research and develop new products and technologies", but that's a Faustian bargain . "Innovation can be co-opted; anyone will sell out -- or else." That should be their message. MicroSoft exists only to take over the world. If you don't believe that you either hold or you're a prostitute who wants a job. Nobody with even a single scruple would work for MicroSoft.

The dude with the pie had the right idea.

Posted by wee on 05/27/2003 at 10:21 PM | Main Page | Category: Rants
More MySQL stuff

A couple more MySQL notes I wanted to write down before I forgot.

There's a MySQL Perl module called DBIx-DWIW that looks interesting. The name stands for "DataBase Interface stuff - Do What I Want". Normally, you have to jump through some small hoops to get stuff back from a MySQL query in Perl. You do stuff like set up the connection, set up your query, prepare the statement for execution, excute it and fetch rows within a loop or something, handling each record returned individually. If you just want one row from a DB it's a pain.

Enter DBIx-DWIW. To get a single record, you set up the DB connection like before and then you have something like my @prez = $db->Array("select * from presidents where lname='Kennedy'"); and then you'd have an array called @prez with all JFK's stats. A clever fella can trim the complexity down even further by sticking that "$db->Array" call as the parameter for a foreach loop, or taking an array slice from it directly.

I'm going to take a more in-depth look at it next week.

Second note: I wrote small tool last Thursday that backs up MySQL databases. It works over a network and can back up all the databases on the server, individual databases, etc. It's basically a wrapper around mysqldump, but it has a little smarts thrown in. It store MD5 checksums of the dumped data, for example, and only saves dumps if the contents of the database have changed. It zips up dumped files to save space. And it can keep incremental backup files if needed. This makes it easy to do things like backup the DB, do some work of unknown usefulness/quality, do more backups, and roll back to a know state if you decide the changes aren't what you wanted. You could also just watch your database grow, I guess. It seemed like a useful feature to add in and it was simple to do.

I might make a few additions to it. I'd like to not use mysqldump. Then I could do things like back up only the DBs that the supplied username can see (right now it errors out if you try to back up stuff you aren't allowed to read). If I can keep from shelling out to another program I'd be happy, even thought it's a perfectly reasonable thing to do.

Third note: If you want to see what your MySQL server can do on your hardware, check out SuperSmack. It basically whollops your server and gives you an idea of what's going on.

Fouth and last note: Go and read all about the query cache feature introduced in MySQL 4.0.1. It stores SELECT statements and their results. When a query comes that matches a previous one, the cached result is sent out instead of the statement being re-run and a new result generated. You get things like a minimum speed boost of 238% and 20,000+ queries per second on old (900MHz P3) hardware.

Of course none of the two people that read this site (Hi, Tess!) care about this stuff, but it's as good a place to make notes as any other... :-)

Posted by wee on 05/24/2003 at 02:09 PM | Main Page | Category: Geek Stuff | Comments (3)
The Matrix

Everyone has to have an opinion about the new Matrix movie. I'm all carpal-tunneled out from typing all day, so in the interests of brevity I'm going to borrow one.

Having "said" that, I will say that I liked it and I do want to see it again. But it isn't the pinnacle of modern cinema people are making it out to be. It's a live-action anime kung fu movie, nothing more. It's entertainment, and it served its purpose.

Posted by wee on 05/23/2003 at 02:42 AM | Main Page | Category: Random Stuff
DBD::Google

If you have ever used Perl's DBI database interface, then you should most certainly look at DBD::Google. It basically gives you a SQL interface to Google. So that means you can do stuff like SELECT title, URL, hostName FROM Google WHERE q = "monkeygumbo" and call a Perl DB driver to do the dirty work. Here's an example of what the output looks like.

Thinking about this makes my head move around in tiny imaginary circles. I'm one step closer to having a live Google feed (tempered by a Wikipedia feed) installed into my brain and that makes me very happy.

Posted by wee on 05/22/2003 at 11:27 AM | Main Page | Category: Geek Stuff
Stump the AI

I happened across a really cool web site yesterday called 20Q. It's essentially your normal 20 questions game, but there's no human on the other end. You think of an object and AI software attempts to guess what it is by asking you "animal, vegetable, or minieral?" types of questions. It sounds really easy to stump, but it really isn't. The software actually learns over time as the game is played and is already pretty smart.

The database of objects has been growing for a long time and the software has been around since 1988. It doesn't just remember objects like you think it would (cats are animal, small, furry, etc), it also knows what objects are similar to both unknown and known objects. It uses this knowledge of like objects to refine the questions it asks. If you pick as your object "an electron", then 20Q might arrive at a guess of "a neutron" or "a molecule of water", for example. When you say that the guesses are close, it tends to get them right away. The interesting part is thinking about why it asks a particular question. You're thinking of "Ganymede" and it's asking you if the object you're thinking of "is something you bring along" or if it "weighs more than a duck". Yet even though you might think it's gone off into the deep weeds, it seems to guess what you were thinking of pretty consistently.

I managed to stump it a few times, but there were only a couple times that it really didn't know what I was thinking about; most of the times it had the object in its database and I was answering the questions wrong (or differently than it expected). It didn't know about "mine tailings" but it knew about gold and other mining-related stuff. It didn't strictly know about "a software license" but it knew about patents, a contract, etc. It didn't get "a game show" right off, but knew about TV and such. Picking non-concrete objects like "happiness" or "a tirade" seemed to have the most fuzzy conclusions (probably because my answers to its questions were open to some interpretation), and I think it pretty much got them all even though it didn't really guess them right away. I ended up fooling it with things like surface tension, a pillory, the escape key, islets of langerhans, a sluice and a couple other obscure (but specific) things that popped into my head. And since I had to tell it what objects I was thinking of when it couldn't truly guess them, now it knows all about those things.

If you think about how it works while you play it, then you come to realize that it's pretty fascinating software. I wish the author would hook it up to an Eliza-ish bot, if for no other reason than to make it more spooky to play.

Posted by wee on 05/13/2003 at 10:34 AM | Main Page | Category: Geek Stuff | Comments (3)
kio_fish is really, really cool

If you use KDE version 3.1 or greater, then you're lucky. It has kio_fish built in. I wrote about this before (it was in the Red Hat 8.0.96 beta) but I hadn't really used it much. I've been doing stuff all morning with it (I upgraded my Windows 2000 machine to Red Hat 9 over the weekend), and I don't think I can live without it.

I started Quanta (the editor I've been using this month until I find something better or start using emacs) and hit the 'Open -> File' dialog. In the 'Location' field, I entered 'fish://wee@hostname' and hit return. After typing in my password for the remote system, I was looking at all the files in my home directory. I found a file, opened it up and started editing it. All the changes are there on the remote system. No more scp'ing things all over the world. I've opened a dozen files so far, and I'm still "logged in" to the remote machine. Very spiffy.

Copying files and directories is really easy, too. You hit 'alt+f2', then type in 'fish://user@hostname' and after entering your password you are there looking at your home directory in Konqueror. Drag and drop whatever files you want from there...

Every KDE app can use kio_fish to access remote loactions. I wish XMMS understood how to use it. But streaming MP3s from a web server works well enough I suppose.

Posted by wee on 05/07/2003 at 01:36 PM | Main Page | Category: Geek Stuff | Comments (2)
Pondering the imponderable

Sometimes a stray thought comes into my head and I don't know how it got there or why I bother thinking about it at all. Just now I found myself correcting a couple small grammatical errors in the comments of the source to a program I'm writing at work and I paused for a moment while wondering, "Are comments to source code considered literature?" Then I caught myself staring off into space and went back to work.

Sometimes I find myself giving up far too much mental power to these kinds of inane questions, and very often I can't remember what went on while I was off woolgathering in la-la land. Yesterday, for example, on the drive home from work I lost about 10 minutes when I caught myself pondering "If the Cylons were made of metal which was polished to a mirror finish, how could they be affected by Starbuck's and Apollo's laser pistols? Wouldn't the beams just reflect off them harmlessly?"

Posted by wee on 05/01/2003 at 11:24 AM | Main Page | Category: Random Stuff | Comments (9)