Making Global Translator 0.6 and FireStats Play Nice

Anyone else tired of Google's 403 messages when using previous versions of Davide Pozza's Global Translator?  For some weeks I've been noticing a larger number of them than usual, but have lacked the resolve to either write in a caching mechanism for the translated pages, or change the code to work with AltaVista's BabelFish service.

Luckily, Mr. Pozza decided to do both.

Yesterday Global Translator 0.6-beta was released, and I was interested to know how it would run.  This version comes with support for both Google Translator and BabelFish, and will permit pages to be cached for faster loading.  The only downside to this version was it's inability to play nice with Omry Yadan's FireStats.  But since I really enjoy both of these plugins, I thought that I would make the effort and find a way to make these work together like I had for version 0.4.1.

While testing this I had found two issues would arise if both plugins were active simultaneously.  First, the translation service would receive an address like http://blog.net/http://blog.net/wp-content/firestats/, and second, the Flags Bar would have "double-language" links ( http://blog.net/fr/jp/ ) after coming back from translation.  Luckily there was only one function in translator.php that needed to be updated, and these changes are really minor.

In the translate function, change the lines:

$url_to_translate = BLOG_HOME . '/' . $url;
$resource = build_translation_url(BASE_LANG, $lang, $url_to_translate);

to:
$url_to_translate = BLOG_HOME . str_replace('//', '', '/' . preg_replace(LANGS_PATTERN, '', $_SERVER['REQUEST_URI']));
$resource = build_translation_url(BASE_LANG, $lang, $url_to_translate);

Under the line:
$fp = @fsockopen($host, $port, $errno, $errstr);

add:
$rep_url = '<a href="' . BLOG_HOME;
$repl = '<a href="' . BLOG_HOME . '/' . $lang;

Then replace:
if (!(strpos($line, FLAG_BAR_BEGIN)===false) && !(strpos($line, FLAG_BAR_END)===false)) {
  $line = get_flags_bar();
  } else {
  //Clean the links modified by the translation engine
  $line = preg_replace($gt_engine->get_links_pattern(), $gt_engine->get_links_replacement(), urldecode ($line)); 
 
  $pattern = "/<a href=\"" . BLOG_HOME_ESCAPED . "([^\"]*)\"[\s|>]{1}/i";
  $repl = "<a href=\"" . BLOG_HOME . '/' . $lang . "$1\" ";
  $line = preg_replace($pattern, $repl, $line);
}

with:
//Clean the links modified by the translation engine
$line = preg_replace($gt_engine->get_links_pattern(), $gt_engine->get_links_replacement(), urldecode ($line));       

if ((strpos($line, 'hreflang='))===false) {
  $line = str_replace($rep_url, $repl, $line);
}


And you're done!

For those of you that don't want to go into the code and change a bunch of things, you can download the modified translate.php file here.

One word of caution, though.  It seems that a formatting issue arises on sites that are using some heavy CSS.  Before using this version of the Global Translator plugin, I was using a sweet theme created by miloIIIIVII ... unfortunately, after translation there is quite a bit of header space and I lose the sweet cascading menus.  I haven't yet determined if this is from the translation, or something else ... but I'll update this post if I can resolve it.

If this works for you, let me know.  I also encourage you to head over to Davide's site and let him know that his efforts are appreciated.  These two plugins have proven themselves to be invaluable to me, and hopefully you find them just as useful.

UPDATE:

Davide's current release of Global Translator (0.6 Beta5) resolves the issues reported here, making my suggested fixes rather obsolete.  However, I'd like to thank Davide for all the work he's put into this release and I'm sure that everyone will agree with it's superior handling.

One note I would like to re-iterate, though, is that after upgrading to Beta5 you will need to either deactivate/activate the plugin or go to the Global Stats admin page (under options) and clear your cache, then hit "Save Options".  Reason is there is a function that needs to be initialized, and until you refresh the plugin's data, your site will show an array error.  This is in the user documentation, but how many of us actually read documents? :P

Google Mini Is Gonna Be A Winner

Google MiniThey've been working up to this for the last four years, and dammit, it's here.

