<?xml version="1.0" encoding="utf-8"?>
<!-- generator="wordpress/2.0.11" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>context switch</title>
	<link>http://log.emmanuelebassi.net</link>
	<description>Random babblings of a geek.</description>
	<pubDate>Fri, 10 Oct 2008 22:04:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>
	<language>en</language>
			<item>
		<title>Good Intentions/2</title>
		<link>http://log.emmanuelebassi.net/archives/2008/04/good-intentions2/</link>
		<comments>http://log.emmanuelebassi.net/archives/2008/04/good-intentions2/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 21:30:50 +0000</pubDate>
		<dc:creator>ebassi</dc:creator>
		
		<category>Hacking</category>

		<category>GNOME</category>

		<category>C</category>

		<category>developer</category>

		<category>gtk</category>

		<category>clutter</category>

		<category>crack</category>

		<category>json-glib</category>

		<category>glib</category>

		<guid isPermaLink="false">http://log.emmanuelebassi.net/archives/2008/04/good-intentions2/</guid>
		<description><![CDATA[gtk+: I&#8217;ve been working again on the RecentManager and in trunk you&#8217;ll see some new stuff, namely:

use GIO to determine the MIME type of a URI, on every platform supported
use the file monitoring API to avoid polling the storage file
add a GtkSettings property for clamping the recently used resources list to a 30 days limit

more [...]]]></description>
			<content:encoded><![CDATA[<p><strong>gtk+</strong>: I&#8217;ve been working again on the <a href="http://library.gnome.org/devel/gtk/stable/GtkRecentManager.html">RecentManager</a> and in <code>trunk</code> you&#8217;ll see some new stuff, namely:</p>
<ul>
<li>use GIO to determine the MIME type of a URI, on every platform supported</li>
<li>use the file monitoring API to avoid polling the storage file</li>
<li>add a GtkSettings property for clamping the recently used resources list to a 30 days limit</li>
</ul>
<p>more stuff I&#8217;d like to add is:</p>
<ul>
<li>small parser changes to <a href="http://library.gnome.org/devel/glib/stable/glib-Bookmark-file-parser.html">GBookmarkFile</a>, to reflect changes in the spec</li>
<li>bulk addition, for applications storing multiple items when quitting</li>
<li>new API needed to follow the usability review in bug <a href="http://bugzilla.gnome.org/show_bug.cgi?id=349541">349541</a></li>
<li>moving the RecentItem icon code to GIO, and add API to extract the thumbnail</li>
</ul>
<p><strong>twitter</strong>: I&#8217;ve been using <a href="http://twitter.com">Twitter</a> a lot in the past two weeks; it&#8217;s nice, it makes it easier to copy and paste a quote or a thought, and the 160 characters limit is an interesting challenge. As it&#8217;s been ages since I last wrote an application<sup><a href="#footnote-1-261" id="footnote-link-1-261" class="footnote-link footnote-identifier-link" title="lately all I&#8217;ve been doing was writing libraries">1</a></sup>, I decided to start writing a Twitter reader/writer &mdash; using <a href="http://www.gtk.org">GTK+</a>, <a href="http://www.clutter-project.org">Clutter</a> and Tidy; without much thinking, I opened gvim and started writing code in C<sup><a href="#footnote-2-261" id="footnote-link-2-261" class="footnote-link footnote-identifier-link" title="hey, that&#8217;s what I do for a living, it&#8217;s hard to switch off; plus, I could reuse some of the platform libraries">2</a></sup> &mdash; so, the obvious thing that happened was that I ended up writing a library <em>yet again</em> in order to use Twitter&#8217;s web API. luckily for me, libsoup has now a really nice API to work with; all you need is <code>GET</code> and <code>POST</code> to their RESTful API, retrieve the result, parse it through JSON-GLib, hide everything inside a new GObject and you have a wrapper around a web service. the application, you say? oh, I was sure I forgot something. well, it&#8217;s <a href="http://github.com/ebassi/tweet/tree/master">coming along</a> &mdash; it just needs some work still.
</p>
<ol start="1" class="footnotes"><li id="footnote-1-261" class="footnote">lately all I&#8217;ve been doing was writing libraries [<a href="#footnote-link-1-261" class="footnote-link footnote-back-link">&#8617;</a>]</li><li id="footnote-2-261" class="footnote">hey, that&#8217;s what I do for a living, it&#8217;s hard to switch off; plus, I could reuse some of the platform libraries [<a href="#footnote-link-2-261" class="footnote-link footnote-back-link">&#8617;</a>]</li></ol>]]></content:encoded>
			<wfw:commentRss>http://log.emmanuelebassi.net/archives/2008/04/good-intentions2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Failsafe</title>
		<link>http://log.emmanuelebassi.net/archives/2008/03/failsafe/</link>
		<comments>http://log.emmanuelebassi.net/archives/2008/03/failsafe/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 23:17:49 +0000</pubDate>
		<dc:creator>ebassi</dc:creator>
		
		<category>json-glib</category>

		<category>tests</category>

		<category>glib</category>

		<guid isPermaLink="false">http://log.emmanuelebassi.net/archives/2008/03/failsafe/</guid>
		<description><![CDATA[About JSON-GLib: things have gone quiet on that front, but lately I&#8217;ve resumed working on it1.
I decided to try the new GLib test framework that has landed in the 2.15 cycle; GLib and GTK+ are both already using it, and now a branch of JSON-GLib is GTest-powered. Setting it up is not hard - but [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://log.emmanuelebassi.net/archives/2008/03/the-laws-have-changed/">About</a> <a href="http://live.gnome.org/JsonGlib">JSON-GLib</a>: things have gone quiet on that front, but lately I&#8217;ve resumed working on it<sup><a href="#footnote-1-246" id="footnote-link-1-246" class="footnote-link footnote-identifier-link" title="In a couple of separate branches, for the time being, but when those are ready, they will be merged back into master and will be released as 0.6.0">1</a></sup>.</p>
<p>I decided to try the new GLib test framework that has landed in the 2.15 cycle; GLib and GTK+ are both already using it, and now a branch of JSON-GLib is GTest-powered. Setting it up is not hard - but it requires some changes in the build environment. The API is quite straightforward &mdash; just call:</p>
<pre>
  g_test_init (&amp;argc, &amp;argv, <span style="color:purple">NULL</span>);
</pre>
<p>inside your main, then add the test functions with:</p>
<pre>
  g_test_add_func (<span style="color:red">&#8220;/test-section/foo&#8221;</span>, test_function_foo);
  g_test_add_func (<span style="color:red">&#8220;/test-section/bar&#8221;</span>, test_function_bar);
</pre>
<p>and finally run the test using:</p>
<pre>
  <span style="color:orange">return</span> g_test_run ();
</pre>
<p>which will return the exit code used by the <code>gtester</code> program to determined whether the successfully test passed or not.</p>
<p>The test suite is built along with your library or application, but run only with <code>make check</code> and <code>make distcheck</code>. There&#8217;s also an automatic report generator which will dump an XML file with the results, which you can then parse to create HTML pages or other forms of report. The rest of the work is putting a set of pre-cooked declarations for the Makefile templates into the root of your project; including it in every Makefile.am file; create some <code>tests</code> directories; and dump there the test units. I bet that Anjuta or other IDEs with autotools support can be tweaked to do this stuff for you.</p>
<p>JSON-GLib is now using GTest to test the data types API (for the time being, Array and part of the Node) and the Parser behaviour; nothing very complicated, at first, but it&#8217;s good to have it all automated and a simple <code>make</code> away. Adding new test cases to exercise the whole API will be the priority in the next weeks.
</p>
<ol start="1" class="footnotes"><li id="footnote-1-246" class="footnote">In a couple of separate branches, for the time being, but when those are ready, they will be merged back into master and will be released as 0.6.0 [<a href="#footnote-link-1-246" class="footnote-link footnote-back-link">&#8617;</a>]</li></ol>]]></content:encoded>
			<wfw:commentRss>http://log.emmanuelebassi.net/archives/2008/03/failsafe/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
