-
Find me a Friend – Social Networks and Graph
Introduction In the last post I discussed how certain recommendation algorithms work – with the examples being various ways in which you could code a movie recommendation. I thought what would be interesting is to take another approach to this kind of problem and demonstrate an approach for how a social network identifies people who…
-
What should I watch tonight – Movie Recommendations
Introduction Its cold, very cold. There little better to do in early January than sit at home and watch TV, except no one really watches TV live now (sport aside), we all use streaming services such as Netflix or Amazon Prime. Last night I found myself wondering – how does the recommendation system in this…
-
Doubling Down – The Martingale System
We all know Christmas is an expensive time of the year, perhaps it is due to this that I have spent a little time looking into a gambling strategy, with the hope I can recoup all my expenditure from this period. I clearly must be desperate as this has lead me to look at a…
-
Leetcode – 3sum
Well… I wasn’t born with the talent of a premiership footballer, so this will likely be the only 3sum I get. This is another Leetcode problem, it builds upon the 2sum example (see the previous post) but adds one more number (obviously) and some more conditions, which significantly increase the difficulty of the problem being…
-
Leetcode – 2sum
After a period of inactivity due to working full time on a project (this was enough coding for me), I am back writing some articles. After a week and a half away from work over the Christmas period I quickly fell into the familiar seasonal pattern of not really knowing what day it is, with…
-
Databricks – Connecting to GitHub
Introduction This post will continue to be on the theme of Databricks, the posts so far have shown an introduction to spark / data bricks as a concept and a couple of administrative tasks (creating a service principal / mounting / accessing storage). This post is similar in nature. It will show how you can…
-
Databricks – Mounting Storage and Importing Files
Introduction In my last post (Learning Databricks – Accessing a Data Lake Using a Service Principal – Cookie Codes). I described the process for setting up a Service principal in Azure and how you can store its credentials securely and access them via Databricks. This post is going to continue from this point and use…
-
Learning Databricks – Accessing a Data Lake Using a Service Principal
Introduction One of the first tasks to learn when using Data bricks is how to access data contained in a data lake. I will be using Azure as my cloud provider in these posts and therefore my data lake will be Azure Data Lake (gen2). This post will show the necessary steps that you need…
-
The Data LakeHouse – Introducing Databricks
Introduction One of the goals in making this blog was to allow me to have a space to learn new technologies I haven’t used much in the past and hopefully provide interesting examples to help others learn these technologies. I have never used Databricks before but have heard a lot about it, I simply just…
-
Machine Learning – Predicting Fatalities on the Titanic
Introduction This is a sequel to a post I wrote on the Data Analysis of deaths on the titanic and any correlations that can be drawn from them. I recommend you read that post before you read this one. The aim of this post is to use the same dataset to build a model that…
-
Iceberg Right Ahead – Analysing Titanic Survival Chances
Introduction The Sinking of the titanic is one of the most famous events of the last century. The “unsinkable” ship sinking on its maiden voyage was a truly humbling event and the introduction of radio / telegram at the time allowed the story to be relayed around the world. Datasets detailing the list of passengers…
-
Turtle – Learning to code with drawings
Introduction I am currently stuck indoors suffering with Covid, this is especially unfortunate as I am overseas on holiday, with few better options I decided to play around with the Python Turtle library. What is Turtle? When I was at school (a long time ago) there was a language we used on the computers called…
-
Unstructured Data to Structured – JSON Normalisation
Introduction I had a job interview today and one of the topics that was raised was importing JSON based data (which can be considered as unstructured) into a table format (structured). I offered a few ways of how this could be done and I think answered the question appropriately, but the interviewer said a number…
-
Benford’s Law
Introduction Let’s speculate on a distribution involving the population of cities. We will look at only the first digit of the population size. So for example greater London has 9 million people living in it. the first digit is therefore 9. If we took the first digit of each capital city, how do we think…
-
Automate the Boring Stuff – DevOps
Introduction The fun part of being able to code is well… the coding right? (provided it works) but in reality so many developers spend a minority of their working day writing code, there are meetings, phone calls, lunch (ok that bit isn’t bad), and all the work around building, testing and deploying software. An approach…
-
Cracking Wordle
In my previous post. I explained how you can code the NY Times puzzle game Wordle in Python. I recommend reading the previous post (Coding Wordle) if you are unfamiliar with how Wordle works. My sister is a fan of this puzzle and told me she could only play it once a day on the…
-
Coding Wordle
Christmas is a strange time of the year, often you feel like you’ve gone from rushing around in chaos to sitting down with little to do. My Christmas is often like this. This year my sister was doing an online puzzle called Wordle but having completed it I asked – is that it? To which…
-
Fake it Till you Make it
Unit testing is part of the development process, where a developer will write some tests to check if the basic functionality of their code is correct or not. Lets have a look at some very basic functions. Here we have 2 methods; so lets write some unit tests for these – we want a test…
-
What If Analysis – Power BI
A couple of posts ago I showed the creation of a data model in Power BI, from start to finished and produces reporting showing expenditure vs budgets for personal bank accounts. This was quite interesting and showed how once the model is created within power BI basic reporting can be produced very fast. But what…
-
Everyday I’m Shuffling.
I read an article the other day explaining that Spotify changed it shuffling algorithm due to a large amount of user feedback suggesting it was repeating songs by the same artist frequently or playing the same song twice. A company like Spotify has a huge amount of engineering talent, so I was confused as to…
-
Modelling Personal Finances in Power BI
Introduction Microsoft Power BI is a platform Microsoft provided that allows for self service BI work. It is a mistake to think this software simply generates reporting, the central aspect of Power BI is the ability to create a dimensional model representing various entities of a business process. It is a software I have some…
-
Stick or Twist – the Monty Hall Problem
In Season 4 Episode 9 of the comedy show Brooklyn 99, two characters fall out over a debate around a probability problem. The problem is known as the “Monty Hall problem” due to the fact it was made famous on a game show named “Lets Make a Deal”. Initially I was a little confused into…
-
A Computer Whoops me at Drumming
A couple of posts back I highlighted how in one way you are better at maths than a computer (You are Better at Maths Than a Computer). And now it appears my computer hasn’t taken this well and has now decided to humiliate me at something I like to do, playing the drum kit. Sonic…
-
Creating a Classic – Snake
I once owned a Nokia 3310 (showing my age a bit here). This phone was and still is class for several reasons; Now obviously compared to modern games Snake is rubbish, but as a kid in school in the late 90’s it was class. How Does the Game Work Snake is a really basic game.…
-
From Ceasar to the Nazis – How to keep a secret
I can remember at school there were two girls who passed each other notes all the time, once the teacher took the paper off them but couldn’t make sense of it as it was written in code, some kind of arrangement they had made with each other. In some crude way that transaction was encrypted.…
-
You are Better at Maths Than a Computer
Ok… this claim is a bit tongue in cheek but let me demonstrate one way of how you are “better at maths” than a computer. Let’s consider the following piece of code in Python. What do you expect to be printed (0.1+0.2)?0.3 right? we know 0.1 + 0.2 = 0.3.Well……………… The output of this code…
-
Is the Lottery Fair?
We all dream of winning the lottery and the life changing opportunities this would give us, the houses, cars and holidays. But how likely are you of winning the lottery if every number drawn is random? And how do we know it is a random chance? are there potentially exploits where some numbers are more…
-
Data Analysis – Airbnb in London
Let’s for a minute imagine a wonderful parallel universe – where a decision I need to make is where should I buy a property in London to rent out on Airbnb (for those that don’t know me this is about as far fetched as it gets). How could we do this? We would need some…
-
Convert a Number to Roman Numerals
I was on the LeetCode website earlier today, more often than not the problems on this site scare the living hell out of me, however one caught my eye and I naively thought “that can’t be that hard can it?”, you’d think by now I’d know better than that, but the problem felt solvable and…
-
Sudoku Solver
Yesterdays post was about backtracking and to milk as much as possible from this topic I thought I would demonstrate another example of how this can work. I failed to do a Sudoku from the newspaper this morning and thought – hang on, could I use backtracking to solve it for me. How Sudoku Works…
-
8 Queens Problem
Recently I downloaded and played the excellent game “Human Resource Machine” (Human Resource Machine) – this one must have passed me by without me noticing it as it was released in 2015. In this game you instruct a character to solve various problems using an assembler type language. It starts off easy and then goes…
-
Welcome to Cookie Codes
This site exists as a way of me recording snippets of code or projects i’m working on. The intention is to motivate me to play around with different software/problems than I would in my day to day job and show some progress/thoughts I have on these.