Archive for January, 2008

Sun Spots are now Open Source

Wednesday, January 30th, 2008

sunspot.jpgSun has announced that the Sun Spots are now fully open source. This means that the API as well as the Squawk VM are now fully open. The Squak VM itself is an interesting project. I will be curious to see how it compares against google’s Dalvik VM on small devices (that is whenever google releases or tells us more about Dalvik).

The press release seems to imply that the Sun Spot hardware will also be open source:

The open source release of the versatile Java technology-based Sun SPOT platform will include hardware, software and the Squawk Virtual Machine.

but this is the only mention I see of hardware in the press release and on the several sites dedicated to Sun Spot. I really hope they expand on this and show the world everything that is included in the OSS releases.

If the hardware is Open Source that could make way for some third parties to make their own implementations, similar to the different implementaitons of Arduino. This would be especially welcome given the crazy high cost of a Sun Spot device ($250 or so per device compared with $20-150 depending on configuration for Arduino). Yea, Yea, I know Sun Spot is way awesomer than Arduino, but if I am going to make a little device to attach to the top of a rocket or the under carriage of my skateboard, you better believe I am going to be looking for the cheapest hardware I can find.

SQL NOT IN SubQuery + Null

Friday, January 4th, 2008

This is something that wasn’t apparent to me for quite a while and seems to trip me up every now and again.

Say you have two tables. ‘Employees’ and ‘Payroll’.

Employees

column type
username varchar(200)
email varchar(200)

Payroll

column type
username varchar(200)
paid datetime
amount money

Not great tables, but they will get the point across.

If you wanted to select all employees who have never been paid, you would normally do a query like this:

SELECT *
FROM Employees
WHERE username NOT IN (
	SELECT username
	FROM Payroll
)

What trips up this query is if there is a NULL username in Payroll, it will never return any results. In order to make it work, you have to select all the NON NULL usernames from Payroll.

SELECT *
FROM Employees
WHERE username NOT IN (
	SELECT username
	FROM Payroll
	WHERE username IS NOT NULL
)

This behavior seems to be consistent in MySQL 5 and SQL Server 2005, I haven’t tested in Oracle.

More Macbook weirdness: num lock & caps lock reversed

Wednesday, January 2nd, 2008

Maybe my Macbook is messed up because I seem to get way more weird issues with it than other people I talk to.

Today it started doing this thing where it thinks the number lock and caps lock buttons are reverse what they should be. In order to type normal, I have to have both the lock lights turned on, rather than turned off. Toggling them on or off seems to work normal, it just thinks that a green light means turned off rather than on.

A bit of digging turns up that it seems like I’m not the only one with this problem. A forum post says that resetting the PRAM fixes the issue, but so does resetting the computer without doing anything sometimes so I don’t know.