<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://www.jacquet80.eu/blog/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Christophe Jacquet</title>
  <link>http://www.jacquet80.eu/blog/</link>
  <atom:link href="http://www.jacquet80.eu/blog/feed/rss2" rel="self" type="application/rss+xml"/>
  <description></description>
  <language>fr</language>
  <pubDate>Mon, 30 Jan 2012 22:28:34 +0100</pubDate>
  <copyright>© Christophe Jacquet, 1999-2012. Tous droits réservés, sauf mention contraire explicite.</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Sauvegarde d'une carte SIM</title>
    <link>http://www.jacquet80.eu/blog/post/2012/01/Sauvegarde-carte-SIM</link>
    <guid isPermaLink="false">urn:md5:ed69de72f4ead514069b97745c2fde04</guid>
    <pubDate>Sun, 15 Jan 2012 19:07:00 +0100</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
            
    <description>    &lt;p&gt;Ce billet explique comment sauvegarder le contenu du répertoire téléphonique d'une carte SIM à partir d'un téléphone Bluetooth. Je l'ai utilisée avec succès sur un Nokia 6230i, mais cela doit s'adapter à tout type de téléphone. On suppose que l'ordinateur dispose d'un système de type Unix avec l'outil &lt;a href=&quot;http://www.jacquet80.eu/blog/post/2010/04/GNU-Screen&quot; hreflang=&quot;fr&quot;&gt;GNU Screen&lt;/a&gt;.&lt;/p&gt;


&lt;h3&gt;Préparatifs&lt;/h3&gt;


&lt;p&gt;1) Il faut d'abord apparier le téléphone et l'ordinateur. La procédure dépend du téléphone et du système d'exploitation. Ensuite on se connecte en console au téléphone :&lt;/p&gt;


&lt;pre&gt;screen /dev/tty...&lt;/pre&gt;


&lt;p&gt;2) Démarrer l'enregistrement de la session Screen dans un fichier :&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;C-A&amp;nbsp;: logfile /path/to/file&lt;/code&gt; — on indique le fichier dans lequel la sauvegarde sera réalisée&lt;/li&gt;
&lt;li&gt;&lt;code&gt;C-A&amp;nbsp;: log on&lt;/code&gt; — lancer la sauvegarde&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Répertoire&lt;/h3&gt;


&lt;p&gt;3) Sélectionner le répertoire (&lt;em&gt;phonebook&lt;/em&gt;) de la carte SIM :&lt;/p&gt;


&lt;pre&gt;AT+CPBS=&quot;SM&quot;&lt;/pre&gt;


&lt;p&gt;4) Afficher le nombre d'entrées dans ce répertoire (réponse en italiques) :&lt;/p&gt;


&lt;pre&gt;AT+CPBR=?
&lt;em&gt;+CPBR: (1-150),20,12&lt;/em&gt;&lt;/pre&gt;


&lt;p&gt;5) Liste les entrées de ce répertoire :&lt;/p&gt;


&lt;pre&gt;AT+CPBR=1,150&lt;/pre&gt;


&lt;h3&gt;SMS&lt;/h3&gt;


&lt;p&gt;6) Sélectionner le mode texte pour la transmission des SMS :&lt;/p&gt;


&lt;pre&gt;AT+CMGF=1&lt;/pre&gt;


&lt;p&gt;7) Lister les modes de stockage :&lt;/p&gt;


&lt;p&gt;AT+CPMS=?&lt;/p&gt;


&lt;p&gt;8) Pour chaque mode de stockage (&lt;code&gt;SM&lt;/code&gt; pour la carte SIM proprement dite, &lt;code&gt;ME&lt;/code&gt; pour le mobile) :&lt;/p&gt;


&lt;pre&gt;AT+CPMS=&quot;&lt;em&gt;SM&lt;/em&gt;&quot;
AT+CMGL=&quot;ALL&quot;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Pour plus de détails, voir mon article : &lt;a href=&quot;http://www.jacquet80.eu/blog/post/2010/12/telephone-mobile-commandes-AT-mac&quot; hreflang=&quot;fr&quot;&gt;Téléphone mobile et commandes AT (et Mac)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2012/01/Sauvegarde-carte-SIM#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2012/01/Sauvegarde-carte-SIM#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/371</wfw:commentRss>
      </item>
    
  <item>
    <title>Nouvelles du RDS</title>
    <link>http://www.jacquet80.eu/blog/post/2012/01/Nouvelles-du-RDS</link>
    <guid isPermaLink="false">urn:md5:e9561ef6ed8838eec8987cd04d1c7d1c</guid>
    <pubDate>Tue, 03 Jan 2012 21:16:00 +0100</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
        <category>Radio</category>    
    <description>    &lt;h3&gt;PS dynamique en France&lt;/h3&gt;


&lt;p&gt;Les &lt;a href=&quot;http://www.csa.fr/actualite/decisions/decisions_detail.php?id=133520&quot; hreflang=&quot;fr&quot;&gt;conditions de l'expérimentation de PS dynamique du CSA en France&lt;/a&gt; ont changé en 2011-2012 : les expérimentations de PS dynamique sont autorisées jusqu'à mai 2012, mais &lt;em&gt;à condition d'être couplées à une diffusion en radiotexte&lt;/em&gt;, et &lt;em&gt;au-delà de mai 2012, seul le radiotexte sera autorisé.&lt;/em&gt; ¡Olé!&lt;/p&gt;


&lt;h3&gt;Radiotexte sur Radio France&lt;/h3&gt;


&lt;p&gt;Le radiotexte sur France Musique et France Inter s'étend : après l'Île-de-France, j'ai constaté qu'il est diffusé à Bordeaux, et on rapporte que c'est le cas à Lille également. Au moins, l'arrêt de la radiomessagerie ex-Operator est mis à profit ! À quand une couverture nationale ? À quand le tour de France Culture et France Info ?&lt;/p&gt;


&lt;h3&gt;xRDS : extended RDS&lt;/h3&gt;


