GoGeocode PHP Library Release

Tuesday, February 26th, 2008

Over the past two months or so I’ve been playing with an old pet project of mine that I tend to peck away at when I can’t think of a better to work on.

As part of this project I found myself needing to do a massive amount of geocoding in PHP.

After searching through the various PHP based geocoding libraries online I came to notice that none of them seemed to make use of the APIs ability to return multiple points as well as informational data about each point.

Thus GoGeocode was born.

GoGeocode is an extremely small set of classes for use in querying both the Google and Yahoo geocoding APIs.

I’ve released the code under the MIT License and posted the code at http://code.google.com/p/gogeocode/

Take and enjoy!

Update: The GoGeocode page has been updated with a description, example use case, and a tar.gz archive of the gogeocode-0.1 release tag from SVN.

GoGeocode PHP Library

Tuesday, February 26th, 2008

Over the past two months or so I’ve played with an old pet project of mine that I tend to peck away at when I can’t think of anything better to work on.

As part of this project I found myself needing to do a massive amount of
geocoding in PHP.

After searching through the various PHP based geocoding libraries online I came to notice that none of them seemed to make use of the APIs ability to return multiple points as well as informational data about each point.

Thus GoGeocode was born.

GoGeocode is an extremely small set of classes for use in querying both the Google and Yahoo geocoding APIs.

I’ve released the code under the MIT License and posted the code at http://code.google.com/p/gogeocode/

Take and enjoy.

Happy Coding,
Joe Bauser

Setting up an NDS Homebrew tool chain in Linux and Mac OSX! (Ok… Windows too…)

Monday, July 23rd, 2007

UPDATE: Given the updates made in the DevkitPro project since this article was written, it is quite out of date. For Linux, there is a little bit of hope! Commenter Namoul has created an installer script which can be used to get your development environment up and running. Find it here: http://lmn.mooo.com/projects/devkitpro-sh

Well, I realize I had promised to give instructions for both Windows and Linux, but as it turns out, the instructions for Windows are so simple it’s almost laughable.

Are you windows users ready?

Installing devkitARM and setting up your environment in Windows.

  1. Run the updater script you downloaded in the previous section.
  2. Select devkitARM, libnds, the examples, programmers notepad
  3. Finish the install

That’s right. That’s it. You’re done Windows users. Now go have a coffee while us linux users get ourselves up and running. :)

Installing devkitARM and setting up your environment in Linux and Mac OSX.

To be honest, the process isn’t all that much more complex, but it does assume you know a little bit about setting environment variables.

The first thing you’ll need to do is make sure you’ve downloaded the devkitARM binary package, the libnds source package, and the example code package mentioned in the previous post.

Step 1) Setting up the directory structure:

First we need to set up a development path. This path can be anywhere, but for the sake of this tutorial we’ll assume you’re installing to /usr/local/devkitPRO/.

The first thing we need to do is create our directory structure:
For now this is as simple as

 mkdir /usr/local/devkitPRO

But by the time we’re finished it should look something like

/usr/local/devkitPRO
/usr/local/devkitPRO/devkitARM/
/usr/local/devkitPRO/libnds/

Step 2) Installing the devkitPro binaries:

Next we’ll want to uncompress our devkitARM tar.bz2. Assuming you’ve downloaded the devkitARM archive to your home directory, this can be acomplished by changing to the devkitPRO directory we’ve just created and running:

cd /usr/local/devkitPRO/
tar -xjvf ~/devkitARM_r20-linux.tar.bz2

the devkitARM tar.bz2 contains a root directory called devkitARM which when compressed will contain the toolchain and a series of helpful binaries located within its “bin” directory.

Step 3) Decompress the libnds source:

Next we’ll need to decompress libnds. Unlike the devkitARM archive, libnds does not contain it’s own base directory, so we should create one for it now, and decompress to that directory.

mkdir /usr/local/devkitPRO/libnds
cd /usr/local/devkitPRO/libnds
tar -xzvf ~/libnds-20070503.tar.bz2

Now you have the source and tool chain necessary to build libnds into a fully fledged library for your linking pleasure. Unfortunately, if you’re at all familiar with Linux, you’ve likely already typed make, and to your surprise you’ve received a warning!

We need to set up some environment variables so the makefiles know where the tool chain and other libraries live.

Step 4) Set some environment variables:

First we need to set the DEVKITPRO variable to point to our devkitPRO install directory:

export DEVKITPRO=/usr/local/devkitPRO

Then we need to set DEVKITARM to point to our devkitARM install location

export DEVKITARM=${DEVKITPRO}/devkitARM

To make things easier for me, I just added the following three lines to the bottom of my ~/.bashrc file so every interactive shell would have access to these environment variables.

