Older blog entries for fxn (starting at number 329)

27 Aug 2004 (updated 27 Aug 2004 at 09:57 UTC) »

mwh: That coincides. The functions in that script are Expat handlers or used by Expat handlers. After that the rest of the program is mainly module-level code. Thank you!

I have been using Python almost on a daily basis for seven months now, mainly due to the fact that we are writing an application in Jython at work. After it, I think I can make an objective remark about something I feel using the language. I would like to find the exact words, but I see an excellent balance between conciseness and density, and a feeling of having a relaxed concentration while programming, which is not only pleasant but I am sure it has several positive implications.

I would like to understand why that's that way.

Please, don't take that as general statements comparing Python to any other programming language. It is just a blog entry of someone that tries to observe himself.

Tried Psyco in the script

I could finally try Psyco in that script. It turned out that it didn't speed it up, in fact with the optimizer the script was five or six seconds slower over a total of a minute. I didn't profile the program, but my guess is that much of the work is done by Expat, and the rest of the script might end too quickly for the JIT to have a chance to make a difference.

23 Aug 2004 (updated 23 Aug 2004 at 09:17 UTC) »

This Saturday cerquide and I discussed a bit about Halk. He saw two improvements to the current set of features:

  • The function provided to templates to portably link to slides within a presentation could support cross-referencing between presentations.
  • If Halk sets the base attribute of a slide to point to the presentation root directory authors of presentations can use relative links, which are more easy to write than calls to a template function.
Good, and easy to implement.

In the course of the discussion we talked about support for sections. In Keynote, for instance, there's unlimited nesting of slides in groups. That's a good model to take into account. The nodes there are slides themselves, and there are no labels, distinguished slides, or shortcuts to go to start/end of group, start/end of parent, etc. Just start/end of presentation AFAIK. Grouping is just a visual aid to help the author organize his presentation. See this screenshot to get the idea.

The problem of sections is basically the interface for themes, and its implication in the slide appearance. I try to avoid having a tree around because if you offer just one level of nesting the theme author knows that in a slide one optional block label may be defined, but no more. And one link to beginning of block may be needed, but nothing more.

A thing I don't like about some frameworks whose document type support links are navigation bars with links to any imaginable defined spot. It distracts from the slide itself in my view, and in addition you need to remember which one was the link to the parent subsection, and which one the link to the parent section, and so on.

I think the guideline I prefer for themes in Halk is: put just the absolutely necessary links in the slide, and let the user navigate through the presentation via the table of contents.

90% of the time you give a presentation from start to end, sequentially. You occasionally need to jump to slides when a question is asked or you want to remind the audience of something, for instance. You even have extra slides not shown in the presentation that you have there in case they may help in answering some question (there will be support for this as well in Halk). OK. My opinion is that those anecdotal usages don't deserve a link in the slide. With the table of contents you have all the imaginable spots to go right there. Switch it on and off and you're done.

With this model in mind, we could offer arbitrary nesting as in Keynote, but no structural link exported to themes. Or the current just one optional level of nesting. I have to make a choice here but I've hit a wall, I don't know which would be better. On the one hand I think presentations are not books, and don't need that much structure. On the other hand I am sure people who designed Keynote know a thing or two about presentations.

19 Aug 2004 (updated 19 Aug 2004 at 13:02 UTC) »

Speeding up a filter

I've taken a break in Halk to optimize a Perl filter I wrote a couple of years ago for a research project that was presented in AAMAS 04.

That script receives a problem in XML, builds some structures to feed a solver written in CPLEX, captures the solution, and prints it as XML.

I made a mistake then, I didn't ask how big the problems could be in real experiments. The trials went OK, but when we started to input +3MB of XML, it was apparent I had chosen the wrong XML parser. The problem was not the parser itself, which trades really easy access to the XML tree by computer resources, but my bad choice.

I had now the opportunity to fix that. The choice for speed and less memory usage was Expat, and since I have been studying Python lately this was a perfect excuse to practice the language, so I used the standard module xml.parsers.expat. The new filter runs more or less 4 times faster in mean, and the memory usage is much much less. I would like to try Psyco in addition, but since I develop on a Mac I can't. The filter runs on a Linux machine, so maybe I will be able to try it there.