&lt;p&gt;Une proposition d'étendre la norme RDS est actuellement étudiée par le RDS Forum : &lt;a href=&quot;http://extended-rds.org/&quot; hreflang=&quot;en&quot;&gt;xRDS pour Extended RDS&lt;/a&gt;. En gros l'idée est de diffuser plusieurs flux RDS standards sur plusieurs sous-porteuses (jusqu'à 6). Les flux supplémentaires seraient références depuis le flux « principal » à 57 kHz via une ODA, de sorte que le récepteur les fusionne. De plus xRDS propose de « compresser » les données transmises sur les &lt;em&gt;flux supplémentaires&lt;/em&gt;. Par exemple, dans un groupe inutile de transmettre le bloc n°1 qui transmet le PI, vu que le PI est déjà codé par le flux principal. De même dans les groupes de type B, le bloc n°3 (répétition du PI) peut être omis, ou bien peut servir à coder le bloc n°4 d'un autre groupe de type B. L'idée est techniquement intéressante, car elle est rétro-compatible avec l'existant. Mais dans un contexte où l'on parle de remplacer éventuellement la diffusion FM analogique par de la radio numérique, les promoteurs pourront-ils convaincre des fabricants de sortir des récepteurs compatibles xRDS, et surtout des diffuseurs d'exploiter un canal de données qui ne serait pas reçu par le parc actuel de récepteurs&amp;nbsp;? Je suis &lt;em&gt;extrêmement dubitatif&lt;/em&gt;.&lt;/p&gt;


&lt;h3&gt;RDS Surveyor version 0.8&lt;/h3&gt;


&lt;p&gt;J'ai publié une version 0.8 de mon décodeur &lt;a href=&quot;http://rds-surveyor.sourceforge.net/&quot; hreflang=&quot;en&quot;&gt;RDS Surveyor&lt;/a&gt;. Elle reprend de nombreuses améliorations présentes depuis plusieurs mois dans le code publiquement accessible . Parmi les &lt;a href=&quot;http://rds-surveyor.sourceforge.net/news/&quot; hreflang=&quot;en&quot;&gt;nombreuses nouveautés&lt;/a&gt; : compatibilité RBDS, compatibilité avec les fichiers de log de RDS Spy, multiples améliorations à l'interface graphique, accès direct à des données RDS disponibles sur le web, implémentation de l'ODA « EN301700 » (référencement de programmes DAB depuis le RDS, notamment utilisé par la BBC).&lt;/p&gt;


&lt;p&gt;Je continue à travailler sur le projet, notamment sur un driver Windows libre pour la clé radio &lt;a href=&quot;http://www.silabs.com/products/mcu/Pages/USBFMRadioRD.aspx&quot; hreflang=&quot;en&quot;&gt;USBFMRADIO-RD&lt;/a&gt;. La version 1.0 approche !&lt;/p&gt;


&lt;h3&gt;La radio numérique pourra utiliser le DAB+ en France&lt;/h3&gt;


&lt;p&gt;Ce n'est pas du RDS, plutôt la relève à venir. La France avait choisi le &lt;a href=&quot;http://fr.wikipedia.org/wiki/Terrestrial_Digital_Multimedia_Broadcasting&quot; hreflang=&quot;fr&quot;&gt;T-DMB&lt;/a&gt; pour la radio numérique terrestre, contrairement à ses voisins européens qui avaient choisi le &lt;a href=&quot;http://fr.wikipedia.org/wiki/Digital_Audio_Broadcasting#DAB.2B&quot; hreflang=&quot;fr&quot;&gt;DAB+&lt;/a&gt;. T-DMB et DAB+ sont deux extensions du DAB, un standard développé depuis une vingtaine d'années. Au départ, DAB utilisait un codec audio MPEG-1/2 Layer II. De nos jours, il est plus intéressant d'utiliser un codec plus performant comme MPEG-4 AAC. T-DMB est une extension du DAB d'origine coréenne qui fait transiter sur le DAB un flux de transport MPEG-TS, qui peut contenir de l'audio et éventuellement de la vidéo, utilisant divers codecs (dont AAC). DAB+ est ciblé spécifiquement radio, et propose d'utiliser AAC sans avoir besoin du flux MPEG-TS. La France vient d'ajouter DAB+ à la liste des standards de diffusion possibles pour la future radio numérique.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2012/01/Nouvelles-du-RDS#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2012/01/Nouvelles-du-RDS#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/378</wfw:commentRss>
      </item>
    
  <item>
    <title>Visite de Stockholm</title>
    <link>http://www.jacquet80.eu/blog/post/2011/12/Stockholm</link>
    <guid isPermaLink="false">urn:md5:638429f555618617479a0c493188771a</guid>
    <pubDate>Fri, 30 Dec 2011 18:15:00 +0100</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
        <category>Tourisme</category>    
    <description>    &lt;p&gt;&lt;em&gt;Je me décide enfin (!) à publier cet article, écrit à la suite d'une visite en Suède en 2009, et qui était resté en souffrance. La Suède est un pays magnifique. Stockholm m'a beaucoup plu ; je suis également allé à Uppsala, que je recommande pour une petite escale.&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.jacquet80.eu/blog/public/2011/20111230_Vaxholm.jpg&quot; alt=&quot;Sur Vaxholm&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; title=&quot;Sur Vaxholm, déc. 2011&quot; /&gt;
Voici quelques idées pour une visite de Stockholm&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Le musée Vasa est fantastique. Le &lt;a href=&quot;http://fr.wikipedia.org/wiki/Vasa&quot; hreflang=&quot;fr&quot;&gt;Vasa&lt;/a&gt; est un navire de guerre suédois qui a coulé lors de son lancement en 1628. Plusieurs tentatives de renflouement ont échoué, puis on a peu à peu oublié l'emplacement de l'épave, jusqu'à ce que des archéologues la retrouvent et remontent le bateau en 1961. Il a pu être mis en cale sèche, séché, stabilisé, et maintenant on peut le visiter. Il est dans un état remarquable&amp;nbsp;; la visite vaut vraiment le coup.&lt;/li&gt;
&lt;li&gt;Le musée d'art moderne, qui occupe l'île de &lt;em&gt;Skeppsholmen&lt;/em&gt; vaut également le détour, bien que la visite soit à mon goût &lt;em&gt;un peu courte&lt;/em&gt;. Profiter de la visite au musée pour flâner sur l'île de &lt;em&gt;Kastellholmen&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Flâner dans les rues est très agréable. N'hésitez pas à visiter plusieurs quartiers. Les incontournables&amp;nbsp;: le quartier moderne près de la &lt;em&gt;Centralstation&lt;/em&gt;, &lt;em&gt;Gamla Stan&lt;/em&gt; (vieille ville), grande île de &lt;em&gt;Södermalm&lt;/em&gt; (quartier branchouille). Au nord de &lt;em&gt;Södermalm&lt;/em&gt;, l'&lt;a href=&quot;http://en.wikipedia.org/wiki/Katarina_Elevator&quot; hreflang=&quot;en&quot;&gt;ascenseur de Katarina&lt;/a&gt; offre une jolie vue, mais il est possible de monter en haut à pied, sans devoir payer la montée.&lt;/li&gt;
&lt;li&gt;Il est possible de faire des expéditions d'un jour dans les îles. Par exemple, je recommande Vaxholm (&lt;em&gt;photo&lt;/em&gt;), qui à la fois possède une petite zone commerçante sympathique, et dont il est possible de faire le tour à pied dans la nature. Plusieurs compagnies proposent une jolie croisière d'une heure environ (départ en face du &lt;em&gt;Grand Hotel&lt;/em&gt; sur &lt;em&gt;Södra Blasieholmshamnen&lt;/em&gt;). L'accès (ou le retour, pour changer) peuvent également se faire en bus, ligne 670 (carte basique de transports en commun valable).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Aspects pratiques&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Transports en commun&amp;nbsp;: le métro (T-Bana) fonctionne très bien. Je recommande la &lt;em&gt;travelcard&lt;/em&gt; 3 jours (20 €) ou 7 jours (26 €). On se la procure chez &lt;em&gt;Pressbyrån&lt;/em&gt;, pas au guichet de la compagnie. Elle permet également d'accéder à tous les bus de la région.&lt;/li&gt;
&lt;li&gt;Hébergement&amp;nbsp;: pour un prix modéré, il est possible d'avoir de petits appartements (enfin petits, pas tant que ça d'ailleurs, comparativement au standard parisien...), très bien tenus, dans un hôtel, avec petit-déj. Il s'agit du &lt;a href=&quot;http://www.stayat.eu/bromma&quot; hreflang=&quot;en&quot;&gt;StayAt Stockholm Bromma&lt;/a&gt;, à deux pas de la station de métro Alvik, à 20 minutes du centre. L'hôtel est immanquable&amp;nbsp;: c'est la plus grande tour du quartier. Sortir du métro côté ouest, c'est-à-dire à l'avant du train en venant de Stockholm).&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/12/Stockholm#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/12/Stockholm#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/282</wfw:commentRss>
      </item>
    
  <item>
    <title>Liberté de panorama en France</title>
    <link>http://www.jacquet80.eu/blog/post/2011/11/Liberte-de-panorama-en-France</link>
    <guid isPermaLink="false">urn:md5:4e6c4174f27598d30c708b2cf4f2491a</guid>
    <pubDate>Mon, 21 Nov 2011 23:09:00 +0100</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
        <category>Société</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.jacquet80.eu/blog/public/.20070119_louvre_m.jpg&quot; alt=&quot;20070119_louvre.jpg&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; title=&quot;20070119_louvre.jpg, déc. 2008&quot; /&gt;
Comme &lt;a href=&quot;http://www.jacquet80.eu/blog/post/2007/01/19/80-non-aux-droits-d-auteurs-abusifs&quot; hreflang=&quot;fr&quot;&gt;je le soulignais il y a quelques années&lt;/a&gt;, la &lt;a href=&quot;http://fr.wikipedia.org/wiki/Libert%C3%A9_de_panorama&quot; hreflang=&quot;fr&quot;&gt;liberté de panorama&lt;/a&gt; n'existe actuellement pas en France, contrairement à de nombreux pays.&lt;/p&gt;


&lt;p&gt;Or &lt;a href=&quot;http://www.assemblee-nationale.fr/13/amendements/3953/395300022.asp&quot; hreflang=&quot;fr&quot;&gt;un amendement&lt;/a&gt; visant à introduire cette liberté de panorama devrait être examiné ce mercredi à l'Assemblée nationale&amp;nbsp;! L'alinéa suivant serait introduit dans l'&lt;a href=&quot;http://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000006278911&amp;amp;cidTexte=LEGITEXT000006069414&amp;amp;dateTexte=20111121&quot; hreflang=&quot;fr&quot;&gt;article pertinent du code de la propriété intellectuelle&lt;/a&gt;&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;em&gt;«&amp;nbsp;Toutefois est autorisée la reproduction par la peinture, le dessin, la photographie ou le cinéma des œuvres de toute nature situées de manière permanente dans l'espace public, y compris à l’intérieur des bâtiments ouverts au public, ainsi que la distribution et la communication publique de telles copies. »&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;Cet amendement a des chances de passer car il est porté par des députés de la majorité. Mais vous voudrez probablement &lt;a href=&quot;http://www.assemblee-nationale.fr/13/qui/circonscriptions/&quot; hreflang=&quot;fr&quot;&gt;contacter votre député&lt;/a&gt; pour lui expliquer à quel point la liberté de panorama constituerait un progrès pour les libertés et le rayonnement culturel dans notre pays.&lt;/p&gt;


&lt;p&gt;Voir &lt;a href=&quot;http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Le_Bistro/21_novembre_2011#Opportunit.C3.A9_d.27introduire_la_notion_de_libert.C3.A9_de_panorama_en_droit_fran.C3.A7ais&quot; hreflang=&quot;fr&quot;&gt;le bistro de Wikipédia&lt;/a&gt;, avec quelques modèles de lettres à envoyer à son député.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Mise à jour, 24 novembre 2011 :&lt;/strong&gt; &lt;a href=&quot;http://blogs.rue89.com/hotel-wikipedia/2011/11/24/lassemblee-rejette-lamendement-sur-la-liberte-de-panorama-wikipedia-res-0&quot; hreflang=&quot;fr&quot;&gt;amendement rejeté&lt;/a&gt;. 30 députés ont décidé au nom du peuple entier de maintenir la France dans son archaïsme. Voir la carte dans l'article lié ; la position singulière de la France en Europe est édifiante.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/11/Liberte-de-panorama-en-France#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/11/Liberte-de-panorama-en-France#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/377</wfw:commentRss>
      </item>
    
  <item>
    <title>Décodage de capteur thermo-hygro TFA</title>
    <link>http://www.jacquet80.eu/blog/post/2011/10/Decodage-capteur-thermo-hygro-TFA</link>
    <guid isPermaLink="false">urn:md5:5be3c0990d1b69365ad7fd660913c3bb</guid>
    <pubDate>Sun, 30 Oct 2011 22:22:00 +0100</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
        <category>Radio</category>    
    <description>&lt;p&gt;Je possède depuis quelques jours un thermomètre-hygromètre intérieur-extérieur sans fil &lt;a href=&quot;http://tfa-dostmann.de/index.php?id=129&quot; hreflang=&quot;de&quot;&gt;TFA Maxim II&lt;/a&gt;. TFA est une entreprise allemande qui commercialise des appareils de mesure électroniques ou non. L'entreprise semble être liée à La Crosse Technology, certainement plus connue. Notamment les deux marques diffusent des systèmes de mesure sans fil estampillés « IT+ Instant Transmission 868 MHz ». Mon capteur appartient à cette nouvelle famille.&lt;/p&gt;


&lt;p&gt;Bien entendu, je me devais d'analyser le codage utilisé par cette transmission IT+... Je suis parti à la chasse avec un &lt;a href=&quot;http://www.funcubedongle.com/&quot; hreflang=&quot;en&quot;&gt;FUNcube Dongle&lt;/a&gt;, un génial récepteur SDR 64-1700 MHz qui se présente sous la forme d'une clé USB. Son principal défaut est sa bande passante limitée (environ 80 kHz), mais on peut raisonnablement imaginer que cela soit suffisant pour recevoir la modulation engendrée par un petit capteur.&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.jacquet80.eu/blog/public/2011/20111030_materiel.jpg&quot; title=&quot;20111030_materiel.jpg&quot;&gt;&lt;img src=&quot;http://www.jacquet80.eu/blog/public/2011/.20111030_materiel_m.jpg&quot; alt=&quot;20111030_materiel.jpg&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;20111030_materiel.jpg, oct. 2011&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div style=&quot;text-style:center; margin: 4px auto; width: 448px;&quot;&gt;&lt;em&gt;Matériel utilisé pour ce projet : un capteur sans fil de la station météo photo&amp;shy;graphiée ici, ainsi qu'un récepteur FUNcube Dongle muni d'une antenne boudin VHF-UHF.&lt;/em&gt;&lt;/div&gt;
    &lt;p&gt;&lt;a href=&quot;http://www.f6fbb.org/domo/sensors/&quot; hreflang=&quot;en&quot;&gt;F6FBB&lt;/a&gt; donne quelques informations sur le mode de modulation utilisé par certaines stations La Crosse&amp;nbsp;: il s'agit basiquement de modulation d'amplitude (discrète). La porteuse est émise à l'état haut, mais pas à l'état bas. On peut voir ça comme de l'AM classique, où le signal modulant est un signal logique tout où rien. Certains parlent d'ASK (Amplitude Shift Keying) car c'est de l'AM discrète (ici, ce serait plus précisément de l'ASK à deux états). D'autres parlent d'OOK (On-Off Keying). L'UIT parle de &lt;a href=&quot;http://fr.wikipedia.org/wiki/Classe_d&amp;#039;%C3%A9mission_radio&quot; hreflang=&quot;fr&quot;&gt;classe A1B&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;J'ai effectivement localisé une émission AM provenant de mon capteur, sur précisément 868,428 MHz. En réception AM audio, on entend de très brefs « clics » toutes les 4 ou 8 secondes (&lt;a href=&quot;http://www.jacquet80.eu/blog/public/2011/20111030_trame.wav&quot;&gt;exemple&lt;/a&gt;). Il faut bien prendre garde à couper le contrôle automatique de gain (AGC) qui peut jouer des tours. Le signal en sortie d'un démodulateur AM a l'allure suivante (ici vu dans Audacity) :&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.jacquet80.eu/blog/public/2011/20111030_trame.png&quot; alt=&quot;20111030_trame.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;20111030_trame.png, oct. 2011&quot; /&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://www.f6fbb.org/domo/sensors/&quot; hreflang=&quot;en&quot;&gt;F6FBB&lt;/a&gt; décrit la modulation utilisée par des capteurs La Crosse sur 433 MHz, qui est de type « modulation en largeur d'impulsion » : les 0 et les 1 génèrent des impulsions de largeurs différentes. Ici, l'oscillogramme montre que ce n'est clairement pas le cas, les passages à 0 ou à 1 étant de largeurs très diverses. Une seule hypothèse viable (et qui s'est avéré être la bonne) : il s'agit d'un signal logique brut, sans horloge (asynchrone), comme il peut en circuler sur des liaisons TTL ou RS232. Autrement dit, le train de bits d'une trame module directement la porteuse en tout ou rien. L'étude de plusieurs trames montre que les 8 premiers bits alternent toujours entre 0 et 1 (valeur binaire 0b10101010), ce qui permet de synchroniser l'horloge du récepteur.&lt;/p&gt;


