ANU Quantum Random Number Generator API

The Quantum Optics folks at the Australian National University have recently created a quantum random number generator, and made a website for it that allows you to retrieve numbers from it. By using the fluctuations of quantized energy from splitting light beams in a quantum vacuum, researchers from this group constructed a machine that generates numbers based on these fluctuations. The current theories in quantum mechanics show that these fluctuations are truly random, so the numbers are also truly random. Short of going into an all-out discussion about quantum mechanics, I’ll talk about a little open source library I built that uses the website that interfaces with the machine to produce random numbers for your applications. Click the jump for more.

TL;DR: I wrote a Java library that generates random numbers that can be found here. Download the bin jar file in Downloads and use QuantumRandom from that library just as you would Java’s Random class (it has the same methods). Just keep an eye on the QuantumRandom.err() method for error output. Further instructions can be found here. More languages to come later. Also, the library requires an Internet connection.

Read more »

Programming , , , , , , , , , , ,

Mercurial Build Number in Ant

A while back, one of our clients at work asked us to create a new record for a doctor so he could prescribe medication (this was in our older product, DoxCIS). This required us to update a class where that information was statically stored. However, this client isn’t up to the latest version of DoxCIS (primarily because we haven’t fully tested the latest version) so we had to use DoxCIS to decide what build number they had. We weren’t sure because our support guy had taken a full-time job elsewhere and we didn’t know which version he had deployed. Long story short, the build number reported by our program turned out to be wrong, and we had to update the class file by manually taking the newly compiled class and updating the jar on their server with it (in other words, it wasn’t easy to figure out). I set out to figure out why our build number was wrong so that our new product wouldn’t have the same problem. Click the jump for more.

Read more »

Java, Programming , , , , , , , , , ,

Sockets In Java

Want to use the java.net.Socket class in your stuff? While there are plenty of tutorials on how to create an SSLSocketFactory and set up SSL properties and keystores, etc. out on the web, there are surprisingly few resources that detail what to do with the socket once it’s created. We’ll talk about how you connect your socket to a server, how to send data through it, and how to properly close the socket when you’re done with it. Click the jump for more.

Read more »

Java, Programming , , , , , , , ,

Overridable Methods in Constructors

For those of you that have used NetBeans, you’ve probably seen this warning at least a few times. You may have even turned it off without really thinking of the consequences. In this post, I’ll discuss how using overridable methods in your constructors is both error-prone and poor design. Click the jump for more.

Read more »

Programming , , , , , , , ,

Programming Interviews

We did a couple of interviews at Dox recently for new co-ops, and I was in charge this time (particularly because I was the only one that would be working with them). One of the interviews was with a student we had previously interviewed, and I was confident that we would hire him. The only reason we didn’t sooner was because of financial concerns. The other was a new student, and it was definitely her first real programming interview. Not surprising, especially since most companies that are interviewing co-ops give the usual, HR-style, where-do-you-see-yourself-in-5-years interviews. Hint: anything but “working for your company” is usually a wrong answer. Interviewers asking those questions come out of the interview with a superficial idea of what kind of person the interviewee is and with little to no knowledge about the person, their real work ethic, and even who they are as a person. Canned responses from these interviews make it impossible to distinguish between good and bad workers. Click the jump for more on our interview process.

Read more »

Interviewing , , , , , , , , , , , , , ,

Bit-Masking

I was working with a friend of mine on a lab project the other day when the topic of bit-masking came up. We have an assignment in one of our classes that requires us to check the state (1 or 0) of three bits in a byte value read from memory. What’s more, we have to write it in assembly. This lead to a discussion about how bit-masking is used in general, a technique that she wasn’t familiar with. Seeing as how it hasn’t been taught in any of our classes, I decided to write a blog post for those that aren’t familiar with it. Included in the post is also a performance analysis between using separated variables and bit-masking, which yielded some interesting results. Click the jump for the discussion.

Read more »

Programming , , ,

db4o and ClassLoader

We’ve been using a NoSQL database called db4o at work for the new software, and we’ve had some hiccups with it. The latest is an issue with how it fetches the class information and how Java handles parent/ancestor class-loading.

Read more »

Java , , , , ,

f1R57 P057!!

W00T!

My name’s Brian, and welcome to my blog. This is my first attempt at hosting my own website here at home, so here it goes. Many thanks to DynDNS for their awesome services. Click the jump to read how awesome I am.

Read more »

About Me , , , , , , , , , , , , , , , , , , , , , , , , , , ,