This is just not right

The Japanese are from space -- or they might as well be. They have a way of thinking (viz sausage octopus) that is truly strange to Western people. This is spectacularly true when one looks at a traditional Western item which is in use in Japan. (No, not that kind of item!) For example, most Americans know what pizza is, what it tastes like, etc. You can go from Seattle to Tampa, find a pizza joint, order a pie, and expect pretty much a narrow variation on the same theme. Pizza is pizza all across the country. Pizza is even pizza in England, Australia, Israel, Mexico, etc. (and no, Macedonian egg and lard pizza doesn't count). But not in Japan. No, most certainly not in Japan.

They have Dominos Pizza in Japan, just like in England, Israel, etc. But their pizza is not quite what one expects. Ask 100 Americans, Brits, Aussies, Spaniards, whomever what a Dominos pepperoni pizza is and you'll get 100 accurate descriptions. Ask that same group what Sumibiyaki Chiki-Teri pizza is and you'll get 100 vague stares. Ask them what a Margherita pizza is and you'll get those same stares. Ask them "Have you ever had a Tuna Delight pizza?" and you'll get those same stares.

Keep in mind, this is Dominos we're talking about. It's not like we're screwing with Big Macs or anything. I haven't even mentioned the half-meter-long pizzas with corn and shrimp and mustard and seaweed yet. Or other places that serve pizzas with names like "Golden Triple Corn" and "New Funky" and "Nasu Meat" and, my personal favorite, "Pizza-La Ebi-Mayo". Ask 100 people what "Nasu" tastes like and see what answers you get. Nothing like the answers for sausage or beef or even squid, I bet. Ever had a pizza with mayonnaise on it? Yeah. You need no more evidence that the Japanese are from space than a mayonnaise, potato, bacon, onion, corn, tomato sauce and double cheese pizza.

I rest my case.

Posted by wee on 06/28/2002 at 09:43 AM | Main Page | Category: Rants
Country names and ISO 3166 codes SQL import file for MySQL

I recently had a project at work which required a web-based user registration sort of feature. Because the project had an international flavor, I had to let people from every country register. And since we were going to need to generate reports broken down by country and eventually make mailing labels from the data stored in our MySQL database, I wanted the data to be pretty clean. Thus, I didn't want people to either have to or be able to type in their country of origin by hand. I wanted a select list they could choose from.

What I wound up doing was making a table which listed the names and ISO 3166 codes of all the countries of the world. I then referenced this table in my main user registration table as a foreign key. This allowed us to look at all the people that had registered from Europe, let's say, and then make graphs with the two-letter ISO codes on them for clarity. It worked out pretty well.

To make a long story short, I realized that this was not only the fourth time I had made such a table, but also the fourth time I had done it from scratch (and it was the third time I had done it by writing a perl script which screen-scraped a list off the web). This is silly and a waste of time. So I decided to put my SQL file up where I can get it later if I needed it. Since sharing is good, I made it public here so other people can get it if they find it useful (I didn't find much when I went googling for such a list...).

So if you happen to find yourself needing a MySQL table with the ISO 3166 codes and names for every country in the world, you're in luck</>. I also included some other example tables and a PHP code snippet which makes HTML form select lists automatically from the table.

Winamp on Linux? Sure! Well, "Maybe" at least...

The alpha release of Winamp for Linux (odd name, I know; reminds me of a class I once took in college called "Planetary Geology") is available for download from Nullsoft's site. A fairly lightweight 1.5MB download (XMMS was around 2MB last time I grabbed it). The press release for version 3 has this to say about Linux and us maybe seeing other cross-platform code:

Every component of the Winamp player can be removed or replaced, enabling developers to create exactly what they want and integrate it quickly into Winamp. The "Wasabi" coding platform enables instant cross- platform functionality for supported platforms that will include Windows and Linux at launch. The Winamp player is the first full-featured application for this groundbreaking new coding platform.
That bodes well. Maybe the Wasabi "platform" will allow more visual stuff, hoepfully for more than just an mp3 player. The license, I'm sure, won't be GPL or LGPL.

I downloaded the alpha. It's a tarball all right, but it's a tourist in the Linux world and definitely not a native speaker. First off, the archive has hardcoded paths starting from /. It expects you (as root, I assume) to extract it from /, and it makes a /usr/local/Winamp directory for its files and then places a shell script in /usr/local/bin which runs /usr/local/Winamp/Winamp.exe (with an input file arg and STDIN/STDERR to /dev/null). This is very weird. I now have a binary file with a .exe extension at $HOME/download/win32/winamp/usr/local/Winamp and a shell script which points elsewhere.

I tried to run it manually, but forgot one other thing about the shell script: it adds /usr/local/Winamp/libs to my LD_LIBRARY_PATH environment variable. I didn't do this, so it wouldn't run. I added it, and Winamp.exe did in fact execute. But it didn't run long.

It looks like this is a debug build, which is unsurprising since it's an alpha. It ran and displayed various profiler messages and such (the app loaded completely in 3422ms, in case you were interested). Most of the output wasn't especially interesting or unusual, although it did have a few of what looked to be function names that simply said "Write me!". I happened to notice that among these unwritten items, both Systray::addIcon and Systray::setTip told me to write them. Again, in case you didn't know it was a work-in-progress, here you go. Except seeing as how I don't have a system tray to which an icon and its associated tooltip might be added, I wonder if this might not be a work based on Win32 version which is in progress...

When the .exe ran it tried to create what looked like 3 new windows. I assume that they were the main window, the EQ and the playlist window. I couldn't say for sure since the allocated screen real estate was simply black. These new windows were up for about 1 second then went away. On the console, I saw this final message before the app died:
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request: 72 (X_PutImage)
Serial number of failed request: 5012
Current serial number in output stream: 5013
I'm no X programmer, but that looks to me that the app is trying to draw something in a window -- a border or background image or some such -- and can't because some X API function call was expecting different args. I don't know. I'm using XF86 that comes with Red Hat 7.3, version 4.2.0. Maybe this Winamp alpha was built under a different version? Version 3.something maybe? At any rate, I can see why they redirect STDIN and STDERR from the shell script. This build spits out a lot of info.

So there it is. I ran it with strace and watched all the "seek into my zipped-up skins files" hoo-ha fly by. I'm tired and it's late and
I'm no longer all that curious as to what "Linamp" might be like, so I didn't go through it all of it very much. I did scan through it, though. Toward the end, I saw bunch of open() calls that failed because the files weren't found. I also saw some libpng warnings about incomplete streams. Offhand, I'd say that this alpha build actually does expect to be installed in a certain location. Although I can't imagine hard-coding paths, even in an alpha. More likely, I've got it all wrong and my theories are bunk. I wound up installing it where it wanted to be on my dev box, though. I got the exact same results. No go. There's no readme or any kind of documentation with the alpha, so I have no idea what really is wrong.

Anyway, it'll be nice to have some choice once they get it working. When I switched from Windows to Linux, one of the things I really missed was Winamp's minibrowser. XMMS could use that feature.

UPDATE:
Thu Jun 27 13:17:58 PDT 2002
I figured out what was wrong. Winamp doesn't handle lower bit depths that well. I keep all my machines at 16-bit color since it's plenty and faster than 24-bit. Winamp just doesn't like that too much. I'm just not curious enough to go jigger my XF86Config file.

Posted by wee on 06/24/2002 at 03:15 AM | Main Page | Category: Geek Stuff | Comments (7)
Oh dear lord for the love of all that's holy don't screw with Race...

I came across something tonight which I didn't think much of at first, but after careful reflection, troubled me deeply. I don't know how else to say it than to just say it: Race Bannon filed suit against Dr. Benton Quest to win custody of Jonny and his pal Hadji. I think I'm going to get sick and spit up on my desk. Oy.

That's just not right. It. Is. Not. Right. Johnny Quest was like my favorite show growing up. And I dug Race Bannon. He was my hero during my formative years. When the outer space spiders came down, he whipped out the Garand. When there were crocodiles, he'd get the .50 cal on the jeep. He flew the plane and blew shit up and drove cars really fast and generally kicked complete ass against any and all manner of bad guy both far and wide. He was the Quest family's fearless protector and had an unknown bond with them: Never a "true" part of the family, yet the one that would give his life to save the family. He always made sure they were safe even if it meant his life was on the line. He was unconditionally devoted even though he knew he would never be a real family member. He was a selflessly caring character in that respect, and he was also a rambunctious little punk's idol. And now, 35 years later, they say he's gay? That's the unknown bond?! But... But... But... No!

I'm not saying there's anything intrinsically wrong with him being gay. I have and have had lots of friends who are gay. I've known and worked with and gone out with and had whole entire relationships with gay people. I've got no problem whatsoever with people being gay. It's their thing, just like my thing is my thing. I am down with gay. Really and truly. But none of the many wonderful gay people I've known were my friggin' childhood cartoon heros!

It shakes a small foundation is all I'm saying. A tiny one. Something you took for granted isn't the way you thought it was. Nothing major on the surface, but somehow profoundly disturbing the more you think about it. Like a picture that always looks crooked, and gets more croooked the more you mess with it. Or like a table that is never quite level. Like that, but in your head.

Anyway, I submitted the link to fark.com...

Posted by wee on 06/20/2002 at 09:05 PM | Main Page | Category: Rants
A good ID3v2 spec

I don't know why it eluded me so long, but I've been looking for a genre list for MP3 ID3v2 tags. I found a good one by accident today. Cool.

In completely unrelated news, while The Ramones' "I Don't Wanna Go Down To The Basement" has some really inane lyrics, it has a pretty darn infectious beat. I find myself wanting to listen to it over and over. I don't know if the song is all that good or if I'm just mildly autistic.

Posted by wee on 06/20/2002 at 10:23 AM | Main Page | Category: Geek Stuff
Cool software

I found a couple cool software packages in the last few days. They are:

Progect
Progect is a freeware Palm app which does what I was going to do myself: make lists of lists. It's got a "task list" sort of metaphor which is easy to hink of. You make a list of itemts, and then sub-items under those. Each item has a progress meter icon, and you can specify "progress" in various ways: percent complete, number of things done, or no completeness (just "an item to do"). It's a very nice app. (BTW, an incredibly nice gent by the name of Bryan White turned me on to this. Much thanks, Bryan!)

Linksysmon
To get information fro a Linksys router I have, I've been using a smallish C app that I hacked together. It essentially syslogs SNMP traps and it's very basic and not altogether useful for much. Linksysmon does that, but does it way better. You get router stats and much better logs. As a bonus, it will send email alerts when certain defined things happen, and comes with a script which sends a newly-changed IP address to dynamic DNS service. It's Perl-based too, so very easy to install and work on.

Dailystrips
This one is just amazingly cool. It's a Perl script that will go out and fetch various comics. The really swift bit is that it can save them all locally without you having to resort to piping trickery. I set it up to grab a bunch of my favorite strips and put them on my intranet's home page. It runs every morning, and links back to the old strips (in case I miss a day).

Posted by wee on 06/19/2002 at 10:50 AM | Main Page | Category: Geek Stuff | Comments (2)
Get your IP address emailed to you

I sliced about 1/2" into the tip of my right index finger Saturday night with the ceramic utility knife I gave Tracy for her birthday (yes, the one I told her to be careful with because it'll cut just by looking at it). I was trying to be careful when I was cleaning it; that's why I cut my right hand. Grrr. I told the dude at the ER that I was cleaning it when it went off. Hardy har har.

Anyway, this post is gonna be short. Yeah, right..

If you have a machine on an Internet link, but which is NAT'ed, and your provider keeps messing with your IP address, then you might like this:

#!/usr/bin/perl -w
use strict;
use LWP::Simple;
use Mail::Sendmail;
use Sys::Hostname;
use Cwd;
# Define if you want messages on STDOUT
my $debug = 0;
my $email_to     = '';
my $email_from   = '';
my $smtp_host    = 'smtp.isp.com';
my $hostname     = hostname;
my $ipfile       = cwd . "/ipaddress";
my ($oldip, $lasttime);
my @oldip;
my %mail;
my $content = get("http://www.whatismyipaddress.com/") || die $!;
$content =~ /(\d+\.\d+\.\d+\.\d+)\s/;
my $ip = $1;
my $time = time;
if (-e "$ipfile") {
    open(IP, $ipfile) || die $!;
    chomp(($oldip, $lasttime) = <IP>);
    close(IP);
} else {
    $oldip = "none";
    $lasttime = $time;
    print "IP address file not found, will create.\n" if $debug;
}
if ($ip ne $oldip) {
    open(IP, ">$ipfile") || die $!;
    print IP "$ip\n$time\n";
    close(IP);
    my $lastchangetime = scalar(localtime($lasttime));
    my $currenttime    = scalar(localtime($time));
    my $message = "\nAs of $currenttime, $hostname reports your ip address as being $ip.\n";
    $message   .= "Your IP address last changed on $lastchangetime\n";
    unshift @{$Mail::Sendmail::mailcfg{'smtp'}}, $smtp_host;
    %mail = ( To      => $email_to,
              From    => $email_from,
              Subject => "IP Address from $hostname",
              Message => $message );
    sendmail(%mail) or die $Mail::Sendmail::error;
    print "\n\$Mail::Sendmail::log says:\n", $Mail::Sendmail::log, "\n" if $debug;
} else {
    print "IP address $ip has not changed, no mail being sent.\n" if $debug;
}

That will email your IP address to you. I had a much simpler version up here originally, but it wasn't that useful.

This version will only mail you if your IP changes. So you can run this from a crontab like every 5 minutes and it will only bother you when you IP changes. It'll also let you know the last date and time a change was detected as well as the host that is reporting the IP.

Note the security risks with this. If a bad guy knows you use this to log (in at home or where ever), he can spoof it and then get into that box by fooling you into thinking your IP changed. Small risk, but there it is.

Oh yeah, that uses whatismyipaddress.com to screen scrape your IP. That doesn't have to be the case. If you have a web server somewhere on the outside from which you can run CGI scripts, then this will also work with the above script:

#!/usr/bin/perl -w
print "Content-type: text/plain\n\n", $ENV{REMOTE_ADDR};

Save that somewhere in a place where a browser can hit it and you're good to go.

Posted by wee on 06/18/2002 at 12:36 AM | Main Page | Category: Geek Stuff
QA via sheer luck and accidents

I happened to notice this story on news.com about Microsoft shipping the Nimda worm (it's not a friggin' virus, dammit!) with the Korean version of Visual Studio .Net. What a hoot. But buried in the story was something very scary.

Microsoft has exceedingly bad Quality Assurance. While trying to play down the sheer stupidity of actually bundling a worm -- by accident -- with their developer software (where's the virus scanning? where's the software manifest?), a MS spokesman said this:

It wasn't until a Microsoft employee was adding the help documentation to the software giant's developer Web site that the worm was found. "We have to go through a conversion process to an online HTML format," said Flores. "During that process we found an extra file hanging around."
"Awww, shucks, silly us, it's not a big deal, see it was with the help files and that's where we found it..."

Hang on a minute. They found it by accident? What?!? Where the hell were the QA people? Where was the QA process? Some web flunky was converting the .hlp files to .html (or I should say ".htm" files, since everyone knows 8.3 file names is the way God intended PCs to be and even if it wasn't, MS would never admit to eveer having being completely lame) and just happened to notice an extra file? Holy shit!

That just blows my mind. It's stunning. If the web guy hadn't happened to notice an extra file, what other QA process would have caught it? Anything at all? What else is the utter lack of QA at Microsoft missing? How many extra files do you have in Windows XP or 98 or 2000? If they hadn't been doing the conversion (like, say, 3 or 4 years ago when .hlp files were just .hlp files and needed no conversion) what would have happened? Has this happened in the past?

Jesus... that's incredible.

I bag on MS often enough, and they do enough to warrant more than a little derision. But this is just mind boggling. This is just one more good reason why I don't use their products. What a load...

Posted by wee on 06/15/2002 at 12:40 PM | Main Page | Category: Rants
More virii infecting my brain

I swear I have a mental tick when it comes to the word 'virii'. I just can't stand it. Why must people use that word? Here's a good page on the etymology of the word 'virus'.

Although I can't stand the fact that I find myself agreeing with Tom Christiansen...

Posted by wee on 06/14/2002 at 10:53 AM | Main Page | Category: Rants
What is it about creature feep?

I'm doing a lot of web-based stuff at work lately. (In case you cared: I'm making read-only event calendars from CorporateTime via an app I wrote which produces XML; various XSLT sheets and a Java servlet produce HTML and printable PDFs and such from that output and this is what people see and what they see is what I'm talking about). So I'm back into the whole game of meeting with people who decide feature sets and the "look-and-feel" of things. It's oddly surreal, since I've been doing that off and on for the past 8 years in one form or another. This time is different, though. Maybe since I was pretty much on the server end of things for so long, I see the presentation end as being somewhat whimsical. I dunno.

Anyway, I've been meeting with people who could be considered the "Marketing Department" of the school where I work. I've noticed that no matter where you go, you see the same thing happen over and over: Most people would rather add to an existing widget than make a new one (or attempt to create even part of one).

If you ask 100 people to come up with how they all want a design to look, you either get no responses or your get a 1000 ideas. But if you go and make your best guess, you always get those 1000 ideas. It must be easier to create a thing when a framework for it is already built than to create the framework as well as the guts of the thing. Maybe that's why so few people are painters, or why so many painters paint things they can already see. But for what I do, things usually go like this:

"How do you want it to look?"

"Oh, you know... with a thing here and a thing at the bottom is fine."

"That's it?"

"Yeah, we just want something basic. You know what we want."

"OK..."

... after the whole deal is completed ...

"Well, what do you think?"

"I like it, but can I have an extra thing here, and wouldn't a side thing look nice, and I'd like that thing at the top to also be blue, but except if they are upper management, when it should be red... and oh yeah, the one guy said that the thing on the bottom has to be smaller so that needs to change..."
It's always the same no matter where you go.

Posted by wee on 06/12/2002 at 08:17 PM | Main Page | Category: Random Stuff
Lists of lists are where its at

Lately, everything has been on a list. Seriously, since my dad went into the hospital (for what we thought was the last time), I've been thinking that there's a lot of things that I want to do. And so I thought that maybe I should make and then keep a list.

Trouble is, just one list won't do. I need one list which has as its members pointers to other lists. I want to have one list which has things like "Work - Do by Tomorrow" and "Work - Learn" and "Tracy" and "Home - Outside" and "Home - Immediate" and "Learning" and "Garage Projects" and "DVDs to Buy" and any other item on it. Then I want each of those items to be either a single bullet point, action item, to-do type thing, or I want it to open up a sub-list.

I only want to go one list deep, and I don't care if the list items tie into a calendar or whatever. I don't care about dependancy trees or action items. I just want to sort items in each sub-list, not in the master list. Basically, I want a way to group my lists. And I want to have any number of lists, with any number of items. I want to recurse one level deep. Oh yeah, I want it on my desktop (via the web is preferrable) and on my Palm.

So I'm going to have to write something. Every Palm list app I can find is geared towards sales people. Screw those guys. "Close two deals this week" and "Get tee time for some asinine golf thing" and "Buy hair gel" and "Go to sports bar" and "Cheat on bleach-blond lap-monkey of a girlfriend with another superficial trollop at work" aren't real high on my list since each app I've seen demands that these items be ordered via a Windows GUI which ties into Outlook. For a one-dimensional sales/marketing type, that would be fine. But I need at least one level of depth. I need steak, not sizzle (I stole that phrase from a sales guy who was trying to get me to promise, and then do, the impossible so he could whore the company out for more cash -- and therefore secure his retirement).

So I have to write a Palm app that makes the lists I want. And I'm going to put that on my list.

Hardy har har. You're pretty farking funny, man.

Posted by wee on 06/05/2002 at 11:10 PM | Main Page | Category: Random Stuff
Decisions, decisions..

I was trying to decide whether to go to the O'Reilly Open Source Software Conference here in town or that Linux cruise out of Miami. Cost was an issue, but I've always wanted to meet Linux Torvalds. Well, this decided it for me. How cool is that?

Although I really want to blow my savings on the cruise...

Posted by wee on 06/04/2002 at 10:07 PM | Main Page | Category: Random Stuff