News, Stuffs and Other Stuffs

To content | To menu | To search

Sunday, November 9 2008

the one with the new late 2008 macbook running linux

Well. 2h45 battery time on thinking/edition/compilation cycles after lots of tweaks to the base install (debian unstable).

Considering that i don't have working brightness changing yet, which means that my brightness is at 100% at all time, it's not too bad. the hardware in general is almost fully working on what's the most basic need, except the brightness.

  • touchpad: fully working. got scroll with 2 finger, middle/right click etc. you need Henrik Rydberg's patches on the bcm5974.
  • function keyboard: fully working. again, you'll need Henrik's patch on hid and apple's quirks.
  • nvidia card: working on nvidia proprietary driver, i'm looking forward to help the nouveau project to get rid of those.
  • wireless card: working with broadcom proprietary driver. i think i'll cut my teeth on mmiotrace with this first, and then move to nouveau. already did a first trace to see what to expect and i'm now creating a tool in ocaml to data-mine the mmiotrace report to help.
  • sound: half working. the sound is only available through headphones.
  • rebooting: leave the machine on, with nothing left to run.. need to press the power button 4s to get out of it.
  • mini display port: status unknown, i don't have the dongle to get anything plug really, and i rarely use the feature in general.
  • brightness change: the only thing that works is actually switching off the screen backlight completely after a long period of idleness.

Wednesday, November 5 2008

the one with a great day for the world

go obama

Saturday, October 18 2008

the one with corrupted opensource zealot

For some reason, there's lot of opensource (pseudo-)zealots that think using macosX is OK because it got some unix-ish feeling ... let's be quite clear about it, it's exactly the same as running windows, license wise.

Monday, September 15 2008

the one where firefox turns bad

Ah well, looks like it's going even worse than i was expecting with the mozilla corp. I'm already using iceweasel anyway, since Debian made the right things several months ago on something that was relatively benign compared to the current EULA crap in the latest firefox version. looks like i'll be on the market for a new browser soon. I think i'm really looking forward to a webkit based gnome browser.

Thursday, September 11 2008

the one with the favorite RCS

There's dozen of different RCS out there. each of them got a slightly different user interface, which make switching between one to the other uneasy.

They can be divided in two categories: distributed and central.

  • a central RCS means that each user is talking to a remote place to do RCS actions.
  • a distributed RCS means that each user got a copy where RCS actions happens, and have synchronization mechanism across copies.

In some way, DRCS is much more flexible and a superset of the centralized RCS; while you can still works with them in a centralized fashion, it permits much more.

Some of the most popular open-source DRCS are: git, bzr, mercurial and darcs.

My favorite DRCS for everyday use is git. git started from a bunch of really low level operation commands hold together by shell scripts, and evolve over the years into a more built-ins and consistent DRCS. it's also still the fastest and most flexible system.

Git users, have usually, in my experience, a more sane understanding of how distributed development should be done. people have to grasp all what a branch and merge works, to be familiar with git. however with other DRCS, i frequently see people scared by merging and branches, which means that those persons, tends to pull-commit-push as often and quickly as possible, leaving the history in some kind of linear mix-up between all the things that people are working on.

In the end, the more changes happening, the more history chaos, this commit-early technique bring. which means this is not scalable when the number of change or commiter increase.

In some ways, git rewards people with a knowledge on how to do thing the right way, which is something inherited by the linux kernel development, with thousands of differents peoples from all over the world sending thousands of thousands of patches/commit all the time.

Git is about discipline, and a steeper learning curse, but also give flexiblity, performance and scaling to development.

Sunday, August 10 2008

the one with understanding precedence and associavity with parser generators

precedence is the ability to give more or less priority to symbols. for example the expression 5 + 4 * 10 can be understood in two different way. the first one, (5 + 4) * 10 which give you the value 90, and the second one 5 + (4 * 10) which give you the value 45. basic mathematics taught us that the second one is the right one, and that * has priority over +. in this case * has higher precedence than +.

associavity is the way to associate same thing together. for example the expression 8 / 4 * 4 can again be understood in two different way. the first one (8 / 4) * 4 which give you the value 8, and the second one 8 / (4 * 4) which gives you the value 0.5. * and / got the same precedence so you can't determine only with this criteria. on a left-to-right association, expression associate from left to right. so 1 * 2 * 3 * 4 is actually understood as ( (1 * 2) * 3 ) * 4. on a right-to-left association with associate term on the opposite way. 1 * 2 * 3 * 4 is understood as 1 * (2 * ( 3 * 4 ) ).

common parser generator, using LALR(1) type of parsing, work with a stack of symbol and only do two operations repetitively: reduce or shift. shift means that we take the symbol we looking at and we put it on the stack. reducing means that part of (or all) the stack can be replace by some rule.

the following grammar contains conflict with the + and * terms. conflicts means that the parser has multiple options as to how things can be parsed.

E -> E * E (rule 1)
  -> E + E (rule 2)

when parsing the following expression E + E * E, the following actions are performed:

Stack		Input		Action
		E + E * E	shift
E		+ E * E		shift
E +		E * E		shift
E + E		* E		shift/reduce conflict

At this point the parser can choose either to replace the stack elements E + E by E through rule 2, or it can choose to shift the following elements through rule 1. by default usually, they choose to shift which lead into the following

Stack		Input		Action
E + E		* E		shift
E + E * 	E		shift
E + E * E			reduce (rule 1)
E + E				reduce (rule 2)
E				accept

that means the expression has been parsed E + (E * E).

going back to the shift choosing, and replacing it by a reduce will lead into the following:

Stack		Input		Action
E + E		* E		reduce (rule 2)
E 		* E		shift
E *		E		shift
E * E				reduce (rule 1)
E				accept

which is (E + E) * E

in this specific case, the grammar is very easily written to get rid of the conflicts between the 2 operators. however when the number of symbols grows this is getting more and more tedious to do.

Fortunately, this is possible to actually influence the parser to do an educated guess at what to do when there's a shift/reduce conflict instead of defaulting to some action. this is done with precedence and associavity of terminal symbols.

When the precedence of the next symbol is higher than your current stack precedence, you want to shift, and when it's lower, reduce. when precedence is the same, for example * and /, associavity come into action. left-to-right associavity will means reduce, and right-to-left shift.

practily with bison or ocamlyacc, precedence and associavity are defined together at the beginning of the grammar file. using the %left %right %nonassoc directives.

%left directive means that the following symbols will associate from left-to-right. %right directive means right-to-left. and the %nonassoc directive means that instead of associating symbols either from left-to-right or right-to-left, we want the parser to error-out on thoses case, which means that the user has to write the way it's associated explicitly (using parenthesis for examples).

The precedence is implicitely defined with the same directives using the order in which they appears in the file. the first of those directives will be the lowest precedence, and the last of those directives will be the highest precendence.

for example a subset of the C operators precedence will be written the following way:

%left ,
%right = += -= *= ...
%left == !=
%left <= < > >=
%left << >>
%left + -
%left * / %

note that sometimes some symbol have different precedence in different context. -4 * 5 need to be understood has (- 4) * 5. using the previous precedence this is not possible since the precendence of the stack after shifting "- 4" is the precedence of -, which is lower than the precedence of *. hence the parser will shift to give priority to *.

the %prec directive is useful to artificialy change the precedence of the stack. in our case we want to define a dummy symbol that going to have higher precedence than *. First you need to tweak the precedence directives adding

%left + -
%left * / %
%left DUMMY_MINUS

and in your grammar the "E -> - E" rules will be rewritten "E -> - E %prec DUMMY_MINUS".

Sunday, August 3 2008

Back to dotclear

Well, i though i was going to develop my own set of tools to generate a static blog. specially since i don't really like dynamic database and seems a bit overkill. nonetheless i'm back using dotclear, since i really don't have time to develop few stuff to make the static blog a real blog (for example, a rss reader).

Saturday, August 2 2008

Un año mas

well, err, i guess it happens.. well every year. nevermind ! i'm now old enough to do, the exact same thing i could do yesterday.