Solipsism Gradient

Rainer Brockerhoff’s blog

Preparations for the upcoming Europe/UK trip are being pursued in fits and starts. One fit happened yesterday and today when the tourist agency that is brokering our Russian visas (visae? visii?) phoned asking for my foreign resident’s registration number. While reading the number over the phone my eye strayed to the expiration date and noticed (picture a momentary pupil double-take here) that my foreigner’s ID card will expire on May 11th, 2004.

Now, I certainly have looked at that date hundreds of times over the past 9 years; the card was dated 1995; but I had somehow gotten used to it always being aeons in the future. A quick phone call to the Federal Police, who handle this sort of thing here in Brazil, was initially disquieting: it seems the Feds were (yet again) striking for better salaries and nobody would be able to take care of my problem until some vague future date.

Needlees to say, I could certainly travel out of the country with no problem using just my EU passport but getting properly readmitted later without a valid ID card – which is the only way I can demonstrate that I’m a permanent resident – would be somewhere between tricky and impossible. So, after some heated questioning of the lady who answers the Fed’s phone, we established that:

1) She was just substituting for the normal information lady, who was out on strike, so she couldn’t give us reliable information;

2) A skeleton crew of analogous substitutes would probably be on duty today, certainly in the morning and possibly also later;

3) Her boss had just said they would probably be able to give me some document certifying that it wasn’t my fault that they couldn’t give me the official document in time for my trip. Heh.

So, today early in the morning, off I went to the Federal Police building, presciently armed with a 40GB iPod, a thick paperback which I had just begun rereading (Greg Bear’s excellent Eon), several 3x4cm pictures of yours truly, and several documents which I supposed they might request.

It turned out that, despite the strike, normal activities were being supported by the substitute crews, so after an half-hour wait I had the chance to talk to an actual live substitute federal bureaucrat. My ID photos were deemed acceptable. I had merely to procure an authenticated photocopy of my expiring ID, pay a small processing fee of about US$23, fill out a form and return everything before 2 PM. The fee had to be paid at a bank some miles away, using a form that had to be purchased at a nearby store, and the photocopy had to be authenticated by a devilish Brazilian institution called “Cartório”, which I’m currently unable to describe more detailedly due to advice from my cardiologist.

Anyway, a few hours of standing in line later (that’s what I had iPod and book with me for, after all) I was back at the substitute bureaucrat’s counter. He was away at the moment but the helpful s.b. at the next counter volunteered to look at my papers. “Hah, that’s all wrong! The processing fee is a different value and we’ll need your passport, too! Who told you to do this?” When I pointed out the offending s.b’s counter, he advised me to wait for that person to return, which he did somewhat later, being immediately buttonholed by his neighbor.

After a hasty conference, my s.b. turned to me and apologized, saying that he was, after all, just a substitute bureaucrat and confessing that he had inadvertently quoted me the wrong processing fee. I was able to make a convincingly outraged face at his suggestion that I return to the bank to pay the correct amount and get restitution of the previous payment; he then helpfully offered to take care of this for me if I would give him the balance due in cash.

Although his suggestion sounded somewhat fishy, I said that I might consider if it the balance were not too large; how much would that be, anyway? He started stabbing away at a calculator and finally vanished into the inner sanctum for several minutes of consultation with his boss – an action which he would repeat a few times later. Thankfully, he returned with the information that the boss had considered the balance insignificant and no extra payment would be necessary. Hm. I forebore to repeat the neighboring s.b’s mention of a passport, as I didn’t have mine with me in any case – it was hundreds of miles away, at the Russian embassy in São Paulo, in any case – and nobody mentioned it afterward again, so there.

Next the s.b. informed me that I would have to wait until after 2PM, when the substitute fingerprinting expert would make his entrance. My weak reference to a huge sign that stated the office’s operating hours to be 9AM to 2PM was brushed aside with yet another invocation of the strike’s pervasive effects, so… at exactly 2PM I was back.