&lt;p&gt;Après une étude plus poussée, il s'avère qu'une trame comporte exactement 64 bits (8 octets). La transmission se fait à environ 17200 bit/s, bit de poids fort (MSB) d'abord. De plus, les 5 derniers octets suivent exactement &lt;a href=&quot;http://fredboboss.free.fr/tx29/&quot; hreflang=&quot;fr&quot;&gt;le protocole déchiffré par Fred Bossard&lt;/a&gt; qui a analysé le trafic sur le &lt;a href=&quot;http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus&quot; hreflang=&quot;en&quot;&gt;bus SPI&lt;/a&gt; interne d'une station La Crosse IT+ ! Notamment, son travail de cryptanalyse du &lt;a href=&quot;http://en.wikipedia.org/wiki/Cyclic_redundancy_check&quot; hreflang=&quot;en&quot;&gt;CRC&lt;/a&gt; m'a beaucoup facilité la tâche.&lt;/p&gt;


&lt;p&gt;Au final, voici le contenu d'une trame, illustré sur l'exemple de trame ci-dessus :&lt;/p&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th&gt;Numéro&lt;br /&gt;quartet&lt;/th&gt;&lt;th&gt;Exemple&lt;br /&gt;(hexa)&lt;/th&gt;&lt;th&gt;Champ&lt;/th&gt;&lt;th&gt;Commentaires&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;0&lt;/td&gt;&lt;td&gt;A&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Préambule&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Mot de synchronisation, toujours 0xAA = 0b10101010.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;A&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td rowspan=&quot;4&quot;&gt;Identificateur ?&lt;/td&gt;&lt;td rowspan=&quot;4&quot;&gt;Probablement un identificateur de fabricant et/ou de type de capteur, à confirmer. Chez moi il vaut toujours 0x2DD4.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;D&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;D&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;Taille données&lt;/td&gt;&lt;td&gt;D'après Fred Bossard, la taille, en quartets, des données à venir jusqu'à la fin de la trame, CRC compris. Toujours 9.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Identificateur capteur&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Identificateur du capteur, tiré aléatoirement au démarrage.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td&gt;4&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;9&lt;/td&gt;&lt;td&gt;5&lt;td&gt;Température dizaines&lt;/td&gt;&lt;td rowspan=&quot;3&quot;&gt;Le capteur transmet (temperature + 40) * 10. Le résultat, sur 3 chiffres, est codé en &lt;a href=&quot;http://en.wikipedia.org/wiki/Binary-coded_decimal&quot;&gt;BCD&lt;/a&gt;. Ici 0x561 signifie +16,1°C.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;td&gt;Température unités&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;11&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Température dixièmes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;12&lt;/td&gt;&lt;td&gt;5&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Humidité relative&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Contrairement à la température, l'humidité relative est codée en binaire standard, pas en BCD. Selon Fred Bossard, la valeur 0x6A (106) indique l'absence du capteur hygrométrique. Ici la valeur est 0x53, soit 83 %.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;3&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;14&lt;/td&gt;&lt;td&gt;D&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;Mot de contrôle&lt;/td&gt;&lt;td rowspan=&quot;2&quot;&gt;CRC des 4 octets situés du quartet n°6 au quartet n°13. Le polynôme est \( x^8 + x^5 + x^4 + 1 \) (0x31), la valeur initiale 0, et il n'y a pas de XOR à la fin. Voir &lt;em&gt;&lt;a href=&quot;http://www.ross.net/crc/crcpaper.html&quot;&gt;A Painless Guide to CRC Error Detection Algorithms&lt;/a&gt;&lt;/em&gt;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;15&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;



&lt;p&gt;Le protocole utilisé par ces petits capteurs est donc assez simple. Quant à la modulation, elle est plutôt rudimentaire. J'ai intégré un décodeur de ces données à &lt;a href=&quot;http://code.google.com/p/pydemod/&quot; hreflang=&quot;en&quot;&gt;Pydemod&lt;/a&gt;, ma boîte à outils Python &lt;em&gt;open-source&lt;/em&gt; pour le décodage de signaux radio. Pour la trame ci-dessus, Pydemod fournit les informations suivantes :&lt;/p&gt;


&lt;pre&gt;Frame: size 64 bits, contents [1 0 1 0 1 0 1 0 0 0 1 0 1 1 0 1 1 1 0 1 0 1 0 0 1 0
       0 1 0 1 1 0 0 1 0 0 0 1 0 1 0 1 1 0 0 0 0 1 0 1 0 1 0 0 1 1 1 1 0 1 0 0 0 1]
Frame hex contents: AA 2D D4 96 45 61 53
CRC: calculated=D1, received=D1
Temperature: 16.1 C -- Humidity: 83 %&lt;/pre&gt;


&lt;p&gt;Mon outil prend en entrée un fichier WAVE comme &lt;a href=&quot;http://www.jacquet80.eu/blog/public/2011/20111030_trame.wav&quot;&gt;celui-ci&lt;/a&gt;. Il se synchronise initialement sur le préambule 0xAA, puis il profite de chaque front pour se resynchroniser.&lt;/p&gt;


