Categories
Uncategorized

iOS Fortnightly Tutorial: A Simple Weather App, Part 1

simpleweather running 4

Welcome to the second installment of iOS Fortnightly, Global Nerdy’s iOS programming tutorial series! If you’ve got a little experience with an object-oriented programming languages, whether it’s client-side JavaScript, server-side Perl, PHP, Python, or Ruby, or desktop Java, C#, or Visual Basic, this series is for you. Every fortnight — that’s a not-so-common word for “two weeks”, I’ll post a tutorial showing you how to write a simple but useful app that you can use as the launching point for your own iOS development projects. The idea behind iOS Fortnightly is to help you become familiar with mobile app development, the Objective-C programming language, the Cocoa Touch programming framework, and iOS application design.

ios fortnightly tutorials

In case you missed the previous iOS Fortnightly installment, go check it out. It’s a simple “Magic 8-Ball” app, but it’s the perfect starter app for someone who’s new to iOS development.

With the introduction out of the way, let’s move on to this fortnight’s app, a simple weather app. Let me start with what I think will be an iOS Fortnightly tradition — the video:

Question 1: Where Will the Weather Data Come From?

open weather map

I decided to go with Open Weather Map, a free-as-in-beer/free-as-in-speech weather data and forecast API in the spirit of Wikipedia and OpenStreetMap. While they recommend the use of a key to access the API (also free), it’s not absolutely necessary, which means that you can get started writing a weather app without having to sign up for an API key and waiting for approval. With a simple HTTP GET call, you can use it to get the current weather for a location that you can specify by:

  • City name,
  • Latitude and longitude, or
  • Numeric city ID

Here’s a sample call to Open Weather Map’s API for the current weather in my current location, Toronto, Canada:

http://api.openweathermap.org/data/2.5/weather?q=Toronto,CA

Here’s the resulting JSON object that came back when I wrote this article. Your results may vary, seeing as you’ll be making the call at a different day and time, but the format will be the same. It comes out as one long, continuous string; I’ve reformatted it so that it’s easier to read:

{"coord":{"lon":-79.416298,
          "lat":43.700111},
"sys":{"country":"CA",
       "sunrise":1378032138,
       "sunset":1378079546},
"weather":[{"id":701,
            "main":"Mist",
            "description":"mist",
            "icon":"50n"}],
"base":"gdps stations",
"main":{"temp":294.11,
        "humidity":93,
        "pressure":1009,
        "temp_min":292.59,
        "temp_max":295.15},
"wind":{"speed":1.3,
        "deg":187.501},
"rain":{"3h":0},
"clouds":{"all":0},
"dt":1378007487,
"id":6167865,
"name":"Toronto",
"cod":200}

Here’s a run-down of the returned object’s keys and values:

Element Description
cod The HTTP status code.
clouds The cloudiness, expressed as an object with a single key:

  • all: The cloud cover, expressed as a percentage (0 – 100).
coord The coordinates of the location for the weather report, expressed as an object with two keys:

  • lat: The location’s latitude, expressed in degrees (- is west, + is east)
  • lon: The location’s longitude, expressed in degrees (- is south, + is north)
dt Time the weather report was sent in the GMT time zone, expressed in Unix time.
main The quantitative weather, expressed as an object with these keys:

  • humidity: The humidity, expressed as a percentage (0 – 100).
  • pressure: The air pressure, in hectopascals (hundreds of pascals; 1 hectopascal is equal to one millibar).
  • temp: The current temperature, in degrees kelvin (1 degree kelvin = 1 degree celsius, 0 degrees C = 273.15 K).
  • temp_max: The predicted maximum temperature, in degrees kelvin.
  • temp_min: The predicted minimum temperature, in degrees kelvin.
name The name of the town or city closest to the location for the weather report.
rain The amount of rain expected to fall, expressed an object with this key:

  • 3h: Expected rainfall over the next 3 hours, in millimetres.
snow The amount of snow expected to fall, expressed as an object with this key:

  • 3h: Expected snowfall over the next 3 hours, in millimetres.
sys Other time and location data, expressed as an object with these keys:

  • country: The country in which the location for the weather report is located, expressed as an ISO two-letter country code.
  • sunrise: The time when sunrise will occur at the location for the weather report, expressed in Unix time.
  • sunset: The time when sunset will occur at the location for the weather report, expressed in Unix time.
weather The qualitative weather, expressed as an array containing one or more objects with the following keys:

  • description: A plain English description of the weather.
  • icon: The filename of the icon corresponding to the current weather. The full URL of the icon is http://openweathermap.org/img/w/filename.png.
  • id: The weather condition code, expressed as a three-digit number. See Open Weather Map’s “weather condition codes” page for an explanation of the codes.
wind The wind, expressed as an object with the following keys:

  • deg: Wind direction in meteorological degrees (0 is a north wind — that is, coming from the north, 90 is east, 180 is south, 270 is west).
  • speed: Wind speed in metres per second.

Question 2: How Will Open Weather Map’s Data be Accessed?

afnetworkingApple’s Cocoa Touch framework has its own class for downloading the contents of an URL — NSURLConnection — but we’ll use a third-party library that’s even simpler to use: AFNetworking, which describes itself as “a delightful networking framework for iOS and OSX” and is used at fine institutions such as Github, Heroku, and Pinterest.

Question 3: How Do We Include AFNetworking in an iOS Project?

cocoapodsAFNetworking can be manually included in a project, but I thought this would be a good opportunity to show the use of CocoaPods, the easy Ruby-based library dependency manager.

To install Cocoapods, fire up Terminal and type in the following lines:

$ sudo gem install cocoapods
$ pod setup

Create the Project

As with the previous project, we start with From the menu bar, choose File → New → Project…. You’ll see this:

single view application

Once again, this application will happen on a single screen, so we’ll go with a single-view application:

  • In the left column, under iOS, make sure that Application is selected.
  • In the big area on the right, select Single View Application.

Click Next to proceed to the next step:

choose options for project

On the “Choose options” screen…

  • Give your app a name by entering one into the Product Name field. I’m going with SimpleWeather.
  • Make sure that in the Devices menu, iPhone is selected.
  • Check the Use Storyboards checkbox.
  • Make sure that the Use Automatic Reference Counting checkbox is checked.

Click Next to proceed to the next step:

save project

Do this:

  • Choose the directory where your project will be saved. Your project will be saved in a directory inside the directory you chose.
  • Check the Create local git repository for this project checkbox. Git’s a good habit to get into, and there’ll come a time when being able to backtrack to a previous version of your code will save your bacon.
  • Make sure that the selection in the Add to: menu is Don’t add to any project or workspace.
  • Click the Create button.

So far, this isn’t all that different from the setup for the previous project. Here’s where it’s different — first, close the project. That’s right; close the project. We’re going to set up Cocoapods to bring AFNetworking into the project. Open the text editor of your choice and enter the following:

platform :ios, '6.0'
pod 'AFNetworking', '~> 1.3.2'

Save the file in your project directory. Double-check that it’s in the right place:

$ pwd
/Users/joey/Developer/iOS/Demo Apps/SimpleWeather
$ ls
Podfile			SimpleWeather		SimpleWeather.xcodeproj
$ cat Podfile
platform :ios, '6.0'
pod 'AFNetworking', '~> 1.3.2'

Once you’ve confirmed that the files are in the right place, install AFNetworking by entering pod install at the command line while in your project’s directory:

$ pod install
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (1.3.2)
Generating Pods project
Integrating client project

[!] From now on use `SimpleWeather.xcworkspace`.

As the command-line output states, you should now open the project using SimpleWeather.xcworkspace, the full workspace file:

simpleweather.xcworkspace

Open the project by double-clicking on SimpleWeather.xcworkspace:

projects

If you look at the Project Navigator on the left side of Xcode’s window, you’ll see that the workspace is made up of two projects:

  • SimpleWeather, our weather app project, where we’ll be doing our work, and
  • Pods, which contains the AFNetworking code. We won’t touch it, but we’ll use its functionality to grab the weather info from Open Weather Map.

(If you want to find out more about workspaces, see this section of Apple’s documentation.)

Next step: drawing a quick user interface.

Draw the User Interface

In the Project Navigator on the left side of the Xcode window, select MainStoryboard.storyboard. Once again, we’re not going to bother with autolayout — we’re not quite at the fancy UI phase yet — so select the File Inspector on the right side of the window, and uncheck the Autolayout box:

screen 1

Click the screen capture to see it at full size.

Now to draw some controls on the view. In the Object Library, select Controls from the drop-down menu to narrow down the selection in the Object Library to just the UI controls. Drag the following from the Object Library onto the view:

  • A Label to a spot to near the top of the screen. Double-click it to edit its text, and change it to Where’s the weather in:.
  • A Text Field to just below the label, and stretch it to nearly the full width of the view.
  • A Round Rect Button to just below the text field. Double-click it to edit its text, and change it to Tell Me.

screen 2

Click the screen capture to see it at full size.

Connect the Controls to Code

First, let’s create an action for the Tell Me button:

  • Select the Assistant Editor so that both the storyboard and view controller header code in ViewController.h are both on display.
  • Select the Tell Me button, and then either right-click or control-click it. A grey window will pop up beside it, which will display actions and outlets.
  • Drag from the circle beside Touch Up Inside into the view controller header code, anywhere between @interface and @end.

screen 3

Click the screen capture to see it at full size.

In the little window that pops up:

  • Give the action a name. I used tellMeButtonPressed.
  • Make sure that the Event is Touch Up Inside.
  • Click the Connect button.

tellmebuttonpressed

You should now have the following line in the view controller header:

- (IBAction)tellMeButtonPressed:(id)sender;

First, let’s create an outlet for the text field:

  • Select the text field, and as we did with the button, right-click or control-click it. As with the button, a grey window will pop up beside it, which will display actions and outlets.
  • Drag from the circle beside New Referencing Outlet into the view controller header code, anywhere between @interface and @end.

screen 4

Click the screen capture to see it at full size.

locationtextField

In the little window that pops up:

  • Give the outlet a name. I used locationTextField.
  • Make sure that the Type is UITextField and that the Storage is Weak.
  • Click the Connect button.

You should now have the following line in the view controller header:

- (IBAction)tellMeButtonPressed:(id)sender;

With the action and outlet code inserted into the header, I did a little rearranging so that it looks like this:

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

// Outlets
// =======
@property (weak, nonatomic) IBOutlet UITextField *locationTextField;

// Actions
// =======
- (IBAction)tellMeButtonPressed:(id)sender;

@end

Commit the Changes

Now’s a good time to commit the changes to git. Choose File → Source Control → Commit… from the menu bar. The “diffs” window will appear, which lets you see the changes you’re about to commit:

commit 1

Click the screen capture to see it at full size.

Enter a commit message — something like “Added controls and their actions and outlets”, then click the Commit 4 Files button to commit the changes.

Create a Model Class for the Weather Data

As I mentioned in the last article in the series, iOS apps are built on the Model-View-Controller pattern. Here’s how we’ll apply the pattern in this app:

simpleweather mvc

We’ve already got a view and view controller from the project setup work we’ve done — let’s create a model class. From the menu bar, File → New → File…. You’ll be presented with this dialog box:

Select Cocoa Touch from the sidebar on the left, then select Objective-C class, then click Next. You’ll see this:

create weather

Provide a name for the class. I gave mine the name Weather and made it a subclass of NSObject, the ultimate base class for every class in Objective-C. Once that’s done, click Next. You’ll be taken to the dialog box to save the class:

save class

Click Create to save the new class files. You can see them in the Project Navigator, marked with the letter A, denoting files that have been added since the last commit:

weather.h and weather.m

Now that we’ve got files for the Weather class’ interface (the header file, Weather.h) and implementation (the module file, Weather.m), let’s code! Let’s take care of the header first, where we specify the properties and methods that our model exposes:

Weather.h

#import <Foundation/Foundation.h>

@interface Weather : NSObject

// Properties
// ==========

// Place and time
@property (nonatomic, copy, readonly) NSString *city;
@property (nonatomic, copy, readonly) NSString *country;
@property (nonatomic, readonly) CGFloat latitude;
@property (nonatomic, readonly) CGFloat longitude;
@property (nonatomic, copy, readonly) NSDate *reportTime;
@property (nonatomic, copy, readonly) NSDate *sunrise;
@property (nonatomic, copy, readonly) NSDate *sunset;

// Qualitative
@property (nonatomic, copy, readonly) NSArray *conditions;

// Quantitative
@property (nonatomic, readonly) NSInteger cloudCover;
@property (nonatomic, readonly) NSInteger humidity;
@property (nonatomic, readonly) NSInteger pressure;
@property (nonatomic, readonly) NSInteger rain3hours;
@property (nonatomic, readonly) NSInteger snow3hours;
@property (nonatomic, readonly) CGFloat tempCurrent;
@property (nonatomic, readonly) CGFloat tempMin;
@property (nonatomic, readonly) CGFloat tempMax;
@property (nonatomic, readonly) NSInteger windDirection;
@property (nonatomic, readonly) CGFloat windSpeed;

// Methods
// =======

- (void)getCurrent:(NSString *)query;

@end

Note that what the model exposes is mostly properties and a single method, getCurrent. The idea is to call getCurrent with a query term, which can be a city name, a latitude/longitude pair, or a numeric city code. The model makes a call to Open Weather Maps using the query term, and uses the result to populate the model’s properties, which are then access by the view controller.

I’ll cover what all the @property stuff means in an article to follow.

Now that we have an interface, let’s code up the implementation:

Weather.m

#import "Weather.h"
#import "AFNetworking.h"

@implementation Weather {
    NSDictionary *weatherServiceResponse;
}

- (id)init
{
    self = [super init];

    weatherServiceResponse = @{};

    return self;
}

- (void)getCurrent:(NSString *)query
{
    NSString *const BASE_URL_STRING = @"http://api.openweathermap.org/data/2.5/weather";

    NSString *weatherURLText = [NSString stringWithFormat:@"%@?q=%@",
                                BASE_URL_STRING, query];
    NSURL *weatherURL = [NSURL URLWithString:weatherURLText];
    NSURLRequest *weatherRequest = [NSURLRequest requestWithURL:weatherURL];

    AFJSONRequestOperation *operation =
    [AFJSONRequestOperation JSONRequestOperationWithRequest:weatherRequest
                                                    success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
                                                        weatherServiceResponse = (NSDictionary *)JSON;
                                                        [self parseWeatherServiceResponse];
                                                    }
                                                    failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) {
                                                        weatherServiceResponse = @{};
                                                    }
     ];

    [operation start];
}

- (void)parseWeatherServiceResponse
{
    // clouds
    _cloudCover = [weatherServiceResponse[@"clouds"][@"all"] integerValue];

    // coord
    _latitude = [weatherServiceResponse[@"coord"][@"lat"] doubleValue];
    _longitude = [weatherServiceResponse[@"coord"][@"lon"] doubleValue];

    // dt
    _reportTime = [NSDate dateWithTimeIntervalSince1970:[weatherServiceResponse[@"dt"] doubleValue]];

    // main
    _humidity = [weatherServiceResponse[@"main"][@"humidity"] integerValue];
    _pressure = [weatherServiceResponse[@"main"][@"pressure"] integerValue];
    _tempCurrent = [Weather kelvinToCelsius:[weatherServiceResponse[@"main"][@"temp"] doubleValue]];
    _tempMin = [Weather kelvinToCelsius:[weatherServiceResponse[@"main"][@"temp_min"] doubleValue]];
    _tempMax = [Weather kelvinToCelsius:[weatherServiceResponse[@"main"][@"temp_max"] doubleValue]];

    // name
    _city = weatherServiceResponse[@"name"];

    // rain
    _rain3hours = [weatherServiceResponse[@"rain"][@"3h"] integerValue];

    // snow
    _snow3hours = [weatherServiceResponse[@"snow"][@"3h"] integerValue];

    // sys
    _country = weatherServiceResponse[@"sys"][@"country"];
    _sunrise = [NSDate dateWithTimeIntervalSince1970:[weatherServiceResponse[@"sys"][@"sunrise"] doubleValue]];
    _sunset = [NSDate dateWithTimeIntervalSince1970:[weatherServiceResponse[@"sys"][@"sunset"] doubleValue]];

    // weather
    _conditions = weatherServiceResponse[@"weather"];

    // wind
    _windDirection = [weatherServiceResponse[@"wind"][@"dir"] integerValue];
    _windSpeed = [weatherServiceResponse[@"wind"][@"speed"] doubleValue];
}

