Older blog entries for elanthis (starting at number 100)

Banging Head Like a Bull

Argh! The player account states in AweMUD are driving me nuts!

States include 'valid' (is an actual Player, not just a garbage temporary object from a failed login or something that hasn't been GC'd yet), 'playable' (has gone thru character creation and can start playing any time), 'connected' (has a valid TelnetHandler object, someone is using the player), and 'active' (player is in the game world; usually also connected, but may have been disconnected and hasn't had the anti-cheating timeout expire yet).

Now, you can't save a non-valid player to disk - wouldn't serve a purpose. Alright. If a player that isn't playable logs in, character creation must be started. All good. If a player is valid and playable, but not connected but is alive, you can take over the player on login. Getting hard to follow. If the player is valid and playable and connected and alive, you are asked if you wish to take over the player on login (perhaps a hung connection is making AweMUD thing you're still connected).

When does a player become playable? After character creation, or if loaded from disk and the playable attribute isn't set to false. When do they become valid? After character creation or after they are loaded from disk (as they must have been valid to be saved to disk). When are they active? As soon as they connect, and up until the player quits, which happens some 60 seconds after most disconnections. Um... OK.

It's just getting to be a serious pain in the ass. I need to think up a better way to manage all these...


Ugh. Not sure why, but I feel completely dead. No energy at all. I'm surprised at got as much of my morning workout done as I did. (Which wasn't very much.)

Even now, it's all I can do to stay upright in front of my desktop...

Scriptix Security

Started finishing off the Scriptix security access stuff. I figure for now a 16 bit flags variable is all we'll need - the system is likely to never need the 8 bits reserved for it, and I can't imagine an embedding app (at least none of Scriptix' target apps) using more than the 8 user bits.

Big Patches

Unfortunately, as part of my bad developer discipline, the Arch patch is going to end up having several completely different updates in it, including a change to using the C99 intptr_t type and a cleanup to tons of public constant and type names.

How do people generally manage splitting a single file's changes into multiple patches? The only way I can think of (hand-hacking the diff) is waaay too much pain for the payback in the case of a mostly single developer project. And, besides, I really don't think you can hack the diffs like that in GNU Arch at all.

File I/O

I guess now that I have the security stuff in place I need to actually write file I/O routines for Scriptix. Joy.

Laptop Goodness (or not?)

Well, the iBook is ordered. Thanks to those who gave me suggestions! Should be here within 5 business days, along with a (much cheaper than Apple would provide) 512MB PC2100 SODIMM stick.

My old laptop is powering on again, which is good, but the Windows Quick Restore CDs don't work, which is bad. So I guess I'll just dump the whole lot off at Best Buy tomorrow and let those bastards fix it. (Of course, all they do is ship the laptop to Compaq itself, who then proceeds to not fix it, and ship it back to Best Buy, for me to pick it up.) ::sigh::

27 Jan 2004 (updated 27 Jan 2004 at 16:46 UTC) »
Powerbook vs iBook

I was looking at iBook reviews last night, and noticed two things that sound rather unappealing: the white plastic gets dirty very easily and is hard to clean, and the 14" model has a max res of 1024x768.

I speced out two PowerBooks (both 15.2", 1ghz or 1.25ghz, the later also have the backlit keyboard), altho the weaker PB is $700 more than the iBook, and the other PB is $900 more than the iBook.

One thing that makes the decision even harder is that even tho the PBs are more expensive, they aren't even necessarily better - the iBooks are smaller, lighter, and should have a longer battery life. I want to avoid wires, so that's a big plus for the iBook. I guess what it comes down to is whether a 1024x768 on 14" display is good enough for my wide-screen DVDs and whether the 933mhz processor is good enough, or if I should go for the 1ghz or 1.25ghz of the PBs.

I'm wondering if anyoen here has any recommendations for which to get? I have no plans to do any gaming, just school work, watching movies, using iTunes, and (of course) programming. The notebook wouldn't be my main development machine, so speed isn't super important, but I don't want something that'll take 7 minutes to compile AweMUD. (Like my current laptop.)


My laptop died. Yet again. POS. It's under warranty for a little longer, so I'm going to get it fixed for free and then stick the sucker on EBay.

For a replacement, I'm very likely to get a 14" iBook. With my student discounts, it's quite cheap, and if I go for the loan route, it's only $14/month. That's nothing. I make that much every time I sneeze at work. So all I have to do is sneeze once more per month and the iBook is free. ;-)

(no, actually, that's a little over an hour's worth of work, not including taxes, but oh well.)


Fedora's gnome-vfs packages have been broken for a long time with regards to SMB. Or, perhaps, it's something on my local system. With the new gnome-vfs 2.5 packages in Fedora Devel, it hasn't gotten any better. When opening smb://, nothing shows at first. Hitting refresh makes the link to the HOME workgroup show, but the link doesn't work - Nautilus claims there is no app for opening application/x-desktop files...

Scroll Wheel

Hmm, seems the latest Fedora kernel has borked the scroll wheel on my mouse. I find it rather funny how attached to that thing I've become - my computer felt almost useless until I fixed it (by reinstalling an older devel kernel).


jds: I'm not really sure how to say this nicely, so I won't. Your definition of geek seems to have no relation to what "geek" really means. It looks a lot more like you're trying to justify your own unpopular behaviour and liken yourself to respectful figures. I'm appalled to think others might read your writing and assume the rest of us are anything like what you describe - arrogant, pompous, self-centered and thoughtless. I almost think you're writing something closer to satire than anything you expect to be taken seriously.

21st Birthday Parties

Spent last evening at my good friend's 21st birthday party, which was interesting. I avoid alcohol almost religiously, for several reasons (not the least of which is that I rather prefer keeping my head in working order), but just about everyone else there was plastered after the first hour or two.

It wasn't so bad until later in the evening, where pretty much every game being played turned into a drinking game. ;-) That was about when I left, since I was relegated to watching the others have fun.

On a side note, I am ashamed to admit that I still almost always lose at Super Smash Brothers, even when the other three players are (ahem) smashed.

Linux Evangelism

I've noted that many of my recent attempts at Linux/Free Desktop evangelism have failed since my personal box is so often borked. A few days ago I found audio had stopped working (due to the removal of OSS in the Fedora kernel), and while I got ALSA setup quick enough, the fact that friends watched me do all this intricate wizardry just to play Red vs Blue videos rather left a bad impression on them. Even my 'stable' boxes tend to have numerous problems, since I keep tinkering around with various things and end up breaking it in subtle ways. ;-)

I think when Fedora Core 2 comes out, I'm going to reinstall this box and my laptop, to get things in a clean working order. I need to save up and get a nice big harddisk for my home folders on my workstation first, tho. 40GB is too little when you want to install even a few large games, especially when you have the drive partitioned.

Drive partitioning in general is evil for the user, I believe. Yes, yes, it's great for numerous technical reasons, but that doesn't matter to normal people. What does matter is that it's very, very difficult to predict how much software you'll install system-wide and how much data/software you'll keep per user. You might very well have enough disk space for everything, but find out that due to your guess up front about partition sizes you don't have enough space in the right place.

Dynamic automatic partition resizing might fix this, might I'm not sure it could actually be done. I guess the lazy modern fix is just to buy 200GB hard disks. ;-)

Art of UNIX Programming

The book, as a whole, is quite good, I think. I really wish more so called programmers would read it. I wish even more than non-programmers would read it; managers in particular.

One thing that I must say, however, is that ESR definitely asserts his personality in the book. He, of course, is the author, but I would personally expect a little less of his personal opinion and more of the straight facts. The several new terms he's tried to coin in the book alone are a good example of the problem. In other places, applications (especially his own) are praised for design choices with either no reasoning given, or with reasoning that ignores how the apps break the philosophies he's preaching in the book.

One good example is the fetchmailrc configuration format. It's horrible for a number of reasons. The "English like" syntax is conter-productive. It's much more difficult to parse by scripts (more code, more bugs, etc.) more difficult to learn by humans (the rules aren't obvious and self explanatory) and more complicated than need be (remember KISS?). Fetchmailrc should've been one of the examples of what not to do in the book. The fact that it is (mis)placed in the mini-languages section of the book makes the problem even more obvious.

Again, tho, the books is on a whole quite good. I'm quite glad I bought a paper copy.

Fax Sending Software

It appears the idea of ease of use and sanity hasn't quite reached the fax software developers yet. Four hours after starting tryint to set something up, and I'm not much closer.

Hylafax is an abomination. Whoever wrote that configuration interface needs a swift kick to the $VITALS and a copy of a UI design book.

For example - why does it ask some 10 different questions about locale-specific phone setup? Why not just provide a list of locales, and read the settings from that? One option for user, less chance of mistakes, etc. Users with whacked out/special needs can manually tweak things at a lower-level.

The Debian packages are especially insance. Why is it compiled with default paths for gs at /usr/local when Debian installs it in /usr? What the heck was the packager thinking?

I managed to get efax (not sure of the link) running, and it works very well for sending faxes. The configuration there is just right! One simple, obvious configuration line for your sending number, another for outgoing line prefix ("9" in many organizations), etc. Easy to setup, and it sent a fax perfectly on the first try, not 10 minutes after installing it.

Of course, the problem with efax is it is a bit buggy. For example, it's print spool integration is completely broken. Additionally, I can't seem to find a Free print driver for Windows that lets the user select a job name (which may be different than the file name) to select the phone number. Drat.

So, I'm tacking some hints from the print setup at my school. Users print the files to the 'fax' print, as usual. However, it isn't then faxed, because the number is unknown. (The job name ends up being the same as the file name.) So then, the users must enter the web interface (fully integrated with our intranet support system, SupportWeb), select their fax (by the file name they printed), and enter the fax number. Then the fax is sent for real.

If I could find a print driver for Windows that just let the users enter the job name as they printed, life would be much better. As is, they'll have to settle for the two-step method.

TelnetHandler and Player

Working on separating the telnet code and the player code even more. I had them in separate classes, but Player was just inheriting from TelnetHandler, so the effect was little more than a code cleanup.

The idea of having users connected over telnet with no player, or switching players without disconnecting, pretty much requires that TelnetHandler and Player be wholly separate objects.

This is taking a lot of time, however (as does any large refactoring of code), as tons of code depends on Player having the output/telnet control methods. So now Player has a bunch of wrappers (yuck), and other bits of code have to manually get the TelnetHandler pointer from the Player, check that it's not NULL, and then use it. That's even more of a pain.

Not sure yet what the best strategy to solve this ugliness is. I want to hide all the "if(get_telnet() != NULL) blah();" bits, which means most likely just more wrapper functions in the Player class. Of course, since Characters are likely to be playable soon as well, that means moving the wrappers (and the TelnetHandler pointer) to Character.

The other thing is, as I don't want to include the telnet.h header in the player.h/char.h headers (too much recompilation when I change around internal implementation stuff that C++ unfortunately makes one put in a header), the wrapper methods can't be inlined. And it's quite wasteful to have a method like that not be inlined. I could make an ITelnetHandler interface, but that's a lot of work (keeping the interface and implementation in tight sync) for no good reason other than C++ silliness. I guess in the end I'll just have to include telnet.h and deal with it.

All that's left for the immediate problem however is to "port" the login code from a player input processor to the TelnetHandler class.

Header Cleanups

While on the topic of header cleanups, I really do want to go thru the headers and see if there are any unnecessary includes. Many headers include other headers, since that's rather the sane thing to do to not duplicate the work of tracking header dependencies in dozens of files. But, in many cases, these dependency headers aren't needed, because all I use in the dependant header is a class/type name reference.

In yet other cases, I just haven't done the cleanup for when headers where once used but aren't any longer. (See, now, if I did header dependency tracking in the source files alone, that problem would be much much worse.)

2.6 Goodness

Linux kernel 2.6 is running, gnome-volume-manager is working great, I have ALSA setup properly, my DVD burner works, and IPv6 is running flawlessly. I am a happy man. :)


davidz: Your HAL packages seem to have made the difference. The CD insertion (and removal) are being detected now. Yay. ^,^

Still a few issues here and there, tho. For example, gnome-volume-manager tries to use some ioctl's on the cdrom device, which doesn't work because udev gives it permissions of root.root 0600. I tried to modify the udev.permissions file and restart, but no luck - that's lucky something I did wrong on my part tho.

Once I manually set the permissions nicely, gnome-volume-manager mounted the volume wonderfully. After I disabled cdrom tray locking and ejected the CD, I noticed that gnome-volume-manager didn't try to unmount the device, which wouldn't been nice. There's probably issues with doing that I'm not aware of tho...

Also, udev seems to be have something some disturbing problems. When it runs, I get lots of messages akin to: cannot acquire org.kernel.udev service, error org.freedesktop.DBus.Error.AccessDenied: Connection ":1.373" is not allowed to own the service "ȠU " due to security policies in the configuration file'

It seems udev didn't add a D-BUS config file for persmissions, which could be the cause the above. The real issue is that bit in quotes there - it's different for each of the many similiar messages printed, and garbage everytime. Someone is reading uninitialized memory (or getting corrupted memory). These don't happen with udev 013, but then, the HAL disc detection doesn't work with that either. :(


Making marginal progress on learning the bass. While practicing, I stumbled upon a familiar sounding tune. Upon asking my father, he told me it was Smoke on the Water (Deep Purple), corrected me slightly, and now I can play the beginning of that song rather well. :)

Otherwise, tho, I still suck at playing the bass. :(


One of the more disgusting sets of code in AweMUD is the Player class. This is because all of the networking code (including the complete telnet implementation) is included in that one gigantic class.

My current mini-project to avoid working on the main Todo items for the next release is to clean up this abomination. Of course, the trick is, what is the best design?

On one end is what I have now. Only Players are going to need the telnet layer and such, so why split it out into a separate class at all? On the other end, each bit of different functionality (network connection managing, telnet protocol handling, high-level I/O managing, and the player itself) can be split into its own class. Of course, something in the middle is the most ideal solution. I'm just not sure where abouts in the middle that solution is. ;-)

I'm thinking to split out the network conenction manager, since that's already been duplicated once and may be again. Good to have that unified. The telnet layer and high-level I/O can be merged, as I'm not sure the other network methods will ever need such advanced data management (as they are rarely used and don't have as much user-visible impact). So that gives us a three class split.

Scriptix Capabilities

I started working on Scriptix capabilities yesterday. The general idea, so far, is for each thread to simply have a set of binary flags (32-bit int on 32-bit platforms, etc.) which is inherited by created threads. The API will have things like has_capability(uint cap) which take the cap as an index, bit shift it, and use that as the flag. There will also be, of course, standard capabilities with nice names instead of just numbers. The first 16 or so flags (half of the available allotment on 32-bit platforms) will be reserved for the Scriptix core.

16 Jan 2004 (updated 16 Jan 2004 at 19:41 UTC) »

davidz: Ah, I'll have to give that a try sometime tomorrow when I have a chance. I had tried installed udev 0.13, but that seemed to make the situation worse, not better. Not that I'm complaining, this is all pre 1.0 software. ;-)


All comfortably settled in with using Arch for AweMUD and friends. The setup I have is a little convoluted tho, and I'm thinking it would be nice to have server-side hooks for Arch. As is, I currently have 3 cron jobs to handle various tasks.

The first, and easiest, was to get commits to my server mirrored to the SourceForge web space. The second is a port of the CVS scripts I had for generating snapshot tarballs (for users without the Arch tools) and the HTML ChangeLogs and copying them to the website. The final script generates commit logs to send to the awemud-commits mailing list.

That last script, as I couldn't find anything like it on the web, may be useful to others - send me an email if you want a copy.

The only thing I'm missing now is a ViewCVS equivalent. There's the super-alpha ViewArch, but it's configuration is... well, non-standard, and I don't think it'll run on SourceForge's web server anyhow (needs tla installed). I suppose I *could* do another "generate it on my server, copy it to SourceForge" script, but I'm getting sick of those. ;-)

91 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!