Archive for April, 2004

It’s Never too Late to Fix Bugs

Time once again to mention my dirty little secret… yes, I’m a Visual Basic programmer. Of course, I also do alot of Perl, and I’ve done my share of Java, but much of the software I’ve written in the past 10 years has been VB, starting with VB3.0 (I did play with VB 1.0, but not for work). My current major project at work is mostly implemented in VB6.0 (service pack 5) because of the requirement to interact with the Excel and Word application binaries.

Why do I bring this up now? Because Microsoft has released Service Pack 6 for Visual Studio, which includes updates for VB6, VC++ 6, and SourceSafe. I took a look at the list of VB bugs addressed by this update, and found a couple that make this upgrade worthwhile for me.

Knowledge Base article 297112, “BUG: Visual Basic Compiler Pads Embedded Resources to Align on 32-Bit Dword Boundaries”, is an old friend of mine. I have an application that makes use of a number of XSLT stylesheets and W3C Schema Defs (XSD). In order to ease deployment issues I decided to load these documents into the app’s DLL as resources. When I tested this, some documents would work, but others would not. At the time (a couple of years ago), this article was not in the KB (or at least, I was unable to find it. Fortunately, I was able to work out the solution on my own. Every now and then, I forget to check the file sizes when build a maintenance release, and run into the problem again. Nice to see it’s finally being addressed.

The other fixed bug that caught my attention is KB Article 312218, “BUG: Deadlock in Multithreaded Process If You Use Declare Statements for APIs in Visual Basic ActiveX .dll Files or .ocx Files.” The short version is this: VB6-authored DLLs which use the Declare statement to access API functions can deadlock things like IIS and MTX. If you’re using such a DLL under IIS, it’s running under one of these two executables. I don’t know how long this problem has been documented, but it may be the answer to many untraceable, non-reproducable issues I’ve had. The problems occur on a production IIS webserver that uses a custom COM component written in VB6 for mainframe access. I think I’ll be putting a new build into production soon. This one really ticks me off, since it I’ve been having these problems for a long time, and since it affects such core techonologies… the ones Microsoft spent so many years convincing me to use (before .NET came along and changed the rules. Again.)

If you, like me, have any ongoing interaction with VB6 or VC++6, give this service pack a look. If not, well, congratulations.

Foxy

Nearly two months after its release, I’m finally using Mozilla Firefox 0.8 on my Powerbook. I’ve been using it on my Win2K box at work since the release, but I had issues under OS X.

Since yesterday, two important things have occurred. First, Arvid Axelsson released the Qute theme for Firefox OS X. I don’t care for the new default theme under OS X, and I think it was a mistake to release 0.8 with a new default and without the theme used on other platforms (Qute). One of the big advantages I find in Firefox is that it’s the same on my Mac and on my PC. By not offering the same default themes (at least as choices), its value as a cross-platform browser is diminished. It’s not completely the same as before; the icons are the same but the tabs look different. Hopefully this will improve.

Today, Shimoda Hiroshi (a.k.a. Piro) released an update to his Tabbrower Extentions, which finally lays to rest the last of the OS X/FF0.8/TBE compatibility issues. TBE has become an such an integral part of my browsing experience that I just refuse to work without it.

So far, the ‘Fox seems to working ok. As well as Firebird 0.7 served me for many months, I was really looking forward to this upgrade. 0.7’s performance under OS X was pretty poor at times. Closing a tab or window could at times take 10 seconds or more. Shutting down the whole app could take minutes. I haven’t noticed performance problems so far under 0.8, but it’s early yet. To be fair, some of the issue I had under 0.7 could have been the fault of TBE; Piro says on his site that the TBE can slow browser performance. At any rate, it never got so bad that I’d consider dropping TBE. In addition to the FF upgrade, Piro’s had a number of releases to TBE in the past couple of months, so hopefully I’ll see improved performance across the board.

The Future is Now

In a move calculated to occupy all my free time, and the free time of Blosxom afficianados everywhere, Rael Dornfest today announced the availability of Blosxom 3.0+1i (aka 3.0 alpha). As Rael put it:

It’s been massively refactored, all but rewritten, object-oriented, and usable as a CGI script, module, or indeed subclassed. Oh, and I’m afraid it’s grown a bit, now weighing in at a massive 15K (slightly less, actually) ;-)

Once I’ve had a chance to play with, I’ll post some thoughts.

Tweaking the Robot Tweak

Recently, I updated my Blosxom template to provide <meta name="robots" value="..." /> tags on each of my pages. The idea is to set the value to "index,follow" for permalinks and to "noindex,follow" for all other pages (i.e., index pages) to prevent category and date archives from being returned by search engines.