&lt;p&gt;N'hésitez pas à jouer avec vos capteurs et avec &lt;a href=&quot;http://code.google.com/p/pydemod/&quot; hreflang=&quot;en&quot;&gt;Pydemod&lt;/a&gt; ! Si vous analysez les émissions de vos capteurs IT+ 868 MHz, que ce soient des TFA ou des La Crosse, je serais ravi d'avoir vos résultats afin d'étoffer cet article.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/10/Decodage-capteur-thermo-hygro-TFA#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/10/Decodage-capteur-thermo-hygro-TFA#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/374</wfw:commentRss>
      </item>
    
  <item>
    <title>Automatically merge calendars with Google Apps Script</title>
    <link>http://www.jacquet80.eu/blog/post/2011/10/Automatically-merge-calendars-with-Google-Apps-Script</link>
    <guid isPermaLink="false">urn:md5:70c278613e892cb9c2c19beea471e171</guid>
    <pubDate>Fri, 14 Oct 2011 23:07:00 +0200</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
        <category>Geekeries</category><category>Programmation</category>    
    <description>&lt;p&gt;I have several Google calendars: one for lectures, one for appointments, one for vacations, etc. I need to combine them automatically into a single ICS file. Surprisingly, this feature does not seem to exist off-the-shelf.&lt;/p&gt;


&lt;p&gt;I have devised a solution based on Google Apps Script: a Javascript script runs periodically on the Google cloud, and generates the ICS file. Surprisingly, the script has to be in a Google Docs spreadsheet. The script editor is in the &lt;em&gt;Tools&lt;/em&gt; menu. When the script works okay, it's possible to schedule its execution periodically in the script editor, via the &lt;em&gt;Triggers&lt;/em&gt; menu. As easy as a good old cronjob.&lt;/p&gt;    &lt;p&gt;I use the following script:&lt;/p&gt;


&lt;pre&gt;function eventToICS(event) {
  var tz = &quot;Europe/Paris&quot;;
  var dateFormat = &quot;yyyyMMdd'T'HHmmss&quot;;
  var res = &quot;&quot;;
  res += &quot;BEGIN:VEVENT\n&quot;;
  res += &quot;SUMMARY:&quot; + event.getTitle() + &quot;\n&quot;;
  res += &quot;DTSTART;TZID=&quot; + tz + &quot;:&quot; + 
            Utilities.formatDate(event.getStartTime(), tz, dateFormat) + &quot;\n&quot;;
  res += &quot;DTEND;TZID=&quot; + tz + &quot;:&quot; + 
            Utilities.formatDate(event.getEndTime(), tz, dateFormat) + &quot;\n&quot;;
  res += &quot;END:VEVENT\n\n&quot;;
  return res;
}

function aggregateCalendars() {
  var cals = CalendarApp.getAllOwnedCalendars();

  var ics = &quot;BEGIN:VCALENDAR\nVERSION:2.0\n\n&quot;;
 
  var startDate = new Date();
  var endDate = new Date();
  
  startDate.setDate(startDate.getDate() - 50);
  endDate.setDate(endDate.getDate() + 500);
  
  for(var i=0; i&amp;lt;cals.length; i++) {
    ics += &quot;COMMENT: &quot; + cals[i].getName() + &quot;\n\n&quot;;
   
    var events = cals[i].getEvents(startDate, endDate);
    for(var j=0; j&amp;lt;events.length; j++) {
      ics += eventToICS(events[j]);
    }
  }
 
  ics += &quot;\nEND:VCALENDAR\n&quot;;

  // here do something with the ICS file...
}&lt;/pre&gt;


&lt;p&gt;Once the contents of the ICS file has been constructed, you can do whatever you want with it, for instance send it via e-mail. Personally I upload it onto a Google Sites page :&lt;/p&gt;


&lt;pre&gt;var page = SitesApp.getPageByUrl(pageURL);
page.addHostedAttachment(Utilities.newBlob(ics, &quot;text/plain&quot;, filename));&lt;/pre&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/10/Automatically-merge-calendars-with-Google-Apps-Script#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/10/Automatically-merge-calendars-with-Google-Apps-Script#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/373</wfw:commentRss>
      </item>
    
  <item>
    <title>KISS</title>
    <link>http://www.jacquet80.eu/blog/post/2011/09/KISS</link>
    <guid isPermaLink="false">urn:md5:4e597156a18f76662c75019a310c1eb1</guid>
    <pubDate>Sun, 11 Sep 2011 15:58:00 +0200</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
        <category>IHM</category><category>Obscurantisme</category>    
    <description>    &lt;p&gt;A few years ago I administered a test in which I asked students to expand the &lt;a href=&quot;http://en.wikipedia.org/wiki/KISS_principle&quot; hreflang=&quot;en&quot;&gt;KISS acronym (“Keep It Simple Stupid”)&lt;/a&gt;. Although I had explained the KISS principle during the classes, I got some “interesting answers”:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Kinesthetic Interface State System&lt;/li&gt;
&lt;li&gt;Keystroke Interface System Software&lt;/li&gt;
&lt;li&gt;Keyboard Input Single Static&lt;/li&gt;
&lt;li&gt;Keystroke Interface Selection&lt;/li&gt;
&lt;li&gt;Knowledge Identify Simplify Steps&lt;/li&gt;
&lt;li&gt;Keystroke Interface System&lt;/li&gt;
&lt;li&gt;Knowledge Interesting Sensitive&lt;/li&gt;
&lt;li&gt;Key Interface Sensitive Software&lt;/li&gt;
&lt;li&gt;Keyboard, Interaction, Selection, Separation&lt;/li&gt;
&lt;li&gt;Keystroke Interaction Simple&lt;/li&gt;
&lt;li&gt;— Interface Simple Stupid&lt;/li&gt;
&lt;li&gt;Keystroke Interaction — —&lt;/li&gt;
&lt;li&gt;Keep It Simply Stupid&lt;/li&gt;
&lt;li&gt;Keystroke Interface State&lt;/li&gt;
&lt;li&gt;Keystroke Interface Selection State&lt;/li&gt;
&lt;li&gt;Keyboard Interaction Service System&lt;/li&gt;
&lt;li&gt;Keystroke Interaction Selection System&lt;/li&gt;
&lt;li&gt;Keystroke Interaction Shape State machine&lt;/li&gt;
&lt;li&gt;Keystroke Interaction System Solution&lt;/li&gt;
&lt;li&gt;Keyword Interface Simple Services&lt;/li&gt;
&lt;li&gt;Keystroke Interface Service Simple&lt;/li&gt;
&lt;li&gt;Keep Interface Simple System&lt;/li&gt;
&lt;li&gt;Keystrocking &lt;em&gt;(sic)&lt;/em&gt; Interactivity Size Shape&lt;/li&gt;
&lt;li&gt;Kiosk Interactive Simple Software&lt;/li&gt;
&lt;li&gt;Keyboard Interface Signification Sensibility&lt;/li&gt;
&lt;li&gt;Kinestesic Interaction Sensor Sensitive&lt;/li&gt;
&lt;li&gt;Knowledgeable Interactive Simple Safe&lt;/li&gt;
&lt;li&gt;&lt;em&gt;and finally:&lt;/em&gt; Kabul Is Soft Saber (for Bush)&lt;/li&gt;
&lt;/ul&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/09/KISS#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/09/KISS#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/370</wfw:commentRss>
      </item>
    
  <item>
    <title>Twenty years of computing</title>
    <link>http://www.jacquet80.eu/blog/post/2011/08/Twenty-years-of-computing</link>
    <guid isPermaLink="false">urn:md5:b0eb9560d72e76c3de099700cdbcee28</guid>
    <pubDate>Tue, 30 Aug 2011 22:47:00 +0200</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
        <category>Geekeries</category><category>Ma vie</category><category>Programmation</category>    
    <description>&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Debug_(command)&quot; hreflang=&quot;en&quot;&gt;&lt;/a&gt;&lt;em&gt;I recently realized that it has been 20 years since I started computer programming. Here's how it all started.&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;The story begins in May 1991. At that time I had already used computers, namely a network of French-made &lt;a href=&quot;http://en.wikipedia.org/wiki/Thomson_MO5&quot; hreflang=&quot;en&quot;&gt;Thomson MO5&lt;/a&gt; 6809-based microcomputers hooked up to a PC server, and a bunch of PC clones at the neighboring high school where my father was a teacher. I had shown “polite interest” in the thing, doing a bit of word processing, playing a bit with Logo. Yet, I had begun to conjecture the existence of “software allowing one to create software”. In short, I thought that computers were interesting devices, that maybe there was more to be found, but clearly I was not thrilled.&lt;/p&gt;


