<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0cCSX85cCp7ImA9WhFSEks.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018</id><updated>2013-06-15T04:51:08.128+03:00</updated><category term="Cryptography" /><category term="Event Programming" /><category term="Signal Processing" /><category term="Visual Studio" /><category term="Gnome3" /><category term="Memory Operations" /><category term="AWT" /><category term="Visual Programming" /><category term="SQL" /><category term="File Operations" /><category term="C" /><category term="Arrays" /><category term="Threads" /><category term="Geometry" /><category term="Windows" /><category term="GUI" /><category term="Swing" /><category term="Skeleton Code" /><category term="ANSI" /><category term="C++" /><category term="Collections" /><category term="Graphics" /><category term="Mathematics" /><category term="NMat" /><category term="Text Files" /><category term="Console" /><category term="Preprocessor" /><category term="GDS" /><category term="Telecommunications" /><category term="Legacy" /><category term="Inheritance" /><category term="Microsoft SQL Server CE" /><category term="Constants" /><category term="Data Structures" /><category term="External Arguments" /><category term="Control Flow" /><category term="Applets" /><category term="Library" /><category term="Image Processing" /><category term="Pointers" /><category term="Bitwise" /><category term="Memory Management" /><category term="Software Architecture" /><category term="Java" /><category term="VB" /><category term="JavaDoc" /><category term="Algorithms" /><category term="Gnome" /><category term="Exception Handling" /><category term="Locale" /><category term="C#" /><category term="Text User Interface" /><category term="Netbeans" /><category term="Compilers" /><category term="Random Numbers" /><category term="Wrappers" /><category term="Linux" /><category term="Operators" /><category term="Eclipse" /><category term="OOP" /><category term="File I/O" /><category term="gcc" /><category term="Ubuntu" /><category term="Bash" /><category term="Type Conversions" /><category term="Databases" /><category term="Game Programming" /><category term="Serialization" /><category term="Concurrent Programming" /><category term=".NET" /><category term="String operations" /><category term="Enumerations" /><title>Dystopian Code</title><subtitle type="html">Programming Tutorials</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://dystopiancode.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Bogdan Taranu</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>117</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/DystopianCode" /><feedburner:info uri="dystopiancode" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DEECQH8yfSp7ImA9WhNbEEg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-4008182871937341717</id><published>2013-01-13T07:47:00.002+02:00</published><updated>2013-01-13T07:57:41.195+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-13T07:57:41.195+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Console" /><title>Reading from Console in ANSI C</title><summary type="html">The ANSI C standard I/O library (stdio.h) provides us with 3 powerful functions for reading data from STDIN (the stream used for the console):

-Reading a character: getchar

-Reading formatted input: scanf
-Reading an entire line: gets

Here's a short example on how you can use any of these functions to read a string:
#include&amp;lt;stdio.h&amp;gt;

