Archive for the ‘Technical Articles’ Category

HP Laserjet 2600 or 2605 toner: “Replace supplies” is a lie


Thursday, August 20th, 2009

I’ve had a Laserjet 2605dn for a few years. It’s been a pretty good printer, but I’d like to throw it in the bin. But first, if you will:

fraud, n.

1. A deception deliberately practiced in order to secure unfair or unlawful gain.
2. A piece of trickery; a trick.
3. a. One that defrauds; a cheat. b. One who assumes a false pose; an impostor.

It’s no secret that printer companies don’t make any money off the actual printers. The supplies (like toner) are where they make their millions.

When all three of my cyan, magenta, and yellow cartridges in my HP Laserjet 2605 ran out of toner simultaneously (i.e., on the same page), I was immediately suspicious. The printer’s LCD flashed “Replace Supplies” and refused to print another page (even grayscale!) unless I replaced all three cartridges, to the tune of about $300 CAD.

My suspicion was confirmed when I pulled the yellow cartridge and realized it was almost full. The printer ticks a counter every time a page is run through the printer, which has nothing to do with how much toner is actually consumed.

Thankfully, there is a printer setting that HP probably doesn’t want you to know about.

How to use ALL of the toner in your HP Laserjet 2605 or 2600

  1. On the printer itself, hit the big green checkmark button to access the menu.
  2. Select System Setup -> Print Quality -> Replace Supplies.
  3. There is likely an asterisk (*) beside “Stop at out”.
  4. Hit the > arrow once, and the display should read “Override out”.
  5. Press the checkmark to confirm that (the asterisk should now be beside “Override out”).
  6. Back out of the menu. The LCD should now display “Override in use”, meaning, you can now continue printing for as long as you actually have toner in the cartridges (and beyond, probably).

Thank you HP, for providing this “feature”, and for burying four levels into a completely non-obvious menu. I guess they had to call it “Print quality”, because “Not paying triple on already overpriced toner” wouldn’t fit on the LCD. Now we know how they turn a healthy profit on their oh-so-green cartridge recycling program. (“It’s free!”)

HP does describe this feature on their knowledge base. They also strongly recommend against using it, because it may cause “Color matching and other print quality defects related to the absent(sic) of a color.” Ha! Who would have thought. Oh, and–better yet–this feature voids the warranty on the toner you were about to throw out send to HP for recycling anyway.

Yes, printer companies have done this before, and yes, I’m still page flipping mad about it. If this article saves one poor soul the expense of $300 worth of toner cartridges, it’d make my day.

[Photo credit: jepoirrier (flickr)]

Globe and Mail Column on Multiple Monitors


Monday, August 10th, 2009

Harvey Schachter of the Globe and Mail interviewed me for a column on multiple monitors. The article appeared in today’s edition of the paper, and it’s available online as well.

I believe he does give the topic a reasonable treatment, for his target audience. Let me know what you think!

How to Tell Thunderbird to Really Delete Messages From Your IMAP Server


Monday, June 8th, 2009

This quick tip is for Mozilla Thunderbird users who use Thunderbird with an IMAP account, but also use another mail user application (MUA) such as Outlook or webmail. If you’re in a similar situation, you might notice that when you delete messages in Thunderbird, they remain visible in your other MUA, until you exit Thunderbird. This can be especially impractical, for example, when you left Thunderbird running at the office and go to check your webmail from home. All of the spam you deleted in Thunderbird is still sitting there.

Fortunately, there’s an extremely simple solution to this problem. In Thunderbird:

Preferences -> Advanced -> Config Editor…

Search for “expunge”, and enable the “mail.imap.expunge_after_delete” option by double-clicking it. You need to restart Thunderbird after applying this setting.

Here are the before and after shots:

Expunge - Before and After

This setting tells Thunderbird to automatically “expunge” (IMAP terminology for “permanently delete”) any messages that have been deleted within Thunderbird. Otherwise, it just marks the message with a “delete” flag that many other mail clients ignore by default.

The “expunge_after_delete” option should be safe to use; your Trash folder will still work normally. This setting only controls the communication with the email server.

Statistical Testing


Tuesday, May 26th, 2009

Sometimes, when you need some extra confidence in your algorithm, it doesn’t hurt to employ random data and statistics. You may be able to take your testing a step further by throwing literally every input—or at least a random sample of every input—at your program in an attempt to raise an error or unexpected success.

I used this technique today, with a low-level program that accepts structured binary input (including variable length fields, nested records, and some other non-trivial parsing requirements). I had already tested as many execution paths and pathological corner cases as I could design tests for, but I wanted some extra assurance that my program would not segfault or produce unexpected results, no matter what a user might throw at it.

Representative Sample?

Representative Sample?

So, naturally, I threw /dev/random at it.

In a few minutes, I wrote a script to run my program against about one thousand completely random data sets, which, barring a miracle, should have been complete gibberish to my parser. I was looking for program crashes, but thankfully my parser handled all of the random inputs gracefully.

I did get an unexpected result, however: Within the first few hundred iterations, my parser had actually picked out small sections of valid data. Over the thousand-or-so runs, it pulled out six valid values. This looked fishy to me, so I did the math. If my parser was working correctly, the probability of a match was about 1:18,000,000. So, six hits out of a thousand was a real red flag. After all, I can never even win a free lottery ticket.

When I inspected one of the random files that contained the supposed valid data, I quickly discovered a subtle bug in my parser that made it far too permissive in some cases. The bug was easy to fix, but would have been very difficult to spot otherwise.

So, don’t forget to throw some complete rubbish at your programs during testing once in a while.

[ Photo credit: Nice balls by RcktManIL, on Flickr ]

Showing Sub Pages in WordPress


Tuesday, May 19th, 2009

WordPress allows site owners to create “Pages”, in addition to normal blog posts. Pages are simply static content. Most WordPress blogs at the very least have some sort of “About” page, but it’s possible to deeply nest pages and create a rich hierarchy.

Depending on your chosen theme, this hierarchy is (by default) shown on the sidebar. However, that can get unwieldy if you have a complex site structure. One approach I sometimes take is to limit the hierarchy on the sidebar, but display links to the sub-pages on each of the main pages. What do I mean?

Suppose I have arranged my pages as follows (using Permalinks of course!)

  • About Me
    • My Career
      • Resume
    • My Hobbies

Normally, the content section of the About page would look something like this:

About Me

Posted by Ryan Thompson

Content…

But, with just a little template magic, we can tell WordPress to show all of the subpages of the current page.

In your WordPress admin page, click on Appearance -> Editor, and then find the Page Template (page.php) on the right hand side of the page. Then, look for a line like this:

<h2><?php the_title(); ?></h2>

After that line (or wherever you would like the sub pages to appear), add the following line:

<ul><?php wp_list_pages('title_li=Sub%20Topics:&depth=4&child_of=' . get_the_ID()); ?></ul>

Now, your page will look something like this:

About Me

  • Sub Topics:
    • My Career
      • Resume
    • My Hobbies

Posted by Ryan Thompson

Content…

The sub-pages (and the “Sub Topics:” heading) will only display if the page actually has sub-pages, so it is safe to use this code on all pages.

The important bit is the wp_list_pages() call, and the use of get_the_ID() to retrieve the current numeric page ID.

Once you have your sub pages displaying correctly, you’re of course free to apply a style to the unordered list (<ul class=”…”>) to render this particular list in a more imaginative format, assuming you have some HTML/CSS know-how.