Wednesday, 27 February 2019

Football Simulation Engine v2.1.0, v2.1.2 and v2.2.1

The football simulation engine node module has been available for just over a year now and has a couple of hundred downloads, and an interaction of a fair few people via GitHub. Part of that interaction has led to requests for changes to be made to the modules functions to either make the game easier to control or alter. 

Whilst making the changes other issues were thrown up such as the ball not continuing to move with the players when they were in possession, and in other cases the ball remaining in the players control after it had been kicked. The new versions - specifically version 2.2.1 - resolves these issues and provides a much better and more reliable output.

Refactoring 

The first big change was the removal of the async module. Two reasons for this were that a) it didn’t need it, b) I’ve grown a distaste for dependencies in my NodeJS programs. On top of this there were changes to allow for the latest node version to be used which included using let, const instead of var which good practice dictates and the general removal of promises which were also not necessary. 

General input from https://github.com/dashersw has been instrumental which has included improving error throwing as well as removing repetition. As such the code has been regularly reduced or made easier to understand with game examples now available.

Testing 


Part of my own journey has been to begin looking at Test Driven Development (TDD). Unfortunately, I could only apply it in this module retrospectively but will be adding test cases for all new functionality before I code it in future. 

For now, I have added testing for the three main exported functions and testing of validation of input. This is because it is where users are most likely to get stuck. My new goal is also to raise tests around whatever issues come through. One example is https://github.com/GallagherAiden/footballSimulationEngine/issues/33 where tests were added to validate the “ClosestPlayer” functions.

Adding tests has improved the game, because it has caught a number of interesting ‘perks’ of the code written where tests that should have passed actually failed. Which is good, as it shows TDD in action. 

Finally, part of the testing now includes End to End testing through Match Simulation of varying team ratings which shows expected results for teams of different skills.

New Functionality


After a review of the games being played there were a few obvious changes that could be made. Allowing more tackleswas one such whereby players rarely were able to take the ball off each other before, this has now changed and with it comes an improved risk of players committing fouls. 

The greatest new functionality was to stop the ball moving instantaneously, instead the ball moves over a period of iterations. This includes an x, y and z movement which factors in the height of the ball against the height of another player. This has allowed even greater play by introducing interception of the ball as it moves

Another big new function to the simulation was in the calculation of offside and the beginnings of some simple player marking. Other improvements have been possible with the ball movement change which includes; direction of player movementso players attack in the right direction, and better passing to stop players constantly passing to the keeper.

Finally, the way shots were taken, calculated and checked for so that own goals are awarded to the correct teams and shots occur over time. This has also led to an improvement of the ability for keepers to save shots as the ball enters their area.

Finally, a player fitness parameter has been added however this has no impact on the game currently and is merely additional information for people using the simulation engine as a manger game. This also includes an action parameter for each player which allows the move performed by each player determined by the simulator to be overridden.

Fixes


There have been a number of little fixes such as elimination of incorrect reporting of player possession of the ball. Changes have been made so that the closest player to ball or a position now gives a more accurate output.

Players now move with the ball at their feetwhich was quite a major bug in previous versions.



The changes made have had a massive impact on game play which you can see on the video I created for the latest version.



There are other changes coming in version 3 which looks to make the iteration json read better and make it more accessible. Other possibilities will be the removal of players from game play e.g. by red or yellow cards and the ability for team rating and other skills and fitness to have a greater impact on individual player performance.

I would love to receive feedback and requests for improvement which can be added here: https://github.com/GallagherAiden/footballSimulationEngine/issues
Alternatively you can email me here.

Happy footballing and thank you for downloading and using the module. 

Wednesday, 20 February 2019

A brief history of Banks, Payments and Technology

During a recent frenzy of reading on banking systems, payment types, technology and trade I began to note down what I was learning in the hope of sharing that information with others without the need to jump between lots of different sources. Hopefully it is of some use to someone.

Firsts in trade and banking


Around 10,000 years ago, early human beings began to swap hunter gatherer lifestyles for crop planting and animal husbandry. In the process, a specialisation took place whereby communities began to become very good at certain skill sets; wood cutters, fishers, farmers, miners, hunters and gatherers produced specific goods. Each good had its own demand, and so it became sensible to swap one set of goods for another [1].
Early trading would have been the swapping of the physical goods, whether necessity or luxury items. Historians believe one of the first long distance trades to have been conducted could have been as early as 3000BC with goods from Mesopotamia arriving in the Indus Valley in Pakistan and corresponding traded items being delivered in return [2].
With the extended usage of metal in daily lives, its value for trade in both its raw and final form led to its demand in trade encounters. The Greeks, for example, had no early raw metal access and so traded art, food and services with the Kingdom of Lydia for electrum (a natural alloy of silver and gold) coins. It was this supply of coinage that is believed to have led to widely adopted usage of coins across the ancient world and with this circulation came the need for people who were able to swap sets of coins and able to receive money for safe keeping from proprietors and traders and other banking like functions [3]. 
Bankers in ancient Greece and Rome lent money from temples and exchanged coins from different cities both within and from outside the empire. Investments could be made as capital for loans, which would incur interest at rates of over 6% which could be paid using exchange bills without the need for coins. In Ancient Egypt, the Ptolemaic king’s revenue was collected by an intricate banking system before being paid out as paper transactions [4].
Later, in the time of the independent Italian states bankers - known as Lombard’s within the Banking system of Venice - became the first notorious `bank`, which performed its role for the needs of its government. With each governmental war came a need for cash income whereby the populace was forced to pay into the loan system with cash stored in a chamber of loans. 
Whilst the Venetian chamber ceased with the independent state, the Bank of Amsterdam followed a similar set of practices before the Bank of England - chartered in 1694 - became the first of the modern banks, built also upon the principle of capital for loans of which bank notes were given [5].
Banking systems continued to be adopted until it had gained global usage as a means for storing capital, generating interest, producing loans or receiving capital from others such as wages or rent. Payment methods have traditionally been favoured in cash either through coins or bank notes, although cheque payments - a written order for a payment makers bank to transfer funds to a third party - has been used since the 17th century with the earliest surviving Bank of England cheque written in 1659 [6].
The use of cards for payments has had a long history, in the UK, a financial credit company called Provident began to provide clothing and supply vouchers in 1880 as credit for working-class families who could make repayments on the loan over time [7]. This was followed in 1914 by metal cards known as ‘metal’ which allowed deferred payment for card holders [8] which continued to evolve over the next hundred years to provide wider card access to all markets in both credit and debit form. 

