john guthrie

Ranch Hand
+ Follow
since Aug 05, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by john guthrie

hi, i have a currently running, does-almost-everything, webapp based around struts/spring/hibernate. i need to do a couple of CRUDs for some backing database tables that only a few users (admins) would see, and i thought this could be done quickly with grails. but ....

i don't see any tutorials on how to 'add' grails to an already existing project - they all start from scratch.

so, is this a doable thing?
16 years ago
you can have multiple jvms on a linux box. all you need to do is to switch the path to point to the one you want to use, e.g. (bash-speak below):

export JAVA2_HOME=/usr/local/jdk1.4.8
export JAVA5_HOME=/usr/local/jdk1.5.0
export PATH=$JAVA5_HOME/bin:$PATH

two things to note:
1) you may have an /etc/profile.sh or /etc/profile.d/java.sh that sets up the jvm, so that may be where you want to make the change
2) redhat used to install a fairly old jdk by default in /usr/bin (i say 'used to' because i haven't run RH in a couple of years). so if the above stuff acts funny you can rpm-uninstall the redhat supplied one or just rename any /usr/bin/java, /usr/bin/javac, /usr/bin/jar, /usr/bin/javah etc
17 years ago
i have dozens of forms with "id" properties. i really really don't think struts has any reserved words - dunno how it could.
17 years ago
for my current project, at a fairly low priority, i'd like to start migrating away from struts 1.1. i like webwork, and i am thinking that one strategy would be to gently migrate the app to webwork 2.2, with the idea that once struts 2 is production-ready i can (more?) easily migrate from webwork.

so is this a ridiculous idea? i really do see benefit taking positive steps away from struts (to webwork to struts 2), but not if those steps don't in some way follow the same path.
17 years ago
you might look at ANTLR vice a series of case conditions
17 years ago
awk is a unix command, so you'd run it in a shell script (if on windows, you can run it in cygwin, dunno if there's a native windows awk). it's very useful, and looks very impressively cryptic to newbies and beautiful women.
nice. thanks. next time, i may at least remember this advice from the other posting:

Check the javadocs for the DriverManager class, particularly the section about the "jdbc.drivers" property.

look at SimpleDateFormat. this, or something near it, should work:

SimpleDateFormat parser = new SimpleDateFormat("yyyymmddhhmmss");
Date d = parser.parse(dateString + timeString);
return new Timestamp(d.getTime());
17 years ago
there is a way to specify and register the jdbc driver from the command line, as a -D argument i think, something like:


i can't remember what the actual argument is though. anyone else know?
how about awk?

awk -F, '{print "insert into table_a (C1, C20) values (\"" $1 "\", \"" $2 "\"")' csv-file

then pipe result into isql or somesuch.

just nosy, but why are they dictating what tool(s) you can use? what's wrong with letting you get the job done the best way you know how?
i'd say your reference was wrong. static initializers are run at class-load time, which may or may not coincide with object instantiation. so having constructors throw unchecked exceptions won't cover a static initialization.
18 years ago
from what i know, j_security_check is strictly thumbs-up/thumbs-down, you logged in successfully or you didn't. there is nothing in it to handle explaining why you didn't.

so you are looking at a custom implementation, where you handle the entire login process yourself. some app-servers (jboss is the one i have in mind) could let you drop in a plugin and keep the j2ee login, but that's obviously app-server-specific
18 years ago
secure random is a pretty solid implementation of a PRNG. it's not based at all on system clock, so when you try to generate the random numbers should have nothing to do with the RNs you get. also, from the name it looks like it hashes the entropy value, so even if the two values were time-based (and close together) the hash would change that.
18 years ago
using jakarta-commons-lang, you could also StringUtils.chop(string) to remove the last character (no matter what it is)
18 years ago