November 8th, 2007

Firebug can make Gmail slow

I love the Firebug extension for Firefox. It’s one of those few extensions that I actually use every day. I raved about it when I first found out about it, last year, and I still love it now.

I’ve been noticing that Gmail has been pretty slow, recently, but I assumed it was just related to their recent rollout of IMAP support, or their recent UI improvements.

Then, this morning, I saw this message at the top of my Gmail page (image has been scaled to fit blog content area width):
Gmail warning: Firebug is known to make Gmail slow unless it is configured correctly.

The “Fix this” link took me to a Gmail Help page: Firebug can make Gmail slow

Google offers two suggestions:
- just disable Firebug for mail.google.com
OR
- turn off XMLHttpRequest logging and network monitoring

A little while later, I was reading Ben Simon’s blog, and saw that he ran into the slow Gmail problem a couple days ago, as well. It appears that he figured out that Firebug was the culprit, even before Google started showing the warning message that I saw. Ben’s solution was simple:

A quick right mouse click on the green checkmark in the bottom right hand corner of my browser, and selecting Disable Firebug is all it took to get reclaim my browsing speed.

I can’t decide which solution I prefer–Gmail’s selective-disabling approaches or Ben’s total-disabling of Firebug. At first, I thought disabling Firebug completely was just crazy talk. But then I started thinking about it, and realized that it would probably speed up my web browsing in general. I could just enable Firebug on those specific occasions when I’m actively debugging webapps.

But, I often find myself using Firebug on sites that I did not specifically go to for debugging purposes, and it’s nice to have Firebug already loaded and ready to let me hack away. So, I think I’ll start with Google’s first suggestion, and try disabling it specifically for the gmail site. While I’m at it, I think I will disable Firebug on iGoogle, too, since it seems to be very Javascript-intensive.

**Update**:
I just noticed that Firebug lets you specifically set which sites you DO want to use it on, as well as the ones you DO NOT want to use it on. Just right click the little green check mark in the bottom right corner of your browser window, and select ‘Allowed Sites’. That pops up a little dialog, which lets you specify whether to Allow or Block Firebug for each site in the list. Neat.

October 26th, 2007

The *** service could not be started.

When I tried to start my Apache Tomcat application server’s Windows Service, this morning, I was greeted with a lovely error message:

$ net start tomcat5
The Apache Tomcat service is starting.....
The Apache Tomcat service could not be started.

More help is available by typing NET HELPMSG 3523.

Naturally, I wanted to know more about why it failed, so I typed the command that it suggested. The results were not quite what I’d consider “more help”:

$ NET HELPMSG 3523

The *** service could not be started.

Now, this is the point where I’d usually go into a thoroughly-researched, in-depth explanation of the root cause of the error. But, I didn’t bother investigating it any further, because I noticed shortly afterwards that the service actually DID start–just not immediately.

Looking at my Tomcat application debug log, I saw this:

25-Oct-2007 09:16:48 AM: [INFO] Server startup in 30124 ms

Usually, the numbers are a little smaller:

24-Aug-2007 12:08:08 PM: [INFO] Server startup in 15822 ms
24-Aug-2007 01:51:25 PM: [INFO] Server startup in 16736 ms

So, I’m guessing that the Windows Services controller got impatient, when Tomcat took 30 seconds to start instead of only 16 seconds. If I ever get this error message again, though, you’d better believe I’ll post a follow-up with a full explanation. :)

October 15th, 2007

Problems with my HP DeskJet 3820 printer

