Beau Bouchard

Hexagon implementation of Conway’s game of life.

October 20th, 2014 § 0 comments § permalink


While experimenting in javascript using a svg hexagon grid for another project I decided to try out some basic cellular automaton and ended up making a small javascript Hexagon implementation of Conway’s Game of Life. A Cell is a tile which is “alive”, each Cell on render checks the tiles around it to see if the surrounding neighbors are also alive. The colors of the cells are randomly assigned at “birth” and have nothing to do with the cell reproduction. If there is a “cell” or living organism in one of the six connecting tiles it prompts a change. There are several ways you can implement a game of life with different sets of rules; for this project I used “H:B2/S35” which I will explain more about down below:


  • A Cell dies if it has less than 2 neighbors, as if caused by under-population.
  • A Cell dies if it has more than 4 neighbors as if by overcrowding.
  • A Cell with 4 neighbors lives on to the next generation.
  • An empty tile becomes a live cell if it has 3 or 5 neighbors as if by reproduction.

The actual code for the project is harder to do like I did using a 2d/plane Cartesian coordinate system, it would be much easier to attempt with an axial coordinate plane. As you can see below there is a small comment giving incite to how the each tile can check its neighbor.

The project was a small one I just did to get more practice with OOP javascript and rendering SVG onto a page. I am using the hexagon svg grid i made in another project as I get better with it. Please check out the project’s github and the demopage.

Demo Page


npm 2-0-0

September 24th, 2014 § 0 comments § permalink


Some exciting new updates for node as one of the largest package managing systems on node, npm is pushing out a large upgrade with its newest npm 2.0.0 version that adds some new great features. I have been experimenting with node for a little while with katelibby an irc bot, and beaubot a bot for twitter and they each rely more or less nearly entirely on several npm packages for their core functionality.

The most notable changes is with scoped packages, which was implemented earlier this season. Historically scoped packages has meant that with the Carrot operator (^) you can assign specific versions of dependencies to use within your package now with 2.0.0, npm now allows name spaces for personal registries, by using an @ sign you can create a registry which can consist of multiple scoped packages internal to that registry. This can allow you to be logged into multiple registries and keep your private non-main registries up to-date. npm now uses token based authentication and credentials can be shared between multiple scoped packages with peer dependencies inside of the registry now. These upgrade are probably more useful for enterprise companies using their own large private code bases, a practical demonstration of the changes could be thought of as two different versions of Grunt, one where features which have be depreciated in an older version, could be used in combination with the newest release version. Also in the 2.0.0 version they improved reliability, fixed a number of race conditions, bugs and dependency issues. But its good to see npm getting enterprise level features in its public release.

A small IRC bot

July 23rd, 2014 § 0 comments § permalink

I host a small irc channel for mostly personal friends, its been a fun adventure adding and running the occational irc bot to quickly query google, or schedule a message when we are away from keyboard. After experimenting with premade irc bots, there was a little bit lacking from most of the ones out there.

Phenny / Jenni were two python irc bot variants, phenny operating in 2.7 python environment and Jenni operating with python 3. Although they each allow for modular improvements it quickly became apparent to install a minor feature, such as a new command to reach an external website/service and retrieve a few lines required a lot of groundwork. After a short amount of time I was convinced from a friend to just start from scratch and code a fresh irc bot with all of the functionality I wanted.

Using npm I installed the irc package, technically the only external package you would need to make your own irc bot, but I added a few others which I will use to give kate some additional features. Katelibby, named after a female character from the 1995 hacker movie. Working with @ericnorris to add some features to make the bot have some interesting commands for the irc. I will be adding a followup write up about some of the commands when I get some time.

Lazy Newb Pack Linux

July 11th, 2014 § 0 comments § permalink


As of  2014-06-24 Andrew18’s Lazy Newb Pack installer stopped being maintained, which was the most popular and best way to get started playing Dwarf Fortress on linux. Toady, the creator of Dwarf fortress started to release regular updates and seeing that there wasn’t a suitable replacement for the package I created a modest precompiled version I have tried to maintain. Nearly every week now there are small updates that require the package to be reassembled recompiled and rehosted. Its not entirely a long term fix, but it seems people are using the package and grateful and that makes me happy.

I have hosted the project page on my github for the time being.

The package can be seen and downloaded here: On Dwarf Fortress File Depot

Also, Toady works on the releases and allows for the redistribution of his game entirly due to the outpouring of donations from the community. Please if you enjoy his project, donate to him.

Out growing my server

April 18th, 2014 § 0 comments § permalink

I previously was hosting my website and most of my projects at Bluehost, although as I used there service for about 4 years I noticed increasingly long downtime and once I had an extended email disruption. Bluehost was a great provider for the price, however it quickly became apparent I was outgrowing my space there and needed a more concrete setup.  Either Linode or  DigitalOcean were the SSD cloud hosting services I narrowed my choices down to based on price and convenience. I eventually ended up picking Linode because a friend has a referral code and with that I started from scratch setting up the services I would be using.  I previously used amazon’s aws and have a heavy background in system administration from RIT  so I knew mostly what to expect. Migrating my content from Bluehost was pretty easy since most of it was just miring the word-press database and migrating images over. Configuring Apache, Mysql and PHP5 was a single day task setting up the entire LAMP stack. In nearly 10 hours I was able to see my wordpress up and running.  I ended up deleting the entire linode and starting over so my steps were more documented the second time. Since I am now entirely responsible for my own data security and backups. The next day I was able to get it up in about a third of the time and started working on re-hosting my personal projects.

