2018/06/30

Top tips for refreshing Android skills with the Little Miracle prototype

Over the last few weeks I have been working on a prototype of a pregnancy contraction tracking app and wanted to share some tips from my experience so far.

Go native with Android

Android has a number of native solutions for problems you may experience during your development. One really good example of this is using java Threads vs TimerTask vs Handlers for updating the UI based on clock or timing events. In this case I was using the timer to schedule asynchronous events to update the user interface which is an anti pattern. When updating the user interface the best practice is to use Handler solutions. If you are seeing leaked context warnings or experiencing issues with thread scopes then there is probably a better way.

Compat[ibility] is main route

The compatibility libraries are not so much extras as the normal way to build things. When prototyping they can help hide a lot of the complexity of the ever evolving Android ecosystem. Unless you are developing for a specific device then the compatibility libraries are a must!

2018/03/29

Changing teams at Google

After spending a little over a year working with Ads partners I am now moving to a different team working with Google partners! Part of the transition involves getting up to sped with Android development so I will be building a demo app over the next few weeks and wanted to share my experiences.

To make things more interesting I will be starting out with an older version of Android (Nougat) and migrating my app to new versions. At the same time I will migrate the app from Java to Kotlin.

In order to make things as real as possible I will be creating an app in a very competitive space (pregnancy tracking) and launching it on the app store. As I go I will share useful resources and guides that I tried to help me.

Hello World

To get started I will be taking a couple of courses to refresh my knowledge as it has been a year since I built an Android app and I am guessing a lot has changed. Here's where I started:

2017/02/15

Redeploying Rediscover.Work to Save Money Part 2


Migrating to Google App Engine was more straightforward than trying to rebuild my environment and meant I had to change a few things in my setup.

- Unable to update app: Class file is Java 8 but max supported is Java 7: Don't forget Guava, only versions of guava up to 20 are supporting Java 1.7
- The app config version isn't the SDK version, it is like the AWS build version and can't contain '.' periods so version 0 it is.
- Downloading the database is a pain in a server-less environment as AWS only supports binary snapshots. But fear not, a bit of ssh / yum / security group manipulation and the download is done in about 20 minutes.
- Deploy a new SQL instance in the cloud console: Note you need to include the create database or use the advanced options to specify the database to import your SQL to.
- Then hit a brick wall "You can't have any JDBC database with Google App Engine." due to "java.lang.management.ManagementFactory is a restricted class". This is a slight misnomer, it is creating threadpool connection pool resources which is prohibited.
- In steps a non threaded connection pool: http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html#Plain_Ol'_Java
- Unfortunately Tomcat connection pool was a red herring with "java.lang.RuntimePermission" "modifyThreadGroup"
- Logging to a file doesn't work, (neither does looking at the file system to figure out where you are).
- More security errors: setProperty.networkaddress.cache.ttl
- Moved to Google SQL driver "com.mysql.jdbc.GoogleDriver"
- ERROR: (gcloud.beta.sql.connect) HTTPError 400: Invalid value for: Invalid format: "2017-02-16T20:01:08+00:00" is malformed at "+00:00"

2017/02/12

Redeploying Rediscover.Work to Save Money Part 1

After five years working in startups, and more recently in 'stealth mode' startups I have decided to go back to my favourite place to work. This means that I can now share some of my hacking projects more openly.

At the moment one of my side projects which I want to keep alive is Rediscover.Work. It is currently hosted in AWS using Elastic Beanstalk and RDS. This made sense at the time when I was trying to get the site up quickly. Now that the project is no longer funded though it is time to do a bit of belt tightening.

As with any project it is worth looking at different options for how it could be deployed. There were never more than there are now:

* AWS Elastic Beanstalk + RDS. Current running cost of around $96 per month. + Easy install. -  Cost.
* AWS Lambda + RDS. + Simple scaling. - Migration costs are prohibitive.
* EC2 Instance: $9.52 according to the price calculator. + Already have needed tools - More admin to manage instance personally.
* Google App Engine and Cloud SQL: $8.01 according to the price calculator. + Ease of mantenance and app engine security scanning. - Migration to app engine layout.

