The personal blog of Stuart Breckenridge

Today's Fraudulent Email

Fresh into my inbox, an email purportedly from Bank of America, of whom I’m not a customer (emphasis mine):

“Dear Member,

We are committed to keeping your information secure. We are updating account security so you can feel confident that every transaction you make is protected. The process is simple and will take just a moment.

This is simply ensuring additional verification of protection that will help prevent unauthorized access to your account and will virtually eliminate fraud and totally protect you.

Safeguarding your information is a priority for bank of amirca. Find out how to proceed by Log On to our Sеcurity Cеntеr. We value your business and the opportunity to serve all your financial needs.

Thank you,”

Bank of Amirca

Who writes this stuff?

My Favourite Multiplayer Maps

“Let’s get some grenades and defend this beatch.”

An Unknown Texan

11 years ago I was playing Halo 2 multiplayer on the Zanzibar map when the above quote was muttered at the start of a 1-Flag CTF match. It was so unexpected that I don’t think I’ve laughed so much in any game, ever. Now, in 2015, playing through Halo: The Master Chief Collection1, it got me thinking about what multiplayer maps have stood out as my favourites over the test of time.

#####Zanzibar — Halo 2 The original Zanzibar is my favourite map of all time. It has a great balance of just enough outdoor space to allow for vehicle combat which is tempered by the presence of turrets, to the indoor corridors of the base room allowing for close combat. The placement of the sword at the peak of the map always resulted in an ambitious (or suicidal) player running to get it first.

#####Dust 2 — Counter-Strike, Counter-Strike: Source, CS:GO Dust 2 is an odd inclusion in this list as I cannot stand its predecessor. Nevertheless, whether defending or attacking Bombsite A or B, I really like Dust 2. There are so many different approaches — Rush B, Rush A Long, 2B3A, Rush A Short, Mid to B — it’s just outrageous.

#####Super-Bomberman Unlike Halo or Counter-Strike, in Super-Bomberman you could actually see what your enemy was doing all the time. The grid based, top-down system made it a game of reactions and tactics. It was brilliant, simple, and cunning.

  1. Including Zanzibar's remake: Last Resort.

    </li> </ol></div>

A 1,000 Year Simulation of Football Manager  

“That’s right. You’re not seeing wrong. 1000 years of holidaying in FM15, in just England. I started this on March 4th and it took 58 days of simming to get to 1000 years. And now that it’s all over and the data is all compiled…”


Over the years I’ve lost so many hours to Football Manager but I only last around a maximum seven seasons before starting all over again, so when I saw that someone had simmed 1,000 years worth of the game, I couldn’t help but take a look at some of the more outrageous statistics.

####Premier League

  • Most Times Winner: Sheffield United (168)
  • Highest Attendance: 112,278 (Burnley vs Preston)

The current big four definitely fall back from their role as glory custodians and let Sheffield United in. Burnley – at the Harry Potts Arena – racking up the highest attendances.1

####FA Cup

  • Most Times Winner: Burnley (101)
  • Highest Attendance: 126,047 (Bolton vs West Ham) (in 1923)

Burnley, not content with having the highest attendances across the land, also one of the FA Cup big shots with the most wins. It’s good to see that the highest attendance has stood the test of time.

####League Cup

  • Most Times Winner: Sheffield United (90)
  • Highest Attendance: 112,278 (Burnley vs Preston)

Sheffield United really get their game on in domestic competition, while Burnley’s Harry Potts Arena again hosts the highest attendance.

####Champions League

  • Highest Attendance: 523,945 (FC Red Bull Salzburg vs Red Star)
  • Highest Average Attendance: 576,199 (Celtic)
  • Top Goalscorer: Cristiano Ronaldo (17) (2013/14)
  • Most Goals in a Match: Lionel Messi (5) (2012)

I think there’s a bug as the average attendance is higher than the highest attendance. That being said, with over half a million people going to a match you can only imagine how good the view must be. Two more records that stand the test of time with Cristiano Ronaldo and Lionel Messi holding their own for more than a thousand years.

