Bienvenue sur le blog jlcyr.com. Ce blog est un petit site personnel. Il regroupe des liens, notes et essais sur différents sujets. Au plaisir d'avoir quelques lecteurs...

Ordre des ingénieurs - Régional Saguenay Lac St-Jean mai 13th, 2009

Comme certains l’ont déjà entendu.. je me présentais comme directeur pour la régionale Saguenay lac-st-jean de l’ordre des ingénieurs du Québec à l’assemblée annuelle vendredi dernier.  Ayant eu plus d’appui pour ma candidature que nécessaire (5 seulement étaient demandés et j’en ai eu 7), et n’ayant pas d’opposition (il restait même un poste d’ouvert) j’ai été élu à l’unanimité au sein de l’exécutif.

Cela au minimum m’engage à participer à neuf réunions par année (Congé en juin, juillet et décembre), participer à certaines activités et naturellement (on est supposé en tant qu’ingénieur de toute manière) participer à la promotion de la profession d’ingénieur.

À la suite de l’assemblée annuelle générale s’est tenu le souper “terre et mer” qui fût une réussite bien appréciée par les membres présents.

Je vous tiendrai au courant si jamais je m’implique sur d’autre comité ou que j’ai une envie soudaine de vous reparler de ce bénévolat.

support Mercurial sous TextMate mai 13th, 2009

Un “Bundle” existe sous TextMate (le super éditeur Mac) pour gérer les sources sous mercurial.  La façon simple de l’installer est d’exécuter le script ci-dessous qui proviens d’ici où vous retrouvez aussi une liste de Bundle disponibles.   


 

#!/bin/sh

LC_CTYPE=en_US.UTF-8
SVN=`which svn`

echo Changing to Bundles directory...
mkdir -p /Library/Application\ Support/TextMate/Bundles
cd /Library/Application\ Support/TextMate/Bundles

if [ -d /Library/Application\ Support/TextMate/Bundles/Mercurial.tmbundle ]; then
	echo Mercurial bundle already exists - updating...
	$SVN up "Mercurial.tmbundle"
else
	echo Checking out Mercurial bundle...
	$SVN --username anon --password anon co http://macromates.com/svn/Bundles/trunk/Bundles/Mercurial.tmbundle/
fi

echo Reloading bundles in TextMate...
osascript -e 'tell app "TextMate" to reload bundles'
Nouvel album de Jean Leloup avril 24th, 2009

Pour ceux qui ne le savent pas encore, Jean Leloup (oui, oui, pas Jean Leclerc, Jean Leloup est ressuscité) va sortir un nouveau disque mardi prochain (28 mai 2009).  Il est déjà disponible en version électronique sur zik.ca  Vous pouvez lire des commentaires sur chacune des pistes et en écouter des extraits ICI.

De plus, si j’ai  bien entendu, notre loup sera présent à tous le monde en parle dimanche prochain.

URL sur une minivan avril 24th, 2009

Cette semaine ma curiosité a été piquée quand j’ai vu ceci “www.7pouvoirs.com” inscrit sur le derrière d’une minivan circulant devant moi sur la route.  Non seulement j’étais surpris de voir une adresse web sur un véhicule (ici au saguenay) mais je trouvais ça louche un tel nom.. 7 pouvoirs!

Et bien, cette tactique publicitaire a fonctionné puisque je suis allé voir le dit site internet.  Ce site fait la promotion d’un livre et de CDs visant (vous l’avez deviner) les 7 pouvoirs.  Je ne crois pas acheter le tout, mais cette tactique m’as quand même amené sur le site et fait publier un billet sur mon blogue (mais qu’est-ce que je fais là!?!?).

Bon c’est quand même un auteur régional si je me fis au contenu de ceci : www.cj.saglac.qc.ca/CJechoNov2003.pdf (je vous en copie l’extrait)

“À la fin d’octobre, un membre du personnel des Centres jeunesse nous conviait à un événement rare : un lancement double. En effet, Gilbert Gagnon, DPJ de son état professionnel, nous présentait fièrement ses derniers nés : un roman et une série de huit CD audio présentant un programme tout à fait unique. Rappelons que Gilbert a déjà publié deux autres volumes, mais qu’il s’agit ici de sa première œuvre romanesque.

