A little turkey day coding!

Monday, December 1st, 2008

So what does any self respecting programmer do when he finds himself awake at 2am after Thanksgiving?

Do some coding of course!

In this case I decided to finish up that holiday shopping budget I had been putting off. Using this simple little javascript application you can tell exactly how much you can afford to spend on each person.

http://lab.coderjoe.net/holiday-budget/budget.html

Just choose your overall max budget, enter the names of all those people you will be giving gifts to, and rate them on a scale from 1 to 10!

Easy as pie.

Happy Holidays!

FreeRice.com and Automaton

Monday, November 19th, 2007

I had recently become aware of a website named FreeRice.com. This site provides a vocabulary game where one identifies synonyms for words with an ever increasing difficulty. Since I could always use a better vocabulary the site intrigued me. I played the game for a few hours but was in no way satisfied with my progress. At roughly one correct answer every two seconds I’d rank up 18,000 grains of rice an hour. Unfortunately, once I reached the higher levels I was averaging only 3 out of every 4 questions right.

While 13,500 (75% of my estimated optimal efficiency) grains of rice is a lot, it was nowhere near satisfactory. After joking about my “horrible rice metrics” at work, I mused that I should write a Greasemonkey script which would play the game better than I could possibly hope to. As the rest of my work day rolled on I became more and more intrigued by the idea. There was absolutely no reason why I couldn’t write a very simple AI to play the FreeRice.com game.

Were there reasons why I shouldn’t?

I knew the most obvious reason:
This wasn’t a controlled experiment. If the script spun out of control and was allowed to play over and over I could risk exhausting FreeRice.com’s funds.

Because I didn’t want to be responsible for the downfall of a potentially lucrative source of food for impoverished children I initially abandoned my bot. Despite my fears, curiosity eventually got the best of me and I began implementing my bot. I started by implementing a simple timing method limiting page requests to once every 10 seconds for debugging purposes, just in case.

(more…)

Experts Exchange Encryption

Friday, August 10th, 2007

NOTE: The methods listed below are no longer necessary! Experts Exchange has moved to providing the answers in plain text at the bottom of the page. Just look past the first set of “answers”, past the advertisements and link farm, and you’ll see them.

What is Experts Exchange?

If you’ve ever tried to look up some sort of technical information on the internet, you’ve likely come across the Experts Exchange. Experts Exchange is a site on which people can ask questions about a variably infinite number of technical topics and receive a range of answers from experts purported experts.

The site then allows the user to select a “best answer” earning the answer’s author extra points. Points can be redeemed for a better type of account and access to other things on the site.

In this way the site is user supported, without the experts there would be no exchange of answers.

What’s your problem with Experts Exchange?

As an incentive to sign up, the questions asked on experts exchange are visible to all, however, the answers are obscured in two rather tricky ways.

  1. The answers are obscured by a transparent gif with alternating pixels of solid and transparent, making the words a fuzzy haze.
  2. The answer text itself is encrypted using a basic and fairly famous encryption scheme called Rot13

As a person just looking for the answer to my question I’m often frustrated by the number of times I stumble across an experts exchange thread which might answer my question, but is obscured.

What are you going to do about it?

Well I hate to be bothered with unnecessary prompts to log in as much as the next guy. With that in mind, I present to you:

The Unhide Experts Exchange Greasemonkey Script

This script does what it says, it removes the image which blurs the answer text, and then Rot13 decrypts the answers for your viewing pleasure.

As the title implies, you will need to be using Firefox, and you will need the Greasemonkey plug-in to use this script.

Will this destroy Experts Exchange?

For those of you worried that this might just ruin the Experts Exchange, fear not. In their infinite wisdom they decided to completely omit the “selected answers” for the questions unless you’re logged in.

In this way there is still incentive to get an account and contribute!

In addition, I do not believe that my little Greasemonkey script will ever gain enough momentum to offset a significant portion of potential Experts Exchange visitors. If it ever did, all they would have to do is change their cypher or insert dummy text.

Any change to the cypher algorithm will be taken as a hint. (Also I’m way too lazy to implement anything other than rot13 instead of just logging in.)

However, if you’re as lazy as I (or rather as lazy as one needs to be to write a Greasemonkey script to avoid logging in…), and would prefer not to manage yet another user name and password combination, you may use the script above.

Note: The Greasemonkey script was updated on Sunday August 12th at 1:00am. It now properly takes care of the <br> characters that they do not rot13.

On Javascript and Object Extention

Monday, July 2nd, 2007

I find myself doing more and more Javascript development as the days go on, and while I do not consider myself an expert on the language, I do consider myself well versed enough to get things done the right way.

More often than not my solutions will involve heavy use of the Prototype.js library to make my life a little bit easier.

I won’t be shy, I love this library. I love that it isn’t based on XPath, and I love that it provides me with common extensions to common objects to make my life easier. It would seem, however, that there are quite a few people who disagree with me.

Following the Rails Spinoffs mailing list (a hangout for users of Prototype and Scriptaculous alike) I came across a post entitled “Why I Don’t Use the Prototype Javascript Library“. As I’m always willing to be pointed in the right direction when I’m doing something wrong, curiosity got the best of me and I checked the site out.

I’ve got to say, I’m quite surprised at the number of times I hear the arguments presented in this post.
To be honest, I don’t really understand what the problem is.
(more…)

Updated RND Benchmarks

Saturday, August 12th, 2006

Since the original author was curious about the results from my updated benchmarks here they are. I will only report results from test-fixed.html as I do consider test-unfairdom.html to be unfair in favor of the dom example. Then again I did make it so you already knew that. ;)

Read on for my results!

(more…)