Testing Tips: Avoid sleep in tests

Hi 👋, In this article I wanna show a testing tip that I’ve recently learned myself by reading Software Engineering at Google: Lessons Learned from Programming Over Time. The technique improved the way I write unit tests. When I’m writing bigger unit tests, I have execute something in the background, like for example publishing a message to a message broker, wait for the message to be published and then consume it to test that what I published is correct. ...

July 12, 2022 · 4 min · Denis Nuțiu

A Rust library for for BME-680

https://github.com/dnutiu/bme680-rust

March 14, 2024 · 1 min · Denis Nutiu

Cancellation Token Pattern in Python

Hello! 👋 The Cancellation Token Pattern article is a pattern inspired by C#’s CancellationToken struct and Golang’s context package. The main idea of the pattern is to allow the user of an API to cancel its operations, but in order for this pattern to work, the API must be written with the cancellation token pattern in mind. To use the pattern, you need a class that represents a cancellation token. Here’s my simple version: ...

March 9, 2024 · 3 min · Denis Nutiu

Implementing cat with Kotlin Native

Introduction Hello! 👋 In this article we’ll implement the cat command utility which is used in many Unix like systems like Linux and macOS. To implement it, we’ll use kotlin and to drop the Java Virtual Machine (JVM). We’ll build a binary directly with Kotlin Native. In the end, we’ll get an executable that we can simply run on our Linux or macOS box. What is cat? The catutility which has purpose of concatenating files. You can use it by typing cat file.txt and it will output the contents of the file into the terminal. It also has more options like: usage: cat [-belnstuv] [file ...] which are documented in the manual pages. ...

December 24, 2023 · 6 min · Denis Nutiu

Learning Kotlin

Introduction Hello everyone! 👋 The year of 2023 has come closely to an end, and I want to write a short article about my experience with Kotlin and what other programming languages I’ve tried this year. Outside work, I like experimenting with new programming languages and technologies. I don’t usually build side projects in the languages and frameworks that I use full time at work because I don’t find it fun. I like to learn new things. ...

December 11, 2023 · 4 min · Denis Nutiu

Idempotency in Your API

Introduction Idempotency is a crucial property in the world of APIs, ensuring that operations can be applied multiple times without changing the result. In this post, we’ll explore six effective strategies to achieve idempotency in your API, drawing inspiration from real-world examples and distributed systems principles. Idempotency Explained The light switch analogy is often used to explain idempotence. Consider a light switch in a room. The operation of turning the light switch on or off is idempotent. If the light is initially off and you flip the switch to turn it on, flipping it again won’t turn the light off again—it stays on. ...

November 11, 2023 · 4 min · Denis Nutiu

Windows Task Scheduler - Quick Start

Introduction Hello everyone 👋, This is a quick post about the windows task scheduler, if you’re a Software Developer using Windows the task scheduler is a great tool to automate tasks. I see it as a combination of cron and systemd (if you’re a Linux user you know what I’m talking about). For my personal use case, I use the task scheduler to download more images from the internet to improve a machine learning model used to classify images. To download the images I use a simple Python script and a batch file to run the script. ...

November 11, 2023 · 3 min · Denis Nutiu

Project Showcase: Image Tagging

Hello there 👋, This is a showcase of a project I’ve been working on for the past weeks. It’s a simple cross-platform desktop application that allows you to tag images using a machine learning model that I’ve trained. It is written in C# using Avalonia UI, and it uses the FastAI library for the machine learning part, the model is then converted to ONNX. The application is available for Windows, Linux and MacOS. ...

September 12, 2023 · 1 min · Denis Nutiu

Tracing Node.js APIs with OpenTelemetry

Hello everyone 👋, In this article, we’ll instrument a simple Node.js API with OpenTelemetry traces. OpenTelemetry is the new standard for distributed tracing and metrics. Trace data is used to monitor and troubleshoot complex distributed systems. At the end of this article, we’ll have a Node.js API that is instrumented with OpenTelemetry and we’ll be able to see the traces in Grafana Tempo: The API Let’s start by setting up our NodeJS project by installing the dependencies: ...

August 7, 2023 · 9 min · Denis Nutiu

Using an ONNX Resnet model in Java

Hello everyone! 👋 This is a follow-up post to the previous one, long story short I started taking the course from fast.ai to learn more about Deep Learning. I’ve built a simple Image Tagging model using the Resnet architecture (don’t worry about the paper I did not read it, GitHub Copilot suggested it while writing this blog post). FastAI is a high-level Python library that allows you to train complex ML models really fast and efficiently. After training my model, I’ve exported it into the ONNX format and in this post we’re using the model in a Java application. ...

July 4, 2023 · 8 min · Denis Nutiu