As I already have all the tools needed to create the EC2 Instance solution and it requires the minimum investment in tooling I chose to go down that route first and see how things played out. In part 2 of this blog I will see how hard it is to migrate to app engine as this seems like a better solution for the long term.

Workflow:

  1. Build dependencies and update dependency versions using

mvn versions:display-dependency-updates

  1. Package the code into a WAR to be deployed on the new shared EC2 instance.
  2. Launch a new instance which will run the site and database.
  3. Start hacking ansible (and loose the will to live due to so many issues with config).
  4. Stop.
Look out for part 2 where I will probably decide to migrate the whole project as managing machines is getting too painful for this time poor old coder.

2017/02/11

Wine Tasting at Majestic Camden

I recently attended my first wine tasting which was organised by my private Somelier. We  Definition wines from Majestic which it selects as reference examples of different wines. We also learned how to pair food, and my somelier won the competition to match food and wines. What great taste!

We tried:

Sauvingnon Blanc grown on Granite. Marlbrough NZ heavy yield fast ripening. Acidic. Some regions are full bodied like Chili. This is light, fresh and green, almost tastes like nettles.

Sauvingnon Blanc. San Cere. Loire. FR. darker and heavier flavored due to the soil. Bolder than the first sauvingnon Blanc due to the chalk soil. Easy drinking and balanced with less acidity.

Chardonnay. Chablis, Eon, France. Un-oaken. Stored in stainless steel temporarily before bottling. The oak barrelling would normally reduce the acidity. Light but zesty with more body than the sauvingnon Blancs.

Definition prosecco. Very light and medium dry, excellent with melon and prosciutto.

Pinot Noir NZ. Picking a great one can be tricky from a French range. This one is quite spicy and 
peppery. Some people say it is like grape juice or raisins. I like it.

Malbec Argentina. (Mendoza). Very full bodied. Smoky blackberry. Great with a steak frites.

Tempranillo Rioja ES. A blend of different vineyards. The grand reserve we tried was the older with around 36 months of oak aging. This was the last and heaviest, DOCG.
I'm looking forward to the next level of training!

2017/02/08

Living with Android 4.* on Samsung S3

The Due to a screen fade issue with my Samsung S7 I recently had the chance to downgrade temporarily to my old Samsung S3.

The first thing that I noticed was how much smaller the old device is, both in terms of the physical device and screen real estate. Welcome to zooming and scrolling! From a development point of view it is all too easy to think of these two devices as the same format but that could be a mistake. It may be good to consider making the main view different for small handsets.
The second thing to hit me which was more profound was the performance, or lack of. I removed every app I didn't absolutely need. It turns out that still wasn't enough. If you are wondering why your older remain relatives or friends are so slow to message back; this is probably why. It is so tempting, as a developer using the latest handset, to think people will upgrade their handsets. Guess again, according to the official Google developer pages a massive 36.3% of android handsets are running KitKat L19 or lower as of January 2017. If you are building a mass market app this simply isn't a demographic that you can afford to ignore.

There are some tech companies who occasionally do downgrade testing for a large set of their employees. Facebook is one noteworthy example.

Many apps just can't run in usable time, by that I mean that they remind me of using a x286 without the Coprocessor. A particularly bad example was the twitter app which crashed every time that the "share content on social" hook was called to find contextual information.
The question remains, does developing for the latest hardware first make sense if you are trying to reach mass appeal or does making your developers start with the end in mind ensure your app will succeed?

2016/09/23

Discovering The Beauty of Tuscany in Italy

Italy is without exception my favourite place to visit and my last trip was no exception. There are some really stunning places but my favourite from my last trip was Montepulchano.








The town it's self is small and can easily be walked around in a matter of hours but to really get to know this gem of a spot you have to spend a little more time getting to know your way around.

One definite attraction are the wine cellars of this great old wine growing region.


As well as the beauty of this gorgeous town our accommodation at Residence Fabroni really made the visit special. Ombretta, the manager of the property was probably the most hospitable host you could ask for. The view from the balcony was worth the trip alone.


As well as the Tuscany wine region the trip also included Florence and Verona, the town famous for it's part in Romeo and Juliet. The restaurants definitely seemed to favour eating in couples!








More photos coming soon when I manage to find a USB card reader!

2016/05/31

QA for the Customer

Some time ago I had the chance to work wuth a development team which had separate QA resource. The team was working in the standard "over the wall" mentality. Developers do stuff, QA engineers pick it apart and so on.

I heard a phrase which really gave me pause:

"QA is working on behalf of the customer"

This sounds great, the QA engineers really take ownership of thinking about the customer. What does it say about the development team motives? Aren't they thinking about the customer?

In the teams I have helped shape I have always avoided dedicated QA because I suspect it creates an environment where people defer responsibility. On the other hand it might mean that a stretched development team can roll out faster as they can rely on QA to catch the issues. That might sound plausible but in the world of ever accelerating deployment can manual testing really keep up?

2016/04/19

Recruiting Full Stack Developer

I recently joined www.parktechnology.com as the CTO.

One of the great pleasures of my role is to start hiring a technology team. The first role we are trying to recruit for is a 'Full Stack Developer'. We will also be hiring for Android and IOS developers too so watch this space.

UPDATE...

We were really lucky to be able to find two really strong candidates who have a wealth of experience. Exciting times!

Blog Draft Ratio: Should We Publish Everything

Recently I have had a proliferation of ideas about blog posts to write. The challenge is knowing which are really interesting to readers. One thought was to publish every draft as it is then let views / votes / comments decide which to refine. Does anyone want this?

2016/03/13

Random Damage

One of the hardest things to rationalise are random acts. Today I found someone had pushed my motorbike over. Unfortunately there was quite a bit of damage. I still need to strip down the rear fairing which is cracked,  but the damage already stands at over £350.

With insurance premiums spiralling and excess now nearly half the value of the bike,  maybe it is time to let it go. You just can't keep anything nice.

2016/01/19

How to Apply Sales CRM to Job Hunting

After reading a number of books on sales about using technology like Customer Relationship Management (CRM) tools to measure and qualify your sales funnel to increase the predictability of leads and opportunities turning into offers and contracts.

By leads I'm talking about people or companies I haven't contacted or worked with.  Once they are qualified then they become opportunities. This seems to be a common distinction made in the sales industry. The terminology seems better suited to sales and marketing but for the sake of speed I'm going to use them here.

Many sales organisations also split the tasks of generating leads and developing them into opportunities. My lead generation activities included:


  • Attending conferences and fairs.
  • Researching top companies via lists from sites like glassdoor and the guardian top graduate employers lists.
  • Through my network trying to identify potential companies.
From these lists of companies the qualification step is quite different from an outbound sales team approach. In a sales team the lead generation hand over happens after the lead generation team has made contact and qualified that the potential customer is in the market to buy. The opportunity team then focuses on 'closing' the deal.

In the job hunting context this looked like researching the companies and identifying whether they are hiring for a good work match. To stretch the metaphor further the HR, talent team or recruiters are the 'gate keepers'. Initial calls would be with HR for example and once it seemed there was a potential there and the discussion was involving the leadership team of the company they were converted to opportunities.

In keeping with the predictable revenue approach I tried to keep track of how many companies I found were in market. For me it was around 20%. This helped me figure out how many companies I needed to research to feed my opportunity funnel.

Using my CRM tool I set up a opportunity funnel with stages for:
  1. Introduction Email.
  2. Initial Call. 
  3. Send CV.
  4. On Site Interview(s).
  5. Proposal Meeting.
  6. Offer Review.
  7. Accepted.
This was really helpful as I could prioritise based on likelihood of getting an offer and how far along the process I was. Being able to track the attrition also gave me an idea how many company lead generation / qualifications I needed to do in order to 'fill' my week. The goal being to have 5 - 10 on site interviews per week.

2016/01/15

Fix Found for Foundation 5 Syntax error unrecognized expression

If you are using Zurb Foundation 5 and are seeing this error message:

Uncaught Error: Syntax error, unrecognized expression: [data-'Times New Roman'-dropdown]


Then check out this solution from http://jelaniharris.com/2014/fixing-foundation-5s-unrecognized-expression-syntax-error/

2016/01/14

Installation Issues of Ubuntu 15.10 and 14.04 on Lenovo X1 Carbon

I recently bought a Lenovo X1 Carbon and had a bit of a 'mare' installing Ubuntu (both 15.10 and 1.04). I had error messages like:


  • Unable To Find A Medium Containing A Live File System
  • ACPI PPC Probe failed 

And some other issues which aren't possibly related. The bottom line is that it wasn't possible to install ubuntu from USB disk as the live CD medium wasn't found. 

There is an open bug with usb3 disks and I found that if I forced my laptop to treat the ports as USB2 (disable USB3 in the bios) everything worked fine. If you are having this issue and this post helps feel free to tweet me your dmesg issues so I can add them to the list!

2015/12/31

Which is the next hot technology for full stack developers?

I am trying to compile a list of technology stacks that full stack developers are using and could in the future become part of a recognised approach like LAMP. Please tweet me your suggestions...


  • React / Go / Mongo : MGR 
  • React / Node / Mongo: RNM
  • Angular / Ruby / Mongo : MRA
  • Ruby / Rails / Postgres : RRP
How about layout technologies? The main runners seem to be:

  • Foundation
  • Bootstrap
Then there is view / control systems like:
  • Backbone
  • Angular
  • Ember

2015/12/23

Ansible Destination Not Writable


This is a quick blog post FYI in case you are searching for error messages like:


msg: Destination /etc/mysql/my.cnf not writable

This may be caused by the need to set the sudo flag in any roles/your_role/vars/main.yml files as it seems that they default to sudo : no if you define a main.yml for your vars. While creating the main.yml file for all of the vars your role defines seems to be best practice it isn't intuitive that you need to redefine that this role should use sudo.


---

sudo : yes

Thanks to Patrick Kuti for his tip in this ansible discussion for the solution.

Note too that vars in a role overrides inventory variables. If you want to document the defined variables use roles/role/defaults/main.yml instead.

Links:

2015/12/17

The Three Stages of Software Design Evolution


I have had a number of conversations lately with different people on the subject of assessing job candidate competency. This is a really hard thing to do in an interview. One of the main reasons is that the stress of the interview can seriously detract from the candidate performance.

A colleague asked me how I would assess the levels of competency for a developer and after some thought I came up with a few distinctive levels:

JFDI: Hack, Ship, Hope

Now we are talking here about the 'design' element of the process. You can hack code in a well designed component or a poorly designed one. The choices you make on your first attempt will determine whether when you need to change the code whether you can iteratively change it or it has to be replaced.

Startup developer teams often end up building components that are thrown away. This is usually because they didn't fully understand the requirements. This is kind of a special case. Startups are supposed to solve problems for which the answer is not known aren't they? (Well supposedly).

At this level code review may not pick up on the design decisions being made (or lack of design) during individual diffs. 

Ask a Friend

In reality most software developers have discovered Google search by the time they graduate. The even more socially adept may have also discovered the joy of getting help on Quora and StackOverflow. The tricky thing is that once you are in an professional role you often can't reveal too much about what you are working on.

There are a few different activities to look for:
  • Searching the internal repos for a working solution (yes code can be re-used).
  • Internal forum activity.
  • Engaging a more experienced engineer. We all need coffee breaks.
  • Finding the coding standard for your team and seeing what the normal design pattern usage is.

Defining Norms