Modern Times

The goal in modern times is still about making trades of one good for another, with work services traded for money - now almost exclusively into a bank account - and then credit in the bank traded for other goods and services. The difference is that now the banking industry, consumers and merchants are pushing for faster, easier, more secure and more reliable payments.
In order to achieve this the banking industry has looked to build technological systems that facilitate growth, make it easier to spend and save money whilst improving payment security to prevent fraud whilst keeping customer engagement through the sentiment analysis.
In the 1920’s, accounting machines, punch cards and typewriters were utilised to improve processing time in repeatable processes whilst simultaneously reducing the cost of employment and accounting errors [9].
Task automation and further operation streamlining continued throughout the 1930’s, 1940’s and into the early 1950’s with cooperation between US and European technology companies during in the WW2 era allowing greater sharing of ideas and innovation with trips across the Atlantic galvanising large banks to adopt ever more sophisticated techniques such as standardisation of documentation across the industry [10].
Centralisation of ‘service factories’ to process even the most trivial of items like coupons gave the banks an infrastructure to cope with the rising middle classes who were most likely to use banking services. Problems emerged from the mid-30s as the weight of the work being performed meant the longevity of the machines were less than expected causing machines to need constant repairs or replacement.
In the UK, Barclays - the biggest UK bank of the time - were looking to demonstrate their ability to innovate with foresight. A new ‘computer centre’ was created in Drummond Street, London to demonstrate their computing prowess, significantly, the Emidec 1100 machine which was ordered for delivery in 1961 [11].
In the branches the Burroughs TC500 were also introduced as systems that allowed customer information to be fed into the main computer system from the branch. It took some time to complete the switch, but it is thought most banks has fully moved to the computer-based systems by early 1970s.
One inspiration for Barclays was a partnership between the Bank of America and the Stanford Research Institute which led to the creation of the Electronic Recording Machine - Accounting (EMRA) in 1955 where the level of involvement the bank had in the design of the computer made it facilitate business needs over scientific needs [12].
Further innovation continued for Barclays after British inventor John Shepherd-Barron proposed an automated teller machine (ATM) to the then Chief General Manager in 1965. The idea - stemming from the inventor arriving one minute after the bank shut - was for a cash dispensing machine that would work similarly to a chocolate dispenser. Barclays liked the concept and installed the first ATM at their Enfield branch in North London on 27th June 1967 [13], [14].
At the same time that the ATM was being designed, Barclays also conceived of the Barclaycard in 1965 through Derek Wilde and James Dale who were managers at the firm. In the UK, the idea of the plastic card for issuing credit was a relatively novel even though the practice of the issuing of credit had been occurring for some time, with some local shops allowing purchases ‘on tick’ - meaning to be delayed until payday [15].
The ability to withdraw cash, anywhere and anytime continued to propel the public view that their cash should be available and spendable anywhere and anytime and with the credit card this was now possible, but the endeavour had no infrastructure, no user base and would take until 1972 before profit could be made. Over the Atlantic the Bank of Delaware issued the first debit card in 1966 for regional use, simply requiring a card and signature - the same as with the credit card. 
Whilst credit cards extend loans to the card holder to be repaid at some set later date, a debit card is the spending of money held by the account holder in their account. In the UK, it took until 1987 for the first debit card to be released, once again the front runners were Barclays through the Visa Delta Card [16].
There were still problems for UK payment makers despite frequent substantial change to the way banks were doing business. For example, each week or month, payments would be made to employees through envelopes of cash, and payment of bills such as rent, gas, electric and paper subscriptions were paid face to face and usually behind a queue of other payers.
To help solve this problem and alleviate the need to pay either face to face or specifically with physical money handed from one person to the next, the Bankers Automated Clearing Services (BACS) was introduced helping to reduce processing time of transaction from weeks and sometimes months.
When Dennis Gladwell’s idea was implemented in 1968, the introduction of Electronic Fund Transfer (EFT) between banks meant payments could be handled via computers, eliminating the need for repetitive writing of transfer notes between banks and thus making the movement of money simpler and quicker [17]. 
Whilst the changes being made were allowing more cash to flow in the rising middle class, and that savings had been made with greater efficiency, the 1970s emerged with just as many new challenges as there had been before. The first was the sheer number of customers now using different card types which were manually initiated and entered into the system - a process that was prone to error and slow to complete.
The solution would end up being a method for quickly relaying the information of a card holder using information stored on the card itself, which would be easily accessible without too much human intervention.
In the early 1960s, IBM Engineer Forrest Parry had seen the benefit of attaching magnetic media to a card such as in high security buildings like CIA offices to track personnel information through the magnetic stripe. Forrest would explain that his wife had suggested ironing the magnetic stripe to the card and with that a technology that would serve billions of dollars and billions of transactions entered the technology world. 
Initially the system was used by transit systems on the London Underground and California’s Bay Area Rapid Transit to match travellers with their tickets, but with further standardisation - helped in part by IBM who did not patent the technology - banks had begun to use the technology, heralding an era of greater technical prominence within the banking system [18].
From the retailer’s perspective, cash registers - in order to count and audit payments - had been in existence since 1879 when Ohio based James Ritty and his brother wanted to limit the ability of employees to steal money when handling saloon payments. Over time, the cash register adopted the LCD screen, magnetic stripe technology and wider computer integration throughout the 1970’s. 
By adapting and adopting each new technology, the cash register transformed into point-of-sale (POS) systems or at least POS compatible systems, which were primed for future use as a method for card holders’ payments to be pushed through to bank backend systems and back to the retailer for confirmation of payment [19].
Whilst retailers and banks had improved technologically, so too had telephonics. Home telephone lines had become more popular and obtainable by the early 1980s, simpler to setup, use and cheaper to have in the home. This brought with it a new way that people could conduct their affairs, more importantly, without leaving the home.
In the early 1980’s a partnership between the East Midlands bank The Nottingham Building Society, Bank of Scotland and British Telecom (BT) allowed home service users to connect a bank terminal to their home network or use their personal home computer through the telephone line and television, which enabled bank customers to transfer money, pay bills and arrange loans [20].
Gradual improvements both in quantity of people who owned home computers, the quality of network connectivity and the number of services that could be performed made online banking the convenient way to bank and thus its number of users progressed to a point where bank face to face stores are seeing a shake up in the way they operate and in some cases closing all together.
As access to cash became easier for customers, so too did it become easier for fraudsters who, by 2004, were costing banks £129.7 million in fraudulent activity. To tackle this the UK made a communal switch to chip & PIN on February 14, 2006 following a similar move in France in 1993 [21].
 Chip & PIN (Personal Identification Number) was not exactly new, with Scottish inventor James Goodfellow patenting the mechanism in 1966 it was already a necessary part of ATM transactions. The concept was simple, a chip was inserted into the card instead of a magnetic stripe and required a four-digit pin in order to access the cards services at the computer terminal.
