Older blog entries for fxn (starting at number 232)

5 Sep 2003 (updated 5 Sep 2003 at 06:59 UTC) »

A couple of ideas for Halk:

  • It should be possible to assign a timeout to a slide. If a slide had one we would send a refresh pointing to the next one. Good!
  • Since a presentation is run in a single process in stand-alone mode (no CGI mode is planned for 1.0) we can offer the possibility to record the time spent in each slide to allow authors study the timing of their presentations. That time would be defined as the seconds that lasted between the request for the current slide and the next request for a different slide. Simple but sounds kind of meaningful enough for the intended purpose.

    That can be munged from the logs in debug mode, but a clean file with timings already computed by the program (and independent of debug mode) would be far better.

This project is getting exciting!

29 Aug 2003 (updated 29 Aug 2003 at 15:27 UTC) »

diablod3, those numbers are rather old. There are up to date Advogato statistics, maintained by bagder. Have a look at this page and this page.

27 Aug 2003 (updated 27 Aug 2003 at 22:24 UTC) »

I have come across Exerb, which produces a Windows executable from your Ruby program with an interpreter included, so it won't even require Ruby installed to be executed in Windows. Moreover, you can make the binaries in any platform with Ruby.

That's yet another great thing for Halk, because authors will be able to distribute presentations for Windows as a stand-alone .exe file with no further requirements (unless the presentation itself have dependencies. For instance, a Python course would normally require Python installed to let the reader run the code snippets of the slides). I don't know the size of the executable, but at least you have the choice to provide one.

In another front, the look and feel one, a coworker pointed out the use of CSS and JavaScript in some HTML presentations by Brett Merkey. Hey, they have transitions!!!

I don't particularly like transition effects, but it would be a fancy feature, so I rapidly thought I could provide them out of the box so authors could use them if they wanted to just setting a parameter in the corresponding slide. They worked in Mozilla (Windows and Linux) and Explorer. They didn't in Konqueror (which cooled my enthusiasm down a bit), and don't know what happens with Galeon or Safari (if anyone tries please let me know, I would appreciate it very much to take a decision). So I don't know what to do. It might be reasonable to provide them with a warning (the slides themselves would be seen alright in Konqueror anyway, so having the transition won't hurt in that particular browser).

Talking about browsers, another cool thing about all this is that with a non-fancy theme (which I'll certainly provide with the distribution) one will be able to give the presentations in some text-based web browser. I saw a couple of presentations running on terminals in the YAPC::Europe and they were way cool. BTW, the engine of one of them, which was about Parrot's performance, was written in Parrot bytecode, how devil.

I am not coding this week to let the ideas rest a bit.

25 Aug 2003 (updated 25 Aug 2003 at 00:56 UTC) »

Halk

Halk has error handling and logging written. There's now a file cache that can optionally stat files on disk to keep them up to date in memory. Templates are cached in compiled form. Presentations have associated a theme (look and feel), but individual slides can be configured to use some other theme. I don't know whether that will be used, but looked funny and easy to implement.

The executable has a --port option. But if no port is specified the HTTP server tries to find silently an available port in the range 8000..8999 automatically. This way Windows users will be able to just double-click and have the default browser launched showing the cover of the presentation.

I'll play a bit with this recently released Tar2RubyScript. If the user (presentation writer) had it installed it would be possible to put the whole dynamic presentation in a single ready-to-run Ruby file, which would be ideal for its distribution.

Reading

I have just finished the second edition of Mastering Regular Expressions. It's a really impressive work. Regular expressions is supposed to be a dry topic, but this book treats the subject in a very exciting way.

19 Aug 2003 (updated 19 Aug 2003 at 01:49 UTC) »

Python-like indentation for Ruby

Although I don't know Python, I've always liked the idea of using indentation to mark blocks. One indents the code anyway, the lack of explicit end-of-block marks requires less lines, and the listing gets cleaner for my taste.

I wrote today some Elisp to let Emacs hide ends in a row and collapse their lines, intended for reading Ruby.

Thus, Emacs can display

def method(foo)
  if condition(foo) then
    do_something(foo)
  end
  foo.each do |bar|
    bar.each do |baz|
      do_something_else(baz)
    end
  end
end
as
def method(foo)
  if condition(foo) then
    do_something(foo)
  foo.each do |bar|
    bar.each do |baz|
      do_something_else(baz)
which I find much more pleasant.
14 Aug 2003 (updated 14 Aug 2003 at 23:45 UTC) »

Some more work done in Halk. I want to get a working version first, so the main classes are already written but without error checking by now. The slides I'll write for testing will constitute the very Halk documentation, ready to read after decompressing the tarball. This way users will be able to see for themselves how easy is to deploy a presentation.

This is my first project in Ruby and I feel slooooow, going back and forth from the manual or the pickaxe to the editor. I am learning along the way though, and am confident it's worth the effort.

11 Aug 2003 (updated 11 Aug 2003 at 13:23 UTC) »

I start today two weeks of holidays. Among other things I plan to write a first release of Halk.

With Ruby 1.8.0 the implementation will be much easier using standard modules. Not only we've got support for CGI, YAML, and eRuby, I noticed yesterday Ruby 1.8.0 comes with WEBrick as well! That's excellent news for the stand-alone run mode.

6 Aug 2003 (updated 6 Aug 2003 at 07:11 UTC) »

Reply

robertc: Thank you for the advice. The idea is, say, that a student of your class wants to have a copy of the presentation (which is a web application), and you pass it to him for local execution. The port should of course be easily configurable with an optional parameter of the thing executed in the launch step. According to brondsem's 8080 looks like a good default.

Patch accepted

A patch of mine for the core module Tie::RefHash was applied. It's nice a few lines of code contributed by you come with the Perl distribution.

As you surely know keys in Perl hashes have to be strings. That module allows the use of references as well and the implementation stringfied them behind the scenes with "$ref" for use in an internal hash. That might not work however if $ref is an object with overloaded "" (this comes indeed from an IRC folk that couldn't use the module because of that). So I fixed it using calls to overload::StrVal($ref) instead, which bypasses the overloading, if any.

5 Aug 2003 (updated 5 Aug 2003 at 09:05 UTC) »

Good news, the recently released Ruby 1.8.0 comes already with the modules I plan to use in Halk: cgi.rb, yaml.rb, and erb.rb. Thus, users won't need to install dependencies to run the presentation, just the interpreter.

One of the problems of the prototype is that setting up the dynamic presentation in someone else's machine is not immediate, one has to follow a few instructions and install a few Perl modules. So, one of the goals of Halk is to have these instructions for running: uncompress, launch, go to localhost:8080.

YAPC::Europe went very well, I learned things and met people.

After the conference Mark Jason Dominus came to Barcelona for a few days. He gave a talk to Barcelona.pm last Monday and after that had dinner with the group. We had a great time. He stayed at home, it has been a pleasure to have him as guest.

223 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!