Once a developer has started to get feedback on designs there is a natural tendency to share the decision. This may be as part of a show and tell or a wider presentation. These sorts of activity will drastically improve the efficiency of not only the developer solving the problem but the reset of the team by sparking ideas and understanding.

The nirvana of defining 'the way we work' is upon us. One of the most debilitating challenges facing any developer sitting at their keyboard:
The past, like the future, is indefinite and exists only as a spectrum of possibilities. - Stephen Hawking
There can at times simply be too many possible ways to solve a problem. Design patterns can help but they some times contradict each other. In order to be able to 'get things done' some times the best thing can be to have a standard way which means you can get started then discover along the way the problems you still don't know about. This idea works well with the concept of tracer code.

Defining Exceptions

Clearly the goal of defining a norm like how should a problem be solved should include the counter cases. If the goal of defining ways of working the challenge here is to understand where a library, tool or process doesn't apply.

How many times have you seen hadoop map reduce used to solve problems exactly matching the documented counter cases? 

Some framework take this "when you have a hammer everything looks like a nail" philosophy to the limit. 

In a startup context you can also find that you come full circle and use the wrong tool simply because you have to get something done. The reversibility design pattern is your friend. Apply liberally. 

2015/12/16

Sales University

In a previous post I mentioned the sales training from Rod Sloane which I attended at Google campus. My goal was to brush up on my sales skills to support a few projects I am working on at the moment.

In addition to finding some seminars and networking groups I also built myself a reading list of some of the top rated sales books available on Kindle. For each one I downloaded the sample and bought it if I was convinced it was worth a read. I will update the list as I get through them.

Coffees for closers

A really useful read for those who haven't, like me, had any formal sales training. It gives you a lot of tools and examples to help you think about what you could have done differently in retrospect.

Predictable Revenue

I really like how this book outlines a number of funnel steps and helps you to focus on tracking conversion rates so that you can predict sales volumes. The idea is that if you know the conversion rate of all of the steps in your sales funnel then you can estimate team size required for your sales target. I ended up using the sales funnel stages that are defined in this book to create the opportunity states in my CRM. Great stuff

To Be Read (Not all directly sales)

- The DIY manual of copy writing that really packs a punch
- Delivered: the no nonsense guide to email marketing
- 79 network marketing tips for fast track success
- Sell them the pen
- The little fish guide to marketing
- Bootstrap marketing: 101 tips for marketing on a budget

Other Events

2015/11/12

Web Summit 2015 with Upgrade Digital

In November this year I was lucky enough to be able to attend Web Summit to promote Upgrade Digital 

The web summit venue is truly vast. Our stand, which we only had for one of the three days was near the main stage so we had fantastic footfall but very little engagement sadly.



Web summit has become famous due to Uber raising so much funding during a chat in the pub but it has perhaps gotten too large.


The first night summit was very popular and there were a lot of great conversations but what became apparent was that there were a very large number of startup companies attending.

If you go to Dublin I strongly recommend going for a whisky tasting session at the temple bar. The bar staff are very knowledgeable and extremely friendly.


Oh, and there are some great places for live music too, whether you are looking for traditional folk or more rock covers.



2015/11/01

SSL Test Certificate Bleed

Many of the people I have worked with will know of my distaste for self signed SSL certificates in test environments. Once you have built a tool to generate and distribute these 'cruft' flakes they invariably spread. The worst case scenario is if these certs end up in your production environment. The real question to ask is will developers take the path of least resistance and skip SSL validation.

I have always advocated using genuine certificates for all build environments. This approach is usually resisted with the vigor of a grad dev defending his favourite language. I don't know why. With a little planning it is easy to use a subdomain, with implementation costs typically in the double digits per year. Usually the argument has more to do with resistance to fixing something that 'works'.

The recent news of symantec accidentally releasing test certificate is a really good counter case. This is one test environment that really should use a self signed cert. The Web needs security and the certificate issuance companies could be the weakest link.