Jekyll2021-05-12T18:40:02+00:00/feed.xmlClark SeanorClark Seanor's portfolio and blog. Web development and more.Book notes2021-05-12T18:00:00+00:002021-05-12T18:00:00+00:00/books/2021/05/12/book-notes<p>I’ve added a new page to my site, a <a href="/reading">reading list</a> which contains a noncomprehensive list of books I’ve read this year. Generally speaking, I’ll include a book there if I finished it and it wasn’t something I read for a university course.</p>
<p>I’m also giving some brief, non-spoilery thoughts on all of the books I’ve put in the list so far. I might expand some of them into a full, more spoilery review - I haven’t decided yet. Because these aren’t reviews or criticism per se, they’re very opinionated and not that detailed.</p>
<h2 id="a-desolation-called-peace-by-arkady-martine">A Desolation Called Peace by Arkady Martine</h2>
<p>This is a sequel to one of my favourite books ever and it’s also cemented itself as one of my favourite books ever. I really liked this book and thought it was cleverly written. It has a Precocious Child POV which I didn’t despise and actually found enjoyable to read (this is high praise; I usually want to kick a book across a room at least a few times when this is brought out) and head-hopping with characters who all felt sufficiently different that it din’t get confusing. It’s also a great first-contact book, with alien language stuff, which probably meant I was going to like it anyway? Would recommend, but only as part of the series.</p>
<h2 id="john-bergers-ways-of-seeing">John Berger’s Ways of Seeing</h2>
<p>This was a re-read. I got this book from the Nottingham Contemporary when I asked someone working in the gift shop if they could recommend me books that would help me understand art. I wouldn’t say that I now “understand art” but I feel like I learned a lot about it and that this was a really worthwhile book to read. It’s pretty old but a lot of what it has to say is still relevant and applicable, and it’s approachably written.
m</p>
<h2 id="kafka-on-the-shore-by-haruki-murakami">Kafka on the Shore by Haruki Murakami</h2>
<p>This is a weird book and I thought it was going to be about bugs. Also the first Murakami that I’ve read. I am not sure whether I like Murakami, but I’m now interested in reading <a href="https://softskull.com/dd-product/who-were-reading-when-were-reading-murakami/">Who We’re Reading When We’re Reading Murakami by David Karashima</a>.</p>
<h2 id="the-worst-of-all-possible-worlds-by-alex-white">The Worst of All Possible Worlds by Alex White</h2>
<p>This is the bottom of the downhill slope that is the Salvagers series. I really, really liked the first book, didn’t like the second book at all, gave the third book a shot, the third book is just… ugh. Bad! It’s bad! It has the worst things from the second book on top of being inconsistent in ways that I found extremely annoying.</p>
<h2 id="fireheart-tiger-by-aliette-de-bodard">Fireheart Tiger by Aliette de Bodard</h2>
<p>I liked this book! It was a fast read with really gorgeous imagery. I kind of felt like it could have been better if it was longer and had more of a chance to explore the various relationships in the book–sometimes it felt like they took jarring turns–but it did a great job of getting as deeply into them as it probably could have in the length of a novella. I get the impression that broad strokes were painted to imply more detail than is directly shown. It was fun and it was pretty and Thanh is a heroine I’d love to see more of.</p>
<h2 id="finna-by-nino-cipri">Finna by Nino Cipri</h2>
<p>I may or may not have a new fear of IKEAs.</p>
<h2 id="the-city-in-the-middle-of-the-night-by-charlie-jane-anders">The City in the Middle of the Night by Charlie Jane Anders</h2>
<p>I enjoyed reading this book and trying to work out what all of the aliens looked like as I read it. At its heart, it’s essentially a YA novel with the YA “chosen one” plot, but it subverts what I’d expect from that genre and comes off as fresh and interesting anyway. The stories of the secondary characters were so compelling that I was always excited when the story came back to them. Maybe it’s not a life-changing book, but I did generally like it.</p>I’ve added a new page to my site, a reading list which contains a noncomprehensive list of books I’ve read this year. Generally speaking, I’ll include a book there if I finished it and it wasn’t something I read for a university course.Writing a Long Long for the Arduino Uno2019-10-20T13:30:00+00:002019-10-20T13:30:00+00:00/tech/2019/10/20/writing-long-long<p><img src="/assets/img/longlong.png" alt="Long Long demo output" /></p>
<p>I recently started a module in my Computer Science course where we were each given an Arduino Uno to play around with. The version of C/C++ the Arduino Uno works with doesn’t have support for 64-bit operations out of the box. Ints are 16-bit, longs and floats are 32-bit, and doubles are only technically implemented. They exist, but are also 32 bits, making them identical to floats.</p>
<p>I wanted to see if I could implement a ‘64-bit long’ in C, without doing significant prior research. That was a bit of a mouthful, so I tenatively changed the name to “LongLong” before finding out partway through the project that this was, in fact, the name I needed: ‘long long’ was the real name for the data type. The way I’d like to describe the ‘long long’ is as two longs stapled together. A struct holds a left long and a right long. Functions take instances of this struct as inputs and perform operations on them, taking into account the fact that both ‘halves’ must behave like one number.</p>
<p>As an example of how this works, to perform a left shift, the left side of the number is first shifted the specified number of places. Then, a bitmask is used to make a record of the rightmost values of the right side of the number–the amount of values recorded is equal to the number of places the bits will be shifted. The recorded values are then right-shifted for the amount of bits that weren’t saved by the bitmask, putting them in the right position to be added to the left side of the number. Only after this has been done is the left shift applied to the right side of the number.</p>
<p>This process allows the bits on the left side of the right side of the number to be ‘carried into’ the left side of the number. The process is reversed for a right shift.</p>
<p>I used a lot of references while writing this code, so a lot of what I did wasn’t ‘reinvent subtraction’ but something more like ‘adjust an existing subtraction algorithm to work with this construct’. I’ve commented links to sources used above each function.</p>
<p>Addition and subtraction are implemented using the boolean operators I defined earlier. Multiplication and division are implemented using addition and subtraction using iterative definitions. This <em>works</em> but isn’t very efficient. If I make improvements to this, I’d like to learn about more efficient algorithms for multiplication and division and implement one of them.</p>
<p>Other changes I’d like to make include switching to using <code class="highlighter-rouge">typedef</code> (which I didn’t know existed when I was writing the code) and allowing operations to happen between long longs and other numeric types. I’d also like to try implementing a signed 64-bit type as my current implementation can only do unsigned numbers.</p>
<p>Overall, I think this was an interesting and challenging project which allows room for further improvement within it. It is ‘reinventing the wheel’, but it was a fun wheel to reinvent and I learned a lot in the process.</p>
<p>If you’d like to have a look at the code, <a href="https://github.com/cruxicheiros/longlong/blob/master/longlong.ino">check it out on my github</a>!</p>Setting up Jekyll2019-09-14T15:00:31+00:002019-09-14T15:00:31+00:00/tech/2019/09/14/my-first-post<p>I’ve decided to replace my current site with a Jekyll setup, so I can easily make blog posts and update it. I initially just had HTML files pushed to the server, but that came with its own kind of overhead: a few months after I’d set it up, I no longer remembered the details of how I’d set things up. I guess I should have taken notes, but Jekyll comes with documentation, so I hope that later on when I’m wondering ‘how did I do that thing?’ I won’t need to remember or hope I’ve written down the right stuff.</p>
<p>I’ve already made a few changes to Minima, the default theme, and hope to make more over time. I put off the switch for a while because I wanted to write my own theme from scratch, but I feel like that should come after I’ve become familiar with the Jekyll theming system.</p>
<p>I’m still hosting the site on DigitalOcean, but I’ve switched to using TravisCI to make deploys rather than doing it manually, and storing all the site’s content on GitHub. This will make it easier for me to maintain the site. I’ve got an education subscription using my university email, which means I can use it with a private repo.</p>I’ve decided to replace my current site with a Jekyll setup, so I can easily make blog posts and update it. I initially just had HTML files pushed to the server, but that came with its own kind of overhead: a few months after I’d set it up, I no longer remembered the details of how I’d set things up. I guess I should have taken notes, but Jekyll comes with documentation, so I hope that later on when I’m wondering ‘how did I do that thing?’ I won’t need to remember or hope I’ve written down the right stuff.