DIJKSTRA ALGORITHM IN JAVA





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

« Previous 1 2 3 4 5 6 7 8 9  ...  13 14 Next »
4
Date Submitted Sat. Sep. 9th, 2006 9:22 PM
Revision 1
Helper jbplou
Tags String | VB.NET
Comments 2 comments
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.
9
Date Submitted Tue. Sep. 19th, 2006 7:53 PM
Revision 1
Helper jbplou
Tags CSharp | Security | String
Comments 0 comments
Generates an 88 character secure hash string for the passed in strings.
10
Date Submitted Thu. May. 11th, 2006 10:19 AM
Revision 3
Helper jbuchberger
Tags BATCH | Java
Comments 2 comments
Java properties files can yield undesirable results at runtime, if there happen to be spaces at the end of some lines.

Requires a win32 port for the GNU utilities grep and sed - e.g. http://unxutils.sourceforge.net/.
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
9
Date Submitted Thu. May. 18th, 2006 2:02 AM
Revision 3
Helper jbuchberger
Tags Java
Comments 0 comments
With Java Web Start 1.5.0 all of a sudden new proxy properties were introduced (deployment.proxy.http.host, deployment.proxy.http.port and deployment.proxy.bypass.list) valid only for the webstart environment - and if that was not enough yet, it does not support the existing proxy properties, neither the standard, nor the deprecated ones from old Java releases. To topple even that, for the bypass-list the delimiters were changed to semicolon (http.nonProxyHosts has the pipe char as delimiter) ...

standard networking properties

the workaround here makes sure, that if any one of these proxy properties (deprecated, standard or webstart-5 ones) are set, that all the others get the same settings - this pays off, if you're using different third-party components relying on one specific set of these proxy properties (especially if it's beyond your power, in what kind of environment the software will be executed respectively integrated...)
6
Date Submitted Thu. Jan. 4th, 2007 4:30 AM
Revision 1
Beginner jimmah
Tags C | factorial | Fast | Recursive
Comments 3 comments
Gives factorials for a given value.
4
Date Submitted Mon. Oct. 23rd, 2006 5:35 PM
Revision 1
Beginner jonathanstarrett
Tags "form input" | Java | JComboBox
Comments 0 comments
I was looking for an easy way to populate a combo box with strings taken from an enumeration, and also to be able to pull out Enum objects from the combo box. After some searching, I found EnumComboBoxModel on the JDesktop website, but was not able to find any code.

Instead I came up with an easier solution that did not require me to define a new Model class, but instead uses javax.swing.DefaultComboBoxModel.

Sorry for the disorganization of the code, but hopefully you get the idea.
-3
Date Submitted Thu. Feb. 23rd, 2006 9:57 AM
Revision 3
Helper jpinkham
Tags Java | JDBC | lightweight | orm | SQL
Comments 1 comments
I actually like SQL. So, things like Hibernate with it's own query language don't quite fit my style. But, I don't want to code the same catch SQLException conn.close over and over either. So, I came up with this.

The idea is you extend SQLCommand (usually anonymously) override getSql(), and call execute() to get a list of whatever objects you are selecting - all the cleanup stuff is taken care of. It also handles nullable attributes more intuitively using ResultSetWrapper and PreparedStatementWrapper so that in your overridden getRow(ResultSetWrapper rs) method, you can call getInt on a nullable column and have it return null - what a concept! Also I like java.util.Date for my dates, so the wrappers convert to/from java.sql.Timestamp.

Right now I've only bothered with some basic types - it should be pretty clear how to add more if you need em.

See what ya'll think.

Oh, it uses JDK 1.5 Generics, but stripping that away would be pretty easy if you wanted 1.2 compliance.
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.
9
Date Submitted Mon. Apr. 3rd, 2006 10:41 AM
Revision 1
Helper jpinkham
Tags debug | Java | toString
Comments 1 comments
Do you find yourself implementing toString on your objects all the time, and wondering why (the debugger seems to do a pretty good job of it all by itself)...well, here's a bit of introspection applied to the problem. This is for all those quick debug sessions where you just want to do System.out.println(myComplexObject).

Instead, just do System.out.println(DebugPrint.toString(myComplexObject));
« Previous 1 2 3 4 5 6 7 8 9  ...  13 14 Next »