Friday, April 9, 2010

Port OpenInkpot to uClibc

This GSoC proposal is for OpenInkpot, a Debian-based e-reader OS.

Project proposal

I plan to port OpenInkpot to the lightweight uClibc C library in order to improve its memory usage. Here are some of the other benefits this project could provide.

Possible benefits

  • Increase number of devices on which OI could run
  • Improve performance
  • Decrease compile time
  • Reduce firmware transfer and installation time
  • Simplify porting OI to other architectures

Plan of action

Follow these instructions for porting IPLinux to a new architecture.

  1. Acquire target device (my own e-reader!)
  2. Add new architecture identifiers (uclibc and ucarmel) to dpkg.
  3. Build and package toolchain for new arches.
    • Cross-compile existing packages to new arches with toolchain, starting with most important packages
    • Build and test firmware once the necessary packages (uClibc, dpkg, and BusyBox) have been packaged
    • Test packages on device with chroot
  4. Test complete firmware and allow autobuilders to start porting packages to new arches

Background

Programming experience

I've been programming for about two years. I've primarily used five programming languages: Javascript, PHP, ActionScript 3, Python, and C++. I've finished several small independent programming projects, but two in particular have taught me important lessons.

Last fall, I created an example game for Pygame2, a low-level Python wrapper for SDL. The game ran, but it was worthless as an example because my clumsy graphics abstraction obscured the underlying Pygame2 graphics calls. From this failure, I learned to never lose sight of the purpose of my project. My initial announcement for the flawed example.

Earlier this year, I decided to rewrite my Flash app for drawing snowflake patterns with Javascript and SVG. Once I chose the right data structure, the whole library fell into place. This project taught me that few programs must be complex; with enough thought, you can find a simple solution to many complicated problems. Read more about the SVG snowflake micro-library.

Personal qualities

I'm hard-working
When I am assigned a task, I feel compelled to do it as well as I can. I find it difficult to walk away from an unfinished task.
I'm self-motivated
Events in my life have taught me to work independently and seek out my own answers. When I discover a problem I don't know how to solve, I start looking for a solution. I check any relevant manuals, search for tutorials, look for examples, and — if I still haven't found a solution — ask for help. Finding answers on my own gives me a feeling of satisfaction and accomplishment.
I love programming
Writing code is my favorite hobby, and I will someday make it my profession. I'm not participating in the Google Summer of Code because I really need the money or I want another bullet point for my resume; I'm participating because I want to create software and learn more about software development.

Open-source experience

In addition my recent OI patch, I've spent some time working with Pygame2. While developing an example game with the unstable development version, I found, isolated, and reported several bugs.

GNU/Linux distributions development experience

I've used Ubuntu for about a year, learning much about Linux and Debian. I've become proficient at finding, installing, and upgrading Debian packages. I packaged my first .deb and started my own repository in order to test my fix for Ticket #834. I've compiled my share of source code, and I'm familiar with the GNU build system as both a user and a developer. I've written several bash scripts, and I'm comfortable with the major Unix commands and concepts. I've even spent some time configuring and troubleshooting the GRUB bootloader.

Kernel hacking

Unfortunately, I haven't worked on the Linux kernel yet.

Replace dap-server WWW Interface

Below is my GSoC proposal to OpenDAP, the developer of a scientific data server. You can see the official proposal here.

Have you contributed to any open source projects in the past? If so, which ones?

I've worked two open-source projects other than OpenDAP: Pygame2, a low-level Python SDL wrapper library; and OpenInkpot, a Debian-based e-reader OS. While developing an example game with Pygame2, I found, isolated, and reported several bugs. In preparation for my OpenInkpot GSoC application, I added a feature to OpenInkpot, closing Ticket #834.

What are your other summer plans?

I plan to go on a vacation with my family for a week or two. I'm not taking any college courses, and I have no other commitments.

Where are you going to school?

I've graduated with highest honors from Broward College with an Associate in Arts degree, but I'm still picking up some prerequisite classes before I transfer. I plan to pursue a BS in Computer Science at the Massachusetts Institute of Technology, the University of Florida, or another school — I haven't decided yet.

Have you used any of our software in the past? If so, which?

My first experience with your software was installing Hyrax from source (from this branch.)

What experience do you have that's relevant to your project?

Code

I've been programming for two years. Writing code is my favorite hobby, and one day, it will be my profession. I love to develop software, and I read everything I can to improve my skills.

Examples

Javascript
Javascript snowflake SVG micro-library
JSON Javascript slideshow
C++
I've taken a college course on C++, and I've read Effective C++, but I haven't published any C++ code yet. If a code sample is required, I could send you one of my class projects.
Shell scripting
OpenInkpot patch
Several system utilities for my personal use

