Load File into String





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

11
Date Submitted Wed. Jul. 5th, 2006 8:15 AM
Revision 2
Helper poncho
Tags Array | Name | PHP | String | Value
Comments 3 comments
Convert an irregular name=value pair string into a formatted array.
3
Date Submitted Tue. Jun. 13th, 2006 3:21 PM
Revision 1
Helper gbarendt
Tags enum | String | VB.NET
Comments 0 comments
Given a string, you can return an Enum value

Originally found at http://codeproject.com/dotnet/EnumTips.asp?df=100&forumid=38264&exp=0&select=797671
9
Date Submitted Fri. May. 26th, 2006 11:16 AM
Revision 2
Coder mattrmiller
Tags "Email Address" | Java | String | Validate
Comments 2 comments
Fixed the regular expression to check for more strict requirements.
7
Date Submitted Wed. Mar. 29th, 2006 11:31 AM
Revision 1
Helper digitaljunkie
Tags compress | File | gzip | Perl
Comments 0 comments
Need to GZip a file using Perl?

Use Compress::Zlib.

This is a simple perl script which creates a GZip file.
8
Date Submitted Wed. Mar. 29th, 2006 10:55 AM
Revision 1
Helper digitaljunkie
Tags File | MD5 | Perl
Comments 0 comments
Is this file the same as that file? The files may or may not be binary. We could compare the modify dates, or the sizes. But, those are not very accurate to know if a file has really changed.

Introducing MD5 Checksum. We can feed the files into Digest::MD5 in binary mode.

This is a great way to do Incremental Backups.

This is also an easy way to verify checksums when downloading files from the internet which list their MD5 Checksums.

You'll need the Digest::MD5 Perl Module.
14
Date Submitted Wed. Mar. 22nd, 2006 6:10 PM
Revision 2
Beginner nev3rm0re
Tags PHP | String
Comments 1 comments
This function calculates how many lines will text occupy.
Example (simple):


$string = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus tincidunt posuere dolor";

$num_lines = how_many_lines(10, $string);

It accepts a third, optional, parameter $options, that allows you to change behaviour. $options should be array. Following configuration options are available:

'white_spaces' - default: array(' ', "\t") - array of chars, that should be treated as whitespace.

'new_lines' - default: array("\r\n", "\n") - array of strings, that should be treated as newlines. For example, for HTML you can set 'new_lines' => array('');

'force_line_breaks' - default: true - force wrapping, when the token is longer than width, or not. If set to false, and token cannot be fitted into $width, function will return false;

'callback' - default: null - callback function for determining character width. Must accept at least one parameter - $char

'callback_params' - default: array() - optional additional callback parameters

'char_widths' - default: null - associative array in a form $char => $width, which contains char width. If $char is not found in the array, it's width is defaulted to 0.

8
Date Submitted Tue. Mar. 21st, 2006 11:58 AM
Revision 1
Helper gbarendt
Tags File | programming | python | system
Comments 1 comments
Copies files from nested folders into one source, flat directory.
13
Date Submitted Mon. Mar. 20th, 2006 4:52 PM
Revision 1
Coder mattrmiller
Tags Delete | Extension | File | Folder | Java
Comments 0 comments
Deletes all files of a certain extention from a folder.
7
Date Submitted Thu. Mar. 16th, 2006 11:17 PM
Revision 1
Coder mattrmiller
Tags File | Java | Move
Comments 1 comments
Move a file quickly in java.
13
Date Submitted Thu. Mar. 16th, 2006 10:49 PM
Revision 1
Coder mattrmiller
Tags Compression | File | GZIPOutputStream | GZIPOutputStreamEx | Java | Stream
Comments 0 comments
in the normal GZIPOutputStream you can not et the compression level. I came across this little script tonight that allows you to set the compression level for GZIPOutputStream.