Christophe Jacquet — Carnet

Automatically merge calendars with Google Apps Script

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.

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 Tools menu. When the script works okay, it's possible to schedule its execution periodically in the script editor, via the Triggers menu. As easy as a good old cronjob.

Lire la suite...

KISS

A few years ago I administered a test in which I asked students to expand the KISS acronym (“Keep It Simple Stupid”). Although I had explained the KISS principle during the classes, I got some “interesting answers”:

  • Kinesthetic Interface State System
  • Keystroke Interface System Software
  • Keyboard Input Single Static
  • Keystroke Interface Selection
  • Knowledge Identify Simplify Steps
  • Keystroke Interface System
  • Knowledge Interesting Sensitive
  • Key Interface Sensitive Software
  • Keyboard, Interaction, Selection, Separation
  • Keystroke Interaction Simple
  • — Interface Simple Stupid
  • Keystroke Interaction — —
  • Keep It Simply Stupid
  • Keystroke Interface State
  • Keystroke Interface Selection State
  • Keyboard Interaction Service System
  • Keystroke Interaction Selection System
  • Keystroke Interaction Shape State machine
  • Keystroke Interaction System Solution
  • Keyword Interface Simple Services
  • Keystroke Interface Service Simple
  • Keep Interface Simple System
  • Keystrocking (sic) Interactivity Size Shape
  • Kiosk Interactive Simple Software
  • Keyboard Interface Signification Sensibility
  • Kinestesic Interaction Sensor Sensitive
  • Knowledgeable Interactive Simple Safe
  • and finally: Kabul Is Soft Saber (for Bush)

Twenty years of computing

I recently realized that it has been 20 years since I started computer programming. Here's how it all started.

Lire la suite...

Securing an untrusted Wifi access using SSH

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 not to be relied upon. Most often, the network itself is open, and you log in on a web page. This means that the data exchanged between your laptop and the access point is unencrypted. 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.

If you use only encrypted protocols 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) hijack your session if you have logged in already, and in any case 3) gain access to private information by just capturing exchanged data.

Therefore a basic recommendation is not to connect 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.

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:

ssh -D 8888 my.trusted.box

Once logged onto the computer, a SOCKS proxy will be opened on your laptop, here on port 8888.

Now all you have to do is to configure your browser or OS to use localhost, port 8888, as a SOCKS proxy. Firefox must be configured specifically (Advanced > Network > Proxy parameters), while Chrome, Safari and IE use system-wide parameters. After that, any HTTP connection will be delegated 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.

Java: the problem with String.split()

Java's String class offers a very convenient split() method. In a pinch, you can write for instance

String components = myString.split(",");

to split a string into smaller substrings delimited by commas. So easy that one is prone to forget that the parameter of split() is not a string, but a regular expression. Powerful, but it comes at a cost: the regular expression must be compiled into a recognizer (into a Pattern in Java parlance) before it can be used to actually split the string. And the compilation step costs a lot.

Lire la suite...

Minigeo

I'm releasing a new little project today. It's called Minigeo, it's shared on Google Project Hosting, it's released under GPLv3.

Minigeo is a lightweight Java library that allows one to plot geographical data (namely lines between points determined by a latitude-longitude pair), using Universal Transverse Mercator (UTM) projections.

The display is done using a Swing JFrame. The user may pan and zoom with the mouse à la Google Maps (i.e. drag to pan, scroll to zoom).

It is especially useful for educators, as students can very easily use this library during practical sessions. Minigeo is very basic, but ultra-simple to use.

20110717_minigeo_osmdata.png

The screenshot shows a Minigeo window displaying OpenStreetMap data as wireframe.

Geek's dice

Geek's dice

Found in a regular gift shop, otherwise not geek-oriented at all.

DOSBox

Need to run old DOS software?

One way to go is to use virtualization software (e.g. QEMU, Bochs or Parallels Desktop) and install MS-DOS or FreeDOS on it. However, it's quite inconvenient because you have to find floppy images, create a virtual hard disk and install the OS. After I failed to get my hands on my old DOS floppies and Parallels Desktop refused to boot FreeDOS, I decided I needed to try something else.

And then I discovered DOSBox. DOSBox is several things at a time, in one neat package:

  • a complete x86 processor emulator,
  • a PC peripheral emulator, including many once-popular graphics and video cards,
  • a complete PC BIOS implementation,
  • a complete MS-DOS API implementation,
  • an MS-DOS compatible shell and user commands.

Lire la suite...

TeXShop's magic comments

I once wrote a note on how to set the character encoding of a file in TeXShop, using a “magic comment”. As the information on the topic of TeXshop's magic comments is very scarce on the web, here is a compilation of the magic comments I know of.

Note: magic comments (or magic markers) alter TeXShop's default behavior on a per-file basis. These are basically regular TeX comments, but they start with %!, thus they are interpreted by TeXShop if they appear at the top of a file.

Set the character encoding:

%!TEX encoding = UTF-8 Unicode
%!TEX encoding = IsoLatin

Set the engine (command to be run with the Typeset command, ⌘T):

%!TEX TS-program = context

Set the name of the “main”/“root” file, the one on which to call the typesetting command:

%!TEX root = main_file_of_my_phd.tex

Set the language to be used by the spell-checker:

%!TEX spellcheck = de-DE

When using source/PDF synchronization with multiple files, TeXShop is able to spot \include and \input commands in the main file. However this does not work with ConTeXt, so the following command allows one to explicitly reference an included file vis-à-vis TeXShop. Therefore it may be used several times:

%!TEX projectfile = chapter1.tex
%!TEX projectfile = chapter2.tex

Main source: TeXShop version history.

Évolution du RDS de Radio France

