25. jan. 2006

The Joel Test: 12 Steps to Better Code - Joel on Software

The quick way to check how good a software team is.

The Joel Test
  1. Do you use source control?
  2. Can you make a build in one step?
  3. Do you make daily builds?
  4. Do you have a bug database?
  5. Do you fix bugs before writing new code?
  6. Do you have an up-to-date schedule?
  7. Do you have a spec?
  8. Do programmers have quiet working conditions?
  9. Do you use the best tools money can buy?
  10. Do you have testers?
  11. Do new candidates write code during their interview?
  12. Do you do hallway usability testing?
For every yes you get a point.
12 points: Perfect!
11 points: Tolerable...
10 points or lower: Get startet!!!

Joel has a good description to every item, so check it out.

Ajax: A New Approach to Web Applications

This article gives you a brief introduction on how-to use AJAX.

The author (Eric Pascarello) has kindly zipped the example:
http://radio.javaranch.com/pascarello/files/BasicAjaxExample.zip

Of course a good place to start is by this book:
Ajax in Action
See two sample chapters: http://www.manning.com/books/crane/chapters

2. nov. 2005

Set classpath the smart way

Original: http://mindprod.com/jgloss/classpath.html

Isn't it annoying you have to specify all the jar files needed to run a javaprogram?


Nomally you would make a:
  SET CLASSPATH=jar1.jar;jar2.jar;jar3.jar...


But in stead you can simply specify the directory where you have all your jar files:
  javac.exe -Djava.ext.dirs=usualextdir;anotherdir... 

and
  java.exe -Djava.ext.dirs=usualextdir;anotherdir...


See the original page for more tips.

13. okt. 2005

Diagnostic Tests with Ant

Diagnostic Tests with Ant

Suppose you have developed your Java application and distributed it to your users. If all goes well, the application just works on every computer. But if there's a problem, you have to begin troubleshooting. Users will call for all sorts of installation problems, expecting you to fix them. Moreover, the same problems will often come back: the wrong version of Java, a deleted file, too-restrictive file permissions, etc. Most of these problems can be solved by creating a checklist. However, instead of wasting time asking new users the same questions on the checklist over and over, you can create a diagnostic test that goes through the checklist, providing users with the information they need to solve the problem. If users can't solve the problem themselves, they can show you a clear checklist, so you can take a look at what's going wrong without asking a bunch of questions first.

What problems can users expect? First, things can already go wrong during the installation process if the user doesn't follow the installation instructions accurately. Even if the installation succeeds, problems can appear later. Changes in configuration (like the JAVA_HOME environment variable) or changes in the directory structure can indeed break things. In this article, we will develop an Ant script to run diagnostic tests for a Java application. We will look at a list of possible problems and how to deal with them. For our approach to work, Ant has to be installed on the user's machine. This may mean that your installer will have to provide Ant.

The article gets you through all kinds of environmenttest:

  • Write out a checklist of the systemenvironment

  • Check nessesary folders and required classes

  • Task for checking minimum JDK-version

  • MD5-checksum for configurationfiles and classes

  • Restore original configuration

11. aug. 2005

The VoipBuster! Free phone to 24 countries in Europe

Download the beta version of The VoipBuster!, and get free phone calls all around the world.



(You must pay 1 Euro for unlimited call
s)

18. maj 2005

How to free up Windows XP system resources

How to free up Windows XP system resources
Situation:
You are having performance problems or conflicts on a Windows XP computer. You want to know what programs or services you can safely stop from loading when you start Windows.
Symantec gives here a list of recommondations.

17. maj 2005

A neural network for Java Lego robots

A neural network for Java Lego robots
Learn to program intelligent Lego Mindstorms robots with Java
The Lego Mindstorms Robotics Invention System lets you design and program real robots that do what you want them to. By using artificial neural networks, you can build intelligent robots that can learn and show emergent behavior. This article describes the backpropagation algorithm, a basic neural network, and its implementation on a Lego Roverbot with Java.

Developers can build intelligent robots with Java, as it provides APIs for programming systems that can see, hear, speak, move, and even learn, using neural networks, which are algorithms that mimic our brain.

This article shows how to develop a robot that can learn by using the backpropagation algorithm, a basic neural network, and implementing it on a Lego Roverbot. Using both the algorithm and Java, the Roverbot?a Lego robot vehicle?can learn some basic rules for moving forward, backward, left, and right.

In this article, we use the Lego Mindstorms Robotics Invention System 2.0 for building the Lego robot; leJOS 2.1.0, a little Java operating system for downloading and running Java programs inside the Roverbot; and J2SE for compiling the Java programs under leJOS.

18. apr. 2005

Automatically implement design guidelines in your code.
Add Hammurapi, a design-compliance solution, to your toolbox

Design guidelines represent mere intent; for success however, implementing these guidelines is essential. The traditional way of implementing them is via code reviews. Hammurapi, a design-compliance tool, provides an automated and consistent way of implementing design guidelines, thereby making design reviews effective and painless. In this tutorial, author Sidharth Sankar introduces Hammurapi, compares it with similar tools, and gives a quick peek under the hood to illustrate how it works.

3. feb. 2005

Java Platform Migration Guide from 1.3 to 5.0

http://java.sun.com/j2se/JM_White_Paper_R6A.pdf

This guide helps developers migrate Java applets, standalone applications, Java Web Start applications, and development tools from version 1.3 of the Java platform to version 5.0.
While many 1.3 applications run without change, compatibility issues do exist, as described in this guide. The first three sections cover issues that are of interest to all application developers. The fourth section covers issues that are primarily of interest to platform implementers and tool developers.

19. jan. 2005

WindowsDevCenter.com: Disk Cleanup Hacks

WindowsDevCenter.com: Disk Cleanup Hacks.

