Warwalking in my neighborhood

Most evenings, Diane and I take a walk through the neighborhood, but she couldn’t go tonight, so I went out on my own. I got bored pretty quickly and took out my iPhone, and just for curiosity, put it on the page where it’s looking for WiFi networks.

There were, as you might expect, dozens; I was pleased to find that most weren’t wide open, and only a few were named “linksys”. But there were other amusing SSIDs to be found: “StayOffMyNet” (locked), and “god” (wide-open), to name but two.

As I said, I got bored pretty easily….

First programming language?

A reader (and friend) writes:

My nearly 17-year-old daughter is starting to be more and more curious about what it is that I
*DO*, and computers and stuff. Which leads us to the perennial question:

What programming language should beginners be exposed to first – this
year? Just to give them a basic notion about programming concepts – not
to get them a job.

I’m completely stumped. I live in a world of C and C++ and Java and
Perl and more recently Ada – yes, Ada – from which I am unlikely to
escape.

Is Python the answer? Or ??? I can’t imagine that any of the languages
I listed above is a candidate. Pascal is irrelevant these days. Logo
(“turtle graphics”) were cute 20 years ago. What is it now? Something
simple to grasp but that isn’t too limiting.

Curious what your ideas are.

…S

My first programming language was Fortran on an IBM 1620; I decided that wasn’t a reasonable recommendation, despite the availablility of an 1620 emulator (I had to drive 5 miles each way uphill in the snow to get to the computer).

Instead, I answered thusly:

I, of course, am still partial to Rexx, but I don’t think it’s a good beginner’s language any more, because you can’t do “interesting” things in it (like make GUIs happen, or manipulate other programs, or do things on the web). And, to be honest, I haven’t written anything in Rexx in a few years and don’t even bother to install it any more.

So my suggestions would be Python or Ruby.

Python, because it’s got a very clean syntax (as long as you don’t mind that indentation is syntactically significant), because it is just object-oriented enough (and these days, I think starting with an OO language is the right answer), and because there are packages available that let you do damn near anything (though I still haven’t gotten around to writing anything GUI….). The documentation is pretty good, and there are at least two decent books to start with (Learning Python and Dive Into Python, which is also available free online).

Ruby, because all the Cool Kids are using it (especially with Rails). It has much too much syntax for my taste, and there’s often More Than One Way To Do It, which you may consider to be good or bad. I haven’t really gotten into Ruby or Rails yet, because I haven’t had a real good use case, though that may change.

Other languages to think about:

PHP, the language of WordPress and MediaWiki. There’s even a book, PHP For Teens, which might be interesting from a target audience perspective. OTOH, PHP’s natural habitat is in creating server-based apps, and that might not be ideal.

Java, just because. I’ve been able to avoid it so far, but the time has come for me to get my feet wet there, so I can vouch for Head First Java as a good introductory book.

And one of my colleagues here suggests JavaScript — you can write it and play with it right in your browser and get instant gratification.

Both S. and I are interested in your thoughts on this…comment away!

Installing MySQLdb on Mac OS X 10.4.8

I’m in the process of deleting duplicate copies of photos from my system in the interest of saving disk space (320MB just isn’t all that much when one is playing with video!). I’ve used find and md5 to build a list of all the .jpg files on my system with their hashes, and wrote some simple Python code to find duplicates. The problem now is to choose the best one of the duplicates (“best” in this case means the one with the most useful file and directory name). But my code just creates a pile of small files, one for each set of identical photos. This is a pain.

So I decided to install MySQL so that I could crawl through the duplicates in some interesting manner (yes, I did have wine with dinner tonight. Why do you ask?). The install of MySQL itself was trivial, but trying to install the Python binding (MySQLdb) was a pain. The important tip came from a posting on Jeremy Dunck’s blog — I was using gcc 3.3, and needed gcc 4. His posting explained what to do; I did it, and now I’m all set.

Now I have to actually put the data into the database and do something with it — that’s a problem for another evening, though….

That’s not crashing, it’s thrashing

Much to my surprise, I am now the proud owner of a 300GB backup drive for my Mac Mini.

The story started earlier this week, when I decided to get back to the project of digitizing our Hi-8 tapes before they (or the camcorder) gave up the ghost. So I fired up iMovie and copied the first tape that came to hand.

Except that I’d forgotten to rewind it, so there was a 13-minute segment that was dubbed. No problem; I rewound the tape and copied that part, too. But then I wanted to move the clips into the proper order so I wouldn’t have to remember what I’d done when I finally got around to editing.

Again, no problem. Until I tried saving the rearranged file. The progress bar zipped along for a few seconds, then came to a complete halt (with the spinning beachball in place of the cursor). And I heard a ticking noise from the disk. And the noise continued. And the progress bar didn’t move. And the app was unresponsive to the “Cancel” button.

So I rebooted and tried again. Same results. I even downloaded smartmontools, only to discover that they don’t work against an external Firewire-attached drive. I did wonder how I was able to do the download and compile while the disk was having problems, but it was getting late, so I turned everything off for the night, including my brain. That was Wednesday.

Thursday, I stopped at CompUSA on the way home and picked up the special of the day, a Maxtor 300GB drive (which, for reasons best known to Maxtor, came with a 20GB “bonus”, making it 320GB). I put it in my external USB drive case (which I’d bought in the course of recovering a failed disk on a TiVo) and went to work.

I’d done some research, hoping to find a way to recover the bad sector on my old drive, and there didn’t seem to be one — but The X Lab suggested it would be a good idea to “zero” the new disk before using it, so that the system would find and bypass any bad sectors on the drive. So I started that process and went to sleep.

This morning, I fired up SuperDuper, as recommended at UNEASYsilence, to copy the old disk to the new one. Then I went off to work. When I returned, the copy had finished, so I swapped the new drive into the miniStack; it booted, and I was back in business — back to iMovie to continue where I left off.

When I went to save the movie, the same thing happened. Except this time, the ticking was quieter. And it finally hit me: copying 22GB takes a long time. And the progress bar in iMovie doesn’t reflect the amount of data moved, just the number of clips touched. And I almost certainly didn’t have any bad sectors on my old disk — it was just doing a lot of seeking.

Oh, well; I needed a place to take backups anyway.

But next time, I’ll make sure to rewind the tape before I copy it.