Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

a silhouette of a person's head and shoulders, used as a default avatar

I like emacs.

Here's some emacs lisp I whipped up yesterday. It helps out when running quilt against new .spec files on old systems. It's a bit crude, but so far it's proven quite the little timesaver -- it's certainly already repaid the 10 minutes I put into writing it.



;; Temporarily comment out %gconf_schemas_prereq, %lang_package,
;; %files lang, etc.
;; Useful when using quilt setup. Don't forget to save. You can
;; undo this with M-x ab-undumb-down-spec.
(require 'cl)
(setf replacements '(("^%gconf_schemas_prereq"
"# GCONF_SCHEMAS_PREREQ"
"%gconf_schemas_prereq")
("^%lang_package"
"# LANG_PACKAGE"
"%lang_package")
("^%files lang"
"# FILES LANG" "%files lang")
("^gnome-patch-translation-prepare"
"# GNOME-PATCH-TRANSLATION-PREPARE"
"gnome-patch-translation-prepare")
("^gnome-patch-translation-update"
"# GNOME-PATCH-TRANSLATION-UPDATE"
"gnome-patch-translation-update")))

(defun ab-dumb-down-spec ()
(interactive)
(let ((old-pnt (point-marker)))
(progn (mapcar (lambda (arg)
(progn (beginning-of-buffer)
(replace-regexp (first arg) (second arg))))
replacements)
(goto-char old-pnt))))

(defun ab-undumb-down-spec ()
(interactive)
(let ((old-pnt (point-marker)))
(progn (mapcar (lambda (arg)
(progn (beginning-of-buffer)
(replace-string (second arg) (third arg))))
replacements)
(goto-char old-pnt))))



Adding new pieces of text to replace and unreplace is easy: add a list containing a regular expression matching the text to destroy, a(n ideally) unique temporary replacement, and the original text to replacements. I use a regexp in the cars in case there's the same text elsewhere, which I wouldn't want to change.

Now I visit a .spec file, run M-x ab-dumb-down-spec, do quilt setup whatever.spec and other quilty things, and then revisit the .spec and do M-x ab-undumb-down-spec prior to doing actual builds.

(By the way, the meat of this post was created by setting a region around this chunk of lisp and running M-x htmlize, although it looks like blogger is eating the colors.)

a silhouette of a person's head and shoulders, used as a default avatar

Graph creating libraries for PHP

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. It is a very nice, used and easy to learn web programming language. I decided to play arround a bit with it and for this I needed a graph library to create dynamic scientific, business and stock-market charts. So, trying to find something I stopped on these two: PHPlot and JpGraph which are fine for my needs. You also can find useful to look for a nice Tutorial for Component Graph. I finish by tell you “happy programming and nice plots with PHP”.

a silhouette of a person's head and shoulders, used as a default avatar

a silhouette of a person's head and shoulders, used as a default avatar

back home

I arrived uneventfully in Mexico City last night. Was good to see my wife and cats again. Alma bought a bunch of plants during my absence. They make the apartment feel a little nicer somehow.

I got stuck in an extra small seat from CDG to MEX -- there was a big metal box under the seat in front of me bolted to the floor and occupying about 1/3 of the "legroom". At 193cm tall, I find all seats cramped, but this was ridiculous. Ridiculously uncomfortable, that is.

Being back at home is like stepping into a pair of old, comfortable shoes.

a silhouette of a person's head and shoulders, used as a default avatar

in Germany

