Archive for October, 2005

Ubuntu Linux: Success!

1

Well, it’s less than 2 hours later, and I’ve gone from downloading Ubuntu to having a pretty decent setup, including a normal working desktop with the correct resolution and all of the blog related software (apache, php, wordpress, mysql) up and running. Very happy so far. Seems to have much better / easier availability of packages than Redhat.

I went with Apache 2 even though my gut was telling me to stay with 1.3 . I’ll probably flip the switch tomorrow and have the blog hosted by the new box. Now, time to sleep.

Trying Ubuntu Linux

0

Funny how one worn out screw can lead to a wasted day and a fresh install of a new linux distribution…

I’m trying to move my blog from this old server to my fancier new one. The new one has been sitting around for several months doing nothing, but the only reason I’m moving is the old one is very loud. The fact that it’s old and slow doesn’t bother me, the loudness does.

First thought: put the disk from the old into the new. Path of least pain.

Turns out of the 4 screws holding the old drive onto the old frame, one is completely worn out and will not unscrew despite 20 minutes of effort.

So to install things on the new server. Pain.

I had already installed Redhat Fedora Core 3 on the new server, messed around with a few things, so I thought it’d go smoothly. Not so.

The Apache that comes with FC3 will not work for me, can’t recall why. So I install Apache from source. Joy. Oops, I’ll need PHP. That doesn’t want to quite work. Great.

Finally I get it working. Now just to get MySQL up and running…

I mysqldump from the old server, but it will not import into the MySQL on the new server. Turns out Redhat ships with MySQL 3.x, and I’m using 4.x on the old server. Given that MySQL 5.0 just came out, I’m not into sticking with 3.x, so I attempt to upgrade.

Redhat official RPMs seem to be old version, so I download RPMs from mysql.com . Installs fine after ignoring dependencies, but will not run, will not report any error. Starts, immediately ends.

All of this is driving the point home that this Redhat distro is really quite screwed up. I shouldn’t have to be doing any of this; Apache, PHP, and MySQL should all be magically up and running with reasonably new versions with no effort on my part. I’ve been getting more fed up with Redhat each time I use it, including the annoying little things like it insisting on going to Gnome even though I asked it not to install and requested KDE…

There you have it. I’m downloading Ubuntu Linux with hopes that it’ll work magically. Will let you know how it goes.

XML Masters Class at XML Conf 2005

0

I’ve been asked to participate in the XML Masters Series Class at XML Conf 2005. The speaker presents a real world implementation and a panel of experts comments. Should be fun. Hope to see you there.

Web 2.0: Fastest Backlash Ever?

1

It seems like barely yesterday that Web 2.0 was born. Tim did his diagram. The conference happend. The VCs flocked in. Web 2.0 got included in every VC pitch.

Then it went sour. Actually it went sour much earlier for Dare. But now Joel is taking it to the mat:

The term Web 2.0 particularly bugs me. It’s not a real concept. It has no meaning. It’s a big, vague, nebulous cloud of pure architectural nothingness. When people use the term Web 2.0, I always feel a little bit stupider for the rest of the day.

Nice. If Joel don’t like it, it’s officially over.

Anyway, it happened so fast I mostly missed it. Had intended to go to the conference, got busy, didn’t go. Had intended to do a mashup, got busy, now everybody and their grandma has one.

Meanwhile, there are a lot of cool things. Flickr. Upcoming. Google Maps. Web 2.0, like AJAX, seems like a meme that got way overhyped but actually does produce good things.

Blogging via Sidekick II From the Train

1

How fancy is this? I’m on the train to San Diego, having an IM conversation with a friend in London and blogging this entry from my Sidekick II. This thing is very usable.

If it had storage, the ability to dock to a full size keyboard and monitor, and better native handling of excel/word/ppt documents, I could live without the laptop on many trips.

Referrer Spam: Trying Referrer Karma

0

Got sick of referrer spam – I’m getting over 1000 referrer spam hits per day, which screws up stats pretty bad. So I’m trying Referrer Karma. Hopefully this thing will work well. I’m worried about false positives, too lazy to think of a good way to test. If you see strangeness, let me know.

Nova, Mirror Neurons, and Jeff Hawkins

0

I’m watching an episode of Nova that talks about mirror neurons. In short, they’ve discovered that the same neurons fire when you’re doing something as when you’re watching somebody do the same thing. They’re calling these mirror neurons.

Thinking along the lines of Jeff Hawkin’s On Intelligence, it occurs to me that these are not mirror neurons. They’re simply neurons. Jeff talks about the brain being in large part associative memory, with the same neurons activating when you experience something (input comes from the outside world) as when you do something (you take action). Successive layers take signals to more and more abstract concepts, and vice versa.

