pythonaro.com

Pythonaro blog

29 June 2009

Earth to VmWare: make some DEBs, please

I've recently installed VmWare Server on a new box. For some reason, VmWare packages RPMs but not DEBs, so I had to do a nonstandard local install from the generic .tar.gz installer. That's not difficult, but now there is no way for me to track updates, including security-related ones.

Come on VmWare, get your act together: it's 2009, people expect this sort of feature these days. Since you bother to build RPMs, it's clear that you can package stuff properly if you want to. If you are not sure what distribution to pick in the sea of available Debian-clones, just track Debian-stable and let the community do the rest.

Labels: , ,

posted by GiacomoL @ 1:40 PM   0 comments links to this post

08 June 2009

My new meme

Labels: ,

posted by GiacomoL @ 12:50 PM   0 comments links to this post

07 June 2009

The pains of backward-compatibility

Problem:
  • you have several ZIP and TAR archives
  • you have to replace ONE FILE in each of them
  • you only have Python 2.5

From what I see, the only solution in this situation is to completely branch off the two cases, because the relevant Python modules (tarfile and zipfile) have such a completely different interface.

None of them can simply replace or delete one single file, so you have to unpack the entire archive, edit the file, repack. Inefficient, but consistent approach.
Then ZipFile object will read bytes, whereas TarFile objects will extract files.
Finally, ZipFile doesn't feature a method to extract all files in one go, like TarFile has. To be honest, zipfile sucks in pre-2.6 VMs.
This means that what you can really do (more or less) in the same way (with some essential metaprogramming) is opening/closing archives, listing the contained files, and adding new files.

Things are much, much better in 2.6 and 3.0, where both interfaces are almost the same, but if you are stuck with 2.5 (like me) then you'll have to do with inelegant solutions. And if you are reading this, maybe you'll waste less time.

(Memo to self: always, ALWAYS do the easiest thing that could possibly work, no matter how inelegant it is. Premature optimization really is the root of all evil.)

Labels: , , ,

posted by GiacomoL @ 7:54 PM   2 comments links to this post

01 June 2009

note to self

When you start writing hacks like this:

for attr in ['Something1','someThing2'...'SomeThing215']:
    self.__dict__[attr.lower()+'Widget'].do_something(someValue)
    self.__dict__[attr.lower()+'Widget'].set_parameter(someparameter)
... it's probably time for a subclass.

Labels: ,

posted by GiacomoL @ 9:08 AM   2 comments links to this post

30 May 2009

"Sigh. I really wish I could vote Labour, but..."

"...then they go and put Arlene McCarthy top of the ticket in the North West".
"Do you mean that Arlene McCarthy? The one who pushed so hard for software patents?"
"Yes, that Arlene McCarthy."
"Man, that must hurt."
"Indeed. And the other ones in the list look more of the same: people concerned mostly with the welfare of big business."
"But at least the campaign message will surely be about your 'sweet spots': fair opportunities, workers' rights, social Europe..."
"Er, no, actually. It's a riff on protectionist themes: fight for the UK, defend the country, etc. You would easily confuse them for BNP or UKIP material."
"I see."
"So it's gonna be Green again, I guess."
"F*ck me, the tree-huggers! Man, you even hate recycling schemes! Are you all right? Let me check your temperature..."
"Actually, their policies are quite sensible these days. They really get it on technology issues. They even have people in the Open Rigths Group."
"Well, ain't you a single-issue voter."
"Single-issue? Labour got it wrong on ALL the issues in the last few years: DRM, net filtering, open source, software patents... they even fought to be exempted from directives on workers' rights!"
"Yeah, but I mean, the enviro-nazi are full-on plane-haters..."
"I don't agree with their shenanigans on Heathrow either, but I think they started to understand that being anti-planes is a lost cause. And we do need more anti-nuclear activists, the original generation basically sold out to Blair."
"What about the Lib-Dems? Apart from Nick 'David Cameron wannabe' Clegg, they do have good people on."
"Yeah, I'm checking them out, but they always leave me underwhelmed. The best one they have, Chris Davies, is top of the ticket and is going to get a seat anyway."
"What about the Tories? David Cameron looks like a nice fellow."
"I'm actually worried by how much I agreed with the Conservative spokesperson on the last BBC Question Time, very intelligent man. But I'm still convinced they'll pull a GWB-style U-turn as soon as they are in government."
"And I guess you wouldn't consider UKIP..."
"Are you serious? Their motto is 'we're just xenophobes, not full-on racists like the BNP'. If they had free reign, I probably couldn't live here."
"That settles it, then. Not that I care, I'll campaign for the one with the bigger tits and beat your silly people anyway."
"Eh. Gotta run now, that's enough politics on the blog for at least another year. It's always so nice talking to you, Mr.Murdoch."

[UPDATE: If you still don't know who to vote for in UK constituencies, have a look at the Open Rights' Group page listing candidate positions on technology issues. It's fantastically simple and well-designed.]

Labels: , , , , , ,

posted by GiacomoL @ 9:45 AM   1 comments links to this post