As previously mentioned, my HP DeskJet 3820 printer worked pretty well, for a while, but had a few issues over the course of its lifetime:

  • It was suicidal! When we first bought it, it kept trying to push itself off the shelf where it sat, whenever we printed anything. The problem was that the clipping mechanism that usually kept the back panel securely attached, was broken.

    I think this may have been why the printer was returned–whoever bought it probably broke that piece, and then returned it, claiming that it was like that already. Why the people at Target would put it back on the shelf in that condition, though, is questionable. Perhaps the person who returned it did not bother to mention that it was broken, so the customer service people at Target did not notice. It was not something obvious–really, it required plugging it in and printing something to see that there was a problem.

    Anyways, we ended up using electrical tape to keep the back panel on, and the printer was happy again. No more jumping off the shelf.

  • It had trouble letting go. I don’t think it did this from the start, but at some point it started having some paper feeding trouble. After printing one page, it’s supposed to completely spit out that page, before feeding the next piece of paper in and printing the next page.

    It had some trouble spitting out the printed pages, though. So, if you were printing multiple pages, you had to stand there and grab each page when the printer attempted to spit it out. If you didn’t, it would start feeding the next blank page in, while still hanging on to the just-printed page, and this would cause the just-printed page to pull back inside the printer and get crumpled up.

    When I looked for official HP support on this subject, I found a couple of relevant paper-jam support pages, but these tips did not help me resolve my paper feeding issues. Here are the pages, though, in case they might be useful for solving someone else’s HP DJ 3820 paper feeding problems:

    HP Deskjet Printers - Preventing Paper Jams on the 3800 Series Printer

    HP Deskjet 3800 Series Printers - Fixing Paper Jams

  • It recently became paralyzed. A few weeks ago, the printer started going nuts, and this error message popped up on the computer screen:”Mechanism Error. The print cartridge cradle cannot move. Please check under the device’s top cover for a paper jam or other obstruction.”There was no paper jam, and no visible obstruction.

    I tried pushing the various cryptic buttons on the front of the printer, which seemed to all have flashing lights next to them. I tried opening the front cover, pulling out the ink cartridges, putting them back in, unplugging the printer and plugging it in a couple minutes later, and so forth. Nothing fixed the problem.

    At some point, during this process, the cartridge cradle did move across from the right side (where it was supposedly stuck) to the left, and back again, but then it gave me the same error message again.

So, was it time to buy a new printer? Or was it simply a matter of needing to clean/lubricate something inside the printer? I googled for the error message, and found several useful sites. Apparently, this is a very common problem, with HP DeskJet 3820 printers, and many resourceful geeks have successfully repaired their own printers.

I found some forums, where people posted their own questions, answers, and links. Here are a couple of relevant threads:

From there, I learned that the “mechanism error” is caused by a buildup of ink in a chamber inside the printer. During normal printer operation, the printer is constantly cleaning the print heads, and the excess ink goes into this chamber. The ink dries, there, and over time a large buildup of dried ink forms. Eventually, this mass of dried ink gets in the way of one of the gears, and causes the gear to break. This is when you will most likely start seeing the dreaded “mechanism error”, if you haven’t already.

I don’t remember some of the details, but when I read about all this, I was left wondering whether my gear was already broken, or if I might still be able to prevent it by cleaning out that ink chamber. I decided to take the printer apart and find out. I figured there was no harm in trying, since the printer was already useless to me in the error state that it was in.

Thankfully, several people have written detailed, step-by-step, illustrated guides to repairing an HP 3820 that is having the dreaded “mechanism error”. Here are some of the ones I consulted:

  • Oprava HP DeskJet 3820 - this page is from the Czech Republic, and the instructions are not in English. However, there are a lot of useful photographs that help to bridge the language gap.
  • Ma 3820 fait du bruit - this set of instructions is in French, and spans 7 pages or so. The photographs are pretty good, but I felt like the words were necessary to complement them. So, I ran each page through Google Translate, an automatic stastical translation service, and was able to understand most of the instructions.
  • Google translation of “Ma 3820 fait du bruit” - Google’s automatic translation did help me to understand a lot of these instructions (along with the photographs), but some of the translation was just horrible! For example, throughout the instructions, they kept referring to the “food”–a very important part of the printer, apparently. It took me a while, but eventually I realized it was talking about the power supply. :)
    Note: I just took another look at the translated pages, and they actually look a lot different now than they did a week or two ago. No mention of “food”, anymore, and a lot of the instructions seem a lot more readable. There are still a lot of things that do not make any sense, but it’s pretty cool to see that Google Translate is constantly evolving!

