Climbing Cerro Zapaleri

Last month, I climbed Cerro Zapaleri, the 5648 m tall summit of which forms the tripoint of the borders of Chile, Argentina, and Bolivia.1 Its location is quite remote, ~105 km from San Pedro de Atacama, Chile and >40 km from the nearest paved road, both as the crow flies. After researching previous accounts of ascents and poring over high-resolution satellite imagery to map out routes to get to the mountain and to climb it, it was time to depart. As expected, a high-clearance four-wheel drive vehicle would prove to be necessary.

Cerro Zapaleri Continue reading

  1. This was at the end of a nine-week trip to Chile for telescope repair and maintenance work. Traveling during the COVID-19 pandemic, even with an N95 mask and PCR tests, was a nightmare, particularly for the flights in the United States, and I would not have done so if the repair work wasn’t necessary.  

Posted in | Tagged , , , | Leave a comment

Baking a Sierpiński Carpet Linzer Cookie

As a follow-up to my previous entries for the Ashley Book of Knots and Space-Filling Curves, I decided to enter a submission into this year’s Johns Hopkins University Sheridan Libraries’ (virtual) Edible Book Festival contest for Mandelbrot’s The Fractal Geometry of Nature. This raises the questions of which fractal to use and how to make it edible. To this end, I decided to bake a Sierpiński carpet Linzer cookie. The zeroth iteration of the fractal, a square, forms the first layer of the cookie, while the first three iterations of the fractal form three additional layers, for four cookie layers in total.

Photo of a Sierpiński carpet Linzer cookie Continue reading

Posted in , | Tagged , , , , , | 1 Comment

Space-efficient Embedding of WebAssembly in JavaScript

Recently, I came across a blog post about converting parts of a JavaScript library into WebAssembly. The part that interested me the most was a section about efficiently embedding the WebAssembly binary into the JavaScript code such that the library could be distributed as a single file, instead of the usual method of providing the WebAssembly binary as a separate file. This is accomplished by Base64-encoding the WebAssembly binary as a string and including the resulting string in the JavaScript file. Unfortunately, this significantly inflates the total file size, since the Base64-encoded string does not compress nearly as well as the original binary. To mitigate this issue, the blog post author had the clever idea of gzip-compressing the binary prior to Base64-encoding it and using the zlib.js JavaScript library to decompress the binary client-side, after undoing the Base64-encoding. While this significantly reduced the size of the Base64-encoded WebAssembly binary, it required ~6.5 kB for the decompression code, after gzip compression.1

While I liked the idea of compressing the WebAssembly binary prior to Base64-encoding it, I thought there must be a way of decompressing it with a smaller decompression code. The simplest change would be to use a raw Deflate-compressed payload instead of one encapsulated with gzip, as the zlib.js library also provides a decompression function for this, which is only ~2.5 kB after gzip-compression, saving ~4 kB. However, this is still excessive, since it shouldn’t be necessary to provide a Deflate decompression function as web browsers include such functionality. Although such decompression functionality isn’t exposed directly to JavaScript, PNG images can be decoded from JavaScript, and PNG images use Deflate compression. Thus, I decided to encode the WebAssembly binary as a grayscale PNG image, Base64-encode the PNG as a data URI, and include the resulting string in the JavaScript file. Continue reading

  1. The author mentioned 12 kB of decompression code, but that was without gzip-compression of the JavaScript code.  

Posted in | Tagged , , , | Leave a comment

Update on Figure Caption Color Indicators

Last year, I published a blog post on figure caption color indicators. The positive feedback I received on it from a number of individuals prompted me to revisit the subject. At the time, I did not have a good way of locating published examples of such caption indicators and was only able to locate a few published examples with shape indicators but none with color indicators. When thinking about revisiting the subject, I had the epiphany that although searching for such indicators in the published literature is next to impossible, searching in the LaTeX source markup for papers is not. As arXiv provides bulk access to the TeX source markup for its pre-prints, this provided a large corpus of manuscripts to search through. After finding examples in pre-prints, I was then able to see if the indicators survived the publication process and was thereby able to locate well over one hundred examples of color line or shape indicators in the figure captions of published academic papers. Continue reading

Posted in | Tagged , , , , , | Leave a comment

Pre-calculated line breaks for HTML / CSS

Although slowly improving, typography on the web pages is considerably lower quality than that of high-quality print / PDF typography, such as that produced by LaTeX or Adobe InDesign. In particular, line breaks and hyphenation need considerable improvement. While CSS originally never specified what sort of line breaking algorithm should be used, browsers all converged on greedy line breaking, which produces poor-quality typography but is fast, simple, and stable. CSS Text Module Level 4 standardizes the current behavior as the default with a text-wrap property while introducing a pretty option, which instructs the browser to use a higher quality line breaking algorithm. However, as of the time of writing, no browsers supported this property.
Continue reading

Posted in , | Tagged , , , , | Leave a comment