• Skip to site navigation
  • Skip to content
  • Skip to sidebar
  • Skip to footer
  • Go to archive page
Shadowmaster’s Lair
A light in the darkness, where everything is possible...
  • Home
  • Projects
  • About
  • Blog [ frontpage ]

Monday, February 8. 2010

Throwaway code

It has become increasingly common for me to come up with a program for an amazing task one day, to rewrite it the next day.

umcdist, the Wesnoth-UMC-Dev Distribution Tool, has been in development hell for a year mostly for this reason; the other reason is that it seems like it will perform worse than build-external-archive.sh a.k.a. “Scrappy” due to an excessive usage of Perl's system function. I cannot make up my mind and choose between performance and maintainability; Espreon knows that build-external-archive.sh is broken, but I can't be bothered to try to understand that awful piece of Bash unholy abomination again to fix it.

Meanwhile, umcstat (Wesnoth-UMC-Dev Statistics Service) is still a work in progress, but with more emphasis in progress; there's actual code written already, and I've been using freenode's Eir bot framework to test it.

While Eir could possibly be a nice way to get rid of umcreg's Net::IRC dependency and code, it's actually a C++ program that can be compiled only with GCC 4.4 at minimum, due to at least one C++0x feature used throughout the code: auto. The target machine runs Debian lenny, unlike my laptop (Squeeze), and therefore doesn't have GCC 4.4!

Instead of sticking with Eir, I'm refactoring umcreg's IRC code into a custom Perl-only framework, umcbotd, and making creative use of eval writing an abomination code-named “Naia”, which I'm rewriting again because the first version I wrote, which worked, was very badly designed and ugly. I know it's a problem when I have three classes or modules all depending upon each other's internals.

The goal of umcbotd/Naia is producing a Net::IRC-based abstraction layer for our bots that treats them as “services” with multiple “modules” (not in the Perl sense, though) that can be easily inserted and removed from the system by adding/removing their files. umcreg already runs with a prototype implementation of this mechanism, but it needs to be generalized further before it can be usable with Naia.

Writing our bots could be this simple, if Naia gets completed:

#!/bin/true
CO_SERVICE_COMPONENT('umcreg');

sub ctcp_version_reply () { "Wesnoth-UMC-Dev Registry Service, using " . Naia::version_string() }

sub eh_ctcp_version
{
    my ($self, $event) = @_;
    $self->ctcp_reply($event->nick, 'VERSION ' . ctcp_version_reply());
}

# ...

my $bot = Naia::get_bot('umcreg');
my %eh = (
    'cversion'      => \&eh_ctcp_version,
    'msg'           => \&eh_msg_private,
    '330'           => \&eh_whoisloggedin,
    '318'           => \&eh_endofwhois,
    '331'           => \&eh_notopic,
    '332'           => \&eh_topic,
    '403'           => \&eh_nosuchchannel,
);

$bot->connect();
$bot->register_event_handlers(%eh);

And their modules would be like this, more or less the same as umcreg's modules already are:

#!/bin/true
# token, subroutine, privilege level (A: admin, H: half-admin, U: user)
CO_MODULE('RAW', \&co_raw, 'A');

sub co_raw
{
    my ($parent, $nick, $hostmask, $svaname) = (shift, shift, shift, shift);

    if(!@_) {
        $parent->notice($nick, "Not enough arguments for \002RAW\002.");
        return;
    }

    $parent->sl(join(' ', @_));

    broadcast_to_log("RAW [$hostmask]");
}

... And of course it would still involve lots of ugly stuff under the hood (eval magic), but if done right I shouldn't have to touch it whenever I wanted to add or remove a feature from any of our two services.

Posted in Personal, Software, Wesnoth at 23:03 | No comments

Saturday, January 30. 2010

umcreg

At last, umcreg, Wesnoth-UMC-Dev's Registry Service, is finished, deployed and announced in the forums, thus completing the first part of introducing the Registry system to the project.

There were some changes from its original incarnation, but everything turned out pretty well for a bot written from scratch in approximately 6 days by a Perl fanatic with no knowledge of object-oriented Perl — I actually learned some object-oriented Perl while at this and I feel like I can do anything with it now. :D

I was in a hurry to get this done right before freenode deployed ircd-seven today (yays!), for no particular reason; this resulted in a security feature not working with hyperion-ircd until I introduced a quickie hack that I'll be retiring later today.

We are using a private git repository for managing the source code, but since I wrote it with an open-source licensing model in mind as usual, here's umcreg version 0.1.1 for the curious, released under the terms of the GNU GPL version 3.

  • umcreg 0.1.1 (gzip tarball, 35.7 KiB; MD5 sum: 7877c82082d42c45d45f68647c223459)

I have already registered our current members using some basic, known information about them — even including their join date. Old projects' registration will be a little slow as I need to research the current structure of the repository, of which I lost track a year ago, and retrieve original timestamps. The registry's web interface, provided by the umcreg::Web and Thoria::Web packages, can be found here.

umcreg is already working at the project's admin channel on freenode too. It only obeys the project staff's orders, though, so there's no point in trying to send messages to it.

The next step in implementing the Registry model is writing the Statistics service, codenamed “Listra”, and most likely going to be named umcstat. That will definitively take much longer than umcreg's development. Meanwhile, Espreon is trying to convince me to take care of umcdist (codename “Blackmore”) first.

Posted in Software, Web design, Wesnoth at 16:54 | No comments

Wednesday, January 27. 2010

Building arcs

After some weeks of inactivity, I have finally completed the first arc (not the first episode, though) of After the Storm in the Wesnoth-UMC-Dev SVN repository, comprising 7 scenarios out of planned 11; this means that a 0.3.0 release is coming soon. It was about time!

With this new arc completed, I have introduced new background story elements that could be considered controversial if any mainline purist is actually paying attention to the campaign — that's okay, I never intended IftU or any sequels to be mainlined. I still struggle to keep everything as fuzzy as possible to give a certain degree of flexibility to any content authors who decide to take what is said in IftU and AtS as “canon”. It's harder than it sounds, particularly because it must still be clear enough to allow the plot to progress; so I cannot just throw a bunch of nonsense into the campaign and say “hey, look at this, this is our vague excuse for this pathetic plotline!”.

Now that the characters have a decidedly vague excuse for the plot of the next arc, I face a problem that I knew I'd have to handle sooner or later: artwork.

I am not a good pixel artist, but I don't have any loyal slav- pixel artist that could help me either. And even if I could get one, I'm not completely sure I could describe the concepts I have in mind in plain words to tell them what unit sprites I require. There's also the spoileriffic factor; there's a reason that I removed the original (clumsy) storyboard from the SVN repository and departed from the original plans, most notably by removing a main character and introducing two new sidekicks instead. So, it's up to me to create any pixel art needed to make the campaign work; baseframes are enough for this purpose, although I still wish IftU and AtS' original units had animations.

At least I don't need to write a game engine from scratch too, thanks to Wesnoth's scripting flexibility.

Posted in Software, Wesnoth at 12:03 | No comments

Thursday, January 21. 2010

Robots!

It's year 2010, and, despite the promises, there are no flying cars, no jetpacks, people still die, there's no interplanetary travel, no apocalyptic event triggered by humans made Antarctica disappear on 2000, and most importantly, we are still awaiting the day we can have our own robot pals.

But here's IRC to solve that! No, really! What do you mean, it's not awesome!?

Okay, obscure references aside, the Wesnoth-UMC-Dev started as a fairly casual repository set up by me and Eric S. Raymond for managing a few add-ons that were, at that time (March 2008) candidates for being mainlined at some point of the future: Invasion from the Unknown, Legend of Wesmere and Delfador's Memoirs. Guess which of them has not made it to Wesnoth's mainline project yet.

The way we worked before was fairly different to what we do nowadays. Some time before AI0867 joined me in this quest, I decided to open the “UMC Sandbox” for projects not intended/expected to be merged into mainline. This had some unexpected success by the end of the year and we got a fair amount of add-ons to manage. As I write this, I'm wondering what the hell we are hosting anymore — I lost track!

