Monday, May 7, 2018

Speech links: How to be rich

Mr chairman, fellow toastmasters and guests.

Recently I was enjoying my jet-setting hobby of visiting international airports.  I was sitting in the departure lounge at Singapore airport when a man walked up to me and said "Hi Sean, how are you".  It was Thomas; we had inadvertently booked onto the same flights back to Hawkes Bay.

WE got into a conversation about money, and Thomas asked a questions that I thought was both insightful and pertinent.  He said "Sean, "", and this is almost a direct quote, he said "Sean, how can I be as rich and good looking as you?".  So I told him.  As you can see he is already much better looking.  Afterwards I thought "That's good advice, I should take it" and also "I have to do a speech next week, I should tell everyone".  So here I am.

I would like to introduce you to Harold Pollack.  Harold is a blogger and podcaster.  A few years ago he was interviewing someone about the personal finance industry, the financial equivalent of used car sales.  He said “Isn’t the industry’s fundamental problem that the best advice for most people would fit on an index card, and it’s available for free at the library?”.  They laughed and moved on.

Once the interview was published, people started asking.  They said "Harry, where is the index card" and "Pollock, you pillock, show me the card."

So Harold took an index card, wrote down his 9 rules and posted a photo online.  The rest is viral history.

1                     strive to save 10 to 20 percent of your income.
2                     pay your credit card balance in full every month.
3                     Put 3% into Kiwisaver or similar (NZ version) max out your 401(k) and other tax-advantaged savings accounts. 
4                     never buy or sell individual stocks.
5                     buy inexpensive, well-diversified index mutual funds and exchange-traded funds.
6                     make your financial advisor commit to the fiduciary standard.
7                     buy a home when you are financially ready.
8                     insurance. Make sure you’re protected.
9                     do what you can to support the social safety net.

I promised to tell you how to be as rich as me.  But I'm not rich.  I have a wife and 2 teenage children who are expensive to keep.

I am not trying to be rich, I am aiming for something else: Financial independence; having enough investments that I don't need to work.

To be financially independent, you need to meet 2 criteria:
  1. Have 25 x annual expenses in savings and investments
  2. Spend less than 4% of your saving/investments each year
If you can meet these criteria, then your investments should last at least 50 years.

Closing thoughtsMoney is like sex.  
We like it, but we don’t really talk about. it 
We all think we know what we are doing, but most of us don’t.  
We all think that everyone else has more than we do.
And like sex, the more you learn about it, the easier and better it gets


Saturday, May 5, 2018

Using the Aorus GTX 1080 Gaming Box with an XPS 15 9560

 TLDR: Everything is twice as fast

I recently purchased an Aorus GTX 1080 Gaming Box (see review)  for my 9560 (i7, 1 TB SSD, 32 GB ram).  I have been playing with and testing it for a few days and am pretty happy with my purchase.

Initial impressions

Initial impressions are mostly good.
Setup was annoying
Recognition of the card when hot plugging is OK, but not outstanding.  Typically takes 20 seconds for the card to recognised and my external monitor to be activated.
The internal clearance is a bit tight.  When it arrived, the gpu fan was hitting the casing.  I had to remove the case (6 screws) and do some precision adjustment with pliers to resolve this.

Set up

Initial setup is a pain in the arse, although it would probably have been easier if I had found the CD and read the instructions.

To set it up properly you should do the following:

1. Install the 16.2 thunderbolt drivers from Intel
2. Plug in the box and let windows recognise it
3. Reinstall the graphics drivers
4. Install the latest firmware from gigabyte.  This requires the 16.2 thunderbolt drivers
5. Install the latest thunderbolt drivers from Intel.
6. Profit


Gaming performance on an external monitor is much improved as you would expect.  For every config that i have tried, I get 2 to 2.5 times the fps compared to the internal 1050 card.

Gaming on the internal monitor was also improved, but not as dramatically.  I got an extra 25% fps compared to the internal card.  However the minimum fps was much better.

I did quick and dirty benchmarking with the Far Cry 5 benchmarking tool.

I also tried testing with Farcry 4.  Unfortunately I couldn't turn off vsync, so with the gaming box I got a solid 60fps @ 1440p with everything on ultra.  Using the internal card I averaged 28fps.

In Final Fantasy 15, I am getting 50 fps on highest settings.

Overall I am pretty happy with this.  Every game that I have tried has been able to run at 1440p on highest/ultra settings at a playable framerate.

Friday, September 2, 2016

Welcome to the revolution(s)