&lt;p&gt;In May 1991 my last year in primary school was wearing out.
I had borrowed a book about science and technology at my school's library. Among all the fascinating topics it introduced, two really caught my attention: computers and human sexuality. I decided to dive into the first of them right away. The chapter about computers in my technology book was 4 pages long, but it introduced &lt;em&gt;computer programming&lt;/em&gt;. The core concepts were roughly explained, and there were one or two examples of programs written in Microsoft BASIC for the Thomson line of computers. This was really basic, but in two hours' time of reading this chapter, I felt I understood the whole point about programming and computers in general. I mean, I really &lt;em&gt;got&lt;/em&gt; it. Immediately. I felt a whole new world had opened in front of me, and I felt my whole perspective on life had changed. And that day assuredly &lt;em&gt;did change&lt;/em&gt; my life.&lt;/p&gt;


&lt;p&gt;From that day on I was literally obsessed with one thing: writing computer programs. When my class was allowed to use the MO5 computers for &lt;em&gt;playing games&lt;/em&gt; at the end of that school year,  I used the opportunity to reset the machine in BASIC mode and give way to my creativity. My first programs were modest: writing my name on screen, performing binary-ternary-decimal conversions and drawing shapes on screen. Yet I felt utmost excited.&lt;/p&gt;


&lt;p&gt;During the 1991 summer holidays, I spent my time on two things. First I wrote programs. I had no computer at home, but it did not matter: I wrote them on paper. Second I felt the urge of owning my own computer, so I spent a lot of time browsing through mail order catalogs, starting to get familiar with microprocessors (at that time the 68k family was still well represented, with several offers from Apple, Comodore-Amiga and Atari), clock speed, floppies and hard drives.&lt;/p&gt;


&lt;p&gt;Thanks to the generosity of a grandmother, I was able to place an order in Fall 1991, and one night in November, a shiny &lt;a href=&quot;http://en.wikipedia.org/wiki/Commodore_PC_compatible_systems&quot; hreflang=&quot;en&quot;&gt;Commodore PC 20-III&lt;/a&gt;, a 8088-powered PC clone with a 20MB hard disk and a VGA graphics card was delivered to my parents' door. It came with &lt;a href=&quot;http://en.wikipedia.org/wiki/Microsoft_Works&quot; hreflang=&quot;en&quot;&gt;Microsoft Works&lt;/a&gt;, but I did not look at it first. It came with &lt;a href=&quot;http://en.wikipedia.org/wiki/GEOS_(16-bit_operating_system)#GeoWorks_Ensemble&quot; hreflang=&quot;en&quot;&gt;GeoWorks Ensemble&lt;/a&gt; but I did not look either. I just typed &lt;code&gt;GWBASIC&lt;/code&gt; at the MS-DOS 4 prompt, and I coded for several hours in a row.&lt;/p&gt;


&lt;p&gt;Over the next few months I coded, and coded again. I produced graphical “demos”, a timetable program, and I started to work on educational programs as a “subcontractor” for my teacher of a father. I quickly got a good grasp of MS-DOS and &lt;a href=&quot;http://en.wikipedia.org/wiki/GW-BASIC&quot; hreflang=&quot;en&quot;&gt;GW-BASIC&lt;/a&gt;, and I hit the limitations of this mostly-unstructured programming language. But surprisingly enough, it's not really the lack of “modern” features such as clean control structures and proper functions that made me crave for another language. More prosaically, I wanted to call &lt;a href=&quot;http://en.wikipedia.org/wiki/MS-DOS_API&quot; hreflang=&quot;en&quot;&gt;DOS&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/BIOS_interrupt_call&quot; hreflang=&quot;en&quot;&gt;BIOS interrupts&lt;/a&gt; (namely INT 33h, used to control the mouse), and this was cumbersome to do with GWBASIC (one had to write a machine-language snippet to do this, assemble it, or have DEBUG assemble it, and then you could include the hex dump of this into the GWBASIC program).&lt;/p&gt;


&lt;p&gt;Therefore for my 12th birthday, I received a &lt;a href=&quot;http://en.wikipedia.org/wiki/QuickBASIC&quot; hreflang=&quot;en&quot;&gt;QuickBASIC&lt;/a&gt; 4.5 IDE. I quickly learnt the new control structures. Incidentally, I remember writing to the organizers of a coding contest, not a long time after taking up QuickBASIC: “Oh, my program does not used advanced features such as procedures and functions, I'm just a 12-year-old kid”, and just after thinking “why the heck am I writing this?”, “why in the first place don't I use advanced features?” Two hours later my program incorporated functions and procedures.&lt;/p&gt;


&lt;p&gt;In 1993 I started to look into Windows, which I could not use on my 8088-based PC. Therefore I took advantage of a quite inexpensive deal at a local store to get a new PC, a Bull/&lt;a href=&quot;http://en.wikipedia.org/wiki/Zenith_Data_Systems&quot; hreflang=&quot;en&quot;&gt;Zenith Data Systems&lt;/a&gt; 386SX that came with Windows 3.1. At that time I had gotten quite technical: I remember asking at my local computer store a book “that described DOS and BIOS interrupts”. The surprised look of the storekeeper was memorable: “what do you call interrupts?”, “do you want a list of error messages?”. That year I got &lt;a href=&quot;http://en.wikipedia.org/wiki/Visual_Basic&quot; hreflang=&quot;en&quot;&gt;Visual Basic&lt;/a&gt; 3 as a birthday present. Visual Basic was great, but I felt somehow “trapped” into its event-driven model. Plus, I wanted to learn other languages.&lt;/p&gt;


&lt;p&gt;First I did a little of assembly using the &lt;a href=&quot;http://en.wikipedia.org/wiki/A86_(software)&quot; hreflang=&quot;en&quot;&gt;A86&lt;/a&gt; package that was fine, but I was hindered by two things. First my knowledge of processor hardware was quite limited, so I had difficulties with addressing modes, and second I did not have a good documentation for A86. So I never undertook really interesting projects in assembly. Incidentally, the way I got the A86 distribution is to be noted: I used a &lt;a href=&quot;http://en.wikipedia.org/wiki/Minitel&quot; hreflang=&quot;en&quot;&gt;Minitel&lt;/a&gt;, a dial-up computer terminal that was distributed to landline owners by the then state-run France Telecom. I used to hook up the Minitel to my computer, so I could download software on dedicated sites. By the way I got familiar with the Videotex standard used for Minitel display, and I did a lot of experiments that included displaying my own pictures on the Minitel screen, or moving the Minitel cursor with my PC mouse.&lt;/p&gt;


