How-To

XBMCbuntu Ubuntu 10.04 Howto

For the past couple of years I have been experimenting with a variety of different Media Center distributions for my media PC. I’ve played with Boxee, Moovidia, MythTV, XBMC and LinuxMCE. Since I’m from Canada, Boxee wouldn’t work to its full extent, I don’t have a tuner card, so most of MythTV’s power was lost on me and LinuxMCE seemed like it was dieing at the time. After struggling with the performance (or lack there of) of Moovidia on my old hardware, I eventually settled on XBMC.

Zend Framework Badword filtering with Cdyne

One of my recent PHP projects had the requirement to filter out inappropriate language from user submitted content. After thinking about the problem briefly, I decided that I didn’t want to be writing the filter myself but, rather, find a third party service that could filter my text for me. By doing this, I eliminated the need to create and maintain a bad-word list, as well as saved the CPU cycles required to actually preform the search-and-replacement (Although, arguably, remote API calls are more expensive anyways).

Enable Xdebug HTML Output

I recently updated to Ubuntu 10.04 which includes PHP-5.3 by default. Ever since that upgrade I’ve had trouble with Xdebug not displaying HTML in its output: instead it would output human-readable text which becomes quite unreadable when rendered in the browser without <pre> tags.

Build an API for any website with Web-Scraping

There are a lot of web-sites out there, with a lot of data on them. Sometimes you are building a killer web-app and you just have to have some data off a certain site. The problem is, that particular site doesn’t have an API that you can just plug into! Never fear, using some simple tools, combined with the Zend Framework you can create your own web-scraping (screen-scraping) API in no time.

Greasemonkey And Dojo Integration Redux

Back in 2007 I wrote a post on how to integrate Dojo with Greasemonkey.

Since then, Greasemonkey has been re-written to include security and bug fixes which has broken my demo code. The problem is that the new security model doesn’t return an instance to the newly created dijit.Dialog when the constructor is called. The work-around is to set the ID of the dialog, and then call dijit.byId() to get a handle to it.

JavaScript Sudoku Solver

In Computing science artificial intelligence terms, the game of Sudoku is a constraint satisfaction problem. Constraint satisfaction problems are nice in the regard that there are some very nice heuristics that lead to an easy algorithm to solve them. On the other hand, constraint satisfaction problems with a large problem domain may take an inordinate amount of time to solve.

Shellinabox Gentoo Init Script

I’ve been playing around with ShellInABox and I think it is quite neat. From the website:

Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. This emulator is accessible to any JavaScript and CSS enabled web browser and does not require any additional browser plugins.

Inject Dojo Bookmark

Sometimes it can be handy to inject Dojo into pages that would not otherwise have it. I’ve used this so I can use dojo.query() on a page to select DOM objects while testing a parser in a different language.