Older blog entries for fxn (starting at number 228)

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.

I am going to take off for Paris with my lovely GoldWing tomorrow, to attend YAPC::Europe.

Right after the conference Mark Jason Dominus will stop a few days in Barcelona, and will give a talk to Barcelona.pm on the 28th. He'll stay at home, which will be a honor for me.

15 Jul 2003 (updated 15 Jul 2003 at 10:41 UTC) »

I have just come across wwwd. It is a HTTP server written in Ruby with a set of features which are perfect for Halk. The idea now would be to deploy a self-contained, easily configurable web application with an integrated HTTP server.

In addition, that might imply we get portability out of the box, which would be a plus.

Advogato

Hey, the dev list is moving, and raph's posts are back. Excellent!

Halk

Halk's CGI driver will need to create lots of URLs pointing to it. CGI.pm has self_url() to get them easily but cgi.rb has no similar feature, so I wrote today self_url() for cgi.rb and a pair of related methods (based on CGI.pm's implementation), and sent the patch to Wakou Aoyama.

Hey don't miss this weblog entry at Artima. You may agree or not with the author, but it's an execellent reading IMHO. I like the perspective, the distance, the non-attachment of most of his words.

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