Creating an Anki flashcard deck from Twitter feed to learn sign language

Creating an Anki flashcard deck from Twitter feed to learn sign language

TLDR: Twitter feed sign language signs in Anki:


The problem

Right, so I’m trying to learn some sign language. For anyone who’s not read the blog before: my hearing is really bad. So now I’m trying to get ahead of it getting worse, just in case. I’m going to do a course at the local uni next year but before that I figured it’d be nice to memorise some vocab. The great thing about being able to program is that you can improve your life in lots of little ways with some imagination and some help from Google.

Memorisation (Anki)

I’ve mentioned before that a really useful skill for devs is the ability to memorise. There are loads of techniques but something like a new language (spoken or sign) is a perfect use case for spaced repetition. I use Anki for my spaced repetition needs so I need to get some signs in there in a new deck so that I can start learning.

If you’re not familiar with spaced repetition, it’s a technique based on research that shows the best time to be retain something you’re trying to learn is to recall it just before you forget it. Then, each time you try to recall from memory you’ll be able to go a lot longer before needing to be reminded again.

Anki flashcards are similar to physical flashcards in that there is a front and a back. On one side you’ll put a prompt, e.g. a word to learn, and on the other you’ll put the “answer”, e.g. the corresponding sign for that word.

The solution

So the steps to get what I need are fairly simple:

  1. Get British Sign Language signs from somewhere
  2. Iterate over the signs
  3. Get the word and store it
  4. Get the sign and store it with the word
  5. The storage format should be importable by Anki

A quick bit of research and we’ve got a wealth of signs from a great Twitter feed by British Sign! I also know from reading somewhere before that Anki can import CSVs and you can even ref images if you add them to your Anki media folder so that’s the unknowns from steps 1 and 5 sorted. Like any programming task, once the steps are clear it’s a fairly trivial task to implement.


Python (3) is the logical choice here. It’s quick and easy and I don’t need anything sexy. Just need it to do its job. So here’s the code with a few comments:

import twitter
import re
import csv
import urllib.request

# The Twitter API is awesome. First you have to get your 
# API keys (removed my actual ones!) and create an instance of 
# the client
api = twitter.Api(consumer_key='MY_CONSUMER_KEY',

# Searching the last 1k tweets will be plenty 
t = api.GetUserTimeline(screen_name="BritishSignBSL", count=1000)
tweets = [i.AsDict() for i in t]
with open('bsl_signs.csv', 'w', newline='') as csvfile:
    signwriter = csv.writer(csvfile, delimiter=',')
    for t in tweets:
        tweet_text = t['text']

# The sign of the day tweets always have the same format so Regex 
# is handy for getting the word
        m ='sign is: (.+?) - http', tweet_text)
        if m:
            english_word =
            if 'media' in t:
                media = t['media']
                image_url = media[0]['media_url']
                filename = 'bsl-' + 
                english_word.replace(' ', '-').lower() + '.jpg'

# Downloading the image. Once copied to Anki's 
# folder you just need to ref them in the CSV with img src
                urllib.request.urlretrieve(image_url, filename)

# The important line. Write a row to the CSV, first column is 
# the word pulled from the tweet and second is the ref to the image
                f'<img src="{filename}" />'])

Copy the downloaded images to the folder for Anki and import the CSV and you’re done. I can run the script again in a few weeks/months to add new signs that get released but plenty to learn in the meantime!

