<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>The Rebertian Times &#187; review</title>
	<atom:link href="http://blog.rebertia.com/tag/review/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rebertia.com</link>
	<description>All my thoughts that are fit to blog. Which mostly consists of stuff about programming.</description>
	<lastBuildDate>Mon, 09 May 2011 20:44:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>C in a Nutshell in a Nutshell</title>
		<link>http://blog.rebertia.com/2009/04/04/c-in-a-nutshell-in-a-nutshell/</link>
		<comments>http://blog.rebertia.com/2009/04/04/c-in-a-nutshell-in-a-nutshell/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 22:12:19 +0000</pubDate>
		<dc:creator>Chris Rebert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[nutshell]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[reference]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://blog.rebertia.com/?p=133</guid>
		<description><![CDATA[I recently finished reading C in a Nutshell, which I highly recommend as an excellent C reference and tutorial to anyone with programming experience. I previously learned some MS Visual C++ at CyberCamps some years ago, but finding the language a bit clunky, I searched around the web, found Python and have been in love [...]]]></description>
			<content:encoded><![CDATA[<p>I recently finished reading <a href="http://www.amazon.com/C-Nutshell-OReilly-Peter-Prinz/dp/0596006977/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1238891376&amp;sr=8-1"><em>C in a Nutshell</em></a>, which I highly recommend as an excellent C reference and tutorial to anyone with programming experience. I previously learned some MS Visual C++ at CyberCamps some years ago, but finding the language a bit clunky, I searched around the web, found Python and have been in love with it ever since. But since every programmer should know (at least most of) C, and I had a C/Assembly course coming up, I resolved to learn C properly; hence the book. Anyway, here are my notes from it, both as a memo to myself and in the hope that others might find it mildly useful:</p>
<h1>Interesting trivia</h1>
<ul>
<li><code>index[array]</code> ≡ <code>array[index]</code> ≡  <code>*(array + index)</code></li>
<li>arguments to a function may be evaluated in <strong><em>any</em></strong> order by the compiler</li>
<li>The <code>signed</code>-ness of plain <code>char</code> is compiler-dependent</li>
</ul>
<h1><a href="http://en.wikipedia.org/wiki/C99">C99</a> Hotness</h1>
<ul>
<li>Boolean type introduced:</li>
</ul>
<pre class="brush:c">#include &lt;stdbool.h&gt;
bool a = true, b = false;</pre>
<ul>
<li><code>//</code>-comments formally allowed</li>
<li>declarations can go <strong><em>anywhere<span style="font-weight: normal;"><span style="font-style: normal;"> within a function; C89 forces you to declare <strong>everything</strong> at the </span>start<span style="font-style: normal;"> of the function</span></span></em></strong></li>
</ul>
<h1>Syntax</h1>
<pre class="brush:c">#include &lt;something_in_std_lib.h&gt;
#include "your_own_lib.h"
enum SomeEnum {A, B, C};
typedef someDeclaration newTypeAlias;</pre>
<ul>
<li><code>const</code> keyword, like Java&#8217;s <code>final</code></li>
<li><code>static</code> keyword means private to this source file, like C#&#8217;s <code>internal</code></li>
</ul>
<h1>Basics</h1>
<pre class="brush:c">int main(int argc, char * argv[])
char aStringVariable[length];</pre>
<ul>
<li><code>EXIT_SUCCESS</code>, <code>EXIT_FAILURE</code> defined in <code>stdlib.h</code></li>
</ul>
<h1>Function pointers</h1>
<pre class="brush:c">int foo(char);//declare function
int (*funcPtr)(char) = foo;
int result = funcPtr('a');//use func pointer</pre>
<h1>Objects</h1>
<h2>Defining</h2>
<pre class="brush:c">struct Foo
//unions use same syntax, just w/ different keyword
{
    int a;
    char b;
}</pre>
<h2>Using</h2>
<pre class="brush:c">/* C99: */ struct Foo bar = {.b = 'Q', .a = 42};
/* C89: */ struct Foo baz = {42, 'Q'};</pre>
<h1>Defining <a href="http://en.wikipedia.org/wiki/C_preprocessor">macros</a></h1>
<ul>
<li>Function-like macros: <code>#define foo(a,b) ((a)-(b))</code></li>
<li>The <code>##</code> operator within macros:
<ul>
<li>Given: <code>#define foo(x) MSG_##x</code></li>
</ul>
<ul>
<li>Then: <code>foo(A)</code> ≡ <code>MSG_A</code></li>
</ul>
</li>
<li>The <code>#</code> operator within macros &#8211; converts operand to string</li>
</ul>
<h1>Useful macros</h1>
<p><a href="http://en.wikipedia.org/wiki/Assertion_(computing)">Assertions</a>:</p>
<pre class="brush:c">#include &lt;assert.h&gt;
assert(booleanExpression);</pre>
<ul>
<li><code>#define NDEBUG</code> &#8211; disables asserts</li>
<li><code>#error "Message"</code> &#8211; causes compile error with given message</li>
<li>Conditional compilation: <code>#if</code>, <code>#elif</code>, <code>#else</code>, <code>#endif</code></li>
</ul>
<h1>Metadata macros</h1>
<ul>
<li><code>__func__</code> &#8211; name of current function</li>
<li><code>__LINE__</code> &#8211; current line number</li>
<li><code>__FILE__</code> &#8211; name of current file</li>
<li><code>__TIME__</code> &#8211; time of compilation</li>
<li><code>__DATE__</code> &#8211; date of compilation</li>
</ul>
<h1>Standards macros</h1>
<ul>
<li><code>__STDC__</code> &#8211; bool for whether compiler is C89-compliant</li>
<li><code>__STDC_VERSION__</code> &#8211; <code>199901L &gt;=</code> if C99-compliant</li>
<li><code>__STDC_IEC_559__</code> &#8211; bool for <a href="http://en.wikipedia.org/wiki/IEEE_754">IEEE-754</a> compliance</li>
</ul>
<h1><a href="http://en.wikipedia.org/wiki/C_standard_library">Stdlib</a> survey</h1>
<ul>
<li><code><a href="http://en.wikipedia.org/wiki/Stdlib.h">stdlib.h</a></code>: <code><a href="http://en.wikipedia.org/wiki/Malloc">malloc</a>()</code>, <code>free()</code>, array sorting, binary search, str-&gt;num conversion, random numbers</li>
<li><code><a href="http://en.wikipedia.org/wiki/Stddef.h">stddef.h</a></code>: defines <code><a href="http://en.wikipedia.org/wiki/Null_pointer">NULL</a></code>, <code><a href="http://en.wikipedia.org/wiki/Size_t">size_t</a></code></li>
<li><code><a href="http://en.wikipedia.org/wiki/String.h">string.h</a></code>: also includes general array/memory stuff</li>
<li><code><a href="http://en.wikipedia.org/wiki/Math.h">math.h</a></code>, <code><a href="http://en.wikipedia.org/wiki/Time.h">time.h</a></code>: speak for themselves</li>
<li><code><a href="http://en.wikipedia.org/wiki/Errno.h">errno.h</a></code>: defines <code>errno</code> global var</li>
<li><code><a href="http://en.wikipedia.org/wiki/Ctype.h">ctype.h</a></code>: ASCII character classification</li>
<li><code><a href="http://en.wikipedia.org/wiki/Fenv.h">fenv.h</a></code>: controls floating point rounding mode, etc [<strong>C99 only</strong>]</li>
<li><code><a href="http://en.wikipedia.org/wiki/Limits.h">limits.h</a></code>: limits of integer types</li>
<li><code><a href="http://en.wikipedia.org/wiki/Float.h">float.h</a></code>: describes properties of float representation</li>
<li>See also <a href="http://rebertia.com/wiki/C_Stdlib_Notes">my summary </a>of the essential parts of the stdlib</li>
</ul>
<h1><a href="http://en.wikipedia.org/wiki/GNU_Compiler_Collection">GCC</a> options</h1>
<ul>
<li><code>-o exec_name</code> (instead of <code>a.out</code>)</li>
<li><code>-Idir_name:other_dir_name</code> (places to also look for headers)</li>
<li><code>-fsyntax-only</code> (just check syntax)</li>
<li><code>-ansi</code> (use C89)</li>
<li><code>-std=c99</code> (use C99)</li>
<li><code>-Wall</code> (warn about a bunch of stuff)</li>
<li><code>-pedantic</code> (adhere pedantically to standard)</li>
<li><code>-Wextra</code> (warn about strange/pointless code)</li>
<li><code>-g</code> (add debug info)</li>
<li><code>-pg</code> (add profiling hooks)</li>
</ul>
<img src="http://blog.rebertia.com/?ak_action=api_record_view&id=133&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.rebertia.com/2009/04/04/c-in-a-nutshell-in-a-nutshell/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Please Pardon Our Dust</title>
		<link>http://blog.rebertia.com/2009/03/07/please-pardon-our-dust/</link>
		<comments>http://blog.rebertia.com/2009/03/07/please-pardon-our-dust/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 05:48:19 +0000</pubDate>
		<dc:creator>Chris Rebert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.rebertia.com/?p=109</guid>
		<description><![CDATA[Just finished moving the blog off of WordPress.com and onto my own servers, hence why the theme suddenly changed. I&#8217;m still finishing up the setup, so don&#8217;t be alarmed if things suddenly change over the next day or so. You may be wondering why I&#8217;m going through all the trouble to move things. Basically, WordPress.com [...]]]></description>
			<content:encoded><![CDATA[<p>Just finished moving the blog off of WordPress.com and onto my own servers, hence why the theme suddenly changed. I&#8217;m still finishing up the setup, so don&#8217;t be alarmed if things suddenly change over the next day or so.</p>
<p>You may be wondering why I&#8217;m going through all the trouble to move things. Basically, WordPress.com quite frankly has a lousy theme selection. Also, using my own server gives me more control. I will applaud them on making moving one&#8217;s blog quite easy, with nice import-export wizards and making it simple to delete one&#8217;s blog. No service provider lock-in.</p>
<p>Anyway, thanks for reading! New posts are planned and will be on their way Real Soon (TM)!</p>
<img src="http://blog.rebertia.com/?ak_action=api_record_view&id=109&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.rebertia.com/2009/03/07/please-pardon-our-dust/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amateur Fiction FTW!</title>
		<link>http://blog.rebertia.com/2009/02/01/amateur-fiction-ftw/</link>
		<comments>http://blog.rebertia.com/2009/02/01/amateur-fiction-ftw/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 06:57:25 +0000</pubDate>
		<dc:creator>Chris Rebert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fiction]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[promo]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[story]]></category>

		<guid isPermaLink="false">http://blog.rebertia.com/?p=75</guid>
		<description><![CDATA[My friend recently started publishing a serialized short science fiction story on his group blog, and it&#8217;s terrific so far. It&#8217;s intriguingly titled &#8220;Cities of Bronze and Glass&#8221;. It&#8217;s about a &#8220;device&#8221; that seeks to find the mysterious &#8220;Creator&#8221;. In doing so, it buries itself only after making a backup of itself, which it names [...]]]></description>
			<content:encoded><![CDATA[<p>My friend recently started publishing a serialized short science fiction story on his group blog, and it&#8217;s terrific so far. It&#8217;s intriguingly titled <a href="http://unterseeboot.blogspot.com/2009/01/cities-of-bronze-and-glass-1.html">&#8220;Cities of Bronze and Glass&#8221;</a>. It&#8217;s about a &#8220;device&#8221; that seeks to find the mysterious &#8220;Creator&#8221;. In doing so, it buries itself only after making a backup of itself, which it names &#8220;Two&#8221;. This inevitably leads to a large population of devices (&#8220;Forty-Three&#8221; is mentioned at one point), all being backups and all trying to find &#8220;the Creator&#8221;. I don&#8217;t think I can adaquately summarize the typical SciFi atmosphere of mystery in it, suffice it to say that no further backstory is given, which is par for the course in Science Fiction. I highly encourage you to read it as it&#8217;s quite novel and original. My friend hasn&#8217;t finished it yet, so I eagerly await the upcoming parts in order to learn how the story ends.</p>
<p>If you like it, you might also enjoy a considerably longer story from the same blog: &#8220;<a href="http://unterseeboot.blogspot.com/2007/05/awakening-part-i.html">Awakening</a>&#8220;. I think <a href="http://starsage.net/">my other friend</a> ,the Illuminati Ninja, would appreciate that story, especially considering the vague similarity to his story which was took place on a Pan-Dimensional Waffle, among other settings.</p>
<p><em>This post has been brought to you by <a href="http://en.wiktionary.org/wiki/shameless_plug" class="broken_link">Shameless Plugs Inc.</a>: &#8220;(Non-)profit unblushing internet cross-promotion <a href="http://en.wikipedia.org/wiki/History_of_blogging_timeline">since 1994</a>.&#8221;</em></p>
<img src="http://blog.rebertia.com/?ak_action=api_record_view&id=75&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.rebertia.com/2009/02/01/amateur-fiction-ftw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

