The high cost of Mobile Internet in Ireland Part Deux

In my previous rant about the cost of the mobile Internet I neglected
to mention that I was talking about 2G or less networks.

3G is an entirely different beast.

Tom Raftery in his blog gives the low down on 3G costs.
Irish mobile broadband becomes more compelling

3 network passes on iPhone
3 also point to the high cost of 2G networks as the reason their not going to
support the iPhone.

So if you a serious user of the mobile Internet the 3G is a great option.

The only problem is that most people are still on 2G or less so we still need to
care about bandwidth.

1 Comment

Is There A Future For Desktop Email Clients ?

The Coming of Gmail

When Google released GMail they eroded the two primary advantages of the desktop email client, Storage capacity and POP access.

Before GMail, web based email restricted users storage capacity to a couple of megabytes, users could access their POP accounts but only if they paid a premium for this service, Gmail allocates a couple of gigabytes and are continually increasing it, and Gmail allows users to access a number of POP accounts free of charge.
How long will it be before GMail uses GEARS to enable it’s use off line?
Add this to all the other advantages inherent in web based email clients, why would anyone still want to use a desktop email client?

Not everyone has broadband

Not everyone has a fast internet connection and using web based email on a slow connection is painful.
What they need is the solution which requires the lowest possible bandwidth.
Enter the desktop email client.

An email client such as Thunder Bird can be configured to only download the headers while leaving the rest of the message on the server, the user can then decided what important enough to download in full. This is an extremely efficient use of bandwidth.

The Future

I don’t think desktop email clients have much of a future, as high speed internet connections become even more common the need for desktop email clients will decrease and they will become a niche product.

Maybe this is an indication of what will happen to other types of desktop applications in future, Just look at Google Apps for a hint of what is possible.

Leave a comment

RESTful Web Services

Hot off the presses RESTful Web Services by
Leonard Richardson and Sam Ruby has just been delivered to me, I can’t wait to get stuck in.

I’ll post a review as soon as I can.

Leave a comment

Simplicity is a Function of Insight

REST reminds me of a quote, “Simplicity is a Function of Insight”.

When I first heard about REST way back in 2004 , I was stunned by its simplicity, particularly in comparison to how SOAP is abused (remind to tell you that story one day).
For so many applications REST is the simply the best way to implement them.

One of the common complaints about REST is that it tries to make things simple when they really aren’t, in answer to that I include this link The Complicator’s Gloves.

When developing software we should always keep in mind Ockham’s razor, when given the choice choose the simpler path.

I hadn’t intended this blog to focus on REST web-services, I thought Delphi would come up more often and maybe some general software development posts.
I suppose its just that I find REST to darn interesting. Why fight it.
So for the moment this blog is going to focus on REST.

Leave a comment

Google, Intelligent ?

Conclusive proof of my theory that the Google search engine is intelligent, as defined by the Turing test ;)
The results of the query just need to be re-formatted.

What is the answer to life the universe and everything ?

Look at the top result.

This looks like a good idea for a mashup, some kind of service that can use Google results to generate a conversation with a person.

Leave a comment

links for 2007-05-24

Leave a comment

Regular Expressions Simple and Powerful.

Yes! Regular Expressions are simple once you learn the grammar, and thats also the biggest problem with them, unless you learn the grammar, Regular Expressions look like the gibberish of some dark art, And unless you actually sit down and study you’ll not make much progress with them.

There are some good books on Regular Expressions.
Regular Expression Pocket Reference

Mastering Regular Expressions

Once you have Regular Expressions in your tool box you’ll quickly see many uses they can be put to such as page scraping or data validation, I’ve even seen them used them for updating Delphi code bases to the latest version of Delphi.

In the train timetable service I used 3 Regular expressions to extract the information need to output optimized version of the time table.

The first two

/<input type=”hidden” name=”DepTime” value=”[0-9][0-9]:[0-9][0-9]

/<nput type=”hidden” name=”ArrTime” value=”[0-9][0-9]:[0-9][0-9]

Are used to strip out the table elements which contain the departure and arrival times,
The strings which match the patterns are stored in two arrays, one for arrival and one of departures.

Then iterating through the two arrays a third regular expression is used


[0-9][0-9]:[0-9][0-9]

This Regular Expression returns the times from the strings contained in the two arrays and it is this information which is used to produce the timetables you see when using the service.

I’d be interested to hear an if there is an even easier way to do this.

There is an excellent tool available for working with Regular Expression, Regex Buddy It is a fantastic piece of software.

Most languages and platforms support Regular Expressions, For Delphi you can use the TRegex component which is free, for Delphi .NET it’s not needed as .NET supports Regular Expressions.

Leave a comment

links for 2007-05-23

Leave a comment

URL Rewriting, A Simple Example

One of the tools I used to construct the train time table service was mod_rewrite.

mod_rewrite can change URLs on the fly based on any rewriting rules you want to apply.

so instead of
../trains/Trains.php?from=Cork&to=Cobh
we now have
../trains/Cork/Cobh

Much nicer isn’t it.

Rewriting allowed me to create a URL structure which hides the implementation details, is easy to remember and can be constructed easily.
The URL is also more RESTful as a particular URL refers to a particular resource, todays time table.
An added bonus of hiding the implementation details makes it more secure.

Using mod_rewrite is straight forward.

First of all, the mod_rewrite is usually installed by default with Apache so you shouldn’t to worry about that.

Next, if like me you don’t have control over the server then you’ll have to use a .htaccess file which can be placed in the folder you do have access to. In this case I placed the .htacces file in the ../trains folder.
An advantage of placing the .htaccess file in a sub-folder is that it won’t have an effect on your root folder or any other of its subfolders, The .htaccess file will only effect the folder it is placed in.

Next we need to add some stuff to .htaccess file

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/?$ /trains/trains.php?from=$1&to=$2 [L,NC]
RewriteRule ^/?$ /trains/trains.php [L,NC]

The first line activates the rewrite engine.
The next lines are where the magic happens,
it is in the format Command Pattern Substitution Flags

Command : Simply “RewriteRule”
Pattern : This is the Regular Expression to matched in the URL, If a match is found then the rule is applied.
Substitution : This is the replacement string that the will replace the part of the URL matching the pattern if any.
Flags : You can set flags affect the behavior of mod_rewrite, in this case L and NC. L means last rule, if a match is found do not apply any further URL rewrites. NC means Not Case Sensitive.

Now just save the changes and we’re done.

The rewrite rule RewriteRule ^([^/]*)/([^/]*)/?$ /trains/trains.php?from=$1&to=$2 [L,NC] will rewrite URLs of the format ../trains/Depart/Destination/ to ../trains/Trains.php?from=Depart&to=Destination

The second rewrite rule RewriteRule ^/?$ /trains/trains.php [L,NC] will rewrite URLs of the format ../trains/ to ../trains/Trains.php as long as the first rule wasn’t triggered by a matching pattern being found.

The rewriting of URLs is completely invisible to the user and they will only the simplified URL.

To get the must out of mod_rewrite you’ll need to understand regular expressions, just one more reason why developers should add regular expressions to their toolbox.

There are a number of mod_rewrite clones available for IIS so URL rewriting is not just for Apache, It’s for life.

mod_rewrite URL Rewriting Engine.

3 Comments

links for 2007-05-22

  • “Ryan Tomayko’s brain: bookmarks to stuff recently reaching his brain, summaries of rants and raves leaking out of his brain, and the occasional article or essay.”
    an excellent site with some nice articles on REST
    (tags: blogs REST)
Leave a comment