Skip to main content

Gabriele Carcassi

Gabriele Carcassi has been working for more than 10 years in scientific computing. Is currently employed by the Brookhaven National Laboratory in the control systems group for the National Synchroton Light Source II, building tools for physics and machine operation.

 

carcassi's blog

How to prevent an applet from being silently closed (with unsaved data)

Posted by carcassi on September 27, 2010 at 11:05 AM PDT

It is generally a good idea to ask the user before closing an application without saving the data. If you deploy an applet, the situation is even worse: the user may get distracted, follow some link, forget what he was doing, and close the whole browser without realizing he closed the applet too. Fortunately, it's very simple to tell the browser to display a warning.

Two problems with generics in Java

Posted by carcassi on April 9, 2010 at 5:21 AM PDT

Since generics were out and I started using them, there were always a few cases in which I couldn't make them do what I wanted. I always thought it was my problem, and that I didn't understand what was going on... Turns out: it's not. There are at least two things that are implemented in a way that break what I thought were very safe expectations.

Building a fluent API (internal DSL) in Java

Posted by carcassi on February 4, 2010 at 1:53 PM PST

In this post I am going to sum up things I have learned while creating a fluent API (or internal DSL) in Java. I'll talk about the search API I created for my current position: it's not a toy problem, it's a real problem, which has a significant amount of complexity. Because of that complexity, you get to see techniques and ideas that you don't usually see in toy examples.

Simple guide to checked exceptions

Posted by carcassi on September 25, 2009 at 10:11 AM PDT

While much have been written on checked vs unchecked exceptions, I found very little practical, down to earth, advice on how and why to use them. Here are my thoughts after years of rumination.

Java plug-in wish list: JVM scope

Posted by carcassi on March 5, 2009 at 12:11 PM PST

The second generation plug-in really made me reconsider applet as a viable deployment method (though people who are not aware of the improvements think I am crazy). For the project I am working on (http://irmis.sourceforge.net/) we decided that the user interface would be a series of applets that communicate through a Java API to a REST Web Service.

Scripting Java with Javascript: trapping Swing events

Posted by carcassi on November 12, 2008 at 7:59 AM PST

A few months ago, we had to decide which technology to use for the front end
gui of our project. We ended up
choosing Swing/Applets due to the progress that they both have done in the past
couple of years.

Finite State Machine with Annotations

Posted by carcassi on February 2, 2007 at 6:16 PM PST

This is an exercise that I did more or less an year ago to learn how to use annotations.
The idea is to use the then new Java 5.0 language features to create finite state
machines with no separate configuration files. By this time, probably there are
already a million implementation around, but the excercise did help me quite a bit
to understand how annotations can be used.

Domain Specific Languages and runtime code generation

Posted by carcassi on January 24, 2007 at 10:24 PM PST

One area in which Java has an advantage over typical HPC languages
(C/C++/Fortran) is its ability to use information at runtime to fine tune the
code.

Jabble/NetBeans bundle

Posted by carcassi on January 18, 2007 at 7:10 PM PST

I have just

made available a zip bundle
on the Jabble site in response to
some users that got stuck in the installation process: new to Jabble,
new to NetBeans, new to Java... it's tough!.