Older blog entries for fxn (starting at number 131)

I wanted to include in my Perl seminar updated timings of the comparative C/C++/Java/Awk/Perl found in The Practice Of Programming but I am a bit perplexed with the results and am unsure about what to do.

The fact is that to process the 4.2M of this Bible the C program takes for about 7.5 seconds, whereas the Perl code takes just 4.9 seconds. This has its explanation, and those implementations were not competing for speed in the book, but it would take longer to justify than it's worth.

The intention of that slide was to illustrate somehow that all the power Perl offers to the programmer is much cheaper than one would expect, for perl is very fast indeed. It is a simple statement to get the big picture, no more ambitious than that. I wanted to use those programs because they are public, taken from a well-known book, written by outstanding authors. But presenting a table with those timings would be actually confusing, and I wouldn't transmit the central idea in the end. Hmmmm.....

26 Sep 2002 (updated 26 Sep 2002 at 10:08 UTC) »

The sync release of MyAdvogato is out.

It is aware of the new changes and takes advantage of the new parameter thresh of the very website: Users can define its own threshold giving a value to thresh. If the CGI sees it has received a parameter named thresh it passes it when fetches recentlog. Othersiwe, when the CGI wraps the home initializes the parameter with the value found in the link under Recent diary entries. Particularly, you may avoid any filtering setting this parameter to 0.

At this moment the link that appears at the bottom of recentlog when some entry has been hidden is not correctly normalized, but the entire page can be obtained setting thresh to 0, so I'll fix it later.

The tarball is available here and the Zip file here.

21 Sep 2002 (updated 21 Sep 2002 at 08:16 UTC) »

The version 0.9.5 of MyAdvogato is out.

In this release an ignore list has been implemented, and performance has been somewhat improved, since the retrieval of pages is done using pipelining. There were also some bug fixes and code cleanup.

The tarball for Unix systems is available here, and there is a Zip file for Windows over here.

I wanted to add a few things to the next release of MyAdvogato, which would be the 1.0. It seems, however, that there is more interest in filters by user name than I thought, so I plan to publish tonight (European time) a minor version with that addition.

Regarding the feature wanted by gilbertt... is there any page where one's given and received diary ratings can be consulted? (Or diary rates? Which is the correct term?)

The three-hour seminar I proposed for the forthcoming V Congreso Hispalinux has been accepted. It will be largely based on the one I gave at work, with some improvements due to the feedback of my colleagues, and new slides about the comparative C/C++/Perl/Java/Awk found in The Practice of Programming, including updated timings.

The very presentation is written in Perl and will be delivered with a free license to the organization. I will polish and document it a bit these days. It is not a generic framework for on-line presentations right now, it was intended for writing that seminar, but if something not too bad results maybe I could release it anyway.

15 Sep 2002 (updated 15 Sep 2002 at 22:13 UTC) »

I am doing the first attempts to rewrite MyAdvogato following the literate programming paradigm. I see I need to tune the level of detail of the things I factor out as chunks, and adopt a good convention that reflects scopes somehow. For instance, in this code:

my $connected = 0;
my $socket    = undef;
foreach my $page (@pages) {
    unless ($connected) {
      <<connect to Advogato>>
    }
    # ...
}
we have to remember when writing the chunk <<connect to Advogato>> that $socket is there in scope and we have to put the socket there. I think this cannot scale, and is poor style. Rereading some non-toy examples in Knuth's book I've gathered these guidelines:
  • The scope of locals should fit in their chunk as much as possible.
  • If you need to share a variable or two between chunks, mention them in the name of the chunk.
  • If there are more than one or two variables to share, rethink your code.
I'll keep them in mind and try to follow them, let's see how them work.

In a more practical level, I am finding some problems using Perl and noweb in Emacs. I am using right now noweb-mode for normal editing and noweb-outline for navigation through chunks expanding and collapsing labels. On the one hand << has to do with here-documents in Perl, and names of code chunks in noweb, and on the other hand Perl uses a lot of $s, which fool LaTeX mode, the working mode when you are editing the documentation of a chunk.

