Archive for the ‘Programming’ Category

homeR: an R package for building physics

For the past few weeks we’ve been very busy here at Neurobat with the analysis of field tests results. In the process of doing that, we had to implement several functions in R that relate to building physics. We thought it might be useful for the community to have access to those functions, so we [...]

Posted on May 26, 2011 at 2:54 am by lindelof · Permalink · 2 Comments
In: Programming, Tools

Saikoro game engine in Lisp

Here at Neurobat we consecrate one day per sprint as a Lab Day, i.e. a day when, not unlike what Google does, we are free to work on whatever we want. Today was Lab Day and I took the opportunity to brush up my Lisp skills by writing a game, inspiring myself heavily from Conrad [...]

Posted on May 20, 2011 at 11:40 am by lindelof · Permalink · 2 Comments
In: Programming · Tagged with: , ,

Weird certificate verification error

I spent most of the day today debugging a very mysterious error we encountered when trying to programmatically call a web service over SSL from Java. Here is the source code with which we managed to reliable reproduce the error: import javax.net.SocketFactory; import javax.net.ssl.SSLSocketFactory; import java.io.*; import java.net.Socket; public class SimpleSSLTest { public static void [...]

Posted on July 1, 2010 at 1:45 pm by lindelof · Permalink · One Comment
In: Programming · Tagged with: 

MATLAB’s inane idea of time

MATLAB seems to have a very peculiar notion on how to represent dates and times. Yesterday I spent a wonderful couple of hours debugging some code that’s supposed to compute the sun’s position, most of which could have been avoided if the MATLAB designers had followed a simple convention used by, I believe, most computing [...]

Posted on June 24, 2010 at 2:18 pm by lindelof · Permalink · 4 Comments
In: Programming · Tagged with: 

Alternatives to Java for home automation devices

I think there’s no escaping this simple fact: the Java Virtual Machine (JVM) is definitely here to stay, and all the evidence shows that it has tremendous potential for being used in home automation devices. I still remember from a previous life when we hunted for a JVM implementation that would run with a minimal [...]

Posted on June 7, 2010 at 1:30 pm by lindelof · Permalink · Leave a comment
In: Programming

Event rate of arrival analysis with R

Here is a very common problem: suppose you’re give a series of event timestamps. The events can be anything—website logins, persons entering a building, anything that recurs regularly in time but whose rate of arrival is not known in advance. Here is, for example, such a file which I had to analyze: 05.02.2010 09:00:18 05.02.2010 [...]

Posted on February 18, 2010 at 1:03 am by lindelof · Permalink · Leave a comment
In: Programming

Looking up an EJB from a Web Service under JBoss 4.x

EJB injection in Web Services does not work with JBoss (yet), so when you want to use an EJB from your @WebService annotated POJO you have no choice but to look it up yourself. This can get a little tricky, because each J2EE container can use its own JNDI naming convention when registering the EJB [...]

Posted on August 14, 2009 at 2:38 pm by lindelof · Permalink · Leave a comment
In: Programming · Tagged with: , , , ,

5 Java logging frameworks for building automation software

Back in 2005, when I was writing Java software for an embedded home automation controller, we ran into a little unforeseen problem. The embedded virtual machine we were using implemented only the Java 1.3 API, and so did not offer any logging facilities (which only Java 1.4 started having). We ended up using the logging [...]

Posted on July 23, 2009 at 1:28 pm by lindelof · Permalink · Leave a comment
In: Programming · Tagged with: , ,

When I hear the word “Entity” I reach for my thesaurus

According to Eric Evans, the author of Domain-Driven Design: Tackling Complexity in the Heart of Software, one of your first goals as domain analyst is to define what he calls an Ubiquitous Language, i.e., a common vocabulary that your technical team and your business sponsor will agree on, and will use to communicate. Having such [...]

Posted on July 14, 2009 at 3:25 pm by lindelof · Permalink · Leave a comment
In: Programming · Tagged with: , , , , ,

Largest palindromic long long int that is also the product of two integers

Just to practice my C skills I’ve begun doing the Project Euler exercises in that language. Project 4 asks what is the largest palindromic number that can be expressed as the product of two 3-digit numbers. The answer is 906609 = 993 x 913. Just for fun I modified my program to compute the largest [...]

Posted on June 2, 2009 at 11:28 am by lindelof · Permalink · Leave a comment
In: Programming · Tagged with: ,