Below are the top ranked snippets.
6
If anyone has tried using the .NET Graphics API, they know that replacing pixel colors takes a long time to complete. I did some research and found a good source. This code will adjust the color to greyscale by Binary.
The page is http://www.navicosoft.com/software_articles/softwares_articles_index.html for more information. It is under Basic Image Processing in the list of articles.
The page is http://www.navicosoft.com/software_articles/softwares_articles_index.html for more information. It is under Basic Image Processing in the list of articles.
10
template function to create a boost::shared_ptr in the form
boost::shared_ptr classPtr = new_ptr(Arg1, Arg2);
You can also make new_ptr_access a friend of className and make the constructor and destructor private.
This keeps the end user from:
Creating an instance manually on the heap
Creating an instance manually on the stack
Deleting a shared_ptr manually using "delete get()"
boost::shared_ptr classPtr = new_ptr(Arg1, Arg2);
You can also make new_ptr_access a friend of className and make the constructor and destructor private.
This keeps the end user from:
Creating an instance manually on the heap
Creating an instance manually on the stack
Deleting a shared_ptr manually using "delete get()"
6
boost::format gives you the ablility to safely use printf like formatting as well as positional format specifiers ala .NET.
8
Converts a string representation of a number with any base(binary, octal, decimal, hexadecimal, up to base 36) to a long int.
4
This is enhanced version of java.util.Properties that:
Preserves order of Properties read from file if LinkedHashMap used.
Preserves comments in header and scattered throughout file.
It's by no means perfect, but a good start for anyone that once the above features.
Preserves order of Properties read from file if LinkedHashMap used.
Preserves comments in header and scattered throughout file.
It's by no means perfect, but a good start for anyone that once the above features.
7
This code will show you how to encrypt user passwords with md5 algorithm and how to start using encrypted passwords if you already have users' database ready. The md5.asp you can download from my site http://www.webcheatsheet.com/asp/md5_encrypt_passwords.php
12
This is a class for generating HTML tables. It's kind of rough, but I thought somebody might want to do something with it.
8
This is a swear filter script I wrote for my xanga blog. I don't know if it has any application anywhere else. This will replace the swear words listed in the array with the character defined in blank_char. This isn't perfect but it works pretty well.
6
This snippet also you to limit the input in a form field to a specified number of characters. It displays a counter so users can see how many characters they have left, and once they reach the limit the field just trims the length to your limit.
The following is a snippet from what I used when I implemented a tagboard to my site. Further revisions could/should read the LIMIT from the maxlength attribute
The following is a snippet from what I used when I implemented a tagboard to my site. Further revisions could/should read the LIMIT from the maxlength attribute
4
This bit of code will open up the http link in a new browser window. The link should be passed to the variable "HTML_File" as a string (as shown below).