One of those forum threads pointed me to another set of instructions (this time actually in English). While this initially seemed useful, it got a bit too technical for me part-way through–referring to parts I was not familiar with–and the photos were not as good as some of the ones on the Czech and French instruction pages.

By referring to all three of these instruction pages, I was able to take my printer apart. The ink chamber was quite a mess! I took some pictures, to add to the collective body of photos of HP 3820 guts. I’m not sure if these photos will be of any value to anyone (especially since the lighting and focus are not ideal), but here they are:

Photos of my broken HP DeskJet 3820 printer

I tried to clean the ink chamber, but it was just too much to deal with. Plus, my gear was indeed broken (see photos). So, I decided it wasn’t worth dealing with, anymore. I was not motivated enough to try and do a very thorough cleaning, and getting a replacement gear is bit of a hassle, since you have to order them from overseas.

All in all, it was fun reading the fixyourownprinter.com forums, and taking the printer apart, but now the printer is history. Now, I need to decide whether to buy a new printer, or buy more ink for my Dell J740 printer.

October 5th, 2007

Buy a new printer, or buy more ink?

Epson CX5000v All-In-One (printer/scanner/copier) (320×256) vs

I think it’s time for me to buy a decent printer. I’ve been using cheap printers for years, and it’s getting old.

For several years, this was my routine:

  1. Buy a new cheap inkjet printer for ~$30
  2. Use it until it completely ran out of ink
  3. Look up the cost of ink cartridges (about $50 for color + black)
  4. Whine to my friends and family about how buying ink costs more than buying a printer
  5. Throw the printer away
  6. Lather, Rinse, Repeat

Eventually, I found out that the ink cartridges that come with printers are not nearly as regular ink cartridges that one would buy to replace them. I also kept feeling guilty about throwing away printers that still worked– mainly because it’s bad for the environment (I’ve since learned that there is a designated place at the county landfill for computer hardware. I didn’t know about it back then, though. Not that it matters, throwing it away is still throwing it away, even if they’re just handling the trash differently.).

A few years ago, I got a Dell J740 printer, bundled with my Canon PowerShot S50 digital camera, as part of a very hot deal. The printer was not top-of-the-line, by any means, but it was much better than the $30 ones I had been using previously, and actually printed photos very well.

Unfortunately, when I ran out of ink, I could still not justify spending about $75 for replacement ink cartridges. It was actually a Lexmark under the hood, but it was branded by Dell, and had modifications that made it so Lexmark ink cartridges would not fit properly. So, pricing on the ink cartridges was controlled exclusively by Dell. I didn’t throw this printer away, though, because it really was great for printing photos. I kept it, in the hopes that eventually I could find a good deal on Dell ink cartridges.

However, I never really bothered looking for Dell ink cartridge deals, because I ended up buying another, similar, printer around that time. I was a fanatical Target clearance deal seeker at the time, and, with the help of the Target Clearance Deals thread on Fatwallet, picked up an Hewlett-Packard (HP) DeskJet 3820 for pretty cheap. It was the only one they had left at my Target store, and it happened to also be an open-box returned item. I think I figured out why it had been returned, later on.

The HP printed photos pretty well, but not quite as well as the Dell. The HP ink cartridges could at least be bought from various stores, though, so that became our primary printer for a long time, until just recently. Over the course of its lifetime, though, it did have a few issues, one of which was terminal. So, it’s dead now. I will go into that in more detail in my next entry.

So, I’m looking for a new printer, again. I saw a couple printers on clearance at Target, recently, for pretty cheap:

I was tempted to buy them both, but decided to do some research first. So, I snapped some pictures of them (linked above), so I could look up reviews online, from home. The reviews I found, for both of these printers, were almost all bad. I was still tempted to buy them, because they were dirt cheap and would probably get me by for a while, but I held off on that.

On a subsequent visit to another Target store, I checked out the printers on clearance, and found this one as well:

When I looked that one up, the reviews were much more favorable. But, I couldn’t justify spending $67.98, at the time, so I held off on that, as well.

I decided to do some research on the HP 3820, to see if there was some way I could fix it. I was able to find tons of information about this problem, and various solutions that others had used. I will be posting some more about that in an upcoming entry. For now, you can check out my del.icio.us bookmarks tagged with printers, hp, repair, and diy.

