<?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>Persistent notes &#187; fun</title>
	<atom:link href="http://alexkr.com/notes/fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexkr.com</link>
	<description>Alexander Krivutsenko&#039;s online journal</description>
	<lastBuildDate>Sat, 07 Apr 2012 20:46:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Origins of DeadBeef</title>
		<link>http://alexkr.com/fun/155/origins-of-deadbeef/</link>
		<comments>http://alexkr.com/fun/155/origins-of-deadbeef/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 16:13:51 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[blah-blah]]></category>

		<guid isPermaLink="false">http://alexkr.com/fun/155/origins-of-deadbeef/</guid>
		<description><![CDATA[It was nice to find out in Jeremy Uejio&#8217;s Blog that 0xDEADBEEF is used on Linux (I assume it happens with debug versions) when you free memory.
According to this source, originally DEADBEEF was used in order to fill newly allocated memory.
On my Windows machine neither fresh nor deallocated memory is fancy.
Only 0xAB, 0xFE and nothing [...]]]></description>
		<wfw:commentRss>http://alexkr.com/fun/155/origins-of-deadbeef/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some fun with C</title>
		<link>http://alexkr.com/fun/152/some-fun-with-c/</link>
		<comments>http://alexkr.com/fun/152/some-fun-with-c/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 13:37:54 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[c]]></category>

		<guid isPermaLink="false">http://alexkr.com/fun/152/some-fun-with-c/</guid>
		<description><![CDATA[Do you know that the following is legal C code?

const char * x = "abcdefgh";
int pos = 4;
char tmp1 = (5*2-6)[x];
char tmp2 = pos[x];
assert(tmp1 == 'e');
assert(tmp2 == 'e');

The point here is that compiler evaluates x[y] as (char&#038;)(x + y) or (char&#038;)(y + x).
So regardless of what comes first, the result is the same.
]]></description>
		<wfw:commentRss>http://alexkr.com/fun/152/some-fun-with-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some C++ fun with 2 in power N</title>
		<link>http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/</link>
		<comments>http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 16:22:21 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/</guid>
		<description><![CDATA[There is one very famous task to design an algorithm which calculates 2 in power N.

Obvious solution will require N operations so it is not something we are thinking about.

If you look at the example: 2^6 = 2*2*2*2*2*2 you will notice that it can be done faster: 2^6 = (2^3)*(2^3).

in other words:


long compute2N(long n)
{
	if (n==0) [...]]]></description>
		<wfw:commentRss>http://alexkr.com/source-code/134/some-c-fun-with-2-in-power-n/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zeros or Zeroes</title>
		<link>http://alexkr.com/fun/124/zeros-or-zeroes/</link>
		<comments>http://alexkr.com/fun/124/zeros-or-zeroes/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 17:36:48 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[blah-blah]]></category>

		<guid isPermaLink="false">http://alexkr.com/fun/124/zeros-or-zeroes/</guid>
		<description><![CDATA[Since I was always writing &#8220;zeroes&#8221; I was really surprised that Google contains more pages with &#8220;zeros&#8221; than with &#8220;zeroes&#8221;.
This means more people are using word &#8220;zeros&#8221;.
As for the dictionary both forms are equivalent.
But I was wondering how I ever started to write &#8220;zeroes&#8221;?
Because I thought there is a general rule for words ending with [...]]]></description>
		<wfw:commentRss>http://alexkr.com/fun/124/zeros-or-zeroes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Having math breakfast is easy!</title>
		<link>http://alexkr.com/fun/118/having-math-breakfast-is-easy/</link>
		<comments>http://alexkr.com/fun/118/having-math-breakfast-is-easy/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 14:50:49 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[blah-blah]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[theory]]></category>

		<guid isPermaLink="false">http://alexkr.com/fun/118/having-math-breakfast-is-easy/</guid>
		<description><![CDATA[Here are silly but correct intuitive definitions for properties of binary operations. These properties are essential for understanding complex elements of abstract algebra such as groups, rings and fields thus it is important to have strong intuitive binding for fundamental definitions.
Let&#8217;s make a breakfast with coffee and sandwich!
Please be careful when choosing the sort of [...]]]></description>
		<wfw:commentRss>http://alexkr.com/fun/118/having-math-breakfast-is-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Corporate structure</title>
		<link>http://alexkr.com/fun/113/corporate-structure/</link>
		<comments>http://alexkr.com/fun/113/corporate-structure/#comments</comments>
		<pubDate>Fri, 06 Jul 2007 16:38:54 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://alexkr.com/fun/113/corporate-structure/</guid>
		<description><![CDATA[Pitty I don&#8217;t know who is the author of this.


]]></description>
		<wfw:commentRss>http://alexkr.com/fun/113/corporate-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trigraphs</title>
		<link>http://alexkr.com/fun/106/trigraphs/</link>
		<comments>http://alexkr.com/fun/106/trigraphs/#comments</comments>
		<pubDate>Sun, 06 May 2007 06:53:16 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[c]]></category>

		<guid isPermaLink="false">http://alexkr.com/posts/106/trigraphs/</guid>
		<description><![CDATA[The following code compiles and runs well, however gcc requires &#8220;-trigraphs&#8221; options in order to process the input correctly.


??=include??/
&#60;stdio.h&#62;
int main()??&#60;
  int a??(??)=??&#60;1,2,3??&#62;;
  int x=??-0??(a??)??!1??(a??)??'2??(a??);
  printf("%d\n",x);
  return 0;
??&#62;


So, there are special character sequences, called trigraphs.
They were introduced for systems whith reduced character sets.
Here is the substitution table for trigraphs:


??= 	 #
??(  [...]]]></description>
		<wfw:commentRss>http://alexkr.com/fun/106/trigraphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Templated recursion</title>
		<link>http://alexkr.com/fun/102/templated-recursion/</link>
		<comments>http://alexkr.com/fun/102/templated-recursion/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 14:12:59 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[cpp]]></category>

		<guid isPermaLink="false">http://alexkr.com/fun/102/templated-recursion/</guid>
		<description><![CDATA[To understand what is recursion, you first need to understand what is recursion.
Just discovered the following valid piece of code.
Originally it was printing powers of tree, but it was easy to modify this code so now it supports various bases.
Beautiful, isn&#8217;t it?



#include &#60;iostream&#62;
using namespace std;

template&#60;int BASE, int POWER&#62;
class Pow {
public:
 enum { result=BASE * Pow&#60;BASE, [...]]]></description>
		<wfw:commentRss>http://alexkr.com/fun/102/templated-recursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

