Tao of the MachineProgramming, Python, my projects, card games, books, music, Zoids, bettas, manga, cool stuff, and whatever comes to mind.
Last 10 archives
:: About me
:: Oasis Digital
I would get a .py domain name, but they're $240, and require local presence. Oh well.
Yesterday's technology tomorrow
"Tomorrow's technology today. [...] And I suddenly realized that is the exact opposite of what I want. I don't want tomorrow's technology today. I want yesterday's technology tomorrow. I want old things that have stood the test of time and are designed to last so that I will still be able to use them tomorrow. I don't want tomorrow's untested and bug-ridden ideas for fancy new junk made available today because although they're not ready for prime time the company has to hustle them out because it's been six months since the last big new product announcement. Call me old-fashioned, but I want stuff that works."
The blog post goes on with a few examples: WordPerfect, Adobe Acrobat Reader, etc. Yes, I agree, it does appear that for a lot of commercial software, every upgrade is really a downgrade... it adds a lot of features you don't need, often removes features you did need, and takes more memory and hard disk space.
Acrobat Reader 6 is a good example. A few months ago, my version 5 somehow broke, so I went to the Adobe site for the latest version, which was 6. Turns out it's quite a bit slower than its predecessor, especially when starting, when it loads all this stuff that I don't need. It also changed the "find" feature, and changed some keys around, apparently arbitrarily (e.g. Ctrl+N, to go to a page number, is now Shift+Ctrl+N).
Operating systems are another, very obvious, example. Upgrading from Windows 2000 to XP gives you a few useful features and a lot of bloat, some of which is eye candy that slows the computer down. Since I got my first PC in 1991, I've needed a new one every two years, because by then it would be too slow, incapable of running the latest software, lacking in memory and hard disk space, etc. Back in the day, a new computer at least got you some real improvements: better graphics (CGA -> EGA -> VGA -> SVGA), better sound (PC speaker -> Sound Blaster), memory above the 640K limit. These days, what are the improvements? Sure, a faster processor and more memory/disk space is always nice, but aside from that it will just be the same old stuff. 3D cards? I don't need or like them, and think it's ridiculous that anno 2004 you need one to play an adventure game.
It is developments like these that sometimes make me highly dissatisfied and make me want a Mac, an SGI or an Amiga. Or make me want to go back to the time of the command line.
On the other hand, there are some benefits as well. Interpreted languages like Python have become valid tools for mainstream programming projects. That wouldn't have been possible on memory-starving, slow machines. And ironically, I can play Broken Sword 1 on the GBA emulator, because modern PCs are powerful enough to support such a thing. Bloated software wants more memory and faster processors, but has the unintended side effect of paving the way for dynamic programming languages, emulators and other niceties.
So I guess I'll just install the older versions of some software (while they still work) and enjoy some of the positive side effects of bloated software without actually using it.
Adventures in writing adventures
AMK writes about interactive fiction with Python. " In text adventures, usually every single object is unique, so it's a minor irritation that you have to write classes and then instantiate the class. It would be better if you could automatically instantiate each class."
Yes, I noticed this too. A while ago, I came to the conclusion that straight OO may not be right for writing adventure games. Sure, it *seems* like a great match. You have objects for things, people/creatures, rooms, and maybe other stuff like mechanisms. An object's properties can easily be stored in attributes:
Except that it doesn't work all that well in practice. The problem mentioned by Andrew is just one out of many. It seems kind of redundant to have a class and an instance. Also, if you go for the
Of course, it's not *impossible* to write an adventure in Python using OO, far from it; it's just less convenient than it could be. A few ideas for ways around it:
Idea #1: Use classes, and classes only. Make all methods classmethods, all attributes class attributes. Would this work in real life? No clue. One obvious drawback is that you'll have to define the methods the usual way, *then* make them classmethods.
Idea #2: Self-style objects. This would work (assuming my code is correct, it was just something to play around with), but has an obvious drawback as well: you'll need to add methods on the fly. Something like this:
def window_open(self): if self.open: print "The window is already open, you dork." else: self.open = 1 print "You open the window." # 'window' is a Self-like object window.open = window_open
Both ways seem kind of unpythonic.
Lately I have been tinkering with a system that uses a mixture of OO and procedural/functional style. Some ideas:
painting.get_response = "Who would want an ugly painting like that?!" # when doing "get painting" in the game, this will be the # response
(Although normally you'll set this attribute when creating the
More about this in this older post. Someday I might actually try to write an adventure with this... So much time, so little energy. :-(
We make rock 'n roll. LL Cool J is rock 'n roll. Run DMC is rock 'n roll, the Beastie Boys are rock 'n roll, Public Enemy is rock 'n roll.
That is one of the things I'm fighting for, that rap beat is viewed as rock 'n roll. It's not R&B. As a matter of fact, we have closer alliances with heavy metal than anything else.
My first macro
The other day I wrote my first real Lisp macro. Yay! (Not counting macros from tutorials, etc.) It's a first step in harnessing some of the amazing power of Lisp.
This macro implements a C-like
(defmacro ++ (x) `(let ((old-x ,x)) (progn (setq ,x (+ ,x 1)) old-x)))
and it's used like this:
(setq magic 42) (print (++ magic)) ;; like magic++ in C: sets magic to 43, returns 42 (print magic) ;; 43!
Nothing special, and maybe not very useful, but it's always nice if you have an idea and it can actually be implemented in a few lines of code. :-) This may be an important step on the road to more Lisp. A long, long road, I suspect. Not that I will leave Python anytime soon... I'll still need to get some actual work done.
[Update #1] Some people pointed out that the macro isn't 100% safe. More about this problem here. The safe solution is quite ugly, IMHO (using
(It's a bit quiet here in the Python and Parentheses topic exchange. Anybody else join in?)
Spam, spam, spam
Well, sort of... More like virii and link-harvesting robots.
I received this mail today:
This *almost* sounds like an actual human writing me to swap links. That happens sometimes, and I occasionally do trade links with sites. However, this one seems fishy. "I've already linked to you"... where is your site, then? Where am I supposed to link to? Also, it's not unlikely that I show up on a Google search for "anime basket download fruit" (especially now that I've mentioned it twice in a blog post )... however, my site has nothing to do with flowers, and neither does that search term. (It's a search for the "Fruits Basket" anime.)
So, this isn't real, and a quick Google search confirms this.
Then we have the "Notify about using email account." (Sounds a bit like "all your bases...")
Hmm, I wasn't aware there was a zephyrfalcon.org team, other than me... :-)
And then there's this one:
Um, yeah. Who doesn't want to receive a happy fun mail that encourages you to start smoking?
Bad business practice
About a week ago, I was at the local PetCo to get cat treats and such. I usually check out the betta fish in pet stores, and this time was no exception. However, much to my dismay, most of the bettas they had seemed sick, afflicted by fungus and ick.
That happens, fish get sick, but I would have expected people to recognize and treat the disease. Fungus and ick are not fatal, all they take is a little medicine in the water, if diagnosed in time. And it's kind of hard *not* to notice, since the fish gets white spots (ick) or fuzz (fungus). In this case, they didn't notice the diseases, nor treated them; as a result, many fish showed the symptons, and one fish had his whole body covered with fuzz.
Gullible as I am, I bought one fish that looked healthy, to "rescue" it. To little avail, it appears now... a few days later, the fish developed fungus as well, and died not long after.
In comparison, the two bettas I got from Petsmart recently are doing well; they're active and making bubblenests.
I'm not sure I will shop at this Petco again... at least not for fish. If you sell live animals, you should at least know how to take care of them. No matter if they're only $3 or so... they're still living creatures. If you're not willing to take care of them, then don't sell them.