What Makes a Good Printer Test Page?

I don’t normally think twice about printer test pages. And, to be honest, who does? But I was setting up a new printer at home the other day on my laptop, which dual boots into Ubuntu 9.10 (Karmic Koala) and Windows 7 and couldn’t help but notice that stark contrast between the Windows 7 printer test page and it’s Ubuntu counterpart:

Windows 7 printer test page

Windows 7 printer test page

Ubuntu 9.10 printer test page

Ubuntu 9.10 printer test page

I know which one I find more useful and informative :)

, ,

No Comments

How to check if an assembly was compiled in debug or release mode

I came across this nifty bit of code the other day when looking for a way to do this and, just for fun, thought I’d convert it to IronPython. So I did. And here it is:

import System

def is_assembly_debug_build(filename):
	"""Returns true if filename appears to have been built in debug mode"""
	result = False
	dll = System.Reflection.Assembly.LoadFile(filename)
	customAttribs = dll.GetCustomAttributes(False)
	for att in customAttribs:
		if att.GetType() == System.Type.GetType("System.Diagnostics.DebuggableAttribute"):
			result = att.IsJITTrackingEnabled
	return result

I saved this in a file called diagnostics.py. So using it (you’ll need to be in the same directory as diagnostics.py or have added diagnostics.py to your path – more info can be found here: http://docs.python.org/tutorial/modules.html#the-module-search-path) is simply a matter of doing something like this:

from diagnostics import is_assembly_debug_build
is_assembly_debug_build([absolute_path_to_your_dll])

If you’re interested you can grab a copy of diagnostics.py from http://gist.github.com/206177

Have fun :-)

No Comments

A Meta Keywords Tag Does Nothing for your Site’s Google Rank

Are you fed up with so called SEO experts extolling the importance of meta “keywords” tags on a site’s Google rank? Me too. I therefore created doesgoogleusethekeywordsmetatag.com.

So the next time anyone moans about their site’s lack of a keywords meta tag, you know where to send them :-)

,

No Comments

Recommended Reading for 2009-11-27

No Comments

Updating RubyGems on Ubuntu to Install Jekyll

Having recently read about Jekyll I decided to boot up Ubuntu, install all the bits and pieces and give it a try. However, I fell at the first hurdle when greeted by the following error:

Error installing gemcutter:
gemcutter requires RubyGems version >= 1.3.5

The Synaptic Package Manager reported everything as being up-to-date but only to version 1.3.1. As it turns out, there is another way to update rubygems on Ubuntu, which worked a treat! The rest of the installation was a breeze :-)

If you are interested more info on Jekyll can be found on GitHub.

, , ,

No Comments

Recommended Reading for 2009-10-30

No Comments

Lorem Ipsum Bookmarklet

I often use a couple of paragraphs of Lipsum when testing forms containing <textarea> tags and have had this bookmarklet I cobbled together sitting on my Bookmarks Toolbar for a while now.

Anyway, I thought it might be fun to hook it up to a HTML 5 form to let you customise how many paragraphs of Lipsum you want each time you click it. So that’s what I went and did:

Lorem Ipsum Bookmarklet Generator

Hopefully it’ll save you a few mouse clicks next time you’re testing some forms.

(Please note that the form used in the generator uses the <input type="range" /> HTML 5 tag which currently works best in the latest version of Opera. YMMV when using other browsers).

, ,

No Comments

Nice UX on The Book Depository’s Payment Page

Quite often, when buying books off Amazon, you can sometimes get them cheaper by going to a marketplace seller’s own website. That’s how I came across The Book Depository, where I have bought a few books recently.

One nice UX feature that I like on this site was the way in which they highlight where to find your credit card CVV/security number depending on which credit card you are using:

Visa card with CVV number highlighted

Visa card with CVV number highlighted

The image above shows the security number highlighted on the signature strip when you select Visa from the credit card type drop-down list. Compare that with the screenshot below showing the security number highlighted on the front of the card when American Express is selected:

AMEX card with the CVV number highlighted

AMEX card with the CVV number highlighted

It’s a simple feature really, but nicely implemented.

,

No Comments

Recommended Reading for 2009-09-21

No Comments

How To Reset Your SubSonic 3 ActiveRecord Test Repository For Each Unit Test

When writing unit tests with SubSonic’s new built-in testing for ActiveRecord don’t forget that each time you call the Setup() method on your ActiveRecord object it adds records to any that have already been created. For example:

[Test]
public void Foo_Bar() {
    Foo.Setup(10);
    Assert.AreEqual(10, Foo.All().Count());
}

[Test]
public void Bar_Foo() {
    Foo.Setup(10);

    // This will fail: Foo.All().Count() will return 20
    Assert.AreEqual(10, Foo.All().Count());
}

To reset your test repositories you will need to call the ResetTestRepo() method prior to each test, which can be accomplished easily enough by adding the method call to your test’s [SetUp] method:

[SetUp]
public void SetUp() {
    Foo.ResetTestRepo();
}

[Test]
public void Foo_Bar() {
    Foo.Setup(10);
    Assert.AreEqual(10, Foo.All().Count());
}

[Test]
public void Bar_Foo() {
    Foo.Setup(10);

    // Now Foo.All().Count() will return 10 and the test will pass
    Assert.AreEqual(10, Foo.All().Count());
}

Hopefully this will save you a bit of time, as well as head scratching :p

, ,

No Comments