&lt;p&gt;My 1993 letter to Santa included &lt;a href=&quot;http://en.wikipedia.org/wiki/Turbo_Pascal&quot; hreflang=&quot;en&quot;&gt;Turbo Pascal&lt;/a&gt; 7 and Michael Tischer's fantastic book, &lt;em&gt;PC system programming&lt;/em&gt; (in French, &lt;em&gt;La Bible du PC&lt;/em&gt;). This book described very thouroughly the hardware and software intrinsics of a PC.
I rapidly got onto Pascal programming, so that around April 1994, I thought “Now that I have known Pascal for a long time, let's learn C”. So I ordered a copy of &lt;a href=&quot;http://en.wikipedia.org/wiki/Borland_Turbo_C&quot; hreflang=&quot;en&quot;&gt;Turbo C&lt;/a&gt; 3 for DOS. In the following months and years, I would practice and practice again coding in these two languages.&lt;/p&gt;


&lt;p&gt;I started to explore a new area starting at Christmas 1994: I got a Texas Instruments &lt;a href=&quot;http://en.wikipedia.org/wiki/TI-82&quot; hreflang=&quot;en&quot;&gt;TI-82&lt;/a&gt; programmable and graphing calculator. I had a lot of fun programming on calculators; being able to carry a programmable device along with me was an additional motivation. After the TI-82, I got a 68000-powered &lt;a href=&quot;http://en.wikipedia.org/wiki/TI-92_series&quot; hreflang=&quot;en&quot;&gt;TI-92&lt;/a&gt; with symbolic calculation in 1997. I made a lot of crazy things with both machines. For instance, the TI-82 did not have a “string” datatype. But I &lt;em&gt;needed&lt;/em&gt; to store strings, and even to create records. So I designed a way to store strings and other random data into matrices. The system was very slow, but I was able to improve it a lot using the relative frequencies of letters in the alphabet. Another time, I hacked on the TI-82 “Picture” datatype, that by default enabled one to store and display screenshots only. I was able to display arbitrary pictures on the tiny calculator screen, including a photo of myself. In high school, I remember the amazement of my Latin teacher when one of my classmates showed him my TI-92 &lt;a href=&quot;http://en.wikipedia.org/wiki/Latin_scansion&quot; hreflang=&quot;en&quot;&gt;scansion&lt;/a&gt; program that was able to correctly determine the rythm of arbitrary Latin verses following the “&lt;a href=&quot;http://en.wikipedia.org/wiki/Dactylic_hexameter&quot; hreflang=&quot;en&quot;&gt;dactylic hexameter&lt;/a&gt;” pattern (1998).&lt;/p&gt;


&lt;p&gt;Back in the PC field,  I spent some time hacking with an &lt;a href=&quot;http://en.wikipedia.org/wiki/HP-GL&quot; hreflang=&quot;en&quot;&gt;HP-GL&lt;/a&gt; plotter (1995) and trying to build a &lt;a href=&quot;http://en.wikipedia.org/wiki/Morse_code&quot; hreflang=&quot;en&quot;&gt;Morse&lt;/a&gt; decoder (1995). In itself, the decoder worked well, but I did not know enough electronics and signal processing to build a decent analog to digital converter. My makeshift converter did not have any filtering at all, it captured sound through a loudspeaker-microphone chain, hooked up to an op-amp that used a homemade optocoupler to get into the &lt;a href=&quot;http://en.wikipedia.org/wiki/Game_port&quot; hreflang=&quot;en&quot;&gt;joystick port&lt;/a&gt; of my PC. Morse decoding worked fine provided there was no static and you were very quiet next to the radio transceiver, which was rarely the case!&lt;/p&gt;


&lt;p&gt;In 1995 I bought a Pentium-powered PC, and used Windows 95. However, I still spent a lot of time programming on MS-DOS. In my high-school years I focused on more long-term projects and in 1997 I released advanced versions of my educational programs, &lt;a href=&quot;http://www.jacquet80.eu/logiciels/&quot; hreflang=&quot;fr&quot;&gt;Dactylo and Resistor&lt;/a&gt;, respectively programmed in Pascal (with a little Object Pascal and Assembly) and C (with a little basic C++).&lt;/p&gt;


&lt;p&gt;Days after I finished high-school, I dived into Linux (Summer 1998). I had been exposed to a UNIX book years before, so I was very excited to “have UNIX at home”. From then on I spent a lot of time hacking on Linux.&lt;/p&gt;


&lt;p&gt;In Fall 1998 I enroled in scientific “preparatory classes” and at the beginning of 1999 I had my first courses in computer science! We studied &lt;a href=&quot;http://en.wikipedia.org/wiki/Caml&quot; hreflang=&quot;en&quot;&gt;Caml&lt;/a&gt;, a functional language of the ML family, and it was a new horizon for me. Theoretical foundations were also totally new, so it was really fun.&lt;/p&gt;


&lt;p&gt;In 1999 I learnt HTML, and the first version of my website was online. In 2000 I got fed up with Microsoft Office after the program crushed my work, so I learnt LaTeX. In Fall 2000 I entered Supélec, where we had C classes. A C veteran already, this gave me extra time to get into PHP, Perl, SQL and Java. By that time, Linux had become my primary operating system. In 2000-2001 I got involved with Supélec students' residential network, Supélec Rézo, where I became for one year the primary Linux administrator and architect.&lt;/p&gt;


&lt;p&gt;Now computer science has been my job for several years, but when writing a program or devising some architecture, I'm still as excited as I was that day in 1991! And I'm still into learning new languages: I'm currently trying to get productive with Python and Javascript, while keeping an eye on other languages, namely C#.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/08/Twenty-years-of-computing#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/08/Twenty-years-of-computing#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/369</wfw:commentRss>
      </item>
    
  <item>
    <title>Securing an untrusted Wifi access using SSH</title>
    <link>http://www.jacquet80.eu/blog/post/2011/07/Securing-an-untrusted-Wifi-access-using-SSH</link>
    <guid isPermaLink="false">urn:md5:3b6fb303ebf43d6997b6b2c3744db9b8</guid>
    <pubDate>Tue, 19 Jul 2011 19:58:00 +0200</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
            
    <description>    &lt;p&gt;It is now quite easy to get a Wifi connection while on the move, in public places or at hotels or holiday apartments. However, a majority of these access points are &lt;em&gt;not to be relied upon&lt;/em&gt;. Most often, the network itself is &lt;em&gt;open&lt;/em&gt;, and you &lt;em&gt;log in&lt;/em&gt; on a web page. This means that the data exchanged between your laptop and the access point is &lt;em&gt;unencrypted&lt;/em&gt;. In other words, anybody may eavesdrop on your data, even if they are not logged in. The same goes for Wifi networks “secured” with WEP, as the key may be recovered by any intruder in a matter of just a few minutes using off-the-shelf programs. And anyway, if you're on an unknown network, you never know if someone who has physical access to the network doesn't “monitor” traffic.&lt;/p&gt;