Thanks to British Sign ( for kindly agreeing to me using their content.

Mini book review: Surely You’re Joking Mr. Feynman

Mini book review: Surely You’re Joking Mr. Feynman


If you don’t know Richard Feynman, you’re in for a treat. He has done a lot of unbelievable shit: He won the Nobel prize in Physics, he worked with Oppenheimer on the Manhattan Project, he lectured alongside Einstein at Princeton and he played a key role in determining the failings that led to the Challenger disaster.

What’s it about

Well, it’s not about Physics.

It’s a selection of anecdotes from Feynman himself, jumping back and forth in time. It doesn’t cover his time in the Challenger investigation but a lot of key events in his life are talked about in detail. The book has a bit of a disjointed format. I wasn’t sure if I’d like the lack of structure at first but I found it refreshing as I made my way through. One chapter might be about the friction between him and his military bosses and the next about his bongo playing adventures in Rio.

The one thing that is consistent is his simple presentation and hilarious tone. Despite understanding and developing incredibly difficult concepts, he had an amazing ability to explain things in a way a child could understand. In fact, he’d point out that not being able to do that means you really don’t understand the thing you’re talking about at all! I remember when I was younger my brother (a big Feynman fan) always asking me to explain what I had learned in school that week. If I couldn’t do it without tripping over, he knew I hadn’t really learned it.

My only real criticism is that some of his chat comes across as dated. His attitude towards women at times is probably a bit controversial at best. He does acknowledge it though, and for the time I think he was probably pretty progressive. Reading it in 2017 though can induce a bit of cringe.

Why should I read it?

If you’re on this blog, you probably develop or are interested in developing software. Anyone who follows the Feynman method is going to improve their dev skills.

He also shows how it’s a great thing to not be afraid of looking like an idiot. Just because everyone else in the room seems to understand something, doesn’t mean they do and also doesn’t mean you should. Likewise, just because everyone else in the room does something a certain way, doesn’t mean it’s the right way to do it.

He didn’t respect authority just for the sake of it and gives numerous examples of how an ego has gotten in the way of many solutions to problems. He talks about his experiences with imposter syndrome and having confidence in your position in life.

Pretty much all of the book (except the bits about women and bongos!) can be applied to software development, especially for the guys and girls writing the code. You’ll also laugh out loud at bits.

My rating


Get it here

Belfast and the cybersecurity buzz

Belfast and the cybersecurity buzz

Awesome to see cybersecurity growing in my home town. There’s such a wealth of skills here and I’m excited to be in the midst of it.

If you’re not from Belfast but interested then check out this great write up:

With the World Cyber Security Technology Research Summit and the OWASP AppSec Europe 2017 conferences both being held here this week, the buzz is real.

Non-programming activities that make for a better developer

Non-programming activities that make for a better developer

I should probably start with a disclaimer. This post contains a list of non-CS activities that have had a positive impact on my career as a developer. Some of it will work for everybody and some won’t. A lot of it is also useful for people in other fields too but I guess they’re unlikely to be reading this.

In no particular order…


Reading is a great pastime and, like most of these points, should be done for its own merit. Being well read provides new insights into the world. Read Feynman on physics and you’ll discover how to think through a problem. Read about the Civil Rights Movement and be inspired by people that could stand by the courage of their convictions, despite overwhelming adversity. Obviously I’m not comparing the struggles of oppressed people to software developers (!) but my point is that the more you learn in life, the more ammo you have when faced with any challenge.

What to read though?

This is going to vary wildly depending on what your goals are but I think there are two golden rules:

  • Read as much as you can. If I could recommend one non-technical book for programmers, I’d say Carnegie’s “How To Win Friends And Influence People”. Despite having a slightly sociopathic sounding title, it’s a classic that will help improve the lives of everyone around you in a genuine and meaningful way.
  • Include a healthy dose of things you don’t agree with. Challenging your existing viewpoints is a great way to grow as a person and teaches humility.

Exercise (and eat well!)

Life is easier when you’re stronger and fitter. There’s no reason not to strive for more of both. Exercise releases dopamine and all the feel good chemicals to elevate mood. I find that I’m more focused when I’m training well and eating healthily. The sugar hit from junk food might get you through that hackathon but eat it day in day out and it’ll just leave you feeling moody and lethargic.
Pointing out that “sitting is the new smoking” is cliché these days but that doesn’t mean it’s wrong. I’ll mention some ways to counteract the effects of sitting in the next section but a comprehensive resistance training routine will go a long way also. Performing “ass-to-grass” squats and other compound exercises with good form by themselves will promote better mobility, helping the 9-5 body move beyond its restricted range of motion. The great Pavel Tsatsouline recommends 30 seconds of kettlebell swings for every hour of sitting – please learn how to do them from a good coach first however! That brings me onto my next point


  • Find a well recommended personal trainer. I can’t emphasise this enough.
  • There are some great apps to help. Check out the Stronglifts app for iPhone and Android but make sure you get someone to check your form is solid before upping the weights.
  • If resistance training isn’t your thing, I think you’re missing out but it’s hard to go wrong with just moving more. If you want to get better at running then check out the Couch to 5k app or see if you have a local Parkrun nearby.
  • There are some great fitness related subreddits: /r/bodyweightfitness is one of the best, especially if you’re light on equipment and don’t fancy joining a gym. Some of the subscribers have created a great supplementary app containing the official recommended routine and made it available on the Play store.
  • I’ll say it one last time to drill the point home: please get a professional/expert to help with your form, especially at the beginning.


Obviously related to the last suggestion. Postural issues are rampant in the software industry. Unfortunately there’s no quick fix but as long as you put in consistent effort, even just a little at a time, the benefits are pretty extraordinary. I experience next to no niggles from physical activity now and improved posture and mobility has had a definite positive impact on my mental wellbeing as well.

More than touching toes

  • Get one or two solid stretches for each problem area.
  • If you work at a desk I’d put money on you needing to improve your hips, glutes, back (flexion and definitely extension) and shoulders. Probably ankles too.
  • Strength and flexibility go hand in hand when done right but if you weight train and never stretch then you probably need even more help – ease into it!
  • Some people hate stretching. I personally do it while I’m watching a TV show and that works for me. There are plenty of avenues to explore. Maybe yoga is more your thing? Find what works for you.
  • If I had to recommend the most “bang for your buck” stretches I’d say: pigeon stretch, couch stretch, shoulder dislocates (with a resistance band and eventually a stick/bar), sitting at the bottom of a bodyweight squat and back bridges.
  • Check out Kelly Starrett at MobilityWOD.


There’s a lot of pseudo science and spirituality attached to meditation which I’m not a fan of but ignoring all that it’s a great tool. Mindfulness has been shown to improve mood, help battle depression and to lead to an increase in concentration. Mindfulness sort of goes hand in hand with mediation although you could argue that mindfulness has a broader scope. Either way, I’ve found that the practice helps me stay in “the zone” for longer periods of time. This obviously applies to all aspects of life but I think it’s especially great for programming because of the high levels of focus required.

I’m not your Buddha, guy

  • This is another activity that has some decent apps to help out. Headspace is very popular, especially for guided meditations. I use “Meditation Timer & Log” on the Play store. It’s pretty basic but lets me set some useful options and keeps track of how much I’ve done.
  • Reddit to the rescue again. /r/meditation is very active and super patient to beginners – as you’d expect from a bunch of people who meditate a lot I guess!

Memory training

This is something I’ve picked up over the last few months. In all honesty, I mostly use it to learn stuff that isn’t work related but that doesn’t mean it isn’t suited for CS studies or work too. If you think you have a bad memory then you’re almost certainly wrong. If you’ve read about people with photographic memories then that’s mostly bullshit too. There are a lot of techniques to retaining information and some people pick them up by chance. The good news is that anyone can learn them at any stage in life. Even if you “naturally” have a good memory then chances are you’re can hone the skills you have quite considerably using these simple techniques.

30 days hath September

  • Spaced Repetition. There’s a fair bit of research to show that the best time to remind yourself of something is just before you forget it. Each time you do this you’ll remember the thing for a longer period of time. Eventually you’ll only need to remind yourself every few months/years to keep it in your long term memory. Once again, there’s a bit of software to help: check out Anki (web app and iPhone/Android apps). It will send you notifications to remind you to check information you want to remember (saved as flashcards). You can also download a ton of prepared decks from their site if you don’t fancy making your own.
  • Using your senses. I won’t try and pretend like I know anything about neuroscience but from what I gather tying information to one or more senses in your mind makes a deeper connection in your brain. Also, the more unusual the sensory experience then the easier it is for you to recall it. For example, say you need to remember that a Lambda is another name for an anonymous function but you just can’t make it stick. Try picturing a little lamb running around in a green field being chased by your dad. You can smell the grass and hear your dad scream “Come back you fecking lamb!”. The lamb gets closer and closer to you and right before it knocks you over you see that it’s wearing the Guy Fawkes mask from V for Vendetta that appears in all the Anonymous videos. Obviously that example is ridiculous. It’s meant to be! Next time you hear/see lambda that image will start to play in your head. Even the fact that you sat and conjured up some ridiculous story means you’ve given that fact more attention than you normally would – that in itself will help you remember.
  • Memory palaces (loci). You’ve probably heard of these and they’re a highly recommended tool although I personally haven’t made much use of them. They’re suited to learning things in a certain order like speeches.
  • Major system and Peg system. I’ll not go into depth here but I recommend picking up a decent book. Harry Lorayne’s Ageless Memory is great and covers these well. Essentially you can translate numbers to words using these two systems. With the words then you create vivid pictures that make learning number based facts easy. They’re surprisingly versatile too since a lot of related facts can be strung together using numbers e.g. I learnt the US presidents in no time by using the major/peg systems to learn when the presidents were in office (by year and position).
  • Combine the above! These techniques/tools are all complimentary to each other. Some are better suited to certain types of information but generally a mix and match works best unless the thing you want to learn is very simple. I mentioned that I learnt the presidents. To do that I used a combination of every point above (except for loci). I would find out the president’s position in the order and the years they were in office, then I’d make a flashcard in anki, create pegs out of the numbers and make a strong sensory image connecting the pegs to something about the president’s name.

Something creative

I choose to draw and I’m pretty bad at it but I love it and it gets my brain working in a different way. Again, whatever you choose should be something you will enjoy.

*insert creative subtitle here*

  • Draw, play, sculpt, dance, whatever. Find something, preferably not related to a computer of any kind, and get on with it! Do it every day, even if only for 5 minutes.


Although I’d recommend doing all of these things multiple times a week, I’d also encourage mixing it up. Science has shown that new experiences are recorded differently in memory. You know the way life seems to fly by quicker as you get older? When you’re young, a lot of things are new but as you get older your experiences are usually things you’ve done before. Our brain filters out familiar memories almost like you never experienced them. By doing new things, you not only grow as a person but your life will even seem longer when you look back on it.


Alright I’m just taking the proverbial now right? Nope. A good sleep not only feels awesome and helps with important bodily functions like hormonal balance; it also supports pretty much every other activity mentioned in this post! Exercising needs a recovery period for optimal efficiency. Same goes for stretching. A well rested brain is more able to digest and remember information. You get the gist…

You may have noticed that these things can all be done without going near an electronic device. That is by design. Developing is often a series of “Aha!” moments (in between long periods of “I’m an idiot” moments) and experience has told me that achieving that “Aha!” is usually done after taking a break from the problem.

Have fun, I’m heading outside.

Deaf in the software industry

Deaf in the software industry

Deaf insights

Not a technical post, but hopefully still an interesting one. I want to take you through a quick tour of some things I’ve experienced (good and bad) as a software engineer, specifically from the perspective of someone who has drastically lost their ability to hear over the last few years. NOTE: I’ll use the audiological term deaf in this post but it’s worth noting that there are differences between deaf, Deaf and Hard Of Hearing.

My hearing

A lot of this post is going to apply to others but some bits might be more significant, depending on the person’s hearing levels. For reference, my hearing (or lack of!) consists of high frequency deafness, which I’ve had as long as I can remember, as well as severe loss in the other frequencies caused by Ménière’s disease. I lost around 90% of hearing in my right ear about 5 years ago and had a similar loss in my left over the past year. Since then I’ve managed to gain a fraction back in both ears but I still require hearing aids on both sides, with supplemental lip reading, to maintain a conversation.


Anyone familiar with “Agile” development will be aware of standups, where everyone in a team gathers to quickly chat about what they’re working on and any obstacles they might be facing. Open communication is key in the Agile world. Unfortunately when you’re deaf, hearing 5-10 other people in a meeting room, which might have funny acoustics and/or AC on, can be tricky. I’m lucky that I have an understanding team who will take care to make me aware of what they’re talking about but sometimes even that isn’t enough.

For any deaf SEs out there, I recommend firstly making your team very aware of what level your hearing is at. Secondly, just like with normal group conversations, make sure to find a position in the room that facilitates hearing what you need to hear – this might require standing where you can see the most faces or perhaps beside the quieter speakers. If I’m having a particularly low hearing day and I can’t hear someone who’s talking to me directly then I’ll just walk over to them and ask them to repeat what they said.

For the hearing SEs reading this, if there is someone in your team who is deaf, be sure to make yourself seen as well as heard. Speak clearly and loudly. Move closer to your other team members if necessary.

Call me maybe

Standups aren’t the only meetings we have to deal with. Like it or not, they’re a fact of software life. If the company you work for is global, then you’ll also have the dreaded conference calls. Luckily, compared to a lot of industries, we have tools that make it way easier for deaf people to participate. GoToMeeting software or other video conferencing means there can be a visual element to calls. Slack or similar chat programs are ubiquitous in most development shops. For me, I couldn’t live without both of these. I occasionally have to attend calls that are audio only but they really zap my energy because I have to spend a lot of effort just trying to extract the meaning out of what’s being said. With a video conference, where there are slides, or a demo, I don’t have to focus quite as hard on the audio as the visual cues will help cover what I miss. Chat software like Slack solves the problem in a slightly different way – it allows me to gather some pre meeting info from one or more participants, so again I can expend energy more efficiently during the meeting itself.

Quick side note here for any recruiters out there. Try to be conscious of candidates that prefer written or face to face communication over phone calls. I love my job and don’t foresee any change of job in the near future but if I were invited for a phone screen or told that I could only find information on a job via phone, both of which were fairly common when I was on the job hunt, then I’d potentially be put off because I know I might miss out on important information.

Syntactic sugar

The company I work for has a great cutting edge tech stack and is always willing to use a new tool if it will solve a problem better than the existing offerings. This is awesome! I can learn new stuff and it helps me do my job better. However, being deaf, new terms or methods can cause a bit of a headache. If I’m chatting to my coworkers and someone suggests some cool AWS gizmo to store our data more robustly, I’ll make a mental note to do a quick review of any domain specific terms once the conversation is finished. This helps me as an engineer because I can do some investigating into whether I think it’s a worthwhile move but it helps me more as a deaf person. How? Next time that tech, or the terms that surround it, come up in conversation I won’t have to do as much mental gymnastics to decipher what’s being said and I can just concentrate on the content of the conversation.

Deaf not dumb

Related to the last point, I’ll often make people “explain like I’m 5” when I want to be absolutely clear of the point they’re making. I’m pretty methodical at times so my colleagues need to be quite patient but in the end everyone benefits. I’ve been developing long enough to know that one of the most lethal blows to a software project comes in the form of assumptions. In my opinion, clarity is paramount.

Music to my ears

Being deaf definitely isn’t bad; it has some surprising upsides. One great thing is that I don’t need to stick headphones on to get in the zone. The hustle and bustle of a normal workplace can easily be ignored when it barely registers above silence. You could argue that this means I might look more approachable and therefore might get more interruptions but I find I’m more productive if I take occasional breaks from my screen anyway.

1 on 1

Sometimes the trickiest encounters are the simplest for most people. Ever pair program? It’s a great process for working through a non trivial task. Unfortunately, it can be a bit more work when deaf. If someone else is driving then they’re probably going to be looking at the screen, meaning their voice isn’t carrying towards me and I can’t see their mouth properly to get a bit of lip reading in. If I’m driving then I’m probably looking at the screen, meaning I have to keep turning back and forth to hear what my co-pilot is saying. I still encourage it in my team and try to pair program when it suits because I feel overall the pros outweigh the cons.

Programmers have this reputation of being socially awkward. I’ve found the opposite to be true in the majority of cases, though maybe I’ve been lucky. With that said, I do find a lot of people in the industry quite soft spoken. If you’re one of those people, please make an extra effort when speaking to someone like me in future. Also, try to recognise when someone has an issue communicating, in whatever way. Everyone in my work knows I’m the deaf guy, so they’ll really go the extra mile to communicate, but occasionally someone from a different office will travel over and there can be an initial fumbling through a few conversations until it sinks in that I’m not kidding when I say I’m deaf.


I’m convinced that lack of hearing is not a disadvantage but it obviously does provide unique challenges in life. Hopefully this post has shed a little light on the subject. Reading this back I’m wary of painting a negative picture. This industry is really great for deaf people, especially if you’re surrounded by the right people in a supportive company.

Tell your friends to learn CS with edX’s (MITx) course on learning to program

There’s a great course doing the rounds for anyone looking to learn CS/programming. It uses Python and is taught by MIT. Most people who stumble across this blog probably won’t use it as it’s fairly basic, but it’d be a good idea to share it to any friends/relatives who have been looking to learn a bit of programming. It’s currently in week 2 so the discussion boards etc. will be a hive of activity for anyone who will need help as they go.

You can check it out here.

How to steal any developer’s local database

Stumbled across this on Hacker News. The summary is quote worthy:

This proof of concept shows why computer security is incredibly hard to get right. The attack depends on multiple software products all making very reasonable decisions about how they should work, but the way they interact with each other leads to a vulnerability.

The example, especially from a dev’s perspective, is beaut:

Source: How to steal any developer’s local database

Vim text objects in zsh

Vim, not Vi, on the command line

“Vi mode” is well known about. In bash or zsh, it’s possible to move around much in the same way you would in vi (e.g. b goes back a word). What isn’t as well known, is that zsh, 5.0.8 or later, offers support for visual mode and text objects. For anyone who hasn’t yet seen the vim light, this might not mean much but read on…


Say I have a command to create a new git branch but upon copy/paste I notice an error:
git checkout -b CREATURE-my-new-feature
I’m an idiot. That should say FEATURE as per my team’s branching convention. Ok, so in emacs or vi mode I can move back to the “C” in “CREATURE” easily enough using M-b or b respectively but then what? zsh’s Vim text objects allow me to make the corrections in a vim like manner:

  • ciwFEATURE rewrites CREATURE as FEATURE.
  • Even better, ctEF changes to E with an F. This makes the same amendment in a more succinct way.
  • If I wanted to rename the whole branch with something completely different then I could ciWnew-name. (Notice the capital W to change the major text object).

Shell settings

If bash is your shell of choice, then I still recommend trying vi mode for a while, even if it isn’t as fully featured as zsh’s version:
bash setting: set -o vi
zsh: bindkey -v

WTF is a text object

As usual, I’m jumping straight to the point. If you haven’t stumbled across text objects in Vim yet then I recommend opening it up and trying the command:
:help text-objects
Alternatively, there’s a great post here that explains text objects in detail!

Hello World

I’m not usually a fan of tradition but I can’t help but kick things off with:

Hello World

As per the “About” section, this blog is a collection of various musings, thoughts and rants about various software topics. I’ll try to provide as much insightful material as possible in short, digestible nuggets.

If a topic warrants more depth, I’ll try to spread it across multiple posts. Each part shouldn’t exceed “coffee length”. I encourage discussion, debate, questions or anything else that might help me or others learn.