Viand Sync Diary #2 – Refreshing

Syncing data between the device and the cloud will happen at two times:

  • Automatically when the application starts
  • Automatically when the application comes to the foreground
  • Manually when the user makes the refresh gesture on either list

While I continue refactoring the application to add the automatic sync calls I’ve added a manual refresh gesture to the iPhone app. With Xamarin Forms it’s quite simple (like everything once you figure how to do it). Here’s the code that I added to the Buy list constructor.

buyView.IsPullToRefreshEnabled = true;
buyView.Refreshing += delegate(object sender, EventArgs e) {
	Device.StartTimer(TimeSpan.FromSeconds(5), SyncItems;

The Add list code is similar except I used a lambda expression instead of the C# 2.0 delegate syntax to call SyncItems.

addView.IsPullToRefreshEnabled = true;
addView.Refreshing += (object sender, EventArgs e) => Device.StartTimer(TimeSpan.FromSeconds(5), SyncItems;

For both lists the SyncItems calls the SyncItems method in ItemDatabase (which will perform the actual database syncing), sets IsRefreshing to false to end the refresh state, and then returns false to prevent the timer from recurring.

internal bool SyncItems()
	addView.IsRefreshing = false;

	return false;

Here’s how manual refreshing looks on the iPhone.


Since I’m using Xamarin Forms I get an Android-specific manual refresh indicator without any additional coding.


Posted in Side Projects | Tagged , , | Leave a comment

Viand Sync Diary #1 – Overview

My wife’s been using Viand for several month’s now with no major issues (there is one minor issue related to text size that I’ll have to fix before I push to the App Store).

The final piece is syncing so both of us can share the same lists on our respective iPhones. I’ve broken the implementation down into several steps.

  1. Sync a single Buy/Add list running on a single instance of the app with the backend database (My wife’s iPhone)
  2. Sync a single Buy/Add list running on two instances of the app with the backend database (My wife and my iPhones)
  3. Sync multiple Buy/Add lists running on multiple instances of the app for multiple accounts with the backend database (My wife and my iPhone; my mother-in-law’s iPhone)

I’ve decide to use Microsoft’s Azure for the backend because I’m familiar with the Microsoft stack, mobile services are free up to a point, and you’ve got to start somewhere.

It was relatively easy to create a mobile service (I chose to use the JavaScript backend because I want to use a tool that ubiquitous should I move into web development).


There’s an excellent post on the Azure site on how to get started with Mobile Services so I won’t duplicate the information here. Two caveats:

  • I’ll have to figure out how to sync my local data to the cloud first (The sample ToDo app starts off with an empty local database).
  • I’ll have to figure out how to add the asynchronous sync to my existing Xamarin.Forms code (the ToDo sample used UITableViewController instead of Xamarin.Forms).
Posted in Side Projects | Tagged , , | Leave a comment

What Makes Personal Computers Special?

While in the midst of cleaning out years of clippings and newspaper articles I came across a dot-matrix printout of the editorial below. I recall seeing it in one of the Whole Earth Software Catalog and Review magazines from the 80s but it turns out that was probably a reprint, it originally appeared in the August 1984 issue of Byte Magazine.

People sometimes ask me why there’s so much fuss about personal computers. Now that there are millions of them in the hands of ordinary people, personal computers are, in a sense, commonplace. Even enthusiasts may forget that personal computers are very special indeed. We would enjoy them even if they lacked practical applications and never overcame the digital indifference so often characterized as unfriendliness. To put personal computers in perspective, we should compare them with such earlier cultural watersheds as the printing press, the Industrial Revolution, and the automobile.

Because it made the production of books far more efficient, the printing press made it possible for more people to learn more than ever before. But while the printing press gave creative work a wider audience and eliminated the drudgery of scribes, Gutenberg’s technology did not directly enhance the creativity of the people who wrote books.

The Industrial Revolution made the production of goods far more efficient than ever before. The efficiencies of mass production made possible the accumulation of great wealth. Unfortunately, mass production also brought about cultural impoverishment of many workers. The assembly line deprived workers of the creativity that belonged to craftsmen— the stamp of individuality that went with good handwork. The Encyclopaedia Britannka puts it this way: “. . .the discipline of the factory (a discipline often imposed by strangers), the remorseless monotony of many of the tasks, and the physical hazard and discomfort of some of the new processes took a heavy toll.” Few would deny that the Industrial Revolution was, on balance, a good thing. But it did exact a great human price.

The automobile changed society for all time by broadening the experience of millions of people. The ability to travel quickly and widely enabled people to see more of the world and to judge it for themselves. The automobile’s influence resembled that of the printing press; while widespread book publishing extended knowledge, the mass production of automobiles extended experience. With broadened experience came wider choice in place and type of work. But the automobile did not directly enhance creativity; furthermore, the automobile was produced by the dehumanizing assembly-line methods introduced by the Industrial Revolution.

The personal computer disseminates knowledge, as the printing press did; increases productivity, as the Industrial Revolution did; and broadens experience, as the automobile did. In many applications, personal computers also reduce drudgery such as needless retyping and recalculation.

What sets personal computers apart, however, is their ability to enhance the creativity of the individual. They have justly been called “mind appliances” and “thought amplifiers.” They can help us manipulate information and ideas with remarkable freedom. Rather than forcing us all to work alike under the supervision of strangers, personal computers will let us develop our own unique ways of working. Rather than requiring personal sacrifices to achieve greater social goals, personal computers will contribute to the achievement of social goals by enriching the lives of individual persons. Programs like Bill Budge’s Pinball Construction Set, Bill Atkinson’s MacPaint, and Warren Robinett’s Rocky’s Boots offer glimpses of things to come.

Will personal computers make us all geniuses or saints? No. But they will help us make the most of ourselves. That is ample reason for regarding personal computers as far more than just another major consumer item.

—Phil Lemmons, Editor in Chief


Posted in Other | Tagged | Leave a comment

Best Birdman Scene

In Birdman Riggan Thomson tries to explain to his daughter Sam why he’s staging an adaptation of Raymond Carver’s short story “What We Talk About When We Talk About Love.”


Riggan: Listen to me. I’m trying to do something important.

Sam: This is not important.

Riggan: It’s important to me! Alright? Maybe not to you, or your cynical friends whose only ambition is to go viral. But to me… To me… this is – God. This is my career, this is my chance to do some work that actually means something.

Sam: Means something to who? You had a career before the third comic book movie, before people began to forget who was inside the bird costume. You’re doing a play based on a book that was written sixty years ago, for a thousand rich old white people whose only real concern is gonna be where they go to have their cake and coffee when it’s over – and let’s face it, Dad, it’s not for the sake of art. It’s because you want to feel relevant again. Well, there’s a whole world out there where people fight to be relevant every day. And you act like it doesn’t even exist! Things are happening in a place that you willfully ignore, a place that has already forgotten you. I mean, who are you? You hate bloggers. You make fun of Twitter. You don’t even have a Facebook page. You’re the one who doesn’t exist. You’re doing this because you’re scared to death, like the rest of us, that you don’t matter. And you know what? You’re right. You don’t. It’s not important. You’re not important. Get used to it.


Posted in Other | Tagged | Leave a comment

On Infinite Loops

Proramming-In-A-Nutshell(via Three Panel Soul)


Posted in Software Development | Tagged | Leave a comment

Developer vs. Good Googler

Scott Hanselman’s reply to developer who asked him the following question:

Some time in my mind sounds come that Is that I am really a developer or just a good Googler. I don’t know what is the answer I am googler or I am developer. Scott Please clear on my mind on this please.

I wonder that sometimes about myself, especially since the jobs I do or the side projects I work on always seem to be at the edge of what I know how to do or what I’ve done in the past. I’ve worked with a lot of extremely smart people over the years, smarter than me, so sometimes the thought that I’m a fraud creeps into my head.

Scott’s suggestions:

  • Remember, you grow when you work outside your comfort zone.
  • Practice. Do Code Katas or problems on Project Euler
  • Program for a day without Googling
  • Think about the problem instead of copying code from Stack Overflow
  • Get involved with others who feel about technology like you do

(via Scott Hanselman)

Posted in Software Development | Tagged | Leave a comment

NASA Space Colony Artwork

Three space colony studies conducted by NASA Ames Research Center in the 1970s.

Toroidal Colonies

Bernal Spheres

Cylindrical Colonies

An excellent book about these types of space colonies is Gerald K. O’Neill’s  The High Frontier (I still have my original copy).


(via io9)

Posted in Other | Tagged , | Leave a comment