Category Archives: Meetup

IET Meetup: Appleton Lecture – AI and Human Digitization


The first address in this year’s Appleton lecture was given by Dr Sarah Atkinson. She gave a historical view of “fake news” created by manipulation of media, starting with the Cottingley fairies. This set the scene for Dr Hao Li’s excellent presentation of his research into animation of people, initially through long-running processes for film effects, but latterly in real-time for Animoji on the iPhone X.
Dr Hao Li - Animoji Mastermind
There are plenty of applications for the techniques, such as video conferencing, social media and even films. However, the common theme was that, as these technologies become mainstream, we should no longer assume that video evidence of a speaker saying something is actual real.

Leave a comment

Filed under Meetup

IET Meetup: Mountbatten Lecture, 2018

I was lucky to attend the 2018 Mountbatten lecture at Savoy Place, London. This year’s speakers were Dr Julia Sutcliffe of BAE Systems and Air Marshal Julian Young of the Royal Air Force.

Dr Sutcliffe’s theme was “Air Sector Technology – is the sky still the limit?” and spoke of breakthrough technologies such as cloud computing and artificial intelligence as the 4th Industrial Revolution (after Steam, Electricity and Electronics/Computing). Her interest in military air systems is the generation of huge amounts of information for each single flight – not only from machine performance but also from crew health metrics. It would be a game changer to be able to receive the telemetry in real time so that appropriate action could be anticipated and actioned as soon as the plane returns to base. Other topics were unmanned systems for dirty or dangerous tasks and “Chemputation“, a method for using algorithms to build materials.

Air Marshal Young’s theme was “RAF 2118 – Engineering the next 100 years”. His point was that the Royal Air Force has been entwined with technology throughout its whole life, with innovation often the deciding factor in conflicts. Innovation has produced accuracy improvements in weapons delivery as well as amazing reliability for engines (such as the EJ200 in Typhoons). Novel technologies can also deliver increased operational performance, reduce production costs and reduce through-life savings – leaving more money to buy shiny new aeroplanes.

Interestingly, multi-core processors are not currently sanctioned for use in safety-critical systems because predictability is paramount. And whilst 3D printing could potentially allow spares to be produced “in theatre”, in practice it’s more reliable to produce them at home in a factory and send them in one of the daily flights transporting crew/cargo to the area.

The RAF Engineering teams breed a culture of innovation and “restless improvement” with each new generation.

Leave a comment

Filed under Meetup

C++ London Meetup: Tuppence more on Standard Algorithms

This evening of talks was split into a set of Lightning Talks in the first half followed by a discussion about the Standard Library in the second half.

Part 1 – Lightning Talks
Richard Chandler – ACCU 2018 Trip Report – much on C++14 and C++17 standards to catch up on as well as introduction to Kotlin and a number of talks on diversity and inclusivity.

Phil Nash – East End Story
Phil dived into the controversial East Const v West Const debate

    void f( T const& t ) // East const
    void f( const T& )   // West const

i.e. should you put the const before or after the type. This topic was introduced by Dan Saks in 2011 – Simplifying const Syntax, Dr Dobbs and revived by Jon Kalb in A Foolish Inconsistency.

“Const applies to what is on its left, unless there is nothing to the left, in which case it applies to what is on the right.” But using east const format, it always applies to the left! West const reads more naturally from left to right, e.g. “const integer” – the East const argument is that you would always read declarations inside out and right to left!

    char const * const pc = str // pc is a const pointer to a const char, reading right to left

Developers are already accustomed to using East const for const member functions (must put const on the ‘east’ side). And there are other examples of going East:

    // moving the return type further east as a result of c++11
    auto someFunc( int i ) -> std::string; 

    // you have to put the return type on the east side
    auto lambda = [] -> double { return 0; } 

Other considerations: Swift/Haskell have trailing return type; putting auto at the start of list of function definitions, the start of the names line up; C++ standard NL.26 says use conventional const notation, endorses West Const notation, but is itself inconsistent!

Phil is now using trailing return types everywhere in production code – see his blog, East End Functions (LevelOfIndirection.com)

Stewart Becker – A Fool’s Consistency, the rebuttal (Jonathan Muller’s talk)

East const gives more consistency? If 83% of people write const T (i.e. West const), you need to be consistent with everyone else in your codebase.
Const pointer to const fallacy – with modern c++, use const std::string_view instead. Can use std::as_const(x) to get the const cast.
Right-to-left fallacy – but we read loops etc from left to right, and ‘const’ is an adjective which goes before the noun in English.
Clockwise-Spiral rule for function pointers.

const east west const – you are allowed to write const in both the East and West positions!!

Part 2 – Tuppence More on Standard Algorithms – Iakov Sergeev
Iakov believes the standard algorithms should make code easier to implement and read, but are forgotten in practice. He raised issues with inconsistencies and the learning curve to use STL (output iterator, predicates, modifying input sequences, could take both begin/end iterators).

Historically, the predicates were hard to implement where you had to supply a functor to call algorithms. Now, with lambdas, it’s much easier and localised to call algorithms.

The audience felt that Eric Niebler’s work on the Ranges TS should help a lot with adoption of standard algorithms.

Leave a comment

Filed under C++, Meetup, Programming

IET Turing Lecture: Innovation and Technology – Art or Science

This evening at the IET was split into two lectures, the first by Larissa Suzuki entitled “Brave New Smart World”. Larissa covered a lot of ground, scaring the audience with figures on our over-population of the planet, over-consumption and lack of recycling. Then she showed how we may have potential to engineer our way out of these global problems – with smart cities, self-driving cars and smart-recycling.
Quote of the Day:

You cannot jujitsu your way out of bad data


The main Turing Lecture was by Andy Harter, who among other things invented VNC (used for connecting to remote computing devices). The stated intention of the lecture was to make the audience think about whether innovation and technology owe more to Art or Science. The lecturer admitted that his hope was that we’d agree that both are necessary. He covered a number of facets that he believes are the ingredients behind the best inventions: Creativity, Necessity, Storytelling, Timing, Retrospection, Observation, Laziness, Simplicity, Responsiveness and Generosity.

If necessity is the mother of all inventions, laziness is the father!

This quote was quite pertinent to the speaker, who invented VNC so that he didn’t have to leave his office to help a colleague down the corridor with issues on his machine!

Leave a comment

Filed under Meetup

ACCU Meetup: Code Craft

Jason Gorman of CodeManShip gave an interesting talk on code craft this week. The talk began with the business case for Code Craft, based on the cost of changing a line of code. If you compare the number of changes in source code repository to the expense of their development teams, the cost generally increases massively over time – 40X more expensive per line of code change after 8 years for one company. The same hockey-stick chart appears in Kent Beck’s book “Extreme Programming Explained”. Code Craft skills tend to flatten the cost-of-change curve, which is good for the business, and make the code easier to change, which is good for the developers.

Code Craft Skills

Write good unit tests, use version control, do continuous integration, apply design principles, refactor code safely.

Cost – if the cost of a change in design is 1, then the cost in implementation is 6.5, in testing is 15 and in maintenance is 100.  Bringing testing forward in the development process gives a massive return on investment.  Legacy code can be defined as any code that doesn’t have fast running, automated unit tests that can discover a bug quickly – enabling a cheap fix.  You must automate testing and enable the feedback loop to iterate quickly – ideally in minutes or seconds.

Readability – 50%-80% of time spent on a codebase is reading code, not writing it.  Making code easier to read and understand has a great pay-off.  Code that’s hard to understand is easy to break.

Complexity – attack complexity, try to replace it with the simplest thing, which is less likely to be wrong.

Duplication – never copy/paste code, especially off the internet!  You have no idea if it works or even compiles.  Making changes to common logic is multiplied if there’s duplicate code.  Duplication is the opposite of reuse – generate an abstraction to help improve the design.  Duplication can be hard to spot (e.g. customer playing several roles which could have been parameterised).

Ripple Effect – a change to one area of code breaks a much wider circle of code.  Cost of change greatly increased – need to have a local effect from a small change to code.

Principles of Clean Code

The speaker also coaches teams in the following principles:

1. Shorter feedback loops – automated unit testing.  Not possible with manual testing iterations or a manual testing phase.  Automated system testing can give good coverage, but is often too slow, can take hours to run.  Need to run in minutes or seconds.  Ideal chain is Unit Testing -> Integration testing -> System testing.  Want most of the testing in first layer, minimal number of smoke tests in the top System layer.

2. Simple Design – the code works, clearly reveals intent, free of duplication, made out of simple parts.  Need another pair of eyes to check the code is easy to read.  Code review your own code every few minutes.

3. Single responsibility – traditionally, this is taught as classes should only have one reason to change.  Or better, look at the number of combinations of the sections of code implemented in a function – it’s more powerful to break functions into smaller parts then use composition to implement the larger function.  Smaller components/functions => many more ways to re-use. So give each piece of software a single responsibility.

4. Tell, don’t ask – lots of low-level coupling between objects. Better to have objects sharing smallest possible interface to each other. Don’t pass the whole object – pass the data needed to do the operation.  Put the work where the knowledge lives – do the work in the right place so that data and behaviour belong together.

5. Dependency Inversion – you should be able to swap your dependencies.  Talk to dependencies as abstractions through interfaces.  Eg1 all commands inherit from ICommand and high-level components work on generic interface, not concrete classes.  Eg2 VideoRental example, rather than coupling to Imdb, replace with an interface.  Better for mocking/testing as well.

Leave a comment

Filed under Meetup, Programming

Meetup: Workplace London, Facebook


I was lucky to receive another invitation to a private Facebook event, this time the first ever public event at their new offices at 1 Rathbone Square. The focus this time was on Workplace, an application developed entirely from the London offices of Facebook.

Ben Mathews – Practical Security for Workplace

Workplace is a product that helps people work together. It looks a lot like Facebook, but it’s a tool for people to communicate and share things for their work. The website, mobile apps and colour scheme differ from Facebook (so all your personal information is separated). Workplace places emphasis on groups and chat.

Well known companies using Workplace include Walmart, Starbuck and Heineken. These firms have formally adopted the product, it’s administered centrally and employees are members of the firm’s community while they work there. In other firms, the use of Workplace grows organically – employees can set up an account and invite colleagues to join groups (it’s free to use).

Key features include Live Video (great for presentations and Q&A globally), Workplace Chat (a desktop app neatly integrated into the OS) and Company Dashboard (for admins to look after the community).

Ben’s focus is on security for Workplace. There is a difference emphasis from consumer Facebook, where it’s vital to enable users to get back into their account, so multiple methods are supported, such as email/telephone/photo id/friends. For a workspace account, the account is linked more to the employer than to the person. When they leave the company, they should lose access. The basis is the business email account – if you still have access to your company email account, it is assumed that you still have access to the Workplace account. However, a person may work for multiple firms (e.g. main employer and a non-profit) – these identities are kept separate.

Workplace are working on solving the wider problem of identity, to be able to support people who aren’t sitting at a desk and/or don’t have a company email account, but need to re-gain access to their account. Under consideration are crowd-sourcing security (where your colleagues can confirm your identity so that your password can be reset). A less sophisticated idea is just to allow a manager authenticate their employee using the org chart – but that fails if the manager is unavailable. If you have a company admin, they could block an account when people leave the firm (caveat – confirmation by email that the person no longer has access).

Workplace highlight accounts at risk – Facebook check password dumps (websites that list passwords and accounts that have been compromised), so any matching accounts on Workplace can be notified that the account is at risk. In that case, they advise the user to reset their password (and educate them on the danger of re-using passwords across websites).

Spam Prevention – spam is in the eye of the beholder, the poster may think that a post is useful, but maybe the receiver doesn’t. Some tools exist in Facebook to prevent this – e.g. you can’t invite too many friends to an event. But for Workplace, those limits may not make sense – some global distribution lists are appropriate, such as for firm-wide announcements. Spam limits need to be context dependent – the company may want aggressive/lenient levels for spam filtering. During Hurricane Irma, one firm was posting regularly on Workplace and breached the spam limits, so these needed to be quickly adjusted.

Astha Agarwal & Connor Treacy – Building for the Workplace Platform

Initially, the application was called Facebook at Work – this was widely seen as a bad idea since Facebook was thought of as “not allowed at work”, so when re-launched it became Workplace. The Platform allows customer integration software/bots to be written. There are APIs for user management and group/content management. Bots can plug other tools into the Platform for chat and groups, to power everyday tasks. For example, discussions can be converted into tasks using a bot. They have also created an Interview Bot – to give useful reminders and context for interviews. 3000 companies are already using software integrations into Workplace. Another example is a bot to create groups for flight crews so that they can coordinate last minute changes.

Bots are built on top of the Facebook graph API, and bots in chat are very similar to bots for messenger. This enables developers to move from one codebase to another quickly. Many features are carried over, like quick replies (Yes/No), persistent menus and localisation (to translate bots into different languages).

Bots can act as a person in a group – so bots can like, comment and post. The bot can mention a person in a post so that they get a ping to look at the post. This was demonstrated for a bot that files issues in the bug tracking system when it is mentioned, and pings back to the issue creator to give them the ticket number.

Blaise DiPersia & Lyndsay Watt – Learning to Ship Love

Like any software team, Facebook have to balance Time to Market with Quality of Execution. Facebook’s Values inform their decision making – be bold, create social value, move fast and break things. This approach was initially good because they released exciting new features – but also disoriented some users and sometimes made the infrastructure unstable. Eventually there was a breakdown in user trust and a rift in company unity (between customer support and developers on new features). So “moving fast” was changed to “Shipping Love”, to encompass the delivery and quality together.

Now, tasks are evaluated against Value, Ease of Use and Craft – prioritised in that order (note that the different applications within Facebook such as WhatsApp and Instagram have slightly different emphasis on each of these).

Valuable – does it solve a real problem for a person, in a unique way
Easy to use – core features are easy to find, less common features still discoverable.
Craft – moments of delight and magic, handle failures and edge cases gracefully

Facebook Reactions was a good example of this philosophy. First, it had to be confirmed as a real problem that people wanted to be solved, tested in user focus groups. The team analysed which sticker emojis were used and how many comments were already single phrases. Reactions met all the requirements – value, easy to use and well-crafted – and is one of the most popular new features.

Leave a comment

Filed under Meetup

Meaningful Connections @ Facebook

Facebook invited me (and a few hundred others!) to a private event at their London offices to network and hear presentations from several of their engineers.

Allan Mertner – Welcome
Allan was previously at King (makers of Candy Crush) and joined just five months ago. He leads the Ads group in London – the largest group in Facebook London. The culture is to move fast and ship things, to make things better – at scale.

Damien Lefortier – Causal Modeling: Delivering Incremental Advertiser Value
Incrementality
A conversion is any event of interest happening on the advertiser’s side (subscribing, purchasing etc). Incrementality is a conversion caused by the ad that would not have happened otherwise. So reporting these incremental conversions is a goal for any advertising platform. But it’s hard to assess – how to measure people that would have discovered the advertiser anyway.

Attribution frameworks
Used as a proxy to incrementality for determining which conversions are considered for both reporting and delivering. Eg. 1-day or 7-day click-through (so record that the person saw the ad, then count it if they convert within some period if going to the advertiser’s site). Or 1-day View-through – the whole thing from showing the ad to converting within a day. But not all attributed conversions are incremental – may have happened anyway.

Delivering incremental value
First need to measure incremental conversions! Then you can assess if you’re improving your delivery. So you can measure random samples of people that are shown/not shown the ad, and see how many convert.

Causal modelling – model both the conversion probability given ad exposure and given non ad exposure. No need for attribution with this approach. E.g. 1 – Natural Experiments – use the natural randomisation in the system to get data. Use this to train a model – but needs correction for biases. E.g. 2 – Small randomised trials – collect data, but typically means less data to teach models.

A model can not only be used for measuring, but also predicting the impact of an ad campaign. It’s a hard, and interesting, machine learning problem. But it actually works – such as for Brand Awareness following ad campaigns.

Brian Rosenthal – How Facebook culture influenced our ad system evolution
Brian has been at Facebook for over 8 years and has worked on much of the Ads codebase.

Mission driven, monetisation business. Facebook don’t want you to see ads that waste your time and the advertiser’s money. This helps frame the problem as one of efficiency – which is appealing to engineers!

Stage 1: Launching Quickly
Ads started in 2004/2005 – it was initially a college site, so the adverts were related to colleges, storage and moving companies. Ads were integrated as part of the social media interface, not just as banner ads. They had an Advert creation interface, where you could add your ad – with identification of who is running it. Then in 2007, an auction where you could bid per click (where a higher bid increased the likelihood of it being seen). In 2009, you could finally edit your ads (previously, they were only created or bulk uploaded)

Stage 2: Embrace best practices
Figured out the right principles – unlike stage 1 (which was quick and dirty to launch), they really understood the problems. Fixed bugs due to database inconsistencies – instead, adopted modular, transactional units – taking 12 months to ensure consistency (half of that time writing tests). Enforced a strict API layer (so internal code also had to use the API as well as outside users). The auction functionality matured – multi-objective optimisation. You could now bid on all the actions you wanted.

Stage 3: Deeper lessons
Try things again, decouple concerns. In 2011, the world was moving to mobile, but ads didn’t work on mobile! They tested ads on mobile and it was a failure. Trying again with deeper knowledge helped to get it right. Decoupled concerns – an early design error was to have objectives and ad formats entangled. These were separated so that every format supported every objective and the code was independent. Dynamic Ads introduced – made the ad more suited to the person (‘customer segmentation’). Objective-based ad buying – do you want to increase adds to cart or checkouts?

Current problems
Scaling, fighting fraud, quality, malicious actors. Biggest thing has been to be adaptive, to change what they do to meet demand.

Ben Savage – Reducing Unintentional Clicks
Ben joined Facebook in 2013 – initially thinking it would be for a year or so, but has stayed because it’s a fun place to work!

Facebook has a long term view – they need their advertisers to be happy, getting return on investment and increasing their budget year-on-year. This enables Facebook to increase the sophistication of their offering – they used to bill by Clicks, now can model conversions.

Audience Network – the problem was that the value of a click was lower than that on Facebook news feed. They saw that the number of clicks reported was not well associated with the number of significant website sessions. Hypothesis – this poor conversion was due to unintentional clicks. This was frustrating for the users and reduced the value per click.

Tinder uses audience network for its ads. The click goes to Web View – so you can measure the time spent in the browser (before they go back to the launching app). At Facebook, Data Wins Arguments. If there are short sessions, it’s likely the click was unintentional. Could they remove the financial incentive to get these unintentional clicks?

Well, what if they stop billing advertisers for such clicks? Blogged that the company would stop billing for this, even though it reduced revenue, because it’s the right thing to do. As an engineer, that’s pretty rewarding. The hope is that advertisers would then re-design ads (such as removing active whitespace areas) because they wouldn’t count clicks for that anyway.

Wrap up
The panel answered questions from the audience. One development they would love to see is that, for users who allow mobile Facebook to track their location, associating showing an ad with the user physically visiting the store to make a purchase. Another feature that’s already available is “Why am I seeing this?” if you’re wondering why a particular ad was selected for you.

Leave a comment

Filed under Meetup, Technology