Projects
How I get this date
Language: Java
An SMTP (email) server written from scratch in pure Java (the Java Mail API isn't used at all). Also supports the POP3 protocol.
How I get this date
Language: PHP
A PHP library for querying the Hyperiums API (HAPI). I've also written a reference manual, which describes HAPI in great detail because the documentation on their website doesn't provide a lot of information.
Hyperiums is a turn-based strategy game that you play in your browser. You start out in control of a single planet. You earn money by trading with neighboring planets and you use that money to research technology and build fleets of warships. Then, you use the warships to fight battles and take control of other planets, and so on. You can join alliances with other players to help keep your planets safe.
How I get this date
Language: Java
A command-line Java program that plays the Game of Life. It uses a concurrent implementation, spreading the CPU load across multiple cores. I wrote this program while reading the book The Art of Concurrency by Clay Breshears.
Language: Java
Bemuled! is a Java game I created that's similar to the popular game Bejeweled, except instead of lining up rows of jewels, you line of rows of donkies ("mule" rhymes with "jewel"). Read the technical overview I wrote, which describes the technical aspects of the game.
A widget you can add to your webpage that displays your JavaRanch forum username and number of posts that you made.
Date: 7/15/2009I read A Programmer's Guide to Java SCJP Certification: A Comprehensive Primer (3rd Edition) by Mughal and Rasmussen in order to prepare for the SCJP exam. I sent the authors of list of mistakes I found in the book and some made it into the online errata.
How I get this date
Language: Java
A command-line Java program that accepts the terms and conditions you are often required to accept when using a public Wifi hotspot. This is useful if you have your browser configured to open all tabs that it had open last. With this utility, you can accept the terms and conditions, open your browser, and not be afraid of losing any of your tabs.
Language: PHP
A webpage that generates getter and setter methods for all of the fields in a PHP class. These methods are used a lot in the Java world. They are simple methods that allow you to get and set the properties in a class (which should be private). It's good practice to use them because as long as the signatures of the getter/setter methods don't change, you can make modifications to the class's fields without breaking any code that uses the class.
Language: PHP
A webpage that validates XML documents against XML schemas.
Language: HTML/Javascript
A Mac OS X dashboard widget that allows you to view the screen of your Chumby.
Language: PHP
A utility that creates a data URI from an uploaded image. Data URIs allow you to include the actual binary data of an image inside of an HTML page, instead of referencing the image with a URL.
Language: Java
Finds all solutions to a given Boolean Satisfiability problem.
Language: PHP
Downloads Hyperiums data files and imports the data into a database.
Language: Javascript
ThumbThru is a Javascript utility that provides a simple way of displaying photos on your website.
Language: C
Platform: Windows
I created this as a project for a game programming class I took in college. Watch as alien invaders blow away helicopters in the city!
Quick Reference Sheets
This reference sheet lists some of the more commonly used Java system properties, and also includes basic instructions on how to access system properties.
This contains a table listing the pattern codes that the java.text.SimpleDateFormat class uses to parse and format Date objects.
This contains a table listing the pattern codes for the PHP date() function.
This reference sheet lists and describes all the PHP magic constants, such as __DIR__ and __FILE.
Using the Github commits API
Last updated: 12/31/2011Some of the projects listed on this page are hosted on Github, a free, open-source code hosting service that makes it easy to share your code with other people. In order to get the date that my github projects were last updated on, I use the Github commits API.
It is very easy to use. Just send a GET request using a URL that contains the username of the project owner and the name of the project. It returns a list of the most recent commits, encoded in JSON.https://github.com/api/v2/json/commits/list/USERNAME/PROJECT/master
It returns something like the 10 most recent commits. You can get older commits by adding a page=N query string parameter to the URL. However, I only need information on the most recent commit, so making one request is good enough for me.
I cache this data so that I don't have to contact Github everytime the page loads. The data is cached in an XML file that looks like this:
<?xml version="1.0"?> <github> <project name="PHP-HAPI" username="mangstadt" commit="2011/11/30 17:04:06" refreshed="2011/12/31 12:12:36" /> <project name="The-Game-of-Life" username="mangstadt" commit="2011/06/18 09:11:53" refreshed="2011/12/31 12:12:36" /> <project name="Public-Wifi-Accepter" username="mangstadt" commit="2011/06/01 07:42:34" refreshed="2011/12/31 12:12:37" /> </github>
It uses the time in the refreshed attribute to determine if the data on that particular project is stale or not. If it is stale, then it queries the Github API to get the most recent data, then saves the data back to the cache.
All original content (C) Copyright 2012 Michael Angstadt
View the source