Computers: February 2002 Archives

Nobody knows the troubles sysreads

| | Comments (0)
For some reason, a bug apparently has slept dormant in MacPerl for the last many months, whereby sysread() is returning undef instead of 0, intermittently, when it is finished reading. This came up while I was using LWP::Simple::get(). However, if I switch to get_old(), or define $FULL_LWP so that the trivial_http_get() is not used, then it is fine. Harumph. Murr will save me.


| | Comments (0)
MP3::Info 1.01 is released, with improvements in ID3v2 tag support (ID3v2.2.0 improvements, ID3v2.4.0 support, other improvements, UTF-8 support). The UTF-8 support is kinda cool, but still partially experimental; I'd be surprised if there are no bugs in either code or design. Please let me know of any problems you find with either.


| | Comments (0)
I have a lot to do this week. I need to release MP3::Info and MacPerl. I need to do a lot of things for my wife, since she is resting as much as possible. I need to do my real job. I need to prepare more for our coming child.

We spent almost 6 hours in the hospital just so they could observe mother and child. Ugh. Nothing wrong, we didn't think we were in labor or anything, they just wanted to observe, in the off-chance that something might happen. I am not angry with them, just tired and busy. I want to say I have more important things to do than waiting for nothing to happen in a hospital for 6 hours, though that wouldn't really be true, but I do have other things to do, and since we didn't need to be in the hospital in the first place ... but at least we have now had somewhat of a dress rehearsal, so we really know what to expect when we get there for real. I now know what all the buttons do on the various things in the room (including the UA Reference button which I guessed zeroed out the monitor for relative pressure, and was right, though my wife didn't want me to press buttons without knowing for sure what they did ... but I'm an engineer! The plug says "UA" on it, and the monitor was recording 60 when she changed positions instead of 10, and the nurse had said something about setting the resting position on the monitor, so hey, it should work, right?)


| | Comments (0)
TorgoX noted that one of his journals was not showing up in the fulltext journal search by the term "obviously". Hm. After some searching br Krow, it is discovered that MySQL 3.x has a stopword list compiled in if COMPILE_STOPWORDS_IN is defined, and obviously is a stopword. Yow. We can edit the list, undef the COMPILE_STOPWORDS_IN, or not use that word anymore!


| | Comments (0)
I have a new MP3::Info about ready to go, but I am unsure if I like the interface for the UTF-8 stuff. Maybe I should sleep on it more. And I should probably add heaploads of testing to it ... maybe if Schwern paid me to!

Hopefully MacPerl 5.6.1r1 will finally be released next week. After that, if all goes well with it, I can try to do some more builds of 5.7.3+ to see if there are any new problems before it goes to 5.8.0. I simply don't have time to port all the tests, so hopefully Schwern's wonderful work of the testing stuff has paid off, and most of them just work.

Your message may cause offense

| | Comments (0)
Eudora has a FlameWatch feature that tries to guess if the message you are sending might be offensive to the recipients, to help you rethink what you are about to send. I leave it on for fun, because it often picks very innocuous things as offensive, and sometimes picks things as offensive that I can't even figure out at all. In any event, it has a scale of one pepper to three, and when you hit Send it says "Your message may cause offense."

Might this be a good feature for Slash? :-)/2

Too Much To Do

| | Comments (0)
I am not any busier than I was before; I don't have too much to do in the sense of volume, but too much in the sense of too many different things. It makes it hard to focus on one thing, or to do a lot of work in one thing. Bah!

| | Comments (0)
We just launched a new section on Slashdot for Apple stuff, and I'll be handling most of the stories on it. There's some neat code underneath to make work like And it has a nice fluffy new look to it.

Good Day

| | Comments (0)
Yesterday kinda sucked. I did bills, TiVo was broken, and it was raining.

Today the TiVo started working again and it was snowing and I woke up to a loaf of freshly cooked bread from the machine.

DirecTV Revisited

| | Comments (0)
Somehow, DirecTV, after I adjusted my account options online, decided it was time to close my TiVo account, even though I have lifetime service.

So I am now going on Day Two of No TiVo.

Try to avoid the online account changing if you can, or at least double-check what changes they make to your account for the next day or so after you make changes.

Journal / Comment Stats