I'm not sure how long this has been out, since I found it by an absolute fluke while getting the latest version of Douglas Karr's Technorati Rank WordPress Plugin.  While downloading I happened to notice an AdSense showing the blue 1U server to the right and said "WTF is that?"  Feeling adventurous, I took the plunge and started reading up on what this little thing can do... and it's gonna be a winner.

I'm very suspicious of Google's technologies because they're too good to be true.  Almost a decade ago I learned that when things often seem this way, they usually are.  Everything has a price, but Google just hasn't started extracting their price.

In the last year alone I have been asked to integrate more and more Google stuff into various corporate CRMs, websites, smart-apps, and portable applications.  I'm still trying to get the blood off my hands from a project I had completed a few months back to integrate Google Calendar into a company's BlackBerry system.  I don't know if it's just me, but I find this absolute trust in Google to be scary.  Thousands of companies are uploading so much data to this organization, and I'm wondering when the shoe is going to drop.  Trade secrets, customer lists, sales leads, corporate stragegems, financials ... everything is being put on these servers where the data is out of the owners' hands.  When the day comes that Google says "Oh, we're charging you for all this now", companies will be hard-pressed to rip out all the Google-specific code written into virtually every aspect of their business.

And people say that Microsoft is evil ....

However, my rant finished, Google Mini is going to be a huge success for these guys.  This little box will index the contents of a corporate network and provide a single place for users to look.  What's more, it has support for LDAP so that when someone goes to search for documents they will only see the results that they have permission to access.  At most of the places I've done work for in the last two years, this service would be a God-send.  Quite often there are very similar documents in completely different network shares, and people spend more time trying to collect information than use it.  Most everyone is already very accustomed to the Google GUI, and productivity could potentially skyrocket with something like this.

Naturally, since the 1U server would be provided to you already loaded with software and awaiting integration into a corporate network, this wouldn't be free.  The price structure looks to be right in line with what most corporations would be willing to pay, with the starter package going for $1,995 USD for searches on up to 50,000 documents.

I am curious to know what information is sent back to Google, though.  I'm sure that this box requires some sort of internet connection to keep itself up to date and would likely complain if it was not granted access to an outside port.  While I doubt Google would use this for covert corporate espionage, the possibility exists.  This little server could be more dangerous to a company than anything people have wrongfully blamed Microsoft for.

Of course, all that said, I've already recommended this to a few clients as well as my current employer in an effort to help them help themselves.  This is already a winner.

Habari, anyone?

There's a new blogging platform in town, and it's called Habari.  This was just recently made available as a developer's release (version 0.1) and already there are some waves being seen in certain segments of the community.

I'll be testing this out on my development platform during the Easter long weekend and I'm sure I'll have some positive things to say about the new package.  There are some sites out there that are already using this package (I'm guessing for testing purposes, since this is reportedly not ready for prime-time) and the users seem to enjoy the minimalism and ease of use.  Naturally there will be a few things to work out before 1.0 can be released, but I'm sure this can be done with lots of community support.

For anyone that's wondering what will make Habari stand apart from WordPress, Movable Type and the other packages, I'd recommend reading this article on Broken Kode.  There are quite a few people looking forward to what these talented programmers can deliver, and you can count me as one of them.

More to come....

A Worthy Challenge

Today's my 28th birthday.  10 Years ago I saw myself living in a big house, having no money worries, and enjoying my life as a computer programmer solving the world's problems.

Well ... one out of three ain't bad.

On to the world of exciting challenges ... Intel's PC Design Challenge!

In the spirit of the X-Prize-style challenges, Intel is hosting an open PC Design challenge to anyone that thinks they can make the next best thing out there.  Contestants have a month from March 19th to submit their computer design and let the internet community vote on the machines they like the most.  There are some basic technical requirements that need to be met (CPU type, motherboard requirements, case size, etc.), but it's pretty open.

What I really like about this contest is the wide array of excellent designs.  Some of the machines that have been submitted are the very designs that consumers have been looking for.  This one, for example, would be perfect to replace my existing media server.  I think this could be another kick-start opportunity for the Michael Dell's of the world and their little-known companies.  Of course you have the big corporate guys like Acer in the running with their sleek little machines and I wish them all the best of luck.

This summer could be the start of something great for the little guys.

The Circumcision Decision

