AI and Big Data Expo

2018

I recently started on a learning program provided through work (Government Digital Service), to better understand emerging technologies, with a focus on Artificial Intelligence (AI) and Machine Learning.

For 10 weeks I am studying for 2 days a week. The learning is fairly self directed, though once a week I meet with my brilliant mentor Ivan who is a lecturer in AI and Data Science at The University of Bristol. He is also a fellow at The Alan Turing Institute which is the national institute for data science and artificial intelligence and is based in the British Library.

First things first, some terminology:

Algorithm

Think of an algorithm as a set of instructions… inputs that result in outputs… an example could be a cake recipe.

Artificial Intelligence

When a machine performs tasks that would usually require human brain power to accomplish.

Data Science

Turning data into useful information. The study of data science brings together researchers in computer science, mathematics, statistics, machine learning, engineering and the social sciences.

Machine Learning

A subset of Artificial Intelligence. It is based on writing computer algorithms (sets of instructions given to a computer) that can learn from information they have previously processed in order to generate an output.

Systems appear ‘intelligent’ because they can adapt to different situations based on what they have learnt/seen before.

I found the FAQ of the Alan Turing Institute gave a great introductions to these terms. Their website in general is great for gaining an understanding the different areas that AI encompasses.

Example uses of AI and machine learning include:

  • Fraud detection
  • Smart homes, where decisions can be made based upon factors such as energy consumption or perceived home safety
  • Connected and self driving cars
  • Sentiment analysis (for example analysing if a review is positive or negative)
  • Managing workloads of computer systems (Google Deepmind reduced energy used for their coding data centres by 40%)
  • Health care – helping doctors with diagnosis
  • Recruitment – sourcing candidates and interviews with chatbots
  • Predicting vulnerability exploitation in software
  • Financial market prediction 
  • Accounting and Fintech – automating data entry and reporting
  • Proposal review – reviewing contracts, cost, quality level
  • Voice assistants

Last week, I managed to catch a panel discussion on the subject ‘AI for Social Good’ at the AI and Big Data Expo. The Head of Programme, Digital Commission of the disability charity Scope gave some interesting examples of AI being used for social good.

She spoke about how in New York, screens that people can interact with using sign language are being trialled and installed on buses to improve accessibility. Microsoft are developing ‘Seeing AI’ used within a text recognition application designed with people that are blind. Really excitingly, The National Theatre and Accenture have developed Smart Caption Glasses. They are a way for people with hearing loss to see a transcript of the dialogue and descriptions of the sound from a performance displayed on the lenses of the glasses.

The panel also discussed how although the design focus of these AI applications may have been for people with specific disabilities, they will benefit many others. Somebody could be holding a baby and suddenly they wouldn’t be as mobile as they were before. It is a shame that a business argument to design accessibly would need to be made, but designing for people with specific needs shouldn’t be viewed as designing for a small subset of users as the benefits will cascade. Thus designing accessibly shouldn’t be an afterthought.

Of course it isn’t all good. Systems learn based on what they have seen before. Society is inherently bias against minority groups. If we let this (to name a few) racist, sexist, transphobic view of the world run through our systems and then rely on those systems to make predictions based on this information, then we are only going to amplify bias. The people developing the systems need to do so with this in mind. Machine learning models should be made transparent where possible.

There is growing concern that some job sectors will be replaced with AI. If you work in a job that involves solving lots of problems and a high level of human interaction then you will probably be less at risk. If you are a train driver, mortgage advisor or stock market trader then it is quite possible you could be affected one day.

Another concern is data privacy. As users, we want our data to be kept safe. It’s no secret that tech companies largely profit from selling on information. We take this as the trade off for not paying to use their platforms, but are not very confident in how our data will be used or what the limits of surveillance are. On the flip side, to train Machine Learning systems so that they can make accurate predictions, we want lots of data. This is ok if you work at a large corporation with a lot of access to user data, but if not there is a reliance on collecting it yourself of using open data sets.

In 2018 The Department of Culture, Media and Sport released The Data Ethics Framework. The framework sets out clear principles for how data should be used in the public sector. It will help us maximise the value of data whilst also setting the highest standards for transparency and accountability when building or buying new data technology. Many open data sets are available on https://data.gov.uk/.

Some examples of how public sector organisations are implementing emerging technologies, including AI and machine learning have been presented here by the Innovation Team at Government Digital Service. Projects range from anomalous ship detection to resource allocation of fire engines to predicting people in crisis. A visualisation of the research can be found here and can be filtered in various ways.

Intro to Cryptography

