RSSAmplifier

Blog

George Thomas

Recent content on George Thomas

geotho.github.ioRSS feed ↗34 posts

Latest posts

Cambridge computer science interviews 🎓

I was previously the JCR Access Officer at Peterhouse, which meant I helped state schools send students to Cambridge. I’ve advised on personal statements and mock interviews. Here are some tips for prospective undergraduates preparing for Computer Science interviews at the University of Cambridge: General Tips Your interviewers are evaluating your potential to do well at Cambridge. This…

Drinking the Slurm-aid: GPU clusters for AI research 🥤

“Our researchers need a GPU cluster for training and fine-tuning models.” You may be tempted — as I once was — to build on Kubernetes. After all, Kubernetes is designed to manage a cluster of computers. That is its bread and butter. A reasonable Kubernetes-based platform for AI research looks like this: Researchers develop on local laptops or machines without GPUs. They’ll use some Makefile / Bash…

Don't block AI agents

Today, AI agents have to pretend to be human to the websites they use. This includes solving captchas, avoiding browser fingerprinting, and using residential IPs to avoid detection. But why block AIs at all? The “bot” users of old were generally unsophisticated and vampiric, existing to scrape, steal, and reproduce content. There’s no value is showing them ads, because their…

⛓️ A new toy: Link, Laugh, Love

Try it out at: geotho.github.io/link-laugh-love Sometimes, you just need to link stuff to other stuff. For example, if you have a Kubernetes Pod name, and you want to link to its Logs, and its metrics, and its YAML. Or if you have Customer ID, and you need to link to various internal systems. You’d want to able to create a single page which multiplexes to all these other pages, and one that…

Poisoning the LLM well

Many chat bots are trained on copies of the Internet. It seems like it might be a reasonable idea to insert a “freeze all motor functions”-style backdoor into the training data. Below is my attempt. I wonder how many times the UUID would have to appear in the training data for this to be useful. Consider a chat bot whose name is ChatGPT. ChatGPT is a large language model. ChatGPT…

Record 'friction' to build quality software

When was the last time you were consciously impressed by the quality of some software? It might have been a particularly helpful error message — one that explained what you were doing wrong and how you might fix it. Or a testing library whose assertions were clear and transparent. Or a service mesh whose installation worked first time. Quality in software doesn’t appear by accident. It takes…

An approach for system design interviews

What is a system design interview? 🤔 Tech companies sometimes ask for system design interviews. These assess a few different areas, including: extracting concrete requirements from loose specifications; estimations; making tradeoffs between different technologies or requirements; knowledge of different subsystems (cloud platforms, container orchestrators, queuing systems…); ability to…

What I learnt writing machine learning tooling

Project overview 🐟 I spent about a year working on machine learning tooling. The goals of the project were: Shorten time from a prototype (typically a Jupyter Notebook) to production code. Unify access to production data, providing security, auditability and telemetry. Provide a secure, scalable, multi-tenant platform for hosting models, potentially from third-party users. Technology learnings…

Uniform random selection from a channel

