self reminder about “le vélo star”
Thursday, November 5th, 2009So, this is a XML list of vélo star stations and this is the state of a particular station (as an HTML fragment)
So, this is a XML list of vélo star stations and this is the state of a particular station (as an HTML fragment)
I preferred when Safari was chewing up tons of memory. At least then it didn’t crash every 10 minutes on random web sites. (more…)
So, the following is legal:
$foo = array( "bar" => 2*2 ); var_dump($foo);
But this is not:
class Foo {
public static $foo = array(
"bar" => 2*2
);
}
var_dump(Foo::$foo);
I’m sure there is a reasonable explanation for this behavior, but I’m not sure I really want to hear about it.
A few months (well, almost years…) ago, I had this project of mine which only led me to write a small google maps rails based application. And since I was having some spare time recently and some good weather, I was also playing a bit with my GPS. So, one thing leading to another, and the rewrite starts to look good. But I still have quite a few features to add. And with some luck and inspiratio, I may even be able to finish the original application.
Dear Lazyweb, why does Safari 4 takes up to 500 threads after a few days running? Not that I mind much the 5.6GB of virtual memory it takes or the almost 700 MB of real memory, but I’m just curious.
I’m 2 months late on this one, but one can now merge gmail contacts!
It would be nice if you could work together so that I can directly open PPT/PDF/DOC/whatever files directly from the search interface with the docs viewer (which is far friendlier than the HTML output). kthxbye. (more…)
Once upon a time, I wanted to be able to generate RPN-style code from a more common Ruby-based syntax (and DSL). Fast-forward, I have been playing today with ParseTree and ruby2ruby (Thanks Ol for the hints!); The latter provides a to_sexp method on all Proc objects (which was lacking from the former). Given that a sexp is an abstract representation of a code portion, I can then use this structure to generate a new representation (in RPN, obviously) using my own “compiler”.
A real simple example (extracted from my test suite), with just an arithmetic operation:
assert_equal "kmh,8,*", evaluate_rpn_block {
kmh * 8
}
The evaluate_rpn_block method calls ruby2ruby’s to_sexp and then goes through the result tree. A more complete example of what can be done:
assert_equal "kmh,100,GT,0,kmh,IF", evaluate_rpn_block {
if kmh > 100 then
0
else
kmh
end
}
From there, what is lacking would be plugging the internal available functions (and operators) and matching the names used with existing definitions.
When I first started to code scripts with Ruby, one of the features that I loved was the Rexml library which made parsing XML just a breeze, most likely because I was coming from a Perl/Sax background and at the time I was surrounded by Java programmers, but also because it really is that easy to use.
At home, I have this small script that takes a XML file listing books that I have, do stuff to it and outputs more XML but in a different format and with some filtering. At first, it was ok. But recently, the source XML file got a bit hairy and larger that it used to be (just 2MB, but that’s already a bit of a constraint).
So I looked around a bit, and in fact there are now a few alternatives which are faster; One of them being Hpricot which is originally an HTML parser (as I already used it earlier on) but which also works well for well-formed XML. And in fact, it isn’t much harder to use (even easier at some point) and yes, it is faster. The same script (almost) is about 7 times as fast using Hpricot rather than good ol’ Rexml. Ok, I’m convinced.
(more…)
Automatic translation is nice, but please, allow it on a per-post basis instead of per-feed. kthxbye. (more…)