It has got to the point where I want to start learning more about digital security, so lately i’ve started learning a bit about cryptography. Cryptography is described as the art of writing or solving codes. It is of course only one segment of the giant security pie, but without cryptography security systems would be a lot less… well… secure.

Cryptography can get extremely deep and complex especially when you start looking into cryptology (the maths behind it) so being my first dive into learning about crypto this post will be more of an overview of the basic concepts.

What is Cryptography?

Cryptography is used to encrypt information. Once information is encrypted it is transformed into a scrambled up, unreadable format. The only way to unscramble it is to use a secret key. This is known as ‘deciphering’ or ‘decrypting’ a message.

Sometimes an attacker will manage to unscramble the encrypted message without the secret key. This is known as cryptanalysis or code breaking.

Here are the guarantees that cryptography makes when it comes to securing a communication:

Integrity – guarantees that a message hasn’t been modified in a way it shouldn’t have

Confidentiality – the message is kept secret

Authenticity – guarantees that a message comes from where it was supposed to

What is it used for?

Some modern day applications of cryptography include email encryption, hard drive encryption, encrypting mobile phone data, passwords for logging into sites, bank cards, electronic passports, online banking, GSM (mobile!) voice encryption and iTunes & Kindles (digital rights management stuff). As far as communications and data transfer is concerned it is pretty much everywhere, though the idea of cryptography has been around for a very long time – as far back as 2000bc and hieroglyphics.

Symmetric encryption

Symmetric encryption is a subset of cryptography and is probably the most basic example to use for explaining how a message may be secured. Here a key is used to encrypt a message and then the same key is used to decrypt it at the other end. Here the encryption will only get you confidentiality and perhaps a weak guarantee about authentication.

Two people are communicating over a channel that may not be secure. They are called Alice and Bob. Examples of insecure channels could be GSM & wifi/internet which can be open channels. The attacker (Oscar) wants to listen in on Alice and Bob to find out some top secret information.

                                                                    OSCAR! (attacking!!)

ALICE ————————————> Insecure channel! ———————————–> BOB

                                                        ——– = top secret message (Not encrypted!)

Cryptography can be used to encrypt the message sent from Alice to Bob so that Oscar can only see random characters.

 OSCAR!

(Can’t understand the message and use for evil)

ALICE ————————————> Insecure channel! ———————————–> BOB

(Encrypts)                                                                                           (Decrypts)

An encryption algorithm will be used at Alice’s end to generate the cipher text. Encryption algorithms are also referred to as ciphers and the string of jumbled up characters produced is knows as ‘cipher text’. Bob will have a key which tells the decryption to change the cipher text into a message that makes sense. Bob needs to have the corresponding key to Alice to unlock the message. A key is basically a parameter that defines what the output of the cipher would be. So a key might tell the cipher to change plain text into cipher text and vice versa when it is decrypted.

What are these encryption algorithms?

There are many well known encryption algorithms (some common examples being AES, DES, Blowfish… if you google you will find long lists). It is very unlikely that a programmer would ever need to write their own encryption algorithms, in fact, it is recommended that rather than try and make your own, that you use something that has been tried and tested for many years. This is basically because it is very difficult to create a secure encryption algorithm.

Until the 1970s people kept these algorithms secret (a long time to go down the path of secrecy considering crypto started way way back). It was then realised that this was a bad idea, and for an encryption algorithm to be truly secure it should be openly available to everyone… and still for no one to be able to decipher it. Everything is pretty open in cryptography, everything other than the actual keys generated, in the hope that people will try and break the codes. When they can’t after years and years then the algorithm is proved to be pretty solid.

Cryptanalysis

Some cryptanalysis methods include brute force, pattern matching and social engineering. The brute force approach basically involves working out every possible key combination and trying each one out until the cipher text is de-ciphered. This generally takes ages and the algorithms are often future-proofed to ensure that even as machine speeds advance, the decipher key would still take forever to find. Pattern matching is a really basic way of me saying that mathematics and logic are used to find patterns in cipher text. Examples of this could be the probability of certain letters appearing in a sentence and using that logic to figure out which character they could have been replaced with, or patterns in what plain text generated hashes are known to represent. Social engineering involves physically going to a place where secret information is stored and obtaining it.

Encryption Gems in Ruby

Luckily we don’t have to manually write out these algorithms to encrypt our code. Ruby gems (and of course libraries in other languages) allow us to easily insert the functionality into our own projects.

