Archive for the ‘web technologies’ Category

Google App Engine Frustrations

July 20th, 2008

Google App Engine LogoI’ve tried more than once to jump onto the Google App Engine bandwagon to no avail. Unfortunately it’s preview nature is acting to frustrate any attempt I make build something I’m happy with. Just some thoughts so far:

No Direction – It’s been dumped into the ether with no solid direction. No recommended method or path to building your web app is given or hinted at. I’m all for choice and its great Google allow you to use Django, CherryPy, WebPy, etc. but it’d be helpful if a consistent and solid method was given. Unfortunately you’re left with the feeling that the GAE has been thrown together with no real thought of making a web app out of it.

Disorganised Documentation – This doesn’t help the problem mentioned above as the docs provide 3 or 4 ways of producing a web app from the start. It first tells you how to do it using basic CGI and printing directly to the browser. Then it shows you using the RequestHandler and WSGI app. At which point it doesn’t say URLs are now handled by the WSGIApp instead of the app.yaml. Then it brings Django templates into the mix. How about pretty URLs? Oh well we can do that in app.yaml, or using matched groups in the WSGI app. For the love of all thats holy can’t we just have a single nice solution? A recommended method? An idea? A guide?

Restrictions – So it gives you all that wonderful choice as mentioned above so you think you’re going to make the best of it but oh no. Now you have to put up with the restrictions. No MySQL, no Django admin, restricted URL retrival, restricted security, no file uploading.

So you have to ask the question: Why?

What, ultimately, is the point in it when there’s far better out there – Django, Merb, etc.  It has no purpose other than to faff with and so I shall be avoiding it for the forseeable.

Rails Alternatives

January 10th, 2008

After the recent turmoil I thought it may be worth pointing out a few alternatives to the Rails framework. So here’s 4 Ruby-based web framework alternatives for starters:

  • Ramaze – Has no known bugs and claims excellent stability. Thems fighting words! ;)
  • Camping – A ‘micro-framework’, this is incredibly lightweight offering limited features but great efficiency and speed.
  • Merb – One of the frameworks recommended by Zed this started as Mongrel + ERB, hence the name. Its grown to be a very clean and efficient Ruby framework.
  • Hobo – Not a framework in its own right as its built on top of Rails but it offers a raft of extra functionality to ease and speed up development of your projects.

You may also be interested in the following web frameworks in other languages:

  • Cake (PHP) – One of PHP’s most popular Rails alternatives. More verbose than Rails but providing much of the same functionality.
  • Symfony (PHP) – This is becoming increasingly popular with employers looking for experienced PHP developers.
  • Django (Python) – Hugely popular Python framework and although not the first its overtaken veteran frameworks like Turbogears to be the most popular Python in the box.
  • Turbogears (Python) – An older Python solution which is actually a jumble of technologies stuck together.
  • Sails (Java) – One of the many Java frameworks with a lot of promise.
  • Seaside (Smalltalk) - The onlySmalltalk based framework I know of. I’d really like to have a gander at this at a later date as one of Ruby’s inspirations was Smalltalk so it’d be interesting to see how the forefathers go about framework creation.

If you’re a fan of statistics, reviews and comparisons then maybe you’d like some of these – about as many web framework reviews as you can possibly want!

Facebook API Wins API of the Year

December 29th, 2007

Facebook LogoIf you’ve never heard of Programmable Web then I suggest you take a look. Its a huge directory of all the major APIs on the web open for development. They’ve decided to award the Best API of the Year to the Facebook site. It won based on its openness, audience, money-making potential, viral features, modularity and metrics.

This got me thinking of ideas to put into a new Facebook app but before I jump in at the deep end I’m going to start small with a few quizzes that can plu gin to my existing sites then build from there.

Interesting side note for Ruby/Rails developers: There is an API interface for you to with rFacebook.

Failing that you could just get someone else to do it for you by getting one of the many Facebook Developers to do it for you.

GMail IMAP and Attachment Workaround

November 28th, 2007

We’ve been having some attachment problems at work recently since shifting over to using IMAP on our Google Apps for Domains service. After some trawling it seems the solution is a relatively simple one:

Change these two values in Thunderbird’s advanced configuration editor to “false“.