It has been bothering me for several days that the side affect of this change is that my blog homepage, http://jclark.org/weblog/ is now marked noindex. This is particularly an issue for me since I normally use the blog homepage URL when posting on other sites, etc. Tonight a comment to that post from Lou Quillio got me to do some checking. It appears that Google Searches for my name that used to return the blog homepage in the top 10 hits no longer do so.

In order to undo this damage, I decided to serve "index,follow" for the blog homepage as well as for permalinks. In order to make this change, I’ve updated my head.html template:

<head>
  <!-- other head stuff like title omitted for brevity -->
  <?$storystate::blogroot>
    <meta name="robots" content="index,follow" />
  </?>
  <?$storystate::permalink>
    <meta name="robots" content="index,follow" />
  </?>
  <?$storystate::archive>
    <meta name="robots" content="noindex,follow" />
  </?>
  <?$storystate::category>
    <meta name="robots" content="noindex,follow" />
  </?>
</head>

As before, this requires Rael Dornfest’s interpolate_fancy plugin and my own storystate plugin. It’s a bit cumbersome, but it works. Now I just have to wait and see if it fixes my Google juice.

Update: Re-enabling the indexing of jclark.org/weblog seems to have done the trick. It’s once again the number 2 result for “Jason Clark” and the number three hit for “jclark”.

More Spanish Resources

Since my previous post on resources for those studying Spanish, I’ve found a few more. Here are some of my favorites:

  • WordReference.com’s Spanish Dictionary - I mentioned in my last post that had not found an English-to-Spanish online dictionary that I like. I’ve finally found one. It’s the online version of the Collins Consise Spanish Dictionary. In addition to providing English translations for Spanish words and vice versa, it also lists common phrases that use the word with translations. A “See Also” list includes words with similar spellings. Unlike several Spanish dictionaries I’ve tried, searching for a conjugated form of a verb returns the infinitive version of the verb. A definition link provides access to full dictionary definitions in the original language. For a good example, look at this entry for the Spanish verb tener (to have).

  • Diccionarios.com - Spanish reader Choan C. Gálvez recommended this dictionary site. The interface is primarily in Spanish (which is good and bad). There are a number of nice features here, including verb conjugations. However, after running several lookups, I started getting a screen that seemed to be requiring a login. I couldn’t translate the whole page, but it looks like this is a pay site with limited free searches per day. For comparison, here’s the entry for tener.

  • Mundo Du - “Short stories, surprising tales” is the subtitle of this Spanish language short story site. Choan is a contributing author on this site. This is just the kind of practice I need… it also shows how much I have left to learn.

  • Cuentos de Cien Palabras - Another literary site, the name says it all - “One Hundred Word Stories”. These seem just the right length for someone like me who has to look up every other word. Thanks again to Choan for the pointer.

  • MiniD.net - This is the blog of Diego Martín Lafuente, focusing on technology and design. It’s a great, clean looking site. The level of difficulty is way over my head right now, but the subject matter is right up my alley. I’ve subscribed to the RSS feed, and I’ll continue trying to read it. This find was true serendipity… I stumbled across this while playing around on del.icio.us. I was looking at who else had bookmarked articles I had bookmarked, and noticed that one entry had Spanish keywords. Looking through that user’s bookmarks list, I found this blog.

Indexing Tweak Redux

Dugh mentioned in the comments of my post on using the “robots” meta tag with Blosxom that he was having some trouble with interpolate_fancy getting everything working, and asked for my template. Since my comments system is still nearly 100% feature-free, I decided to just create a new post.

The goal is to help search engine robots to only index permalinks (individual posts) but not pages containing multiple posts such as data or category archives (or your main page, since the content changes). To do this, we need to add a <meta /> tag to the <head> of each page. For index pages, we need the following:

and for individual posts, we need this:

My solution requires two plugins for Blosxom: Rael’s interpolate_fancy plugin and my own storystate plugin. A word of warning - if you aren’t already using interpolate_fancy, this isn’t a simple drop-in - you’ll have to change all of your templates. For more info, see the interpolate_fancy docs. My storystate plugin simply provides a number of additional variables denoting the state of the current story, for use by interpolate_fancy’s conditional tags. For this application, we need $storystate::permalink, which is true if the current page represents a single post, and undef otherwise. Here’s the relevant section of my head.html flavour template:

That’s all I did. I haven’t seen much change on Google yet, but it’s only been in place for 3 days. Hopefully, as Google reindexes more of my site, all of my index pages will drop off, leaving only permalinks.

Update: The change shown here has a nasty side effect of no longer indexing the blog’s homepage, see Tweaking the Robot Tweak for an improved version that fixes this bug.