At the beginning we also had a wiki page at Wesnoth.org with the list of projects and authors. AI0867 and I tried to keep it up to date at all times, but we inevitably forgot its existence after a while. The fact that Wesnoth.org crashed around July 2008 and stayed dead for nearly one month, and was resurrected from 2 months-old backups didn't help. When I remembered the page, I decided to wipe the rusty listings out; the only thing that survived was the admin list, which is now happily hosted by AI0867 on our project's website.

But it'd benefit everyone if we didn't need to look at SVN directory listings or history to check what add-ons we host, or who are in charge of them. To solve this problem, two new services are born: the Statistics service (umcstat, codename “Listra”) and the Registry system (umcreg, codename “Thoria”). I've been asked about their purposes and goals a few times lately, mainly because umcreg is finally reaching completion, so here it is; a thorough description of our new pals.

Continue reading "Robots!" »
Posted in Software, Wesnoth at 21:38 | No comments

Dorset2

At last, the new layout is ready and deployed. Codename “Dorset2” was completed some days ago but I spent additional time figuring out ways to make a few parts work with Internet Explorer 5.5 and 6. Yes, I know those browsers are obsolete, but IE 6 is the last version that can be installed on Windows NT 4.0, Windows 98 and later (wikipedia) — yes, I know nobody should use anything older than Windows XP for Internet browsing nowadays, hush.

I also had to work around a couple of bugs in Mozilla Firefox 3.5, of all things. Webkit and KHTML-based browsers (Google Chrome understands some KHTML extensions for some odd reason) also displayed some quirks of their own.

Here's a few of screenshots that should display the overall differences between Dorset and Dorset2 (big files ahead!):

  • Dorset
  • Dorset2
  • Dorset2 on Internet Explorer 6 SP1

Naturally, this site is no longer very compatible with IE 5, 6 and 7 because it's using some CSS 2.1 characteristics that are not implemented correctly or at all by those versions. IE 8 works like a charm except for a minor problem with the pre element height rules — which I could fix with a small work-around if I cared enough — but there are also some CSS 3 techniques and/or vendor-specific extensions in use for round borders and text shadows. Nonetheless. I made sure that the site's functionality would not differ between IE 5, 6 and 7, so even if the appearance differs, nothing should work incorrectly.

VirtualBox was very helpful when testing all this stuff. It'd been very hard to run Debian lenny and squeeze at the same time otherwise!

Opera 10.00 showed problems handling multiple children elements with transparent background images. That's a real pity and I hope that newer versions don't have this problem.

The bottom-left corner is not round. There's a good reason for this, and I hope to fix it in the next iteration, some day. For now, Dorset2 is here to brighten and soften your day!

Posted in Miscellaneous, Personal, Software, Web browsers, Web design at 10:41 | No comments

Sunday, January 17. 2010

Dorset2 on the horizon

I have recently discovered that the color scheme and overall “look and feel” of an user interface, including web sites, can do a lot with my mood. Two days ago, someone on freenode.net's social channel (#defocus) linked to her blog, which has a black background — that's not bad or unusual, but I noticed that the dark scheme affected my mood making me feel slightly upset for a few minutes. I have no idea if this is just another quirk in my brain's functionality, or normal.

Nevertheless, it does sound like something I could use to my advantage, and to please my somewhat loyal reader (hi Espreon!).

Codename “Dorset2” has been a work in progress since last November. I had experimented with round shapes, box shadows and gradients, using CSS 2.1 and background image tricks, but I didn't get very far due to Dorset's inflexibility and design flaws at the PHP level; basically, I'd have had to edit every single page to adapt them to the new scheme, and that'd be boring and tedious. However, a few days ago, “Poison Ivy” was completed, enabling me to share the basic and simple functional code with three websites, or document sets, so to speak:

  • The Wesnoth-UMC-Dev website, (now codename “Kalari”);
  • This website (codename “Dorset”); and
  • Dorset2, not yet online.