This article gives you an idea how to clean up your harddisk reguarly via creating a cleanupset.
cleanmgr /sageset:1

And then create a scheduled task with:
cleanmgr /sagerun:1

13. jan. 2005

ONJava.com: Mock Objects in Unit Tests

ONJava.com: Mock Objects in Unit Tests.
The use of mock objects is a widely employed unit testing strategy. It shields external and unnecessary factors from testing and helps developers focus on a specific function to be tested.

This article is an introduction to Mocquer, which is a mock tool.

6. jan. 2005

Meet the experts: Bobby Woolf on J2EE architecture and design

Meet the experts: Bobby Woolf on J2EE architecture and design.
Java 2 Enterprise Edition (J2EE) is an environment for developing and deploying enterprise applications. The J2EE platform consists of services, application programming interfaces (APIs), and protocols that provide functions for developing multi-tiered, Web-based applications.
Here you'll find Question/answers to many things.

23. dec. 2004

ONJava.com: The Hidden Gems of Jakarta Commons

The Hidden Gems of Jakarta Commons
If you are not familiar with the Jakarta Commons, you have likely reinvented a few wheels.

Before you write any more generic frameworks or utilities, grok the Commons. It will save you serious time. Too many people write a StringUtils class that duplicates methods available in.
This article gives some examples and tips.

21. dec. 2004

TheServerSide.com - Struts Live Chapter: Nested POJOs

The new chapter will include a solution to one of the most frequently heard complaints about Struts: that it doesn't provide a simple way to meaningfully nest POJO graphs in ActionForms. The provided example code solves this problem and includes an integrated solution for automating conversion, formatting, and validation.

Read the article in PDF here:Struts Live Chapter: Nested POJOs.

20. dec. 2004

Yet Another Servlet Filter You Can't Live Without - Cache control

The Cubicle Jockey: Yet Another Servlet Filter You Can't Live Without
At work, we were looking for ways to reduce bandwidth usage on our secure applications. We already have the compression filter, various object caches, etc-- everything you read about. Then we started looking into caveats with using SSL and found something surprising-- HTTP 1.1 SSL usage prevents ANY content from being cached on the user's drive. "So you mean those massive JavaScript and Stylesheet files are getting pulled down with each secure page?" Yes, images too-- multiple times on a single page even.

The solution? Yet another Servlet Filter you can't live without that will be bound to your static content such as Javascript, CSS, and image files. The code for the filter is only a couple lines, but the goal is to write out the 'Cache-Control' header and the 'Expires' header.

long durationSeconds = 28800; // 8 hours
response.setDateHeader("Expires",
System.currentTimeMillis()
+ (duractionSeconds * 1000));
response.setHeader("Cache-Control",
"public, max-age="
+ durationSeconds);
chain.doFilter(request, response);


I couldn't believe how much bandwidth we are now saving with our SSL applications.

Read more here.

Write custom appenders for log4j

Write custom appenders for log4j.
Extend log4j to support lightweight over-the-network logging.

The Apache Software Foundation's log4j logging library is one of the better logging systems around. It's both easier to use and more flexible than Java's built-in logging system. This article shows you how to extend log4j with a custom "appender," the part of the system that actually writes the logging messages. This article also provides a simple example of Java's socket APIs and multithreading capabilities.

1. dec. 2004

Unit Testing with Mock Objects : What are Mock Objects?

Unit Testing with Mock Objects : Shine Technologies.
This page and its children talk about unit testing with the Mock Objects pattern. In particular, it covers what Mock Objects are, what tools the author (Ben Teese) have used, and important lessons he has learnt along the way.


The pages is about:

  • What Are Mock Objects?
  • DynaMock - A Mock Object Testing Framework
  • Experiences With Mock Objects
  • Conclusions on Unit Testing with Mock Objects

26. nov. 2004

Usable GUI Design: A Quick Guide

In Usable GUI Design: A Quick Guide, the author has 5 points in writing good GUI's.
It's supplemented with good examples.

The points:

  1. The user is not using your application

  2. The most basic point in all computer UI design is that the user does not want to use your application. They want to get their work done as quickly and easily as possible, and the application is simply a tool aiding that.

  3. Fitt's Law

  4. This is the most basic and well known of UI design laws. It states that the larger and nearer to the mouse pointer an on-screen object is, the easier it is to click on. That's common sense, yet it is often completely ignored in UI design.

  5. Unnecessary interference

  6. When a user is working, their attention is on the work they are doing. Every time they have to move their attention away from their work to the application, it takes time for them to get back to where they were in their work. Therefore, you should minimise the amount of distraction and interference your application gives the user. Every application has an item that is its key focus ? in a text editor, it's the text; in a web browser, it's the web page ? so make that central to your interface.

  7. Use the power of the computer

  8. Computers are powerful things these days, with billions of processor cycles per second and hundreds of gigabytes of storage available. Humans, however, haven't changed that much in hundreds of years. We still get tired, bored or distracted and have a limited amount of mental energy available at any one time. It would seem a good idea, therefore, to shift as much work as possible off the poor, worn out human and on to the untiring, super fast computer in front of them.

  9. Make items easy to distinguish and find

  10. This point is pretty simple: items on the screen that do different things should be easy to see and differentiate from each other.

New Community: community.java.net - Portlet

New Community: community.java.net - Portlet.
If J2EE based portals, JSR 168 or WSRP mean anything to you, you have come to the right place. This is a gathering of developers and technical experts working on Portals and related technologies. Here you will find open source projects, articles, tips, news, product announcements, blogs and FAQs. This community is also dedicated to creating a repository of open source and free JSR 168 compliant portlets that can be used on any J2EE portal server available in the market today. This is a great place to obtain portlets, learn, discuss, share knowledge and publicize your work.