~mrlee/www.leemeichin.com

9aa8f7f7c6a6b18755f6c34771f4aefd725503b5 — Lee Meichin 16 days ago 8df578b
Horizontal rules
M posts/can-you-crack-the-code.org => posts/can-you-crack-the-code.org +4 -4
@@ 10,7 10,7 @@ What better way to spend the final moments of 2020, locked down in London, than 

I presume you've seen this kind of puzzle before: there is a lock that requires a three or four digit code in order for it to open. You don't know what the code is, of course, but you're given a series of clues that will test your powers of deduction and lead you to the right answer. I've actually got such a puzzle here:

◊hr{}
-----

◊div[#:style "text-align: center"]{
  *CAN YOU CRACK THE CODE?*


@@ 33,7 33,7 @@ I presume you've seen this kind of puzzle before: there is a lock that requires 
  ◊p{Two numbers are correct, but in the wrong place.}
}

◊hr{}
-----

◊h2{A brief introduction}



@@ 100,7 100,7 @@ This is more or less the essence of Prolog, and your program is essentially a da

Here's the puzzle again, for reference:

◊hr{}
-----

◊div[#:style "text-align: center"]{
  *CAN YOU CRACK THE CODE?*


@@ 123,7 123,7 @@ Here's the puzzle again, for reference:
  ◊p{Two numbers are correct, but in the wrong place.}
}

◊hr{}
-----

According to Leon Sterling and Ehud Shapiro in /The Art of Prolog}◊^[3], this type of problem falls quite neatly under the umbrella of non-deterministic programming. This is because we're essentially going to build an algorithm that will use what they describe as a ◊code{generate and test/ solution. We're going to write something that will take our clues and run through all the possible answers until it lands on the only one that fits. We're not aiming for beautiful optimisation here so this good enough, although the code we write will be tightly coupled to the exact puzzle provided.


M posts/gettin-ziggy-with-it-pi-zero.org => posts/gettin-ziggy-with-it-pi-zero.org +6 -6
@@ 20,7 20,7 @@ Ready to... get Ziggy with it? Oh, I bet you are. 😋 If you want to skip to th

🥁

◊hr{}
-----

◊h2{Hello, Pi.}



@@ 81,7 81,7 @@ What we've actually done, however, is open the device file ~/dev/i2c-1~, and the

We're at a good point now to try and compile this thing and then run it on the Pi. If we get the message 'Init successful.' then we're golden.

◊hr{}
-----

◊h2{Build and Push}



@@ 117,7 117,7 @@ SSH into your Pi after that, and try and run it! Does it return successfully? I 

Let's move on and make this kitten purr. Meow 🐈.

◊hr{}
-----

◊h2{Getting this show on the road}



@@ 222,7 222,7 @@ The rest of the code, e.g. ~reset_cursor~, resets the state of the display in su

This ~fill~ function will (rather quickly) turn the display solid white, updating each pixel one at a time. Before we continue though, let's go through some more Zig specifics; namely, ~inline~.

◊hr{}
-----

◊h2{A zig-a-Zig aaaahhhh...}



@@ 232,7 232,7 @@ This ~fill~ function will (rather quickly) turn the display solid white, updatin

Zig has some nice language features intended to replace and improve upon C/C++ preprocessor macros. The ~inline~ keyword is one such thing, and when applied to a ~for~ or ~while~ loop it'll unroll it at compile time. A simple optimisation but a useful one. We don't use it, but you also have ~comptime~, which is powerful enough to be able to implement generics, if you so desire. We're not going to go into that here though, and you can read more about it from a certain Loris Cro◊^[16].

◊hr{}
-----

This post is getting pretty long-winded, and all I wanted to do was show how to set some pixels on a tiny display. Let's wrap this up then, since we're almost ready to recompile. Just one finishing touch, which is to call the functions we defined. Update ~main~ to look like this:



@@ 263,7 263,7 @@ This post is getting pretty long-winded, and all I wanted to do was show how to 

Once you're done, rebuild the binary and ~scp~ it over, like you did the first time. SSH into your Pi and run it again (i.e ~./stardust~), and see your display light up! 🥳

◊hr{}
-----

Hopefully that worked, but if it didn't, get in touch with your feedback at wtf@mrlee.dev and help contribute to this post being a better, more informative read. After all, /works on my machine!/ can only go so far.


M posts/hakyll-on-devops-pipelines.org => posts/hakyll-on-devops-pipelines.org +1 -1
@@ 23,7 23,7 @@ I've been keen on playing with these pipelines for a while, and much like any de

Let's do a step-by-step walk through my setup.

◊hr{}
-----

