Hello,
due to some synchronization problems between my desktop and laptop, unfortunately I've lost my GPG secret key. I was planning to renew my key after the SHA issues, but this way I can't neither revoke the old key nor sign the new key. So I please anybody having my pubkey to delete it:
gpg --delete-key C29A9371
I've uploaded my new key as usual so you can get it:
gpg --keyserver pgp.mit.edu --recv-keys D2C27B6B
Saturday, August 29, 2009
Sunday, August 09, 2009
Spadi source code
Hello,
after I've written really a few docs, and cleaned up some stuff, I've published the code of both Spadi and Corraza on gitorious here. In the while, I've added support for floors and closeable views.
Help... help is needed.
Stay tuned.
after I've written really a few docs, and cleaned up some stuff, I've published the code of both Spadi and Corraza on gitorious here. In the while, I've added support for floors and closeable views.
Help... help is needed.
Stay tuned.
Thursday, August 06, 2009
Constructing a free ArchiCAD alternative
Hello,
together a couple of university mates we talked about a possible free (as in freedom) ArchiCAD alternative. There are several free CAD out there but none is free for architects/engineers. The project is too big and ambitious, but I wanted to give OpenGL a shot with this excuse to learn something new.
I've started two projects:
You can find a video here to see what it can do now, after a week of development.
There's no code published at the moment, contact me if you would like to join the development.
Stay tuned.
together a couple of university mates we talked about a possible free (as in freedom) ArchiCAD alternative. There are several free CAD out there but none is free for architects/engineers. The project is too big and ambitious, but I wanted to give OpenGL a shot with this excuse to learn something new.
I've started two projects:
- Corraza, the OpenGL framework for editing 3d objects and exporting the scene graph to ray tracing software... think about a very very very minimal blender but as library
- Spadi, the GTK+ application that runs on top of Corraza
You can find a video here to see what it can do now, after a week of development.
There's no code published at the moment, contact me if you would like to join the development.
Stay tuned.
Etichette:
archicad,
corraza,
development,
gtk,
opengl,
python,
ray tracing,
spadi
Tuesday, July 21, 2009
Aruanne, pdf reporting framework
Hello,
a while ago I've been talking about pango cairo and how to generate pdf with a couple of tables.
In the meantime I've worked on it, improving and enhancing new kinds of elements. This has lead to the creation of a small project, a library providing a simple framework for generating mostly PDF reports (I haven't tried to generate SVG or something else yet).
After a couple of release requests, I've found finally the time to publish a sort of working code.
Here's the git repository and here you can download the snapshot tarball.
Any patches welcome.
a while ago I've been talking about pango cairo and how to generate pdf with a couple of tables.
In the meantime I've worked on it, improving and enhancing new kinds of elements. This has lead to the creation of a small project, a library providing a simple framework for generating mostly PDF reports (I haven't tried to generate SVG or something else yet).
After a couple of release requests, I've found finally the time to publish a sort of working code.
Here's the git repository and here you can download the snapshot tarball.
Any patches welcome.
Saturday, June 20, 2009
The less consuming radio player ever
Hello,
multimedia always killed desktop performance, also audio with all such effect-based players out there. I've been using deezer for a long time, but sometimes I'm tired to see my desktop lagging.
I don't need that, I need random music from internet while I'm either programming or studying, and my computer has only 512mb ram and 2.4ghz amd64 (onLY??? yes nowadays it's a little amount).
Let's see what we can do using gst-launch:
The URL above is a hard rock station :) The while ensures re-connection. I think performances are great, 6% cpu and 2% ram.
But there's yet a bettere solution (see comments):
multimedia always killed desktop performance, also audio with all such effect-based players out there. I've been using deezer for a long time, but sometimes I'm tired to see my desktop lagging.
I don't need that, I need random music from internet while I'm either programming or studying, and my computer has only 512mb ram and 2.4ghz amd64 (onLY??? yes nowadays it's a little amount).
Let's see what we can do using gst-launch:
while [ 1 ]; do wget -q -O - http://66.250.45.112:80/hard.ogg|gst-launch fdsrc fd=0 ! decodebin ! audioconvert ! alsasink; done
The URL above is a hard rock station :) The while ensures re-connection. I think performances are great, 6% cpu and 2% ram.
But there's yet a bettere solution (see comments):
mplayer http://66.250.45.112:80/hard.ogg
Friday, May 29, 2009
Syx changes web and git hosting
Hello,
I'm officializing the change of web hosting and git hosting from googlecode to berlios:
The new website is up!
For several reasons, including reliability, we switched both the website and git hosting to berlios. Also the purpose of this change is to rewrite the website backend using Syx.
The mailing list and the bug tracker are still hosted at googlecode.
Some progress news in the while
We're working on a new memory management, object representation and garbage collector. On the other side the lack of time is making things harder for releasing the new version. Together with the above changes, new Smalltalk standard pieces will implemented as usual. I remind you the new code is in
the object branch.
Website: http://syx.berlios.de
Project page: https://developer.berlios.de/projects/syx/
Wednesday, May 27, 2009
Render tables with pangocairo like reportlab
Hello,
lately I was wondering if there was any alternative to the well known reportlab python software for creating PDF reports. I immediately thought about Cairo. The only two problems are:
Here's the Pango tables code snippet containing the necessary classes for achieving the job. Notice that the methods in the snippet often make use of Pango units instead of pixels.
Here's the result test.pdf:

lately I was wondering if there was any alternative to the well known reportlab python software for creating PDF reports. I immediately thought about Cairo. The only two problems are:
- Cairo doesn't create multiple pages
- No support for creating tables containing text, necessary for table-based reports
I still can't realize how to achieve the first feature, but the second one could be solved using Pango layouts.
The idea is to create the cells of the table using such layouts, so that the text get wrapped etc.
Now let's use the Table class as follows: create a table with two rows and two columns, then show it twice with different background colors.
surface = cairo.PDFSurface ("test.pdf", 300, 400)
cr = cairo.Context (surface)
cr = pangocairo.CairoContext (cairo.Context (surface))
sizes = [pango.SCALE*12*10, pango.SCALE*12*10]
data = [["first test with pango tables", "seems to work correctly"],
["though it needs", "support for borders and spans"]]
table = Table (cr, sizes, data, pango.FontDescription ("Sans 12"))
cr.rectangle (0, 0, pango.PIXELS(table.get_width ()), pango.PIXELS(table.get_height()))
cr.set_source_rgb (0.8, 0.8, 0.8)
cr.fill ()
cr.set_source_rgb (0, 0, 0)
table.show_table (cr)
cr.translate (0, 200)
cr.rectangle (0, 0, pango.PIXELS(table.get_width ()), pango.PIXELS(table.get_height()))
cr.set_source_rgb (0.4, 0.5, 0.7)
cr.fill ()
cr.set_source_rgb (0, 0, 0)
table.show_table (cr)
Here's the result test.pdf:

Monday, May 18, 2009
Blogging from Epiphany WebKit
Hello,
I've been using Midori for a while. It's a great browser: innovative and light. However all my bookmarks and data are in Epiphany. Last week the new epiphany-webkit version has been uploaded in Debian Sid and I couldn't wait to test it. I'm currently using it instead of gecko; it has still some issues but I begun living without it.
I've been using Midori for a while. It's a great browser: innovative and light. However all my bookmarks and data are in Epiphany. Last week the new epiphany-webkit version has been uploaded in Debian Sid and I couldn't wait to test it. I'm currently using it instead of gecko; it has still some issues but I begun living without it.

