Recent blog entries for wwwwolf

20 May 2003 (updated 20 May 2003 at 18:56 UTC) »

NeverBlender saga continueth! Today I learned that Blender in Windows indeed does support some sort of sys.path. Kind of lame sys.path but I can throw stuff in it. Just not do sys.path.append() and I'll be just fine.

So I proceeded to split up some of the code to modules. I originally wanted to keep all of the code in single file that can be easily opened in Blender and run, but it's not significantly harder to do things this way, I suppose, and writing other scripts may be easier also this way.

Following is yet another stupid language rant. Just ignore it, please.

I keep hearing "Perl is ugly and Python is clean and nice" all the time. Today, I've easily started to react to statements like that with disgust.

First of all, conventions. "Perl's sigils are ugly. So, Python uses no sigils." Yet, it's recommended to start private object variables with underscores. Underscores, people. Not just any sigil but the most ugliest and unreadable sigil imaginable.

Ages ago when I was learning C coding I read, from the guidebook, that "your #defines should not start with underscores because the library uses names like that." Me, in my youthful ignorance, said "oh, can I use two underscores? Bet that won't conflict!" Nope, it didn't - but it was horrible to read. And Python wants me to use that sort of stuff to name my constructors. def __init__(): print "Yuck."

"So," says Python, "are you ready to make your ugly Perl more beautiful?" Wait. Does Python do private instance variables? "Nnnno. It's just a convention that you name stuff this way. It doesn't enforce data hiding." Then it's just as ugly as Perl. "Eh, Yes." Well, at least I have 'self' reference and I don't need to pass references to the object to every damn one of my methods? "Er, no. First parameter is a reference to self."

Hrm, "no confusing 'bless' function, 'class' keyword defined instead" doesn't equate "more convenient OO than Perl"...

Now, I just need to figure out why the heck I spew out this same stupid tired rant every time I touch Python objects. =)