Today I was reading an article on cbc.ca about an title="cbc.ca - Edmonton agency calls on parents to circumcise">agency in Edmonton that's calling on parents to have their sons circumcised in order to reduce the chance of STI's in a persons future.  I have to wonder if this is going too far.

An agency representative, Deborah Jakubec, goes on to say:

"In today's world people are not wearing condoms and we know that because currently we are having a syphilis epidemic in the city"

and:
"If we are not going to be comfortable speaking with our children about sex and sexuality then circumcision is another way to prevent [HIV]."

Are you kidding me?  So ... because parents are not comfortable talking about sex with their children, and since males aren't wearing condoms because they're thinking with the wrong head, we should circumcise our sons?  This sounds a little backwards to me.  People are bound to have sex eventually so proper education on the matter should start at home.

Many parents are uncomfortable talking about sex with their children for any number of reasons, but if kids don't feel comfortable discussing things or having someone at home to turn to about these issues, I don't see why the kids should go through the agony of such an action.  Now, I'll admit that I had this process done when I was too young to remember such a thing (thanks Mom and Dad!), but I don't see why any agency should be advocating such an action ... it's none of their concern.

There are many reasons parents may want their sons circumcised, or left as God created us.  Using the procedure as a "go ahead" to practice unsafe sex is just irresponsible.  Any male that knows how to properly bathe and look after themselves would likely never have this problem, anyways.  I agree that there is a serious issue regarding the number of sexually transmitted infections going on all over the planet, but these can be combatted through open discussion and effective education (for both the child and the parents).  Put the scissors down and let the parents decide this on their own.

There Are No More Secrets, China

Collapsed Tunnel in China

Why all the secrecy?  Is it worth the lives of six people?

Earlier this week, construction came to a halt for workers in Beijing, China when a section of tunnel they were working on collapsed.  Almost immediately after this occurred, the management locked the gates to the site and tried to keep the incident to themselves.  Cell phones were confiscated in order to prevent word from spreading, and there was even word of some kind of monetary incentive to keep the accident secret from the rest of the world.

Six people were trapped when the earth collapsed in on them and, after 50 hours of digging, only one body was recovered.  There's little hope on finding the remaining workers alive.

The incident occurred around 9:20 am, and oddly enough, the actions taken by management had kept the story quiet until 5 pm, when people were able to leave.  The police did know something was wrong, as a crowd had gathered, but the management who spoke to the authorities said that everything was normal, and eventually the police left.

I have to admit ... I feel sorry for every person involved in this project, and wonder if a similar situation might happen in Vancouver as the city prepares for the Olympic events in 2010.

With less than a year to go before the games, Beijing is under incredible pressure to complete all the construction on time.  This pressure is then pushed down to the companies who face stiff penalties for not completing by certain dates, and that pressure is then transferred to management who then try and push their front-line workers harder.  Breaks are shorter, people are asked to cut corners, and safety precautions are ignored in order to complete sections faster.  We've seen in every huge engineering project what happens when safety is secondary, but we just never learn.

Despite Beijing's perceived urgency on the completion of their expanded subways and towering skyscrapers, I hope that the lessons learned here will not be soon forgotten.  There have been several accidents in the last year on several of the subway projects, and they've all stemmed from lack of safety precautions.

The Olympics are still a year away, and the events are only for two weeks.  While these events will create for a greater awareness of Beijing and Chinese culture for many throughout the world, repeated incidents like this will only make us think the country is little more than a fascade.  Sure, it looks nice from a distance.  But once you get up close, you can see what it actually cost to make it.

As for trying to keep this secret ... it seems that people still need to learn that there are very few secrets in the world.  Secrets that cost lives tend to get noticed right away.  The managers and designer of the tunnel have all been arrested by police, and I'm sure they're all sorry for the loss.  In the name of expediency they ignored the people working for them ... their most important resource.

So please slow down, Beijing.  Poor planning on your part should not make it an emergency for others.  I'm sure that we'd understand if there were still some parts of the city under construction when the world comes to play.

Planets and Binary Stars

In many of our popular science fiction stories, characters either come from or visit planets that orbit two or more suns.  I've often given this kind of solar system design some thought as I try to comprehend Einstein's Theory of General Relativity and how the gravitational planes would work in these scenarios.  I must say ... it's an interesting study.

Scientists at NASA have recently used the Spitzer Space Telescope to examine quite a few of these systems looking for the potential of planets.  Because our telescopes can't directly see planets at such a distance, what the scientists did instead was examine the dusty disks that surround each system.  The idea is that if gaps in the disks exist, there is the potential that planetary bodies have swept the area clear of debris (much like the 8 planets in our system have done).

Oddly enough, what scientists have found is that planets are just as likely around these stars as they are around single-star systems.  Since most of our galaxy is made up of multi-starred systems, this opens up huge areas of real-estate where we can look for signs of life, or even potentially colonize in the next millenium.

No matter how often I hear of these discoveries, I'm always impressed by how much we can learn about the universe from our tiny vantage point.  I grew up watching Star Trek, and the crews that manned these incredibly powerful starships had technologies light years ahead of ours.  Despite this technology, they would continue to venture out to witness first hand many of the great wonders of our little corner of the galaxy.

When I consider the technologies that we have today, with the technologies that we may have in 50 years, I'm forced to ask myself "Will we ever need to leave our little solar system?".  As it is, our technology is growing by leaps and bounds.  Sure, by the time we start colonizing planets other than Mars we will likely have vessels that could travel at near-lightspeed, if not faster.  Einstein's theoretical speed limit is just begging to be broken.  But if we can learn so much about the universe from an insignificant section of it ... would we ever need to leave the comfort of home?

Busy, Busy, Busy

For the last few days I've been a bit tied up when at home, and because of that, the topics I've written about over the last few weeks have been pretty short, or incompletely written.  At one time I had considered pre-writing my entries on paper and then typing them into the site ... but there just hasn't been time for that.

Over the last few months I've been working on putting together my options for working in Japan.  As it is, when not studying or helping someone with whatever chore, I've been able to get some extra work through title="Guru.com Guru.com">Home">Guru.com ... though nothing sizable enough to warrant becoming a contract programmer.  This is about to change, though.

Recently I've started working on a small project for a great little company based in Portland, Oregon.  Because of the NDA I signed, I can't really plug them, but it's all good.  This project is serving two purposes.  First it will solve a small business problem that they're experiencing, and second it will show the quality of my work and ability to understand their business processes.  Yesterday I had fired off the finished project a whole week ahead of schedule and today we agreed to continue working together in the future.  They're currently working on a specification for a larger application that will be used on three platforms and will tie together all of their services.  I'll be one of the main programers called in to make their ideas work.

Exciting times, indeed.

On top of this, I'm being given the opportunity to have a very different relationship with my other employers.  One advantage to this will be my ability to work from anywhere on the planet.  No longer will I need to travel to one of a few different offices (depending on the day), but instead I can work remotely and upload my finished work.  This extra freedom will permit me to do something I've been trying to accomplish for just over a year ... moving to Japan.

In three weeks I'll have officially started my own software company, and for the moment I'll be working alone.  I'd like to get enough work to have two or three other people work with me, and it would be great if they preferred to work from home.  The reason for this (right now) is costs.  I can't really justify the huge cash outlay that would be necessary to open yet another software shop in Vancouver and stock it with decent furniture, computers, servers, coffee makers, etcetera.  These things are just a bit beyond my reach right now.  However, as it stands I have the opportunity to earn 20% more this year than last, and the current relationships that are being forged seem to be strong enough to support me for at least one year.

It's what comes afterwards that leaves me wondering, though.

I've read many columns written by people who have run their own business.  The biggest worry that these people had was money.  Where would their next paycheque come from?  Could they afford the bills that month?  Who would try to get out of an invoice on a "technicality"?  These are the problems that sometimes confront small business owners.

I've had my share of problems in the last year with people who have skipped payments, but these are usually resolved when I show up at their door and discuss the matter.  But if I'm on the other side of the globe, how will I go about ensuring payment?

There are always ways to collect on debt, I'm just hoping that I won't have too many troubles with it.

In the next month, I'll be launching another site outlining services offered and all the standard things that one would expect from a software site.  This is going to be my first official venture in over five years, and I'm hoping that this will give me the flexibility and financial resources I'll need to move to Japan and be with my Reiko.

Not Banned In China

