masijade 1,351 Industrious Poster Team Colleague Featured Poster

It couldn't have been much earlier since they were made on the same day, but OK, at least you've realised your mistake, regardless of how or why.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What, exactly are the compile time errors you're getting.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Maybe. If you post the code correctly (use code tags) and actually ask a specific question, and give detailed explanations of what, up to this point, is not working as it should, and what the difference is.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

What part of "No" did you not understand? The "N" or the "o"?

A Java program can be converted to a native executable, however this looses all of the advantages you had from using Java in the first place, and the created native programs are, usually, no where near as efficient (in any aspect) as a normal Java Program. All of this is, of course, a moot point if you are not talking about one you are creating, but rather just something you have downloaded.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can't. You aren't opening it with Java either. You are simply telling the browser what is being sent (the content type) and letting the browser decide how to display it. In this regard, Java has nothing to do with it.

Assuming that this question is related to
http://www.daniweb.com/forums/thread100436.html

masijade 1,351 Industrious Poster Team Colleague Featured Poster

thanx to all of u friends. mt problem was solved by putting connector :mysql-connector-java-3.0.16-ga-bin.jar in jdk ----jre folder in lib----ext

Which is exactly the wrong place for it. Never place third party libraries here.

and also copy it in tomcat---lib.

tomcat/common/lib is the proper place (or is it tomcat/lib/common, anyways, only one of those places exist)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Wow, you seem to have finally taken the hint. Good job. But, back to this code.

1) you should use (fileSize > counter) otherwise you will wind up skipping the last bit of data in the file.

2) read(byte[]) is not guaranteed to fully read the entire size of the array. It does however return the number of bytes read, so capture this value.

3) Make sure that you only write as much of the array as was read (see above). Otherwise you may be writing old data again (or at least null bytes, which is nearly as bad).

4) Increment the counter with the amount that was actually read (see 2) as well.

Edit: Except for the fact that this should not be done as a Scriptlet in a JSP. Makes much more sense to do this one in a Servlet.

PoovenM commented: Very impressive - you took out time to read that guys code; awesomeness :) +2
masijade 1,351 Industrious Poster Team Colleague Featured Poster

And you don't say what it is you need.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

And? What is this for? What is it suppossed to be, other than a procedural program masquerading as a Java program?

Did you have a question? Or did you simply want to show the world that you
1) Have no idea what OOP is
2) Have no idea how to post code to a forum

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This is just so wrong on so many different levels.

First of all, neither a servlet, nor a JSP has any business, what-so-ever even attempting to open a socket, much less a serversocket.

You do realise that a JSP/Servlet is meant to be run mulitple times, right? And a serversocket can only be opened once, and every other attempt to open it will cause a bind exception, right?

You also realise that accept blocks until a connection is made, right? And since (I assume) it is suppossed to be the applet that makes the connection, and accept is called before enough of the html is served to the browser to even know that it is suppossed to start an applet, that is impossible for the applet to make the connection, therefore, the JSP never finishes, your browser neven gets a complete html, and everything deadlocks, right?

You either need to write a complete, standalone server for the ServerSocket (and whatever service it is suppossed to provide), or you will have to write a class that will be kicked of in the Application context by a ContextListener, to provide this service.

peter_budo commented: I always learn something new from you... +6
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Measure the volume methane produced by drying cow dung and try to figure out how many more times a cow has to take a dump before a catastrophic climate shift results.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well, sort date objects rather than date strings and you wn't have this problem. Use SimpleDateFormat to create actual date objects from the date strings, then sort those.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It was the way you worded your question. The way you said it left no way to help you. Your problem now is networking and has almost nothing to do with the camera. First, start with the networking tutorial and the cameras manual.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Dat wascaly wabbit!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I've seen a lot of mad software.

Really? I find mad programmers to be more common. And that in every possible meaning of the word mad. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

dear all,
i want to build applet viewing video from an ip camera which gives video type MPEG-4.
how can i build that application?

By coding it?

which api i need to work with?

Well, if you're going to use Java, I would say to start with the JDK.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Well read the API doc for the class I told you, then you tell me. God, that doc spells it out pretty clearly. Take two minutes of your own time to read the docs (rather than hours of your time and mine posting questions that you can easily answer yourself with two minutes time, especially when you are pointed directly to what you need).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

If your using Java 6 look at the Class Desktop. (As long as you are not still attempting to start an application on the server in a Servlet/JSP and get it to appear on the client, you've been told often enought that that won't work.)

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It might help to know what you expect, and what you get, as well as any errors that are occurring. But, thing, if you are passing a boolean already then the == is redundant. Simply do