Nobody at the counter. I plugged the iPod in again and opened up my paperback – I was at page 286 by now. At last, my s.b. appeared and again took my reams of paperwork for examination. He pointed at some missing fields on the all-important form, which related to my arrival in Brazil in 1953; things such as the original passport number and other immigration details. I protested that I did not have that information anymore; after all, that was nearly 51 years ago and I had come in as family baggage, so to speak. He vanished once again and returned with a printout of my personal data from the database, where most of the missing information had been miraculously preserved, and asked me to copy it to the form. Purely for form’s sake, I presume.

Next an apprentice substitute bureaucrat (or perhaps a substitute apprentice bureaucrat?) was detailed to guide me through various corridors and elevators to be fingerprinted. Interestingly, two metal detectors were driven into a frenzy of beeping by my passage – I suppose carrying an iPod and a digital camera will do that normally – but neither of the s.b’s on duty nor my guide paid attention. I then was fingerprinted by yet another s.b. using the standard infernal sticky black ink – all ten fingers separately on one side of the form, thumbs on the other side, finger groupings below that, and finally the right thumb (again, reinked) in a separate field in the middle of the form.

I asked if they still hadn’t any better way of doing this, and the s.b. proudly pointed at a complex machine standing in the middle of the room, about the size of an ATM: “oh, now we have this modern laser-driven fingerprint scanner!” And why, then, did we just go through a classic sticky-black-ink procedure? “Ah well, this particular form hasn’t been updated for it yet, sorry.” I was then directed to the men’s room to clean off the ink. No soap or paper towels were available, although after some minutes of searching I managed to convince a passing cleaning lady to fetch some for me from the ladies’ room.

Back I went to my original s.b’s counter… more scrutiny of my papers… more consulting the boss… more copying of code numbers onto the form… and finally, after pasting my ID photos as well as several preprinted barcodes on the form, he tore off a small strip and gave it to me. “Present this and the photocopy at immigration and everything will be fine; your new ID will be sent to you as soon as possible.”

OK! What a relief… and when will it be ready, anyway? Perhaps in time for my trip, even? “Ah no! Count on at least two months!”… icon_lol.gif

CodePoetry and a bunch of others are pointing at this very long and interesting rant about developing for the Mac, by drunkenbatman.

It’s way too long to justify quoting any part of it; if you’re developing for the Mac, you must go read it (and the comments, too). I disagree with some of the conclusions – especially regarding Java and .NET – and the style is a little grating; I for one wouldn’t use slang like “prolly” outside of an informal e-mail or chat. Still, very recommended.

A new site, iTunes per iPod, poses the following calculation: Apple sold 60 million tunes and 2.9 million iPods (as of April 15th). Therefore, the average iPod contains 21 purchased tunes. They, then, ask:

For perspective, the smallest iPods hold 1,000 songs, and some hold 10,000 songs. So, when people fill up those iPods, where does all the music come from?

They then proceed to speculate that a very significant amount of the typical iPod’s spare capacity is taken by illegal music downloads, and pitch for the Voluntary Collective Licensing system – which looks interesting but very un-RIAA-like.

Theirs would be a valid calculation if iPod sales were, like the iTunes music store, restricted to the US. However, that is clearly not the case. Slightly over 50% of Apple’s sales in the recent 3 years are outside the US and, although no exact figures are released, there’s no reason to suppose that iPod sales outside the US would be anomalously low. Neither is it valid to suppose that all iPod users are automatically interested in using the iTMS as their normal method of buying music. Supposing that 50% of iPods are sold in the area where the iTMS now operates, and that 10% of the iPod users are also significant iTMS users, we get a more reasonable amount of 400 songs per iTMS user’s iPod.

Also, most people have significant amounts of CDs in their collections that would be ripped to the iPods anyway. Let’s suppose the average iPod user has 200 CDs he’s interested in; that would mean around 2,000 tunes per iPod, 2400 on iTMS user’s iPods.

Checking out my own iPod I have slightly over 3000 tunes, nearly all of which come from either my own CD collection or my old LP collection, of which I’ve ripped but a fraction. Should iTMS become available in Brazil, would I stop buying CDs and switch over to the iTMS? Not really.

