Lester Burnham

Rancher
+ Follow
since Oct 14, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
46
Received in last 30 days
0
Total given
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lester Burnham

You would use the javax.imageio.ImageIO class to read and write images from files. That would provide you with a BufferedImage object which you can either manipulate directly (through the getRGB and setRGB methods), or you can access its Raster (through the getRaster method), which gives you more ways to manipulate the image.

Note that the values handled by getRGB and setRGB contain all data for a single pixel in one integer: red value, blue value, green value, and alpha value (if the image has one). So if you intend to do work on the individual pixel values, you'll have to extract those values from the integer, transform them as desired, and then put them back together.

This will also help: http://download.oracle.com/javase/tutorial/2d/images/index.html It explains how to perform higher-order image manipulations like drawing geometric shapes.
13 years ago
While it would be nice to assume that the HR folks will say what they intend to do, and do what they say they will do, fact is - it doesn't always work out like that, sometimes intentionally, sometimes unintentionally.

I'd advise to wait as long as you can (meaning, as long as you don't have to make a decision regarding the other company). Unless they specifically say to contact them sooner, wait at least a week between being in touch. And finally, don't make it sound as if the decision hinges completely on the CTC; companies don't like to hear that, and they don't like to hire employees who think that way.
13 years ago
iText comes with several tool classes in the com.lowagie.tools package; check out the ConcatPdf class in particular.
How about all the ones that come with the JasperReports distribution? Are you experiencing problems if you do that?
13 years ago
"it doesn't work" is not a helpful problem description - see ItDoesntWorkIsUseless and TellTheDetails.

You could also check out how the examples in the "servlets-examples" web app work that comes with Tomcat.
13 years ago
Probably a union thing.
13 years ago

I was told that a program needs to have the main method to start the program but this does not have any but it runs


The GraphicsProgram class probably has a main method which this class inherits. I say "probably" because you didn't mention how this class is intended to be used.
13 years ago
java.lang.ProcessBuilder

java.lang.Runtime.exec(...)
13 years ago
For starters, this can easily be implementation-dependent. I just ran the code a few times, and mostly the "Main exits" message was the last to be printed, but a couple of times in between the others.

As the worker thread is running with the same priority, worker thread should finish first


No. Both threads have the same priority, so it's up to the JVM to decide which one to run. Pre-emptive means that thread execution can be put on hold in favor of running some other thread, and then resumed later.

What's more, calling t.start() does not guarantee that the thread starts executing right then. It very likely starts no later than the sleep method call, but the JVM might decide that 10ns is so short that swapping in a different thread is not worth the effort, and continues running the main thread for some more time. Or maybe it calls the GC during that time.

Plus, the JVM may or may not run threads on different CPU cores, so there may be actual parallelism at work (or not, you can't be sure).

And lastly, even though it plays no role here: Thread priorities are not something one should put a lot of stock in. In particular, trying to control which threads are run by giving them different priorities is bound not to work well. It seems like it should, but it just doesn't.

Ganesh Ravi Kumar wrote:You have understood clearly about my problem.


Actually, Paul had not - which is why he asked what exactly you're trying to do. Notice how he suggests at least 3 different things you may be trying to do? Unless you tell us which it is, there's not much we can do to help.
13 years ago
JSP
The article you read may have been based on outdated information. Object creation used to be slow in the early day of Java, but has become quite a bit faster over time, especially with the JVMs in Java 5 and Java 6. Unless you have specific evidence that object creation is indeed a performance bottleneck in your application, you should assume that it is not.

That's also the reason why object pools (like thread pools) are no longer a hot topic - they're not generally worth the effort any more.
13 years ago
If Tomcat is not listening to HTTP, then there's no way to use HTTP to get through to an app running in Tomcat.

You don't need a second Tomcat instance, though. You can define one Service that only has an HTTP Connector, and one Service that only has an HTTPS Connector. See http://tomcat.apache.org/tomcat-6.0-doc/config/index.html for details.
13 years ago
SSLSockets know how to handle SSL, and that's what you want to achieve, correct? Standard sockets know nothing about SSL.
Is there any particular reason why you're not basing your software on proven crawl infrastructure like Apache Nutch?
13 years ago