Archive for the 'Coding' Category

Continuations: What is the deal?

Friday, September 7th, 2007

Over the past few weeks I’ve noticed what I consider to be an interesting trend. It has become almost impossible for me to browse for technical reading on the internet, or partake in a technical discussion, without someone mentioning continuations.In general, I welcome any discussion, and discussion of continuations is no different. The implementation of continuations intrigues me, and I’m curious about how useful they will turn out to be. I’ve even been known to suggest that continuations could be used to make code smaller and easier to write.

With such a positive opinion about the potential use of continuations, it surprises my colleagues to learn that I am very wary of their actual use. I find myself asking, or being asked, the same question again and again.

 

(more…)

Foxnight.net is dead… anybody want it?

Friday, August 17th, 2007

Oh no! You killed it!

When I purchased my first domain I had a nifty idea for a particularly useful and exciting web application. It was to be the be-all and end-all of all my internet needs.

Then I realized that my idea sucked harder than a vacuum.

Since then the domain has been sitting around gathering dust, and generally wasting space. People have suggested that I sell the domain, but I’ve decided to just give it to the first person to  give me a good reason why it should be theirs.

How can I get it from you?

  • First, you need whatever the transfer costs for your registrar.
  • Second, you need a good reason why you should be the lucky one to own Foxnight.net.

Ok, so the reason doesn’t have to be amazing. Your reason just needs to beat the many “because I want it” reasons I’ve been receiving.

Want to do something good with the domain? Going to start a business? Want to own your first domain and think it sounds neat?

Let me know!

Contact me via my e-mail address at coderjoe[squiggily-a]coderjoe.net with your reason, and if I like it we’ll get the transfer process started.

I’ll leave this post up for as long as it takes to catch someones interest.  Once the domain has a new owner I’ll note it at the top of this post.

Experts Exchange Encryption

Friday, August 10th, 2007

NOTE: The methods listed below are no longer necessary! Experts Exchange has moved to providing the answers in plain text at the bottom of the page. Just look past the first set of “answers”, past the advertisements and link farm, and you’ll see them.

What is Experts Exchange?

If you’ve ever tried to look up some sort of technical information on the internet, you’ve likely come across the Experts Exchange. Experts Exchange is a site on which people can ask questions about a variably infinite number of technical topics and receive a range of answers from experts purported experts.

The site then allows the user to select a “best answer” earning the answer’s author extra points. Points can be redeemed for a better type of account and access to other things on the site.

In this way the site is user supported, without the experts there would be no exchange of answers.

What’s your problem with Experts Exchange?

As an incentive to sign up, the questions asked on experts exchange are visible to all, however, the answers are obscured in two rather tricky ways.

  1. The answers are obscured by a transparent gif with alternating pixels of solid and transparent, making the words a fuzzy haze.
  2. The answer text itself is encrypted using a basic and fairly famous encryption scheme called Rot13

As a person just looking for the answer to my question I’m often frustrated by the number of times I stumble across an experts exchange thread which might answer my question, but is obscured.

What are you going to do about it?

Well I hate to be bothered with unnecessary prompts to log in as much as the next guy. With that in mind, I present to you:

The Unhide Experts Exchange Greasemonkey Script

This script does what it says, it removes the image which blurs the answer text, and then Rot13 decrypts the answers for your viewing pleasure.

As the title implies, you will need to be using Firefox, and you will need the Greasemonkey plug-in to use this script.

Will this destroy Experts Exchange?

For those of you worried that this might just ruin the Experts Exchange, fear not. In their infinite wisdom they decided to completely omit the “selected answers” for the questions unless you’re logged in.

In this way there is still incentive to get an account and contribute!

In addition, I do not believe that my little Greasemonkey script will ever gain enough momentum to offset a significant portion of potential Experts Exchange visitors. If it ever did, all they would have to do is change their cypher or insert dummy text.

Any change to the cypher algorithm will be taken as a hint. (Also I’m way too lazy to implement anything other than rot13 instead of just logging in.)