Website creation

I've developed more than ten commercial websites from the ground up. I'm proficient in (X)HTML and CSS, and I'm comfortable with SVG. I enjoy creating simple, usable websites.

Examples

Software development

I've been developing software on Ubuntu for about a year. I've compiled several applications from source, and I'm familiar with the GNU build system as both a user and a developer. I'm comfortable using the major Unix commands and chaining them together into useful shell scripts. I've used both SVN and Git to retrieve and commit code. I have all the necessary skills to collaboratively develop software.

Project proposal

I plan to replace the dap-server WWW Interface with a more intuitive data request form.

Plan

  1. Remove WWW Interface from dap-server
  2. Create new BES module for generating data request forms
  3. Design intuitive HTML form for constructing data request URLs
  4. Write server-side form generator
  5. Write Javascript to read user input, construct request URL, and send data request
  6. If I have extra time:

    1. Write server-side data request generator to improve accessibility
    2. Add JSON format to dap-server to simplify Javascript metadata access

Goals

  • More logical, easier-to-use interface
  • Simpler, more readable code due to separation from dap-server
  • Greater accessibility with semantic XHTML form

Execution

  1. BES receives request for data specification form
  2. Request is sent to form-generation module
  3. Module generates data-specific data request form
  4. Form is sent to user
  5. User specifies desired data through form
  6. Javascript constructs data request URL
  7. User clicks on generated link
  8. BES receives data request and sends it to dap-server
  9. dap-server returns requested data

Why not Ajax?

  • Server-side caching
  • Greater speed
  • Fewer HTTP requests
  • Easier to implement

Sunday, March 14, 2010

InstaPyGame progress report

I spent the last three days working on a prototype "space shooter" module for my InstaPyGame framework. I had hoped to have a prototype ready today, but the framework isn't usable yet. You can see my progress so far at my Google Code repository, but be warned; the code is messy and inconsistent, and nothing is set in stone.

However, I have created an API with which I'm satisfied. Making the sample below work properly is my goal for this prototype.


from insta.spaceshooter import *

def startDemo():

    game = Game(640, 480)
    
    player = Player()
    player.setSprite('resources/ship.gif')
    
    player.when(player.moving, 'left').setSprite('resources/bankingleft.gif')
    player.when(player.moving, 'right').setSprite('resources/bankingright.gif')
    
    shot = Shot()
    shot.setSprite('resources/shot.gif')
    
    player.setAmmo(shot)
    
    enemy = Enemy()
    enemy.setSprite('resources/alien.gif')
    
    boss = Enemy()
    boss.setSprite('resources/angryalien.gif')
    
    mapGen = LevelMapGenerator({'0' : None, '1' : player, '2' : enemy, '3' : boss})
    
    level = Level(mapGen.generate('data/levelmap1.txt'))
    level.setBGSprite('resources/space.gif')
    level.setBGMusic('resources/spacemusic.ogg')
    
    game.setLevels([level])
    game.start()

if __name__ == '__main__':

    startDemo()

Right now, I'm working on the event system and the controls, but the event system appears far more challenging. I'm planning to encapsulate the data for the "Player" and "Enemy" objects within another object, protecting the data behind its member functions. This should allow me to create a special data object that will apply its changes only when a condition is fulfilled.

Although the framework is far from complete, I'm excited about the possibilities. I have plenty of work ahead of me, but I think my goal is worth the effort.

Sunday, March 7, 2010

GSoC project idea: Insta-PyGame

I'm still trying to choose new GSoC organizations to join, but I know one of the organizations to which I'll apply: PyGame, the SDL-based Python multimedia library. I plan to write a micro-framework on top of PyGame to dramatically simplify the creation of conventional games.

The Problem

PyGame is a wrapper for the C SDL library. Some of the library hides the complexity of the underlying SDL library, but in most areas, PyGame is simply a Python binding for SDL. For that reason, you often need to write several lines of code to accomplish a simple task, such as checking whether the user has pressed a button. In addition, many pieces of the API are based on C coding idioms that are unfamiliar to most Python programmers.

The Plan

I propose the development of a new framework on to of PyGame that operates at a much higher level of abstraction. Through this new framework, people would create games by declaring the sprites the characters use, the arrangement and graphics of the levels, and the interactions between the player and the contents of the levels.

The framework would be divided into modules with each module representing a genre. The "platformer" module would contain everything necessary to create a platformer game, including a physics engine, a tile map engine, and enemies that die when you jump on them. In contrast, the "scrolling shooter" module would contain tools for controlling the behavior of projectiles and enemy ships.

Here's an example of the type of code games using the framework could look like. I haven't put much thought into the API, but I would like game code to be written at this level of abstraction.


from insta.menu import *

from insta.platformer import *



