The Caribbean Weblog

"This blog is continuing @ http://christophemaximin.com "

Aller au contenu | Aller au menu | Aller à la recherche

vendredi 27 juillet 2007

YATWS -beta-

YATWS, a Ruby on Rails, RESTful, AJAX-loaded, easy-to-use multi-level and ads-free tasks-manager -beta- web service. No big deal, I needed it for myself, I created it, that's all.

mercredi 18 juillet 2007

Faire un do...while en ruby

Il se trouve que la vraie structure do ... while n'existe pas en ruby. Sérieusement.
Pour combler ce manque, il devient commun d'utiliser la structure begin...end faite pour gérer le (long)[1] code suceptible de générer une exception (plus d'informations).

Ceci ce présente donc sous la forme suivante, par exemple :

begin
  @user = User.create_guest
end while @user.errors.any?

C'est bête, mais on s'y fait, surtout quand il se trouve que l'on doit vraiment gérer des exceptions dans ce bloc.

Notes

[1] parce que c'est gérable "inline" aussi. Par exemple, si foo.bar génère une exception, avec la ligne suivante, la variable prout prendra pour valeur "pouet" : prout = foo.bar rescue 'pouet'

mardi 17 juillet 2007

Hybrid Assistive Limb 5

Quand même, c'est pas mal du tout :

samedi 7 juillet 2007

Americans ready to elect a Black President (?)

obama clinton

Although 92 percent of the NEWSWEEK Poll’s respondents claim they would vote for a black candidate (up from 83 percent in 1991), only 59 percent believe the country is actually ready for an African-American president (an improvement over 37 percent in a 2000 CBS News poll).


Similarly, 86 percent of voters say they would vote for a female commander in chief, but only 58 percent believe the country is ready for one (up from 40 percent in a 1996 CBS poll).


Two thirds (66 percent) of voters said there was at least some chance they’d vote for Democratic Sen. Barack Obama (35 percent said there was a “good” chance, up from 20 percent last May).


About as many (62 percent) said there was some chance they’d vote for Democratic Sen. Hillary Clinton (43 percent said good chance, up from 33 percent). In a head-to-head race, though, Clinton dominates Obama 56 to 33 percent.

Source : http://www.msnbc.msn.com/id/19623085/site/newsweek/

En fait, il faudrait déjà qu'il arrive vivant au bout de l'élection... et même s'il gagnait, je ne parierai pas un kopeck sur le fait qu'il termine son mandat vivant... mais comme on dit, qui ne tente rien n'a rien. Bon courage, et bonne chance à lui.

Pages: