	
<?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"
	>

<channel>
	<title>Rubinium.org</title>
	<atom:link href="http://rubinium.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubinium.org/blog</link>
	<description>The Element of Aron and Heather</description>
	<pubDate>Fri, 01 Aug 2008 03:29:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Handlers Where Are You?</title>
		<link>http://rubinium.org/blog/archives/2008/07/31/handlers-where-are-you/</link>
		<comments>http://rubinium.org/blog/archives/2008/07/31/handlers-where-are-you/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 03:19:20 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Poly-Sigh]]></category>

		<category><![CDATA[fudge]]></category>

		<category><![CDATA[Lindsey Graham]]></category>

		<category><![CDATA[mccain]]></category>

		<category><![CDATA[oil rig]]></category>

		<category><![CDATA[sausage]]></category>

		<category><![CDATA[schmidts]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/?p=186</guid>
		<description><![CDATA[
Ok, first McCain does a speech in front of a green screen. Now I see him packing in his lunch with Lindsey Graham at Schmidt&#8217;s Sausage and Fudge Haus (not kidding). Of course that is probably better than air lifting onto a failing oil rig (doh).
]]></description>
			<content:encoded><![CDATA[<p><img src="http://rubinium.org/blog/wp-content/uploads/2008/07/sausage_and_fudge.jpg" alt="" title="Sausage and Fudge" width="485" height="363" class="aligncenter size-full wp-image-184" /></p>
<p>Ok, first McCain does a speech in front of a <a href="http://blog.wired.com/27bstroke6/2008/06/stephen-colbert.html">green screen</a>. Now I see him packing in his lunch with Lindsey Graham at <a href="http://www.youtube.com/watch?v=cumyghODHeU">Schmidt&#8217;s Sausage and Fudge Haus</a> (not kidding). Of course that is probably better than air lifting onto a failing oil rig (doh).</p>
]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/07/31/handlers-where-are-you/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gtk Pie Chart Widget</title>
		<link>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/</link>
		<comments>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 00:03:47 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[cairo]]></category>

		<category><![CDATA[chart]]></category>

		<category><![CDATA[graph]]></category>

		<category><![CDATA[gtk]]></category>

		<category><![CDATA[pie]]></category>

		<category><![CDATA[pie chart]]></category>

		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/?p=181</guid>
		<description><![CDATA[
I needed a pie chart widget for a project so I made one. I used cairo for rendering of course. This API has add_segment and remove_segment functions but I will change that to take a tree model. There are almost no options or style at this point which would obviously be important but I have [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://rubinium.org/blog/wp-content/uploads/2008/06/gtk_pie_chart_widget.jpg" title="Gtk Pie Chart Widget" /></p>
<p>I needed a pie chart widget for a project so I made one. I used <a href="http://cairographics.org">cairo</a> for rendering of course. This API has add_segment and remove_segment functions but I will change that to take a tree model. There are almost no options or style at this point which would obviously be important but I have got the basic outline down I think. I am considering writing an entire charting widget set. There are several packages focused on plotting but they are not presentation oriented.</p>
<p>Code Follows:</p>
<p><span id="more-181"></span></p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #808080; font-style: italic;">/*
 * Gtk Pie Chart Widget
 * Copyright (C) 2008 Aron Rubin
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 */</span>
&nbsp;
<span style="color: #339933;">#ifndef GTK_PIE_CHART_H_INCLUDED</span>
<span style="color: #339933;">#define GTK_PIE_CHART_H_INCLUDED</span>
&nbsp;
<span style="color: #339933;">#include &lt;gdk/gdk.h&gt;</span>
<span style="color: #339933;">#include &lt;gtk/gtkwidget.h&gt;</span>
&nbsp;
G_BEGIN_DECLS
&nbsp;
<span style="color: #339933;">#define GTK_PIE_CHART(obj)	   GTK_CHECK_CAST( obj, gtk_pie_chart_get_type(), GtkPieChart )</span>
<span style="color: #339933;">#define GTK_PIE_CHART_CLASS(klass) GTK_CHECK_CLASS_CAST( klass, gtk_pie_chart_get_type(), GtkPieChartClass )</span>
<span style="color: #339933;">#define GTK_IS_PIE_CHART(obj)	   GTK_CHECK_TYPE( obj, gtk_pie_chart_get_type() )</span>
&nbsp;
<span style="color: #993333;">typedef</span> <span style="color: #993333;">struct</span> GtkPieChart GtkPieChart;
<span style="color: #993333;">typedef</span> <span style="color: #993333;">struct</span> GtkPieChartClass GtkPieChartClass;
&nbsp;
<span style="color: #993333;">typedef</span> <span style="color: #993333;">struct</span> GtkPieSegment <span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">float</span> sweep;
  <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>name;
  <span style="color: #993333;">float</span> rgba<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span>;
<span style="color: #009900;">&#125;</span> GtkPieSegment;
&nbsp;
<span style="color: #993333;">struct</span> GtkPieChart <span style="color: #009900;">&#123;</span>
  GtkWidget base;
&nbsp;
  <span style="color: #993333;">int</span> width;
  <span style="color: #993333;">int</span> height;
&nbsp;
  <span style="color: #993333;">float</span> start_angle;
  <span style="color: #993333;">float</span> sweep_factor;
  <span style="color: #993333;">float</span> radius;
&nbsp;
  GList <span style="color: #339933;">*</span>segments;
<span style="color: #009900;">&#125;</span>;
&nbsp;
<span style="color: #993333;">struct</span> GtkPieChartClass <span style="color: #009900;">&#123;</span>
  GtkWidgetClass parent_class;
<span style="color: #009900;">&#125;</span>;
&nbsp;
GtkType gtk_pie_chart_get_type<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
GtkWidget <span style="color: #339933;">*</span>gtk_pie_chart_new<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
guint gtk_pie_chart_add_segment<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie, <span style="color: #993333;">float</span> sweep, <span style="color: #993333;">const</span> gchar <span style="color: #339933;">*</span>name, <span style="color: #993333;">float</span> <span style="color: #339933;">*</span>rgba <span style="color: #009900;">&#41;</span>;
<span style="color: #993333;">void</span> gtk_pie_chart_remove_segment<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie, guint id <span style="color: #009900;">&#41;</span>;
&nbsp;
G_END_DECLS
&nbsp;
<span style="color: #339933;">#endif</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #808080; font-style: italic;">/*
 * Gtk Pie Chart Widget
 * Copyright (C) 2008 Aron Rubin
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 */</span>
&nbsp;
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
<span style="color: #339933;">#include &lt;math.h&gt;</span>
<span style="color: #339933;">#include &lt;glib.h&gt;</span>
<span style="color: #339933;">#include &lt;glib-object.h&gt;</span>
<span style="color: #339933;">#include &lt;gtk/gtkwidget.h&gt;</span>
<span style="color: #339933;">#include &lt;cairo.h&gt;</span>
<span style="color: #339933;">#include &quot;gtk_pie_chart.h&quot;</span>
&nbsp;
<span style="color: #339933;">#define UNUSED __attribute__ ((unused))</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Properties</span>
<span style="color: #000000; font-weight: bold;">enum</span> <span style="color: #009900;">&#123;</span>
  PROP_0,
  PROP_START_ANGLE,
<span style="color: #009900;">&#125;</span>;
&nbsp;
<span style="color: #993333;">static</span> GtkWidgetClass <span style="color: #339933;">*</span>parent_class <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">NULL</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// object signals</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_class_init<span style="color: #009900;">&#40;</span> GtkPieChartClass <span style="color: #339933;">*</span>class <span style="color: #009900;">&#41;</span>;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_init<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie <span style="color: #009900;">&#41;</span>;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_finalize<span style="color: #009900;">&#40;</span> GObject <span style="color: #339933;">*</span>pie <span style="color: #009900;">&#41;</span>;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_set_property<span style="color: #009900;">&#40;</span> GObject <span style="color: #339933;">*</span>object, guint prop_id, <span style="color: #993333;">const</span> GValue <span style="color: #339933;">*</span>value, GParamSpec <span style="color: #339933;">*</span>pspec <span style="color: #009900;">&#41;</span>;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_get_property<span style="color: #009900;">&#40;</span> GObject <span style="color: #339933;">*</span>object, guint prop_id, GValue <span style="color: #339933;">*</span>value, GParamSpec <span style="color: #339933;">*</span>pspec <span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// widget signals</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_realize<span style="color: #009900;">&#40;</span> GtkWidget <span style="color: #339933;">*</span>pie <span style="color: #009900;">&#41;</span>;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_size_allocate<span style="color: #009900;">&#40;</span> GtkWidget <span style="color: #339933;">*</span>pie, GtkAllocation <span style="color: #339933;">*</span>allocation <span style="color: #009900;">&#41;</span>;
<span style="color: #993333;">static</span> gboolean gtk_pie_chart_expose<span style="color: #009900;">&#40;</span> GtkWidget <span style="color: #339933;">*</span>pie, GdkEventExpose <span style="color: #339933;">*</span>event <span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// internals</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**********************************************\
&nbsp;
         Section: GtkPieChart Methods
&nbsp;
\**********************************************/</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* ===========================================
&nbsp;
      Group: GtkPieChart Core Object Methods
&nbsp;
   =========================================== */</span>
&nbsp;
GtkType gtk_pie_chart_get_type<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">static</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> gtk_pie_chart_type <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>;
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>gtk_pie_chart_type <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    GtkTypeInfo gtk_pie_chart_info <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #ff0000;">&quot;GtkPieChart&quot;</span>,
      <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>GtkPieChart<span style="color: #009900;">&#41;</span>,
      <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>GtkPieChartClass<span style="color: #009900;">&#41;</span>,
      <span style="color: #009900;">&#40;</span>GtkClassInitFunc<span style="color: #009900;">&#41;</span>gtk_pie_chart_class_init,
      <span style="color: #009900;">&#40;</span>GtkObjectInitFunc<span style="color: #009900;">&#41;</span>gtk_pie_chart_init,
      <span style="color: #000000; font-weight: bold;">NULL</span>, <span style="color: #000000; font-weight: bold;">NULL</span>, <span style="color: #000000; font-weight: bold;">NULL</span>
    <span style="color: #009900;">&#125;</span>;
    gtk_pie_chart_type <span style="color: #339933;">=</span> gtk_type_unique<span style="color: #009900;">&#40;</span> GTK_TYPE_WIDGET, <span style="color: #339933;">&amp;</span>gtk_pie_chart_info <span style="color: #009900;">&#41;</span>;
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> gtk_pie_chart_type <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
GtkWidget <span style="color: #339933;">*</span>gtk_pie_chart_new<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieChart <span style="color: #339933;">*</span>pie;
  GtkWidget <span style="color: #339933;">*</span>widget;
&nbsp;
  pie <span style="color: #339933;">=</span> gtk_type_new<span style="color: #009900;">&#40;</span> gtk_pie_chart_get_type<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
  widget <span style="color: #339933;">=</span> GTK_WIDGET<span style="color: #009900;">&#40;</span>pie<span style="color: #009900;">&#41;</span>;
  widget<span style="color: #339933;">-</span>&gt;style <span style="color: #339933;">=</span> gtk_style_new<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">return</span> widget;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_class_init<span style="color: #009900;">&#40;</span> GtkPieChartClass <span style="color: #339933;">*</span>class <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GObjectClass <span style="color: #339933;">*</span>obj_class;
  GtkWidgetClass <span style="color: #339933;">*</span>wid_class;
&nbsp;
  obj_class <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>GObjectClass <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>class;
  wid_class <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>GtkWidgetClass <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>class;
  parent_class <span style="color: #339933;">=</span> gtk_type_class<span style="color: #009900;">&#40;</span> gtk_widget_get_type<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
  obj_class<span style="color: #339933;">-</span>&gt;finalize <span style="color: #339933;">=</span> gtk_pie_chart_finalize;
  obj_class<span style="color: #339933;">-</span>&gt;set_property <span style="color: #339933;">=</span> gtk_pie_chart_set_property;
  obj_class<span style="color: #339933;">-</span>&gt;get_property <span style="color: #339933;">=</span> gtk_pie_chart_get_property;
&nbsp;
  wid_class<span style="color: #339933;">-</span>&gt;realize <span style="color: #339933;">=</span> gtk_pie_chart_realize;
  wid_class<span style="color: #339933;">-</span>&gt;size_allocate <span style="color: #339933;">=</span> gtk_pie_chart_size_allocate;
  wid_class<span style="color: #339933;">-</span>&gt;expose_event <span style="color: #339933;">=</span> gtk_pie_chart_expose;
&nbsp;
  g_object_class_install_property<span style="color: #009900;">&#40;</span> obj_class, PROP_START_ANGLE,
                                  g_param_spec_double<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;start_angle&quot;</span>, <span style="color: #ff0000;">&quot;Start Angle&quot;</span>,
						       <span style="color: #ff0000;">&quot;The angle of the leading edge of the first segment.&quot;</span>,
						       <span style="color: #339933;">-</span>M_PI, M_PI, <span style="color: #cc66cc;">0</span>, G_PARAM_READWRITE <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_init<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_finalize<span style="color: #009900;">&#40;</span> GObject <span style="color: #339933;">*</span>pie <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// GObject Methods</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_set_property<span style="color: #009900;">&#40;</span> GObject <span style="color: #339933;">*</span>object, guint prop_id, <span style="color: #993333;">const</span> GValue <span style="color: #339933;">*</span>value, GParamSpec <span style="color: #339933;">*</span>pspec UNUSED <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieChart <span style="color: #339933;">*</span>pie;
&nbsp;
  pie <span style="color: #339933;">=</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span> prop_id <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">case</span> PROP_START_ANGLE<span style="color: #339933;">:</span> pie<span style="color: #339933;">-</span>&gt;start_angle <span style="color: #339933;">=</span> g_value_get_double<span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">break</span>;
  <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
    <span style="color: #000000; font-weight: bold;">break</span>;
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_get_property<span style="color: #009900;">&#40;</span> GObject <span style="color: #339933;">*</span>object, guint prop_id, GValue <span style="color: #339933;">*</span>value, GParamSpec <span style="color: #339933;">*</span>pspec <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieChart <span style="color: #339933;">*</span>pie;
&nbsp;
  pie <span style="color: #339933;">=</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">switch</span><span style="color: #009900;">&#40;</span> prop_id <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">case</span> PROP_START_ANGLE<span style="color: #339933;">:</span> g_value_set_int<span style="color: #009900;">&#40;</span> value, pie<span style="color: #339933;">-</span>&gt;start_angle <span style="color: #009900;">&#41;</span>; <span style="color: #000000; font-weight: bold;">break</span>;
  <span style="color: #b1b100;">default</span><span style="color: #339933;">:</span>
    G_OBJECT_WARN_INVALID_PROPERTY_ID<span style="color: #009900;">&#40;</span> object, prop_id, pspec <span style="color: #009900;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">break</span>;
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_set_size<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie, <span style="color: #993333;">int</span> width, <span style="color: #993333;">int</span> height <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  pie<span style="color: #339933;">-</span>&gt;width <span style="color: #339933;">=</span> width;
  pie<span style="color: #339933;">-</span>&gt;height <span style="color: #339933;">=</span> height;
&nbsp;
  pie<span style="color: #339933;">-</span>&gt;radius <span style="color: #339933;">=</span> fmin<span style="color: #009900;">&#40;</span> width, height <span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">0.33</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_update_segments<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">float</span> total_sweep <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0.0</span>;
  gboolean divide_remaining <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">FALSE</span>;
  GList <span style="color: #339933;">*</span>list;
&nbsp;
  g_return_if_fail<span style="color: #009900;">&#40;</span> GTK_IS_PIE_CHART<span style="color: #009900;">&#40;</span>pie<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
  list <span style="color: #339933;">=</span> pie<span style="color: #339933;">-</span>&gt;segments;
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> list <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>GtkPieSegment <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>list<span style="color: #339933;">-</span>&gt;data<span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span>&gt;sweep &gt; <span style="color: #cc66cc;">0.0</span> <span style="color: #009900;">&#41;</span>
      total_sweep <span style="color: #339933;">+=</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>GtkPieSegment <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>list<span style="color: #339933;">-</span>&gt;data<span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span>&gt;sweep;
    <span style="color: #b1b100;">else</span>
      divide_remaining <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">TRUE</span>;
    list <span style="color: #339933;">=</span> list<span style="color: #339933;">-</span>&gt;next;
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> total_sweep &gt; <span style="color: #cc66cc;">0.0</span> <span style="color: #009900;">&#41;</span>
    pie<span style="color: #339933;">-</span>&gt;sweep_factor <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100.0</span><span style="color: #339933;">/</span>total_sweep;
  <span style="color: #b1b100;">else</span>
    pie<span style="color: #339933;">-</span>&gt;sweep_factor <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1.0</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
guint gtk_pie_chart_add_segment<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie, <span style="color: #993333;">float</span> sweep, <span style="color: #993333;">const</span> gchar <span style="color: #339933;">*</span>name, <span style="color: #993333;">float</span> <span style="color: #339933;">*</span>rgba <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieSegment <span style="color: #339933;">*</span>segment;
&nbsp;
  g_return_val_if_fail<span style="color: #009900;">&#40;</span> GTK_IS_PIE_CHART<span style="color: #009900;">&#40;</span>pie<span style="color: #009900;">&#41;</span>, <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
  segment <span style="color: #339933;">=</span> g_new0<span style="color: #009900;">&#40;</span> GtkPieSegment, <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span>;
  g_return_val_if_fail<span style="color: #009900;">&#40;</span> segment, <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span>;
  segment<span style="color: #339933;">-</span>&gt;sweep <span style="color: #339933;">=</span> sweep;
  segment<span style="color: #339933;">-</span>&gt;name <span style="color: #339933;">=</span> g_strdup<span style="color: #009900;">&#40;</span> name <span style="color: #009900;">&#41;</span>;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> rgba <span style="color: #009900;">&#41;</span>
    memcpy<span style="color: #009900;">&#40;</span> segment<span style="color: #339933;">-</span>&gt;rgba, rgba, <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">float</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span>;
  pie<span style="color: #339933;">-</span>&gt;segments <span style="color: #339933;">=</span> g_list_append<span style="color: #009900;">&#40;</span> pie<span style="color: #339933;">-</span>&gt;segments, segment <span style="color: #009900;">&#41;</span>;
&nbsp;
  gtk_pie_chart_update_segments<span style="color: #009900;">&#40;</span> pie <span style="color: #009900;">&#41;</span>;
&nbsp;
  gtk_widget_queue_draw<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span>GtkWidget <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>pie <span style="color: #009900;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> g_list_length<span style="color: #009900;">&#40;</span> pie<span style="color: #339933;">-</span>&gt;segments <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> gtk_pie_chart_remove_segment<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie, guint id <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieSegment <span style="color: #339933;">*</span>segment;
  GList <span style="color: #339933;">*</span>segment_item;
&nbsp;
  g_return_if_fail<span style="color: #009900;">&#40;</span> GTK_IS_PIE_CHART<span style="color: #009900;">&#40;</span>pie<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
  segment_item <span style="color: #339933;">=</span> g_list_nth<span style="color: #009900;">&#40;</span> pie<span style="color: #339933;">-</span>&gt;segments, id <span style="color: #009900;">&#41;</span>;
  g_return_if_fail<span style="color: #009900;">&#40;</span> segment_item <span style="color: #339933;">&amp;&amp;</span> segment_item<span style="color: #339933;">-</span>&gt;data <span style="color: #009900;">&#41;</span>;
  segment <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>GtkPieSegment <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>segment_item<span style="color: #339933;">-</span>&gt;data;
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> segment<span style="color: #339933;">-</span>&gt;name <span style="color: #009900;">&#41;</span>
    g_free<span style="color: #009900;">&#40;</span> segment<span style="color: #339933;">-</span>&gt;name <span style="color: #009900;">&#41;</span>;
&nbsp;
  pie<span style="color: #339933;">-</span>&gt;segments <span style="color: #339933;">=</span> g_list_delete_link<span style="color: #009900;">&#40;</span> pie<span style="color: #339933;">-</span>&gt;segments, segment_item <span style="color: #009900;">&#41;</span>;
  g_free<span style="color: #009900;">&#40;</span> segment <span style="color: #009900;">&#41;</span>;
&nbsp;
  gtk_widget_queue_draw<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span>GtkWidget <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>pie <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_realize<span style="color: #009900;">&#40;</span> GtkWidget <span style="color: #339933;">*</span>widget <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieChart <span style="color: #339933;">*</span>pie;
  GdkWindowAttr attributes;
  <span style="color: #993333;">int</span> attributes_mask <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>;
&nbsp;
  g_return_if_fail<span style="color: #009900;">&#40;</span> widget <span style="color: #009900;">&#41;</span>;
  g_return_if_fail<span style="color: #009900;">&#40;</span> GTK_IS_PIE_CHART<span style="color: #009900;">&#40;</span>widget<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
  pie <span style="color: #339933;">=</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>widget<span style="color: #009900;">&#41;</span>;
  GTK_WIDGET_SET_FLAGS<span style="color: #009900;">&#40;</span> widget, GTK_REALIZED <span style="color: #009900;">&#41;</span>;
&nbsp;
  attributes.<span style="color: #202020;">x</span> <span style="color: #339933;">=</span> widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">x</span>;
  attributes.<span style="color: #202020;">y</span> <span style="color: #339933;">=</span> widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">y</span>;
  attributes.<span style="color: #202020;">width</span> <span style="color: #339933;">=</span> widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">width</span>;
  attributes.<span style="color: #202020;">height</span> <span style="color: #339933;">=</span> widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">height</span>;
&nbsp;
  attributes.<span style="color: #202020;">wclass</span> <span style="color: #339933;">=</span> GDK_INPUT_OUTPUT;
  attributes.<span style="color: #202020;">window_type</span> <span style="color: #339933;">=</span> GDK_WINDOW_CHILD;
  attributes.<span style="color: #202020;">event_mask</span> <span style="color: #339933;">=</span> gtk_widget_get_events<span style="color: #009900;">&#40;</span> widget <span style="color: #009900;">&#41;</span> | GDK_EXPOSURE_MASK;
  attributes.<span style="color: #202020;">visual</span> <span style="color: #339933;">=</span> gtk_widget_get_visual<span style="color: #009900;">&#40;</span> widget <span style="color: #009900;">&#41;</span>;
  attributes.<span style="color: #202020;">colormap</span> <span style="color: #339933;">=</span> gtk_widget_get_colormap<span style="color: #009900;">&#40;</span> widget <span style="color: #009900;">&#41;</span>;
&nbsp;
  attributes_mask <span style="color: #339933;">=</span> GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
  widget<span style="color: #339933;">-</span>&gt;window <span style="color: #339933;">=</span> gdk_window_new<span style="color: #009900;">&#40;</span> widget<span style="color: #339933;">-</span>&gt;parent<span style="color: #339933;">-</span>&gt;window, <span style="color: #339933;">&amp;</span>attributes, attributes_mask <span style="color: #009900;">&#41;</span>;
&nbsp;
  widget<span style="color: #339933;">-</span>&gt;style <span style="color: #339933;">=</span> gtk_style_attach<span style="color: #009900;">&#40;</span> widget<span style="color: #339933;">-</span>&gt;style, widget<span style="color: #339933;">-</span>&gt;window <span style="color: #009900;">&#41;</span>;
&nbsp;
  gdk_window_set_user_data<span style="color: #009900;">&#40;</span> widget<span style="color: #339933;">-</span>&gt;window, widget <span style="color: #009900;">&#41;</span>;
  gdk_window_set_background<span style="color: #009900;">&#40;</span> widget<span style="color: #339933;">-</span>&gt;window, widget<span style="color: #339933;">-</span>&gt;style<span style="color: #339933;">-</span>&gt;bg <span style="color: #009900;">&#41;</span>;
&nbsp;
  gtk_pie_chart_set_size<span style="color: #009900;">&#40;</span> pie, widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">width</span>, widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">height</span> <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> gtk_pie_chart_size_allocate<span style="color: #009900;">&#40;</span> GtkWidget <span style="color: #339933;">*</span>widget, GtkAllocation <span style="color: #339933;">*</span>allocation <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieChart <span style="color: #339933;">*</span>pie;
&nbsp;
  g_return_if_fail<span style="color: #009900;">&#40;</span> widget <span style="color: #009900;">&#41;</span>;
  g_return_if_fail<span style="color: #009900;">&#40;</span> GTK_IS_PIE_CHART<span style="color: #009900;">&#40;</span>widget<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
  g_return_if_fail<span style="color: #009900;">&#40;</span> allocation <span style="color: #009900;">&#41;</span>;
&nbsp;
  pie <span style="color: #339933;">=</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>widget<span style="color: #009900;">&#41;</span>;
&nbsp;
  widget<span style="color: #339933;">-</span>&gt;allocation <span style="color: #339933;">=</span> <span style="color: #339933;">*</span>allocation;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> GTK_WIDGET_REALIZED<span style="color: #009900;">&#40;</span>widget<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    gdk_window_move_resize<span style="color: #009900;">&#40;</span> widget<span style="color: #339933;">-</span>&gt;window, allocation<span style="color: #339933;">-</span>&gt;x, allocation<span style="color: #339933;">-</span>&gt;y, allocation<span style="color: #339933;">-</span>&gt;width, allocation<span style="color: #339933;">-</span>&gt;height <span style="color: #009900;">&#41;</span>;
&nbsp;
  gtk_pie_chart_set_size<span style="color: #009900;">&#40;</span> pie, widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">width</span>, widget<span style="color: #339933;">-</span>&gt;allocation.<span style="color: #202020;">height</span> <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">float</span> gtk_pie_chart_draw_segment<span style="color: #009900;">&#40;</span> GtkPieChart <span style="color: #339933;">*</span>pie, cairo_t <span style="color: #339933;">*</span>cr, GtkPieSegment <span style="color: #339933;">*</span>segment, <span style="color: #993333;">float</span> start <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">float</span> end <span style="color: #339933;">=</span> start <span style="color: #339933;">+</span> <span style="color: #808080; font-style: italic;">/* pie-&gt;sweep_factor* */</span> segment<span style="color: #339933;">-</span>&gt;sweep<span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2.0</span><span style="color: #339933;">*</span>M_PI<span style="color: #009900;">&#41;</span>;
  <span style="color: #993333;">float</span> mid <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>start <span style="color: #339933;">+</span> end<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">0.5</span>;
&nbsp;
  cairo_save<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
  <span style="color: #666666; font-style: italic;">//cairo_move_to( cr, pie-&gt;radius*cos( start*2*pi ), pie-&gt;radius*sin( start*(2.0*M_PI) ) )</span>
  cairo_move_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span>;
  cairo_line_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>cos<span style="color: #009900;">&#40;</span> start <span style="color: #009900;">&#41;</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>sin<span style="color: #009900;">&#40;</span> start <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
  cairo_arc<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span>, pie<span style="color: #339933;">-</span>&gt;radius, start, end <span style="color: #009900;">&#41;</span>;
  <span style="color: #666666; font-style: italic;">//cairo_arc_negative( cr, pie-&gt;width/2, pie-&gt;height/2, 0, end*(2.0*M_PI), start*(2.0*M_PI) );</span>
  cairo_close_path<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
&nbsp;
  cairo_set_line_width<span style="color: #009900;">&#40;</span> cr, <span style="color: #cc66cc;">1.0</span> <span style="color: #009900;">&#41;</span>;
  cairo_set_source_rgba<span style="color: #009900;">&#40;</span> cr, segment<span style="color: #339933;">-</span>&gt;rgba<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span>, segment<span style="color: #339933;">-</span>&gt;rgba<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span>, segment<span style="color: #339933;">-</span>&gt;rgba<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span>, segment<span style="color: #339933;">-</span>&gt;rgba<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span>  <span style="color: #009900;">&#41;</span>;
  cairo_fill_preserve<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
  cairo_set_source_rgba<span style="color: #009900;">&#40;</span> cr, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1.0</span> <span style="color: #009900;">&#41;</span>;
  cairo_stroke<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
&nbsp;
  cairo_move_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">0.5</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>cos<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">0.5</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>sin<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
  cairo_line_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1.3</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>cos<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1.3</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>sin<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> mid &gt; M_PI_2 <span style="color: #339933;">&amp;&amp;</span> mid &lt; <span style="color: #009900;">&#40;</span>M_PI_2 <span style="color: #339933;">+</span> M_PI<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    cairo_line_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">/</span><span style="color: #cc66cc;">6</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1.3</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>sin<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
  <span style="color: #b1b100;">else</span>
    cairo_line_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">*</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">6</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1.3</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>sin<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>;
  cairo_stroke<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
  cairo_restore<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
&nbsp;
  cairo_save<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> mid &gt; M_PI_2 <span style="color: #339933;">&amp;&amp;</span> mid &lt; <span style="color: #009900;">&#40;</span>M_PI_2 <span style="color: #339933;">+</span> M_PI<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    cairo_text_extents_t text_extents <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#125;</span>;
    cairo_text_extents<span style="color: #009900;">&#40;</span> cr, segment<span style="color: #339933;">-</span>&gt;name ? segment<span style="color: #339933;">-</span>&gt;name <span style="color: #339933;">:</span> <span style="color: #ff0000;">&quot;&quot;</span>, <span style="color: #339933;">&amp;</span>text_extents <span style="color: #009900;">&#41;</span>;
    cairo_move_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">/</span><span style="color: #cc66cc;">6</span> <span style="color: #339933;">-</span> text_extents.<span style="color: #202020;">width</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1.3</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>sin<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">4.0</span> <span style="color: #009900;">&#41;</span>;
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    cairo_move_to<span style="color: #009900;">&#40;</span> cr, pie<span style="color: #339933;">-</span>&gt;width<span style="color: #339933;">*</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">6</span>, pie<span style="color: #339933;">-</span>&gt;height<span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1.3</span><span style="color: #339933;">*</span>pie<span style="color: #339933;">-</span>&gt;radius<span style="color: #339933;">*</span>sin<span style="color: #009900;">&#40;</span> mid <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">4.0</span> <span style="color: #009900;">&#41;</span>;
  <span style="color: #009900;">&#125;</span>
  cairo_set_source_rgba<span style="color: #009900;">&#40;</span> cr, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1.0</span> <span style="color: #009900;">&#41;</span>;
  cairo_select_font_face<span style="color: #009900;">&#40;</span> cr, <span style="color: #ff0000;">&quot;sans&quot;</span>, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL <span style="color: #009900;">&#41;</span>;
  cairo_set_font_size<span style="color: #009900;">&#40;</span> cr, <span style="color: #cc66cc;">10.0</span> <span style="color: #009900;">&#41;</span>;
  cairo_show_text<span style="color: #009900;">&#40;</span> cr, segment<span style="color: #339933;">-</span>&gt;name ? segment<span style="color: #339933;">-</span>&gt;name <span style="color: #339933;">:</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span>;
  cairo_restore<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> end <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">int</span> gtk_pie_chart_expose<span style="color: #009900;">&#40;</span> GtkWidget <span style="color: #339933;">*</span>widget, GdkEventExpose <span style="color: #339933;">*</span>event <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  GtkPieChart <span style="color: #339933;">*</span>pie;
  cairo_t <span style="color: #339933;">*</span>cr;
  <span style="color: #666666; font-style: italic;">//GdkRectangle rect = { 0, 0, 0, 0 };</span>
  GList <span style="color: #339933;">*</span>list;
  <span style="color: #993333;">float</span> angle;
&nbsp;
  g_return_val_if_fail<span style="color: #009900;">&#40;</span> widget, <span style="color: #000000; font-weight: bold;">FALSE</span><span style="color: #009900;">&#41;</span>;
  g_return_val_if_fail<span style="color: #009900;">&#40;</span> GTK_IS_PIE_CHART<span style="color: #009900;">&#40;</span>widget<span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">FALSE</span> <span style="color: #009900;">&#41;</span>;
  pie <span style="color: #339933;">=</span> GTK_PIE_CHART<span style="color: #009900;">&#40;</span>widget<span style="color: #009900;">&#41;</span>;
&nbsp;
  cr <span style="color: #339933;">=</span> gdk_cairo_create<span style="color: #009900;">&#40;</span> widget<span style="color: #339933;">-</span>&gt;window <span style="color: #009900;">&#41;</span>;
&nbsp;
  cairo_save<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// expose area</span>
&nbsp;
  cairo_rectangle<span style="color: #009900;">&#40;</span> cr, event<span style="color: #339933;">-</span>&gt;area.<span style="color: #202020;">x</span>, event<span style="color: #339933;">-</span>&gt;area.<span style="color: #202020;">y</span>, event<span style="color: #339933;">-</span>&gt;area.<span style="color: #202020;">width</span>, event<span style="color: #339933;">-</span>&gt;area.<span style="color: #202020;">height</span> <span style="color: #009900;">&#41;</span>;
  cairo_clip<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
&nbsp;
  angle <span style="color: #339933;">=</span> pie<span style="color: #339933;">-</span>&gt;start_angle;
  list <span style="color: #339933;">=</span> pie<span style="color: #339933;">-</span>&gt;segments;
  <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> list <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    GtkPieSegment <span style="color: #339933;">*</span>segment <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>GtkPieSegment <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>list<span style="color: #339933;">-</span>&gt;data;
    angle <span style="color: #339933;">=</span> gtk_pie_chart_draw_segment<span style="color: #009900;">&#40;</span> pie, cr, segment, angle <span style="color: #009900;">&#41;</span>;
    list <span style="color: #339933;">=</span> list<span style="color: #339933;">-</span>&gt;next;
  <span style="color: #009900;">&#125;</span>
&nbsp;
  cairo_restore<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// expose area</span>
&nbsp;
  cairo_destroy<span style="color: #009900;">&#40;</span> cr <span style="color: #009900;">&#41;</span>;
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">FALSE</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/06/10/gtk-pie-chart-widget/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ACM Awards</title>
		<link>http://rubinium.org/blog/archives/2008/05/19/acm-awards/</link>
		<comments>http://rubinium.org/blog/archives/2008/05/19/acm-awards/#comments</comments>
		<pubDate>Tue, 20 May 2008 02:55:43 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Computer Science]]></category>

		<category><![CDATA[Music]]></category>

		<category><![CDATA[acm]]></category>

		<category><![CDATA[awards]]></category>

		<category><![CDATA[cnn]]></category>

		<category><![CDATA[country music]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/?p=179</guid>
		<description><![CDATA[
I noticed CNN is running an footage of this year&#8217;s ACM Awards. It looks like they managed to book some high profile country music singers for the ceremony.
]]></description>
			<content:encoded><![CDATA[<p><img src="http://rubinium.org/blog/wp-content/uploads/2008/05/acm_horning.jpg" alt="" title="ACM Awards" width="378" height="320" class="alignnone size-full wp-image-180" /></p>
<p>I noticed CNN is running an footage of this year&#8217;s <a href="http://awards.acm.org/html/awards.cfm">ACM Awards</a>. It looks like they managed to book some high profile <a href="http://news.google.com/news?q=acm+awards">country music</a> singers for the ceremony.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/05/19/acm-awards/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How South Park Ruins Things</title>
		<link>http://rubinium.org/blog/archives/2008/04/26/how-south-park-ruins-things/</link>
		<comments>http://rubinium.org/blog/archives/2008/04/26/how-south-park-ruins-things/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 16:08:03 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[HaHa Funny]]></category>

		<category><![CDATA[Our Little Bundles of...]]></category>

		<category><![CDATA[boo-boo]]></category>

		<category><![CDATA[healing]]></category>

		<category><![CDATA[jesse jackson]]></category>

		<category><![CDATA[kiss it]]></category>

		<category><![CDATA[parenting]]></category>

		<category><![CDATA[south park]]></category>

		<category><![CDATA[toddler]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/?p=176</guid>
		<description><![CDATA[
We taught my son that if gets a &#8220;boo-boo&#8221; all he has to do is get it kissed and everything feels all better. It has worked out really well. Instead of major crying fits he just walks up to us calmly presents the injured area and says &#8220;kiss it&#8221;. The problem is south park has [...]]]></description>
			<content:encoded><![CDATA[<p><embed src="http://media.mtvnservices.com/mgid:cms:item:southparkstudios.com:155469:" type="application/x-shockwave-flash" wmode="window" width="480" height="360" allowFullscreen="true" scriptAccess="always"></embed></p>
<p>We taught my son that if gets a &#8220;boo-boo&#8221; all he has to do is get it kissed and everything feels all better. It has worked out really well. Instead of major crying fits he just walks up to us calmly presents the injured area and says &#8220;kiss it&#8221;. The problem is south park has some prior art on a presentation of a body part and saying <a href="http://www.southparkstudios.com/clips/155469">&#8220;kiss it&#8221;</a>. I almost choked on a pretzel when he fell on his bottom and requested my healing powers.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/04/26/how-south-park-ruins-things/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pharoah&#8217;s Revenge</title>
		<link>http://rubinium.org/blog/archives/2008/04/22/pharoahs-revenge/</link>
		<comments>http://rubinium.org/blog/archives/2008/04/22/pharoahs-revenge/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 13:02:15 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[constipation]]></category>

		<category><![CDATA[matzah]]></category>

		<category><![CDATA[matzoh]]></category>

		<category><![CDATA[pharoah's revenge]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/?p=175</guid>
		<description><![CDATA[
For those who are not familiar, there is a tradition every year when millions of Jews wake up following holiday festivities and groan in pain. Passover is a kind of fast from low density (aka leavened) food. Our systems are not designed to deal with high-density food alone. There should be a section of the [...]]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="JibJabPlayer" width="440" height="370" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.jibjab.com/v/30977" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="http://www.jibjab.com/v/30977" loop="false" menu="false" quality="high" bgcolor="#C4C2AA" width="440" height="370" swliveconnect="true" id="JibJabPlayer" name="JibJabPlayer" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object></p>
<p>For those who are not familiar, there is a tradition every year when millions of Jews wake up following holiday festivities and groan in pain. Passover is a kind of fast from low density (aka leavened) food. Our systems are not designed to deal with high-density food alone. There should be a section of the haggadah dedicated to bathroom reading afterwards because you are going to be in there for a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/04/22/pharoahs-revenge/feed/</wfw:commentRss>
		</item>
		<item>
		<title>St Patricks Day If the Empire Had Won</title>
		<link>http://rubinium.org/blog/archives/2008/03/31/st-patricks-day-if-the-empire-had-won/</link>
		<comments>http://rubinium.org/blog/archives/2008/03/31/st-patricks-day-if-the-empire-had-won/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 00:21:47 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Computer Science]]></category>

		<category><![CDATA[HaHa Funny]]></category>

		<category><![CDATA[Linux and Systems]]></category>

		<category><![CDATA[empire]]></category>

		<category><![CDATA[image upload]]></category>

		<category><![CDATA[storm trooper]]></category>

		<category><![CDATA[vader]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/?p=171</guid>
		<description><![CDATA[ Well I was cruising for new feeds an I came across the flickr blog which had a nice bit of cognitive dissonance as you see above. Oh and I installed WP 2.5 and I wanted to try it out. Then I discovered that image uploads for a great many installs are broken in 2.5 [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a href="http://www.flickr.com/photos/mac_addict/2340725403"><img class="size-full wp-image-172" title="irish_troop" src="http://rubinium.org/blog/wp-content/uploads/2008/03/irish_troop.jpg" alt="Irish Storm Troop" width="478" height="290" /></a> Well I was cruising for new feeds an I came across the <a href="http://blog.flickr.net/en">flickr blog</a> which <a href="http://blog.flickr.net/en/2008/03/17/happy-st-patricks-day/">had</a> a nice bit of cognitive dissonance as you see above. Oh and I installed WP 2.5 and I wanted to try it out. Then I discovered that image uploads for a great many installs are broken in 2.5 including this site. I have also noticed some bugs with the editor like adding paragraphs breaks when I did not. Overall 2.5 has a far more organized than 2.3 and maintains compatibility with all the plugins that I use. I also like the plugin that fixes the image upload. I am not sure why we would need a flash based uploader anyway:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #666666; font-style: italic;">/*
Plugin Name: No Flash Uploader
Version: 1.0
Plugin URI: http://dd32.id.au/
Description: Disables the Flash Uploader of 2.5
Author: Dion Hulse
Author URI: http://dd32.id.au/
*/</span>
&nbsp;
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'flash_uploader'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'noflashuploader'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> noflashuploader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/03/31/st-patricks-day-if-the-empire-had-won/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Can&#8217;t Attack McCain, Go After Obama Instead</title>
		<link>http://rubinium.org/blog/archives/2008/02/18/cant-attack-mccain-go-after-obama-instead/</link>
		<comments>http://rubinium.org/blog/archives/2008/02/18/cant-attack-mccain-go-after-obama-instead/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 14:22:01 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Poly-Sigh]]></category>

		<category><![CDATA[global poverty]]></category>

		<category><![CDATA[mudslinging]]></category>

		<category><![CDATA[obama]]></category>

		<category><![CDATA[republican]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/archives/2008/02/18/cant-attack-mccain-go-after-obama-instead/</guid>
		<description><![CDATA[As yet another sign of who exactly is winning the primary election. Republican conservatives are conceiting to their obligation to now support the man standing (McCain). However, the RNC knows that the lackluster support for McCain is just not enough get out the vote. In order to even attempt to rally the base they need [...]]]></description>
			<content:encoded><![CDATA[<p>As yet another sign of who exactly is winning the primary election. Republican conservatives are conceiting to their obligation to now support the man standing (McCain). However, the RNC knows that the lackluster support for McCain is just not enough get out the vote. In order to even attempt to rally the base they need to make the Democrat contender seem sufficiently horrible. Time to fire up the faux-grassroots mudslinger. Sure enough, right after super-Tuesday blog traffic aimed at painting Obama as a socialist increased many fold. Comically at the same time Hillary continues to rail on Obama for not being a socialist in terms of health care plan or economics.</p>
<p>Presently the biggest story on these sites is a new senate bill cosponsored by Obama, Global Poverty Act. which calls our government to monitor whether we honoring promises made by president Bush in 2005 to the international community. It also calls for the development of a national strategy to deal with world wide poverty. Of course, the republican blogs have done a little name spin - &#8220;Global Poverty Tax&#8221; - and misrepresented what was being said. Not surprisingly I have not seen even one of these sites actually link to the bill itself. I will, <a href="http://www.govtrack.us/congress/billtext.xpd?bill=s110-2433">HERE</a> it is. Funny that a call for accountability would get so much criticism, huh. The bill describes one of the key vehicles for action on global poverty:</p>
<blockquote><p>Mobilizing and leveraging the participation of businesses, United States and international nongovernmental organizations, civil society, and public-private partnerships.</p></blockquote>
<p>It also reiterates the US goal in regard to poverty reduction:</p>
<blockquote><p>The official goal of United States foreign assistance is: `To help build and sustain democratic, well-governed states that respond to the needs of their people, reduce widespread poverty and conduct themselves responsibly in the international system.&#8217;.</p></blockquote>
<p>[sarcasm] Oh that sounds very out of line. [/sarcasm]</p>
]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/02/18/cant-attack-mccain-go-after-obama-instead/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rubinium Candidate Round-up</title>
		<link>http://rubinium.org/blog/archives/2008/01/18/rubinium-candidate-round-up/</link>
		<comments>http://rubinium.org/blog/archives/2008/01/18/rubinium-candidate-round-up/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 02:27:33 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[all things considered]]></category>

		<category><![CDATA[america]]></category>

		<category><![CDATA[battlestar]]></category>

		<category><![CDATA[economic stimulus]]></category>

		<category><![CDATA[npr]]></category>

		<category><![CDATA[obama]]></category>

		<category><![CDATA[romney]]></category>

		<category><![CDATA[thompson]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/archives/2008/01/18/rubinium-candidate-round-up/</guid>
		<description><![CDATA[
After hearing Obama and Thompson on NPR All Things Considered last night I felt the need to post some of my observations. You can really tell why Doug and I gravitate toward Thompson and Obama respectively. Both men project a distinct air of honesty about them. The responses to assertions that their lack of spin [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://rubinium.org/blog/wp-content/uploads/2008/01/bsg_candidates.jpg' title='BSG Candidates, Democrats'><img src='http://rubinium.org/blog/wp-content/uploads/2008/01/bsg_candidates_crop.jpg' alt='BSG Candidates, Democrats' /></a></p>
<p>After hearing Obama and Thompson on <a href="http://www.npr.org/templates/rundowns/rundown.php?prgId=2&#038;prgDate=17-Jan-08">NPR All Things Considered</a> last night I felt the need to post some of my observations. You can really tell why <a href="literalbarrage.org/blog">Doug</a> and I gravitate toward Thompson and Obama respectively. Both men project a distinct air of honesty about them. The responses to assertions that their lack of spin may be used against them were classic. Referring to the last debate, Obama said jokingly &#8220;yeah, maybe I should have answered that my greatest weakness is I help old ladies across the street.&#8221; In his interview Thompson jabbed &#8220;some people are more interested in style than substance [...] there is plenty of people for them to vote for too.</p>
<p><a href='http://rubinium.org/blog/wp-content/uploads/2008/01/rep_candidates.jpg' title='BSG Candidates, Republicans'><img src='http://rubinium.org/blog/wp-content/uploads/2008/01/rep_candidates_scrop.jpg' alt='BSG Candidates, Republicans' /></a></p>
<p>Obama and Thompson were both asked about a now inevitable economic stimulus package. Oddly enough both of them had a rather similar response which contrasts with their competitors. They said we should consider a one-time infusion of money into the economy by tacking it on to an existing vehicle. Tacking it on to an existing vehicle allows us to avoid potential pork and minimize bureaucratic skimming. Thompson was also prompted to mention not doing anything, which is where I personally lean right now.</p>
<p>I am actually pulling for Romney on the Republican side. It is time for them to know how we Dems felt with Kerry as our nominee. Actually comically enough he is pretty much like Kerry with an R. I did not make this video, but it sums:</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/PiCqxKLIVDY&#038;rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/PiCqxKLIVDY&#038;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/01/18/rubinium-candidate-round-up/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DMS to Decimal By Request</title>
		<link>http://rubinium.org/blog/archives/2008/01/17/dms-to-decimal-by-request/</link>
		<comments>http://rubinium.org/blog/archives/2008/01/17/dms-to-decimal-by-request/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 22:41:15 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[c]]></category>

		<category><![CDATA[degrees]]></category>

		<category><![CDATA[dms]]></category>

		<category><![CDATA[minutes]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/archives/2008/01/17/dms-to-decimal-by-request/</guid>
		<description><![CDATA[This is a function from my library that can be used to decode a degrees-minutes-seconds (DMS) string to a decimal degrees.
Enjoy.

/* ------------------------------
   Function: geo_dms_to_deg
     Parse a degrees-minutes-seconds (DMS) value string into a double floating
     point in degrees.
&#160;
   Parameters:
     str [...]]]></description>
			<content:encoded><![CDATA[<p>This is a function from my library that can be used to decode a degrees-minutes-seconds (DMS) string to a decimal degrees.<br />
Enjoy.</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #808080; font-style: italic;">/* ------------------------------
   Function: geo_dms_to_deg
     Parse a degrees-minutes-seconds (DMS) value string into a double floating
     point in degrees.
&nbsp;
   Parameters:
     str     - [in]  string containing an angle in DMS
     end_ptr - [out] a pointer to the character following the last in the DMS
     packed  - [in]  boolean whether to expect the DMS to lack delimiters
     value   - [out] value in degrees
&nbsp;
   Returns:
     true on success, false on failure
   ------------------------------ */</span>
<span style="color: #993333;">int</span> geo_dms_to_deg<span style="color: #009900;">&#40;</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>str, <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">**</span>endptr, <span style="color: #993333;">int</span> packed, <span style="color: #993333;">double</span> <span style="color: #339933;">*</span>value <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">int</span> d <span style="color: #339933;">=</span> <span style="color: #cc66cc;">-1</span>, m <span style="color: #339933;">=</span> <span style="color: #cc66cc;">-1</span>, s <span style="color: #339933;">=</span> <span style="color: #cc66cc;">-1</span>, pos <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>;
  <span style="color: #993333;">char</span> ps<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">20</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>, <span style="color: #339933;">*</span>ps_ptr;
  <span style="color: #993333;">float</span> p <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0.0</span>, fraction;
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> packed <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">char</span> format<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">64</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span>;
&nbsp;
    pos <span style="color: #339933;">=</span> strspn<span style="color: #009900;">&#40;</span> str, <span style="color: #ff0000;">&quot;0123456789&quot;</span> <span style="color: #009900;">&#41;</span>;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> pos &lt; <span style="color: #cc66cc;">5</span> || pos &gt; <span style="color: #cc66cc;">7</span> <span style="color: #009900;">&#41;</span>
      <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span>;
&nbsp;
    snprintf<span style="color: #009900;">&#40;</span> format, <span style="color: #cc66cc;">64</span>, <span style="color: #ff0000;">&quot;%%%dd%%2d%%2d%%n&quot;</span>, pos <span style="color: #339933;">-</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span>;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> sscanf<span style="color: #009900;">&#40;</span> str, format, <span style="color: #339933;">&amp;</span>d, <span style="color: #339933;">&amp;</span>m, <span style="color: #339933;">&amp;</span>s, <span style="color: #339933;">&amp;</span>pos <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">3</span> <span style="color: #009900;">&#41;</span>
      <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span>;
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> sscanf<span style="color: #009900;">&#40;</span> str, <span style="color: #ff0000;">&quot;%d:%d:%d.%[0123456789]%n&quot;</span>, <span style="color: #339933;">&amp;</span>d, <span style="color: #339933;">&amp;</span>m, <span style="color: #339933;">&amp;</span>s, ps, <span style="color: #339933;">&amp;</span>pos <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    p <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0.0</span>;
    fraction <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0.1</span>;
    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> ps_ptr <span style="color: #339933;">=</span> ps; <span style="color: #339933;">*</span>ps_ptr <span style="color: #339933;">!=</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\0</span>'</span>; ps_ptr<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      p <span style="color: #339933;">+=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">*</span>ps_ptr <span style="color: #339933;">-</span> <span style="color: #ff0000;">'0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span>fraction;
      fraction <span style="color: #339933;">*=</span> <span style="color: #cc66cc;">0.1</span>;
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> sscanf<span style="color: #009900;">&#40;</span> str, <span style="color: #ff0000;">&quot;%d:%d:%d%n&quot;</span>, <span style="color: #339933;">&amp;</span>d, <span style="color: #339933;">&amp;</span>m, <span style="color: #339933;">&amp;</span>s, <span style="color: #339933;">&amp;</span>pos <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">3</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/* empty */</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> sscanf<span style="color: #009900;">&#40;</span> str, <span style="color: #ff0000;">&quot;%d:%d%n&quot;</span>, <span style="color: #339933;">&amp;</span>d, <span style="color: #339933;">&amp;</span>m, <span style="color: #339933;">&amp;</span>pos <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    s <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>;
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> sscanf<span style="color: #009900;">&#40;</span> str, <span style="color: #ff0000;">&quot;%d%n&quot;</span>, <span style="color: #339933;">&amp;</span>d, <span style="color: #339933;">&amp;</span>pos <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    s <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>;
    m <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span>;
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span>;
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>d &lt; <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>m &lt; <span style="color: #cc66cc;">0</span> || m &gt;<span style="color: #339933;">=</span> <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>s &lt; <span style="color: #cc66cc;">0</span> || s &gt;<span style="color: #339933;">=</span> <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
&nbsp;
  <span style="color: #339933;">*</span>endptr <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>str<span style="color: #009900;">&#91;</span>pos<span style="color: #009900;">&#93;</span>;
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span>
    <span style="color: #339933;">*</span>value <span style="color: #339933;">=</span> d <span style="color: #339933;">+</span> m<span style="color: #339933;">/</span><span style="color: #cc66cc;">60.0</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>p <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">float</span><span style="color: #009900;">&#41;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">3600.0</span>;
&nbsp;
  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2008/01/17/dms-to-decimal-by-request/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Bubbles, Bubbles, Bubbles</title>
		<link>http://rubinium.org/blog/archives/2007/12/14/google-bubbles-bubbles-bubbles/</link>
		<comments>http://rubinium.org/blog/archives/2007/12/14/google-bubbles-bubbles-bubbles/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 14:14:27 +0000</pubDate>
		<dc:creator>A R Baboon</dc:creator>
		
		<category><![CDATA[Computer Science]]></category>

		<category><![CDATA[Work work work]]></category>

		<category><![CDATA[algorithm]]></category>

		<category><![CDATA[attraction]]></category>

		<category><![CDATA[auto-placement]]></category>

		<category><![CDATA[bubbles]]></category>

		<category><![CDATA[feature]]></category>

		<category><![CDATA[repulsion]]></category>

		<category><![CDATA[ui]]></category>

		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://rubinium.org/blog/archives/2007/12/14/google-bubbles-bubbles-bubbles/</guid>
		<description><![CDATA[ Google has added a feature to YouTube for navigation of related videos. Video bubbles are placed by attraction. If it works like our algorithm at work for displaying networks and flow graphs here&#8217;s the general idea behind the algorithm.  Videos with a higher relation ranking have bubbles which are assigned a higher attraction. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src='http://rubinium.org/blog/wp-content/uploads/2007/12/youtube_bubbles.jpg' alt='YouTube Bubbles' style="width:300px;height:195px;margin:0.5ex" /> Google has added a feature to <a href="http://youtube.com">YouTube</a> for navigation of related videos. Video bubbles are placed by attraction. If it works like our algorithm at work for displaying networks and flow graphs here&#8217;s the general idea behind the algorithm. <a href='http://www.atl.lmco.com/projects/csim/demos/autoplace/index.html' title='Node Auto Place'><img class="alignleft" src='http://rubinium.org/blog/wp-content/uploads/2007/12/tree8-3.jpg' alt='Node Auto Place' style="width:214px;height:155px;margin:0.5ex"/></a> Videos with a higher relation ranking have bubbles which are assigned a higher attraction. There is a certain amount of built-in repulsion to space all bubbles out. Then position is determined by summing all positions of other bubbles weighted by the attraction and repulsion values. Ok, so it is a bit more complicated than that when you consider all the optimizations weighting functions but thats the starting point.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubinium.org/blog/archives/2007/12/14/google-bubbles-bubbles-bubbles/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
