May 15

AB Split Testing scripts for websites


There are several big name services for split testing website and they are all services which you have to pay a monthly fee.  Would you want a script you could install on your websites that can give you metrics just for 2 pages?

This script I designed work using javascript and php.  You can have two versions of an index.php file such as index1.php and index2.php.  One of the two files is randomly rendered upon visit, a timer starts, and any time the visitor clicks a link, button, or exits the page, an entry is recorded.  This entry includes amount of time the user has been on the page and which link or button was clicked.

You can even choose to show the same page version to returning visitors which is done by a cookie.  The results page shows you two columns per day or per cumulative time with the following:

  • Click through rate
  • Total visits
  • Amount of links clicked
  • Average visit duration
  • Amount of new visitors
  • Amount of returning visitors
  • Amount of bounces

Continue reading

May 4

Attending a Hackathon

Tom at hackathon

This was about the biggest hackathon in the east coast or possibly in the entire nation with a record amount of attendees in the hundreds.

Only 160 teams presented with teams ranging from 1-4 people. For me it was my first one and I was a bit skeptical at first.  Prior to this I’ve heard of companies holding hackathons and wondered about the benefits.  I thought about it and realized that it is similar to crowd-sourcing so it mainly benefits the host but what’s in it for the developer/hacker?

You get a variety of developers coding for an extended period of time at no additional pay to create something the host can sell or profit from.  In return the host will provide snacks, pizza, and beer!  Wow… not really, this just makes viable sense for the business hosting the event.  Okay so there’s really more to it depending on the size of the hackathon and the benefits for the developers can be equally beneficial.  I can tell you the two essential things you should check for:

  1. Sponsors offering prizes, preferably cash to implement their software.
  2. Press such as journalists, preferably with a camera.

Another consideration is whether you have the rights to keep your code, which you totally should, and I wouldn’t bother attending one that strictly prohibits this.  Continue reading because you will find out that you  don’t have to be a level 900 coder nor a black hat hacker.  It is actually possible to win even if you’re a axe-wielding tree hacker or hustler.  There were actually quite a few of those at the Disrupt hackathon, the latter not former.  So when the attendee list is in the hundreds how many presentations do you expect to have and how long should they be?

It boils to down to a quick persuasive presentation, because most likely you won’t have time to fully demonstrate the functionality of your application under two minutes.  Getting the point yet?  It’s the idea that counts and how you present it.  Design is key as well!  Ensure you team up with a designer that will make the graphics and style your web app, because it will get you much closer to winning.  If you’re a solo dev you can use templates, themes, or boilerplates.
hackathon 2
Continue reading

Category: Code, Social | LEAVE A COMMENT
April 20

MyISAM or InnoDB MySQL engine?

If you’re curious about the difference of MySQL engines, here they are.

Comparing and contrasting what MyISAM is and InnoDB. First ISAM is the acronym for Indexed Sequential Access Method, generally it is fast, compressable, and allows full text searching.  Second InnoDB is transaction safe and includes automatic foreign key checking so it’s a bit slower.

The important part is that don’t spend too much time deciding which one to choose, because you can change table type later with the ALTER TABLE statement.  Instead you should focus on optimizing tables for performance such as using fixed with fields versus variable width (varchar).  Now for the technical details.


MyISAM tables are optimized for flexibility and compressionThey can hold upto 256TB of data but are not transactional-safe, meaning if the power goes out in a middle of a write, the data is gone.  This is especially important for financial data.  The schema is flexible so it is good for beginners learning about databases.  Foreign key relationships do not have to be setup for the database to function, however this can cause poor performance and unreliable data.  The simplicity allows lower use of hardware resources and another benefit is the table search ability for full-text.
Continue reading

Category: Code | LEAVE A COMMENT
April 13

Make your website cross-browser compatible

cross browser compatibility

Forget about CSS hacks as they should only be temporary solutions and will eventually break upon browser updates.  You want robust CSS with minimal amount of HTTP calls for the best performance.  So here’s the code using conditional comments adding a class to theelement:

[code]<!–[if LTE 7 ]><html class="ie7"><[endif]–>
<!–[if IE 8 ]><html class="ie8"><![endif]–>
<!–[if IE 9 ]><html class="ie9"><![endif]–>
<!–[if gt IE 9 ]><!–><html><!–>![endif]–&gt;[/code]

The first line gives the body a class of “ie7” if the browser is Internet Explorer 7 or less, followed by lines detecting versions 8, 9, and greater than 9.   Now you can change the styles with CSS code as such:


#header { background-color: yellow; //default rule }
.ie7 #header { background-color: orange //rule for IE7 }
.ie8 #header { background-color: red //rule for IE8 }
.ie9 #header { background-color: blue //rule for IE9 }

I didn’t discover this method so the credit goes to Paul Irish.

Limiting the number of stylesheets you are will improve the performance for a high-traffic website. So keep your media queries for alternative resolutions in the same file.


@media screen and (max-width: 320px) {
.iphones { width: 320px }

Using a media query inside a link tag will actually load the css file and the images in it, even if the display is set to none,; except for Firefox and Opera.

[code]&lt;link href="iphone.css" rel="stylesheet" media="screen and (max-width: 320px)" />;

For browser vendor specific CSS you can speed up your coding time with the web app PREFIXR.  It reads CSS3 styles and automatically applies your rule to work for the main other browsers.

  • -mos- for Mozilla
  • -webkit- for Apple browser Safari
  • -ms- for Microsoft
  • -o- for Opera
April 1

57 Ways To Take Control Of Your Time And Your Life


This is a book review of Jim Meisenheimer’s book 57 Ways to Take Control of Your Time and Your Life.   What a long title, but the book remains succinct in length.

I like how the author redefines time management in this book.  He puts it in a different perspective.  You can not manage time, but you can manage yourself to be more efficient with the use of time.

I really didn’t expect much but a list of tactics used to improve your productivity however this book does more than that.  It goes beyond tactics and includes some strategy, guidelines, and scenarios.  A typical book includes a lengthy introduction, history, inspirations, anecdotes, and even fluff that’s off tangent.  This book does not – it is succinct with almost every page being noteworthy.  It is actually better than a few longer productivity books I could not get into such as “Getting Things Done” by David Allen.

Even though this book focuses around sales talk it is useful for speeding up your day-to-day accomplishments. You’ll find tips  on better planning, delegation, productive traveling, directives, talking with prospects, and semantics.

March 14

Overlay scrolling issues on iPhone iPad


Fixed position prevents iOS devices from scrolling the overlay div.

You are probably here because you were coding a website with overlaying divs and you discovered there’s a scrolling problem in iOS.

This happens in the css position property of fixed-size or fixed position div.  At first you will try the 2-finger swipe on your device and notice nothing happening.  Then you try to re-size the screen with the pinch gesture and scroll again. Am I right?  

I looked it up and this has been a known issue in Safari caused by Apple not wanting duplicate scroll bars to complicate the simplified user-interface. I don’t remember the credit reference for this, but will post it when I find it.

First consider using HTML5 and the meta tags for mobile.

Continue reading

March 7

How to update a MySQL field in a table matrix

matrix table image

This is a tutorial on updating a unqiue mysql field in a matrix grid of elements by using PHP and jQuery.

In this tutorial, we are presuming you are familiar with PHP and MySQL.
This is the example we will use. The scenario is giving users access to special features on movies created by producers. This will be useful in the near future when producers have control of film distribution.

We start with the database design creating four tables.

  1. producers
  2. users
  3. Features
  4. feature_access

Step 1. Import schema

Copy paste the code or import the TEST.SQL file into phpMyAdmin (download file link at the bottom of tutorial).

The USERS and PRODUCERS tables are simplified to id and names. The FEATURES table has a foreign key to link the producer who made the feature. The FEATURE_ACCESS table contains 3 foreign keys, linking the 3 other tables. The additional field we are calling “access” is a BOOLEAN allowing NULL.
If you are wondering why were are allowing NULL values besides 0 and 1, it’s because we want the FEATURE_ACCESS records to exist regardless if they are active or not. More on this later.

Continue reading

Category: Code | LEAVE A COMMENT
February 6

Hacking a Website to See Hidden Content

Have you searched online to find answers but when you find a website with the answer it requires you to login or have a membership account?  That’s a clear tactic to convert a visitor to a member of that website.  Even though I agree it is a useful tactic, but it’s usually executed poorly such as during the first visit of that website.  It’s really annoying when you just want to see that one single page and could care less about any other content.  I am going to show you how to how to remove the overlay so you can read the hidden page content.

First I can tell you based on usability design here is an example of a well executed overlay window. provides great content for free but requires registration and participating to see more.  The reason I think Glassdoor makes good use of this and offers a good user-experience is because it does not require registration upon the initial page visit.  But rather on a second or consecutive page visits of specific areas such as the review.  (Screenshot Bel0w)

This appeared on the third page within  Now here is an example of a poorly executed mandatory registration overlay window on

white overlay blocking


Continue reading

Category: Design | LEAVE A COMMENT
May 16

So You’re a Creative Genius Now What

Creative Genius Book Cover

A motivational and imaginative story to turn your creativity into business

As a creative business man I’ve experienced similar events this book describes. King is right on many levels of working for yourself and breaks down his analysis into witty and understandable wisdom.

In a way it can be considered therapeutic for artists because King explains how it’s possible to go from depression and anxiety into a happy and profitable lifestyle. He claims you have to have a blend of creative and technical skills to succeed which is absolutely true. However he also suggests that you should do all tasks for a project which contradicts his later chapter on multi-tasking where you lose focus and time switching between tasks. This is actually not efficient as most entrepreneurs will tell you to delegate or outsource trivial tasks.

Screenwriting is briefly mentioned and used as a model to build stories for your art or product because it is the story that sells. Then King goes on to communication and learning from mentors but not how to get them. Freelance work ethics are described well and I would hire him just based on how he explains his workflow. As there are fakers, takers, and makers, it is best to be the maker to create substance and be results-oriented. Unfortunately there are many irrational people which don’t know better which is ridiculously accurate.

He describes Los Angeles creative industry, the types of people in it, and what to expect or actually not to expect. What surprised me the most was his refusal to accept and harness his startup fame as a musician but didn’t explain why. As described in the book, his accomplishments were creating videos, albums, and including popular musicians. Two things however were not as ethical such as his massive internet trolling and setting up a booth at a conference for a fake product to get investors. I could only guess that King may have felt unworthy of his temporary fame or felt rebuffed from his trolling.

I enjoyed reading the part about dealing with difficult clients. The funny mantra written for freelancers: “I work in a mental hospital. When he doesn’t like green snake, I hide green snake.”