By PVG viagra

HackWE

This past weekend I had the opportunity to serve as the technical facilitator for the HackWE code jam held at the University of Windsor.

The event was organized by WETech, with great support from the City of Windsor and the Computer Science department at the University of Windsor. Irek Kusmierczyk was the able organizer of the overall event.

10 University of Windsor Computer Science students, split into 5 teams, participated in the event. The majority of the Hackforge members who served as mentors are recent graduates of St. Clair College. We matched each team with a mentor who is currently a professional programmer working in Windsor.

Two teams were awarded a prize for their work. One for their creative use of the City data sets, and the other for their technical achievement.

Adam Heinermann and Eric Brisco had the most creative entry. They created a game which uncovers a “fog of war” as players physically move around the city, and awards achievements for players who find landmarks like parks and heritage buildings. All of the judges were impressed with the creativity of this application of game concepts to achieve community goals.

Chris Drouillard, Alex Velazquez, and Kevin Yavno won for technical achievement. They were able to create an application that works on desktop computers and phones, visualizing city data sets like ward boundaries, sidewalks and bike trails on a map. Their application also shows detailed information about locations within the city as reported by city data sets. They won because they were able to do an incredible amount of work and created a highly polished application in just 24 hours. As of this posting, you can check out “Winfo” on Chris’ web space.

Alexander Chernoukhov and Adrien Gagnon created a concept for a game with the awesome name “Windsor Garbage Zombies.” They demonstrated a proof-of-concept and vision for an augmented reality MMORPG taking place on the streets of Windsor. Their presentation was quite a crowd pleaser!

Sehaj Chawla, working under a bit of a handicap (see below), created an iPhone application designed to locate City parking lots. The app has a crowdsourcing component – users can report how full a parking lot is when they get there, helping others choose the best place to park.

Alexander Nikolic and Jordan Willis created an application designed to help Windsor house-hunters make a decision by tying together City of Windsor and third-party data to identify nearby amenities.

The mentorship team consisted of Hackforgers Randy Topliffe, Jeff Szusz, William Comartin, Ben Hohner, Dan Koss, and Lucas Jones. I really appreciate them giving up their weekend for this event, along with our hosts from the U of W CS department Steve Karamatos and Margaret Garabon Cookson.

It was a really successful event. The creativity and technical achievement of all of the students was really outstanding.

All of the technical participants, whether they were contestants or mentors, learned a lot about the way that City of Windsor geographic data works and how to work with it. Professional programmers, mainly early in their career, acted as mentors and taught valuable project management skills to the contestants.

A group of representatives from the City of Windsor (Marian Drouillard, Alison Cherko and Bob Price), Alphakor (Frank Abbruzzese) and the University (Dr. Ziad Kobti) gave up their Sunday afternoon to serve as judges.

As I mentioned above, Sehaj was limited to working with City-provided CSV files because there is not a readily-usable iOS library available for working with Shapefiles. We found “iOS-Shapefile” on Github but Sehaj found that it didn’t work with the City of Windsor data. I was inspired by all the hacking going on around me so I took a crack at debugging this library. I was able to get it working with a few small additions. I’m hosting my fork with my Github account. When I get an opportunity I’ll clean it up a bit, but even in it’s current state it should be useful.

All in all, it was a great event and I’m proud to have been a part of it! You can see photos from the event on the Hackforge Facebook page.

Windsor Hackforge

Over the past several months I’ve been working with a talented, hardworking team to create a new community organization. We call it Hackforge Windsor. It’s a hackerspace with a strong community focus.

Hackforge Windsor is a non-profit computer and electronics club, which includes community capacity building as its core mission. Our goal is to spread excitement, interest and knowledge in technology in the youth, teen and young adult age demographics.

We have reached an agreement with the Windsor Public Library to use the space formerly occupied by the Wood Carving Museum. We’ll be opening the space early in 2013. We’ve already started to work on some community programming, as mentioned in this nice “Metro” article.

You should visit our website if you’d like to learn more or be a part of Windsor Hackforge.

Hexagon Hero taking shape

I’ve had a bit of time to mess around with my current game project lately, and I wanted to share my progress.

The latest prototype screenshot

I’m still using the assets from “Neutron Capture” for the time being. As it turns out, the game design owes quite a bit to Kraus’ design for Neutron. I really like the concept of using a neutral piece in an abstract game. This time around, players don’t directly move the neutral piece but instead push them (as well as their own and other player’s tokens). Tactically, it’s got a very “sporty” feel to it so I may end up using a sports theme for the art.

Gutenberg Bibliomancy

I was recently introduced to the concept of “Bibliomancy” by a friend of mine who is a librarian. According to Wikipedia, this is the traditional method of bibliomancy:

1. A book is picked that is believed to hold truth.
2. It is balanced on its spine and allowed to fall open.
3. A passage is picked, with the eyes closed.

I was captivated by this concept, and it clicked with something that has been on my mind for a while: discoverability in public domain archives. Gutenberg.org contains thousands of books on a variety of topics, and has a few nice ways to engage with it. The top 100 lists, the various bookshelves and categories are all helpful.

