Family

Building a 'Nosedive' rating app in a couple of hours

This month, the family and I have been watching the NetFlix series "Black Mirror", catching up older seasons and devouring Season 3.  One of our favourite episodes was 'Nosedive', and so I don't give out spoiler alerts here, I won't go into the plot line, but nevertheless, we were all fascinated by the 'Rating' app that everyone used on the show.

So much so, that my wife, the kids and I all started 'air gesturing' each other the 'swipe and flick' routine as if we were using the app to rate each other throughout the day.

This made me think - how about if we actually had a dummy app that we could use?  I noticed that NetFlix had created a demo site on the internet to promote the show, so I (ahem) "borrowed" some of the assets like the background, star graphics and the rating sounds, and mocked up a small dummy 'Nosedive' app in a couple of hours that I had spare.

Now I can really annoy the kids.  "Didn't do your homework?, ONE star for you!" (dew dew dew dew dew).  Wife brings me a nice hot cup of tea? "Five stars, my dear..." (dinga ding ding ding DING!).

I never intended to make money from this little side project - I just installed it on our phones using my developer account.  I am releasing the source code on GitHub in case any others want to take things further.

Please note that this is nothing like the actual app - there is no facial recognition (although I have been playing around with the Microsoft Face API to see if I can do something there).  There is not aggregate rating for people, and there is no central database that things are stored in (though I have thought about using Firebase to store rating data in the cloud).  It is purely a gimmick - although there is no reason that anyone can't take this starting code and build all that on.  Have at it! :)

Building the App

The app itself is built using the Ionic framework, which I have been using for over a year now, and really love.  It facilitates creating a hybrid app quickly and easily that can be used on iOS and Android devices.  No need for Swift or Objective-C, it is all done in javascript and HTML/CSS.

Nothing too tricky about this app - it is a simple one page application, which is the rating page.  As I mentioned all the assets, including the background swirling pink video, the rating star graphics and the notification sounds, were all downloaded from the NetFlix promotional site I mentioned above.  That is 90% of the work right there.

The rest was just implementing the swipe gestures to set the star level, and then the flick gesture to 'send' the rating and play the sounds.

Setting the ratings was one area that stumped me for a while.  Initially, I was playing around with the $ionicGesture event handler, and trying to trap left and right swipes including the distance swiped and the swipe velocity to try and calculate the star rating to give.  That all turned out to be extremely tricky and difficult, so in the end, I ended up using a typical programmers shortcut - in that I cheated! :)

I ended up placing an HTML range slider control on the screen, just under the stars.  I then made this slider element invisible, and used CSS to reverse offset the slider to that it lay just on top of the stars themselves.

This way, if anyone put their finger on the stars and moved left or right, it effectively moved the hidden slider left and right.  The upside is very accurate tracking of where the user lifted their finger, as the rating value would correspond with the star where they lifted their finger.

The downside is that on some devices, the slider will not move unless the user starts their finger on the current star (e.g. if you wanted to go from 2 stars to 5 stars, you would have to place your finger on the second start, then slide to the fifth star.  If you just tapped the fifth star or started on the third star to slide up, the slider would not move).  Most users I tested this on (well, my wife and kids) seemed to naturally start at the current star anyway, so I figured I could get away with this.  At least it worked with minimal (read: NO) coding required.

The last thing so do was to implement the Cordova Native Audio plugin to generate the sounds.  This was pretty trivial to do, and was only a few lines of code.  I had to capture the swipe up gesture to trigger the 'send' sound at first, then wait one second, then play the 'rating' sound depending on the rating (one to five) that the user had chosen. Check the code for details.

Yes, yes, yes, the pedants among you might say well the sending phone only plays the 'send' sound and the rating sound is played on the receiver's phone, but for our app, we aren't really 'sending' the rating anywhere, and are just using it as a too to tease or annoy others, so the rating playing on our own phone after a delay is enough to let the other person know exactly what we think of them (as long as they are in hearing range in a relatively quiet environment).

Anyhow, I will let others feel free to build upon the code base and see what they come up with.  I won't be releasing this app on the App Stores or anything, as I don't want to push things too far and be hit with a copyright violation from NetFlix!  Have fun.

 

20 years of Blaze...