&lt;p&gt;If you use only &lt;em&gt;encrypted protocols&lt;/em&gt; on top of the insecure Wifi channel (e.g. HTTPS, POPS, SSH, etc.) it's not really a problem. For instance, you may safely connect to your bank account as it's done over HTTPS. However, if you connect to Wikipedia or Facebook for instance (which use HTTP), anybody may 1) steal your password if you log in, or 2) &lt;a href=&quot;http://en.wikipedia.org/wiki/Session_hijacking&quot; hreflang=&quot;en&quot;&gt;hijack your session&lt;/a&gt; if you have logged in already, and in any case 3) gain access to private information by just capturing exchanged data.&lt;/p&gt;


&lt;p&gt;Therefore a basic recommendation is &lt;em&gt;not to connect&lt;/em&gt; to websites requiring a log in and not offering HTTPS when on untrusted networks. Unfortunately this prevents you from using many sites. So here comes this solution. All you'll need is an SSH client on your laptop and a trusted computer, online somewhere on the Internet, accessible via SSH.&lt;/p&gt;


&lt;p&gt;The connection between you and the trusted computer, using SSH, an encrypted protocol, is inherently secure, and may be safely used on an untrusted network. So the basic idea is to tunnel all your traffic through this secure channel. It's very easy using SSH, because the standard OpenSSH client has an option to create a SOCKS proxy on the local host. To do this just connect to the trusted computer using a command like:&lt;/p&gt;


&lt;pre&gt;ssh -D 8888 my.trusted.box&lt;/pre&gt;


&lt;p&gt;Once logged onto the computer, a SOCKS proxy will be opened on your laptop, here on port 8888.&lt;/p&gt;


&lt;p&gt;Now all you have to do is to configure your browser or OS to use &lt;code&gt;localhost&lt;/code&gt;, port 8888, as a SOCKS proxy. Firefox must be configured specifically (Advanced &amp;gt; Network &amp;gt; Proxy parameters), while Chrome, Safari and IE use system-wide parameters. After that, any HTTP connection will be &lt;em&gt;delegated&lt;/em&gt; to your trusted computer, which will do it on your behalf. Note that on MacOSX, when you set a SOCKS proxy, it affects all connections, not just HTTP, so for instance when Mail.app sends an e-mail, it's actually done through your trusted computer.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/07/Securing-an-untrusted-Wifi-access-using-SSH#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/07/Securing-an-untrusted-Wifi-access-using-SSH#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/363</wfw:commentRss>
      </item>
    
  <item>
    <title>Java: the problem with String.split()</title>
    <link>http://www.jacquet80.eu/blog/post/2011/07/Java-problem-with-String-split</link>
    <guid isPermaLink="false">urn:md5:a1187a11f659ca9949e43647ec7c1731</guid>
    <pubDate>Mon, 18 Jul 2011 21:24:00 +0200</pubDate>
    <dc:creator>Christophe Jacquet</dc:creator>
            
    <description>&lt;p&gt;Java's String class offers &lt;a href=&quot;http://download.oracle.com/javase/6/docs/api/java/lang/String.html#split%28java.lang.String%29&quot; hreflang=&quot;en&quot;&gt;a very convenient split() method&lt;/a&gt;. In a pinch, you can write for instance&lt;/p&gt;


&lt;pre&gt;String&lt;a href=&quot;http://www.jacquet80.eu/blog/post/2011/07/&quot;&gt;&lt;/a&gt; components = myString.split(&quot;,&quot;);&lt;/pre&gt;


&lt;p&gt;to split a string into smaller substrings delimited by commas. So easy that one is prone to forget that the parameter of split() is &lt;em&gt;not a string, but a regular expression&lt;/em&gt;. Powerful, but it comes at a cost: the regular expression must be &lt;em&gt;compiled into a recognizer&lt;/em&gt; (into a Pattern in Java parlance) before it can be used to actually split the string. And the compilation step &lt;em&gt;costs a lot&lt;/em&gt;.&lt;/p&gt;    &lt;h3&gt;An experiment: splitting strings repeatedly&lt;/h3&gt;


&lt;p&gt;I recently had to process a &lt;em&gt;huge&lt;/em&gt; text file: 5 GB, 92 million lines. Each line had to be split into three parts separated by commas. After that the program parses one of the components as an integer, compares another component, computes a hash code and increments an integer in a 16 M-element array.&lt;/p&gt;


&lt;p&gt;At first I naively used String.split() to split the string, with a one-character pattern (&quot;,&quot;), meaning that the pattern is compiled for each line, here 92 million times. And then I compiled the regular expression once and for all:&lt;/p&gt;


&lt;pre&gt;Pattern commas = Pattern.compile(&quot;,&quot;);

// and later
String&lt;a href=&quot;http://www.jacquet80.eu/blog/post/2011/07/&quot;&gt;&lt;/a&gt; components = commas.split(line);&lt;/pre&gt;


&lt;p&gt;I also tried to use a &lt;a href=&quot;http://download.oracle.com/javase/6/docs/api/java/util/StringTokenizer.html&quot; hreflang=&quot;en&quot;&gt;StringTokenizer&lt;/a&gt;:&lt;/p&gt;


&lt;pre&gt;StringTokenizer t = new StringTokenizer(line, &quot;,&quot;);

// and then use t.countTokens() and t.nextToken()&lt;/pre&gt;


&lt;p&gt;And finally I wrote a hand-crafted parser, optimized as much as I could.&lt;/p&gt;


&lt;p&gt;The results are as follows, using an Unibody MacBook Pro, 2.66 GHz Intel Core 2 Duo:&lt;/p&gt;

&lt;table style=&quot;margin-left:auto; margin-right:auto&quot;&gt;
&lt;tr&gt;&lt;th&gt;Method&lt;/th&gt;&lt;th&gt;Average execution time&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Naive split()&lt;/td&gt;&lt;td&gt;160 s&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Pre-compiled pattern and split()&lt;/td&gt;&lt;td&gt;130 s&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;StringTokenizer&lt;/td&gt;&lt;td&gt;160 s&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Hand-crafted parser&lt;/td&gt;&lt;td&gt;130 s&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;



&lt;h3&gt;Conclusions&lt;/h3&gt;


&lt;p&gt;Pattern compilation done by String.split() behind the scenes is very costly. Okay, here it's on average “only” 0.3 µs for compiling a one-character pattern. But repeated 92 million times, it increased the execution time of the &lt;em&gt;whole program&lt;/em&gt; by 23%!&lt;/p&gt;


&lt;p&gt;In conclusion, String.split() is very convenient when using a pattern once or a few times. But for any repeated processing, &lt;em&gt;the&lt;/em&gt; way to go is to compile the pattern with Pattern.compile() first. Forget about StringTokenizer (it's inefficient and officially &lt;em&gt;discouraged&lt;/em&gt;) and hand-crafted parsers (there's no clear benefit).&lt;/p&gt;</description>
    
    
    
          <comments>http://www.jacquet80.eu/blog/post/2011/07/Java-problem-with-String-split#comment-form</comments>
      <wfw:comment>http://www.jacquet80.eu/blog/post/2011/07/Java-problem-with-String-split#comment-form</wfw:comment>
      <wfw:commentRss>http://www.jacquet80.eu/blog/feed/atom/comments/364</wfw:commentRss>
      </item>
    
</channel>
</rss>