#Set Variables for DEVKIT_PRO
export DEVKITPRO=/usr/local/devkitPRO
export DEVKITARM=${DEVKITPRO}/devkitARM

Step 5) Compile libnds:

Now that we have our environment variable set, we can compile libnds.
Just go back to our libnds directory and type make!

cd /usr/local/devkitPRO/libnds
make

If all went well, you should see a bunch of text fly by, and eventually successful completion!

Step 6) Bake until golden brown:

Congratulations, you now have a successfully built Nintendo DS development tool chain and libraries.

If you’d like to test your toolchain you can extract the example source tarball that I suggested you download in the previous tutorial, and type make in it’s root directory. If everything is correctly set up, it should create a Nintendo DS ROM for each example in the examples directory.

The examples may not make much sense now, but make sure to poke around the examples. They’re one of the most useful resources a Nintendo DS homebrew developer has at his or her disposal.

Final Notes:

A final suggestion would be to install a Nintendo DS Emulator on your computer if you haven’t already. This way you can begin experimenting with your Nintendo DS examples even if you don’t yet have a DS or development hardware. However, when it comes to testing your shiny new Nintendo DS programs, nothing beats booting them on a Nintendo DS.

I would highly recommend that every budding Nintendo DS developer own at least one Nintendo DS. Besides… when you’re not developing you can pop in your Mario Kart or Tetris cartridge and enjoy Nintendo’s awesome handy-work!

Now that you have a working tool chain set up, you should go on to configure your IDE of choice to use devkitARM and libnds.

Nintendo DS Homebrew: Tools of the Trade

Monday, July 23rd, 2007

How the heck do you do this?

There are few things more essential to the budding homebrew developer than their development environment. As we’re just starting out, we have yet to even get our environment together. As such our first task should be to gather our tools and get ready to install.

There are two very important packages every homebrew developer should be aware of.

The first of these two is a package called devkitARM. DevkitARM is a full compiler toolchain for the ARM chipset on which all Nintendo DS games run.

Why do you need a toolchain?

Because executables differ from platform to platform. If you just take your home Visual Studio install and compile a “hello world” application, it will compile for your host operating system and architecture. Unfortunately the set of instructions that your (likely intel) CPU and the instructions that the Nintendo DS’s ARM CPUs understand are not very similar at all. As such you need a set of tools which can create executables for your target platform.

Getting devkitARM.

DevkitARM provides just those tools, as well as an additional set of tools which should make your homebrew development that much more fun.

Now that you’re excited to get those files, devkitARM can be found at the following addreses:

For windows, you’ll want the devkitPro updater, which is a full installer for windows, and will get you up and running with minimal work.
Download the devkitProUpdater for Windows from Sourceforge.

For Linux or Mac OSX, you’ll want to grab the binaries for devkitARM at the following address:

(There are windows binaries as well, but windows users should just use the super spiffy auto updater.. it’s much easier.)
Download the devkitARM binary archive from Sourceforge

Now that your programming arsenal has increased by one cool package, it’s time to get your Nintendo DS development library.

Getting libnds.

The only library you should concern yourself with at this point is libnds. Libnds began as a series of useful #define statements to make Nintendo DS development a bit easier. Over time it evolved into a full development library with support for most of the functionality of the Nintendo DS. Through libnds, the enterprising developer even has support for 3d through a series of functions which look incredibly similar to OpenGL.

If you’re running Linux or Mac OSX you can get the library here:
Download the libnds source archive from Sourceforge

If you’re running Windows, don’t fret, the auto updater will fetch libnds for you!

Example code anyone?

The final archive I would suggest everybody have on hand is the latest copy of the nds examples. This archive contains a series of example code showing most of the implemented functionality within libnds.

As above, Linux and OSX users use the below URL. Windows programmers should use the auto updater to get these files.
Download the Nintendo DS example code from Sourceforge

Tune in later for information on how to turn these archives into a full fledged development environment!

So you want to make Nintendo DS Homebrew…

Tuesday, July 10th, 2007

If you’re like me, and you’re new to the Nintendo DS scene, the first thing you’ll notice is that you have a long road ahead of you before you can call yourself an expert homebrew developer.You’ve probably scoured message boards, websites, IRC channels, and source code soaking up as much information as you could so you could be somewhat ready to begin developing.

Well you’re ready to start… but how do you do that? Where are the tools? How do you install them?

Never fear folks, I’ve collected this information and will provide you with step by step instructions for getting your development information up and running!

Over the next few days I’ll be posting these how-to tutorials on my site which should explain every step you need in order to start developing for your Nintendo DS.

Topics which will be covered are as follows:

  1. Getting the tools of the trade.
    • devkitARM
    • libnds
  2. Setting up your development tool chain.
    • In Windows
    • In Linux
  3. Creating your first Nintendo DS development project