Ivy's design allows me to simply “flip the switch” to convert every web page in my laptop's test Apache instance to use the new scheme, thanks to a extremely primitive, yet effective template and configuration system. A couple of lines of code:

define('DORSET2_ENABLED', TRUE);
define('SKEL_BASE_PATH', DORSET2_ENABLED ? '/dorset2' : '/dorset');

By toggling DORSET2_ENABLED, I can test my code with the old and new templates and stylesheets as necessary, without editing any of the actual pages!

I deployed “Poison Ivy” on the online site last night, so this is already theoretically possible in here... except that the Dorset2 files are not finished or online yet. I did resume my work on it some days ago after finishing Kalari, though.

If a dark scheme can have negative effects on my psyche, what could bright (but not too bright), soft colors and shapes do for me? Basically, Dorset2 aims for a relatively simplistic look, with soft shapes and colors using gradients and round corners for some elements. The color scheme is also slightly brighter than Dorset for some elements; but the shapes are what matters here. A box with round corners and no solid border makes the contents look soft to me; compare current Dorset which uses (way too many) rectangular boxes with solid and dark borders everywhere, inside and outside the main body.

Here's a (rather big) screenshot of Dorset2. Apologies for the admittedly awful rendering of Verdana Bold; that must be freetype's fault.

  • Dorset2 (PNG screenshot)

Since it's a work in progress, I have not gotten around to tweaking the CSS to make it work as best as it's possible with Internet Explorer. It doesn't look too bad at first glance, but it gets worse at the bottom (not pictured) thanks a gradient background trick that makes some text disappear at random in IE 6 SP 1 — and for whatever reason, this doesn't affect IE 5.5 or IE 6 SP 2 and later. I figured that I'll make my work easier for now if I write rules to disable certain decoration elements with these broken browsers.

Hopefully this gets finished soon. :)

Posted in Miscellaneous, Personal, Software, Web browsers, Web design at 00:11 | No comments

Friday, January 15. 2010

Oxygenize your desktop!

I use KDE 4...

Sounds suicidal? Go check your facts. Anyway, I use Mesa 7.7 for 3D, plus libdrm and the X.org radeon driver from their git repositories. The system is Debian Squeeze, but it's a few weeks behind testing because I've not had access to a strong connection to download the shitload of packages (~350 MB) for upgrading.

I normally use the QtCurve style for Qt3, Qt4 and Gtk2 applications, but last night I decided to give Nitrogen-style (based on Oxygen) a go again.

I found that if I open Konqueror's bookmarks menu, when it has many more elements than they fit in the whole screen, X.org crashes!

Backtrace:
0: /usr/bin/X(xorg_backtrace+0x26) [0x4ee056]
1: /usr/bin/X(xf86SigHandler+0x39) [0x484199]
2: /lib/libc.so.6 [0x7ffc172e8fd0]
3: /usr/lib/dri/r600_dri.so(r600SetTexOffset+0x8b) [0x7ffc028e306b]
4: /usr/lib/xorg/modules/extensions//libglx.so [0x7ffc163b911c]
5: /usr/lib/xorg/modules/extensions//libglx.so(__glXleaveServer+0x18) [0x7ffc163affa8]
6: /usr/lib/xorg/modules/extensions//libglx.so [0x7ffc163b055f]
7: /usr/bin/X(Dispatch+0x374) [0x44d494]
8: /usr/bin/X(main+0x3aa) [0x43337a]
9: /lib/libc.so.6(__libc_start_main+0xfd) [0x7ffc172d5abd]
10: /usr/bin/X [0x432819]

Fatal server error:
Caught signal 11.  Server aborting

It reproduces with the Oxygen theme too. All with KDE 4.3.2 — but the crash seems to come via Mesa 7.7's ATI R6xx/R7xx DRI driver. Ah, yays for newborn drivers. :P

Posted in Hardware, Software at 18:26 | No comments

Tuesday, January 12. 2010

Kalari at last

It took me much less time than I expected to put the new layout of the Wesnoth-UMC-Dev website together. Observe.

