<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for TazForEver</title>
    <link>http://www.advogato.org/person/TazForEver/</link>
    <description>Advogato blog for TazForEver</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Tue, 21 May 2013 05:02:09 GMT</pubDate>
    <item>
      <pubDate>Wed, 18 Jan 2006 09:57:21 GMT</pubDate>
      <title>18 Jan 2006</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=18</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=18</guid>
      <description>&lt;b&gt;CVSspam&lt;/b&gt;&lt;br/&gt;
I've installed &lt;a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" &gt;CVSspam &lt;/a&gt;on my &lt;a href="http://www.clarisys.fr" &gt;company&lt;/a&gt; CVS repository, this tool is amazing. Much better than poor old cvssyncmail. CVSspam sends HTML mail with coloured diff on CVS  activity. Moreover, mail's subject includes cvs project name :)</description>
    </item>
    <item>
      <pubDate>Sat, 17 Sep 2005 17:07:46 GMT</pubDate>
      <title>17 Sep 2005</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=17</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=17</guid>
      <description>&lt;b&gt;Maintenant les ASSEDIC&lt;/b&gt; &lt;br /&gt;
Et &#xE7;a continue : aujourd'hui 17 septembre, je re&#xE7;ois un courrier des ASSEDIC dat&#xE9; du 13 septembre qui m'informe que je dois r&#xE9;gulariser ma situation avant le 16 septembre. &lt;br /&gt;
D'une part, c'est la toute premi&#xE8;re fois que les ASSEDIC me contactent, d'autre part, je veux bien r&#xE9;gulariser, mais faudrait il encore que je puisse terminer mon inscription. Bref, je suis ray&#xE9; des demandeurs d'emploi alors que je n'ai m&#xEA;me pas termin&#xE9; les formalit&#xE9;s.&lt;br /&gt;
L'administration fran&#xE7;aise est tellement lente et minable, on se fait virer avant m&#xEA;me d'avoir pu s'inscrire.&lt;br /&gt;
&#xC7;a fait mal de penser qu'un site web permet de remplir un dossier complet et de l'activer en 15 minutes alors qu'actuellement l'ANPE n'est au courant que de mon nom et que je dois leur ramener un formulaire dans lequel on me demande si je sais construire un mur.&lt;br /&gt;
&lt;br /&gt;
MAJ: Pire, mon premier courrier de la part des ASSEDIC me communiquent des identifiants pour leur web. Je vais sur le site pour r&#xE9;gulariser ma situation. Manque de bol, aux ASSEDIC, on ne r&#xE9;gularise qu'une fois par mois, il me faudra donc attendre le 29 setptembre 23h59m59s (sic).&lt;br/&gt;
Lundi, je vais les exploser, rendez-vous ou pas.</description>
    </item>
    <item>
      <pubDate>Fri, 16 Sep 2005 22:12:38 GMT</pubDate>
      <title>16 Sep 2005</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=16</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=16</guid>
      <description>&lt;b&gt;L'ANPE responsable du ch&#xF4;mage&lt;/b&gt;&lt;br /&gt;
Je viens juste de rentrer d'un entretien d'embauche prometteur chez &lt;a href="http://www.eds.fr" &gt;EDS&lt;/a&gt; pour un travail d'administateur syst&#xE8;me UNIX, et je trouve dans ma bo&#xEE;te aux lettres un courier de l'ANPE.&lt;br /&gt;
Je suis &#xE0; la recherche d'un premier emploi depuis en peu plus de 2 mois. Je me suis inscrit &#xE0; l'ANPE le 8 ao&#xFB;t 2005, ce qui m'a valu de recevoir une invitation pour le 7 septembre au plus tard. Je me pr&#xE9;sente donc le 6 septembre &#xE0; l'ouverture. Je repars 2 minutes plus tard avec un rendez-vous le 21 septembre. Quelle efficacit&#xE9; ! J'en arrive &#xE0; cette lettre que j'ai ouverte &#xE0; l'instant : on m'annonce que je vais &#xEA;tre radier de la liste des demandeurs d'emplois parce que je me suis pas pr&#xE9;sent&#xE9; &#xE0; mon entretien du 13 septembre. Cherchez l'erreur. Lundi je vais les exploser ces fonctionnaires. Faut pas chercher plus loin : l'ANPE est la garrante du non-retour &#xE0; l'emploi.&lt;br /&gt;
Merci le service publique.</description>
    </item>
    <item>
      <pubDate>Fri, 24 Jun 2005 16:15:11 GMT</pubDate>
      <title>24 Jun 2005</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=15</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=15</guid>
      <description>&lt;b&gt;Python : the socket.error trap&lt;/b&gt;&lt;br /&gt;