There are numerous ruby gems that can be added to your codebase to secure data. A useful gem for password hashing is Bcrypt Ruby. Hashing is actually a different thing altogether to encryption. This is because hash functions are designed to be non-reversible and generate a fixed length signature that is always the same for the same input. There should never be an easy way to reverse a hash. Bcrypt is a really good thing to use because it means that a password can be easily hashed and this password hash can be stored in your database in a ‘password digest’ row. So a password could look something sort of like this in a database: $2a$10$zbMs7mLoTF/4iz9FvBNgcONBwxsbdeIyYK8Ig.L8HQ3t…” which is way safer that storing the actual password string a user entered. You can then use a method called has_secure_password which will be able to validate the password a user enters with the password hash stored in the database using a password_confirmation field. This is the Railscast that I used to learn how to set that up: http://railscasts.com/episodes/270-authentication-in-rails-3-1

Sublime to VIM

April 2015

In order to make the switch to coding in Vim a smoother experience I set up my Vim environment to look and behave as much like Sublime as I could. This might sound pointless, but now I have the familiarity of the layout with all the additional Vim commands which should ultimately save me a load of time in the future. In this post I will explain how I did this so that if you are thinking of switching, you shall learn a few ways to make the transition a bit nicer.

What is Vim?

When I very first heard of Vim I thought that it was some sort of alternative to Bash and was used primarily to run commands to run programs. This is NOT the case… Vim is actually a text editor within the terminal. You use it to open files and edit them, like you do with a regular text editor… just that now it is from within the terminal. It also comes with its own set of commands (though most are just one key stroke) which let you jump around the file quickly aka a dollar sign $ will take you to the end of a line, G will take you to the last line in the document etc.

Why Vim?

The reason some programmers prefer Vim is that it is highly configurable, allowing you to map key strokes to custom functionalities. Because editing files in Vim happens within the terminal, you can’t use the mouse to click to where you want on the screen. You need to get used to learning the commands to move around.

This is the initial barrier, because as well as working on writing a program, you also have to remember a load of commands in order to enter your code into the right place. After a while these commands will become second nature and you will save a lot of time not having to use the mouse. Basically you have to slow down to learn and then you will speed up over time. This can be off putting at first but I am assured that the perseverance is worthwhile.

I can definitely say that after a couple of weeks of using Vim, you do get used to it quite quickly (ok ‘it’ at this stage only means a handful of commands) but it isn’t as difficult as you may expect.

Getting started!

The installation instructions can be found on the Vim website. I am using a Mac which came shipped with Vim.

To open a file in Vim cd into the appropriate directory and run vim name_of_file.rb. This will then open up your file in vim. 

1
2a

At this point you will find that you can’t just start typing out the text. This is because on entering Vim you are placed into ‘normal’ mode. Here you can do stuff like entering Vim commands to move the cursor around or perform actions such as deleting text (for example dd will delete a whole line).

In order to add a new line of code to your program, you will need to go into ‘Insert mode’. This can be done by pressing i which starts insert mode from where the cursor is currently or a which will start insert mode with the cursor one space forward. In insert mode your keyboard will work as regular keyboard text input usually does, so hitting x is going to type a letter x as opposed to deleting a character like it would if you were in Normal mode. To get out of insert mode back into normal mode you need to press esc or ctrl+c.

To save changes go into normal mode and type :w (including the colon!) and to exit use :q. To do both at once use :wq (w = write, q = quit). An alternative to :q is ZZ.

On my first failed attempt of using Vim I literally just Googled the commands as I needed them. This disturbed the flow completely so I recommend finding a Vim cheat sheet online, printing it out and sticking it somewhere nearby. This is the one I have tacked to my wall.

An additional method, which I haven’t done yet for Vim but did for UNIX command line is to make cue cards of the commands (with the command on the front and what it does on the back) and to drill through them when you have a spare minute.

On my old laptop Vim didn’t automatically colorise the syntax, though it did on my new one. To turn syntax colorisation on each time you open a file do :syntax onand then :syntax off to get rid of it. A better option is to set it up to always be on automatically. To do this you will need to edit your .vimrc file which can be found in the ~ directory (if it’s not there then you need to make one). This is where you specify customisations for your environment. Add syntax on to the end of the .vimrc file and save – your syntax will always be colorised on opening Vim 🙂

It is a good idea to start with creating a new file and trying out the commands from the cheat sheet. Also spend some time going through Vimtutor. Just type Vimtutor into the terminal to get started. Realistically though, individually opening files is annoying as it takes up time, especially if you are not completely confident on where files are within the structure. To conquer this I installed a Vim plug in called NERDTree which opens up your project in a file structure so that it looks fairy similar to Sublime (though I will admit not as pretty but you soon get used to it). NERDTree can be installed by following the installation instructions on Github.

