If you're developing a real world application (not an educational project), then I recommend you to use connection pooling. Apache Commons DBCP does that well.
Type: Posts; User: Ruhe; Keyword(s):
If you're developing a real world application (not an educational project), then I recommend you to use connection pooling. Apache Commons DBCP does that well.
Checkout this section of java language specification. Look at the example with cloning array of integers.
This is what I was talking about.
PS: but it doesn't clone array of my own cloneable...
Interesting question.
I thought that array.clone() returns deep copy of array,
so if you clone array, which consists of cloneable elements, then all the elements will be cloned.
But it seems,...
Use System.arraycopy, Luke ;)
Hi.
Never do things like fileScan.nextInt() without checking that nextInt() exists.
This is your mistake, you are trying to get next integer from scanner, but it doesn't exist. I'll show you a...
Read: http://www.rubytips.org/2008/01/26/what-is-a-ruby-symbol-symbols-explained/
Just as a variant Adobe Air + embedded sqlite.
ActionScript is easy to learn, mxml is much-much better than swing.
From every java programer's bible "Effective Java Programming 2":
Item 48: Avoid float and double if exact answers are required.
Did you test your code?
int quarters = 1;
...
What Every Computer Scientist Should Know About Floating-Point Arithmetic
Need correct precision? Use BigDecimal.
If you want to remove items while iterating, you should use Iterator.
Iterator<Integer> it = list.iterator();
while (it.hasNext()) {
int i = it.next();
if (i % 2 == 0) {
...
1. Install jdk:
open terminal (Accessories->Terminal). type
sudo apt-get install sun-java6-jdk
This install Sun java development kit.
After it is installed don't close terminal. Type
sudo...
Most likely you have downloaded Java SE bundle.
Go to Tools->Plugins->Available and check JavaEE, then click install.
Maybe you'll want to install some other Web & JavaEE plugins.
http://martinfowler.com/eaaDev/uiArchs.html
For advanced readers.
So running java -version gives you gcj?
Try to uninstall gcj and check that sun jdk is installed.
Then again try to update default java version, and check what returns java -version.
And one...
Install Sun JDK. And change it to default:
Open a Terminal window
Run sudo apt-get install sun-java6-jdk to install Sun jdk.
Run sudo update-java-alternatives -l to see the current...
I wonder how do people use google that they can't find such things.
1. http://www.jroller.com/santhosh/date/20050620
2....
http://www.smashingmagazine.com/
JS, query...
Usually jars are copied to the directory WEB-INF/lib, so that the tomcat server was able to load them.
Eclipse automatically adds all jars located in WEB-INF/lib to classpath.
Look at this post. You'll find a lot of interesting things about collections.
After I watched this presentation, I thought that it would be great, if such collections would be added in java.
This is Linus's revenge for the fact that the computer is called "xp-desktop" ;)
Try to do this:
create file assert_gcc.sh with the following content
#!/bin/sh
mkdir test_dir;
cd...
I always use jad (plugins for IDEA and Eclipse)
Reason - it does all what I need.
And if you need here is link for webarchive...
Because you will not use it in production, you can download oracle xe.
There are two versions on download page - Western European and Universal. I chose universal, because I need unicode. So if you...
Hey, what's the problem installing jboss?
Just download it and unpack where you want.
But it's not so easy to create "hello world" app, because j2ee is too complicated.
JBoss is well documented....
You can use Law of cosines.
This formula, but you'll need arccos of the right side of it:
http://upload.wikimedia.org/math/4/d/8/4d8d17cae0a354660b66327415507651.png
You'll need to find...
Yeah, it's really common task to generate DB schema from some persistent framework. Hibernate provides such mechanism through hbm2ddl.
cl333r
Everything depends on which JPA provider you use.
If...