The system was seen as an improvement on signature-based verification which was easy to forge, leading to a greater prevalence of card cloning and a surge in incidents of driving heavy vehicles through walls which hold ATM’s (ram raids) in the late 2010’s [22]. 
To make modern purchasing quicker and easier, a new method was introduced in 2007 through a partnership by Barclays and the Transport for London in order to offer contactless methods of payments for commuters and purchases across any participating retailers. The service would gain in popularity and by 2017 contactless payments accounted for 30% of all UK transactions [23].
By inserting Radio Frequency Identification capabilities into a card, card readers are able to get customer card data through radio signals, with the primary allowance being for purchases of £10 or under, with occasional verification required by the card holder completing a Chip & PIN transaction to keep security integrity [24].
At the same time as companies were pushing to get online, mobile phones technology was improving, with the adoption of internet connectivity into mobile devices in 1996. From here on out, card users could access internet banking services through their mobile, making transactions possible anywhere with internet connectivity.
Of the types of mobile phone payments, the simplest takes place through a regular browser which may or may not have been adapted for the mobile phone’s usage. Shoppers add items to an online ‘basket’ before making payments by entering their card details on an online web form. The webpage then makes a request of the banks system to initiate a transaction which the user confirms. 
Traditional banking and moving of money were to be challenged throughout this period, giving a real driver for existing financial services. In 1999, a company called PayPal was created that allowed individuals to send money to each other through their mobile phones. By using the mobile as a ‘wallet’, users didn’t need their physical wallet, money or cards on their person and could instead pay merchants and, more importantly, each other directly from their phone.
Increasingly more prevalent is the use of mobile applications to complete transactions for specific companies, where traditional cards details are held in the ‘wallet’. This is also true for the device as a whole, where a ‘wallet’ can hold the users bank details and the phone can be used to make payments using Bluetooth or WIFI technology against the card reading device held by the retailer.
Mobile Applications have also allowed banks to shift away from the terminal/home computer-based telephone line internet banking. Instead the method for accessing bank details, making payments and completing other bank services is now available through Bank provided mobile phone applications. The first of which was made available by the Royal Bank of Scotland in May 2011 [25]. 
Digital wallets continue to gain in popularity, with Apple Pay providing the service on Apple Products such as the iPhone and even the Apple Watch as recently as December 2014. The added benefit being that now mobile phones can use greater security feature such as two factor authentications where a secondary authentication method was required, such as face ID, touch ID or a form of passcode.
Whilst bank users, transactions and cash spending has continued to grow over the decades of technological advancements, there has also been an increase in the amount of scrutiny placed on existing banking systems. New online innovation has allowed financial services to emerge to help handle a user’s money effectively or without charges applied by regular banks. 
One example is the smartphone-based bank service Monzo. Whereas before, bank customer would be required to pay a fee to access their money abroad, using modern technology the company were able to offer the service for free.

The Future of Banking

Through government regulation the competitiveness of the major banks has continued to be questioned. In the EU, regulations meant that APIs needed to become available to allow third parties to perform banking functions for bank customers. This dramatic shift mandated in the UK from 2018 meant that customers would be able to access all their different bank accounts data from a single access point such as a mobile application [26].
Whilst this approach is looking to address competitiveness in the market, the financial crash of 2007 has continued to cause a reduction in the number of smaller independent banks available for customers to switch to, with over half of independent banks in the US disappearing over the last 50 years [27].
In this case, if the number of banks is decreasing and the volume of transactions increasing it is easy to see why bank competitiveness is being questioned and why regulations like the Payment Service Directive (PSD2) which envisions easy switching of account types, mortgages and saving funds from a third party is seen as a massive benefit to banking customers. 
What is becoming increasingly obvious is that banks and technology companies do not and perhaps have never been too different. The innovation technology can bring has a dramatic advantage on the banking system through ease of making payments or receiving payment for services or goods. 

The Crystal Ball

Whilst researching I had a couple of thoughts on how the way we handle and deal with money, banks and payments might changes. Below are a few of the thoughts I had, please feel free to comment with your own ideas for the future or harangue me for my own stupid ones...

In the next few years, it seems unlikely that anything but a face scan, voice identification or fingerprint will be required to do our shopping, even less so will there be a need to enter card details into your own device. 

Money management will soon move away from individuals with mortgages, savings accounts and investment all handled by an application which finds and switches to the best deals to get the best monetary return for the end user.

It's also possible that payments for rent, water, gas and electric could be further abtracted away so that the money never truly enters the account holders account, but instead is deposited directly to the end target.

----------------------------------------------------------------------------------------------------

