BAF's Ramblings » #programming

Website Overhaul

It’s been a long time coming, but I’ve finally overhauled my site! Actually, I’ve only just begun the process of doing so, but it’s in a state of being able to show it off. I’ve still got some more things I’d like to do with it, but it’s off to a good start already.

I’ll begin by giving a quick overview of the current state of things. I’ll dive into deeper details about everything in future posts.

more

SantaHack 2012

Following SantaHack 2011, the site needed a bit of work. Namely, support for hosting the competition across multiple years (and allowing prior years data to be shown), and to clean up the backend code, which was some pretty crappy PHP based on Symfony (which was hugely overkill for a site of this magnitude).

Not much at all has remained the same. The new system is written in Coffeescript (which compiles down to JavaScript and is then run on Node.js). MongoDB is the database of choice now, and all of this is hosted on Heroku for pushing new code to be hosted. I’ve got properly separated dev, staging, and production environments now (before, I had separate codebases, but it usually went back to the same database). The pages are all templated using Jade for some of pieces of styling, and jQuery for a bunch of the dynamic/AJAX stuff. I’m using numerous Node packages on the serverside; I may elaborate more on that later.

The site itself also much more dynamic. Wishlists are saved via AJAX and votes are stored instantly via AJAX. I have yet to write the entry submission page, but that will be dynamic as well. I’m also planning on adding a blogging feature, which allows participants to blog as they write their entries. Blogs will be private during the event, and made public at the same time their entry is. User supplied content (aside from data that is stored in the database), like entries and blog screenshots, will be stored on S3. And, since I know there are some folks in the community who like to block JavaScript, all of the JS addons are simply upgrades. If JavaScript is disabled, the site still functions fine in a more traditional way.

The code is much cleaner this time around, which is surprising given this is my first time using most of the technology at play here. About the only thing I have prior experience with is HTML, CSS, and to some extent, JavaScript.

Anyhow, I’m liking these new technologies so far, and look forward to working with them in the future.

Arduino Projects

I’ve been playing a bit with Arduino lately. My current project actually involves creating some hardware to go with it. I dislike the heat, which makes riding my motorcycle uncomfortable at times in the summer, especially on the really hot days. I stumbled upon the concept of a cooling vest - one style of which involves flowing cold water through tubes in a vest to cool down the core of your body. All commercially produced systems using this, however, require that you load a cooler with ice to provide the cold liquid to circulate through the system.

This got me thinking. I don’t want to have to screw around with ice, especially if I’m on a long ride or something. How much cooler would it be to be able to cool the water in some other way?

I’ll go into more details about this project at a later point, but right now, I’ve got a peltier unit sandwiched between a CPU heatsink/fan and a CPU water block. This, coupled with a water pump, allows me to remove heat from the water. This cooled water would be stored in an insulated container, and used to circulate through a cooling vest. As the water warms up from body heat, it can be re-cooled by the peltier unit again. To bring this project full circle, I am planning on controlling every aspect of the system using an Arduino. As mentioned before, I’ll delve into deeper details on this at a later point, but things such as monitoring temperatures, controlling water pump speed and peltier output, and even estimating cooling capacity and power consumption are the target of this system.

In the pursuit of this target, I’ve dumped a few hundred dollars buying Arduino parts and a bunch of miscellaneous sensors. I’ve begun to play with the system as a whole - which really isn’t too hard to pick up. My last foray into microcontrollers involved PICs and writing assembly code, so the familiar gcc compiler and community provided libraries for the Arduino family is a nice change of pace.

While playing around with Arduino, though, I’ve begun to think of several other projects that I may tackle at some point. They all sound fun:

A DIY weather station setup. Given a bunch of sensors, I could record weather data in my backyard, and even submit to Weather Underground. Bonus points for solar powered sensors that communicate wirelessly to a central Arduino brain, which can then use ethernet or wifi to report the info directly online, with no computer required.

An LED cube. They’re just plain awesome. Even cooler would be an RGB LED cube, though that presents some interesting issues (due to the fact that I want full PWM control of each voxel in the cube). Multiplexing a digital, single color cube isn’t a big deal, but when going to RGB in this fashion, you now have to control three times as much hardware, and deal in analog as well.

Remote car starter. Not the car starter itself, but an extension to it. Using one of the fancy GSM modules for Arduino, it would be cool to be able to start my car remotely over the internet. The only thing holding me back here is that my current vehicle doesn’t have a remote starter.

LED brake/tail light and blinkers for my bike. Use Arduino to control them, so I can add some attention getting features (such as strobing the brakes and/or blinkers when I tap the brakes). This was actually a project I was envisioning doing with some sort of microcontroller, before the cooler idea and before I knew much about Arduino.

A bright RGB light for my room. Doesn’t necessarily need to have individually addressable pixels, but it would be cool to replace the ceiling mounted light in my room with such a beast. The challenge here is getting the thing bright enough to light the room, and doing it affordably (these challenges rise from the desire for full RGB).

I’m sure I’ve had other cool ideas that I’ve forgotten about. These are the cool ones that come to mind right now.

Anyhow, look for more posts on this subject later. In tandem with my current Arduino project, I’ll likely be reimplementing community-sourced libraries for hardware interfacing that I’d like to see done a different way. This includes a library for text LCD control, for interfacing the 1-wire temperature sensors I’ve purchased, and a library for handling buttons for a user interface.

SantaHack 2011!

I spent a good chunk of the weekend working on the site for SantaHack 2011. It still needs some work, primarily the implementation of the voting mechanism and the assignment and entry info pages. I’ll have plenty of time to do those though, it’s not a ton of work. The important part was getting the base site up and ready.

Major kudos to Mark Oates/Zeox Design as well for all his hard work on the graphics/design for the site.

Another Overdue Update

I’ve been doing a horrible job at blogging, as usual. I’ve gotten a head start on what would have (yet again) been a New Year’s resolution - going to the gym. I started going to a local gym with a friend - which is great, it gives somebody to work out with, somebody to be accountable to, etc. So I figured why not get started on what would likely end up being another New Year’s resolution - blogging more.

I’d like to attempt to write a blog post every night. That probably won’t happen, but it’s something to shoot for. Anything at least semi-regular would be nice. Anything goes here, programming, personal stuff, workouts, etc.

As far as the gym - my main goal is to lose some weight and get into shape. Bulking up a little bit is a secondary goal, but nothing I’m going to actively seek at the moment. I seem to have settled in around 200 pounds lately, and I wouldn’t mind dropping at least 50 of it (or less, depending on how much muscle I build, being that muscle weighs more than fat).

Wooters.us desperately needs some attention. This seems to be a recurring, tragic issue. It’s just hard to find the time to do it - I have so many other things I want to do as well.

And, on a closing note, I think I’m going to host a programming competition this month. I need to get in gear, and set up a site and everything for it, but I’m hoping for moderate success. There seems to be a void over at allegro.cc these days with Jakub gone, with nobody left to host ChristmasHack. So I’m planning on organizing ‘SantaHack’ to fill this void. More on that as it comes.