groom is currently certified at Journeyer level.

Name: Benoît Rouits
Member since: 2002-05-26 02:42:50
Last Login: 2011-09-10 05:41:42

FOAF RDF Share This

Homepage: http://herewe.servebeer.com

Notes:

Playing with C, making tiny libraries for various purpose.

  • Addiction: playing music.
  • Favourite quote:
    If a composer could say what he had to say in words,
    he would not bother trying to say it in music
    (Gustav Mahler)

irc://ben{}@eu.freenode.net

Projects

Articles Posted by groom

Recent blog entries by groom

Syndication: RSS 2.0
Posting SVN commits to an IRC channel

Everybody may be aware of svn mailers that post commit logs to a mailing list or several email address. I found more useful to have a notification on my favourite IRC channel.

For people interested in IRC notification of SVN commits, here is a python script that will do the trick.


#!/usr/bin/python
import sys
from irclib import *


class SVNBot(SimpleIRCClient): def __init__(self, server, port, target, repo, rev, author, log): SimpleIRCClient.__init__(self)

self.target = target self.repo = repo self.rev = rev self.author = author self.log = log self.msg = 'new commit on ' + repo + ' r' + rev + ' by ' + author + ': ' + log self.connect(server, port, 'svnbot')

def on_nicknameinuse(self, c, e): c.nick(c.get_nickname() + '_') def on_welcome(self, c, e): if (is_channel(self.target)): self.connection.join(self.target) else: self.connection.notice(self.target, self.msg) self.connection.quit()

def on_join(self, c, e): nick = nm_to_n(e.source()) if nick == c.get_nickname(): self.connection.notice(self.target, self.msg) self.connection.quit()

def on_quit(self, c, e): nick = nm_to_n(e.source()) if nick == c.get_nickname(): self.connection.disconnect() sys.exit(0)

def main(): if len(sys.argv) != 7: print 'Usage: ' + sys.argv[0] + ' <server[:port]> <target> <repo> <revnum> <author> <log>' sys.exit(1)

s = sys.argv[1].split(':', 1) server = s[0] if len(s) == 2: try: port = int(s[1]) except ValueError: print 'Error: Erroneous port.' sys.exit(1) else: port = 6667 target = sys.argv[2] repo = sys.argv[3] revnum = sys.argv[4] author = sys.argv[5] log = sys.argv[6] bot = SVNBot(server, port, target, repo, revnum, author, log) bot.start()

if __name__ == '__main__': main()

This script should be callable from the hooks/post-commit file as follow:


REPOS="$1"
REV="$2"
AUTHOR=`/usr/bin/svnlook author "$REPOS"`
LOG=`/usr/bin/svnlook log "$REPOS"`
/usr/local/bin/svnbot.py "irc.server" "#irc.chan" "$REPOS"
"$REV" "$AUTHOR" "$LOG"

Now, happy commits!

nall! notify almost everything on the system tray

I finally released a decent tarball of nall, a tool i use for several months, and i noticed that some people really waited for such a tool to monitor various networked resources a simple way. However, nall's current spawn'n'reap model is not very smart,so i may improve it in the future.

python is cool: chapter 0

I finally rewrote a program (previously wrote in C) in the python language. I like it, mainly for it's well documented API and the way we can have both the functionnal and object language style. I took to me less than 12 hours to complete the program i made in 3 days of C, having not any knowledge of Python but a book. I'ts really cool.

15 Feb 2008 (updated 15 Feb 2008 at 02:39 UTC) »
vala tutorial: chapter 0

after about 8 years of C and bourne, i finally decided to learn a descent language. and by learn, i mean learn from the beginning, as a baby. making things clean, trying to forget crappy things i made in the past. So, i decided to choose vala for testing my fresh baby brain. This first post on vala is be the beginning of a step by step introduction to this language for people who know C or C++.

first, read This Hello World in Vala

Here is a variant, which goal is to demonstrate how to use program's arguments, and how to get an array's length:

using GLib;
public class Tutorial.CommandLineArgs : GLib.Object {
 public static void main(string[] args) {
  for (uint i=1; i< args.length; i++)
   stdout.printf("Hello, %s. ",args[i]);
  stdout.printf("My name is %s\n", args[0]);
 }
}

Here you see the declaration of an array of strings which i called args, another declaration: an unsigned integer variable named i. Then you see the length member of the array type. Finally you see how to acces to an array's cell.

Question from the baby: how to get the real basename of args[0], having knowledge of basename() from <libgen.h> or g_path_get_basename() from GLib ? Reply: to acces g_path_get_basename() from GLib, Vala has this naming convetion: GLib.Path.get_basename(). Now it's up to you to make a better hello people program.

3 Oct 2007 (updated 3 Oct 2007 at 04:18 UTC) »
vps experience

After the succcessful vserver experience for virtualizing asterisks and freepbx, i am now switching to the VPS technology provided by Positive software. The advantage is mainly that they provide a web interface to generete guest OSes. The cons is that it is not free for commercial purposes. see you later for more infos.

48 older entries...

 

groom certified others as follows:

  • groom certified jul as Journeyer
  • groom certified Ruffy as Journeyer
  • groom certified groom as Apprentice
  • groom certified negative as Journeyer
  • groom certified johnnyb as Journeyer
  • groom certified salmoni as Journeyer
  • groom certified remle as Journeyer
  • groom certified Barbicane as Journeyer
  • groom certified fxn as Journeyer
  • groom certified r4f as Journeyer
  • groom certified chipx86 as Journeyer
  • groom certified lmjohns3 as Journeyer
  • groom certified jschurger as Journeyer
  • groom certified mathieu as Journeyer
  • groom certified exa as Journeyer
  • groom certified Guillaume as Journeyer
  • groom certified zhaoway as Journeyer

Others have certified groom as follows:

  • badvogato certified groom as Apprentice
  • bytesplit certified groom as Apprentice
  • negative certified groom as Apprentice
  • groom certified groom as Apprentice
  • johnnyb certified groom as Apprentice
  • lev certified groom as Apprentice
  • remle certified groom as Journeyer
  • jul certified groom as Apprentice
  • r4f certified groom as Journeyer
  • Barbicane certified groom as Journeyer
  • fxn certified groom as Apprentice
  • helcio certified groom as Apprentice
  • Guillaume certified groom as Apprentice
  • Stevey certified groom as Apprentice

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page