mail.server.default.fetch_by_chunks
mail.imap.fetch_by_chunks

Your MP – Google Desktop Gadget

October 15th, 2007

Your MP Small LogoI was playing around with the Google Desktop Search API again at the weekend and threw together a gadget that queries the TheyWorkForYou.com UK MP database. It basically enables you to gather all sorts of interesting info about various MPs, Peers, debates and committees.

This gadget is just a simple interface so you can enter your postcode and the panel then shows your local MP with links to their profiles (BBC, Wikipedia and the Guardian) with the list of the most recent debates they’ve been involved in.  All of this is done with three requests to their server resulting in three seperate JSON responses.  The first response is used to get the “person_id” which is necessary for the next two which retrieve further info and debates listings.

The gadget is hosted on Google’s Code Project Hosting site and released under GPL 3 so anyones free to tinker if they wish.

Download Your MP Gadget

10 Free SVN & Project Hosting Services

September 20th, 2007

Gears

UPDATED: As of Jul 10th 2009

Open Source seems to be exploding all over the place at the moment and with online services increasingly jumping on the free offerings its been fantastic for developers wanting to host, manage, flaunt and communicate their projects online. Here’s a rundown of 6 free SVN hosting and project management offerings I like the look of.

Unfuddle

Nice name and nice site. Very web 2.0 and slick with project tracking such as issue tickets, source control, time tracking, milestones, etc. The free package only comes with 200Mb and restrictive user allowances (1 per account) and only one project. This makes them the stingiest of the group. This is reflected in their price-resources on paid plans with $99 only getting you 10Gb and 50 projects. Compare this to $59.99 at Codespaces for the same space but unlimited projects.

Pros: best interface, great features, Git support.

Cons: high price, low resources, tiny free account.

CodeSpaces

They have a hefty 500Mb for 2 free users per account and they have a good range of prices starting from $9 per month for 4-man teams upto $59 for unlimited.

Pros: nice interface, good pricing, active and involved developers.

Cons: Not as many features as the ‘big-beast’ Assembla.

Assembla

Part of a large and feature-packed service full of project management features as well as basic 200Mb of SVN hosting. It even has a jobs board but the project hosting comes with wiki pages, blogs, etc. The free package has all of this but lacks phone supports and is only for open source projects.  They have VERY competitive prices starting from $3.

Pros: packed with features, reliable, supports Mercurial.

Cons: pricey in the higher plans.

OpenSVN

One of the first to release free SVN hosting and starting to show its age with very barebones features. They had a major failure in backup and restore last year which causes some worry about their reliability. So when I say “free SVN hosting” I really mean just that!

Pros: unlimited space, unlimited projects.

Cons: very unreliable, no features!

XP-Dev

This is a very no-frills setup but they have one killer feature: Private SVN repo hosting – FOR FREE!!  Made for agile and extreme programmers this doesn’t have a lot of the features inherent in other services but thats just fine.  Its also got an unlimited repo limit.

Pros: unlimited repos, free private hosting

Cons: Only one paid option, very few features.

Bounty Source

Still going strong after I first mentioned it back in June Bounty Source offer your basic SVN along with a wiki and CMS for managing your projects online presence as well as a task tracker. Bounty Source have a unique feature though that enables a developer to be paid for the work they carry out on user feature requests. Something I really like the look of – all I need now is an open source project people are going to pay me to finish!

Pros: bounty system helps devs get paid to work.

Cons: no paid option, looking old, falling behind in features.

SourceForge

Like an old grandfather clock this has been around years and although very reliable its showing its age. They tried to spruce it up with some Web2.0 gradients and curves but you can’t scrub out the moldy smell from that interface and features-set.

Pros: reliable, well established.

Cons: very intrusive ads, pain to use.

Google Project Hosting

They seem to have taken a lot of the old school methods of project hosting from SourceForge. Unfortunately as mentioned earlier they’re looking old and although Google looks much cleaner its features still lack the richness that the smaller providers have who’ve gone all out on innovation while Google remains formulaic. Google also don’t provide paid private hosting. Its all open source here.

Pros: reliable, clean interface, good features, supports mercurial

Cons: no private paid options, open source only

Comparison Table – Free Accounts