int main(void)
{
    const int LENGTH = 100;

    //The &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/Ai-iu3fV6q8" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/4008182871937341717/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2013/01/scanf-getchar-gets-ansi-c-console.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/4008182871937341717?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/4008182871937341717?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/Ai-iu3fV6q8/scanf-getchar-gets-ansi-c-console.html" title="Reading from Console in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2013/01/scanf-getchar-gets-ansi-c-console.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU4HQHo6cSp7ImA9WhNUFk0.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-6010518577468775980</id><published>2013-01-08T01:32:00.003+02:00</published><updated>2013-01-08T02:12:11.419+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-08T02:12:11.419+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="gcc" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Console" /><title>How to Print to Console in ANSI C</title><summary type="html">The ANSI C standard I/O library (stdio.h) provides us with 3 powerful functions for outputting characters to STDOUT (the stream used for the console):
-Printing a character:  putchar
-Printing a string : puts
-Printing a formatted string : printf

A formatted string is a dynamical string that is built on the go. Here's an example:
#include&amp;lt;stdio.h&amp;gt;

int main(void)
{
    int myInt = 42;
    &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/xJ5jCc4P60w" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/6010518577468775980/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2013/01/printf-puts-putchar-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/6010518577468775980?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/6010518577468775980?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/xJ5jCc4P60w/printf-puts-putchar-ansi-c.html" title="How to Print to Console in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2013/01/printf-puts-putchar-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YASX05fyp7ImA9WhNUE0k.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-1169893920019824615</id><published>2013-01-04T00:14:00.002+02:00</published><updated>2013-01-05T03:25:48.327+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-05T03:25:48.327+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Memory Operations" /><title>Using sizeof to Determine the Size of a Data Type in ANSI C</title><summary type="html">The size of an ANSI C data type is dependent on the compiler.  However it can be easily determined by using the sizeof operator.


Here's a  example on how to do it:

#include&amp;lt;stdio.h&amp;gt;

typedef struct
{
    int  field1;
    long field2;
    char field3[30];
}ExampleStructure;

typedef union
{
    int field1;
    double field2;
}ExampleUnion;

typedef enum
{
    enum1,
    enum2,
    enum3
}&lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/hM7AW5SyWmY" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/1169893920019824615/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2013/01/using-sizeof-to-determine-size-of-data.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1169893920019824615?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1169893920019824615?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/hM7AW5SyWmY/using-sizeof-to-determine-size-of-data.html" title="Using sizeof to Determine the Size of a Data Type in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2013/01/using-sizeof-to-determine-size-of-data.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MCRXk8fip7ImA9WhJUFEU.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-4226763671968835576</id><published>2012-08-19T18:54:00.002+03:00</published><updated>2012-09-12T23:24:24.776+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-12T23:24:24.776+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematics" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Integer Rounding in ANSI C</title><summary type="html">
1.Unsigned Integers

When two unsigned integers are divided, the result will be rounded down.


result = numerator / denominator;
To round up a result you must apply the following idiom:


result = (numerator + denominator - 1) / denominator;
Example:
#include&amp;lt;stdio.h&amp;gt;

int main(void)
{
    unsigned int numerator   = 50;
    unsigned int denominator = 25;
    unsigned int upResult;
    unsigned &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/-RWgGuZ0uVA" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/4226763671968835576/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/integer-rounding-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/4226763671968835576?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/4226763671968835576?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/-RWgGuZ0uVA/integer-rounding-in-ansi-c.html" title="Integer Rounding in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/integer-rounding-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEFRHs9fCp7ImA9WhJUFEU.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-1710739474302875596</id><published>2012-08-19T16:31:00.002+03:00</published><updated>2012-09-13T00:00:15.564+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T00:00:15.564+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Swing" /><category scheme="http://www.blogger.com/atom/ns#" term="GUI" /><title>Creating a MessageBox / Message Dialog in Java Swing</title><summary type="html">To create a dialog in Swing, you will need to use the JOptionPane class.

If you want to trigger a message dialog, you will need to use the static method:

showMessageDialog(Component parentComponent, Object message, String title, int messageType, Icon icon)






1.The Parent Component

Defines the component (usually a JFrame or a JPanel) that will be the parent of the dialog. The coordinates of&lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/hBazoe2nilY" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/1710739474302875596/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/creating-messagebox-message-dialog-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1710739474302875596?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1710739474302875596?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/hBazoe2nilY/creating-messagebox-message-dialog-in.html" title="Creating a MessageBox / Message Dialog in Java Swing" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-0f6UR2fggas/UDDDaSeCEMI/AAAAAAAAAUM/W97GhHeoTq8/s72-c/Screenshot+from+2012-08-19+13:43:13.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/creating-messagebox-message-dialog-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQFQns-eyp7ImA9WhJUFEU.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-62269728418042439</id><published>2012-08-19T12:39:00.001+03:00</published><updated>2012-09-12T23:38:33.553+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-12T23:38:33.553+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="JavaDoc" /><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans" /><title>Installing and Configuring JavaDoc for Netbeans in Ubuntu</title><summary type="html">
If you encounter such an error, you probably don't have JavaDoc installed or you don't have it configured correctly.


The JavaDoc error


1.Installing JavaDoc

You can install it using command-line or a package manager.

To install it command-line open a terminal and type:
sudo apt-get install openjdk-6-doc

If you want to install it using Ubuntu Software Center, open it and search for openjdk-&lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/sKYpA1AXeFg" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/62269728418042439/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/installing-and-configuring-javadoc-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/62269728418042439?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/62269728418042439?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/sKYpA1AXeFg/installing-and-configuring-javadoc-for.html" title="Installing and Configuring JavaDoc for Netbeans in Ubuntu" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-jVp6ioi-A9Y/UDCtL_L3k5I/AAAAAAAAATI/4AU6Sd8F18w/s72-c/Screenshot+from+2012-08-19+12:06:22.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/installing-and-configuring-javadoc-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUHQXY8eCp7ImA9WhJWEkU.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-2078392017524276163</id><published>2012-08-18T12:28:00.003+03:00</published><updated>2012-08-18T12:30:30.870+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-08-18T12:30:30.870+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Gnome" /><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><title>Removing Shortcuts From the Gnome Applications Menu Manually</title><summary type="html">If you installed a program without using the Ubuntu Software Center and there is no uninstaller (or you just deleted the folder), the shortcut to your removed application may still remain in the Application Menu.



If you try to remove it using Alacarte, you may be surprised to see that your shortcut doesn't appear there. If you find it in Alacarte, read this.



This happened to me when I &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/qZqdwIP4Itk" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/2078392017524276163/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/removing-shortcuts-from-gnome.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/2078392017524276163?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/2078392017524276163?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/qZqdwIP4Itk/removing-shortcuts-from-gnome.html" title="Removing Shortcuts From the Gnome Applications Menu Manually" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/removing-shortcuts-from-gnome.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIGQnwzfSp7ImA9WhJUFEU.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-1951617141146651926</id><published>2012-08-17T19:59:00.002+03:00</published><updated>2012-09-12T23:58:43.285+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-12T23:58:43.285+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Euclid's GCD Algorithm in ANSI C</title><summary type="html">In mathematics, Euclid's algorithm is a simple yet efficient method for computing the greatest common divisor of two positive integers.

There are 3 possible implementation for Euclid's algorithm:

1. Division-Based Euclid
/*
 * Description:
 *  Returns the greatest common denominator of a and b using the
 *  Euclid's algorithm division-based.
 * Parameters:
 *  a,b - two positive integers
 * &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/KcZEBScfudQ" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/1951617141146651926/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/euclids-gcd-algorithm-in-ansi-c.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1951617141146651926?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1951617141146651926?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/KcZEBScfudQ/euclids-gcd-algorithm-in-ansi-c.html" title="Euclid's GCD Algorithm in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/euclids-gcd-algorithm-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIMSXk9eip7ImA9WhJUFEU.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-6839438514391812431</id><published>2012-08-17T13:32:00.001+03:00</published><updated>2012-09-12T23:59:48.762+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-12T23:59:48.762+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Bitwise" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Generic Bitcount Algorithm in ANSI C</title><summary type="html">The purpose of the Bitcount algorithm is to return the number of bits set to 1 in a memory block.

A simple implementation of the Bitcount algorithm would be:

/*
 * Description:
 *  The function returns the number of bits set the 1 in a integer
 * Parameters:
 *  data - the integer who will be verified
 * Returns:
 *  The number of bits set to 1
 */
int SimpleBitCount(unsigned long data)
{
    /&lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/90nhlqxX_hI" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/6839438514391812431/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/generic-bitcount-algorithm-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/6839438514391812431?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/6839438514391812431?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/90nhlqxX_hI/generic-bitcount-algorithm-in-ansi-c.html" title="Generic Bitcount Algorithm in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/generic-bitcount-algorithm-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8MSH85eyp7ImA9WhNbEEg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-8594005144508916943</id><published>2012-08-17T10:09:00.002+03:00</published><updated>2013-01-13T08:18:09.123+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-13T08:18:09.123+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Enumerations" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><title>Using Enumerations in ANSI C</title><summary type="html">In ANSI C, a enumeration is a collection of integer constants which share something in common.  The enumeration is somewhat of an analogy to a set. Also, enumerations are a better alternative than a group of macrodefinitions.

They can be declared as:
#include&amp;lt;stdio.h&amp;gt;

enum Color
{
   RED ,
   GREEN ,
   BLUE ,
};

int main(void)
{
   printf("RED = %d\nGREEN = %d\nBLUE = %d",RED,GREEN,BLUE);
   &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/hjZksLDQcQg" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/8594005144508916943/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/enumerations-in-ansi-c_17.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/8594005144508916943?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/8594005144508916943?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/hjZksLDQcQg/enumerations-in-ansi-c_17.html" title="Using Enumerations in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/enumerations-in-ansi-c_17.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAMQHk4eCp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-5953637811583093948</id><published>2012-08-15T10:20:00.002+03:00</published><updated>2012-09-13T19:29:41.730+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:29:41.730+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Pointers" /><title>Basic Pointer Operations in ANSI C</title><summary type="html">Pointers are variables that hold a memory address. Usually that memory address is the first memory address of another variable or a dynamically allocated block. The type of the pointer indicates to what kind of variable it points to.

Example:

    /*A pointer to a int variable*/
    int   *myPointer;
    /*A pointer to a char variable*/
    char  *myCharPointer;
    /*A pointer to a double &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/vPB7lw8CGwA" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/5953637811583093948/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/basic-pointer-operations-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/5953637811583093948?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/5953637811583093948?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/vPB7lw8CGwA/basic-pointer-operations-in-ansi-c.html" title="Basic Pointer Operations in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/basic-pointer-operations-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUABQHs5eip7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-1536632924616757449</id><published>2012-08-15T09:05:00.001+03:00</published><updated>2012-09-13T19:29:11.522+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:29:11.522+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Pointers" /><title>Call by Value and Call by Reference in ANSI C.</title><summary type="html">
In ANSI C, variables can be referred directly or indirectly depending on the context.


A variable who is referred indirectly is a variable who is called-by-value. This means that when you pass the variable to a function, a hard copy of the variable will be created and used in that function. Any modifications that occur to the variable while in the function will not happen to the original &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/YIBh_Gd3KlE" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/1536632924616757449/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/call-by-value-and-call-by-reference-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1536632924616757449?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1536632924616757449?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/YIBh_Gd3KlE/call-by-value-and-call-by-reference-in.html" title="Call by Value and Call by Reference in ANSI C." /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/call-by-value-and-call-by-reference-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAHQn89eip7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-3850370574634103428</id><published>2012-08-11T19:04:00.002+03:00</published><updated>2012-09-13T19:28:53.162+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:28:53.162+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Memory Management" /><category scheme="http://www.blogger.com/atom/ns#" term="Arrays" /><title>Creating a Dynamic Matrix in ANSI C</title><summary type="html">
The memory of a dynamic matrix can be allocated at run time as opposite to the static matrices (who are allocated at compile-time).


The allocation algorithm is based on the function void* malloc(size_t size). The first thing that must be done is to allocate the space for the entire matrix. After that, each row from the matrix must be allocated separately.

/*
 * Description:
 *  Allocates &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/N_H-Tv16Onc" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/3850370574634103428/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/creating-dynamic-matrix-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/3850370574634103428?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/3850370574634103428?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/N_H-Tv16Onc/creating-dynamic-matrix-in-ansi-c.html" title="Creating a Dynamic Matrix in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/creating-dynamic-matrix-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAESHg9eyp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-7386489491155029165</id><published>2012-08-11T12:38:00.001+03:00</published><updated>2012-09-13T19:28:29.663+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:28:29.663+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Preprocessor" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Software Architecture" /><title>Conditional Inclusion in ANSI C</title><summary type="html">Let us assume that you have a program that will run on multiple platforms. For each platform you have an API which defines the functions that you will call in your program.

Example Scenario:
Your platforms are Windows, Unix, BSD and Mac. The headers for the platform specific operations are:
-Windows: windows_api.h
-Unix: unix_api.h
-BSD: bsd_api.h
-Mac: mac_api.h

Here's an example on how to &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/6mM0C2va05E" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/7386489491155029165/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/conditional-inclusion-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/7386489491155029165?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/7386489491155029165?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/6mM0C2va05E/conditional-inclusion-in-ansi-c.html" title="Conditional Inclusion in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/conditional-inclusion-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUENRXc5eip7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-5687957272397268387</id><published>2012-08-11T11:23:00.001+03:00</published><updated>2012-09-13T19:28:14.922+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:28:14.922+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Preprocessor" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><title>Avoiding Multiple Header Inclusion in ANSI C</title><summary type="html">Let us assume that you have 2 header files a.h and b.h and one source file main.c.



The files are in following relation:




Double-inclusion scenario


Let assume that this is the initial content of the files:

The content of b.h:

/*b.h*/
typedef enum
{
    val1 = 1,
    val2,
    val3
}EValues;


The content of a.h:

/*a.h*/
#include"b.h"

const int resource2 = val1+val2;


The content of &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/5Jq1d7okN7s" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/5687957272397268387/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/avoiding-multiple-header-inclusion-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/5687957272397268387?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/5687957272397268387?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/5Jq1d7okN7s/avoiding-multiple-header-inclusion-in.html" title="Avoiding Multiple Header Inclusion in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-KOVKYQoBWvo/UCYQMxD0W-I/AAAAAAAAAS0/sV2bN1Tuj6s/s72-c/Diagram1.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/avoiding-multiple-header-inclusion-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAASXgzcCp7ImA9WhNbEEg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-4942128892300276091</id><published>2012-08-11T09:51:00.001+03:00</published><updated>2013-01-13T08:15:48.688+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-13T08:15:48.688+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><title>The Literal Suffixes and Prefixes of ANSI C</title><summary type="html">In order to improve the readability of your code , you can declare constant literal values using suffixes.

Also, if you want to initialize integers in other radix than decimal, you can use prefixes. Characters can be as well declared using the octal, decimal and hexadecimal.

Here are some examples:
/*-----------------------------------------------
Integer constants
-----------------------------&lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/pweEt84hI0Y" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/4942128892300276091/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/constant-suffixes-and-prefixes-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/4942128892300276091?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/4942128892300276091?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/pweEt84hI0Y/constant-suffixes-and-prefixes-in-ansi-c.html" title="The Literal Suffixes and Prefixes of ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/constant-suffixes-and-prefixes-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEASHgzfyp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-1876328338293758722</id><published>2012-08-06T22:36:00.003+03:00</published><updated>2012-09-13T19:27:29.687+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:27:29.687+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="String operations" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Reversing a String in ANSI C</title><summary type="html">If you're not familiar with how strings are represented in ANSI C, you should read this first:

Concatenating, Copying and Comparing Strings in ANSI C


We shall reverse the string in situ, without using an additional string. The implementation for this function is:


/**
 * Description:
 *  Reverses the received string.
 * Parameters:
 *  string - a pointer to the string who will be reversed
 * &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/MYdBSS04OCs" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/1876328338293758722/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/reversing-string-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1876328338293758722?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/1876328338293758722?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/MYdBSS04OCs/reversing-string-in-ansi-c.html" title="Reversing a String in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/reversing-string-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEHQXwzfip7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-8425218443300398197</id><published>2012-08-04T20:13:00.004+03:00</published><updated>2012-09-13T19:27:10.286+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:27:10.286+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="NMat" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematics" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><title>Other Matrix Operations in NMat</title><summary type="html">In order to understand this article, you should read the following articles first:

The NMat Library

Creating, Destroying and Copying a Matrix

NMat provides several other operations for matrix calculus, such as:
-Finding the minimum/maximum element of a matrix
-Computing the sum/product of all elements of a matrix
-Extracting rows and columns from a matrix into a submatrix
-Computing the &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/qyx9HnFSoHY" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/8425218443300398197/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/other-matrix-operations-in-nmat.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/8425218443300398197?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/8425218443300398197?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/qyx9HnFSoHY/other-matrix-operations-in-nmat.html" title="Other Matrix Operations in NMat" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/other-matrix-operations-in-nmat.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEFQHo7eCp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-7951291842261201989</id><published>2012-08-04T00:28:00.004+03:00</published><updated>2012-09-13T19:26:51.400+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:26:51.400+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="NMat" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematics" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><title>The NMat Library</title><summary type="html">NMat is a ANSI C library that provides an API for matrix operations.

The current operations implemented by NMatlib are:

 
 
 

  Operation
  Description
 

  Create
  Creates a NMatrix object
 

  Destroy
  Destroys a NMatrix object
 

  Clone
  Creates a hard copy of an existent NMatrix object
 

  Sum
  Computes the sum of two matrices
 

  Scalar Multiplication
  Multiplies the matrix with a&lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/P8PqhMq_jYU" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/7951291842261201989/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/the-nmat-library.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/7951291842261201989?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/7951291842261201989?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/P8PqhMq_jYU/the-nmat-library.html" title="The NMat Library" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/the-nmat-library.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUINQXc6cSp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-15409186376913577</id><published>2012-08-02T19:20:00.001+03:00</published><updated>2012-09-13T19:26:30.919+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:26:30.919+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GDS" /><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Data Structures" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Defining an Object for the GDS Library</title><summary type="html">If you don't know about the basics of the GDS library, be sure to read this first:

The Generic Data Structure Library

In order to work with the data structures defined in the GDS library, your structure (which we shall call an object from now on) must be defined in a certain way. In this article I will provide you with a simple example on how to define such an object.



The first thing that &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/FQXanczq3kk" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/15409186376913577/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/08/gds-defining-object.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/15409186376913577?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/15409186376913577?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/FQXanczq3kk/gds-defining-object.html" title="Defining an Object for the GDS Library" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/08/gds-defining-object.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIAQn0ycSp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-252796048733394896</id><published>2012-07-29T20:45:00.002+03:00</published><updated>2012-09-13T19:25:43.399+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:25:43.399+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GDS" /><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Data Structures" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><title>The Generic Data Structures Library</title><summary type="html">The purpose of the GDS (Generic Data Structures) Library is to provide type-independent data structures such as lists, sets, trees or arrays for the C programming language.

A GDS object contains 2 data structures:
-A interface data structure which contains the object's generic behaviors:
      -Copy (Used for creating a hard copy of the object) 
      -Destroy (Used for freeing the memory &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/6v9MOxpJw4U" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/252796048733394896/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/07/the-generic-data-structures-library.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/252796048733394896?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/252796048733394896?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/6v9MOxpJw4U/the-generic-data-structures-library.html" title="The Generic Data Structures Library" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/07/the-generic-data-structures-library.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMDRH4yfSp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-6079354505542988344</id><published>2012-07-27T19:30:00.000+03:00</published><updated>2012-09-13T19:24:35.095+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:24:35.095+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Library" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Temperature Conversion Library in Java</title><summary type="html">This library allows you to perform conversion between the Celsius, Kelvin, Rankine, Delisile, Newton, Reaumur, Romer and Fahrenheit temperature scales.

Here's an example on how to use the library:
package temperatureconversion;

public class TestLauncher
{
    public static void main(String[] args)
    {
        Temperature t1 = Temperature.fromCelsius(-273.15);
        Temperature t2 = &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/pbrLTU2zbwk" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/6079354505542988344/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/07/temperature-conversion-library-in-java.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/6079354505542988344?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/6079354505542988344?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/pbrLTU2zbwk/temperature-conversion-library-in-java.html" title="Temperature Conversion Library in Java" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/07/temperature-conversion-library-in-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QDQXk4fSp7ImA9WhJQE0Q.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-8983626864920638440</id><published>2012-07-27T15:15:00.003+03:00</published><updated>2012-07-27T15:16:10.735+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-07-27T15:16:10.735+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Applets" /><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans" /><title>Designing Applets with the Netbeans GUI Designer</title><summary type="html">
If you want to use the Netbeans GUI editor for an Applet you must follow the next steps:


1. In the menu bar go to File -&amp;gt; New Project and then select Java-&amp;gt;Java Application



2.Name your application and select a location for the project



3, Select the package where you want to add your applet and then right click -&amp;gt; New -&amp;gt; Other. After that go to Swing GUI Forms -&amp;gt; JApplet Form



4.Choose &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/FWOy873gVtE" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/8983626864920638440/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/07/designing-applets-with-netbeans-gui.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/8983626864920638440?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/8983626864920638440?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/FWOy873gVtE/designing-applets-with-netbeans-gui.html" title="Designing Applets with the Netbeans GUI Designer" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-4y7-q8mZpZ0/UBKB5syJjUI/AAAAAAAAAQ8/YTJsdfoEVb0/s72-c/FirstStep.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/07/designing-applets-with-netbeans-gui.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIEQ3o9cSp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-5894518503084240402</id><published>2012-07-27T12:20:00.003+03:00</published><updated>2012-09-13T19:25:02.469+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:25:02.469+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="String operations" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Pangram Checking Algorithm in ANSI C</title><summary type="html">A pangram is a sentence that contains at least once all the letters of the alphabet. A well known pangram in the English language is the sentence "A quick brown fox jumps over the lazy dog".

To check if a string is a pangram we must implement a flag vector containing entries for each letter of the alphabet. A flag will be set if the corresponding letter is found in the string. If all flags from &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/jUxHnm8tscM" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/5894518503084240402/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/07/pangram-checking-algorithm-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/5894518503084240402?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/5894518503084240402?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/jUxHnm8tscM/pangram-checking-algorithm-in-ansi-c.html" title="Pangram Checking Algorithm in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/07/pangram-checking-algorithm-in-ansi-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMHSX4_fSp7ImA9WhJUFUg.&quot;"><id>tag:blogger.com,1999:blog-4389443862338186018.post-7288250353011453768</id><published>2012-07-27T10:56:00.000+03:00</published><updated>2012-09-13T19:23:58.045+03:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-13T19:23:58.045+03:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="ANSI" /><category scheme="http://www.blogger.com/atom/ns#" term="String operations" /><category scheme="http://www.blogger.com/atom/ns#" term="Algorithms" /><title>Anagram Checking Algorithm in ANSI C</title><summary type="html">An anagram is a word or phrase formed by reordering the letters of another word or phrase [Free Online Dictionary].



The easiest method to check if a string is an anagram of another string is to build the letter frequency statistics for both strings and compare them. If the statistics vectors are equal, then the strings are anagrams.


An implementation of such function is:
/*
 * Description:
 &lt;img src="http://feeds.feedburner.com/~r/DystopianCode/~4/7EXBt5M5Ovs" height="1" width="1"/&gt;</summary><link rel="replies" type="application/atom+xml" href="http://dystopiancode.blogspot.com/feeds/7288250353011453768/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dystopiancode.blogspot.com/2012/07/anagram-checking-algorithm-in-ansi-c.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/7288250353011453768?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4389443862338186018/posts/default/7288250353011453768?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/DystopianCode/~3/7EXBt5M5Ovs/anagram-checking-algorithm-in-ansi-c.html" title="Anagram Checking Algorithm in ANSI C" /><author><name>Bogdan Taranu</name><uri>https://plus.google.com/113471477047828063920</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh5.googleusercontent.com/-IAEAbInSR8Q/AAAAAAAAAAI/AAAAAAAAAmo/3U-OSkmy760/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://dystopiancode.blogspot.com/2012/07/anagram-checking-algorithm-in-ansi-c.html</feedburner:origLink></entry></feed>
