March 18, 2009

Yahoo’s Rich Web UIs for Java Developers

ahoo User Interface (YUI) is an open source JavaScript library for developing AJAX-based rich user interfaces. The new Yahoo Mail uses YUI, so you might imagine how powerful the library is. This is the first article in a three-part series that primarily targets Java developers who are not JavaScript experts,

Build a Custom Formatter for a Java.util.logging Logger

For a simple custom logger, you can inherit from the base java.util.logging.Formatter class and override its format method to customize the output. Here’s an example: import java.io.*;import java.util.*;import java.util.logging.*;public class CustomFormatter extends java.util.logging.Formatter { public String format(LogRecord log) { Date date = new Date(log.getMillis()); String level = log.getLevel().getName(); String logmessage

Rebuild All Table Indexes in a SQL Server Database with One Command

You can use the sp_MSforeachtable undocumented stored procedure to rebuild all indexes in your database. The command iterates through all the tables in a database. It’s best to schedule this so it executes only during CPU idle time and at slow production periods: sp_MSforeachtable @command1=”print ‘?’ DBCC DBREINDEX (‘?’)”

Pass Arguments to Subroutines from a Button Control

You can use the CommandName and CommandArgument attributes of a button to submit arguments to an ASP.NET method on the server. For example, suppose you have a repeater control in a page that shows a nicely formatted list of products. You can include a button on that page that, when