References:

  1. Lannoye, V. (2015). The History of Money for Understanding Economics. 2nd ed. CreateSpace Independent Publishing Platform.
  2. Ahmed, M. (2014). Ancient Pakistan - an Archaeological History. 1st ed. Amazon.
  3. Seaford, R. (2004). Money and the Early Greek Mind. 1st ed. Cambridge: Cambridge University Press.
  4. Adkins, L. and Adkins, R. (1998). Handbook to Life in Ancient Rome. OUP USA.
  5. Hildreth, R. (1840). Banks, Banking, and Paper Currencies. Whipple & Damrell.
  6. Flinders, K. (2009). Cheque is 350 years old today, lingering death expected. [online] ComputerWeekly.com. Available at: https://www.computerweekly.com/news/2240088409/Cheque-is-350-years-old-today-lingering-death-expected [Accessed 20 Feb. 2019].
  7. Provident Careers Site. (2018). About Provident - Provident Careers Site. [online] Available at: https://providentcareers.co.uk/about-provident/ [Accessed 20 Feb. 2019].
  8. Parker, D. (2015). A Brief History of Payments. [PDF] Available at: https://www.polymathconsulting.com/Cache/Downloads/A-Brief-History-of-Payments-from-Polymath-Consulting.pdf [Accessed 20 Feb. 2019].
  9. Archives & Histoire BNP Paribas. (2019). Chronology | Archives & Histoire BNP Paribas. [online] Available at: https://history.bnpparibas/chronology/ [Accessed 20 Feb. 2019].
  10. Bonin, H. (2004). The development of accounting machines in French banks from the 1920s to the 1960s. Accounting, Business & Financial History, [online] 14(3). Available at: http://boninhub.free.fr/files/documents/machines%20%E9lectrocomptables%20I%20anglaisRABF100108.pdf [Accessed 20 Feb. 2019].
  11. Emidec.org.uk. (n.d.). EMIDEC 1100 computer. [online] Available at: http://www.emidec.org.uk/emihme.htm [Accessed 20 Feb. 2019].
  12. About Bank of America. (2019). Bank of America revolutionizes banking industry from Bank of America. [online] Available at: https://about.bankofamerica.com/en-us/our-story/bank-of-america-revolutionizes-industry.html [Accessed 20 Feb. 2019].
  13. Telegraph (2017). The story behind the world's first cashpoint. [online] Available at: https://www.telegraph.co.uk/personal-banking/current-accounts/story-behind-worlds-first-cashpoint/ [Accessed 20 Feb. 2019].
  14. BBC (2007). The man who invented the cash machine. [online] Available at: http://news.bbc.co.uk/1/hi/business/6230194.stm [Accessed 20 Feb. 2019].
  15. RONSON, J. (2016). Barclaycard: 50 years of plastic money – the story from the Archives – Archives Hub Blog. [online] Blog.archiveshub.jisc.ac.uk. Available at: https://blog.archiveshub.jisc.ac.uk/2016/05/31/barclaycard-50-years-of-plastic-money-the-story-from-the-archives/ [Accessed 20 Feb. 2019].
  16. WOJCIECHOWSKA, I. (2017). How debit cards stack up. [online] Fin. Available at: https://fin.plaid.com/articles/how-debit-cards-stack-up [Accessed 20 Feb. 2019].
  17. G, A. (2016). Honey, who moved my money? A Brief History of Direct Debit. [online] Elementary. Available at: https://www.chargebee.com/elementary/what-is-direct-debit/ [Accessed 20 Feb. 2019].
  18. Ibm.com. (2019). IBM100 - Magnetic Stripe Technology. [online] Available at: https://www.ibm.com/ibm/history/ibm100/us/en/icons/magnetic/ [Accessed 20 Feb. 2019].
  19. Merchantproexpress.com. (2017). A Brief History of POS Systems. [online] Available at: https://www.merchantproexpress.com/news/a-brief-history-of-pos-systems [Accessed 20 Feb. 2019].
  20. FEDER, B. (2019). BRITISH MOVE FAST IN HOME BANKING. NY Times. [online] Available at: https://www.nytimes.com/1984/01/02/business/british-move-fast-in-home-banking.html [Accessed 20 Feb. 2019].
  21. 10 Years of Chip & PIN: 2006 to 2016. (2019). [PDF] www.theukcardsassociation.org.uk. Available at: http://www.theukcardsassociation.org.uk/wm_documents/10%20Years%20of%20Chip%20%20PIN%20report%20%282%29.pdf [Accessed 20 Feb. 2019].
  22. Staffordshire Live (2019). Shocking figures reveal high number of ram raids devastating shopkeepers. [online] Available at: https://www.staffordshire-live.co.uk/news/local-news/shocking-figures-reveal-high-number-753815 [Accessed 20 Feb. 2019].
  23. Card Expenditure Statistics. (2017). [PDF] www.theukcardsassociation.org.uk. Available at: http://www.theukcardsassociation.org.uk/wm_documents/Card%20Expenditure%20Report%20-%20April%202017.pdf [Accessed 20 Feb. 2019].
  24. newsroom.barclays.com. (2007). Barclaycard OnePulse leads the way to a futuristic London with unique three-in-one credit card. [online] Available at: https://newsroom.barclays.com/r/1225/barclaycard_onepulse_leads_the_way_to_a_futuristic_london [Accessed 20 Feb. 2019].
  25. Rbs.com. (2019). Banking app, 2011. [online] Available at: https://www.rbs.com/heritage/rbs-history-in-100-objects/history-in-100-themes/going-the-extra-mile/banking-app-2011.html [Accessed 20 Feb. 2019].
  26. PwC. (2019). PSD2 – a game changing regulation. [online] Available at: https://www.pwc.co.uk/industries/banking-capital-markets/insights/psd2-a-game-changing-regulation.html [Accessed 20 Feb. 2019].
  27. McCord, R., Simpson Prescott, E. and Sablik, T. (2015). Explaining the Decline in the Number of Banks since the Great Recession. [ebook] FEDERAL RESERVE BANK OF RICHMOND. Available at: https://www.richmondfed.org/~/media/richmondfedorg/publications/research/economic_brief/2015/pdf/eb_15-03.pdf [Accessed 20 Feb. 2019].



Friday, 4 January 2019

A Year In Books - 2018


At the end of 2017, I set myself a couple of ambitious goals for 2018. One of which was to read 20 books by the end of the year. As of the 26th December 2018 I had read 25 books - just over two per month. In this post I'll give my overall rating and a little description as to why.

Books in reading order left -> right
NOTE: War & Peace looks like a single book but I split the three volumes into different reading chunks.


  1. David Mitchell - Bone Clock (2014) [8.8/10]

  2. As the first book of the year, I was surprised by just how good it actually was. It had the feel of the mythical; about cults, magical powers, other beings etc. which is not always my cup of tea. But it was so well written, it really drew me in and I could hardly put it down.

    It follows several stories which combine from almost mini stories as part of a wider plot - which although it might seem difficult to follow, was actually an incredibly easy read.

  3. Andy Weir - The Martian (2011) [8.4/10]

  4. Having watched the film of the same name, I couldn't help but hear Matt Damons voice and see his face - similar to many younger Harry Potter readers who can never unsee Hermione, Harry and Ron.

    The book is extremely funny, believable from a scientific view - for this lamen at least - but was also pretty tense throughout. Once I started reading, I finished the book in just a couple of sittings over two nights.

  5. Homer - The Odyssey (1200 - 800BC) [5/10]

  6. I'd wanted to read Homer for a while and had previously read the Illiad. Both epics were written in similar styles, with the familiar "Aiden who was son of Patrick who was son of Harold who was son of..." littered throughout. The odyssey was a much easier read than the illiad but was still not easily digestible.

    The epic follows Odysseus on his 10 year journey home from Troy where he falls upon all forms of mishaps and woe. It also follows his wife Penelope and son Telemachus who have to fight off suitors. The intention is for the epic to be orated, but I'm not sure I would have got away with muttering away to myself for several weeks.

  7. Bernard Cornwell - Lords of the North (2006) [9/10]

  8. Following the story of Uthred (son of Uthred) - this third in the series novel - was as compelling a read as the two before had been. It was easy to read, engaging and makes you feel like you were in ancient England in person.

  9. Douglas Hulick - Among Thieves: A tale of the kin (2011) [7.7/10]

  10. An organised crime spy in a fantasy world where magic is forbidden must piece together clues from a series of events to save the criminal world he inhabits. Whilst the first few paragraphs come across as very 'samey' for the genre it picked up pace and the story really started to pull you in - so much so that I order the next in the series as soon as I had finished reading.

  11. Nick Srnicek and Alex Williams - Inventing the Future: Postcapitalism and a World Without Work (2015) [6.5/10]

  12. The book began well by examining the history of the left, how it had failed and what the left needs to do in the future to bring around the general populace to left policies by emulating neoliberal strategies.

    The next few chapters look at how shifting work availability, greater automation and a non-working class of people who cannot or will not be suitably employed is raising problems for the left, standards of life as well as - to a degree - business.

    The four points raised are; fully automate, reduction of the working week, a universal income and the diminishment of the work ethic. As a 'left' leaning person the reduction of the working week seems reasonable and should be encouraged. However the premise of the book leans heavily on the automation aspect which suggests that automation means less work.

    In my opinion this doesn't hold true. Historically the industrial revolution, introduction of irrigation, computing, machine processing and many other concepts should have eliminated work, but instead society and the world adapted, generating a need for different jobs. The book was generally good, but the urgency placed around the falling job numbers and the need for the four solution didn't quite ring true.

  13. Douglas Hulick - Sworn In Steel: A Tale of the Kin (2014) [7.6/10]

  14. Following from the original adventures of Drothe. Drothe must now use his new position to solve different intrigues. As in the first book the fight scenes seem realistic, the book is a nice easy read and the plot keeps you guessing. I would have purchased the next in the series but as of yet there is none.

  15. John Stack - Ship of Rome (2009) [7.8/10]

  16. As a Rome enthusiast this book gave a new perspective of the Romans which was exciting and enthralling. Focusing around the early Roman need for ships against the Carthaginians and their journey to becoming moderately good shipwrights made for a novel approach to typical roman adventures whilst keeping a similar style to what you might read by Simon Scarrow.

    What helped put the book into perspective was that I was also listening to History of Rome podcasts by Mike Duncan and his fantastic description of the Punic Wars.

  17. Margaret Atwood - The Handmaid’s Tale (1985) - [8/10]

  18. Dystopian tales are my jam, and this one left the right amount of intrigue and historical background to what led to the 'new world' to really leave me satisfied. What I really enjoyed was seeing the transition into the new totalitarian state from the eyes of Offred.

    Although the cliffhanger leaves a lot to be desired, I was beginning to struggle to see where else the story could really have gone to. It didn't exactly make me want to watch the tv series. That being said it did teach a very important piece of advice "Nolite te bastardes carbatorum".
     
  19. Agatha Christie - Murder On The Orient Express (1934) [8.2/10]

  20. Having watched the film first, the book was never going to surprise me in the same way. However, the ending is fantastic and the book is so magnificently written that it surpasses its age. It doesn't seem to be written in over 70 years before like you might find with a C.S Lewis or Enid Blyton novel. Fantastic read, great ending, brilliantly written.

  21. Bernard Cornwell - Harlequin (2000) [8.3/10]

  22. I originally read this book as a young boy, and it kick started my childhood joy for building bows and arrows from pieces of cane. The adventure is exciting, the historical context and placement - as with all Bernard Cornwell books - makes you feel like you are there in person. A great book, well written.

  23. Ben Elton - The First Casualty (2005) [7/10]

  24. Whilst the flow is a little off at times and can be a little difficult to get into at the beginning, the story really transports you as a reader into the horror and misery that was the trenches. The Inspector Kingsley is somewhat annoying which appears to be intentional, whilst vitriol toward the pointlessness of the war is much easier in hindsight the book is a good read with lots of intrigue.

  25. David Moody - Hater (2009) [7.4/10]

  26. Hater was a reread from my first year in uni, and it was good as I remember it to have been. The book focuses on a 'hatred' that appears in many people, often displayed through the eyes of the 'haters' themselves. As escalating violence erupts across the nation, panic ensues and Danny must protect his family from the haters. Genuinely good book which was a lot different to other horror stories I've read.

  27. David Moody - Dog Blood (2010) [7.1/10]

  28. Having just finished Hater, I had already pre-purchased the next in the series as I was enjoying the first so much. The second follows Danny as he navigates around a much different world. I don't want to give away spoilers to the first book. But this one only dipped slightly, the writing was as good as the first but obviously there was less intrigue in the second.

  29. Ross Leckie - Hannibal (2008) [7.7/10]

  30. Following the podcast for the History of Rome about the Hannibal era I saw this book and couldn't not buy it. It was a great read and dramatisation of the life of Hannibal that was not too dissimilar to the history in the podcast. It follows Hannibal's life right through to his death showing the pride, loyalty and commitment he had for Carthage but also the intense hatred he held for Rome and all Romans.

  31. David Moody - Them Or Us (2011) [6.8/10]

  32. By 'Them or Us" the pace and intrigue had really been impacted in the series so I couldn't quite enjoy the third book as much as I could "Hater" or "Dog Blood". Had it been written as a stand alone I'm sure it would have rated better - I really enjoyed the first in the 'Autumn' series for example which has a similar feel.

    The story fantastically displayed how the human race at the end of its life might be torn apart by infighting, bullies and tyranny. The writing is fantastic and the scene setting is perfect. My downside would be the bleak outlook on the end of days but that's because I'm all about sunshine and butterflies.

  33. Anna Sewell - Black Beauty (1986) [7.9/10]

  34. The life of the horse 'Black Beauty' shows the different ways that horses live amongst humans. How they are loved, ignored, used for their beauty or as a symbol of wealth, mistreated through ignorance and malice and the relationships they might build with each other. Anna Sewell shows the greatest of empathy and understanding of horses and their lives, making this a beautiful read.

  35. Ted Chiang - Arrival (2002) [6.8/10]

  36. If you have watched the film Arrival, the book is a collection of short stories of which one happens to be the 'Arrival' from the film. Ted Chiang is an interesting writer with a world of imagination that he conjures on the pages. Unfortunately, this makes it hard to follow at times.

  37. Bernward Cornwell - Vagabond (2002) [7.8/10]

  38. The theme of the year has been that the second book to a series is never quite as good as the first. Maybe that's just me and the books I've read this year? Vagabond was a continuation of my boyhood dream to be an archer fighting for England, hunting deer and beating the French, great read.

  39. Leo Tolstoy - War and Peace Vol. 1 (1869) [7.1/10]

  40. I watched the TV series on the BBC before reading the book which made comprehension of what was going on much much easier, as I could put faces to names and scan over the names much easier. The book is somewhat hard to read, being written in the style of the time which for some reason begins with a long preamble around history, a city or the writers opinion on a subject before moving onto the story itself (This happens in Les Miserables too).

    I really enjoyed the intrigue of the life of the gentry shown in the book and its very easy to become attached to the characters and want them to succeed, hate their enemies and feel like you are resting in a Russian townhouse or joining in a great hunt.

  41. Leo Tolstoy - War and Peace Vol. 2 (1869) [6.5/10]

  42. The second book slows considerably and I'm not entirely sure why I struggled so much more with the centre piece. The war progresses throughout volume two and the circumstances the characters find themselves in seems much of their own making which is frustrating - a sure sign that the author has done a good job at evoking feelings in the reader.

  43. Leo Tolstoy - War and Peace Vol. 3 (1869) [7.2/10]

  44. Tolstoy describes in this part how the ebbs and flow of war were not directly contrived by important figures of the day. There is an obvious adoration for Kutuzov who he obviously sees as a wise, sickly man who was able to see the bigger picture in everything he does against the brash arrogance of Napoleon.

    Having never been a fan of the slow, almost idiotic fighting of the era (standing in squares with slow reloading guns) this is the first time the Napoleonic Wars have ever interested me. Tolstoy is a magnificent story teller who obviously studies and gave great consideration to the invasion of Russia.

  45. Stephen King - The Green Mile (1998) [7.8/10]

  46. As with all books by Stephen King the story was mysterious and believable in equal measure. It was well written with intrigue throughout.

  47. Tom Beaumont James - Winchester (1998) [6.2/10]

  48. This book describes Winchester through time in cold hard facts. It describes architecture, burials, population - size and origin - throughout Winchesters existence in a factual and informative way.
    It might have benefited from a couple of folk stories from the area, such as perceived notions of King Alfred time in the city - even if described as unfounded with no evidence. The reality is somewhat disheartening and loses Winchester some of its magic.

  49. Iain Gale - Four Days In June (2006) [8.9/10]

  50. This novel was one of the best I have read all year. I couldn't recommend it highly enough. It describes the rolling, unimaginably complex formation and distribution of Napoleonic armies perfectly to present the difficulties and intricacies the wars of the times held.

    The story telling was brilliant and well described. There was obvious bias towards Wellington over Napoleon which tried to show the fall from grace the French commanders and leaders had felt. Obviously well researched, it was a fantastic entry point into the world of Napoleon and Wellington.




Sunday, 4 November 2018

Comparing Exercises by converting to 'Steps'

Recently at work, a selection of my colleagues and I were involved in the Virgin Pulse Global Challenge. It was a great challenge that increased my daily steps from around 10,000 steps to 15,000 steps. There were great improvements to my life generally in terms of eating, moving and understanding the affect of my habits on my body.

Part of the challenge was the ability to share steps with others through a leaderboard. This was fun, but quickly it became apparent that there was a massive gap between different exercises. Cycling was the most efficient exercise yielding the greatest number of steps, swimming and weight lifting gave a medium yield of steps for effort but running and walking gave only the face value.

The problem comes from a series of complex methodologies for trying to discern how many 'steps' to give for time spent performing an Activity. A study looked to determine a ratio of working metabolic rates against resting metabolic rate using metabolic equivalents (MET). Different activities have individual MET units which "range from 0.9 (sleeping) to 18 METs (running at 10.9mph)". https://partner.ergotron.com/portals/0/literature/compendium-of-physical-activities.pdf

By using the MET system it is possible to covert average steps for a host of activities, which is what has been done by the Global Challenge. One example can be seen here: http://www.uvm.edu/hrs/healthy/archive/steps.html or on the Global Challenge itself: https://globalchallenge.zendesk.com/hc/en-gb/articles/360000440186

In terms of the challenge it meant that cyclists were constantly doing much better than a runner doing the same hours of exercise because of the conversion. e.g. 1 Hour of high intensity activity.
   Cycling: 343 (per minute) * 60 = 20508
   Running: 180 (per minute) * 60 = 10800
From a competitive perspective this makes it very difficult to compare effort put in to an arbitrary 'steps' conversion amongst say runners, swimmers and cyclists.

I began to think and discuss a way in which a more fair representation could be found to show 'steps' based on effort for the activity itself. This might not be represented in steps but instead as exertions or intensity levels.

Whilst looking to find existing step converters for Node.JS project I found nothing to complete step conversions in the package repository. Instead I created a simple exercise to steps converter: https://www.npmjs.com/package/exerciseconverter which takes an exercise, an intensity and minutes performed into a promise function and returns the total number of steps. Additionally, user can provide a heart rate which determines intensity achieved.

