Author Archives: Nicolas Riousset

How to resize the width of a JComboBox dropdown list without resizing its edit box ?

You need a JComboBox whose width doesn’t depend on the widest of its items, but you still want the dropdown list to be wider than the JComboBox, wide enough to display properly the widest item. For example :

wider combo box

Continue reading

Questions to ask before a code refactoring

“Refactoring is the process of taking a running program and adding to its value, not by changing its behavior but by giving it more of these qualities that enable us to continue developing at speed.” – Kent Beck

A new developer gets his hands on an existing source code, and soon your hear this complaint : “Code is a mess, it must be refactored !” Sometimes, that’s true, and some other times, that’s a great recipe to end up with a code as bad as – or even worse than – the initial code. To decide if a refactoring is required, here are ten questions you should ask yourself (or the developer asking for the refactoring): Continue reading

Hints for efficient project postmortems

Project postmortems help improving a development process. But before planning one, ask yourself why you need it, and what will be the consequences of doing it or not. There’s nothing worse than collecting people’s feedback, and then ignoring it. If you are not ready to take actions to improve things, just don’t do a postmortem. Else, the following tips may help you get the most from your project postmortem : Continue reading

How to clean SQL Server cache before performance testing ?

One of your customers reported some very slow Microsoft SQL Server database access times. You restored his database at home, and were able reproduce the performance issue. But after the first execution, your super-slow query is now blazing-fast. Still you didn’t make a change… This is a courtesy from the SQL Server performance engine which cached a lot of things related to your previous query execution. How can you clear/flush this SQL Server cache before executing your performance tests ?

Continue reading