#!/bin/python
"""
This program parse logs of a dokuwiki
and tranform them for gource (a log viewer)
http://code.google.com/p/gource/
developped by WolverineX02
site : http://wolverinex02.blogspot.com
"""
import glob
import os.path
import getopt
import sys
import re
WHITE = "11FFAA"
GREEN = "00F000"
vector = (1,10,100)
start_page_name = "start"
def RGBToHTMLColor(rgb_tuple):
""" convert an (R, G, B) tuple to #RRGGBB """
hexcolor = '#%02x%02x%02x' % rgb_tuple
# that's it! '%02x' means zero-padded, 2-digit hex values
return hexcolor
def HTMLColorToRGB(colorstring):
""" convert #RRGGBB to an (R, G, B) tuple """
colorstring = colorstring.strip()
if colorstring[0] == '#': colorstring = colorstring[1:]
if len(colorstring) != 6:
raise ValueError, "input #%s is not in #RRGGBB format" % colorstring
r, g, b = colorstring[:2], colorstring[2:4], colorstring[4:]
r, g, b = [int(n, 16) for n in (r, g, b)]
return (r, g, b)
def colormodify(colorstring):
rgb_tuple = HTMLColorToRGB(colorstring)
r, g, b = (rgb_tuple[0]+vector[0]) % 255,(rgb_tuple[1]+vector[1]) % 255,(rgb_tuple[2]+vector[2]) % 255
return RGBToHTMLColor((r, g, b))
def listdirectory(path,color):
l = glob.glob(path+"/*")
for i in l:
if os.path.isdir(i):
listdirectory(i,colormodify(color))
else:
readfile(i,color)
def listdirectory2(path):
"""list all the files like *.changes,
read them and output them in gource's log syntax
"""
for root, dirs, files in os.walk(path):
for i in files:
if (re.search('\.changes$', i)):
fichier = os.path.join(root, i)
readfile(fichier,GREEN)
def readfile(fichier,color):
"""read the file and output for each line of this
file a log line for Gource
"""
myfile = open(fichier, 'r')
for line in myfile.readlines():
mots = line.split('\t')
if len(mots)>=6:
resultat = mots[0] + "|"
if mots[4] == '':
mots[4] = 'Anonymous'
resultat += mots[4] + "|"
resultat += translate(mots[2]) + "|"
resultat += mots[3].replace(':', '/')
if mots[3].rfind(start_page_name) == len(mots[3])-len(start_page_name):
resultat += "|" + color
else:
resultat += "|" + colormodify(color)
print resultat
myfile.close()
def translate(mot):
"""translate the dokuwiki vocabulary to the gource one
C (also cc and sc from discussion plugin) ->A
E (also ec from discussion plugin) -> M
D (also dc and hc from discssion plugin) -> D
other -> M
"""
if mot.upper == "C" or mot == 'cc' or mot == 'sc':
return "A"
elif mot.upper == "E" or mot == 'ec':
return "M"
elif mot.upper == "D" or mot == 'dc' or mot == 'hc':
return "D"
else:
return "M"
def main(argv):
"""principal function
"""
try:
opts, args = getopt.getopt(argv, "hd:", ["help", "dokuwiki="])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ("-h","--help"):
usage()
sys.exit()
elif opt in ("-d","--dokuwiki"):
print listdirectory(arg,WHITE)
def usage():
"""this function will display how to use this script
"""
print "This script will output change logs of a dokuwiki"
print "in a friendly way for gource"
print "how to use it :"
print "python gourcedoku.py -d ~/Sites/MyDokuwiki/ | sort > dokusort.log"
print "and then :"
print "gource --log-format custom dokusort.log --stop-position 1.0 \ "
print "--stop-on-idle --file-idle-time 10000000"
print "---"
print "-h : help "
print "-d : meta directory of your dokuwiki"
if __name__ == "__main__":
main(sys.argv[1:])
Wednesday, May 19, 2010
Dokuwiki, Gource : color now
In response to various requests, I just added the color to the Dokuwiki representation with Gource. You can now download the new version .
Sunday, May 16, 2010
Wasab emulsion
We tasted this preparation in a very good restaurant ... By guessing the ingredients that could be present ... we managed to recreate a recipe for wasabi emulsion well nice and very easy to make :-)

Here is the recipe:
List of ingredients:
Mix the wasabi in soy sauce. Add lemon juice, whipping cream and beat all until a stiff emulsion.

Suggestion:
You can serve as an appetizer with bread sticks, as an accompaniment to salmon sashimi.
Enjoy!
Here is the recipe:
List of ingredients:
- 1 tsp wasabi (in a tube and not powder)
- 1 tbsp soy sauce
- juice of half a lemon
- 200 ml of cream
Mix the wasabi in soy sauce. Add lemon juice, whipping cream and beat all until a stiff emulsion.
Suggestion:
You can serve as an appetizer with bread sticks, as an accompaniment to salmon sashimi.
Enjoy!
Gource and Dokuwiki : the video
The video :
obtain with the followinf command line :
It takes a little time but the result is wonderful
obtain with the followinf command line :
gource --log-format custom dokusort.log --stop-position 1.0 --stop-on-idle --file-idle-time 10000000 --output-ppm-stream - | ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i - -vcodec mpeg4 gource.mp4
It takes a little time but the result is wonderful
Gource and Dokuwiki
Like everyone, I am fond of the wonderful videos made with Gource. The goal of this tool is to make a representation of the changes made on a version control system like git or SVN. But my favorite wiki ( DokuWiki ) is a version control system tool... Have a look to the folder tree to find the directory "dokuwiki/data/meta" in which the files "*. changes" contain exactly the information sought. For example, the file "systemes_visualisation.changes" looks like:
Explanation :
I will try to put this code on the site Gource site ;-) Feel free to ask me questions or to improve my script.
1263135717 ::1 C informatique:systemes_visualisation Wolverine créée 1263135717:: 1 C computer: Wolverine created systemes_visualisation
1263135988 ::1 E informatique:systemes_visualisation Wolverine 1263135988:: 1 E it: Wolverine systemes_visualisation
1263136423 ::1 E informatique:systemes_visualisation Wolverine 1263136423:: E a computer: Wolverine systemes_visualisation
Explanation :
- the first column is a Unix Timestamp ,
- the second is the IP address (I'm working on localhost ;-))
- the third is the action performed (C created, E edited ,...)
- the fourth is straightforward,
- the fifth is the ID of the person who modified the page
- and the last column is the smallest text you can perform when you edit a page ...
To start it, nothing more simple, launch the script in yout dokuwiki directory :
#!/bin/python
"""
This program parse logs of a dokuwiki
and tranform them for gource (a log viewer)
http://code.google.com/p/gource/
developped by WolverineX02
site : http://wolverinex02.blogspot.com
"""
import os.path
import getopt
import sys
import re
def listdirectory2(path):
"""list all the files like *.changes,
read them and output them in gource's log syntax
"""
for root, dirs, files in os.walk(path):
for i in files:
if (re.search('\.changes$', i)):
fichier = os.path.join(root, i)
myfile = open(fichier, 'r')
for line in myfile.readlines():
mots = line.split()
if len(mots)>=5:
resultat = mots[0] + "|"
resultat += mots[4] + "|"
resultat += translate(mots[2]) + "|"
resultat += fichier
print resultat
elif len(mots)==4:
resultat = mots[0] + "|Anonymous|"
resultat += translate(mots[2]) + "|"
resultat += fichier
print resultat
myfile.close()
def translate(mot):
"""translate the dokuwiki vocabulary to the gource one
C -> A
E -> M
other -> M
"""
if mot == "C":
return "A"
elif mot == "E":
return "M"
else:
return "M"
def main(argv):
"""principal function
"""
try:
opts, args = getopt.getopt(argv, "hd:", ["help", "dokuwiki="])
except getopt.GetoptError:
usage()
sys.exit(2)
for opt, arg in opts:
if opt in ("-h","--help"):
usage()
sys.exit()
elif opt in ("-d","--dokuwiki"):
print listdirectory2(arg)
def usage():
"""this function will display how to use this script
"""
print "This script will output change logs of a dokuwiki"
print "in a friendly way for gource"
print "how to use it :"
print "python gourcedoku.py -d ~/Sites/MyDokuwiki/ | sort > dokusort.log"
print "and then :"
print "gource --log-format custom dokusort.log --stop-position 1.0 \ "
print "--stop-on-idle --file-idle-time 10000000"
print "---"
print "-h : help "
print "-d : meta directory of your dokuwiki"
if __name__ == "__main__":
main(sys.argv[1:])
python gourcedoku.py -d ~/Sites/MyDokuwiki/ | sort > dokusort.logthen view the result with Gource with the following command:
gource --log-format custom dokusort.log --stop-position 1.0 --stop-on-idle --file-idle-time 10000000
I will try to put this code on the site Gource site ;-) Feel free to ask me questions or to improve my script.
Sunday, January 24, 2010
Chromoxy
I have just read the article from LifeHacker on how to block ads in Chrome browser Goolge ... ce serait un peu comme l'extension AdBlock Plus pour Chrome ;-) voir même encore un peu plus que seulement filtrer les publicités sur Chrome... This would be like the AdBlock Plus extension for Chrome ;-) see even a little more than just filter the ads on Chrome ... Je me suis dit que c'est pas mal mais pas très automatique ;-) j'ai donc écrit un petit script pour cela : I told myself that it's not bad but not very automatic ;-) so I wrote a little script for that:

Facile non ;-) si vous êtes intéressés, je peux continuer à développer cette "application". ;-) Not easy if you're interested, I can continue to develop this "application". J'attends vos retours I await your return
et en utilisant Platypus , il devient super facile de créer ensuite une véritable application : and using Platypus, it becomes super easy to then create a real application:
#!/bin/sh / bin / sh
# Demarrage de Privoxy # Starting Privoxy
cd /Applications/privoxy/ cd / Applications / privoxy /
./privoxy & . / privoxy &
# demarrage de Chrome # START Chrome
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --proxy-server="http://127.0.0.1:8118" / Applications / Google \ Chrome.app / Contents / MacOS / Google Chrome - proxy-server = "http://127.0.0.1:8118"
# retour maison # Return home
cd cd

Facile non ;-) si vous êtes intéressés, je peux continuer à développer cette "application". ;-) Not easy if you're interested, I can continue to develop this "application". J'attends vos retours I await your return
Sunday, December 13, 2009
How to import Mac OS X's icons in Visio
You certainly know the program Visio (Microsoft Office) that allows to make beautiful diagrams ... the only small snag, Visio's icons are particularly ugly... Therefore let me show you two techniques to import the beautiful Snow Leopard icons in your Visio.
Method: by hand
Select the application whose you want import the icon (with the famous Apple + C), then open the Preview application and choose "New from clipboard"
you will just have to save it as and choose the PNG format. You can now import your image into Visio.

Second method: using a script
The previous method let you to extract only an icon at a time, if you want to retrieve all the icons of Mac OS X, you can use the following python script:
/bin/python
import os
import re
text = "0000"
out = "~/Pictures/"
stdout_handle = os.popen ( "find / -name *. icns", "r")
while (text !=""):
stdout_handle.readline text = ()
regnamefile = re.compile ( '\/([^//]*)\. icns')
namefile = regnamefile.findall (text) [0]
Reglin = re.compile ( '(\/ .*\. icns)')
line = regline.findall (text) [0]
os.system ( "sips-s format png"+line+"-out"+out+namefile+".png")
Beware the indentation : it is the python ... ;-) The script first look for all icns file (the format of the icons of Mac OS X ;-) ;-)), then apply a transformation using the application sips available on Mac OS X. All files in PNG format will be created in your pictures folder ...
That ;-) I hope you will make beautiful patterns after that.
Method: by hand
Select the application whose you want import the icon (with the famous Apple + C), then open the Preview application and choose "New from clipboard"
you will just have to save it as and choose the PNG format. You can now import your image into Visio.

Second method: using a script
The previous method let you to extract only an icon at a time, if you want to retrieve all the icons of Mac OS X, you can use the following python script:
/bin/python
import os
import re
text = "0000"
out = "~/Pictures/"
stdout_handle = os.popen ( "find / -name *. icns", "r")
while (text !=""):
stdout_handle.readline text = ()
regnamefile = re.compile ( '\/([^//]*)\. icns')
namefile = regnamefile.findall (text) [0]
Reglin = re.compile ( '(\/ .*\. icns)')
line = regline.findall (text) [0]
os.system ( "sips-s format png"+line+"-out"+out+namefile+".png")
Beware the indentation : it is the python ... ;-) The script first look for all icns file (the format of the icons of Mac OS X ;-) ;-)), then apply a transformation using the application sips available on Mac OS X. All files in PNG format will be created in your pictures folder ...
That ;-) I hope you will make beautiful patterns after that.
Sunday, June 08, 2008
Installing Wikicalc: the most beautiful OpenSource spreadsheets
As I indicated in my last post: WikiCalc is a collaborative spreadsheet operating on the principle of wiki. It is completely written in Perl. To install Wikicalc, nothing more simple, just start by installing the necessary tools for your good old Debian:
Now you have to let the Wikicalc engine to be accessible from your Web server: compared to the configuration by default, you just need to add these few lines :
To finish the installation, go to http://wikicalc.monsite.com/wikicalccgi.pl and follow the instructions ....
Now you can play with this imressive spreedsheat
apt-get install apache2 libapache2-mod-perl2Then download sources: wikicalc-1-0.tar.gz. Then can begin the installation process itself:
cd /var/www
tar xvzf wikicalc-1-0.tar.gz
ln -s wikicalc-1-0 wikicalc
Now you have to let the Wikicalc engine to be accessible from your Web server: compared to the configuration by default, you just need to add these few lines :
NameVirtualHost *
ServerAdmin webmaster@localhost
DocumentRoot /var/www/wikicalc/
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews ExecCGI
AddHandler cgi-script .cgi .pl
AllowOverride None
Order allow,deny
allow from all
Load Perl module:
a2enmod perl
restart /etc/init.d/apache2
To finish the installation, go to http://wikicalc.monsite.com/wikicalccgi.pl and follow the instructions ....
Now you can play with this imressive spreedsheat
Saturday, March 22, 2008
Fulguro
A new site, soon... I am sure you will enjoy it, so come and join me at http://fulguro.fr/ . People who like Goldorak will enjoy this site, I am sure of it ;-)
Wednesday, January 02, 2008
Simataï : the best part of the great wall
Simataï is probably the best part of the great wall, it is a bit farer than the other part of the great wall, nevertheless it is probably the more typical part of this monument. You will need good shoes to go there and a good health. Be careful there are some bees in the wall and if you are lucky you might be see some bats.
The best way to wish a happy new year
Wednesday, August 29, 2007
A good hotel in Beijing
I went in China this summer and I spent one week in the Beijing King's Joy Hotel, whose address is : No. 81, Meishi Street, Xuanwu District, Beijing

this hotel is not very far from the Tienanmen place, is very cheap (40$) and there is a very good restaurant in the hutong near the hotel. Hope it can help you...

this hotel is not very far from the Tienanmen place, is very cheap (40$) and there is a very good restaurant in the hutong near the hotel. Hope it can help you...
Tags: China, Beijing, Hotel, Tienanmen, Meishi Street, Xuanwu District
Thursday, August 23, 2007
Ratatouille : a great great movie
Tags: Ratatouille, Paris, rat, movie
Simataï: marvellous the chinese Great Wall
Tags: Simataï, Great Wall, China
My week Harry Potter: The Deathly Hollows and the movie
I was in the FNAC (a big french store for books, disks, computers...), and I did not resist to buy the last Harry Potter : “Harry Potter and The Deathly Hollows”. The intrigue puts a little time to set up itself, but one is glad finally to know the fate of Harry Potter. Poor Albus sees its will have put a little at evil but the final he will be rehabilitated… As a conclusion, it is not great literature (good it is true it is written in English…) but that slackens… On the other hand I went to see the same week : “Harry Potter and the Order of the Phoenix”
there too the intrigue puts much time to set up itself… certain elements overlooked and others are presented in an unmethodical way! I am fan of the 4 first opus, where the dream and fairyhood are omnipresent… I know the last Harry Potter want to be much darker as Voldemort seizes the power… But that does not want to say that the film must all sacrifice to the darkness. In conclusion, I was very disappointed! A good film: to see in DVD not moreEnough of Google: test Exalead
If you are fed up of the oneself-saying supremacy of Google as "search engine" on Internet, I propose you to test a new search engine, of the new generation: Exalead
this search engine was or is still implied in the European search engine Quaero, if this last is born or not…. The strong points of Exalead are thumbnail previews of the sites
I like also the possibility of making research directly in Wikipédia, the search engine for films is very good and the zapette is a brilliant idea: try it absolutely

