jwenting 1,905 duckman Team Colleague

Find an abandoned cabin in a rural area, nail his pecker to the floor, give him a knife, and set the cabin on fire leaving him with two options. Should he survive this, then send him to jail, the life expectancy of this type of offender is very short. The woman should never see the light of day again either.

You've seen Mad Max too often :mrgreen:

jwenting 1,905 duckman Team Colleague

Could come in handy as an optional feature, some sort of administrative console. But always provide a means to run a server on a headless machine.

jwenting 1,905 duckman Team Colleague

Just delete the file, Windows will recreate it.

jwenting 1,905 duckman Team Colleague

P.S. Didn't know there were so many wombat lovers.
Nasty little critters if you ask me ;)

jwenting 1,905 duckman Team Colleague

You left out Hillary Clinton, first female president of the Ustated Nites.

jwenting 1,905 duckman Team Colleague

Never put anything in the common library. That location is for Tomcat internal use.
Put them in your web-application's own library path which is <TOMCAT_HOME>/<WEBAPP>/WEB-INF/classes

jwenting 1,905 duckman Team Colleague

Yours didn't, but a lot of others do.

jwenting 1,905 duckman Team Colleague

thanks kids. I'm not quite dead yet :)

jwenting 1,905 duckman Team Colleague

I am sure there are as many legit ones as scams out there. You just have to be careful wheny our deciding if you want to go though with it or not.

-T

No, the scams outstrip the legit ones by an order of magnitude.

jwenting 1,905 duckman Team Colleague

And most of those schemes also work only if you can get a high number of people to do the same thing...

For example you must buy 3 items out of a list of 10, and then get 10 people to do the same thing before you get the "free" whatever.
Those items you have to buy are usually way overpriced to the point where you could buy them elsewhere and have enough left to buy that "free" whatever and then some, plus of course it's getting ever harder to sign up people for something like this.

Essentially they're pyramid schemes, which are illegal.

jwenting 1,905 duckman Team Colleague

no, it only compares memory locations.
So if 2 references point to the same object in memory it will return true (in which case they obviously point to the same type object as well), if they point to 2 different objects it will return false even if equals returns true for those 2 objects (and remember that equals may return true if objects are of different types depending on how it's implemented).

jwenting 1,905 duckman Team Colleague

Not quite sure what it's doing, but looks to me like the he's trying to receive something by pushing a button. Anything sent over the network at any time except that it's available to the client just when the button is pushed is simply thrown away (or that's what it looks like).
There doesn't seem to be any code to handle sending data at all...
Nothing listening for network traffic, nothing listening for things to send.
That connection might be made but never do anything really useful.

jwenting 1,905 duckman Team Colleague

It's a port of the Linux C++ compiler to Win32, able to create Win32 console applications (and with addon libraries graphical applications as well most likely).

jwenting 1,905 duckman Team Colleague

I've done a bit more R&D (you got me interested ;) ), turns out it's trickier than it looks because you need to start a process and then start a process in that process and catch the output of that sub process.

As a minimum you'd end up with something like this (for a simple dir command):

String[] command =  new String[4];
          command[0] = "cmd";
          command[1] = "/C";
          command[2] = "dir";
          command[3] = "c:\\";
          Process p = Runtime.getRuntime().exec(command);
          BufferedReader stdInput = new BufferedReader(new 
               InputStreamReader(p.getInputStream()));

          BufferedReader stdError = new BufferedReader(new 
               InputStreamReader(p.getErrorStream()));

          // read the output from the command

          String s = null;
          System.out.println("Here is the standard output of the command:\n");
          while ((s = stdInput.readLine()) != null) {
              System.out.println(s);
          }

          // read any errors from the attempted command

          System.out.println("Here is the standard error of the command (if any):\n");
          while ((s = stdError.readLine()) != null) {
              System.out.println(s);
          }

Forget the /C option (as I initially did) and it will only start a command shell and just sit there forever waiting for that to terminate (which it won't as there's nothing ever telling it to close).

jwenting 1,905 duckman Team Colleague
jwenting 1,905 duckman Team Colleague

Send them to Vermont where they'll get "counseling" after a token 2 months in prison...
According to the judge there you shouldn't punish criminals, but help them readjust to society.

I'd say readjust them to society with a noose and a tall tree, or at worst with an M16, but then I'm not a judge in Vermont.

jwenting 1,905 duckman Team Colleague

passing data between pages is always a matter of setting that data up as request parameters, either using a script to create the request string on the fly or by sending it as html form fields.

jwenting 1,905 duckman Team Colleague

why? There's no reason to do that ;)

You might want to read up on Runtime then, and calling commandline programs from Java. Tons of stuff written about that.

jwenting 1,905 duckman Team Colleague

first and second case are easy, first you just null the reference, second you replace the reference with the only child it has.

Third you determine the node to move up one spot and set one of its children to the other node that was a child of the deleted node.
You then reorder that entire branche.
If the node you're moving up has an empty child that's easy as there's nothing to do, if it has children those will start to move down.