Okay, that's basically because most of the design was already made long time ago, in the form of the site's earlier incarnation, codenamed “Soradoc”, which looked rather busy and useless with the sidebar and other design elements. The new design, “Kalari”, removes the sidebar, clears the site banner a bit, and blends the site with Wesnoth.org as far as appearance is concerned. It's not the same design, but it's similar — that should be a good thing considering the purpose of Wesnoth-UMC-Dev.

That site also had a Blosxom-based blog, but I removed it since nobody was making actual use of the space.

The greatest thing about all this is that most of the PHP, “Poison Ivy” was finished in 1 night, while the rest took me just a few additional hours. Now that Poison Ivy is completed, I can reuse its code for the next incarnation of this very website and blog.

It's all for teaching some web design and programming basics to myself, really.

Posted in Miscellaneous, Personal, Software, Web design, Wesnoth at 20:43 | No comments

Monday, January 11. 2010

Sexy and poisonous

(No, not that one.)

There are many content management systems out but all of them seem to require some sort of database server and occasionally sacrifice flexibility in favor of ease of use.

This is why neither this site or Wesnoth-UMC-Dev's use one of those nifty software packages although they still use PHP. The latter website uses a bunch of ugly code codenamed “Soradoc” which has the actual XHTML layout embedded on it; the CSS stylesheet is also codenamed Soradoc and it's derived from “Glamdrol”, the Wesnoth.org wiki skin by Ettin; and “Dorset”, which is Soradoc's immediate ancestor, used on this very personal website — which in turn uses PHP code derived from the current incarnation of “Soradoc”.

Enter codename “Poison Ivy”, which is basically the same thing as Soradoc/Dorset, except written from scratch, much cleaner and more flexible; in particular, the XHTML layout and the site configuration are no longer part of the engine's source code which will allow me to share that among both websites more easily. It also introduces seamless support for document compression, which may be useful for my personal website.

Ivy is mostly finished, but I'm now busy reworking the Wesnoth-UMC-Dev site's design under a secret project, codename “Kalari”. Maybe once I'm finished with that, my next web project will be bringing umcreg (codename “Thoria”) to life.