The workarounds I've found by now are setting cperl-pod-here-scan and cperl-pod-here-fontify to nil, and closing code chunks with @ %$, that is a comment for LaTeX, and it seems it has the effect of closing artificial math environments if LaTeX mode thinks we are inside one after that. I don't know how that will work with larger code.

I did some trials with the Leo editor as well, but there is too much structure enforced there for me. I'll surely appreciate it once I face the problems Leo solves.

14 Sep 2002 (updated 14 Sep 2002 at 14:02 UTC) »

redi, yeah those are natural filters to consider also. In early stages of the program I thought about them, but on the one hand I didn't see clearly which would be the expected, or most useful behavior, and on the other hand I don't like the idea of filtering out entries in a community where trolls are anecdotal. So I ended up implementing something else.

Now, diary ratings do filtering even a more natural feature to have, and that's why I am rethinking this subject. Once again, I do not even see the rates because I have drates=0 in my bookmark, but MyAdvogato tries to be helpful to as much people as possible. Tools, not policies. Then, if anything gets written I believe it should include also an ignore list and a level threshold, to offer the complete set of available criteria.

We have some tradeoffs to resolve there: When I think in filters I have recentlog in mind, but would users like to filter the right column of the home as well? If that was the case filters based on diary rates would need three requests, I think I don't like that. But otherwise we have an asymmetry with the current notify list, which is taken into account in both pages. What do we do?

Let's think in recentlog now, would people like being notified somehow of the hidden entries or would they generally prefer ignoring them altogether? If the former, how do we notify them? At the top of the page? Will one want to have a summary there? It seems too intrusive for something you actually want to ignore. Maybe the right interfaces would be either hiding the entries with their headers, or replacing just their body with ellipsis, as Emacs does selective display, or turning their body to gray. The preferred display would be another parameter. Then, the options having to do with bodies have no sense in the home, what to do? And would we like having different displays for different filters? Would we like to be able to express that we don't want to see the entries of people in the ignore list but we want the entries rated below a given threshold in gray? Do we want buttons to be able to see some entry normally? What sense have those buttons if we entirely hide the entry? Do we want a myriad of parameters to express every conceivable combination?

Well, I guess I'll eventually arrive to a compromise and write something.

11 Sep 2002 (updated 11 Sep 2002 at 18:41 UTC) »

Dust In The Wind (And The Fan In Its Way)

The desktop PC at home did random reboots under FreeBSD, and gave a nice blue screen saying that IRQ_LESS_THAN_OR_EQUAL didn't hold ---or something like that--- if I tried to boot Windows XP.

It turned out the CPU fan had so much dust that stopped working. The computer lives in a normal room and has just a few months, but it seems this Athlon XP 1700 has a fan that needs almost monthly cleaning.

Reading

Among other things I am reading the woven source of GNU libavl, a real pleasure.

MyAdvogato

Following the trend of my recent immersion into literate programming I plan to completely rewrite MyAdvogato to make it a literate CGI, surely using noweb. Besides, pipelining and optional hiding of diary entries in recentlog below a user defined threshold are things to be added in the next release.

4 Sep 2002 (updated 4 Sep 2002 at 06:15 UTC) »

kbreit, add this to your .emacs

(add-hook 'c-mode-hook
          '(lambda ()
             (c-set-style "k&r")))

You can read which styles are supported in

C-h i m Emacs RET m Program Indent RET m Custom C Indent RET

Perl Golf

The TPR(0,5a) has started today and will finish next September 8th. This time there is a single hole, players are to write a translator of arithmetic expressions from infix notation to RPN.

I am a referee again this month, I am amazed at the ways golfers are solving the problem. Golf forces people to be really creative (ab)using the language. At the top of the leaderboard there is Stephen Turner right now with 126 strokes, I like his approach very much.

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