The following is a rough transcript of my toastmasters speech 7: "Do your research"




The Luddites were a protest group that primarily operated between 1811 and 1816.  They were primarily workers in the garment industry.  They started riots and destroyed machinery.  These days, the name Luddite is applied to anyone who struggles with or opposes new technology.  However, the original Luddites however weren't so much opposed to technology as  to it's effects.  In particular they feared the loss of work from automation and the replacements of skilled labour with unskilled.

The Luddites were correct in their fears.  The industrial revolution eventually resulted in better working conditions, better wages and an improved standard of living standard.  However it took a long time to get there. On the way, it resulted in widespread pain and unemployment.

Mr chairman, fellow toastmasters and guests, welcome to the revolutions.

I am not actually going to talk about the first industrial revolution, the one we learned about in school.
Nor am I going to talk about the second one, exemplified by Henry Ford’s introduction of the assembly line
The third revolution was the digital revolution.  Most of us have lived through it.  But I am not going to talk about it

I am going to talk about the one happening right now, the fourth industrial revolution.

  • What is it?
  • What is the impact?
  • What can be done?

What is it? 

There area number of technologies making up IR4 such as

  • AI
  • Robotics
  • Automation
  • genetic engineering/biotechnology
  • Nano technology

Most of these are autonomous, things that happen without human intervention.

Individually any of these would have a large impact.  together, it is a perfect storm of change.

Let me give you a few examples:
Every major car manufacturer is working on self-driving cars.  Tesla has one out now.  Uber is trialling self driving cars in Pittsburgh this month.

Major truck manufacturers such as Mercedes Benz and Volvo are working on self driving trucks.  The intention is that a local driver will drive the truck to a motorway, the truck will drive cross country to near it’s destination and then a second driver will handle driving the last few kilometres to the final destination.  Long haul truckers will become short haul truckers

IBM have been working on an AI called Watson.  A few years ago it won the American game show Jeopardy, beating out previous champions.
Now it is being used in medicine, as a laywer and in other fields such as teaching

Amazon is my poster child for IR4.  They started out as a website bypassing physical stores to reduce prices.  They have giant warehouses heavily using robots and autonomous delivery cart.  Now they are working on using drones to deliver directly to purchasers.

What is the impact?

There is going to be a big impact.  Many job categories will disappear or become much smaller.

  • Oxford: %47-81% of jobs under threat in 20 years
  • McKinsey Quarterly: Almost half of current job activities can be automated.
  • World Economic Forum: Predicts loss of 5m jobs in the next 5 years
  • The International Labour Organisation 137 Million SE Asian Workers Could Lose Their Jobs in the Next 20 Years

Most of the 137m SE Asians work in the garment industry, the industry that gave us the original luddites.

“Foxconn replaces 60,000 factory workers with robots”
Foxconn is the company that makes iPhones.  They employ 480,000 people.  Well they used to, now they employ about 420,000.  These are people that make $5 per day, and it is still cheaper to use robots.

If you think China is too far away to care about, Watties is right next door.  They have been replacing workers with robots for the past 20 years

This graph shows the change in income across the world from 88-2008.  The poor are on the left, the rich on the right.
The area around 50-60% is mostly China and India.  New Zealand and other rich countries are mostly from 75% - 100%.

This graph is both good news and bad news.
Good news.  If you are rich, well you got even richer.
If you are poor, then it’s also good news.  Offshoring and globalisation have made many of the poorer countries much better off.
But for those of us in the room, we mostly fall in the 80-95% range.  And we haven’t seen much growth in our incomes.

IR4 may (and we don’t really know) make the dip even wider, as the rich keep getting richer but the drop in employment reducing incomes for the rest.

What can be done? 

  • Shorter working hours
Before the 1st IR, the average working week was about 70 hours.  Now it’s more like 40.  If half of the jobs disappear then perhaps we will only need a 20 hour week.  The French have already started moving in this direction.
  • Universal Basic Income
The UBI is a payment made to every adult in a jurisdiction with very few eligibility criteria.  It provides enough money for people to live without working and replaces most government benefits.  It’s much like National Superannuation if it had a starting date age of 18.
This is been trialled in many areas around the world.
  • Education 
Education will be key, but it will be lifelong education as employment requirements change.
  • Adapt 
In the long term, the 1st industrial revolution was a good thing.  It reduced working hours, lowered the cost, and raised the standard, of living .  However there was a lot of pain along the way.  We can expect this again, the trick will be to navigate the 20-50 years till we get there.



