zf = zipfile.ZipFile(zpath) zlist = zf.namelist() for filename in zlist: if filename.endswith("/"): destpath = os.path.join(path_to_extract,filename[:-1]) if not os.path.exists(destpath): os.makedirs(destpath) else: zf.extract(filename,path_to_extract)
30 April 2009
27 April 2009
I have had a @libero.it email address for more than 10 years. I stopped using it regularly when they disabled POP/IMAP for people connecting through other providers, but still logged in occasionally every once in a while.
Today I went there and my saved emails were all gone. Apparently I didn't log on for three months (which may or may not be), and this "authorized" them to go and delete all I had left there for 10 years.
This policy is braindead and guaranteed to piss off people. Storage is cheap; if they really wanted to "temporarily disable the account" (in their words), they could have simply bounced incoming mail, and compressed the few megabytes (!) of data, ready to be restored the first time I logged in again.
This act of destruction was unnecessary, and carries the risk of being sued by angry people. This is the sort of decisions that made Libero.it (once at the forefront of internet-adoption waves in Italy) a fringe player; while Google and others ate their lunch, they were all busy penny-pinching, pissing off old-time users faster than they were making (very few) new customers.
21 April 2009
I started tracking my activities using Toggl. The concept is very simple: the site gives you a timer that you can "toggle" to signal when you are starting a certain task. You define different tasks and group them into projects, and you can mark "billable" hours as such (clearly a feature for consultants / freelancers). It features reports (obviously) and other workgroup-related options, a dotNet-based offline tracker, and premium options for paid subscribers.
The first day I used it, it was enlightening: it turns out that I only spent about 3 hours doing actual "core" work. Most of the remaining time was wasted being sidetracked by other internal projects, plus random chitchat. Ok, it was the day Oracle bought Sun, and we were pretty psyched about it (especially me, as the first thought I had when news emerged about the botched IBM/SUN deal was "well, [Oracle] would be a much better fit than IBM; db appliances would be very sexy, and most of [Oracle]'s stack is Java-based already", and the others were all "yeah, keep dreaming!"... then Larry vindicated me), I expect the numbers to get better. If they don't, it means my routine needs improving and I'll work on that, but I feel that without Toggl I probably wouldn't have the sort of hindsight that gives a sense of achieving, which is necessary to maintain continuous efforts.
All in all, Toggl feels cool. Other project-management sites should take note.
15 April 2009
Phorm / Webwise is a disgusting ex-spyware maker now intent in profiteering from your browsing habits without your consent, as described by this exhaustive explanation of the Phorm system and why it is bad for everyone. They will basically spy on all your network request and then inject their own advertising on somebody else's pages. This is bad for users (spied on without consent, with very low guarantees of anonymity), and extremely bad for any website holder (whose content is modified and exploited, again without consent, and probably infringing copyright laws).
Yesterday the European Union, usually so despised by British citizens, formally accused Britain of infringing the EU directive on data protection by implementing Phorm. Today, Amazon opted out of the system, as previously did Google, Facebook and many others. I personally opted out a few minutes ago, by sending an email to email@example.com listing all my domains.
For the sake of the net, Phorm/Webwise MUST fail. If the system goes live, I will ask my ISP whether my traffic will go through BT, and if so, I will switch to a provider who can guarantee they will NOT take part in the system (i.e. not Virgin and not TalkTalk).
13 April 2009
...is that logic and rhetoric are not taught well, or (like in my experience) not taught at all.
This is reflected in the political debate, which is getting dumbed-down to the point where rational arguments can be completely absent; and it can be seen all over "teh intarwebs", where multitudes of well-intentioned individuals routinely end up acting like trolls.
One should be able to understand when he is losing the rational argument, and either retreat, reformulate, move the subject onto a different field, or try to bluff his way through. By banging on about the same, lost point over and over again, one doesn't do himself any favour; he might be able to appeal to the basest instincts of some individuals, but he won't be able to win intelligent men to his cause.
I have to admit, I have been guilty of this behaviour several times during the years. I put it down to my lack of knowledge of the abovementioned fields. At school, they taught us how to analyse sentences for syntactical structure, but rarely for meaning, and never for logic. They told us how to write in a readable style, but didn't really ask us to understand where we are in a debate, how to interact strategically during a verbal confrontation, how to step back from the heat and think hard about your next rhetorical move.
Is it a form of large conspiracy, where upper classes try to maintain old privileges by "forgetting" to properly teach these subjects to the uninitiated? Or could it be that these are considered too dangerous a weapon, too prone to abuse, to be widely taught? Or is it simply that education topics are constantly squeezed by the furious pace of technological advancement, to the point where you need to teach kids how to work with newer and newer devices which are fundamental to the current way of life (computer, tv, ipods etc etc)?
In any case, it feels like some of the oldest fields of study ever taught ended up being victims of accomplished mass-scholarisation. I don't think this is helping the masses or anyone else, though.
10 April 2009
Memo to self: if you ever need to download the Qt4 documentation on Windows, instead of scraping the official site, just download the qt4-doc package for Debian, open it with 7-Zip and extract the .qch files to use with QtAssistant (which also gives you indexing etc).
06 April 2009
I have several ODBC (and JDBC) requests, all pointing to the same server. They are all queries coming from the same database user. However, depending on who the caller is, requests should be "rewritten" to point to a different schema (for Oracle) or database (for SQLServer). In short, the identity should be proxied, because I cannot manually change it client-side.
Can this be done transparently? Does anybody know of a tool that does it, even commercial ones?
I thought about using a simple network proxy and redirecting to different
I can't find anything on Google, I wonder if the LazyWeb can help...?
UPDATE: I realized I need something similar to Context Switching in SQLServer 2005/2008, to wrap all my requests with a "EXECUTE AS" request. I wonder what the equivalent is for Oracle.
02 April 2009
Only Germany and Poland managed to score 18 goals. After champagne-football, will we have cevapcici-football ?
01 April 2009
This post is for google.
If your Eric4 for Windows keeps crashing on startup, try the following:
- Start eric4-tray.py (which should be in your
- Right-click on the Eric icon tray, and select Preferences
- Change something in the Application section, and click Apply then Ok
- Right-click again on the icon, and select "Eric IDE". This time it should start ok.
- Now you should be able to quit the tray application and start Eric as usual