Le roman d’abord « Les sept pouvoirs d’Abraham Hollis » dans lequel le lecteur peut suivre les aventures de Jérémiah et d’Abraham qui sont, presque malgré eux, les premiers humains à accéder à de fantastiques pouvoirs. Un roman auquel certains ont apposé les qualificatifs de fantastique, humoristique, onirique, philosophique,systémique et Hollistique… Déjà, Gilbert s’est quasiment engagé publiquement à écrire la suite de ce premier roman ; on assiste peut-être à la naissance d’une trilogie à la Tolkien

Puis, le coffret « Vos 7 pouvoirs» qui comprend huit CD audio. L’auteur nous indique que, grâce à ce programme tout à fait unique, chaque personne peut y apprendre, entre autres :
• À se connecter à sa mission;
• À utiliser ses 7 pouvoirs
• Atteindre ses objectifs beaucoup plus efficacement et rapidement
• Utiliser les capacités supérieures de son cerveau
• Se libérer des entraves du passé

Est-ce que quelqu’un en connait plus sur le sujet? Laissez-le moi savoir.

Hidding content in frontrow mars 16th, 2009


Looking around, I found nothing interesting explaining how to hide content in frontrow.  Why do this?  I don’t want all the items to appear here.  For example, I don’t want my TV Show in ITune to be available in Front Row.

The secret is in the /System/Library/CoreServices/Front Row.app/Contents/PlugIns where reside the information about what is displayed in the main menu.  Juste renaming the  TV.frappliance to .TV.frappliance (adding a dot in front of it) hide this item in the menu.May be we can have more granularity (using the checkbox in front of the item in itune for example) but I haven’t time to test everything.

Pointage de crédit mars 16th, 2009

Vous saviez qu’on a tous (ou presque) un dossier de crédit?  Mais saviez-vous que nous avons le droit de le consulter?  Et encore mieux, qu’on devrait tous le faire de temps en temps pour s’assurer que les informations qu’il contient sont exactes et pour détecter de possibles fraudes?

Voici les liens vers des les formulaires pour demander des informations de crédit chez les trois plus grandes compagnies qui tiennent de tels dossiers.

Pour Equifax, remplissez le formulaire suivant:
http://www.equifax.com/ecm/canada/demandededossierdecredit.pdf

Pour TransUnion:
http://www.transunion.ca/docs/personal/Consumer%20Disclosure%20Request%20Form%20_fr.pdf

Pour Experian:
http://www.creditbureau.ca/intl/pdfs/report_request_french.pdf

 

Source: Réseau des Ingénieurs du Québec.

CVS repository switch mars 9th, 2009

This is a simple script that change recursively the CVS repository of a project.

In this example, it changes from “-d :ext:lsabo:/gen” remote server to a local file repository “-d /cvsroots/gen”.

find * | grep Root | xargs sed -i 's/:ext:lsabo\/gen/\/cvsroots\/gen/'

PDF Half page splitting février 26th, 2009

I’ve found this interresting script digging around.  As I’ve a lot of old book got scanned 2 / 1 pages and I don’t found then easy to read on my portable device I think this could be useful.

#!/bin/bash
#script:    unpnup
#        This script reformats pdf files where two portait pages
#        are joined on one landscape page (like pnup does). After
#        completion each page is on one single fullframe page
#         Copyright (c) 2007 F5 GmbH
# Author: Harald Hackenberg <hackenberggmx.at>
#
#programs required:
#           pdftk, pdftops, poster, epstopdf
#
#
#
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
# the full text of the license.
if [ “$1″ == “” ] || [ “$1″ == “–help” ]; then
echo
echo “Usage: `basename $0` filename”
echo
else

mkdir tmp
cd tmp
pdftk “$1″ burst
for file in pg*.pdf;
do
pdftops -eps $file
poster -v -pA4 -mA5 -c0% `basename $file .pdf`.eps > `basename $file .pdf`.tps
epstopdf `basename $file .pdf`.tps
done
pdftk pg*.pdf cat output ../`basename $1 .pdf`_unpnuped.pdf
rm *
cd ..
rmdir tmp
fi

Hidding content in frontrow février 16th, 2009

Looking around, I found nothing interesting explaining how to hide content in frontrow.  Why do this?  I don’t want all the items to appear here.  For example, I don’t want my TV Show in ITune to be available in Front Row.

The secret is in the /System/Library/CoreServices/Front Row.app/Contents/PlugIns where reside the information about what is displayed in the main menu.  Juste renaming the  TV.frappliance to .TV.frappliance (adding a dot in front of it) hide this item in the menu.

May be we can have more granularity (using the checkbox in front of the item in itune for example) but I haven’t time to test everything.

