Archive for January, 2006

01/13 The crap you read sometimes…

When Shin talked about getting a visa and straightening her teeth in France, Boschi asked her to marry him, reportedly saying that if she marries him, she does not need a visa and dental service is free in France. via Marmot


Well she wouldn’t need a visa to visit [but couldn’t get “free” medical care as a tourist], but to live there [and get a “Carte Vitale”], of course she would need one. She would get it, too, for 10 years, all at once [beats being the French spouse of a Korean, believe me]. And dental care is far from free, like any other country, dental care is one of the less reimbursed medical care. Actually, French people who have been to dentists in France and Korea usually prefer the Korean one [with the notable exception of yours truly, but it’s another story for another day].

Idiots…

01/11 Emballage de Carambar™

C’est quand le petit père Damien est de mauvais poil qu’il est le plus drôle :

En lieu et place de la carte de presse, un emballage de carambar.

Testigna, Grande Nouille [大面], on t’a volé un DVD de Bruce Lee ? ;-)

01/10 Salvageable…

I am nerdier than 79% of all people. Are you nerdier? Click here to find out!

01/09 Le meilleur reste *vraiment* à venir…

Tout en douceur, sans faire de bruit, 2005 aura vu ma vie basculer. Tout cs‘est accéléré ces derniers mois, mais c’est bien le 7 janvier dernier que tout a commenceré.
Sur la route de Notre-Dame-de-Bellecombe, pour un week-end de ski entre amiamis, mon premier. Il conduit, il parle, il choisit la station de radio, Chéri FM comme d’habitude, je l’écoute. Tant de chosechoses à se raconter, quatre mois d’absence à combler. La vie, l’amour, ce qu’il y a de mieux là bas, pourquoi on est quand même bien chez soi. Mais je ne comprends pas pourquoi il ne veuxveut pas me donner le prénom de celle qu’il a laisseré avec tristesse là-haut, où le soleil ne se lève pas. Ce n’est que dans les premiers virages des pentes des Alpes qu’une explication logique s’imiceimmisce dans mon esprit. Sans vraiment le dire, sans prononcer ce que je soupsonnesoupçonne, je lui faitfais comprendre que j’ai compris. Il me le confirme sans vraiment le dire lui non plus. C’est mieux ainsi.
Merci.
Merci de m’avoir donner la fierté d’être ton unique confidente pendant quelques mois. Je n’avais jamais été la confidente de personne.
Merci de savoir m’écouter, le peu de fois où j’ai envie de parler. Je n’avais jamais eu de confident.
Merci d’avoir fait en sorte que j’attaque les gardes aux urgences sans peur. Malgrèé tous ses défauts, ça aura été le stage le plus maturant de mon cursus.
Merci de m’avoir appris qu’un repas au self est bien mieux si on s’assoit en face de la caisse, pour voir tous les petits culs qui passent.
Merci de m’avoir montré qu’en n’ayant pas peur d’être impertinente, de faire de l’humour, et d’être un peu lèche cul, on pouvait avoir le plaisir de voir le sourire d’un professeur d’anesthésie, mais surtout lui donner envie de passer du temps à nous expliquer le pourquoi du comment, au point de me contaminer.
Merci de m’avoir sortie de ma coquille de Bernard-Lhermite pathologiquement timide.
Merci de m’avoir montrer que l’on pouvait être étudiante en médecine, mais Vivre et Exister quand même.

J’espère voir ta grande silouettesilhouette l’année prochaine dans un bloc de gynécologie parisien, je feraisferai la rachi-anesthésie, tu feras la césarienne. Et le soir, on profitera de notre jeunesse.

12 fautes, peut vraiment mieux faire…

01/08 Victory!

My first Erlang program, all on my own :-) [well, with a lot of time spent on the online doc…]. It’s the classic Coconuts problem, which you can find described here:

This problem, which appeared in a short story by Ben Ames Williams, concerns five men on a deserted island who gather a pile of coconuts. During the night, one of the men wakes up and decides to take his share in advance. He divides the coconuts into five equal piles. One coconut is left over, and he tosses it to a nearby monkey. Hiding his pile and consolidating the four remaining piles, he returns to sleep.

The second man does the same thing, dividing the now slightly smaller pile into five equal ones, tossing the one leftover coconut to the monkey, hiding his pile and returning to sleep. The third, fourth and fifth man all repeat the same pattern.

When all awake in the morning, the pile looks smaller, but each man is as guilty as the others, so no one says anything. They divide the remaining coconuts into five equal piles as the monkey watches. This time, though, there are no coconuts left over.

How many coconuts did they start with?

The code below can probably be cleaned up, improved, yadada, but it gives the right answer…

-module(coconuts).
-export([start/0]).

start() ->
  doWork(5,1,5).

doWork(99999,1,99999) ->
  done;
doWork(Orig, 6, Temp) ->
  if
    (Temp rem 5) == 0 ->
      io:format("Victory! ~w~n",[Orig]);
    Temp rem 5 /= 0 ->
      doWork(Orig+1, 1, Orig+1),
      done
  end;
doWork(Orig, Man, Temp) ->
  if
    (Temp rem 5) /= 1 ->
      doWork(Orig+1, 1, Orig+1);
    (Temp rem 5) == 1 ->
      doWork(Orig, Man + 1, trunc((Temp-1)*4/5))
  end.

Execution:
104> c(coconuts).
{ok,coconuts}
105> coconuts:start().
Victory! 3121
ok

This is mind-boggling. I sat at my desk tonight with the goal of writing a small program and understand how it worked. Using recursion instead of loops makes my head splinter in multiple places. Basically you test and redirect the flow with overloading of a function [testing for 99,999 thousand iterations on the pile, for 6 iterations on Man, etc…], and this makes me feel like throwing a for-next loop at the screen. But, OK, it works, it’s fast, and I have decided to learn Erlang, so I’ll get on with the program…

/me shakes fist at the Erlang people for writing half-assed docs…

Erlang