It follows that the same neurons in the middle layers would activate when you do something as when you watch something, since the abstract concept is the same. There are your mirror neurons – they’re just normal neurons.

Any case, go read the book, it’s an excellent framework for thinking about the brain and intelligence.

C++ is a brutally effective demagogue?

0

I don’t necessarily agree, but I enjoyed the quote:

Programming in C feels like debating a political opponent whose views are sharply opposed to mine, but who is entirely forthright about his beliefs and integrates them into a consistent philosophical framework. Programming in C++ is like facing off with a brutally effective demagogue who has defeated every challenger the opposition can throw at him over a long career, but has never really taken an honest position on anything, and has only keen opportunism where a philosophy should be.

http://www.gwydiondylan.org/pipermail/gd-hackers/2005-October/005574.html

Calmest Ocean I’ve Ever Seen

0

The ocean is as calm today as I’ve ever seen it. Even the few waves that break do so grudgingly, slowly, holding on to their foam for fear of disturbing some unknown giant.

It’s flat pool. The small ripples make it look like the continuation of the beach sand into a vast desert. It’s eery.

Ruby On Rails from Ruby

0

Nice slide show from Sam Ruby on Ruby on Rails (no relation). I really gotta try this out one of these days. I even got the book and project lined up, now to get off my behind…

Speaking at XML Conf 2005, Nov 16th

1

My talk got accepted to XML Conference and Expo 2005, coming up in November in Atlanta. The talk is:

XML, REST, and SOAP at Yahoo
Track: Late Breaking News
Audience: High Level/Technical View
This session will discuss the uses of XML at Yahoo Search Marketing, including REST and SOAP based APIs, and the challenges of large scale, high performance systems.

Let me know if you’re going to be there and want to chat. tdarugar at yahoo dot com .

Mandatory Perl/Python

3

I’ve contended that a good computer science degree should focus primarily on science and algorithms, and only secondarily on specific languages and tools. I’d like to modify my position: hands-on experience with at least one scripting language should be mandatory.

Here’s why: students are invariably required to learn one low level language, C/C++ or these days Java. These languages bring with them a set of assumptions that get baked into the student’s impressionable young mind: Strong typing. Specific (as opposed to generic) data structures. Complied code.

The students then take the computer languages course and learn about all the crazy alternatives people tried along the way: Lisp, prolog, fortran, etc. Bad ideas fallen by the wayside.

Thus the students will graduate with a bias toward low level, compiled, strongly typed languages. Not just because that’s the only thing they know, but also because they’re led to believe this is the Right Way.

Now good programmers are lazy. They’ll find scripting by themselves because it’s faster and easier, makes them better programmers, significantly more productive.

Lately, however, I’ve come to notice just how many smart young programmers don’t know scripting. It’s been quite a suprise.

So I chatted with a few of them.

Part of it is just momentum: I know Java, it works fine, why do I need to learn another language?

But the other part, the harmful part, is the unexamined assumption that scripting languages are less capable, less powerful, less “enterprise”, less Good.

The typical first response I’ll get is, “but scripting languages are not strongly typed. Who’ll catch my type casting errors?”

Ok, let’s examine that. Do you really make type casting errors? Really? If you’ve been doing this for even a little while, your programming muscle memory is trained not to make those mistakes.

The real point is that type information is not enough to be a useful error catching tool. Most of your effort will go into understanding what the required argument is. Not its type, but what are valid values. It’s the semantics, not the type. If I told you the second argument of some function is a string you’d be able to compile against it, but you’d have to know what that string represents to do anything useful. Semantics.

On the other hand, look at how much easier life is with duck typing. If the programming language assumes you’re smart instead of trying to protect you against your own stupidity, and if you’re actually smart, you can get things done a lot faster. And if you’re stupid strong typing isn’t going to help you anyway.

The best way to get convinced of the power of duck typing is to try it. Write some scripting code. It won’t take long to feel the power of the handcuffs coming off your hands.

Another strength of scripting is the generic data structure: everything is a hash table.

Turns out you can represent the vast majority of useful things as hash tables. Because you can put arrays, other hash tables, anything you want into those hash tables.

There’s a discipline of mind that comes from thinking of everything as a hash. I’ve found this is the polar opposite of the RDBMS fiends. Sure, you can throw anything into a database, but do you really need to? How about a hash? Did you try the hash? It’s free. It’s fast. It’s part of the language. How ’bout that hash table? Did you realize a hash provides a natural partitioning of you data in case you need to scale beyond one box? Did you know a hash doesn’t require a DBA?

Then you have the compile assumption. Nobody actually likes compiling, but without scripting people assume it’s a fact of life. It’s not. Scripting languages just run. No compile. Say goodbye to your makefile. Squash that ant.

