Inspired by the latest Coding Horror post, here’s an code snippet that allows you to implement a password revealer using the Prototype JavaScript library.
Check it out in action below.
I wouldn’t mind seeing more web forms adding this feature for password fields.
Posted in Uncategorized at February 12th, 2008.
View Comments.
I came across JMeter a while back but never got a chance to try it out. From the JMeter website:
Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.
This weekend I was able to test load on my 256 slice which this blog is running on. Here’s what I did:
- Download the binary
You can get the binary here.
- Unzip the tarball/zip file
I extracted it file to /Users/theo/tools/jakarta-jmeter-2.3.1
- Start up JMeter
Go to the bin directory. Run jmeter.sh (jmeter.bat if using Windows) from the command line.
- Create a Test Plan
Just give a name and any description you want for your test plan.
- Create a Thread Group
A thread group allows you to specify the amount of load you want to simulate. Select your test plan from the left Tree view, right-click, and select Add -> Thread Group.
Configurable fields include:
- Number of threads – the number of connections or users you want to simulate
- Ramp up period – the amount of time in seconds to take to reach the number of threads specified. If you choose 0, all of the threads will be created at the start of the test.
- Loop count – you can specify to loop indefinitely or provide a number of times to run through the test.

- Add a Sampler
A sampler is a type of request you want to make. In this example, I used an HTTP request to test load to a web server. It’s good to note JMeter supports multiple types of samplers including web services, JMS, and JDBC. Add a sampler by selecting the Thread Group you just created, right-click, select Add -> Sampler -> HTTP Request.
Configurable properties include:
- Server Name – what the ip or url is to the server the request it to
- Port – the port the server is listening to
- Protocol – the protocol (http, https, etc)
- Method – HTTP method (POST,GET, PUT, DELETE, etc)
- Path – the URL path to request

- Add a Listener
A listener allows you to collect data points and display them in some fashion like a graph or a table. I used the Graph Results listener by selecting the Thread Group, right-click, select Add -> Listener -> Graph Results.
- Run the test!
Now we are ready to run the test. From the file menu bar, select Run ->Start. You will be prompted to save your test plan. You can save it or just hit “No”. You should see data points begin to be plotted on the Graph Result or whatever listener you selected.

I monitored the usage from my slice as well and this is what top showed me:

You can see the 5 threads we specified in the Thread Group taking up 5 apache processes.
- Interpret the results
Tests are worthless without interpreting the results. So, what the heck does this graph tell me? Pretty good documentation can be found here. Basically, given the load scenario we have setup, my slice can handle ~643 requests/minute or ~11 requests/second. I am not sure what kind of numbers I should be getting but these seem pretty good to me. One last thing to note is that JMeter is not a web browser so these metrics don’t include rendering time or execution of any JavaScript.
Overall, JMeter seems to be a great open source tool to test different kinds of load on servers. I look forward to trying it out at work. One last thing I came across is JMeter integration with your Ant build process. Check that out here. I would like to hear about other people’s experiences with JMeter, too.
Posted in Uncategorized at February 10th, 2008.
View Comments.
Thanks to the WordPress plugin found here, I’ve been able to import my old blogger posts to WordPress. So far, it’s looking good!
Posted in Uncategorized at January 27th, 2008.
View Comments.
In the previous post, I quickly created a widgetized blog feed. However, the dynamically generated HTML included links that would open in the same window that the links was on. Under normal circumstances, this is the best user experience. However since Clearspring generates HTML-based feeds in an iframe, clicking on any of the links in the widget caused the page to be rendered in the small, confined space of 300×236 pixels.
I know I could have used document.getElementsByTagName('a') but I was wondering if there was a nicer way to grab all the links on a page. Googling around pointed me to this post. I can get all the links on a page by using document.links, which returns an array of the links on a page as DOM objects. I haven’t tested this on all browsers, but that’s pretty sweet.
Here’s the code in it’s entirety to make all links on a page open up in a new window:
<script type="text/javascript">
var links = document.links;
for( var i = 0 ; i < links.length ; i++ ) {
links[i].setAttribute('target','_blank');
}
</script>
Posted in Uncategorized at January 17th, 2008.
View Comments.
I came across a Clearspring back a months ago when they were TechCrunch’d and more recently, I came across Wigetized.com, made by a fellow slichoster.
I wanted to try out both and I thought it would be interesting to combine the powers of both services.
I created my widgetized blog feed from wigitized.com, created a widget cname, updated my apache2 config, created a new directory, and pasted in the generated wigetized html into a new file. Oh, and I bounced apache2.
And TA-DA! A widgetized feed!
Next step was to create a new Clearspring Widget from this. Clearspring has done a good job of making this ridiculously easy. You have a couple of options of how to create widget (flash, HTML, js, image). I went with HTML since I had HTML was just to provide the URL to the HTML and a name for the widget.
Once I had the widget added to the Clearspring platform, all I really had to do was publish it and now I have a Clearspring tracked widget.
Next, I’ll be interested in see how I can leverage the platform in different ways to make this widget “viral” and what sort of analytics come with Clearspring to help me track its viralocity (did I make that word up?).
Posted in Uncategorized at January 15th, 2008.
View Comments.