<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-1353239644941812755</atom:id><lastBuildDate>Sun, 20 Dec 2009 21:48:18 +0000</lastBuildDate><title>kassoulet codelog</title><description>python | gtk | gnome | ubuntu</description><link>http://kassoulet.blogspot.com/</link><managingEditor>noreply@blogger.com (Gautier Portet)</managingEditor><generator>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-6320705707136349011</guid><pubDate>Wed, 20 May 2009 21:01:00 +0000</pubDate><atom:updated>2009-05-20T23:40:54.143+02:00</atom:updated><title>How to uninstall a python program, packaged with distutils (setup.py)</title><description>So you have installed a program by running something like &lt;code&gt;sudo setup.py install&lt;/code&gt; and want to remove it, without forgetting a file or mess with the system ?&lt;br /&gt;It's simple in fact. Install checkinstall. And run &lt;code&gt;sudo checkinstall python setup.py install&lt;/code&gt; to create a package for your system, and remove it with &lt;code&gt;dpkg -r NAME_OF_PACKAGE&lt;/code&gt;.&lt;br /&gt;Checkinstall is an handy tool, it replays the install procedure while inspecting what is being done, and creates a package doing the same thing. With uninstall.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-6320705707136349011?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2009/05/how-to-uninstall-python-program.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-3877606066202008060</guid><pubDate>Fri, 10 Apr 2009 18:40:00 +0000</pubDate><atom:updated>2009-04-10T21:39:42.968+02:00</atom:updated><title>Luc Besson contre la Joconde</title><description>"&lt;span class="texte2"&gt;&lt;span class="texte2"&gt;&lt;i&gt;On ne vole pas les tableaux au Louvre il me semble !&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;" -- Luc Besson&lt;br /&gt;&lt;br /&gt;Non, on n'a pas le droit de voler la Joconde...&lt;br /&gt;Mais on a le droit d'en avoir une photo.&lt;br /&gt;On a le droit de faire une copie de la photo.&lt;br /&gt;Et le droit de faire une copie de la copie de la photo.&lt;br /&gt;Et la Joconde est toujours en place, épatant non ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-3877606066202008060?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2009/04/luc-besson-contre-la-joconde.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-3933758249418793444</guid><pubDate>Sun, 01 Mar 2009 21:07:00 +0000</pubDate><atom:updated>2009-03-01T22:11:22.364+01:00</atom:updated><title>Nautilus-folder-actions</title><description>You want to add buttons in the Nautilus toolbar, all read from a custom file in the current view ?&lt;br /&gt;You want to add a button to launch "git gui" from your code folder ?&lt;br /&gt;So &lt;a href="http://github.com/kassoulet/nautilus-folder-actions"&gt;nautilus-folder-action&lt;/a&gt; is for you !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-3933758249418793444?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2009/03/nautilus-folder-actions.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-3309081433143337720</guid><pubDate>Thu, 26 Jun 2008 19:41:00 +0000</pubDate><atom:updated>2009-03-11T22:26:58.380+01:00</atom:updated><title>Auto Vectorize Decorator</title><description>&lt;pre&gt;&lt;br /&gt;def vectorize(f):&lt;br /&gt; """&lt;br /&gt; Allows a traditionnal python function to be called with&lt;br /&gt; iterables arguments.&lt;br /&gt;&lt;br /&gt; So when you call func([array]) it will do the iteration for you,&lt;br /&gt; call func() for each element in array, and return an array.&lt;br /&gt;&lt;br /&gt; All arguments must be iterable, if you want to pass something else,&lt;br /&gt; use a keyword argument.&lt;br /&gt;&lt;br /&gt; """&lt;br /&gt; def _vectorize(*args, **kwargs):&lt;br /&gt;     if not isiterable(args[0]):&lt;br /&gt;         return f(*args, **kwargs)&lt;br /&gt;     else:&lt;br /&gt;         return [f(*arg, **kwargs) for arg in zip(*args)]&lt;br /&gt; return _vectorize&lt;br /&gt;&lt;br /&gt;# to use it:&lt;br /&gt;&lt;br /&gt;@vectorize&lt;br /&gt;def my_func(arguments):&lt;br /&gt; # do something interesting, on ONE element.&lt;br /&gt;&lt;br /&gt;my_func(my_args)&lt;br /&gt;my_func(my_super_list_of_many_values)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-3309081433143337720?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2008/06/def-vectorizef-allows-traditionnal.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-8599649486524180946</guid><pubDate>Tue, 18 Mar 2008 15:53:00 +0000</pubDate><atom:updated>2008-03-18T17:10:22.536+01:00</atom:updated><title>Get a hash of a given module in python</title><description>This small function use the inspect and sha modules to return you a hash of the given module/class/function.&lt;br /&gt;Note that we only hash the bytecode, so only really modified &lt;span style="font-style: italic;"&gt;code&lt;/span&gt; will change the resulting hash.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import inspect&lt;br /&gt;&lt;br /&gt;def get_module_hash(root, obj=None, hash=None, verbose=False):&lt;br /&gt;   if not obj:&lt;br /&gt;       obj = root&lt;br /&gt;       if verbose:&lt;br /&gt;           print obj.__name__&lt;br /&gt;   if not hash:&lt;br /&gt;       import sha&lt;br /&gt;       hash = sha.new()&lt;br /&gt;&lt;br /&gt;   for member in inspect.getmembers(obj):&lt;br /&gt;       name, child = member&lt;br /&gt;&lt;br /&gt;       if inspect.ismodule(child):&lt;br /&gt;           if child.__name__.startswith(root.__name__):&lt;br /&gt;               if child != root:&lt;br /&gt;                   if verbose:&lt;br /&gt;                       print child.__name__&lt;br /&gt;                   hash = get_module_hash(root, child, hash, verbose)&lt;br /&gt;&lt;br /&gt;       if inspect.isclass(child):&lt;br /&gt;           if child.__module__.startswith(root.__name__):&lt;br /&gt;               if verbose:&lt;br /&gt;                   print '  ', child.__name__&lt;br /&gt;               hash = get_module_hash(root, child, hash, verbose)&lt;br /&gt;&lt;br /&gt;       if inspect.ismethod(child):&lt;br /&gt;           if verbose:&lt;br /&gt;               print '    ', child.__name__&lt;br /&gt;           hash.update(child.im_func.func_code.co_code)&lt;br /&gt;&lt;br /&gt;       if inspect.isfunction(child):&lt;br /&gt;           if root.__name__ in child.func_code.co_filename:&lt;br /&gt;               if verbose:&lt;br /&gt;                   print '  ', child.__name__&lt;br /&gt;               hash.update(child.func_code.co_code)&lt;br /&gt;   return hash&lt;br /&gt;&lt;br /&gt;hash = get_module_hash(yourmodule)&lt;br /&gt;print 'version hash:', hash.hexdigest()&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-8599649486524180946?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2008/03/get-hash-of-given-module-in-python.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-3551512555028106576</guid><pubDate>Tue, 12 Feb 2008 21:55:00 +0000</pubDate><atom:updated>2008-05-03T18:26:27.048+02:00</atom:updated><title>Dose2 - Now in fullscreen splendor</title><description>I love the Dose2 [1] demo by mfx, but I always wanted it to run in a better resolution, as it is fully vectorial. So here it is, finally you can run it in 1600x1200 if you dare!&lt;br /&gt;&lt;br /&gt;Download the sources [2], compile and run!&lt;br /&gt;&lt;br /&gt;You can try the following command line options:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;-fullscreen : obviously, switch to fullscreen.&lt;/li&gt;&lt;li&gt;-stretch : use the current resolution.&lt;/li&gt;&lt;li&gt;-nofill : do not apply the magic xor - some kind of wireframe, search fillcopy() in main.c to see some f*cking clever code.&lt;/li&gt;&lt;li&gt;-WIDTHxHEIGHT : choose resolution. WIDTH and HEIGHT can be any size.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;[1] &lt;a href="http://pouet.net/prod.php?which=3289"&gt;http://pouet.net/prod.php?which=3289&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://kassoulet.free.fr/files/dose2_2008-05-03.tar.gz"&gt;http://kassoulet.free.fr/files/dose2_2008-05-03.tar.gz&lt;/a&gt; (new, 2x faster version!)&lt;br /&gt;&lt;br /&gt;Ed: Now also on &lt;a href="http://github.com/kassoulet/dose2/tree/master"&gt;github&lt;/a&gt;.&lt;br /&gt;Ed2: Backbuffer was blitted two times, new version is 2x faster in big resolutions!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-3551512555028106576?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2008/02/dose2-now-in-fullscreen-splendor.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-1266419014736128454</guid><pubDate>Wed, 23 Jan 2008 10:43:00 +0000</pubDate><atom:updated>2008-01-23T11:55:49.804+01:00</atom:updated><title>Splitting a mp3 album (mp3+cue) in separate files without recoding</title><description>So you have &lt;a href="http://www.demovibes.org"&gt;demovibes&lt;/a&gt; and you would like to have it with separate tracks so you can skip one?&lt;br /&gt;&lt;br /&gt;This is really simple, here is the magic command: &lt;span style="font-style: italic;"&gt;(in one line)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;mp3splt -c demovibes3.cue demovibes3-80mn_scene_music_compilation_mixed_by_willbe.mp3 -d demovibes3 -o @n-@p-@t&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Associer" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;You will need the nice &lt;a href="http://mp3splt.sourceforge.net"&gt;mp3splt&lt;/a&gt; of course, and it works also for ogg vorbis!&lt;br /&gt;If you want tags, you can extract them from filenames, with &lt;a href="http://easytag.sourceforge.net"&gt;easytag&lt;/a&gt; for example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-1266419014736128454?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2008/01/splitting-mp3-album-mp3cue-in-separate.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-368908017119662271</guid><pubDate>Wed, 05 Dec 2007 10:37:00 +0000</pubDate><atom:updated>2009-03-05T23:53:15.661+01:00</atom:updated><title>How to clear disk cache in Linux</title><description>&lt;pre&gt;&lt;br /&gt;sync ; sudo echo 3 | sudo tee /proc/sys/vm/drop_caches&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;em&gt;edit: better safe than sorry: flush caches before, as suggested...&lt;/em&gt;&lt;/small&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-368908017119662271?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2007/12/how-to-clear-disk-cache-in-linux.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>5</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-7173230351393889575</guid><pubDate>Mon, 30 Jul 2007 13:23:00 +0000</pubDate><atom:updated>2008-08-07T00:12:40.230+02:00</atom:updated><title>Vice Dual Sid patch</title><description>&lt;a href="http://kassoulet.free.fr/misc/vice-1.21_kassoulet.patch.gz"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Here&lt;/span&gt;&lt;/a&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;is&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;my&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;crappy&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;patch&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;to&lt;/span&gt; &lt;a href="http://www.viceteam.org/"&gt;Vice&lt;/a&gt; 1.21 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;to&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;add&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;my&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;special&lt;/span&gt; 6581 + 8580 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;stereo&lt;/span&gt; &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;output&lt;/span&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;You&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;can&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;listen&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;to&lt;/span&gt; &lt;a href="http://kassoulet.free.fr/?/blog/16-C64-Soundtracks"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;some&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;examples&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;After&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;applying&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;patch&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;you&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;will&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;just&lt;/span&gt; have &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;to&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;select&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;the&lt;/span&gt; dual &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;sid&lt;/span&gt; option (note &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;that&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;this&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;will&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;also disable&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;the&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;previous&lt;/span&gt; dual &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;sid&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;functionality&lt;/span&gt;). &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;You&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;will&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;now&lt;/span&gt; have &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;both&lt;/span&gt; 6581 and 8580 in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;separate channels&lt;/span&gt;, in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;real time&lt;/span&gt; and record mode. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;Enjoy&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;edit: &lt;a href="http://kassoulet.free.fr/misc/vice-2.0_dual-sid-stereo-by-kassoulet.patch.gz"&gt;updated patch for Vice 2.0&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-7173230351393889575?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2007/07/vice-dual-sid-patch.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-693990049900199162</guid><pubDate>Mon, 09 Jul 2007 14:43:00 +0000</pubDate><atom:updated>2007-07-09T17:01:34.101+02:00</atom:updated><title>Knights demos on youtube.</title><description>Yeah I encoded styler2 and schtroumpf2 and uploaded them on &lt;a href="http://www.youtube.com/user/kass0ulet"&gt;youtube&lt;/a&gt;.&lt;br /&gt;The quality is rather bad, I will upload high quality videos somewhere else soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-693990049900199162?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2007/07/knights-demos-on-youtube.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-8831439552601055319</guid><pubDate>Wed, 30 May 2007 23:50:00 +0000</pubDate><atom:updated>2007-05-31T01:54:58.154+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>python gtk pygtk</category><title>Faster ListStore</title><description>Your are wondering why ListStore.append() is so slow in your code?&lt;br /&gt;No more turtle-soft: disconnect the view and the store by doing TreeView.set_model(None), edit the ListStore, and then reconnect them.&lt;br /&gt;&lt;br /&gt;Tadaaa, this is just &lt;span style="font-style: italic;"&gt;thousands&lt;/span&gt; of time faster here...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-8831439552601055319?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2007/05/faster-liststore.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-5895273317740173924</guid><pubDate>Fri, 11 May 2007 16:39:00 +0000</pubDate><atom:updated>2007-05-11T19:15:10.395+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>dbus glib code</category><title>Returning a array of structs with dbus-glib</title><description>I was looking for an example on how to return an array of struct in a D-Bus program, and I found nothing. So here is a fast note for later reference.&lt;br /&gt;&lt;br /&gt;This is pseudo code, just to show you how to proceed.&lt;br /&gt;&lt;br /&gt;So you want to return a "a(si)", that's it, an array of struct containing each a string and an integer. &lt;br /&gt;&lt;br /&gt;in your example.xml: (process with dbus-binding-tool as usual)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;node name="/com/example/Example"&amp;gt;&amp;lt;/node&amp;gt;&lt;br /&gt;    &amp;lt;interface name="com.example.Example"&amp;gt;&amp;lt;/interface&amp;gt;&lt;br /&gt;        &amp;lt;method name="getExampleArray"&amp;gt;&amp;lt;/method&amp;gt;&lt;br /&gt;            &amp;lt;arg &lt;strong&gt;type="a(si)"&lt;/strong&gt; name="array" direction="out"&amp;gt;&amp;lt;/arg&amp;gt;&lt;br /&gt;  &amp;lt;/method&amp;gt;&lt;br /&gt; &amp;lt;/interface&amp;gt;&lt;br /&gt;&amp;lt;/node&amp;gt;  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;in your example.c:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;em&gt;// you define your structure here by using get_struct &lt;/em&gt;&lt;br /&gt;#define DBUS_STRUCT_STRING_INT (dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID))&lt;br /&gt;&lt;br /&gt;gboolean desktoptracks_get_example_array(DesktopTracks *obj, GPtrArray **stats_data, GError **error)&lt;br /&gt;{&lt;br /&gt;  &lt;em&gt;for ( each element you want to return )&lt;/em&gt;&lt;br /&gt;  {&lt;br /&gt;      &lt;em&gt;element_string , element_int = the element you want to return&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;      GValue *value;&lt;br /&gt;&lt;br /&gt;      value = g_new0 (GValue, 1);&lt;br /&gt;      g_value_init (value, DBUS_STRUCT_STRING_INT);&lt;br /&gt;      g_value_take_boxed (value, dbus_g_type_specialized_construct (DBUS_STRUCT_STRING_INT));&lt;br /&gt;&lt;br /&gt;      &lt;em&gt;// field number, value, G_MAXUINT at the end&lt;/em&gt;&lt;br /&gt;      dbus_g_type_struct_set (value, 0, element_string, 1, element_int, G_MAXUINT);&lt;br /&gt;      g_ptr_array_add (array, g_value_get_boxed (value));&lt;br /&gt;      g_free (value);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Easy uh ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-5895273317740173924?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2007/05/returning-complex-array-with-dbus-glib.html</link><author>noreply@blogger.com (Gautier Portet)</author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>7</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-4844535577809517244</guid><pubDate>Sat, 28 Apr 2007 14:20:00 +0000</pubDate><atom:updated>2007-04-28T19:39:05.430+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>python gstreamer soundconverter</category><title>SoundConverter 0.9.6</title><description>I've just uploaded a version, which fixes a stupid problem in one Makefile.am (No, there is no need for DESTDIR there :) ).&lt;br /&gt;&lt;br /&gt;Previous 0.9.5 version mainly fixed a problem with spaces in filenames when encoding to the same folder (Hell must be filled by escaped characters).&lt;br /&gt;&lt;br /&gt;And website look was updated as well!&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://soundconverter.berlios.de"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; cursor: pointer;" src="http://1.bp.blogspot.com/_zh-tyncWHcQ/RjNik4g4vwI/AAAAAAAAAAs/f8RdDTcPzys/s320/soundconverter.png" alt="" id="BLOGGER_PHOTO_ID_5058495192252333826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I think we are pretty close of a 1.0, we need more test, more polish and more love and we are done. And after 1.0 we will add some new features.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-4844535577809517244?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2007/04/soundconverter-096.html</link><author>noreply@blogger.com (Gautier Portet)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_zh-tyncWHcQ/RjNik4g4vwI/AAAAAAAAAAs/f8RdDTcPzys/s72-c/soundconverter.png' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1353239644941812755.post-3964647038000772695</guid><pubDate>Thu, 14 Dec 2006 10:44:00 +0000</pubDate><atom:updated>2006-12-14T17:03:17.265+01:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>gtk</category><category domain='http://www.blogger.com/atom/ns#'>gxiso</category><category domain='http://www.blogger.com/atom/ns#'>python</category><category domain='http://www.blogger.com/atom/ns#'>pygtk</category><title>gXiso website updated</title><description>I just updated the &lt;a href="http://gxiso.berlios.de/"&gt;gXiso website.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_zh-tyncWHcQ/RYEs9ZX19EI/AAAAAAAAAAM/gej_Vol1al4/s1600-h/gxiso_new_website.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer;" src="http://2.bp.blogspot.com/_zh-tyncWHcQ/RYEs9ZX19EI/AAAAAAAAAAM/gej_Vol1al4/s400/gxiso_new_website.png" alt="" id="BLOGGER_PHOTO_ID_5008333693907235906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I will maybe do some enhancements to this nice program soon, including a port to MacOSX.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1353239644941812755-3964647038000772695?l=kassoulet.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://kassoulet.blogspot.com/2006/12/gxiso-website-updated.html</link><author>noreply@blogger.com (Gautier Portet)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_zh-tyncWHcQ/RYEs9ZX19EI/AAAAAAAAAAM/gej_Vol1al4/s72-c/gxiso_new_website.png' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></item></channel></rss>