But scripting is not enterprise! It’s not maintainable! It’s slow! It’s for small minded people who couldn’t be bothered to learn a Proper Programming Language!

Scripting is enterprise my friends. Much of the backbone of business is written in Perl. Each time you do a credit card transaction chances are high a piece of Perl code gets tickled along the way. When you search for airline reservations you’re touching scripting. It’s everywhere. I’ll claim (without actual proof) that a lot more of the “enterprise” runs on scripting (usually Perl) than on Java. The rest of it is mainframe.

The maintainability knock, on the other hand, is deserved. There’s a lot of ugly Perl code out there. The obfuscated Perl contest doesn’t help.

Yes, you can definitely write ugly code in Perl. Most people do.

But you can also not write ugly code. Just don’t do the ugly stuff. Write it so that a C programmer can understand it. Don’t allow the fancy ugly stuff. You CAN do this with style guides and rules.

Or just use Python. It’s pretty. It’s well indented. Heck, it’s even object oriented. Ooooh.

Maintainability comes from good design and from having few lines of code. Good design can be applied to scripting languages as well as it can to low level. Scripting has the advantage in lines of code.

But scripting language are so slow. They just won’t scale.

There are applications that require raw speed. No doubt about it. Write those in C. If you’re thinking of writing them in Java, realize that you can get comparable or better speed with a moderm scripting language.

Real speed comes from the design of your algorithm. The next concern is typically scalability: can I throw more boxes at it and have it go faster? Both of these have little to do with the choice of your programming language.

Let’s drag good old 80/20 out of the close for this next part. Most programs spend most of their time in a couple of tight loops. If you optimize those loops your program goes a lot faster.

The thing to realize is that scripting is setup perfectly to allow this optimization. Write your program, find the 80% loop, and rewrite just that part in C. It’s quite easy to wrap C/C++ and expose it as a command in a scripting language. Now you have a program in a high level language that’s also blazingly fast.

That’s not the speed to worry about anyway. These days the speed of writing the application is the real key. If you can get your application to market faster than the competition, enhance it faster, add features faster, you win. Scripting wins here hands down. There are studies out there, but I suggest you try it. Pick a sample app. Write it in Java and time how long it takes. Now pick up a book on Python. Go ahead: start your timer, drive to the store, pick up the book, come back, grab a sandwich, have a nice read. Now write it in Python. Stop the timer. It still took less time than doing it in Java.

But scripting? That’s so below me. I’m very smart. Any idiot can do scripting. I’m a Java guy.

Right.

Being a 10x programmer is about producing good apps fast. A tool that doesn’t hinder good design and gets you there faster is a good tool. Some of smartest people out there use even goofier languages like Lisp. Don’t be afraid. You don’t get to be Enterprise because some marketing guy told you this is Java Enterprise Edition.

Everyone I know who’s actually tried scripting ends up using it. Not necessarily for most of what they do, but at least for some of what they do. There’s nothing to be afraid of. It’s an excellent tool in your arsenal. It challenges some of your assumptions. It teaches you different ways of thinking. It’s a good thing. Go learn one. I don’t care which one; Python is the one I’d recommend right now, but do Perl if you like, Ruby if you prefer, or even Tcl if you’re old skool. But definitely go learn one.

Oracle Buys Innobase (MySQL engine)

0

Jeremy reports that Oracle has purchased Innobase, the company that makes one of the popular storage engines for MySQL. Interesting. This could mean bad things for MySQL…

A Different Way to Do Music

0

I’m listening to Under Mi Sensi Beenie Man by Barrington Levy. How I got there is the interesting part.

I was thinking of the Bush Don’t Like Black People remix, which got me in the mood to listen to Kanye West’s Gold Digger. I’m using Yahoo Music Unlimited, so I searched for the title and hit play. The Kanye song played, followed by an entirely different song of the same name by Jimmy Cliff. So now I’m listening to Reggae. Cool. I hit the Play Artist Fan Station button, and I got to Barrington Levy and now Burning Spear (Hail H.I.M.).

This is a great way to explore. It’s very different from the physical experience of going to the record store, even at a good record store. I was reading this morning that Ameoba is a great place to hang out and experience music, and I can believe that, but this is fundamentally different, better and more efficient in finding new music to listen to. It’s also better than listening to the radio. Better than downloading music from P2P.

Having just about all the music out there at your fingertips with no effort and a wise hand to guide your way is amazingly great. In keeping with my core Cheap Bastard mentality, I’d have never paid for a service like Yahoo Music Unlimited because I believed I could always get whatever I want to listen to for free, or that I had more than enough to listen to already. Now that I’m using the service (I got it for free btw), I realize it’s very worthwhile even for a cheap bastard like me.

Now I’m listening to Thievery Corporation. Neat.