RSS Feed

Thomas Ross Hallock

Octi For Kids Haskellbot

17-April 2011

North: 12 prongs
+---+---+---+---+---+---+
|   |   |   |   |   |   |
|   |   |   |   |   |   |
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   |   |   |   |   |   |
|   | O | O | O | O |   |
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   |   |   |   |   |   |
|   |   |   |   |   |   |
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   |   |   |   |   |   |
|   |   |   |   |   |   |
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   |   |   |   |   |   |
|   |   |   |   |   |   |
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   | | |   |   |   |   |
|   | X | X | X | X |   |
|   |   |   |   |   |   |
+---+---+---+---+---+---+
|   |   |   |   |   |   |
|   |   |   |   |   |   |
|   |   |   |   |   |   |
+---+---+---+---+---+---+
South: 11 prongs

On the heels of last week’s post of my implementation of Tonobeb for the web, I bring you another board game blast from my past: back in 2001, I wrote a simple minimax AI in Haskell for a board game called Octi for Kids, a simplified version of Don Green‘s OCTI board game.

I finally had some time this morning to recompile the Haskell code into a binary that runs on my webhost, so now you can play against it while it thinks:

Inspection of the url in the links above will reveal how to arbitrarily increase the look-ahead level.

The code is available here on github.

My implementation of Tonobeb – a board game played with dice

10-April 2011

Back in 1983, my uncle Bruce came up with a fun board game played with dice. My dad made a nice wooden board for it and Bruce got a write-up of the the game published in Gameplay Magazine. Fast forward to 2006 and I made a playable web version of the game; it was the first web application that I finished, and even now, I’m a bit impressed in using it. This pre-dates jQuery, so please savor the library-free hand-coded javascript ajaxy goodness. Without further ado, I present Web Tonobeb:

If someone else loads this page at the same time as you, you will be matched with them automatically. Alternatively, you can challenge a friend by e-mail.

I just open sourced Web Tonobeb on github; I probably won’t have much time to turn it into something that Yahoo games would want to acquire, but you might! Clone away!

Fractile: browser-based distributed computation of Mandelbrot set tiles. Now on Google Code!

17-September 2010

I open sourced my Yahoo Open Hack NYC 2009 entry into a google code project called fractile. It’s currently only one php file with embedded Javascript at the moment. Feel free to let me know if you would be interested in joining the project to turn this into something useful; the idea has tons of potential for any sort of problem that can be parallelized well low-bandwidth ray-tracking, for example.

A proof of concept HTML + JS-based distributed computing platform

10-October 2009

[update] Just fixed a bug that was preventing this from working in most browsers. Go ahead and give it a try now.
distributed browser based Mandelbrot set rendererI made this browser-based Mandelbrot set zoomer for Yahoo’s Open Hack Day NYC 2009. It is built in HTML + JS and will use the browser of anyone that has the page loaded to construct fractal images for other users that are also viewing the page. Click on the large image to zoom deeper and deeper. It works best in Safari 4, okay in Firefox 3.

This is a proof of concept of portable browser-based distributed computing. (It even runs on iPhone.) The web server will ask your browser to render a specific square on the complex plane onto a canvas. Your browser will then submit the rendered square by turning the canvas into a data URL and posting it to the server’s cache. At the same time, your browser is requesting that the server send out render requests for all squares necessary to make up your current view of the complex plane. These requests may be rendered by your browser, or they may be rendered by another user’s browser that currently has the page running. Load it up on two or three computers at the same time and you’ll notice a significant increase when rendering parts of the fractal. The server caches the tiles, so browse to an obscure part of the fractal to make sure that the system is actually sending requests to the swarm. You can see the last square that your browser rendered just below the large square.

This technique can be used for a specific type of problem where the information that describes the problem and the result is significantly lighter-weight than the computation required to solve it. Specifically, this would also work well for a web-based ray-tracer.

This idea was partially inspired by Resig’s Test Swarm service that distributes front-end toolkit testing to any user that hits the site with their browser.

turning the premailer interface invisible

28-August 2009

[update: looks like premailer changed their interface a little,
which broke my domain-level meta-interface for it. I'll fix it sometime, just not now :(]

Premailer is a nifty ruby script that turns most of the css from external stylesheets and style blocks into inline css on each element. This is useful if you want to be sure that HTML e-mails will remain mostly in-tact in the viewer’s mail client.

It’s a great script, but the interface could be better… and by better, I mean invisible. … so I bought the domain inlinecss.com and made it work with premailer and your URLs. No interface required; just add .inlinecss.com after the TLD in the URL of the page that you want to inline, and the site will mirror the inlined version of your page.

For example, to inline google.com, turn http://google.com/ into http://google.com.inlinecss.com/

refracting magnifying glass effect with Javascript

20-March 2009

After playing with this code and this demo of a javascript mouseover zoom effect, I decided to take the magnifying glass effect one step further and add some refraction:

It uses concentric images placed on top of each other to achieve the illusion. Paste in a URL to any image you want and you can play with it. It’s in an iframe, so you’ll have to dig a little if you want the source; it’s pretty ugly right now.

Mad photoshop skills

5-January 2009

Here’s a quick little job I did because it needed to be done.

Before:
big-ride-logo
After:
big_ride_2008_cleaned

Consignment 2.0 – a podcast for eBay consignment sellers

I would like to make a special mention of my new podcast, Consignment 2.0, dedicated to improving the practice of eBay consignment shops by sharing information from the guys at The Sellery, as well as others in the eBay consignment community. Our first episode is up, and we are aiming for a bi-monthly release schedule.

Expiration date decoder

3-January 2009

This page explains how to decipher many of the cryptic expiration dates found on food containers. This is very useful, but it occured to me that it would be even more useful if this could be implemented in a script that could be accessed from something portable like an iPhone. Enjoy!

Template Metaprogramming

1-May 2002

As part of a research and writing project in my Junior year, I wrote an explanation of template metaprogramming in C++ and how it relates to the functional programming paradigm.