jwenting 1,905 duckman Team Colleague

given your web.xml mapping you should use /servlet/LoginServlet for the relative URL, nothing more.

jwenting 1,905 duckman Team Colleague

Deletion is usually left out because it constitutes recreating the tree minus the deleted element, and therefore is no different from building a new tree from scratch (or more likely by moving branches to different positions in the tree until the tree is once again ballanced).

Examples in C and C++ should be no problem for someone who's at the stage of more complicated data structures than an array or single linked list, you should really know enough to at least understand them by now (I regularly read books using examples in languages I've no experience in, it's a good mental exercise).

The principles and algorithms are the same after all, except in Java you don't have to mess with all that dereferencing pointers because you have references and can reference those directly ;)

Best way to sort them is to do an insertion sort, sorting them during insertion. If that leaves the tree unballanced, you can then ballance sections of the tree until the entire thing is ballanced (copying entire branches to fall under other branches).

I've not much experience with trees in my line of work (Maps and Lists are far more common in most fields, and if a tree is needed a TreeSet will let me use a built in tree through a Set interface).
But that's the theory at least in a nutshell.

jwenting 1,905 duckman Team Colleague

huh? what are you trying to do?

jwenting 1,905 duckman Team Colleague

that would be Bradshaw.servlet.LoginServlet which would need a mapping in your web.xml deployment descriptor as well.

jwenting 1,905 duckman Team Colleague

The compiler is just a Java class which you can call. It's contained in one of the jarfiles that come as part of your JDK installation.

public final class Compilerextends ObjectThe Compiler class is provided to support Java-to-native-code compilers and related services. By design, the Compiler class does nothing; it serves as a placeholder for a JIT compiler implementation.

When the Java Virtual Machine first starts, it determines if the system property java.compiler exists. (System properties are accessible through getProperty and , a method defined by the System class.) If so, it is assumed to be the name of a library (with a platform-dependent exact location and type); the loadLibrary method in class System is called to load that library. If this loading succeeds, the function named java_lang_Compiler_start() in that library is called.

If no compiler is available, these methods do nothing.

Check your API docs.

jwenting 1,905 duckman Team Colleague

it is rather simple if you know math and programming. Sadly a lot of people lack the math, and a lot of people lack the programming.
A rather large subgroup of those 2 groups lacks both.

jwenting 1,905 duckman Team Colleague

in a binary tree every branch has 2 branches leading from it (ok, in reality it could be one but I'm taking the perfectly ballanced tree here).
It's therefore impossible to remove a node without rebuilding the entire tree, as just linking the children of that node to the parent of the removed node would mean you now don't have a binary tree anymore.
You could remove the entire branch, but then your tree would no longer be ballanced.

If you want that you can simply remove the reference to the element at the top of the branch you're removing from its parent node and it's gone.

There are tons of examples of trees online, though most may be in C or C++.
Look for artificial intelligence, path finding algorithms, things like that.

jwenting 1,905 duckman Team Colleague

Take a look at Java webstart. It's an integrated component of the Java platform for installing software over networks (including the internet).

jwenting 1,905 duckman Team Colleague

the last 128MB are likely reserved for videomemory.
Most laptops use a shared RAM system like that, yet few detail in the sales brochures that the usable RAM is the total RAM minus the videoram.

jwenting 1,905 duckman Team Colleague

examples of converting xml to pdf are contained in the FOP documentation.
properly written html is an xml dialect.

Other libraries exist as well, I'm sure a quick search of the web would turn them up.
In fact a quick search resulted in

Top 213 results of at least 4,162,398 retrieved for the query java html pdf

While without doubt not all of those are relevant out of the first dozen or so only one or two were pdf files about writing html and/or Java, the rest seemed concerned with creating pdf files from html using Java.

jwenting 1,905 duckman Team Colleague

Whichever, you will need to define an array to hold the result.
That's going to take up the same space as the original array (it contains the same number of elements after all).
After that it's a linear operation putting element [i,j] of the original array into element [j,i] of the resulting array.
A simple nested for loop will do that.

jwenting 1,905 duckman Team Colleague

A method takes up space in memory.
A method call takes time in access to the instructions performed in that method.
The compiler may be able to optimise some instructions (like direct array access), making them a lot faster than doing the same through a method.

jwenting 1,905 duckman Team Colleague

You'll have to write your own program, noone's going to do it for you unless you pay us consultancy fees to the amount of $150 per hour for a minimum of one week (at 10 hours a day).

jwenting 1,905 duckman Team Colleague

Only the window that has keyboard focus can receive keyboard events AFAIK.
You'll have to instead create some interface that will allow the virtual keyboard to send data to your application forms and fill them that way, working outside the Windows message dispatcher system.

Maybe it's changed though, I've not done any Win32 API programming in quite a while.

jwenting 1,905 duckman Team Colleague

yes, there are libraries that can do that.
Apache FOP is a classic example that I've used in the past for similar purposes. It does require extremely strict and correct html to work though.

jwenting 1,905 duckman Team Colleague

It should be n!, not (n!)^n.
If each of the n characters can be used in any of the positions irrespective of whether it was already used at another position it would be (m!)^m where m is the number of distinct characters in the total set of n characters, but I assume you have n distinct characters each of which has to be used only once.
To be completely accurate you have to calculate m here as well by removing duplicates.

To determine n, you only need the length of the input string minus the length of the fixed part(s).
Determining m is harder, as you'll have to take the non-fixed part of the input and determine the number of distinct characters in it.
Not hard, but takes a little work. Using a HashMap of Character objects will do nicely. m will be the size of the HashMap.

What means "If the input string can be anything as long as the pattern is in it"? Could you show an example please?[\quote]

If the pattern is ABC*, both ABC1234 and ABC123456 are valid.
Now if your input were ABC1234 you'd have 4! options if the valid string length is restricted to the length of the input string.
If however it is not restricted to that (7 long in this case), the longer string is also valid, which would yield a total number of 6!+5!+4! options for just that length and any length at …

jwenting 1,905 duckman Team Colleague

yes you can, but the 1 dimensional array would take up the same amount of space in memory as would the 2 dimensional array.

And that's without the added address space needed for the accessfunctions (and the slower access to the data using those functions instead of whatever optimisations the JVM may employ on arrays).

jwenting 1,905 duckman Team Colleague

Struts is no J2EE technology, rather it's a rather old and overly complicated application framework built on some J2EE components.

MVC is no J2EE technology either but an application architecture commonly used in J2EE applications.

I doubt there are many systems that use the entire J2EE platform, it's just too large.
Instead of trying to find a system using as many different things as possible you'd rather decide what to build and then decide the best technology to use based on that.

jwenting 1,905 duckman Team Colleague

You will need to start a command interpreter in order to launch operating system level commands.
Under win32 that's done using the "cmd" command.
For example "cmd dir" would execute a dir command.

The entire system is rather tricky, I've never really gotten the hang of it (but then I've never tried to, preferring to keep my code operating system independent).