(Okay, it's not a secret anymore. Dammit.)

Posted in Miscellaneous, Personal, Software, Web design, Wesnoth at 23:00 | No comments

Mozilla Firefox 3.5

Long, long ago, I talked about several issues I had with Mozilla Failfox Firefox 3.0 and openSUSE 10.3 for the AMD64/EM64T architecture.

Ever since then, I have learned several things:

  1. Debian's Iceweasel fork doesn't seem to be much ahead of mainline Firefox in terms of bugfixes, as far as I can see. This might be not true for security fixes and such; I admit I haven't done any actual research on this and I'm basing this statement on my user experience.
  2. The Download Day was a trap.
  3. Other people who I have talked to regarding Firefox's stability on Linux claim that is never/rarely crashes, but all of them use x86 kernels and userspace.
  4. Iceweasel 3.0 taints the Debian GNU/Linux 5.0 Lenny distribution on the AMD64/EM64T architecture, with no differences in either of my laptops. This Linux distribution is remarkably stable otherwise, and lived up to my expectatives since I originally switched to it when it was the Testing distribution — this is, comparing it to the released openSUSE 10.3.
  5. Off-line browsing is truly, horribly underestimated, to the point that one of the major web browsers does not support it at all; probably in favor of simplicity and ease of use, and “permanently connected people”. But, STILL... :/
  6. It's not a good idea to leave a chainsaw and a newspaper near the reach of a cow.

I recently switched to Debian Squeeze, which is still under development (e.g. Testing) as of this writing. Originally, I just got a newer revision of Iceweasel 3.0 with the set. Some weeks ago, I got upgraded to 3.5.

As I mentioned in my previous post in this series, the status bar does still glitch a lot — no, wait — the status bar glitches even more than in 3.0. Scrolling is less laggy but only with smooth scrolling disabled, although I am not exactly using a well-supported video configuration at the moment and I probably should not complain about performance issues with any 2D application unless I'm willing to use the unaccelerated X.org VESA driver for benchmarking or shut up.

The Live Bookmarks feature stopped working after the upgrade until I went and manually reloaded every single Atom/RSS feed I had linked in a neat folder in the bookmarks toolbar. It took me a while to realize that nobody posting anything near Christmas was a bad sign — I didn't miss much anyway, since my feed sources aren't really chatty. Yes, I know I'd be better using an actual feeds reader, but I'm just that lazy, which is also why I don't use Opera as much as I want.

However, this version of Firefox is much, much more stable than 3.0 — as far as this AMD64/EM64T architecture user is concerned, that is. Firefox just got better, really. But it's still rather odd because I've heard comments on IRC of people claiming that it got more unstable instead. Hmm... Well, maybe Windows or x86 Linux users are less lucky this time?

Firefox 3.5 also supports the CSS text-shadow property, which was introduced in the CSS level 2 specification, removed in revision 1 (CSS 2.1), and seems to have been picked up again for CSS 3. No version of Internet Explorer before and including 8.0 supports this (although ISTR that they support a shadow filter using a custom extension to CSS that didn't even follow the specification for naming vendor-specific properties), and current Opera, Safari and Chrome support this property well. That means that I must make more use of it in this site's stylesheets from now on. ;)

Posted in Software, Web browsers at 00:00 | No comments

Sunday, January 10. 2010

Creativity drops

At this point, I should know better than tempting fate in a blog post:

[...] Some days before Xmas, my creativity returned from its long, chaotic journey and my Wesnoth add-on, After the Storm (sequel to Invasion from the Unknown has seen steady progress and two new releases were published in less than two weeks. Keep in mind that this add-on had not seen any public releases for almost a year. [...]

Two days afterwards, my creativity disappeared like a drop of water in the sea, again — which means that After the Storm has seen relatively no progress since then. I hope I get better next week, because this work needs to be completed as soon as it's possible.

Posted in Personal, Wesnoth at 16:09 | No comments

Sunday, January 3. 2010

Extract Archive Here, Autodetect Subfolder, Save the Day

Konqueror archive context menu screenshot

Thanks to this KDE 4 feature, I no longer need to preview whatever zip, rar archive or tarball I download to check if it has a suitable structure for uncompressing directly into a separate dir without help. Awesome.



(Yes, I admit it; this is a filler, just for the sake of breaking my habit of not posting anything on Sundays.)

Posted in Miscellaneous, Software at 20:59 | No comments
next page »
(Page 1 of 4, totaling 43 entries)
1 2 3 4 ►
Calendar
« February '10 »
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
Archives
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • Recent...
  • Older...
Categories
  • XML Hardware
  • XML Miscellaneous
  • XML Personal
  • XML Software
  • XML Web browsers
  • XML Web design
  • XML phpBB
  • XML Wesnoth
  • XML freenode


All categories
Syndication
  • XML RSS 0.91 feed
  • XML RSS 1.0 feed
  • XML RSS 2.0 feed
  • ATOM/XML ATOM 1.0 feed
  • XML RSS 2.0 Comments
Projects
  • Battle for Wesnoth
    • Wesnoth add-ons
    • Wesnoth Team Colorizer
    • Wesnoth-UMC-Dev
  • umcreg: Registry Service
  • Shikadibot 0314
  • Miscellaneous
    • irssi scripts
    • phpBB 3.0.x hacks
Links
  • Wesnoth.org
  • Wesnoth-UMC-Dev website
  • Turuk's blog
Serendipity PHP Weblog
Valid XHTML 1.0 Transitional
Copyright © 2006-2010 by Ignacio R. Morelle. Powered by Poison Ivy/Dorset and Serendipity.
The opinions expressed herein do not represent those of any of the projects and organizations the author might be affiliated with, unless otherwise stated. The author is not responsible for the content hosted by external websites linked from this site. All software, documentation or instructions of any fashion are provided as is, and under its own license terms. Use/read/eat/drink at your own risk.