New Version of Google App Engine Relased

Google has released a new version its App Engine Software platform, the register writes about it here.

 

Of great interest to us is that the Blob Store API has been upgraded allow programmers to fully interact with blobs, previously data could only be written to a blob in the blobstore via a HTTP post, but now it seems data can be written to a blob, at will, directly from code – i.e. The blobstore API was more or less useless and now it should be useful! ;-)

 

Previously we had to design and implement our own BLOB storage mechanism on top of the Google Datastore to get around these limitations, so hopefully now such homegrown efforts will be no longer required….

 

Also a new unit test framwork for python has been added, we already happily use the GAE Unit framework on which it seems the new google framework is partly based.

 

It is great to see google push ahead and continue to support software developers by fixing up and improving their platform – keep up the good work lads; a lot done, a lot more to do!

IE8 / .change() jQuery event not firing

This one catches me out time after time and I always forget how to get around it – so I am writing it down this time. Developing software to run well on multiple browsers is actually not that difficult until, that is, good old IE is thrown into the mix! ;-)

 

The problem is that in Internet Explorer, the .change() event on radio buttons doesn’t get fired properly, or at least it doesn’t behave the same was as it does in the other browsers – it’s a real pain!

 

There is however a relatively easy way to get around the problem, that is to handle the radio’s .click() event, and then, just .blur() and .focus() the radio control – this will cause the change() event to be fired:

 
$(document).ready(function() {
  $('#my-radio-container input:radio').click(function () {
        // Cause the change() event
        // to be fired in IE8 et. al.
        this.blur();
        this.focus();
   });
  $('#my-radio-container input:radio').change(function() {
    // Handle .change() event as normal....
  });
});
 

Remember to replace #my-radio-container with an appropriate selector for your HTML.

 

I am not sure why it works exactly….. but it works well for me!

Drupal moves Software Revision Control to Git

Our favourite Content Management System – Drupal is moving over from CVS to Git today, meanwhile drupal.org will be down for 12 hours…

 

More and more people seem to be completely side-stepping subversion and moving straight to Git, is subversion yesterday’s news?

 

I do like subversion and think it’s an excellent Software Version Control system, but I do feel that Git may be stealing the march on it…

 

Any thoughts?

Expect Shell SSH Example

I found this nice example of using the Expect Shell to automate an SSH connection providing username and password:

 

http://bash.cyberciti.biz/security/expect-ssh-login-script/

 

When automating SSH connections it would be better to have authentication keys setup to avoid the necessity of passing a password to a script, but this is not always possible and in these cases the Expect Shell offers a workaround.

 

I need this type of automation functionality as I am currently working on automating some Git tasks, so that an application running on the Google App Engine can access Git repositories via a Web API running on a third party system.

 

Git is gaining more and more popularity as a Software Control system within the Software Development community but it turns out that interacting with it from the Google App Engine is far from trivial – but what’s new! ;-)

 

“You Irish, you very good at software” – Yes we are!

Micheál Martin’s recent rather amusing gaffe has left people in a lot of different emotional states ranging from the wringing of hands emotional state to the back-of-clasroom giggling emotional state – but what nobody seems to have taken from his statement is that it’s actually 100% correct:

 

We Irish _are_ very good at software!

 

Thanks for noticing Micheál!

Google Apps Cloud Rollout for Small Business – Very Impressive

Most Software Development houses need to roll up their sleeves every now and again and get stuck into some honest to goodness IT setup – somtimes for themselves and sometimes for their clients.

 

With cloud services maturing there are more options than ever for rolling out capable and cost effective IT infrastructure.

 

This week, we finished moving a client’s email setup from standard web-hosting mailboxes (POP & IMAP) to Google Apps and Gmail, we found the whole process refreshingly straightforward. The setup included mail and calendar on windows with outlook, Outlook mail and iCal calendar on the Mac and Mobile Sync of mail and calendar on the iPhone, Blackberry and Android.

 

The only sticking point was that outlook on the Mac does not yet support calendar syncing with anything except Microsoft Exchange and so won’t sync with Google Calendar – hence the use of iCal instead which does happily sync up with Google Apps. Proper syncing functionality has been promised by Microsoft for some time now but hasn’t appeared. Hopefully it will arrive within the next half year or so…

 

Of the mobile setups the blackberry was amazingly simple – those guys really have thought of everything. All you do is enter your google account name and password when logged into your web account and everything is then setup automatically on your phone, you don’t even have to tell it that it’s a Google Apps account – it figures all of this out itself!

 

The rollout included the migration of many hundreds of Mib’s of the client’s existing email up to the cloud – this process took a wekend to complete, but again was quite painless.

 

As well as mail and calender support, Google Apps also has Google Docs and Google Sites which can be used for developing a company intranet.

 

Anyway I would definitely recommend Google Apps as a good option for small companies out there who need to grow theirr IT infrastructure, but don’t want the extra hassle and cost of having an in-house IT setup. Google really have put a lot of effort in making the user experience on the Cloud as seamless as possible and it seems to have paid off.

Scripting GPG – “It is NOT certain that the key belongs to the person named…”

GPG is great software for manually encrypting data using the OpenPGP standard – good encryption tools are more and more becoming essential to software development.

 

However using GPG from a script sometimes presents problems. Why would you want to GPG from a script? Well you might want to encrypt a backup from within your backup script to allow you to safely FTP the backup file to remote storage, for example.

 

Anyway, one such problem results in the following error message appearing, when you try to encrypt using an imported, but unsigned public key:

 

“It is NOT certain that the key belongs to the person named…”

 

GPG then says something along the lines of ‘do you want to continue anyway?’ and tries to read your response from the terminal – the script is unable to answer the question and so the whole process stalls…

 

One way to get around this problem is to manually set the trust level of the imported public key to ‘ultimate’ so that the situation no longer arises, instructions for how to do this can be found here:

 

http://www.somacon.com/p107.php

 

However in some cases this may not be easy or desirable, especially if you don’t have access to the command line – for example, you may be working with shared hosting. You may also want to ensure that the _whole_ process is automatic with no manual steps required.

 

So, another option is to pass the ‘–trust-model always’ argument to gpg, this will force GPG not to issue the warning and not ask for confirmation – so your script should proceed OK. For example:

 

[code]
gpg –encrypt –yes –no-tty –trust-model always –output backup.gpg –recipient backup@software-ireland.ie backup
[/code]

 

Older versions of GPG may not have this parameter, and will report an error when you pass it, in this case the depreciated ‘–always-trust’ argument can be used instead.

 

Be warned that this does reduce security slightly. If somebody somehow maliciously managed to substitute your public key for theirs and then managed to intercept the encrypted data, then they could decrypt it with their private key. However in most cases this is of small concern – but do be aware of the possible dangers of blindly encrypting without requiring signed public keys.

 

Script & Encrypt!

The rise of the CMS, whither the cloud?

Here is an interesting article about the relative strengths of the most popular CMS systems out there:

 

http://www.dss-int.com/articles/2010/10/15/the-cms-tug-of-war-wordpress-vs-drupal-vs-joomla/

 

As regular readers will know drupal is my tool of choice for most of my web development work although I have put many a website together with wordpress too and I really like it. I can readily understand why you might choose wordpress over drupal for a particular job and vis versa. I have developed many large and capable web apps with drupal.

 

What I find harder to understand is why some web designers and developers slog away with the older web platforms like ASP .NET and JSP etc.

 

I have developed many such systems but after developing web apps using CMS systems over the last few years I would find it really hard to go back – I don’t think that I could handle the sheer amount of wheel reinvention that is necessary to put anything useful together!

 

Mind you I have been developing in the cloud lately with Google App Engine and the amount of wheel reinvention that must go on there is quite staggering, but then it is the cloud, so that’s ok….! isn’t it?…. ;-)

Google App Engine extends time limit for tasks, No more DeadlineExceededError ?

Is DeadlineExceededError a thing of the past?

 

The new version (1.4.0) of the google app engine was announced yesterday, details can be found here:

 

http://googleappengine.blogspot.com/

 

There are some interesting changes and additions, however the one change that really caught my attention is that the time limit for tasks has been increased from 15 seconds to 10 minutes!!

 

The 15 second limit was a real pain when trying to do any sort of even light to medium weight background processing in the GAE – any task that ran to 15s would be killed and the very annoyong DeadlineExceededError would be reported. This sometimes made life really difficult for software developers, forcing them to restructure their code into multiple smaller chained tasks etc. So this is big news!

 

I have run some quick tests this morning and have happily run background tasks for many minutes, so things are looking good so far!

Swapping Database Column Values (mySQL)

Software Developers know their away around SQL – it is a tool of the trade (as it were!), however today I had to revert to google to find the SQL to swap the values of 2 columns within a table. Luckily I found this interesting (and very handy) article that explains just how to do it:

 

http://beerpla.net/2009/02/17/swapping-column-values-in-mysql/

 

I had to reverse the relationships between drupal taxonomy terms, this was to be done by reversing the values of the tid1 and tid2 columns of the term_relation table, this code did the trick for me:

 

[code]
UPDATE term_relation SET tid1=tid2, tid2=@temp WHERE (@temp:=tid1) IS NOT NULL;
[/code]

 

If I had to manually reverse all of the taxonomy relationships via the drupal admin interface it would have taken _forever_!

 

PS. If, for a given taxonomy term id, you need to get a list of the related taxonomy terms, just call:
[code]taxonomy_get_related()[/code] although be warned that the concept of related terms is to be removed in drupal 7!