I thought bibliomancy would be a playful way to engage with Gutenberg’s collection and provide another way for people to discover the material. I’ve got an interest in machine-generated content of all kinds, so I thought I would build a Bibliomancer Twitter bot.

BibliomancerBot in action

I wrote a script to process the Gutenberg RDF file and generate a list of candidate book IDs. Once I had this list, I wrote a Perl script that does the following:

1. Select a random book ID
2. Download the book
3. Select a random passage from the book
4. Output the selected passage along with a link to the book’s Gutenberg URL

Steps 1,2 and 4 are all fairly trivial. Selecting a random passage from the book was an interesting challenge. Currently, I am using a regular expression to extract a piece of text that fits into a tweet and is likely to be a sentence. In the future I would like to use a more sophisticated method of extracting a piece of text likely to be interesting, but the current approach works pretty well.

You can judge the results for yourself by taking a peek at the Twitter feed. Personally, I’ve discovered some interesting material I never would have read without BibliomancerBot.

Hexagon Hero update

I had a great opportunity this week to spend some time working on my hex-based game project.

The first game in this series will be another abstract strategy game.
Right now I’m using some “found” assets as placeholders along with assets from Neutron Capture. At this point the software side has to wait on game design. This time, I will not be implementing an existing game design but instead I am designing it myself. I’m very excited to meet this challenge! I’ve been immersing myself in abstract games based on the hex grid over the past few weeks. Hopefully this will bear fruit in an interesting new entry into the category.

I am really interested in shifting landscapes and territory so I’ve built the grids to be easily destructibe in-game. In the same vein I’m including support for “obstacle” pieces belonging to no player.

Hexagon Hero

Just a little teaser … I’ve been messing around with hexagons as I’m planning a series of games based around the noble hex grid. This screenshot is from the first day of development of the initial effort. My wife came up with the project’s code name, which is the title of this post. I’m going to try to blog a bit more during the development process this time around so you should be able to watch the game take shape over time.

Temperature alerting with Temper232 and Mon

Last month I posted a Perl script for reading data from the Temper232. Once the problem of reading data is solved, the next step is to provide logging and alerting. I’m using rrdtool for logging and generating graphs. This might be the subject of a future blog post, but today I’m writing about alerting. For alert management, I turned to Jim Trocki’s Mon.

Mon has been around for a while. It’s not fancy, but as I’m planning to deploy on a Raspberry Pi, I need a light-weight solution. The fact that Mon is written in Perl helps quite a bit, as I’m already using Perl to extract data from the Temper232. This presentation gives a good overview of Mon and what it can do. debianhelp.co.uk has a nice set of instructions for configuring Mon with Debian.

I am using Debian GNU/Linux as a platform. There is a Mon package which can be installed with the following command line (as root):

apt-get install mon

Mon’s modular architecture makes it pretty easy to add new monitors. I went ahead and wrote a monitor for the Temper232, which is pasted below. On my Debian machine I saved this script as

/usr/lib/mon/mon.d/temper.monitor

Once the file is saved, we need modify its permission settings so that it is executable by the Mon daemon. To match the permission settings of other monitor scripts, I used the following command:

chmod a+x /usr/lib/mon/mon.d/temper.monitor

Here’s the source code of the monitor script:

#!/usr/bin/perl

use Device::SerialPort;
use Getopt::Std;

getopts("dt:l:h:");

# d debug mode
# t timeout period
# h high threshold
# l low threshold 

my $timeout = $opt_t || 10;
my $minTemp = $opt_l || -99;
my $maxTemp = $opt_h || 99;

my @serialports = @ARGV;
my @failed;
my $detail;

print "testing @serialports\n" if $opt_d;

foreach my $portname (@serialports){
  my $timer = $timeout;
  $port = Device::SerialPort->new($portname)||die "Couldn't open port $!\n";
  $port->user_msg(ON);
  $port->baudrate(4800);
  $port->databits(8);
  $port->parity("none");
  $port->stopbits(1);
  $port->handshake("none");
  $port->read_char_time(0);
  $port->read_const_time(1000);
  die "Couldn't open port $!\n" unless $port->write_settings;
  my $code = "\x24\x10\x05\x01\x01\x00\x32\x01\x55";
  my $count_out = $port->write($code);
  while ($timer > 0){
    # Read enough characters from port to guarantee a complete reading
    my ($count,$saw) = $port->read(10);
    if($count > 0){
      if ($saw=~m/\x24\xfe\x02(\C\C)\x55/){
        my $raw =  unpack('n*',$1);
		$raw -= 1<<16 if $raw & 1 << 15;
		my $temp = ($raw * 0.007812);
		if ($temp > $minTemp && $temp < $maxTemp){
		  print "temperature OK\n" if $opt_d;
		  $detail .= "$portname in range: $temp\n";
	    }else{
		  push @failed,$portname;
		  $detail .= "$portname out of range: $temp\n";
		  print "temperature bad\n" if $opt_d;
		}
	    print "$temp\n" if $opt_d;
	    last;
	  }
	}
	else{
	  $timer--;
	}
  }
  $code = "\x24\x11\x00\x55";
  $port->write($code);
}
print join (" ", @failed), "\n";
print $detail;

@failed == 0 ? exit 0 : exit 1;

To use this monitor, I created a “temp” hostgroup in Mon pointing to the serial device corresponding to the Temper232. In most cases this will be /dev/ttyUSB0. Mon’s a networking tool, but since the “hostname” specified in the hostgroup is the parameter passed to the monitor script, we can use this functionality to get data from a local serial port. In /etc/mon/mon.cf, my “hostgroup” section looks like this:

#
# Define groups of hosts to monitor
#
hostgroup localhost localhost 

hostgroup temp /dev/ttyUSB0

I set up the following monitoring specification for the hostgroup:

watch temp
  service temperature
    description Temp monitor
    interval 1m
    monitor temper.monitor -t 10 -l 10 -h 25
    period
      numalerts 10
      alert mail.alert bob@aol.com

The entry is fairly self-explanatory except for the switches passed to the monitor.

  • -t specifies a timeout value (in seconds) to wait for the serial port
  • -l specifies the low temperature minimum for our range (in Celsius)
  • - h specifies the high temperature maximum for our range

If the temperature reading falls outside of the acceptable range, Mon will dispatch an e-mail alert to the address specified.

The Game of Gale 1.0

The Game of Gale 1.0 is now available for download from the iTunes Store

The Game of Gale is an abstract strategy game invented by David Gale. Each player attempts to complete a connection of their own colour from one side of the board to the other.

My implementation of Gale has the following features:

  • Local multiplayer
  • AI opponent for solo play
  • The finest quality programmer art available in my neighbourhood
The Game of Gale

The Game of Gale in progress

The Game of Gale is an iPad-only release, mainly because of the way I chose to implement touch controls – players use their finger to “draw” the connection between nodes of their colour. I chose this approach because I think it feels good to use, and because it is very difficult to accidentally make a wrong move.

I learned a lot and had a lot of fun making this game. I hope you enjoy it too.

Purple Pawn was kind enough to take note of the game’s launch.
iPad Board Games gave the app a review.

TEMPer232 Perl script

One of my projects for 2012 is building a Raspberry Pi-based data collector device. Like most others, I’m still waiting for my Pi hardware. Fortunately I’ve been able to get started with a SheevaPlug that was collecting dust at Netmon. The Sheeva and the Pi share a processor architecture and both support the Debian-ARM operating system. I anticipate being able to transition to the actual Pi hardware more or less seamlessly.

I decided to start by collecting temperature data since it’s a very common data collection scenario and there are plenty of cheap sensors available.  After a bit of research I settled on the TEMPer232. The device was attractively priced and promised to be easy to work with as it contains a USB-Serial adapter compatible with the Linux ch341 driver.

The vendor’s documentation was pretty sketchy. Luckily, a guy named Silicon Owl on LiveJournal put together a nice post of his investigation into the TEMPer232. I was able to use this information to write a basic Perl script to test out my SheevaPlug temperature sensor, which I’ve pasted below. On a Debian machine you will need to install the package libdevice-serialport-perl.

SheevaPlug and Temper232

The Temper232 and it's SheevaPlug host installed in Netmon's server room.

You may want to check out my newer post which shows how to expand this script to perform alerting with Mon.

#!/usr/bin/perl

use Device::SerialPort;

my $timeout = 10;
my $port = Device::SerialPort->new("/dev/ttyUSB0")||die "Couldn't open port $!\n";

$port->user_msg(ON);
$port->baudrate(4800);
$port->databits(8);
$port->parity("none");
$port->stopbits(1);
$port->handshake("none");
$port->read_char_time(0);
$port->read_const_time(1000);
die "Couldn't write port settings: $!" unless $port->write_settings;

my $code = "\x24\x10\x05\x01\x01\x00\x32\x01\x55";
my $count_out = $port->write($code);

while ($timeout > 0){
  # Read enough characters from port to guarantee a complete reading
  my ($count,$saw) = $port->read(12);
  if($count > 0){
  # Uncomment to print hex values of data from port
  #  my $output="";
  #  @data = unpack('C*',$saw);
  #  foreach my $c (@data){
  #    $output .=  sprintf("%lx",$c) . " " ;
  #  }
  #  print "$output\t";
  if ($saw=~m/\x24\xfe\x02(\C\C)\x55/){
    $raw =  unpack('n*',$1);
    $raw -= 1<<16 if $raw & 1 << 15;
    $temp = $raw * 0.007812;
    print "$temp\n";
    last;
    }
  }
  else{
    $timeout--;
  }
}
$code = "\x24\x11\x00\x55";
$port->write($code);

SimpleLife 1.2

SimpleLife 1.2 is now available in the App Store.

The main reason for this update is to clean up the #1 user complaint with the application: it is not obvious or easy to recover from clearing the grid.  I have added a “reset” button which will allow the user to select from a number of starting patterns, including a blank grid.

In addition, I’ve cleaned up the cell graphics and added a dozen or so new starting patterns to choose from.