<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>The Unterminated String</title>
    <link>https://www.theunterminatedstring.com/</link>
    <description>Recent content on The Unterminated String</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-gb</language>
    <copyright>© Alan Barr</copyright>
    <lastBuildDate>Wed, 13 Mar 2024 22:00:00 +0000</lastBuildDate>
    <atom:link href="https://www.theunterminatedstring.com/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Bin Hoking - Using Binutils to Inspect Symbols</title>
      <link>https://www.theunterminatedstring.com/bin-hoking/</link>
      <pubDate>Wed, 13 Mar 2024 22:00:00 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/bin-hoking/</guid>
      <description>I&amp;rsquo;m likely not the only one, who, after updating a third party dependency has ran into some linker error. This could be in the form of:&#xA;a build time error, complaining about an &amp;ldquo;undefined reference&amp;rdquo; seeing your application exit immediately at runtime, giving &amp;ldquo;cannot open shared object file: No such file or directory&amp;rdquo; as its excuse Sometimes when you get a weird and wonderful linker error, it can be useful to peek under the under the covers a little to get a better understanding of how different libraries depend on each other.</description>
    </item>
    <item>
      <title>Hashing With OpenSSL Dgst</title>
      <link>https://www.theunterminatedstring.com/openssl-dgst/</link>
      <pubDate>Sun, 23 Jul 2023 15:00:00 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/openssl-dgst/</guid>
      <description>SQLite provides SHA3-256 hashes for the verification of the files available for download on its website.&#xA;Most Linux distributions I have used come with a collection of &amp;ldquo;*sum&amp;rdquo; commands (provided by coreutils) to generate hashes, e.g.:&#xA;md5sum sha1sum sha256sum However, there doesn&amp;rsquo;t seem to be a readily available &amp;ldquo;sha3sum&amp;rdquo; variant.&#xA;After searching around for ways of validating a SHA3-256 digest, I found that OpenSSL provides a wide selection of hashing algorithms to use via its dgst command.</description>
    </item>
    <item>
      <title>Base64 Encoding</title>
      <link>https://www.theunterminatedstring.com/base64-encoding/</link>
      <pubDate>Fri, 12 May 2023 21:00:00 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/base64-encoding/</guid>
      <description>I&amp;rsquo;ve encountered base64 encoding many times, be it in TLS certificates, SSH keys, or JWT tokens. Base64 is a useful way for holding binary data in a friendly format (&amp;ldquo;ASCII Armor&amp;rdquo;) that can be inserted into XML, JSON, or an email. Until recently, I hadn&amp;rsquo;t given much consideration to the specifics of the base64 encoding process, but after having cause to skim RFC4648 I decided to make some notes.</description>
    </item>
    <item>
      <title>Parsing with RapidJSON</title>
      <link>https://www.theunterminatedstring.com/rapidjson-parsing/</link>
      <pubDate>Tue, 28 Feb 2023 20:00:00 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/rapidjson-parsing/</guid>
      <description>RapidJSON is one of many available options for parsing JSON with C++. The official documentation offers a fairly good tutorial.&#xA;The following provides some additional notes and examples which build on top of the tutorial, to act as a reference for myself, if no one else. All the examples are taken from the same file which can be found here.&#xA;Note that the focus of this post is on reading JSON rather than creating or manipulating JSON.</description>
    </item>
    <item>
      <title>SQLite: Vacuuming the WALs</title>
      <link>https://www.theunterminatedstring.com/sqlite-vacuuming/</link>
      <pubDate>Sun, 21 Mar 2021 22:43:10 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/sqlite-vacuuming/</guid>
      <description>TL;DR WAL files can grow to the size of the largest transaction. The pragma wal_checkpoint(truncate) can be used to shrink the WAL file. A vacuum command will result in the WAL file growing by roughly the number of used pages in the database. During the process, a temporary copy of the database will be be created. An incremental_vacuum(0) may result in the WAL file growing by approximately the number of free (‽) pages in the database.</description>
    </item>
    <item>
      <title>Where&#39;s my operator=(const T&amp;)?</title>
      <link>https://www.theunterminatedstring.com/implicit-assignment-operator/</link>
      <pubDate>Sun, 31 Jan 2021 15:05:43 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/implicit-assignment-operator/</guid>
      <description>Recently, I was using std::transform to juggle some data between structures only to run into a compilation error.&#xA;While not the clearest of errors (I was admittedly using an old version of GCC) it indicated my structure was missing an appropriate assignment operator. An assignment operator is not something I typically need to pay much attention to; I&amp;rsquo;m normally quite happy for the compiler to implicitly generate one for me.</description>
    </item>
    <item>
      <title>How Does Boost Move Emulation Work? (Addendum: Temporarys, Rvalues, Const and Confusion)</title>
      <link>https://www.theunterminatedstring.com/boost-move-emulation-addendum/</link>
      <pubDate>Sun, 04 Oct 2020 10:11:34 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/boost-move-emulation-addendum/</guid>
      <description>I had cause to reread my initial write up of Boost move emulation and noticed a glaring omission. Since this had me scratching my head for a while, I figured it was worthy of a follow up post. Admittedly, it appears that much of my confusion stemmed from a misunderstanding I had with regard to why rvalues can only be bound to a const &amp;amp; (in C++03).&#xA;The Omission - Modifying an Rvalue In the original post, I used the class move_only_class to provide a simplified example of how Boost move works.</description>
    </item>
    <item>
      <title>Populating Boost Ptree JSON Arrays</title>
      <link>https://www.theunterminatedstring.com/boost-ptree-array/</link>
      <pubDate>Wed, 17 Jun 2020 19:38:18 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/boost-ptree-array/</guid>
      <description>Boost Property Tree offers a simple interface for parsing and writing JSON.&#xA;It is not without its limitations however, one of which being that working with arrays isn&amp;rsquo;t particularly intuitive. This is at least partly due to the array elements being modelled as having empty keys. Per the docs:&#xA;JSON arrays are mapped to nodes. Each element is a child node with an empty name. If a node has both named and unnamed child nodes, it cannot be mapped to a JSON representation.</description>
    </item>
    <item>
      <title>Software Laws</title>
      <link>https://www.theunterminatedstring.com/software-laws/</link>
      <pubDate>Sat, 13 Jun 2020 11:22:07 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/software-laws/</guid>
      <description>Atwoods&amp;rsquo;s Law Any application that can be written in JavaScript, will eventually be written in JavaScript.&#xA;Brook&amp;rsquo;s Law Adding human resources to a late software project makes it later.&#xA;Conway&amp;rsquo;s Law Organizations which design systems &amp;hellip; are constrained to produce designs which are copies of the communication structures of these organisations.&#xA;Cunningham&amp;rsquo;s Law The best way to get the right answer on the internet is not to ask a question; it&amp;rsquo;s to post the wrong answer.</description>
    </item>
    <item>
      <title>Occasionally Useful Git Commands</title>
      <link>https://www.theunterminatedstring.com/occasionally-useful-git-commands/</link>
      <pubDate>Fri, 12 Jun 2020 17:37:06 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/occasionally-useful-git-commands/</guid>
      <description>Git revisions Not a command, but a useful reference. gitrevisions lists the various ways you can refer to a commit.&#xA;Get the history of a function git log -L :${FUNCTION}:${FILE} References:&#xA;git log -L Show a file at specific commit git show ${COMMIT}:${FILE} References:&#xA;git show git revision &amp;lt;rev&amp;gt;:&amp;lt;path&amp;gt; Checkout a file at specific commit git checkout ${COMMIT} -- ${FILE} References:&#xA;git checkout pathspec List files changed in git log git log --name-only git log --name-status References:</description>
    </item>
    <item>
      <title>How Does Boost Move Emulation Work?</title>
      <link>https://www.theunterminatedstring.com/how-does-boost-move-emulation-work/</link>
      <pubDate>Sun, 17 Nov 2019 00:17:01 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/how-does-boost-move-emulation-work/</guid>
      <description>C++11 added move semantics along with rvalue references to the language. This allows for the user to indicate when a function can be destructive to its arguments. For example a &amp;ldquo;move&amp;rdquo; constructor could avoid an expensive memory allocation and copy by just taking ownership of its argument&amp;rsquo;s pointer. Additionally, it allows for the creation of classes which can only be moved but not copied. This trait is used by unique_ptr to help ensure only a single instance of the class remains responsible for the managed pointer.</description>
    </item>
    <item>
      <title>BusyBox ps - Brackets and Braces</title>
      <link>https://www.theunterminatedstring.com/busybox-ps-brackets-and-braces/</link>
      <pubDate>Mon, 05 Aug 2019 09:45:30 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/busybox-ps-brackets-and-braces/</guid>
      <description>TL;DR In the COMMAND column of BusyBox ps, the name of the process will sometimes be wrapped in curly braces or square brackets.&#xA;Curly braces {} are used to indicate that the filename of the executable retrieved from /proc/&amp;lt;pid&amp;gt;/stat doesn&amp;rsquo;t match the argv[0] value parsed from /proc/&amp;lt;pid&amp;gt;/cmdline. This can occur if the program has been run with an interpreter e.g. /usr/bin/python or has modified its own argv.&#xA;Square brackets [] are used to indicate that the process&amp;rsquo; /proc/&amp;lt;pid&amp;gt;/cmdline was empty.</description>
    </item>
    <item>
      <title>C&#43;&#43; Conference Playlist</title>
      <link>https://www.theunterminatedstring.com/cpp-conference-playlist/</link>
      <pubDate>Tue, 30 Apr 2019 18:00:25 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/cpp-conference-playlist/</guid>
      <description>To help with making the migration from C to C++ I&amp;rsquo;ve been watching a lot of conference talks on YouTube. I&amp;rsquo;ve gathered a list of some of the talks I&amp;rsquo;ve found interesting or have found myself recommending below. As my current focus is sadly on C++03, new language features are in short supply here. Most talks are on fundamental C++, best practises, and tools.&#xA;Fundamentals / General “10 Core Guidelines You Need to Start Using Now” Kate Gregory &amp;ldquo;Choosing the Right Integer Types in C and C++&amp;rdquo; Dan Saks &amp;ldquo;Curiously Recurring C++ Bugs at Facebook&amp;rdquo; Louis Brandy &amp;ldquo;How to Argue(ment)&amp;rdquo; Richard Powell &amp;ldquo;Intro to the C++ Object Model&amp;rdquo; Richard Powell &amp;ldquo;The Shape of a Program&amp;rdquo; James McNellis Performance &amp;ldquo;Cache Warming: Warm Up The Code&amp;rdquo; Jonathan Keinan &amp;ldquo;Copy Elision&amp;rdquo; Jon Kalb &amp;ldquo;CPU Caches and Why You Care&amp;rdquo; Scott Meyers &amp;ldquo;Taming the Performance Beast&amp;rdquo; Klaus Iglberger &amp;ldquo;The End of std::endl&amp;rdquo; Dietmar Kühl &amp;ldquo;The Strange Details of std::string at Facebook&amp;rdquo; Nicholas Ormrod Tooling &amp;ldquo;GDB - A Lot More Than You Knew&amp;rdquo; Greg Law “How C++ Debuggers Work” Simon Brand &amp;ldquo;LLVM: A Modern, Open C++ Toolchain&amp;rdquo; Chandler Carruth &amp;ldquo;Making C++ easier, faster and safer (part 1)&amp;rdquo; Chandler Carruth &amp;ldquo;Sanitize your C++ code&amp;rdquo; Kostya Serebryany Compiler Optimisation &amp;ldquo;Understanding Compiler Optimization&amp;rdquo; Chandler Carruth &amp;ldquo;What Has My Compiler Done for Me Lately?</description>
    </item>
    <item>
      <title>Python Bits and Bytes</title>
      <link>https://www.theunterminatedstring.com/python-bits-and-bytes/</link>
      <pubDate>Sat, 19 May 2018 09:57:28 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/python-bits-and-bytes/</guid>
      <description>In C, handling binary data such as network packets feels almost like a core part of the language. In Python on the other hand, there are a lot of supporting library functions required to facilitate this.&#xA;As I only occasionally use Python for this purpose, I&amp;rsquo;ve written up the below as a reference for myself. All of these examples target Python 3.&#xA;Base Conversions Python has three built in functions for base conversions.</description>
    </item>
    <item>
      <title>How Grep Prevents a Feedback Loop</title>
      <link>https://www.theunterminatedstring.com/gnu-grep-feedback-loop/</link>
      <pubDate>Tue, 30 Jan 2018 21:53:40 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/gnu-grep-feedback-loop/</guid>
      <description>The blog post grep your way to freedom considers &amp;ldquo;what happens when you grep a file and append the contents to the same file&amp;rdquo;.&#xA;Before moving on to investigate BSD grep, the author observes that GNU grep will stop if it detects that a grep process starts grepping its own output.&#xA;Indeed, if I try:&#xA;touch test.txt grep something test.txt &amp;gt; test.txt I get:&#xA;grep: input file ‘test.txt’ is also the output I was once caught out by a grep feedback loop with a version which obviously didn&amp;rsquo;t have this check.</description>
    </item>
    <item>
      <title>The Greedy C Runtime</title>
      <link>https://www.theunterminatedstring.com/the-greedy-c-runtime/</link>
      <pubDate>Sat, 29 Apr 2017 21:28:26 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/the-greedy-c-runtime/</guid>
      <description>I occasionally browse hackaday with the hope that some project will guilt inspire me into creating something interesting. A posting which got my attention was the 1 kB Challenge. This was a competition run at the end of 2016, with the key stipulation being:&#xA;Projects must use 1 kB or less of code, including any initialized data tables, bootloaders, and executable code.&#xA;The competition is now long over and I didn&amp;rsquo;t write so much as a single line of code for it.</description>
    </item>
    <item>
      <title>GNU Make By Example</title>
      <link>https://www.theunterminatedstring.com/gnu-make-by-example/</link>
      <pubDate>Tue, 31 Jan 2017 23:20:53 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/gnu-make-by-example/</guid>
      <description>GNU Make is something I&amp;rsquo;ve always considered to be the necessary evil of C projects. Writing a Makefile with a call or two to GCC is relatively easy, but as a project gets bigger so do the caveats to the build behaviour.&#xA;Like much in the world of software development, there is a Catch 22 on knowing what you want to achieve and understanding enough to get useful search results. The seemingly archaic syntax of make ($(@F)) doesn&amp;rsquo;t make searching for help any easier.</description>
    </item>
    <item>
      <title>Random Numbers with the STM32F4</title>
      <link>https://www.theunterminatedstring.com/random-numbers-with-the-stm32f4/</link>
      <pubDate>Mon, 02 Jan 2017 22:40:10 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/random-numbers-with-the-stm32f4/</guid>
      <description>I&amp;rsquo;ve been looking at the RTP specification lately and it&amp;rsquo;s hard not to notice the protocol&amp;rsquo;s reliance on random numbers. For instance, the RFC recommends the following should be generated randomly:&#xA;SSRC initial sequence number initial timestamp value RTCP transmission interval The rationale for why these values should be random doesn&amp;rsquo;t really apply to my intended use case of RTP so I was prepared to ignore it. However the STM32F407 microcontroller I was using features a True Random Number Generator, so I thought I might as well put it to good use.</description>
    </item>
    <item>
      <title>Typecasting in C: Under the Hood with ARM Cortex-M4 Assembly</title>
      <link>https://www.theunterminatedstring.com/typecasting-in-c/</link>
      <pubDate>Sun, 18 Sep 2016 20:40:14 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/typecasting-in-c/</guid>
      <description>What is Typecasting? There are various sizes and formats in which data can be natively represented in the C language e.g. char, int, float etc.&#xA;Often a C program will have to convert (cast) data from one of these types to another. This may be an explicit cast which the user has requested or it may happen implicitly.&#xA;I&amp;rsquo;ve been wanting to dip my feet in ARM assembly for sometime and decided a brief investigation into how the compiler implements type casting would be a gentle introduction.</description>
    </item>
    <item>
      <title>My Git Workflow</title>
      <link>https://www.theunterminatedstring.com/my-git-workflow/</link>
      <pubDate>Sun, 26 Jun 2016 13:38:34 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/my-git-workflow/</guid>
      <description>Git is a massively popular Version Control System (VCS), and should need no introduction. I&amp;rsquo;ve been using it for several years now, and have found it to be an invaluable tool. I am not going to promote it as the &amp;ldquo;best&amp;rdquo; VCS as it is the only one I have used, but it is good at what it does.&#xA;Git is not without it&amp;rsquo;s shortcomings however, the biggest probably being the user interface - it&amp;rsquo;s not particularly intuitive to use.</description>
    </item>
    <item>
      <title>Probing PDM: MP45DT02 and STM32F407</title>
      <link>https://www.theunterminatedstring.com/probing-pdm/</link>
      <pubDate>Sun, 15 May 2016 16:47:20 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/probing-pdm/</guid>
      <description>STM32F4 Discovery Boards You may or may not be aware that the STM32F407 evaluation boards (STM32F4DISCOVERY / STM32F407G-DISC1) are kitted out for audio processing. They come equipped with with a MP45DT02 MEMS microphone along with a CS43L22 DAC.&#xA;For a while now I&amp;rsquo;ve been interested in getting the MP45DT02 up and running. After putting it off with one excuse or another, I recently found the time (and motivation) to experiment with it.</description>
    </item>
    <item>
      <title>Comparing CMSIS FIR Filter Variants</title>
      <link>https://www.theunterminatedstring.com/cmsis-arm-fir-comparison/</link>
      <pubDate>Sun, 06 Mar 2016 14:53:14 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/cmsis-arm-fir-comparison/</guid>
      <description>About Recently I&amp;rsquo;ve been playing about with a STM32F4DISCOVERY project which requires some DSP - nothing special, just a low pass filter. My DSP is pretty rusty however, and it probably could have been described that way even when I was studying it in uni. I was always able to recall the various formula and when to use them, but the fundamental understanding of just what the math was doing never materialised.</description>
    </item>
    <item>
      <title>STM32 Development on Debian</title>
      <link>https://www.theunterminatedstring.com/stm32-development-on-debian/</link>
      <pubDate>Sat, 20 Feb 2016 23:48:35 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/stm32-development-on-debian/</guid>
      <description>The Ubuntu VM I have been previously using for STM32 development is rapidly falling out of date. Rather than upgrade it I fancied a change (albeit a small one), so I thought I would spin up a Debian VM. I figured it would be helpful (to me if to nobody else) to document the steps required to get it up and running.&#xA;It you are already familiar with setting up a Linux VM (or, before anyone interjects a &amp;ldquo;GNU/Linux&amp;rdquo; VM), some of the steps below might be a little tedious since I walk through the process.</description>
    </item>
    <item>
      <title>The Forever Clichéd...</title>
      <link>https://www.theunterminatedstring.com/hello-world/</link>
      <pubDate>Tue, 12 May 2015 19:28:50 +0000</pubDate>
      <guid>https://www.theunterminatedstring.com/hello-world/</guid>
      <description>Hello World.</description>
    </item>
  </channel>
</rss>
