Archive for the ‘Computer’ Category

Graphical widgets

Mercredi, avril 23rd, 2008

Are you like me, programming a lot but not been a graphical designer?  I’ve found a project offering all the icons we could need to make some pretty apps without loosing our time drawing (which will be obviously ugly) icons.

Juste go and take a look at Tango Desktop Project.

How did i find it?  I was just reading my daily stuff (newsforge, slashdot, etc) and I discover luminote, a web based note collector which use tango for their design.

Utilisation de sphinx sous os x

Mardi, février 26th, 2008

Sphinx est un engin de base de donnée et de recherche plein texte.Pour installer sphinx, vous devez installer plusieurs paquetages GNU.  Pour ce faire sous mac os-x le plus simple est d’utiliser macport.  Vous devez en autre installer mysql. (Commande: sudo port install mysql5)Par la suive vous devez compiler sphinx avec la commande suivante: ./configure --with-mysql=/opt/local/ --with-mysql-includes=/opt/local/include/mysql5/mysql/ --with-mysql-libs=/opt/local/lib/mysql5/mysql/ Je vous donnerai plus de détails bientôt sur son utilisation. 

ASN.1/DER/BER PHP

Mercredi, février 13th, 2008

Je vous ai parlé dernièrement de ASN.1. Voici un petit parseur de base en PHP

 
//Title: Simple PHP BER/DER/ASN.1 basic decoder
//Author: Jean-Luc Cyr
//Date: 2008-02-13
//Desc: Simple BER Printable string dumper
//	read BER data from a file
 
// Set input filename
$filename = 'o';
// Set max number of tag to parse (0 = no limit)
$limit = 0;
 
//Open data file
$f = fopen($filename,'rb');
//Set read tag number to 0
$c=0;
//While not end of file
while(!feof($f))
{
    //Read first block data type
    $type = ord(fread($f,1));
    if ($type==0)
      break;
    //Read first len block
    $len = ord(fread($f,1));
    if ($len==0)
      break;
    $le = 0;
    //If first bit of len is set (1)
    //we have a multiple bit len to read
    if (($len&128)==128)
    {
        echo "Big Len ".($len&127)." Bytes\r\n";
        for ($i = 0; $i < ($len&127); $i++)
          $le = $le * 256 + ord(fread($f,1));
        $len = $le;
    }
    //Findout data type (first 2 bits)
    $cl = ($type & (128+64) ) >> 6;
    switch($cl)
    {
     case 0:
        $cla = 'Universal';
        break;
     case 1:
        $cla = 'application';
        break;
     case 2:
        $cla = 'context-specific';
        break;
     case 3:
        $cla = 'private';
        break;
    }
    //Dump some info
    printf("[$cla] Type: %x (%d), len: %d\r\n",$type,$type,$len);
    //Read data chunk
    $data = fread($f,$len);
    //Display data chunk based on type
    switch($type)
    {
     case 2: // integer
        break;
     case 3: // bit string
        break;
     case 4: // octet string
        break;
     case 5: // null
        break;
     case 6: // object identifier
        break;
     case 16: // sequence and sequence of
        break;
     case 17: // set and set of
        break;
     case 19: //string
        printf("Data: $data\r\n");
        break;
     case 20: // t61string
        break;
     case 22: // ia5string
        break;
     case 23: // utctime
        break;
     default:
        #printf("Data: $data\r\n");
        break;
    }
    //increment count
    $c++;
    //check if we reach the number of tag specified
    if (($c>$limit)&&($limit>0)) break;
}
 
//close our input file
fclose($f);

Les mails à l’ancienne

Mercredi, février 13th, 2008

Utilisez-vous toujours logiciel graphique pour lire vos courriels? (outlook, thunderbird, mail)  Où vous êtes comme moi et aimez pouvoir lire vos courriels a distance avec une connexion terminal (telnet ou ssh)?

Depuis plusieurs années j’utilise le logiciel ‘mail’ à l’occasion mais je me suis trouvé un affinité particulière pour ‘pine‘.  Je l’avais un peu délaissé ces derniers temps car l’utilisation du format ‘maildir’ au lieu des ‘inbox’ standard de unix ne me permettait plus de voir mes courriels autres que dans la boite de réception.

J’ai maintenant trouvé la méthode pour utiliser ‘pine’ avec les ‘maildir’.

  • Premièrement lancer PINE
  • Aller dans le menu de configuration ‘S
  • Aller dans le sous-menu ‘L
  • Configurer une liste de boites.  La seule valeur qui importe c’est le chemin (’path’) où il faut mettre #md/Maildir
  • Ensuite retourner au menu principal
  • Aller dans le menu de configuration ‘S’
  • Aller dans le sous-menu ‘C’
  • Dans la section ‘folder preferene’ activer l’option ‘enable-dot-folders’

Et voilà vous devriez voir tous vos ‘maildir’ maintenant.

Encodage de données

Jeudi, février 7th, 2008

