|
 |
|
|
Submitted: August 6, 2008
Views: 420
A printf() type of function used to center text on an 80 character width display.
|
|
|
 |
|
|
Submitted: October 16, 2008
Views: 1894
Using a map to keep track of character statistics.
|
|
|
 |
|
|
Submitted: May 19, 2009
Views: 169
Simple wrapper that gives comparison relational operators to cstrings.
|
|
|
 |
|
|
Submitted: March 26, 2009
Views: 1024
Creates a formatted view of a block of memory. Very useful in debugging.
|
|
|
 |
|
|
Submitted: September 3, 2008
Views: 616
Snippet to convert between EBCDIC and ASCII or visa versa. Uses byte arrays rather than strings.
|
|
|
 |
|
|
Submitted: March 3, 2009
Views: 2424
Ensure that user input is not interpreted as a regular expression when using String.replaceAll or Stirng.split.
|
|
|
 |
|
|
Submitted: February 15, 2008
Views: 394
Will filter Java escape sequences and replace them with their proper characters.
|
|
|
 |
|
|
Submitted: August 14, 2009
Views: 184
The macros AT and HERE(msg) can be used to insert the file name and line number into debugging messages.
|
|
|
 |
|
|
Submitted: June 15, 2009
Views: 131
A template Meta Program to calculate the N'th prime number. Comes from topic: http://www.dreamincode.net/forums/showtopic108683.htm
|
|
|
 |
|
|
Submitted: March 28, 2009
Views: 355
This function (cdecl calling convention) will convert a hex string into a long value.
|
|
|
 |
|
|
Submitted: March 23, 2009
Views: 455
Uses WMI to fetch the battery status. From here it extract the battery life (percent charge).
|
|
|
 |
|
|
Submitted: June 26, 2009
Views: 341
A basic JavaME MIDP application. Displays the message "Hello Phone" and implements an Exit Command.
|
|
|
 |
|
|
Submitted: January 16, 2009
Views: 299
An intro to Win32::OLE and the windows scripting runtime.
|
|
|
 |
|
|
Submitted: March 23, 2009
Views: 333
List Codec files currently registered with Windows.
|
|
|
 |
|
|
Submitted: January 18, 2009
Views: 771
Perl script to demonstrate a WMI call to list all of the running services on a computer.
|
|
|
 |
|
|
Submitted: October 1, 2009
Views: 350
This class implements a unary_function object that can be used with C++'s STL collections and algorithms. The class finds the min, mean, max, total, and range of a sequence of numbers.
|
|
|
 |
|
|
Submitted: April 4, 2009
Views: 250
This manipulator will help output numbers formatted into comma separated groups. -- updated to handle negative numbers.
|
|
|
 |
|
|
Submitted: April 25, 2009
Views: 496
This function output to the stdout stream. This uses the C calling convention so it can be called form a C program.
|
|
|
 |
|
|
Submitted: April 3, 2007
Views: 1068
This program contains a function that will parse a cstring for a valid US-SSN.
|
|
|
 |
|
|
Submitted: November 23, 2007
Views: 615
This code will parse a complex number of the form [+/-]##.## +/- i##.## the numbers may also be of the form #.##e[+/-]##.
|
|
|
 |
|
|
Submitted: March 11, 2007
Views: 1706
Parse zero terminated strings for singed and unsiged integers.
|
|
|
 |
|
|
Submitted: August 10, 2008
Views: 242
Sometimes it is useful to have an inline IIF to use in the preprocessor rather than having to use #if.
|
|
|
 |
|
|
Submitted: May 27, 2009
Views: 212
A example preprocessor device for initializing arrays to a single value.
|
|
|
 |
|
|
Submitted: June 8, 2009
Views: 157
Demonstrates another way to use the preprocessor to initialize arrays at compile time.
|
|
|
 |
|
|
Submitted: May 10, 2009
Views: 604
A Basic LCG example. The function uses the C calling convention (so it can integrate with C/C++).
|
|
|
 |
|
|
Submitted: November 14, 2007
Views: 7146
This function will copy files or directories from one location to another.
|
|
|
 |
|
|
Submitted: November 14, 2007
Views: 4168
This will delete a file or a directory (and all sub directories and files).
|
|
|
 |
|
|
Submitted: March 27, 2007
Views: 5398
Yet Another digit reversal.
|
|
|
 |
|
|
Submitted: August 18, 2008
Views: 372
This snippet shows how to use the preprocessor to select messages from different languages. Allowing the code to be compiled specific to a particular language.
|
|
|
 |
|
|
Submitted: April 24, 2009
Views: 520
Calculates the length of a zero terminated string. The function uses the cdecl calling convention so it can be used directly within C/C++
|
|
|
 |
|
|
Submitted: May 6, 2009
Views: 138
This class will enumerate all of the substrings of a string. Can be constructed to limit the size ranges of the substrings.
|
|
|
 |
|
|
Submitted: September 18, 2009
Views: 176
This template function version of IIF avoids conditionals by using a little Bit Twiddling. Note that there is no real reason not to just use the tertiary operator (?:) in your code -- but if you want to play.
|
|
|
 |
|
|
Submitted: May 24, 2009
Views: 318
Inline assembly routines for getting the values of E and PI on an x86 based processor -- uses inline assembly.
|
|
|
 |
|
|
Submitted: February 16, 2008
Views: 2279
Calculate the maximum of a variable number of inputs without using any control structures or conditionals. – The key to this was the use of iif() function which functions as a substitute to the ?: operator. – Thanks to Bench and baavgai for their inputs. From thread http://www.dreamincode.net/forums/index.php?showtopic=43479
|
|
|
 |
|
|
Submitted: June 27, 2008
Views: 758
Example of how to determine what class and method have called your function.
|
|
|
 |
|
|
Submitted: December 4, 2007
Views: 1224
This function will do formatted printing to the Window's console window. It demonstrates the use of the vsprintf to create a new member of the printf family.
|
|
|
 |
|
|
Submitted: August 31, 2009
Views: 164
This is an addendum to my http://www.dreamincode.net/code/snippet921.htm snippet -- this snippet adds refined control over the color attributes.
|
|
|
 |
|
|
Submitted: March 1, 2007
Views: 14482
Demonstrates using the Win32 console API to manipulate console output. *Updated to compile with Dev-C++ 4.9.9.2 -- resolved overloaded function names.
|
|
|
 |
|
|
Submitted: April 24, 2009
Views: 218
Display a line of text directly to the windows console.
|
|
|
 |
|
|
Submitted: August 23, 2008
Views: 2093
Not all compilers for windows have conio.h the following function shows how to simulate the function using window's ReadConsole function
|
|
|
 |
|
|
Submitted: August 8, 2009
Views: 116
using JACOB to execute a WMI script to get elements of the Win32_PerfRawData_Tcpip_NetworkInterface.
|
|
|
 |
|
|
Submitted: March 23, 2009
Views: 1614
use the JACOB COM bridge to query the WMI interface to determine which services are currently started on a computer
|
|