To run NERDTree cd into the root of the directory that you want to display in the editor. Enter the command vim to open Vim and then enter :NERDTree.

3

This then begins to look a lot more similar to Sublime Text with the file structure along the side. To open a file hit enter.

indent

To open a file in a new tab hit t.

5

To switch between tabs use gt.

To get from the NERDTree edit window back to the side navigation use ctrl + ww.

So this is a good start to making the cross over from Sublime but it still isn’t ideal for moving around and opening stuff up. The next tool I would recommend is a plugin called CtrlP. This is used for opening files within a file structure but makes things a lot quicker than scrolling through the side menu in NERDTree.

You can use CtrlP with NERDTree. Open up your project in NERDTree and Enter :CtrlP the/file/path then hit enter and you will see a list of all the files in that directory, type in the name of the file you want and this will find the file for you, press enter to open it. ctrl + c closes CtrlP.

6
7

At this point I was pretty happy that I had a fairly similar set up to what I was used to, at least visually. The thing that stopped me committing to using Vim was that in Sublime I always used ctrl + cmd + f to search for snippets of code within the whole project and cmd + f to look for words within a particular file.

If you just want to search for a word in a file (cmd + f style) then /  followed by the word you want will put the cursor onto that word.

In order to search for all instances of a word within the codebase (cmd + ctrl + f style) you can use :Ack or :Ag. This means that you can run :Ack thing you want to find and it will show you all the places that word shows up:

ack
8

You can then open up the files in the list by moving the cursor over the file name and hitting enter.

In order to install Ack I decided to use Vundle as a friend recommended using a plugin manager as it makes it easier to customise your environment with loads of features. A couple of gotchas for installing Vundle. When you copy the example on the README into your .vimrc make sure the formatting is right, the lines with the " " in front of them are comments and I think when I first copied and pasted somehow the format meant some stuff was commented out that shouldn’t have been. Also it tells you to launch Vim and run :PluginInstall. I had my .vimrc file open in Vim so I kept trying to run :PluginInstall from there and it wouldn’t work. Anyway in the end it turned out I needed to close it and open a new vim session and run the command… so just a heads up!

In order to install Ack I added Plugin mileszs/ack.vim to my list of plugins in my .vimrc file and ran :PluginInstall… so mega simple to install thanks to Vundle.

9

Running :h vundle will give you loads of commands for managing and viewing your plugins :PluginList lists them all.

So now that I could view my file structure text editor style, move around it easily and search for files I felt happy using Vim. There’s still lots to learn and I have been told it takes years to really get the hang of using Vim but I am definitely enjoying it. I think the best way forward is just to delete any other text editor from your computer and use Vim as much as possible, even though it will slow you down at first.

Here are a few useful commands that I have been using a lot:

* – shows you where your cursor is on the screen

x – deletes character underneath cursor

u – undo

ctrl + r – redo

h – left

j – down

k – up

l – right

O – Takes you to the start of the current line

$ – Takes you to the end of the current line

Object-oriented programming & method privacy in Ruby

2015 

Ruby is an Object-oriented programming language. As its name kind of suggests, this means that we build Ruby programs using things called objects. There are plenty of tutorials etc online but I will start by explaining some ‘need to know’ fundamentals… 

Object-Oriented Programming

To start building an object-oriented Ruby program a good place to start is with creating a class. A class is born via creating a new Ruby file and adding a class definition.

class

This is the class definition for a Student class, written in a file named student.rb

So you could have say, a Student class or a Car class or a Task class. Out there in the real world individually students, cars and tasks are going to differ from each other, but they have the category of that which they exist under in common.

We produce our objects by ‘initializing’ them from a class using the new method (otherwise known as the ‘constructor’). We can then personalise these individual objects by calling methods on them and by giving them attributes.

… I kind of picture a class like a factory, so for the Student class factory we press an imaginary button (aka initialize the object) and it spits out a fresh new student object that we can now personalise using attributes and methods.

Attributes

Attributes are passed into the object as an argument(s) when the object is initialized… for example:

1

Instance Variables – A Quick Detour

In Ruby we have local variables, instance variables, class variables and global variables.

Instance variables are easily recognisable because they are prefixed with an @. They are bound to an instance of a class and allow us to form the state of an object. This just means that each instance of the class will have its own set of information stored in its instance variables. So if I wanted to create a new student object called jerry, he would produce a different result outputted to the terminal than emma would. This is due to jerry being instilled with different attributes passed into his instance variables.

3
4

If I try and replace the instance variable with a local variable (named local_var… just for example’s sake… it is considered bad practice in Ruby to include ‘var’ in naming a variable as it describes what it is in programming terms rather than what it is representing)