def startMenu():

    titleScreen = Screen(600, 400)
    titleScreen.setTheme(themes.MEDIEVAL)
    titleScreen.setTitle("Porcupine's Tiny Adventure")
    titleScreen.setOptions(["Play", "Controls", "Credits"])
    titleScreen.getOption("Play").setAction(startGame)
    # More code for other menu options

def startGame():

    game = Game()

    hero = Player()
    hero.setSprite("standing.gif")
    hero.setRunningSprites(["running1.gif", "running2.gif", "running3.gif"])
    hero.setJumpSprite("jumping.gif")
    hero.setDeathSprite("gravestone.gif")

    hero.setMovementTriggers(constants.ARROW_KEYS)
    hero.setJumpTrigger(constants.SPACE_BAR)

    goal = Item()
    goal.setSprite("bigring.gif")
    goal.setBehavior(constants.FLOATING)
    goal.setAction(game.nextLevel)

    itemGenerator = ItemGenerator([None, goal, hero])

    '''
    Tile generator translates level maps (text files full of numbers) into tile
    maps in a context-sensitive manner
    '''
    tileGenerator = TileGenerator()
    tileGenerator.setFloorSprite("levelground.gif")
    tileGenerator.setUndergroundSprite("underground.gif")
    tileGenerator.setPlatformSprite("platform.gif")
    # Edge and corner sprites could also be set

    mushroom = Enemy()
    mushroom.setRunningSprites(["step1.gif", "step2.gif"])
    mushroom.setDeathSprite("explosion.gif")
    # Some simple behaviors would be pre-defined
    mushroom.setBehavior(constants.WALKING)

    bird = Enemy()
    bird.setFlightSprites(["flap1.gif", "flap2.gif"])
    bird.setDeathSprite("feathers.gif")
    bird.setBehavior(constants.FLYING)

    # List associates enemy types with numbers in the text file
    enemyGenerator = EnemyGenerator([None, mushroom, bird])

    level = Level()
    level.setTileMap(tileGenerator.generateTileMap("levelmap1.txt"))
    level.setEnemyMap(enemyGenerator.generateEnemyMap("enemymap1.txt"))
    level.setItemMap(itemGenerator.generateItemMap("itemmap1.txt"))

    level.setBackground("background.gif")
    level.setBackgroundOptions([constants.TILED, constants.PARALLAX])

    game.setLevels([level])
    game.start()

if (__name__ == "__main__"):

    startMenu()

The Goal

I want to free PyGame developers from thinking about the hows of game development, allowing them to focus on the whats of their ideas. By freeing game creators from thinking about the implementation of their games, I hope to allow them to explore new ideas in video game design, such as dynamically-generated levels, media mashups, user-created content, and AI.

This is just a rough outline of the framework I'd like to build and the effects I hope to see. I plan to start work on a prototype soon if the PyGame community appears receptive to my idea.

Sunday, February 28, 2010

Picking an OSS project

The Google Summer of Code is rapidly approaching, and I'm looking to join up with an open-source software organization to do a summer project. I'll need to get up to speed in about a month, so I should probably pick a project in my current area of expertise: Javascript, PHP, ActionScript 3, Python, and C++. However, I can't resist looking at some projects that would require a new language. Here are a couple of the projects on which I'd like to work.

Linear window manager
As I wrote in my blog entry on the aging desktop metaphor, I'm sick and tired of touching my mouse to manage my windows. That's why I'd love to work on a new window manager for KDE, Gnome, or another desktop environment to create a new Con10uum-inspired interface. Unfortunately, I'm not sure if any of the orgs would be willing to spend one of their valuable students slots on this project.
Writing Haskell
I'm quite interested in learning about functional programming through Haskell, but I'm not sure if I can find a Haskell project that's basic enough for me to accomplish over the summer, but useful enough for Haskell to sponsor me. Perhaps I should give up on this one.
Working on the ES OS
I think the ES OS concept is highly interesting, and I now know C++, the language in which ES is written. However, this org's projects might still be too advanced for me. I really don't know where to start learning with a project this large.
Writing Python
If I can find a small, interesting project that I could do with Python, I'll try to join. However, the last "Python" project I tried to work on was actually written primarily in C. I'll have to be more careful.

If your OSS organization needs a volunteer over the summer, I encourage you to apply for the GSoC. If you're looking for a hard-working Python or Javascript developer, I'm your man.

Monday, February 22, 2010

My software development goals

I just recently finished my UF application — Woo-hoo! I'm glad to have it done, but I actually enjoyed writing one of the "statement of intent" essays. Here's the thought-provoking prompt.

What are the core skills and knowledge you hope to acquire by completing a degree in this major and how do you plan to apply these when you graduate?

