When I began experimenting with the HTML5 canvas I decided that I might learn more if I actually wrote a program that took advantage of the functionality. This led me to create a clone of the classic Space Invaders game. Since I was primarily concerned with learning the canvas element, the Space Invaders clone was written as a monolithic application. Upon completing Space Invaders I wanted to create another game and further refine my abilities. However, in order to take advantage of the code that I wrote for the Space Invaders clone I would have first had to perform significant refactoring, so I decided to just start from scratch and write generalized classes that I could easily reuse.
After finishing my HTML5 version of Space Invaders
, and then modifying it for the iPhone
I had to write a few SAP ABAP programs which required the uploading of a CSV file in order to import data into SAP. Instead of writing and then copying a FORM into multiple programs (or calling the FORM from another program, or creating a function module, etc.) I developed an ABAP class that would handle the file upload and conversion of the CSV into an internal table. Below is the code for my class, the first part is automatically generated from the data entered in the class edit screen. You can tell the automatically generated code because it is formatted the opposite of code which has been formatted with the "pretty printer," the reserved words are in lower case and the variables are in upper case.
As a programing experiment I decided to see if I could modify my HTML5 Space Invaders Clone
Space Invaders Clone for iPhone
I wanted to learn more about HTML5, especially the new canvas tag
, so I came up with a little project. I decided to develop a completely web-based version of the classic Space Invaders
game. It turned out well enough that I thought I would share it.
You can click the link below and the game will launch right on this page, or you can drag the link to your bookmarks bar (if you have one) and launch it from there.
The hard drives on the Silicone Graphics IRIX systems that I used to administer were always filling up. We had plenty of hard disk space, for the time, but the systems were used in ways that quickly ate up any available space. Some of the workstations were used for running engineering analyses that could generate humongous result files, while others ran CAD applications which left behind many medium-sized temporary files. To keep the systems running it was necessary frequently clean up the drives, and since manually cleaning up disks can be error prone I wrote a script to do the work for me. Since I wrote the script to do some of my work for I had a little free time to add a nifty progress display, which makes the program slightly more complex.
As a UNIX systems administrator I had to maintain many individual workstations located throughout our facility, and I frequently had to either perform updates on all of the machines or some some subset of them. Logging in to each machine was tedious, even if I was just running a batch script, so I created a script that could send my commands out to all the computers that I listed in a configuration file. The configuration file was a simple text file with a workstation name on each line.
Each of the workstations mounted a common user home directory, so I create a shared home directory for root where all of the administration programs would be located (note that this was not root's actual home directory as that would be problematic if a workstation ever experienced problems accessing the NSF share). With the administrative batch files accessible to all the workstations I could use the script below to initiate the command on the cluster.
I have been working on a very simple artificial intelligence algorithm based upon my limited knowledge of game theory. The purpose of the algorithm is to keep track of other actors' karma so that we know how to treat them. The algorithm is a modified tit-for-tat (as demonstrated in Thinking Strategically).
Assume that we are creating a virtual world which contains a main character who interacts with other actors. The main character would instantiate a karma object (var actor_karma = new karma();
) for each of the other actors he encounters. For each interaction with the other actors the main character records whether that actor's actions were good (actor_karma.addDeed(true);
) or bad (actor_karma.addDeed(false);
). Based upon this information the main character would know whether he should treat the actor favorably (true is returned) or not (false is returned).