The most time consuming part is getting everything to look right on the front end. Right now I am using a custom wordpress theme I made from scratch, however over the years its become sort of bloated with extra CSS I am slowly minimizing.

The NoSQL Family Tree

March 26th, 2014 § 0 comments § permalink

The NoSQL Family Tree

New Features in PHP 5.5.0

July 3rd, 2013 § 0 comments § permalink

Version 5.5.0 PHP released June 20th 2013, there are a few important changes of which I will highlight a few of them I personally noticed.

PHP 5.5.0 deprecates mysql extension. Although PHP has been pretty consistent with backwards compatibility this change comes as a tragic surprise to some and to some others a relief. Some developers may need to migrate functionality to different extensions; developers still can use mysqli and/or pdo.

New Additions

Finally Blocks

In PHP 5.5 and later there are “finally block” which can be utilized in try cases after the catch blocks. Anything inside the finally block will executed after the try catch blocks before normal execution resumes, even if an exception is thrown. Example:

Output should look like:

Previously developers would have had to use a hackish workaround such as:

You can read more about the finally block on the site or this other great explanation.

Generators and the Yield

Generators are commonly utilized to control iteration behavior in loops and are now available in PHP 5.5 or later. Yield is a new special keyword which is what makes generators work. Yield operates much like a return statement however instead of stopping execution and returning a value yield will provide a value back to the generator function preserving internal values in the function between yields. A simple example:

Lists in foreach

List is used to assign values to variables from arrays quickly. Example:

However list being available in PHP 4.0.0, new in PHP 5.5.0 you can now utilize them in foreach loops

Immutable DateTime objects

DateTimeImmutable object operates similar to DateTime object; however it never changes, it simply returns a new DateTime object. This can be helpful in instance when you are keeping track of a time which you do not want to change after its been set, however want to convert it into a different timezone. On occasion its been my experience that I can easily accidentally modify a DateTime when trying to do date calculations on them. DateTimeImmutable object can be utilized as unchanging objects which calculations can be done off of without fear of changing values.

To see the complete change log visit the site.

A short rant about project architecture

June 12th, 2013 § 0 comments § permalink

I’ve been working on a my tweetscrape project to try to cement some ground work for its eventual usage in my capstone. I’ve released few details about this system outside of my repository and my pre-capstone documentation, so I figured it was time to release a much needed update.

The purpose of this project is to create a small automated software system to connect various social media postings to a real natural hazard warning issued from National Oceanic and Atmospheric Administration (NOAA). The limitations are currently just examining twitter posts and only hazard warnings issued by NOAA. The The Geographic Information System (GIS) is made up two main parts the back-end and the front end portions.

Back-End Application

The Back-end is an application coded in Java for mining purposes. Essentially this is the “tweetScrape” project I have posted on github, although not yet fully completed. The back-end collects tweets based on keywords associated with each of the main 10 hazards NOAA issues alert notifications for. These Hazards are as follows:

  • Tornado
  • Hurricane
  • Severe Thunderstorm
  • Flash Flood
  • Flood
  • Winter Storm
  • Special Marine
  • Non Precipitation
  • Tsunami
  • Space Weather

Early and Crude System Architecture Diagram


When running the back end application will continuously scrape twitter based on keywords and language to save Tweets of interest. Later once a NOAA Alert Notification is issued the application will associate relevant tweets to the NOAA Alert in the database. These associations are based on overlapping time and geolocation coordinates between the NOAA alert and the tweets as well as more specific language. These associations in side the database are done by relating tweets in the database to an “event” which is a confirmed weather hazard validated by the NOAA Alert notification. Below is an early concept UML Diagram of how the database architecture is going to be setup.

Early UML Diagram of Database Architecture


Web Front End Application

After a NOAA event is issued and the back-end application has associated enough tweets to the “event” this information can be viewed on a web driven front end. Using HTML5 and LeafletJs map, overlaying the tweets with an expected hazard location its possible to allow for simple visual analysis on the Hazard. Here there are a few key features the front end performs on its own.

Twitter User Tracking: Imagining each social media user as an advanced and very articulate sensor each social media posting gives a small piece of a larger picture. The purpose of this feature is to be able to gather additional information/tweets based on each of the detected tweets, allowing for additional/followup information from that twitter user. If a twitter user’s tweet has been saved and associated with a hazard warning in the back-end the front end will take some of their previous tweets as well as any tweets since the original post and check to see if they are relevant. Relevancy being determined by the geolocation of the tweet being near or in the hazard zone and checked for language syntax and keywords different from the back-end.

Hazard confirmation: The language for each tweet associated with the hazard is used to confirm A) the hazard is happening at that time to that twitter user and B) uncover severity of the hazard or additional details. This is done by performing some basic trig to get euclidean geometry based on keywords. Detecting several tweets which all include “hail” during a hurricane hazard can indicate that a number of people are experiencing it, although it should be noted that this does not necessarily or scientifically validating it. In our example case of detecting multiple instances of “Hail” in tweets associated with the “hurricane” event a notification will be present near the map displaying the tweets.

Some of these features are conceptual and their implementation experimental, although this system has promising results and I look forward to working on it.

The NCC-1701, In space, For real…

May 2nd, 2013 § 0 comments § permalink

Source:  High Altitude

Published open source of pTeam

April 8th, 2013 § 0 comments § permalink

I finally got around to uploading most of the files for my past project Personal Travel Emission Analysis Map (pteam). I collected GPS data from my phone using Google Latitude and used it to calculate my CO2 footprint during my travels over a week. Check out the project page for a longer description on what this project did.

Here is the project page: Project Page

Here is a link to the working example: Example

And the Github repo is here: pteam Repo