<?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>olivier deheurles</title>
	<atom:link href="http://odeheurles.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://odeheurles.com</link>
	<description>Just another programming weblog</description>
	<lastBuildDate>Sun, 10 Mar 2013 23:14:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Array of structs in .NET</title>
		<link>http://odeheurles.com/2013/03/array-of-structs-in-net/</link>
		<comments>http://odeheurles.com/2013/03/array-of-structs-in-net/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 23:03:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[GC]]></category>

		<guid isPermaLink="false">http://odeheurles.com/?p=70</guid>
		<description><![CDATA[This post is an answer to these twitts. Context: Martin has been describing a technique to implement arrays of structs in Java and Kelly is looking for something similar in .NET. As Martin pointed out, an array of structure in .NET offers the same caracteristics: reduced memory footprint compared to an array of objects GC friendly [...]]]></description>
				<content:encoded><![CDATA[<p>This post is an answer to these <a title="twitts" href="https://twitter.com/mjpt777/status/310482704347049984?uid=309928952&amp;iid=495b7a00-28a3-4587-a859-92c6ce554a3c&amp;nid=4+248&amp;t=1" target="_blank">twitts</a>.</p>
<p>Context: Martin has been describing a technique to implement <a title="arrays of structs" href="http://mechanical-sympathy.blogspot.ca/2012/10/compact-off-heap-structurestuples-in.html" target="_blank">arrays of structs in Java</a> and Kelly is looking for something similar in .NET.</p>
<p>As Martin pointed out, an array of structure in .NET offers the same caracteristics:</p>
<ul>
<li><span style="line-height: 13px;">reduced memory footprint compared to an array of objects</span></li>
<li>GC friendly</li>
</ul>
<p><span style="text-decoration: underline;"><strong>Memory footprint</strong></span></p>
<p>An array of object (reference type) is allocated on the GC heap and each cell contains a reference to an object (or a null reference) allocated on the GC heap as well.</p>
<p>The reference by iteself is of size 32 bits or 64 bits, depending on the architecture. Each object has as well a header of 64 or 128 bits depending, again, of the architecture.</p>
<p>An array of structures is as well allocated on the GC heap but in that case each structure value in stored directly in the array and the structure does not have a header.</p>
<p>The overhead of an array of objects compared to an array of structures is:</p>
<blockquote><p>Overhead = PTR_SIZE * 3 * ELEMENTS_COUNT</p></blockquote>
<p>where PTR_SIZE is the size of a pointer (ie. 32 or 64 bits) and ELEMENT_COUNT the number of elements in the array.</p>
<p>For small classes (ie. with few fields) the difference is significant.</p>
<p><span style="text-decoration: underline;"><strong>Impact on GC</strong></span></p>
<p>When you allocate an array of structure of size N you actually allocate enough memory to store N instances of this structure on the GC heap.</p>
<p>For instance:</p>
<blockquote><p>var arrayOfStruct = new DateTime[100];</p></blockquote>
<p>create an array of DateTime (DateTime is a struct) of size 100 (ie. 100 contigus blocks of size sizeof(DateTime))</p>
<p><span style="text-decoration: underline;">Writing to the array</span></p>
<blockquote><p>var aStruct = new DateTime(2013, 12, 12);<br />
arrayOfStruct[0] = aStruct;</p></blockquote>
<p>The first line allocates a new DateTime, since this is a struct it is not allocated on the heap but on the stack.</p>
<p>The second line assign the date to element 0 of the array, effectively copying the value to element 0 of the array.</p>
<p>Those 2 lines do not allocate anything on the GC heap.</p>
<p><span style="text-decoration: underline;">Mutating a structure within the array</span></p>
<p>In this example we have replaced completly the element at index 0 but if the structure is mutable it is also possible to mutate directly any element:</p>
<blockquote><p>var arrayOfMutableStruct = new MutableStruct[5];<br />
arrayOfMutableStruct[0].Field1 = 5;</p></blockquote>
<p>Normally any method returning a value type returns a copy but arrays are very special: in the previous example arrayOfMutableStruct[0] is effectively the instance stored within the array and not a copy of it, thus the assignement will work as expected and Field1 will have value 5 (within the array).</p>
<p>Another way of mutating a struct contained within an array is to use the ref keyword in a parameter of a function:</p>
<blockquote><p>public struct MutableStruct<br />
{<br />
public int Field1;<br />
public override string ToString()<br />
{<br />
return Field1.ToString();<br />
}<br />
}</p>
<p>class Program<br />
{<br />
static void Main()<br />
{<br />
var array = new MutableStruct[1];</p>
<p>Mutate(ref array[0]);</p>
<p>Console.WriteLine(array[0]);<br />
Console.ReadKey();<br />
}</p>
<p>static void Mutate(ref MutableStruct mutable)<br />
{<br />
mutable.Field1 = 32;<br />
}<br />
}</p></blockquote>
<p>Output: 32</p>
<p><span style="text-decoration: underline;">Note</span>: it is generally advised to design only immutable structures in .NET (just google it to find why).</p>
<p>Back to the GC now: we have seen several ways of modifying the data contained in an array of struct and none of them allocates anything on the heap (ie. does not trigger any GC).</p>
<p><span style="text-decoration: underline;"><strong>GC impact, part 2</strong></span></p>
<p>Ok we have seen that it is posssible to write algorithm which can read and write to an array of struct without triggering any GC, this is interresting but what if another part of the system triggers a GC: is our array of struct an expensive data structure for the GC to analyse or not?</p>
<p>The answer is that if you structure <span style="text-decoration: underline;">does not reference any reference type</span> (ie. contains a reference to an object), the cost is extremly low: when the GC look at the array it checks its type. If the type of the array is a value type (structure) which does not reference any reference type, the GC has finished its job for the full array and does not have to visit its elements. <a href="http://blogs.msdn.com/b/maoni/">Maoni Stephens</a> (.NET GC dev) explains this behavior of the GC in a Channel9 video. I just had a quick look and could not find it anymore&#8230; sorry :(</p>
<p>For an array of object this is a different story: the GC has to go through each element.</p>
<p>NOTE: we often see algorithms which are &#8220;allocation free/GC Free&#8221; on some specific data structures and think &#8220;That&#8217;s great, if I stick that in my codebase it will cost nothing to the GC&#8221; but that&#8217;s wrong. Maybe the algo won&#8217;t trigger GCs but another part of our system can trigger a GC and during that GC, traversing the datastructure in question might be expensive (ie. long GC pauses).</p>
<p><span style="text-decoration: underline;"><strong>Conclusion</strong></span></p>
<p>Array of structures are probably the most GC friendly multi-element data structures in .NET: it is possible to store a large amount of data, mutate them and read from them without triggering any GC (ie. allocation free). And on top of that, even if another part of the system triggers a GC, the array of struct is very quick analyse.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2013/03/array-of-structs-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>High performance Journaler</title>
		<link>http://odeheurles.com/2011/12/high-performance-journaler/</link>
		<comments>http://odeheurles.com/2011/12/high-performance-journaler/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 16:23:10 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[High Performance]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2011/12/high-performance-journaler/</guid>
		<description><![CDATA[As you may know I&#8217;ve spend some time porting the disruptor to .NET and I&#8217;m now quite happy with the current version. If you want to have a look you can find the source code on GitHub or play with the assemblies available on NuGet. Of course feel free to fork and send pull request, [...]]]></description>
				<content:encoded><![CDATA[<p>As you may know I&#8217;ve spend some time porting the <a href="http://code.google.com/p/disruptor/" target="_blank">disruptor</a> to .NET and I&#8217;m now quite happy with the current version. If you want to have a look you can find the source code on <a href="https://github.com/odeheurles/Disruptor-net" target="_blank">GitHub</a> or play with the assemblies available on <a href="http://nuget.org/packages/Disruptor" target="_blank">NuGet</a>.</p>
<p>Of course feel free to fork and send pull request, I will do my best to merge your new goodies to the main repo.</p>
<p>I&#8217;m now planning to implement other core components described in <a href="http://www.infoq.com/presentations/LMAX" target="_blank">Martin&#8217;s/Mike&#8217;s presentation</a>. The next one on the list is the <strong>journaler</strong>.</p>
<p>Here is a quick overview of this component:</p>
<ul>
<li>it is responsible of persisting to disk every single message (byte array) received from the network adapter</li>
<li>it is consuming messages from a ring buffer (disruptor) and should store messages to disk as fast as possible (minimize latency and maximize throughput)</li>
<li>it is a mono-threaded component, writing to disk serially</li>
<li>since the disruptor can deliver messages in batch, the journaler should take advantage of this mechanism: if multiple messages are available in the ring buffer the journaler thread should pick as many messages as possible before flushing to disk (nice mechanism to absorb messages bursts)</li>
<li>the journaler should be designed with mechanical sympathy in mind: data is send to disk by <a href="http://en.wikipedia.org/wiki/Block_(data_storage)" target="_blank">block</a>, filling blocks as much as possible before flushing to disk sounds like a good idea..</li>
<li>the journaler should minimize allocations (GC pressure) and ideally be alloc free</li>
<li>of course messages should be persisted to disk in a binary format that allow messages to be read later on and the journaler API should offer both read and write functionalities</li>
</ul>
<p>You can find a more in depth overview of the Journaler and other LMAX components in <a href="http://martinfowler.com/articles/lmax.html" target="_blank">Martin Fowler’s review of the LMAX architecture</a>.</p>
<p>I&#8217;m going to create a new GitHub project to host this component. My plan is to first define the journaler API, then build a performance test project and then I will play around to test different implementations. I would like this component to be stand-alone and have no dependency on third party components (disruptor included).</p>
<p>If you are interested and want to contribute let me know: <em>mail at odeheurles dot com</em></p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2011/12/high-performance-journaler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leveraging the tube</title>
		<link>http://odeheurles.com/2011/11/leveraging-the-tube/</link>
		<comments>http://odeheurles.com/2011/11/leveraging-the-tube/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 16:47:21 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2011/11/leveraging-the-tube/</guid>
		<description><![CDATA[It is not always easy to find time to learn new things and the best time I have found is the London transport: like lots of people I spend between 1 hour and 1 hour and a half per day in the tube and I’m trying spend this time intelligently, ie. not playing angry birds. [...]]]></description>
				<content:encoded><![CDATA[<p>It is not always easy to find time to learn new things and the best time I have found is the London transport: like lots of people I spend between 1 hour and 1 hour and a half per day in the tube and I’m trying spend this time intelligently, ie. not playing angry birds. </p>
<p>If you think about it, that’s 6-8 hours per week you&#160; can spend learning new stuff! That’s a lot…</p>
<p>&#160;</p>
<h2>Books</h2>
<p>Computer science books are generally massive beasts and I do not want to carry them in the tube, I generally use my iPad instead. <a href="http://www.goodiware.com/" target="_blank">GoodReader</a> and <a href="http://www.dropbox.com/" target="_blank">DropBox</a> is my preferred combo: I just organize my books within the DropBox folder on my PC and then synchronize GoodReader with the book folder, works very well over Wi-Fi or even 3G.</p>
<p>&#160;</p>
<h2>Videos</h2>
<p>I watch lots of videos, my preferred sources are:</p>
<ul>
<li><a href="http://channel9.msdn.com/" target="_blank">Channel9</a>: videos are available in mp4 directly so you do not need to do any conversion to put them on iPhone or iPad</li>
<li><a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/" target="_blank">MIT OpenCourseWare (OCW)</a>: you can access directly lots of MIT undergraduate and graduate courses for free and some of them are available in video format. Example: <a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/" target="_blank">Introduction to Algorithm</a> contains 25 lectures, all available in mp4 format.</li>
<li><a href="http://www.apple.com/education/itunes-u/" target="_blank">iTunes U</a>: you have probably already used iTunes, but maybe not iTunes U. Instead of browsing music or videos you can access courses from the best Universities. Example: <a href="http://itunes.apple.com/us/itunes-u/programming-massively-parallel/id384233322" target="_blank">Programming Massively Parallel Processors with CUDA</a>, 16 lectures on NVidia CUDA. iTunes U is really friction less: subscribe to course, synchronize with iPhone/iPad, done.</li>
</ul>
<p>When I find videos which are not in mp4 format I use <a href="http://www.mediacoderhq.com/" target="_blank">MediaCoder</a> video encoder: it’s free, easy to use and configure, it has templates for iPhone and iPad screen resolutions, can use your GPU (fast) and support batch encoding: you setup several videos to encode and MediaCoder will process them one after the other automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2011/11/leveraging-the-tube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A first look at CQRS or How push can help you quit smoking</title>
		<link>http://odeheurles.com/2011/07/a-first-look-at-cqrs-or-how-push-can-help-you-quit-smoking/</link>
		<comments>http://odeheurles.com/2011/07/a-first-look-at-cqrs-or-how-push-can-help-you-quit-smoking/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 21:14:21 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[CQRS]]></category>
		<category><![CDATA[Middleware]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2011/07/a-first-look-at-cqrs-or-how-push-can-help-you-quit-smoking/</guid>
		<description><![CDATA[I&#8217;ve heard several colleagues of mine talking about CQRS and I spend some time today looking it. If you want to understand what it is about please have a look here: - AxomFramework (Java) - NCQRS (.NET) - Udi Dahan has a detailed post “Clarified CQRS” Let&#8217;s have a look to the architecture diagram (I [...]]]></description>
				<content:encoded><![CDATA[<p align="left">I&#8217;ve heard several colleagues of mine talking about CQRS and I spend some time today looking it.</p>
<p align="left">If you want to understand what it is about please have a look here:<br />
- <a href="http://code.google.com/p/axonframework/wiki/Documentation?tm=6" target="_blank">AxomFramework</a> (Java)<br />
- <a href="http://ncqrs.org/reference/" target="_blank">NCQRS</a> (.NET)<br />
- Udi Dahan has a detailed post “<a href="http://www.udidahan.com/2009/12/09/clarified-cqrs/" target="_blank">Clarified CQRS</a>”</p>
<p align="left">
<p align="left">Let&#8217;s have a look to the architecture diagram (I will use Udi&#8217;s one):</p>
<p align="left"><img src="http://www.udidahan.com/wp-content/uploads/cqrs.png" alt="CQRS" /></p>
<p align="left"><span style="text-decoration: underline;">Figure 1: Udi’s CQRS architecture diagram</span></p>
<p align="justify">
<p align="justify">We are currently using this type of architecture in several areas for the project I&#8217;m working on, but the flow is actually different: user does not pull for data, it is pushed to him (or to be more accurate the client pulls the data once and is then notified of changes to stay in sync).</p>
<p align="justify">Let&#8217;s look at a real use case: the user is using a UI to trade in real-time. When the application starts-up the UI retrieves the list of trades for this user and, the same time, notifies the server of his interest for trade events (i.e. the server stores a subscription for this user).</p>
<p align="left"><a href="http://odeheurles.com/wp-content/uploads/2011/07/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" src="http://odeheurles.com/wp-content/uploads/2011/07/image-thumb.png" border="0" alt="image" width="516" height="215" /></a></p>
<p align="left"><span style="text-decoration: underline;">Figure 2: Application start-up, trade subscription</span></p>
<p align="left">
<p align="justify">You might say it does not looks like Udi’s diagram&#8230; Wait! We will get there.</p>
<p align="justify">
<p align="justify">Ok, now let’s look at what happens if the user decides to trade:</p>
<ul>
<li>
<div>a trade request (command) is send to an execution engine which will do lots of fancy checks (does this client has enough credit? Is the price valid? etc.). You have 2 possible output to this workflow: all checks pass and the trade is done or one of the check fails and the trade is rejected. We will focus here on the happy path</div>
</li>
<li>
<div>as soon as the decision has been taken several things needs to happen:</div>
<ul>
<li>
<div>the user needs to be acknowledged of the success or the failure of the transaction</div>
</li>
<li>
<div>the back office system needs to be notified (this is where the trades will actually be booked (other stored in a big database if you prefer)</div>
</li>
<li>
<div>other users needs to be notified of this trade: for instance the sales responsible of this client and other users belonging to the same client (client=company) want to be aware of this trade.</div>
</li>
</ul>
</li>
</ul>
<p align="left"><a href="http://odeheurles.com/wp-content/uploads/2011/07/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" src="http://odeheurles.com/wp-content/uploads/2011/07/image-thumb1.png" border="0" alt="image" width="514" height="303" /></a></p>
<p align="left"><span style="text-decoration: underline;">Figure 3: execution flow</span></p>
<p align="left"><img src="http://www.udidahan.com/wp-content/uploads/cqrs.png" alt="CQRS" /></p>
<p align="left">
<p align="left">
<p align="justify">Now the picture looks like the CQRS one but there is <strong>one major difference</strong>: the guy on the picture is looking the other way around. No, not this one… The trade notifications have been pushed to all users affected by the state change. If you look at the CQRS architecture the client is pulling for the data (the query).</p>
<p align="justify">
<p align="justify">Let’s review a typical user experience for a classical data driven app (or CQRS oriented):</p>
<ul>
<li>
<div>Bob opens order view with order 1</div>
</li>
<li>
<div>Sara opens order view with order 1</div>
</li>
<li>
<div>Bob modifies order 1</div>
</li>
<li>
<div>Sara has stale data and she does not know yet</div>
</li>
<li>
<div>Sara continue doing some stuff on order 1, have a coffee and a cigarette and finally commit 20 minutes latter her work</div>
</li>
<li>
<div>At this stage 2 things can happen:</div>
<ul>
<li>
<div>developers did not thought their systems could be used by more than 1 user at the same time and Bob just lost all his work: it has been overridden by Sara and he does not even know that it happened (he may figure out end of month when they will review all the orders)</div>
</li>
<li>
<div>developers did a better job and implemented optimistic locking and Sara is happy to learn that she can not save her work and has to do it again. She smashes her keyboard (which surprises Bob sitting right next to her) and she goes outside for another cigarette.</div>
</li>
</ul>
</li>
</ul>
<p align="justify">In both scenarios you could improve user experience by polling the server to see if the data has changed and notify the user if it’s the case, but this kind of architecture is not scalable, at all.</p>
<p align="justify">
<p align="justify">Pushing the data to the client when it changes is, from my perspective, a far better way to handle the problem:</p>
<ul>
<li>
<div>users are notified in real time when a particular piece of information has changed: there is still a time window where the data is stale for some users but this window is of the order of the second (or the millisecond if you add a few million $), not an undetermined amount of time. Optimistic locking is still required but conflicts are less likely to happen,</div>
</li>
<li>
<div>this significantly improves users collaboration. And instead of notifying only when the data is changed, users can be notified who is currently working on the same piece of data with the same mechanisms: Sara see in the status bar that  “Bob is modifying this order” and she asks him to tell her when  he is done with this order. Sara is not stressed and do not need a cigarette.</div>
</li>
<li>
<div>this architecture is a lot more scalable than a pull model and network traffic is significantly reduced</div>
</li>
</ul>
<p align="justify">I don’t understand why CQRS, which is using asynchronous notification mechanism sever side is not applying the same technics for the client.</p>
<p align="justify">
<p align="justify">It is not harder to have the UI layer notified asynchronously: there are now lots of enterprise grade technologies out there accessible to everybody: 0MQ, RabbitMQ, and lots of http push (or COMET) servers can be used to implement what I just described here in LAN or over the web.</p>
<p align="justify">
<p align="justify">A push system would probably delay Sara’s cancer of a good couple of years…</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2011/07/a-first-look-at-cqrs-or-how-push-can-help-you-quit-smoking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>disruptor-net</title>
		<link>http://odeheurles.com/2011/07/disruptor-net/</link>
		<comments>http://odeheurles.com/2011/07/disruptor-net/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 14:03:25 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://odeheurles.com/?p=59</guid>
		<description><![CDATA[If you are concerned by performance, you will probably have heard about LMAX and their disruptor pattern. If not you should have a look to this video and to this white paper first. LMAX team released the concurrency framework at the heart of their system about one month ago and I decided to port it [...]]]></description>
				<content:encoded><![CDATA[<p>If you are concerned by performance, you will probably have heard about LMAX and their disruptor pattern. If not you should have a look to this <a title="Disruptor presentation @ QCon SF" href="http://www.infoq.com/presentations/LMAX" target="_blank">video</a> and to this <a href="http://disruptor.googlecode.com/files/Disruptor-1.0.pdf">white paper</a> first.</p>
<p>LMAX team released the concurrency framework at the heart of their system about one month ago and I decided to port it to .NET.</p>
<p>The source code, unit tests and performance tests have all been ported to .NET and current trunk is in sync with latest Javav version. Performance tests show equivalent level of performance for Java and .NET versions.</p>
<p>If you are interested you can have a look to the <a title="Disruptor-net" href="http://code.google.com/p/disruptor-net/" target="_blank">disruptor-net project</a> on google code and participate to the discussions on the <a href="http://groups.google.com/group/disruptor-net">.NET discussion group</a> or the <a href="http://groups.google.com/group/lmax-disruptor">Java discussion group</a></p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2011/07/disruptor-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nirvana 6 &#8211; What&#8217;s new?</title>
		<link>http://odeheurles.com/2011/02/nirvana-6-whats-new/</link>
		<comments>http://odeheurles.com/2011/02/nirvana-6-whats-new/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 20:37:15 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Nirvana]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2011/02/nirvana-6-whats-new/</guid>
		<description><![CDATA[My-channels is currently working on version 6 of Nirvana which should be released end Q1/beginning Q2. I’m going to quickly run through the new features: Direct Data Delivery Direct Data Delivery (DDD) is the main new addition to the product, it is a new message delivery paradigm. Before starting, a bit of background: as you [...]]]></description>
				<content:encoded><![CDATA[<p>My-channels is currently working on version 6 of Nirvana which should be released end Q1/beginning Q2. I’m going to quickly run through the new features:</p>
<h2>Direct Data Delivery</h2>
<p><strong>Direct Data Delivery (DDD)</strong> is the main new addition to the product, it is a new message delivery paradigm.</p>
<p>Before starting, a bit of background: as you may know Nirvana is used by several banks within their <a href="http://en.wikipedia.org/wiki/Single-Dealer_Platform">SDP</a> (Single Dealer Platform). What is a SDP you may ask? Most of the financial institutions offer to their clients trading applications available on the Web, generally via a Rich Internet Application (Silverlight, Flex, HTML, etc.) or a Rich Client (Java, .NET). Clients can see bank’s prices and trade in real-time. In these environments you have pretty serious requirements for messaging: you need to:</p>
<ul>
<li> push prices over internet (HTTP generally mandatory to cross firewalls and proxies) to clients,</li>
<li>have guaranteed message delivery for trade execution and order management.</li>
</ul>
<p>Nirvana covers these requirements but it is still challenging to design and implement the price distribution.</p>
<p>Why?</p>
<ul>
<li>because prices are generally distributed by tier levels associated to client groups or even with specific price per client. Mapping this distribution topology to JMS Topics (called Channels in Nirvana) is not always easy: if a client can only see one level of tiering you need to make sure he can’t see other levels by defining properly Channels granularity and ACLs.</li>
<li>you may have to dynamically create channels or queues at runtime, this requires Nirvana admin API, adding a bit of complexity in the system.</li>
<li>to summarize the JMS model fits pretty well when you need to communicate between server side applications in LAN or WAN. You just have to define a static Channel/Queue schema with static ACLs. But when you are dealing with external users it’s different: you have to grant them ACLs dynamically when they are authenticating.</li>
</ul>
<p>Direct Data Delivery (DDD) is going to be very useful for these kind of scenarios, let me explain how it works: when the client API connects to the realm it can choose to subscribe to a <strong>Data Stream</strong>; clients can have only one Data Stream per active Nirvana session. On publisher side you can create, with required ACLs, an other type of resource called <strong>Data Group </strong>and associate different clients data streams with these data groups. You can then publish messages to a data group and Nirvana will automatically deliver them to clients contained within the group.</p>
<p>How does it helps in the SDP scenario?</p>
<ul>
<li>no need to create dynamically channels with the Admin API: data groups can be created dynamically with the Nirvana client API,</li>
<li>client-side implementation is simplified: you no longer have to subscribe to the different channels used for price distribution, every thing can be managed server-side securely.</li>
<li>it’s very easy to change client’s from one tiering group to another: remove it’s data stream from one data group and add it to an other one</li>
<li>DDD will support all the useful features required to distribute price efficiently: <strong>last tick cache with delta delivery enabled</strong> (snapshot + partial updates) and <strong>conflation</strong></li>
</ul>
<h2>API Batching</h2>
<p>The client API now provides batching for find and find + subscribes to channels. Very useful again with client scenarios (latency is higher over internet than in LAN so batching is always helpful).</p>
<h2>A new .NET API with RX Extensions</h2>
<p>Nirvana is a Java product and the .NET API has been designed based on the Java API, so it looks a bit &#8216;”Java” from the eyes of a .NET developer ;-)</p>
<p>The new .NET API has been redesigned to provide a better experience for .NET developers and also provides access to the DDD and batching functionalities.</p>
<p>On top of that you can plug Rx (Microsoft <a href="http://msdn.microsoft.com/en-us/devlabs/ee794896">Reactive Extensions</a>) to get Nirvana event streams exposed as IObservable. I’m not going to explain here what is Rx, you can find lots of information on the <a href="http://msdn.microsoft.com/en-us/devlabs/ee794896">DevLabs web site</a>, on the <a href="http://social.msdn.microsoft.com/Forums/en-US/rx/threads">forum</a> or for instance on blogs of some of my mates <a href="http://leecampbell.blogspot.com/">here</a> and <a href="http://enumeratethis.com/">here</a>.</p>
<p>Stay tuned…</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2011/02/nirvana-6-whats-new/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hardware, Parallel computing and stuff&#8230;</title>
		<link>http://odeheurles.com/2011/02/hardware-parallel-computing-and-stuff/</link>
		<comments>http://odeheurles.com/2011/02/hardware-parallel-computing-and-stuff/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 17:11:34 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Parallel Computing]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2011/02/hardware-parallel-computing-and-stuff/</guid>
		<description><![CDATA[About one month ago I watched a video describing the architecture of LMAX (Financial Exchange) and realized that I did not know that much about hardware. I made some researches and found really good documents, blogs and videos and I thought it may be a good idea to share my findings… First I would recommend [...]]]></description>
				<content:encoded><![CDATA[<p>About one month ago I watched a video describing the architecture of LMAX (Financial Exchange) and realized that I did not know that much about hardware. I made some researches and found really good documents, blogs and videos and I thought it may be a good idea to share my findings…</p>
<p><strong></strong></p>
<p>First I would recommend to have a look at <a href="http://www.infoq.com/presentations/LMAX">LMAX &#8211; How to Do 100K TPS at Less than 1ms Latency</a> presented by <strong>Martin Thompson</strong> and <strong>Michael Barker</strong>, in about one hour it gives a pretty good overview of the challenges you have to face when building a HPC system with high level of contended concurrency. Comments below the video also worth having a look to get more details on there architecture.</p>
<p>Then there is an excellent paper from <strong>Ulrich Drepper</strong> (Red Hat): <a href="http://www.akkadia.org/drepper/cpumemory.pdf">What Every Programmer Should Know About Memory</a>. It presents current commodity hardware architectures focusing on :</p>
<ul>
<li>RAM &#8211; don’t be afraid by this first part, you can skip most of it,</li>
<li>CPU Caches, cache coherency protocols, etc. – very interesting and important to understand too</li>
<li>Virtual memory</li>
<li>the second half of the document focuses on “what programmers can do” (must read) and “Memory performance tools” (relevant if you are working on Linux systems).</li>
</ul>
<p><strong>Paul E. McKenney</strong>, working on Linux kernel, is writing a book on parallel programing: <a href="http://kernel.org/pub/linux/kernel/people/paulmck/perfbook/perfbook.html">Is Parallel Programming Hard, And, If So, What Can You Do About It?</a> I won’t give a feedback yet because I’ve not yet finished it yet but I can already say that it&#8217;s really worth reading.</p>
<p>I have read as well several white papers from <strong>Herb Sutter</strong> (one of the C++ big names), you can find them on his <a href="http://www.gotw.ca/">web site</a>, in his <a href="http://www.gotw.ca/publications/index.htm">books and articles</a> section. If you prefer videos there is “<a href="http://video.google.com/videoplay?docid=-4714369049736584770">Machine Architecture: Things Your Programming Language Never Told You</a>”<strong> </strong>video on YouTube with corresponding <a href="http://www.nwcpp.org/Downloads/2007/Machine_Architecture_-_NWCPP.pdf">pdf slides</a>.</p>
<p>Interested by parallel programming and wants to learn more about wait-free, lock-free, obstruction free, etc.? If you are, you should really go on <strong>Dmitry Vyukov’</strong>s website <a href="http://www.1024cores.net/">1024cores</a> and read the introduction and articles in order, they are pretty quick to read but very informative. You will find as well lots of algorithms and data structures for parallel programming – MUST READ. You should subscribe to it’s <a href="http://blog.1024cores.net/">blog</a> as well.</p>
<p>All documents and videos above are presented from the perspective of <strong>Linux/C++/Java</strong> but are very relevant even for a <strong>Windows/.NET</strong> developer.</p>
<p>Now if you want to learn more about Windows and .NET I would recommend:</p>
<ul>
<li><a href="http://www.bluebytesoftware.com/blog/Default.aspx">Joe Duffy</a>’s blog and <a href="http://www.amazon.com/exec/obidos/ASIN/032143482X/bluebytesoftw-20">book</a> are must read for parallel programming on Windows,</li>
<li>Interested by internals of .NET Garbage collector? <strong>Maoni Stephens</strong>, working on the GC, presents latest evolutions of the .NET 4 GC in a <a href="http://channel9.msdn.com/Shows/Going+Deep/Maoni-Stephens-and-Andrew-Pardoe-CLR-4-Inside-Background-GC">Channel9 video</a>, read here <a href="http://blogs.msdn.com/b/maoni/">blog</a> for more details.</li>
<li><strong>Patrick Dussud</strong>, one of the <a href="http://www.microsoft.com/presspass/exec/techfellow/default.mspx">Microsoft Technical Fellows</a>, and one of the CLR founders and chief architect of the .NET Garbage Collector, has some videos on the .NET GC internals <a href="http://channel9.msdn.com/Shows/Going+Deep/E2E-Erik-Meijer-and-Patrick-Dussud-Inside-Garbage-Collection">here</a> and <a href="http://channel9.msdn.com/Shows/Going+Deep/Patrick-Dussud-Garbage-Collection-Past-Present-and-Future">here</a>. You will notice that I’m not the only French guy with an horrible English accent ;)</li>
<li>I’ve downloaded as well the open source code of the .NET platform (<a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8c09fd61-3f26-4555-ae17-3121b4f51d4d&amp;displaylang=en">Rotor</a>). You should really have a look. For instance you can find the C++ source code of the execution engine (\sscli20\clr\src\vm) and the corresponding BCL code in .NET (\sscli20\clr\src\bcl\system). Did you ever wondered how .NET objects are stored internally? Where is the implementation of “extern” methods for the BCL classes? It’s there! The document <a href="http://tmd.havit.cz/Teaching/CSharp/Lecture5/ObjectInternals.pdf">Object Internals</a> is a good companion to start browsing this large code base.</li>
<li><strong>CLR</strong>: <strong>Vance Morrison</strong> <a href="http://blogs.msdn.com/b/vancem/">blog</a> and <strong>Jeffrey Richter</strong>’s <a href="http://www.wintellect.com/cs/blogs/jeffreyr/default.aspx">blog</a> and book <a href="http://oreilly.com/catalog/9780735627048">CLR via CSharp</a></li>
<li><strong>Windows internals</strong>: <strong>Mark Russinovich</strong>, Technical Fellow and Windows Kernel guru, has a good video “<a href="http://channel9.msdn.com/Shows/Going+Deep/Mark-Russinovich-Inside-Windows-7">Inside Windows 7</a>” on Channel9 and his book <a href="http://www.amazon.com/Windows%C2%AE-Internals-Including-Windows-PRO-Developer/dp/0735625301/ref=sr_1_2?ie=UTF8&amp;qid=1297606217&amp;sr=8-2">Windows Internals</a>, the absolute reference for Windows’ OS core.</li>
</ul>
<p>Other interesting stuff to read:</p>
<ul>
<li><strong>Ring Buffer</strong> implementations (CPU Cache friendly + optimisations): <a href="www.cse.cuhk.edu.hk/~pclee/www/pubs/ancs09poster.pdf">MCRingBuffer</a> and <a href="www.cgo.org/cgo2010/epic8/papers/jablin.pd">LibertyQueue</a> white papers,</li>
<li><strong>False sharing</strong>: <a href="http://www.codeproject.com/KB/threads/FalseSharing.aspx">here</a> and <a href="http://www.drdobbs.com/go-parallel/article/showArticle.jhtml;jsessionid=RERQXXL0GPUPHQE1GHOSKH4ATMY32JVN?articleID=217500206">here</a> (<strong>Herb</strong> <strong>Sutter</strong> strikes back)</li>
</ul>
<p>Last thing to say: I’ve been reading quite a lot lately and it’s pretty hard to keep track of what you have read, what you would like to read, etc.</p>
<ul>
<li>I’ve found <a href="http://readitlaterlist.com/">Read It Later</a> service extremely useful: it integrates with your browser  (Chrome for me), a single click and you have added a document to your list of stuff to read and your mobile devices (iPhone, iPad for me) get synchronized automatically. It works quite well for HTML pages.</li>
<li>For PDFs on Ipad/iPhone, <a href="http://www.goodreader.net/goodreader.html">GoodReader</a> is a must. Note that it can connect to your DropBox if you have one, very useful to share documents between devices.</li>
</ul>
<p>Enjoy…</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2011/02/hardware-parallel-computing-and-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nirvana Part V: Merge Engine and Delta Delivery</title>
		<link>http://odeheurles.com/2010/10/nirvana-part-v-merge-engine-and-delta-delivery/</link>
		<comments>http://odeheurles.com/2010/10/nirvana-part-v-merge-engine-and-delta-delivery/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 23:55:07 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Nirvana]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2010/10/nirvana-part-v-merge-engine-and-delta-delivery/</guid>
		<description><![CDATA[In previous post we have seen how we can use a channel key to keep the last value of a sequence of events. If you have a channel key defined on a channel you can use an optimization to reduce the bandwidth used inbound and outbound of Nirvana called delta delivery. Instead of publishing a [...]]]></description>
				<content:encoded><![CDATA[<p>In previous post we have seen how we can use a channel key to keep the last value of a sequence of events. If you have a channel key defined on a channel you can use an optimization to reduce the bandwidth used inbound and outbound of Nirvana called delta delivery. Instead of publishing a new event for each update, you can publish only the changes and Nirvana will merge these updates within the current value and dispatch the changes to the different subscribers.</p>
<p>There are some restrictions to be able to use the merge engine:</p>
<ul>
<li>as I said previously you need a channel key defined,</li>
<li>only the properties of the event can be merged, this does not work if you’re using the byte array payload,</li>
<li>you need a flat data structure, the merge engine does not work with nested properties</li>
</ul>
<h2>Publisher</h2>
<p>You just need to create a <strong>nRegisteredEvent</strong> on the channel to be able to publish partial updates, here is a sample:</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/delta.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="delta" src="http://odeheurles.com/wp-content/uploads/2010/10/delta-thumb.png" border="0" alt="delta" width="436" height="100" /></a></p>
<p>You need to publish a full update (snapshot) on the first update to properly initiate the last value cache.</p>
<h2></h2>
<h2>Subscriber</h2>
<p>You can continue using the same API when using delta delivery: the client API will receive a snapshot on subscription and will merge the updates providing you with a reconstructed <strong>nConsumeEvent</strong> on each update.</p>
<p>Additionally if you want to get the partial update, you can use the <strong>nRegisteredEventListener’s</strong> update method to get a<strong> nConsumeEvent</strong> containing updated fields only.</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/update.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="update" src="http://odeheurles.com/wp-content/uploads/2010/10/update-thumb.png" border="0" alt="update" width="382" height="56" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2010/10/nirvana-part-v-merge-engine-and-delta-delivery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nirvana Part IV: Channel Keys</title>
		<link>http://odeheurles.com/2010/10/nirvana-part-iv-channel-keys/</link>
		<comments>http://odeheurles.com/2010/10/nirvana-part-iv-channel-keys/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 19:39:25 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Nirvana]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2010/10/nirvana-part-iv-channel-keys/</guid>
		<description><![CDATA[We have reviewed in Part I how Nirvana stores events within a channel and how you can control events expiration using TTL (time to live) and capacity. An other way to purge events is to use channel keys. Let say we have a channel containing blog posts. Each time a new post is add we [...]]]></description>
				<content:encoded><![CDATA[<p>We have reviewed in Part I how Nirvana stores events within a channel and how you can control events expiration using TTL (time to live) and capacity. An other way to purge events is to use channel keys.</p>
<p>Let say we have a channel containing blog posts. Each time a new post is add we publish a message to this channel. If we modify a blog post, we don’t care about the previous version, we just want to keep the last value of the blog post in the channel. To achieve that we just have to define a channel key named “blogID” on the channel and when we publish a blog post we define a property (nEventProperty) blogID and set the value to the identifier of the post.</p>
<p>Let say we publish a blog post message for the blogID=1. If we modify the blog post and then publish a new message for blogID=1, Nirvana will automatically remove the previous version from the channel. So now, if somebody subscribes on this channel it will automatically get the latest version only (and not 2 or more versions of the same blog post).</p>
<p>When creating a channel key you can specify how many “versions” of each element you want to keep: there is a <strong>depth</strong> property associated with each channel key.</p>
<p>In the previous example, if we specify a depth of 5 for our blogID channel key, Nirvana will keep the last 5 versions for each blogID.</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/channelkey.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="channelKey" src="http://odeheurles.com/wp-content/uploads/2010/10/channelkey-thumb.png" border="0" alt="channelKey" width="353" height="354" /></a></p>
<p>Since channels can store state, you want to make sure you channels are not growing indefinitely: using a channel key with depth 1 you are guaranteed that only the latest value is kept on the channel.</p>
<h2>Using a channel as a distributed cache</h2>
<p>A channel with a channel key is nothing less than a distributed cache where your data is indexed by the channel key. If you dispose of a clustered channel, your data is reliably replicated over the different nodes of the cluster. And since this is a channel, your consumers get notified each time an element changes in the cache.</p>
<p>Depending on the size of the cached data, you may want to store your messages in memory (reliable or simple channel types) or on disk (persistent channel type).</p>
<h2></h2>
<h2>Building a local cache on top of a channel</h2>
<p>Depending on the use case you may want to build an in-memory copy of the channel data, this way you can do quick lookups in your cache instead of going back to Nirvana. If your instance fails you just have to subscribe again on the channel to restore the current state of your cache.</p>
<h2>Detecting stale data</h2>
<p>If the data stored in your channel is not static (ie. can change) you probably want to make sure it is always up to date. Imagine that the publisher of the information fails: the data would no longer be published to the channel and your consumer would be using stale data. To detect this failure you can for instance decide to publish heartbeats on a predefined value of the channel key. For instance if blogID is your channel key you publish on a regular basis an event with a property blogID=heartbeat. On the subscriber side, you keep track of the heartbeats and make sure it is properly received. If you miss several heartbeats you can decide how to react (this completely depends of your use case…)</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2010/10/nirvana-part-iv-channel-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nirvana Part III: Subject Filtering</title>
		<link>http://odeheurles.com/2010/10/nirvana-part-iii-subject-filtering/</link>
		<comments>http://odeheurles.com/2010/10/nirvana-part-iii-subject-filtering/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 16:51:00 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Nirvana]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2010/10/nirvana-part-iii-subject-filtering/</guid>
		<description><![CDATA[Subject filtering has been implemented quite recently in Nirvana and has been enhanced in the latest version (5.5). Subject filtering allows the publisher to decide to which consumer(s) the message will be delivered to. Before looking at subject filtering we need to define what subscriber name is. Each client needs to provide a username when [...]]]></description>
				<content:encoded><![CDATA[<p>Subject filtering has been implemented quite recently in Nirvana and has been enhanced in the latest version (5.5).</p>
<p>Subject filtering allows the publisher to decide to which consumer(s) the message will be delivered to.</p>
<p>Before looking at subject filtering we need to define what subscriber name is. Each client needs to provide a username when connecting to Nirvana.</p>
<p>If you don’t specify yourself the username when creating the session the client API will specify a default one for you. Username is for instance used with ACLs: you can entitle resources (queues and channels) based on username and host:</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/sampleacl.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="sampleACL" src="http://odeheurles.com/wp-content/uploads/2010/10/sampleacl-thumb.png" border="0" alt="sampleACL" width="348" height="77" /></a></p>
<p>You can specify the username with the following method of the <strong>nSessionFactory</strong> class:</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/nsessionfqctory.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top: 0px; border-right: 0px; padding-top: 0px" title="nSessionFqctory" src="http://odeheurles.com/wp-content/uploads/2010/10/nsessionfqctory-thumb.png" border="0" alt="nSessionFqctory" width="484" height="176" /></a></p>
<p>To use subject filtering you just need to use one of the following methods of the <strong>nConsumeEvent</strong> class:</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/subscribername.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="subscriberName" src="http://odeheurles.com/wp-content/uploads/2010/10/subscribername-thumb.png" border="0" alt="subscriberName" width="307" height="42" /></a></p>
<p>Use the first method if you want to distribute the message to a single user, the second one if you need to specify a list of receivers.</p>
<h2></h2>
<h2>Request/Response</h2>
<p>Subject filtering is very useful to implement request/response scenarios. Let see what we need:</p>
<ul>
<li>a request queue or channel (depends if we need load balancing on request or not), this will be used by our requester to publish its request message</li>
<li>a response channel to distribute the response</li>
<li>the requester tags the request message with a correlation ID (a GUID will perfectly do the job) – you can use a property of the <strong>nConsumeEvent</strong> to store this ID.</li>
<li>The responder extracts this correlation ID and applies it on the response, so the requester can match together the request and the response.</li>
<li>The responder extracts the username of the requester (using the <strong>getPublisherUser()</strong> method on the <strong>nConsumeEvent</strong>)</li>
<li>The responder uses subject filtering to dispatch the message to the requester only &#8211; multiple consumers could be subscribed at the same time on the response channel and you probably don’t want all of them to receive the response!</li>
</ul>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/request-response.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="request-response" src="http://odeheurles.com/wp-content/uploads/2010/10/request-response-thumb.png" border="0" alt="request-response" width="490" height="324" /></a></p>
<h2></h2>
<h2>To keep in mind…</h2>
<ul>
<li>Since the publisher can decide to which consumers the messages will be delivered you don’t have to worry about subscriber’s ACLs</li>
<li>A side effect of subscriber name affects Nirvana Enterprise Manager: if you try to Snoop a channel where messages are dispatched using subject filtering you won’t see anything. Using snoop over a channel just subscribes on the channel so if the messages are dispatched with subscriber names not matching your username, messages are not dispatched to you.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2010/10/nirvana-part-iii-subject-filtering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nirvana Part II : Queues</title>
		<link>http://odeheurles.com/2010/10/nirvana-part-ii-queues/</link>
		<comments>http://odeheurles.com/2010/10/nirvana-part-ii-queues/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 21:58:57 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Nirvana]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://odeheurles.com/?p=38</guid>
		<description><![CDATA[Queue is the second main construct available in Nirvana to distribute messages between producer and consumer applications. Unlike channels, queues dispatch events to one and only one consumer and reads are destructive: when an event in send to a subscriber, the event is automatically removed (popped) from the queue. It is as well possible for [...]]]></description>
				<content:encoded><![CDATA[<p class="p1">Queue is the second main construct available in Nirvana to distribute messages between producer and consumer applications.</p>
<p class="p1">Unlike channels, queues dispatch events to one and only one consumer and reads are destructive: when an event in send to a subscriber, the event is automatically removed (popped) from the queue. It is as well possible for entitled consumers to browse the queue content using peek operation.</p>
<h2>Implementing load balancing using a queue</h2>
<p class="p1">Queues are particularly useful to implement load balancing between applications: if multiple consumer are subscribed on the queue, events will be load balanced between subscriber using a round-robin algorithm. You will likely want to use a queue to load balance events between multiple active instances of an application.</p>
<p class="p1"><span style="text-decoration: underline;">Example:</span></p>
<p class="p1">This example describes a load balancing scenario between one producer and 2 consumers (C1 and C2):</p>
<p class="p1">
<ul>
<li>C1 is started first and subscribes to the queue</li>
<li>the producer is then started and publishes event1 to the queue</li>
<li>since there is only one subscriber on the queue the event is directly dispatched to C1 and the event is removed from the queue</li>
<li>C2 is now started and subscribed to the queue</li>
<li>the producer publishes event2</li>
<li>this time there are two subscribers on the queue: the event is randomly dispatched to one of the consumers</li>
<li>C2 is stopped (or C2 process fails)</li>
<li>the producer publishes event3</li>
<li>Nirvana has detected that the connection with C2 has been lost: C2 is no longer subscribed to the queue so the event is dispatched to C1</li>
</ul>
<h2>Queues attributes</h2>
<p class="p1">You can refer to the previous post about channels, attributes for queues and channels are the same.</p>
<h2>Note about queues</h2>
<p>It is good to keep in mind that queues are more expensive for Nirvana than channels: destructive reads requires additional synchronization, especially in a clustered environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2010/10/nirvana-part-ii-queues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nirvana Part I: Channels</title>
		<link>http://odeheurles.com/2010/10/nirvana-part-i-channels/</link>
		<comments>http://odeheurles.com/2010/10/nirvana-part-i-channels/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 07:25:57 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Middleware]]></category>
		<category><![CDATA[Nirvana]]></category>
		<category><![CDATA[my-channels]]></category>

		<guid isPermaLink="false">http://odeheurles.com/2010/10/nirvana-part-i-channels/</guid>
		<description><![CDATA[This first post provides a basic understanding of the Channel, which is one of the two main types of resources used to distribute messages (or events) between producer and consumer applications. A channel provides the same basic behaviors than a JMS topic and adds some features on top of it. You basically use a channel [...]]]></description>
				<content:encoded><![CDATA[<p>This first post provides a basic understanding of the Channel, which is one of the two main types of resources used to distribute messages (or events) between producer and consumer applications.</p>
<p>A channel provides the same basic behaviors than a JMS topic and adds some features on top of it. You basically use a channel when you want to distribute events to all your consumer applications.</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/image.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" src="http://odeheurles.com/wp-content/uploads/2010/10/image-thumb.png" border="0" alt="image" width="396" height="140" /></a></p>
<p>Nirvana does not use multicast to distribute the event to the different consumers: the realm (Nirvana server) has a TCP connection with each consumer and the fan-out occurs at realm level.</p>
<p>A channel can be created manually using Nirvana Enterprise Manager or using the administration API. Actually Nirvana Enterprise Manager is “just” a GUI on top of the admin API, so keep in mind that everything you can do via the admin GUI can be done programmatically in Java, .NET or C++ using the Admin API.</p>
<h2>Channel Attributes</h2>
<p>When creating a channel you need to consider the attributes of the channel; here is a screen capture of the Create Channel screen in the enterprise manager:</p>
<p><a href="http://odeheurles.com/wp-content/uploads/2010/10/image1.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" src="http://odeheurles.com/wp-content/uploads/2010/10/image-thumb1.png" border="0" alt="image" width="325" height="304" /></a></p>
<p>Here is a quick summary of the different attributes:</p>
<ul>
<li>Channel name: each channel and queue needs to be identified by a unique Name. You can store hierarchically your channels and queues in a set of folders by separating folder name and channel name by a /. Example: folderLevel1/folderLevel2/channelName.</li>
<li>Channel TTL: defines the time to live of the event in milliseconds. When an event is published on a channel it will be automatically deleted of the channel after the TTL expires. TTL=0 defines an infinite time to live.</li>
<li>Channel Capacity: defines the maximum number of events that can be stored on the channel. Capacity=0 defines a channel without capacity limit.</li>
<li>Channel type: controls how events are stored by the realm.</li>
<li>Dead Event Store: If an event expires and has not been processed you can use this attribute to redirect the event on an other channel or queue.</li>
<li>Channel Keys: will be described in a separate post</li>
<li>Use Merge Engine: will be described in a separate post</li>
</ul>
<table border="1" cellspacing="0" cellpadding="2" width="100%">
<tbody>
<tr>
<td valign="top"><strong>Type</strong></td>
<td valign="top"><strong>Events stored in memory</strong></td>
<td valign="top"><strong>Events stored on disk</strong></td>
<td valign="top"><strong>Comment</strong></td>
</tr>
<tr>
<td valign="top"><strong>Persistent</strong></td>
<td valign="top">No</td>
<td valign="top">Yes</td>
<td valign="top">Events are stored on disk (one file per channel). For performance reason events are not deleted automatically, they are just marked as deleted. To delete them physically the maintenance feature need to be used on the channel (Admin GUI or Admin API)</td>
</tr>
<tr>
<td valign="top"><strong>Reliable</strong></td>
<td valign="top">Yes</td>
<td valign="top">Event ID only</td>
<td valign="top">The event is stored on the heap of the realm. Event IDs are guaranteed to be incremental on the channel even if the realm is restarted: a file per channel is used to store the ID.</td>
</tr>
<tr>
<td valign="top"><strong>Simple</strong></td>
<td valign="top">Yes</td>
<td valign="top">No</td>
<td valign="top">Same as reliable but the event ID is not stored on disk, restarting the realm resets event IDs to 0.</td>
</tr>
<tr>
<td valign="top"><strong>Mixed</strong></td>
<td valign="top">Yes/No</td>
<td valign="top">Yes/No</td>
<td valign="top">The publisher can choose on a per event basis if the event should be persisted to disk or in Memory. The TTL of the event can be overridden as well.</td>
</tr>
<tr>
<td valign="top"><strong>Transient</strong></td>
<td valign="top">No</td>
<td valign="top">No</td>
<td valign="top">This is the most lightweight channel type. In this mode the events are never stored at realm level: if you publish an event it will be distributed only to currently subscribed consumers.</td>
</tr>
</tbody>
</table>
<p>More information can be found online on my-channels web site: <a href="http://www.my-channels.com/developers/nirvana/common/channelattributes.html">http://www.my-channels.com/developers/nirvana/common/channelattributes.html</a></p>
<h2>Understanding events lifetime</h2>
<p>TTL, Capacity and Channel Type allow you to control how events are stored on the channel and for how long. To get a better understanding, here is an example.</p>
<p>We create a channel of type <strong>Simple</strong> with a <strong>TTL</strong> of 10sec.</p>
<ol>
<li>A first consumer subscribes on the channel</li>
<li>A producer publishes an event to the channel</li>
<li>T=0 &#8211; The message is send to the realm and directly dispatched to the first consumer,</li>
<li>Since the channel is configured to store events (simple type stores them in memory) the event stays in the channel for the configured time to live (10 seconds)</li>
<li>T=5 &#8211; After 5 seconds an other consumer subscribes on the channel: the event is automatically dispatched to this consumer*</li>
<li>T=10 – The TTL has expired, the event is removed from the channel and available for garbage collection on the realm.</li>
<li>T=12 – An other consumer subscribes, the event is not dispatched since it has been removed from the channel.</li>
</ol>
<p>Note*: I have intentionally simplified step 5: when subscribing to a channel you can specify from which event you want to subscribe. Each event currently stored on the channel with an Event ID greater than the specified ID will automatically be dispatched to the subscriber. Subscribing with an Event ID of 0 will always dispatch all the events available on the channel at subscription time.</p>
<h2>Glossary</h2>
<ul>
<li><strong>Realm</strong>: this is the name given to a Nirvana server. Multiple realm can be configured to form a Nirvana cluster.</li>
<li><strong>Event ID</strong>: when publishing an event to a channel or a queue an Event ID is assigned automatically to the event by the realm. This is an incremental integer.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2010/10/nirvana-part-i-channels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Calculs détaillés EURL, optimisation</title>
		<link>http://odeheurles.com/2008/07/calculs-detailles-eurl-optimisation/</link>
		<comments>http://odeheurles.com/2008/07/calculs-detailles-eurl-optimisation/#comments</comments>
		<pubDate>Sun, 06 Jul 2008 15:00:08 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Eurl]]></category>

		<guid isPermaLink="false">http://odeheurles.com/?p=14</guid>
		<description><![CDATA[Vous trouverez bon nombre d&#8217;informations concernant la feuille dans ce topic sur le site Freelance-info. EURL Quick Watch V1.11 Downloaded a total of 34602 times Dernière mise à jour : 17/01/2010 (Correctifs &#038; évolutions par Philippe) N&#8217;étant pas comptable, je ne peux vous garantir l&#8217;exactitude des calculs, si vous trouvez des erreurs, merci de m&#8217;en [...]]]></description>
				<content:encoded><![CDATA[<p>Vous trouverez bon nombre d&#8217;informations concernant la feuille <a href="http://www.freelance-info.fr/forum/freelance_4780.html" target="_blank">dans ce topic</a> sur le site <a href="http://www.freelance-info.fr/forum/" target="_blank">Freelance-info</a>.</p>
<h2><span style="text-decoration: underline;">EURL Quick Watch V1.11</span></h2>
<p><a class="dlimg" href="http://odeheurles.com/wp-content/plugins/download-monitor/download.php?id=1" title="Download EURL Quick Watch - Feuille de calcul EURL IS Version 1.11"><img src="http://odeheurles.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download EURL Quick Watch - Feuille de calcul EURL IS Version 1.11" /></a></p>
<p class="dlstat">Downloaded a total of 34602 times</p>
<p>Dernière mise à jour : 17/01/2010 (Correctifs &#038; évolutions par Philippe)</p>
<p><span style="color: #000000;"><strong>N&#8217;étant pas comptable, je ne peux vous garantir l&#8217;exactitude des calculs, si vous trouvez des erreurs, merci de m&#8217;en informer ici, je corrigerai la feuille ASAP.</strong></span></p>
<h2><span style="text-decoration: underline;">NOUVEAU : News letter</span></h2>
<p>Pour être tenu informé des nouvelles versions, inscrivez vous à la <a href="http://odeheurles.com/phplist">news letter</a> !</p>
<h2><span style="text-decoration: underline;">Faire un don</span></h2>
<form style="text-align: left;" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input name="cmd" type="hidden" value="_donations" /> <input name="business" type="hidden" value="mail@odeheurles.com" /> <input name="item_name" type="hidden" value="Feuille de calcul EURL" /> <input name="no_shipping" type="hidden" value="0" /> <input name="no_note" type="hidden" value="1" /> <input name="currency_code" type="hidden" value="EUR" /> <input name="tax" type="hidden" value="0" /> <input name="lc" type="hidden" value="FR" /> <input name="bn" type="hidden" value="PP-DonationsBF" /> <input alt="PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !" name="submit" src="https://www.paypal.com/fr_FR/FR/i/btn/x-click-butcc-donate.gif" type="image" /> <img src="https://www.paypal.com/fr_FR/i/scr/pixel.gif" border="0" alt="" width="1" height="1" /><br />
</form>
<h2>Remerciements</h2>
<p>J&#8217;ai appris énormément grâce à des sites comme freelance-info, APCE ou encore RSI. Je tiens a remercier <strong>HMG </strong>pour le nombre incalculable de réponses qu&#8217;il a pu m&#8217;apporter, directement dans mes posts ou dans ceux de mes homologues. Je remercie également mes collègues freelance <strong>Édouard </strong>et <strong>Silver </strong>qui se reconnaitront s&#8217;ils passent par ici.</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/07/calculs-detailles-eurl-optimisation/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
		<item>
		<title>Saturday Morning, Setting up dev environment&#8230;</title>
		<link>http://odeheurles.com/2008/06/saturday-morning-setting-up-dev-environment/</link>
		<comments>http://odeheurles.com/2008/06/saturday-morning-setting-up-dev-environment/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 09:21:11 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://odeheurles.com/?p=13</guid>
		<description><![CDATA[I woke up quite early this morning and set up my personal computer with my favorites toys : VS2008 with Resharper 4, Download Castle Windsor, log4net, TestDriven.net, GhostDoc, TeamCity VS2008 plugin, TeamCity tray TeamCity (i did not tried it before, how stupid I was&#8230;), set up a project on google code (SVN repository, wiki, etc) [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignnone" src="/img/TC1.png" alt="" /></p>
<p>I woke up quite early this morning and set up my personal computer with my favorites toys :</p>
<ul>
<li>VS2008 with Resharper 4,</li>
<li>Download Castle Windsor, log4net, TestDriven.net, GhostDoc, TeamCity VS2008 plugin, TeamCity tray</li>
<li>TeamCity (i did not tried it before, how stupid I was&#8230;),</li>
<li>set up a project on google code (SVN repository, wiki, etc)</li>
<li>set up turtoiseSVN with the google repository,</li>
<li>created a solution, a project and one unit test,</li>
<li>commit,</li>
<li>configure TeamCity to check-out my SVN project on google code, build the project and run the test,</li>
<li>after a few minutes 1rst build succeded !</li>
</ul>
<p>I&#8217;m very impressed by the quality of TeamCity. For those who don&#8217;t know, TeamCity is a build server developed  by JetBrains (Resharper, IntelliJ and other GODies). I&#8217;ve already tried other products of this kind but this is by far the easier to use. It directly supports VS 2005/2008 solution files (.sln) and I just had to fill 2-3 forms to have a running environment. TC also supports NAnt, Ant, MSBuild and lots of other build tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/06/saturday-morning-setting-up-dev-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Now what ?</title>
		<link>http://odeheurles.com/2008/05/now-what/</link>
		<comments>http://odeheurles.com/2008/05/now-what/#comments</comments>
		<pubDate>Sat, 17 May 2008 16:29:05 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://odeheurles.com/?p=12</guid>
		<description><![CDATA[I&#8217;m Ready ! My blog is now set up and I plan to write some articles on the following subjects : How to set-up and design a web site build by multiple teams with independent deployments, How to design an AJAX Web site with HTTP streaming (Lightstreamer), How to design a build environment : build, [...]]]></description>
				<content:encoded><![CDATA[<h1><strong>I&#8217;m Ready !</strong></h1>
<p>My blog is now set up and I plan to write some articles on the following subjects :</p>
<ul>
<li>How to set-up and design a <strong>web site</strong> build by <strong>multiple teams</strong> with independent deployments,</li>
<li>How to design an <strong>AJAX Web</strong> site with <strong>HTTP streaming</strong> (<a title="Lightstreamer Push Engine" href="http://www.lightstreamer.com/" target="_blank">Lightstreamer</a>),</li>
<li>How to design a <strong>build environment</strong> : build, unit tests, deployment and integration tests for an ASP.NET web site with <a title="automated web application UI tests" href="http://selenium-rc.openqa.org/" target="_blank">Selenium RC</a>,</li>
<li>Why <a title="ReSharper - The Most Intelligent Add-In To Visual Studio" href="http://www.jetbrains.com/resharper/" target="_blank">Resharper</a> is <strong>TDD</strong>&#8216;s best friend.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/05/now-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My profile on Proagora</title>
		<link>http://odeheurles.com/2008/05/my-profile-on-proagora/</link>
		<comments>http://odeheurles.com/2008/05/my-profile-on-proagora/#comments</comments>
		<pubDate>Sat, 17 May 2008 15:51:48 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://odeheurles.com/?p=11</guid>
		<description><![CDATA[I&#8217;ve set up my profile on proagora.com (in french).]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve set up my profile on proagora.com (in french).</p>
<p><a href="http://proagora.com/fr/experts/profiles/odeheurles"><img src="http://proagora.com/App_Themes/Job/Promote_Expert_fr.png" border="0" alt="Voir un profil sur proagora.com" width="87" height="32" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/05/my-profile-on-proagora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Library</title>
		<link>http://odeheurles.com/2008/05/library/</link>
		<comments>http://odeheurles.com/2008/05/library/#comments</comments>
		<pubDate>Mon, 12 May 2008 12:41:58 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://127.0.0.1/blog/?p=25</guid>
		<description><![CDATA[After spending quite a lot of time arranging and completing my book list, I asked myself if there was not a WordPress plug-in which can manage this for me. After 5 minutes on google I found not just what I was looking for, but really better. The plug in is named Now Reading and have [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://odeheurles.com/wp-content/uploads/2008/05/simpsons.gif"><img class="aligncenter size-full wp-image-26" title="simpsons" src="http://odeheurles.com/wp-content/uploads/2008/05/simpsons.gif" alt="" width="417" height="258" /></a></p>
<p>After spending quite a lot of time arranging and completing my book list, I asked myself if there was not a WordPress plug-in which can manage this for me. After 5 minutes on google I found not just what I was looking for, but really better. The plug in is named  <a href="http://robm.me.uk/projects/plugins/wordpress/now-reading" target="_blank">Now Reading</a> and have the following functionalities:</p>
<ul>
<li>add books by ISBN and automatically retrieve book informations on Amazon (great),</li>
<li>provide a library page visible on the blog,</li>
<li>fully manageable book list in WordPress administration section,</li>
<li>I can edit reviews of the books, rate them</li>
<li>manage list of read, currently reading and planned books.</li>
</ul>
<p>The library is available <a href="index.php?now_reading_library=true" target="_self">here</a> and in the menu on the right.</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/05/library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Books</title>
		<link>http://odeheurles.com/2008/05/books/</link>
		<comments>http://odeheurles.com/2008/05/books/#comments</comments>
		<pubDate>Mon, 12 May 2008 12:35:40 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Book]]></category>

		<guid isPermaLink="false">http://127.0.0.1/blog/?p=24</guid>
		<description><![CDATA[I&#8217;m starting to make a list of books. I want this list to be easily accessible so it will not be hosted in a blog post but in separate page. EDIT : My book list is also accessible from the link in the top right corner of the blog.]]></description>
				<content:encoded><![CDATA[<p><a href="http://odeheurles.com/wp-content/uploads/2008/05/rtfm.jpg"><img class="aligncenter size-full wp-image-22" title="rtfm" src="http://odeheurles.com/wp-content/uploads/2008/05/rtfm.jpg" alt="Read the fucking manual !" width="292" height="292" /></a></p>
<p>I&#8217;m starting to make a list of books. I want this list to be easily accessible so it will not be hosted in a blog post but in separate page.</p>
<p><strong>EDIT </strong>: <span style="text-decoration: line-through;">My book list is also accessible from the link in the top right corner of the blog.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/05/books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syntax highlighting</title>
		<link>http://odeheurles.com/2008/05/syntax-highlighting/</link>
		<comments>http://odeheurles.com/2008/05/syntax-highlighting/#comments</comments>
		<pubDate>Sun, 11 May 2008 21:29:02 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://127.0.0.1/blog/?p=23</guid>
		<description><![CDATA[Since there are good chances that I post code samples in the blog, I wanted a good way to format them and I think I found one. There&#8217;s a WordPress plug-in which uses this Syntax Highlighter written in JavaScript (the Highlight occurs client-side). For my personal use, a good syntax highlighter should : be easy [...]]]></description>
				<content:encoded><![CDATA[<p>Since there are good chances that I post code samples in the blog, I wanted a good way to format them and I think I found one. There&#8217;s a WordPress plug-in which uses this <a href="http://code.google.com/p/syntaxhighlighter/">Syntax Highlighter</a> written in JavaScript (the Highlight occurs client-side).</p>
<p>For my personal use, a good syntax highlighter should :</p>
<ul>
<li>be easy to use, I don&#8217;t want to have to make lots of manipulations to output a well formatted code,</li>
<li>allow easy editing : if my code is escaped with lots of HTML tags and CSS, it won&#8217;t be very convenient to work with while editing a post,</li>
<li>allow visitor to copy paste it, without having the same kind of HTML tags disturbance,</li>
<li>support  a least C# and XML,</li>
<li>output formatted code in RSS.</li>
</ul>
<p>Let see how this plug-in render :</p>
<pre name="code" class="c#">

// Hello1.cs
public class Hello1
{
public static void Main()
{
System.Console.WriteLine(&quot;Hello, World!&quot;);
}
}

</pre>
<p>Not too bad. Let&#8217;s see with a XML document now :</p>
<pre name="code" class="xml">


&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;configuration&gt;
&lt;configSections&gt;
&lt;section
name=&quot;castle&quot;
type=&quot;Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor&quot; /&gt;
&lt;/configSections&gt;

&lt;castle&gt;
&lt;components&gt;
&lt;/components&gt;
&lt;/castle&gt;
&lt;/configuration&gt;

</pre>
<p>Fine !</p>
<p>I just see one problem with that solution : since Syntax Highlight is processed client side (JavaScript), the code will not be highlighted in RSS :-(</p>
<p>I found an other solutions that can do the job : <a href="http://www.manoli.net/csharpformat/format.aspx">http://www.manoli.net/csharpformat/format.aspx</a> is an online service that can encode source code snippets in HTML. The annoying point with that is that it generates quite a lot of CSS/HTML and I fear the day where I will have to update some piece of code surrounded with 5465451 HTML tags&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/05/syntax-highlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress : Why and How ?</title>
		<link>http://odeheurles.com/2008/05/wordpress-why-and-how/</link>
		<comments>http://odeheurles.com/2008/05/wordpress-why-and-how/#comments</comments>
		<pubDate>Sun, 11 May 2008 15:55:30 +0000</pubDate>
		<dc:creator>olivier deheurles</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://127.0.0.1/blog/?p=3</guid>
		<description><![CDATA[Round One : Online Service VS personal blog publishing platform I read quite a lot of blogs but I must admit than I&#8217;ve never looked which tool was behind. After lurking on some of my favorites blogs and some searches on google, I found that there are 2 main ways to make a blog&#8230; excluding [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://wordpress.org/" target="_blank"></a></p>
<h2>Round One : Online Service VS <span id="dnn_ctr429_HtmlModule_HtmlHolder" class="Normal">personal blog publishing platform</span></h2>
<p>I read quite a lot of blogs but I must admit than I&#8217;ve never looked which tool was behind. After lurking on some of my favorites blogs and some searches on google, I found that there are 2 main ways to make a blog&#8230; excluding developing one myself</p>
<ul>
<li>register to an online Blog service, like <a href="https://www.blogger.com/" target="_blank">Blogger</a>, <a href="www.myspace.com/" target="_blank">MySpace</a>, etc&#8230;</li>
<li>or host the blog myself and use a personal blog publishing platform (preferably open source)</li>
</ul>
<p>The second one is more interesting for me : I can customize it if required, I&#8217;ve access to the Database so I can migrate the Blog elsewhere and it allow me to do lots of other geek&#8217;s stuff.</p>
<p>Ok, I&#8217;ve chosen, I WILL USE THAT ! Mhh, but which one ?</p>
<h2>Round Two : .NET/SQL Server VS PHP/MySQL</h2>
<p>As I&#8217;m a .NET developer, I first tried to find an ASP.NET solution and found the <a href="http://subtextproject.com/" target="_blank">Subtext</a> project (used by one of my favorites blogger : <a href="http://www.ayende.com/Blog/" target="_blank">Ayende Rahien</a> ). But this solution did not seem perfect to me :</p>
<ul>
<li>this is not as easy to find a host for an ASP.NET/SQL Server solution than it is for a PHP/MySQL one,</li>
<li>I found more mature (more functionalities) and active projects in the PHP/MySQL world.</li>
</ul>
<h2>Final Round : <a href="www.dotclear.net" target="_blank">Dotclear</a> VS <a href="http://wordpress.org/">WordPress</a></h2>
<p>I found two interesting solutions : Dotclear and WordPress. After installing <a href="http://www.easyphp.org/" target="_blank">EasyPHP</a> I set up both solutions locally and start playing with them. I&#8217;ve to admit that my final decision came quite fast because WordPress is really an impressive product :</p>
<ul>
<li>very intuitive, easy to configure and really smart,</li>
<li>the <a href="http://en.wikipedia.org/wiki/WYSIWYG" target="_blank">WYSIWYG</a> text editor contains everything required to edit a post and every function can be accessed with a keyboard shortcut,</li>
<li>possibility to create pages : these are not included in the blog&#8217;s ticket flow but are accessible with the menu. I plan to use them to host more &#8220;advanced&#8221; documents than simple blog tickets.</li>
<li>I found a theme (skin) that i like on <a href="http://www.fahlstad.se" target="_blank">Fahlstad</a> site : http://www.fahlstad.se/themes/ (the fspring one)</li>
<li>LOTS of plugins</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://odeheurles.com/2008/05/wordpress-why-and-how/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