toSteps("Boxing", 3, 10).then(function(steps){
  console.log(steps);
}).catch(function(error){
  console.error("Error: ", error);
})
//output: 3480


If you took the heart rate per minute for when an activity has been performed it is possible to get a more accurate step display. In the node module created this is exposed as an array with an exercise with a heart rate given for each minute of activity performed.

toStepsHRpm("aerobics", [120, 140, 150, 165, 180, 176, 162, 104, 101, 80]).then(function(steps){
  console.log(steps);
}).catch(function(error){
  console.error("Error: ", error);
})
//output: 1872

Currently this could be used to integrate fitness application data of heart rates to get more accurate step metrics for a wide range of activities performed day to day. What this doesn't help with is the ability to create a method for determining effort used to perform a task. In the 'Cycling' and 'Running' example shown earlier the runner would need to run at the pace of Mo Farah to achieve the cadence required without taking into consideration the stride length.

At the end of the hour, the runner would be seriously struggling to continue at the same pace whilst a cyclist could continue at the same rate for much longer periods of time. The exercises are not entirely equal as cycling is better for your knees, joints and causes less muscle soreness, in retrospect running or even walking long distances can have quicker burnout especially at higher intensities.

I would like to expand the exercise converter to include a method for comparing effort against the activity to allow for people exercising to compare their days and weeks of exercise in a fairer way whilst acknowledging the differences of the exercise activities. This might be as simple as an exercise heart rate leaderboard or a fat burn/calories comparison.

Have a thought on how this could be done? Know an existing system that already does this? Think its impossible or unachievable? Let me know in the comments, or post an improvement of the github page for the exercise converter itself. 

Friday, 15 June 2018

Making a Walking Stick

Louise and I went for a little walk around Hinton Ampner, and whilst on our travels we saw a little stick on the floor. We took it to Devon, through the New Forest and all the way up to Jedburgh. It only seemed right to look after it, spruce it up (see what I did there) and make it look good.
Louise when we found the stick
In Devon, I removed the moss, the twigs and began smoothing it down by filing and sanding it down. Some of the harder or bigger knots I had to cut out with a whittling knife but nothing is better than whittle wood in the sun.
Whittled, Filed and Sanded Down
Next I gave it a little varnish with a clear satin wood varnish. Though apparently, https://www.youtube.com/watch?v=FzlAEtQBd5M this chappy says I should have used an oil with a wool cloth for spreading.

Varnishing

Three coats later and we now have a walking stick. I wrapped some string around the top to make it a bit nicer to walk with and now here we have it.

A bit sad, but it looks nice and I'm proud of it.

Wednesday, 13 June 2018

Russia World Cup 2018 Simulator

With the World Cup upon us, this year being hosted in Russia I decided to take the hard work I did in making a football simulation engine: available here and discussed in this blog and put it to good use in a real life scenario.

What better way to test the module and see if it is anywhere near accurate then to simulate each result in the 2018 World Cup. At the same time I've been ironing out some issues and we are - at the time of writing - onto version 2.0.1 and the modules working a charm.

I have decided to host the nodeJS application on IBM Cloud, which gives 255MB free nodeJS deployment especially for this type of development work. Whilst it wouldn't be enough to handle Sky Sports Super 6 traffic, it should be enough for the numbers I'm expecting over the World Cup.

Bored of me talking, go try the simulator for yourself:
                   https://worldcup2018simulator.eu-gb.mybluemix.net/home.html (no longer available)

