muttley hates software

python and its dlopen implementation

From: Simon Wistow
Date: 12:58 on 25 Jan 2006
Subject: python and its dlopen implementation
It's a lovely sunny Wednesday. I recline, trendily, in my Herman Miller
Aeron chair and take a sip from my Latte revelling in my meeja world
comfort.
I get a phone call.
The python wrapper round a C library I recently released a new version
of is not working claiming that it can't find some symbols.
"Oh!", I chuckle, "They probably just didn't set the LD_LIBRARY_PATH
right".
I investigate. Everything seems in order yet still these undefined
symbol error messages are appearing.
"How rum!" I think, switching inexplicably from meeja-luvvy to circa
1915 toff-about-town.
Even rummer is the fact that it's not *my* C library that's failing.
It's not even the C library that my lib links to. It's the plugins for
the second C library. In short, the situation looks like
foo.py OK
- libfoo.so OK
- libbar.so OK
- libbar_plugin1.so FAIL
- libbar_plugin2.so FAIL
- libbar_plugin3.so FAIL
And the plugins are failing because they can't find symbols in
libbar.so. Which are there because nm says they are and it's in the
LD_LIBRARY_PATH because libfoo.so is loading it.
I try gdb, I try Totalview. Nothing seems to explain the fact that this
just shouldn't be happening. It's almost like the LD_LIBRARY_PATH is
being clobbered between libbar.so and the plugins.
A cup of tea. And then a G&T for good measure.
Scratch my head.
No! It couldn't be.
Oh, yes it could.
Python, by default, dlopens its extensions which is sensible. And
depending on a compile time flag it uses RTLD_NOW or RTLD_LAZY.
Which is fine.
Except that means that symbols aren't propagated down through any
further dlopens like, for example, the ones that libbar.so is doing to
fetch its plugins. Both of those should be ORed against RTLD_GLOBAL
I'm sure there are reasons why not doing this is the default and, to be
fair, you can get that back by doing
import dl
import sys
flags = sys.getdlopenflags()
sys.setdlopenflags(flags | dl.RTLD_GLOBAL)
but this is "*HATES* software", not "Accept ugly workarounds as being
acceptable software"
KEEEL THEM. KEEEL THEM ALLL.
Oh look, now I'm some sort of cliched Mexican Bandit Lord.
Bastards have turned me mad.

kcalc

From: Simon Wistow
Date: 16:34 on 28 Oct 2005
Subject: kcalc
I'm not sure where the retardedness of this lies but, you know what, I'm
going to blame kcalc and the cascade of attention deficit disorder
teenagers who wrote it.
I type kcalc at the command line, I expect a calculator. I'm pretty sure
that with Tk, Fltk, Vb, Delphi, MSVS, Xcode or a host of other tools, I
could knock up a simple calculator app in about 30 minutes. It would be
lean, clean and simple. It would fire up in a couple of milliseconds,
calculate things and then close. As a potential calculee with a thrist
for multiplying and dividing I need no other functionality or
information. Put numbers in. Get numbers out.
So why the fuck does kcalc feel the need to tell me all this crap when
it starts up? Hmm? Does that aid my calculation? Does it sooth my
mathematically furrowed brow? No?
Fucking linux retards.
Creating link /usr/people/simon-wi/.kde3/socket-guinea.mpc.local.
Created link from "/usr/people/simon-wi/.kde3/socket-guinea.mpc.local"
to "/tmp/ksocket-simon-wi"
Creating link /usr/people/simon-wi/.kde3/tmp-guinea.mpc.local.
Created link from "/usr/people/simon-wi/.kde3/tmp-guinea.mpc.local" to
"/tmp/kde-simon-wi"
kbuildsycoca running...
Id 'kde2.2/b1' was already in done-list!
Id 'kde3.1/cvs' was already in done-list!
Id 'kde3.0' was already in done-list!
Id 'kde-3.1-toolbar' was already in done-list!
Id 'kde2.2/r1' was already in done-list!
Id 'kde2.2/r2' was already in done-list!
Id 'kde2.2/r3' was already in done-list!
Id 'kde2.2' was already in done-list!
Id 'kde3' was already in done-list!
Id 'kde3.1/r3' was already in done-list!
Id 'kde3' was already in done-list!
Id 'kde_3_1_sizeChanges' was already in done-list!
Id '25082001' was already in done-list!
Id 'kde3.1' was already in done-list!
Id '04112002' was already in done-list!
Id 'kde2.2/r1' was already in done-list!
Id 'kde3.0/r1' was already in done-list!
Id 'kde3' was already in done-list!
Id 'kde3.0r1' was already in done-list!
Id 'kde3.0/r1' was already in done-list!
Id 'noatun20' was already in done-list!
Id '1' was already in done-list!
Id '4' was already in done-list!
Id '5' was already in done-list!
Id '6' was already in done-list!
Id '7' was already in done-list!
Id '8' was already in done-list!
Id '9' was already in done-list!
Id '3.1-update-identities' was already in done-list!
Id '3.1-use-identity-uoids' was already in done-list!
Id '3.1-new-mail-notification' was already in done-list!
Id '3.1.4-dont-use-UOID-0-for-any-identity' was already in done-list!
Id 'KNewsTicker-0.2' was already in done-list!
Id 'KNewsTicker-0.2-Rename-KDE3' was already in done-list!
Id 'KNewsTicker-0.2-Rename-KDE3.1' was already in done-list!
Id 'preKDE3_a' was already in done-list!
Id '3.1-1' was already in done-list!

gcc 3 and the iostream debacle

From: Simon Wistow
Date: 10:31 on 31 Aug 2005
Subject: gcc 3 and the iostream debacle
There may be plenty more of this coming so beware.
I need to recompile a bunch of Maya 6.0 plugins for Maya 7.0. Maya 6.0
was compield with gcc3.3.2 and 7.0 was compiled with 3.3.4
We irregulalrly have to compile against stuff for 2.9.6 as well and it
is never a starightforward recompile, esepcially when it comes to
iostream.
Is it
#include <iostream>
or
#include <iostream.h>
the iostream.h is supposed to be a backwards compatability shim but
sometimes give deprecation warnings and sometimes does. Sometimes I have
to compile with -DAW_IOSTREAM_NEW and sometimes _BACKWARD_IOSTREAM_H. I
found a new one today which was -DREQUIRE_IOSTREAM.
Maybe I have to put
using namespace std;
But then again, maybe not. Sometimes i just have to prefix every cout
and cerr with std::. Although not always.
To solve a problem I've been getting with these kinds of errors
/software/gcc/3.3.4/linux.fedora1.i386/include/c++/3.3.4/backward/iostream.h:34:
error: `
iostream' is already declared in this scope
/software/gcc/3.3.4/linux.fedora1.i386/include/c++/3.3.4/backward/iostream.h:34:
error: using
declaration `iostream' introduced ambiguous type `iostream'
I had to copy backward/iostream.h to ./ although shoving a
-I/software/gcc/3.3.4/linux.fedora1.i386/include/c++/3.3.4/backward/
caused even more errors.
Sure, there's probably something fundamentally broken with the Makefiles
but I'll *guarantee* that the brokeness is the result of a hack put in
there to work around the last incompatible change.
It's a fricking compiler FFS - take C code, spit out object code. Since
this retarded family of languages makes me care about header files
anyway why make everything else so fucking difficult. And what is it
about the ADHD malcontents who produce 90% of software that means that
given a relatively conceptually simple task (read mail, display a web
page, compile a .c(pp) file) that they feel the need to strap on
complications and gotchas like a vengeful dominatrix strapping on a
veiny beknobbed dildo in order to punitively claim your manginity for
crimes unspecified and unspeakable.
I shall dig out a .sig from that last time I went through this flavour
of rigaramole. Aaaah, there it is.
Simon

PHP gallery

From: Simon Wistow
Date: 12:20 on 05 Jul 2005
Subject: PHP gallery
Apart from having a stupid name (almost as brain dead as calling
something .NET or COM) I actually really liked PHP Gallery. It was easy
to set up and it did everything I wanted.
Then one of my users created a sub album. Two actually.
And I couldn't work out how to delete it. Unlike the main album there
didn't seem to be a handy dandy button to say delete.
Since it seemed to be directory based rather than DB base I did
something slightly stupid. I just deleted the directory of the second
album. (Which was in the root albums diretcory, not a subdirectory of
the directory of its parent album).
Without making a backup first.
DOH!
This actually appeared to do nothing.
Apparently, I found out after trawling through the various web sites out
there, what I should have done is scrolled through all 400 photos
looking for the virtual photo representing the sub album. Anfd then hit
'album actions -> delete'. This worked fine for the first album but
threw an error syaing that the second album didn't exist.
So I grep for the name (album02) and find it in photos.dat of the parent
album (still with me) which appears to be a serialised data structure. I
make a backup and edit photos.dat by hand. Which causes all the photos
in the parent album to disapear.
DOH!
Restore.
Chew finger nails.
Create two new sub albums. Sure enough these are given the name album01
and album02.
Delete the orphan album02. It works! Huzzah! Delete the new album01. It
works! Delete the new album02. Failure!
Chew finger nails again.
Repeat steps again but this time back up new album02 dir, delete orphan
album02, delete new album01, restore album02 dir, delete orphan album02.
SUCCESS! PIMMS ALL ROUND!
Of course now I'm worried that other data is in an inconsistent state
but it *looks* ok. What a fucking palaver.

SQLite and friends

From: Simon Wistow
Date: 11:17 on 25 May 2005
Subject: SQLite and friends
I know that at least one other member of our carthartic little bile
cabal has come across this problem
http://use.perl.org/~hex/journal/24191
but some combination of Class::DBI, DBI, DBD::SQLite and sqlite is
fucking up my cabbage patch.
I'm using SQLite for rapid prototyping and I want to stick a version
into a DB. A version is a string because, well, apparently just having
incrementing numbers is too difficult for people or something. Either
way, this shouldn't be a problem. Right? Right? Just set the column type
to VARCHAR. Or TEXT. Or BLOB. Or CLOB. Any of those?
No.
SQLite trys to promote whatever goes in to be a number. Despite claiming
that it won't
"If the datatype of the column contains any of the strings "CHAR",
"CLOB", or "TEXT" then that column has TEXT affinity. Notice that the
type VARCHAR contains the string "CHAR" and is thus assigned TEXT
affinity.
If the datatype for a column contains the string "BLOB" or if no
datatype is specified then the column has affinity NONE."
http://www.sqlite.org/datatype3.html
MY SCHEME DOES DEFINE IT AS ONE OF THOSE! YOU SYPHILLITIC PILE OF GYM
SOCKS!
In fact I've tried everyone of those and also the trick of manually and
explicitly setting the data type to be BLOB.
But no. Apparently the simple taks of sticking exactly what I want into
the database is too difficult. I apparently misunderstood the point of a
database - here I was thinking that it was store data and, in fact, it's
intended purpose is TO MAKE MY LIFE A MISERY.
*sigh*

windowmaker's backgrounds

From: Simon Wistow
Date: 14:54 on 23 May 2005
Subject: windowmaker's backgrounds
Changing one's background is one of the fundamental writes of a GUI
user. It allows you to express your individuality in much the same way
that sticking amusing posters up on your cubical walls do.
In 99.9999% of all desktop systems out there it is a trivially easy
operation.
Windowmaker has, however, fully embraced the Linux Retardo[tm] mindset.
Is it part of the configuration menu - NO! That would be entirely too
easy! You have to use the wmsetbg command line tool. Because, you know,
when you're configuring the look and feel of a GRAPHICAL environment you
want to be using the fucking COMMAND LINE.
But, I figure it should be quire easy - simply wmsetbg <path>. But oh
no, whilst that does change my background it only does it on this
desktop. And sometimes only temporarily. Sometimes permanently. How
special.
To set my background on all desktops I need to do
for f in `seq 0 10`; do wmsetbg -u -w $f <path>; done
Hurrah!
I suppose the point is that I could have different backgrounds on every
desktop should I show wish which is clearly a far more common usecase
than, say, wanting to browse thumbnails. Or put the image down anywhere
other than center.

oyster cards

From: Simon Wistow
Date: 14:59 on 18 May 2005
Subject: oyster cards
One could argue that this is a stretch to call this software but if you
don't like it then you should feel free to bite the ass of a convenient
llama. One that was syphillitic, amourous and deranged would be best.
Oyster cards, for Americans and other aliens, are the handy dandy smart
cards for gaining access to The Underground. They work in two modes -
Mode the First:
You buy a travel pass to travel about for a period of time in a
specified number of zones. For the record I buy monthly Zone 1-2 passes.
Mode the Second:
You put some pre-pay on the card. Every time you swipe through some is
deducted. As of earlier this year it actually works out what the best
fare was for you retrospectively and adjust accordingly. Which is nice.
Now, I tend to put about a tenner of pre-pay on my card because
occasionally I nip to zone 3 and it's useful.
So far, so hateless. The hate starts now.
A minor quibble first - when you swipe through and your travel card is
about to expire the gate flashes up a message "soon expir" (sic). Bceaus
elcearly, even though it only has one thing to say and one thing only,
they though that somehow putting enough space for the final letter
wasn't worth it. And people wonder why our children grow up with the
reading age of a toddler.
And now the major hate - you only get the warning for 2 or 3 days before
your card runs out. Which means that if have a weekend and then take a
bus or walk on the third day you miss it.
If you have no pre-pay then your normal rhythm of swiping and walking
through the gate is disruptwed and people crash into you. MEbarssing but
liveable.
If, however, you have pre-pay they charge you for the journey. At which
point it's too late to back out and get a travel card. Even if you get
to the other end and immediately renew your monthly pass then you still
get charged full whack.
Fucking peice of shit.

dumb phone transfer software

From: Simon Wistow
Date: 11:46 on 13 May 2005
Subject: dumb phone transfer software
I gte shiny new phone. Phne is not by same people as old phone. Attempt
to send all contacts across via the magic of bluetooth. Of course it
fails.
Use a friend's iSync to download old contacts and then sync them to new
phone - it all appears to work apart from where I had lovely entries
which represented one person with multiple phone numbers now I have
multiple entries per person. This, however, I decide I can live with.
However I've just realised that the numbers have been trasnferred and,
somewhere en-route, something has decided that the +44 I'd carefully
prepended to every number should be truncated to 44. Which means none of
the numbers work when I dial out.
GAH

mailman's rejection policies

From: Simon Wistow
Date: 09:46 on 04 May 2005
Subject: mailman's rejection policies
I have an announce list, right. And I only ever want a few authorized
people to be allowed to post to it. So why do I need to rummage through
the grease trap of held posts deleting all of them in turn. I *know* I
don't want them. Why can't I just tell you to reject them outright. WHY?
Oh, and for that matter - why no "delete all"
Oh, and whilst in full flow - you put the headers and body of every
message in a form element. And all form elements are in the same form.
And the message queue, if we've had a particulalry viscious spam attack,
can be over a hundred messages long. Spam and viruses can have rather
large message bodies.
IT'S NOT A PARTICULARLY HARD STRETCH OF THE IMAGINATION TO SEE THAT
SUBMITTING THE FULL TEXT OF A HUNDRED VIRUSES AND HTML SPAMS VIA POST IS
GOING TO PUT QUITE A LOAD ON THE SERVER.
GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH.
Somebody should write a mailing list manager in Perl.

mozilla extensions

From: Simon Wistow
Date: 12:29 on 30 Mar 2005
Subject: mozilla extensions
Well, that's a hate from the get go - Firefox, Phoenix, Mozilla. Watch
the pea!
That aside, fuck me developing extensions for, err, let's call it
Firefox is a pain in the testicular area. This is a typical work cycle.
1. Create directory structure.
2. Populate with meta data files that duplicate large quanities of
information.
3. Start trying to code.
4. zip up various directories, some as .jars
5. zip up more directories plus those .jars as a .xpi
6. Load in Firefox
7. Wait.
8. Just 5 seconds.
9. Only 4 to go now.
...
13. Now restart Firefox. What the fuck? These aren't device drivers.
14. Get an error, try and work out the mapping betwen then internal
error string and what it actually wants.
15. Goto 4.
16. Kill oneself or Ben Goodger.
Debugging is ... well, a pain in the arse. There's no build tools.
There's no docs. The API is different between point releases of browser
versions. JOY!
Worst. Dev. Environment. EVAR!