I'm in Germany. I haven't been having a great time, though. I felt really sick a day after I arrived, and although I've been feeling steadily better since, my recovery has been quite slow. At least I'm able to eat and enjoy food (assuming it's edible and enjoyable, of course, which most of it is) again, although I get full quickly and stay full for a long time.

Seeing people whom I mostly know as email addresses and IRC nicks has been productive and nice, of course. That's the real value in this sort of trip.

a silhouette of a person's head and shoulders, used as a default avatar

Status of my

Status of my Suggested enhancements for OpenDocument V1.2:


Hi Thomas,

thanks for the question. Here is the status:



























Tables:
* introduce allowCollapse attribute for paragraphs following nested tables to encode WW and HTML-like tables. Not put up for discussion.
* declare sub tables as deprecated Under discussion in the Accessibility SC.
Numbering
* introduce text:level-text attribute to encode arbitrary number formats Rejected.
* introduce text:num-follow-char to encode WW-like numbering Partly accepted.
* introduce text:list-override to encode WW-like numbering Strongly rejected.
* declare style:list-level-properties/@text:space-before as deprecated. Effect can be achieved with paragraph indent. Rejected.
Master-page styles
* add header-first and footer-first to encode WW-like page-styles Not put up for discussion
* modify master-page styles such that WW-like sections can be encoded; current CSS3.0 like text:sections are not applicable Not put up for discussion
* declare the style:next-style-name attribute of master-page declarations as deprecated. Not put up for discussion
Styles:
* allow deriving paragraph-family styles from text-family styles. Not put up for discussion
"Break chars"
* introduce a command and a command similar to the command Not put up for discussion
Fields:
* enhance field support by introducing a <text:field-start/> and a <text:field-end/> element to which metadata can be attached. Rejected
Change tracking:
* introduce change tracking for tables Not put up for discussion
* introduce change tracking on property level Not put up for discussion
Discourage the use of the following OD features for MOOX interop:
* nested frames Not put up for discussion / Internally communicated as rejected.
* current CSS3.0 like text:sections Not put up for discussion / Internally communicated as rejected.
* use fo:break-before instead of fo:break-after Not put up for discussion / Internally communicated as rejected.
* use fo:margin-* for tables Not put up for discussion / Internally communicated as rejected.

In general I must confess the OpenDocument TC didn't picked up my discsussion topics... (It's listed as suggested but never has been put for discussion into the agenda). Additionally I had a lot of private communiation where my ideas where communicated as unwanted/rejected.

To get an idea of whats discussed for ODF1.2 take a look at:

  1. Proposals under discussion

  2. Proposals for consideration for a vote in the next coordination call

  3. Approved Proposals

  4. Proposal integrated into the specification document

a silhouette of a person's head and shoulders, used as a default avatar

Look who's sponsoring Ruby

Last weekend saw the Ruby Hoedown conference at RedHats Raleigh Headquarter, listing Microsoft as a sponsor. Interesting.

For those of you wondering Why Ruby ?, look at the conference website.
The Ruby language is growing exponentially, partially because it offers more flexibility than other more common languages.
Now add Suns support for Ruby last year, the famous Ruby on Rails web development framework and broad platform support, this language is still HOT.

the avatar of Flavio Castelli

Xesam and bathroom hacking

Yesterday morning I was quite arrived at work when Laura (my gf) called me. Something went wrong in our bathroom and water was everywhere. She closed the main water tap and I took the first train for home (yes, since I’m an outlier I take the train two times per day). Once arrived at home I performed some hacking on the guilty washing machine, checked some pipes and than took the next train for office.

In the end yesterday I spent approximately four hours on the train. During this elapse of time I started the Xesam User Language parser :) During the travels I:

  • refreshed my memories about Flex, Bison and language parsers in general
  • wrote XesamUserLanguage’s BNF grammar
  • wrote Flex scanner
  • started Bison parser

Now, after fixing some build errors, I’ll start writing Bison’s grammar rules. These rules will translate Xesam user language queries into Strigi::Query objects.

I hope it will work (both bathroom and Xesam parser ;) )

the avatar of Flavio Castelli

How to have some fun with Strigi and Xesam queries

Last day just after I hit the “submit” button a doubt came into my mind: “did I say everything ?” Well, the answer is “No!” In fact I forgot to tell you one of the most important things: how to have some fun with Strigi and Xesam! Actually the only way to perform XesamQueryLanguage queries with Strigi is through the strigicmd program.

Strigicmd is a command-line tool shipped with Strigi. It can perform different actions like:

  • create Strigi indexes
  • remove items from index
  • list all files contained into an index
  • retrieve informations associated to an indexed file
  • update the contents of your index
  • query the index
  • perform a query using XesamQueryLanguage

So, if you want to try the new Xesam support you’ve just to use strigicmd with the xesamquery option. The command syntax is: strigicmd xesamquery -t backend -d indexdir [-u xesam_user_language_file] [-q xesam_query_language_file] As you can expect you’ve to save your Xesam query to file and point strigicmd to it.

This is a really small step-by-step guide:

  • Create a new Strigi index (in this case I’ll index all irc logs): strigicmd create -t clucene -d temp/ logs/
  • Create a simple file containing your Xesam query. You can find some example query on Xesam site or inside strigi tarball (complete path: strigi/src/streamanalyzer/xesam/testqueries/). This is a stupid and easy query:

    {% codeblock [query] [lang:xml ] %} Oever jos {% endcodeblock %}

  • Perform the search, just type:

    strigicmd xesamquery -t clucene -d temp/ -q ~/irc_oever.xml

  • Enjoy the search results ;)

Remember that XesamUserLanguage query language isn’t yet supported.