Today I intended to write a comparison of a few Gnome filemanagers I downloaded and tested this morning, but it's late and going to bed is starting to look like an attractive option.
And tomorrow I'll go to San Siro (or as it's called now stadio Meazza) to see Inter's debut match for this season, so I suspect I won't feel like writing the article either.
So a short entry is in order. Trying to find a speedier and hopefully more usable alternative to Nautilus, I downloaded three file managers:
Velocity looks promising though it makes quite a mess if you let it manage your desktop, or change a folder icon. It also lacks basic things like a detailed view of files, with dates sizes etc (or if it's there, I could not find it easily enough). No screenshot here, since it basically looks like Nautilus with a working directory tree in the sidebar.
The Gnome File Manager is a very quick, basic Norton Commander look-a- like. It has what you expect from a similar program. Not having much, it does not miss much, apart from context menus to perform basic actions with the mouse instead of hitting the F-keys, a status bar displaying the available F-keys commands like its ancestor has, and drag and drop. No screenshot here either, since it's look is very plain and similar to most of its relatives.
Endeavour is the best of the three. It's a feature-rich file manager, with special modes for archives and images, and tools to search for files and mount/unmount disks. I managed to lock it a few times with the open with menu entry for file items, and could not manage to make its archives mode work too well, but on the whole it's a beautiful and feature-rich application and I suspect that if you spend some time customizing it, it may work well.
In the end I did not use any of the three file managers, and did what I had to do from the shell, as usual. =)
I've started experiencing withdrawal symptoms from new (for me) concepts. So tonight I started reading D.Knuth's The TeXbook, and I found myself laughing after just a few pages. Usually this does not happen with technical books....
Insiders pronounce the X of TeX as a Greek *chi*, not as an 'x', so that TeX rhymes with the word blecchhh. It's the 'ch' sound in Scottish words like loch or German words like ach; it's a Spanish 'j' and a Russian 'kh'. When you say it correctly to your computer, the terminal may become slightly moist.Donald Ervin Knuth, The TeXbook, page 1
And the citations are great too. And I've been reading only about 5 or 6 pages. =)
LaTeX has been on my to be learned list for a long time, but somehow I never got around to anything more than reading a few pages of Tobias Oetiker's (you may know him as MRTG's author) The not so Short Introduction to LaTeX2e. Then I started using LaTeX a few weeks ago as an intermediate format to output pdf from RestructuredText (the same format used to write this blog), and was immediately fascinated by its printed quality, and its versatility.
So when a few days later I was asked to produce printed copies of our (>50k) users directory, I decided to write a simple python script to extract info from our Directory Server and produce a LaTeX file (actually, a few files, as we generate more than one type of directory, and I did not write it alone but together with a colleague, and we copied most of the LaTeX stuff from Rich Lafferty, and as usual the request was to ask the consultants I more or less supervise to do it not do it myself).
I have been looking for quite a long time for a more structured way of writing documents. My first attempts where to use the Microsoft Word outliner (its best and most underrated feature imho), which works well enough for writing simple, one-shot documents. Then I tried using Docbook, but I soon discovered that writing XML directly is a pain, reading it on screen is worse, producing good quality output from Docbook + FOP is a frustrating experience, and double validation (once as XML once printed/on screen) is too much. Then I switched to RestructuredText, and you already know what happened. =)
Now I write my documents in RestructuredText with the same editor I use to write code, and with the added bonus of being able to use CVS for versioning. When I have a sufficiently complete version I convert it to LaTeX, and from then on I make corrections etc to the LaTeX source. For complex documents I use Kile, a very nice LaTeX IDE for KDE that gives me syntax coloring and allows me to jump to sections, preview the output from the IDE, etc.
Since I started using LaTeX, I not only get easily manageable documents and excellent quality output, but I also get small satisfactions, like having one of our Avanade consultants come see me with my last report in hand, and ask me with longing eyes if I used LaTeX to write it. They standardise on Word. =)
Tonight I logged in to an old shell account I used in 1995-1996, and which is still used to host a web site belonging to somebody I know, looking for a piece of missing information which might have been there.
I did not find what I was looking for, but I found an old lynx_bookmarks.html file I last accessed in March 1996:
-rw------- 1 xxxxx other 5915 Mar 10 1996 lynx_bookmarks.html
Hmmm nothing really special, as my real bookmarks were on my super- powerful 486 laptop (and have obviously been lost or deleted as I regularly manage to do). I started surfing the net in 1992 or 1993, and I remember using gopher at the time. It was only later that I managed to install Mosaic (on Linux ofc) on a University computer, then the first release of Netscape, downloaded from Mosaic Communications at http://www.mcom.com/.
A recent thread on clp offers a few interesting links to presentations (not all the thread has already been stored on google groups at the time of this writing):
Very interesting stuff but I suspect you know about most it already if you're a Python developer. =)
Yesterday I went to Sun Microsystem's Milan offices, to see a presentation on Sun Ray, their thin client architecture, and a running example of their new Linux desktop, Mad Hatter.
I have to say I was a bit skeptical about the whole thing, the presentation had been arranged almost a couple of months ago and I had totally forgotten about it. From what I had heard about Mad Hatter in previous meetings, I was not convinced it could add any benefits compared to other corporate-oriented Linux distributions, apart maybe for a single source of support.
Moreover, I had already been bitten a few years ago by Sun's thin clients, when I convinced the company I worked for to buy a few JavaStations for testing, and after fiddling with them a while we found them completely useless (or at least not up to the hype that was surrounding them).
Plus, after the summer vacations schedules are still a bit fuzzy around here, so I was lucky one of the sales engineers called be the day before yesterday to remind me of the meeting, or else I would have totally forgotten it.
Despite all this, the presentation turned out to be very interesting. I came out of Sun's building totally impressed by what I had seen.
Sun Ray is a wonderful architecture. The clients are beautiful and sufficiently fast, sessions get transparently restored across geographical networks, and with Solaris supporting Gnome you feel right at home in Sun Ray's desktop. Moreover, rumours say the server software that controls the thin clients will soon be able to run on Linux, giving you the option of using 386 servers instead of expensive (but reliable and beautiful) SPARC servers.
After the presentation, the Sun people let me play around a bit on a couple of Sun Rays, one attached to a guest network, one attached to Sun's worldwide network. The real thing was even better than the presentation (which was very interesting already), and that's not something you see often.
Now I'm trying to convince my boss to spend some money on a start-up bundle (15 Sun Rays and a small Sun Server for 8k euros), so that we can properly test them. Unfortunately, we're becoming more and more Microsoft-oriented at least on the desktop side of things, and technology decision are usually based on politics rather than technical merits, as is always the case in huge organizations.
As for Mad Hatter, I had a quick look and was favorably impressed. It is based on SuSe, not on RedHat as they told us a couple of months ago. It sports all the usual apps, Star Office (ofc), and a beautifully themed Gnome Desktop. What surprised me is that the Gnome packages are pretty bleeding edge. I was prepared to find the usual corporate-oriented distro, ie slow to accept changes and favouring old and stable packages vs new and potentially unstable ones. Instead, the feel of Mad Hatter is of something built by affectionate developers, with a very careful eye towards the professional user's needs.
I'm very curious to see how it feels using it on a day-to-day basis. I hope we're able to join the beta test in a few weeks.
To sum it up, a well spent and interesting morning, in a beautiful (if empty -- we crossed lots of rooms without seeing anybody around) space, with very kind and knowledgeable people (they even let me play a bit on a Mac OSX system they had lying around, lol).
I tried Mozilla Firebird as soon as it was announced, and was not impressed enough to switch from Mozilla. Plus, I was using Mozilla Mail as my email client, and it felt a bit funny to use something else as a browser.
Lately I started using Evolution, which I like a lot apart from some minor annoyances (no context menu in the message pane for copying, poor LDAP support compared to Mozilla Mail), so I went around shopping for a new browser.
I tried Epiphany, which is still a bit rough, and Galeon. One or the other of them messed up my Mozilla installation (on two different machines, so it's not a localized issue) so much that I had to wipe it and reinstall it from scratch.
This morning while having breakfast an entry on AMK's Diary mentioned Burning Edge, a Mozilla/Firebird blog where new builds are announced daily. I went to have a look and there's a Linux+gtk2+xft nightly build. I installed it and liked it so much it's now my default browser. Definitely recommended, if you can overcome the .rpm .apt addiction and simply untar an archive somewhere. Of course, using Slackware I'm not annoyed by these things. =)
update: mainly as a bookmark for myself, Firebird packages for Slackware 9.0 are available at pryan.org
Grr I hate internet explorer-only sites. I'm enjoying watching the 9th World Championships in Athletics (ever since I have been able to watch TV on my computer I am watching a lot of sports events), but the IAAF site does not work under Mozilla/Firebird.
The site looks pretty nice and displays flawlessly, but the left navigation menus do not work. You open up the source to try and find the links to the competition's timetables (which are buried deep in their site ofc), and nothing comes up. Grrrrrr.
For those of you who like watching the Championships, here is the link to the timetable. BTW I am always amazed at how pretty most of the athletes(ses) are. A good body usually goes with the job, but it's not only that. Maybe the greeks where sort of right?
The second and last part of our report from the Gibigianna. In the image you can see on your left, a car has been brought on stage. I wonder what kind of car this is (the year is 1928). update: I was fooled by the picture, looking at the .tif scanned from the original, the car is not a real car but a stage replica. Even more impressive. =)
A writing by my aunt on the back of one of the pictures identifies a few of the participants and sets a different location from the one given on the silver ashtray (my grandmother is the 4th from the right standing in the first row)
in Castellazzo di Bollate party at Marchesa Crivelli's
in the 1st row grandmother, Marichette Valentini, with the mage's hat Vico Sormani
below the panel on the wall Alberto Sormani, at the far right Donà dalle Rose
1928
It's 1928 then, and the place is Castellazzo di Bollate not Rovellasca. Rovellasca is a small town near Como, where the Marchesi (marquis) Crivelli had their villa, villa Arconati-Crivelli. The Crivelli where cousins to my grandmother via her mother Beatrice Sormani.
Castellazzo di Bollate is a small town near Milano, where in the XVII century the Conti (counts) Arconati built their splendid villa. As was usual for rich noble families of the time, the villa had an impressive art collection and library, where for a time Leonardo's Codice Atlantico (now at the Biblioteca Ambrosiana in Milano) was kept. In the villa gardens, one could find fragments of the funerary monument of Gastone di Foix, duke of Nemours and nephew of Louis XII, or the statue of Pompeo at whose feet Caesar was said to be killed.
It is in this impressive settings then that my grandmother's recorded Gibigianna took place. The panel affixed on the wall in one of the pictures says:
O! What is life?
It's a gibigianna
who glitters here and there
it's fate
For those who have missed our previous report, Gibigianna is an old term used in Lombardy meaning either a glitter of light reflected from a mirror or glass, or used as a humorous term for a woman who displays elegance.
That's all for my first Report from the Past. All the images of the Gibigianna are available in a separate directory (since getting text to wrap around multiple images in a blog page is a tedious, error prone and a bit futile process).
Since I'm a bit fed up with programming, but as usual the idea of going to sleep (well, actually of lying in bed with a book, currently the 7th of the 26 in Terry Pratchett's Discworld series) does not look so great, I might as well start putting on my blog my family's ancient pictures. Ancient because that's what came out writing in (more or less) American English on a computer, but thinking about it stuff from the early 1900 should be considered old not ancient.
Scanning all the family pictures scattered around my relatives' homes is an old pet project of mine, one I started last year but never managed to stick to. I hope this will be an incentive towards scanning a few more pictures and letters (especially my paternal grandfather's sometimes humorous letters from the first World War, a good number of them written to his parents by his attendant on pre-signed -- by my grandfather -- stationery, or so the family lore says).
I am starting this fragmented slideshow with the gibigianna. It's a regional (the region being Lombardy, in Italy, where Milan is), pretty disused word meaning
- a glitter of light reflected from a mirror or glass
- humorous, for a woman who displays elegance
A beautiful word, isn't it? It's a special language where you have a word for a glitter of light reflected from a mirror, whose other meaning has to do with a woman's ostentatious display of elegance (but then I suspect most languages have beautiful, very special words). Not very politically correct, but it fits perfectly my grandmother's pictures.
In my grandmother's case, the gibigianna was a sort of party where young people dressed in costumes and reenacted historical or literal scenes (or so my aunt tells me). My paternal grandmother was the daughter of a noblewoman (who unfortunately does not appear to have been one of the heirs to her family's huge fortune or at least to part of it), and had relatives among some of Milan's noble families, and so got to take part to this kind of events.
I have always found these pictures wonderful, and appalling. Imagine a few teenagers (one of the pictures has 20 people in it) that spend a day dressing up in stage-quality costumes, only to reenact historical scenes in their family's private theater inside their villa. Not only that, but they also have silver ashtrays made for the event.
Full coverage of the Gibigianna coming soon, if I manage not to get distracted by something else, as usual. =)
update: the second and last part of this Report from the Past is now online. All the images of the Gibigianna are available in a separate directory (since getting text wrapping around multiple images in a blog page is a tedious and error prone process).
As promised in a previous entry, I managed to give a look at PHPTAL. Since the entry is a bit long, I copied it as a standalone article, and left only this brief notice on the blog.
Read with interest today A Few Tips for Writing Useful Libraries in PHP (via PHP Everywhere), a nice article by the author of the MagpieRSS parser.
Posted a couple comments to the site, to which the author kindly replied by email. Nothing much, the usual "don't name your php files with an extension other than the one defined in your webserver", and an observation about error handling.
As all PHP developers know, PHP has no exceptions (and thus no try/something clauses), errors are either stored in special variables or accessed by calling functions, depending on what extension you're working with (PHP5 will introduce exceptions). All pretty messy, as the article author correctly points out.
One thing most developers don't know is that PEAR (the default PHP library bundled with the PHP source code) has a nice PEAR base class with great error handling features (why a good number of PHP developers stay away from PEAR is another matter entirely from the topic of this entry).
Basically, if your classes (you use PHP's OO features when writing reusable code, don't you?) inherit the PEAR base class, you get error handling for free (and a few other things, like destructors).
Using PEAR error handling is very easy, a quick example will suffice:
// our imaginary library (not very useful, is it?) define('MYLIB_ERROR', 100); require_once 'PEAR.php'; class myClass extends PEAR { function myClass($myargs = null) { $this->PEAR(); } function &raiseError($message, $method, $line) { $error = PEAR::raiseError(sprintf("%s.%s() line %d: %s", get_class($this), $method, $line, $message), MYLIB_ERROR); } function myMethod() { $this->raiseError("hmmm something went wrong.....", 'myMethod', __LINE__); } }
For our libray developer, that's all there is to it. Basically you import the base PEAR class, and use it as a base class for your library classes. Whenever you need to "throw" an exception, just raise a PEAR error. The raiseError method is what I use in my classes, makes much easier debugging what went wrong by appending the method name and the line number where the error occurred, and a constant I use to trap errors depending on the originating classes.
Let's see the user part of PEAR's error handling routines:
// user code accessing our library PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'errorHandler'); function errorHandler($err) { echo("<b>PEAR error</b><br>message: <i>" . $err->getMessage() . "</i><br>user info: <i>" . $err->getUserInfo() . "</i><br>"); } // or use any of the standard PEAR error handlers, eg // PEAR::setErrorHandling(PEAR_ERROR_PRINT); // for development or a more sophisticated handler for production, // eg mailing a copy of the error or saving it in a log $myinst =& new myClass(); $res = $myinst->myMethod(); if (PEAR::isError($res)) { // do something, the error is handled // (in our case printed) by the handler routine } else { // do something else }
The user only needs to import the PEAR base class (or alternatively use $myinst->isError() since it extends PEAR) and check method return values for possible errors. An added benefit of using PEAR's error handling routines is that by changing the function used to handle errors you can switch from debugging (ie print verbose error messages) to production (ie don't let the user see errors, handle them in your application) just by changing the error handling routine. A common practice is to automate this sort of things by checking the environment of the running server (eg hostname, etc.).
I will slowly migrate my bookmarks (currently scattered on at least 3 machines at work and at home) to this site, even though I'm still undecided about how to do it. One possible option is a new category type for bookmarks, whose entries are not displayed in the front page/RSS feeds, but which can accommodate folders. We'll see.
In the meantime, I will transfer from time to time useful links from my old site (they're stored in a MySQL DB, things would -- ahem -- be much easier if they were in ascii files).
Here's tonight's batch, in no particular order:
After 9 years of going back and forth from Windows to Linux with brief periods on various commercial Unices, a few months ago I finally managed to get rid of Windows (thanks to Slackware, which I unfortunately overlooked for a loong time), so these links are the first to go, and will slowly be buried at the bottom of my archives. =)
If you're a veteran procrastinator then you too have known these moments when large matters, easily visible from a distance of six months away, finally somehow depend on the heroic scramble to beat a five minute deadline or to find a new ink cartridge for the printer. Ridiculous. [Making Change]
Being sort of an outsider in most of life situations, I usually enjoy descriptions of the Italian Life by foreigners, outsiders in a pretty strange culture.
Thus I spent a funny 5 minutes browsing through Stumbling Tongue, a blog kept by an American (?) living in Milano (found it via geourl). I especially liked Making Change, a description of the Italian Way of dealing with cash and change.
Recommended.
Just a quick entry to open up the category, since my title points to it. =)
StaticBlog is a tool I'm developing to manage my blog. In as few words as possible, your entry writing process is
It is similar in concept to bzero, but unlike bzero you don't have to explicitly tell it to parse a new entry, and well lots of other stuff. I gave up on bzero after a few minutes when it did refuse to work on one of my machines -- a pretty plain Slackware 9.0 setup -- and I noticed that its source code is not available.
You can read a bit more about StaticBlog in one of my previous entries.
If you're interested in helping develop StaticBlog, or want to give it a try (it's still very much work-in-progress, mind you), drop me a note.
update: I forgot to add that StaticBlog is written in Python.
A couple of days ago while working on this site's generator, I had to solve the (small) problem of generating abstracts of possibly arbitrary length from HTML snippets.
I wanted my code not only to trim down a snippet to a certain word length, but also to count how many words were left out from the abstract, and to preserve HTML tags (not counting them as words, ofc).
A brief look at Text Processing in Python by David Mertz pointed me in the right direction. It took a few minutes, and the abstracts appear to be good so far.
Last night I was browsing through Fredrik Lundh's blog and I stumbled upon his solution to the same problem, that I had only briefly read without much interest when it appeared in my aggregator. I did (and still do not) fully understand his code, mainly because I have never used formatter classes.
Ever the curious person, I decided to benchmark the two solutions together, mentally prepared to take a beating from a far superior programmer than me. I was surprised when my code resulted 35% faster (of course, this may be due to it not actually being my code, but a variation on DM code).
/-(ludo@pippozzo)-(84/pts)-(00:50:25:Mon Aug 18)-- \-($:~/pystuff/staticblog)-- ./test.py effbot code, 100 runs 2.05247092247 my code, 100 runs 1.30467903614
Not satisfied, I thought the difference was in my reusing the same istance vs effbot's code creating a new instance at each call (correct me if I'm wrong).
/-(ludo@pippozzo)-(102/pts)-(00:59:40:Mon Aug 18)-- \-($:~/pystuff/staticblog)-- ./test.py effbot code, 100 runs 2.05521595478 effbot code, 100 * 1 run min 0.011666 max 0.043925 avg 0.019288 my code, 100 runs 1.25740003586 my code, 100 * 1 run min 0.007895 max 0.037792 avg 0.013004
Still faster, though not by much. Here's my code:
import re from HTMLParser import HTMLParser class abstractParser(HTMLParser): """inspired by a simpler parser described in Text Processing in Python chap 5 http://gnosis.cx/TPiP/chap5.txt""" space_re = re.compile('(?:\s| )+', re.S) def __init__(self, abstract_length): HTMLParser.__init__(self) self.abstract_length = abstract_length def reset(self): HTMLParser.reset(self) self.tagstack = [] self.abstract = [] self.wordcount = 0 self.morewords = 0 self.completed = False def handle_starttag(self, tag, attrs): if not self.completed: self.tagstack.append('</%s>' % tag) self.abstract.append(self.get_starttag_text()) def handle_endtag(self, tag): if not self.completed: self.abstract.append(self.tagstack.pop()) def handle_data(self, data): if self.completed: self.morewords += len(self.space_re.findall(data)) else: if data: words = [] for word in self.space_re.split(data): if self.completed and word != '': self.morewords += 1 continue if self.wordcount == self.abstract_length: self.completed = True if word != '': self.wordcount += 1 words.append(word) self.abstract.append(' '.join(words)) def feed(self, content): self.reset() # TODO: split feeding in reasonable chunks until self.completed HTMLParser.feed(self, content) HTMLParser.close(self) if self.morewords > 0: self.abstract.append("... (%s more words)" % self.morewords) self.tagstack.reverse() for t in self.tagstack: self.abstract.append(t) return ''.join(self.abstract) if __name__ == '__main__': snippet1 = "<p>Lorem ipsum dolor sit <b>amet</b> ipso facto.</p>" snippet2 = "<p>Lorem ipsum <i>dolor sit <b>amet</b> ipso facto</i>.</p>" p = abstractParser(5) print p.feed(snippet1) print p.feed(snippet2) # gives # <p>Lorem ipsum dolor sit <b>amet</b>... (2 more words)</p> # <p>Lorem ipsum <i>dolor sit <b>amet</b>... (2 more words)</i></p>
Hmmm I even caught a bug writing this blog entry, grrr when will I learn to write tests before coding even for small things?
I've been thinking of writing a TAL|METAL package for PHP for some time, to replace my own version of the aging PHPlib Template class (no I don't like Smarty or other tamplating packages for PHP).
Yesterday I stumbled upon PHPTAL, which looks good and is even a PEAR package. Will try it soon.
Hmmm maybe save people from writing dumb and uninteresting things....well, after the time spent writing the software to drive my weblog, I have to fill it with something, otherwise I'll feel even dumber for developing something I don't use (sounds like a well-known feeling, uhm).
Spent most of the afternoon at my parents' hacking on the new window shades for the office downstairs. Hacking feels like the proper word, as it's as slow and painful a process as developing something ugly in an unfamiliar language, or worse. The only thing that saved the afternoon was my parents' sat tv (now you know why I went there on a Saturday afternoon).
Saw two Premier League matches (UTD-Bolton and Arsenal-uhm Everton I think), and as usual was impressed by UTD. They're so fun to watch, their games are beautiful. And their latest buy, the young Portuguese Ronaldo, looks like a baby champion.
This evening I came back not for more hacking on the shades, but to watch the NZ-AUS Three Nations rugby match. I expected a better match, after NZ easy win two uhm three weeks ago. I can't wait to see my favourite team, France, against NZ at this Fall World Cup, hoping they get to meet. Watching NZ play, one feels that France or any European nation (except England maybe) would be crushed instantly by the All Blacks strength, speed and hyper-technical plays. Then one remembers past World Cups, and France's creativity, and the exceptional talent of most of its players (Poitreneau is my favourite), and the wait for the next World Cup feels even longer.
StaticBlog (my Python flat-file blog) is up and running. Of course, given the short time I've been able to work on it, it's missing most of the features I'd like it to have.
I started writing StaticBlog a few days ago as the tool to manage my personal web site, based on a few considerations:
If you're reading this, it means StaticBlog is (at least partially) working. What I've managed to hack together so far:
What I'd like to add soon:
Well, this is just a test using the asis converter for text and HTML. BTW, StaticBlog is the tool I'm developing to manage my blog. Not much planning apart from knowing the features I need, and a simple key feature: a blog is a static thing, and entries live well in the filesystem. Parsing the filesyste, or querying a database on every request IMHO is a waste of resources, given the average posting rate for a blog.