James Sweet's Blog

A blog and portfolio to demonstrate my work, focusing on visualization.

Nest Thermostat

I was recently looking at some new gadgets and saw the Nest Thermostat. It sounds like a brilliant idea and looks so much better than the yellowing plastic one that we have a the moment.

As I currently can’t bring myself to spend $250 to buy one, I was looking for someone doing a competition and found one by ThermostatForum here. Good luck to anyone who enters. Crossing my fingers that I win.

Trying Again

So I am going to, once again, try and keep this blog updated with what is happening in my life.

Since my last post, quite a bit has occured. Me and my father have almost got a patent out, I have open sourced the Java VisArray project and I have worked on a project with the DHARMA Team at the University of Notre Dame (this has been what I have worked most on since the last post).

Over the coming days I will post some more indepth posts on some of the important work I have been doing.

Quaketectonics – REST Server

As I said in my last post, I am now working on my QuakeTectonics project.

I have spent most of my non-university time working on the REST API server and finding useful data sources.

To aid in actually working with the data collected from users, we also need to know about any earthquakes that have happened and we also need to know what emissions the sun has given off. I have managed to find two daily feeds of data from reputable sources that I have written scripts to download and import into our database, from which we have already seen some interesting results.

For the REST server itself, I attempted to implement it in both Python and NodeJS before giving up on both because I was having difficulty implementing what I wanted in them, so I am now back to using the Scala language and Lift framework. The code connects to a local MongoDB database and have the ability to retrieve, in both XML and JSON formats, the entire list of data that had been submitted to the previously developed website. To help when we actually have more users using the API, I have also started adding statistics via Twitter’s Ostrich library which will allow me to look at the number of times a specific API function is called, average times to do specific database look-ups and so on. This will hopefully allow me to improve the service as time goes by.

QuakeTectonics

I have switched from working on game stuff for a short while now as I would like to renew the work we started doing with QuakeTectonics.

QuakeTectonics was an idea initially inspired by a research seminar at my university where a guest speaker came in to talk about some work that they had done with crowd sourcing as well as some input from my wife, who did her dissertation on how the magnetic field of the earth could affect earthquakes. The goal of QuakeTectonics is to attempt to predict earthquakes using the magnetometers in consumer smart phones. Some issues had come about to do with filtering of the incoming data, which is all that was stopping us from releasing a version to the app stores of both Android and iOS.

We had a device setup that was stationary collecting data, which managed to catch an interesting trend showing that we could notice a change in the magnetic field of the earth when there was an instance of northern lights around South Bend.

Whilst we have a lull in collecting data, I am going to rework some of the server API structure. At the moment we have a website, powered by the Lift web framework, providing the front end and the REST API. I first want to decouple these so that the API is a separate entity. I also want to set the API up to use an SSL connection to keep users logins secure, as at the moment it is just a simple HTTP Basic Authentication.

Pong – States

I have continued my work on my pong game and have taken the rough game that was just a single file of code and refactored it to separate some classes out.

I have also now added states (just enums and if statements) for a main menu and a pause state for the game. Now that I have these, I want to refactor them into their own classes and then expand the menus to have options that can be selected with the mouse.

Menu State:

Pause State:

And Were Back

There seemed to be some DNS issues with this site during the day. I could get access to it yesterday, but when I tried this morning it wasn’t there. Confusingly I could get access to another site that was on the same web server with a different virtual host and all the same DNS settings as this.

This was a problem because a subversion repository that me and some other developers use is also hosted on this domain and the access to that went as well.

All issues seem to be fixed now however.

Moved Domain Registrar

I realised that my domain names were up for renewal at the start of the next month, so I decided that I would do my part and take a stance against SOPA. And so, I now have my domains registered with Namecheap, which, along with being against SOPA, are also cheaper than GoDaddy (my old registrar).

Back to games, I am trying to work on implementing game states into my pong game to allow me to create menus easier. Whilst I am not sure if is the best way to accomplish this task, I am taking inspiration from Managing Game States In C, which provides an example way to create and manage game states.

Pong – Complete

In my last post I said that I wanted to start actually making games and completing them, well I have a working version of pong with complete gameplay. Last time I attempted pong, I got stuck trying to work out how to make the ball bounce at the proper angle. This time, It clicked in my head that I just need to invert the X acceleration when it hits a paddle and the Y acceleration when it hits the top or bottom boundary.

The next steps that I want to do with this code are:

  • Refactor
  • Menus
  • Opponent AI
  • Online Leader boards
  • Online Opponents

I intend to work on these ideas at the same time as working on the next game, which will be a breakout clone as it is similar to pong but is slightly more complicated. Hopefully, I can start building up a good collection of reused code to make it easier in future to implement these games.

Screenshot:

Pong

So, I have realised that I have never actually created a working game that is playable and I intend to make this year a year where I actually make games. To kick it all off I am going to make pong. I have already created a simple version in OpenGL where I can move two paddles and the ball bounces around with the ability to score. The next phase is to have a score counter on the screen and lives so that there is an end to the game.

This is a good step forward, as last time I attempted to write pong I got stuck trying to work out how to make the ball bounce correctly. This time it hit me that it was as simple as just reversing the X acceleration if it hits a paddle, or the Y acceleration if it hits the top and bottom boundary.

The code is at: Pong

Obligatory Screenshot:

Graduate OS

I have now received my results for the last semester and I received a B+ grade for graduate os. This is lower than I was hoping, but I believe that I picked too difficult a project to undertake compared to what was required for the class. There was also some misunderstanding about how to hand in extra credit for this course that ment that I missed demonstrating it, reducing the possible extra marks that I could have received.

This means that in the next semester I intend to retake both Advanced Computer Architecture and Graduate Complexity & Algorithms. As I have done these before I have high hopes that I will be able to meet a high grade in both of these classes.