5

I get the error

6

This is because within age we are unable to access local_var. Local variables are only available within the methods that they are defined. This is their ‘scope’. Because of this, we are not setting up our program to pass attribute information for an object around our Student class. All instance variables behave privately by default. This is because you don’t have access to them outside the scope of the object itself.

Back to Attributes!

Getter and Setter Methods

Only the object’s own methods can access its instance variables. Therefore we need methods known as ‘getter methods’ which return the value of the particular instance variable initialized in the initialize method.

The age method in my Student class is an example of a getter method:

7

Here we are telling the age attribute to be set to 10 when initializing the emma student object.

8

Writing out all these getter/setter methods looks kind of clunky and repetitive. Therefore Ruby gives us a nice short hand way through using attr_accessors.

The attribute accessor for getter methods is attr_reader. We simply pass the getter method name into the attr_reader and it will create the getter method for us, this looks much neater. Here is the Student class refactored to use an attr_reader:

9

Sometimes we may want to change the value of an instance variable from within a class method. To do this we need to use a setter method. To set this up I have added in a fav_colour getter method and a fav_color setter method (the one with the =) to our student class:

setter

To refactor the setter method I can get rid of it and define fav_color in an attr_writer:

11

Calling the setter method would be done a slightly strange looking way which uses an = and some brackets:

12

This results in:

13

The use of the = sign makes it easily recognisable as a setter as it gives the feel of assigning a value. Ruby also gives us syntactic sugar (basically a ‘nice to read’ way of writing the code) which could allow us to call our setter like this:

16

I can then refactor the code further using an attr_accessor which creates both reader and writer (alternative terms for getter and setter) methods. This means I can delete the pre-existing getter fav_color method definition:

attr_accessor

Method Privacy

So far we have looked briefly at OOP (object-oriented programming) which will help us with the next bit… method privacy. Methods by default are public meaning that they can be called on any of out student objects.

So the gotcha for understanding the rules of method privacy is that the visibility (whether it is public, private or protected) of a method depends on what its receiver is allowed to be. The idea of a method is to send a message to an object, but sometimes we only want to allow certain objects to send messages.

Public

Methods by default are public meaning that they can be called on any of out student objects.

For a public method the receiver can either be self, the name of the method or another object. So we can happily run emma.allowed_black_hoody?

Private

Private methods don’t let you specify a specific receiver. So if I make the allowed_black_hoody? method private like so:

17

Then I get a no_method_error

Private methods can also be declared like so:

18

I can’t just remove the receiver because I would end up with a no method error as I have nothing to call the method on. If we don’t specify a receiver then the method would be called on self. The only way we can call the private method is if self is an instance of the Student class.

Self is an instance of Student when any Student instance method is executed. So if I add a method called hoody_check I can call the allowed_black_hoody? private method from there without a receiver and then call emma.hoody_check. This gives me the result of the private method allowed_black_hoody?

19

The idea is that the Student object can check_hoody for itself but no one else can tell it to do so. Private methods are used commonly in Rails for methods which require parameters. This boosts security as it only permits permissible attributes for that instance.

Protected

I haven’t really come across protected methods much as they are not used so often. They are a less hardcore version of private methods. You can call a protected method as long as self is an instance of the class or any of its defining subclasses. This is the same as private but if the class of self and the class of the object having the method called on it are the same or related by inheritance then it will let you call it. It is used when one instance of a class wants to do something with another instance of the class.

Here is an example:

20

If I changed the age method to be private as opposed to protected then I would get a no method error. If I call it as a protected method then it returns “Jerry is older than Emma”.

Two instances of the class are being compared, therefore we need them to both be able to call the age method which means that age can’t be private because private methods only let you call on an instance method that is self implied.

Understanding the concept of OOP and how scope and method privacy work are really vital when learning to build Ruby programs. I hope this post has helped to break down and explain at least an overview of these concepts to help you in building your own programs.

Teaching Sonic Pi with The Curiosity Hub

2015 

sonicpiworkshop

The Curiosity Hub run STEAM (Science, Technology, Engineering, Arts and Maths) workshops, teaching these subjects in imaginative and exciting ways. I was really pleased when Founder and Lead Educator Jacqueline asked if I would join her in running a ‘Create your own Digital Music with Sonic Pi’ workshop.

What is Sonic Pi?