The 1st of September marks a major milestone in my life.  It will mean that I have been running my company, Blaze Business Software Pty Ltd for 20 years now.  Two decades.  It seems almost unbelievable to me at times.

Back in September 1996, I had only been married for a month, I was about to turn 30, and I decided to start a software consultancy business out of my bedroom.  Thus began the rollercoaster, including getting an office in the Cullen Bay area of Darwin, growing the team to at one stage around 16 people, and then now coming full circle to just my wife and I working from a home office again in a 'lifestyle' business.

So many changes in the IT industry at that time.  When I started Blaze, the internet was just hitting mainstream here in Australia, and everything was still dial up.  We were one of the first offices to get an ISDN line into our office, and I clearly remember setting up a small Windows 98 server in the back which was running some sort of DOS mail daemon so that we could have individual email addresses for every employee.  Something that was so rare back then.

We were also one of the first companies locally to upgrade to Microsoft Exchange and implement ActiveSync.  I clearly remember proudly showing off how I could read and reply to emails on my Palm Pilot in real time to all my clients.  Nowadays that is just an expected thing, but back then I was pleased that we were pushing the envelope and being cutting edge.

Lots of nice memories, such as being the finalist in the Telstra Small Business Awards up here in 1998 I think.  Lots of other small awards and achievements.  But there were also some really tough times, and many days where I didn't know whether I wanted to close the doors forever and go raise sheep in the Italian mountains.

But through all that, I still wake up every day and look forward to doing the work I do.  I am always grateful to have met so many wonderful people through my business.  From clients (many of whom I still work with 20+ years later), to employees who have become close friends, to colleagues and competitors and everyone who has walked through the doors or called in the past 2 decades.  Thank You.

Proving that it is never too late to be a 'startup', this year I have embarked on a whole new reboot of the business, as we become a SaaS company providing subscription based business software.  Given that I will be turning 50 this year, I don't know if I will have the energy to keep on with the consulting and support role for many more years, and I am looking forward to setting up a passive income source from a modern, web based subscription platform.

Just another step in our long and interesting journey.  Hope to see you all along the way...

Building a $20 "Prince" guitar

The past weekend was the ANZAC day long weekend, and seeing as I am a little burned out with programming work at the moment, I decided to take a little break from the keyboard and screen, and to tackle a project that I have been thinking about for years now - building a "cigar box" style guitar.

I've seen many people build these online, but never actually tried myself, so I looked around the house this weekend and decided that I had enough scrap material lying around to give it a go.

I don't actually have any cigar boxes lying around, but my wife did have an old art supply carry case that she no longer used, which was sitting in the back of the shed going mouldy, so she said I could have that.  Great.  I found a nice long piece of Merbau timber that was perfect for the neck.  80% there!  Collecting some old tuners from a dismantled Squier Strat, and cutting up some threaded rod and buying an ornate bracket, and we pretty much had all the parts for the guitar.  No excuses.

I posted about this build 'nearly live' on my Instagram account.  When I started posting, I had no idea whether the project would come to fruition or not, so I was taking a risk, but also, I was putting in place some accountability, because I knew I had an audience following along with me.

I also had no plans - just a rough idea of how to go about this from a blog post I had seen many months ago.  Never mind - I actually built a real acoustic guitar 3 years ago, so this couldn't be any more difficult, could it?

As it turns out, the process was fairly straightforward, and I managed to accomplish the build using rudimentary tools, and some very journeyman carpentry skills.  As you can see from the progress photos, I decided to put frets on the neck of this guitar, although that was a moot point, as I was going to set it up as a very high action slide guitar.

Once I had assembled the guitar proper (with some able assistance from my older son), I handed the project off to my wife, and asked her to paint anything she liked on it.

Given the current loss to the music world, she decided to paint a portrait of Prince on the guitar, and I think she did a fabulous job of it.

That was a really fun build, and kept most of the family occupied and creative, and we ended up with a great tribute to a superb artist that left us all too soon.

 

My 30 day app challenge...

About a year ago, my wife approached me with an idea.  It was the new year, 2014, and she was lamenting over the fact that she felt that we had not achieved the goals we had set out for ourselves back in 2013.  "Wouldn't it be nice" she said, "if there was an app that would let us set some goals, then allow us to track our progress towards those goals, and perhaps pop up a reminder from time to time to let us know we are on track...".

