March 2020 Updates

  • Updated the WSON Component Package page.

  • Added projection info to the rasterio page.

  • Added search functionality. When I first moved this blog from a “dynamic” Wordpress-based server to static hosting and Hugo, I thought search functionality was just one of those luxuries I would have to give up. But apparently not! As long as all the search data is assembled at site build time, we can perform the search functionality client side (i.e. on your computer, using your processor :-D). See the blog post We Now Have Search for more information!

  • Added an section on how to remove masked values from a masked array to the Numpy page.

  • Added a new tutorial on geopandas.

We Now Have Search

When I switched from using Wordpress to Hugo I thought I was giving up on search functionality on this blog. I just discovered recently I was wrong! After coming across the post Fast, keyboard optimized search for Hugo I saw that it can indeed be done. The trick to get Hugo to output a single .json file containing all of the sites textual content. This will serve as the “dictionary” for our search engine. We then use Javascript running on the clients browser to download this .json dictionary, index the data, and then provide search functionality to the user.

The above-linked forum post used the Javascript library fuse to provide the search functionality. However I found this library to be somewhat slow given the large amount of text it had to index (2.4MiB in this case). Instead, I settled on the Javascript library flexsearch which was much faster and gave me greater control over how the text was indexed. The demo of the new search feature is shown in the .gif below:

A demo of the new search functionality added for

A demo of the new search functionality added for

The screenshot below of the Network panel in the Chrome Developer Tools shows the time it takes to download the blog’s search dictionary (which is called index.json) to the client’s browser. The HTTP2 protocol automatically compresses the 2.4MiB file down to only 786kiB (which is great, it means I don’t have to implement compression myself, and don’t have to do it in slow Javascript). This file is only downloaded if the user clicks the “Search” button, as not to slowdown the pace of regular browsing or chew up data when it’s not required. I’m hoping the browser will automatically cache this file so it is not re-downloaded on subsequent searches.

The Network panel of the Chrome Developer Tools showing the time it takes to download the site's search dictionary (index.json) to the clients browser.

The Network panel of the Chrome Developer Tools showing the time it takes to download the site’s search dictionary (index.json) to the clients browser.

All-in-all, it was only about 4 hours effort to get the search feature to where it is now! It is the result of a small amount of HTML, Javascript and CSS embedded within the Hugo blog. For anyone who wants to use it for inspiration (or copy it, it’s open source!), it can be found in the following places:

Other examples of static site search functionality can be found all over the web. Some examples include:

February 2020 Updates

  • Added the following information to the AWS S3 page:

    • aws s3 sync and the --exact-timestamps parameter.

    • AWS S3’s data consistency model (including read after write and eventual consistency).

January 2020 Updates

  • Added the Happy New Year 2020 page, which compiles interesting blog statistics for the 2019 year.

  • Renamed all leaf nodes filenames from to, as using the former led to the tag pages not being created.

  • Information on handling warnings has been added to the Numpy page.

  • Updated the TSOC-6 Component Package page with more clarification on the differences between the different variants (D6+1, D6-1, D6N+1 and D6N-1).

  • Added a new QFP Component Package page, which will consolidate all of the variant information (e.g. TQFP) that existed on individual pages.

  • Updated many component package pages, including:

    And also added the following packages to the component package database:

  • Switched the site title and content title around in the HTML page title, such that it is now:

    <page title> | mbedded.nina

    This makes it easier to determine what the page is when you have a lot of tabs open on a tab-based browser such as Chrome or Edge.

  • Added cached external content to the How To Calculate Maximum Track Current page.

  • Added more specific information about dynamic memory allocation on embedded systems to the Dynamic Memory Allocation page.