&lt;p&gt; I spent my lunch hacking a dirty remote shell in python.

&lt;p&gt; &lt;pre&gt;signal.signal(signal.SIGCHLD, reaper)
# ...
while True:
    client, who = server.accept()
&lt;/pre&gt;

&lt;p&gt; Blam ! When the server process receives SIGCHLD, accept() is interrupted. So I added a try/except around the accept() :

&lt;p&gt; &lt;pre&gt;  while True:
        try:
            client, who = server.accept()
        except OSError, e:
            if e.errno != errno.EINTR:
                sys.exit(e)
            else:
                continue
&lt;/pre&gt;

&lt;p&gt; Re-blam. I didn't paid attention to the previous exception's type. It was socket.error. I though it was a subclass of OSError ... it's not. &lt;tt&gt;issubclass(socket.error, OSError) == False&lt;/tt&gt;. &lt;i&gt;pydoc socket&lt;/i&gt; :/

&lt;p&gt; The correct except statement is :

&lt;p&gt; &lt;pre&gt;   while True:
        try:
            client, who = server.accept()
        except socket.error, e:
            if e.args[0] != errno.EINTR:
                sys.exit(e)
            else:
                continue
&lt;/pre&gt;

&lt;p&gt; The socket.* error classes are just Exception. It would be nice to turn them into OSError :)</description>
    </item>
    <item>
      <pubDate>Sun, 12 Jun 2005 21:16:41 GMT</pubDate>
      <title>12 Jun 2005</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=14</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=14</guid>
      <description>&lt;b&gt;Drivel 2.0&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;Wow, &lt;a href="http://www.dropline.net/drivel/" &gt;Drivel 2.0&lt;/a&gt; is amazing :)</description>
    </item>
    <item>
      <pubDate>Sun, 22 May 2005 13:46:43 GMT</pubDate>
      <title>22 May 2005</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=13</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=13</guid>
      <description>&lt;b&gt;GObject *_get_type() + G_GNUC_CONST&lt;/b&gt;&lt;br /&gt;

&lt;p&gt; When you define your own GObject class, you have to define 2 casts macro (instance cast and class cast). So you write :&lt;br /&gt;&lt;br /&gt;
&lt;tt&gt;
#define &lt;i&gt;MY_TYPE&lt;/i&gt; (&lt;i&gt;My_Type_get_type()&lt;/i&gt;)&lt;br /&gt;
#define &lt;i&gt;MY_TYPE&lt;/i&gt;(inst) (G_TYPE_CHECK_INSTANCE_CAST((inst), &lt;i&gt;MY_TYPE&lt;/i&gt;, &lt;i&gt;My_Type&lt;/i&gt;))&lt;/tt&gt;&lt;br /&gt;

&lt;p&gt; e.g : &lt;br /&gt;
&lt;tt&gt;#define GTK_TYPE_LABEL            (gtk_label_get_type ())&lt;br /&gt;
#define GTK_LABEL(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LABEL, GtkLabel))&lt;/tt&gt;&lt;br /&gt;

&lt;p&gt; Now have a look at &lt;tt&gt;&lt;i&gt;My_Type&lt;/i&gt;_get_type()&lt;/tt&gt; declaration and definition. &lt;tt&gt;&lt;i&gt;My_Type&lt;/i&gt;_get_type()&lt;/tt&gt; always return the same GType. So if you write multiple cast, only one call to &lt;tt&gt;&lt;i&gt;My_Type&lt;/i&gt;_get_type()&lt;/tt&gt; is really necessary. But gcc is a good servant and does what you ask him : calls &lt;tt&gt;&lt;i&gt;My_Type&lt;/i&gt;_get_type()&lt;/tt&gt; whenever you call it. Think about this kind of loop :&lt;br /&gt;

&lt;p&gt; &lt;tt&gt;for( ... ) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GtkWidget* widget= ...;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gtk_box_pack_start(&lt;i&gt;GTK_BOX&lt;/i&gt;(hbox), widget, ...);&lt;br /&gt;
}&lt;/tt&gt;&lt;br /&gt;

&lt;p&gt; To avoid such a waste, you have to tell gcc that all calls to &lt;tt&gt;&lt;i&gt;My_Type&lt;/i&gt;_get_type()&lt;/tt&gt; return the same GType.&lt;br /&gt;

&lt;p&gt; &lt;tt&gt;GType                 &lt;i&gt;My_Type&lt;/i&gt;_get_type          (void) &lt;b&gt;G_GNUC_CONST&lt;/b&gt;;&lt;/tt&gt;&lt;br /&gt;

&lt;p&gt; e.g:&lt;br /&gt;
&lt;tt&gt;GType                 gtk_label_get_type          (void) G_GNUC_CONST;&lt;/tt&gt;&lt;br /&gt;

&lt;p&gt; Yes, it's that simple. Just add a G_GNUC_CONST attribute, and gcc will optimize all your to &lt;tt&gt;&lt;i&gt;My_Type&lt;/i&gt;_get_type()&lt;/tt&gt;, therefore all your &lt;tt&gt;&lt;i&gt;MY_TYPE&lt;/i&gt;(inst)&lt;/tt&gt;.&lt;br /&gt;

&lt;p&gt; Be smart, don't forget &lt;a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Miscellaneous-Macros.html#id2996505" &gt;G_GNUC_CONST&lt;/a&gt; when you create your GObject class :)&lt;br /&gt;
&lt;i&gt;Of course, glib and gtk+ already do this kind of optimization.&lt;/i&gt;</description>
    </item>
    <item>
      <pubDate>Sat, 19 Mar 2005 21:18:35 GMT</pubDate>
      <title>19 Mar 2005</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=12</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=12</guid>
      <description>&lt;b&gt;The gboolean trap&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;
gboolean is just int !

&lt;p&gt; &lt;pre&gt;
#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;

&lt;p&gt; #include &amp;lt;glib.h&amp;gt;

&lt;p&gt; int main()
{
        float f;
        gboolean gb;
        bool b;

&lt;p&gt;         f = 0.5f;
        gb = f;
        b = f;

&lt;p&gt;         printf("gboolean %d\n"
               "bool     %d\n",
               (int)gb, (int)b);

&lt;p&gt;         return 0;
}
&lt;/pre&gt;

&lt;p&gt; Ouput :
&lt;pre&gt;
gboolean 0
bool     1
&lt;/pre&gt;

&lt;p&gt; 0.5f is converted to int 0. But 0.5f is obsviously not zero and therefore should be evaluated as TRUE. So be carefull with gboolean.

&lt;p&gt; NB: &amp;lt;stdbool.h&amp;gt;, bool, true and false are C99.</description>
    </item>
    <item>
      <pubDate>Wed, 16 Feb 2005 20:21:47 GMT</pubDate>
      <title>16 Feb 2005</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=11</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=11</guid>
      <description>&lt;b&gt;sizeof troubles&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;