◊codeblock['yaml]{
  trigger:

M posts/isolation-aloneness-and-loneliness.org => posts/isolation-aloneness-and-loneliness.org +2 -2
@@ 12,7 12,7 @@ That's not the full topic of this post, but I think it's important to acknowledg

Now I've explained where I'm coming from, let's move on.

◊hr{}
-----

For a long time (up until the last few years) I've considered myself a lonely person, or a bit of a loner. It sounds like a label to identify by and, if I were to call myself a loner enough times, it surely would become an identity. What I really mean when I say it, though, is that I don't feel like I have the capacity to provide myself the comfort, the fulfilment, the happiness, that I feel lacking in. There's a psychological undercurrent to it of course, based on my childhood, but I'm ultimately disempowering myself and also signalling that I don't really have that kind of positive feeling to give out either. There's an absence of it and I'd like it if someone else shared some with me.



@@ 28,7 28,7 @@ Most of the places I've travelled to for a holiday have been alone. A week in Cr

The difference here is that there is a source of happiness and comfort in the aloneness, and it is self-sufficient. It doesn't completely remove feelings of loneliness, as there can still be underlying reasons for that emotion, but in and of itself it can be hugely enriching, maturing, and enlightening.

◊hr{}
-----

So how does this pertain to the lockdown period we've found ourselves in since March? I have to admit that I've felt pangs of loneliness every now and then, and I seriously miss the social chit-chat at the pub after work, or meeting up with close friends to chill out. At the same time, I've discovered enough in myself over recent years to give me plenty to engage with and enjoy while I'm alone at home. As much as I'd love to dip my feet in more social things, like the dating scene and such like, I still feel quite comfortable riding this out by myself until I'm comfortable that it's safer for me to do so. It's a great feeling to have.


M posts/past-mistakes.org => posts/past-mistakes.org +1 -1
@@ 42,6 42,6 @@ You figure it out along the way and then become comfortable enough that you can 

These days I tell myself that it looks intimidating, but take it easy.

◊hr{}
-----

Four is the magic number, so I'll leave it there. I'm not sure how sincere I felt when writing this to begin with, but it's all been part of the experience. I think next time I'll single one or two things out and go into more depth.

M posts/ruby-sorcery.org => posts/ruby-sorcery.org +1 -1
@@ 197,7 197,7 @@ If you recall earlier examples, I defined ~destructure_keys(*)~, which meant tha
  end
}

◊hr{}
-----

Well, this doesn't cover the entirety of Ruby's pattern matching fun, but it should at least show you the various things you're now able to do with the feature. If in doubt, RTFM◊^[1]; Ruby's documentation is absolutely fantastic.


M posts/the-bookshelf.org => posts/the-bookshelf.org +1 -1
@@ 45,7 45,7 @@ I revisit this book every now and then, although it has the dual purpose of sell

It's the kind of book I'm happy to lend to someone without an expectation of them giving it back when they're done, so I've had a few different copies over the past several years. And it's one of the handful of books I've read cover-to-cover that has materially changed how I approach communication.

◊hr{}
-----

Beyond these, I have both Dune and Systemic Coaching & Constellations on the backburner. I'm looking forward to getting stuck into both.


M posts/the-goose-is-out.org => posts/the-goose-is-out.org +1 -1
@@ 14,7 14,7 @@ This is one of those posts I can relate to, at least in part, because of the exp

Let's get one thing out of the way before I continue: yes, there are people out there who are--always as ever--looking to prey on your vulnerability. They come in many forms and one of them is the guru, the enlightened teacher, the yogi, the new-age healer, the shaman, the spiritual group (or cult) leader, or some other kind of con artist who will appropriate a variety of spiritually-rooted terms to give themselves an appearance of authority. Ultimately, if you're going to put your physical, mental, and spiritual wellbeing in the hands of another person, you've gotta do your best to research that shit before you make a commitment. Don't be fooled by someone who has sought you out, don't trust them blindly. Do your due diligence and consult to make sure you know what you're getting into. Any teacher worth their salt will make you fully aware of what to expect and will be ready to turn you away if they don't feel you're prepared for what's to come. Same deal applies for your life coach, your therapist, your lawyer, or any other person who can easily make your life miserable if they do a shit job.

◊hr{}
-----

For some reason I was reminded of an Osho story◊^[3] that was told at one of the retreats I went to. It was probably in one of the Osho books I read too but I couldn't tell you which one. It adapted the riddle of the goose in the bottle and turned it into an allegory of sorts.


M posts/things-ive-changed-my-mind-on.org => posts/things-ive-changed-my-mind-on.org +1 -1
@@ 64,7 64,7 @@ The sort of feedback you can give in a pull request is not of the same quality y

Rejection isn't always so easy to handle, but there's always another time and a 'no' is still better than not being acknowledged at all. It's a great opportunity for constructive feedback and learning.

◊hr{}
-----

It feels a bit weird to write out a series of arbitrary maxims the way I just have, so I'll aim to explore each one in more depth throughout this year. With that said, it was an interesting exercise if ultimately a rather shallow one. Watch this space for more details.


M posts/to-simpler-times.org => posts/to-simpler-times.org +1 -1
@@ 73,7 73,7 @@ sudo apt install kamelasa
kamelasa build
}

◊hr{}
-----

On another note, this site now also left GitHub for Sourcehut◊^[8] and, at risk of being a bit narcissistic, a comments section lives on a mailing list there◊^[9]. Should you feel that the stuff I post is worth talking about, of course. You don't need a Sourcehut account to get involved, although you'll need to join the list (without signing up for Sourcehut) if you want more than read-only access.