With all the talk of China blocking sites and telling Google what they are permitted to show, have you ever wondered if your site could be viewed from within the country?  GreatFirewallOfChina.org">TARGET="_blank">GreatFirewallOfChina.org will give you a pretty easy way to check this out, and I'm happy to see that my site has not yet been singled out by the government ... yet.

Over the last few months I've noticed quite a few hits from China.  A few are from people I talk with on IRC, while most are from crawlers that seem to enjoy hitting 20 pages in each of the 10 languages available within the space of five seconds.  Luckily, my web host can handle this kind of traffic.

Of course, we need to keep in mind that it's the provincial internet providers that actually do the site blocking, so even if your site doesn't work according to GFOC, you might still have viewers in other parts of the country.

I wonder if the Chinese immigration office will begin linking websites with contributors in order to keep the people that post potentially controvertial material out of the country....

The Human Paradox

When is life considered life?  More specifically ... when does human life begin?

This is a subject that we hear debated in government halls, religious circles and respectable newspapers ... but never can we find the common ground to say "This is when life is life, and this is the stage where we protect it."  I don't claim to have an answer, as this is a very loaded question, but I do have a question back to everyone that believes that life starts at the time of conception and we should protect it as the barely-multi-celled organism has the same rights as us; "What makes this life so important?"

Whenever I hear this argument I strain to listen in order to hear what insight some new minds might bring to the table.  This is a very touchy subject for many as humans have an inalienable claim to certain rights.  These rights include protection from exploitation and the right to food, water and shelter.

So this brings me to the subject at hand ... the Human Paradox.

A group of scientists in the UK have applied for permission to inject human genetic material into cow eggs that are devoid of their own genetic material.  The end goal of this action is to create a steady supply of human stem cells with which to examine the onset of certain diseases.  This gets around the current bottleneck of using human eggs supplied by women, which is not realistically feasible as a long term supplier of this material.

Ten years ago, a team lead by Jose Cibelli was successful with their attempt to fool the cow egg into thinking it's pregnant so that it will begin the cell division process using human genetic material as the blueprint for reproduction.  However, this event was condemned as unethical by President Bill Clinton and opened the monumental question "When is life, life?"

Unfortunately, after a decade of heated debate, we're no closer today than when the question was first asked.

The idea here is to inject DNA from people afflicted with Alzheimers, Parkinson's and a plethora of other diseases into these devoid cow eggs.  From here, the eggs would be tricked into multiplying for a period of five days, where they will then be "killed" and the stem cells harvested.  With these cells, researchers could examine these diseases right at the very start of their development.  With this knowledge, scientists would have a much better understanding of the root causes of these diseases and could begin working on viable methods of repair.

"Exciting" does not even begin to describe this field of science.  The potential rewards for research in this area includes the abolishment of diseases and conditions that cause considerable pain.  This would be as important to medical science as the discovery of pennicilin.

But at the same time this means we humans would be, in effect, playing God.  We would be creating inter-species life that should not have existed for the sole purpose of killing it, extracting what we want from it, then discarding the rest.  Heck, this could be viewed as rape on a cellular level followed by an immediate abortion.  I can certianly understand why so many people are offended by the mere thought of scientists playing with the very foundation of life.

But is a cellular organism only five days old human?  What makes us human?  Is it the amount of time that we spend in the womb?  Is it our ability to speak and reason?  Is it our mostly hairless bodies with two arms, two legs, and all the other features that make up our person?  Is this a question to be answered philosophically, or politically?

As it stands, we humans turn a blind eye to the millions in distress all over the planet.  We ignore the homeless.  We ignore the unfortunate people in war-torn nations.  We ignore the attrocities in Darfur.  We ignored the heinous crimes that happened in Sierra Leone.  We pay little attention to the countless children forced into the sex trade industry....  The list goes on and on.

And this is just for crimes against other humans!  I can dedicate half a Wiki to the bullshit we do to animals, and another for our crimes against the Earth.

So why does a clump of non-sentient, semi-functional, cross-species animal cells warrant so much of our attention?  Is it because we're not ready yet as a species to play God?  Or is it because we've messed up everything else so bad that we want to protect the last frontier we've yet to exploit and bastardise?

  1. 1
  2. 2
  3. ...
  4. 255
  5. 256
  6. 257
  7. ...
  8. 267