Page 2 of 5
Hello,
Happy Thanksgiving, for the ones who celebrate it. It’s always important to be grateful for everything we have, so no matter if you don’t directly celebrate Thanksgiving. Maybe use it as an excuse and think of all the things that you have to be grateful for :).
Alright, in this week’s newsletter I want to share with you a podcast I’ve been enjoying a lot.
The name of the podcast is The History of Computing, you can add it to your favourite podcast player. I use Overcast, so here is the link to the latest episode.
Read More...
Hello,
Have you ever wondered why the home directory is mapped to ~? Or if you use vi, why use the letters H, J, K, and L to move?
These types of questions are the ones that keep me up at night. Not really :D, but I find them interesting.
I found answers to many of these questions in this article:
https://dave.cheney.net/2017/08/21/the-here-is-key
The author explains how the “Lear Siegler ADM-3A terminal” influenced so much of our current computing. Check the keyboard for the terminal. See how most of the keys match some of the “conventions” we have today. It’s a fun read about computing history.
Read More...
If you’ve used the Swift Package Manager, you have interacted with its handy command-line tool. When creating command-line tools, we strive to provide an easy to use interface. One of the main characteristics of a good CLI tool is how it handles parameters. In this post, I’ll show you how to use Swift Package Manager’s TSCUtility module, and especially ArgumentParser to parse arguments for your swift command-line tools.
Let’s start by defining the common types of arguments we get in command-line tools:
Read More...
Hello,
Are you excited for the new 16" MacBook Pro? For me, it’s much more than I would use. I’m happy with my 13" MBP, and I haven’t had any problems with the keyboard, so I’ll keep my current machine. But if I were to get one for free, I wouldn’t be mad at all.
Also, some people are excited about the return of the Esc key. It seems to be missed by many people. So much so that it even made it to the promotional video.
Read More...
State machines are used to model systems that can be thought of as a collection of states, and a collection of events that cause state changes. Many of the systems we want to model can be abstracted to a state machine. For example, elements in a Game, devices like vending machines, ATMs, etcetera. In this post, I’ll explain what State machines are, and give a simple example of the implementation of a general state machine.
Read More...
Hello,
So glad that the weekend is here, time to relax. I found this post that you might find interesting. It is about the reason that 80x25 became the standard display.
There are many things we do out of habit and end up forgetting why we started doing them in the first place. One example in my case is that I try to always keep my commit messages in under 72 characters per line. I don’t claim to be 70 years old and got used to it by using IBM’s 3270. What happened is that I read this Tpope’s article on writing good git commit messages, where he explains the reason why 72 characters per line is the ideal. The relevant reason is this:
Read More...
System libraries are typically defined using C, that means we need a way to make them available to Swift. In this post, we are going to explore how to use the Swift Package Manager to give us access to C libraries, be it system or user-defined.
Let’s start by talking about Swift modules.
*NOTE: check the following GitHub repositories for the code:
- Csqlite3 gives us access to
sqlite3.h C system library. - SQLiteTester a Swift package executable that uses the
Csqlite3 module. - SQLite3 a wrapper that provides a Swifty interface to the SQLite3 C library.
- SQLiteClient a Swift package executable to test SQLite3.
#Swift modules
Read More...
Hello,
This year Unix turns 50! You can check the website thatBell Labs created for the commemoration. I’ve always found these stories fascinating. I can only imagine how cool it would be to be part of the team that built something as impactful as Unix. I’ve always wanted to be part of a team of “scientists” that changes the futures. I remember reading Nerds 2.0.1 and getting sad that those times have already passed, but also enjoying the storytelling.
Read More...
Long gone are the days when single process single thread was the norm. We now take multithreading for granted, we expect all our applications not to lockup when we interact with them. We expect them to handle multiple users at the same time, etcetera. In this post, I’ll explain what multithreading is and how to use threads (using pthreads) in Swift.
Before someone tells me that in 2009 GCD (Grand Central Dispatch) was introduced, I know. This post is aimed at anyone that wants to understand how multithreading works using threads. To use threads directly in Swift, we need to interoperate with C code. We need to go down to using pthreads directly. We’ll go from the basics of threads and then write a Server simulator using threads.
Read More...
Hi,
How was your week? I hope it was a good one. It was a busy week for me. I was worried I wouldn’t be able to publish an article this week. But I made it.
I enjoy writing these articles. I wish I had more time to dedicate to research and writing, but I’m happy that I can dedicate at least a small amount of time every week.
Anyways, it’s the weekend, so it’s time to relax. I’m a fan of AudioBooks and podcasts. So on Saturdays, I take some time to get a coffee and listen to an interesting story. If you are a fan of audio content, here is one of my favourite podcasts:
Read More...