<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Came for the beer, stayed for the Freedom</title>
	<atom:link href="http://audidude.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://audidude.com</link>
	<description>Programming is not a spectator sport</description>
	<lastBuildDate>Thu, 17 May 2012 21:53:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>push-glib</title>
		<link>http://audidude.com/?p=602</link>
		<comments>http://audidude.com/?p=602#comments</comments>
		<pubDate>Thu, 17 May 2012 21:52:40 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[GLib]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=602</guid>
		<description><![CDATA[I needed to do some push notifications to Android and iOS, so I put together a library for doing so. It's early, but is functional thus far. No API guarantees, of course. C2DM still uses the (newly) deprecated Google ClientLogin authorization. I still need to do some research for moving that to the forward supported [...]]]></description>
			<content:encoded><![CDATA[<p>I needed to do some push notifications to Android and iOS, so I put together a library for doing so. It's early, but is functional thus far. No API guarantees, of course. C2DM still uses the (newly) deprecated Google ClientLogin authorization. I still need to do some research for moving that to the forward supported OAuth2 authorization. The APS client uses your TLS certificates registered with the app store. It speaks the "enhanced" protocol, which lets you know about errors. Occasionally. Sometimes. If you're lucky.</p>
<p><a href="https://github.com/downloads/chergert/push-glib/push-glib-0.1.9.tar.gz">Push-GLib-0.1.9</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=602</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mongo-glib</title>
		<link>http://audidude.com/?p=596</link>
		<comments>http://audidude.com/?p=596#comments</comments>
		<pubDate>Wed, 09 May 2012 22:04:58 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[GLib]]></category>
		<category><![CDATA[Gnome]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=596</guid>
		<description><![CDATA[I recently wanted to learn the mongo wire protocol so I could better understand how to optimize my queries. I'm not a huge fan of Mongo, but they do a few things well. Additionally, I wanted something that would eventually work with GObject Introspection so I have the same API in multiple languages.
Therefore, I started [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to learn the mongo wire protocol so I could better understand how to optimize my queries. I'm not a huge fan of Mongo, but they do a few things well. Additionally, I wanted something that would eventually work with <a href="http://live.gnome.org/GObjectIntrospection">GObject Introspection</a> so I have the same API in multiple languages.</p>
<p>Therefore, I started writing one. It takes a different approach than most of the drivers out there. Primarily, it uses the asynchronous model introduced in <a href="http://developer.gnome.org/gio/unstable/">GIO</a>. This of course adds some extra complexity, but allows you to pipeline some packets together which can be useful.</p>
<p>Additionally, there is a MongoBsonStream object that is useful for reading through a file that contains a stream of BSON documents sequentially. This is the wire format for mongodump. Therefore, if you want to do offline jobs against your mongo backups, this can be quite useful. I in fact use it to verify the BSON schema of our database offline, after backups have occurred.</p>
<p>I don't know what will end up happening with it, but here it is.</p>
<p><a href="https://github.com/downloads/chergert/mongo-glib/mongo-glib-0.1.9.tar.gz">Mongo-GLib-0.1.9</a></p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=596</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A moment to give thanks</title>
		<link>http://audidude.com/?p=584</link>
		<comments>http://audidude.com/?p=584#comments</comments>
		<pubDate>Fri, 23 Dec 2011 08:50:03 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=584</guid>
		<description><![CDATA[I'm offline for the next two weeks, visiting Morocco. The time away is quite welcomed. I don't celebrate religious holidays, but the end of the year does present a time to reflect on a year passed by. I wanted to celebrate a short list of people that have had a positive influence on me this [...]]]></description>
			<content:encoded><![CDATA[<p>I'm offline for the next two weeks, visiting Morocco. The time away is quite welcomed. I don't celebrate religious holidays, but the end of the year does present a time to reflect on a year passed by. I wanted to celebrate a short list of people that have had a positive influence on me this year, and that means something to me. This list is, by far, not comprehensive.</p>
<ul>
<li><a href="https://twitter.com/#!/ebassi">Emmanuele Bassi</a> for his hard work and dedication to bringing us a solid platform. Clutter, gtk+, glib, json-glib. Your attitude and ability to stay calm when surrounded by trolls does not go unnoticed.</li>
<li><a href="https://twitter.com/#!/hfiguiere">Hub Figuière</a> for never relenting to others revisionist history.</li>
<li><a href="https://twitter.com/#!/eqe">Andy Isaacson</a> for being 5 steps ahead of everyone else. Every conversation I have with you ends up in amazing stories, a history lesson, and what we can do to make it better. It is always inspiring.</li>
<li><a href="https://twitter.com/#!/wednesdaynight">Jacob Berkman</a> for the indistinguishable mix of charm and bad attitude. It was unforgettable working with you.</li>
<li><a href="">Hylke Bons</a> for taking the rudeness and undeserved aggression too often found in our community and continuing to produce quality.</li>
</ul>
<p><strong>Thank You!</strong></p>
<p><i>There are so many others, but I wanted to keep this list short.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=584</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Translucent Scrollbars</title>
		<link>http://audidude.com/?p=577</link>
		<comments>http://audidude.com/?p=577#comments</comments>
		<pubDate>Thu, 08 Dec 2011 23:33:41 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=577</guid>
		<description><![CDATA[While working on mock-ups and prototypes for Builder, I realized that I can't stand those clunky bars, and they need to go. 1/3rd will like the idea, 1/3 will say they prefer scrollbars, and a third will say I'm copying mac. Comments typically just put me into episodes of depression, so I'm not enabling them. [...]]]></description>
			<content:encoded><![CDATA[<p>While working on mock-ups and prototypes for <a href="https://live.gnome.org/ChristianHergert/Gnome3DX">Builder</a>, I realized that I can't stand those clunky bars, and they need to go. 1/3rd will like the idea, 1/3 will say they prefer scrollbars, and a third will say I'm copying mac. Comments typically just put me into episodes of depression, so I'm not enabling them. I think that's why I blog less, but that is a rant for another lifetime.</p>
<p><a href="http://www.youtube.com/watch?v=bNV8-evh-VY">http://www.youtube.com/watch?v=bNV8-evh-VY</a></p>
<p><img src="http://x.dronelabs.com/chris/blog/screenshots/scrollbars.png"/></p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=577</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>moving along &#8230;</title>
		<link>http://audidude.com/?p=575</link>
		<comments>http://audidude.com/?p=575#comments</comments>
		<pubDate>Tue, 31 May 2011 23:59:54 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=575</guid>
		<description><![CDATA[Today was my last day at VMware. I'm off to do another start-up.
]]></description>
			<content:encoded><![CDATA[<p>Today was my last day at VMware. I'm off to do another start-up.</p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=575</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I want GtkBuilder+JavaScript</title>
		<link>http://audidude.com/?p=565</link>
		<comments>http://audidude.com/?p=565#comments</comments>
		<pubDate>Sun, 24 Apr 2011 01:49:43 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=565</guid>
		<description><![CDATA[While having coffee with some friends a few weeks ago, I kept coming back to the thought that I need to be able to do small amounts of scripting within GtkBuilder. Especially if I'm going to switch to that from hard coding UIs in C. I figured it would take some hacking to GtkBuilder to [...]]]></description>
			<content:encoded><![CDATA[<p>While having coffee with some friends a few weeks ago, I kept coming back to the thought that I need to be able to do small amounts of scripting within GtkBuilder. Especially if I'm going to switch to that from hard coding UIs in C. I figured it would take some hacking to GtkBuilder to do what I wanted. Well, it turns out not. I came to the revelation late last night, in bed, and hacked it up this morning.</p>
<p>First, we create GScriptJs which is a thin wrapper around Gjs. Mostly, just to be able to create an object from within the GtkBuilder file. Then, we create a custom connect func that will look for a given function in the script and attach it to the requested signal. All in all, very few lines of code. I'm pleasantly surprised.</p>
<h3>Example GtkBuilder+JavaScript</h3>
<pre class="xml"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;interface<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;object</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;GScriptJs&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;script&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">const Gtk = imports.gi.Gtk;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function onClicked() {</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  let w = new Gtk.Window();</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  w.set_default_size(320, 240);</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  w.present();</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">}</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">function onQuit() {</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  Gtk.main_quit();</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">}</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/object<span style="font-weight: bold; color: black;">&gt;</span></span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;object</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;GtkWindow&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;window&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;signal</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;delete-event&quot;</span> <span style="color: #000066;">handler</span>=<span style="color: #ff0000;">&quot;onQuit&quot;</span> <span style="color: #000066;">swapped</span>=<span style="color: #ff0000;">&quot;no&quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div></li></ol></pre>
<h3>Example GtkBuilderConnectFunc</h3>
<pre class="c"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">static</span> <span style="color: #993333;">void</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">connect_func <span style="color: #66cc66;">&#40;</span>GtkBuilder    *builder,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">              GObject       *object,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">              <span style="color: #993333;">const</span> gchar   *signal_name,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">              <span style="color: #993333;">const</span> gchar   *handler_name,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">              GObject       *connect_object,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">              GConnectFlags  flags,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">              gpointer       user_data<span style="color: #66cc66;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #993333;">const</span> gchar *script_name = user_data;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	GScriptJs *script;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	GClosure *closure;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	g_return_if_fail<span style="color: #66cc66;">&#40;</span>script_name != <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	g_return_if_fail<span style="color: #66cc66;">&#40;</span>connect_object == <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">/* TODO */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	script = G_SCRIPT_JS<span style="color: #66cc66;">&#40;</span>gtk_builder_get_object<span style="color: #66cc66;">&#40;</span>builder, script_name<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!script<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		g_critical<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Cannot locate script %s&quot;</span>, script_name<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #b1b100;">return</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	closure = g_script_js_get_function<span style="color: #66cc66;">&#40;</span>script, handler_name<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!closure<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		g_critical<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Cannot locate function %s&quot;</span>, handler_name<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #b1b100;">return</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	g_signal_connect_closure<span style="color: #66cc66;">&#40;</span>object, signal_name, closure,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	                         !!<span style="color: #66cc66;">&#40;</span>flags &amp; G_CONNECT_AFTER<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></pre>
<p>Get the code at <a href="https://github.com/chergert/gtkbuilderscript">https://github.com/chergert/gtkbuilderscript</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=565</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Gom data mapper</title>
		<link>http://audidude.com/?p=546</link>
		<comments>http://audidude.com/?p=546#comments</comments>
		<pubDate>Sat, 26 Mar 2011 03:29:26 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[GObject]]></category>
		<category><![CDATA[gt]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=546</guid>
		<description><![CDATA[Sorry it has been so long. I've been trying to keep busy, playing with lots of new ideas to see what pans out. I guess I throw a lot of code away because of it.
Anyway, a while back I played with making a sort of data mapper. I figured it is time to post it [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry it has been so long. I've been trying to keep busy, playing with lots of new ideas to see what pans out. I guess I throw a lot of code away because of it.</p>
<p>Anyway, a while back I played with making a sort of data mapper. I figured it is time to post it here to see if anyone finds interest in it. Otherwise I'll just let it continue to bitrot. It lets you map GObjects to SQL or whatever. I've also only implemented sqlite. But it works okay for that so far. There are probably still a bunch of bugs or corner cases missing.</p>
<p>But it lets you do some fun stuff, like relations. It can handle basic properties, relations and groups, enums, etc etc. It does not do migrations.</p>
<h3>Defining a resource</h3>
<pre class="c"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #339933;">#include &quot;mock-gender.h&quot;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #339933;">#include &quot;mock-occupation.h&quot;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #339933;">#include &quot;mock-person.h&quot;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">GOM_DEFINE_RESOURCE<span style="color: #66cc66;">&#40;</span>MockPerson, mock_person,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                    GOM_RESOURCE_TABLE<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;persons&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                    GOM_RESOURCE_HAS_MANY<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;friends&quot;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Friends&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;The persons friends.&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          MOCK_TYPE_PERSON,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                    GOM_RESOURCE_BELONGS_TO<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;occupation&quot;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                            _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Occupation&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                            _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;The persons occupation.&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                            MOCK_TYPE_OCCUPATION,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                            <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                    GOM_RESOURCE_PROPERTY<span style="color: #66cc66;">&#40;</span>g_param_spec_uint64<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;id&quot;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Identifier&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;The persons identifier.&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              <span style="color: #cc66cc;">0</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              G_MAXUINT64,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              <span style="color: #cc66cc;">0</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              G_PARAM_READWRITE<span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          <span style="color: #ff0000;">&quot;key&quot;</span>, <span style="color: #000000; font-weight: bold;">TRUE</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          <span style="color: #ff0000;">&quot;serial&quot;</span>, <span style="color: #000000; font-weight: bold;">TRUE</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                    GOM_RESOURCE_PROPERTY<span style="color: #66cc66;">&#40;</span>g_param_spec_string<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;name&quot;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Name&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;The persons name.&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              <span style="color: #000000; font-weight: bold;">NULL</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                              G_PARAM_READWRITE<span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                    GOM_RESOURCE_PROPERTY<span style="color: #66cc66;">&#40;</span>g_param_spec_enum<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;gender&quot;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                            _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Gender&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                            _<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;The persons gender&quot;</span><span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                            MOCK_TYPE_GENDER,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                            MOCK_GENDER_UNKNOWN,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                                            G_PARAM_READWRITE<span style="color: #66cc66;">&#41;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                                          <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#41;</span>;</div></li></ol></pre>
<p>And no, you don't have to use the macros if you have something more complex.</p>
<h3>Saving a resource</h3>
<pre class="c"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">GomResource *resource;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">resource = g_object_new<span style="color: #66cc66;">&#40;</span>MOCK_TYPE_PERSON,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                        <span style="color: #ff0000;">&quot;adapter&quot;</span>, sqlite_adapter,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                        <span style="color: #ff0000;">&quot;name&quot;</span>, <span style="color: #ff0000;">&quot;Jane Doe&quot;</span>,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                        <span style="color: #ff0000;">&quot;gender&quot;</span>, MOCK_GENDER_FEMALE,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">                        <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">gom_resource_save<span style="color: #66cc66;">&#40;</span>resource, &amp;error<span style="color: #66cc66;">&#41;</span>;</div></li></ol></pre>
<p><a href="https://github.com/chergert/gom/">Get the code here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=546</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>smoother graphs coming</title>
		<link>http://audidude.com/?p=527</link>
		<comments>http://audidude.com/?p=527#comments</comments>
		<pubDate>Mon, 27 Dec 2010 03:39:31 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Gnome]]></category>
		<category><![CDATA[Gtk]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[graphing]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=527</guid>
		<description><![CDATA[I did a bit more work on the real-time graphs during my current vacation. It has resulted in being a whole lot smoother. Primary fixes were:

Graph tracks time rather than "available buckets" for data points. It works so much better I feel stupid for not doing it in the first place.
Use floating point for positioning [...]]]></description>
			<content:encoded><![CDATA[<p>I did a bit more work on the real-time graphs during my current vacation. It has resulted in being a whole lot smoother. Primary fixes were:</p>
<ul>
<li>Graph tracks time rather than "available buckets" for data points. It works so much better I feel stupid for not doing it in the first place.</li>
<li>Use floating point for positioning throughout pipeline until last possible step.</li>
<li>Render updates in thread and only blit to cairo xlib surface in main loop. This probably isn't technically safe at the moment as reference counting of images in libpixman aren't thread aware. However, it seems to work pretty well for a single rendering thread. Once that is fixed, we can scale up rendering to more threads (which helps a bit if you have a lot of visualizers in perfkit).</li>
<li>Not really a performance/smoothing fix, but the renderers are abstracted more from the graph. This means the visualizers and realtime graphs in perfkit share rendering code.</li>
</ul>
<p>It also now works on gtk+ 3.0. Obligatory screencast below.</p>
<p><object width="400" height="225"><param name="movie" value="http://www.youtube-nocookie.com/v/Yw88edHU18E?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/Yw88edHU18E?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object></p>
<p><a href="http://www.youtube.com/watch?v=Yw88edHU18E">http://www.youtube.com/watch?v=Yw88edHU18E</a></p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=527</wfw:commentRss>
		<slash:comments>2</slash:comments>
<enclosure url="http://x.dronelabs.com/chris/blog/screencasts/graphing2.mpg" length="1155072" type="video/mpeg" />
		</item>
		<item>
		<title>Things I&#8217;ve been working on</title>
		<link>http://audidude.com/?p=519</link>
		<comments>http://audidude.com/?p=519#comments</comments>
		<pubDate>Tue, 14 Dec 2010 06:45:14 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Gtk]]></category>
		<category><![CDATA[gtk animations]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=519</guid>
		<description><![CDATA[(Animations) ...



http://www.youtube.com/watch?v=lp6ceGP-6vU
http://www.youtube.com/watch?v=AlvieV-sBJo
http://www.youtube.com/watch?v=_koPfiJ2zn0
]]></description>
			<content:encoded><![CDATA[<p>(Animations) ...</p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390" src="http://www.youtube.com/embed/lp6ceGP-6vU?rel=0" frameborder="0"></iframe></p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390" src="http://www.youtube.com/embed/AlvieV-sBJo?rel=0" frameborder="0"></iframe></p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390"  src="http://www.youtube.com/embed/_koPfiJ2zn0?rel=0" frameborder="0"></iframe></p>
<p><a href="http://www.youtube.com/watch?v=lp6ceGP-6vU">http://www.youtube.com/watch?v=lp6ceGP-6vU</a><br />
<a href="http://www.youtube.com/watch?v=AlvieV-sBJo">http://www.youtube.com/watch?v=AlvieV-sBJo</a><br />
<a href="http://www.youtube.com/watch?v=_koPfiJ2zn0">http://www.youtube.com/watch?v=_koPfiJ2zn0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=519</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Visualizing main loop delays</title>
		<link>http://audidude.com/?p=514</link>
		<comments>http://audidude.com/?p=514#comments</comments>
		<pubDate>Tue, 30 Nov 2010 09:39:02 +0000</pubDate>
		<dc:creator>chergert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gtk]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[perfkit]]></category>

		<guid isPermaLink="false">http://audidude.com/?p=514</guid>
		<description><![CDATA[Ross suggested adding a feature to show when your main loop has been blocked. I borrowed some code from libsocialweb to do this. The orange blocks are periods of time when the main loop was delayed for more than 10 milliseconds. Probably useful for people trying to have high frame-rate/smooth animations.

]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.burtonini.com/blog">Ross</a> suggested adding a feature to show when your main loop has been blocked. I borrowed some code from libsocialweb to do this. The orange blocks are periods of time when the main loop was delayed for more than 10 milliseconds. Probably useful for people trying to have high frame-rate/smooth animations.</p>
<p><img src="http://x.dronelabs.com/chris/blog/screenshots/perfkit/mainloop.png"/></p>
]]></content:encoded>
			<wfw:commentRss>http://audidude.com/?feed=rss2&amp;p=514</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

