This blog is about programming and other technological things. Written by someone developing software for fun and professionally for longer than I want to admit and in more programming languages that I can remember
When I was implementing the metrics task using tokio, I wanted to save the result JoinHandle
in a struct and I saw the type being displayed by the IDE: JoinHandle<?>
What does it mean?
... more ...
In a previous post, I wanted to deserialise a date from a Toml file and implemented the Deserialize trait for a type NaiveDate. When I was implementing metrics, I had to do it again, but implement serialise and deserialise for NaiveDate and I found another way, possibly simpler, to serialise and deserialise NaiveDate.
First: add derive support to your Cargo.toml
... more ...
This is a simple step-by-step guide to install nerd fonts in Ubuntu
Download the font you want from Nerd Fonts website https://www.nerdfonts.com/font-downloads
... more ...
When implementing a new configuration parameter for Texted, I needed something to represent the date the blog started.
When looking into the TOML website, I was fortunate to discover that it has a data type for dates, so I could create the new parameter
blog_start_date = 2016-06-25
However, my fortune was gone as I found that the Toml crate does not support deserialising.
... more ...
When implementing tags for Texted2, I had a list of tags being:
let tags: Vec<(&str, u32)>; // Tag name, number of posts containing this tag
And I need to sort it by the second item of the tuple, the tag count.
... more ...
Some years ago, I create a blog application in D and called Texted. The idea that time was to learn D using a project. This time, to learn Rust, I created a new version of that same blog application, but faster and improved.
I present you, texted2!
https://gitlab.com/thiagomg/texted2/
... more ...
A very important part of any software are the unit tests, after all, they help us verifying that the cases that are in our heads are indeed correctly implemented and also that whoever is the next lucky fellow changing our code in the future (it might be ourselves!) will feel confident that their change won't break the application.
Rust implements tests in the same file that you are implementing your functions. I will first show one example and later explain how it works.
First, let's see a piece of code I used in a tool to generate posts for my newly rewritten blog system Texted2
... more ...
So, you created your awesome server-side application and you are ready to start using. However, you want it to start automatically with your server and restart if it crashes. Also, you're happy to have a system that uses System D
So, how do we do that?
(Spoiler alert: It's super easy)
... more ...
In a C++ project I am currently working, we are using CMake/Conan for dependency resolution and planning to use flatbuffer to serialise some messages. When searching for documentation, I noticed that flatbuffers documentation is not the best one and that the integration with CMake is even harder to find, therefore, I decided to write a recipe on how to integrate it to reduce the misery of other developers around.
First, let me explain quickly how it works.
... more ...
How to be a great software engineer?
Someone asked me this question today and I didn’t have an answer. After thinking for a while, I came up with a list of what I try to do myself.
Disclaimer: I don't think I am a great engineer, but I would love to have listened to that myself when I started my career, over 20 years ago.
I will divide this in parts, non-technical and technical
... more ...
This blog is about programming and other technological things. Written by someone developing software for fun and professionally for longer than I want to admit and in more programming languages that I can remember