Drew Silcock new Stream(consciousness)

How long is a cucumber? 🥒

Or: UTF-16 handling of astral planes and implications for JavaScript string indexing

tldr: 2.

String encoding in JavaScript is a bit weird. You might’ve heard this before. You might even have read about how, somewhat inexplicably, JavaScript does not use the almost universal UTF-8 file encoding but instead UTF-16 (see note 1). In this article I’m going to explore some of the more subtle and perplexing aspects of the weird way ...

Jekyll KaTeX Block

If you follow Hacker News, then you might’ve seen the latest development from Khan Academy: .

Although it hasn’t yet implemented the full set of mathematical symbols, promises to replace MathJax as the web technology for displaying mathematical expressions. This plugin utilises Jekyll’s plugin system to enable you to easily add mathematical equations to your statically generated site, by adding a Liquid block corresponding to content to be rendered by .

It’s as simple as adding this plugin to your _plugins folder, pointing the plugin to your JavaScript file in _config.yml, and including the CSS in the resulting web pages.

For more information, continue reading, or if you want to just go straight to the code, head over to https://github.com/drewsberry/jekyll-katex-block.

Using make and latexmk for easy LaTeX compilation

Still running pdflatex (or equivalent) every time you want to recompile your document? There’s a simpler way using make and latexmk. All you need is a simple Makefile and you can tell to automatically recompile your document every time you change a file, and run pdflatex the sufficient number of times to get cross-references right.

Calculating the overlap of aerial photos

The setup is as follows: you have a camera attached to a UAV which is taking pictures regularly every five seconds, and you need at least 80% overlap between the photos in order to properly stitch them together into a Digital Elevation Model (DEM). What do you do? How far apart should each photo be? How fast do you need to fly your UAV in order to achieve this?

This post demonstrates how to go about calculating the required maximum distance between successive photos in order to ensure a certain percentage overlap between those photos, as a function of the required overlap, the angle of view of the camera and your height above the ground.

I then go on to show how to simply work out how fast you need to fly your UAV to achieve this overlap, given the time between successive photographs.

Custom Jekyll plugins with GitHub Pages

So GitHub Pages is a fantastic resource for hosting your personal or organisation site on GitHub, for free. It even supports Jekyll! only thing is, it doesn’t support custom plugins because of the --safe flag that it compiles your site with. So what do you do?

Well, if you compile the site using jekyll yourself, then push the resulting compiled HTML to your GitHub Pages repository, then it works perfectly! You get your custom plugins, and you get your free GitHub Pages hosting.

So how do you organise the source and compiled code?