if (O) {
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Not important to us. And, seemingly, not important to you either, or you'd have at least something to show for it.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Show your exact directory structure, and the exact command you used to compile.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

A tomcat server?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google POI and/or JExcel

masijade 1,351 Industrious Poster Team Colleague Featured Poster

compile with

javac -classpath . <Classname>.java
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Here's my contribution:

Next time do your homework (or maybe its your job) rather than go out drinking, and you won't be in this situation, and so won't be in the position of possibly having the capabilty to go out drinking cut-off completely.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can not code website using java, try some server side language like asp/php

I'm sorry (no I'M not), but BS. What is JSP? What do those three letters stand for? What are Servlets programmed in? What are they?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

In other words, read the API docs for Integer and its parse methods, and see if there is something there that can help you.

And find out what the difference between a char and an int is, as you can use a char as an int (as you've done here), but its value won't be what you seem to be expecting (find an ASCII character code table).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

That's a (unholy) mix of a class definition with a constructor definition.

Example:

public class ClassName {
  Type var;
  public Classname (Type arg) {
    this.var = arg;
  }
}
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Of course, if its boolean, you don't need the == either. Simply while(correctName), you do realise that the result of an == is true or false, which is the exact value of the variable being checked, right?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I can guarantee, that what he wants, is to open an app on the client, through code executed on the server. You have been told before, you cannot do this!

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You have absolutely no idea what you are doing, do you?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

I would still recommend the two regexp solution as a force of good habit though.

You're probably right, but I, myself, will sometimes settle for brevity (as in this case), since most of the perl scripts I have to write have no real need of this type of optimization. They are usually neither runtime sensitive (to a point, of course), nor do they usually have to deal with large blocks of text. ;-)

masijade 1,351 Industrious Poster Team Colleague Featured Poster
cat $HOME/scripts/autoinfo1.txt | sort +3nr | mailx -s "job failure" joeblogg@hotmail.com
masijade 1,351 Industrious Poster Team Colleague Featured Poster
scriptname.sh | sort +3nr
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Uuuhhmmm, by reading the documentation and doing what it says there, maybe?

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Oh, I just noticed too, that I accidentally inserted a \ in front of the first paren.

Although, to tell you the truth, I don't know if yours is truely measurably more effecient (unless the string is very long). I feel it's simply more a personal preference (once again, depending on the length of the string, due to the amount of backtracking).

masijade 1,351 Industrious Poster Team Colleague Featured Poster
s/^\s*\(.+)\s*$/$1/
masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google might help you with that (with a little initiative and correct spelling, anyway, both of which are probably more than you can handle, seemingly).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Different. Although I don't really know why sourcing the script, rather than simply running it, would make a difference in the way set -f acts, but, oh well.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Ok, unfortunately, the only thing left to do, that I can think of, is to do the script this way:

#!/bin/sh -f
for i in `grep "/\\*" file`; do
  echo "$i"
done

And start the entire script without file name generation. That means, however, that file name expansion/generation does not work at all in the script, which may be wholly unenjoyable, but at least this part works.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

It is because of file name expansion in the shell.

Just for fun try it this way

for i in `grep "/\\*" file`; do
  set -f i=$i
  echo "$i"
done
masijade 1,351 Industrious Poster Team Colleague Featured Poster
for i in `grep "/\\*" file.c`; do

You need to escape the escape character when doing this inside of the expression quotes.

Edit: Which, I believe, is what ithelp meant, but he mistakenly used /// instead of /\\.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

This forum is meant for unix shell scripting. There is a forum for vb here, and this question should be asked there.

I have already asked the admins to move this.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Google "Java transparent frame"

masijade 1,351 Industrious Poster Team Colleague Featured Poster

Java.util.Random and a long list of questions with the answers.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

http://java.sun.com/

Go to documentation, you'll find the Collections tutorials (as well as all the others) somewhere under there.

masijade 1,351 Industrious Poster Team Colleague Featured Poster

To tell you the truth, you would be much better off using an ArrayList, otherwise, place this code into a method that accepts an array and an element as arguments, and returns an array, then call this method for each element to be removed (is one fairly inefficent way). Or, place all elements to be removed in another array, then loop over the original array, and inside that, loop over the smaller array and comparing them (another ineffecient way).

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You don't. If you're problem is storing the time then simply store the number that time() returns. Then to display the time, assuming that the time retrieved from the DB is stored in the variable $time, do

gmtime($time) // to see it in GMT
localtime($time) // to see it in localtime

masijade 1,351 Industrious Poster Team Colleague Featured Poster

You can also, as long as it is not csh or sh, just simply do
var=$(( 2 + 4 ));
var=$(( $var + 2 ));

masijade 1,351 Industrious Poster Team Colleague Featured Poster

who do you think? It's lardmeister, the guy's on a personal vendetta against me after I deleted a post in which he called me a Nazi and a personal friend of Heinrich Himmler...

I didn't know about this (I must be blind or something ;-) ). But, sad, just sad.