Est-ce que vous connaissez la norme ASN.1 ? C’est un système d’encodage de données pour la transmission de manière uniforme et compréhensible par tout langage et/ou plateforme. Plusieurs systèmes sont dérivée de cette norme dont BER (Basic Encoding Rule), DER (Distinguished Encoding Rules), CER (Canonical Encoding Rules). DER/BER sont expliqués assez clairement sur le site luca.ntop.org Quand à elle, la norme ASN.1 est facilement trouvable sur google (introduction, consortium).

Coté logiciel et hype moderne, ca pourrait se définir comme un version très bas niveau d’un système de communication comme JSON. Il permet l’échange de données de bases (int, string, …), de structures et de structures imbriquées. Je suis sur que plusieurs systèmes que nous utilisons se servent de cette norme à l’interne sans que nous le sachions.

Un kit d’outil de base pour encoder/décoder est disponible à http://lionet.info/asn1c/download.html

QRCode

Jeudi, janvier 24th, 2008

Vous connaissez les QRCodes?

Ce sont de petits graphiques, 2 dimensions, qui ont la même utilisé que des code à barres.

Voici un exemple:

QRCode2

Différents logiciels existent pour en produire et pour les lires.

Un exemple en ligne est disponible ICI

CMS BLOG WIKI

Mardi, janvier 22nd, 2008

Quoi prendre? un CMS, un Wiki ou un Blog?  Humm… depuis quelques années j’ai essayer les différents systèmes.

J’avais 2 cms basés sur Étomite en ligne (après avoir utilisé plusieurs autres logiciels), un autre basé sur Zope/Plone, un Wiki basé sur médiaWiki.

Le problème c’est que je n’écris pas régulièrement.  Alors pourquoi ne pas essayer encore autre chose pour voir sur l’utilisation que je fais du clavier dans mes heures de loisirs sera plus grande et plus utile.

Alors voici pourquoi vous voyez ce tout nouveau “setup” sur ce site web.

Bienvenue sur le Blog www.adninformatique.net.

Pour ceux qui veulent retrouver des informations plus personnelles à mon sujet, allez plutôt explorer www.jlcyr.com

Rest

Vendredi, décembre 14th, 2007

I’m used to be asked “what is REST?”, the answer is simple: “Rest is a development method that involve using HTTP methods to communicate to a web service.”

But when we got into details, digging the web, we found that some details are fuzzy.

The basics, using HTTP verbs GET, POST, PUT and DELETE is agreed by almost averyone. But what does each web is not well defined.

I recently read an article giving an interesting point of view.
GET is used to retrieve information.
POST is used to create or update a document by sending the data to an intermediate URL.
PUT is used to create or completly update a document name by it’s own URL.
DELETE is used to delete a document.

I should agree the detail that POST create a document by sending data to another URL seem right for me. We usally use POST on an URL representing the base of the final one. For example, we POST a “user” to something like http://server/users and that create a new document at an url like http://server/users/TheNewUser. And I also agree that PUT is used on a complete URL like http://server/users/TheUserID. But I disagree with the principle that PUT should always overwrite the document. Following the definition in the HTTP RFC the article is right! But for data consistency, if you allow an external call to define new document URL, you tend to broke the data consistency.

I think that you should only allow document creation by POSTing some data to the root url http://server/users and let the web service define the corresponding ID and URL as http://server/users/NewUserID and after that, allow updating the document using PUT method on it. I also recommand that PUTting or POSTing to the document URL only update part of the document that is sent (as partial form or some blocks) instead of overwriting the entire content. I recommand that to avoid need to first GET the entire document, merge the changes and PUT/POST it back to the server.

On top of that, I strongly recommand using HTTP authentification in the http://user:password@server/service form. You could access the user/pass within your software to extent access rights but your resources are web based protected. The output format should also be negociated using HEADER strings

Cablage Cat6

Jeudi, septembre 27th, 2007

Ca fait un bout de temps que je me demande l’utilisé de faire du cablage réseau Cat6e poru l’utilisation actuelle que la majorité des gens en font. Je n’ai pas trouvé la réponse spécifique, par contre, voici quelques liens vers de l’informations techniques intéressantes:

http://www.tiaonline.org/standards/technology/cat6/faq.cfm
http://www.tiaonline.org/standards/technology/cat6/index.cfm

Un peu moins pertinent mais mérite une mention.. pour sa clarté:

http://fourpair.blogspot.com/

ah.. et tant qu’a y être, voici la recette pour faire un “patch cord”

http://www.lanshack.com/make_cat_6_cable.aspx

Web 2.0 optimisation

Samedi, septembre 15th, 2007

Here are some web 2.0 optimisation tricks
80-90% of end user response time is spent on the front-end. so optimize there.

14 Rules for a Better User Experience

1. make fewer HTTP requests
2. use a CDN
3. add an Expires header
4. gzip components - even JS and CSS
5. CSS at top
6. JavaScripts to bottom
7. avoid CSS expressions
8. make JS and CSS external
9. reduce DNS lookups
10. minify Javascript
11. avoid redirects
12. remove duplicate scripts
13. configure Etags - disable in most cases if load-balanced or multiple web servers
14. make AJAX cacheable
Source: James’World