Adam Gotterer

Find the secrets to infinite income, and automate it!

While writing out the Prototype XUL documention I came across a nasty little bug that took me a few hours to fix. I will wrap up the documentation tomorrow. If you downloaded the Prototype XUL 1.6.0.2 file anytime before today, please upgrade (the version number has not change).

Drum roll please… After three attempts/failures, I present to you the newest version of the Prototype XUL library! The previous released version technically never worked. It was something I threw together for a Firefox project that only required the basic of functionality (Ajax.Request, utility functions, etc.). I was under the impression that converting the functions that failed due to the known XUL function bug would solve all the problems. Unfortunately this was not the case and under these assumptions more complex functionality ceased to work correctly. This version has gone through a finer examination, conversion and code update to (hopefully) be a fully functional representation of prototype. Hopefully Firefox 3 will have this bug corrected and I wont have to release many future updates. Please post any bug reports, questions or feedback in the comments section, this will help reduce duplication and make my life easier :). Enjoy!

WARNING: I have not fully tested this library!

Disclaimer: This modified version of the Prototye JavaScript framework is in no way affiliated, distributed or supported by Sam Stephenson or the Prototype library project. This library has been modified from its original intended version/use and I take no responsibility for any bugs, damages or problems this library may cause.

Download Prototype XUL

* Most up to date version as of 2/22/08
* Documentation
* Examples

Facebook Logo

Let preface this by saying I actually do love facebook and check it a few times a day. I have followed them as a company from the moment my school was listed, several years ago. There were even thoughts in the past of applying for a job there.

Now to my little rant… These applications are getting out of hand. Mainly the invites and notifications, but most of the applications them self suck as well. This isn’t facebook’s fault, I blame the developers. I get all excited when I login and have a bunch of new notifications. Maybe I got tagged in a new picture? Maybe a new wall post? 9 out of 10 times it was a notification from an application about some nonsense. I have since removed every application except one.

For weeks I have been collecting invite requests. Only recently facebook added a clear all button, but I want to see how many I can rack up. At the time of writing I have 106 application invites. Most of these invites come from people I never speak to or most likely ever will again (not because of the invites). The whole invite process leads me to believe that they are sent out automaticly or are simply part of a “click here to get to the damn application”, in which case they have automatically selected a few people and by the user clicking, it sends to the first 10 or so selected people. My name starts with an “A”. I most likely appear near the top of all of my friend’s lists. I am a prime candidate for application invite hell.

I wont even get into how pointless most of these applications are right now. The only application that I am running is SnowTick, which gives me updates on how much snow the mountains I ride at have gotten. Theres a great development mantra that facebook application developers refuse to follow. MAKE THINGS PEOPLE WANT!

Click the invite thumbnail to see the full list!
Facebook Invite Thumb

  • 0 Comments
  • Filed under: General
  • Startupschwag Logo

    I received my first schwag bag from startupschwag.com last week. Startup Schwag has picked up where Valley Schwag failed and left off. It’s basically a t-shirt of the month club for web 2.0 companies. The first bag I recieved had a mashable t-shirt and a ton of great stickers. The other past shirts have been techcrunch, digg and reddit. The shirt is awesome, it’s printed on American Apparel, it’s comfy as can be and the ink is high quality. Whats really interesting is this shirt is comprised of 12 different colors, which is really high for a tee. If you are as much of a internet geek as I am, every month you will look forward to your schwag bag!

    Startupschwag - Masbale T-shirt

  • 0 Comments
  • Filed under: General
  • I have spent the last few minutes trying to come up with a good excuse to why I haven’t posted in the past few weeks. Early January was excusable. I was snowboarding in Lake Tahoe from Jan 2nd to the 9th. Just before I left my hard drive crashed. I didn’t have time for diagnosis during the holiday season,so I didn’t get around to getting a replacement from Dell until after my trip. After the new hard drive arrived my memory went corrupt. It took several days to figure that out and get replacements. That covers early January,the rest is inexcusable. I made a promise to myself today to get back on track and post more. So here is my triumphant return!

  • 0 Comments
  • Filed under: General
  • I appeared in my second College Humor video today (a hardly working). You can see the back of my head around :48. If you want to hire me to be in any films or videos, please get in touch with my agent.

  • 0 Comments
  • Filed under: CollegeHumor
  • Priceadvance Logo

    The last few days have been database/server optimization and scaling day! Before optimizing any of the default mySQL options we decided to test performance against a number of different database engines to see what would happen. As a side note mySQL wasn’t optimized from the beginning, we decided last minute our other box wasn’t going to handle the load well.

    Lets try every reasonable mySQL engine…
    Since our tables are read only, we tried packing the keys. This had no noticeable effect. With the packed keys we then compressed our core table. We managed to drop the table size from 1.4GB to 1.1GB, which is a pretty significant decrease. This also had no worthwhile effect. Next move was converting the tables over to innoDB. (note: you cant convert compressed tables to innoDB, so un-pack them first :P). My original theory was queries were slow because of table locking, so innoDB would offer us row level locking. That was a wrong assumption and innoDB caused a performance decrease by about 4 fold. The next and last option we tried was MEMORY (old Heap format). A 1.4GB table didn’t fit in the 1.6GB of allocated memory we gave to the engine. It got about 40% of the rows in and tapped out. We ran some queries on the 2.x million rows that actually made it in and the results were decently quick, but this wasn’t an optimal solution on our 2 gigs of RAM.

    We finally gave in and decided to really fine tune and optimize mySQL and Apache. It took about 4 hours to get everything exactly how we wanted it. Right off the bat queries responded infinitely faster. Tomorrow will be judgment day, but I don’t expect to see anymore database issues until traffic increases again. Right now our traffic has stabilized and we have a nice core user base for our beta program. We will now begin phase two of operation save you lots of money, and do a full launch soon…

    The lesson here is optimizing mySQL should be your number one configuration priority in database applications. Apache only needed a few tweaks, but the mySQL defaults are designed for small sites on low end servers. If the configuration ends up being successful I will post the file.

    Priceadvance Logo

    I’m three days late to this post, but Roddy and I launched the beta of Priceadvance. Just five weeks after our Ycombinator interview (we didn’t get accepted). Priceadvance is a Firefox extension that finds better prices for products you are already viewing. Our objective is to cut out the process of doing price comparison research. Instead you should focus on finding products you want while we find the best prices.

    The beta version is only a fraction of what we plan to accomplish with Priceadvance. We did a lot of internal testing and found our software to have a relative low number of bugs, now with over 3,000 installs we haven’t received a single bug report yet. The reason we released early was so we could determine if market for this type of product existed and if it did, what were the expectations. If 90% of the feedback we received was negative we would most likely be moving on to the next project.

    When the idea for a Firefox extension first presented itself, we predicted the number one barrier to use would be the download/install. Our analytics show that around 40% of the visitors that went to Priceadvance.com installed the application.

    One of the big unknown’s for us was what to expect as far as traffic. All we knew was we needed a dedicated box, mainly for customization reasons. We leased one from Layeredtech with decent specs (something like 1.8 Core Duo, 2 gigs of RAM and a good hard drive). In the first 24 hours after launch we landed on the front page of Lifehacker, Mashable and The Consumerist. Over the course of three days our traffic went from zero to over 12,000 page views. A Google search for “Priceadvance” on Monday returned 120 results, almost all of them unrelated to us. A search now returns over 3,000 results.

    Working full time on CollegeHumor and Bustedtees has given me a substantial amount of experience in building applications that scale. Priceadvance is running a custom PHP framework, a “somewhat” optimized mySQL database using MyISAM tables and a Memcached cache layer. Even with my experience at CollegeHumor, we very rarely query tables with rows in the millions. The Priceadvance database has several million rows and appears to be our biggest bottleneck. Thankfully our server hasn’t been totally killed at any point, but slow response times are common. As I’m writing this, I’m killing slow queries.

    We’re not positive what the answer to our database problem is. We are in the process of converting all our tables over to innoDB to test for the next day or two. Our queries are pretty simple and one theory is that the table level locking is what’s holding us back. If the innoDB experiment doesn’t work we may try Heap tables. If all of this fails, we will split the tables into several smaller tables and devise a mapping system for requests. We are also looking into adopting the Google server methodology and dumping our expensive machine in exchange for 2 or 3 lower end boxes for the same price. With all that said, I’m sort of glad we are having scaling issues only three days in.

    So far this has been an incredible experience. Everything from the Ycombinator interview (I will write about that someday) to a friend telling me Priceadvance was the talk of his office. Take a look at the site; we appreciate all feedback, suggestions and comments.

    I wrote a class to deal with preference handling in the PriceAdvance Firefox extension. I found the Mozilla documentation to be difficult to understand. So, I decided to share the class. Theres a little bug in Firefox that took me two days and borderline suicide to figure out… Extensions can have a default preference file that you can query using the preference interface. These preference files are “magically” loaded from a very specific file folder/location - “defaults\preferences\xxxxx.js”. To set a preference you simply put “pref(”branch_title.variable_name”, value);” in the file. If you use the class I made these preferences can be accessed like this: “Preference.getPref(”variable_name”)”. Now the bug I found is with the way you configure your extension. If the extension is bundled and installed “properly” it will work without a hitch. For development purposes I have my extension using a pointer from the extension folder to another folder location where I do all the work. Apparently when its setup as a pointer it wont load the preference files. Whats really annoying is theres no way to verify if the magical files have been loaded or not. Because of this I have avoided preference defaults and use my own variables class.

    Preferences = {
    initialize: function() {
      this.prefs = Components.classes['@mozilla.org/preferences-service;1']
      .getService(Components.interfaces.nsIPrefService)
      .getBranch('extensions.branch_title.');
     
      this.prefs.QueryInterface(Components.interfaces.nsIPrefBranch2);
    },
     
    getPref: function(name) {
      var type = this.prefs.getPrefType(name);
     
      if (type == this.prefs.PREF_STRING)
        return this.prefs.getCharPref(name);
      else if (type == this.prefs.PREF_INT)
        return this.prefs.getIntPref(name);
      else if (type == this.prefs.PREF_BOOL)
       return this.prefs.getBoolPref(name);
    },
     
    setPref: function(name, value) {
      var type = this.prefs.getPrefType(name);
     
      if(type == 0) {
        if(typeof(value) == 'number')
          type = 64;
        else if(typeof(value) == 'string')
          type = 32;
        else if(typeof(value) == 'boolean')
          type = 128;
      }
     
      if (type == this.prefs.PREF_STRING)
        this.prefs.setCharPref(name, value);
      else if (type == this.prefs.PREF_INT)
        this.prefs.setIntPref(name, value);
      else if (type == this.prefs.PREF_BOOL)
        this.prefs.setBoolPref(name, value);
    }
    };
     
    // USAGE:
    Preferences.initialize();
    Preference.setPref('this_works', true);
    alert(Preference.getPref('this_works'));
    /******************/

    To view preference variables that have been set, type “about:config” into the address bar and filter for your branch.

    Earlier this week I was out to lunch with a College Humor colleague. He happens to be the only Connected Ventures employee with a kid. We got talking about toys. He told me his son plays with Ghostbusters and Thomas the train. Has the toy industry really not done any innovation in the last 20 years to capture kid’s attention?

    I was on the subway heading uptown to meet a friend and I saw a billboard for this new TV series about the Wizard of oz. From the billboard I gathered it would be about the other side (not Pink Floyd) of Oz. Maybe it’s about what the tin man’s favorite drink is, or that the lion was nailing Dorothy on the side? Either way, it’s interesting that so many years later that’s what people are still into.

    Year after year the top rated rock and roll songs are from the 80’s. The coolest cars are from the 40’s to 70’s. People collect just about anything that’s old, it obvious that is has some value to someone. What it comes down to, is a lot of the things we grew up with are still awesome today. My question is, in 20 years will we look back at things from this time and think the same way? Because there a very few things that I have recently discovered that are leaving a lasting impression. But I will never forget the first time I got a plasma screen TV, it must have been a similar experience to what it was like to get a color TV.

  • 0 Comments
  • Filed under: General