Archive for the 'Java' Category
Wednesday, October 19th, 2005
If you are trying to use Rome and Rome Feed Fetcher, the following will not change the default user agent:
FeedFetcher feedFetcher = new HttpURLFeedFetcher();
feedFetcher.setUserAgent(\”User Agent 007\”);
SyndFeed feed = null;
feedURL = new URL(rssUrl);
feed = feedFetcher.retrieveFeed(feedURL);
List entries = feed.getEntries();
To change the user agent you must use the InfoCache as shown:
FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
feedFetcher.setUserAgent(\”User […]
Posted in Programming, Java | No Comments »
Sunday, July 10th, 2005
Cobertura is a fork of jCoverage. It runs reports to let you see how much of your code is being tested by unit tests. This is incredibly useful to find areas of your code where a bug would go undetected.
It looks like there is a plugin for Maven already, so I’m […]
Posted in General, Programming, Java | No Comments »
Saturday, July 2nd, 2005
Maven 1.0 has some problems with memory leaks. Most of the time these aren’t issues, but if you are trying to compile a multiproject you might run into problems. By default Maven tells java to let it have up to 256MB of ram. If you need to increase this you’ll need to […]
Posted in General, Programming, Java | No Comments »
Sunday, April 3rd, 2005
Why Java Won’t Get It Right is an interesting entry about some of the problems with Java technology. The best part is that it is written by someone who actually knows Java. A part that I particularly liked was:
They over-architect everything. I’ve actually used a Java framework (I’m not gonna say which) […]
Posted in Java, WebObjects | No Comments »
Saturday, April 2nd, 2005
The following is a JUnit test that looks like it should always run without a problem. Mark the current time in a variable called start call Thread.sleep and tell it to sleep for x number of seconds, note the current time again in a variable called end and then assert that end - start […]
Posted in Java | No Comments »
Tuesday, March 29th, 2005
According to some posts on Java Ranch, Sun is looking to create a Sun Certified Java Associates exam. The idea is to have an exam that companies can use to certify entry level programmers. I’m not sure why this is better than the current Sun Certified Java Programmer certification. It sounds like […]
Posted in Java | No Comments »
Sunday, March 27th, 2005
Agylen: Comparable vs equals has a nice discussion of how compareTo is used in Sets.
If you don’t understand how Java is going to use your compareTo and your equals methods you can run into a problem with Sets. Basically you shouldn’t have a compareTo() method that returns 0 unless equals() returns true.
Since […]
Posted in Java | No Comments »
Wednesday, February 23rd, 2005
Using JUnit With Eclipse IDE is a great simple tutorial on how to use JUnit in Eclipse. It doesn’t assume any knowledge of JUnit, but is useful as a quick tutorial for people wanting to make a switch to the Eclipse development environment.
Posted in Java | No Comments »
Tuesday, February 22nd, 2005
Reflection is a mechanism in java that allows to to get information about a class without needing to know the type of the class. The program below takes a java class name as a command line argument and shows you all of the methods and field names that are in the class.
You […]
Posted in General, Java | No Comments »
Sunday, January 30th, 2005
I have some XSLT stylesheets that I use to integrate information from Amazon with my reading list on my website. This weekend I decided to create another list using Amazon’s “People Who Bought this Book also Bought” feature. After a couple generations of downloading books that were related to books I read, I […]
Posted in Java | No Comments »
Sunday, January 30th, 2005
The other day when doing some particularly large xslt conversions I kept running out of memory in the JVM. After doing a bit of research I found two command line arguments that help solve the problem. -mx allows you to set the maximum size of the memory allocation pool while -ms allows you to […]
Posted in Java | No Comments »
Sunday, January 2nd, 2005
The new certification test for Java 1.5 (or Java 5 or Tiger) is going to be coming out as a beta soon. According to Kathy Sierra’s weblog the new test is going to avoid the complicated “puzzle” type problems and concentrate more on your ability to accomplish specific objectives with Java code. It […]
Posted in Technology, Programming, Java | 1 Comment »
Sunday, January 2nd, 2005
One of the questions I ran into when preparing for the Java Certification exam dealt with how Java handles nested comments. Since this isn’t something I usually do in my code I wasn’t sure how it worked. It turns out the results were different than I expected.
First lets look at the double slash […]
Posted in Java | No Comments »
Sunday, January 2nd, 2005
After using Java for about four years, I started wondering how well I really understood the language, so I started looking into Sun’s certification. Sun offers the following certifications:
Sun Certified Programmer
Sun Certified Developer
Sun Certified Web Component Developer
Sun Certified Business Component Developer
Sun Certified Developer for Java Web Services
Sun Certified Enterprise Architech
Sun Certified Mobile Application Developer
The […]
Posted in General, Java | No Comments »