Strigi gains full Xesam queries support
As I said in this previous post, Strigi’s Xesam support was half-done since XesamUserSearchLanguage wasn’t yet handled. Well, this is no longer true… ;) In these weeks I’ve been working on XesamUserSearchLanguage support. Ehm… to be honest, I’ve been fighting with Bison.
But in the end I tamed the beast and now Xesam support in Strigi is full.
IMHO XesamUserSearchLanguage can be considered more important than XesamQueryLanguage since common users will write queries in this way.
As reported on the project page: {% blockquote %} It is [XesamUserSearchLanguage] designed as an extended synthesis of Apple’s spotlight and Google’s search languages. {% endblockquote %}
These are some possible queries (examples taken from freedesktop site):
-
_type:music hendrix_will return all music items related to hendrix -
_type:image size>=1mb tag:flower africa_will return all pictures displaying a flower greater than 1 Mb and related with africa
Technical aspects
The Xesam’s UserSearchLanguage query –> Strigi::Query object conversion is made using a hand-written scanner and a C++ parser created by Bison.
You don’t have to worry if you don’t have Bison installed on your system since all parser generated code is already put into svn. In these days, as soon as I’ll have some spare time (when?!), I’ll write another post about open-source scanner and parser generators.
By now I would like to thank Andreas Pakulat (developer of KDevelop) for his help with parser generators.
s/evento/acontecimiento/
s/evento/acontecimiento/. Por favor.
(En el evento que lo de que hablas sea un evento sigue usando evento.)
I like emacs.
;; 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.)
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”.
136 years of solitude
/dev/sda2 has gone 49680 days without being checked, check forced.
back home
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.
in Germany
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.
Status of my
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 |
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:
Look who's sponsoring Ruby
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.
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 ;) )