Monday, May 14, 2012

Walk DOM and report ID's and Parents

function walkReport() {
$("body").find("*").andSelf().each(function() {
    var parent = $(this).parent().attr("id");
    console.log(this.nodeName+" "+this.id+" and my parent is "+parent);   
});
}

Sunday, May 6, 2012

One Wire On Fire 1-Wire Automation Management Tool

This is a project I'm designing and coding. Far from done as of this post, but I hope to have it reasonably functional by July 2012.

Python: Error Handling

import traceback
def formatExceptionInfo(maxTBlevel=5):
         cla, exc, trbk = sys.exc_info()
         excName = cla.__name__
         try:
             excArgs = exc.__dict__["args"]
         except KeyError:
             excArgs = ""
         excTb = traceback.format_tb(trbk, maxTBlevel)
         return (excName, excArgs, excTb)

try:
         x = x + 1
except:
         print formatExceptionInfo()

Thursday, May 3, 2012

Python: Kill Self

import os
def properExit():
 os.system('kill %d' % os.getpid())

Wednesday, May 2, 2012

my .vimrc

syntax off
set number
set columns=120
set ruler