Roman number translator
8
Convert an ebcdic buffer to an ascii buffer.
8
Nifty way to swap two integers in C (C++) without using a temporary variable. Uses one line of code (3 assignments).
7
The modus operandi for this is similar to that taken by PHP's implementation of such functions. It's comparitively memory-intensive, but is much faster than running a whole bunch of tests.
Basically, you set a mask -- an array of 256 null bytes -- and set those that correspond to characters you wish to trim. Then, rather than having to test if a character is in the set of characters to trim(O(n), or linear time on *ws), you just test once (O(1), or unit time) to see if the byte in question is set.
And of course, to trim(), you just wrap trim() around both ltrim() and rtrim().
One point of caution: these functions trim in place, so copy strings before trimming them. (Of course, if you usually want access to both pre- and post-trimmed strings, you could always make these malloc() a new string and return a pointer to it . . . )
Basically, you set a mask -- an array of 256 null bytes -- and set those that correspond to characters you wish to trim. Then, rather than having to test if a character is in the set of characters to trim(O(n), or linear time on *ws), you just test once (O(1), or unit time) to see if the byte in question is set.
And of course, to trim(), you just wrap trim() around both ltrim() and rtrim().
One point of caution: these functions trim in place, so copy strings before trimming them. (Of course, if you usually want access to both pre- and post-trimmed strings, you could always make these malloc() a new string and return a pointer to it . . . )
7
This little number will allow the contents of other pages to be included or embedded into the rendered HTML of an aspx page. Using the WebClient class from the .NET framework, you can conditionally load pages, even manipulate the HTML before it is rendered and in this example, fill in forms and execute javascript actions.
The following example shows how to auto-login to an Exchange Server - this was something requested for inclusion into our portal, but I left out the logic that pulls/decrypts the real password - for obvious reasons.
Enjoy!
~Jeremy
The following example shows how to auto-login to an Exchange Server - this was something requested for inclusion into our portal, but I left out the logic that pulls/decrypts the real password - for obvious reasons.
Enjoy!
~Jeremy
6
Another pull from my growing-towards-beta CGI library: sgcgi_url_unescape().
Note the use strcpy, which is faster than the equivalent memmove()ing. To ensure 64-bit safety, I plan to rename this function and then conditionally compile it to point to either strcpy or a 64-bit-safe memmove() implementation of strcpy.
However, even though copy order isn't guaranteed for strcpy, on 16-bit and 32-bit systems, all known implementations copy byte-by-byte from lower addresses to higher addresses. Some 64-bit optimized compilers may copy 8-byte chunks, making the assumption of full linearity unstable at best.
I know it sounds like I'm justifying use of nonstandard code for convenience . . . *blush* . . . it's just something that putting in a -DPEDANTIC type of preprocessor flag could fix if broken, and its SO much faster!
Note the use strcpy, which is faster than the equivalent memmove()ing. To ensure 64-bit safety, I plan to rename this function and then conditionally compile it to point to either strcpy or a 64-bit-safe memmove() implementation of strcpy.
However, even though copy order isn't guaranteed for strcpy, on 16-bit and 32-bit systems, all known implementations copy byte-by-byte from lower addresses to higher addresses. Some 64-bit optimized compilers may copy 8-byte chunks, making the assumption of full linearity unstable at best.
I know it sounds like I'm justifying use of nonstandard code for convenience . . . *blush* . . . it's just something that putting in a -DPEDANTIC type of preprocessor flag could fix if broken, and its SO much faster!
6
Gives factorials for a given value.
6
Code snippet that prints MAC addresses for Ethernet type devices.
5
This module is used to generate the unique number and self check the numbers in social security, band accounts and etc.
Here you can find detailed explanation:
http://www.eclectica.ca/howto/modulus-11-self-check.php?start=1&count=5&generate=Generate#calculator
I have made this scirpt generate numbers in drop down list and write brojevi.txt file that you can download with numbers you have generated...
Here you can find detailed explanation:
http://www.eclectica.ca/howto/modulus-11-self-check.php?start=1&count=5&generate=Generate#calculator
I have made this scirpt generate numbers in drop down list and write brojevi.txt file that you can download with numbers you have generated...
5
This class intended to collect TODO comments from java/c++/etc source files.
Example:
protected readFileData (String path) throws IOException {
// TODO: add try...catch block for IOException
InputStream is = new FileInputStream(path);
...
}
See also DirectoryScanner class.
Example:
protected readFileData (String path) throws IOException {
// TODO: add try...catch block for IOException
InputStream is = new FileInputStream(path);
...
}
See also DirectoryScanner class.
5
Simple C++ program that creates a directory with the asked username, and places 2 files within the directory that contain the asked for username and the asked for password.
This is an edit of another snippet I made, but I have fixed the creation of the user's folder so it is named after the user.
FlyingIsFun1217
This is an edit of another snippet I made, but I have fixed the creation of the user's folder so it is named after the user.
FlyingIsFun1217









