2,443 Posted Topics

Member Avatar for blackeyed

The "END" tag to your so-called "here" document (started by the <<END expression) needs to be at the left hand side. That means it must be placed at the start of line without any whitespace in front of it.

Member Avatar for blackeyed
0
243
Member Avatar for Iamnew2java

Actually, if it is suppossed to be a fuel efficiency calculation, then it is miles/gallons (mpg miles per gallon).

Member Avatar for Iamnew2java
0
112
Member Avatar for nammi_aqua

DYOH (Do Your Own Homework). If you have a specific question, about a specific part of code that you are having problems wih, then please, ask. BUT, we are NOT going to do YOUR homework for you.

Member Avatar for jwenting
0
116
Member Avatar for nammi_aqua

What have you tried so far, or, at least, what are your ideas as to how it could work?

Member Avatar for jwenting
0
82
Member Avatar for LBasa

Well, illegal expression normally means that you have not closed a ( ) pair, a { } pair, or have forgotten a ;. Judging by your comments I am assuming you have not closed the { } pair that defines the method that contains your "outer for" loop.

Member Avatar for ranjanbaisak
0
603
Member Avatar for iamthwee

Well, here is one possibility. [url]http://www.onjava.com/pub/a/onjava/excerpt/swinghks_hack41[/url] But I thought there was also a way to set transparency for the frame, but I can't seem to find it at the moment

Member Avatar for jwenting
0
94
Member Avatar for muthumari
Member Avatar for delizeka

The request object in a servlet is a passed in Object, not some sort of magical reference. You would have to rewrite this to either pass the request object into the called method or retrieve it from the ServletContext. But, in either case, you will also need to import a …

Member Avatar for masijade
0
68
Member Avatar for haidabalaji

This doesn't seem to be very good design, but you could define a public method in A for setting whatever field should be set with the data then let A pass a reference to itself when calling B's constructor. Then B can call aRef.method to pass the data.

Member Avatar for masijade
0
98
Member Avatar for ljungmichel

you don't have a closing brace at the end of your main method, or you are trying to declare that method within your main method, which you cannot do.

Member Avatar for ljungmichel
0
171
Member Avatar for TheVerve51