Programmation objet novembre 18th, 2008

 Extrait d’une entrevue avec le créateur du langage Erlang.  Il parle de sa vision de la programmation orientée objet.
Ref: http://www.infoq.com/interviews/Erlang-Joe-Armstrong

You’ve been reading my OOP sucks blogs. I saw a blog yesterday, they said Erlang is actually more object oriented, truer to the spirit of pure object orientation than all object oriented languages. You could take two views: you could say either Erlang isn’t object oriented - which I used to say a few years ago - or you could say it’s more object oriented than all the object oriented languages. Alan Kay said that he made a mistake in not really emphasizing the messaging aspect of object oriented programming. He said in SmallTalk you talk about sending a message to an object, but you don’t, you do a function call. I think function calls and remote procedure calls are too high-level in the sense that a function call or a remote procedure call returns to the person who made it.

If I do remote procedure call against you, I can say “Hey, do this!” and the answer automatically comes back to me, but that’s not how we work. I could say “You do that” and reply to this guy. Why am I involved? That’s how we behave. If you are a manager at office you say “Can you check this out? When you’ve done it, tell this guy”. This is just an asynchronous message passing model. I think when you talk about object orientated programming, when you model a world, you are encouraged to think in terms of objects and I don’t see objects. I also have what you would call the categorization problem: which object do I put my code in? Sorry I just don’t get this. Let’s suppose you have a method, in SmallTalk terms, that manipulates time of a directory structure or something like that, is this a subclass of a time object or is it a subclass of a directory object? I don’t know.

Years ago I’ve started several projects staff - file my data/my letters, physical papers and research reports and things like that. Every time I’ve done that it failed, because I get files and I put something on this line - it says “Correspondence”, “Lectures”, “Papers”. Then I get this thing: it’s a paper, I put it in the file called papers; this is a letter which contains a paper “Do I put it in ‘Correspondence’ or do I put it in ‘Lecture notes’?”. It breaks down because I don’t know where to put it. I think if you’ve got objects in your function, which object do you put it in? I made another filing scheme, in which I just numbered everything, and I have files and I go over my office and the first file says 1-167 and the next file says 168- something. I have a single file that goes 1,2,3,4 and some text. I use emacs to create, I use grep to search, and it’s a brilliant system!

This is how we organize things in English. We have a dictionary and when we want to know what the word means, we look it up in the dictionary. Everything is in alphabetical order - that’s a good way to organize data. I think object oriented programming is not a good way to organize data. There is a principle in programming “Never write something twice” - yes, it’s a fine principle, a great principle, but let’s think about this: “How do I find the old stuff, that I am going to reuse?” That becomes extremely difficult, in fact, I think people have been deluded into thinking that this choice is easy. When I started programming, there were no choices, I programmed everything in Fortran - Fortran was the only language I had on my machine. Nowadays, some poor sod’s got to choose the programming language: “Should I have Java or C# or C++ or Lua or F# or Pascal or Prologue or Erlang or Haskell? On what should I do it?” “You don’t want something in the-NET framework or a Java framework that runs on the JVM or on Mac OSX?”

You have all these decisions, incredibly difficult to make, and then you got bosses. You don’t write this stuff in scratch! You got to reuse somebody else’s code. After all that is. Somebody else’s code doesn’t do exactly what you want - it does something that’s subtly different. Then, the time taken to modify and understand this old code takes an incredible amount of time. Have you ever sat there with code that somebody else has written and have to modify it? You spend hours and hours doing it. You can’t reuse object oriented code, because all the stuff it inherited has to be there as well. You can’t just take this stuff out and put it in your program cut and paste, like you did in C, or Erlang or Prologue or Perl, you got to take all the stuff it inherits from.

One of the problems I had with object oriented programming, one guy said: “You wanted a banana but what you got was a gorilla that was holding the banana and the entire jungle. You got a lot of stuff in it and all you wanted was just a little bit of code”. The Lisp idea - lots of little functions - ubiquitous data structures like Lists, everywhere, and lots of very small functions that work on this, that these are highly reusable. Code that’s referentially transparent, that means if you call it twice with the same arguments, you get the same value - it’s very reusable. To them the question is “How do we reorganize all this stuff? I think something like a dictionary, like the English dictionary, put in alphabetical order. Don’t put lots of modules, just put one module! If code is referentially transparent, it’s small functions, then it doesn’t belong to object. Where does it belong? What is the containing object? There isn’t one! So, just put them all in alphabetical order and use Google to search it and you’ll find the code easily.