Tao of the Machine

Programming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.

Poking around in referrer logs

My own, that is. Beware... the PSU is everywhere.

People use all kinds of browsers. This includes the more obscure ones, like Konqueror and Galeon. I didn't run statistics on the referrer log yet, it would be interesting to see the distribution. Maybe in a follow-up post, eh?

Same for news aggregators. I saw NetNewsWire, AmphetaDesk, Straw, Syndirella, NewsGator, Effnews... Apparently some people use home-made scripts as well, Python-urllib shows up often. The Googlebot paid a visit too.

Quite a few people come in through http://mechanicalcat.net/pyblagg.html. Many hits for the RSS file.

Search engine queries that somehow lead to me:

  • q=spyce+exit%28%29
  • search?p=Tao+of+the+machine
  • q=spiderzoid -- Somebody searched for a Spiderzoid?
  • q=aikido+movies+mpeg -- ?!
  • p=2003+dutch+guess+book -- I wonder what a "Dutch guess book" is.
  • q=gameboy+advance+zoids+roms
  • query=vellum%20machine -- This could be good. Search for one blogging tool, find another. :-)
  • q=view-pdf+safari+mac-os-x -- Not sure why I would show up here...
  • q=crossroads+twilight+spoilers+mat+tuon -- I did review Crossroads of Twilight.
  • q=%22Robert+Jordan%22+%22twilight%22+%22nothing+happens%22 -- Indeed, nothing happens.
  • q=hans+nowak -- Somebody must have been looking for me. :)
There's more stuff, some queries for Jython and Swing, Delphi, Magic the Gathering, etc. Either I end up surprisingly high on those queries, or people just go to page 10 or so.

Some unsuccessful hacking attempts as well. By ip67-93-167-210.z167-93-67.customer.algx.net, for example. And port0230-cvx-carl1.cwjamaica.com. Ya mon, where is the time that Jamaicans lounged in the sun with a big spliff? These days they apparently have other interests... :-)

Posted by Hans Nowak on 2003-02-14 17:45:19   {link}
Categories: general

Other languages

My search for the Perfect Language (whatever that may be ;-) never ends. Ever since I hit the Internet (and even before that, with limited resources) I have been checking out different programming languages. Many of them offer interesting paradigms. The fact that I am doing most of my coding in Python these days, doesn't change this.

In the 1990s, my main language was Pascal. As I was looking around, I discovered Python, and slowly it started replacing Pascal as my language of choice. I suppose one day the same could happen to Python. However, there's a difference. With Python, I don't really have the feeling that the language gets in my way, and that it could use a lot of improvement. As opposed to Pascal which eventually got in my way quite often (and still does, when I have to use Delphi). The keyword here is flexibility.

Lately I've been liking Lisp more and more. It's stunningly elegant (and Scheme probably even more so than Common Lisp), but there are two major reasons I don't use it, not even for experimenting or small programs and the like. First, I don't like deeply nested expressions (and it's really hard to write a Lisp program without these). Second, it doesn't offer enough syntactic clues to my (admittedly untrained) eye. My internal parser just sees Lisp code as

(name name (name name) (name (name name)))
whereas a Python program has visible clues to what's going on. Not just by indentation, but also by the trailing colon (although some people think it's not necessary), operators, etc.

Lisp's strength (syntax and s-expressions) is also its weakness. Until I can overcome the objections mentioned above, I will not (be able to) use it. (I suspect many people feel this way.) Maybe that moment will never come. Until then, Python suits me just fine.

Posted by Hans Nowak on 2003-02-13 17:29:59   {link}
Categories: programming, Python

PyCon keynote

According to the schedule, the keynote speaker for PyCon is Paul Graham. Am I the only one who thinks this is a surprising choice? I mean, the man is competent enough and all that, but he's not a Pythonista. In fact, besides being a Lisp guru and advocate, he's mostly known in the Python community for articles like this (suggesting that Python is a kind of immature Lisp; rebuttal here), or this.

I wonder what the keynote will be about. Is he going to tell the audience that Python is cool, because it's almost a Lisp? :-)

(I have nothing against Paul Graham by the way... in fact, I recently bought his book ANSI Common Lisp, which I can heartily recommend.)

(Update. I just discovered that a new article is online. Why nerds are unpopular. Hmm...)

Posted by Hans Nowak on 2003-02-13 16:14:45   {link}
Categories: Python

Jussumlynx

Ten links that might tickle your fancy.
  1. Python programmers weblogs. Everybody already knows this site, of course.
  2. Hackles. Like User Friendly, but with animals.
  3. The original text of H.G. Wells' The Time Machine, via Project Gutenberg.
  4. Toriyama's World. This site has lots of mangas online.
  5. Selected Quenya vocabulary.
  6. The Ruthless Rap Assassins online. (Downloads page has Kiss AMC stuff as well.)
  7. The Phoenix browser for Mac OS X.
  8. Bored and too much time to spoil? (Takes a while to load...)
  9. A few Google tips & tricks.
  10. Trouw, a Dutch newspaper.

In other news, I've been working on Firedrop today... Developing a GUI without a GUI builder isn't easy. >_< Especially dialogs are a pain in wxPython. I don't recall having that much trouble with my Tkinter dialogs in Kaa. I probably still have a lot to learn though.

Anyway, the progress is slow and steady. I rehashed the serializing mechanism (which is laughably simple, by the way, but it works for my purposes). You can now add sections and empty nodes (entries), but not much more. There's lots more to do.

Time to get Kaa 0.9 out the door, before Firedrop makes it obsolete. :-)

Posted by Hans Nowak on 2003-02-12 22:42:37   {link}
Categories: general, Firedrop

These are sad times for c.l.py

I had not read the newsgroup for two days or so... so I return to find, oh, around a 1000 new messages. Guess what most of them are about...

If Guido's "cunning plan" was to drown out all other threads from people who may actually have valid or interesting questions, then it succeeded very well.

Worse, people who used to be rational thinkers seem now ready to accept (or reject) just about any proposal. I posted a mock-proposal, a hideous cross of ternary-like stuff and a syntax like the join() method. Now I actually get mail from people who say, "I like it, too bad it doesn't do short-circuiting"...

Lisp is starting to look better and better.

Posted by Hans Nowak on 2003-02-11 13:06:29   {link}
Categories: Python

Short progress report

Firedrop development advances slowly. In fact, large parts of it are still in the design phase... so a working prototype is not to be expected soon. I am still trying to figure out how it will work...

I did design the GUI, though, and made sure that 1) the GUI is separated from the business logic, and 2) other GUI front-ends can be written without much hassle.

In fact, the program contains several layers:

A: the lowest level, the database (FDB). (The database doesn't know anything about business logic.)

B: one level higher is the Firedrop class. Rules and stuff are located here. It calls the database to make it do higher-level things, like creating a database (plus metadata and default settings), etc. This class does interact with the user in any way.

C: one level above that is the Mediator class. As the name indicates, it functions as an intermediary between the toplevel (user actions via the GUI, really) and the lower levels (Firedrop class). This class does interact with the user, in a *generic* and *GUI-independent* way. For example, opening a new database would call mediator.ask_directory(), where the user gets to select a directory; then the appropriate Firedrop method is called with the directory name as a parameter.

D: the highest level is the GUI itself, or really the main frame. This is of course not GUI-independent. The current version, for example, uses wxPython.

How can class C (the Mediator) be GUI-independent? Easy: each GUI defines a GUIActions class, defining some common actions: selecting a file, putting text in the statusbar, showing an error dialog, etc. The Mediator gets an instance of this class, enabling it to call its methods (and thus use GUI-specific code while keeping a GUI-independent interface itself). You can define a wxGUIActions class, SwingGUIActions, etc. As long as their interfaces are consistent, the Mediator can use them.

I like to see Firedrop on the Mac, so maybe I will write a Swing/Jython front-end, eventually. But for now it's more than enough work to get things going on Windows.

Posted by Hans Nowak on 2003-02-10 23:24:39   {link}
Categories: Firedrop

Macking

Being a digitreuzel, I only installed Mac OS 10.2 (Jaguar) a few weeks ago. (Under the assumption that by now, most interesting packages would be out for 10.2. Little did I know... ;-) Anyway, there's lots of stuff to explore. Sherlock 3.5, for example.

Many things have changed. It's become a much more useful tool, something that I actually might use for more than just locating files on my harddisk. Take, for instance, the Ebay section. You type a search term, and you get a nice list of matching auctions. Select an auction to get more info, complete with a picture and clickable links if you want to place a bid. (What, Hammerrock for $41?! Ridiculous!)

It could use a few more options though... for example, is there a place where I can see (and maybe copy) the URL of the auction I'm looking at? I don't see it. You have to click on a link to open a browser window with the actual URL. Also, I'd like to see more information... the number of bids really isn't interesting to me, but an indication if I could "buy it now" would be. Third, it doesn't show all the auctions (just the top N or so, I assume). Hmm, maybe in a future version...

Searching on the Internet doesn't work so great. The list of "content providers" doesn't include Google, and it shows. Search for 'python', hit #6 finds the Euphoria programming language. (To be fair, hit #1 leads you to www.python.org.) A search for 'python programming' is more like it. Still, this is not an acceptable replacement for Google.

Picture search is nice. Searching for 'imac' yields what I want to see. Still, a picture search at Google is more powerful. :-/

Movies is also interesting. You type your zip code, a list of movies appears. Click on the movie to see a description, picture, Quicktime preview, and names of movie theaters where it plays.

Yellow Pages seems cool, but doesn't provide all the information it should. It failed my first test, finding our local Pizza Hut (which has been there for years). It does find lots of them in Gainesville, though. In fact, it doesn't seem to find *any* stores in our town. Granted, it isn't very large, but neither are some of the other towns that do show up in the list. (Correction: it does find Hitchcocks. :-) On the plus side, the map and the driving directions are a nice touch.

All in all, this is a nice tool, but it doesn't beat going to the real websites (that Sherlock uses underneath).

Posted by Hans Nowak on 2003-02-10 21:16:23   {link}
Categories: switch

The Time Machine

I don't normally watch a lot of movies, much less review them. Friday we rented Signs and The Time Machine, though, and the latter deserves a few words.

The Time Machine is, of course, made after the book with the same title by H.G. Wells. If you haven't read the book, this may be an OK movie. Not great, but acceptable, with nice special effects. However, if you did read the book, and expect the movie to be like it, you're in for an unpleasant surprise. It's nothing like the book *at all*. If someone had only read the back cover of the novel and decided to make a movie from it, it would probably be more true to the original text than this flick. Of all the reviews I've read, none pointed this out (probably because they didn't bother to read the book :-).

The main storyline is roughly as expected. A scientist develops a time machine and travels far into the future, 800,000 years from now, and humankind has split into two races, one of which feeds on the other. That's about all that is the same as the book. What is different? Let's see...

When I was a kid and read the (translation of the) book, I found the concept of time travelling fascinating. These days, that is not enough anymore, though. The main character has to have a more mundane reason for inventing the time machine, rather than just investigating time travel "for the heck of it", like one review said it. His fiancee is introduced (doesn't appear in the book at all), he proposes to her, she gets killed by a thug, and this prompts him to invent the time machine to go back in time and prevent the fatal event from happening. (Once he tries this, it doesn't work, and he travels into the future to find out the answer to the question why the past cannot be changed.)

So off to the future we go. Before we reach the future 800,000 years from now, we get some glimpses of the more near future, with more stuff that doesn't happen in the book: the moon collapses, talking hologram like in A.I., etc. Once we're in the future world, there are two races, Eloi and Morlock. The names are the same, but that's about it. The movie's Eloi are not tiny, fragile, blonde and airheaded, but a normal-sized tribe of aborigine-like people. The Morlocks do live underground, but they are more like apes, and very strong, rather than spidery and weak. They don't seem very intelligent, in spite of having some heavy industries below the surface.

There are too many differences to name. Weena is replaced by Mara, an Eloi woman who has to be rescued from the Morlocks. She doesn't perish in the burning woods. The Morlocks don't sabotage the time machine, making it difficult for the time traveller to get home. What's more, the time machine is used to blow up the Morlocks; the traveller doesn't even get home. Etc, etc.

Now, there is such a thing as "artist's impression", and not everything in a book can be well expressed in a movie. They're different media. The Lord of the Rings movie plots are not the same as the books, for example. But at least the LotR movies stick to the general storyline most of the time, have many of the same characters, and more importantly stay in the spirit of the Tolkien books. None of this applies to The Time Machine.

The book was very much a product of its time. The movie is that even more, though, something which is not flattering to our times. Good special effects but no substance, cheap attempts to be politically correct, and storyline twists to appease a bored and not very intelligent target audience. Like I said, I suppose it can be amusing if you've never read the book; because unlike the book, all the movie is is entertainment.

Posted by Hans Nowak on 2003-02-10 10:36:30   {link}
Categories: general

How to troll comp.lang.python

<0.5 wink>

Lots of arguing on c.l.py about the ternary operator. Some people even came with mock PEPs to indicate what they think about this. This discussion has come up before, so everybody knows people are divided about this feature, to say the least. In spite of that, this PEP is created *and* thrown in the newsgroup with a call for votes. Well, at least it gets some traffic going...

Personally, I don't like the proposal. It's just not readable, the order is wrong, it's easily abused, it's not necessary, etc. Writing a little function should take care of most use cases, like this:

response = iif(condition, "approved", "not approved")
It's trivial to write such a function. What's that you say? It evaluates both possibilities? Damn straight it does, and in case of side effects
deposited = iif(condition, account.deposit(100), account.deny())
a proper if statement should be used instead. As Laura Creighton pointed out, control flow should have indentation.

Let's hope this thing gets rejected soon and more sensible PEPs are written.

Posted by Hans Nowak on 2003-02-08 15:02:08   {link}
Categories: Python

--
Generated by Firedrop2.