First pick your two teams (I've gone for Tunisia vs England) and click select teams.
Hint: If you don't pick any teams or only pick one, just click "select teams" and it'll randomly pick two teams. 
Select your team
This dynamically generates 11 selection boxes with each countries squad displayed in each box, ready to pick your team. You will also need to select your formation or it won't work!
pick your players
Not sure who to pick? Just click random select and it will pick a formation. This will fill in each position with either a Goalkeeper, a Defender, a Midfielder or a Forward depending on the formation and the players preferred position.
Hint: Not all player of a certain type will be put in their best position i.e. an RB in a CB position!

After you hit "Simulate Match" you'll see a screen with all the players selected and the positions they were put in. At which point you can either do a "Quick Match" which simulates the match with updates to the statistics or you can "Watch Match" which will give a graphical view.
Hint: Mobile Phones should be held in landscape mode
Ready to Play
Watch Match
Quick Match
Best of three has it. Tunisia will win 1 - 0.
Let's hope not
Let me know how you get on via email or comments below.

Wednesday, 9 May 2018

Integration Innovators - Part 1

**Note: Any images, text or quotes have been used to provide an overview of the people themselves. I have linked to the relevant sources in the read more, but will gladly remove any part should the subjects or original authors so wish.**

In the last 18 months I have been constantly seeking to get a better understanding of the technologies I work with every day from databases, to Ethernet, to the first compilers, message queues and the underlying network they run on. The list is never ending and what started as a few pages of notes has turned into maybe 30.

What has begun to interest me more and more are the people who brought about these changes, the work they have completed across their lives and the impact it has had on the way we live and the way we do business.

In this post I intend to describe some of the people who I have ‘discovered’ in my research in a hope that my own generation do not forget those who progressed the computing technology that can often be taken for granted. 

Here are a handful of them, in no particular order;

Abhay Bhushan

1.    Abhay Bhushan was born in Allahabad, India in November 1944 and was in the first group of students to attend the Indian Institute of Technology Kapur (IIT Kapur) which was at the time being funded by a consortium of universities including; Berkeley, Princeton and MIT. 

It was at the university that Abhay met mentors like William Schreiber and Harold Huskey who had worked on some of the first ever TVs and computers inspiring him to take up a role at MIT after his graduation to complete his master’s degree.

It was over the next 5 years 1965 - 1970 that Abhay became involved with APRA and APRANET, even attending a meeting at the pentagon for the Defence Advanced Research Project Agency (DARPA) to discuss communication security before getting involved in the Network Working Group whilst working on his MBA at MIT.

It was in one of these meetings where Abhay took the ownership of “a file transfer protocol” having been working with Steve Crocker, Jon Postel, Mike Padlipsky, Vincent Cerf and many more. The group would discuss, build, test and write Requests For Comments (RFC’s) working on a whole host of networking solutions such as TCP/IP, FTP and the email address with different members being tasked with the write up.

FTP - for which Abhay was the author - went on to be the foundation for pushing files from one system to another whether that’s sharing information across branches, uploading to your blog, or to share files securely. It has been expanded, updated and built upon but FTP remains a huge part of the computing world and Abhay is recognised here for his part in it.

Read more: https://tools.ietf.org/html/rfc114https://www.mappingthejourney.com/single-post/2017/09/15/episode-9-interview-with-abhay-bhushan-author-of-file-transfer-protocol/https://www.scmagazineuk.com/ftp-comes-of-age-as-considerations-made-on-how-practicality-is-over-riding-security/article/560138/

Grace Murray Hopper
2.    Dr Grace Murray Hopper was born in New York City December 1906, gaining a BA in Mathematics and Physics in 1928 before achieving both her MA and PhD in Mathematics at Yale University.

From a young age it was apparent that the budding mathematician had a drive to discover, taking apart the family alarm clocks at age 7 just to see how they worked. The same drive saw her through university and her PhD, despite being only 1 of 10 students on a doctoral program of which only 4 were women.

It was this drive that also led her to take a leave of absence from teaching to join the US Navy as part of their Women Accepted for Volunteer Emergency Service (WAVES) program where she graduated first in her class and gained the rank of lieutenant, aiding in the war effort by working on the Mark series of computers.

Working on and off for the rest of her life in the navy, research positions and as a consultant she filled her days with innovating, teaching and thinking outside of the box. One such innovation was her belief that computing could be further used and more widely adopted if it could be written in a human readable way.

She went on to create an operational compiler at a time when many believed that computers couldn’t - or indeed shouldn’t - communicate in English. Instead, she pushed for its use in business tasks like billing and payroll calculation. Later the FLOW-MATIC compiler she had worked on became the basis of COBOL, a language used by up to 80% of all code in existence including in the Navy whom Grace persuaded to adopt the new language.

Whilst this extremely brief summary does not skim the surface of this inspirational woman, her contribution to the world of computing has been phenomenal.

An interesting fact is that Grace Hopper was the finder of a moth in one of the early computers which was causing chaos on the system itself. This later led to the widespread use of the word ‘bug’ to mean a fault in a computer.

Read More: Grace Hopper and the invention of the Information Age (Book) http://www.amazingwomeninhistory.com/amazing-grace-hopper-computer-programmer/http://www.cs.yale.edu/homes/tap/Files/hopper-wit.html

Roy Fielding
3.    Roy Fielding was born in 1965 (same year as my mum and dad) in Laguna Beach, California and describes himself as “part Maori, Kiwi, Yank, Irish, Scottish, British, and California beach bum".

Whilst the youngest member of the five being discussed, he was accredited as one of the top 100 innovators around the world by an MIT Technical Review in 1999 for his work on Open Source projects like Apache Group - of which he is a co-founder - and his work in 1994 when he innovated the web by creating procedures to update web page storage by transmitting information only when a change had been created.

He later began work with Tim Berners-Lee as part of the WWW Consortium (W3C) helping with standardisation of WWW protocols being an active member of several working groups such as HTTP, HTML and URI.
Most notably would be his contribution to the world of web services in 2000 with his dissertation thesis for his degree as a Doctor of Philosophy in Information and Computer Science at University of California, Irvine. 

In the dissertation, Roy discussed the idea of Representative State Transfer (REST) architectural styles and how they can be used in web services specifically by using interoperable, stateless operations such as GET, PUT and POST. 

The RESTful architecture came to be used massively in SOA implementations across the computer industry, especially in integration and this Roy finds himself on my list. At still a young age and continuing his work at Adobe there is yet much more to come.


Frances Allen
4.    Frances Allen was born in Plattsburg, New York in 1932 becoming first a B.S. in 1954 and then an M.S. in mathematics from the University of Michigan in 1957. Whilst initially a teacher of mathematics she later joined IBM - our first IBMer on the list - in order to pay off her education debts but fell in love with the people in the company, so much so, that she remained there for the next 45 years.

It was Frances work in compiler optimisation that gained her the plaudits, after she read the FORTRAN programming manual and became interested in the field. She continued in this vane for the rest of her IBM career, working on some of the earlier supercomputers within the organisation such as Stretch.

Part of this optimisation was the use of her mathematics knowledge to gain computational advantages when analysing data sets. She gained many awards for the work including IBM, ACM and IEEE fellowship for her work in making the programs people loved to use, better.

In 2006, Frances was awarded the ACM Turing Award, a prize given for those who have contributed lasting and major technically important work in the computing field for her years of dedication. Additionally, she is one of the Women In Technology Internationally (WITI) hall of famers.

Read More: https://amturing.acm.org/award_winners/allen_1012327.cfmhttp://www.computerhistory.org/fellowawards/hall/frances-allen/https://www-03.ibm.com/ibm/history/witexhibit/wit_hall_allen.html

Douglas Crockford
5.    Douglas Crockford was born (according to Wikipedia, but I can’t verify) in 1955. Having graduated from San Francisco State University with a Radio and Television degree, Douglas has worked across the board as a technology guru at Atari, yahoo, lucasfilms, paramount pictures and paypal.

What Crockford is well known for his work with JavaScript and specifically the object notation called JSON which he discovered and has popularised ever since by documenting formally the notation for the JSON media type in  RFC 4627 and through a dedicated website. Additionally, he has published a book called “JavaScript: The Good Parts” which was released by O’Reilley in 2006.

What makes JSON so key is that it is a self-describing, hierarchical structured simple text which is both easy to use and more compact than its XML counterpart by around two thirds and although its name contains “JavaScript” it is actually language independent.

It is now widely used, and in some cases like Twitter, it is the only data expression exposed in APIs due to the simplicity and ease with which it is consumed. Whilst JSON will be Douglas’ lasting legacy his other work also provides much to be admired including his creation of the JSLint and JSMin software which analyses and minifies JavaScript code respectively.

Read More: https://tools.ietf.org/html/rfc4627https://www.crockford.comhttp://www.json.org/fatfree.html


I hope you enjoyed this little read and will go out and learn more about the people mentioned.

Who would go on your list of Integration Innovators? Feel free to comment and I can add them to Part ‘N’ of what I hope to be a little series over the next year.