Biological Cron Job

For the first few months I had this site, I was very lackidaisical about performing backups. When Sean had problems with his site after his host’s server died, and he had no recent backup, I determined to do better.

My hosting service doesn’t offer shell acess (I’m thinking of switching), but does provide a handy one-click-to-make-a-tar.gz button for creating full site backups. This means I can’t schedule backups automatically, and of course I’m too lazy to setup reminders (especially since I rarely fire up iCal). I make backups when I think of it. Tonight, for some reason, I thought of it. As I retrieved my latest backup, I noted the dates of my last several backups:

jclarkor.011204.tar.gz
jclarkor.021604.tar.gz
jclarkor.032004.tar.gz
jclarkor.042004.tar.gz

I seem to be developing a pretty regular habit of pulling a backup once a month, around mid-month. Kind of like a biological cron job.

I Knew I Was Right - But I Was Wrong

UPDATE: See the end of the post for a retraction. The original post remains for posterity.


Even though I swore off CompUSA several months ago, today I almost caved in. In the end, they just proved me right. You can’t trust them.

I was browsing the sales ads in today’s newspaper, looking for a large harddrive cheap to put in my TiVo. Circuit City had a 160GB Western Digital for $109 after rebate (plus a $20 gift card), but curiousity made me check CompUSA. They had the same drive for $59 after (multiple) rebates. Being that I didn’t see the ad until late in the afternoon, I figured going to the store was probably pointless… they never have much stock on these kinds of offers; they just want to get you into the store. I’ve been bitten many times.

This evening, I decided to see if I could get the rebates if I purchase the drive from their website. I’ve read the webpage and both rebate forms, and I can’t really tell. It all implies that you must purchase from the store in order to get the rebate. Of course, the rebates are only good for drives purchased this week, and only from CompUSA. Tempted, I decided to use the “check availability” feature. Naturally, all 5 stores within 50 miles of me had already sold out. But then I looked a little closer:

Product (un)availability

The highlighted section tells the story: “availability information is up-to-date as of 4/18/2004 3:40:41 AM”. That was before the store even opened on the day the ad broke.


UPDATE: Never let it be said that I can’t admit a mistake. When I posted this Sunday night, I believed that all 5 CompUSA stores in my area were sold out of this promotional item before the promotion even began. On Monday evening, it occurred to me that I should recheck in the interest of fairness. Sure enough, on Monday all 5 stores showed the drive in stock, “as of 4/19/2004 03:36:41 AM”. I can only conclude that they held the items until the sale promotion began, before putting them into stock. To appologize to CompUSA for jumping to an incorrect conclusion, I went today to purchase a drive. They still had it in stock.

A Few Tweaks

I’ve just finished making a few tweaks to the site. Please shoot me an email if you see anything untoward. The updates are mainly for the benefit of search engines. Here’s what I’ve done:

  • Added <meta name="robots" ... /> tags to control what pages are indexed. I’ve set them up so that permalinks (individual posts) should be indexed, but index pages (main page, category pages, date archive pages) are not. This should prevent Google from listing dozens of hits for what is really a single post. For more info, see this old post (which I’m just getting around to acting on).

  • Added the post title to the page title on permalinks. This way, all my hits on Google won’t be titled “jclark.org”. There are a few Blosxom plugins that can do this; I’m using storytitle. I only made one small code tweak to the plugin, to remove dates from the page title on date archive views. It wasn’t implemented correctly (any date link, including year or year/month/day links, put the year and month in the title), and I didn’t feel like fixing it, so I shut it off. The info is at the top of the page, and Google doesn’t need page titles for index pages now (see prior bullet).

Now I just need to setup a robots.txt, at least to prevent downloads (e.g., source code for Blosxom plugins) from being indexed. I still need to add search, but I’m lazy and Googling is so much easier… just include site:jclark.org in my search and I’m set. In fact, I even created a custom Firefox search extension to let me search my site via Google from Firefox’s toolbar search box… but that’s another post.

Page 23

Page 23

  1. Grab the nearest book.
  2. Open the book to page 23.
  3. Find the fifth sentence.
  4. Post the text of the sentence in your journal along with these instructions.

And no, nothing much has changed since then.

Krikorian, Raffi. TiVo Hacks: 100 Indutrial Strength Tips & Tools. O’Reilly and Associates, 2003: 23.

You know, I usually don’t do these me-too-blog-meme things, but I had just been flipping through the book not 5 minutes ago, giving some thought to giving my TiVo a 160GB brain transplant, so I figured, why not? Besides, I’m couch-ridden with a sinus infection, and I’m bored.