Last month we looked at how cosine similarity works and how we can use it to calculate the "similarity" of two vectors. But why choose cosine similarity over any other distance function? Why not use Euclidean distance, or Manhattan, or Chebyshev?| Tom Hazledine
Look up "how to compare vectors" and cosine similarity will be the most common (if not the only) approach you will see. I've been working with vectors a lotlately in the context of LLM embeddings, and being able to measure how similar any two embeddings are has become an important part of my workflow. But how does the cosine similarity process actually work?| Tom Hazledine
Improving or comparing search algorithms requires being able to objectively test their performance. How on earth do you actually do that?| tomhazledine.com
Unpicking an ISO Week conundrum leads into a pit of JavaScript date madness.| tomhazledine.com
Despite often describing myself as a "typography nerd", there's not all that much evidence of my font-nerdery on these pages. And given that I'm a vocal proponent of making sites small and fast, it's doubly damning that I've never given much thought to the way webfonts are applied to my own site.| Tom Hazledine
The cover art of Joy Division's debut album, Unknown Pleasures, is about as good as it gets. It's instantly recognisable and a perfect example of how a simple, abstract image can become iconic. And because it's both simple and data-driven, it feels like a great candidate for recreating with code.| Tom Hazledine
Turning an SVG chart into a general purpose web component| tomhazledine.com
RSS is “having a moment” right now, and I’m 100% here for it. Well, maybe folks aren’t explicitly excited about RSS specifically, but an independent and open Web (a Weird Web, even?) is being talked about a lot. Burned by recent trends in [looks around]everything, we’ve realised that having some degree of control over the way our content is distributed is actually quite useful.| Tom Hazledine
A strange thing just happened. I was starting a new web project and setting up my build pipeline (and yes, I'm the kind of nerd who enjoys that kind of thing), and I didn't import my boilerplate .scss templates. This is probably the first time I've not started a project by importing Sass in, oh, about ten years.| Tom Hazledine
Embeddings are long lists of seemingly inscrutable numbers created by an LLM, but if you're prepared to lose a little precision you can force them into 3D space where they're a little easier to comprehend and explain.| Tom Hazledine
This is a list of a few things I’ve learned while publishing my JavaScript shenanigans on npm. Or, more accurately, it's a list of things I’ve banged my head against while trying to publish on npm. Some of it is logical, some of it is inscrutable. All of it was necessary. I’m documenting it here so that next time I go to publish something I can avoid going down a hundred-open-tabs search-engine rabbit hole (again!).| Tom Hazledine
I've been having a lot of fun lately with embeddings. They are a somewhat-overlooked sideshow to the current GPT/LLM/AI circus, but in my view they are even more interesting than the headline-grabbing chat apps. And unlike the the chat interfaces, embeddings are a way to make LLMs actually useful without any of the worries about "hallucination" or just-plain-wrong content.| Tom Hazledine
Scatter plots are a fun way to visualize data, showing both the relationship between two variables and the distribution of data points. And they're reasonably trivial to create in web-friendly SVG (especially if you get a library like D3.js involved). One issue, though, is hover interactions.| Tom Hazledine
I've burnt thousands of hours playing Minesweeper over the years, and my preferred method of keeping things interesting was to add a mine everytime I completed the grid. I often wondered if someone would automate this process, and (as is the way of all software nerds) I inevitably decided to do it myself.| Tom Hazledine
In 1975 Brian Eno and Peter Schmidt released their Oblique Strategies; "Over One Hundred Worthwhile Dilemmas"| Tom Hazledine
Let’s be honest, by this point you’re either addicted to Wordle1 or sick to death of hearing about it. And yes, I'm shamelessly using Wordle as click-bait for this post. Having lured you in with the promise of Wordle-insight (which I will deliver!) I'm going to try and get you excited about writing tiny scripts.| Tom Hazledine
I'm in the getting-to-know-you phase of a new job, and it's got me thinking about the aspects of my work-personality that I've deliberately chosen. I'm sure I've got plenty of inadvertent character traits that I've no idea of or control over (for good, I hope, but also inevitably for bad). But there are few I've consciously tried to foster, and the biggest of them is humility[1].| Tom Hazledine
We're in the setup-and-planning phase of launching a new podcast at my new job, and once again I found myself sharing my Podcast Equipment 101 tips with a team who are interested in podcasting but have no prior experience of working with audio. This is not the first time I've written a guide like this, so I'm publishing this one here for posterity (mostly so I don't have to type it all out again next time).| Tom Hazledine
A while ago I wrote an article about the Web Audio API with an interactive demo. The primary visualisation for that demo was a series of graphs that displayed the live frequency data of the sounds made by the demo. Since then, several people have asked about how the graphs were made and the answer is way too confusing when expressed at tweet-length, so this post is a full explanation.| Tom Hazledine
I've always struggled with finishing things, but lately I've found that forcing myself to release projects early has had some amazing effects. Flushed with that success, I'm going one step further and making myself publicly accountable for things I'm planning to do.| Tom Hazledine
Over the last year I've fallen in love with making music again, and it's all thanks to modular synthesisers. But to understand why this is such a big step for me, you need to know just how surprising it is that I'm now "in to" electronic music.| Tom Hazledine
For 2019 I experimented with an alternative to a traditional new year's resolution: a "Yearly Theme". It was such a success that I repeated the process in 2020, and now I'm laying the foundations for my "theme" for 2021.| Tom Hazledine
I'm trying out a "recipe blogger" style of writing[1]. That is to say, I'm going to share a simple set of technical instructions but first I'll tell you a rambling story about how this recipe reminds me of how butterflies sip dew from the golden whatever high atop the thing... Unlike food bloggers, however, I'm self-aware enough to include handy section links so you can choose your own adventure.| Tom Hazledine
In this post I'm going to show you how to use JavaScript to recreate a delay pedal. A delay pedal is something that you'd place between a guitar and an amplifier to add a delay effect to the signal from the guitar. They're a relatively common piece of musical kit, and I'm going to recreate one in the browser.| Tom Hazledine
Dark mode has been around in operating systems and web browsers for a while now, but it wasn't something I'd ever really cared about. But that all changed when my brother implemented a dark-mode stylesheet for his (seldom updated but excellent) blog, edthecoder.dev. In a true spirit of "anything you can do, I can do better", the sibling rivalry kicked in and I knew I had to implement dark mode on my own site. If a "mere" backend dev could implement a solid dark mode, surely a "frontend expert...| Tom Hazledine
Announcement: from this week onwards, Podcasts for Nerds is switching to a fortnightly format. I want to stress that this is because I'm lazy, and not because I think you're lazy. A lot of the feedback I'm getting is that you folks don't have enough time to listen to the recommendations - and that's fine! The whole premise of this newsletter is that you can cherrypick the shows that appeal to you. Don't feel bad about saying to me "I don't really listen to many of them, but that one that I di...| Tom Hazledine
I've noticed I have to make a conscious effort to not have every recommendation be music-related. Thanks to discovering the world of modular synthesis I've fallen in love with music and music making all over again, and this is reflected in the podcasts I'm listening to. Is that a bad thing? My hobbies often come and go in waves, so we'll probably swing back to another topic in a few weeks.| Tom Hazledine
Bit of an eclectic mix this week, but I think that's fine. Sometimes have a unifying theme can be interesting, but more often than not it's just an arbitrary limitation. There's also been more big-money acquisition news in the world of podcasting this week... but hey, sometimes it's good to focus on enjoying the content rather than obsessing over the business model. (I will definitely return to obsessing over the business model next week 😛)| Tom Hazledine
This week I've been thinking a lot about podcasts that are no longer with us. With the current boom in podcasting (are we at "peak podcast" yet? Maybe...) I keep seeing lots of faux-stats about the survival rate of most shows. Proportionally, very few make it past more that a couple of episodes, and hardly any make it past ten. The long tail is long, but not very consistent. There have been plenty of shows, however, that had really good runs and made quite an impact on me, but which have now ...| Tom Hazledine
I've got another loosely-themed issue for you. This week's podcast recommendations are all about music. That said, I've often received a pretty strong "that's not music" response every time I've tried to play tracks by The Books to friends and family. And as for bleepy-bloopy modular-synth based stuff, the disgust and repulsion was even stronger. So your milage may vary but I think all this stuff is bona-fide music, and I love it.| Tom Hazledine
This week heralds yet more evidence that podcasting is becoming a serious mainstream medium. Podcasting has been bubbling under the surface for years (decades?) as a niche nerdy pursuit, but following Spotify's $230 million acquisition of Gimlet Media (a pioneering podcast studio who are responsible for quite a few shows that have featured in this newsletter) early last year, the stakes have felt a little bit higher. Then in May Spotify dropped $100 million to bring the execrable Joe Rogan po...| Tom Hazledine
Favour time! I would love to be able to include some testimonials on the Podcasts for Nerds homepage. If you're enjoying these emails, it'd be great if you could tweet one thing you like about them; "I like this newsletter because it summarises podcasts I'm too lazy to listen to" - that sort of thing. Include the hashtag #podcastsForNerds, and I'll embed them on the PFN site.| Tom Hazledine
We often hear that "discovery" is the biggest unsolved problem in podcasting. I'm trying to address that problem with this newsletter, and the very fact that you've subscribed means you're actively seeking out new podcasts to listen to. But beyond knowing what I do, I don't really know how people find out about shows. So tell me. Reply to this email and let me know the most common way you hear about new shows. I'll share the best tactics next week (spoiler alert: tactic #1 is "subscribe to Po...| Tom Hazledine
Most of the recommendations in this newsletter have been at or around the thirty-minutes-long mark. Many of you have commented that this is "just right" and probably "the best length of podcast to be recommending". So naturally I'm mixing it up for this issue. There's a long rambling chat about supply chains (my personal favourite podcast format!), and a short snappy tidbit that's been really well produced. Plus a show at the "optimal" length. But you tell me: reply to this email and let me k...| Tom Hazledine
At the start of the lockdown I asked my Twitter followers how their podcast listening habits had changed. The majority of responders said they were listening to fewer podcasts during the "new normal". A lot of people use their commute as podcast-time! Personally I've replaced the ~10 hours a week travel-time with ~10 hours a week staring-at-a-blank-wall-musing-on-the-futility-of-existence time, so I'm actually listing the same volume of podcasts as before. How have your listening habits chang...| Tom Hazledine
The boundary between podcasts and radio shows is blurry. If the BBC release one of their shows online, does it become a podcast? Objectively, yes; if it has an RSS feed of audio files then it is a podcast. But it's not really what I think of when I think of "podcasting". The constraints of Old Media are still there, whereas the main appeal of podcasts (in my view) is the lack of constraints. They can be as long as the creators feel they need to be (ideally letting the content dictate the leng...| Tom Hazledine
"Hacker" is a word with several meanings. In the vernacular, it's taken to mean a tech-savvy bad-actor; "a hacker broke into the bank's database", "the NSA mainframe was hacked", etc. But in the start-up sphere, it just means someone who is creative with technology; "she hacked together her MVP in the garage", "did you see that fantastic hack she made to fix that bug?". This week's issue of Podcasts for Nerds contains both types.| Tom Hazledine
Thanks for all the great feedback on the format of this newsletter! Keep it coming; it's really helpful. I promised myself I'd only make a website for this site if we could reach certain number of readers in the first two weeks. Thanks to you we've passed that mark, so now this list has a name ("Podcasts for Nerds") and a (placeholder) website: podcastsfornerds.com.| Tom Hazledine
Signup to my newsletter| Tom Hazledine
The Final Destination, Tales from the Tannoy (32mins, 2020-04-21)We probably hear the work of voice-over artists every day, but don't even notice them. Tales from the Tannoy is presented by Elinor Hamilton, the voice of the London Underground. The show interviews people whose voices we probably know but whose lives we know nothing about. This episode features Jon Briggs, the original voice of Apple's Siri and the voice inside many sat navs. He's charming and (obviously) has a fantastic voice,...| Tom Hazledine
Believe it or not, I've thought of something new to say about Bullet Journalling. I won't dive into the mechanics of what and how, because I've written about Bullet Journalling before (several times, in fact). If you're unfamiliar with the concept of Bullet Journalling, those posts are better places to start.| Tom Hazledine
Crystal balls and Coronavirus, The Numberphile Podcast (45mins, 2020-04-10)Numberphile is a YouTube channel for maths-nerds, and the spin-off podcast interviews leading mathematicians. In this episode TV-mathematician Hannah Fry looks back on the lessons learned (or not learned) from the 2018 BBC show Contagion (which she presented). That show was a remarkably prescient look at what a modern pandemic would look like. Find it hereThe idea, Backstage (28mins, 2020-04-27)Myke and Stephen run Rel...| Tom Hazledine
In case it's somehow escaped your attention, I've been having a lot of fun recording a podcast lately. It's a weekly show that we have been running for nearly a year and half now (which is something I'm rather proud of).| Tom Hazledine
As a developer who came of age at the dawn of Web 2.0, supporting semantic markup is something that I've always been in favour of. I've written in the past about how HTML doesn't need (much) styling to be perfectly functional. So I'm really enjoying the fact that today (April 9th) is "officially" CSS Naked Day.| Tom Hazledine
When sharing links on Twitter, there's a handy feature to make those links look prettier. Twitter "cards" will turn your simple text link into a rich card complete with an image and structured title and description data. Here's a recent tweet from my podcast's[1] account. When writing the tweet, we simply included the url https://aquestionofcode.com/52-what-gear-do-you-use/ in the text, and Twitter automatically added the card content.| Tom Hazledine
Every now and then I get "nerd sniped". Something (a link, an idea, anything) comes out of left-field and instantly becomes an obsession. Take, for example, Universal Paperclips. I stumbled on that link who-knows-where, and BAM! Three days' productivity lost, just like that.| Tom Hazledine
I have an obsession with static site generators. They help turn simple markdown files into a lean, mean, super-fast website. They're rendered at compile-time, so there's no server-side activity to slow things down. And because all the browser ever sees is static files, there's much less chance of your site being hacked. My favourite SSG is Eleventy (11ty), but I've been on a long journey to get here...| Tom Hazledine
Making predictions is a dangerous game, especially if you publicise them. Before this year's (2019's) Rugby World Cup, I was chewing the ear off anyone who'd sit still long enough: "I know how the world cup will turn out. I've made an algorithm!" Not only did I bore all my friends, exhaust my colleagues, and write up my predictions here on my blog... Not only that, but I actually put my hard-earned money on the line. So confident was I in my predictions, I made a series of bets. "Sure things"...| Tom Hazledine
I've been working on a rugby prediction algorithm for a while now. My basic premise is that the World Rugby rankings are a good indicator of past performance, but don't give the full picture when predicting future results. I've already visualised my predictions based on form alone, and the results look reasonable - so is there room for improvement?| Tom Hazledine
This year (2019) is a rugby world cup year. I like data visualisation, and I like rugby. So here's my primitive attempt to calculate the results of the pool stages of the 2019 World Cup. My simple heuristic is that world ranking (as of Aug 22nd 2019) is a predictor of a team's success. In effect, my simple algorithm states that a team with a higher ranking will always beat a team with a lower ranking.| Tom Hazledine
I’ve worked hard on my writing style, and continually reap the benefits of having done so. Email and instant messages take more work than face-to-face communication, and being able to convey a point clearly and concisely is an essential skill. Writing documentation is even harder, but just as important. I’ve had to navigate poorly documented code in the past, and try my best to ensure no-one has the same experience when trying to decipher code I’ve written.| Tom Hazledine
I’ve finally published Picobel as a node package. Picobel is my open source JavaScript tool for turning HTML <audio> tags into styleable markup (a.k.a. regular divs and spans that you can target with your CSS).| Tom Hazledine
I have a long commute, so blast through at least a couple of hours of podcasts every day. I enjoy polished efforts like those from Gimlet Media and NPR, but for me the real gold lies in the more unstructured efforts. Without any constraints of format or time, the best podcasts get to dive deep into topics that wouldn't otherwise get covered.| Tom Hazledine
I've launched my first open source project. Well, okay, so it's not my first and it's also not 100% launched yet. Maybe I should explain...| Tom Hazledine
I like to think of myself as a mature typographer[1]. I've spent years obsessing of the minutia of line-lengths and leading and kerning-pairs. Bringhurst's Elements is always within arm's reach of my desk, but of course it doesn't need to be because I've got it memorized. I've even reached acceptance in the Kübler-Ross 5-stages when it comes to Comic Sans.| Tom Hazledine
Alexa represents a growing trend. The big tech players are investing heavily in voice-control (in order of current competence: Amazon, Google, Microsoft, Apple). They see voice as the next step logical interface for technology. Gone are they days, they argue, when we had to do anything quite so quaint as type on a keyboard. And in many ways, they're right: being able to say what you want and get an immediate answer can be fantastically useful. But it doesn't always beat a good-old-fashioned k...| Tom Hazledine
The decibel has always confused me. Sometimes people use decibels as an absolute value where "0" is silence and anything over "120" is very loud. Journalists do this when describing how loud a band is1. Sound engineers do it too, when boasting about the power of their speaker-setup. "It's louder than a jet engine at 50 paces, man". But when I look at the volume meter on a mixing desk, things are different. The desk shows the loudest value as zero, all the way down to silence at "-96" (or some...| Tom Hazledine
You can see SVG icon sprites in use across the high-performance web. Lonely Planet1, GitHub, & CodePen all use an SVG icon sprite, and there are plentyofadvocates for SVG icons across the development community. These examples come from the cutting-edge of front-end development, but SVG icons are not "hard" or "complicated". In fact, using an SVG sprite is one of the easiest ways to maintain an icon system.| Tom Hazledine
Here is a side-by-side comparison of an icon. The image on the left is an SVG, the one on the right is a raster PNG. They are both roughly the same file size (~1Kb), and at 64px x 64px they look pretty similar. But see how those same files look at double-scale:| Tom Hazledine
My original analogue attempt at maintaining a Bullet JournalThe "Bullet Journal"[1] is a system for Getting Things Done. One nested pen-and-paper list that gets rewritten every morning. My first post on this site was about the success I was having with the Bullet Journal. Over the last few weeks I've begun to use the journal system again, so I figured it was time for an update.| Tom Hazledine
One of the best things about HTML is that it just works. As with much of the web, things only get weird when designers and developers start adding things. By default, a raw HTML file will render quite nicely in every browser on every device. Hierarchy is clear, lists look like lists, tables look like tables, we have bold text and italics, and links (the ‘hyper’ in HTML) are obvious.| Tom Hazledine
I'm interested in measuring what effect, if any, displaying an approximate reading-time for articles will have on readers of my site[1]. Will people be put off by knowing in advance that an article will take a long time to read? Will they gravitate to shorter pieces, or avoid them because they're looking for more in-depth content? Will it have no effect at all?| Tom Hazledine
Our programming languages substitute the complex logical underpinnings with easy-to-remember words. Typing for or while is an abstraction that suits our brains better than a string of ones and zeros. We program using languages we understand. Code is not for computers, it's for us.| Tom Hazledine
I'm noticing a tendency for organisations to pass their problems along to their customers, and I wish it didn't happen. At its simplest, this issue can be demonstrated by a basic form asking a user to input their name. It's common to see two separate fields for first-name and surname, as opposed to one box. As a developer it's easier to parse and save structured data when it's more precise, so I can see why I'd want to receive a user's name in two parts[1]. But all I'm doing is passing that t...| Tom Hazledine
Native apps are the ones you download to a device and run as a discrete application (hence the name). So-called web-apps perform similar tasks, but run in your browser. But whether we can even consider a website to be an “app” is an altogether more contentious issue.| Tom Hazledine
[1]ThingMonk is a conference “for developers, designers, data wranglers and decision-makers that want to turn ideas and concepts into industrial scale systems".| Tom Hazledine
[1]ThingMonk was wall-to-wall interesting and inspiring. I took lots of notes, but naturally focused on the areas that interested me most, and was often too busy trying to take it all in to write anything down...| Tom Hazledine
The great white hope of the Internet Of Things is the internet-connected fridge. It's the go-to example when trying to explain IOT to lay people. "Imagine what you could do if your fridge was connected to the web!" So why don't we have them yet? And do we really want them? Or even need them?| Tom Hazledine
I've long been an advocate of using icon fonts. They're resolution-independent, light-weight, and stylable with CSS. It turns out they're not the best option: inline SVG icons are better in almost every way.| Tom Hazledine
There's an episode of the Boagworld podcast where Marcus and Paul list the ten ‘web people’ they've found most inspiring. This has in turn inspired me to publish my own list.| Tom Hazledine
Every now and then I need to take a screenshot of an entire webpage, generally to use in my portfolio. Manually positioning the cursor for a cmd shift 4 screenshot (on a Mac) feels a little imprecise for my tastes, and I want to capture the whole of a site, not just the area visible in the viewport.| Tom Hazledine
Picking the right typeface for this site took a long time, and my final choice wasn’t one I was expecting. Ask 3-months-ago-me if I'd set a website entirely in Futura and I'd have laughed at you.[1]| Tom Hazledine
“Simplify, simplfy!” we're often told. Your service isn't appealing to your customers? The answer's simple: simplify! Your song isn’t connecting with your fanbase? Simplify! You aren’t shifting as many units as Apple? Simplify! It’s an easy mantra to mock, and even easier to swallow hook, line, and sinker.| Tom Hazledine
An analogue to-do list system. To-do lists are usually just a short-term fix, but I've found a system that stays relevant.| tomhazledine.com
Creating a site-search function that doesn't rely on external services| tomhazledine.com