First of all, the average CD price in Brazil is somewhat adapted to the reduced buying power – about R$20, which comes out to US$7 or so, and you can find less expensive albums too. So the iTMS would be a resource to substitute expensive import CDs or rare items not usually found here. I doubt that Apple will be able to set regional prices lower than their standard $0.99 per tune. So, I foresee the iTMS becoming a hit in Europe, where CDs are very expensive, but not in the Third World.

There’s a comprehensive list of iPod stuff over at the iPodlounge. Quite a lot of items; some are good for a chuckle, such as the ProClip, which is described as “small, neat, and descreat”. 🙂

After nearly a year with my 40GB iPod I’m quite satisfied. I have ripped most of my CDs onto it, and I’m now starting on my extensive old collection of vinyl records, most of which haven’t been reissued on CDs, unfortunately.

There are some small issues, though. To my surprise, battery life isn’t one of them. My normal usage pattern may not be typical in that regard; I leave the dock and power supply connected to my home sound system, and leave the iPod charging most of the time. When I leave home I hook the iPod onto my belt and in the car I connect it with a short cable to a $35 car stereo I bought solely for that purpose. Sound quality isn’t great but then a car isn’t a noise-free environment either. Anyway, I rarely let the battery discharge entirely and so far have noticed no capacity decrease.

Unfortunately, the standard belt case for the iPod is bulky and cumbersome. Except for jogging, where you can place it in the back, the thing is heavy and keeps snagging on things… I can see the rationale for getting a mini, now. So I hit upon the trick of placing it into a pocket (without the case), which also conveniently removes it from sight for added security. However, last month I noticed that the cable insulation broke at the point where it comes out of the remote control plug. So, with some regret, I’ve started using the case again, after winding the break with some stiff tape to keep it from getting worse…

I suppose if the cable came out of the plug at a 90-degree angle, as it does on the Engineered Audio Remote, this wouldn’t have happened. Alternatively, someone should make a special slim “pocket case” with a curved duct to prevent strain on the cable. I wonder how much Apple’s design of the remote control is tied to American-style clothing.

Travels

No comments

In less than a month we’ll be off again to Europe, this time on a trip to the UK and a cruise on the Baltic Sea, visiting the Scandinavian capitals and St. Petersburg (ex-Leningrad).

I’ve seized the occasion and surrendered, somewhat belatedly, to the “travel map” meme that swept the net a few months ago. Here’s my current worldwide travel status, courtesy of World66:

Here are the detail maps, for Europe:

for American states:

and for Canadian provinces:

I haven’t counted states or countries where I didn’t leave the airport, of course. More details later…

Everyday Hackers

No comments

Rael Dornfest points out this article:

If you think all ”hackers” are computer criminals, think again: A new generation is reclaiming a creative, do-it-yourself approach to everything from home electronics to home improvements.

…The spread of hacker culture is very much related to the spread of technology, which now pervades almost every aspect of life. Among techsters, hackers are the good guys, as opposed to the malevolent cybercriminals to whom they refer as ”crackers.”

…Said (Rael) Dornfest: ”The difference between a hacker and consumer is a consumer says, ‘I wish it would work this way.’ A hacker says, ‘I’ve got a screwdriver and a few minutes.’ “

Well worth the read.

Needless to say, I’m solidly behind this definition, being a screwdriver/soldering iron/whatnot-wielding practitioner since early childhood.

Traditionally the first program one sees or writes in a new computer language is the “Hello, world” program: a simple program that simply prints out, or sends, or extrudes, the string “Hello, world” through the most convenient interface. For instance, in PHP this would look like:

<?php echo "Hello, world"; ?>

For contrast, check out this cautionary counterexample of writing a “Hello, world” program using POSA (Pattern-Oriented Software Architecture):

<?php
/********************************************************************
Model-View-Controller implementation according to POSA
(Pattern-Oriented Software Architecture
  http://www.hillside.net/patterns/books/Siemens/book.html)
********************************************************************/
class HelloWorldController {
    private $model;
    function __construct($model) {
        $this->model = $model;
    }
    function handleEvent($args) {
        $this->model->setStrategy($args[2]);
        $this->model->addText($args[1]);
    }
}
class HelloWorldModel {
    private $text;
    private $observers = array();
    private $strategy;

    function attach($observer) {
        $this->observers[] = $observer;
    }
    function getData() {
        $facade = new HelloWorldFacade($this->strategy);
        return $facade->getHelloWorld().$this->text."\n";
    }
    function addText($text='') {
        $this->text = $text;
        $this->notify();
    }
    function setStrategy($strategy) {
        $this->strategy = $strategy;
    }

    function notify() {
        foreach ($this->observers as $observer) {
            $observer->update();
        }
    }
}
class HelloWorldView {
    private $model;
    function initialize($model) {
        $this->model = $model;
        $model->attach($this);
        return $this->makeController();
    }
    function makeController() {
        return new HelloWorldController($this->model);
    }
    function update() {
        $this->display();
    }
    function display() {
        echo $this->model->getData();
    }
}
/*********************************************************************
"Business logic"
********************************************************************/
class HelloWorld {
   function execute() {
       return "Hello world";
   }
}
class HelloWorldDecorator {
   private $helloworld;
   function __construct($helloworld) {
       $this->helloworld = $helloworld;
   }
   function execute() {
       return $this->helloworld->execute();
   }
}
abstract class HelloWorldEmphasisStrategy {
    abstract function emphasize($string);
}
class HelloWorldBangEmphasisStrategy extends HelloWorldEmphasisStrategy {
    function emphasize($string) {
       return $string."!";
    }
}
class HelloWorldRepetitionEmphasisStrategy extends HelloWorldEmphasisStrategy {
    function emphasize($string) {
       return $string." and ".$string." again";
    }
}
class HelloWorldEmphasizer extends HelloWorldDecorator {
   private $strategy;
   function HelloWorldEmphasizer($helloworld,$strategy) {
       $this->strategy = $strategy;
       parent::__construct($helloworld);
   }
   function execute() {
       $string = parent::execute();
       return $this->strategy->emphasize($string);
   }
}
class HelloWorldStrategyFactory {
    static function make($type) {
        if ($type == 'repetition') return self::makeRepetitionStrategy();
        return self::makeBangStrategy();
    }
    static function makeBangStrategy() {
        return new HelloWorldBangEmphasisStrategy;
    }
    static function makeRepetitionStrategy() {
        return new HelloWorldRepetitionEmphasisStrategy;
    }
}
class HelloWorldFormatter extends HelloWorldDecorator {
   function execute() {
       $string = parent::execute();
       return $string."\n";
   }
}
class HelloWorldFacade {
    private $strategy;
    function __construct($strategyType) {
        $this->strategy = HelloWorldStrategyFactory::make($strategyType);
    }
    function getHelloWorld() {
        $formatter = new HelloWorldFormatter(
                new HelloWorldEmphasizer(
                    new HelloWorld,$this->strategy));
        return $formatter->execute();
    }
}
$model = new HelloWorldModel;
$view = new HelloWorldView;
$controller = $view->initialize($model);
$controller->handleEvent($_SERVER['argv']);
?>

I couldn’t resist quoting the whole code. The sharp-eyed observer will notice that the actual string is generated at the beginning of the “business logic” part and the rest is just handwaving. This quote from the author is also irresistible:
…And the program works. In spite of its deadness, it executes and produces a result. You might say it’s like one of those severed frog’s legs that twitch when you apply current.
This reminds me of a program I had occasion to look over recently; a friend wrote it as his final assignment for Java certification.
It exhibited all of the same symptoms: elegant formatting; repetition of dozens of function with slight variations in names and one or two lines in the body; frequent referral to buzzwords like model, controller, strategy, and so forth; complete obscurity of actual function. Indeed, I can’t recall what its ostensive purpose was, beyond making sure that the examiner understood that the writer had a thorough grasp of orthodox design patterns.
Space precludes going into details now, expect a longer rant later about the subject… 😉

No comment

No comments
<p>You are an
obsessed
quiz-taker

Find out what kind of quiz-taker you are</p>

Photos licensed by Creative Commons license. Unless otherwise noted, content © 2002-2025 by Rainer Brockerhoff.
Iravan child theme by Rainer Brockerhoff, based on Arjuna-X, a WordPress Theme by SRS Solutions. jQuery UI based on Aristo.