Monthly ArchiveDecember 2004



Python 30 Dec 2004 01:26 pm

Good company…

It turns out that Sam Gentile is learning Python as well.

Personal 30 Dec 2004 01:13 pm

South-East Asia Earthquake and Tsunami - HOW TO HELP

Visit http://tsunamihelp.blogspot.com/. This site has lots of information on the best ways to help, regardless of where you are. It also has links to information sources, list of people missing and found, and to relief organizations. Post comments there (not here) if you have any new information or wish to help in some way.

Python 27 Dec 2004 04:53 pm

Forging ahead

As I mentioned previously, Programming Python is indeed not quite the book I was expecting it to be. After reading roughly 100 pages, I find that it delves for too long on subjects that are not quite related to Python (it spends an awful lot of pages in the os and sys modules, for example) and does not include any kind of introduction to novice programmers (on code formatting issues, for example, or lambda functions; this is assumed to be already known).

So, I’m taking a detour and moving on to the Python tutorial, which can be found online at python.org and in the standard distribution files. I’ll go back to the book afterwards…

Python 24 Dec 2004 11:36 am

So you want to be a Python programmer…

A few weeks ago, I started working on implementing a new print server at work, with a new quota control system. The old one was a made-at-home collection of scripts and text files, and lacked a few features we’d like to have. After some research, we settled on LPRng with Pykota. LPRng was simple enough to set up (although its interaction with Solaris print services is a little weird at times), but Pykota didn’t like our printers (mostly HP LaserJets of various models and ages) too much.

By the grace of open source code, I could fix the problems, of course. Which I did, and sent the patched code (with fixes and a new feature) back to the developer (my changes are now part of the default distribution). The funny thing is, Pykota is written entirely in Python, and I’d never programmed in Python before. I had heard mostly good things about the language, and was impressed by (1) how easy it is to do “complicated” things in it, such as talking to a database server and to printers using PJL and SNMP, and (2) how easy the code is to understand, such that even a Python beginner can make useful modifications without breaking anything.

So I decided I wanted to learn more about the language, and perhaps to start to do real stuff with it. With this spirit, I went to the library and picked up “Programming Python”, a 1000+ page tome of which I’ve already read… 20. I was expecting something very much like “Programming Perl”, but it’s a different type of book. For one thing, it expects you to know how to program in Python. I guess the book I should be reading is “Learning Python” instead, but the library didn’t have that one. For now, I’ll go on with this and blog about my progress. With some luck, after the holidays break, I’ll be able to write something in Python from scratch!

Random 22 Dec 2004 04:39 pm

207 days to go…

…until the next Harry Potter book is published.

But, “Harry Potter and the Half-Blood Prince”? I doubt anyone out there likes the title.

Tech 16 Dec 2004 03:42 pm

Rant of the day - changing IP address

Many years ago, I remember that everyone used to complain that, in order to change the IP address of a Windows NT server, you had to reboot the server. It is, I agree, stupid, as this is the kind of thing you can acomplish in a Linux server with a couple of ifconfigs and the occasional restart of the odd daemon that does not handle the change well. But this has been fixed, and it’s now very quick and easy to change the IP address of any computer running any Microsoft OS relased after 2000.

So, when I had to change the IP address of a Mac server in late 2004 (earlier this week, to be more precise), I did not expect it to be very hard. After all, Macs are easy to use, right? Well, almost. It turns out that, if you run OS X 10.2.x and the “Permanent IP address” option was selected during the server setup, you’re out of luck: when it says “permanent”, it means it. The only “official” way of changing the IP address is by reinstalling the server (note that I am talking about a Mac OS X server, not a regular desktop machine). Yes, reinstalling, not rebooting.

As Donald Trump would say, very disappointing. Very, very disappointing. And I couldn’t simply fire the server, unfortunately. So I decided to ignore what Apple said and try anyway. It almost worked: the server kept trying to talk to itself on its old address, and a few minutes after rebooting it deteriorated so much that you couldn’t start new applications any more. And “ls -l” didn’t work at all (”ls” without the “-l” did work).

Since there was nothing visible in the server configuration pointing to the old address, I did a large “grep” and found a binary file under /private/var/db with a mention to it. I bravely used vi to edit the file, changed the address, rebooted… and it worked!

After all of this, we found out that Apple makes available a script to change the IP address of a Mac server. It’s a shell script that asks you for all the information (including the old IP address and netmask, which it should be able to get from the server configuration) and does everything. It seems to work very well, so, if you need to do it, I recommend this process instead of the massive grep. But the manual way is more satisfying.

Tech 14 Dec 2004 02:10 pm

Code Room

Forget The Apprentice or The Rebel Billionaire. The reality show of choice for software developers is The Code Room:

In an inner-city warehouse sits a laptop and a few partially charged batteries. Three developers are taken to The Code Room [...] and asked to design and develop an e-commerce Web site.

Yes, it’s produced by Microsoft, and it’s completely .Net-centric, but it’s fun to watch, and it’s a nice twist on those “business” reality show that are starting to become ubiquitous.

Random 14 Dec 2004 12:46 pm

Words…

Isn’t it funny how a new word you learn suddenly starts to pop up everywhere after the first time you see it?

Not being a native English speaker, I pay attention to new words I see, and even (occasionally) look them up. Because of that, I see this phenomenon on a regular basis. For example: about a year ago, I first saw the verb gallivant in a “word a day” calendar someone gave me. I don’t think I’ve ever seen the word used before this. Within two weeks, I saw the word used twice in the book I was reading at the time (it was Silicon Boys, by the way), and I’ve heard or read it occasionally since.

And, being in Australia and being mostly used to the US brand of English, I’m exposed to new words quite frequently. One of those is “bowser”, which here is the word that refers to what Americans would call a gas pump (and “gas” in the sense of “car fuel” is called “petrol” here, by the way). The word was in most news reports about a week ago due to a government problem not really worth mentioning and, despite it referring to a somewhat common object, I didn’t know what it meant at the time (it was very easy to guess from the usage, of course). Within two days the same word showed up in a mailing list I subscribe to, in a completely different context.

I know that this happens, probably, because you are more “tuned” to new words you’ve just learned, and you tend to notice it more when they are used again. It is still a very strange feeling when it happens, though.

Australia 03 Dec 2004 10:05 am

Right hand, meet left hand

Best possible example of “right hand doesn’t know what the left hand is doing”:

Autistic boy featured in Govt calendar facing deportation

A 12-year-old boy chosen by the Federal Government to appear in a calendar marking the International Day of People with Disabilities is apparently facing deportation from Australia because he is disabled.

more

It would be ironic if it weren’t sad…