I am sorry to say this, but it sounds as those your computer may be infected with something. (Whether virus or dialer or something else I don't know). But, in any case, this is definately not the place. Get your computer serviced somewhere. Look in the yellow pages.

Member Avatar for TheVerve51
0
84
Member Avatar for alvaro

exit in the script, or any thing else designed to exit the shell, will only exit the subshell that the script is operating under (that #! line at the top of the script). If you want your login shell to exit with the script then you have to execute the …

Member Avatar for alvaro
0
97
Member Avatar for girish.sh

There are no system wide standard exit codes other than 0 is success and other than 0 is generally regarded as an error. It is completely up to you how you want to handle exit codes.

Member Avatar for masijade
0
134
Member Avatar for girish.sh

The only java method you can call from a shell script is the main method of a class, by starting that class with a java command line execution.

Member Avatar for masijade
0
313
Member Avatar for aarya
Re: ejb

The application server specific stuff in the tutorial is its description on how to deploy the examples on a sun one application server. Other than that, everything is standard j2ee. And the reader should hopefully be able to read the server documentation well enough to find out how to deploy …

Member Avatar for masijade
0
103
Member Avatar for seran128

[code] #!/bin/ksh tail -f file.log | grep "ERROR" | \ while read line do echo $line | mailx -s "Error" you@office.com done [/code]

Member Avatar for masijade
0
106
Member Avatar for computerpros

I am pretty sure you cannot. Trying to intercept the shutdown call, seems to me, to be a pretty system-level function, and Java is not intended, or designed, for that type of functionality.

Member Avatar for computerpros
0
248
Member Avatar for irtisha

I have no idea about bioinformatics, but a good starting point for perl for a true programming newbie is "Learning Perl" from O'Reilly publishers.

Member Avatar for masijade
0
85
Member Avatar for Phaelax

There is no system variable for this. You are going to have to start from the java.home variable. simply check if there is a bin/javac under the java.home, if not check if there is a bin/javac under the directory one level up from the provided directory. If both attempts fail, …

Member Avatar for jwenting
0
282
Member Avatar for heatherc3

Well to split one line into an array it would go like this [code] my @line = split(/\s*,\s*/, $inputLine); [/code] to read an entire file this way it would be as so: [code] open(FH, ......); while(<FH>) { my @line = split(/\s*,\s*/, $_); ..... work on this line .... } close(FH); …

Member Avatar for Comatose
0
281
Member Avatar for soso30
Member Avatar for wandererman

perform the commands you think might be needed manually on the command line. Once you have a sequence that works, throw them into a file and your script is done (except maybe for a little fine tuning).

Member Avatar for masijade
0
95
Member Avatar for mohamad11

[QUOTE=mohamad11] System.out.println("Your Received message is as following:"); while((recv_Message=buff2.readLine() )!=null){ System.out.println(recv_Message); } four_characters=recv_Message.substring(recv_Message.length() - 4); Four_characters_Integers = Integer.parseInt(four_characters); [/QUOTE] I haven't tried it, I would, however, assume that recv_Message is null at the point where you try to get the last four characters, as your while loop will not exit until …

Member Avatar for aniseed
0
421
Member Avatar for lwinn213

Uhm ... Look at your UpdateBean code. All of your get/set routines do nothing but call themselves. They should actually return/set something from the actual Bean, not just simply call themselves. When all they do is call themselves, you have a classic case of infinite recursion. I assume you meant …

Member Avatar for masijade
0
312
Member Avatar for forrest

Try adding the following to the policy file: [code] grant { permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc"; permission java.util.PropertyPermission "file.encoding", "read"; }; [/code] the policy file is located under JRE_HOME lib/security or tomcat may have its own, you will have to search for a file with poilcy in the name under the tomcat …

Member Avatar for ponloges
0
296
Member Avatar for TERRORISTsam

Okay try the following sample of code. It will ask the user to enter the file name, then open an xterm with a vi of the file then continue with the script without waiting for the user to close the file again. If you wish the script to wait until …

Member Avatar for masijade
0
95
Member Avatar for forrest

jdbc is the Java DataBase Connector odbc is the Ole DataBase Connector two different products. There is a jdbc driver for java meant to give access to sources that define an odbc "interface" which is then the jdbc driver for odbc.

Member Avatar for masijade
0
113
Member Avatar for liliafan

The performance between c and perl is minimal. If you use the "use" keyword, instead of the "require" keyword, then the only real preformance difference will be in start up, as the entire program will be read and interpreted before actual execution starts. Once execution starts, then the performance is …

Member Avatar for masijade
0
202
Member Avatar for jlbovo

Just to be a bother, why does he need it in csh? Every UNIX system comes with a sh, or at least sh compatable shell called sh. Unless you wrote your script using bash masquerading as sh and he only has a true bourne shell, in which case many of …

Member Avatar for masijade
0
115
Member Avatar for jasminemary
Member Avatar for SurendraNath

I don't think you can. I believe it is built into the Korn shell, not the OS. You may want try multiple arrays and an indexing array. If you are not sure what I mean, then I am sorry. It is a little complicated to explain in a forum such …

Member Avatar for SurendraNath
0
107
Member Avatar for jasminemary

If there will always be only one "." as in filename.txt then given var=filename.txt you can do var2=`echo $var | awk -F'.' '{print $1}'` if there is any possibility that the filename will have more than one "." as in filename.date.txt then given var=filename.date.txt you can do var2=`echo $var | …

Member Avatar for jasminemary
0
98
Member Avatar for webmasts

try this [code] if (Math.abs(number / 10) < 1000) { error message } [/code] since a five digit number will be at least 10000 or -10000 probably a little quicker than converting to string and evaluating its length as well.

Member Avatar for iamthwee
0
325
Member Avatar for Kiba Ookami

There are third party compilers you can get to do this, but that completely defeats the purpose of doing something in Java, because the end compiled programs are once again platform dependent.

Member Avatar for server_crash
0
90
Member Avatar for kriezo

try this in a script: while /usr/bin/true do xterm -e tail -f logfile sleep 3600 done this will open the tail in an xterm, wait exactly one hour (or close enough anyway) and then open another (the logfile should have changed) you probably will want to start this approximately one …

Member Avatar for masijade
0
160
Member Avatar for jasminemary

Why don't you write a properties file for your java program and just change entries in that according to the server it is running on, rather than hard coding the connect information into the java program (which, coincedentally, is bad form anyway).

Member Avatar for jasminemary
0
90
Member Avatar for zbx888
Member Avatar for craju45
Re: re

I am not sure what you are really trying to say here >file means to redirect the standard output to the file named. 2>&1 means redirect standard error to the file descriptor of standard out so that error messages go to the same place, using the same channel as the …

Member Avatar for masijade
0
91
Member Avatar for k_satish0101

I won't claim to know why you are converting this to a GregorianCalendar, but I will show you two things that you can try. In both these examples the line from your post for creating "sdf" and "dateField2" should be kept and the line creating startDate thrown out. Here the …

Member Avatar for Nilesh Pagar
0
139
Member Avatar for aliz

A hit counter is many times best done with a filter. Go to java.sun.com and look at the j2ee tutorial. It is long and you will have to search for the counter examples, but they are there. And remember, that even if the filter example is shown for a servlet, …

Member Avatar for masijade
0
163
Member Avatar for k_satish0101

[QUOTE=k_satish0101]root cause Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK[/QUOTE] Have you actually checked your setenv/catalina script to ensure that the variable JAVA_HOME points to a JDK (i.e. /usr/java) or to a jre (i.e. /usr/java/jre). If your JAVA_HOME …

Member Avatar for masijade
0
233
Member Avatar for ramkumar
Member Avatar for 3x108th

try the following: [CODE]public void printLoop(int index; char[] list; char[] string) { if (index == list.length) { System.out.print(new String(string) + " "); return; } for (int i = 0; i < list.length; i++) { string[index] = list[i]; printLoop(index + 1, list, string); } } char[] string = new char[list.length]; for …

Member Avatar for masijade
0
192

The End.