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.
Tabs-vs-Spaces
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:
@trace 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 self.health -= 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.
Block the 'Delete goes back' action in Firefox
QUOTED FROM: http://www.macosxhints.com/article.php?story=20070511123925218
Mon, May 14 2007 at 7:30AM PDT • Submitted by cdimara
Python Tip: Tricks for Dict(ionarie)s
Okay, so things everyone should know about dictionaries, they are in the python manual but I still didn't know them until today. First off creating a dictionary in the code (ie hardcoded)
<code>d = dict(one=2, two=3)<br /></code>
This is a simpler way of doing things, and it sure beats having to rember all your quotes when doing:
<code>d = {'one': 2, 'two': 3}</code>
Granted the second way looks cooler! But we have to make compromises. Another cool thing, is taking a list of keys and list of values and turning them into a dictionary:
Python Tip: Swapping Two Objects
So I wanted to swap to objects, and I prefer to write short clean code, especially to carry out simple processes. The idea was that I have two objects, in this case treeA and treeB and I wanted treeA to be the deeper of the two trees. Now the long way would look something like this:
if treeA.depth < treeB.depth: tree = treeA treeA = treeB treeB = tree
Which is a little ugly, 4 lines to reorder something, so there neat trick is that if you want to swap two objects a and b simply use:
a,b = b,a
So the above code becomes:
Writing Test Cases
- You can debug the POSTs and GETs using <code>drupal_set_message($this->_content);</code> which will display the page as a message.
Delicious
Digg
StumbleUpon
Reddit
Facebook