| | Comments (0)
For those who are curious: journals really started to take off around October, and took a huge jump in January. Comments -- not just comments on journals, but also those on stories, polls, etc. -- exploded around the same time.

Journal Stats for use Perl;    //  Comment Stats
MMM YY :  New / Tot. / T.Users //  New  /   Tot.
=========================================== =====
Pre-01 :    - /    - /   -     //   894 /   894
Jan 01 :    8 /    8 /   1     //    53 /   947
Feb 01 :   12 /   20 /   1     //    34 /   981
Mar 01 :   13 /   33 /   4     //    81 /  1062
Apr 01 :   58 /   91 /  15     //   100 /  1162
May 01 :  103 /  194 /  28     //    58 /  1220
Jun 01 :  115 /  309 /  38     //    83 /  1303
Jul 01 :  185 /  494 /  50     //    87 /  1390
Aug 01 :  170 /  664 /  61     //    34 /  1424
Sep 01 :  112 /  776 /  72     //    55 /  1479
Oct 01 :  280 / 1056 /  89     //   283 /  1762
Nov 01 :  332 / 1388 /  96     //   297 /  2059
Dec 01 :  388 / 1776 / 107     //   499 /  2558
Jan 02 :  725 / 2501 / 137     //  1351 /  3909
Feb 02 :  324 / 2825 / 140     //   694 /  4603

MP3::Info and Unicode

| | Comments (0)
So Che_Fox wants MP3::Info to handle Unicode strings. Well, he and others had recently helped me fix some problems with MP3::Info on ID3v2 tags and encoding bytes, so sure, let's look at it.