moreover Exalead allows you to carry out research with regular expressions, the famous RegEx: the experts will appreciate. To finish and like quality guarantees: COCK-A-DOODLE-DOO, this search engine is French and was founded by François Bourdoncle: a pure product of the best French schools (Polytechnique and Mines)
Tags: Exalead, Google, RegEx, regular expression, zapette, Wikipedia, François Bourdoncle, Bourdoncle, Polytechnic, X, Mines
Labels:
Blogger,
Exalead,
Google,
Internet,
search engine
Tuesday, August 21, 2007
Help for your MacBook and other Howtos
I will encourage the blog of a friend of mine : a small blog entirely dedicated to the wonderfull universe of MacBook… Happy guy or girl, who has a MacBook, do not hesitate to visit him
Tuesday, June 19, 2007
A little walk in Brussels
A small walk in Brussels with some Comic strips on walls. Good walk but be careful to not knock your head against a wall… Who knows what it could happen
Friday, June 08, 2007
Cake with Etorki, prune and Italian ham
An easy recipe for a delicious cake… Again... YES, because a cake is practical, easy and most of the time mine are delicious
Before anything, it is necessary to preheat the furnace on 180°C. During this time, in a salad bowl, mix the flour with yeast then with eggs.
Incroporate oil gradually then the milk heated beforehand in the microwaves (1 minute is sufficient). Add the Gruyere, mix and add salt and pepper.
Now the recipe is quite finish, add Etorki cut in small dice, ham in plates and prunes half cutted.

Pour the preparation inside the moult and to charge during 45 minutes in the furnace.

The recipe is simple and delicious. I am sure you will love it

Ingredients:
- 3 eggs
- 150g of flour
- 1 bag of yeast
- 8cl oil
- 13cl of full-cream milk
- 100g Gruyere
- salt and pepper
- 100g of Etorki (cheese)
- 4 piece of Italian ham
- 125g stoned prune
Before anything, it is necessary to preheat the furnace on 180°C. During this time, in a salad bowl, mix the flour with yeast then with eggs.
Incroporate oil gradually then the milk heated beforehand in the microwaves (1 minute is sufficient). Add the Gruyere, mix and add salt and pepper.Now the recipe is quite finish, add Etorki cut in small dice, ham in plates and prunes half cutted.

Pour the preparation inside the moult and to charge during 45 minutes in the furnace.

The recipe is simple and delicious. I am sure you will love it

Tuesday, May 15, 2007
La Butte aux Cailles and its restaurant: "Les Cailloux"
If you walk one day on the side of the Butte aux Cailles and that you start to feel the hunger to come, I advise you a small halt at the restaurant “Les Cailloux”. It is a small Italian restaurant not too far from the place of the Butte aux Cailles (XIII), with a middle-class Bohemian environment… but that's why we like the Butte aux Cailles, isn't it? The decoration is sober although a little sinks, with lamps which do not finish any going down… The reception is cordial and the service is fast. I can simply advise it to you for a meal with friends.
(The picture is borrowed from the site of the Verlaine Institute)
(The picture is borrowed from the site of the Verlaine Institute)
Tags: restaurant, Les Cailloux, Paris, Buttes aux Cailles, Cailles, Butte
Second Life: my first avatar
Second Life is very hype so I have just created my avatar and plug me to Second Life… I am not yet totally accustomed with the interface, but it is rather easy to move and interact with the objects. The inhabitants of Second Life (avatars) are very cool and never hesitate to guide you and to help you.

Above a small island that I discovered thanks to Zelena (an avatar met on SL), normally it is a beach of nudists, there is some one of them but not every people… The good point of this small island is that it is rather easy to gain Linden (the local dollar, which will enable you to buy new accessories for your avatar, or to take part in other activities of this world). Indeed on this beach, you can gain 2L$ for 10 minutes sunbathing and you can take part in a lottery and gain even more Linden (not later than yesterday, I gained 238L$)

My avatar, on the bath towel which pays you to sunbathe… As you have probably noticed, my avatar is a default one and looks like a first 3D game of Sega, I advise you to seek a news skin (skin) and to modify your avatar a little… Hair flex adds also much to realism…
An air sight of the dancefloor. I hope to find you on SL (do not hesitate to contact me if you want to be escorted)

Above a small island that I discovered thanks to Zelena (an avatar met on SL), normally it is a beach of nudists, there is some one of them but not every people… The good point of this small island is that it is rather easy to gain Linden (the local dollar, which will enable you to buy new accessories for your avatar, or to take part in other activities of this world). Indeed on this beach, you can gain 2L$ for 10 minutes sunbathing and you can take part in a lottery and gain even more Linden (not later than yesterday, I gained 238L$)

My avatar, on the bath towel which pays you to sunbathe… As you have probably noticed, my avatar is a default one and looks like a first 3D game of Sega, I advise you to seek a news skin (skin) and to modify your avatar a little… Hair flex adds also much to realism…
An air sight of the dancefloor. I hope to find you on SL (do not hesitate to contact me if you want to be escorted)
Subscribe to:
Posts (Atom)

