This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.

Koen Aerts

Ranch Hand
+ Follow
since Feb 07, 2012
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Koen Aerts

Your bfr.read() call reads a single character each time, after which your readLine() gets the rest of the line. Use this instead:
12 years ago
Dark clouds and rain here... I'll have to follow the event on the Internet: http://www.ccssc.org/transit2012.html
12 years ago
And that's why people write down these passwords on a sticky note and hang it on their screen.
12 years ago
Do an "echo ${CLASSPATH}" and see what the values are of the CLASSPATH variable. Then verify the directories/jar files in CLASSPATH do indeed exist or whether you need to include additional jar/directories.
12 years ago
Look at your stacktrace and see which line number and class the exception originates from.
In Excel you can save directly to an XML format. Not sure how your Excel files are being used, but if macros are an option, you could explore that approach.
12 years ago
You are probably including the path to your JRE instead of your JDK in your PATH. A JRE is just the runtime engine, while the JDK also includes the compiler and other dev tools. When you do a simple search on this forum, you should be able to find an answer.

Here are some useful threads:
Environment variable
Need guidance on how to get Javac compile to execute
Issues with checking that my JDK is configured properly
12 years ago
You can have a look at SWT. I don't think it will have an API to do exactly what you want, but you might be able to find something useful in the code snippets. You might have to go as far as writing some low-level C or C++ code to hook into the Desktop Key events. Via JNI you can have your event call your Java code if needed.
12 years ago
Try something like:
12 years ago

Jeff Verdegan wrote:

Koen Aerts wrote:

Rob Spoor wrote:

Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.


Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.


Local system doesn't need to be Windows. I've used File on a UNIX systems with mount point (using Sharity Light) to a Windows share.


Yeah, but is is mounted so that it's visible as a local file system, such as /mnt/my_windows_drive? Or were you specifying the remote host in the File object?


The share would have to be mounted so that it looks like it's local. But - and I might be wrong here - it is the share that determines what you can do with java.io.File. For instance in my case (local UNIX system mounted to remote share on Windows) I could not rename a file from one letter case to another (i.e. myfile.txt to MYFILE.TXT) because according to the share (Windows) you cannot rename a file to the same name. However in a pure UNIX filesystem that would have worked because it's case sensitive (unlike Windows by default isn't, although you can change that).
12 years ago

Rob Spoor wrote:

Jeff Verdegan wrote:The java.io classes that deal with files only work on the local file system.


Not completely true. java.io.File can handle network shares as long as a) the local system is Windows, b) the share is a Windows share, and c) the user running the Java code has access to the share.


Local system doesn't need to be Windows. I've used File on a UNIX systems with mount point (using Sharity Light) to a Windows share.
12 years ago
First, how would you connect to that IP? Is it a mapped share, or via SSH/FTP/??? You can use the getFreeSpace() method on a java.io.File instance as of Java 6.
12 years ago
I ran a little test. With your original String concatenation I noticed memory usage around 317MB. When I instantiated and re-used a StringBuilder object, memory usage stayed around 8MB and I noticed a huge performance increase, which I assume is related the elimination of instantiating a large amount of String objects and the Garbage Collector kicking in.
12 years ago
You're iterating correctly over the arrays; that's as efficient as that will go. What calculations are you doing that is causing issues? The issue might actually be related to whatever it is you're doing with the calculations, not the array iterating itself.
12 years ago

david jeche wrote:ok well i have tried to take a look at the htm lunit library but im not getting much information from Google


First link I got when I typed "HtmlUnit" in google: http://htmlunit.sourceforge.net/
On that page, click "Get Started".
12 years ago