If the indexes in your table are broken, he is the script to fix them:

DBCC DBREINDEX (‘db_name.db_owner.table_name’)
GO

MS SQL Server 2000 does not allow columns with Default value constraints to
be altered or dropped. So, is there any way to alteror drop those columns?. The problem
occurs because the DEFAULT clause actually creates a constraint on the
table. This name of this constraint is chosen by SQL Server and will differ
from database to database. (more…)

This is the class that adds the autocomplete feature to a comboviewer

import java.util.Date;

import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusAdapter;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;

/**
* Adds the autocomplete feature to a comboviewer
*
* @author Felipe Lang
*
*/
public class AutoComplete { (more…)

It’s very simple:

import java.util.Date;

public class DateUtils {

private static final long MILISECONDS_PER_DAY = 24 * 60 * 60 * 1000;

public static int getDaysBetweenDates(Date startDate, Date endDate) {
long diff = endDate.getTime() – startDate.getTime();
int days = (int) Math.floor(diff / MILISECONDS_PER_DAY);
return Math.abs(days);
}
}

Here is the code to play wav files in java. It is pretty simple, so I do not think you will any problem.

public static void play(String soundFile) {
try {

InputStream stream = SoundPlayer.class.getResourceAsStream(soundFile);
if (stream == null)

return;
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(stream);
Clip clip =

(Clip) AudioSystem.getLine(new DataLine.Info(Clip.class, audioInputStream.getFormat()));

clip.open(audioInputStream);
clip.start();
stream.close();
audioInputStream.close();

} catch (Exception e) {

e.printStackTrace();

}
}

Recently, at work, we deployed a software in many locations, and we do not wanted to allow people to install it in any computer they want. We must be sure that the software will only run in the PCs in which we installed it.
I found on the internet many applications that allows you to generate some kind of license to protect your software, but most of them where very expensive or difficult to apply.
So I decided to build my own license software, and I based it on the MAC address number because it is supposed that this number is unique. (more…)

Review of some adds and changes that will appear in the Eclipse Platform 3.3 Europa


Eclipse Platform

  • Improved workspace switching: switching between workspaces is now quickly and more efficient, since it allows to copy the workbench layout and the working sets, keeping the style of the workspaces consistent.
  • More team annotation options: you can see the version or the author of the changes in the text editor ruler in different colrs . This is great because the changes history is available at first glance.

JDT – Java Development Tools

  • Rename refactoring in editor: this is a great feature. I think that most of the developers were tired of having to open a menu each time they want to refactor. The only drawback is that is does not rename automatically the getters and setters of the field you are renaming. Also it does not open the rename dialog even if you select the menu Refactor->Rename.

Java Compiler

  • Improved null check detection: i think that the features “Potential null reference” and “Redundant null check” are very useful. I have been using the Potential null reference check, and I do not why but it only works with local method variables, it does not check the class variables.

The Eclipse Europa release available

Eclipse Packages
Eclipse IDE for Java Developers – Windows (78 MB)
The essential tools for any Java developer, including a Java IDE, a CVS client, XML Editor and Mylyn. Find out more…
Windows
Linux
MacOSX
Eclipse IDE for Java EE Developers – Windows (123 MB)
Tools for Java developers creating JEE and Web applications, including a Java IDE, tools for JEE and JSF, Mylyn and others. Find out more…
Windows
Linux
MacOSX
Eclipse IDE for C/C++ Developers – Windows (62 MB)
An IDE for C/C++ developers. Find out more…
Windows
Linux
MacOSX
Eclipse for RCP/Plug-in Developers – Windows (152 MB)
A complete set of tools for developers who want to create Eclipse plug-ins or Rich Client Applications. It includes a complete SDK, developer tools and source code. Find out more…
Windows
Linux
MacOSX
Eclipse Classic – Windows (140 MB)
The classic Eclipse SDK: the Eclipse Platform, Java Development Tools, and Plug-in Development Environment, including source and both user and programmer documentation. Find out more…
Windows
Linux
MacOSX

Great site with thousands of interesting programming ebooks about Java, JSP, Servlets, JSF, AJAX, etc.
Link here

« Previous Page