+ (double)kelvinToCelsius:(double)degreesKelvin
{
    const double ZERO_CELSIUS_IN_KELVIN = 273.15;
    return degreesKelvin - ZERO_CELSIUS_IN_KELVIN;
}

@end

As with the .h file, I’ll explain what’s in the .m file in an article to follow.

Connect the Model to the View Controller

We’ve got a functioning model, and a view controller connected to a view. It’s now time to make the final MVC connection: the one that links the model to the view controller. Change the code in ViewController.m to:

ViewContoller.m

#import "ViewController.h"
#import "Weather.h"

@interface ViewController ()

@end

@implementation ViewController {
    Weather *theWeather;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    theWeather = [[Weather alloc] init];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

- (IBAction)tellMeButtonPressed:(id)sender
{
    [theWeather getCurrent:self.locationTextField.text];

    NSString *report = [NSString stringWithFormat:
                        @"Weather in %@:\n"
                        @"%@\n"
                        @"Current temp.: %2.1f C\n"
                        @"High: %2.1f C\n"
                        @"Low: %2.1f C\n",
                        theWeather.city,
                        theWeather.conditions[0][@"description"],
                        theWeather.tempCurrent,
                        theWeather.tempMax,
                        theWeather.tempMin
                        ];
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Current Weather"
                                                    message:report
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
    [alert show];
}

@end

I’ll explain more about this code in a later article.

Run the App

We’ve got all the code we need for a working weather app. It won’t be slick, but it will work. When you run the app, you should see this:

simpleweather running 1

Enter the name of a city into the text field. In my case, I used my own city, Toronto, then tapped the Tell Me button:

simpleweather running 2

The first time you do this, you’ll most likely see a result like the one below. Don’t let it bother you for the time being:

simpleweather running 3

Don’t worry about this for now. I’ll explain why this happens in a follow-up article.

Dismiss the alert box by tapping the OK button, then tap the Tell Me button again. You should see some better results this time:

simpleweather running 4

That’s It for Now

Congratulations! You now have a working weather app. I’ll post a few follow-up articles featuring tweaks to the app, as well as explanations of the code behind it. In the meantime, commit your changes, and more importantly, play around with the code. Experiment. Tweak. Look up anything that seems odd, unfamilair or interesting!

If you have any questions or comments, or got stuck or encountered an error while doing this tutorial, let me know — either in the comments or by dropping me a line!

Categories
Uncategorized

Bakers and Accordions! (Or: What Every Tech Ad Seems to Have)

bakers and accordions

College Humor hits the nail on the head in their parody, Every Tech Commercial, which features the tropes and cliches of…every tech commercial. It also says what I’ve been saying — and demonstrating — for years: you can’t properly promote technology without an accordion.

This article also appears in The Adventures of Accordion Guy in the 21st Century.

Categories
Uncategorized

Grand Theft Auto V’s Official Trailer

now with submarines

While Bioshock Infinite will likely claim the “game of the year” crown for 2013 (and rightfully so), a lot of us are still looking forward to the upcoming Grand Theft Auto V, featuring the voice of Ray Liotta. The official trailer hit the ‘net today:

Here are all the Grand Theft Auto IV trailers in one video:

Here’s the trailer for Grand Theft Auto: San Andreas

Here’s one of the original trailers for Grand Theft Auto: Vice City

…and here’s the trailer for Vice City’s 10th Anniversary edition:

And for you Grand Theft Auto fans that have about 50 minutes to kill, here’s GamerSpawn’s documentary on the history of Grand Theft Auto:

Categories
Uncategorized

Playing to My Strengths

Good Advice from Johnny Bunko

johnny bunko coverA few years back, Daniel “A Whole New Mind” Pink wrote and Rob Ten Pas illustrated a manga career guide titled Johnny Bunko: The Last Career Guide You’ll Ever Need. The trailer — that’s right, this book has a trailer — gives a quick overview:

One of the key pieces of advice that book gives is “Think strengths, not weaknesses”. It’s covered in this excerpt, in which Johnny, who’s trapped in a dead-end job, gets an important lesson from Diana, the magical career advisor who appears whenever he breaks apart a pair of special chopsticks:

bunko strengths 1

bunko strengths 2

The names on those two bobbleheads are:

bunko strengths 3

Strengths

Buckingham, with Donald O. Clifton, wrote a book titled Now, Discover Your Strengths, which is tied to a Gallup personal assessment system called StrengthsFinder. It features a test that measures you along 34 dimensions called “talent themes” that everyone has to varying degrees. The goal of the test is to find your “top five” themes — the things that have the greatest impact on your behaviour and performance — so that you can focus on them.

The themes fall into four different domains of leadership strength…

  • Executing: Team members who have a dominant strength in the Executing domain are those whom you turn to time and again to implement a solution. These are the people who will work tirelessly to get something done. People who are strong in the Executing domain have an ability to take an idea and transform it into reality within the organization they lead.
  • Influencing: People who are innately good at influencing are always selling the team’s ideas inside and outside the organization. When you need someone to take charge, speak up, and make sure your group is heard, look to someone with the strength to influence.
  • Relationship building: Relationship builders are the glue that holds a team together. Strengths associated with bringing people together — whether it is by keeping distractions at bay or keeping the collective energy high — transform a group of individuals into a team capable of carrying out complex projects and goals.
  • Strategic thinking: Those who are able to keep people focused on “what they could” be are constantly pulling a team and its members into the future. They continually absorb and analyze information and help the team make better decisions.

…and the themes themselves are:

strengthsfinder themes

The accented themes — Activator, Woo, Positivity, Ideation, and Strategic — are special, at least to me. They’re my strengths.

Here’s a brief description of each of the themes, and this PDF (221k) provides a more detailed description of each one.

My Strengths

As I wrote in an earlier post, there were a number of things I enjoyed about my tenure at Microsoft. One of those things were the many perks that they provided for their employees, which included some personal health and development goodies, and one of them was the Gallup StrengthsFinder test. As part of the annual team-building exercise for the Developer and Platform Evangelism group in Canada have taken it, I’ve taken it twice (on Microsoft’s dime, of course), and the results have been consistent. If you get the opportunity, you should take the StrengthsFinder test. There isn’t much better advice than “know thyself”, and having seen my own results, as well as those of my former teammates, I’d have to say it’s pretty accurate.

While going through some paper files in my home office, I found my last StrengthsFinder evaluation and thought, “Hey, why not post this for kicks?” A quick scan and an OCR later, I had something ready to copy and paste into a blog entry, and here it is for your reading pleasure. Enjoy!

My “top 5” strengths are, in order, with the first one being my strongest:

  1. Positivity: People strong in the Positivity theme have an enthusiasm that is contagious. They are upbeat and can get others excited about what they are going to do.
  2. Strategic: People strong in the Strategic theme create alternative ways to proceed. Faced with any given scenario, they can quickly spot the relevant patterns and issues.
  3. Woo: People strong in the Woo theme love the challenge of meeting new people and winning them over. They derive satisfaction from breaking the ice and making a connection with another person.
  4. Ideation: People strong in the Ideation theme are fascinated by ideas. They are able to find connections between seemingly disparate phenomena.
  5. Activator: People strong in the Activator theme can make things happen by turning thoughts into action. They are often impatient.

I think that sums me up rather nicely. The detailed report appears below.

1. Positivity

You are generous with praise, quick to smile, and always on the lookout for the positive in the situation. Some call you lighthearted. Others just wish that their glass were as full as yours seems to be. But either way, people want to be around you. Their world looks better around you because your enthusiasm is contagious. Lacking your energy and optimism, some find their world drab with repetition or, worse, heavy with pressure. You seem to find a way to lighten their spirit. You inject drama into every project. You celebrate every achievement. You find ways to make everything more exciting and more vital. Some cynics may reject your energy, but you are rarely dragged down. Your Positivity won’t allow it. Somehow you can’t quite escape your conviction that it is good to be alive, that work can be fun, and that no matter what the setbacks, one must never lose one’s sense of humor.

Action items for the Positivity theme:

  • You will excel in any role in which you are paid to highlight the positive. A teaching role, a sales role, an entrepreneurial role, or a leadership role will utilize your ability to make things dramatic.
  • You tend to be more enthusiastic and energetic than most people. When others become discouraged or are reluctant to take risks, your attitude will provide the impetus to keep them moving. Over time, others will start to look to you for this “lift.”
  • Deliberately help others see the things that are going well for them. You can keep their eyes on the positive.
  • Because people will rely on you to help them rise above their daily frustrations, arm yourself with good stories, jokes and sayings. Never underestimate the effect that you can have on people.
  • Plan highlight activities for your colleagues. For example, find ways to turn small achievements into “events,” or plan regular “celebrations” that others can look forward to, or capitalize on the year’s holidays and festivals.
  • Increase the recognition you give to others. Try to tailor it to each person’s need.
  • Be ready to: Avoid negative people. They will bring you down. Instead, seek people who find in the world the same kind of drama and humor that you do. You will energize each other.
  • Be ready to: Explain that your enthusiasm is not simple naivety. You know that bad things can happen; you simply prefer to focus on the good things. Pessimists might superficially seem wiser; they might even sometimes be right-but they are rarely achievers (and, incidentally, optimists have more fun).

2. Strategic

kirk and spock playing chess
The Strategic theme enables you to sort through the clutter and find the best route. It is not a skill that can be taught. It is a distinct way of thinking, a special perspective on the world at large. This perspective allows you to see patterns where others simply see complexity. Mindful of these patterns, you play out alternative scenarios, always asking, “What if this happened? Okay, well what if this happened?” This recurring question helps you see around the next corner. There you can evaluate accurately the potential obstacles. Guided by where you see each path leading, you start to make selections. You discard the paths that lead nowhere. You discard the paths that lead straight into resistance. You discard the paths that lead into a fog of confusion. You cull and make selections until you arrive at the chosen path—your strategy. Armed with your strategy, you strike forward. This is your Strategic theme at work: “What if?” Select. Strike.

Action items for the Strategic theme:

  • Take the time to fully reflect or muse about a goal that you want to achieve until the related patterns and issues emerge for you. Remember that this musing time is essential to Strategic thinking.
  • You can see repercussions more clearly than others. Take advantage of this ability by planning your range of responses in detail. There is little point in knowing where events will lead if you are not ready when they do.
  • Talk with others about the alternative directions you see. Detailed conversations like this can help you become even better at anticipating.
  • Trust your intuitive insights as often as possible. Even though you might not be able to explain them rationally, your intuitions are created by a brain that instinctively anticipates and projects. Have confidence in these intuitions.
  • When the time comes, seize the moment and state your strategy with confidence.
  • Find a group that you think does important work and contribute your Strategic thinking. You can be a leader with your ideas.
  • Learn how to describe what you see “down the road.” Others who do not possess a strong Strategic theme may not anticipate often or well. You will need to be very persuasive if you are to help them avoid future obstacles, or to exploit the opportunities you have seen.
  • Partner with someone with a strong Activator theme. With this person’s need for action and your need for anticipation, you can forge a powerful partnership.

3. Woo

Yours Truly with Robert Scoble at South by Southwest 2008.

Woo stands for winning others over. You enjoy the challenge of meeting new people and getting them to like you. Strangers are rarely intimidating to you. On the contrary, strangers can be energizing. You are drawn to them. You want to learn their names, ask them questions, and find some area of common interest so that you can strike up a conversation and build rapport. Some people shy away from starting up conversations because they worry about running out of things to say. You don’t. Not only are you rarely at a loss for words; you actually enjoy initiating with strangers because you derive satisfaction from breaking the ice and making a connection. Once that connection is made, you are quite happy to wrap it up and move on. There are new people to meet, new rooms to work, new crowds to mingle in. In your world there are no strangers, only friends you haven’t met yet—lots of them.

Action items for the Woo theme:

  • Choose a job in which you can interact with many people over the course of a day.
  • Partner with someone with a strong Relator or Empathy theme. This person can solidify the relationships that you begin.
  • Deliberately build the network of people who know you. Tend to it by checking in with each person at least once a month.
  • Join local organizations, volunteer for boards, and find out how to get on the social lists of the influential people where you live.
  • Learn the names of as many people as you can. Build a card file of the people you know and add names as you become acquainted. Include a snippet of personal information-such as their birthday, favorite color, hobby, or favorite sports team.
  •  Consider running for an elected office. You are a natural campaigner. Understand, however, that you might prefer the campaigning more than holding the office.
  • Recognize that your ability to get people to like you is very valuable. Do not be afraid to use it to make things happen.
  • In social situations, take responsibility for helping put more reserved people at ease.
  • Practice ways to charm and engage others. For example, research people before you meet them so you can find the common ground.
  • Find the right words to explain to people that networking is part of your style. If you don’t claim this theme, others might mistake it for insincerity and wonder why you are being so friendly.

4. Ideation

ideation

You are fascinated by ideas. What is an idea? An idea is a concept, the best explanation of the most events. You are delighted when you discover beneath the complex surface an elegantly simple concept to explain why things are the way they are. An idea is a connection. Yours is the kind of mind that is always looking for connections, and so you are intrigued when seemingly disparate phenomena can be linked by an obscure connection. An idea is a new perspective on familiar challenges. You revel in taking the world we all know and turning it around so we can view it from a strange but strangely enlightening angle. You love all these ideas because they are profound, because they are novel, because they are clarifying, because they are contrary, because they are bizarre. For all these reasons you derive a jolt of energy whenever a new idea occurs to you. Others may label you creative or original or conceptual or even smart. Perhaps you are all of these. Who can be sure? What you are sure of is that ideas are thrilling. And on most days this is enough.

Action items for the Ideation theme:

  • Seek work in which you will be paid for your ideas, such as marketing, advertising, journalism, design, or new product development. Find work in which you will be given credit for your ideas.
  • Yours is the kind of mind that bores quickly, so make small changes in your work or home life. Experiment. Play mental games with yourself. All of these will help keep you stimulated.
  • Seek brainstorming sessions. With your abundance of ideas, you will make these sessions more exciting and more productive.
  • Schedule time to read, because the ideas and experiences of others can become your raw material for new ideas. Schedule time to think, because thinking energizes you.
  • Discuss your ideas with other people. Their responses will help you keep refining your ideas.
  • Finish your thoughts and ideas before communicating them. Lacking your Ideation strength, others might not be able to “join the dots” of an interesting but incomplete idea, and thus might dismiss it.
  • Partner with someone with a strong Activator theme. This person can push you to put your ideas into practice. This kind of exposure can only be good for your ideas.
  • Partner with someone with a strong Analytical theme. This person will question you and challenge you, therefore strengthening your ideas.

5. Activator

striking a match

“When can we start?” This is a recurring question in your life. You are impatient for action. You may concede that analysis has its uses or that debate and discussion can occasionally yield some valuable insights, but deep down you know that only action is real. Only action can make things happen. Only action leads to performance. Once a decision is made, you cannot not act. Others may worry that “there are still some things we don’t know,” but this doesn’t seem to slow you. If the decision has been made to go across town, you know that the fastest way to get there is to go stoplight to stoplight. You are not going to sit around waiting until all the lights have turned green. Besides, in your view, action and thinking are not opposites. In fact, guided by your Activator theme, you believe that action is the best device for learning. You make a decision, you take action, you look at the result, and you learn. This learning informs your next action and your next. How can you grow if you have nothing to react to? Well, you believe you can’t. You must put yourself out there. You must take the next step. It is the only way to keep your thinking fresh and informed. The bottom line is this: You know you will be judged not by what you say, not by what you think, but by what you get done. This does not frighten you. It pleases you.

Action items for the Activator theme:

  • Seek work in which you can make your own decisions and act upon them. In particular, look for start-up or turn-around situations.
  • Take responsibility for your intensity by always asking for action when you are a part of a group.
  • To avoid conflict later, ensure that your manager judges you on measurable outcomes rather than your process. Your process is not always pretty.
  • Prepare a simple explanation as to why any decision, even the wrong one, will help you learn, and therefore will make the next decision more informed. Use it when people challenge you and tell you to slow down.
  • Try to work only on committees that are action-oriented. Much committee work might prove very boring for you.
  • Give the reasons why your requests for action must be granted; otherwise, others might dismiss you as impatient and label you a ‘ready, fire, aim’ person.
  • Recognize that your “pushiness” might sometimes intimidate others.
  • Partner with someone with a strong Strategic or Analytical theme. This person can help you see how high the cliff is before you fall off it.
  • Avoid activity for activity’s sake. If you want people to join in your activity, you will need to provide them with a purpose for their actions.

This article also appears in The Adventures of Accordion Guy in the 21st Century.

Categories
Uncategorized

Two Canadian Tech Companies, Two Very Different Stories: Shopify and BlackBerry

Shopify and BlackBerry are Canadian companies, tech pioneers, and led by CEOs with German accents, but that’s where the similarities end…

Shopify Gets into the POS Business

shopify pos 1

With nearly a third of Shopify shopowners owning a brick-and-mortar shop in addition to their online one, it only made sense that they’d put out their own POS (point of sale, a.k.a. cash register) system. It’s an iPad-based system, and it’s the kind of thing that only Shopify could pull off, as it looks like the joint effort of several of its teams, all of whom do what they do like no other:

  • the web development team that was its original core,
  • the mobile development team that grew from their Select Start Studios acquisition,
  • the design team that does a killer job whether they’re designing user interfaces or their own workspaces and who they grew with the acquisition of Jet Cooper
  • their experience with payments,
  • the vision of guys like Tobi, Cody, and Harley

shopify pos 2

You can read more here:

Nicely done, guys!

BlackBerry is a Failed State

blackberry as a failed state

Image taken from BuzzFeed.

John Herrman’s article in BuzzFeed, BlackBerry is a Failed State, is an article I wished I’d written. A failed state is the perfect metaphor for the one-time ruler of the smartphone world and the jewel in the Canadian tech industry’s crown. As Herrman puts it:

But BlackBerry isn’t quite DEC, nor is it Gateway or Palm. It’s a company that even today has millions of active a loyal users, who don’t just purchase BlackBerry products but use them every hour of every day — who live in them, and will soon have to live in something else. BlackBerry is less like a company than a country. A failed state: BlackBerria.

BlackBerria exhibits all the classic signs of a collapsing country. Today, it’s the kind of place that might compel the State Department to issue a travel advisory. It’s a land where crime goes unpunished, where fires burn unextinguished, where citizens wander the streets alive but dazed, where the future is too foggy to inspire any feeling but despondency.

According to Wikipedia, the Fund for Peace has four conditions that it requires to classify a country as a failed state:

  • Loss of control of its territory, or of the monopoly on the legitimate use of physical force therein
  • Erosion of legitimate authority to make collective decisions
  • An inability to provide public services
  • An inability to interact with other states as a full member of the international community

With leadership that stands to walk away with a nice big nest egg (and even job opportunities) if the place completely collapses, grand  projects in which they attempt to mimic the amenities of more advanced zones, an app economy that’s one-third owned by a single entity that produces crap and a marketplace that’s mostly knock-offs, a mass exodus of its own citizenry to greener pastures, and no one on the outside wanting to do business with them, BlackBerry certainly has all the earmarks of a banana republic about to go belly-up.

Categories
Uncategorized

And Now, What I LOVED About Working at Microsoft

My Job

If I heaped scorn on Microsoft’s stack ranking or 70-20-10 system and the toxic management culture it engendered, it’s only fair that I heap praise on those aspects of being a Microsoftie that I really liked.

I loved the developer evangelist role. I also loved the fact that Microsoft not only had an evangelism team, but evangelism opportunities aplenty. I enjoyed what I did immensely and in spite of my happy-go-lucky demeanor, I took the job very seriously. Most of the time, I lived in the “hooray!” zone in the Venn diagram shown above.

(If you’re curious about what my job was like, I think that this article that I wrote back in 2010 does a pretty good job of explaining it. You might also want to check out my Evangelist, Immigrant, and Shaman article.)

My Team

I may have butted heads with some higher-ups (and in a couple of cases, some waaaay higher-ups), but the people who’ll always have my love, friendship, and respect are my former teammates on the Developer and Platform Evangelism Canadian “breadth team”, including Damir Bersinic:

damir bersinic

…and he’s even more loveable in cartoon form:

There’s also Qixing Xeng, who’s since gone on to her dream job on the Windows user experience team:

And two of the best damned tech presenters in the entire organization, Christian Beauclair and Rick Claus:

Here’s Rick, me, and Rodney Buike striking a “Charlie’s Angels” pose with our netbooks:

Ruth Morton was the very first person (after my manager) to welcome me onto the team — she left a comment on this blog.

Paul Laberge was my fellow Windows Phone Champ on the Canadian team, and together we gave the greatest mobile phone presentation ever. So great that it can’t ever be repeated again:

Paul Laberge

As far as I’m concerned, it’s not a TechDays conference without Pierre Roman (he’s on the right):

I’m glad I had the chance to work with Fred Harper — he joined near the end of my tenure and is with Mozilla now:

And while Susan Ibach came aboard shortly after I left, we had a couple of chances to chat, and she gave me a grand tour of the server room at the TechReady 12 conference:

susan ibach

I’m also glad to have had a chance to work with Jonathan Rozenblit (below, left):

jon and ruth

Poor John Bristowe — he had one of the toughest jobs: to be my “onboarding buddy” when I first joined The Empire. He probably still has a mark from all the facepalming he had to do during that process:

And of course, I can’t not mention David Crow, who was Butt-Head to my Beavis…or was that Beavis to my Butt-Head?

While not on my team, I worked cross-functionally with Arun Kirupananthan and Nik Garkusha on Make Web Not War:

…and with Anthony “Situation” Bartolo on all sorts of Windows Phone-related thingies:

Mark Relph (pictured below on the right), who was my skip-level — that’s Microsoftese for “my manager’s manager” — who said something I’ll always remember when I was hired: “We enter as friends, we leave as friends”…

And last, but not least, I have to mention my long-suffering manager, John Oxley, who always had my back. He was an endless wellspring of good advice, ideas, stories, and some much-needed booze on his expense account. He also let me expense the rental of a pair of assless chaps, which I’m sure that no one else at Microsoft would ever do (okay, Adam Carter and Scott Hanselman probably would, too):

The Gear

At Microsoft’s Developer and Platform Evangelism group, we got assigned a lot of gear — more than one laptop per limb, all brand new.

My favourite has to be the “Dellasaurus”: the Precision M6500, a 17″ powerhouse that was essentially a server shoved into a laptop-shaped chassis:

dellsaurus

As a Windows Phone Champ, I got to work with the early test phones months before Windows Phone 7 hit the market:

And of course, I got my own production phone once they hit the shelves:

Damir even saw fit to make sure I left with some fabulous parting gifts when I left:

The Community

I get a kick out of working with lots of other people; that’s my nature. I really loved that aspect of the job, and what made it even better was the fact that the community with whom I worked — developers and IT pros who used Microsoft tools and technology were such great people.

If you look through the archives of this blog, you find dozens — perhaps hundreds — of photos that I took at various developer gatherings, from the TechDays series of conferences…

…to “Coffee and Code” gatherings…

and everything in between.

I feel that some really active participants in the community deserve special mention, including Atley Hunter:

atley hunter

Mark Arteaga:

Cory Fowler, who’s since gone on to join the company:

Bruce Johnson, Barry Gervin, and the rest of the ObjectSharp folks:

Steve Syfuhs, Todd Lamothe and Colin Melia:

Sean Kearney, Steve Syfuhs again, and Mitch Garvis. Special credit to Mitch for trying to set me up when he found out The Missus left me; the thought is appreciated:

Alexey Adamsky and Barranger Ridler:

D’Arcy Lussier:

Miguel Carrasco:

…as well as Kate Gregory, Alex Yakobovich, and so many other people whose photos I need to dig up.

The Pay

Let me just say this: the pay and perks were sweeeeeeeet.

Windows Phone

I often joked that Windows Mobile (Microsoft’s Mobile OS before the revamped Windows Phone and the User Interface Formerly Known as Metro) made me feel like this:

Sad-looking kid in a Darth Vader mask sitting alone at a fast-food restaurant table.

Photo courtesy of Alex Brown Photography.

A couple of months before Windows Phone was announced, I got assigned the role of Windows Phone Champ, which was the assignment I loved the most.

It was a challenge, starting from zero with a brand-new operating mobile operating system in 2010, three years after the debut of the iPhone, when the company was still stinging from Steve Ballmer’s underestimation of the effect that Apple would have on the mobile phone industry. In spite of all that, Windows Phone had an interesting user interface with a lot of possibilities, a great set of developer tools, and a whole lot of developers who were interested in building apps for it:

Even today, I keep the “I love Windows Phone” sticker that Charlie Kindel gave me, back when he ran the Windows Phone Champs:

My “Sesame Street” Fantasy, Fulfilled

Last, but certainly not least, for two brief shining episodes, Microsoft gave me a children’s show, where I got to teach kids about technology, complete with little puppet friend! Unfortunately, Microsoft Canada didn’t have much of a budget for outreach to grade school kids, but for fulfilling my fantasy to be on Sesame Street or something like it, I will be forever grateful.

Categories
Uncategorized

The Thing About Phone Cameras…

…is that they seem to make people really determined to capture the moment in a photo:

PUBLISHED by catsmob.com

Click the photo to see it at full size.

This article also appears in The Adventures of Accordion Guy in the 21st Century.