We searched around the app store, and while there were apps there that came close, none seemed to fit the bill.  "We should write that app!" she declared.  I nodded in agreement, but in the back of my mind, I know that my current 'real' work schedule didn't give me much spare time to even contemplate such a project.  We put together some vague specs for the app in a Google Doc, but it basically just sat there gathering dust.

Fast forward to the beginning of December, and I caught myself remembering that conversation from earlier in the year.  I realised that once again, we had fallen into the old habits of letting goals slip by in 2014.  After all, wasn't the idea to write a goal tracking app a goal in itself?

I had the usual end of year madness upon me, with clients wanting projects finished before the Christmas closure, but I looked at the vague specs my wife and I drew up earlier, and decided "Right!".  

I was going to do this.

Not only was I going to do this, but I was going to do it before the end of the year, so that the app would be ready to go out to the masses for the New Year 2015.  That gave me 30 days.  Factoring in the 2 week average approval period for the Apple App Store, it meant I would have to submit the final product for approval by mid December.  Time to get to work.

My first question was "Which platform?".  Both my wife and I are iPhone users, but my son has an Android phone and I wanted to cover both bases.  We decided iOS and Android would be the main platforms.  Windows, Blackberry etc. may have to come later.

Second question was "Which technology stack?".  I already had some familiarity with jQuery Mobile and PhoneGap etc., but I wanted a little more.  Then, I came upon a framework called Ionic, which is a mobile development framework based upon AngularJS.  When I first saw the demos for AngularJS, I went "Whoa!" in an excited way as I saw two way data binding etc. in action.  Then I delved deeper and looked at the code behind the scenes and went "Whoa!' in a kind of horrified, opening Pandora's box kind of way.

It certainly wasn't going to be an easy framework to get to grips with.  New methodologies and protocols such as Directives, Services, Factories, Promises etc. would be a completely new way of thinking about app development than what I was used to.

Nevertheless, I rolled my sleeves up and dived in head first.  Being a relatively new framework, Ionic questions and tips were hard to find on Google or StackOverflow.  Lots of things were trial and error.  Also, being on the 'bleeding edge' of current app development tools, there were a lot of incomplete things or things that would change literally overnight.  I would be in the middle of a late night coding session and would get a message saying that a new release was available.  Sometimes twice in the same evening!

One of the saving factors was the excellent community around Ionic, AngularJS and Cordova.  Plenty of REALLY smart people who are also generous with their time and knowledge.  I found some great blog posts which covered the areas I got stuck in, such as using SQLite databases on a mobile device via Cordova and Ionic.

Well, not 9 days later, we had an app ready to submit to the two app stores.  Not even I could believe it.  In reality, I had finished the first 1.0 version in about 6 days, but then when my wife and I tested the early version, we realised we wanted a few more things in there, so I went back to work to add more features.

Some 'simple' sounding features, like local notifications, proved to be a lot trickier than I imagined.  But once again, the Ionic forums came to the party and I found the answers there.  I even managed to improve on one of the answers a bit myself, and contributed back on the forums, so hopefully someone else in the same boat can get through the issue quickly.

Finally, on the evening of the 13th December, we submitted the app to both stores.  It is called BlissBank (which is the name my wife came up with) and hopefully will be approved by Apple by the 31st December.  There are still lots of things that I wanted to add to the app, and to clean up within it, but for now it appears to be stable, and will at least give us the chance to get a small user base together and get some feedback before we develop the next version.

It's been a long time since I went 'heads down' with such intensity on a project.  But being a personal project, and the brainchild of my own wife made it special and added a lot of incentive.  Kudos to my wife for giving me total support and allowing me as much time as I needed to go hard at this project too.  She took care of the other normal distractions around the house, like taking the kids out for long outings etc. to give me space and quiet.  Especially seeing as she was in the middle of launching her first art exhibition.

Now, I just have this one other idea for an app that would be useful for the New Year... Hmm... wonder if I can squeeze that in...

 

Cyclone Tracy - 40 years on

I have been thoroughly enjoying reading the stories on Facebook from my friends who lived through the destructive forces of Cyclone Tracy, 40 years ago.  My contribution isn't as poignant or direct as some of theirs, but it has a (kind of) twist ending.

During that time, I was about 8 years old, and we lived in a small town called Taiping, in my birth country of Malaysia.  At that stage as a kid, I had never travelled outside of the country.

The day after Christmas in 1974, my family was over at a neighbours house having drinks to celebrate the festivities.  The grown ups however, were distracted and talking about this devastating storm called a 'cyclone' that had destroyed an entire town called Darwin in Northern Australia.  As an impressionable kid, I was quite shaken by the serious, grave tones of the adults, and I left the party early to run back home to our own house.

We had a huge map of the world taped to the wall outside the bedroom my sisters and I shared, and I went and found a map pin and scoured the whole map for this place called "Darwin".  When I found it, I stuck the pin into the map over it, and vowed that I would NEVER, EVER go to that place in the world as long as I lived.

Well, just 4 years later, we were packing all our worldly belongings (and getting rid of most of it) to emigrate to Australia...to... a place called Darwin.  A place which I have happily called my home for three quarters of my life.

The Old Airport

For years in my town, it was fashionable to hate the 'old airport'.  You know, that sweltering tin shed left over from World War II.  Apparently there were still bullet holes in the steel girders from the Japanese Zero's that strafed it.  The building served as our domestic and international terminal in our little outback town for many decades.

I remember back before they built the new 'modern' airport, you would *always* hear people moan and complain about the old one.  "Why don't they upgrade it?" they would ask.  "It's a travesty, and embarrassment to us, an eyesore".

So in the 90's, they did build a new terminal.  A big concrete soulless, unaesthetic monstrosity that looks as plain and ugly as most other airports in the world.

You see, I hate the *new* airport.  But I never really hated the old one.  Here is why.

Because on that one day in December 1978, when we migrated to Australia, I remember stepping out of that QANTAS 747 on top of the mobile staircase (no aerobridges on the old terminal), and feeling the humid heat wrap around me, I blinked and took a mental picture of this place.  The picture I took in my mind is actually quite similar to the photo above.  We must have parked in about the same spot.

I was only about 12 years old, but I remember walking across the shimmering heat haze of the tarmac, through a glass door to the immigration area.

There, we lined up behind one of the customs desk, and waited patiently while a *huge* man in a tight fitting blue uniform scanned our passports and paperwork and stamped them.  He was actually the first Australian person I had seen here since we arrived from Malaysia, and I was impressed and intimidated by his sheer size.

I remember his intent look as he processed our paperwork, and sweat rolling down his face as the overhead fans did little to alleviate the heat in that hot section of the tin shed.

Far from being scary, he actually turned out to be really kind as he looked at us, smiled and welcomed us to our new home.

After we passed through the immigration, my two sisters, my mother and I went to the public waiting area.  My dad had already arrived in Australia before us to set things up, and was going to pick us up soon.

My older sister and I were feeling rather parched in this heat, so we decided to buy a cold drink.  We carefully counted out the small amount of Australian money we had, and checked the price list above the only refreshment stall in the centre of the airport, and decided that we had enough money for two cups of orange juice.

As we approached the cheery young girl behind the counter, she smiled at us and said "Just a minute, I have to refill the OJ machine".  I watched her as she pulled the spouts out on several tetra pack juice cartons to fill the machine.

I was filled with wonder - I had NEVER before seen juice packs with the spouts that you could split and pull with one hand.  All the ones we had in our 'old' country had to be cut with scissors.  I thought this was the precursor to MANY wonders that we would get to see in this new land.

Then, my mother reminded us that we needed to get our luggage.  I looked around for the carousel, but could only see signs pointing to a fenced off area next to the car park.  We went there but it was empty.

Then I noticed that there was a tractor with several baggage trailers still near our plane, which was busy disgorging the contents of its hold onto the trailers.

Shortly after that, the tractor just drove into the fenced baggage area and the tractor driver parked and opened the fence gate so that we could all approach the trailers and pick our luggage off them.

Yes it was rustic, but it was also magical and quaint at the same time.  I had this combined feeling of dread and excitement at our new lives that were about to be rebooted here.

The old airport now stands silent, empty and abandoned, but it will always be a major milestone in my life, and for that reason, I could never bring myself to hate it.

