Randy Motluck

Greenhorn
+ Follow
since Jul 19, 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 Randy Motluck

All,
This is an interesting thread. Both sides make good points. I feel the argument against guns is weak.
If people were really interested in outlawing items that kill people or harm society, cigarettes, alcohol and cars would have to be on the top of the list. These should go far above guns in the list.
But it is really a matter of utility. A friend that is a lawyer pointed this out to me, and I seem to agree. People that complain the most about guns and violence don't own any guns and seem not to have ever used one (sports, recreation, or otherwise). If you have no use for a gun, fine. Don't tell everyone that they can't have one either.
Cars kill massive amounts of people in the US but no one every ponders making autos contraban. Every one "needs" a car; therefore the utility factor has a role. Gun control advocates always say nobody really needs a gun! It seems bizarre to me. Maybe everyone who advocates gun control should give up their cars for a year or two...
Living 200 miles from Chicago, I don't see tons of gang-land violence. I do live in a suburban area, though. This state requires its own ID card for purchase of firearms and ammunition. Stricter laws will not change intent people from obtaining guns, through whatever measures.
In this area of the country, hunting is a popular sport. Shooting clay targets is also popular.
Eliminating guns would hamper these sports.
Knives are also used in murder. Soon, are we going to ban fillet knives from fishermen?
I think the real issue is that people, in general, are not as willing to take responsibilty for their own actions these days. Governments in many areas of the world are condoning this behavior - including the US.
Everyone has some kind of problem whether it is drug abuse, alcoholism, irritating family, rude coworkers, or just a bad disposition. That is not an excuse and we in the US don't really need to find a scape goat in guns.
Eliminating guns will not eliminate the need for people to maintain self control.
Maybe the answer could fall in a test: Make 1/2 of some country gun free and the other half a place where responsible citizens are allowed to have guns. Give it ten years are check out where you would want to live.
That is just my $.02,
BTW check out this bit on Paramedics being issued body armor! I found it through Google.
http://news.bbc.co.uk/1/low/england/2117592.stm
21 years ago
If you use a property "name" in the jsp, you should have a method "setName" that only takes one argument, the name to set. If you want the address, you should have a property called address and use a method called "setAddress" with only one argument as well. It should be the address to set.
That's it. The jsp can glean the correct method name from the propery name.
-Randy
21 years ago
JSP
If you are running the client and getting the "UnMarshalException - nested ClassNotFoundException ", then you may want to make sure to have the same codebase argument on the java command for the client.
I have gotten around this by making sure the CLASSPATH is set for both the server side and client side. Make sure your basic stuff works before letting RMI fetch needed class definitions.
Then let the full RMI w/ codebase rip!
My 2cents. -Randy
21 years ago
In my example, I called a Perl CGI script on my own computer. I think your answer is the setup in the machine. You could restrict access to the web server that hosts your CGI. If you restrict it such that the only requests it answers are the ones coming from your machine where the Java app server runs, you are done. You just need to make sure the Servlet has the security you desire.
This would work for a GET Method. The Servlet can pick up the form data from the URL and pass it along. I did not try this for any POST method forms, but I would imagine that you could just rip off the encoded arguments and shoot them over the socket to the CGI server.
-Randy
-Randy
21 years ago
You could try this:
I found some code on:
http://www.webdeveloper.com/java/java_jj_read_write.html .
Combining that with a servlet, I was able to call a script that prints out the junk from the CGI environment (local Apache httpd w/ Perl).
Your idea sparked my interest and I can use it.
Here is the doGet() from my servlet CGIHandler.
Hope this helps.
-Randy
*************************************
public void doGet(
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException, java.io.IOException
{
boolean isValid = false;
//get theCgiUrl from Request URL or just set it to a static dest.
String theCgiUrl = "http://localhost/cgi-bin/printenv.pl";
String errorUrl = "http://127.0.0.1/"; //probably a local JSP like cgiError.jsp or something

ServletContext ctx = getServletContext();

//do some authorization, I will just set to true
isValid = true;

URL myUrl = null;
if(isValid)
{
myUrl = new URL(theCgiUrl);
}
else // isValid == false <=> not authorized
{
myUrl = new URL(errorUrl);
}
//log which URK
ctx.log(this.getClass().getName() + " -> using URL: " + myUrl);
//capture the URL's ctxtent
URLConnection conn = myUrl.openConnection();
conn.connect();
ctx.log(this.getClass().getName() + " -> connected..." );
//now get the content into a buffer.
DataInputStream data = null;
String line;
String content = "";
StringBuffer buf = new StringBuffer();
data = new DataInputStream(new BufferedInputStream(conn.getInputStream()));
while ((line = data.readLine()) != null)
{
buf.append(line + "\n");
content += line;
}
data.close();
//print it out
PrintWriter out = response.getWriter();
out.print(content);
}//end doGet()
21 years ago
FTP
For FTP you might want to try Freshmeat:
http://freshmeat.net/projects/javaftp_api/?topic_id=20%2C87%2C89%2C136%2C142
This is something a coworker used. It is a client API.
-Randy
21 years ago
If you go with Entity EJB's and CMP, you don't do the SQL (in an IDE). If you go with JDBC, you may need to write SQL that is not portable from DB to DB.

Just an extra 2 cents.
-Randy
Sorry my last post had some stuff ripped out of the text. The xhost command can be xhost + to accept any incoming X program or xhost +myhostname for just one particular host.
Sorry I had some less-than and greater-than's that must have filtered out.
21 years ago
You might be getting the connection refused because you logged in as sophia and then ran the oracle install script as user 'oracle'. Make sure to do an xhost+ or xhost +<myhostname> as the user that you logged in with (sophia in this case). Then as user oracle running the install script, export DISPLAY=<myhostname>:0.0 and run the script. That is all provided you are on the same machine....
If you are on a different machines, do the xhost+ on the machine you are sitting at, and the export DISPLA.... on the remote machine.
Good Luck,
Randy
21 years ago
You may opt to put the JDK stuff in the system's path for all users. You can find a copy of the .bash_rc in /etc/bashrc and edit that in the same fashion.
This can allow any user on the system to get to the java run time stuff. You may want another account to be able to use the JDK, like a database admin user or a 'Tomcat' user.
I also put the path to something like /opt/java/bin where the /opt/java is a 'symbolic link' to whatever current JDK I need - say /opt/jdk1.3.4.12.3.5 or whatever.
Run man on 'ln' to see about the links in the Linux terminal window.
-Randy
21 years ago