2006-04-30 10:41

Open Source Remix

One more thing to love about Open Source/Free Software:

Maybe each screw doesn't work exactly as you want. But you can hit them with a big enough hammer. And if you have a big enough hammer, every screw is a nail.

Mgetty+sendfax sucks a little in some areas. It supports no class1 faxes (ok, it may do if you rebuild with a switch it says doesn't really work).

Efax sucks a little in some areas. It has no spooling mechanism. It has no way at all to be used decently from windows clients.

So, remix them!

Take efax's efax command (the one that actually sends the faxes), and mgetty+sendfax's sendfax command.

They are quite similar. So, write a tiny shell wrapper that makes efax look like sendfax.

And Voilá. Mgetty+efax, which works on class1 fax/modems ;-)

The wrapper itself is left as an exercise for the reader.

2006-04-29 12:51

The state of simple Linux fax server software

A customer asked me to implement for him a simple fax serving solution.

Here's what he wanted:

  • A central received fax repository.
  • A way to send, as simple as possible (the classic fax-printer scenario).

I vaguely remembered knowing that Linux could do that, so I said yes. Then I started trying to figure out how to do it.

The 500lb gorilla of linux fax software is of course Hylafax. And it's just about as pretty and cuddly as a 500lb gorilla, too!

Put it simply: waaaaaay too much software for the goal.

Hylafax is a very complex software package, and while it does have some tools to make management simple, it would probably have forced me to support this thing forever. And that's not mi idea of fun.

Not to mention that I couldn't find CentOS/RHEL4 packages (not too big a problem, but annoying).

Then I spent 10 hours trying to make it pick up the phone. And I started being annoyed.

So, I started looking for simpler stuff, and the second gorilla seems to be mgetty+sendfax.

The more I read about it, the more I liked it, and I finally implemented using it.

The good news:

  • It's really simple. I was receiving faxes in 5 minutes.
  • It was way less fidgety about modem setup than Hylafax.
  • The fax quality was very good (probably not their merit, but it was nice).

Now, the bad news:

  • It's old software. Check the webpage and look at the broken links and ancient releases.
  • The windows client support was pathetic.

How pathetic: ok, here is how you make it work:

  • Setup mgetty+sendfax enough that you can make it send from the CLI.
  • Setup samba enough that you can do a shared printer from the windows side.
  • The shared printer should print to printfax.pl (look at the germglish page).
  • On the windows side, start respond and then when you print to the fax, the fax server hooks to the client's port 5555, and respond show a huge popup asking for the number, recipient, and sender.
  • Explain to your client that where it says "name" he should put his email address. There is no way to save that address so it's not asked again.
  • After the fax is sent, the user gets an email (if he filled the form correctly) with the report.
  • The alternative notification mechanism is winpopup. Which isn't there in XP anymore anyway.

Amazingly, it does work fairly well, and the client is not terribly annoyed. I would be, though.

So, what can be done:

  1. Now that there is a PyQt4/Win32 I may write a respond replacement.
  2. Maybe printfax.pl can be extended/replaced to give report information to that respond replacement.

Sounds like a nice fun project... NOT! But it is a fairly simple, necessary one.

So I will probably do it. Or else, I may have to learn how to properly use HylaFax.

2006-04-27 18:11

IUP/Qt: Timers and images

Well, timers are done, including the idle timer, and images are kinda there.

It is much simpler to add stuff now that the proper OO skeleton is in place.

However, I am not making progress in the iupcontrols library. Then again, I have the flu.

2006-04-24 20:25

Further IUP/Qt advances: Canvas

I keep working on it, which is nice. I have finished the skeleton of the implementation of a Qt driver for the CD canvas.

I had it kinda working with the generic X driver, but it sucked a bit to have this largish chunk of Motif code I didn't understand in the middle of it all.

It has only the most basic stuff implemented, and the scrollbar stuff is not there, but it does draw and set colors ;-)

So, right now, the next step is getting the iupcontrols library up, but that shouldn't be too hard, I think.

But, we'll see.

PS: If anyone reads this and wants to check it out, just email me, I can ship it.

2006-04-24 15:03

El mundo es un pañuelo