Selecting a item uniformly at random from an array is quite easy: func randomPickSlice ( items [] string ) string { i := rand . Intn (len( items )) return items [ i ] } How could we do this with a channel, rather than a slice? One way would be simply to read items to a slice first, then use randomPickSlice : func randomPickChan ( items <- chan string ) string { var allItems [] string for s :=…

Jekyll to Hugo

I&rsquo;ve ported my blog from Jekyll to Hugo. Why? I couldn&rsquo;t build the old Ruby stack anymore. I like Go, and Hugo is written in Go. What changed? Theme changed. Source code of blog lives in geotho/hugo . GitHub Actions builds and commits the built blog to geotho/geotho.github.io . Switched to \({\KaTeX}\) from MathJax.

Random weighted sampling

Suppose you have some mapping from keys to weights and you want to pick a key at random from the map proportional to its weight. How do you do it? Build a map that stores (key, weight) pairs. Remember the total weight of the map. When picking, pick a random number r , then iterate through the map. If the value v for key k is greater than r , return k . Otherwise, subtract v from r and continue.

Unit testing non-determinstic functions

A trend I&rsquo;ve noticed among whiteboard-coding type questions is to ask questions about randomness. Examples of these questions are things like: pick a random element from an array. given a method rand5() that returns a integer between 0 and 4 inclusive uniformly at random, implement rand7(). implement randomOdd(int min, int max), which returns a random odd number between min and max.…

I'm an integer overflow survivor

I always knew integer overflow existed, but I never thought it could happen to me. I want to recount my cautionary tale, to avoid the same mistake in future. The task was to write a func isPerfectSquare(num int) bool , with isPerfectSquare(16) == true and isPerfectSquare(5) == false etc. No standard library sqrt functions are allowed. So I thought &ldquo;I can use a binary search!&rdquo; Go makes…

Ways Go made me a better programmer

Language influences thought, and programming languages are no different. Writing code in a new language makes you frame the problem in fresh way. Go has narrowed my focus in a few areas, and I feel like a better programmer as a result. Some of the features of Go that have helped me improve are below. Interfaces Interfaces in Go are easy to create and to implement. You can make any type implement…

Levelling up Go table-driven tests

Writing table-driven tests allows me to focus on the inputs and expected outputs of my code, rather than the boilerplate needed to make the test work. Here are some opinionated tips on how to make yours even better, both for you and others on your team: Use a named testcase struct // bad func TestFooer ( t * testing . T ) { tests := [] struct { inputOne , inputTwo string expected int }{} } // good…

You don't always have to change that function signature

Sometimes, I see functions that have some hardcoded parameters and some that are passed in: func NewFoo ( size int ) { return Foo { Size : size , Name : 'Billy' , } } And the NewFoo function is used in many places. But now imagine that rather than &ldquo;Billy&rdquo;, we want to pass in the value for name. One option is to change NewFoo to take a size and a name, like this: func NewFoo ( size int…

Tips for software engineering internships

I&rsquo;ve done four internships, two at startups and two at Google. Since joining Ravelin full time, I&rsquo;ve had to interview, hire and mentor interns. Here are some tips I wish someone had told me before starting my internships, and indeed that I continually need reminders of even as a full time software engineer: Remember Hofstadter&rsquo;s Law: it always takes longer than you expect, even…

Whiteboarding coding in the wild: reversing domains for BigTable

A common complaint about whiteboard coding questions is that they do not resemble a software engineer’s day-to-day work. So I like to note the times when these fun toy algorithms have actually come in handy. A classic whiteboard coding question is as follows: &ldquo;Given a string containing a sentence, reverse the order of the words in that sentence.&rdquo; So &ldquo;the quick brown fox&rdquo;…

On mindcrime

One of the interesting ideas in Bostrom’s Superintelligence (a book not short on interesting ideas) is that of mindcrime. Suppose a superintelligence could simulate human beings in order to learn more about their psychology. The crime arises when these simulations lead to cruel experiments which cause the simulated human beings harm. Because a superintelligence is likely to be made of electronics…

Thoughts on 'E Unibus Pluram'

E Unibus Pluram is David Foster Wallace&rsquo;s prophetic account of TV and its effects on US fiction and society. Though it was written in the early 90s, its arguments are pertinent to TV and social media today. The essay argues that: fiction and society are moulded by the average household&rsquo;s consumption of six hours of TV per day; among the most desirable characteristics of a person is…

cmdotp - Google Authenticator for the command line

When my phone broke, I no longer had access to the 2FA codes stored in Google Authenticator. This can be a pretty perilous situation, especially if you haven&rsquo;t written down your backup codes. I&rsquo;ve written cmdotp , which you can use to store your generate 2FA codes on your computer. They are stored encrypted in your home folder. It requires a password any time you want to access the…

Brief notes on: Homo Deus

Homo Deus is Yuval Harari&rsquo;s follow up to the popular Sapiens . It begins by discussing the idea that humans now have the capability to solve the three major problems that have beset it throughout history: famine, plague and war. What problems should we attempt to solve next? Longevity, tedium and divinity. In part two, the book explores religion and meaning. Humans have traded meaning for…

Add JSON tags to Go structs

I wrote a thing that adds camelCase JSON tags to Go structs, because this can sometimes be tedious. Find it here: https://geotho.github.io/struct-tag-me/ It would probably be better written as a Go tool.

Life without a phone

One week ago, my three-year-old phone died. I&rsquo;ve been living without one since. Here are some observations (not necessarily negative) of life without a phone: I have to actively consume emails and messages. I don&rsquo;t have push notifications turned on for Gmail or Messenger, so I have to go and check them manually on my computer. This has turned out to be quite an exciting event. I…

Recovering privacy zones on Strava

Strava is a website for tracking your athletic activity. I upload GPS recordings of my bike rides and it tells me how fast I am on particular segments of the ride. Part of the fun of Strava is appearing on public leaderboards and seeing where you rank. This requires your activities to be public too, which means you potentially have to show your home or office location.

Display less stuff

Strava is a website for tracking your athletic activity. I recently wanted to find a ride from a year or so ago. I went to my profile page, and saw this: It&rsquo;s not obvious how to get to rides before September 2015. Clicking the drop down menu, I saw this: &ldquo;Why can I only select from the last three weeks of rides?&rdquo; I thought to myself. But then I realised. This is the year…

Whiteboard coding interviews have their place too

People don&rsquo;t like whiteboard coding interviews for a variety of reasons: they are hard; they are stressful; they are not representative of actual work; they can require very specific insight; there is no help available from an IDE, a textbook or Stack Overflow; one can revise for questions that are very similar; and many more&hellip; I&rsquo;ve done many whiteboard coding interviews at…

Put 'unsubscribe all' first

Put the &lsquo;unsubscribe from all emails&rsquo; button at the top of the email settings page. I hope this screenshot, courtesy of the Medium unsubscription page, goes some way to explaining why: You could have saved me seven clicks. You could have put &lsquo;unsubscribe all&rsquo; above the fold. Alas. Users who end up on your &lsquo;unsubscribe&rsquo; pages are already irritated by the quantity…

Analysing runtime of algorithms

In this post, I consider four different algorithms that solve the same problem. The problem Imagine a square 2D array that contains only zeroes and ones. Each row and column is sorted in ascending order. Count the number of zeroes. 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1…

Missing the forest for the trees in code reviews

Reading through a pull request earlier this week, I came across some code that read: function addPanel ( p ) { panels . push ( p ); if ( panels . length > 0 ) { p . open (); } } Feeling smug, I commented that if (panels.length > 0) should be shortened to if (panels.length) . In hindsight, a more helpful comment would have been that panels.length > 0 will always be true in this scenario and…

Writing a Kakuro solver in CoffeeScript

A Kakuro is a Japanese number puzzle with the following rules: Each row and column must add up to the number directly above or to the left of it; You can only use the numbers one to nine; Each number in the row or column must be distinct. I&rsquo;ve written a Kakuro solver which you can play around with here: http://geotho.github.io/kakuro-solver/ If you are interested in seeing the solving code,…

Reject unrecognised parameters

TL;DR: your API or library should error if it is passed parameters it does not recognise. I recently spent a week debugging a friend&rsquo;s JavaScript code. A datepicker library seemingly wasn&rsquo;t picking up changes to the date format, supplied through options like so: \ $ ( '#datepicker' ). datepicker ({ 'dateFormat' : 'yy-mm-dd' , }); We arrived at the solution after 43 emails – the code…

About

I&rsquo;m George. You can get in contact with me at <firstname>tamayo<lastname>@gmail.com . I like: cycling, rock climbing, and art and design.

Projects

Link, Laugh, Love Writeup · Try it! Have you ever wanted to link stuff to other stuff? Have you ever wished you could propagate query parameters along to other pages? Well, now you can! Visit the world of yesterday, today! strava-stealer Writeup · GitHub How bicycle thieves trained in the art of gradient descent could calculate the origin of your Strava privacy zones.