Sonic Pi is free to download and provides an environment for creating music using computer code. It began as a research project by Sam Aaron at Cambridge Uni to improve computing and music lessons within schools. I think it is an amazing way to teach coding skills in a creative way. Part of the reason for this is that it removes the ‘fear’ of learning to code. Kids that have never coded before probably don’t realise quite how many programming constructs they are covering, as they are too excited about all the cool sounds they are making. It was endearing to see that the children were genuinely excited, their facial expressions displayed sheer awe when they heard the sounds they were producing. They were very keen to show each other what they had created! The idea is that children don’t just sit back and learn about music, they can actively be musicians even if they do not already play an instrument. This could then open the door to discover a path they may have otherwise dismissed.

The workshop

The attendees were aged between 9-12. Some already played an instrument and a couple had done a little coding before. The workshop began with a discussion about how we hear sounds from both acoustic and electronic sources. They seemed quite clued up on acoustic sounds but sound from a loudspeaker was more of a mystery. We spoke about whether anyone played any instruments, the kind of music they liked to listen to and why. I was quite impressed with their musical tastes and I suppose secretly quite surprised that they knew about a lot of electronic music that I had never heard of. They said they mostly found music on Youtube and I experienced feeling old, maybe for the first time when I told them about how we listened to the CDs on the wall in HMV to listen to new music… but this ability to listen to and share music using technology definitely ties into the ethos of creating and sharing music with Sonic Pi.

We then showed them the Sonic Pi environment and asked them to get used to running and stopping sounds and noticing that the program was outputting information to the log once running. They then copied in examples that came with Sonic Pi and ran them. After this they took it in turns to describe their favourite example and why they liked it. We then listened to the first minute or so of ‘Time’ by Chase and Status and talked about the different layers of sound and how they were being used to build up the song. We spoke about how Time begins with vocals that are treated with lots of echo/reverb which gave the impression of the singer being alone, the build up of vocal layers, repetition, call and response and finally how the drums speeding up to create a burst of energy and realisation.

This was to demonstrate that in a radio friendly pop/dnb song there is still a lot going on and if we listen carefully then we can identify and use these ideas to construct our own music. We then described synths and samples and demonstrated the amen break. Using Sonic Pi we slowed down the rate of the Amen Break and discussed how it now sounded a bit funkier and actually now sounded like the drum beat in ‘You Know I’m No Good’ by Amy Winehouse. We ended the introduction reflecting about how programming is an amazing way to make music, as a slight change of a parameter can completely change the way something sounds, giving us loads of control and endless creative possibilities.

We then worked through some worksheets. The children kind of went through in order but were quite keen to skip ahead to the parts that covered the things wanted to create. Inevitably they came across syntax errors. At first they would be quite quick to say ‘It’s not working’ and immediately ask for help, but after reading through error messages with them they were able to start debugging for themselves by the end. At the end of the session the children took it in turns to share some of the music they created with each other and their parents. They took home a Certificate of Coding and Musical Excellence and the Coding and Music Journals that Jacqueline created for them as well as the worksheets. Hopefully they will continue to create music at home :).

sonicpicertif

Outcome

In 2 hours not only had the children been exposed to sound waves, ADSR, amplitude, rate, panning, midi notes, synths, writing melodies, samples and analysing existing music. They learnt about code, running a program, debugging, syntax errors, loops, iteration, blocks, threads, parameters and randomisation. All done in a really fun, creative ‘non textbook reading’ kind of a way. It’s worth mentioning as well that no matter what your age, if you are new to programming, this is a great way to learn about all of these programming constructs in a practical way because they are most likely going to help you in which ever language you go on to use.

The language of Sonic Pi is created using Ruby and SuperCollider. I use Ruby day to day at work and I studied Music Informatics at Uni where we used Super Collider… so Sonic Pi is very appealing to me! My old blog about computer music is somewhere on the depths of the internet if anyone is interested.

Mentoring at ThinkNation – Young people creating tech solutions for big social challenges

BY ROSAEMERALDFOX ON DECEMBER 30, 2018 IN BLOG, BRIGHTON, DEVELOPER, DIVERSITY, EVENT, TECH

On October 13th I was a mentor to a group of young people at @thinknat ‘s @brightondigitalfestival event. The aim of the event was for the young people (aged 14-24) to come up with tech solutions for big social challenges.

ThinkNation founder Lizzie kicked off the day with introductions and we broke out into our groups. Within our group, we spent the day discussing and researching our subject, creating ideas for a tech solution and then putting together a pitch style presentation. The young people then presented in the evening, live on stage to an audience of around 70 members of the public… busy day!

The subjects were selected as a result of a vote, in which young people chose the questions they felt had the most impact on their lives. They were:

  • How can tech can help mental health support for young people? (There were actually 2 groups on this as mental health was such a strong concern).
  • How can tech help the homeless in Brighton and Hove?
  • What tech would you invent to eliminate beach pollution?
  • How can Artificial Intelligence (AI) create a fairer housing solution in Brighton and Hove?

The focus was to think creatively about how technology can be applied to help to reduce these problems. Although the technology was important, because we were not actually building the products and didn’t have a budget, the focus was much more on coming up with creative ideas, thinking big and not limiting the imagination. Despite this, after the presentations, as there were a lot of people from industry with the event being part of Brighton Digital Festival, all of the groups had companies keen to speak to them further about developing the ideas. Even if an idea would have been very big and difficult to implement, a descoped version could still have real impact. We were able to show the young people that often, other technologies are already in place that could be used to help build their idea faster.

My group consisted of five young people, three from Sweden and two from the UK, as well as two other mentors; Andy Cummings, Director or Product Development and Rebecca Willis, BDM International Education Marketing and Management.

Our question was ‘How can Artificial Intelligence (AI) create a fairer housing solution in Brighton and Hove?’. This focused more on poor quality of housing and expensive rent as opposed to homelessness. Though of course lack of housing, expensive rent, high deposits and private landlords being able to tell people to move at a months notice can easily equate to homelessness (a question focused on by another group) so there was some cross over in our initial discussions.

Poor housing conditions in Brighton is an issue that I had a lot of familiarity with, let me tell you! I lived in Brighton for 8 years and I absolutely loved the city, but there seemed to be a constant string of housing issues. Everywhere I lived there was an ongoing battle with mould. I once ended up in A&E due to allergies and the damp conditions. There was the ‘rat flat’, my friend Katie Jane’s dearly beloved ‘cockroach flat’, there was the mushroom crop growing shower in first year uni halls, meaning that whilst it was being replaced we had to have one shower for our twelve person (yep twelve person) flat for a while… I could go on and on.

Although the stories are sort of funny to recall looking back, and of course there are many people much worse off, that don’t have the privilege of living in exciting places like Brighton or London (where I am now… still enduring the less than great conditions!), feeling so unsettled and living in these conditions does take its toll on your happiness and well being, yet landlords are continuing to rake in more and more money whilst taking advantage of people’s desperation.

Young people at the event expressed a lot of concern over not being able to afford to move out. If their option (if they have the luxury of the option and can stay at home) is to spend most of their salary on a place that causes them discomfort, then they are not as likely to be out their learning how to be independent, confident and how to start building lives for themselves, which simply isn’t fair.

Anyway, back to the event… As a group we began by discussing these problems. Having the mix of UK and Swedish backgrounds in our group generated loads of interesting conversations. The Swedish young people expressed that they never really see homelessness so were shocked when they came to Brighton where homelessness is very apparent. Sweden has more space, less people, no ‘let to buy’ and thus high prices charged by private landlords, rental properties are generally let out by large private companies, often there are no deposits and generally low rent. They do however have to pay high taxes and things like food and drink are expensive…

We identified some of the main issues in Brighton as:

  • Lack of regulation, accountability and monitoring of housing conditions or rent prices for landlords.
  • Lack of space to build in Brighton and Hove due to being between the sea and the Sussex Downs.
  • Lack of affordable materials.
  • Lack of affordable housing.
  • Not enough social housing.
  • Renting from Private landlords.
  • Cost of land.
  • Spaces owned by private companies.
  • Ideologies from people in general. People want more money for themselves, this is destructive.
  • Bad conditions – dangerous, rats, mould, health impacts. Impacts other services such as hospitals.
  • Bad health can affect people going to work. 
  • Feeling unsafe and security.

The discussions covered a range of topics so we narrowed the ideas down to two themes which were ‘regulations’ and ‘physical space’. We moved onto talking about technology. We discussed what we thought Artificial Intelligence (AI) was and the young people were already very clued up on its practical applications.

AI can seem a bit futuristic and scary, despite being around for decades. What it boils down to is a computer performing a task based on information it has been given. The more information it is given, the more the computer ‘learns’ and is able to perform a better output based on being able to predict what usually happens given certain information. Of course there can be grave flaws in computational models (I have been reading ‘Weapons of Math Destruction’ by Cathy O’Neill which I would recommend to learn about ethics and computational modelling) as they can often lead to unfair bias towards vulnerable people… but like most technologies there are good and bad applications. Some examples of AI applications could be self driving cars or the software that is used for targeting the ads we see in Instagram.