Halk

I have a permanent background process when I browse the web that identifies ideas for Halk themes. Since I don't have a clue about doing fancy things with HTML and CSS I rather copy stuff. For instance, the brushed metal texture of the Metal Dreams style for WordPress is much better than the one I wrote for Halk. I saw how it was done and the Halk theme looks much nicer now.

Another example, I like the rounded boxes in KeynoteUser.com as well. Those tables could be modified to get framed slides that occupy the whole window in a different theme.

13 Aug 2004 (updated 13 Aug 2004 at 09:35 UTC) »

Speculations

Thanks to a pointer by Perrin Harkins in the modperl-user mailing list I discovered yesterday that Amazon.com is driven by Mason.

That success story triggered again an idea I ponder from time to time: founding some business based on Perl. Further, the dream would be to found a software company specialized in dynamic languages gathering a handful of specialists in Perl, Python, and Ruby. Though that is more ambitiuos.

That is a very rough idea that could crystallize or not, I have no measure about how much Perl is used in Spain, and I have no experience in consultancy or whatever shape could that take. Well, this is the first time I verbalize it.

10 Aug 2004 (updated 10 Aug 2004 at 13:49 UTC) »

Followups

deekayen, agreed. Let's see whether the site gains momentum again.

Halk

I have now to decide the interface for listings.

Jorge PĂ©rez, a coworker and friend of mine, suggested that in addition to stdout and stderr outputs, the program should allow the user to specify some other custom output. He's right. For instance, if you were demonstrating some graphical library, after the execution of the code the program should provide a way to include an image.

That would need to be done with an obvious and simple API for the author, and the minimal context for the theme template.

Authors should also be able to customise the form attached to an executable listing that has parameters. The prototype just puts as many textfields as parameters, but that's not enough. Perhaps you would like a combo for some of them for instance. I have played with the idea of abstracting web forms, but that sounds too convoluted. I think I'll provide the textfields by default, and if the author needs some customisation he will be provided a parameter to pass raw HTML.

Reading

I am reading Cocoa Programming for Mac OS X (2nd Edition). This book briefly introduces Objective-C, assuming you already know some C, C++, or Java, and explains Cocoa programming using Xcode and Interface Builder, which are developer tools that come with the system.

Due to my natural inclination towards VHLLs it has been a while since I studied a programming language that is so close to C. Besides fullfilling my interest in having a clue about how native applications are written in Mac OS X, that will be healthy in its own.

7 Aug 2004 (updated 7 Aug 2004 at 21:45 UTC) »

Halk

Halk supports blocks of slides.

QOTW

I've written a solution and a test script for the current Perl Quiz of the Week.

6 Aug 2004 (updated 6 Aug 2004 at 16:57 UTC) »

I have been refreshing my very limited CSS to get a starting theme for Halk. I took a screenshot.

The position: fixed used to put the secondary controls to the right-bottom of the window works in Safari, Firefox, etc. But IE just adds them to the bottom of the body. It's a pity. BTW, the images were taken from VLC, I'll write to them to ask for permission to use them if I finally do it.

The slide shown in that screenshot is written this easy:

    slide 'First we start with a list', <<'BODY';
    * First item
    * Second item
    * Third item
    * ...
    BODY
and that particular presentation is configured to filter that using the txt2html utility that comes with HTML::TextToHTML.
3 Aug 2004 (updated 3 Aug 2004 at 10:05 UTC) »

Halk

Halk is progressing. It already serves slides supporting themes and content filters.

A theme is a set of files in a directory. It is described in one distinguished file, called theme.pl, and can contain CSSs, images, etc. Halk provides a function to portably link to those resources from within the theme description.

A description basically consists of snippets of HTML with template slots (e.g., <% $url_next_slide %>, or <% url_file("style.css") %>) for the head and the body of the three kind of slides: cover, titled, and blank.

I think people good at CSS could write themes that made the slides look really appealing.

The next steps in the TODO are support for listings, including execution of programs in presentation-time, and support for blocks of slides (one-level sectioning, no more).

320 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!