2004-10-28 20:47

My week so far

This last week has been one of the most exhaustings I can remember. And that includes the one I didn't sleep, while drinking heavily with all my schoolmates in Bariloche (local tradition, never mind).

Let's see...

Last friday, after finishing work at 21:00, I boarded a bus at 23:20 with Rosario, headed for my birthplace, Santa Fe. That's 450km away, and it took until 5:30 am.

There I was greeted by my brother, who I had not seen in almost three years, and we went to his place to waste some time because I had to go buy a gift for my niece, who was having her 5th bithday party.

So, I slept about 2 hours, and then we went, bought some Barbie make up (my niece is going to be a model, trust me), and we sailed off, in his Peugeot Partner, towards Moises Ville (his town), about 200Km to the left.

Bad news: the Partner has only two seats. There's three of us. So, I went bouncing in the back, in a mattress, Rosario and Santiago (my brother) at the front.

We did that for about 80Km. Then we picked up Romina (ex-nanny of Muriel, my niece) and Martin (Romina's chatterbox, 1.5 year old).

So they went to the front, and Rosario, I, a few pounds of meat, a PC CRT monitor, a few suitcases, the gifts and some flowers went on the back.

Then we arrived at the next town, some 50Km further. I was about to get sick, so, when we picked up the Barney & friends foam suits, I switched places with Romina & Martin (hey, I'm about twice the size of both of them... together).

That's how we arrived at Moises, around 3PM.

Rosario and Santiago went for a nap, I helped Sandra (Santiago's wife) pick up some stuff, like, beverages or whatever, and at 16:30, the birthday party started.

Nice party. Muriel dressed like a princess (she's too cute, really. Princesses are usually uglier ;-) 40 of her best friends (in a town pop. 1800), two inflatable castles to bounce in, cake, and all the sandwiches you can eat.

Good thing Rosario used to work teaching kindergarten, too, so she lent a hand...

Highlights of the day: Muriel waltzing with her uncle Iair dressed as the Beast (Disney version... ok, he looked more like the creatures in "The Village" to me, but to each his own).

Listened at random: "you know, he could have just used a zipper in his belly as a beast costume", which is an absolute defamation of the boy ;-)

Rosario painted every little girl as if they were about to be on TV...

Now, I have been to some 5-year-old gatherings, and this bunch has to be the sweetest-natured children I ever saw, except maybe for the kids at Urdinarrain, who even say hi to strangers on the street.

At 19:30 everyone went away, and we rested a little, then headed for one of Sandra & Santiago's business, a cybercafe/ping-pong den for a nice asado (that's why there was meat in the truck :-).

Awesome meal, laughed until Santiago seemed about to burst something, disgusted the female company with anecdotes, Muriel sleeping in a corner, while kids were playing counterstrike...

The following day more of the same, knishes, empanadas, long nap, thinking of how the hell we could get back to Buenos Aires before monday 18:00, when I had to meet a customer (yeah, that's right).

Sandra took us in a scary pickup ride in the darkness over a dirt road to Palacios, the town on the pavement road, where we waited in the darkness for a bus.

That bus was headed to Rosario (a city, not my girlfriend), and it was full, so Rosario got a seat, I got to stand up (and smooch) until Sunchales (some 40Km) where some people left, and we got seats, and then nothing much happened until we arrived, around 1am.

Then... no buses until the morning. We had almost no money now, but what the hell. We ate a couple of sandwiches, took a room in a cheap nearby hotel, and took a bus (finally a nice one) at 9:15 am.

Arrived at B.A. at 13:30, she went home, I went to work, went home at 21:30, collapsed at 21:32.

Discovered my house was infested with fleas at 21:33 (how? My cat never leaves! It's a 7th floor!)

lost consciousness at 21:38.

And it was still only monday.

Then lots of other stuff, like trying to buy a suit with Rosario and Maria Feray (her sister), and waling about 40 blocks looking for a piece of cloth... lots of work... even some hacking...

And you know... I have a ticket for San Juan (oh, roughly a 14hs bus ride ;-) for tomorrow. Once I get there at 10am on saturday, I will have to dress up for a party (a wedding, not mine), and then we will come back in a car. On sunday.

That means I am going to spend 12 hours in a car with Rosario, her sister and their father. Have mercy on my soul if noone sees me again!

I forgot to mention: I saw Nahuel, a black cocker spaniel that lived with me when he was a puppy... many years ago. He's blind, but he still recognized me. Emotional moment :-(

2004-10-27 23:18

konqueror/embedded hacking continues

I have roughly 95% of it building with kdelibs 3.3.1, with the patches comitted up to now.

I have some weird problem with khtml_part where it doesn't see a function that's defined right there, but I am starting to get dizzy.

It's not very difficult coding (mostly cut&paste) but it's a large piece of it and this is a slooow computer :-)

2004-10-26 02:47

Konq-embed hacking progress

Ok, I have done a little about that.

Turns out I was patching it for HEAD, not 3_3_1, so I fixed that, and now the available patches work for both versions.

Of course that doesn't mean either one actually builds, only that the stuff that needed to be patched for 3.2 is now patched for newer versions as well.

The biggest problem with this piece of code is that in order to do it nicely, I have to test every change I make agains sources prepared from 3 different KDE releases (or rather, about 5 or 6, but I will not do that), so that when I touch one of the dropin/ classes to provide a 3.3 interface, I don break the 3.2 kdesrc/ build.

And I am oing it in a pretty slow box, so each build takes a couple of hours.

Ergo, I am doing it wrong. I am going to hack against 3.3.1 until it works, then 3.2 until it works, then 3.3.89.

Then all around again, until all three work without trouble. It's not going to be too easy.

To make matters worse, I realized that I don't need it to work with 3.3 for what I wanted, since a 3.2-based KHTML is already good enough.

Oh, well, at least I am hacking in public CVS again. Hopefully I won't break anything too badly.

2004-10-22 14:31

Some KDE-related hacking

Since porting HTML display engines from one place to another is all the rage these days, I did a little hacking on one of the oldest forms of the art:

KDE's kdenox module contains konq-embed, which is, among other things, a port of KHTML to almost-pure-Qt (I think).

So, I am hacking to make that really-pure-Qt.

So, it's basically porting KHTML from KDE to Qt.

Why? Because I want a decent HTML widget for PyQt that doesn't require kdelibs. So people using PyQt/Win32 can use it, for instance.

I don't know if it will work (hacking C++ code is almost painful to me nowadays).

2004-10-21 18:20

Sometimes people just don't think

ISC makes dhcpd and BIND.

Dhcpd can update a BIND zone using a variety of methods. The one I saw examples of is called the "interim" method. It requires that you create what's called a TISC key, used by BIND to authenticate the zone update requests.

All fine and dandy. BIND even has a tool to generate such keys.

Too bad about 1 in every 8 times, the key will include a / and will be a syntax error if you include it in a BIND named.conf file.

A minor bug? Sure. But come on, noone has noticed it?????

2004-10-15 11:11

Now, this is news to me.

Tavia seems to be another KDE web browser.

I say nice.

Semi-related:

Because of a question on the PyKDE list, asking for a more complete HTML widget using Qt (not kdelibs) I am looking at kdenox, which is supposed to be a Qt-only (QT/E) konqy. Perhaps ripping off the khtml piece of it won't be too hard, and then it can be sip-wrapped.

Probably nothing will happen with it, but I am looking ;-)

2004-10-15 09:20

Nice graphics

Danny Allen has been kind enough to send me some pretty pieces for my Ongoing Game Development Effort That Has No Name Yet (But Should Not Be Called Anything Jewelry-Related) [1]

So, thanks Danny!

I think I am going to switch to SVG-based image loading, too.

[1] Or, as I call it, OGETHNNY(BSNBCAJ-R)

2004-10-13 16:24

On other news today...

Python code really doesn't look good on planetkde, so follow the link to my page to see it right if you are there ;-)

2004-10-13 16:03

Adventures in Hi-Fi

As I blogged earlier I am writing a game (and yes, it's pretty much playable already).

One thing I didn't mention is that I never wrote a game before. Yeah, I know everyone does it as one of his first projects, but I never did.

So, there are some things I really have no clue about [1], like sound and moving graphics around.

For the graphics stuff, QCanvas is just fine and dandy, but to make things bloop and warble and squeak when the time is right, I found Qt's sound support somewhat depressing.

Come on, NAS? Who uses that? And what about music? I had no idea.

So, I started trying to follow one of my leading principles of development: find a way to make it Someone Else's Problem (TM).

The usual way to do that is finding a library that handles the problem, write minimal glue, stick it to the side of the program, tell the program that's his new arm, and forget about it quickly.

Here's what I found.

Mi Dios!

I thought I should start by adding one of those annoying little tunes every game has. It's just a game tune, I don't want to have to include a 3MB OGG file for it, so I wanted an instrument-based format.

I remembered MIDI tunes. You may know them as ringtones nowadays, but they used to be just cheesy tunes generated by your SBPro's FM generator, not your phone.

In fact, I remember having a little proggie called playmidi, that would do that in Linux.

Well, it seems that in the past few years, either sound cards have forgotten how to play them, they fell out of fashion, or something, because the only things I found that could play MIDI are monstrosities that require a 9MB digital instrument set. And how was I to include that along with my 25KB game???

So, what's next? I had a C64, so...

MOD me up!

MOD files are like MIDI files, only the MOD includes it's own instrument set, called samples, and instructions on how to repeat and alter those samples to make a tune.

Good news: there are nice-sounding, funny MOD files that are about 30KB in size.

Better news: There is a popular library to play them! It's called Mikmod, and your distro has it (and it's a dependency for KDE's multimedia packages too).

Even better news: It has support for playing simple sounds (samples in mod lingo) by calling a couple of functions.

Awesome news: It includes a software mixer so you can just tell it to play this, then play that, then that, and a tune in the background, and everything sounds at the same time.

So, we have a winner. This baby can handle everything I need for the game!

But... is that a snake in your pocket?

I can't find a Python binding for it. I am sure as soon as I post this article someone is going to come up and tell me, here they are, moron! But I just can't find any.

So, I decided to do something I wanted to do already and learn to use Pyrex. Pyrex is a tool to write python extensions, with almost-free access to C libraries, in an almost-python language (only minor syntax differences).

That way, I could write a Python module to use Mikmod.

You know what? It was almost scarily simple [2]. I didn't wrap all of Mikmod [3] because I don't need it, but now I can do stuff for games and apps almost trivially.

Even more: Pyrex has awesome distutils support, so building the extensions, usually a pain in the rear, is trivial (mostly you just copy and delete stuff, with some search and replace).

One thing I found I did nicely is this: Mikmod requires you to call Mikmod_Update every once in a while so it fills the soundcard's buffer with stuff to play. If you don't, it skips.

So, I just started a thread that loops and takes care of it. You don't even have to know about it to use the extension. Oh, sure, if your Mikmod is not threadsafe, it breaks. Well, get a decent Mikmod package, then.

How does it look?

Here's a whole noisy proggie

#Load the modules
import mikmod, time
#Init the library
mikmod.init()
#40 voices, 20 for music, 20 for random sounds (overkill)
mikmod.setNumVoices(20,20)
#Enable sound, starts the thread that pushes sound, too
mikmod.enableOutput()

#Create a module, that is, a music track
module=mikmod.Module("BasicInstinct.mod")

#Load two samples, just a couple of noises
s1=mikmod.Sample("lost.wav")
s2=mikmod.Sample("swap.wav")

#Start playing the song
module.play()


#For the duration of the song, each second, make some noise


while module.active():
        s1.play()
        time.sleep(0.5)
        s2.play()
        time.sleep(0.5)

#Close the mikmod library, stop the thread, etc.

mikmod.exit()
[1] As if that would surprise anyone!
[2] On the other hand... waiting for stuff to compile... how quaint.
[3] Actually, I am wrapping almost all of Mikmod, I am just not exposing it to Python because I don't need it.

2004-10-06 21:02

KSPread to the MAX!

Rob, I think the problem here is that you don't know how to use KSPread.

Here's the correct syntax for your examples (untestd, but should work):

=F7 * ( 1 + MAX( 0.20 ; (F7-F2)/F2/5 ) )

=MAX(A1;100)

In fact, the one that you mention as working, MAX (A1:A2) works by coincidence (Unless you really want the max over a range, instead of the max over two cells).

Can we get that not-grumpy week anyway?

Contents © 2000-2019 Roberto Alsina