We figured we could just identify which strings are UTF-16 (the default for ID3v2; UTF-8 is not even supported until ID3v2.4.0, which most software doesn't even support yet) and convert them to UTF-8.

if ($uniconvert && ($encoding eq "\001" || $encoding eq "\002")) {  # UTF-16, UTF-16BE
    my $u = Unicode::String::utf16($data);
    $data = $u->utf8;

That worked fine, until we relalized that Unicode::String was leaving in the byte-order mark (BOM) and we don't want that. So we strip it out after the fact:

    $data =~ s/^\xEF\xBB\xBF//;    # strip BOM

Hopefully, that's the right thing. And it seems to work.

But then we realize that some tags might be Latin-1 and others might be UTF-8; so what to do? Well, we can convert everything to UTF-8, which will be fine, except that it will break things that want everything to be in Latin-1.


I think we're going to make a switch of some kind to tell MP3::Info to convert everything to UTF-8. Bah, again, I say!

MacPerl, 5.6.2, and Thomas Wegner

| | Comments (0)
Thomas wrote me today and said "hey, I rewrote the MacPerl built-in editor, you want it?" Yes, yes, I do.

I think our plan will be to release MacPerl 5.6.1 soon (a few weeks tops), and then put together MacPerl 5.6.2[ab]1, which will include the new editor stuff, along with any other new features we may deem appropriate. Bugfixes will go into 5.6.1 after that, but any new work will go into 5.6.2. Hopefully when perl 5.8.0 is released, perl 5.6.2 (a maintenance release) will be finalized and we'll release MacPerl 5.6.2 with the new editor.

Then work will commence on 5.8.0, which might get spread out over more time than it needs, but there's no rush; we just got 5.6.1/2 done! :-) 5.8.0 should require a lot less work. Soon I hope to do some more test builds of it and see if there's any real big issue to iron out.

This is a test

| | Comments (0)
Please ignore it. I am testing the new SOAP interface for journals, where I can do this:

#!/usr/bin/perl -w
use strict;
use HTTP::Cookies;
use SOAP::Lite;
my $host        = '';
my $uri         = "http://$host/Journal";
my $proxy       = "http://$host/";
my $cookie_file = "$ENV{HOME}Netscape Users:Chris Nandor:MagicCookie";
# first line is subject
chomp(my $subject = <>);
my $text = join '', <>;
(my $newtext = $text) =~ s/\n/\012/g;  # Local to Unix newlines
my $cookie_jar  = HTTP::Cookies::Netscape->new;
$cookie_jar->load($ cookie_file);
my $journal = SOAP::Lite->uri($uri)
                        ->proxy($proxy, cookie_jar => $cookie_jar);
$journal->add_entry($subject, $newtext);
# print text back to original window
print $subject, "\n", $text;


A Day in September

| | Comments (0)
I watched A Day in September on HBO this weekend. It's a 1999 documentary about the terrorist attack at the 1972 Munich Olympics. I am sitting here shocked at how the Germans botched the operation.

Worst Police Operation Ever.

They were going to ambush the room where everyone was being held, but didn't realize that they were being televised live while in preparations, and that there were TVs in each athletes' room. En route to the airport, the terrorists saw armed people running to hide, tipping them off. They discovered en route that there were eight terrorists instead of four or five, and had no way to let the people at the airport know of the change in intelligence. They had only five snipers, and the snipers, when they started firing, were dreadfully ineffective, and were positioned in each others' line of fire. A German officer in a building was killed with a stray bullet.

One German sniper, caught in the line of fire, shot only when a terrorist was heading right for him, and after he fired, additional Germans came up and, not knowing the locations of the men, mistook the sniper and a hiding helicopter pilot for terrorists and seriously wounded the both of them.

Over in the airplane there were German officers disguised as a flight crew. They unanimously abandoned the mission minutes before the terrorists and hostages arrived, because they felt it was a suicide mission. That's one of the worst things I've ever heard.

That is, at least, until the one remaining terrorist -- only three survived, and they were released by Germany after a plane was hijacked a few weeks later, and Israel hunted down and killed two of the survivors -- admitted in the documentary that the German government set up the whole hijacking to allow them to save face and hide evidence about how bad they botched the whole operation. And to top it all off, the German government returned the bodies of the killed terrorists to Libya, where they received a hero's welcome. I'd have had their bodies burned and flushed down the toilet, soon to be followed by their three executed brethren who survived their mission.

One great line from the documentary: "The operation disproved the long-standing myth of German ruthlessness and efficiency."

The living terrorist, Jamal Al Gashey, spoke on camera (in a shadow) and said he is proud of what he did, all for the Palestinian cause. He currently lives in Africa somewhere with his wife and children (maybe we can call all of Africa harborers of terrorists? ;-). He made me recall a scene I'd seen on TV from the new Schwarzanegger movie, Collateral Damage. The terrorist says to Arnold, "we're alike, you and me," or something just as typical. "We both kill for a cause. What makes you think we are not the same?" My immediate thought, recalling the Israelis who killed the Palestinian terrorists, was, "Because I'm only going to kill you." Which is what Arnold said moments later.


| | Comments (0)
I heard DirecTV redid their web site, so I went to check it out, and it was much better than before; I created an account and logged in and saw that it showed how much I owed them, what channels I get, etc. I also saw that I could go from Total Choice to Total Choice Plus and get like 15 extra channels (half of them Discovery Channels, plus History International, Biography Channel, PBS Kids, VH1 Classic, and a few more) for only $2 more per month.

So I modified my account and hit "accept these changes" and changed the channel to VH1 Classic immediately and there it was! The Who singing something or other! I know I shouldn't be, but I am quite impressed that hitting a button on a web site can so quickly affect what signals the little box under my TV will give to me.


| | Comments (0)
# I use this to put the current track I am listening to
# on; each time a new MP3 is selected, it sends
# an HTTP request to which calls a perl script
# to update the current track there.  Essentially, this
# just tells the site "this is the track info for the
# just-requested track".

package Apache::MP3::Log;

use strict;
use vars qw(@ISA $VERSION);
use Apache::Constants qw(DECLINED);
use Date::Format;
use LWP::Simple;
use MP3::Info;
use Socket;
use Apache::MP3::Resample;

@ISA = 'Apache::MP3::Resample';
$VERSION = 1.0;

sub stream {
    my $self = shift;
    my $r = $self->r;

    return DECLINED unless -e $r->filename;
    # only my IPs for now ... maybe do by cookie/username later
    $self->log_mp3 if $r->connection->remote_ip =~ /^10\.0\.1\.(?:132|107|177|108|109)$/;

sub log_mp3 {
    my $self = shift;
    my $r = $self->r;

    my $tag = get_mp3tag($r->filename) or return;
    my $url = $self->stream_base . $r->uri . '?stream=1';
    $url  =~ s/%/%25/g;
    $url  =~ s/ /%20/g;
    $url  =~ s/&/%26/g;
    $url  =~ s/;/%3B/g;

    my $data = join "%%", @{$tag}{'TITLE', 'ALBUM', 'ARTIST'},
        $url, strftime("%C", @{[localtime]});
    $data =~ s/[\015\012]+//g;
    $data =~ s/%/%25/g;
    $data =~ s/&/%26/g;
    $data =~ s/;/%3B/g;

    my $get;
    my $foo = 0;
    eval {
        local $SIG{ALRM} = sub { die "oops!" };
        alarm 10;

        $get = get("$data");
        $foo = 1;

    alarm 0;


MacPerl 5.6.1b4

| | Comments (0)
It's released, no major bugs remain, I'm going to bed soon.


| | Comments (0)
Shuck wasn't working on pre-8.6 Mac OS machines because they kinda messed up with FetchFontInfo in earlier OSes, and I needed to weak-link InterfaceLib while compiling. Yay. Thanks to Marco Piovanelli the WASTE guy and Thomas Wegner the Shuck guy.

MacPerl 5.6.1b4 Is Close

| | Comments (0)
Every outstanding show-stopping bug and task for a MacPerl 5.6.1 release is CLOSED. ALL OF THEM. I still have some cleanup things to take care of, and hopefully b4, a release candidate, will be out tomorrow evening. Then we'll wait a few weeks, and release 5.6.1r1, and I will have achieved my goal of releasing MacPerl 5.6.1 before my daughter is born!

LWCE Day Three

| | Comments (0)
Day Three, woke up, cleaned up room, checked out. The hotel had this soul CD in the room that was pretty relaxing, and I thought Oh, Cool, I get a free CD out of this. Then I saw the sticker: $13 to keep the CD. So I ripped it.

I went over to the OSDN booth and found no wireless access. So I found another wireless network and used that. Then I got tired of stealing things and we got the nice men from to set up a hub and some static IPs. But the public computer we had set up had no RJ-45 connection I could find, just 802.11 card. So I set up my extra PowerBook instead.

I saw Penth, for the first time since TPC was in Monterey, I think. She stopped by on her way to the .org Pavilion (where .org's, non-commercial groups, set up small booths).

I went and hung out with the crew in the speaker's lounge, having some rice pilaf (no pictures of it, sorry!) and getting a copy of the Slash book. I then went to Brian Aker's talk on how Slashdot & MySQL scaled together, which was quite interesting, even for me, who knows most of the story already. After the talk, Brian rushed to the airport and I went back to the OSDN room again, where I checked mail, downloaded The Perl Review (which I read on the train) and helped clean up the room a bit.

After awhile, with most everything being taken down, I wandered over to the Compaq pinball table (some Harley Davidson game) and proceeded to score 36 million points on my first ball. A guy walked up and bragged that he had a high score of 96 million, so I decided to best him. I scored another 30-something million on my second ball, and was up to 86 million total with my third ball when the power went out. In the words of Charlie Brown: AUGH!

I took a cab over to Penn Station and stood around for an hour, got on the train, and read The Perl Review, watched Tron, and went home.

LWCE Day Two

| | Comments (0)
Day Two was a bit better than Day One, because I did a lot less travelling.

Being sedentary is good.

So the day started as it should, going over to the OSDN meeting room for free food and net access. Then I hung out most of the rest of the day, eating, talking to people, and taking pictures. I was amazed at how different this was from a Perl conference; very little technical content, everything was about business, and the form of the booths was far more impressive than the content of the booths.

I did see the Perforce booth and told them that I use Perforce, at which point they responded, "really?" They said they were coming out with a Mac OS GUI for Perforce at some point (I didn't ask, but I would assume Carbon-based?) and they gave me a free balsa wood airplane, the only really good swag I snagged.

In the afternoon I sat in on a couple of sessions, including ESR's Vaudeville Act, something about moving Windows to Linux. I got a bit frightened and went over to Jeff Bates and some other people talking about a demographic study of users, which was interesting.

Then I went to the hotel and hung out for a bit before having dinner with Fmh at the Palm. Nice big expensive steaks, and I stuck him with the bill. Awwwwww yeah.
<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Archive

This page is a archive of entries in the Computers category from February 2002.

Computers: January 2002 is the previous archive.

Computers: March 2002 is the next archive.

Find recent content on the main index or look in the archives to find all content.