In thinking about how we could apply technological solutions to our two themes, we hit a fork in the road. One route we could have gone down was our vision to build a ‘smart’ eco island of social housing out on the sea, utilising the energy from the tides and thus solving the problem of there being no space to build… it may sound a bit ‘out there’, but let us not forget the palm tree shaped islands built in Dubai due to lack of space, or the underground city built in Montreal due to above ground being just so cold (the young people thought us building and living underground Brighton might be a bit dark and depressing!).

The other route, and the one the group decided to take, was to focus on regulations and holding landlords accountable. We knew that apps like ‘Rate My Landlord’ already exist, but they depend on the user manually submitting the review through a form. The idea that the young people came up with was an application that connected tenants and their landlords.

Tenants could raise issues with landlords through sending messages, but alerts of potential problems occurring could also be predicted via AI using sensory data. All homes would have sensors hooked up to collect data on moisture levels, water pressure, temperature, air quality, noise, electricity use/if the power is working etc. An algorithm could then make predictions and if it looked like something was about to break it could send alerts to the tenants and landlords. It would also make it easy for landlords to dispatch the relevant handy people. It could tell you how long something was broken for.

Ultimately we thought it would be great if somehow laws could enforce that if the sensors showed that conditions were not up to a high level, then tenants would be able to have their rent capped until the problem was fixed. Realistically this in its entirety would be fairly tough to implement across every home. In steps towards ‘Smart Homes’, currently the Smart Energy GB ‘Smart Meter’ is being rolled out across all homes in the UK in order to put a stop to metered bills and to increase awareness of energy use. It is a very complex and expensive project, but it is happening. As network connections improve and people become more accepting of the permeation of technology in our daily lives, it could all be possible for monitoring through sensory data and AI based predictions to be effective one day at a large scale.  

The young people named the app ‘7th Sense’ and worked together to create a logo and the presentation for their pitch. They portrayed the problem, their solution, who it would benefit, potential issues and a call to action (invest!!). Two young women from the group presented in the evening and answered questions from the audience afterwards. They did an amazing job and I was really proud of them. At the end of the presentations, someone from a company that have developed a smart air brick for tracking indoor air quality/humidity and are installing them in social housing in Hackney, sat down and spoke with the group, so they were able to learn more about how related solutions are being applied in homes which was a great result.

The presentations from the rest of the groups were all really eye opening and the ideas were generally things that would make waves towards solving the problem they were focussed on. There were also screenings of short videos, both made separately by 14 year old boys. One was about homelessness and the other about mental health. To see a 14 year old boy get up on stage to introduce his video and speak openly and confidently about mental health was really inspiring, as it has been such a notoriously taboo subject for previous generations. These young people cared deeply about social issues and were using Youtube as a platform to educate others and themselves. They seemed a lot more clued up about the world around them than I remember ever being at that age and they are making their voices heard.

I hope that by attending the event the young people enjoyed thinking creatively and have confidence that they genuinely have brilliant ideas that could be applied to the real world. If they hadn’t considered working with technology before, I hope attending the event helped them see that it is an exciting avenue for them to potentially take. Personally I loved my experience of mentoring, it was a long day but it went so so fast and it helped me build my own confidence in that I could be some help to the young people in pulling together their fabulous ideas.If you are ever interested in mentoring at a future ThinkNation event, please get in touch with them through their website. Lizzie the founder is truly inspiring and does an amazing job. It is so important to help raise the voices of young people and I look forward to see what ThinkNation do in 2019.

Uncodebar 2018

uncodebar is codebar‘s annual unconference. This year it was hosted at Twitter and gathered 86 developers from our codebar community.

At an unconference there is no specified agenda, meaning that speakers are not booked in advance to present. Instead, at the start of the day, people that attend the event pick up the microphone and pitch sessions that they want to run. There is a show of hands to determine which room size the session will require and it is added to a time slot on the schedule on the wall.

The sessions usually take the format either of a talk with Q&A, a hands on coding workshop or a group discussion around a set topic.

Schedule which took shape as a result of pitches:

I took part in a session about running community meet ups, saw a talk about ‘the art of saying no’, learnt about the highs and lows of @thisisjofrank’s project in which she created a tweet controlled LED wedding dress (it was AMAZING, find out more in Jo’s post here), saw a thought provoking talk about software and ethics by @richardwestenra and finally a talk about coaching software dev.

Honestly, go along to an unconference if you can. You never know quite what you are going to get, but that is part of the fun. In this post about a Civil Service unconference, Claire writes about the value of moving away from having “speakers” and “listeners” as the collective knowledge of the audience is likely to be more than that of any one speaker.

Huge thanks to the codebar organisers that put this together (I can take no credit as I wasn’t involved in organising this… just attended!), they did a brilliant job. I left feeling very proud of the codebar community and look forward to next year.