jwenting 1,905 duckman Team Colleague

As a request attribute, or a session attribute, doesn't really matter.

jwenting 1,905 duckman Team Colleague

I'd not buy a budget board... It's the one component that's hell to upgrade, so you'd better buy the best you can get.

jwenting 1,905 duckman Team Colleague

People believe the weirdest thing. The more unrealistic a scenario is it seems the easier it is for the uninitiated to believe it.

I make perfect use of that by spreading rumours like this to hide my real operations towards taking over the world.

And before you say you've never heard of those operations, that's how well they're hidden ;)

jwenting 1,905 duckman Team Colleague

you'd have to send it to the servlet, the servlet isn't going to know it's there to be saved unless someone tells it so.

jwenting 1,905 duckman Team Colleague

did you install iTunes on the PC?

jwenting 1,905 duckman Team Colleague

There are also special cleaning agents for LCD screens, might be hard to get outside office supply companies.
Sometimes companies selling accessoiries for PDAs have them.

jwenting 1,905 duckman Team Colleague

check any of the thousands of explanations on how to implement a linked list that exist.
Basically just point the element before the one that is to be deleted to the one that the element you're deleting is pointing to and set the pointer in that element to null.

typedef struct ll {
  int val;
  ll *next;
}

ll *list;

void addElement(int el) {
}

void deleteElement(int pos) {
 // find position
 // ...
 ll element = (listCopy->next)*;
 ll delElement = (element->next)*;
 element.next = delElement.next;
 delElement.next = null;
}

or something like that, my pointer code in C is a bit rusty.

jwenting 1,905 duckman Team Colleague

No, if the input string is ABC and the pattern is A*, you have 2 characters left over which means there are 2! = 1*2 = 2 possible strings that match.
If you have a string ABCDEF and you have a pattern *CD* you have 4! ((2+2)!) matches.

That's assuming that the matches need to be made up of the characters in the input string with the fixed ones as defined in the pattern.
If the input string can be anything as long as the pattern is in it the number of possible options is always infinity or zero depending on whether the fixed part(s) of the pattern exist or not.

jwenting 1,905 duckman Team Colleague

nothing to do with Java, must be a problem with Compuserve (AOL... says enough).

jwenting 1,905 duckman Team Colleague

no, you don't save a byte using a one dimensional array instead of a multidimensional array.

jwenting 1,905 duckman Team Colleague

Collections API can do all that and a lot more.
I wonder why teachers choose Java as a language for teaching and then expect their students to do things in it that the core API can do very well thank you.

I know the curiculum is left over from C, but it's better done in C anyway. Beautiful language, perfect for teaching core programming skills (apart from OO).

And no, we're not going to do your homework for you. If you have SPECIFIC questions about something where you're stuck on a detail we may be able to steer you in the right direction but we're not going to write your entire paper (which is what you're essentially asking).

jwenting 1,905 duckman Team Colleague

convert them both to a numerical data type and then add them together.
Very easy.