Thursday, August 11, 2011

Google Spreadsheet Custom Functions

Google spreadsheet functions
Google spreadsheets are a viable browser based alternative to desktop PC spreadsheet programs.  Google spreadsheets can be easily shared over the web and accessed from any device with a web browser.  A particularly exciting feature is the option to create custom spreadsheet functions and macros using JavaScript.  This blog post gives an example showing how easy it is to create a spreadsheet and then write a custom function.  Future posts will explore the powerful features available using macros and automation.
Creating a spreadsheet
To be able to create a spreadsheet it is necessary to have a Google account (for example through GMail).  Documents should then be available as an option at the top of the browser window.  This will display a window similar to that shown below:

Selecting the option to create a spreadsheet will display a window, shown below for a completed spreadsheet using a custom function for decibel addition.  This spreadsheet is viewable on the web.

Creating a spreadsheet function
Custom spreadsheet functions are created in the Script Editor (under the Tools menu).  This will display a window, such as that shown below.  This example shows the complete code for the decibel addition function shown above.  Easy, peasy with JavaScript! Please note this example needs additional error checking and to allow for multiple function arguments (additional ranges and values as input).


As can be seen, it is easy to create custom functions for a spreadsheet using JavaScript. 
More Information
Web sites with further information on Google spreadsheet functions:
Information is available from Mozilla on JavaScript

If you need help creating custom functions for Google spreadsheets please let me know!

Tuesday, August 9, 2011

QR Codes

What is a QR (Quick Response) Code?

A QR code is a two-dimensional bar code, produced in a standardized layout for reading as a digital image.  An example is shown below, linking to my Twitter account:
A QR code is often used to link to a website URL. With a suitable app on a mobile phone a QR code can be scanned and then automatically display a website in the phone browser.

QR codes can also contain a simple text message or information in other formats such as contact details (vCard format), a phone number (for quick dialing), event details (vCalendar format).

 

Why were QR codes developed?

QR codes were developed by Denso, an automotive parts supplier subsidiary of Toyota. Denso needed a way to store detailed information on automotive components, and standard barcodes were not able to store enough information. The use of Japanese Kanji characters exacerbated the problem as more data needs to be recorded to identify each character.

 

Alternatives

There are many other types of bar codes, designed for specialist purposes, such as for airline tickets and for addresses. These codes often use dedicated readers.

An alternative to QR codes which is used in advertizing is the Microsoft Tag. This has a triangular grid and uses color to increase the density of information, reducing the size of tag codes. A dedicated app is available from Microsoft for reading Tag codes.

Why are QR codes becoming so popular?

Browsing the web with a mobile phone is now commonplace and there are many occasions where it is useful to obtain information on the go. QR codes provide one of the simplest ways to provide access to information when using a mobile phone.

 

Where can I get a QR code reader?

There are many QR code readers available as apps for mobile phones, for example:


Phone

QR Code Readers
Android
  • Goggles (Google) can read QR codes, other bar codes and also recognize many products
  • Barcode Scanner(Zxing Team) can scan bar codes, data matrix codes and QR codes
Blackberry
  • Messenger, standard on Blackberry devices, scans codes and can open websites
iPhone
Windows, Symbian and other phones
  • Kaywa Reader, a Java based reader that will work on many Windows mobile and Nokia phones

 

How can I create a QR code?

There are many web sites which can be used to create QR codes. The following are good for getting started:

  • QR Code Generator - a useful website maintained by Kerem Erkan and can be used to create QR codes in different formats
  • The Google chart API can be used to generate QR codes programaticaly
  • bit.ly, the URL shortener, creates a QR code for every shortened URL
Websites with more information include: