Platypus Header

Platypus Innovation Blog

28 May 2018

Splitting out a React js project for code reuse - The easy way

We like React, and we run a few projects on it: Good-Loop's portal, SoGive, and some internal tools. So we wanted to reuse code between these projects.
One way would be to make separate npm packages. But this is a painful solution: The compilation setup is painful, and you lose source-code maps (so you end up debugging from babelled code).
Instead, we found a simple solution using symlinks:
  1. Just sym-link the "packages" in, using ln -s (for Linux or Mac; I don't know what the equivalent is for Windows).
  2. Set webpack's resolve.symlinks property to false. In our setup that meant editing webpack.config.js to have resolve: {symlinks: false }}.
Then your code is split out -- but as far as the build process is concerned, or your code editor, nothing has changed.
You can also unit test with tests in each "package".
E.g. your project folders might end up looking something like this:
  • myapp
    • src
      • subpackage: a symlink to subpackage/src
    • webpack.config.js, package.json, etc.
  • subpackage
    • src
    • test: unit tests for src files
    • webpack.config.js for the unit tests
This is easy and it works.

12 April 2018

Invest in Good-Loop

This is an unusual post for me. After 10 years as an entrepreneur, I am asking for money.

Amy and I set out in 2016 with a mission: to make something positive and good in the often sordid world of online advertising. Good-Loop is an ad network, but different from any other:

  • 50% of the money goes to charity. To be clear: that's not 50% of profits, or 50% of our commission. That's 50% of the total revenue. The rest is split, approximately 30-40% to the publisher and 10-20% to us.
  • The user is in control: of whether we show them an ad, and what we do with their data. This is the "ad-choice" alternative to adblockers, which avoids annoying ads whilst still supporting publishers to create.

We believe that if you treat people with respect and aim to do good, then you can create both a positive impact (money raised for charity), and a better space for advertising (happy viewers are more likely to listen than annoyed ones).

The results so far back this up: because we engage users in a positive way, Good-Loop adverts are watched rather than skipped (benchmarked against YouTube and Facebook video ads), and generate more actual customer activity (measured with one of our clients, Lifecake by Canon). Unilever's chief marketing officer, Keith Weed, describes our approach as a "win-win!" (namedropping, because, wow, not only are we working Unilever, who have one of the world's largest ad budgets and an ethical ethos, but their CMO tweeted about it).

We are not a charity: we plan to make profits and deliver a return. Our aim is to be both profitable and good for the community. I think this investment is a good bet: we have a reasonable chance of delivering an unreasonable return.

Warning: Any investment in a start-up is risky - do not invest money unless you're OK losing it. I cannot provide financial advice here.

If you want to be part of what we're doing - now you can! Over April 2018, we are running an open investment round: https://seedrs.com/good-loop

This is open to anyone. The bulk of the round will likely be established investors who we've pitched to. However if you know and like what we're doing, then you can invest, regardless of cheque size -- the investments so far range from £15 to £30,000.

I hope you'll join us.
If you have any questions, feel free to contact me: daniel@sodash.com

10 January 2018

Upgrading from Jetty 8 to 9

I'm upgrading from Jetty 8.1 to Jetty 9.4. Here are the changes I've encountered so far:

Several classes renamed / replaced:

* SelectChannelConnector has become ServerConnector
* ServletContextHandler has become ServletHandler

Server.setThreadPool() has gone.

Lots of jar changes.

The JSON class (org.eclipse.jetty.util.ajax.JSON) has moved out into a separate Maven project: https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util-ajax, which gives you jetty-util-ajax.jar

We also needed the Maven packages: jetty-server, jetty-servlet


You must upgrade to servlet-api 3.1 (so change anything which pulls in the servlet-api-3.0.jar or earlier).

24 November 2017

UK Chancellor says: Driverless cars by 2021

The AI revolution is getting real: Chancellor Philip Hammond aims for the UK to be using driverless cars in 4 years time.[1] He warns people to: "retrain and re-skill [in what?] so they can take up the many, many new jobs that this economy will be throwing up" [doing what?]

The AI revolution will reduce jobs, especially the ones that employ lots of people. Blue collar, but also white collar, and also management. Computer industry jobs like, er, mine, will go too. This is potentially but not necessarily terrible: if society can be run for the common good, then the extra time & wealth will be a good thing.

Back to Hammond's many many jobs. Here's one new job automation creates: being human for legal reasons.



[1] Philip Hammond pledges driverless cars by 2021 and warns people to retrain. The Guardian.

6 October 2017

GDPR Jargon: What is a Data Controllers vs a Data Processor?

The incoming GDPR legislation introduces roles and responsibilities that will affect a great many companies.

A Data Controller is any organisation that collects and uses data about individuals.

E.g. does your company have a mailing list? Then it's a data-controller.

Data-controllers are responsible for using the data correctly (i.e. only as permitted), for not retaining data beyond the agreed purpose,
and for interacting with the individual about their data.

A Data Processor is an organisation that provides data processing facilities -- e.g. databases and computer systems.

They are responsible for how the data is stored, and for providing proper security (and notification of any security breaches).
E.g. MailChimp is a data-processor.

Of course, many companies are both data controllers and data processors.

28 July 2017

Visiting the Future in Scandinavia

To travel Scandinavia using AirBnB is to visit a version of the future. A clean, well-designed, if somewhat aseptic, future. You need hardly meet another human being. After booking (which is entirely online), I received instructions by email. There is no reception of course; check-in is by a code to unlock a key-box (a miniature safe), and collect a key, which then unlocks the front door. It's like an escape-the-room game (only in reverse: get-into-the-room). Payment is seamless, handled digitally in the background.

There's a definite AirBnB chic, and it's nice enough but generic. Posters from warehouse outlet stores, especially those with universal quotes. Interior decor by the numbers; it could have been designed by a machine.



At Vielje Fjord, we are met by a robot lawnmower - a roomba-style contraption that trundles autonomously around the garden, before returning by itself to its charging bay. This meeting with our robot overloads made a great impression on the younger generation. Fascinated and a little nervous, their garden games centred on it: Escape from the Robot Lawnmower, and Robot Lawnmover Will Eat Your Pizza. The object of this attention calmly continued on with its tasks, unperturbed.

I have the sensation of my family as a small bubble of humanity, travelling effortlessly through the landscape, our path mediated and managed by bots.

As we leave the cabin at Vielje Fjord, we notice the robot lawnmower has failed. It navigated itself into a narrow patch between a fence and some garden furniture, then stuck, it's sensors reporting no safe way out, until it's batteries drained. The future is impressive but it's still a work in progress; expect glitches.

26 June 2017

BitCoin: It won't make you look 5lbs thinner



Recently I've been reading up on BitCoin, Ethereum, blockchain, and the assorted crypto-currencies than now bloom across the techscape.

These are exciting times, but not clear times. Consensus ledgers and public cryptographically signed audit trails are an interesting thing, and they'll find some powerful applications. But it's notable that we've all been perfectly happy to use money systems without that -- witness banks, Visa/Mastercard, PayPal, or the numerous companies who use direct-debits to tap your wealth according to their own notion of credit/debt.

Money systems are essentially about trust (that the the token you hold can be exchanged for goods & services). Money has to be backed by something we trust, such as the nation state & it's economy, or the bank's solvency and integrity at the book-keeping level, or for IOUs, in the individual. BitCoin is the first system where trust is grounded in an algorithm.

That alone doesn't change how money is used. Perhaps BitCoin's biggest achievement is to get enough momentum to puncture the Visa/Mastercard monopoly (alongside PayPal, and now Android and Apple payment systems). These are (welcome) variations on an existing theme. We're still waiting to see a digital currency that really shakes up how commerce works.

People talk of low transaction costs -- in fact BitCoin transactions are computationally very expensive! This is by design: BitCoin uses computational cost to defend against attack by a swarm of bots. As I write this, a BitCoin transaction costs about $0.50 and takes about 20 minutes, but these numbers vary.* That BitCoin is cheaper than debit card or bank transfers is not due to technological breakthroughs. It is because the existing system is massively over-priced.

Reading the many earnest thought-pieces on how blockchain will change everything -- it seems people sometimes project their thoughts about the wider potential of digital currency onto the specific technology of blockchain and BitCoin. These thoughts then get repeated by others (and ratified by repetition), until it can become hard for everyone to see what's going on.

I've seen a similar concept-creep happen in AI. Specific techniques get described by analogy, and those analogies are extended, until people see The Terminator in every AI project. Your future toaster might have senses (to see when the toast is cooked), and voice recognition and machine-learning to learn your preferences. And probably some spare intelligence, because it's cheaper to put in generic over-powered components than to custom make simpler ones. But no amount of feature-creep will turn it into The Terminator. Although it will get hacked by some internet d-bag, inscribe rude messages into your toast, then burn your house down. If you want a picture of AI over the next 5 years, imagine everything as smart toasters.





*BitCoin transactions offer a fee to encourage BitCoin miners to process them, and to do so ahead of other transactions (there is a queue). There are plans to alter BitCoin to allow for cheaper transactions, though this requires a reduction in security, and changing a currency on the fly is not easy.

Images: (cc) FamZoo Staff, famzoo on Flickr, and the Talkie Toaster from Red Dwarf.

Good-Loop Unit