Carey Evans

Ranch Hand
+ Follow
since May 27, 2008
Carey likes ...
Debian Eclipse IDE Java
Christchurch, New Zealand
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Carey Evans

Tim Holloway wrote:A TreeMap is built on top of a HashMap, so it has the overhead of a HashMap plus the overhead of the ordering mechanism.

As Pat said, TreeMap is implemented using a Red-black tree. It doesn't have any relation to HashMap, except that they both extend AbstractMap.

Note that the Sun implementation of String caches the hash code the first time it is calculated, so after the first time, the call to hashCode() takes constant time.
8 years ago
Running as a user (or as NetworkService) may only work when both computers are in the same domain, which won't be the case with XP Home.

A more complicated alternative is JCIFS, which doesn't use, but would let you supply your own network username and password.
8 years ago
It may be that there is something in /etc/profile or $HOME/.profile on that machine that is sending the escape sequences, like reset or tput, a different PS1 setting, or a different shell like bash or ksh instead of sh.

The rsync program has similar problems running over SSH, and they have some more about it in their FAQ:
PuTTY reads the escape sequences, and uses them to position the cursor, clear the screen, etc. You could try passing the TERM environment variable as xterm, but that would just give you slightly different escape sequences.

You should be able to configure your SSH connection not to allocate a pseudo-terminal, or to run your remote program directly instead of the shell, or both, and not get any escape sequences. It's hard to say more without knowing which SSH library you're using, or what program you're running on Solaris.
That looks like escape sequences for a VT100 terminal emulator. \x1b[3g then all the \x1bH sequences reset the tab stops, \x1b7 saves the cursor position,x1b[r resets scrolling, \x1b999;999H scrolls to the bottom of the screen, then \x1b6 restores the cursor position.

Is there any other way to get to the server that doesn't expect a terminal emulator to be connected?
If it was an applet security problem, like with java.policy, I'd expect you to get an AccessControlException. It could be a firewall problem on the server or the client; you could use nmap to see what ports get through, or try opening the connection from a Java application instead of an applet.
getUserPrincipal() (and getRemoteUser()) will return null if the servlet that's checking isn't matched by a <url-pattern> in the security constraints. You might need to enable security for more than just your main page.
8 years ago
There is a COM Interface to the task scheduler, which is presumably accessible via JACOB.
8 years ago
You will need some JavaScript code on the target page to execute after it is loaded. If you need to pass parameters, it’s common to use the fragment identifier (e.g. #inbox, #all, etc.), or maybe

If the code is on the same domain, you may be able to do some magic with popup windows and window.opener.
In Windows I would use Process Explorer for interactive testing, WMI from native code, or ThreadMXBean from within Java.
8 years ago
The Java exception doesn't seem to say where the error occurred, but it’s probably ENOSPC or similar from a call to pipe(2) or fork(2). It could be caused by exceeding some process quotas, or limits like virtual memory or number of open file descriptors. The last one is possible if you’re creating lots of processes, but not closing all three streams associated with them when you’re finished.

You could try using tools like strace or truss to identify the failing system call; or alternatively, use something like Apache Commons Net to do the Telnet protocol in pure Java.
The usual way to implement this in Java is to use an ObjectInputStream or ObjectOutputStream to read or write each field individually, which can be a bit of a change from your C example. An alternative technique would read the entire packet into a ByteBuffer, then read the fields with the methods get(), getShort() and so on.

The Javolution Struct class builds on the latter technique and looks even more like C.
DataInputStream is probably what you want. However, you will need to read each string as a byte array initially, then create a Java string from the bytes with the correct encoding (US-ASCII, ISO-8859-1, etc.). There is a constructor on String to do this, either using a character set name, or a Charset object.
8 years ago
You can't configure multiple websites on IIS 5.1 through the GUI. However, you should be able to use the adsutil.vbs CREATE_VSERV command from the command prompt.
8 years ago
The simple answer is that Stack.empty() won't be returning incorrect values. You haven't included a standalone test case to reproduce your problem so we can't offer much more help. The only reason I can think for for pop() to fail after empty() returns false is if the stack is shared by multiple threads.