Here you will find a collection of things I've worked on or found interesting and worthwhile to post. There is some poetry and other written works, as well as projects and programming thoughts/ideas/tips.

Function Closures in Python

So today I used my first function closure in Python. I had always wondered why/how someone would use them, but today after reading an article earlier this morning I ran across a place to use them while coding this evening. Here we go:

Sync your iPhone/iPod to Multiple Computers

One thing that I don't like about the way iTunes handles things is thats not multi-computer friendly. I have my desktop running windows, my macbook and my iPhone. And I want the music on them to be the same, all three of them. Now before today, and really I should have googled this before today, I had always just been faced with the "Do you want to sync with this computer? Doing so will erase all the files currently on the device." message which I clearly didn't want to do. Then today, after finally googling the problem I came across the answer.

Tight Convex Hulls: Who Are My Neighbors?

In one of my research projects we have a set of points on a two dimensional plane that when given a single point from that set we want to be able to know who its "neighbors" are. For our work we have the mesonet stations spread across the state of Okalhoma and we want to be able to select the neighboring stations. There are a couple of methods that are intuitive but require setting a parameter, something I'm not fond of. Also we have the concept of multiple levels of neighbors, so my first neighbors, my second neighbors and so on.

Another Thing I Dislike About MatLab

Every so often I try to write some code in MatLab instead of my beloved Python, it generally turns into a marathon even of trying to get MatLab to do what I know how to make Python do in a couple of lines. One thing that I am missing right now is Python's sort and the ability to pass it in a key function that will be used in sorting an array.

Brittleness in Spatio-Temporal Relational Probability Trees

The Fall semester of 2008 I started my masters at the University of Oklahoma. My first project which has dovetailed with a class and my work as a graduate research assitant has been a study of brittleness in spatio-temporal relational probability trees. Expect to see my class paper up here soon.

So a year and half later I finally put up my class paper.

Generalized Grammatical Evolution

I've got some cool ideas for generalizing grammatical evolution. Expect to see them here as the mature.


So I've run across the issu of tabs vs spaces again and have decided to put in my two cents. A nice overview of the topics is given here, but I disagree with is final conclusion. The topic actually consists of three points:

Python Woes: Decorators Lack Information

Python has a really cool feature called decorators. Which allow you to wrap functions around other functions in a clean way. The classic example would be the @trace decorator which would let us do this:

def sayHello(name):
   print 'Hello %s!' % name

If we define the trace decorator like this:

Python Tricks: AOP Variable-Set Pointcuts

I've been working on a project, a game fight simulator, where I want to watch the value of a variable, say the players health, in a GUI. The tricky part is I really don't want to couple the game logic to the GUI. I want to be able to simply have -= damage be reflected in the GUI with out putting GUI code in the same function. Enter aspect oriented programming (AOP). Now python doesn't have a serious AOP module like Java and its AspectJ or Ruby and AspectR. So no AspectP or PyAspect will save us here.

MatLab Woes: Contour Plots of Scalar Valued Functions of Vectors

So MatLab can be cool at times, and at others rather annoying. So the big deal with matlab is everything should be matrix or vector operations, yet they don't make this particullarly easy, especially those of us who learned to program in other languages that like for-loops. My big grip at the moment is the contour plotting function. It's just annoying. They assume, wrongly, that the only things people contour are multi-valued functions, such as f(x,y). Now this is great, some people do that.


Subscribe to  Glimpses RSS