I always took for granted that my name -- Beno&#xEE;t -- was 6 chars long. I was wrong.&lt;br/&gt;
It's 7, UTF-8 speaking.&lt;br/&gt;
It took me some time this afternoon to understand why sizeof "Beno&#xEE;t" == 8 where i would expect 7. So i hexdump'ed my C file and realized that &#xEE; is encoded as 0xC3AE.

I'm glad that ASCII chars are still encoded on a single byte in UTF-8 so hacks like this one:
&lt;pre&gt;char buf[magic]; /* enough to hold "plop" */&lt;/pre&gt; are still 0k.

I'll try to be less lazy and always code :
&lt;pre&gt;char buf[sizeof "plop"];&lt;/pre&gt;
&lt;br/&gt;
&lt;b&gt;WTF is &lt;i&gt;&#xEE;&lt;/i&gt; ?&lt;/b&gt;
&lt;pre&gt;U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
UTF-8 : 0xC3 0xAE&lt;/pre&gt;
In French, circumflexes '^' on vowels often replace old French 's' :&lt;br/&gt;
- h&#xF4;pital for hospital&lt;br/&gt;
- h&#xF4;tel for hostel (= hotel)&lt;br/&gt;
- Beno&#xEE;t for Benoist&lt;br/&gt;
- c&#xF4;te for coste (= coast)&lt;br/&gt;
- etc&lt;br/&gt;
Beno&#xEE;t is the french for &lt;a href="http://en.wikipedia.org/wiki/Saint_Benedict" &gt;Benedict&lt;/a&gt;.</description>
    </item>
    <item>
      <pubDate>Tue, 19 Oct 2004 12:20:44 GMT</pubDate>
      <title>19 Oct 2004</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=10</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=10</guid>
      <description>&lt;b&gt;Linux.Conf.Au 2004&lt;/b&gt;&lt;br&gt;
May be some of you have missed the LCA2004 DVD event record. I have.&lt;br&gt;
Here's the &lt;a href="http://www.linux.org.au/conf/2004/eventrecord/LCA2004-dvd.iso.torrent" &gt;BitTorrent&lt;/a&gt; and &lt;a href="http://www.linux.org.au/conf/2004/eventrecord/LCA2004-dvd.iso.md5" &gt;MD5&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="http://www.linux.org.au/conf/2004/eventrecord/LCA2004-dvd/" &gt;Linux.Conf.Au 2004 Videos&lt;/a&gt; </description>
    </item>
    <item>
      <pubDate>Fri, 24 Sep 2004 02:50:52 GMT</pubDate>
      <title>24 Sep 2004</title>
      <link>http://www.advogato.org/person/TazForEver/diary.html?start=9</link>
      <guid>http://www.advogato.org/person/TazForEver/diary.html?start=9</guid>
      <description>&lt;b&gt;PyPMU&lt;/b&gt;&lt;br&gt;
I've hacked a small python wrapper for PowerMac Power Management Unit.

&lt;p&gt; &lt;p&gt; &lt;a href="http://dejean.benoit.free.fr/software/pypmu/pypmu.html" &gt;PyPMU 0.1.1&lt;/a&gt;

&lt;p&gt; &lt;p&gt; I'll soon make a control-based desklets on it.&lt;br&gt;
I'd like to get the C backend used by GNOME battstat applet (supports only ACPI/APM, but i steel haven't been able to contact its maintainer. I think I'll have to provide a full patch to get a chance to get PMU support in ...


&lt;p&gt; &lt;p&gt; &lt;b&gt;LibGTop&lt;/b&gt;&lt;br&gt;
I'm working hard on libgtop. Fixed a nasty bug on Linux/Sparc64.&lt;br&gt;
I've been granted access to 5 Solaris (sparcs) machines in a German University, and started to fix Solaris support. I still haven't decided if this will go 2.8.1 or 2.9.0 ...</description>
    </item>
  </channel>
</rss>
