Please support our C# advertiser: Programming Forums
Contribute Code

Fun with DateTime and TimeSpan

This is just for fun. You know how old you are(I hope), but do you know how many days you are walking around on this planet? The two routines presented here could be used more practically in an ever present employee application. (View Snippet)

Capture your screen in a bitmap.

While strolling around in the methods of the Graphics class, I bounced on the CopyFromScreen method. He, so why not make a screen capture utility! I know there is lots of this stuff out there. But it just seems like fun to try to make one myself. I made a little Forms application with two forms:... (View Snippet)

The 2000 first primes

Blink and you will see them appear in a Console window. This is a translation to C# of a Modula-2 implementation by N.Wirth, the inventor of Pascal. The tested integers are obtained by incrementing alternatively by 2 and 4, thereby avoiding multiples of 2 and 3 in the first place. This list starts... (View Snippet)

Fast Bucket Sort

A slightly modified version of Bucket Sort that uses LinkedLists and initializes buckets only when required. Results in massive speed improvements. (View Snippet)

Bubbe Sort and Selection Sort in C#

Although there is little need for any sort algorithm in C#. Every collection class has a sort method, so why would you wanna write one for yourself? My guess to learn and see how it is done. Well her are implementations of two popular sorts. The arrays are integer but you can change the type if you... (View Snippet)

Any color you like.

You can make any color you like by setting the r, g and b values of a Color structure. But .NET has a set of predefined colors that you can use by name, so that you can simply set the backgroundcolor of a form with Color.LawnGreen for instance. Ever wondered what all those color names are? MSDN has... (View Snippet)

Function plotting in C#

When you want to draw something on a form you need a Graphics object. But a Graphics constructor isn’t public and if that is not enough the Graphics class is also sealed! This means you can’t create a Graphics object via the new keyword nor can you derive from the Graphics class. One way to get... (View Snippet)

Color to uint and back

Convert a color to a uint representation and back with simple byte shifting. (View Snippet)

Bucket Sort Integers

Bucket sort is a very simple, fast sorting algorithm specialized in integers. (View Snippet)

Getting basic with Visual Studio in C#

Visual Studio is a great tool to use. But for beginners like me a few years back, it was a bit overwhelming and confusing. You got the feeling you lost all the control. VS has it’s special ways of doing things with partial classes and so on. So lets get back in control (for a while) this has the... (View Snippet)
Contribute Code
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:31 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC