Bloated OS

Anyone who thinks OSX is bloated should read this:

Microsoft is expected to recommend that the “average” Longhorn PC feature a dual-core CPU running at 4 to 6GHz; a minimum of 2 gigs of RAM; up to a terabyte of storage; a 1 Gbit, built-in, Ethernet-wired port and an 802.11g wireless link; and a graphics processor that runs three times faster than those on the market today.

Taming the x86 beast

This is why I always disliked PCs, not for any religious or ideological reasons. I always thought the x86 instruction set was the ugliest thing ever.

If you’ve never had the pleasure of programming an x86-family processor in assembly language, you don’t know pain. The 32-bit x86 chips (including the ‘386, ‘486, and Pentium-class parts from Intel and AMD) do an amazing job of dragging one of the world’s oldest processor designs into the modern age. They do it while still maintaining binary compatibility with chips that are three generations and 15 years behind. It’s impressive, really, but it makes these chips tricky to program with low-level code.

Since the discussion forum has gotten into a question of evolution and popularity, I thought I’d pop in with the parallel universe of assembly language. IMHO, x86 assembly language is far inferior to many of the other alternatives. Yet, the biggest target cpu is the x86.

The only upside, I suppose, is that Intel managed to single handedly destroy the art of hand crafted assembly. The vacuum being filled in by C. The problem with the popular choices is not just restricted to higher level languages (and that’s not even getting into the question of Operating Systems). [Lambda the Ultimate]

Some PHP fun

Since shareyourmusic.com and worldbeatplanet.com now point to the same host and share the same installation of Drupal, the stand-alone script “feedback.php” on both hosts is the same. Since it isn’t part of Drupal, it didn’t know about the two different sites.

I just added a test (eregi("worldbeatplanet.com",$_SERVER["HTTP_HOST"])) to set some display variables according to the host name, so it will look completely different (and send the feedback to a different address) depending on which hostname it’s run from.

I’m also using a variation of that same script (which I partially ripped off from PHP-Nuke’s feedback module) for the contact form at this site.

Going back in time

I’m now changing my Mac OS 9 code to use pre-Carbon APIs since some features I need to use aren’t available in Carbon.

Fun with SQL

The Drupal version of WorldBeatPlanet is shaping up very nicely. Rather than using the song & review modules, I’m using a taxonomy to select song lyrics or reviews. I defined a required vocabulary with the terms story, lyrics, and review. To find all items of a specific type, I use the following SQL query:


SELECT n.nid, n.title
FROM node n
LEFT JOIN term_node t ON ( n.nid = t.nid )
LEFT JOIN term_data d ON ( t.tid = d.tid )
WHERE ( d.name = "lyrics" )

OOPS!

I just fixed a bug in my drupal tune module so registered users can now actually upload their tunes to shareyourmusic.com.

It turns out that I had the acccess hook declared as: function tune_access(), which is how it was in the original file module, when it should have been: function tune_access($op, $node)

The result of that was only an administrator could upload tunes, not a regular user, even though upload access was allowed.

w00t!!! File uploads work!!

For the past few days I learned how to write a Drupal module so I can support file uploads & downloads at shareyourmusic.com. I finally figured out why it wasn’t working.

The _form hook changed at some point. According to the documentation, it should be

function my_form(&$node, &$help, &$error)

After looking through the source code, I determined that it was actually being invoked as:

my_form(&$node, &$error, &$param)

In order to support file uploads, I had to add an option to $param specifying enctype=multipart/form-data. Once I got that straightened out, my module was able to properly locate the uploaded file. This was the biggest hurdle that kept me from opening the site.

Moving to a new host

I just signed up for a new account at PEHosting for ShareYourMusic.com. The site at 1and1 is dead. It keeps getting internal server errors and is often unable to connect to the database, which is running on a separate host.

I just took the latest Drupal from CVS and I’ll be working with that version, since it adds some features I need. I hope to get it running on the new host in another day or so, depending on the name server change.