Sunday August 17, 2003
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.
comment
Saturday August 16, 2003
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:
- blogs change a few times per day at most (if we exclude features like trackback and comments, which can be easily implemented on separate scripts or -- better -- not implemented at all)
- you don't need a database for a blog since entries are few, sorted only on date or category, and indexes have to be built anyway for menus or archives
- I don't like CGIs =)
- there are lots of really good apps to write blog entries, a few of them even come preinstalled on modern PCs, they're called editors (and if you're like me, you spend most of your waking time in fron of one)
- did I mention that I hate CGIs?
- static pages are faster than dynamic pages and they're cache-friendly and searchbot friendly by default
- I much prefer working from the command line than using a web interface
If you're reading this, it means StaticBlog is (at least partially) working. What I've managed to hack together so far:
- filesystem based entries and categories, more or less like Pyblosxom (using the wonderful path Python module)
- modular converters (.txt, .html, and .rst do far) to convert entries
- input encoding support (since I'm Italian I'm pretty sensitive to it, things like àèìòù should work)
- template based (via simpleTAL)
- monthly archiving (partially done)
- parsing only of the actually modified entries and HTML generation only of the actually modified pages (thanks to the shelve module)
- rc based configuration with sensible defaults (at least for Unix systems)
What I'd like to add soon:
- RSS generation (it's already built in, I only need to write the XML template and feed it to TAL) update: as you can probably see, RSS is working now generating an RSS 0.91 feed for each category; I'm thinking of adding an RSS 2.0 feed (it's just a matter of creating the template) to use entry dates, etc.
- logging support, using the 2.3 logging module
- new entry submission to blog engines (via XMLRPC? is it really a nice feature? hmmmm have to investigate this a bit)
- support for formats needing external converters, like LaTeX or Office docs (I really only need to write a converter for them)
- completing the half done features ofc =)
- improving the architecture maybe by planning it a bit =)
comment
Tuesday August 12, 2003
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.
comment
Saturday June 07, 2003
Today, being Saturday and being my gf away until tonight, I finally managed to download Dropline Gnome and install it on my Slackware 9.0 notebook.
The dropline packages are a little more than 250Mb and they download and install flawlessly with the dropline installer. I do not know why I stopped using Slackware sometime in 1996 or 1997 for RedHat, it is so much faster and leaner.
Well, back to Dropline Gnome. After having downloaded everything, I dropped in single mode and got out to do some stuff. When I came back later all the packages had been properly installed. I only had to recompile freetype after enabling the bytecode interpreter, and everything is as it should be, only better than before. It's really amazing how much Gnome keeps improving.
I also installed the new Friday theme I downloaded after following a news item on FootNotes instead of my usual Metabox theme, and I like it a lot. I took a screenshot of my plain (but uncluttered) desktop
Now if only I could get google search back in my Mozilla location bar..... =)
update: found a partial solution by inserting:
user_pref("keyword.URL", "http://www.google.com/search?q=");
to my prefs.js file. It works but in a different way from what I'm used to: instead of dropping down a list it goes straight to google.....
update2: grrrr when one is dumb......I only had to select a couple of checkboxes in the Advanced settings of the Location Bar.
comment
Friday June 06, 2003
Looks like I really need to start coding on my alternative to pybloxsom. I took an instant dislike to pyblosxom when I sent a very small patch to make it run under mod_python to its author.
He made a few changes (not noticing that the content_type for the rss was set to text/html) and promptly posted a news item announcing the patch, saying that it was sent by a kind soul.
Well, this kind soul has a name, and is not so kind usually, or so people say about me. I do not need publicity, and it was just 6 lines of code, and kind soul takes less time to type than my name (which is pretty long, I agree), but credit should be always given, unless the person receiveing it decides not to.
The dislike was augmented (but this may be my usual wannabe hacker attitude that makes me want to rewrite 80% of the Web apps I stumble upon) by looking at the code.
Now I notice that all entries are displayed on the front page, or so it seems. Hmmmm better hurry with the coding =)
comment
PyMeld
22:50:00 CEST
Found a reference to PyMeld in a comment to a weblog entry discussing Web templating engines (which has been a favourite topic of mine ever since I started programming for the Web).
PyMeld is a Python templating engine for XML/(X)HTML that uses id attributes in tags to present them as objects to the programmer. Sounds too good to be true? Looks like it is.
The examples are self-explanatory, and the API is very simple and pythonic. It does not have the advanced functionality of, say, TAL and MeTAL but IMHO the dumber a templating engine, the better. Logic should stay in the code, not be hidden (often by conventions or layers of conventions) inside the template/templating engine.
One of the cases where the old Mies van Rohe saying less is more actually sounds true (though I do not like its mainstream interpretation on architectural principles and modernism).
update: It turns out that PyMeld is actually not less but more, a lot more. I briefly used it a while ago and realized something I have always known instinctively, templates should just digest code entities (variables, instances, etc.) and render them. PyMeld takes an attractive, but very impractical approach, forcing you to drive the rendering engine from the code. Contrast this with the beauty of TAL, where you (at least that's what I do) toss the same entities you use for the logic of the program to the templating engine, and the templates knows what to do with them. In TAL you're not forced to massage your data to have it rendered (well, maybe you need to add an attribute or two from time to time to your classes, but it's a very different effort than say driving a table to create rows and cells from your code, urgh!).
comment
One of the things that prevented me from switching to Linux full-time as my desktop os was the lack of a good all-around editor. I know VI (vim) and even like it but I just am not productive enough with it, and Emacs has always scared me and I never got around to learn it properly.
I tried Jedit for a while, but it feels too slow and Javish, tried Komodo from ActiveState (I even bought a license) but it's even slower and crash-prone. Tried a number of Python IDEs like BlackAdder or WingIde but they feel clunky or use qt which I don't like (I do not have KDE installed so it's a waste to load qt just for my editor, and moreover qt has bad fonts defaults -- I am VERY picky about fonts, my eyes are pretty sensitive to blurred/antialiased/badly designed fonts).
Then I read somewhere a comparison of Open Source Java editors where J came out pretty well, and decided to give it a try. I installed it and was instantly surprised by its user interface and speed, in contrast to Jedit which feels sluggish and bloated even on fast machines. So I fiddled a bit with the props file, played with J a while then forgot about it. About one month ago I started a new Python project here at work, and started using J as my main editor. Day by day I discovered some amazing features of this powerful, lean editor like CVS integration, ssh editing and directory navigation, HTML browsing of files, XML tree navigation, and many others.
Now I can't live without it. It's my default editor and I suspect that, as soon as its email and news features are completed, it will be my email client as well. Not only is J a great editor, but it's lead developer Peter Graves is a very kind person and dedicates lots of his time to improving J (he is now working on J's own Lisp interpreter) and resolving the few minor bugs posted on the devel list.
If you're not an Emacs or VI only guy, give J a try.
update: I post my j configuration here, mainly so that I can retrieve when I'm working around on a new computer:
globalKeyMap=/home/ludo/.j/globalkeys
PhpMode.keyMap=/home/ludo/.j/PhpKeys
XmlMode.keyMap=/home/ludo/.j/XmlKeys
restrictCaret = true
autoNewline=false
autoSelectLine=false
dirSortDirectoriesFirst=true
enableExperimentalFeatures=true
highlightBrackets=true
highlightMatchingBracket=true
HtmlMode.upperCaseTagNames=false
showLineNumbers=true
sortBufferList=true
StatusBar.displayLineCount=true
StatusBar.displayLineSeparator=true
tabWidth=4
wrapCol=72
dialogFontName=verdana
dialogfontsize=11
gutterFontName=andale mono
gutterFontSize=8
textFieldFontName=andale mono
textFieldFontSize=11
style.comment=0
autoSelectLine=false
# mail preferences
enableExperimentalFeatures = true
enableMail = true
# Default "From" address information.
userFullName = Ludovico Magnocavallo
userMailAddress = ludo_at_asiatica.org
# The SMTP server to be used for sending mail.
smtp = zzz.zzz.zzz
inbox = {[email protected]}inbox
bcc = ludo_at_asiatica.org
comment
Thursday June 05, 2003
|