<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/c</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Sat, 25 May 2013 12:07:34 GMT</pubDate>
<item>
<title>(C) Date format in C - mlecho</title>
<link>http://snipplr.com/view/66233/date-format-in-c/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 20 Jul 2012 05:21:09 GMT</pubDate>
<guid>http://snipplr.com/view/66233/date-format-in-c/</guid>
</item>
<item>
<title>(C) Read hexadecimal argument from command line - vdevos</title>
<link>http://snipplr.com/view/63924/read-hexadecimal-argument-from-command-line/</link>
<description><![CDATA[ <p>This piece of code will read a hex argument such as: ff or ab from your command line and stores it as a integer</p> ]]></description>
<pubDate>Wed, 14 Mar 2012 21:21:34 GMT</pubDate>
<guid>http://snipplr.com/view/63924/read-hexadecimal-argument-from-command-line/</guid>
</item>
<item>
<title>(C) Two Binary Search Functions in C - rtperson</title>
<link>http://snipplr.com/view/63046/two-binary-search-functions-in-c/</link>
<description><![CDATA[ <p>Two versions of binary search -- one recursive, one iterative -- for an array of strings.
Both assume that your array index fits within an integer.</p> ]]></description>
<pubDate>Sat, 04 Feb 2012 02:45:29 GMT</pubDate>
<guid>http://snipplr.com/view/63046/two-binary-search-functions-in-c/</guid>
</item>
<item>
<title>(Objective C) Work 3 in C - AlexanderRavikovich</title>
<link>http://snipplr.com/view/62133/work-3-in-c/</link>
<description><![CDATA[ <p>Buld menu &amp; use pinter &amp; dynamic arrays</p> ]]></description>
<pubDate>Tue, 27 Dec 2011 11:47:38 GMT</pubDate>
<guid>http://snipplr.com/view/62133/work-3-in-c/</guid>
</item>
<item>
<title>(Objective C) Global Variables in Objective-C (Singleton) - neoline</title>
<link>http://snipplr.com/view/61937/global-variables-in-objectivec-singleton/</link>
<description><![CDATA[ <p>How to make Global Variables (Singleton) in Objective-C</p> ]]></description>
<pubDate>Sat, 17 Dec 2011 03:21:45 GMT</pubDate>
<guid>http://snipplr.com/view/61937/global-variables-in-objectivec-singleton/</guid>
</item>
<item>
<title>(Objective C) Use function from another class - neoline</title>
<link>http://snipplr.com/view/61196/use-function-from-another-class/</link>
<description><![CDATA[ <p>Accessing Method from other Classes Objective-C</p> ]]></description>
<pubDate>Fri, 25 Nov 2011 21:10:24 GMT</pubDate>
<guid>http://snipplr.com/view/61196/use-function-from-another-class/</guid>
</item>
<item>
<title>(Objective C) Localized Language Tutorial - neoline</title>
<link>http://snipplr.com/view/60902/localized-language-tutorial/</link>
<description><![CDATA[ <p>How to add multiple Language localization to an App.</p> ]]></description>
<pubDate>Thu, 17 Nov 2011 03:19:02 GMT</pubDate>
<guid>http://snipplr.com/view/60902/localized-language-tutorial/</guid>
</item>
<item>
<title>(VB.NET) Global System Object extensions for easier conditionals (VB.net example) - bryanlyman</title>
<link>http://snipplr.com/view/59759/global-system-object-extensions-for-easier-conditionals-vbnet-example/</link>
<description><![CDATA[ <p>Because there is no way to use object extenders in vb.net here is an example of how you can get similar functionality. See the C# example for further info.</p> ]]></description>
<pubDate>Fri, 14 Oct 2011 16:45:34 GMT</pubDate>
<guid>http://snipplr.com/view/59759/global-system-object-extensions-for-easier-conditionals-vbnet-example/</guid>
</item>
<item>
<title>(Objective C) iOS Show Full Screen - streamt</title>
<link>http://snipplr.com/view/59663/ios-show-full-screen/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 12 Oct 2011 11:26:13 GMT</pubDate>
<guid>http://snipplr.com/view/59663/ios-show-full-screen/</guid>
</item>
<item>
<title>(Objective C) Add / remove view controllers to tab bar controller - FumarMata</title>
<link>http://snipplr.com/view/58591/add--remove-view-controllers-to-tab-bar-controller/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 10 Sep 2011 19:50:23 GMT</pubDate>
<guid>http://snipplr.com/view/58591/add--remove-view-controllers-to-tab-bar-controller/</guid>
</item>
<item>
<title>(Objective C) Add a single UIViewController controller to tabBarController - FumarMata</title>
<link>http://snipplr.com/view/58590/add-a-single-uiviewcontroller-controller-to-tabbarcontroller/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 10 Sep 2011 19:46:18 GMT</pubDate>
<guid>http://snipplr.com/view/58590/add-a-single-uiviewcontroller-controller-to-tabbarcontroller/</guid>
</item>
<item>
<title>(C) Get Key information with GTK - FArcellier</title>
<link>http://snipplr.com/view/57662/get-key-information-with-gtk/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Sat, 06 Aug 2011 17:15:41 GMT</pubDate>
<guid>http://snipplr.com/view/57662/get-key-information-with-gtk/</guid>
</item>
<item>
<title>(Bash) uncrustify c-like sourcecode - abstraktor</title>
<link>http://snipplr.com/view/56055/uncrustify-clike-sourcecode/</link>
<description><![CDATA[ <p>you may not want to use the buggy apt version. just compile it yourself</p> ]]></description>
<pubDate>Sun, 03 Jul 2011 09:14:58 GMT</pubDate>
<guid>http://snipplr.com/view/56055/uncrustify-clike-sourcecode/</guid>
</item>
<item>
<title>(C) Register Autostart Application - the_coder</title>
<link>http://snipplr.com/view/55875/register-autostart-application/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Wed, 29 Jun 2011 07:50:33 GMT</pubDate>
<guid>http://snipplr.com/view/55875/register-autostart-application/</guid>
</item>
<item>
<title>(C) Hashing function for C - davince</title>
<link>http://snipplr.com/view/55639/hashing-function-for-c/</link>
<description><![CDATA[ <p>The General Hash Functions Library has the following mix of additive and rotative general purpose string hashing algorithms.

* RS Hash Function
A simple hash function from Robert Sedgwicks Algorithms in C book. I've added some simple optimizations to the algorithm in order to speed up its hashing process.
* JS Hash Function
A bitwise hash function written by Justin Sobel
* PJW Hash Function
This hash algorithm is based on work by Peter J. Weinberger of AT&amp;T Bell Labs. The book Compilers (Principles, Techniques and Tools) by Aho, Sethi and Ulman, recommends the use of hash functions that employ the hashing methodology found in this particular algorithm.
* ELF Hash Function
Similar to the PJW Hash function, but tweaked for 32-bit processors. Its the hash function widely used on most UNIX systems.
* BKDR Hash Function
This hash function comes from Brian Kernighan and Dennis Ritchie's book "The C Programming Language". It is a simple hash function using a strange set of possible seeds which all constitute a pattern of 31....31...31 etc, it seems to be very similar to the DJB hash function.
* SDBM Hash Function
This is the algorithm of choice which is used in the open source SDBM project. The hash function seems to have a good over-all distribution for many different data sets. It seems to work well in situations where there is a high variance in the MSBs of the elements in a data set.
* DJB Hash Function
An algorithm produced by Professor Daniel J. Bernstein and shown first to the world on the usenet newsgroup comp.lang.c. It is one of the most efficient hash functions ever published.
* DEK Hash Function
An algorithm proposed by Donald E. Knuth in The Art Of Computer Programming Volume 3, under the topic of sorting and search chapter 6.4.
* AP Hash Function
An algorithm produced by me Arash Partow. I took ideas from all of the above hash functions making a hybrid rotative and additive hash function algorithm based around four primes 3,5,7 and 11. There isn't any real mathematical analysis explaining why one should use this hash function instead of the others described above other than the fact that I tired to resemble the design as close as possible to a simple LFSR. An empirical result which demonstrated the distributive abilities of the hash algorithm was obtained using a hash-table with 100003 buckets, hashing The Project Gutenberg Etext of Webster's Unabridged Dictionary, the longest encountered chain length was 7, the average chain length was 2, the number of empty buckets was 4579.</p> ]]></description>
<pubDate>Thu, 23 Jun 2011 21:03:46 GMT</pubDate>
<guid>http://snipplr.com/view/55639/hashing-function-for-c/</guid>
</item>
<item>
<title>(C) Windows C API for running an application as admin - shadevampire</title>
<link>http://snipplr.com/view/54841/windows-c-api-for-running-an-application-as-admin/</link>
<description><![CDATA[ <p>for return codes see the documentation: http://msdn.microsoft.com/en-us/library/bb762153(v=vs.85).aspx</p> ]]></description>
<pubDate>Fri, 03 Jun 2011 23:14:08 GMT</pubDate>
<guid>http://snipplr.com/view/54841/windows-c-api-for-running-an-application-as-admin/</guid>
</item>
<item>
<title>(C) C puzzler for software developer role - adino</title>
<link>http://snipplr.com/view/54742/c-puzzler-for-software-developer-role/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 02 Jun 2011 01:39:34 GMT</pubDate>
<guid>http://snipplr.com/view/54742/c-puzzler-for-software-developer-role/</guid>
</item>
<item>
<title>(C) Digit Check in C - rtperson</title>
<link>http://snipplr.com/view/54626/digit-check-in-c/</link>
<description><![CDATA[ <p>Check that a given integer consists only of elements of a given set. It does a linear search through the set, so the assumption is that the set to search is relatively small. If you're chewing through a particularly large set of digits, you may want to sort your set and implement a binary search.</p> ]]></description>
<pubDate>Tue, 31 May 2011 10:43:04 GMT</pubDate>
<guid>http://snipplr.com/view/54626/digit-check-in-c/</guid>
</item>
<item>
<title>(C#) System Object extensions for easier conditionals (Extending Base Object Types) - bryanlyman</title>
<link>http://snipplr.com/view/53894/system-object-extensions-for-easier-conditionals-extending-base-object-types/</link>
<description><![CDATA[ <p>.net 3.0+, To create stability in your code, you must check all inputs into a method to make sure they are valid . Often people overlook this step because of laziness, or because they aren't convinced that exceptions and assertions are actually in place to help you instead of cause you a headache. Here are some extensions which can be used to enhance the System.Object class so that their methods are global to all classes; this makes input checking effortless. This is also somewhat generic in nature because the extensions take no class type in to account before they are called, but we can use type checking to perform different boxing (casting) operations.  Sadly this cannot be done in VB.net because late binding restrictions do not allow the Object class to be extended (See my VB.Net example for further information).</p> ]]></description>
<pubDate>Sat, 21 May 2011 02:48:17 GMT</pubDate>
<guid>http://snipplr.com/view/53894/system-object-extensions-for-easier-conditionals-extending-base-object-types/</guid>
</item>
<item>
<title>(C#) Check SqlDataReader Column Is Exists  (extension method) - emregulcan</title>
<link>http://snipplr.com/view/53330/check-sqldatareader-column-is-exists--extension-method/</link>
<description><![CDATA[ <p>This snippet is "extension method" for IDataReader. 
You can use this snippet below ;
I assume you have datareader like that
SqlDataReader dataReader = command.ExecuteReader();

if (dataReader.IsColumnExists("columnName"))
{
   //do something
}


and also you should validation null value control if you work critical datas

if (dataReader.IsColumnExists("columName"))
{
    if (dataReader["columName"] != DBNull.Value)
       {
             //do something
        }
}</p> ]]></description>
<pubDate>Wed, 11 May 2011 08:30:49 GMT</pubDate>
<guid>http://snipplr.com/view/53330/check-sqldatareader-column-is-exists--extension-method/</guid>
</item>
</channel>
</rss>