(Update, a little while later: Also discovered Python doesn't do method overloading. Bet my scream was heard back home, across the country.)

Not done anything remarkable for a while. Small scraps of Perl and Ruby for doing mundane trash.

And then. The big project I've been doing for a while is called NeverBlender.

A script for exporting Blender models to Neverwinter Nights ASCII model format. Supports mesh geometries, NWN special properties, texturing (including UV coordinates), and per-face shading. Cool, eh? Quirky as hell, but it works already.

Written in programming language I mildly dislike due to its reaction to my karma and its infuriating documentation. Written mostly in that ungodly operating system (Strangely not crashed, even when the app has done that a few times). The script was mostly written the application's own text editor that's not among the greatest text editors built (Can you imagine writing code when you can't use brackets or other required symbols except through copy-paste?)...

So what have we here? A program mostly for Windows users (because most of the Neverwinter Nights custom content creation tools, incl. the toolset and the hak editor, work best in Windows). A program in Python. It manipulates relatively undocumented NWN data files. I'm no Windows guru, I'm no Python guru, I'm not a Blender guru, I'm not a 3D graphics guru, and I'm no Neverwinter Nights Custom Content Dude. But hell, I've made the thing to actually work somewhat. Should I be happy of this little accomplishment?

I have to admit Python is actually nicer than I remembered. But I would still pick Ruby over Python any day if I'd do some scripting in a language that's Not Perl. =)

16 Nov 2002 (updated 16 Nov 2002 at 22:36 UTC) »

Previously, did a small release of Vocoditor and did some work on the new release that'd actually support custom tags.

(Apologies if this is vastly inaccurate or inelegant, I'm really tired.)


People talk about Integrated Noding Environment in

Ahem, I'm not a Guru, but I just did my step toward that goal. I finally got fed up with XEmacs' "don't mess with user's auto-fill-mode setting from file local variables" policy, and wrote a major mode for this baby that does very little else except provide something ELSE besides text-mode to work in. If it isn't text-mode, it can't turn it on in the text-mode hook, right? Right! As an added bonus, I added link syntax coloring.

Too bad this is fairly GNUEmacs-like still... I noted xemacs has even more funky stuff.

Oh, by the way, why people call Perl ugly, when Emacs regexes are twice uglier? It's late in the night, so I couldn't figure out a beautiful way to say this:


Which is Emacs string slang, meaning roughly


Which in turn is


in Perlese. I particularly find it disgusting that [] has syntactical meaning, \[\] is literal, while () is literal, \(\) has syntactical meaning.


Not letting this to be downloaded just yet. It'd rock to actually add sumbission thing and stuff. =)

Perl shit: finally made EveryLecture script to work better - now it handles stuff like headings better and probably will not make Festival's SABLE parser to get confused and die everywhere. The only problem is that I split up the E2 client part to other file - and it's actually a package that could, in time, be put to cpan or something. except that I'm not a hero like that, just a lousy coder. and it's just a trivial wrapper for LWP anyway. if it one day has OO interface to E2, then I may be put it to CPAN, or quit using silly abbreviations everywhere. it's a problem because I can't really node a multi-file package that easily in e2, and making a node that just refers to a dl site is Improper. *sigh*

Okay, I took a dip into the wonderful new world of GNOME 2.0, now that the stuff is finally in Debian. I finally have an original (?! not really) idea for an application (will tell of that later) and I wanted to try out GNOME 2.0 because someone hinted that the libgnome API is now stable "forever".

Return of the Horrors from the Docu-land

Jeez. Why every time I try to touch anything, it's always horribly documented? The HTMLs that come with Debian are not exactly a promise of a better environment, and has Good, Honest Documentation for everything else except libgnome/libgnomeui. I did find a porting guide that got me through the confusion of setting up the build stuff (note to self: srcdir=. USE_GNOME2_MACROS=1 && make). Still, I guess I will be reading existing code and not good API references...

I guess it will once again take a lot of time to get used to GNOME 2. I guess I'll wait for next edition (if there is one) of Writing GNOME Applications book.

Language issues... or, "the wolf explains how Python isn't his chosen language, using the miserable childhood as the excuse."

Recent comments in a.l.f made me to see one programming-related thing:

I'm too much used to C-like program style.
I didn't do enough Turbo Pascal back in the day.

Think of it: In my early programming days, I coded mostly in Microsoft's hideous Commodore Basic. Now that was a tight environment and no way I was able to even breathe. Program had to be crushed. The end result was... a pile. Not good-looking code. Just a pile of commands. That was a particularly claustrophobic experience. At most 65536 lines. At most 80 characters per line - if you cheat, some more, and please do, because you really shouldn't worry of indentation or stylistic things with this amount of memory or with this 40-column display...

I coded in TP for some time, but relatively quickly (in less than 2 years) I was already programming in C. I later moved also to C++, Perl and Java. What drew me to C and relatives was the freedom. Freedom of make the code as pretty as possible. Pascal was better than Basic, but it wasn't always readable or pretty. I didn't always like it. (Well, TP was better-looking than some other dialects...)

Yesterday I saw some Basic-like code and I couldn't spot the bug in it because I misprocessed it in my mind. That was always a problem in Basic-like code... and it still is. Seeing where the problems are, seeing what's going on - that's much easier for my mind when things are written in "the C way".

So, this is why I do Perl and not much Python. It's because I can't see a thing! In Python - like in all procedural languages that don't look like C - things appear to be closer than each other. Important things are... well, near. Python is better than TP because it isn't as claustrophobia-inducing as other languages of its kind, but...

...I think what I'm saying is this: What comes to code structure and layout, with Python you can build huuuge skyscrapers with a lot of small apartments - and with Perl, you can build everything from gigantic concert halls to outhouses.

Maybe I'm wrong again. I know I'm definitely wrong by posting something that looks like an Argument in This Gigantic Language War Of Our Age.

Nothing much on the hacking front, except that I started to work on schedulist again. I wrote a few parts for the missing User's Guide, and also wrote an installer. These are the tasks that don't really contribute to the program, but are surprisingly important =)

Soon, the whole program shall, truly, Work Perfectly and be nicely documented as well!!

I think.

I felt so completely useless that I had to do something today. =(

That SSA idea may be reality later today. Maybe.

Anyway, I threw together the few lacking bits from XMMS InfoPipe and released the Dreaded Release 1.3. (also known as "It compiles, ship it" release. *sigh*)

Maybe I'll make a HTML::Mason component for the thing later, too...

Random coding idea I'm trying to make reality: Since I sometimes subtitle stuff, it'd be nice to make transcripts of the subtitled things. I use SubStation Alpha, a pretty nice subtitling program that has an easy to parse textual format. The format stores start/end times of each dialogue line, and also it's possible to save the name of the character who said the line to the event.

Now, assuming the script has the names of the character everywhere, all I need to do is to read the file, sort the events by start time, merge all lines from same character that fall withing specified time (for example, in case of the thing I'm subtitling now - Sniper Wolf's death scene in MGS - it's about 3 seconds), and dump out the dialogue in HTML.

Easy as pie in Perl, but I need to tell more later on - It's pretty late here... (2002-05-10T02:10)

18 Apr 2002 (updated 18 Apr 2002 at 21:56 UTC) »

Time to blow some dust off Vocoditor. And guess what? It wasn't that bad, after all!

Drag & Drop works just fine now (even though finding programming examples was painful AND the example was Wrong.) I fixed the comment writing problems with new version of vorbiscomment. Once I fix the UTF-8 issue, it'll be just perfect and I can do the long-waited 1.1 release. =)

It's now in ItWorksForMe(tm) state again! I can drag stuff to it from Nautilus, and works from Nautilus with (Right click)→Open With→Vocoditor after I added it to appropriate place.

(Update: I did that UTF-8 thing. Too bad the conversion requires Recode because apparently GTK+/Perl is running GTK+ 1.2 and as such uses only national encodings - which isn't good from Perl's use utf8; pragma's point of view? Does Perl support conversions of UTF-8 strings to locale's own character set? Any ideas?)

Also, yesterday I fixed the MazeHack thing. Now it works in Glorious 3D, the viewpoint looks credible, and it can be controlled with joypad just fine. Next up: Culling of stuff and fog, textures, again working map mode, and other unnecessary stuff like that.

31 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!