Jan 24 2011

Missing Feature: The Mobile Device Self Destruct Button

I use Apple’s Mobile Me service. I got the first year subscription as a gift a little over a year ago and I recently renewed the service for another year. I don’t use the email or calendar service in Mobile Me much but one feature that is worth its price is the Find My iPhone locator feature. This feature lets you track the location of your iOS device, it lets you put an alert message on your iPhone or iPad, and it lets you ring the iPhone (even if it’s on vibrate or silence mode). I’ve used it once when I lost my phone under the couch and I couldn’t find it. It also lets you lock down or even wipe your missing iOS device of all personal and identifying data.

Apple's Mobile Me

Apple's Mobile Me

All mobile devices, from phones, tablets, and to laptops should have a built it self destruct feature that when activated would destroy all data on a compromised device. It is my belief that a phone is a very intimate and personal device, there is so much personal data in my phone from private contact lists, to confidential business emails, to other dubious activities that I may or may not be involved in.

In addition to having the ability to destroy incriminating data from a mobile device, such as an iPhone or iPad, I want the ability to program rules into the phone. Such as if the phone has not been unlocked in over 24 hours, or if the attempted to unlocked more than three times, if it activated with a given specific code, if it is located in a known police or government building, etc.

Find My iPhone

Find My iPhone


Nov 9 2010

The Programmer’s Triforce

I don’t remember where I read it or hear it, but the idea that a computer program is a combination of code and data has stuck with me. I would only add that a great computer program is designed with the user experience in mind. There is a design pattern that embodies this idea of code, data, and user experience is Model-View-Controller. This combination of programming and design elements forms a foundation of any program I’ve designed that it manifests in The Programmer’s Triforce.

The Programmer's Triforce

The Programmer's Triforce


Sep 4 2010

Use Google Forms For Building Simple Surveys and Polls

I use Google Documents to manage drafts of blog posts, to keep track of house hold finances, and even to manage an invite list to gatherings at my house. You can do a lot with nothing more than Google Docs. Recently I had to help a friend create a small informal survey to use with her clients and we choose Google Docs from her Google Apps for Domain account. In this article, I’ll go through the motions of creating and using a simple form in Google Docs which can be used in polls, surveys, or questionnaires.

Create New Form in Google Docs

Create New Form in Google Docs

Log into you Google Docs account and create a new Form document. Creating a new Form document takes you to the Form builder which allows you to enter a title and description for your form and any number of questions. For each question, be sure to enter the question itself, any short description to describe the question further, and the question type. There are several question types, most common are the text, multiple choice, checkbox, list, and scale. You can use the text question type for things like persons name, addresses, city, etc. The multiple choice question type is also known as the radio button, meaning that out of several choices you can only select one. The checkbox allows you to check multiple choices at the same time. The scale question type can be use to identify a range between 1 and 5 of how much a person liked the product or service being asked about.

Google Docs Form Editor

Google Docs Form Editor

Once you filled out your form, you can choose a theme. As of this writing there are over 90 themes available, from plain to whimsical. With the form done you can email the form, make it public, or embeddable in a blog or website. If you reopen the form, you will be presented with the spreasheet view of the form. The form data is saved in the spreadsheet, to view or edit the form again, click Form | Edit Form under the main menu.

Google Docs Form Sharing Settings

Google Docs Form Sharing Settings

You can have three basic sharing options. You can make the form public to everyone in the web, or available to only those that have a link for it, or those you explicitly grant access to.

If you run a small business or a large family, you can use Google Docs to create forms for surveys, polls, questionnaires, or even a small customer relationship management system.


Oct 8 2009

Jamming with Ruby YAML

When working with Ruby, the library/class I use and abuse most often is YAML. YAML stands for YAML Ain’t Markup Language and it is a versatile human friendly data serialization format. It is easier to use and understand than JSON.

A YAML file is much like a Java properties file in that is used to store name/value pairs. YAML is more powerful than simple Java properties file but that is a good way to think of it to begin with. Here is a example of a simple YAM file used to store user name and password.

user: juixe-username
pass: juixe-password

The above YAML snippet can go into a file, typically with a yml extension. To load the YAML file in ruby you can do it in with following Ruby code.

require 'yaml'

yml = YAML::load(File.open('userinfo.yml'))
puts yml['user'] # juixe-username

Just replace userinfo.yml with the name and path of your YAML file. The object that is loaded from the YAML file is a regular Ruby hash object so you can iterate through all the name/value pairs like the following.

require 'yaml'

yml = YAML.load_file 'userinfo.yml'
yml.each_pair { |key, value|
  puts "#{key} = #{value}"
}

What makes YAML files more powerful than a regular Java properties file is that you can complex object collections, structures, or hierarchies. For example, imagine that I want to log into a series of Twitter accounts and get their most recent at replies. I can keep a collection of twitter account usernames and passwords in a YAML file much like the following.

juixe:
 user: juixe-user
 pass: juixe-pass
techknow:
 user: techknow-user
 pass: techknow-pass

Here is the sample Ruby code that can be used to iterate through each user account from the YAML file.

require 'yaml'

yml = YAML.load_file 'userinfo.yml'
yml.each_key { |key|
  username = yml[key]['user']
  password = yml[key]['pass']

  puts "#{username} => #{password}"
  # login ...
}

You build more complex data structures than this using YAML, but this should be enough to get you going.