That's an expression ("The world is a handkerchief") I have often heard, and often found true. It means the world is a very small thing and it's hard for something (or someone) to get lost in it.

Here are two examples:

I went to school with this guy. We were never friends or anything. I had completely forgotten about him. One day, I was walking to the bus stop after teaching, and someone calls me.

It's him. This was roughly 15 years after the last time I saw him.

So, we start talking: he worked 2 blocks away from where I did. And 550Km away from our school, and in a 12 million people city.

He had lived until three weeks before in an apartment around the block from my own.

He usually went to the same cafe I did, in the corner of our streets, but he did so 90 minutes earlier than I did.

And we had never seen each other.

Then we did. On a third place, which was not related to neither of our jobs or homes.

Second example:

I met Rosario on May 25th 2004. Except I almost met her in 1995 (or so).

I was telling her last night about an affair I once had with a girl that lived a ridiculous distance away from me (800km or so) and how I had last seen her in a congress of the FUA (Argentina's students organization) that took place in Santa Fe, where I was born.

That congress had one party (where I broke up with this girl) in my university's law school.

Well... Rosario was there. I don't remember her, but knowing the place where that party took place, I could not have been the whole night without passing 10 feets away from her.

In fact, I can't get out of my head a false memory of a girl looking remarkably like my wife sitting on a planter with a worried look in her face (she had had some issue that day), with a drink in one hand and a cigarette in the other.

I know I did not see her because I didn´t remember this yesterday, but... I ended leaving the party with another woman (oh, being 24, rash and pretty stupid... that woman was trouble). What would have happened if I didn't, and started talking with the woman sitting in the planter?

2006-04-22 17:58

Where IUP/Qt is right now

It has a decent backend, even if it's limited.

Not all widgets are implemented, but they are easy to add. Not all attributes are implemented, but they are even easier.

And it can show rather complex windows, too:


2006-04-22 16:07

Now I remember why I don't like C++

I have refactored IUP/Qt into a lovely object hierarchy. And I now remember why I dislike C++.

Here's the basic problem (code may be wrong, I don´t have the broken versions anymore):

I have a base class IObject, that has stub setters/getters for all the IUP attributes.

For each kind of widget, I create a class that inherits from IObject and the matching Qt widget (example: QDialog).

These have to be hooked into an Ihandle structure through the use of a void * (remember, that's C, I have that too ;-)

Now, this was my first naive approach:

Ihandle *n;
IQDialog *d=new IQDialog();
n->handle=d; //handle is a void*

That compiles ok. However, when you try to call a d member later (and I know I am using old C casts... they had worked for me until today!) ...

((IObject *)(n->handle))set_title("Title here");

Blammo, segfault. Why? Because in one of the assignments to/from void *, the pointer for some reason starts to point elsewhere.

Here´s what Gliptic at #C++ suggested, and it does work:

Ihandle *n;
IQDialog *d=new IQDialog();
n->handle=static_cast <void *>(static_cast < IObject *> (d));

Right, I have to cast it twice.

And here is how you get it back:

(static_cast < IObject * >(n->handle))->set_title ("Some title");

Isn't this just ridiculously weird for anyone coming from any other language?

Or am I missing something completely?

But the good news is, it works ok, and the Qt backend now has a decent structure to hack on.

2006-04-21 15:12

IUP/Qt preview

Ok, here is version 0.0.1 of my Qt4 backend for IUP . It's not very good, but a bunch of things work. A whole bunch more do not, of course.

I am showing this just because I want to rewrite it, because I noticed that I am writing it like it was Motif still, and I must understand this is actually C++ and Qt code ;-)

Using it along with DIUP you can write silly Linux/Windows/Mac GUIs from D, or you can use C. No LUA yet.

You can download it here (click on the "Free" button and wait a while).

You will need Qt4 and qmake to make it work.

2006-04-19 13:00

IUP/Qt is advancing

I have callbacks (some), geometry management, LED files loading (resource files) and it seems no hard parts are left.

That would mean the remaining work is routinary, even if it's a large amount of it.

It's nice that I can switch back and forth between the Motif and Qt implementations just by setting LD_LIBRARY_PATH to compare :-)

Contents © 2000-2019 Roberto Alsina