2,443 Posted Topics
Re: 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. | |
Re: Actually, if it is suppossed to be a fuel efficiency calculation, then it is miles/gallons (mpg miles per gallon). | |
Re: 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. | |
Re: What have you tried so far, or, at least, what are your ideas as to how it could work? | |
Re: 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. | |
![]() | Re: 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 |
Re: Have you read the WebLogic documentation? It is all fully detailed there. | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: [code] #!/bin/ksh tail -f file.log | grep "ERROR" | \ while read line do echo $line | mailx -s "Error" you@office.com done [/code] | |
Re: 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. | |
Re: 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. | |
Re: 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, … | |
Re: 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); … | |
Re: 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). | |
Re: [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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: use the following: eval var=server$i | |
Re: 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 … | |
Re: 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 | … | |
Re: 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. ![]() | |
Re: 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. | |
Re: 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 … | |
Re: 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). | |
Re: [code]^[A-Za-z -']*$[/code] | |
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 … | |
Re: 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 … | |
Re: 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, … | |
Re: [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 … | |
| |
Re: 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 … |
The End.