Solipsism Gradient

Rainer Brockerhoff’s blog

Browsing Posts published in April, 2004

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>

Matt Gemmell has posted source code for a trick to stroke inside a NSBezierPath. The default stroke lies on the path’s boundary, which generates some awkward situations with sharp corners.

We came up with this during a long and fruitful discussion of options (via iChat) for Matt’s upcoming Pie Chart control for Cocoa. Watch that space…

Update: forgot to say that there’s more good Cocoa source on this page. Enjoy.

I was going to post some follow-ups to my MP3Concept “trojan” comments tody but it turns out John “Daring Fireball” Gruber already did it very nicely for me. (The only fault I can find in his article is that he didn’t link to me icon_wink.gif… oh well, can’t have everything.

Meanwhile, it’s interesting to read Symantec’s security response on the subject. This may be the closest a company that sells antivirus software may come to saying “don’t worry about this”.

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