<?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>Intrepid Blog &#187; c#</title>
	<atom:link href="http://blog.affien.com/archives/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affien.com</link>
	<description>A few thoughts</description>
	<lastBuildDate>Mon, 01 Mar 2010 00:58:01 +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>IEnumerable to IEnumerable wrapper</title>
		<link>http://blog.affien.com/archives/2005/06/30/ienumerable-to-ienumerable-wrapper/</link>
		<comments>http://blog.affien.com/archives/2005/06/30/ienumerable-to-ienumerable-wrapper/#comments</comments>
		<pubDate>Thu, 30 Jun 2005 22:09:51 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Code sniplets]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[IEnumerable]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/06/30/ienumerable-to-ienumerable-wrapper/</guid>
		<description><![CDATA[A simple .net class which maps an IEnumerator to a generic IEnumerator, which is very usefull to convert from generic to non-generic collections.

using System;
using System.Collections;
using System.Collections.Generic;

namespace Intrepid.Collections.Generic
{
	public class EnumerableWrapper&#60;T&#62; : IEnumerable&#60;T&#62;
	{
		class EnumeratorWrapper : IEnumerator&#60;T&#62;
		{
			IEnumerator enumerator;

			public EnumeratorWrapper(IEnumerator enumerator)
			{
				this.enumerator = enumerator;
			}

			public void Dispose()
			{
				// maybe we should dispose the underlying IEnumerable?
			}

			public bool MoveNext()
			{
				return enumerator.MoveNext();
			}

			public void Reset()
			{
				enumerator.Reset();
			}

			object System.Collections.IEnumerator.Current
			{
				get { [...]]]></description>
			<content:encoded><![CDATA[<p>A simple .net class which maps an <code>IEnumerator</code> to a generic <code>IEnumerator<t></t></code>, which is very usefull to convert from generic to non-generic collections.<br />
<span id="more-105"></span></p>
<blockquote><pre style="font-size: larger">using System;
using System.Collections;
using System.Collections.Generic;

namespace Intrepid.Collections.Generic
{
	public class EnumerableWrapper&lt;T&gt; : IEnumerable&lt;T&gt;
	{
		class EnumeratorWrapper : IEnumerator&lt;T&gt;
		{
			IEnumerator enumerator;

			public EnumeratorWrapper(IEnumerator enumerator)
			{
				this.enumerator = enumerator;
			}

			public void Dispose()
			{
				// maybe we should dispose the underlying IEnumerable?
			}

			public bool MoveNext()
			{
				return enumerator.MoveNext();
			}

			public void Reset()
			{
				enumerator.Reset();
			}

			object System.Collections.IEnumerator.Current
			{
				get { return enumerator.Current; }
			}

			public T Current
			{
				get { return (T)enumerator.Current; }
			}
		}

		IEnumerator enumerator;

		public EnumerableWrapper (IEnumerable enumerable)
		{
			enumerator = enumerable.GetEnumerator();
		}

		public IEnumerator&lt;T&gt; GetEnumerator()
		{
			return new EnumeratorWrapper(enumerator);
		}

		IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			return enumerator;
		}
	}
}</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/06/30/ienumerable-to-ienumerable-wrapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assembly &#8216;programmers&#8217; suck</title>
		<link>http://blog.affien.com/archives/2005/05/14/assembly-programmers-suck/</link>
		<comments>http://blog.affien.com/archives/2005/05/14/assembly-programmers-suck/#comments</comments>
		<pubDate>Sat, 14 May 2005 20:49:28 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[sucks]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/05/14/assembly-programmers-suck/</guid>
		<description><![CDATA[Some programmers claim writing assembly is the solution to every single programming issue, for it would be great for being down to the basics, or it creates small programs, or even be fast. For all I care they are just trying to brag for not a lot of people know how to program in assembly [...]]]></description>
			<content:encoded><![CDATA[<p>Some programmers claim writing assembly is the solution to every single programming issue, for it would be great for being down to the basics, or it creates small programs, or even be fast. For all I care they are just trying to brag for not a lot of people know how to program in assembly and it is generally seen as difficult to do.</p>
<p>Programming in assembly is almost everytime a bad idea.</p>
<p>So first, what exactly is assembly?<br />
Assembly is a text language with which you can write opcodes and arguments of machine code processed by the processor by hand. This gives you a very high amount of control of what the processor does. Whereas higher languages generate the machine code for you as they deem it to fit you can choose which machine code would fit.</p>
<p>Assembly isn&#8217;t difficult to learn. Assembly is very straight forward. It just is hard to program for you don&#8217;t have functions, you don&#8217;t have high level structures, you don&#8217;t have all the aid of a high level languages.</p>
<p>The reason programmers claim that assembly is superior is for with assembly you can write faster and smaller code. This is only partially true.</p>
<p>When you know all opcodes and tricks you can pull on all different architectures you can beat a compiler.. The problem here is that there are tens of architectures with totally different opcodes and even more subarchitectures with each a slightly different implementation and different performance characteristics of each opcode or way to do something.</p>
<p>So to truely beat a compiler which compiles one piece of code to assembly, you have to create for each different architecture a seperate piece of assembly source.</p>
<p>You&#8217;d also have to learn all the opcodes of one cpu, that aren&#8217;t just a few hundred which would suffice to get it working, but thousands which are required to get it working as fast as possible.</p>
<p>Compilers know all these extra opcodes and tricks for each architecture and would therefore a higher level programmer would do a better job on creating an executable than an experienced assembly programmer in the same amount of time. If the assembly programmer would want to beat the higher level programmer he would require not just 2 times more time but at least 10 times.</p>
<p>Also assembly isn&#8217;t very portable. If you want to change one little thing you got to change it for all optimalizations for all different processors. I haven&#8217;t seen a big application written in assembly. And that has got a reason.</p>
<p>Most programmers that claim to be able to write quick assembly don&#8217;t have got an idea how everything works exactly and are just thrilled that they made a little program work in assembly.</p>
<p>Assembly though can be usefull. An example is an arbitrary length integer class like <a href="http://www.swox.com/gmp">GMP</a> which uses optimized assembly for certain operations. It aren&#8217;t a lot of operations done in assembly, but it certainly has got a lot of assembly. And it is worth it.</p>
<p>Sticking with a good compiler and a high low level language like C is always the best option for good applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/05/14/assembly-programmers-suck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending using Wrapping</title>
		<link>http://blog.affien.com/archives/2005/04/30/extending-using-wrapping/</link>
		<comments>http://blog.affien.com/archives/2005/04/30/extending-using-wrapping/#comments</comments>
		<pubDate>Sat, 30 Apr 2005 00:11:02 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Intermediate Languages]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/04/30/extending-using-wrapping/</guid>
		<description><![CDATA[Ever had a problem, not being able to add more functionality to an existing class? Some languages seem to support adding functionality to an existing class but it does make it less secure and leaves a lot of dangers of maluse.
A solution could be to create a new class which inherits the original class although [...]]]></description>
			<content:encoded><![CDATA[<p>Ever had a problem, not being able to add more functionality to an existing class? Some languages seem to support adding functionality to an existing class but it does make it less secure and leaves a lot of dangers of maluse.</p>
<p>A solution could be to create a new class which <em>inherits</em> the original class although it can only be instanciated using a cast from an instance of the original class or instanciating providing the original instance. Also it won&#8217;t be able to override anything otherwise it couldn&#8217;t act as its base object.</p>
<p>A possible implementation of this idea could be:</p>
<blockquote><pre style="font-size: larger;">wrapper Int_IsOdd : int {
  public bool IsOdd() {
    return this % 2;
  }
}</pre>
</blockquote>
<p>And it could be used in several ways:</p>
<blockquote><pre style="font-size: larger;">int myInt = 100;
print ((Int_IsOdd)myInt).IsOdd();
print myInt.IsOdd();
print new Int_IsOdd(myInt).IsOdd();</pre>
</blockquote>
<p>The first way would be the easiest for both a reader which isn&#8217;t familiar with the extension and for the compiler to guess errors. The second would be neat to use but it would be confusing for people that cannot access the rest of the source or do not know what function is meant. The third way would be very compatible.</p>
<p>I wondered by myself whether normal inheritance could provide this functionality.. and it does. The only problem is that polyforism only works up and not down as the wrapper requires. (when you got <code>a</code> class <code>a</code> and <code>b</code> inherits of <code>a</code>, you can with inheritance treat an instance of <code>b</code> as <code>a</code> but you cant treat an instance of <code>a</code> as <code>b</code> which is required for the wrapper)</p>
<p>Also a wrapper would be more cached and not really a new instance as suggested by the way it seems to work and can already be slightly implemented in existing languages.</p>
<p>Maybe it&#8217;ll be put in paradox.</p>
<p><strong>update &#8211; I talked with Kaja, and it will most likely be a feature of paradox</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/04/30/extending-using-wrapping/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>&#8216;Objects&#8217; in C &#8211; Part 3</title>
		<link>http://blog.affien.com/archives/2005/04/05/objects-in-c-part-3/</link>
		<comments>http://blog.affien.com/archives/2005/04/05/objects-in-c-part-3/#comments</comments>
		<pubDate>Tue, 05 Apr 2005 19:36:15 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/04/05/objects-in-c-part-3/</guid>
		<description><![CDATA[In Part 3 of this mini serie I`ll discuss how interfaces / (multi)inheritance like behaviour can be achieved in a language like C as in C++.
In the posts before (part 1, part 2) I discussed the possibility to inherit behaviour of an &#8216;object&#8217; in C by adding a type pointer which handles initialization and destruction [...]]]></description>
			<content:encoded><![CDATA[<p>In Part 3 of this mini serie I`ll discuss how interfaces / (multi)inheritance like behaviour can be achieved in a language like C as in C++.</p>
<p>In the posts before (<a href="http://blog.w-nz.com/archives/2004/12/14/objects-in-c/">part 1</a>, <a href="http://blog.w-nz.com/archives/2004/12/15/objects-in-c-2/">part 2</a>) I discussed the possibility to inherit behaviour of an &#8216;object&#8217; in C by adding a type pointer which handles initialization and destruction of the object; achieving the possibility to extend an &#8216;object&#8217; by adding fields at the end and updating the type pointer to a new type.</p>
<p>Any object contains a pointer at the start to its <em>type</em>. The type of an object is passed to the <code>CreateInstance</code> function when an instance needs to be created of the object. The type itself just contains a few fields:</p>
<ul>
<li><strong>Length</strong>, the required length of the object, this allows an inheritance to extend the amount of data.</li>
<li><strong>Constructor Function Pointer</strong>, the Constructor Function Pointer is called after the object is allocated to construct its contents.</li>
<li><strong>Destructor Function Pointer</strong>, the Destructor Function Pointer is called before the object is freed to destruct its contents.</li>
</ul>
<p>These fields, along with using function pointers in the instance itself instead of functions, allow an inherited type to expand the existing type. The problem is that an object can&#8217;t inherit from more than one object, for both object&#8217;s expect to start just after the pointer to the type. To solve this an additional field needs to be added:</p>
<ul>
<li><strong>QueryInterface Function Pointer</strong>, the QueryInterface Function Pointer  can be used to get an instance of a supported type from the instance called.</li>
<li><strong>Top Object Pointer</strong>, the Top pointer points to the top object. (An object returned from QueryInterface its Top pointer would point to the object where QueryInterface was called)</li>
</ul>
<p>nb. The latter one will be added after the type pointer in the instance instead of in the type</p>
<p>A good example would be a type called <code>ICloneable</code> which itself only contains one field: Clone, a functionpointer to a function to clone the object. When you would want to clone an object given you would use:</p>
<p><code>ICloneable* interface = toClone-&gt;top-&gt;type-&gt;QueryInterface(toClone-&gt;top-&gt;type, toClone-&gt;top, ICloneableType);<br />
Object* clone = interface-&gt;Clone(interface);</code></p>
<p>Lets take a look to the first line:<br />
<code>ICloneable* interface = toClone-&gt;top-&gt;type-&gt;QueryInterface(toClone-&gt;top-&gt;type, toClone-&gt;top, ICloneableType);</code><br />
This line queries the interface that the object that will be cloned wants you to use to clone it. The top object is used for that is the only way to be certain that you are dealing with the top object and the latest code instead of some base. Using this code an object can be cloned by just providing its interface!</p>
<p>(the QueryInterface takes 3 parameters: first one is the type itself where the function pointer relies, second is the object in question, third is the requested type where ICloneableType is an instance of the ICloneable type).</p>
<p><code>Object* clone = interface-&gt;Clone(interface);</code><br />
The second line just calls the functionpointer in the interface queried.</p>
<p>To ensure that every bit of behaviour can be overriden, the object queried using <code>-&gt;top-&gt;type-&gt;QueryInterface</code> on the provided object must be used instead of the provided object itself for the provided object can be a whole different object merely supporting that interface secondarily.</p>
<p>The nice thing about this architecture is that a top object merely wraps its implemented objects and returns them (possibly addapted) when queried for it. This allows way more access to the inherited types than in any other object orientated model.</p>
<p>This model is quite easy to implement in C and (I hope) will be easy to intergrate with for instance objects in a Virtual Machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/04/05/objects-in-c-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to GC in C(++)</title>
		<link>http://blog.affien.com/archives/2005/04/03/how-to-gc-in-c/</link>
		<comments>http://blog.affien.com/archives/2005/04/03/how-to-gc-in-c/#comments</comments>
		<pubDate>Sun, 03 Apr 2005 21:51:04 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[GC]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/04/03/how-to-gc-in-c/</guid>
		<description><![CDATA[GC`s, Garbage Collectors, are systems to manage memory. Even the good-old C-runtime library has its GC. free, malloc and the others. Now, these aren&#8217;t the best memory managers there are. They cause fragmented memory, and scatter the memory of your application over the whole memory rendering the great processor l1 and l2 cache almost useless.
I [...]]]></description>
			<content:encoded><![CDATA[<p>GC`s, Garbage Collectors, are systems to manage memory. Even the good-old C-runtime library has its GC. <code>free</code>, <code>malloc</code> and the others. Now, these aren&#8217;t the best memory managers there are. They cause fragmented memory, and scatter the memory of your application over the whole memory rendering the great <em>processor l1 and l2 cache</em> almost useless.</p>
<p>I won&#8217;t talk about how to use the <em>C &#8216;GC&#8217;</em>, but how to implement new-generation alike Garbage Collectors in C(++).</p>
<p>The best GC`s can be found in Intermediate Language Virtual Machines which keep track of every object`s type in the memory and can therefore freely move objects in the memory. The great advantage of this is that object that have survived about as much Garbage Collects tend to link a lot to eachother and use eachother. That group survivors is called a generation. When you put a generation close to eachother in the memory, it will usualy only take 1 RAM memory load for the CPU, caching the whole generation in the CPU cache, for a while which is a lot quicker considering that l2-cache is about a thousand times faster than normal RAM.</p>
<p>The problem in C(++) is that you can&#8217;t just move objects. You don&#8217;t know what part of the memory of an object is a pointer, and what is just a mere integer. Therefore it is impossible to make a generation based Garbage Collector for you just can&#8217;t move stuff.</p>
<p>Allocating a big chunks and putting the objects of the C(++) application however using a custom allocation function will generate some additional performance above the traditional <code>malloc</code> although it still isn&#8217;t perfect.</p>
<p>One way to get it to work is to <strong>let the GC know what a pointer is and what now</strong>. This can be done by letting the first 4 (or 8 bytes in case of a 64bit CPU) be a pointer to a function which returns an array of offsets which resemble the pointers in the type.</p>
<p>Now the GC knows what the pointers are in a structure <img src='http://blog.affien.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> .</p>
<p>The GC can now move the object by updating the pointers from the other objects to the new location of the object!</p>
<p>The only problem with this is that there <strong>can&#8217;t be pointers to the object, or inside the object from a not referenced pointer exposing object or a object that doesn&#8217;t exposes it pointers at all</strong>.</p>
<p>To overcome this I guess it could be feasable to add a flag byte in each object that exposes it pointers which allows it to specify a function that can be called when moving the object or when an object referenced is moved.</p>
<p>I&#8217;ve tried out some ways to get this all wrapped up in a nice framework (which is very feasable using my &#8216;<a href="http://blog.w-nz.com/archives/2004/12/16/intrepid-c-objects-in-c/">objects in c</a>-framework&#8217; or something similar (easier) in C++ using inheritance).</p>
<p>I`m afraid however that such a GC comes too late for by the time it is reliable the Intermediate Languages would have gained way more ground for these can implement way more optimalizations, including in the GC, during runtime for they tend to use an Ahead of Time and Just in Time compiler.</p>
<p>Feedback on this would be welcome <img src='http://blog.affien.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/04/03/how-to-gc-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Softwire</title>
		<link>http://blog.affien.com/archives/2005/04/02/softwire/</link>
		<comments>http://blog.affien.com/archives/2005/04/02/softwire/#comments</comments>
		<pubDate>Sat, 02 Apr 2005 22:43:25 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Intermediate Languages]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[jit]]></category>
		<category><![CDATA[softwire]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/04/02/softwire/</guid>
		<description><![CDATA[Softwire
Softwire is a library to generate assembly runtime for different kind of processors. It has a great API. Very usefull for JIT alikes.
Kaja is converting it for use in C for the Paradox JIT. Hopefully it&#8217;ll be a lot faster replacing virtual class function calls with macro&#8217;s.
Great stuff to play with  
]]></description>
			<content:encoded><![CDATA[<p><a href="http://softwire.sourceforge.net/">Softwire</a></p>
<p>Softwire is a library to generate assembly runtime for different kind of processors. It has a great API. Very usefull for JIT alikes.</p>
<p><a href="http://entertheunknown.net">Kaja</a> is converting it for use in C for the <a href="http://blog.w-nz.com/archives/2005/03/12/introducing-paradox/">Paradox JIT</a>. Hopefully it&#8217;ll be a lot faster replacing virtual class function calls with macro&#8217;s.</p>
<p>Great stuff to play with <img src='http://blog.affien.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/04/02/softwire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# rapid game development</title>
		<link>http://blog.affien.com/archives/2005/01/30/c-rapid-game-development/</link>
		<comments>http://blog.affien.com/archives/2005/01/30/c-rapid-game-development/#comments</comments>
		<pubDate>Sun, 30 Jan 2005 00:32:16 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/01/30/c-rapid-game-development/</guid>
		<description><![CDATA[I&#8217;ve been working on a Direct 3d game in C++ for quite some while now. I recently tried using Direct 3d in C# and it took me only 15 minutes to get a basic framework running instead of the 5 hours in C++. Now I know that C# isn&#8217;t favoured for game developing for it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a Direct 3d game in C++ for quite some while now. I recently tried using Direct 3d in C# and it took me only 15 minutes to get a basic framework running instead of the 5 hours in C++. Now I know that C# isn&#8217;t favoured for game developing for it is slower; it is rapid development and a lot more maintainable.</p>
<p>I did some test on how much the difference would be between having a C# or C++ game engine.</p>
<p>The results were quite supprising:</p>
<ul>
<li>C# is slower, but when letting as much as possible be done by the graphics card and direct X instead of C# code the difference between C# and C++ is neglected also due to superior threading control and runtime memory managment of C#</li>
<li>C# develops a lot faster than C++, far faster than I expected initialy</li>
<li>Threading and timing the renders and other operations is a lot faster in C# than it is in C++. Also multithreading doesn&#8217;t generate as much problems in C# as it does in C++. And maybe even important; debugging threads in C# is a lot easier than in C++</li>
<li>The second critical area (after the rendering) is the gameplay engine. Most games need to use scripts for it is unfeasable to hardcode everything. C# doesn&#8217;t has to use scripts for using seperate .net dll&#8217;s works quite well and is hundreds times faster too</li>
</ul>
<p>I wonder what will be the first major game that will be written in .net. It certainly should atract some attention by game developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/01/30/c-rapid-game-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intrepid Countdown</title>
		<link>http://blog.affien.com/archives/2005/01/25/intrepid-countdown/</link>
		<comments>http://blog.affien.com/archives/2005/01/25/intrepid-countdown/#comments</comments>
		<pubDate>Tue, 25 Jan 2005 21:31:26 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[countdown]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2005/01/25/intrepid-countdown/</guid>
		<description><![CDATA[Very simple program I wrote in about 1 hour with c# (I love its productivity) to keep track of certain events:
http://w-nz.com/update/IntrepidCountDown-1.0.0.1.exe
It basicly runs in the background and notifies you of an event or a few minutes before one which you can add yourself.
]]></description>
			<content:encoded><![CDATA[<p>Very simple program I wrote in about 1 hour with c# (I love its productivity) to keep track of certain events:</p>
<p><a href="http://w-nz.com/update/IntrepidCountDown-1.0.0.1.exe">http://w-nz.com/update/IntrepidCountDown-1.0.0.1.exe</a></p>
<p>It basicly runs in the background and notifies you of an event or a few minutes before one which you can add yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2005/01/25/intrepid-countdown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intrepid C &#8211; &#8216;Objects&#8217; in C</title>
		<link>http://blog.affien.com/archives/2004/12/16/intrepid-c-objects-in-c/</link>
		<comments>http://blog.affien.com/archives/2004/12/16/intrepid-c-objects-in-c/#comments</comments>
		<pubDate>Thu, 16 Dec 2004 22:35:19 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2004/12/16/intrepid-c-objects-in-c/</guid>
		<description><![CDATA[I&#8217;m working on a library which can be used to achieve most OOP functionality of OO languages in C, by providing an API (not by extending the syntax).
I&#8217;ve  written 2 articles (artc. 1, artc. 2) so far about getting OO like behaviour in C, and will write a few more about the more advanced [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a library which can be used to achieve most OOP functionality of OO languages in C, by providing an API (not by extending the syntax).</p>
<p>I&#8217;ve  written 2 articles (<a href="http://blog.w-nz.com/archives/2004/12/14/objects-in-c/">artc. 1</a>, <a href="http://blog.w-nz.com/archives/2004/12/15/objects-in-c-2/">artc. 2</a>) so far about getting OO like behaviour in C, and will write a few more about the more advanced stuff which I&#8217;m still experimenting with.</p>
<p>You can download the source of the API I have developed so far <a href="http://blog.w-nz.com/uploads/cobject161204.zip">here</a>, which by the way is far from finished. Stuff will change, and I am aware of some issues.</p>
<p>I&#8217;ll explain how it works in the next parts in the &#8216;Objects in C&#8217; serie, but to give you a kickstart in the code I&#8217;ll explain it briefly:</p>
<p>Every object has got a pointer to its type and its toplevel object, which usualy is itself. The type instance pointed to from the instance provides the size, constructor, destructor and the interfacegetter.<br />
The <code>GetInterface</code> function in the type (the interfacegetter) returns a pointer to an instance of an object of the given type if supported by the object.<br />
Using interfaces can serve different purposes:</p>
<p><strong>Exposing certain objectwide functionality</strong></p>
<blockquote><p><code>((ICloneable*)object->top->type->GetInterface(object->top->type, object->top, GetICloneableType()))->Clone(object->top);</code></p></blockquote>
<p>This code will return a Clone of the <code>object</code>, even if only the object is passed by a not top level pointer. Using the <code>top</code> pointer ensures proper polyforism, and enables the ability for the top most class to hide, or show some internal functionality of wrapped objects.</p>
<p><strong>Exposing interface specific functionality</strong></p>
<blockquote><p><code>((String*)object->type->GetInterface(object->type, object, GetIToStringAble()))->ToString(object);</code></p></blockquote>
<p>It now depends on which interface of a certain object is passed which behaviour results.</p>
<p>And more.. and more.. which I will explain in the coming articles.</p>
<p><a href="http://blog.w-nz.com/uploads/cobject161204.zip">Download the source so far</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2004/12/16/intrepid-c-objects-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some more on my blog</title>
		<link>http://blog.affien.com/archives/2004/12/16/some-more-on-my-blog/</link>
		<comments>http://blog.affien.com/archives/2004/12/16/some-more-on-my-blog/#comments</comments>
		<pubDate>Thu, 16 Dec 2004 22:02:28 +0000</pubDate>
		<dc:creator>Bas Westerbaan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://blog.w-nz.com/archives/2004/12/16/some-more-on-my-blog/</guid>
		<description><![CDATA[I&#8217;m keeping this blog mainly to channel some thoughts about computer science (but probably about physics and other subjects which I find interesting too). I hope people will find the stuff I&#8217;ll write about interesting, and hopefully usefull. Most stuff I&#8217;ll post will as far as I know be quite new, or a new approach [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m keeping this blog mainly to channel some thoughts about computer science (but probably about physics and other subjects which I find interesting too). I hope people will find the stuff I&#8217;ll write about interesting, and hopefully usefull. Most stuff I&#8217;ll post will as far as I know be quite new, or a new approach to an existing issue. </p>
<p>It seems that so far 3 people have linked to an article on this blog (all of them to the <a href="http://blog.w-nz.com/archives/2004/12/14/objects-in-c/">Objects in C article</a>) already. (Thanks! without readers a webblog is quite useless!)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affien.com/archives/2004/12/16/some-more-on-my-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