Ten Months With No Hot Water

 Ye Olde Heater...

Ye Olde Heater...

Sometime in June 2013, I was working in my office when I noticed a puddle of water seeping in the doorway and running towards my amp and guitar collection.  After moving the valuable equipment out of the way, I went outside and noticed that our hot water heater, which was in an enclosure outside my office, had sprung a leak.

After shutting off the water and mopping up the mess, we called in two plumbers to assess the damage.  They both said that the heater, which was about 20+ years old, had split and needed complete replacement.  One quoted us $2200 for the replacement, and the other quoted $2500.  We also got a quote to change over to solar hot water, but that was around $7000.

Now, we had about $5000 saved away in a family savings account, but we had already decided that 2013 would be a year of seriously pursuing our artistic goals.  We had already earmarked  that money (1) for a portraiture course in August in Adelaide that my wife wanted to do, and (2) for a guitar building course in Melbourne in September that I was keen on.

We thought long and hard about this, then decided that we would defer replacing the hot water heater until the next dry season, about a year away.

This was despite the fact it was one of the coolest dry seasons we have had, and hot water was pretty much the only thing that could warm us up in the mornings and evenings.

But we gritted our teeth and persevered.  For arts sake.

Here is what we found.

SHOWERS

Time wasted in the shower was reduced markedly.  From an average of 10 to 12 minutes each standing under a warm cascade of water daydreaming, the family reverted to short, quick shower in the bracing cold water.  Shower times were down to less than 5 minutes as we got in, soaped and rinsed and got the heck out.

Our sons went from sometimes having 3 showers a day, to only having one a day.

This also resulted in the pleasant after effect that the shower and bathroom needed less cleaning due to less usage.  Towels and bath mats were also less in need of regular washes.

 

DISH WASHING

Now here is a funny thing.  I didn't actually realise that dishwashers have a built in water heater  (After all, we never had a dishwasher up until we moved into this house, which had one preinstalled).  For the first few months, we were hand washing everything, but only once or twice a day.

My wife would boil up a large pan of water on the gas hob and use that for the dishes.  Even after we realised we could still use the dishwasher for hot washes, she persevered with the pan heated water, and the dishwasher was reserved for weekend use.

This was probably my least favourite aspect of this experiment.  I HATE having the sink filling up with dirty dishes for a whole day.

The boys did learn to only use one cup/plates etc. during the day though, and wash them up, because they could not keep raiding the dishwasher for clean ones 10 times a day.


SHAVING

This was a challenge for me, because I like my hot shaves, so I used to co-ordinate my morning shaves with those mornings where my wife was heating up a pan for the washing up.  I used to grab a couple of cups of hot water to shave with.

This meant that we had to really time our activities so that we minimised the number of pans of hot water we needed to make.

After a few months of this, I just reverted to cold shaving, which wasn't the most pleasant of experiences, but I managed to do it.


CLOTHES WASHING

This was a simple remedy.  Our washing machine had a 'cold wash' setting, so we simply bought cold wash soap powder and ran with that.

It seemed to work better.  Things like the elastic on underwear etc. didn't seem to break down as fast as they did with hot washes.


ELECTRICITY

I monitored our electricity usage during this time, and noted and power usage dropped by around 40% during this time, which translated to around $400 on our quarterly electricity bills.

I put this down also to less electricity being used by not using the dishwasher as often, or not needing lights in the bathroom for as long etc.

Water usage was also down by about 30% over normal.


OVERALL ANALYSIS

It was an interesting family social experiment, and one that we all participated in with a little bit of reservation.  I am proud of our two boys for running with it and not complaining too much.  At best, they will realise that hot water on tap is a privilege not to be taken for granted.

As the weather cooled down this May 2014, we decided to bite the bullet and replace the hot water system.  We now have wonderful hot water available on demand again, and I won't kid you - it is very welcome.

But I won't forget our little lesson learned, and we still try and prioritise our time in the bathroom and be as efficient as we possibly can.  Hopefully we can keep in mind that this is a luxury that not everyone in the world can experience, and we will savour it a lot more.


FOOTNOTE: The old hot water heater is currently being converted into a 'nuclear tower' in the garden to be used for an upcoming Nerf battle.