####Stadiums The Top 10 largest stadiums:

  1. Harry Potts Arena — Burnley (112,278)
  2. Wakefield Arena — Rotheram (105,915)
  3. Quaranta Arena — Sheffield United (90,273)
  4. Verhoeven Stadium — Bromley (87,436)
  5. Jaouen Arena — Plymouth (86,386)
  6. Bridges Stadium — Hull (85,693)
  7. Anderson Park — Southend (83,881)
  8. Wenger Arena — Arsenal (81,170)
  9. New White Hart Lane — Tottenham (70,312)
  10. The Stadium of Light — Sunderland (68,000)

It’s hard to piece this together. The only thing that’s immediately obvious is that The Stadium of Light must be falling apart, given that it’s over 1,000 years old.

####World Cup

  • Number of Times Scotland Win: 1


N.B.: I’m waiting to download the save game. Seemingly, Celtic won the SPL every single year of the entire simulation.

  1. Note: The Harry Potts Arena has a larger capacity that the population of Burnley.

    </li> </ol></div>

iCloud Voicemail  

“Employees at Apple are reportedly putting a new service through its paces, one that would allow Siri to not only answer a missed call instead of a pre-set voicemail message, but give her the ability to record and transcribe those message for users to read as text later (via Business Insider).”

Mitchel Broussard

I think the idea of iCloud Voicemail is excellent. The adoption of Visual Voicemail – itself an outstanding feature – has been poor1 and that’s the fault of the carriers. They have, once again, presented Apple with a problem to solve and in the process cut off one their revenue streams.

  1. Only 10 carriers in Asia Pacific and Australasia support Visual Voicemail.

    </li> </ol></div>

App Transport Security, Cloudfront, and S3

App Transport Security is a new feature in iOS 9 and OS X 10.11 and it’s enabled by default. This means that you can’t use standard HTTP for requests without making changes to application’s Info.plist.

Take the following simple request:

let request = NSMutableURLRequest(URL: NSURL(string: "")!)
request.HTTPMethod = "HEAD"
let queue = NSOperationQueue()
let session = NSURLSession(configuration: sessionConfiguration, delegate: nil, delegateQueue: queue)
let downloadTask = session.downloadTaskWithRequest(request) { (url, response, error) -> Void in

This request fails in iOS 9 with the following error and a nil response:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. 

Temporary exceptions can be configured via your app's Info.plist file.

As Cloudfront supports HTTPS the request URL can be changed:

let request = NSMutableURLRequest(URL: NSURL(string: "")!)

However, when running the request a different error appears:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

For my specific configuration – Cloudfront CDN with data hosted in Amazon S3 – Forward Secrecy is not enabled (or, at the very least, it’s causing issues). You don’t have to tear down ATS entirely to get things working, you just need to disable the requirement for Forward Secrecy in your Info.plist:


This resolved my issue, hopefully it helps someone else to.

2XU Compression Run 2015  

The postponed 2XU Compression Run is happening on August 2nd. While the route has yet to be announced, a few extra bits of information have trickled out:

“Flag-Off Time: 4.30am (21.1KM), 7.30am (10KM) and 8.30am (5KM)
Venue: Marina East Drive (Open field beside 201 Marina East Drive, Singapore 029997)

Due to the changes in the date and venue of the run, please also note that there will be changes in terms of the layout and race route. While the route may not be as ideal as we would like it to be, the replacement route has been derived with the best of our abilities, given the sudden change in circumstances and because many venues were booked a year in advance. The updated race route will be announced this week due to restrictions by stakeholders.


The start point is hard to get to, so have a look at the getting there guide.

Code Review

When I first got interested in programming – around 2009 – the first app I made was a little utility to help you pick your lottery numbers. It was called Lucky Dip and it sold exclusively in the UK App Store and it very quickly went from being £0.69 to being free.1

In the spirit of continual improvement I’m reviewing my younger self’s code, and boy is it a painful experience.

The problem statement: generate a set of six unique numbers between 1 and 49.

Younger Self

I’m sure I attacked the problem in the following way:

  • find out how to generate numbers within a specific range;
  • generate six of them; then,
  • compare them all against each other individually to make sure they are unique.

This is what my code looked like:

- (NSArray *)generateLottoNumbers
        // Generate Numbers
    int n1 = arc4random() % 49 + 1;
    int n2 = arc4random() % 49 + 1;
    int n3 = arc4random() % 49 + 1;
    int n4 = arc4random() % 49 + 1;
    int n5 = arc4random() % 49 + 1;
    int n6 = arc4random() % 49 + 1;
        // Check uniqueness
    if (n1 == n2 || n1 == n3 || n1 == n4 || n1 == n5 || n1 == n6 ||
        n2 == n3 || n2 == n4 || n2 == n5 || n2 == n6 ||
        n3 == n4 || n3 == n5 || n3 == n6 ||
        n4 == n5 || n4 == n6 ||
        n5 == n6)
            return [self generateLottoNumbers]; // Duplicates detected.
    	// Return a sorted array.
        NSMutableArray *numbers = [NSMutableArray arrayWithObjects:@(n1), @(n2), @(n3), @(n4), @(n5), @(n6),  nil];
        NSArray *array = [numbers sortedArrayUsingSelector:@selector(compare:)]; 
        return array;

The code was then called with:

	NSArray *numbers = [self generateLottoNumbers];

This existed in each view controller in a different incarnation, suitable to each lottery game (typed out every time).2 Talk about not having reusable code and massive view controllers.

Current Self

What I’d do now is create reusable code so each view controller for each lottery game called the same function. I’d start with a protocol:

protocol LottoNumbers
    func generateLottoNumbers(count:Int,maxRange:UInt32) -> [Int]

I’d then extend UIViewController to conform to the LottoNumbers protocol3. The function makes use of a Set to ensure that there are the correct amount of unique numbers:

extension UIViewController:LottoNumbers
    func generateLottoNumbers(count:Int,maxRange:UInt32) -> [Int]
        var i = 0
        let uniqueSet = NSMutableSet(capacity: count)
        var numberArray = [Int]()
        repeat {
            let genNumber = (Int(arc4random() % maxRange + 1))
        } while i < count
        if uniqueSet.count != count
            return self.generateLottoNumbers(count, maxRange: maxRange)
        return numberArray

This code can be reused depending on the rules of the game and it also prevents having a massive view controller:

let numbers = generateLottoNumbers(6, maxRange: 49) // Lotto.
let numbers = generateLottoNumbers(5, maxRange: 50) // Euromillions.
// etc...

There are always better ways of doing things. However, the original version worked and that’s all that mattered at the time.

  1. I had lofty ambitions of World domination that didn’t last. ↩︎

  2. There were three others: Hotpicks, Thunderball, and Euromillions. ↩︎

  3. This could also be achieved with an Objective-C tags. ↩︎

New Horizons Reaches Pluto  

“Nasa’s New Horizons spacecraft has made the first visit to Pluto, speeding past at 14km per second. Earlier, the space agency released the most detailed picture yet as it hurtled towards the dwarf planet on Tuesday. The probe was set to grab more pictures and other science data on the object, as it passed 12,500km from the surface. Controllers got a last health status report, before the robotic craft turned its antenna away from the Earth to concentrate on its target. Only when New Horizons has its trove of images safely in its onboard memory will it call home again. This is not expected to happen until just after midnight (GMT) into Wednesday. It means there will be a long, anxious wait for everyone connected with the mission, as they hold out for a signal that will be coming from almost five billion km away.”

Jonathan Amos

It’s incredible to think that we have a satellite orbiting a dwarf planet, sending back data, from a distance of five billion kilometres. Star Trek distances.

Update: just look at this tweet

Apple Pay Arrives in the UK  

Apple Pay launches in the UK today. Two notable absentees from the participating banks list: Barclays (going their own way) and Citi. Oddly, both support Apple Pay in the United States.

The Student Laptop of Choice

Last week I went to grab a coffee at Starbucks and couldn’t help but noticing that the place was filled with students and that every single one of them was using some variation of a Macbook. Out of 14 laptops, 13 were MacBooks (the non-Macbook user wasn’t a student). The ratio of PC-to-Mac users has flipped since I was at University 12 years ago.

The popularity of Macs isn’t a surprise: their sales figures are going through the roof while PC sales go through the floor. This, however, is caveated: Macs are popular with consumers but have a infinitesimal share in the corporate market. That doesn’t look like changing — there’s simply too much infrastructure (legacy and current1) that relies on non-Apple technologies.

Those students are going to get a shock when they join the corporate world and can’t use Macs.

  1. I’ve seen, in the last few years, ATMs that still use Windows XP.

    </li> </ol></div>