Blog
Page: 0 ... 5 ... 10 ... 15
When Linux sucks, it sucks more than anything else.
Date: 14/10/2003
Did you know that popen wasn't thread safe?

Yeah well it ain't. So those nice little 3 liners (popen, fgets, pclose) now turn into a pipe, fork, dup, close, exec, waitpid, hndstate mess. Of course put it in a function and forget about it.

But why? Why not fix the function! It's not the '90s anymore people, where Linux is just for uni students with too much time on their hands.

Btw gdb 6.0 is out. And it fails nicely when you call fork in a program linked to pthreads (not even calling pthreads yet). However with gdb 5.3 you can call fork, exec etc and it all works but popen is still poison.

So now I have the joy of hunting through LGI and removing all calls to popen so that things "Just Work (tm)".
(0) Comments | Add Comment

The Evilness of W32.Swen
Date: 11/10/2003
Despite the rather excellent virus protection in Scribe my dad got swen'd. Simply because it was a convincing enough email pitch (using real microsoft.com graphics and HTML layout) to cause him to save the exe out and run it, despite the explicit warning about virii when he tried double clicking the attachment.

It's some sort of mark of acheivement for a developer when your own parents (esp. non-technical) happily use your software from day to day.

Anyway, so their laptop was swen'd and it was my job (of course) to unswen it. So I tried the usual things:
  • Open regedit - can't the virus has blocked all exe's from loading. Darnit!
  • Boot to DOS and delete the virus - Ok, but now what? I still can't run exe's.
  • Find symantic's "how to" on removing the virus. Which means typing in a bunch of stuff in DOS mode to removed the registry problems. Then run the virus remover.

    So I needed to transfer the virus remover to the laptop, which was where the fun really began. You see their aging laptop has no network of any kind, so I'm reduced to removable media or a laplink type arrangement. Firstly I no longer have a floppy in my box so I pulled out the laplink cable and plugged it in.

    A long time ago I wrote "i.Share", a simple laplink style app to transfer files over a parallel port link. So I fired that up on the laptop and went across to my machine to fire up the other local copy. But there was no local copy, I had somehow misplaced it and no amount of searching through old archives was to yeild a working copy. So I started rewriting the core parts of the application and sending a file from the laptop to the desktop and decoding the simple wire protocol. Then I remembered that the source code was on the laptop as well! Duh, I had it there to test that side of it when I was originally writing the code. So I retyped by hand the receive file function into the desktop and ran it. Then I sent the source code over this make shift link, and thus restoring the desktop copy to it's original glory. Me thinks a better backup stratagy is needed.

    Anyway I think that some more severe anti-exe attachment code is needed in Scribe. Something along the lines of an option to "Delete executable attachments on sight!" type thing to really make absolutely sure that you can't infect yourself. Scorch that earth!
  • (0) Comments | Add Comment

    Lgi Intergrated Developement Environment
    Date: 3/10/2003
    Well after all this time bashing away at code in Linux I've given up with Kate and jEdit and written my own IDE using Lgi (of course).

    So my life is not complete or anything, but life in Linux is marginly less painful. Of course I had to fix it myself didn't I. *sigh*

    So far it's got a bunch of stuff:
    • Import M$ .dsp files.
    • Heirarchy of folders to store links to source, headers, and resources.
    • Calls external make to build executable.
    • Project wide settings for tab + indent size, hard tabs, show whitespace.
    • Uses Ted/Scribe text control.
    • Mdi panes for documents.
    • Captures build output, console output of application running, and find in files info. Allows you to "next msg" through all that with F4.
    • Projects can have dependencies on other projects.
    • Project file format is simple XML.
    • Find in files function.
    Things I'm thinking of adding:
    • My own build system: dependency checker, build options etc.
    • C/C++ source code browsing functions like "Show Defn", "Find All References" etc. Yum!
    I won't make a binary release of this yet, but all the source will be in each Lgi release so you can just build it yourself.
    (0) Comments | Add Comment

    "Help I've Fallen And I Can't ShutDown"
    Date: 12/9/2003
    What is it with computers and switching off?

    My Windows install has developed a case of shutdownitis, and Linux tells me to "Power Off Now". Thanks... Linux... yeah real great, why don't I manually help you to switch off.

    I kinda expect Windows to Suck(tm), but I don't know what the deal is with Linux. This is like the new millenium right? Where things "Just Work"?
    (0) Comments | Add Comment

    Bayesian Filtering
    Date: 9/9/2003
    The most recent release of Scribe has a new feature which you may have heard of: Bayesian Filtering. Which in a nutshell uses word count statistics to classify email into different groups. This idea has been sweeping the mail filtering industry by storm since Paul Graham published his Plan For Spam.

    For my own sanity (I get 40+ spam a day) I decided Scribe needed better filtering, and Bayesian represents the best technology at the moment. So I've been testing my implementation of Bayesian Filtering for the last few weeks and it's working really well. You may have even noticed it in the filters menu of the last few test builds.

    If you want to know about how to set it up click "more".
    (0) Comments | Add Comment

    Mozilla meet Scribe, Scribe... Mozilla
    Date: 4/9/2003
    It seems after many months of "mailto: is not a registered protocol" I've finally managed to beat Mozilla [Linux] into submission and get it to open Scribe to send an email.

    This 'wizardry' was accomplished with MozEx, an extension for Mozilla (why it's an extension and not PART of the application I don't know). Anyway, with a non-user friendly command like:
    /.../Scribe/scribe -m  "%a" -c "%c" -s "%s"
    
    MozEx will pass all the parameters of the mailto: link down to Scribe, where with some newly written shared memory black magic it passes the arguments to the running instance of Scribe and up comes the compose window with all the arguments in the right place.

    Ahhh, Genki!
    (0) Comments | Add Comment