DIJKSTRA ALGORITHM IN JAVA
8
If you only want to compare yyyy-mm-dd you can use the java.sql.Date class, the valueOf method does the trick. It's perfectly safe as the sql Date class is a subclass of the Date class.
Check out the docs here for more detail.
enjoy
Check out the docs here for more detail.
enjoy
8
Converts a string representation of a number with any base(binary, octal, decimal, hexadecimal, up to base 36) to a long int.
8
Convert an ebcdic buffer to an ascii buffer.
6
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");
Example
String md5Hash = stringMD5("my password");
9
Below is a bit of code which sets up drag and drop in a treeview. This is handy for if you have a list of items that can be sorted by the user.
Here is a bit of code to demonstrate how to do this. First create a new Windows executable project. Drop a TreeView component on the form, and let's name it 'myTree' for this demonstration. Go ahead and populate it with some dummy data; enough data to see the dragging and dropping in action. You will need a variable global to the form's scope.
private TreeNode sourceNode;
This is used to track the item we are dragging in our TreeView. Then define the event handlers listed below.
Here is a bit of code to demonstrate how to do this. First create a new Windows executable project. Drop a TreeView component on the form, and let's name it 'myTree' for this demonstration. Go ahead and populate it with some dummy data; enough data to see the dragging and dropping in action. You will need a variable global to the form's scope.
private TreeNode sourceNode;
This is used to track the item we are dragging in our TreeView. Then define the event handlers listed below.
-9
Write a set of bytes into a so-called binary file. The point is that we use BinaryWriter here and we have a byte array as input.
5
MovingParts
One of best and unknown built in string function included in .NET is String.Split(). It has come in quite handy for my in the last 2 years that I thought I'd share. Pretty basic example here...and for my first post, I thought I'd throw in a little File IO (for free of course)! This was written in .NET 2.0 and it will take little to no modification to make it work in 1.0/1.1.
6
This snippet generates a secure hash string using VB.NET
4
This function provides the reverse of a string. It is constructed using string builder because strings in .NET are immutable, while stringbuilders are not. Therefore large strings could be slow to reverse if a regular string was used for the working value that is returned.
2
This function loads an File into an String.









