Format Duration





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

5
Date Submitted Thu. Nov. 3rd, 2005 7:10 PM
Revision 1
Helper ses5909
Tags "SQL Server" | Portion | SQL | String
Comments 0 comments
Return a Portion of a Character String
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 . . . )
8
Date Submitted Sun. Oct. 29th, 2006 10:32 AM
Revision 1
Scripter SCoon
Tags Format | Java | Number | String
Comments 0 comments
Configurable number formatter.
5
Date Submitted Mon. Oct. 30th, 2006 1:03 AM
Revision 1
Scripter SCoon
Tags C | CPlusPlus | Java | Ruby | String
Comments 3 comments
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.
8
Date Submitted Sat. Oct. 28th, 2006 3:00 PM
Revision 1
Scripter SCoon
Tags Java | Password
Comments 0 comments
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.
8
Date Submitted Mon. Oct. 30th, 2006 4:42 AM
Revision 1
Scripter SCoon
Tags FreeMind | Java | Mindmaps | Ruby | Web | XML
Comments 0 comments
This code illustrates using ruby REXML package. It converts J2EE web application deployment descriptor web.xml into Freemind mindmap document.
6
Date Submitted Sun. Jul. 23rd, 2006 5:39 PM
Revision 1
Helper rugi
Tags Array | Java | Random
Comments 0 comments
Method for get n random number's
6
Date Submitted Sat. Jul. 28th, 2007 3:19 PM
Revision 1
Helper rugi
Tags BufferedImage | Canvas | Image | Java
Comments 0 comments
Convert
java.awt.Canvas to java.awt.image.BufferedImage or java.awt.image.Image