Older blog entries for wwwwolf (starting at number 35)

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.

Summary of what I've done recently - fuller details (if any) are in the Kuro5hin diary...

I fell in love with SOAP::Lite. Wish Debian has the new version of the module soon - you know, the one without the fatal bug. =)

I wish the diary sites would support some sort of (hopefully uniform) SOAP API for making and managing the entries. I hate to see people wasting time with HTML parsing!

"SOAP Web Journal API", anyone?

I had a crazy idea yesterday: .m3u file editing easifier for XEmacs, already made a parser... but I have had second thoughts, because XEmacs. Maybe I'll just make an XEmacs command like "M-x strip-comments" to remove all lines beginning with #...

I found an embarassing typo from XMMS-InfoPipe. I had earlier converted the C string code to use GLib strings instead - and had gone, ahem, overboard with the copy/pasting. So, no wonder it said it was "Paused" all the time, because I had copied the "Paused" text all over the place.

To do: Vocoditor's new release out Any Year Now! XMMS has a tag editor, but it isn't without its share of warts...

Sheesh. So far, nothing annoying in E2 or Slashdot. Got to be a new record or something.

Anyway, today I wrote something for XMMS-InfoPipe. I figured that since I couldn't get XMMS to tell the meta information, the metainfo could be got by other means. In other words, I added stuff to the CGI / mod_perl script instead... This should be given by XMMS, but the API document, excuse me, the header file has no word on how this is supposed to be done.

Yeah, yeah, I said a month ago the release would be "next week". Sorry. Got stuff to do. =( Well, expect it soon...

Version 1.2 of XMMS InfoPipe has been released.

I moved it to my CVS system (before it becomes entirely unmanageable), added some patches from people (late, as usual), tinkered with it, and finally kicked it out of the door. And it works!

It adds some of the patches from other people (including a highly interesting "multisession" patch) and includes some new scripts (PHP version of the info script, and my now-non-famous speech synthesis hookup).

Probably not bad. Get it if you would like the programs, too, know what you listen to. =)

Last night I was, obviously, lying in my bed.

Listening to stuff with XMMS.

And then I noticed I had put to the gigantic playlist of mine a piece of instrumental music that I had not heard before.

So, I just had an idea.

I jumped up, wrote a small Perl script that takes the song title from the XMMS-Infopipe and feeds it to Festival.

Then I bound the script to a button on my remote control I use to control XMMS.

So now I don't need to get up to see what the hell is the name of the song that is playing! =) Strange ideas in the middle of the night.

A friend told me someone had written something similar for iTunes in Applescript. Well...

Uh, it's nice to see that when I write Perl at four o'clock in the morning, I still include "use warnings; use strict;" - those are the sort of things everyone should have in their reflexes =)

1 Feb 2002 (updated 1 Feb 2002 at 23:20 UTC) »

Whoo, it's been pretty quiet on the code front in my case =)

Probably because I've been busy with Most Other Stuff, uninteresting things, and really interesting other things. Could it get any more vague than this?

Well, anyway, today I did code something.

I discovered uptimed, a much better alternative for ud. I converted my old uptimes to its format, and decided I needed to put that to web.

The problem: The machine's home page was written in JSP. Tomcat and Apache don't like each other so much that I could do a virtual include request to a CGI program... so it's all Java or nothing. So, I couldn't use the included CGI.

I used a quick "include stuff from shell command uprecords -a" until I wrote a JSP to parse the recordfile. Now it shows the thing as a HTML table.

If my machine somehow is up, you can see the results. I'll clean it up and release it later.

Too much Java.

Oh yeah: Someone in the Usenet was obviously asking for a school/course work solution for some trivial problem... in Java. I gave the answer... in Lisp....

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