Format Duration





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

6
Date Submitted Thu. Aug. 3rd, 2006 12:10 PM
Revision 1
Helper bobbyrward
Tags boost | CPlusPlus | Format | printf
Comments 0 comments
boost::format gives you the ablility to safely use printf like formatting as well as positional format specifiers ala .NET.
6
Date Submitted Thu. Aug. 24th, 2006 1:58 PM
Revision 1
Beginner jamesstaylor
Tags Java
Comments 1 comments
This is a quick and easy class that will generate MD5 hashes from strings. I originally wrote it to insert into my Oracle database so I could generate MD5 hases for passwords from PL/SQL.

Example

String md5Hash = stringMD5("my password");
6
Date Submitted Thu. Oct. 20th, 2005 6:27 PM
Revision 1
Coder mattrmiller
Tags Date | Java | Parse
Comments 1 comments
Date Parse
6
Date Submitted Tue. Apr. 25th, 2006 1:03 PM
Revision 1
Coder mattrmiller
Tags Generate | Java | UID
Comments 3 comments
Another way to generate a unique ID.
7
Date Submitted Tue. Sep. 26th, 2006 1:13 PM
Revision 1
Scripter sehrgut
Tags C | ltrim | Parse | rtrim | String | trim
Comments 1 comments
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 . . . )
7
Date Submitted Wed. Sep. 27th, 2006 10:51 AM
Revision 1
Scripter shachi
Tags function | reverse | String
Comments 3 comments
Turns any string backwards. If you input "Test" it gives out "tseT". Hope it's useful.

The snippet shows how to use it.
7
Date Submitted Sat. Oct. 28th, 2006 6:03 PM
Revision 1
Scripter SCoon
Tags "Command Line" | Java | Reflection
Comments 0 comments
This class uses reflection to locate option setters. Client class must contains methods setFile (to receive file names from the command line) and setOption### (to receive option ###).

(See also adapter-based implementation)
7
Date Submitted Sun. Oct. 29th, 2006 9:36 AM
Revision 1
Scripter SCoon
Tags Java | XML
Comments 0 comments
Implementation-independent XML builder.
7
Date Submitted Mon. Apr. 3rd, 2006 10:33 AM
Revision 1
Helper jpinkham
Tags Date | intersect | Interval | Java
Comments 1 comments
A handy class I use all the time to encapsulate the idea of whether two events coincide. For example, given a time period representing a shift, and a list of time periods representing transactions or sessions or whatever, find which ones are either totally or partially within the time period. This class make it a bit easier.
7
Date Submitted Mon. May. 15th, 2006 11:25 AM
Revision 4
Helper jbuchberger
Tags ant | builds | Java
Comments 0 comments
if you use the same buildfiles on your local codebase and your continuous integration buildserver, the if-attribute for ant's targets comes in handy...

for this ant buildfile snippet to only create+publish javadoc when executed on the buildserver, the buildserver only has to set the referred system property, e.g. on its startup by using a Java D-option "-Dcontinuous.build=true" ...

ant buildtool website