Metric Unfuddle Code Spaces OpenSVN Bounty Source XP-Dev Google SourceForge
Project/Repo 1/Unlimited[1] Unlimited/Unlimited 1 Unlimited 5 Unlimited[4] Unlimited
Space 200Mb 50Mb Unlimited N/A[3] 300Mb Unlimited[4] Unlimited
Wiki Yes Yes No Yes No Yes Yes
Tracking Yes Yes No Yes No Yes Yes
Browser Yes Yes No Yes No Yes Yes
  • [1] Unfuddle allow one active project but unlimited numbers of repos within it.
  • [3] They state nowhere on their site about limits to project size.
  • [4] Google claim in their terms that there’s no upper limit but they reserve the right to impose one.

Google Tech Talks

September 15th, 2007

I’m a recent convert to Googles Tech Talks and I’ve been totally taken in by it! Its a huge selection of posted videos searchable on Google Video of lectures, demonstrations and talks from a wide array of difefrent people. All rated and commented on by the community. What’s also great is its got RSS so I can keep an eye on it from my Netvibes page.

Here’s a couple of examples of recent great talks:

How to Design a Good API

A great intro to writing a good API and also why writing a good API should come naturally if you’re coding in the right way. ;)

Everything is Miscallaneous

Fantastic talk on categorisation and how the net is helping us sort and manage much better – if only it helped me sort my ‘misc drawer’ out!

Python 3000

There couldn’t be a list of videos without mentioning Python 3000. As you may have heard they recently released the first alpha of Py3k and there’s lots to be excited about – though you’ll have to wait until this time next year before we get the final.

Firebug for the Impatient

August 5th, 2007

Firebug LogoI installed Firebug a long while back and didn’t think much of it. Granted I never read the docs or even the description. I like to just try things out and if I don’t figure it in 10 seconds flat it normally gets ignored. Unfortunately that meant I missed an absolute goldmine and looked a prat in the process.I’ve since attained ‘Firebug Enlightenment’ and so I thought I’d throw together a ripspeed post on Firebug for the un-initiated and un-convinced:

See the response of Ajax calls
This was what really hit me when I delved a bit deeper into Firebug. Its a shame its so hidden away but by opening up your Firebug console and selecting the “Net” tab before clicking “XHR” you will get a listing of all the Ajax calls made so far since the last full page load. If you click on a particular listing then it’ll expand to give you information on the headers sent and any server response. This is invaluable to debugging your Ajax apps!

Edit HTML and CSS live
When you eventually get out of the habit of pressing F5 for every change you make to your page and start using this feature you’ll become a whizz. You can inspect and modify the entire DOM on the fly with all changes appearing live.

Debug Javascript
Not only will Firebug notify you with a statusbar area the number of errors in your document but you can open the Firebug console to get further detailed information on any errors, including their location and debug messages.
You can even execute any javascript commands from the Firebug console allowing you to tweak and experiment with the page on the fly.

More info…

Logging
You can enter anywhere in your javascript code the logging commands to get information on a variety of variables and objects as your code runs. Which is so much more freindly and efficient than the old school “alert()” method.

console.log(myVar); //echos the var to the console
console.dir(myObject); //echos all the variables and methods of the supplied object

More info…

Getting info on objects and variables
On the console you can type a variety of commands but my most heavily used is:

dir(myObject);

It doesn’t look like much but its incredibly useful as it allows you to see all the methods, values and state of the object you pass to it. You can do it with anything in your document, including the document itself.

Yahoo UI – New DataTable Widget

February 27th, 2007

When I first looked at YUI when I was on the hunt for a simple yet powerful Ajax library I cast it aside in favour of Dojo. Which back then I preffered due to its tag parsing as opposed to pure JS implementation of its various widgets.

However, now I’m getting a bit more into the JS side and it doesn’t feel so daunting I decided to take another look at YUI – and I’m very glad I did. Because since my last foray into this Ajax library they’ve added some interesting new features and widgets (in beta stage).

The one I’ve found to be most useful so far has to be the DataTable. Of all the Ajax tables and grids out there that I’ve seen none come close to Yahoo’s DataTable in its speed (happy to deal with 00000’s of records), efficiency, power and functionality. Pagination, sorting, row number, infinite scrolling of data, inline editing, nested columns, row selection, data sources (accepts JSON, XML & CSV) are all very flexible allowing for an immensely powerful widget that puts Dojo’s table to shame.