Le réseau de radiomessagerie par RDS de TDF a été arrêté récemment, après plus de 20 ans de bons et loyaux services. Ce service, connu sous les noms d'Operator puis Alphapage RDS, utilisait les flux de données RDS des émetteurs de Radio France.

Cela change radicalement l'allure des signaux RDS sur les stations de Radio France. En effet, lorsque la radiomessagerie est active, un groupe 1A de synchronisation doit être émis toutes les secondes. Les messages eux-mêmes sont transmis dans des groupes 7A. Les stations de Radio France n'émettent plus les groupes 1A, ce qui mine de rien a permis de réallouer 8,8 % de la bande passante à d'autres données (nom de la station et autres).

Une autre évolution concerne les données EON (Enhanced Other Networks), qui permettent aux stations de se référencer les unes les autres, de façon à pouvoir basculer automatiquement sur un message routier diffusé ailleurs. Ces données sont transmises dans les groupes 14A : on y trouve le nécessaire (code PI, fréquence de la station référencée), mais aussi du superflu (nom de la station référencée). Superflu, car à ma connaissance, aucun appareil grand public n'affiche ce nom... Jusqu'à présent, toutes les stations de Radio France transmettaient le nom des stations. Aujourd'hui en Île-de-France, France Inter et France Bleu 107.1 ne transmettent plus le nom des stations référencées. Une volonté de rationnaliser les informations transmises, dans le but d'optimiser le temps de décodage ?

Dernière nouveauté, France Bleu 107.1 diffuse du radiotexte. Pour le moment, il semble s'agir d'un texte fixe (le nom de la station), mais peut-être ce service est-il amené à s'étoffer ?

Vive la géométrie sphérique !

Soit le problème simple de calculer la longueur d'une balade, donnée par exemple sous forme d'une trace GPX, c'est-à-dire une suite de points dont on connaît les coordonnées dans le système WGS 84.

Ma première idée a été de projeter les points sur le plan (en utilisant par exemple une projection transverse de Mercator dans le bon fuseau UTM), puis de calculer la distance entre deux points successifs en utilisant bêtement le théorème de Pythagore. Cela fonctionne très bien, à condition que la projection soit valide pour toute la trace GPX. Aucun problème dans le cas d'une balade, mais pour un trajet réalisé en avion, qui s'étend sur plusieurs fuseaux UTM, cela n'est plus le cas. De plus, les formules de projection sont souvent assez compliquées.

En réalité, il est beaucoup plus simple, et plus universel, de raisonner directement en géométrie sphérique et de calculer les longueurs des arcs de grands cercles entre deux points successifs (les grands cercles sont les géodésiques d'une sphère, c'est-à-dire que les arcs de grands cercles sont les plus courts chemins entre deux points). Ceci est indépendant de toute projection.

Lire la suite...

Arona to Ifonche and return

For my first walk in Tenerife, I'm describing an itinerary that is very pleasant, offers beautiful views, and is quite easy.

This walk is a variation on the Fantasia walk described in the excellent Walk! Tenerife by Ros and David Brawn. I'm not describing in details the parts in common with Walk! Tenerife, please see walk #19 in the guide. Rather, I am pointing out the differences.

This walk starts from Arona, then climbs to Ifonche, so as to “climb first, then go down”. The walk starts a little above Arona, just before the first curve of the road. The path briefly goes down the steep and deep Barranco del Rey. After we follow itinerary #19 that leads to a viewpoint at the bottom of Roque del Conde and then climbs up to a saddle in between Roque de los Brezos and Roque Imoque.

At the saddle, we don't go to Ifonche by the dirt road, in order to avoid some road-walking. Instead, we drop again into Barranco del Rey: although absent from the Davids' map, the path is easily visible, and marked with green paint dots. This allows us to find the return path to Arona, just above the restaurant El Refugio. The way down is as indicated by itinerary #19.

See the GPX track

20110218_AronaIfonche1.jpg 20110218_AronaIfonche2.jpg

Display GPX tracks using Google Maps API

Surprinsingly, the Google Maps Javascript API does not provide a built-in way to create an overlay from a GPX track, contrary to OpenLayers for instance.

Forum messages asking a way to add GPX overlays to Google Maps are numerous, and various solutions are proposed. Here I propose my own method, adapted to the Google Maps Javascript API v3. It relies on jQuery, so it is very simple.

Lire la suite...

POCSAG decoder

Two years ago, I did some experiments with the POCSAG paging protocol, that resulted in writing a POCSAG decoder in Java. I have no time and no desire to evolve it into a finished, packaged product, so I'm releasing it “as is” under the GPLv3, for the enjoyment of the radio enthusiast / amateur radio community.

The project, called jPOCSAG, is hosted on code.google.com[1].

The program is functional for my own use, but it is not intended to be a stable, released product. Rather, it is a codebase to experiment/play/tinker with, with no warranty of any kind. For these reasons, there is no “executable”; only the source code is available from a Subversion repository. Also, do not expect further updates to the source. I may, or may not, improve the program in the future, depending on my own needs. But feel free to use the code and improve it.

Notes

[1] By the way, Google Project Hosting is much more easy to use than SourceForge, although a little less customizable. Additionally, it's lightning fast compared to SourceForge.

Les superlatifs de la mort

Le mercredi soir à la télévision française :

  • canal 8, 20h40 : Les Démolisseurs de l'extrême
  • canal 9, 20h40 : Le Convoi de l'extrême
  • canal 9, ensuite : Les Pilotes de l'impossible

Et n'oublions pas le canal 11, qui programme au même créneau des titres tels que Beauté fatale ou Impact imminent !

- page 3 de 18 -

HTML5 valide ? © . ✍ Contact. Mentions légales.
Propulsé par DotClear.