the css behind steepster's rating system

if you're looking to build something like steepster's sliders (which uses jquery ui), you can pull it off using technique #4 from this css position guide.

- iterate over a list of scores

- for each score, create a new div, like this:

<div id="tick" style="position:absolute; left: <%= item.score %>px;">&nbsp;</div>

- when you're finished, wrap everything in a container, like this:

<div id="ticks_container" style="position:relative"></div>


so the finished product would look like this in ruby on rails:

<div id="ticks_container" style="position:relative">

<% for item in @items %>

<div id="tick" style="position:absolute; left: <%= item.score %>px;">&nbsp;</div>

<% end %>


calculating the scores could be done with a case statement, or some multiplication and addition.  this is a really cool rating system, big ups to steepster.

learn everything, and then break all the rules

I was an over-confident punk, thinking I had the answer, and everyone else didn’t.

But it worked.

And in fact, isn’t that kind of confidence absolutely required to get anything done?

Isn’t the role of the entrepreneur to be the bold, daring, audacious one? The over-confident reckless one who says, “Screw it. Let’s do it!”?

Yes! Of course! It’s the essential final lesson: that all this learning means nothing until you make something happen.

Derek Silvers on Confidence

hacking jquery's easyslider for faster jumps

easyslider is a terrific jquery plugin for condensing lots of information into a few "slides" that the user can jump to.  demo is here.

the problem is when you have a long list of items to display.  if i have 10 items, and i want to jump from item 1 to item 10, there is a very long delay.  currently, easyslider uses the current formula to calculate how long it takes to do a jump:

var speed = diff*options.speed;

so if there's a difference of 9, it says 9*1000, or 9 seconds for the jump to complete, assuming 1000 milliseconds is your default pause time.

there's a better way to handle this, IMHO.  for example, using the formula below:

var speed = Math.abs(options.speed/(diff/2));

let's use a few examples to show how this is a bit faster.

  • if you jump from item 1 to item 10, your difference is 9.  if you divide by half of that, your jump time is 1000/4.5, or 200 milliseconds.
  • if you jump from item 1 to item 5, your difference is 4.  1000/2 will result in a delay of 500 milliseconds.
i added a check to see if the user clicked on the same item, which can screw up the math a bit:

if (speed > options.speed) { speed = options.speed; } // reset the speed back to normal

you can insert these two lines into the animate function and your jumps will be faster.  the complete function is here on pastie.  as a disclaimer, i threw this together pretty quickly and it's just a quick hack at this point.  i'm sure it could be improved upon and implemented into easyslider.  clearly this particular snippet won't work for abnormally large numbers, like 100.

edit: if the above snippet is too fast, consider trying out this variation:

var speed = Math.abs(options.speed/(diff/(s/2))); // s is the number of items in your list

server hax0rs

i think our rackspace servers got hacked or something the other day, rackspace never really figured it out either.  a quick summary of what happened:

- tried deploying via capistrano, noticed a weird error "/bin/bash: Exec format error"

- tried to ssh in, even as root, and that wasn't working (some random errors and then getting disconnected)

- tried to login via rackspace console, had some issues there (this is when my blood pressure noticeably increased)

- rackspace did a hard password reset, console worked again -- went into rescue mode and mounted sda1 to get back into our server

- databases were nowhere to be found (and i think the site cached everything, so i didn't notice the database was missing to begin with), luckily my co-founder had a 3 day recent backup so my blood pressure plateaued there.  there were random files and users added, so at this point we think someone managed to get into the server.

- found the binary ibdata left in /var/lib/mysql and downloaded that, luckily it was untouched so we lost no data (rackspace only makes server instance backups of 2gb servers, we use 4gb on everything)

- transferred everything to another staging server, and realized the iphone v1.1 was pointing to the original production server ip, so we had to rebuild the production server from scratch.

- had lots of permission problems when we thought it was a much more serious problem, wasted time looking into mysql sockets when all we needed was to fix the mysql privs and re-configure a few things in apache's httpd.conf

- finally got everything working, and still wondering WTF just happened just before going back to sleep

all of this happened from about 3am to noon, and luckily it looks as though nothing ever happened unless you tried using the app early yesterday am ;)

graffiti badges updated

just showing a few of our badges in this screenshot, but i settled on the last row. i thought about using progress bars to represent how far a person has progressed visually, but ended up sticking with just numbers for now.