However, if you’re as lazy as I (or rather as lazy as one needs to be to write a Greasemonkey script to avoid logging in…), and would prefer not to manage yet another user name and password combination, you may use the script above.

Note: The Greasemonkey script was updated on Sunday August 12th at 1:00am. It now properly takes care of the <br> characters that they do not rot13.

A list of Nintendo DS Homebrew Resources

Wednesday, August 8th, 2007

I was asked recently what resources I use as references while developing Nintendo DS homebrew.

As such I’ve decided to collect my favorite links in a single post for your enjoyment.  ( Please keep in mind that I am also new to the Ninendo DS development scene, and as such this post is by no means a complete list of all of the resources available to you. )

If you know of any killer resources that I’m missing please feel free to let me know and I’ll add them to the list.

 Hardware References:

Tutorials: 

Library References:

Communities:

That’s all I’ve got for now. If you feel I’m missing something important please let me know!

Code away.

Using KDevelop with libnds and devkitARM

Tuesday, July 31st, 2007

KDevelop is a full featured IDE for the K Desktop Environment.
In order to take full advantage of the facilities KDevelop has to offer, we’re going to take an existing template based project, and import it as a Makefile project in KDevelop.

In order to do this, first create a template based project as described in the “Using the provided template Makefile” tutorial.

Now that you have your project directory set up it’s time to import the directory into KDevelop and make a KDevelop project file.

To do this, click the “Project” menu, and then the “Import Existing…” to bring up the import existing project dialog. Select the project directory you made in the first part of this tutorial and give the project a name.

For project type you’re going to want to select either “Generic C Project (Custom Makefiles)” or “Generic C++ Project (Custom Makefiles)” your choice of C or C++ doesn’t matter too much at this juncture, so just stick with C. We select “Custom Makefiles” because we want to use the provided nds-example template makefile.

Finally enter your name and e-mail address and click next.
When it asks you if you want to populate the project with files from the source, go ahead and click yes.

You now have a project file for your project directory!
Unfortunately you’re not done yet. If you attempted to compile your project now you’d notice that you wouldn’t get very far. KDevelop will start with a clean environment for the project, so we need to set DEVKITARM and DEVKITPRO in our project.

To do this click “Project” then “Project Options” then select “Build Options” and finally the “Make” tab. There will be a section for environment variables. Add the appropriate variables for DEVKITARM and DEVKITPRO and click “Ok”. At this point your project should now successfully compile!

You could start developing right now, but you’d quickly notice that code completion doesn’t work for types and functions. This is because KDevelop needs to be told where the devkitARM and libnds include files reside.

To set this select “Project” then “Project Options” and choose “C++ Support”. At the bottom of the dialog there is a section for custom “Code Completion Databases” this is really just a collection of paths to the include files you’ll be using to develop your application.

Create one of type “KDevelop Custom Directory PCS Importer” and provide the paths to the devkitARM and libnds include directories. If you followed the environment instructions exactly these should be:

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

Click next and name the PCS importer something witty and original like… oh… “NDS Homebrew Includes”.

Click ok and you should now have working code completion!
A word of warning, there is a known issue with the current stable KDevelop (3.2 tree) which causes typedefs for structs of the form below not to work.

typedef struct {
	struct members
} typeName;

Any structs declared as such will not complete correctly. In addition, KDevelop will not code complete #define variables such as the VRAM_A_* types. I have yet to find a way to fix this.

So you can compile and code complete. But I’ll bet my dinner that you want to be able to actually EXECUTE our compiled source so that the “Run” command does what you would expect right? Well, if you’ve installed an emulator you can tell KDevelop to use that emulator to execute your nds file.

To set the emulator as your executable click “Project” and “Project Options” then select “Run Options” enter the full path to your emulator on the executable line, and in the arguments line give the full path to your project NDS file. In most cases this will just be the name of your project directory with .nds at the end. For our helloworld project the resulting file will be “helloworld.nds”.

You now have a full featured KDevelop project!
One word of warning: If you did set an executable in the Run Options, then every time you open up the project options KDevelop will screw this section up. You’ll need to edit the file to remove the “file://” that KDevelop inserts at the beginning.