So what's going?

  • Taking Chances (Kate Micucci)

    February 3rd, 2010

    This is a great cover of Taking Chances by the G4TV nominated #1 Female Comedian of 2009. Enjoy =D

  • I don’t like Haikus

    February 3rd, 2010


    I don't like Haikus
    because they put restrictions
    on my sentences.

    Because seriously, how can you even write anything meaningful through this type of writing structure?

  • Recovery.Texas

    February 2nd, 2010

    This is an attempt at visualizing the amount of money distributed to Texas via the Recovery.gov program as of (last) November.

    Recovery.Texas

  • Best Hello World App Ever :D

    February 1st, 2010

    Written in Python :D

    See http://failboat.me/2009/cute-functions-creating-pseudo-operators-in-python/ for more details.

    #Hello World
    
    class Operator(object):
        def __init__(self, func, count=2):
            self._func_ = func
            self._args_ = []
            self._count_ = count
        def __ror__(self, first_arg):
            self._args_.append(first_arg)
            return self
        def __or__(self, arg):
            self._args_.append(arg)
            if len(self._args_) >= self._count_:
                return self(*self._args_)
            else:
                raise RuntimeError("Incorrect number of parameters")
        def __call__(self, *args, **kwargs):
            self._args_ = []
            return self._func_(*args, **kwargs)
    
    def alpha(letter):
        @Operator
        def _alpha(a,b):
            return a+letter+b
        return _alpha
    
    for c in range(65, 122):
        globals()[chr(c)] = alpha(chr(c))
    
    print "H"|e|"l"|l|"o","W"|o|"r"|l|"d"
    
  • Lua Tutorials -> Luatut.com

    February 1st, 2010

    A new set of Lua Tutorials are coming out.

    Lua Tutorial

    http://luatut.com/

  • Lua Function Overloading

    December 28th, 2009

    This script will allow you to overload functions based on the type of the parameters passed in. For example, the following

    function asdf()
    	print("A")
    end
    
    function asdf_number(x)
    	print(x)
    end
    
    function asdf_number_number(x, y)
    	print(y)
    end
    
    asdf()
    asdf(3)
    asdf(3,4)
    asdf(4,5,3)
    

    Actual Source code:

    function string.split(t, b)
    	local cmd = {}
    	local match = "[^%s]+"
    	if b then
    		match = "%w+"
    	end
    	if type(b) == "string" then match = "[^"..b.."]+" end
    	for word in string.gmatch(t, match) do
    		table.insert(cmd, word)
    	end
    	return cmd
    end
    
    local __types = {number=1, string=2, table=3, boolean=4, ["function"]=5, ["nil"]=6}
    
    local _mt = getmetatable(_G) or {}
    _mt.__newindex = function(self, key, val)
    	if type(val) ~= "function" then
    		return rawset(self, key, val)
    	end
    
    	if not self.__registry then self.__registry = {} end
    
    	local keys = key:split("_")
    	local fn = keys[1]
    	local types = keys
    	table.remove(types, 1)
    	for _i, type in ipairs(types) do
    		if not type then
    			self.__registry[fn] = {[0]=val}
    			return rawset(self, key, val)
    		end
    		if not __types[type] then
    			return rawset(self, key, val)
    		end
    	end
    
    	local o_fn = rawget(self, fn) or function(...) return arg end
    	local n_fn = function(...)
    		local args = {...}
    		for i, _type in ipairs(types) do
    			if type(args[i]) ~= _type then
    				return o_fn(...)
    			end
    		end
    		return val(...)
    	end
    	return rawset(self, fn, n_fn)
    end
    _G=setmetatable(_G, _mt)
    
  • College.

    December 12th, 2009

    Sorry folks for the lack of updates recently, but I had been busy. For those of you who don’t know, I’m currently a Senior in High School. Around this time of the year, one particular issue becomes the center of occupation for all of us. College Application.

    If you are lucky enough to be accepted on your early decision, then you are home free; however if you’re not, then you’ll have to go through the rigorous schedule of balancing your grades out with Regular application.

    How do I tie into this?

    Ever since I was a little kid, I had just one dream, to go to an Ivy League school. At the time it seemed farfetched, and even now I still do not believe that I have the intellectual maturity to be part of such an elite group of scholars. But I tried my hardest nevertheless, forever reaching out to that dream.

    Read More

  • Free Google Wave Invites

    December 8th, 2009

    Somehow, unbeknown to me, my wave invite queue suddenly racked up over twenty invites, so for the very few of you out there who still haven’t found an invite yet, this is yet another opportunity to score. Just post your email and I’ll fit as many people in as possible.

  • Infovisualization: The Age of Our Senate

    November 7th, 2009

    Age of Senate

    I have always wondered whether there was a correlation between party and age. It just turns out that I had some free time so I pieced together a small program that automatically generated the above infovisual. (Please click on it and zoom in, the picture is actually very large) Enjoy.

  • Gettings the most out of your bits

    November 1st, 2009

    The following will produce the bit representation of an ord(byte) in python

    def bit(chr, i=0, str=''):
        if i > 7: return str
        coef = (2**(8-i-1))
        if chr >= coef: return bit(chr-coef, i+1, str+'1')
        return bit(chr, i+1, str+'0')
    

    Example

    print bit(ord(“a”))
    01100001