October 25th, 2008
In case you haven’t heard, anti-video game lawyer jack Thompson’s lifetime disbarment went into effect today. He’s obviously not just going to go away, and there’s still a chance that he could get it overturned, but I feel that it’s good enough to celebrate.
A few months back I wrote a little program to allow me to play games which don’t support joystick input with my Gamepad Pro USB controller. The code was mainly just a playground for me to explore a few things, and wasn’t well-designed at all, but I got the crazy idea of releasing it in celebration of Thompson’s disbarment.
There are some serious limitations with the program. It doesn’t support joysticks with hats and it doesn’t save your settings. However, I figured it was better to release something that works than nothing at all for the occasion. I will improve upon it in the next few days, and to release the source code when I consider it stable. If you want something stable right now, you might want to consider ControllerMate.
Download it here and enjoy. Of course, I recommend that you play I’m O.K., a game designed by Thompson himself, in the few minutes left until the day is over. It runs fine in Darwine.
Posted in Uncategorized | No Comments »
October 22nd, 2008
Many people probably already know this, but if you’re not using NSDocument in your Cocoa application, the “Open Recent” menu will not get populated automatically when you open files. There are two steps to getting the “Open Recent” menu to work correctly, which are documented in the NSDocumentController documentation, but if you’re searching for a way to do this on Google, the NSDocumentController documentation will not come up, and it’s not inherently obvious that you should look in the NSDocumentController documentation, and searching the XCode documentation for “Open Recent” returns no results.
First, you need to tell NSDocumentController to add the file to the menu. To do this, you need to call [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL:[NSURL fileURLWithPath:filename]];. You can call this at any time after you have the filename, but it might be best to make sure that you can open the file and read it before adding it to the menu.
Next, you need to implement the - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename method in your NSApplication delegate. This method gets called when the user selects an item from the “Open Recent” menu, so its implementation should open the file or call another method which opens the file. If this method returns NO, the file will be removed from the “Open Recent” menu. If it returns YES then the file will be kept in the menu.
Posted in Uncategorized | 1 Comment »
October 4th, 2008
My 10-year-old brother recently asked me to teach him how to program computers. Not sure how to approach the subject, and not wanting to teach him the first language I learned—BASIC—I went looking for programming languages designed to give children an introduction to programming. I found a few, but for one reason or another none of them quite did what I wanted. I then looked into creating my own, and realized that, although implementing an interpreter for a simple programming language may be easy, implementing an educational framework to support it was not.
I don’t know if I will ever undertake such an endeavor, but I wanted to post my notes here in the hopes that they would inspire others working on the same problem or create discussions about the problem and its solutions.
Read the rest of this entry »
Posted in Uncategorized | No Comments »
June 19th, 2008
My
BTLSockets framework has been updated to version 1.1.1. This version fixes a few bugs which prevented it from working on 10.5 and Intel machines. Version 1.2, which will focus on improving performance, is coming soon.
Posted in Uncategorized | No Comments »
May 5th, 2008
This weekend I finished up my work on the first publicly-released version of the BTLSockets framework. It can be downloaded at its Google Code page. The BTLSockets framework is a wrapper around the BSD sockets API for Objective-C. It currently supports TCP and UDP connection over IPv4 and IPv6, but can be extended to support other transport-layer protocols and address families.
There are many other socket frameworks for Objective-C, such as AsyncSocket, OmniNetworking and EDCommon, to name a few. Some of these sockets are more simple, and some of them sport features not implemented by BTLSocket. In general, it is probably best to use the simplest solution which will meet your needs, so BTLSocket might not be the best framework for your project. However, BTLSocket offers the following features:
- TCP and UDP support.
- IPv4 and IPv6 support.
- Extensibility to other protocols and address families.
- Socket handler objects.
- Portability to UNIX, UNIX-like and Windows systems.
Socket Handler Objects
The BTLSockets framework uses socket handler objects which sit between the socket and the application. These handlers can filter the data before it is read by the delegate or written to the network. This interface can be used, for example to implement encryption schemes (from simple XOR schemes to SSL) or to tokenize incoming network traffic. Socket handlers can be chained together in a list, passing data down the line until it reaches the last handler, and are portable across all applications using the BTLSockets framework.
Portability
The BTLSockets framework is implemented using classes from the Foundation framework. It should compile and run on UNIX, UNIX-like and Windows systems, using GNUStep or Cocotron, though it has not yet been tested on other systems. I hope to provide GNUStep makefiles and binaries for many systems in the future.
Posted in OS X Development | No Comments »
March 27th, 2008
I opened a Twitter account the other day, mainly to spite my friends, who keep pressuring me to join the social networking revolution by creating a proper Facebook account. I have found that it’s a nice way to keep up to date with a lot of OS X development related topics. I promise to update it at least every other day or so.
Posted in Uncategorized | No Comments »
August 3rd, 2007
This post introduces a converter for megahal.brn files which converts files created on big-endian machines (e.g. PPC Mac, Amiga, SunOS) to files usable on little-endian machines (e.g. Windows, Linux x86).
Read the rest of this entry »
Posted in Uncategorized | No Comments »
April 9th, 2007
As some of you know, I participated in Ironcoder V last weekend. It was an absolutely fantastic experience. I would have written about it sooner, but this last week was the first week of the new term, and, as it usually is, it was extremely busy.
First and foremost, I should extend my congratulations to Ben Gottlieb for his winning entry WikiPath. Although I was technically in the #macsb channel on irc.freenode.net when the winners were announced, I was also at work, and thus not able to properly congratulate Mr. Gottlieb. I would also like to congratulate the others who made it to the top five: Adam Leonard for Blurred Life, Josh Freeman for CrepuscularLife, Ian Gowen for LifeLike, and Joseph Wardell for Pixure. (I would include a link to each participant’s blog, but I could not find a link for everyone.) I would be tempted to congratulate everyone who completed an entry, as it is not a trivial task, but I do not want to appear to be tooting my own horn.
I am proud of my entry though. For this Ironcoder I submitted an application which implements Conway’s Game of Life using crudely drawn pieces of Life Cereal as cells. I called it Conway’s Game of Life Cereal. I even spent half an hour or so whipping up a custom icon which plays on the ambiguity of the name: Instead of depecting Conway’s Game of Life using cereal pieces, it depicts a box of cereal with pieces shaped like patterns from Conway’s Game of Life.
Read the rest of this entry »
Posted in OS X Development | No Comments »
January 21st, 2007
I have finally relaunched this blog. It’s been a while, and I haven’t had much to write about. I have been very busy with school and various projects. I have thought very carefully about the purpose of this blog, and have decided to make it the means of delivery for my software development output.
The programs I develop tend to fall into three categories. There will be, of course, Apple-specific programs and AppleScripts. There will be software relating to tech support, which is my current job. Finally, there will be discussion (and perhaps software) related to the project which consumes the majority of my free time: Operation Purple Poodle (or OPP for short).
OPP is a 2D platformer game that I and a few others have been working on over the past few years. It is a cross-platform game written in Objective-C. It makes extensive use of SDL and a few supporting libraries in an attempt to be as compatible as possible across different operating systems. It is quite an ambitious project, and has taken a lot longer to get off the ground than I originally anticipated.
Most, if not all of my projects should run on OS X. Some will also run on other systems, and will usually be written in an interpreted language. Because of the nature of tech support, some of them will run on OS X, but will really only be useful on Windows systems. As such, I expect that I will inevitably have some users running Internet Explorer on Windows, instead of the OS X users running only Safari/Firefox/Camino/OmniWeb/Opera. Because of this, in designing the page, I was forced to fall back on HTML 4 and basic CSS to ensure that the the page would work on Internet Explorer with little testing and debugging. Since I do not have access to a Windows computer most of the time, I have very little chance to use Internet Explorer. Even worse, I have very little time to spend on things like Web design. (I’m not sure if the contact page even works. It was slapped together in 5 minutes.) Still, this AppleWorks-inspired design should serve its purpose.
Posted in Uncategorized | No Comments »