Friday, September 11, 2015

Using the Visual Studio Android emulator inside VMWare

I do my development in Virtual machines.  It makes it much easier to to back up and transfer my dev environments.  However not everything works inside a virtual machine :(.  Emulator that themselves rely on a virtual machine are problematic.

When Visual Studio 2015 was released, I built a new VM and installed everything.  VS2015 worked fine but the new shiny Android emulator wasn't so happy.

The first error was around Hyper-V.

Visual Studio Emulator for Android
The emulator is unable to verify that the virtual machine is running:
Something happened while starting a virtual machine: 'VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.bob' failed to start. (Virtual machine ID 889F3EA2-7B0E-4873-9180-C765E4293D4E)
The Virtual Machine Management Service failed to start the virtual machine 'VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.bob' because one of the Hyper-V components is not running (Virtual machine ID 889F3EA2-7B0E-4873-9180-C765E4293D4E).

This a fairly common error and once that is easy to fix.

  1. Open the .vmx file in notepad and ad the following lines:
    hypervisor.cpuid.v0 = "FALSE"
    mce.enable = "TRUE"
    vhu.enable = "TRUE"
  2. Run the VM.  Go to "Programs and Features" and ensure that Hyper-V is installed

Running the emulator now gives a completely different error.  Yay, progress.
Visual Studio Emulator for Android
An OpenGL error has occurred:
Failed to create Context 0x3005
The emulator will now shut down.

There are multiple ways to fix this:

Either way works:

Friday, September 20, 2013

Slides - Cross platform programming with .net, xamarin and MvvmCross

The slides from yesterdays presentation "Hot tuna - Cross platform development with .net, Xamarin and MvvmCross" are available from here.

Useful links from the presentation

Stuart Lodge - MvvmCross Author



Video index


Mobile library 

Ninja Coder
Adrian Sudbury – Ninja Coder Author


Ninja Coder

Portable Class Libraries

Wednesday, March 27, 2013

Using with POCO classes

SQLite has become one of the most pervasive embedded databases around.  It's built into Android, iOS and OSX and is a part of many applications.  It has also become the recommended client side database for WinRT applications

The go-to solution for using SQLite in .net is  It’s a simple ORM that comes as one (or two if you want async support) source files.  You can get the full source from github or just the main files from Nuget lets you store nearly any object in the database without needing to descend from a specific type.  However to make it work well, you need to decorate your objects with data attributes denoting primary keys, indexes and so on.

For example:

       public class Valuation
             [PrimaryKey, AutoIncrement]
             public int Id { get; set; }
             public int StockId { get; set; }
             public DateTime Time { get; set; }
             public decimal Price { get; set; }

On startup, you register your class with SQLite as follows:

       var myConnection = new SQLiteConnection ("Stocks.db");
       myConnection.CreateTable<Valuation> ();

This will check to see if the table exists in the database and create or update it if required. 
You can then start using the database in your code.

       var valuations = myConnection.Table<Valuation>().Where(...);

However for my use case (cross platform application with data objects defined in a portable class library and used in WPF, WinRT and MVC applications), the attribute approach didn’t work.  The nice thing about open source though is that you can always change things…

The latest github version of now has an optional argument for CreateTable that allows defining indexes by convention.   

Acceptable values are:
    public enum CreateFlags
        None = 0,
        ImplicitPK = 1,    // create a primary key for field called 'Id'
        ImplicitIndex = 2, // create an index for fields ending in 'Id'  
        AllImplicit = 3,   // do both above

        AutoIncPK = 4      // force PK field to be auto inc

So to define and register a class, we can now use something like the following:

    public class Valuation
        public int Id { get; set; }
        public int StockId { get; set; }
        public DateTime Time { get; set; }
        public decimal Price { get; set; }

And then 

       myConnection.CreateTable<Valuation>(CreateFlags.AllImplicit | CreateFlags.AutoIncPK);

This will create the table, make Id into an auto incrementing primary key and add an index for StockId.  To explicitly add additional indexes, use the CreateIndex methods.  E.g. 

       myConnection.CreateIndex<Valuation>(v => v.Time);

The main advantage of this approach is that it lets you separate storage details of the object from it's definition.  This is great for cases when you don't want to, or can't, use the sqlite attributes in the main class.  

The main disadvantages are that you have now separated storage from definition, and currently there is no way to set the field size.

Sample applications demonstrating both approaches can be found on github.  The sqlite.dll binaries can be downloaded from here.