Archive for June, 2010

Narrative exploration of code

Saturday, June 19th, 2010

I’ve noticed that a lot of frameworks and libraries don’t have narrative documentation. Instead, they only have a description of each module without a story to go with them.

This post will outline a possible strategy to develop narrative understanding of software libraries.

Exploratory programming is creating prototypes and experimenting with them to develop a deeper understanding of the problem domain and requirements.

Exploratory programming for understanding libraries will be based partially on exploratory testing methodologies. As such, there are several tools that can be used from the testing world:

  • Functional testing
  • Scenario testing
  • Focus/Defocus

Functional testing — in this context — means surveying each module, class or method and experimenting with it in a manner consistent with its documentation. The point is to learn what the software is doing. This can sometimes be difficult when you don’t know what exactly a class does or what you’re looking for, but it can give you a handle on the search space

Scenario testing — in this context — means creating scenarios of use and trying to use the library to meet them. This is generally more challenging than functional testing, but allows you to learn more rapidly about the software then just looking at the manual

Focus/defocus — Focusing on details is sometimes important, but remember to focus on the big picture. Switch between these modes if you get stuck, try something new, do something unexpected.

That’s it for now.

Twisted

Friday, June 18th, 2010

First, I’m going to start with Bruce Eckel’s description, then with the twisted online documentation.

As I progress, I’ll ask the mailing list — this should allow me to generate a narrative tutorial of my experiences that could then be integrated back into the twisted documentation.

Antipathy Redux

Wednesday, June 16th, 2010

I’m getting an itch to work on Antipathy.

This time, I’m using a slightly different strategy:

  • PyMunk for collision detection
  • cocos2d or grease for the game framework (pyglet for graphics)
  • Twisted (of course) for networking/eventing
  • Humane interface (with zooming) as much as possible!

Besides that I’m trying to simplify the game design and development. I just want some graphics, then networking and then go from there.

Until then, though, I’ll be running through tutorials over and over and over again.

Sequitor Based Reinforcment Learning Chatbot

Wednesday, June 16th, 2010

A reinforcement learning based chat bot can be implemented by using the context free grammars created by the sequitur algorithm.

As phrases are learned by the chat bot, the sequitar algorithm creates grammar sub trees based on the existing corpus. These sub trees are cataloged and can be used as a state space. Simplistically, a state consists of a vector equal in length to the number of sub trees, with a bit flipped for whether that specific subtree was seen in the input.

Based on the state, various actions can be taken. New phrases could potentially be generated using the same grammar model, or other actions could be taken.

Reinforcement “simulations” or dreams could be executed between each user input.

Primary difficulties: Keep states consistent as new additions to the state space are added, Generating new phrases based on the captured grammar.