<?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>Centre of the Universe</title>
	<atom:link href="http://www.sergemeunier.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sergemeunier.com/blog</link>
	<description>The musings of a mad software developer</description>
	<lastBuildDate>Thu, 04 Mar 2010 05:43:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Better JavaScript error handling with DamnIT</title>
		<link>http://www.sergemeunier.com/blog/better-javascript-error-handling-with-damnit/</link>
		<comments>http://www.sergemeunier.com/blog/better-javascript-error-handling-with-damnit/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 05:43:41 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1669</guid>
		<description><![CDATA[We all know that the Internet is a mess, with different browsers implementing things differently, and generally making the life of web developers everywhere a nightmare.
Inevitably, bugs will get through no matter how hard we test, but we don&#8217;t always get the feedback we need to fix these issues.
Jupiter IT has released a service called [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/javascript-error-handling-idiosyncrasies/' rel='bookmark' title='Permanent Link: Javascript error handling idiosyncrasies'>Javascript error handling idiosyncrasies</a> <small>If there is one thing that can drive me insane...</small></li>
<li><a href='http://www.sergemeunier.com/blog/dygraphs-javascript-visualization-library/' rel='bookmark' title='Permanent Link: Dygraphs Javascript Visualization Library'>Dygraphs Javascript Visualization Library</a> <small>Drawing graphs has become simpler in Javascript, with the dygraphs...</small></li>
<li><a href='http://www.sergemeunier.com/blog/php-functionality-from-within-javascript/' rel='bookmark' title='Permanent Link: PHP functionality from within Javascript'>PHP functionality from within Javascript</a> <small>Most PHP programmers have to deal with Javascript in some...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>We all know that the Internet is a mess, with different browsers implementing things differently, and generally making the life of web developers everywhere a nightmare.</p>
<p>Inevitably, bugs will get through no matter how hard we test, but we don&#8217;t always get the feedback we need to fix these issues.</p>
<p><a href="http://jupiterit.com">Jupiter IT</a> has released a service called <a href="https://damnit.jupiterit.com/">DamnIT</a> , which you include in your JavaScript code, and then can get detailed error reports emailed to you whenever a user has done something that has caused an error to occur in the script.</p>
<p>I can see this saving the butt of many a web developer out there.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fbetter-javascript-error-handling-with-damnit%2F&amp;linkname=Better%20JavaScript%20error%20handling%20with%20DamnIT"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/javascript-error-handling-idiosyncrasies/' rel='bookmark' title='Permanent Link: Javascript error handling idiosyncrasies'>Javascript error handling idiosyncrasies</a> <small>If there is one thing that can drive me insane...</small></li>
<li><a href='http://www.sergemeunier.com/blog/dygraphs-javascript-visualization-library/' rel='bookmark' title='Permanent Link: Dygraphs Javascript Visualization Library'>Dygraphs Javascript Visualization Library</a> <small>Drawing graphs has become simpler in Javascript, with the dygraphs...</small></li>
<li><a href='http://www.sergemeunier.com/blog/php-functionality-from-within-javascript/' rel='bookmark' title='Permanent Link: PHP functionality from within Javascript'>PHP functionality from within Javascript</a> <small>Most PHP programmers have to deal with Javascript in some...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/better-javascript-error-handling-with-damnit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An entirely different world, just up the road from my house</title>
		<link>http://www.sergemeunier.com/blog/an-entirely-different-world-just-up-the-road-from-my-house/</link>
		<comments>http://www.sergemeunier.com/blog/an-entirely-different-world-just-up-the-road-from-my-house/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 06:48:29 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Politics]]></category>
		<category><![CDATA[Society]]></category>
		<category><![CDATA[South Africa]]></category>
		<category><![CDATA[Poverty]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1653</guid>
		<description><![CDATA[South Africa is an interesting country, and if you think you know completely it &#8211; even as a local you would be severely mistaken.
Yesterday, despite having lived in SA my whole life, I had my first experience of visiting one of our infamous townships (Du Noon), and despite the fact, that I literally live 2km [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/all-i-want-for-christmas-is-a-bullet-proof-vest/' rel='bookmark' title='Permanent Link: All I want for Christmas is a bullet-proof vest'>All I want for Christmas is a bullet-proof vest</a> <small>A few days ago, I saw an article which said...</small></li>
<li><a href='http://www.sergemeunier.com/blog/the-problem-with-south-african-genealogy/' rel='bookmark' title='Permanent Link: The problem with South African genealogy'>The problem with South African genealogy</a> <small>South Africans are a bunch of avid genealogists. So much...</small></li>
<li><a href='http://www.sergemeunier.com/blog/our-emigration-to-the-netherlands/' rel='bookmark' title='Permanent Link: Our emigration to the Netherlands'>Our emigration to the Netherlands</a> <small>It is now safe to do this, since I have...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>South Africa is an interesting country, and if you think you know completely it &#8211; even as a local you would be severely mistaken.</p>
<p>Yesterday, despite having lived in SA my whole life, I had my first experience of visiting one of our infamous townships (Du Noon), and despite the fact, that I literally live 2km away from Du Noon, it is like an entirely different world than what I am used to.<br />
<div id="attachment_1656" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.sergemeunier.com/blog/wp-content/uploads/2010/03/DuNoon.jpg"><img src="http://www.sergemeunier.com/blog/wp-content/uploads/2010/03/DuNoon.jpg" alt="Du Noon main road" title="Du Noon main road" width="500" height="280" class="size-full wp-image-1656" /></a><p class="wp-caption-text">Du Noon main road</p></div><br />
South Africa is one of the countries in the world with the largest difference between standards of living between the rich and the poor, and that was very apparent to me yesterday.</p>
<p> You have a small rich elite, who all drive snazzy new 4&#215;4&#8217;s, BMW&#8217;s and Mercs, who all live in big mansions. Then you have the struggling middle-class, who can barely afford to pay rent and keep food on the table (which we are firmly a part of), and then at the economic bottom, you have the working class which mostly live in townships and squatter camps in the most primitive of conditions imaginable. The sad thing is that the majority of our population lives this way, especially when you consider that unemployment sits around 30%, and that even if you do work, most working class jobs pay an absolute pittance in South Africa.</p>
<p>The reason why I had to go to into the township, was because one of Claudias former colleagues lives there, and since we are packing up our stuff in preparation to move to the Netherlands, we promised to give her a few bookcases, and had to go drop it off.</p>
<p>Once you enter the township, all resemblence to anything you know before just disappears. Building materials are anything people can get their hands on, roads are narrow, most people have no other transport otherthan their feet, and houses are tiny. The main street is bordered by little shops selling discount items. A few of the shops even use old shipping containers as their building.<br />
<div id="attachment_1658" class="wp-caption alignright" style="width: 310px"><a href="http://www.sergemeunier.com/blog/wp-content/uploads/2010/03/DuNoon2.jpg"><img src="http://www.sergemeunier.com/blog/wp-content/uploads/2010/03/DuNoon2-300x225.jpg" alt="A Du Noon shack" title="A Du Noon shack" width="300" height="225" class="size-medium wp-image-1658" /></a><p class="wp-caption-text">A Du Noon shack</p></div><br />
In Du Noon, a house tends to be a little bit of a misnomer. To gve an example, Letitia (to whom I was giving the bookcases) had one of the bigger houses in her street. It was built out cement bricks, unlike most of her neighbours whose houses were made out of corrugated iron. </p>
<p>Her house consists of only one room, with two beds in it, the cooking area, and a tiny walled off section for the toilet. That is all of it. And here I complain about my tiny house with two bedrooms a lounge and kitchen, and her entire house is smaller than my garage.</p>
<p>Letitia&#8217;s house was impeccably neat though, and she was proud to show off her house to me &#8211; as she ought to be. She has done well with what she has.</p>
<p>Despite the fact that most people who do not live in the townships and squatter camps fear them greatly, since most of the criminal element tend to originate from them, my experience yesterday showed that most of the inhabitants are decent respectable and most of all <em>friendly</em> people who are just trying to make it through life. I did not feel threatened once while I was in there, despite the fact that I was not quite comfortable in these unfamiliar surroundings.</p>
<p>I know I struggle immensely to make ends meet every month, and I earn ten times what these people earn &#8211; sometimes even more. </p>
<p>South Africa might be pretending to be a first world country, but until these poor people get lifted out of poverty, we will be firmly stuck in the third world. From first hand observations, I certainly think it is time that South Africa&#8217;s politians take out those silver spoons out of their mouths and start doing something to alleviate the suffering of their people.</p>
<p>The pictures are kindly provided by <a href="http://www.capetown.dj">www.capetown.dj</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fan-entirely-different-world-just-up-the-road-from-my-house%2F&amp;linkname=An%20entirely%20different%20world%2C%20just%20up%20the%20road%20from%20my%20house"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/all-i-want-for-christmas-is-a-bullet-proof-vest/' rel='bookmark' title='Permanent Link: All I want for Christmas is a bullet-proof vest'>All I want for Christmas is a bullet-proof vest</a> <small>A few days ago, I saw an article which said...</small></li>
<li><a href='http://www.sergemeunier.com/blog/the-problem-with-south-african-genealogy/' rel='bookmark' title='Permanent Link: The problem with South African genealogy'>The problem with South African genealogy</a> <small>South Africans are a bunch of avid genealogists. So much...</small></li>
<li><a href='http://www.sergemeunier.com/blog/our-emigration-to-the-netherlands/' rel='bookmark' title='Permanent Link: Our emigration to the Netherlands'>Our emigration to the Netherlands</a> <small>It is now safe to do this, since I have...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/an-entirely-different-world-just-up-the-road-from-my-house/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2</title>
		<link>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/</link>
		<comments>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 08:51:22 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Genealogy]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1636</guid>
		<description><![CDATA[Now that we know how gedcom files work (covered in part 1), we need to actually parse the file.
The way in which the gedcom is structured is that each new record entry starts on a line with a 0. All lines with a 1 under that belong to that record. Similarly, lines with a 2 [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1</a> <small>In my previous post in this series, I introduced the...</small></li>
<li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; The underlying structure'>Writing a family tree application in C# &#8211; The underlying structure</a> <small>I love being able to trace my family tree, and...</small></li>
<li><a href='http://www.sergemeunier.com/blog/compression-using-c-sharp/' rel='bookmark' title='Permanent Link: Compression using C#'>Compression using C#</a> <small>You would have thought that .NET, with its vast libraries...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Now that we know how gedcom files work (covered in <a href="http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/">part 1</a>), we need to actually parse the file.</p>
<p>The way in which the gedcom is structured is that each new record entry starts on a line with a 0. All lines with a 1 under that belong to that record. Similarly, lines with a 2 prefix, belond to the the entry prefixed by a 1 directly above it.</p>
<p>This makes processing rather straightforward. All we need to do, is read the file line by line, then split up the line into its components, and process accordingly.</p>
<p>All lines have a number (0, 1 or 2) as the first field in the line, and each field is seperated by a space, for example <i>1 SOUR FamilyTraces</i></p>
<p>The second field in the line is usually the keyword which tells us what the data represents. Some keywords will not need an extra data field in the third field, but usually, these types of lines which are grouped together with that line.<br />
As an example, the VERS and FORM lines are linked to the GEDC keyword as the 2 in the first field shows they belong to the preceding line.</p>
<pre name="code" class="text">1 GEDC
2 VERS 5.5
2 FORM LINEAGE-LINKED
</pre>
<p>There is an exception to the second field being the keyword, and that is in the individual, family and note record entry fields which take the format <i>0 @Ixxx@ INDI</i> for an individual record for example.</p>
<p>Based on all of that, all we need to do, is split up the line into the three fields, and then process each keyword independantly from each other, while keeping track of which type of record we are currently in, so that we can assign the data to the correct structure.</p>
<p>Here is the full code for the parser, that works pretty much exactly as described above. I have not implemented the full spec of the gedcom file format, but only enough as I need for the application. It is easily modified, however, to add the rest of the spec in if needed.</p>
<p>Usually, now would be the time where I list the source code for the code I have talked about in this blog post, but due to some bug with Wordpress and the plug-in I am using to render my code samples nicely, the code for this section is crashing Firefox, so I have included the code for the GedcomParser class as a link to a <a href="http://www.sergemeunier.com/code/GedcomParser.txt" target="_blank">text file containing the code</a>.</p>
<p>In the next post I will cover how to import the data we have read from the gedcom file into our database.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fwriting-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2%2F&amp;linkname=Writing%20a%20family%20tree%20application%20in%20C%23%20%26%238211%3B%20Importing%20a%20Gedcom%20file%20%26%238211%3B%20Part%202"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1</a> <small>In my previous post in this series, I introduced the...</small></li>
<li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; The underlying structure'>Writing a family tree application in C# &#8211; The underlying structure</a> <small>I love being able to trace my family tree, and...</small></li>
<li><a href='http://www.sergemeunier.com/blog/compression-using-c-sharp/' rel='bookmark' title='Permanent Link: Compression using C#'>Compression using C#</a> <small>You would have thought that .NET, with its vast libraries...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1</title>
		<link>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/</link>
		<comments>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 08:13:40 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Genealogy]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1624</guid>
		<description><![CDATA[In my previous post in this series, I introduced the Family Traces family tree application. Now, I am going to go through the importing of a gedcom file.
Firstly, what is a gedcom file?
The gedcom file format is a text file format for the transmission and storage of genealogical data, created by the Church of the [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2</a> <small>Now that we know how gedcom files work (covered in...</small></li>
<li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; The underlying structure'>Writing a family tree application in C# &#8211; The underlying structure</a> <small>I love being able to trace my family tree, and...</small></li>
<li><a href='http://www.sergemeunier.com/blog/an-implementation-of-a-binary-tree-in-c-sharp/' rel='bookmark' title='Permanent Link: An implementation of a binary tree in C#'>An implementation of a binary tree in C#</a> <small>Binary trees are a very useful data structure, and are...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/">previous post</a> in this series, I introduced the Family Traces family tree application. Now, I am going to go through the importing of a gedcom file.</p>
<p>Firstly, what is a gedcom file?</p>
<p>The gedcom file format is a text file format for the transmission and storage of genealogical data, created by the Church of the Latter Day Saints for their genealogical projects.</p>
<p>A standard gedcom file has a header section, individual records, family records and notes. The various records are linked to each other by ids, in the format of @I1@ for an individual record for example. For a full spec of the gedcom format, have a look <a href="http://homepages.rootsweb.ancestry.com/~pmcbride/gedcom/55gcappa.htm">here</a>.</p>
<p>Here is a sample gedcom file</p>
<pre name="code" class="text">0 HEAD
1 SOUR FamilyTraces
2 NAME Family Traces
2 CORP Serge Meunier
1 DEST Standard GEDCOM
1 DATE 2010/02/16
1 CHAR ANSEL
1 GEDC
2 VERS 5.5
2 FORM LINEAGE-LINKED
0 @I1@ INDI
1 John/Smith/
2 GIVN John
2 SURN Smith
1 SEX M
1 BIRT
2 DATE 15 dec 1950
2 PLAC
1 FAMC @F2@
1 FAMS @F1@
0 @I2@ INDI
1 Jane/Doe/
2 GIVN Jane
2 SURN Doe
1 SEX F
1 FAMC @F-1@
0 @F1@ FAM
1 HUSB @I1@
1 WIFE @I2@
1 CHIL @F3@
0 TRLR
</pre>
<p><span id="more-1624"></span><br />
Before we start processing the file, we need to have some data structures to hold the data from the file.</p>
<pre name="code" class="C-Sharp">
    public struct GedcomHeader
    {
        public string Source;
        public string SourceVersion;
        public string SourceName;
        public string SourceCorporation;
        public string Destination;
        public string Date;
        public string File;
        public string CharacterEncoding;
        public string GedcomVersion;
        public string GedcomForm;
    }

    public struct GedcomIndividual
    {
        public string Id;
        public string GivenName;
        public string Surname;
        public string Suffix;
        public string Sex;
        public string BirthDate;
        public string BirthPlace;
        public string Occupation;
        public string Description;
        public string Nationality;
        public string DiedDate;
        public string DiedPlace;
        public string DiedCause;
        public string ParentFamilyId;
        public string SpouseFamilyId;
        public ArrayList Notes;

        public GedcomIndividual(string id)
        {
            Id = id;
            GivenName = "";
            Surname = "";
            Suffix = "";
            Sex = "";
            BirthDate = "";
            BirthPlace = "";
            Occupation = "";
            Description = "";
            Nationality = "";
            DiedDate = "";
            DiedPlace = "";
            DiedCause = "";
            ParentFamilyId = "";
            SpouseFamilyId = "";
            Notes = new ArrayList();
        }
    }

    public struct GedcomFamily
    {
        public string Id;
        public string HusbandId;
        public string WifeId;
        public string MarriageDate;
        public string MarriagePlace;
        public ArrayList Children;
        public ArrayList Notes;

        public GedcomFamily(string id)
        {
            Id = id;
            HusbandId = "";
            WifeId = "";
            MarriageDate = "";
            MarriagePlace = "";
            Children = new ArrayList();
            Notes = new ArrayList();
        }
    }

    public struct GedcomNote
    {
        public string Id;
        public string Text;

        public GedcomNote(string id)
        {
            Id = id;
            Text = "";
        }
    }
</pre>
<p>We also need a set of enumerations we will use to keep track of where we are in the file. This is important because the meaning of a field in the file is dependant on the place in the file it occurs, so we need to be aware of what we need to do at all times, but more on that later.</p>
<pre name="code" class="C-Sharp">
    public enum GedcomRecordEnum
    {
        None,
        Header,
        Individual,
        Family,
        Note
    }

    public enum GedcomSubRecordEnum
    {
        None,
        HeaderSource,
        HeaderGedcom,
        IndividualName,
        IndividualBirth,
        IndividualDeath,
        FamilyChildren,
        FamilyMarriage
    }
</pre>
<p>Now we need to get to parsing the file, which is covered in <a href="http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/">Importing a Gedcom file &#8211; Part 2</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fwriting-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1%2F&amp;linkname=Writing%20a%20family%20tree%20application%20in%20C%23%20%26%238211%3B%20Importing%20a%20Gedcom%20file%20%26%238211%3B%20Part%201"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2</a> <small>Now that we know how gedcom files work (covered in...</small></li>
<li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; The underlying structure'>Writing a family tree application in C# &#8211; The underlying structure</a> <small>I love being able to trace my family tree, and...</small></li>
<li><a href='http://www.sergemeunier.com/blog/an-implementation-of-a-binary-tree-in-c-sharp/' rel='bookmark' title='Permanent Link: An implementation of a binary tree in C#'>An implementation of a binary tree in C#</a> <small>Binary trees are a very useful data structure, and are...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Writing a family tree application in C# &#8211; The underlying structure</title>
		<link>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/</link>
		<comments>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 10:03:13 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Genealogy]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1621</guid>
		<description><![CDATA[I love being able to trace my family tree, and have used several good genealogy applications which I have found very useful, including Family Tree Legends and Family Tree Builder. The problem I have though, is that they do not always contain everything which I am looking for, so I decided to write a family [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1</a> <small>In my previous post in this series, I introduced the...</small></li>
<li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2</a> <small>Now that we know how gedcom files work (covered in...</small></li>
<li><a href='http://www.sergemeunier.com/blog/the-problem-with-south-african-genealogy/' rel='bookmark' title='Permanent Link: The problem with South African genealogy'>The problem with South African genealogy</a> <small>South Africans are a bunch of avid genealogists. So much...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I love being able to trace my family tree, and have used several good genealogy applications which I have found very useful, including Family Tree Legends and Family Tree Builder. The problem I have though, is that they do not always contain everything which I am looking for, so I decided to write a family tree application to plug in the holes.</p>
<p>Family Traces, which you can download the full source for <a href="http://www.sergemeunier.com/downloads/FamilyTraces.zip">here</a>, is a fully functional, albeit bare-boned family tree application, which can import and export Gedcom files, calculate ancestors and descendants, and allow you to edit the family tree. Everything is there for a starting point, from where you can develop further reports and functionality.</p>
<p>All of that will come in later posts in this series though. For now, I am going to focus on the core of the application &#8211; the data layout. This layout is created within an Access database included with the application.</p>
<p>The two main components of any family tree are individuals and families. </p>
<p>Starting with the individual, each person in the family tree will have a record in the database. The most important data we need for an individual are:</p>
<ul>
<li>Individual Id</li>
<li>Name</li>
<li>Birth date</li>
<li>Birth place</li>
<li>Death date</li>
<li>Death place</li>
</ul>
<p>These fields are vital in determining if the person we are looking at is the same person listed in genealogical records, such as birth certificates, genealogical lists etc. </p>
<p>Now data collection for an individual is not restricted to these fields, and you are free to create as many fields as your want for things like physical attributes, cause of death, photos and general notes.</p>
<p>Moving onto families now, a family is what connects different individuals together into a tree.</p>
<p>The main family record will have </p>
<ul>
<li>Family Id</li>
<li>Husband Id</li>
<li>Wife Id</li>
<li>Marriage date</li>
<li>Marriage place</li>
</ul>
<p>This links the husband and wife individual records into the family, and allows you to track the marriage date and place, which is also important in genealogical research, as it may provide crucial hints to the individuals, particularly if the birth and death dates of the individuals are unsure.</p>
<p>The last thing we need is to be able to link individuals as children within a family, and this is done using a separate table, which keeps track of the family id, as well as the individual id of the child, and each family can have multiple individuals attached to it as children.</p>
<p>In the database setup for the application, I also included a field in the individual record for the parent family record, which makes it easier to link the individual to a family as a child when processing the tree. This means that we are able to find the family that the individual is a child of without having to check the family records directly.</p>
<p>Now that is all there is to the core of a genealogy application, so feel free to play around with the application, and I will explain more about how the application works in the next tutorial&#8230;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fwriting-a-family-tree-application-in-c-the-underlying-structure%2F&amp;linkname=Writing%20a%20family%20tree%20application%20in%20C%23%20%26%238211%3B%20The%20underlying%20structure"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-1/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 1</a> <small>In my previous post in this series, I introduced the...</small></li>
<li><a href='http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-sharp-importing-a-gedcom-file-part-2/' rel='bookmark' title='Permanent Link: Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2'>Writing a family tree application in C# &#8211; Importing a Gedcom file &#8211; Part 2</a> <small>Now that we know how gedcom files work (covered in...</small></li>
<li><a href='http://www.sergemeunier.com/blog/the-problem-with-south-african-genealogy/' rel='bookmark' title='Permanent Link: The problem with South African genealogy'>The problem with South African genealogy</a> <small>South Africans are a bunch of avid genealogists. So much...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/writing-a-family-tree-application-in-c-the-underlying-structure/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Running Android and Ubuntu on the Xperia X1</title>
		<link>http://www.sergemeunier.com/blog/running-android-and-ubuntu-on-the-xperia-x1/</link>
		<comments>http://www.sergemeunier.com/blog/running-android-and-ubuntu-on-the-xperia-x1/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 11:35:05 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Google Android]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mobile phones]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[Xperia]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1619</guid>
		<description><![CDATA[If you thought that you are stuck with using Windows Mobile with your Xperia X1, you would be wrong. Of course, the only officially supported operating system is Windows Mobile, but that doesn&#8217;t stop you from timkering a little.
XDA-Developers have released a version of Google Android that works on the Xperia X1. It is still [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/the-sony-ericsson-xperia-x1/' rel='bookmark' title='Permanent Link: The Sony Ericsson Xperia X1'>The Sony Ericsson Xperia X1</a> <small>Ah, the joy of the free bi-annual contract upgrade. I...</small></li>
<li><a href='http://www.sergemeunier.com/blog/google-maps-navigation-released-on-android/' rel='bookmark' title='Permanent Link: Google Maps Navigation released on Android'>Google Maps Navigation released on Android</a> <small>The major GPS navigation software companies are not liking Google...</small></li>
<li><a href='http://www.sergemeunier.com/blog/my-favourite-windows-mobile-applications/' rel='bookmark' title='Permanent Link: My favourite Windows Mobile applications'>My favourite Windows Mobile applications</a> <small>I have had my Sony Ericsson Xperia for almost a...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>If you thought that you are stuck with using Windows Mobile with your Xperia X1, you would be wrong. Of course, the only officially supported operating system is Windows Mobile, but that doesn&#8217;t stop you from timkering a little.</p>
<p><a href="http://www.engadget.com/2010/02/03/xperia-x1-and-android-2-0-1-joined-in-unholy-matrimony/">XDA-Developers<a/> have released a version of Google Android that works on the Xperia X1. It is still missing a few features, such as the GPS functionality, but it works well.</p>
<p>Also from XDA-Developers is a port of <a href="http://www.engadget.com/2010/02/17/ubuntu-hardy-heron-8-04-gets-ported-onto-sony-ericssons-xperia/">Ubuntu Hardy Heron 8.04</a> which gives you full-on Linux functionality on the X1.</p>
<p>It seems these days that we are fast heading to the days of being able to choose whichever OS we like to use on our phones, and that does make the future exciting&#8230;</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Frunning-android-and-ubuntu-on-the-xperia-x1%2F&amp;linkname=Running%20Android%20and%20Ubuntu%20on%20the%20Xperia%20X1"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/the-sony-ericsson-xperia-x1/' rel='bookmark' title='Permanent Link: The Sony Ericsson Xperia X1'>The Sony Ericsson Xperia X1</a> <small>Ah, the joy of the free bi-annual contract upgrade. I...</small></li>
<li><a href='http://www.sergemeunier.com/blog/google-maps-navigation-released-on-android/' rel='bookmark' title='Permanent Link: Google Maps Navigation released on Android'>Google Maps Navigation released on Android</a> <small>The major GPS navigation software companies are not liking Google...</small></li>
<li><a href='http://www.sergemeunier.com/blog/my-favourite-windows-mobile-applications/' rel='bookmark' title='Permanent Link: My favourite Windows Mobile applications'>My favourite Windows Mobile applications</a> <small>I have had my Sony Ericsson Xperia for almost a...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/running-android-and-ubuntu-on-the-xperia-x1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You only turn 80 once</title>
		<link>http://www.sergemeunier.com/blog/you-only-turn-80-once/</link>
		<comments>http://www.sergemeunier.com/blog/you-only-turn-80-once/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 06:52:47 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Family]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1617</guid>
		<description><![CDATA[What a weekend that just passed! The family gathered for the first time in an age to celebrate my grandmothers 80th birthday this weekend.
This might not sound like major thing, but here is the kicker &#8211; while my family is relatively small, we are dispersed around every corner of the globe. Claudia, Cole and myself [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/the-dangers-of-being-exposed-to-opera-music/' rel='bookmark' title='Permanent Link: The dangers of being exposed to opera music'>The dangers of being exposed to opera music</a> <small>I adore opera music. I really do. And I have...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>What a weekend that just passed! The family gathered for the first time in an age to celebrate my grandmothers 80th birthday this weekend.</p>
<p>This might not sound like major thing, but here is the kicker &#8211; while my family is relatively small, we are dispersed around every corner of the globe. Claudia, Cole and myself had to only fly 2 hours from Cape Town to Johannesburg, but my mother and brother came from the Netherlands, my sister and her boyfriend from Mtubatuba, a sleepy little town (using this word loosely) in northern Natal, and my uncle all the way from Australia.</p>
<p>I can&#8217;t leave out my uncle and aunt living in Johannesburg where we were staying, but then they don&#8217;t count as they didn&#8217;t have to travel any further than from their bedroom to the lounge.</p>
<p>It has been the first time in over 10 years that the whole of my mother&#8217;s family had been in one place at one time, and I must say, it felt as if it things just picked up right from where they left off.</p>
<p>This was also all a big surprise for my gran, as she had absolutely no idea that any of us out-of-towners would be there at all, especially not my uncle from Australia. She was just so taken aback, although I must say, it was a big strain on all our parts not to spill the beans.</p>
<p>Now, thoroughly exhaused from the frenetic weekend jaunt, I must say it was a memorable weekend.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fyou-only-turn-80-once%2F&amp;linkname=You%20only%20turn%2080%20once"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/the-dangers-of-being-exposed-to-opera-music/' rel='bookmark' title='Permanent Link: The dangers of being exposed to opera music'>The dangers of being exposed to opera music</a> <small>I adore opera music. I really do. And I have...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/you-only-turn-80-once/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Our emigration to the Netherlands</title>
		<link>http://www.sergemeunier.com/blog/our-emigration-to-the-netherlands/</link>
		<comments>http://www.sergemeunier.com/blog/our-emigration-to-the-netherlands/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 07:23:10 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Netherlands]]></category>
		<category><![CDATA[Society]]></category>
		<category><![CDATA[South Africa]]></category>
		<category><![CDATA[Emigration]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1607</guid>
		<description><![CDATA[It is now safe to do this, since I have informed the company I work for already, so the latest news flash is that mysef, Claudia and Cole are going to be emigrating from South Africa to the Netherlands in a few months time.
Currently our planned departure date is set at the end of April, [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/celebrating-my-heritage-on-heritage-day/' rel='bookmark' title='Permanent Link: Celebrating my heritage on Heritage Day'>Celebrating my heritage on Heritage Day</a> <small>Today is Heritage Day in South Africa. While also being...</small></li>
<li><a href='http://www.sergemeunier.com/blog/the-problem-with-south-african-genealogy/' rel='bookmark' title='Permanent Link: The problem with South African genealogy'>The problem with South African genealogy</a> <small>South Africans are a bunch of avid genealogists. So much...</small></li>
<li><a href='http://www.sergemeunier.com/blog/all-i-want-for-christmas-is-a-bullet-proof-vest/' rel='bookmark' title='Permanent Link: All I want for Christmas is a bullet-proof vest'>All I want for Christmas is a bullet-proof vest</a> <small>A few days ago, I saw an article which said...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>It is now safe to do this, since I have informed the company I work for already, so the latest news flash is that mysef, Claudia and Cole are going to be emigrating from South Africa to the Netherlands in a few months time.</p>
<p>Currently our planned departure date is set at the end of April, largely to give us enough time to get all our passports sorted out before we go.</p>
<p>So, now I am sure the first question you may be wanting to ask is, &#8220;Why would a South African want to go live in the Netherlands?&#8221;</p>
<p>Well, the reasons are many, but one very powerful driver of our move, is that I have dual Belgian/South African citizenship, and Claudia (and by implication, Cole) has dual Swiss/South African citizenship, so making a move to Europe is very easy for us. Since Switzerland has very close ties to the EU, and me beign an EU citizen, there is no issue at all for us to move over. Very little paperwork to worry about.</p>
<p>This still does not answer fully why we chose the Netherlands though, since most South Africans heading off for Europe tend to centre around the UK. Well, firstly, my mother and brother already stay in Haarlem (near Amsterdam if you are wondering where that is), which gives us a free couch to sleep on until we get settled. </p>
<p>The Dutch are also very easy going, and many of them speak pretty good English to boot, and for an English speaker, I have the greatest probability of success there, outside of the UK. </p>
<p>And in addition to that, Dutch would be one of the easiest European languages for me to learn, as in South Africa, Afrikaans is one of the major languages, which I did 7 years worth of at school. Afrikaans is a closely related language to Dutch, and originated in the early Dutch settlers in South Africa. The pronunciation and spelling are slightly different, and there are a few minor differences in vocabulary, but the two languages are very close to each other, to the point where, based solely on my fluency in Afrikaans, I am able to understand most written Dutch, and spoken Dutch when spoken slowly and clearly. </p>
<p>As to the reasons we are leaving South Africa, well, my entire goal is to provide the best life that I can to my family, and that is becoming increasingly difficult in South Africa. If I start naming reasons, I will start to look like one of the many whingers we have in South Africa. Don&#8217;t get me wrong, I have always loved South Africa as a country, but the problems we have here are starting to become too much for me, and it is now time to seek a better life.</p>
<p>There will be many things I am going to miss, but what I am looking forward to is decent public transport, and fast cheap internet, over everything else.<br />
As the move comes together I will blog more about the experience of uprooting ourselves and planting ourselves in a foreign land.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Four-emigration-to-the-netherlands%2F&amp;linkname=Our%20emigration%20to%20the%20Netherlands"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/celebrating-my-heritage-on-heritage-day/' rel='bookmark' title='Permanent Link: Celebrating my heritage on Heritage Day'>Celebrating my heritage on Heritage Day</a> <small>Today is Heritage Day in South Africa. While also being...</small></li>
<li><a href='http://www.sergemeunier.com/blog/the-problem-with-south-african-genealogy/' rel='bookmark' title='Permanent Link: The problem with South African genealogy'>The problem with South African genealogy</a> <small>South Africans are a bunch of avid genealogists. So much...</small></li>
<li><a href='http://www.sergemeunier.com/blog/all-i-want-for-christmas-is-a-bullet-proof-vest/' rel='bookmark' title='Permanent Link: All I want for Christmas is a bullet-proof vest'>All I want for Christmas is a bullet-proof vest</a> <small>A few days ago, I saw an article which said...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/our-emigration-to-the-netherlands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A visit to an old friend at Planet Kids</title>
		<link>http://www.sergemeunier.com/blog/a-visit-to-an-old-friend-at-planet-kids/</link>
		<comments>http://www.sergemeunier.com/blog/a-visit-to-an-old-friend-at-planet-kids/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 06:19:15 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Cape Town]]></category>
		<category><![CDATA[Society]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1597</guid>
		<description><![CDATA[This last weekend, Claudia and I were out on a drive to Fish Hoek, and decided to go and pop in for a visit at an old friend of ours, Andy Schwab.
He runs a great play centre for kids, called Planet Kids, in Muizenberg. One of the best features of this place is that it [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/hello-world/' rel='bookmark' title='Permanent Link: Finally!'>Finally!</a> <small>At long last, I have finally decided to get my...</small></li>
<li><a href='http://www.sergemeunier.com/blog/our-emigration-to-the-netherlands/' rel='bookmark' title='Permanent Link: Our emigration to the Netherlands'>Our emigration to the Netherlands</a> <small>It is now safe to do this, since I have...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.sergemeunier.com/blog/wp-content/uploads/2010/01/Planetkids1.jpg" alt="Planet Kids" title="Planet Kids" width="300" height="225" class="alignleft size-full wp-image-1598" />This last weekend, Claudia and I were out on a drive to Fish Hoek, and decided to go and pop in for a visit at an old friend of ours, Andy Schwab.</p>
<p>He runs a great play centre for kids, called <a href="http://www.planetkids.com">Planet Kids</a>, in Muizenberg. One of the best features of this place is that it caters for specifically for kids with special needs, although all kids would have fun playing and learning here. </p>
<p><img src="http://www.sergemeunier.com/blog/wp-content/uploads/2010/01/Planet-kids-2.jpg" alt="Planet Kids" title="Planet Kids" width="225" height="300" class="alignright size-full wp-image-1600" /><br />
Part of the inspiration that urged Andy to start this play centre 2 years ago, is his son, Luca, who has autism, and I hear that the centre is doing quite well.</p>
<p>It was nice to catch up with how he is doing, and I hope that his endeavour continues to be a success.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fa-visit-to-an-old-friend-at-planet-kids%2F&amp;linkname=A%20visit%20to%20an%20old%20friend%20at%20Planet%20Kids"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/hello-world/' rel='bookmark' title='Permanent Link: Finally!'>Finally!</a> <small>At long last, I have finally decided to get my...</small></li>
<li><a href='http://www.sergemeunier.com/blog/our-emigration-to-the-netherlands/' rel='bookmark' title='Permanent Link: Our emigration to the Netherlands'>Our emigration to the Netherlands</a> <small>It is now safe to do this, since I have...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/a-visit-to-an-old-friend-at-planet-kids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Processing in C#: Decreasing the colour depth</title>
		<link>http://www.sergemeunier.com/blog/image-processing-in-c-sharp-decreasing-the-colour-depth/</link>
		<comments>http://www.sergemeunier.com/blog/image-processing-in-c-sharp-decreasing-the-colour-depth/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 05:48:21 +0000</pubDate>
		<dc:creator>Serge Meunier</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Image processing]]></category>

		<guid isPermaLink="false">http://www.sergemeunier.com/blog/?p=1592</guid>
		<description><![CDATA[Decreasing the colour depth involves converting colour values to standard values.
Specifying an offset, preferably a value evenly divisible by 256, such as 16, 24 or 32, we then need to make sure that the red, green and blue components&#8217; values get rounded off to multiples of this offset.
For example, using an offset of 16, value [...]


Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/image-processing-in-c-sharp-colour-filters/' rel='bookmark' title='Permanent Link: Image Processing in C#: Colour filters'>Image Processing in C#: Colour filters</a> <small>Implementing a colour filter is a rather simple affair. All...</small></li>
<li><a href='http://www.sergemeunier.com/blog/image-processing-in-c-sharp-contrast/' rel='bookmark' title='Permanent Link: Image Processing in C#: Contrast'>Image Processing in C#: Contrast</a> <small>Contrast in a picture is a measure of how close...</small></li>
<li><a href='http://www.sergemeunier.com/blog/image-processing-in-c-sharp-converting-an-image-to-greyscale/' rel='bookmark' title='Permanent Link: Image Processing in C#: Converting an image to greyscale'>Image Processing in C#: Converting an image to greyscale</a> <small>Converting an image to greyscale is a relatively easy effect...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Decreasing the colour depth involves converting colour values to standard values.</p>
<p>Specifying an offset, preferably a value evenly divisible by 256, such as 16, 24 or 32, we then need to make sure that the red, green and blue components&#8217; values get rounded off to multiples of this offset.</p>
<p>For example, using an offset of 16, value colour values would be 0, 15, 31, 47,&#8230;&#8230;, 255. and all values would need to be rounded off to these values for each of the colour components.</p>
<p>To be able to do this, we take the component value, and then add half of the offset to the value. We then subtract the modulo of this value and the offset. This then gives values along the lines of 0, 16, 32, &#8230;., 256, so we will need to subtract 1 from this, but will need to put in a correction for 0, since that value needs to remain as it is.<br />
<div id="attachment_1593" class="wp-caption aligncenter" style="width: 490px"><img src="http://www.sergemeunier.com/blog/wp-content/uploads/2010/01/Garfield-DecreaseColorDepth.jpg" alt="Decreasing the colour depth using an offset of 16" title="Decreasing the colour depth using an offset of 16" width="480" height="180" class="size-full wp-image-1593" /><p class="wp-caption-text">Decreasing the colour depth using an offset of 16</p></div><br />
You can download the full code for the sample application which contains code for all the image effects covered in the series <a href="http://www.sergemeunier.com/downloads/ImageProcessor.zip">here</a>.</p>
<pre name="code" class="C-Sharp">
public void ApplyDecreaseColourDepth(int offset)
{
    int A, R, G, B;
    Color pixelColor;

    for (int y = 0; y < bitmapImage.Height; y++)
    {
        for (int x = 0; x < bitmapImage.Width; x++)
        {
            pixelColor = bitmapImage.GetPixel(x, y);
            A = pixelColor.A;
            R = ((pixelColor.R + (offset / 2)) - ((pixelColor.R + (offset / 2)) % offset) - 1);
            if (R < 0)
            {
                R = 0;
            }
            G = ((pixelColor.G + (offset / 2)) - ((pixelColor.G + (offset / 2)) % offset) - 1);
            if (G < 0)
            {
                G = 0;
            }
            B = ((pixelColor.B + (offset / 2)) - ((pixelColor.B + (offset / 2)) % offset) - 1);
            if (B < 0)
            {
                B = 0;
            }
            bitmapImage.SetPixel(x, y, Color.FromArgb(A, R, G, B));
        }
    }

}
</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.sergemeunier.com%2Fblog%2Fimage-processing-in-c-sharp-decreasing-the-colour-depth%2F&amp;linkname=Image%20Processing%20in%20C%23%3A%20Decreasing%20the%20colour%20depth"><img src="http://www.sergemeunier.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>

<p>Related posts:<ol><li><a href='http://www.sergemeunier.com/blog/image-processing-in-c-sharp-colour-filters/' rel='bookmark' title='Permanent Link: Image Processing in C#: Colour filters'>Image Processing in C#: Colour filters</a> <small>Implementing a colour filter is a rather simple affair. All...</small></li>
<li><a href='http://www.sergemeunier.com/blog/image-processing-in-c-sharp-contrast/' rel='bookmark' title='Permanent Link: Image Processing in C#: Contrast'>Image Processing in C#: Contrast</a> <small>Contrast in a picture is a measure of how close...</small></li>
<li><a href='http://www.sergemeunier.com/blog/image-processing-in-c-sharp-converting-an-image-to-greyscale/' rel='bookmark' title='Permanent Link: Image Processing in C#: Converting an image to greyscale'>Image Processing in C#: Converting an image to greyscale</a> <small>Converting an image to greyscale is a relatively easy effect...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.sergemeunier.com/blog/image-processing-in-c-sharp-decreasing-the-colour-depth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
