<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>UberMongoose</title>
		<link>http://localhost:1313/</link>
		<description>Recent content on UberMongoose</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Thu, 03 Aug 2017 16:23:12 +0530</lastBuildDate>
		
			<atom:link href="http://localhost:1313/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Building a Blockchain</title>
				<link>http://localhost:1313/post/building-a-blockchain/</link>
				<pubDate>Thu, 03 Aug 2017 16:23:12 +0530</pubDate>
				<guid>http://localhost:1313/post/building-a-blockchain/</guid>
				<description>&lt;p&gt;There has been a lot of discussion around blockchain in recent times. It&amp;rsquo;s been touted as a solution for everything from the financial system to aviation maintenance records, but the details of how it works has always been hidden under a haze of magical technomancy. In this article I take a deep dive into what a blockchain is and build a simple (but actual) blockchain from scratch.&lt;/p&gt;&#xA;&lt;p&gt;The first problem you need to overcome in any research into blockchain is that most of it is mired in the feverish discussion around Bitcoin (or other AltCoins). Bitcoin uses a blockchain implementation for its ledger, but the idea of a blockchain itself is more general. You could use a blockchain for your grocery lists (remember to wear your tin foil hat to the supermarket though).&lt;/p&gt;</description>
			</item>
			<item>
				<title>How Compilers Work - The Problem of Parsing</title>
				<link>http://localhost:1313/post/how-compilers-work-the-problem-of-parsing/</link>
				<pubDate>Mon, 17 Apr 2017 19:51:43 +0530</pubDate>
				<guid>http://localhost:1313/post/how-compilers-work-the-problem-of-parsing/</guid>
				<description>&lt;p&gt;Parsing is the second stage of compilation, it comes right after&#xA;&lt;a href=&#34;http://localhost:1313/post/how-compilers-work-lexical-analysis/&#34;&gt;lexical analysis&lt;/a&gt;. While lexical analysis focuses on breaking down the input text into a set of tokens, parsing focuses on ensuring that the relationships between those tokens are valid. Lexical analysis is about valid words, parsing is about grammatically correct sentences.&lt;/p&gt;&#xA;&lt;p&gt;The problem with parsing, is that at this point during most discussions, the text moves headfirst into theory - and there is quite a bit of it. To make matters worse, it&amp;rsquo;s quite abstract and quite disconnected from much of what comes afterwards (namely parser generation). So instead of going theoretical, let&amp;rsquo;s jump straight into implementing a parser by hand and then come back to the theory. Let&amp;rsquo;s take a look at an example of the Cunning language.&lt;/p&gt;</description>
			</item>
			<item>
				<title>C# Value Types are Objects</title>
				<link>http://localhost:1313/post/csharp-value-types-are-objects/</link>
				<pubDate>Sun, 12 Jun 2016 16:12:24 +0530</pubDate>
				<guid>http://localhost:1313/post/csharp-value-types-are-objects/</guid>
				<description>&lt;p&gt;Value types in C# are Objects, but they don&amp;rsquo;t behave exactly like Objects do. A part of the reason for this is that all value types are &lt;em&gt;implicitly&lt;/em&gt; derived from System.ValueType.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-csharp&#34; data-lang=&#34;csharp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;abstract&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;ValueType&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;protected&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ValueType&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;bool&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Equals&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;object&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;obj&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;GetHashCode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kd&#34;&gt;override&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;ToString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;h5 id=&#34;but-wait-structs-cant-derive-from-classes&#34;&gt;But wait! Structs can&amp;rsquo;t derive from classes!&lt;/h5&gt;&#xA;&lt;p&gt;At first glance, this seems true. You can&amp;rsquo;t for example do this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-csharp&#34; data-lang=&#34;csharp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Animal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;struct&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Rat&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Animal&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The compiler wont let you. Yet if MSDN and the C# language specification itself is to be belived, all value types inherit from object across System.ValueType, but Int32 doesn&amp;rsquo;t seem to mention this fact in its definition.&lt;/p&gt;</description>
			</item>
			<item>
				<title>A Short History of Sorting in C#</title>
				<link>http://localhost:1313/post/a-short-history-of-sorting-in-csharp/</link>
				<pubDate>Sun, 20 Mar 2016 09:37:24 +0530</pubDate>
				<guid>http://localhost:1313/post/a-short-history-of-sorting-in-csharp/</guid>
				<description>&lt;p&gt;Recently, while reading &lt;a href=&#34;http://csharpindepth.com/&#34;&gt;Jon Skeet’s excellent book&lt;/a&gt;“C# in Depth” I came across the long and varied history of sorting in the C# language. It provides a tantalising view of how the language has evolved over the years. Apart from being a great example on C# in particular it’s also a good example on how languages have improved over the years to become more expressive, while maintaining backward compatibility with earlier versions.&lt;/p&gt;</description>
			</item>
			<item>
				<title>C# Abstract Properties, Virtual Properties and Access Modifiers</title>
				<link>http://localhost:1313/post/csharp-abstract-virtual-access-properties/</link>
				<pubDate>Sun, 21 Feb 2016 16:14:33 +0530</pubDate>
				<guid>http://localhost:1313/post/csharp-abstract-virtual-access-properties/</guid>
				<description>&lt;p&gt;Properties in C# are first class citizens, this means that they can be declared as abstract, virtual, private and protected. This is not the general use case though, most of the time properties are used to encapsulate fields.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-csharp&#34; data-lang=&#34;csharp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Customer&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Number&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kd&#34;&gt;public&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;get&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;set&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;Customer&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;customer&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Customer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;customer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Number&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;9&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;customer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Name&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Mrs Lovett&amp;#39;s Pie Shop&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;n the example above, auto implemented properties are used to aid encapsulation. The C# compiler automatically generates the fields used to store the properties and also the methods used for access. Externally, the properties look just like public fields but are actually implemented as methods. The setters and getters of a property can have different access modifiers.&lt;/p&gt;</description>
			</item>
			<item>
				<title>A Concise Guide to Hiring Good Programmers</title>
				<link>http://localhost:1313/post/a-consice-guide-to-hiring/</link>
				<pubDate>Mon, 03 Aug 2015 17:12:14 +0530</pubDate>
				<guid>http://localhost:1313/post/a-consice-guide-to-hiring/</guid>
				<description>&lt;p&gt;The best way to hire a good programmer is to be invested in his or her results. It&amp;rsquo;s like getting married. You want to be careful to choose the right kind of girl, the kind of girl that you&amp;rsquo;d want to spend the rest of your life with. Just like marriage, it can make your life as close to heaven or hell as it can get on earth. Here&amp;rsquo;s how I about it.&lt;/p&gt;</description>
			</item>
			<item>
				<title>How Compilers Work - Lexical Analysis</title>
				<link>http://localhost:1313/post/how-compilers-work-lexical-analysis/</link>
				<pubDate>Thu, 12 Feb 2015 08:20:12 +0530</pubDate>
				<guid>http://localhost:1313/post/how-compilers-work-lexical-analysis/</guid>
				<description>&lt;p&gt;Compilers are wonderful, if somewhat under appreciated programs. Like the foundations of great buildings, they form the latticework on which modern computing is built. Unfortunately, they have been a bit neglected of late. Writing code tends to be more about innovating and creating exciting new businesses than the actual pleasure of knowing how things work, how to break them and how to fix them again. The modern day queen of compilers, Grace Hopper&lt;a href=&#34;#grace&#34;&gt;[1]&lt;/a&gt; , started life by taking clocks apart and trying to put them back together.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Emacs - Debugging Code under Linux with GDB</title>
				<link>http://localhost:1313/post/emacs-debugging-code-under-linux-with-gdb/</link>
				<pubDate>Sun, 04 Jan 2015 10:42:12 +0530</pubDate>
				<guid>http://localhost:1313/post/emacs-debugging-code-under-linux-with-gdb/</guid>
				<description>&lt;p&gt;Visual Studio provides a very nice developer experience when debugging code. Emacs, on the other hand, doesn&amp;rsquo;t really shine in this area. It relies heavily the on strong debugging tools that ship with Linux, particularly GDB. While GDB is powerful and extensive, it&amp;rsquo;s command line interface is dated, and can come as a shock to a developer used to the Visual Studio way of doing things. Let&amp;rsquo;s take the play program below, which introduces an obvious bug involving an array overflow which causes stack corruption.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Emulating Classical Inheritance in Javascript</title>
				<link>http://localhost:1313/post/javascript-classical-inheritance/</link>
				<pubDate>Sun, 13 Jul 2014 11:03:43 +0530</pubDate>
				<guid>http://localhost:1313/post/javascript-classical-inheritance/</guid>
				<description>&lt;p&gt;Javascript isn’t a classical language. &lt;a href=&#34;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain&#34;&gt;It’s prototypal&lt;/a&gt;, which is a bit like every object being a class in waiting. You can create graphs of objects where one object inherits from another, but the idea of classes doesn’t really exist.&lt;/p&gt;&#xA;&lt;p&gt;This can be a drawback, specially with code encapsulation. It becomes difficult to hide private implementation details from public interfaces to the object because Javascript provides no native access modifiers. There is however a number of methods for simulating classical inheritance and encapsulation in Javascript while things nice and clean&lt;/p&gt;</description>
			</item>
			<item>
				<title>C&#43;&#43; Constructors and Move Semantics</title>
				<link>http://localhost:1313/post/cpp-constructors-and-move-semantics/</link>
				<pubDate>Sat, 12 Apr 2014 10:12:06 +0530</pubDate>
				<guid>http://localhost:1313/post/cpp-constructors-and-move-semantics/</guid>
				<description>&lt;p&gt;In order to do almost anything with a class in C++, you need to define a few constructors. If you don&amp;rsquo;t, depending on usage, the compiler will generate those constructors for you. For example, consider the following code:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-cpp&#34; data-lang=&#34;cpp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Person&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;age&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The above class does not explicitly define a constructor of any kind and if you don&amp;rsquo;t use the class at all, the compiler will just ignore it. However on the other hand if you do the following:&lt;/p&gt;</description>
			</item>
			<item>
				<title>CMake Platform Specific Actions</title>
				<link>http://localhost:1313/post/cmake-platform-specific-actions/</link>
				<pubDate>Sun, 22 Dec 2013 10:13:40 +0530</pubDate>
				<guid>http://localhost:1313/post/cmake-platform-specific-actions/</guid>
				<description>&lt;p&gt;Sometimes you need to link one library on Windows and another on Linux (or vice versa). CMake has a &lt;a href=&#34;http://www.cmake.org/Wiki/CMake_Useful_Variables&#34;&gt;number of variables&lt;/a&gt; that allow you to do this easily:&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: left&#34;&gt;&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: left&#34;&gt;&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;UNIX&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;TRUE on all UNIX-like OS&amp;rsquo;s including Apple OS X and CygWin&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;WIN32&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;TRUE on Windows including CygWin&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;APPLE&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;TRUE on Apple systems. **&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;MINGW&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;TRUE when using the MinGW compiler in Windows&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;MSYS&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;TRUE when using the MSYS developer environment in Windows&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;CYGWIN&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;TRUE on Windows when using the CygWin version of cmake&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: left&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;** &lt;em&gt;Note this does not imply the system is Mac OS X only that &lt;strong&gt;APPLE&lt;/strong&gt; is #defined in C/C++ header files. Obtain more specific system information via CMAKE_SYSTEM_VERSION. I.e. IF(${CMAKE_SYSTEM_NAME} MATCHES &amp;ldquo;Darwin&amp;rdquo;) then it&amp;rsquo;s Mac OS X&lt;/em&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Pessimistic vs Optimistic Concurrency</title>
				<link>http://localhost:1313/post/pessimistic-vs-optimistic-concurrency/</link>
				<pubDate>Sun, 15 Dec 2013 07:20:02 +0530</pubDate>
				<guid>http://localhost:1313/post/pessimistic-vs-optimistic-concurrency/</guid>
				<description>&lt;p&gt;Concurrency is when multiple jobs see incremental progress within the same time period. It may be that the concurrency is parallel where both jobs progress together at the same time or time sliced wherein parts of both jobs are done one after the other by a single processor. Whichever the case concurrency creates problems for shared resources. When there is only one job executing at a given point in time the resource can be viewed as consistent on any access. However when there is more than one job executing then care must be taken to ensure that the resource is consistent across both jobs. Consider the classic example of 2 jobs which both increment a single counter.&lt;/p&gt;</description>
			</item>
			<item>
				<title>CMake find_package</title>
				<link>http://localhost:1313/post/cmake-find-package/</link>
				<pubDate>Wed, 04 Dec 2013 10:05:36 +0530</pubDate>
				<guid>http://localhost:1313/post/cmake-find-package/</guid>
				<description>&lt;p&gt;In the &lt;a href=&#34;http://localhost:1313/post/cmake-add-library/&#34;&gt;last scroll&lt;/a&gt; on CMake we discussed adding libraries that you write to your own code. This time, we look at using third party libraries out of the box. This turns out to be fairly easy with CMake - though there are exceptions (alternatively spelled &amp;ldquo;bugs&amp;rdquo;). Adding a third party package such as the precious Boost libraries for C++ is fairly easy with CMake. In your CMakeLists.txt file add a call to FIND_PACKAGE like so:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Redis vs Azure</title>
				<link>http://localhost:1313/post/redis-vs-azure/</link>
				<pubDate>Sat, 12 Oct 2013 09:32:22 +0530</pubDate>
				<guid>http://localhost:1313/post/redis-vs-azure/</guid>
				<description>&lt;p&gt;&lt;img src=&#34;http://localhost:1313/images/azure-vs-redis.png&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;Redis and Azure table storage have a lot in common. Both have no schema’s enforced on the objects that they store. Both have limited complex query capabilities and both are touted as being “post SQL” storage. However there is one major difference between the two that tends to dampen comparisons and that is how they deal with concurrency.&lt;/p&gt;&#xA;&lt;p&gt;Redis deals with concurrency by queuing requests and handling them one at a time. This allows for single instance Redis servers to deliver impressive performance and a bunch of nice features like set intersections and unions. On the down side this limits the scalability of a single Redis instance because you are stuck with just 1 thread doing the actual work.&lt;/p&gt;</description>
			</item>
			<item>
				<title>High Performance Code - Make No Assumptions</title>
				<link>http://localhost:1313/post/high-performance-code/</link>
				<pubDate>Sun, 18 Aug 2013 09:40:51 +0530</pubDate>
				<guid>http://localhost:1313/post/high-performance-code/</guid>
				<description>&lt;p&gt;&lt;img src=&#34;http://localhost:1313/images/concurrent-bear.jpg&#34; alt=&#34;&#34;&gt;&#xA;&lt;em&gt;Concurrent bear – parallel fish&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;Often when writing high performance code one can fall into the trap of making assumptions about the nature of the problem. &lt;a href=&#34;http://en.wikipedia.org/wiki/Donald_Knuth&#34;&gt;Donald Knuth&lt;/a&gt; said “Premature optimisation is the root of all evil”. If that is the case then prejudiced optimisation is the seed.&lt;/p&gt;&#xA;&lt;p&gt;I learned the bitter lesson myself. Recently while building an architecture to support crunching what I thought was a moderately large amount of data I made the &lt;em&gt;mistake&lt;/em&gt; of designing it with multiple threads of execution. At the beginning my rationale seemed quite sound as &lt;a href=&#34;http://www.gotw.ca/publications/concurrency-ddj.htm&#34;&gt;many&lt;/a&gt; have postulated that the performance gain to be had from single threaded execution of code is limited. The architecture that I was building involved a fast in memory key value store called Redis as one of it’s pieces. Unfortunately in the case of Redis the opposite was true. Because it’s often expensive to synchronise between threads and because in the normal use case for Redis the bottleneck was the network and not the CPU it’s authors decided to make it a single threaded application taking and serving requests off the wire one at a time. However it can handle multiple clients at a time, that is it is a program that supports concurrency but that’s &lt;a href=&#34;https://talks.golang.org/2012/waza.slide#1&#34;&gt;not the same thing as parallelism&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Emacs - Frames, Windows and Buffers</title>
				<link>http://localhost:1313/post/emacs-frames-windows-buffers/</link>
				<pubDate>Mon, 29 Jul 2013 16:10:20 +0530</pubDate>
				<guid>http://localhost:1313/post/emacs-frames-windows-buffers/</guid>
				<description>&lt;p&gt;First for some terminology. What Emacs called “frames” is what everyone else now calls windows. This is because Emacs started out as a full screen terminal tool and GUI’s came along later and because of that what Emacs calls windows is now what most visual studio programmers would know as split views. You can experiment with creating new frames, which are by default bound to &lt;code&gt;[C-x 5 2]&lt;/code&gt; and deleting the created frame by selecting it and pressing &lt;code&gt;[C-x 5 0]&lt;/code&gt;. It’s like opening a new instance of visual studio except that your on the same project as you were when you opened it.&lt;/p&gt;</description>
			</item>
			<item>
				<title>CMake add_library</title>
				<link>http://localhost:1313/post/cmake-add-library/</link>
				<pubDate>Mon, 29 Jul 2013 09:57:52 +0530</pubDate>
				<guid>http://localhost:1313/post/cmake-add-library/</guid>
				<description>&lt;p&gt;In the &lt;a href=&#34;http://localhost:1313/post/cmake-include-directories/&#34;&gt;last post&lt;/a&gt; we built an executable from a source file and a header only library. However, sometimes we need to build shared library binaries that can be linked into an executable. This is fairly simple with CMake. Instead of using &lt;code&gt;add_executable&lt;/code&gt; like the last time we now simply need to use &lt;code&gt;add_library&lt;/code&gt; like so:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-cmake&#34; data-lang=&#34;cmake&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Sources &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;GLOB&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;Library_SOURCES&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;*.cpp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;GLOB&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;Library_HEADER&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;*.hpp&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# Executable&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;add_library&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;LibProject&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;Library_SOURCES&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;Library_HEADERS&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;CMake will now get the build system that you choose to create a shared library that can be linked into an executable one. You would end up with .lib files with Visual Studio and typically .a files with Unix make. Note that the name &lt;code&gt;Library_SOURCES&lt;/code&gt; is chosen for clarities sake. The variable can be named anything.&lt;/p&gt;</description>
			</item>
			<item>
				<title>CMake Include Directories</title>
				<link>http://localhost:1313/post/cmake-include-directories/</link>
				<pubDate>Sat, 20 Jul 2013 11:19:39 +0530</pubDate>
				<guid>http://localhost:1313/post/cmake-include-directories/</guid>
				<description>&lt;p&gt;To do almost anything today with C++ requires the use of a number of different third party libraries. Some of these come in the form of header only libraries containing only include files (.h and .hpp). The references to these libraries are easy to resolve with CMake, let&amp;rsquo;s contrive an example.&lt;/p&gt;&#xA;&lt;p&gt;Consider the following folder structure.&lt;/p&gt;&#xA;&lt;p&gt;[CMakeHome] [CMakeHome]\src&lt;br&gt;&#xA;Contains all the source code for the project&lt;/p&gt;&#xA;&lt;p&gt;[CMakeHome]\headerlib\&lt;br&gt;&#xA;Contains a small header only library with a number of different applications&lt;/p&gt;</description>
			</item>
			<item>
				<title>CMake The Beautiful Beast</title>
				<link>http://localhost:1313/post/cmake-the-beautiful-beast/</link>
				<pubDate>Wed, 17 Jul 2013 09:17:29 +0530</pubDate>
				<guid>http://localhost:1313/post/cmake-the-beautiful-beast/</guid>
				<description>&lt;p&gt;CMake is a mix of things. It&amp;rsquo;s a cross platform makefile generator that makes porting your C/C++ code from one OS to another or from one compiler to another inside the same OS really simple. However it complicates things a bit as well as now you need to write an extra &amp;ldquo;CMakeLists.txt&amp;rdquo; file for each of your code directories in order to allow CMake to generate those files for you. It doesn&amp;rsquo;t really help that the CMake documentation is &lt;em&gt;rather dense&lt;/em&gt; and that there are a number of caveats that you really don&amp;rsquo;t see until you get to actually implementing it. Learning CMake therefore can be a harrowing experience and sometimes you might be tempted to give up half way and stick to the warm consolation of the Visual Studio IDE. That&amp;rsquo;s where this guide will hopefully help you as a starting point in your CMake journey that is not too steep to learn.&lt;/p&gt;</description>
			</item>
			<item>
				<title>World War and Economic Unions</title>
				<link>http://localhost:1313/post/world-war-and-economic-unions/</link>
				<pubDate>Wed, 03 Jul 2013 16:13:26 +0530</pubDate>
				<guid>http://localhost:1313/post/world-war-and-economic-unions/</guid>
				<description>&lt;p&gt;&lt;img src=&#34;http://localhost:1313/images/greece-crisis.jpg&#34; alt=&#34;&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;It’s interesting that when the European project kicked off it was against the backdrop of the end of the second World War. Europe had seen two world wars within a generation with much resultant suffering and destruction. There must have been an urgency therefore to stop a third from happening on the continent by creating a pan national entity that binds many nations together.&lt;/p&gt;&#xA;&lt;p&gt;Perhaps the thought was that if one nation desires to start a campaign of aggression against another – if the cost of the aggression would hit home very quickly because of mutual economic dependence then the desire for such an aggression would quickly fizzle out in the home nation.&lt;/p&gt;</description>
			</item>
			<item>
				<title>CMake Trickery - Platform Specific Linking</title>
				<link>http://localhost:1313/post/cmake-trickery-platform-specific-linking/</link>
				<pubDate>Wed, 26 Jun 2013 08:52:57 +0530</pubDate>
				<guid>http://localhost:1313/post/cmake-trickery-platform-specific-linking/</guid>
				<description>&lt;p&gt;Quite often when your working on cross platform code you need to build applications that use one set of libraries when compiled under Microsoft Windows and another set when compiled under Unix/Linux. Fortunately &lt;a href=&#34;http://www.cmake.org/&#34;&gt;CMake&lt;/a&gt; is a cunning tool to help you on your way. It has a bunch of predefined constants that you can use to switch libraries based on the platform like so:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-cmake&#34; data-lang=&#34;cmake&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c&#34;&gt;# SomeCoolLibrary&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;IF&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;WIN32&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nb&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;STATUS&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Building on Microsoft Windows.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;SomeCoolLibrary&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;someCoolWindows.lib&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;ELSEIF&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;UNIX&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;AND&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;NOT&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;MINGW&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nb&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;STATUS&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Building on Linux/Unix.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;   &lt;span class=&#34;nb&#34;&gt;set&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;SomeCoolLibrary&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;someCoolLinux.so&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;ENDIF&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Notice we check for the enviorenment being Unix but not MinGW. This is because CMake reports the enviorenment as Unix even if it&amp;rsquo;s MinGW running on Windows (which I suppose makes sense), but it pays to be specific. Finally you can target the generic link library that you&amp;rsquo;ve mentioned here:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Unicode on Linux</title>
				<link>http://localhost:1313/post/unicode-on-linux/</link>
				<pubDate>Sun, 26 May 2013 14:52:45 +0530</pubDate>
				<guid>http://localhost:1313/post/unicode-on-linux/</guid>
				<description>&lt;p&gt;At first the place of Unicode in Linux looks simple. It is deceptively so. Linux C/C++ has support for both char and wchar_t. Let’s take a look at the char version:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-cpp&#34; data-lang=&#34;cpp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;lt;cstring&amp;gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;main&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;int&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argc&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;*&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;argv&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[])&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[]&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;Άλφα&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;text&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;sizeof(char): &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;sizeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;cout&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s&#34;&gt;&amp;#34;sizeof(text): &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;sizeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;endl&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;This results in the output:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;Άλφα&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;sizeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;sizeof&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;text&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;9&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;Notice that the console prints out the characters correctly and that the size of a char is 1 byte. On the other hand the size of the text buffer is 9 bytes, though manifestly it only contains 4 (+1 for the null terminator). The reason for this is that each character is encoded as a couple of UTF-8 characters. This is important. All char buffers in Linux supports Unicode by default because GCC by default encodes literal text as UTF-8 streams. On the down side now some of the old string handling functions – for example strlen – which are not UTF-8 aware start returning bovine excrement as results and require replacement but we will return to that.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The Configuration of Emacs</title>
				<link>http://localhost:1313/post/the-configuration-of-emacs/</link>
				<pubDate>Wed, 08 May 2013 16:14:33 +0530</pubDate>
				<guid>http://localhost:1313/post/the-configuration-of-emacs/</guid>
				<description>&lt;p&gt;Emacs can only be configured naked by moonlight.&lt;/p&gt;&#xA;&lt;p&gt;I kid, I kid – the moonlight is optional.&lt;/p&gt;&#xA;&lt;p&gt;Emacs has a number of “modes”. Much has been said about them on the interwebs so &lt;a href=&#34;http://jeremy.zawodny.com/emacs/emacs-3.html&#34;&gt;I’ll take the easy way out and link to a such an article&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There are as you would have seen two kinds of modes, major modes and minor modes. Major modes change what Emacs believes is the content, for example there’s a major mode for C and a major mode for Python. Minor modes allow small changes in behavior in any content. CUA-Mode is a minor mode that does some trickery to allow C-c and C-v copy and paste like on the venerable Microsoft Word. It can be enabled by the command M-x followed by typing cua-mode in the mini buffer at the bottom of Emacs. However you don’t want to be manually typing that in every time you start emacs so you put some initialization settings in your &lt;a href=&#34;http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html&#34;&gt;Emacs init file&lt;/a&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Emacs Key Bindings</title>
				<link>http://localhost:1313/post/emacs-key-bindings/</link>
				<pubDate>Wed, 01 May 2013 16:14:33 +0530</pubDate>
				<guid>http://localhost:1313/post/emacs-key-bindings/</guid>
				<description>&lt;p&gt;Emacs is like your average dragon, very cranky before breakfast and set in its ways. Take for instance the key bindings. For you to do anything – and I mean anything at all you need to type in an arcane set of shortcut keys, like for instance the basic &lt;code&gt;Control Meta X, Control Sacrifice Goat, Enter Enter, Control F&lt;/code&gt; command which launches the built in dishwasher. You might be tempted to change the key bindings to better suite the feel of your windows environment but that is not a very good idea for the vast majority of cases.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The Bumpy Road to Emacs</title>
				<link>http://localhost:1313/post/the-bumpy-road-to-emacs/</link>
				<pubDate>Sat, 20 Apr 2013 16:14:33 +0530</pubDate>
				<guid>http://localhost:1313/post/the-bumpy-road-to-emacs/</guid>
				<description>&lt;p&gt;&lt;em&gt;The Road goes ever on and on&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;Down from the door where it began.&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;Now far ahead the Road has gone,&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;And I must follow, if I can,&lt;/em&gt;&lt;br&gt;&#xA;&lt;strong&gt;-Bilbo Baggins, The Fellowship of the Ring&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Sometimes the completely respectable Visual Studio programmer is called upon to follow the arduous road to places unknown where danger and dragons await him at every turn. One such dragon is called Emacs the Keybinder and subduing this beast requires a great deal of effort to those who have lived in the relative comfort of Visual Studio land.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Big Data and Intelligent Machines</title>
				<link>http://localhost:1313/post/big-data-and-intelligent-machines/</link>
				<pubDate>Thu, 31 Jan 2013 16:12:25 +0530</pubDate>
				<guid>http://localhost:1313/post/big-data-and-intelligent-machines/</guid>
				<description>&lt;p&gt;Big data has been getting a lot of attention lately as a field in computing that could significantly increase the value of the vast amounts of data that are captured by digital networks and devices. Phrases like “Data is the new oil.” has been flying around glibly for a while now but it’s difficult to extract the truth from the vast amount of data on big data that’s out there. It sounds like a job for Big Data… but I get ahead of myself.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The pImpl Idiom – Hiding Private Implementation Details</title>
				<link>http://localhost:1313/post/the-pimpl-idiom/</link>
				<pubDate>Thu, 17 Jan 2013 16:16:31 +0530</pubDate>
				<guid>http://localhost:1313/post/the-pimpl-idiom/</guid>
				<description>&lt;p&gt;One key principle behind the design of classes is that of the encapsulation of the implementation from the clients using the code. Here a client is any bit of source code that uses the classes that you write. C++ provides an imperfect implementation of this idea in the way it defines rules for classes. Consider the following class which is declared in event.hpp.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-cpp&#34; data-lang=&#34;cpp&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#include&lt;/span&gt; &lt;span class=&#34;cpf&#34;&gt;&amp;#34;system_clock.hpp&amp;#34;&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;class&lt;/span&gt; &lt;span class=&#34;nc&#34;&gt;Event&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;private&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;SystemClock&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mClock&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;mMessage&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;public&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;:&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;Event&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;std&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;o&#34;&gt;~&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;Event&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;    &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;p&gt;The Event class models an event that can happen at some point in time. It uses “system_clock.hpp” which defiles a class called SystemClock to see what time it is. Notice that both the message and the current time as defined by the member variable mClock in Event is private. This should mean ideally that any changes to the variables in the private section of the class is not exposed to the client code and indeed to an extent it is. No client can create an instance of Event and then access it’s private members like so:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Sociable Programming</title>
				<link>http://localhost:1313/post/sociable-programming/</link>
				<pubDate>Mon, 10 Dec 2012 10:42:43 +0530</pubDate>
				<guid>http://localhost:1313/post/sociable-programming/</guid>
				<description>&lt;p&gt;Programmers are not known to be social creatures. It&amp;rsquo;s an unfortunate reputation really, considering that programmers spend most of their lives writing their thoughts to each other - they should be right up there in the social landscape with Paris Hilton and Lady Gaga. The problem of course is that programmers never recognise the social aspect of their work. They think they write code for computers. Nothing could be further from the truth.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Step on that Code</title>
				<link>http://localhost:1313/post/step-on-that-code/</link>
				<pubDate>Sun, 02 Dec 2012 16:09:10 +0530</pubDate>
				<guid>http://localhost:1313/post/step-on-that-code/</guid>
				<description>&lt;p&gt;In &lt;a href=&#34;http://localhost:1313/post/sociable-programming/&#34;&gt;Sociable Code&lt;/a&gt; I mentioned that an often overlooked consideration when writing code is the strain that it puts on the programmers who end up reading it. Difficult to read code tends to mash the wetware and end up causing more bugs and longer resolution times. One way to reduce that effort is to write code that would make control flow explicit when being stepped through with a debugger. Take a look at this bit of code. I came across it during a foray into a rather well known programming site. I have endeavoured to anonymise the code but the key piece has not lost it’s form.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Unicode and Windows</title>
				<link>http://localhost:1313/post/unicode-and-windows/</link>
				<pubDate>Tue, 06 Nov 2012 13:46:55 +0530</pubDate>
				<guid>http://localhost:1313/post/unicode-and-windows/</guid>
				<description>&lt;p&gt;Unicode string support in Windows is a strange beast.&lt;/p&gt;&#xA;&lt;p&gt;When Microsoft hired Dave Cutler and others to write a new OS for them they were thinking about writing a new version of OS/2. In fact the new Microsoft OS was a combined effort by Microsoft and IBM that would have resulted in OS/2 version 3.0 if not for the success of Microsoft’s own Windows 3 which made them reconsider that approach. At the eleventh hour they shifted their API from the extended OS/2 API that was to be the way things got done on the new OS to an extended version of the Windows API. This last minute change was possible due to some clever trickery on the part of the programmers who wrote the new Windows OS but it resulted in a strange API, especially when it came to string handling in the new OS known to history as Windows NT 3.1.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Unicode</title>
				<link>http://localhost:1313/post/unicode/</link>
				<pubDate>Fri, 12 Oct 2012 09:32:22 +0530</pubDate>
				<guid>http://localhost:1313/post/unicode/</guid>
				<description>&lt;p&gt;For many years programmers and strings existed in a state of balance, as much balance as could have been possible under the constant threat of undefined behaviour that sociopathic string functions threatened in any case. It was not to be however for their lives of relative stability was forever changed with the advent of Other Languages into string buffers. In this part of our continual study of strings we delve into intriguing world of internationalisation, multi byte character sets and Unicode.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The Private Lives of Strings</title>
				<link>http://localhost:1313/post/the-private-lives-of-strings/</link>
				<pubDate>Sat, 15 Sep 2012 16:14:33 +0530</pubDate>
				<guid>http://localhost:1313/post/the-private-lives-of-strings/</guid>
				<description>&lt;p&gt;Ah, Strings. Surprisingly simple for most C# and Java programmers yet so complex for those of us left behind in the world of C and C++, Strings are perhaps one of the strangest beasts in the programming landscape. Yet they began so simple, perhaps deceptively so like a chameleon on a plain coloured leaf waiting to deceive the observer with its next background. Yet I have tracked this beast down through the ages, yea, verily I have identified its habits and its lair and here I present to you in true Attenboroughish fashion the Private Life of Strings. To understand the habitat of strings one must go back to their distant ancestors. The typewriters.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
