XBRL

XBRL

Jul 09

The XBRL spec will put you to sleep. In any case, I’m making an XBRL parser in ruby. Yeah, we already have xbrlware community edition, but it’s artificially limited and I didn’t want that, so I’m building my own. Also, xbrlware represents the entire taxonomy as a Ruby class. I am going to make mine a little more generic than that.

Apr 17

You might’ve heard about the CAP Theorem. It says that when building a distributed system, you’d like to guarantee 3 properties – Consistency, Availability, and Partition Tolerance – but that you have to pick two, because you can’t have all three at the same time.

Today I’ve invented DRC Theorem™.

  1. Dog
  2. Rain (and therefore mud, at least in Lubbock)
  3. Clean Carpet

Pick two. You can’t have all three at the same time.

Nov 14

It’s important to note that the prototype is “live”. Objects are passed by reference in JavaScript, and therefore the prototype is not copied with every new object instance. What does this mean in practice? It means that you can modify the prototype at any time and all objects (even those created before the modification) will inherit the changes.

— Using Prototype Property in JavaScript

To Over-Engineer is Human

To Over-Engineer is Human

Nov 07

The title is a play off of a book named To Engineer is Human and it seems especially true among software developers.

As an example of over-engineering, imagine a civil engineer, who needing to build a bridge, builds a bridge-building machine, and then being unsatisfied that the bridge-building machine can only build one type of bridge, then sets out to build a bridge-building machine generator (i.e. a machine that produces bridge-building machines).

I did that recently; not the bridge builder, but the software equivalent.

I’ve been working on a user interface prototype for my stock screening application. Since it’s a web-app, the UI (i.e. user interface) code is all in JavaScript. JavaScript doesn’t have a traditional class system like other object-oriented languages, so I set out to build one.

I built one that was built upon another JavaScript library called ExtJS. The system worked, but I wasn’t satisfied because my class system wasn’t as simple to use as the class system that John Resig recently released. So, I’ve been thinking and experimenting with different ways of building class systems, because I don’t want just any old class system, I want the easiest, fastest, smallest, best JavaScript class system.

What I came up with is hideously complex and it took me hours to code and debug.

Fast-forward to yesterday. Google released a javascript library that looks very nice, is simple to use, is very well documented, and is proven (on properties such as gmail.com, Google Calendar, and other google apps). So I  think I’m going to scrap the complex class system and instead go back to something more JavaScript-esque, and simple to use, and use it along with Google’s javascript library.

Hopefully I can keep from over-engineering this thing again. I’m going for simplicity and minimalism this time.

PhD

PhD

Jun 02

Today I talked with my advisor again about the PhD program. I think this is the strongest I’ve felt about pursuing the PhD.

It turns out that my master’s thesis is going to be a comparison of stock trading strategy simulator implementations—one written in C++, and one written in SequenceL.

Euler Totient in Clojure

Euler Totient in Clojure

Jan 29

Here’s my attempt:

(defn gcd [a b]
  (if (= b 0)
    a
    (recur b (rem a b))))

(defn totient [n]
  (if (<= n 1)
    1
    (loop [i (- n 1) a 0]
      (if (> i 0)
        (recur (- i 1) (+ a (if (= (gcd n i) 1) 1 0)))
        a))))