Sunday, April 26, 2009
Create a GdkPixbuf from cairo surface
Hello,
here's the inverted code snippet of the previous post.
here's the inverted code snippet of the previous post.
w, h = surface.get_width(), surface.get_height()
pixmap = gtk.gdk.Pixmap (None, w, h, 24)
cr = pixmap.cairo_create ()
cr.set_source_surface (surface, 0, 0)
cr.paint ()
pixbuf = gtk.gdk.Pixbuf (gtk.gdk.COLORSPACE_RGB, True, 8, w, h)
pixbuf = pixbuf.get_from_drawable (pixmap, gtk.gdk.colormap_get_system(), 0, 0, 0, 0, w, h)
Saturday, April 25, 2009
Create a cairo surface from a pixbuf
Hello,
sometimes in the code of a couple of projects I see some hard algorithms to transform a pixbuf in a cairo surface.
Maybe most of people don't know that GdkCairoContext, contrarily to cairo_t, is created against a cairo context not a cairo surface:
Notice gtk.gdk.CairoContext (cr), which cr is not the surface. That's the key of the code snippet.
For instance this can be applied on a ClutterCairoTexture to render pixbufs in the canvas.
sometimes in the code of a couple of projects I see some hard algorithms to transform a pixbuf in a cairo surface.
Maybe most of people don't know that GdkCairoContext, contrarily to cairo_t, is created against a cairo context not a cairo surface:
surface = cairo.ImageSurface (cairo.FORMAT_ARGB32, pixbuf.get_width(), pixbuf.get_height())
cr = cairo.Context (surface)
gdkcr = gtk.gdk.CairoContext (cr)
gdkcr.set_source_pixbuf (pixbuf)
gdkcr.paint ()
Notice gtk.gdk.CairoContext (cr), which cr is not the surface. That's the key of the code snippet.
For instance this can be applied on a ClutterCairoTexture to render pixbufs in the canvas.
Friday, February 27, 2009
Awesome/other wrong keyboard layout
Hello,
due to the high resource usage by Eclipse (I have to use that unfortunately because of my professor) I've temporarly dropped GNOME and now I'm using Awesome for a while.
Ok let's say the problem: the keyboard. Do you have different languages, layouts and so on among several configurations (GNOME, X, ...) and your keyboard layout is messed up with awesome?
Just do it:
Where YOURLAYOUT for me is it.
I've found this utility in this mailing thread. Yet you can read that awesome is still too young and lacks some keyboard configuration features.
Have fun!
due to the high resource usage by Eclipse (I have to use that unfortunately because of my professor) I've temporarly dropped GNOME and now I'm using Awesome for a while.
Ok let's say the problem: the keyboard. Do you have different languages, layouts and so on among several configurations (GNOME, X, ...) and your keyboard layout is messed up with awesome?
Just do it:
setxkbmap -layout YOURLAYOUT
Where YOURLAYOUT for me is it.
I've found this utility in this mailing thread. Yet you can read that awesome is still too young and lacks some keyboard configuration features.
Have fun!
Tuesday, February 24, 2009
JMF and MPEG
Hello,
I'm recently writing a game with Java AWT/Swing/SwingX/JMF for a university exam.
If you are using the Java Media Framework and most of the formats (all the well known and used formats) can't be handled by the library here's your definitive solution to the problem.
You will usually get "Unable to handle format: MPEG" or something like that.
How do you get rid of that and make things work? There's a great plugin named jffmpeg which handles a huge number of audio and video formats (including ogg/vob).
Just follow the instructions on the project website to install the plugins.
Alternatively you can register only the codec and demux you use from within your application code as follows (e.g. only handle MPEG video format on input):
I'm recently writing a game with Java AWT/Swing/SwingX/JMF for a university exam.
If you are using the Java Media Framework and most of the formats (all the well known and used formats) can't be handled by the library here's your definitive solution to the problem.
You will usually get "Unable to handle format: MPEG" or something like that.
How do you get rid of that and make things work? There's a great plugin named jffmpeg which handles a huge number of audio and video formats (including ogg/vob).
Just follow the instructions on the project website to install the plugins.
Alternatively you can register only the codec and demux you use from within your application code as follows (e.g. only handle MPEG video format on input):
Format[] inFormats = { new VideoFormat ("MPEG") };
PlugInManager.addPlugIn ("net.sourceforge.jffmpeg.VideoDecoder", inFormats, null, PlugInManager.CODEC);
PlugInManager.commit ();
Saturday, January 10, 2009
FreeSpeak 0.3.0 has been released
FreeSpeak is a free (as in freedom, developed and released under the terms of GPL) frontend to online translator engines (such as Google, Yahoo, etc.). It is written in Python, it uses the GTK toolkit and some GNOME infrastructure features.
This is a major enhancemenfts release.

Overview of Changes from FreeSpeak 0.2.0 to FreeSpeak 0.3.0
===========================================================
* Project is now hosted at BerliOS.de: http://freespeak.berlios.de
* Support for cancellating operations has been added
* Translation suggestions (open-tran) have been added
* A menubar has been added and the toolbar has been cleaned up
* The behavior of language/translation selection has been fixed and improved
* GNOME documentation has been added
* Dependencies in the configuration have been cleaned up
* Support for global keybindings has been added through python-xlib
* An introduction widget for the main window has been created
This is a major enhancemenfts release.
Overview of Changes from FreeSpeak 0.2.0 to FreeSpeak 0.3.0
===========================================================
* Project is now hosted at BerliOS.de: http://freespeak.berlios.de
* Support for cancellating operations has been added
* Translation suggestions (open-tran) have been added
* A menubar has been added and the toolbar has been cleaned up
* The behavior of language/translation selection has been fixed and improved
* GNOME documentation has been added
* Dependencies in the configuration have been cleaned up
* Support for global keybindings has been added through python-xlib
* An introduction widget for the main window has been created
Friday, December 26, 2008
Mailbox-to-mbox
Hello,
lately I've been looking for a way to convert a mailman archive to an mbox format so that I could open with mutt.
I then found a couple of scripts, but the one I've found simpler and working for my needs is mailbox2mbox.pl.
Sample usage:
And it simply works!
Does anybody know a method as simple as the above one but more powerful?
PS: Happy holidays!
lately I've been looking for a way to convert a mailman archive to an mbox format so that I could open with mutt.
I then found a couple of scripts, but the one I've found simpler and working for my needs is mailbox2mbox.pl.
Sample usage:
$ gunzip YourArchive.txt.gz
$ perl mailbox2mbox.pl < YourArchive.txt > mbox
$ mutt -f mbox
And it simply works!
Does anybody know a method as simple as the above one but more powerful?
PS: Happy holidays!
Sunday, December 21, 2008
Global keybinding on X
Hello,
lately I've been looking for a way to create a desktop-wide keybinding for FreeSpeak.
I first looked into Tomboy and Deskbar source codes but the egg was too huge to be adopted, and it would have brought C dependency which isn't always nice for a Python project.
Then fargiolas pointed me to a blog post where I could find about gnome keybindings owned by gnome control center. Well that was only a mirage as it doesn't really grab the key but it's only a visual entry in the keyboard shortcuts preferences.
After a few days I've finally found a not-so-hackish solution in about one hundred lines of Python code.
Here is the snippet (download), only using Xlib and GTK+ Python bindings.
Sample usage:
The only problem is that it doesn't make use of GDK filters because PyGTK doesn't provide such function wrappers and there's no GDK-to-Xlib mapping available.
But yes, it works very good.
lately I've been looking for a way to create a desktop-wide keybinding for FreeSpeak.
I first looked into Tomboy and Deskbar source codes but the egg was too huge to be adopted, and it would have brought C dependency which isn't always nice for a Python project.
Then fargiolas pointed me to a blog post where I could find about gnome keybindings owned by gnome control center. Well that was only a mirage as it doesn't really grab the key but it's only a visual entry in the keyboard shortcuts preferences.
After a few days I've finally found a not-so-hackish solution in about one hundred lines of Python code.
Here is the snippet (download), only using Xlib and GTK+ Python bindings.
Sample usage:
def callback (keybinding):
print 'Callback!'
gtk.main_quit ()
gtk.gdk.threads_init ()
keybinding = GlobalKeyBinding ("/apps/appdir", "key_binding")
keybinding.connect ('activate', callback)
keybinding.grab ()
keybinding.start ()
gtk.main ()
The only problem is that it doesn't make use of GDK filters because PyGTK doesn't provide such function wrappers and there's no GDK-to-Xlib mapping available.
But yes, it works very good.
Monday, December 01, 2008
Aptitude-gtk progress
Hello,
I was curious to see if aptitude-gtk was making some progress. I haven't followed the project since it's been merged into aptitude.
Well, I found it more functional and complete. Here's a screenshot showing pending packages for upgrade after an update:
The team is definitely doing a good job. Hopefully I'll find the time to give some help as I'm really interested in such full-featured GUI frontend.
Keep going on!
I was curious to see if aptitude-gtk was making some progress. I haven't followed the project since it's been merged into aptitude.
Well, I found it more functional and complete. Here's a screenshot showing pending packages for upgrade after an update:
![]() |
From GNOME |
The team is definitely doing a good job. Hopefully I'll find the time to give some help as I'm really interested in such full-featured GUI frontend.
Keep going on!
Sunday, November 30, 2008
FreeSpeak gains translation suggestions
Hello,
it hasn't been a long time since FreeSpeak 0.2.0 has been released. One of the TODOs for the next release was to support open-tran, and more over translation suggestions for development.
This is a screenshot of what's been included in the repository today:
FreeSpeak is a GNOME frontend to online translator engines.
it hasn't been a long time since FreeSpeak 0.2.0 has been released. One of the TODOs for the next release was to support open-tran, and more over translation suggestions for development.
This is a screenshot of what's been included in the repository today:
![]() |
From GNOME |
Friday, November 28, 2008
FreeSpeak 0.2.0 has been released
after some work in these weeks now I have released a new version of FreeSpeak.
It's been rewritten almost from scratch so I think there's no need to post release notes here. Anyway you can always read what changed from the old version released a couple of years ago here.
Notice that the project homepage has been changed. The project has now moved to BerliOS.de.
Sunday, November 23, 2008
Replace GTK+ with Clutter for fun
Hello,
lately I was having fun with Clutter and Python. I've started by creating some Gtk-like widgets (such as GtkWindow, GtkBox, and GtkButton) in Clutter.
Well, this is the result... it's a simple example of a very poor toolkit, but it works:
Try it, it's only one .py file source code
lately I was having fun with Clutter and Python. I've started by creating some Gtk-like widgets (such as GtkWindow, GtkBox, and GtkButton) in Clutter.
Well, this is the result... it's a simple example of a very poor toolkit, but it works:
![]() |
Try it, it's only one .py file source code
Sunday, November 16, 2008
Single app instances, Python and DBus
Hello,
I'm working on FreeSpeak lately and I needed to run the application once per session, as it's got a trayicon and a notebook (maybe windows with an applet is better?)
I decided to use DBus for making the application run only a single instance; when you try to open it again it won't start another process, instead it will use the already running one.
This is how I would create a generic single app instance with dbus-python:
Let's suppose we want to present() the GtkWindow when the user tries to open another instance of the application:
Let's say we're running the Application for the first time, the loop begins and when it ends running is set to False, so gtk.gdk.notify_startup_complete() won't be called. Instead, if the application is already running, start() will be called on the remote object running the loop. The method then returns immediately so gtk.gdk.notify_startup_complete() will be called.
If you don't notify to the launcher that the startup is complete... guess what happens to your mouse and to your taskbar panel...
If the loop is running, the window is presented to the user with a little delay. If you don't use any timestamp, the UI interaction won't let the window have the time to be presented.
Of course, you can use DBus for many more things, like both setting options from the command line, as explained in the above code, and let other applications communicate with yours and viceversa.
Nowadays almost all systems use DBus, so it won't be a pain to add such dependency. In my opinion, it would be much more painful to use lock files, FIFO, unix sockets or whatever. FreeSpeak used such old technologies and it was a very poor emulation of what DBus already offers.
I'm working on FreeSpeak lately and I needed to run the application once per session, as it's got a trayicon and a notebook (maybe windows with an applet is better?)
I decided to use DBus for making the application run only a single instance; when you try to open it again it won't start another process, instead it will use the already running one.
This is how I would create a generic single app instance with dbus-python:
import dbusHow it works?
import dbus.bus
import dbus.service
import dbus.mainloop.glib
import gobject
class Application (dbus.service.Object):
def __init__ (self, bus, path, name):
dbus.service.Object.__init__ (self, bus, path, name)
self.loop = gobject.MainLoop ()
@dbus.service.method ("org.domain.YourApplication",
in_signature='a{sv}', out_signature='')
def start (self, options={}):
if self.loop.is_running ():
print 'instance already running'
else:
self.loop.run ()
dbus.mainloop.glib.DBusGMainLoop (set_as_default=True)
bus = dbus.SessionBus ()
request = bus.request_name ("org.domain.YourApplication", dbus.bus.NAME_FLAG_DO_NOT_QUEUE)
if request != dbus.bus.REQUEST_NAME_REPLY_EXISTS:
app = Application (bus, '/', "org.domain.YourApplication")
else:
object = bus.get_object ("org.domain.YourApplication", "/")
app = dbus.Interface (object, "org.domain.YourApplication")
# Get your options from the command line, e.g. with OptionParser
options = {'option1': 'value1'}
app.start (options)
- Setup the mainloop for dbus
- Request a session bus name, so that other applications (in our case another instance of the same application) can connect to it
- Create a new instance at path / if the bus name doesn't exist (so we are the primary owner). If it exists, then obtain the object from dbus and call the method on the remote Application object using the known interface.
- The Application.start method checks if it's already running then decide what to do in both situations.
Let's suppose we want to present() the GtkWindow when the user tries to open another instance of the application:
import dbusHow it works?
import dbus.bus
import dbus.service
import dbus.mainloop.glib
import gobject
import gtk
import gtk.gdk
import time
class Application (dbus.service.Object):
def __init__ (self, bus, path, name):
dbus.service.Object.__init__ (self, bus, path, name)
self.running = False
self.main_window = gtk.Window ()
self.main_window.show_all ()
@dbus.service.method ("org.domain.YourApplication",
in_signature='', out_signature='b')
def is_running (self):
return self.running
@dbus.service.method ("org.domain.YourApplication",
in_signature='a{sv}i', out_signature='')
def start (self, options, timestamp):
if self.is_running ():
self.main_window.present_with_time (timestamp)
else:
self.running = True
gtk.main ()
self.running = False
dbus.mainloop.glib.DBusGMainLoop (set_as_default=True)
bus = dbus.SessionBus ()
request = bus.request_name ("org.domain.YourApplication", dbus.bus.NAME_FLAG_DO_NOT_QUEUE)
if request != dbus.bus.REQUEST_NAME_REPLY_EXISTS:
app = Application (bus, '/', "org.domain.YourApplication")
else:
object = bus.get_object ("org.domain.YourApplication", "/")
app = dbus.Interface (object, "org.domain.YourApplication")
# Get your options from the command line, e.g. with OptionParser
options = {'option1': 'value1'}
app.start (options, int (time.time ()))
if app.is_running ():
gtk.gdk.notify_startup_complete ()
Let's say we're running the Application for the first time, the loop begins and when it ends running is set to False, so gtk.gdk.notify_startup_complete() won't be called. Instead, if the application is already running, start() will be called on the remote object running the loop. The method then returns immediately so gtk.gdk.notify_startup_complete() will be called.
If you don't notify to the launcher that the startup is complete... guess what happens to your mouse and to your taskbar panel...
If the loop is running, the window is presented to the user with a little delay. If you don't use any timestamp, the UI interaction won't let the window have the time to be presented.
Of course, you can use DBus for many more things, like both setting options from the command line, as explained in the above code, and let other applications communicate with yours and viceversa.
Nowadays almost all systems use DBus, so it won't be a pain to add such dependency. In my opinion, it would be much more painful to use lock files, FIFO, unix sockets or whatever. FreeSpeak used such old technologies and it was a very poor emulation of what DBus already offers.
Subscribe to:
Posts (Atom)