I enjoyed elucidating what I hope to learn in my Computer Science program and how I plan to apply that knowledge. In the end, I came up with the following goals for my education and my career.

What I want to learn about programming

Good software design
In order to write readable, efficient code, I need to see examples of good code and learn what makes it good. I plan to study algorithms, design patterns, and best practices to learn how best to solve common programming problems.
Alternative programming methods and languages
If I only learn about common solutions to problems, I could never discover new solutions. That's why I'm going to learn about some of the more obscure and academic regions of software development, including functional programming, declarative programming, and other programming paradigms I don't even know about yet.
Low-level programming
I know that if I want to create truly groundbreaking software, I won't be able to rely on high-level languages and pretty abstractions. I'm going to learn about Assembly language and C in order to increase the efficiency of my own applications and to create entirely new OSs and languages.
Writing concurrent code
One of the safest bets in predicting the future of technology is that future computers will have an increasingly large number of processors. Applications that can't take advantage of multiple cores will soon be surpassed by programs that use concurrency effectively. I want to be on the winning side, so I'm going to learn to write concurrent applications with STM, Erlang, and *shudder* even threads. I believe knowledge of concurrent programming will be critical to many of my future projects.

How I will use my programming skills

Creating useful software
I have resolved to never work on an application that doesn't do something useful. Innovative code is nothing if it's part of a worthless piece of shovelware or a soulless enterprise application.
Making my software intuitive
I'll also try to make all my programs intuitive and easy-to-use. When I can, I'll put the needs and wants of the user first, before application structure, technological achievement, and even code readability, although I hope I never need to make that choice. I want my software to make a difference; it's rare that an application or library with an arbitrary, complex interface changes the world.
Improve the process of programming
I plan to work on projects that will not only serve typical computer users but also help other software developers. My goal is to make it easier for coders to write readable, efficient, correct code and create helpful, intuitive interfaces for their applications. I want to leave programming in a better state than I found it.
Explore new technologies
Memristors. Quantum computing. Optical processors. Biological computers. All these rapidly-approaching breakthrough computing technologies will require new programming methods to match. I will always be looking for opportunities to push the field of programming in new and exciting directions.

I know that I may not be able to learn all that I plan to learn, and I might not accomplish all that I hope to accomplish. However, writing out my programming goals has helped me to realize precisely what aspects of programming I find most interesting and important. I think every college student should list his education and/or career goals, if only to provide a derisive laugh or a grin of satisfaction when he reaches the end of his career.

Monday, February 8, 2010

Broward College engineering club

This semester, I have decided to participate in Broward College's engineering club. Each semester, Professor Rolando Branly gathers a group of students from the Physics classes and labs he teaches to work on an engineering project. Last semester, he and his group built a mockup capsule for low-gravity research in cooperation with Masten Space Systems. This semester, we have a more concrete project.

Professor Branly is working on securing a slot on the last shuttle mission for our experiment. We will be attempting to crystallize proteins in space!

The plan

Of course, the process begins long before the shuttle launches and ends long after. Here's a brief summary of the process.

Choose target proteins
Professor Branly has already narrowed our options down to a few proteins related to metabolism and diabetes research, but we still have a couple options. PPAR gamma is our leading choice.
Manufacture proteins
Once we've found a protein of interest, we need to acquire enough with which to work. Hopefully, we will be able to outsource this step to the chemistry/biology department, but if not, we'll need to genetically engineer a colony of E. coli bacteria to churn out our protein. Then, we must isolate the protein from the bacterial solution.
Crystallize proteins
This promises to be the most difficult and complicated step. We plan to send the proteins to the International Space Station on the last Shuttle flight, let them crystallize in anti-gravity for about two weeks, and retrieve them on the return flight of the Shuttle. Unfortunately, protein crystallization is a developing art known to few and mastered by none — Professor Branly calls it a "black art." We'll test many different solutions and methods here on Earth to try to find the perfect setup.
Shoot x-rays at our protein crystals
If we can successfully crystallize some proteins, we will analyze the crystals through a process called x-ray crystallography. In brief, we will shoot a laser of x-rays at a rotating protein crystal and record the diffraction pattern of the x-rays. I'm not sure whether we will be imaging the crystals ourselves or sending them off to a specialized facility for examination.
Analyze diffraction patterns
Finally, we're going to analyze the x-ray patterns with crystallography software. We'll use either Phenix or CCP4 to convert the patterns of x-ray dots into 3D models of the crystallized proteins. These models will allow drug companies to create molecules that can enhance or inhibit the functioning of the proteins in human cells.

Engineering club information

If you want to join the club or help us with our project, you can join our Facebook group, email our coordinator, Professor Branly, or visit our new website, BrowardEngineering.info. We'll need all the help we can get!