After some minor niggles I managed to get my YUI DataTable up & running (with the help of Jenny and Nate at the YUI dev list). My cut down example is here in case anyone needs just another example to make something click.

This was decalred in a seperate JS file (as were all my tables) which was then included in the page.

var itemDataTable;
function exec_item_table(id){
var itemColumnHeaders = [
{key:“item_id”, text:“ID”, sortable:true, type:“number”},
{key:“code”, text:“Code”, sortable:true},
{key:“name”, text:“Name”, sortable:true},
{key:“description”, text:“Desc”, sortable:true},
{key:“qty”, text:“Quantity”, sortable:true},
{key:“unit_cost”, text:“Unit Cost”, sortable:true}
];

var itemColumnSet = new YAHOO.widget.ColumnSet(itemColumnHeaders);

// Point to a local or proxy URL
var itemDataSource = new YAHOO.util.DataSource(“http://localhost/bms/bms_ajax.php”);

// Set the responseType as TEXT
itemDataSource.responseType = YAHOO.util.DataSource.TYPE_TEXT;

// Define the data schema
itemDataSource.responseSchema = {
recordDelim: “\n“, // Record delimiter
fieldDelim: “,”, // Field delimiter
fields: [“item_id”, “code”, “name”, “description”, “qty”, “unit_cost”] // Field names
};

// Configure pagination features
// The following object literal reiterates default values
var initialRequest = ‘do=items&id=’+ id;
var itemConfigs = {
initialRequest:initialRequest,
pageCurrent: 1, // Show page 1
rowsPerPage: 25, // Show 500 rows
startRecordIndex: 1, // Start at first Record
pageLinksLength: -1, // Show all page numbers in direct links
rowsPerPageDropdown: [10,20,50,100],
singleSelect:true
};
itemDataTable = new YAHOO.widget.DataTable(“itemContainer”, itemColumnSet, itemDataSource, itemConfigs);
itemDataTable.subscribe(“cellClickEvent”, itemDataTable.onEventSelectRow);
}

This being the PHP side which generates the CSV then echoes it out for the JS to pick it up.

$csv_data = ”;
$sql = “SELECT * FROM fran_invoice_items WHERE invoice_id=”.$_GET[‘id’];
$res = mysql_query($sql);

while($row = mysql_fetch_assoc($res)){
$csv_data .= $row[‘item_id’].“,
“.$row[‘code’].“,
“.$row[‘name’].“,
“.$row[‘description’].“,
“.$row[‘qty’].“,
“.$row[‘unit_cost’].“\n“;
}

//You need to trim the last "\n" otherwise the DT won’t render.
$csv_data = trim($csv_data);
echo $csv_data;

Some important points I mentioned on the mailing list are:

  • At the moment there’s no way of having the page numbers for the table at just the top or the bottom. They’re always at both ends. I made a feature request for this but there was a workaround offered by one of the members on the list which you can find here.
  • Whenever I had a column with the “key” as “id” it seemed to assume I meant the YUI generated row ID rather than the fieldname of my data field I sent using CSV. A simple name change sorted it but just a heads up if you try using “id” as a key name in your table – don’t. Give it a name like: “thing_id”.
  • Refreshing the table data after making an edit to the records can be done by re-instantiating the table.

A Good Rails/Ruby VPS

August 12th, 2006

Java and Linux VPS Hosting by RimuHosting

I’ve seen a number of posts recently of people wanting to set up or upgrade Rails/Ruby on their shared hosting accounts. My blog is still on the ASO shared hosting but I’m slowlyt moving everything across to my Rimu Hosting VPS. I’ve been using the RimuHosting VPS plan for about a month now. What I can atest to is their quality of service and friendly staff.

Ruby on Rails is also set up for you on signup if requested and they know the requirements and how to deal with Rails setups without any problems. You get a choice of RHEL 4, Fedora Core 5 or Ubuntu as your server distro. They have comprehensive How To’s and a Bliki for helping with other aspects of running your VPS too.

On top of that – they’re very well priced for the service you get so I should think many of those using shared hosting could afford to get a Rimu account – therefore removing many of the issues of upgrading and installing Rails apps on a shared service.