rc3.org

Strong opinions, weakly held

Month: June 2007 (page 5 of 5)

Zero day tracks

The fact that Paul McCartney’s new album, Memory Almost Full is available from emusic.com in DRM-free MP3 format on the day of its release feels like a very big deal to me.

The PHP encapsulation problem

I was working on a small project this week that reminded me again of PHP’s fatal flaw, which is that it is nearly impossible to maintain encapsulation to prevent components of a system from screwing each other up. We have a Web site that uses a big, popular, open source PHP application. The home page of the site loads up some components of the system and displays some information. I had written a tiny application to enable users to maintain one small section of the home page. My application’s involvement with the home page consisted of one function and one callout to the function to display its return value. The function was basically this:

function getQuote() { $my_db = mysql_connect(“host”, “user”, “password”); mysql_select_db(“my_db”, $my_db);

// Query the database, grab a value, and return it. }

My code worked fine, but the mysql_select_db call blew up the other application. As far as I can tell, everything I did should live within the local namespace of my function and shouldn’t affect anything else on the page. To fix the problem, I wound up writing my function using mysqli. I’m not sure if that worked because mysqli provides better encapsulation or because the rest of the application uses the old style MySQL functions and the newer mysqli stuff doesn’t conflict with it.

Aside from the pain in dealing with problems like this, I think that PHP’s lack of clean encapsulation is probably what makes many PHP applications tend toward chaos as they grow.

The BradLands turns nine

Congratulations, Brad, on your ninth blog anniversary. I hold a special affection for all of the pre-twenty-first century blogs.

New OS, old problems

One problem I had under Fedora Core 4 was that occasionally, some memory-leaking process would eventually use up all of the server’s swap space, and the server would stop responding to everything but ping. I’d have to send in a reboot request and wait for the next hang. This evening, the same thing happened again, despite the fact that I’m running a new OS, new version of Apache, new version of PHP, new version of MySQL, etc, etc. Any ideas on how I can set up monitoring to make sure this doesn’t happen again?

Gene Spafford on computer science education

Gene Spafford explains the goals of computer science education as opposed to just teaching someone to program:

We don’t produce programmers. Anyone can learn programming — all they need to do is buy “C for Dummies” and they can learn to program. But that isn’t learning fundamentals. For instance, ask people who know how to program to write a sort routine and they can do it, although the results may not be pretty — or efficient. But task people with a good CS education — who have had some background in algorithms, big “O” complexity, and data structures — and they should ask about input data set sizes, whether identical key sorting needs to be non-destructive, whether the set is pre-ordered, and whether the sort needs to be inplace or not. That may be obvious to you, but non-obvious to someone who hasn’t been exposed to the science in computer science.

He makes me wish I’d actually studied computer science.

The skinny on Apple’s DRM-free tracks

It’s been widely reported that the name and email address of the person who purchased the tracks is embedded in both DRM-protected and DRM-free iTunes Music Store tracks. The EFF has found evidence pointing to the fact that the files may contain a lot more identifying information as well. I’m not necessarily opposed to keeping identifying information about the purchaser in the tracks, but I am curious about what else Apple is stuffing into them.

Anti-globalization riots in Germany

Der Spiegel has a slideshow of photos of the anti-globalization riots in Rostock, Germany. I look at the rioters and see a bunch of people looking for an excuse to throw rocks at the police. It’s a shame that their antics distract from and discredit (in the eyes of most) the causes that the peaceful protesters are marching for.

Stephen O’Grady’s giant Google Gears Q & A

Stephen O’Grady has written one of his patented Q & A pieces about Google Gears. Here’s his summary of the Google Gears’ guts:

Gisting this down, you essentially have a local web server (which one, does anyone know?) that serves cached content out of a SQLite database, with a threading mechanism that ensures that abnormally strenuous tasks – say, downloading and caching several thousand email messages – doesn’t bring your browser down while it waits. It’s pretty straightforward, actually.

Tim Bray on conservatives

Tim Bray has this to say about the state of conservatives in America:

I had come to think, in mid-life, that while I will never really be conservative, there are smart honorable people on that side who have good points to make. That may be true outside the United States, but in the American context, near as I can tell, at the moment “conservative” means “pro-torture” which means “scum”.

I don’t think that’s correct, but I can understand how it seem that way.

Steve Ballmer is a peach

What does Steve Ballmer have to say about Microsoft’s early employees, the ones that built the juggernaut that has made him one of the world’s richest men? Scott Rosenberg reports:

Mossberg: “What, it was small but ossified?”

Ballmer: “The people we had weren’t as good — they just weren’t pushing as much.”

Mossberg: “Like Paul Allen?”

Ballmer: “Paul was good. Bill was good. Four out of 30 were good — and believe me, the rest are gone.”

Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