<?xml version="1.0"?>
<?xml-stylesheet href="/App_Themes/Rss/Rss.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:snippetcenter="http://www.snippetcenter.org/">
<channel>
	<title>snippetcenter.org Snippet Feed - C/C++</title>
	<link>http://www.snippetcenter.org/</link>
	<description>The newest Snippets in  C/C++</description>
	<language>en-us</language>
	<copyright>snippetcenter.org</copyright>
	<generator>Advice: This is a RSS Document for reading in your RSS-Reader. Click here for mor informations.</generator>

	<image>
		<url>http://www.snippetcenter.org/Library/Media/Public/button_88x31.png</url>
		<title>snippetcenter.org</title>
		<link>http://www.snippetcenter.org/</link>
		<width>88</width>
		<height>31</height>
	</image>
	
	<item>
     <title><![CDATA[CRegexpT Revision 1.1.2.41 bug demonstration program.]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/cregexpt-revision-11241-bug-demonstration-program-s1968.aspx]]></guid>
     <pubDate>Thu, 12 Jun 2008 13:19:00 GMT</pubDate>
     <description><![CDATA[CRegexpT Revision 1.1.2.41 bug demonstration program.
(see source code comment for details)]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/cregexpt-revision-11241-bug-demonstration-program-s1968.aspx]]></link>
</item>

<item>
     <title><![CDATA[Safely concatenate strings in portable C (and C++ if you like)]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/safely-concatenate-strings-in-portable-c-and-c-if-you-like-s1954.aspx]]></guid>
     <pubDate>Sun, 11 Nov 2007 03:34:00 GMT</pubDate>
     <description><![CDATA[concat() - allocate memory and safely concatenate strings in portable C (and C++ if you like).

This code deals gracefully with potential integer overflows (perhaps when input strings are maliciously long), as well as with input strings changing from under it (perhaps because of misbehavior of another thread).  It does not depend on non-portable functions such as snprintf() and asprintf().]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/safely-concatenate-strings-in-portable-c-and-c-if-you-like-s1954.aspx]]></link>
</item>

<item>
     <title><![CDATA[Systemzeit aktualisieren]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/systemzeit-aktualisieren-s1952.aspx]]></guid>
     <pubDate>Mon, 15 Oct 2007 17:28:00 GMT</pubDate>
     <description><![CDATA[Dieser Code aktualisiert die Systemzeit!]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/systemzeit-aktualisieren-s1952.aspx]]></link>
</item>

<item>
     <title><![CDATA[Static template-based Huffman Compression scheme]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/static-template-based-huffman-compression-scheme-s1947.aspx]]></guid>
     <pubDate>Thu, 06 Sep 2007 20:34:00 GMT</pubDate>
     <description><![CDATA[Snippet is template C++ class. In order to use it, when making its instance you must specify two template arguments: one is storage type (STYPE) which depends on maximal symbol frequency, and the other is indexing type (ITYPE), which directly corresponds to the size of the symbol you want to encode. For example, if you are going to compress a huge file (let's say 7GB) you must use appropriate STYPE for it (in GCC it is ULONGLONG, in MSVC it is unsigned __int64).

This is just an unoptimized reference code (Usually, "smart guys" are writing something like "...but I'll let you finish it for the exercise". I'm not smart, the proof for that is that I'm programming instead of doing something else in my life.) At least, if properly implemented, it won't crash unlike some other snippets I've seen around :)

For non-Microsoft people, __declspec(align(x)) is used to align both code and data on their natural boundaries (or larger), in order to gain some performance; you can freely omit it.

The other thing, you can decide to use REFERENCE_ prefixed implementations for coding and decoding, but never both. REFERENCE_ is slower, but you can better understand it that way.

After you compile the code and compare it with some decent range coder (even of order-0), regarding the speed and compression ratio, you'll throw it away as serious solution for data compression of any kind.

The only purpose for publishing this snippet is to provide students worldwide with the flexible implementation in order to review the history of compression algorithms, and perheps to help them pass some exams.

]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/static-template-based-huffman-compression-scheme-s1947.aspx]]></link>
</item>

<item>
     <title><![CDATA[Base-256 Radix-Sorter for 4-byte types.]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/base-256-radix-sorter-for-4-byte-types-s1880.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[A radix is a base of a number system.  Just as a one bit value is a base-2 radix (two permutations: one and zero), eight bits (one byte, or type 'signed/unsigned char') is a base-256 radix (256 permutations: 0-255).  For a list of base-2 numbers, we count the occurances of each 1 and 0 in an array of length 2 (ie. unsigned int base2count[2];).  Each '0' is counted in base2count[0], and each '1' in base2count[1]. We can do the same for base-256 numbers (char types!) in an array of length 256.  Sorting the original list of numbers is then as easy as using the count of each occurance as an offset for copying the original list into a new sorted list.  This process can be used to sort larger types by repeating the process on each byte (base-256 radix), from the LSB to the MSB.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/base-256-radix-sorter-for-4-byte-types-s1880.aspx]]></link>
</item>

<item>
     <title><![CDATA[parseIntDemo.c]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/parseintdemoc-s1873.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[Demonstrates parsing a string for its int value, including all error checking (since atoi does not check for errors).]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/parseintdemoc-s1873.aspx]]></link>
</item>

<item>
     <title><![CDATA[A fast ATan2 Function]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/a-fast-atan2-function-s1868.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[If you are doing a lot of ATan2 you my find this to be faster than the library call.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/a-fast-atan2-function-s1868.aspx]]></link>
</item>

<item>
     <title><![CDATA[Vector and Direction]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/vector-and-direction-s1858.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[A Vector class (ie xyz not std::vector).A Direction class.Helper functions:* Convert Vector to Direction (roll is zero)* Convert Direction to Vector (vector is normalised)* Reflect Vector in a plane.* Project a point onto a plane.* Find the distance to a line.* The the (yaw|pitch|roll) between two directions.Also, there are some (unfinished) hittest functions.]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/vector-and-direction-s1858.aspx]]></link>
</item>

<item>
     <title><![CDATA[Unix Path Normalization]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/unix-path-normalization-s1851.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[A little routine to normailze a path. Passin something like ./../..//tmp/../usr/src/./../lib/ andget back /usr/lib]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/unix-path-normalization-s1851.aspx]]></link>
</item>

<item>
     <title><![CDATA[combinatorics]]></title>
     <guid><![CDATA[http://www.snippetcenter.org/en/combinatorics-s1847.aspx]]></guid>
     <pubDate>Mon, 15 May 2006 10:21:00 GMT</pubDate>
     <description><![CDATA[basic combinatorial routines; could be used in loops to go through all the permutations of a given list, or all the lists L with L[i]&lt;=M[i] for a given M; stuff like that]]></description>
     <link><![CDATA[http://www.snippetcenter.org/en/combinatorics-s1847.aspx]]></link>
</item>



</channel>
</rss>
