2,443 Posted Topics
Re: Try using a preparedStatement rather than cobbling together a query statement like that. See the API and Sun tutorials (a link can be found in the API) for more info. | |
Re: Read the API for File, namely the method listRoots. | |
Re: [code] for i in `ls` do head -1 ${i} done [/code] And I hope to God, that this is not homework assignment. | |
Re: [code] int countChar = string.replaceAll("\\s*", "").length(); [/code] Just to be an @ss! ;-) | |
Re: An application designed to be used over the internet (usually through the use of a browser), written in Java. | |
Re: Where does a servlet run? On the client or on the server. Once you answer that question you will know whether or not you can perform client side validation in a servlet. Also, your application should never rely on any kind of operations on the client side. They may have … | |
Re: The problem is quoting. The "last name" should be quoted in the SQL with single quotation marks ('). To avoid errors like this in the future (and to prevent SQL injection attacks), use PreparedStatement and its setString method. See the API for more information. | |
Re: [QUOTE=ramia_1985;432100]yes u have be little more specific ...................[/QUOTE] Yes, definately. Considering, however, that this thread is three years old, I believe his due date is long past. | |
Re: [QUOTE=iamthwee;431500](num1,num2,[COLOR=red]num2[/COLOR]));[/QUOTE] Classic typo. And isn't it grand! ;-) I hazard to guess, that it is a little embarrassing to have it come this far before being found, though. | |
Re: Yes, code would definately help, but an applet is not a [b]J2EE application[/b]. It is a simple standalone application that just happens to be able to be run in a browser, and can be downloaded by the browser, just like an image (no more, no less) before being executed. | |
Re: Why did you start a new thread? Because you didn't like the answers you were getting? Please, do not multi-post in this manner. Stick with the original thread. | |
Re: Well, what the h3ll do you think you need to know?! God, it's not (as he said) rocket science. Geesh. Study the protocol. I myself, have no idea what the protocol looks like, but I assume it will be (in the basic form) text streamed over TCP/IP. So, obviously, you … | |
Re: Read the "Getting Started" Tutorial. And don't save anything to the "bin" directory (or any other directory inside of the jdk directory). | |
Re: JavaScript != Java You have shown only JavaScript. There is no Java anywhere in that post. | |
Re: Awwwwwwwww, but how do I get the leading zeroes back?! Will be his next post. | |
Re: Go through the tutorials without using any IDE whatsoever. Once you understand all the concepts (such as classpath and the like), then you can start worrying about an IDE. | |
Re: That is not a Julian Date. That is simply the number of milliseconds since the "epic" (00:00:00 Jan 1st 1970 UTC) (i.e. a completely normal date as known in nearly all programming languages, excpet that some use seconds rather than milliseconds). Simply do [inlinecode]new Date(1187610073812);[/inlinecode]. | |
Re: Why not == '>' ? Edit: And, of course not 0. Try userData.length() - 1. | |
Re: Because the shell will automatically expand those filename expansion characters before passing the arguments to the script. You might try using \* instead of *, but then, don't expect that the * will work as designed later (it may, then again it may not, I have not tried to "mask" … | |
Re: Check which quote you are using. On the keyboard it should be the one that slants from the upper left to the lower right, not the other way around and not straight up and down. In the code, it should also appear to slant in that direction and not appear … | |
Re: Read [url]http://java.sun.com/products/jdk/faq/faq-sun-packages.html[/url] to find out about sun.* packages (and this includes com.sun.* packages as well). Ezzaral, I would suggest you read this to, if you have not before, as a sun.audio.* class is not "an old part of the api", I'm sorry to say. Have fun reading. ;-) | |
Re: Read the Swing tutorial. You are looking for ActionListener. | |
Re: -n means suppress output (i.e. read the lines in the file, but don't output them). [inlinecode]s/ *\|/\|/g;[/inlinecode] means replace all occurrences of [inlinecode]of zero or more whitespace followed ba a "|" (i.e. "|", or " |", or " |")[/inlinecode] with [inlinecode]"|"[/inlinecode]. And the print after that means output the lines … | |
Re: Have you tried simply removing the "-" characters from those three lines? Some XML Parsers (possibly Tomcat's included) are a little picky. | |
Re: You tried to do "java mynote.java" when you should be doing "java mynote" after compiling. Than again, seeing as how you are talking about compiling you may have done "java mynote.java" when you should have done "javac mynote.java". And, start your own thread when you have a question rather than … | |
Re: Do it in three steps. First use grep and (sed, cut, or awk) to retreive the groups that the user already has, then place these groups, along with the new groups, in a comma separated list string, then call usermod -G ${stringvar} ${user} | |
Re: [QUOTE=shaqnolysis;418619]This implies that am gonna read the File and store my values in someBuffer..... [/QUOTE] Well, that is not what it does. It simply buffers the read stream so that every read function does not have to actually be directly reflected on the disk. It saves a little time (in … | |
Re: I believe this may be your problem [code] public static void main(String[] args) { // TODO Auto-generated method stub //private void readData() //} private PieDataset readData() { [/code] Did you really mean to comment out the } at the end of your main method? Somehow I don't think so. | |
Re: When you initiate the array (i.e. [inlinecode]int[][] array = new int[20][20];[/inlinecode]) every position is already filled with 0 (since a primitive cannot be null). So, if zero is not one of the numbers you are using, simply cycle through the arrays with a nested loop replacing 0 with 99. | |
Re: A very simple answer, move all that scriptlet stuff out of this JSP into a (or probably multiple) beans. | |
Re: Well, if your company were to use a proxy server that the other machines would have to use to reach the internet, you would already have this information. | |
Re: grep will return false if it does not find the searched for String. So an easy way to this is to change if [ $fname = `| grep $fname sname.txt` ] ; then fname=stored_fname elif [ $fname != `| grep $fname sname.txt` ] ; then fname >> sname.txt ; then … | |
Re: Edit: Nevermind, silly me, thinking of something completely different. | |
Re: Copy that jar file into WEB-INF/lib, not into just any generic tomcat lib directory. | |
Re: As long as the object properly implements serialisable then you can send it through an ObjectOutputStream wrapped around the OutputStream retreived through socket.getOutputStream, and read through an ObjectInputStream wrapped around the receiving ends socket.getInputStream. And, of course, RMI and CORBA are other possibilites as long as you define your stubs … | |
Re: [code] // the code which would generate a Unicode file from a CSV ( Comma Seperated File) given as input. [/code] | |
Re: Sure, post the code you already have together with any errors (or unexpected results) and we will be glad to help you correct your code. Oh, wait, you wanted a handout, didn't you. Well, you are not going to get one. We will be more than glad to help, but … | |
Re: In addition, even if we did want to help you, after your demand that we drop everything else and concentrate on your, I repeat [b]your[/b] problem, that question (demand?) you posted just does not contain anything that we could work with. | |
Re: It takes 9 command line arguments (which are filenames), reads the content of the first four, doing varying operations on the data within, and writes results to the last five. It seems to have to do with loan balances, fees, and, seemingly, the determination of FICO scores. | |
Re: What do you have so far, and what problem is it giving you? FileReader with BufferedReader and String.split, or Scanner are good starting points, though. | |
Re: If you simply want to run already compiled classes, you should not need to do anything special (AFAIK). If you wish to compile 1.4 sources, then you also need the -source=version argument for javac. | |
Re: Look at the Process class and its exitValue() method. | |
Re: Well, this code is fairly bad, I'm sorry, I don't mean to be offensive, I'm just stating the way it is, but for a quick fix try this. You are currently doing this [code] for (int iDay2 = 1; iDay2 < 8; iDay2++) { [/code] which is essentially cycling through … | |
Re: Try [code] sed -e '/[\{\}]/d' -e 's/ = /=/' -e 's/;$//' filename > tmpFile . tmpFile rm -f tmpFile [/code] That will turn all those lines with = signs into variables and source them, cleaning up afterwords. | |
Re: Of course, be forewarned, that unless you have locked the table you're using (and if you don't know how then just forget I mentioned that as I am not going to explain it), then between the time that you get the total with that query, and then actually pull the … | |
Re: Well this is guaranteed to get you answers. Have you never heard of Google? Or even the command "man ftp", since that, itself, describes the .netrc file and your "logfile" can be simple output redirection ">". Id10t | |
Re: [QUOTE=Mr.UNOwen;407834]Isn't there something in standard library for this?[/QUOTE] Everything jwenting listed is in the standard library. [QUOTE=Mr.UNOwen;407935]I just noticed a class called ClassLoader and I was wondering how you'd use it. It's abstract, so I'm a little confused about using it. Can someone show me an example of how to … | |
Re: [QUOTE=manusp;408377]Guys, sorry but just give me exactly how the code should be written, so i cn turn in my assignment by tonight! Like i said i'll never be a java programmer and i am just trying to complete this class.. I have no shame here but there has been an … |
The End.