Sooo. At this point, I’m leaning towards buying a slightly better printer than I’ve bought in the past. From all the reviews I’ve read, recently, Epson seems like a good brand to go with.

If you have any suggestions for a quality color printer that prints text and photos well, doesn’t go through ink excessively fast (a common complaint with Lexmarks), and might actually last a long time, please leave a comment below! Extra points if it also functions as a scanner/copier[/fax].

September 14th, 2007

Regular expressions for converting code-indentation spaces to tabs in TextPad

I’ve never been a fan of using tabs to indent my code; I prefer spaces. Writing code is an art form, and when you use tabs to indent, you can’t assume that it will still look pretty on someone else’s machine, or in another application, etc., since tab sizes are platform-dependent and–although usually user-definable–the default size (typically 8 spaces, I think) tends to be much larger than my own 2-4 space indentation style.

However, some of my co-workers indent with tabs, and others indent with spaces. I’ve found that it’s easier for me to avoid inadvertently messing up existing code when I just bite the bullet and use tabs.

So, what follows are a couple of search/replace regular expressions I’ve recently used in TextPad, to make some existing code more consistent, by converting the spaces to tabs in certain relevant locations.


1. Regular expressions for aligning inline comments with tabs

Find what:   \;( *) {2}(\t*)\/\/
 
Replace with:   \;\1\t\2//

Customization: The number 2, in curly braces (above), should be replaced with the number of spaces that are used for indentation, in the code you’re running this on. In this case, the code was indented in increments of 2 spaces. Sometimes I deal with code that’s indented in increments of 4 spaces, in which case that 2 would change to a 4.

Manner of execution: Run via Replace All, repeatedly, until there are no more matches.

Recommended scope: I used it on a very specific block of selected code. Keep reading for the specific format.

When I used this on a block of code that consisted of variable declarations and //-style comments, it ended up making the comment blocks all line up nicely. Here is an animated GIF1 of a series of screenshots, showing how repeatedly running this expression transformed the comments into tab-indented comments that lined up nicely:

animated progression of screenshots showing comments separated from code with spaces, and eventually just tabs (and all lined up nicely)

I’m not sure how useful this will be, in general, because I think I just kind of lucked out when I got the results that I did. I thought it was worth sharing, though, because it impressed me when it produced results that were better than I had actually envisioned. :)

Two important things to note are:

  • The actual variable declarations (beginning of each line) were already indented with 1 tab.
  • There were a consistent number of spaces between the semicolons ending the variable declarations, and the double slashes starting the comments. While this didn’t help them line up, as spaces, it did make things pretty when the spaces were replaced with tabs.

If you’d like, you can see what my TextPad Replace dialog looked like, so you can see things like which checkboxes are checked, etc. Also, please note that in my TextPad preferences, I have it set to Use POSIX regular expression syntax (as previously mentioned, in another TextPad search/replace expression entry, a couple years ago).


2. Regular expressions for changing leading indentation spaces to tabs

Find what:   ^(\t*) {4}
 
Replace with:   \1\t

Customization: As with the first expression, above, the number in curly braces should be changed to the spacing increment used for indentation, in the code you’re running this on.

Manner of execution: Run via Replace All, repeatedly, until there are no more matches.

Recommended scope: It can be used on a block of selected text, the entire active document, or even on all open documents, if you’re brave and somewhat evil. :)


Footnotes

1 Sorry for using an animated GIF. I’d rather not have something constantly flashing on the page, because it distracts, and resembles an advertisement. I would have preferred another solution, but I racked my brain for over two hours, trying to decide how to present this series of 9 screenshots. I didn’t want to alienate readers who might read this using a feed reader that doesn’t support javascript, and I hate making people click through from the feed to the main site–I strongly prefer full-text rss feeds! Laying the 9 images out horizontally or vertically took up either too much space, or required making the images too tiny to read. In the end, this animated GIF seemed like the best portable way to show the effect I was trying to show. I won’t make a habit of using them, though. :)

[return to top] / [expression 1] / [expression 2]