Apr 19, 2004
Psyco - effortless, significant speedup of Python programs.
Summary: using psyco is an
easy way
to get a 9x speedup for real-life Python program.
I just wrote a Python program that took quite a while to complete.
It was reading a 600 MB *.sql file (uncompressed
Wikipedia database dump, parsing it
to extract some fields and writing the result to a text file for
easier processing in the future). While it’s not a production code it is
important for me. Currently Python is my favorite language for writing
non-GUI code because of ease of development and rich libraries. The only
sore point is its speed, or lack of it but I will always trade CPU cycles for
programming cycles. There are efforts to speed up Python code and one of
them is psyco. I’ve heard about it before
but never tried in practice so I decided to give the latest version (1.2)
a try. Setup (on Windows XP, Python 2.3.2) was a breeze. All it takes to
use psyco is to add 2 lines to your
program. What about
the results? I achieved 9.67 speed up which is great. When, for benchmarking
purposes, I limited the processing to only 10.000 (out of around 360.000)
records, the processing time dropped from 301.19 seconds
to 31.12 seconds. That’s a big win and makes a real difference when
processing the whole file. Go psyco!
Standard benchmark warning: “there are lies, damn lies and benchmarks”. My
app is different than yours so it might get better or worse speedup from
psyco. Having said that, the app in question is non-trivial, real-life app
(i.e. it’s not a micro-benchmark designed to test a specific feature) so I
think it’s fair to say that psyco can give a serious speed up to a large
class of python apps. It seems to be stable and is extremely easy to use.
I would post the code so that people could independently verify the
results but currently it takes too much effort to upload files to my blog.
Sorry about that.
Apr 18, 2004
Ecto for Windows - first (bad) impressions.
Ecto for Windows - first (bad) impressions.
My search for a decent blogging windows desktop client continues. I tried
them all and today I tried another one: ecto, build 0.3.3.1 (Yet Another Cryptic Build Numbering System).
Ecto journey was short and here are my first (bad) impressions.
I downloaded, installed and launched ecto. Ecto
informed me that “This might be the first time ecto is run. Please enter your
user information” which was very unnecessary. This message should be gone and I
should be taken straight to profile setup window instead.
The splash screen is visible when “Profile Setup” window is shown.
Why? At this point it’s totally unnecessary and annoying. It’s “always on top”
window; although it doesn’t cover other ecto’s windows, it does obscure
all other applications e.g. the editor in which I’m writing this review.
Profile setup dialog box (where you enter you XML-RPC api entry point) - I’ve
seen better. Could use some re-design. One of the Mac blogging tools had a very nice interface for providing weblogs
settings - I forgot which one but the authors of ecto should survey other
blogging clients and steal the best interface. Theirs isn’t.
In “Profile Setup” window I entered my MovableType weblog setup data: profile
name, username
and password and clicked “Apply” button. Ecto informed me (twice!) that “Specified
key is a known weak key for TripleDES and cannot be used.” This error message is bad:
- it doesn’t tell me what the problem is. I entered “profile name”,
“username” and “password”, not some “specified key” - uses techno-babble language that most people don’t understand (I know what “TripleDES” is but I doubt
many people do) - it doesn’t tell me how to fix the problem
Two words to ecto’s author (and anyone else designing error messages):
About Face.
Then I clicked “Save” button, hoping that the error message was
just an information. I forgot what exactly it did but since I didn’t see an
expected reaction from ecto, I launched another copy. It showed me the same
information as the first run but the previous copy of ecto was running as well. I ended up with 2 “Profile Setup” windows, one splash screen
and one main window (the one where you enter posts). Main window was blocked by “Profile Setup” modal window. To
make things worse I couldn’t even close ecto since it doesn’t provide any close
button on "Profile Setup" window and no other button does the trick. I had to use “kill -f”.
My theory is that ecto, in a misguided effort to force me to use what it
thinks is a strong password, refuses to create a profile with a weak password.
The problem is that I already have a weblog with a password and I’m not going to
change it just to please ecto. Given those 2 constraints (my refusal to change
the password and ecto’s refusal to accept my existing password) ecto is
completely useless for me. There’s no way to exit ecto without creating a
profile.
Redesign advice: instead of refusing to accept “weak unspecified key”, ecto
should accept it. At best it can display a message that explains that weak
passwords are bad (without using techno-babble filled with “TripleDES”
nonsense). But when I press “Shut the fuck up” button, it should accept any
password I give it. I’m the master here, not ecto. If I want to use blank
passwords that’s my choice.
Summary: my first ecto experience was very bad. Ecto is unusable for me because it
refuses to accept settings (presumably password) for my
existing Movable Type weblog. It has some obvious bugs (showing the same
dialog box twice, not being able to exit it, splash screen obscuring other
applications) and the general feel of the interface is “an average for
software” which translates “substandard for actual use”. Most software is
badly, carelessly designed and ecto is not an exception.
As you can imagine, this post has not been written using ecto. I’ll try it again
when a new build becomes available, but judging from screenshots I’ll have the
same complaints I had about all other blogging software I tried:
- no spell-checking
- forcing me to save draft posts on the disk
- no full-text search of my previous posts
Without those features blogging software is no better (and sometimes worse) than
using FrontPage for writing posts and web interface for posting.
Apr 10, 2004
A manifesto for collaborative tools
A manifesto for collaborative tools.
A manifesto for collaborative tools is worth reading. It points problems, shows some meta-solutions but almost none concrete solutions. Despite that, it argues the need for good collaborative tools very well and links to AUGMENTING HUMAN INTELLECT: A Conceptual Framework, a ground-breaking paper by Engelbart and The Computer as Tool: From Interaction To Augmentation, paper that builds on Engelbart’s work.
Apr 08, 2004
Upgrade NEC-1100A DVD+RW drive firmware.
Upgrade NEC-1100A DVD+RW drive firmware.
My Dell desktop that came with NEC-1100A DVD+R/+RW writer. The problem was that it didn’t work with Memoryex DVD+RW media. I could burn it, it would be recognized on some other DVD drives but not on my NEC-1100A. The solution: upgrade the firmware. I found it on dell.com site and upgraded from firmware version 108B to 10GE. Problem fixed.
Apr 06, 2004
Download streaming talks from murl.microsoft.com
Download streaming talks from murl.microsoft.com
Microsoft sponsors a site with scientific talks.
Some of the talks are interesting, so go and check them out.
One problem with the site is that it only offers streaming videos. Providing
only streaming version is stupid. It degrades the quality for me (if my
connection isn’t fast enough) and wastes provider’s ebandwidth (if I want to
see it again, I have to re-download it). I much prefer being able to download
the video for offline viewing at an opportunite moment. The good thing is that
with a bit of digging you can download those talks for off-line viewing. All
you need is a tool to download web pages (I use
wget, you can get a Windows port
here or
here). Let’s
take Dave Winer’s recent talk as an example. On the main
page there’s a link to
on-demand
video.
Let’s look at it:
c:tmpwget http://murl.microsoft.com/videos/msr/msr2004/Winer_Weblogs_OnDemand_100_100K_320x240.htm
...
20:58:13 (16.92 KB/s) - `Winer_Weblogs_OnDemand_100_100K_320x240.htm' saved [4609/4609]
C:tmp>notepad Winer_Weblogs_OnDemand_100_100K_320x240.htm
If you’re smart like me, you’ll notice the following in this file:
<PARAM NAME="FileName" VALUE="Winer_Weblogs_OnDemand_100_100K_320x240.asx">
The .asx file describes the file to the Windows Media Player. Let’s look at
it:
C:tmp>notepad Winer_Weblogs_OnDemand_100_100K_320x240.asx
The content of the file looks very simple:
ASF http://murlup.research.microsoft.com/asfroot2/videos/msr/msr2004/Winer_Weblogs_OnDemand_100_100K_320x240.asf
This tells us all we want to know:
c:tmpwget -c http://murlup.research.microsoft.com/asfroot2/videos/msr/msr2004/Winer_Weblogs_OnDemand_100_100K_320x240.asf
Two hours later the file is downloaded and ready to be viewed in optimal
quality and as many times as you want. And for viewing I recommend Media
Player Classic.
