Home » Archives for Mark Needham » Page 2

Author Archives: Mark Needham

AWS: Spinning up a Neo4j instance with APOC installed

One of the first things I do after installing Neo4j is install the APOC library, but I find it’s a bit of a manual process when spinning up a server on AWS so I wanted to simplify it a bit. There’s already a Neo4j AMI which installs Neo4j 3.2.0 and my colleague Michael pointed out that we could download APOC ...

Read More »

Serverless: S3 – S3BucketPermissions – Action does not apply to any resource(s) in statement

I’ve been playing around with S3 buckets with Serverless, and recently wrote the following code to create an S3 bucket and put a file into that bucket: const AWS = require("aws-sdk");   let regionParams = { 'region': 'us-east-1' } let s3 = new AWS.S3(regionParams);   let s3BucketName = "marks-blog-bucket";   console.log("Creating bucket: " + s3BucketName); let bucketParams = { Bucket: ...

Read More »

Pandas/scikit-learn: get_dummies test/train sets – ValueError: shapes not aligned

I’ve been using panda’s get_dummies function to generate dummy columns for categorical variables to use with scikit-learn, but noticed that it sometimes doesn’t work as I expect.               Prerequisites import pandas as pd import numpy as np from sklearn import linear_model import pandas as pd import numpy as np from sklearn import linear_model Let’s ...

Read More »

Neo4j: How do null values even work?

Every now and then I find myself wanting to import a CSV file into Neo4j and I always get confused with how to handle the various null values that can lurk within. Let’s start with an example that doesn’t have a CSV file in sight. Consider the following list and my attempt to only return null values: WITH [null, "null", ...

Read More »

Go: Multi-threaded writing to a CSV file

As part of a Go script I’ve been working on I wanted to write to a CSV file from multiple Go routines, but realised that the built in CSV Writer isn’t thread safe. My first attempt at writing to the CSV file looked like this: package main     import ( "encoding/csv" "os" "log" "strconv" )   func main() { ...

Read More »

Go vs Python: Parsing a JSON response from a HTTP API

As part of a recommendations with Neo4j talk that I’ve presented a few times over the last year I have a set of scripts that download some data from the meetup.com API. They’re all written in Python but I thought it’d be a fun exercise to see what they’d look like in Go. My eventual goal is to try and ...

Read More »

Neo4j: Graphing the ThoughtWorks Technology Radar

For a bit of Christmas holiday fun I thought it’d be cool to create a graph of the different blips on the ThoughtWorks Technology Radar and how the recommendations have changed over time. I wrote a script to extract each blip (e.g. .NET Core) and the recommendation made in each radar that it appeared in. I ended up with a ...

Read More »

Go: First attempt at channels

In a previous blog post I mentioned that I wanted to extract blips from The ThoughtWorks Radar into a CSV file and I thought this would be a good mini project for me to practice using Go. In particular I wanted to try using channels and this seemed like a good chance to do that. I watched a talk by ...

Read More »