Home

For the area of Buckley, Flintshire, Wales known as Bistre, see Buckley. Bistre's appearance is generally of a dark grayish brown, with a yellowish cast. — “Bistre - Wikipedia, the free encyclopedia”, en.wikipedia.org

Asynchronous Web SQL Database

posted 24 Jul 2011, 21:22 by Bevan Coleman

The 'current' database (it will be replaced) that implimented in most mobile browers is very much asynchronous. Given that this is on a JavaScript platform it makes a lot of sense for it to be this way, but it does mean that it works is a very non SQL way.
 
Most people are used to an atomic database such as SQL Server, MySql, SQLite, etc... were one would expect that an INSERT followed by an SELECT (for the same data) would return the newly entered data. However as the database (which is still SQLite) has been wrapped in an Javacript style asynchronous mathods you can not be sure that is the case (the INSERT may not finish untill AFTER teh select has run).
 
The solution to this is to use the provide 'success' callbacks on all the database methods to insure that the SELECT (in my example) is not run until after the INSERT. For simple situations this works fine (and is a fairly standard JavaScript patten). However when you have a number of SQL queries that are dependant on each other the nesting can get quite deep and it does make the code hard to read.
 
After a bit of looking I've remember jQuery adding a new Defered Object sub-system in v1.5. What this allows is syntax like so;
 
var dfd = $.Deferred().DoInsert.done(DoSelect).done(DoSomethingelse);
 
This allows the same effect as using nestted callbacks, but without the depth and in a mucher easier to read syntax.
 
 
 
 

Processing XML with jQuery

posted 20 Jul 2011, 05:45 by Bevan Coleman

So easy :)

$.ajax({
  type: "GET",
  url: "books.xml",
  dataType: "xml",
  success: function(xml) {
    $(xml).find('record').each(function() {
      var uuid = $(this).find('uuid').text();
      var publisher= $(this).find('publisher').text();
      var rating = $(this).find('rating').text();
      var isbn = $(this).find('isbn').text();
      var title = $(this).find('title').text();
      var titleSort = $(this).find('title').attr('sort');
      var authors = []; $(this).find('authors author').each(function() { 
        authors.push($(this).text()) 
      }); 
      var tags = []; $(this).find('tags tag').each(function() { 
        tags.push($(this).text()) 
      }); 
      var comments = $(this).find('comments').text();
      var series = $(this).find('series').text();
      var seriesIndex = $(this).find('series').attr('index');
      ...
      ...
    });
  }
});

HTML5 book catalog

posted 18 Jul 2011, 06:01 by Bevan Coleman

I've started a new project to create a HTML5 mobile app to catalog books. See HTML5 mobile book catalog in my projects.

Performance is a Feature

posted 20 Jun 2011, 18:40 by Bevan Coleman

It goes into great detail, but the quotes at the top summarize it well;

“[Google found that] the page with 10 results took 0.4 seconds to generate. The page with 30 results took 0.9 seconds. Half a second delay caused a 20% drop in traffic. Half a second delay killed user satisfaction.”

 “In A/B tests, [Amazon] tried delaying the page in increments of 100 milliseconds and found that even very small delays would result in substantial and costly drops in revenue.”

 http://www.codinghorror.com/blog/2011/06/performance-is-a-feature.html

CDN Catalog

posted 15 Jun 2011, 00:41 by Bevan Coleman

Don't know what Javascript libraries are hosted on what CDN (Content Delivery Network), well the CDN Catalog site lists whats on the Microsoft, Google, AOL and Yahoo CDNs.

http://www.cdncatalog.com/

The big name scripts included are;
  • jQuery
  • jQuery.UI
  • jQuery Validate
  • Mootools
  • Prototype
  • SWFObject
  • WebFont Loader


A.R. Drone coming to Android

posted 7 Jun 2011, 16:45 by Bevan Coleman

Fan's of the A.R. Drone (or thoughs whom just like the idea) will be happy to know that they are releasing an Android of version of the control software. 

Now your Droid can control your Drone ;)

Read more here arstechnica


Pinta, cross-platform clone of Paint.Net

posted 6 Jun 2011, 07:08 by Bevan Coleman

Fans of Paint.Net will be happy to know that clone called Pinta has hit v1.0.

Paint.Net is one of the best open source applications I have ever used. It's fast, bug free, has a nice clean interface. And now a cross platform version has been release. It is a good day :) 

O'Reilly 50% Discount Code for Ebooks

posted 5 Jun 2011, 02:08 by Bevan Coleman

Just garbed some books on XNA, WCF and HTML5 apps for iPhone (and other devices with WebKit browser) at 50% off. When you consider we pay nearly twice RRP for the same ebook in a local Australian store, paying only a quarter is a really good deal :)

The code is 4CAST, it appears to apply to any ebooks and I don't know when it expires so I'd use it while you can.

schema.org - 'microdata' specification for SEO

posted 2 Jun 2011, 17:45 by Bevan Coleman

The big search engines (Google, Bing, Yahoo) have published a common schema for improving how search engines index pages. This is done by adding in “microdata” attributes to your HTML so the search index gets better (some?) context of what it's processing.

Could be big stuff for some sites!

http://googleblog.blogspot.com/2011/06/introducing-schemaorg-search-engines.html

 http://schema.org/

An example Design Specification 'Lite'

posted 30 May 2011, 23:55 by Bevan Coleman

I've been working of developer documentation recently and came up with this light-weight Design Specification template.

The idea is that it's not too difficult for a developer to fill out (provides hints as part of the document) but is detailed enough that it covers all the bases (and backsides) and demonstrates that the developer has at least though about their time estimate.
 
Design Specification lite

1-10 of 10