Update:  For those of you interested in getting Global Translator 0.6 to work with FireStats, go here.

 I’ve had several requests from people who use Omry Yadan’s FireStats and want to use Davide Pozza’s Global Translator Plugin, as the two plugins tend to behave poorly together.  For anyone that hasn’t used these two together, what happens is the wrong source page is sent to the Google Translation service, and readers receive either a 404 or a white blank page.  This appears to be a mod_rewrite issue that only affects Global Translator.  Luckily, there is a very quick and dirty fix that will resolve the issue.

First off, I’d like to say that this fix has been tested on both WordPress 2.0.x and 2.1 with FireStats 1.1.0 through to the current 1.1.5 Stable and Global Translator 0.4.1.  I have not updated to the most current version of Global Translator because this one suits my needs just fine.

Now the fun stuff.

There are only two lines that need to be changed in the translator.php file found in your /wp-content/plugins/global-translator/ directory, and in the translate function.

$url_to_translate = BLOG_HOME . ‘/’ . $url;
should be changed to:
$url_to_translate = preg_replace(’(it|ko|zh-CN|pt|en|de|fr|ja|es|ar|//)’, ”, $_SERVER['REQUEST_URI']);

And below that:

$resource = $translator_base_url . $language . ‘&u=’ . $url_to_translate;
should be changed to:
$resource = $translator_base_url . $language . ‘&u=’ . BLOG_HOME . $url_to_translate;

These changes eliminate the $url variable’s use from the translate($lang, $url) function, but the second variable should not be removed from the definition.  This is not a complete solution to the matter, but it’s a quick solution that will work for the majority of sites.

Keep in mind that you need to use “Date and Name based” permalinks and your .htaccess file should be updated acccordingly (this is done by WordPress automatically if the appropriate permissions have been granted).  All of this is outlined in the Global Translator instructions, but it’s a critical component that I’ve seen missed elsewhere.

For anyone that has not used these plugins, I highly recommend them.  The Global Translator is a great way to help foreign visitors enjoy your site (despite the occasional inaccuracies in machine translation), and FireStats will give you a great idea of where your readers are coming from and what browsers they’re using.  This last point is important if you are designing sites to be optimized for certain browsers.

If there are any questions with this change, just drop me a line.  I’ll be sure to offer what help I can.

Update: 

As requested, here is the modified translator.php file that I use on this site.  Please note that this is from version 0.4.1 rather than the current release.

Before using this file, please make sure that your site has the “WordPress should compress articles (gzip) if browsers ask for them)” checkbox cleared.  This can be found in the Options menu, under Reading, down at the very bottom.  Several users have reported that after this is cleared out, Global Stats will work without fail on their site.

Enjoy,

Today I was reading on SlashDot about a promotional problem that Amazon encountered just before Christmas of last year, and their subsequent method of recovering lost earnings from this problem.  At first I found their solution to be wrong, but as I continued thinking about it, I realized that Amazon is partially right to pursue their course of action.

The jist of the problem is this:  Amazon advertised a “Buy One, Get One Free” DVD promotion, and the online shopping cart would glitch when the order was placed, effectively allowing a buyer to get two DVDs for free or a small fraction of the actual cost.  Shortly thereafter, Amazon sent an email to customers asking that they either return the unopened merchandise to them or their credit cards would be charged for the proper amount.  People who did not respond to Amazon’s request had about a month before the company started putting through (what some consider) to be unauthorized charges on their cards.

When I first read this, my initial reaction was: “No.  If Amazon screwed up their pricing, then Amazon should take the hit.”  But then I started thinking about this from a legal point of view.  In many countries, this would be considered theft.

The customers knew that Amazon had a pricing glitch in their system.  Some may have even taken gross advantage of this glitch ordering dozens or hundreds of Box Set DVDs for a fraction of their actual cost.  Many legal systems make it the obligation of the consumer to advise the retailer of this error and ensure it’s correctness.  If the consumer does not let the retailer know, then the store does have the legal right to go after the consumer for the remainder of the proper balance within a short timeframe.

I’m forced to agree with Amazon regarding their recovery policy.  Customers would have seen immediately that two or more DVD Box Sets were incredibly under-priced at the Check-Out.  Why didn’t these people say “Wait a minute?  This is only going to come back to haunt me if I take advantage of this.” ?  Where is the moral compass of the people who may have abused this error?

There are way too many people who think that the world owes them something for nothing.  The loudest shouters are usually the ones who knowingly break laws and agreements for their own personal gain thinking that “big giants like Amazon should take it up the rear” when a mistake is made.  But Heaven forbid someone does the same to these people in a sale.

Some conspiracy theorists believe this was just a tactic by Amazon to boost their bottom line during the busy Christmas season.  However, I see no pattern to this.  Web-based companies have made mistakes before.  We’re all human, and are not impervious to the occasional typo.  While it might have been prudent to have someone test this on the live web server, consumers should know the difference between right and wrong.

Just because we can do a thing, does not mean we must do a thing.  Greed will only consume us.

I feel so bad for the crews manning five Japanese whaling vessels.

It seems that since leaving port the crews have had to deal with super cold weather, constant hassling from a small group of environmental terrorists, and now a fire on their primary ship.

First, I’d like to say “WTF!?!” to the environmental terrorists that have been harassing the people on these vessels.  They call themselves the “Sea Shepherd Conservation Society”, but I think it’s a typo on their part.  I think they meant to call themselves “Unemployable Jackasses From Mars”.  I use the term “terrorist” as a descriptor because of the tactics they employ.  I can’t believe this is a Canadian organization … it just doesn’t make sense.

I can understand that people may not be happy with whaling, considering how we (humans) have been hunting these creatures for centuries to harvest not only for food, but lamp fuel, mechanical lubricant and a host of other uses.  We’ve brought some species right to the brink of extinction in our carelessness, but we’ve learned from our mistakes and many species are begining to make a slight comeback.

Do these life forms deserve to have some kind of protection from us?  Absolutely.

Does this give other humans the right to be retards?  No.

There are ways to accomplish goals in this world, and there are ways to make yourself look like an idiot to the world.  I admit that I look like an idiot quite often, but even I have my limits as to how far I’ll sink in the eyes of my peers.  The fishing vessels that were being harassed were operating on legal permit from their government.  If the Sea Shepherd’s want to raise a stink, they should discuss it with our politicians and request some form of dialog be opened with the offending government.  If these “conservationists” want to send a vessel out to monitor the actions of these whaling vessels to ensure the legal limits are not breached, and no other endangered species are accidentally captured or killed, then so be it.  But observe.   Don’t assault crew members with bottles of acid.

I often wonder where these groups get the money to make all these global trips.  Filling an ocean-going vessel with enough fuel to chase five Japanese cruisers around the Antarctic isn’t cheap.  You’d think the SSCS would send some more intelligent people instead.

I’ll admit that it’s not easy to get governments to listen to the people they’ve sworn to serve.  They have lots of people shouting at them, and only so many hours in a day.  While working with governments it’s often wise to show some form of restraint to ensure your messages are better heard.  Being stupid will just destroy any credibility you may have once carried.

It’s also important to look at why certain countries are whaling, and try to offer solutions to their needs.

Greenland, Iceland, Norway and Japan are some countries that still whale.  But these countries do not go out and slaughter these creatures en masse.  Each country has their own imposed limitations.  Greenland and Japan still eat whale meat.  Iceland collects less than 40 in the name of science.  Norway also gets a few under the guise of science.  While these numbers are still higher than the zero that many conservationists would like to see, it’s a much better sight than the horrid slaughter that took place by many of the European nations up until the early 20th century.

I’m not saying that we should go out and take the life of whatever animal we choose so long as we benefit from it.  Heck, I still have a hard enough time eating meat twice a week knowing that something died to give me nourishment.  But while the earth seems to shrink all the time, the planet is still large enough for most of us.  Rather than make yourself look inept on a global scale by sending your dullest, it may be better to work with the systems in place with your brightest.  It’s not perfect, but only through open and frank discussion can differences in opinion be ironed out and a compromise met.

I only hope it happens before potentially irreversible damage is caused.

It seems that since September of 2001, the media has made it a habit to scare the public into paying attention.  While this may have worked great for the first few years, isn’t it about time they change tactics?

In the last few years we’ve heard how everything and anything can be used against us by terrorists, pedophiles, bored children and the government.  A perfect example of this unnecessary fear mongering would be the recent Vancouver Sun article talking about a possible terrorist threat that a city-wide WiFi network would introduce.  This is the fourth “possible threat” that has plastered the newspapers and news channels in the last 3 days.

I hate the be the bearer of bad news, but a 4-inch aluminum pipe purchased at Home Depot and stuffed full of incendiary material for a total cost of $30 is much more likely than some Al-Queda member sitting in some remote part of Vancouver with a notebook and hacking some dam, causing it to release too much water and flooding a city.

Of course this raises another question.  In the article, they say:

“The plan calls for much of the city’s infrastructure, from traffic signals and TransLink systems to BC Hydro generators and Terasen gas meters, to use the wireless platform for communications and remote operations.”

What genius thought of this?  Someone in the higher levels of management, clearly.  This is about as intelligent as hiring a convicted theif as an armoured truck driver.  Critical infrastructure shoud never be placed on a public network.  Anyone who thinks this is a great way to save money is just asking for trouble.  Because of this, I highly doubt it will actually come to pass.  Informed technology consultants will likely recommend against this kind of design as it’s just foolish.

Humans are a pretty clever bunch.  No sooner had we learned that we could more effectively kill healthy animals with spears that we were doing the same to our cave-dwelling rivals.  You take almost any tool that we’ve created, from the wooden club to the wrench to the pen, and if we’ve found a way to use it to our advantage for a purpose it was not intended to serve.

A city-wide wireless internet infrastructure would be pretty cool.  The likelyhood of the city connecting critical devices such as hydro-electric dams, traffic lights and bridges to this network is likely nil.  Like every other subject that’s been in the news recently regarding some sort of technology and a faceless criminal who’ll take advantage of it, this story was likely conjured up and misconscrued long before it even made it to print.

We know that fear sells.
… The media breeds fear.
… … Is big media our faceless terrorist enemy?

Somebody tell Dubya!  The terrorists were here all along!

It’s time we stop being scared.  The world is no worse today than it was 100 years ago.  Sure, we have more tools to bastardise for terrible acts, but we also have more tools to use for incredible feats.  Let’s focus on our potential rather than some abstract “what if?” fantasies.

Typically I will not discuss work on this site, but this is going to be an exception.

For the last few days I’ve been working on a problem that one person has faced when sending email through a powerful software package called SugarCRM.  This is a great application and I would recommend it for anyone that’s looking for a slick web-based CRM suite.  That said, there are occasionally some pains from time to time when users uncover specific areas that have not been fully tackled by the programmers.

Last week, one of those issues was passed to me.  A user who had a special accent in their name was reporting their displayed name would show up very weird whenever an email was sent.  This looked to be a character set issue, but after several hours, this proved to not be the case.  Over the course of the next 60 hours I learned how emails worked, their history, their requirements and read seemingly all the RFC’s that have been published on the subject in the last 20 years (including the 1993 RFC on the Japanese Japanese Character Encoding for Internet Messages).  After all this time, I had determined where the problem originated and resolved the matter for the user.

Yay!

I had never thought I would need to learn so much about email.  Now that I have, though, I can see why certain decisions have been made over the years regarding the many different standards that are out.  I’m also confident enough in what I’ve learned to actually build an alternate version of PHP’s sendmail() function should it become necessary.

Now the hard part will be billing the appropriate customer for the right amount of time … for the sake of a single user’s display name, we will be billing them 60 hours of work.  Somehow I doubt that it will fly.