Sunday, May 9, 2010

Google Wave

Over the next week I will be exploring the Google Wave API. This post starts with embedding a wave in a webpage which will be used to make gadgets and robots throughout the week. For those that may not have seen Google Wave, it allows many people to collaborate on the same piece of work. I currently use wave pretty heavily to plan trips with friends, document the adventures of the D&D game I'm in, and to vote for a place to eat lunch with the other developers at work.

I have high hopes for wave. It may even provide a means for webpages to communicate and save data without using php/asp/etc and a database(other than the php and database that drives google wave). Simply send what you want to communicate to others viewing the site or what you want to save to Google Wave. We'll see how it goes.

I'm having a little trouble getting the wave to appear for people logged in without google wave accounts.

This is the Wave Frame

Monday, May 3, 2010

Irrational Number Storage

Once upon a time, I really thought that programs could one day be represented with the starting position in an irrational number. Since Irrational numbers don't repeat, given enough time we could calculate pi or any irrational number far out enough to get anyone's SSN, or phone number, or the binary code that makes up Adobe Creative Suite 3.

Of course I later realized that it would take more data to store the starting position than it would to actually store the program. In the spirit of the idea, I decided to make a little example.

Binary Pattern to Find:

When I originally thought of this method as a child I imagined finding the pattern for a program in PI, but for the sake of speed, this example uses Fibonacci sequences to generate a string of binary data that doesn't repeat. It's way faster since all you need to do is a simple addition to find the next number, and as you can tell from the pattern finding below, speed is quite important.

I turn each digit of the Fibonacci numbers generated into binary with the following conversion:


For example, the begining of the sequence 1,2,3 gives us the binary string 001010011 so searching for: "100" would give us starint position 5. The idea to is have the same possibilities for "0" as I do for "1", hence 8 and 9. My theory is already off since Fibonacci number sequences have more odds than evens.

After 1400 and some fibonacci numbers, the next Fibonacci number becomes too large to be stored as a double(3.something times e raised to the 308th power is the last in javascript), so I restart the equation with the next seeds. For example, if the first series was 1,1,2,3,5... then I start the next series with 1,3,4,7,11... and then after that gets too large, 1,4,5,9...

Graphing project

Yet another Javascript project. I wrote this a while back, and recently added the canvas element to test out some basic graphing I'm hoping to include in a project for work.

Amortization Schedule Calculator


Interest Rate:

Term of loan:

Monthly Paymnet:


Additional Yearly Payment:

Additional Montly Payment: