Blog
Page: 0 ... 5 ... 10 ... 15
One for the Windows Refugees
Date: 3/11/2003
Like most Windows refugees I use Mozilla (and no NOT firebird, cause it's still woefully buggy) and there is this little annoying thing that it does differently on linux to the windows build. When you (mostly accidently) click the middle mouse button Mozilla loads whatever is in the clipboard as a URL.

This is purely the most annoying thing about Mozilla.

But there is hope! Type in "about:config" in the address bar, find the value "middlemouse.contentLoadURL", double click it and set it to false.

Then just browse on in peace, safe from stray clicks.
(0) Comments | Add Comment

The Abysmal State of Debugging Under Linux
Date: 26/10/2003
This happens all the time:
lemon% gdb ./scribe
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) r
Starting program: /home/lemon/matthew/Lgi/Scribe/scribe
[New Thread 1078238400 (LWP 10623)]
Screen: 1600 x 1200 @ 24 bpp
InScribe v1.86 (Test43, Linux v2.4, Debug, Kde)
[New Thread 1086864688 (LWP 10640)]
[Thread 1086864688 (zombie) exited]
[New Thread 1097809200 (LWP 10644)]
[New Thread 1116949808 (LWP 10647)]
[New Thread 1125342512 (LWP 10648)]
[New Thread 1133735216 (LWP 10649)]
[Thread 1116949808 (zombie) exited]
[Thread 1125342512 (zombie) exited]
Couldn't get registers: No such process.
(gdb) q
The program is running.  Exit anyway? (y or n) y
"No such process" AND "The program is running"... great... just great. The application just 'exits' somewhere... who knows... gdb won't tell. However it runs fine outside the debugger. So the debugger is screwing up the execution environment so programs exit at strange points. I LOVE gdb... it's the best! *vomit*

So most of the time, to debug non-trivial applications on this supposedly "enterprise ready" operating system you are left with printf.

Super! I love printf!
(0) Comments | Add Comment

More Linux Whining
Date: 22/10/2003
I thought it'd be nice to add cursor support to my LGI apps, so that the mouse cursor changes over splitters, and other active areas of various widgets.

So I discovered XDefineCursor pretty quickly, and it works just fine to change the cursor.

Then comes trying to reset it back to the normal system arrow, and according to the docs you just:
XDefineCursor(Display, Widget, None);
Yeah right. Well THAT didn't work. Crummy implementation, or bad docs, I don't know but the end result is that the cursor just inverts all it's pixels when I try and change it back to the normal arrow. And XUndefineCursor does the same thing before you post some rebuttal in the forums ;)

Stupid X. Bring on Y!
(0) Comments | Add Comment

Loathing Linux
Date: 21/10/2003
Right now I've just had to power cycle my linux box twice! For the same stupid reason that Windows XP raised my ire: it can't multitask to save itself.

I don't care whether you can run 20 apps at once. I do care that when user land task "A" starts chewing up all available memory (inc. virtual) as fast as it can that I have at least a 1 minute window of opportunity to kill the sucka via the Task Manager or the command line, or SOMETHING!

Linux gave me about 5 key strokes on the xterm before it locked solid... which I used to type "top" and watch the first line of output half appear and then stop... Ctrl-Alt-1... nothin... even Ctrl-Alt-Del wouldn't shut the machine down. The scheduler was simply stuck paging massive amounts of memory onto disk.

So reboot... and use ulimit to limit the memory size of that process. Great idea! If ulimit worked as advertised! Good 'ol Linux reliability kicking in.
ulimit -Sd 100000
100mb should be safe enough I think...

"ps -A"

Ctrl-Alt-1?

Ctrl-Alt-Del?

OH COME ON!!!!

*kicks the power button*
(0) Comments | Add Comment

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