20 Sep 2002 redi   » (Master)

fxn: re username filters in MyAdvogato, I'm not actually desperate for username filters, all I need to do is resist the temptation to read the latest stupid troll by you-know-who, it's sort of a sick compulsion to see what crap he'll spew next, and just skipping those entries is much easier and saves the trouble of maintaining an ignorelist external to my head. As I understand it your diary ratings report shows other users' ratings as seen by you. If you've rated someone directly the rating will appear with a confidence of 1, otherwise the confidence is a function of the distance (and certs?) between your user and the rated user. Update: It seems that if you've cert'd user A, and A has rated B's diary, then the rating you see for B is strongly affected by A's rating (in other words by cert'ing someone you've implied you trust their ratings more significantly than some random user. Presumably this trust of ratings propogates outwards with the web of cert's.

How I Learned to Stop Reinventing the Wheel and Love UNIX

This is going to read like a sales-pitch written by a marketing dept. but I'm just trying to get some ideas to coalesce. It's been at the back of my mind for a while, but I've only recently realised just how easily PStreams lets you tie together UNIX utilities in the same way as pipes do on the command line or in a shell script, letting you use existing tools directly inside your C++ program. Noone writing a scripting language would write their own text manipulating functions, they'd use an existing tool such as sed, but C++ programmers all-too-often reinvent the wheel, because to call external programs you have to set up the necesary pipes, call fork(), exec(), wait4() etc. With PStreams all you do is instantiate a single object, which takes care of calling and error-checking all those functions, and then you write to and read from the process as with any IOStream object. To be honest I'm rather surprised this hasn't been done a thousand times already. While I was writing it I read an article in CUJ Binary Code Reuse in a Linux Environment where "Traditional UNIX-like filters meet C++" which is pretty similar, but the interface is IMHO far less natural than with PStreams, and it doesn't map as well to the familiar syntax of pipes on the command line. Somehow I seem to have almost accidentally created a useful and powerful way to write C++ programs as you'd write shell scripts, and AFAIK there's no existing Open Source equivalent. Blimey, can that be right? Surely not. All I was doing was scratching an itch.

My plans for the library are to abstract the creation and control of the new process from the I/O facilities of the existing classes, which would provide a general-purpose process management class for C++, that could be used to implement the PStreams classes. Someone please stop me now if this has been done (well) already.

It's a good thing this is only a tiny project (in terms of lines of code) as I'd never finish it otherwise. It'd be done in a week if I stopped getting wasted every night and finished adding buffering to the stream classes. Not tonight though, it's friday, so I'm going for a pint.

Latest blog entries     Older blog 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!