Overflowing Buckets

Hello everyone 👋, Today I want to share with you a problem I’ve encountered along my journey. The problem is fairly simple: You have a finite number of water units. You have a finite number of buckets. You need to distribute the water units into the buckets. Each bucket has a maximum capacity. When a bucket is full, the water overflows into the next two buckets by splitting evenly. You need to print the number of the buckets that are full....

June 15, 2023 · 3 min · Denis Nutiu

From Wordpress To Hugo

Introduction Hello everyone 👋, This is a quick post on how I migrated my blog from WordPress to Hugo. I will not go into details on how to install Hugo or how to use it, but I will share some of the things I learned along the way. I’ve also written a simple tool in Python to aid you in the migration process. You can find it here: https://dnutiu.github.io/jekyll-to-hugo/ Why not WordPress?...

June 5, 2023 · 3 min · Denis Nutiu

CAP Theorem

The CAP theorem, also known as Brewer’s theorem, is a concept in distributed computing that states that it is impossible for a distributed system to simultaneously provide all three of the following guarantees: Consistency: All nodes in the system see the same data at the same time. Availability: Every request made to the system receives a response, without guarantee that it contains the most recent version of the data. Partition tolerance: The system continues to function despite arbitrary message loss or failure of part of the system....

May 9, 2023 · 2 min · Denis Nutiu, ChatGPT

Apache Cassandra Compaction

Introduction Apache Cassandra is a highly scalable and distributed NoSQL database that is designed to handle large volumes of data across multiple commodity servers. One of the key features of Cassandra is its ability to automatically manage data distribution, replication, and consistency across a cluster of nodes, providing high availability and fault tolerance. One important aspect of managing data in Cassandra is compaction. Compaction is the process of merging and removing unnecessary data from SSTables, which are the on-disk storage structures used by Cassandra....

April 13, 2023 · 6 min · Denis Nutiu, ChatGPT

Getting Started with pdoc3 for Python

Hello everyone! 👋 In this article we’ll talk about documentation and how to document a Python project with pdoc. Documentation is an essential part of writing high-quality Python code. Not only does it make your code easier to understand, but it also makes it more maintainable and reusable. In this post, we’ll explore how to use pdoc to generate documentation for your Python code. pdoc is a powerful tool that can automatically generate documentation for your Python modules and classes based on their docstrings....

April 13, 2023 · 4 min · Denis Nuțiu

Working with Volumes in Microk8s

Introduction Hello 👋, In this quick tutorial 💻 we’ll explore how to use Volumes and PersistentVolumes with hostpath storage in Microk8s. We will deploy a simple nginx instance and mount a volume inside it that points to the ~/Downloads folder. Let’s get started! Note: The following image was generated with Stable Diffusion How-To You can follow along if you want to setup a quick deployment with a host path volume....

April 13, 2023 · 2 min · Denis Nuțiu

LeetCode: Removing Stars From a String & Simplify Path

Hello 👋, I’ve started doing some LeetCode dailies with Paula and I’d like to share our solutions for the last two problems. https://leetcode.com/problems/removing-stars-from-a-string/ https://leetcode.com/problems/simplify-path/ I also want to warmly welcome the new nuculabs.dev subscribers! Thank you for subscribing! If you want to attempt the problems by yourself then stop reading otherwise you’ll be spoiled with solutions. Removing Stars From a String In this problem you are given a string with stars ‘*’ and when you encounter a start you’ll need to remove the start along with the character to it’s left....

April 12, 2023 · 2 min · Denis Nuțiu, Paula Rusti

LeetCode: Boats to Save People

Introduction Hello everyone! 👋 I’ve been practicing with some Leetcode daily challenges lately and since I’ve recently moved to Substack I wanted to make my first post here 😁 Boats to Save People The problem Boats to Save People is solved using a Greedy approach. Given a number of people and their weights, along with a carry limit for the boat. You must find the number of boats needed to carry the people....

April 8, 2023 · 2 min · Denis Nuțiu, Paula Rusti

How to Pack JavaScript Array Elements into a Byte Buffer and Create a New Numeric Array from the Buffer

Hello 👋, In this short article we’ll talk about packing integers into binary data in JavaScript using the Buffer, ArrayBuffer and DataView classes. Sometimes in JavaScript, it may be necessary to pack the elements of an array into a byte buffer and then create a new numeric array from the buffer’s contents. This can be achieved using the DataView object in JavaScript. First, create an array of elements you want to pack, for example:...

March 30, 2023 · 3 min · Denis Nuțiu

How to create a ServiceMonitor in Microk8s: Observability Tutorial

Hello, In this quick tutorial we will explore how to create a ServiceMonitor in microk8s when you have the observability addon enabled. When you enable the observability addon with: microk8s enable observability It will create the obserability namespace and install the Kubernetes Prometheus Stack. k get pods -n observability NAME READY STATUS RESTARTS AGE kube-prom-stack-prometheus-node-exporter-htzw9 1/1 tempo-0 2/2 Running 4 (16h ago) 27h alertmanager-kube-prom-stack-kube-prome-alertmanager-0 2/2 kube-prom-stack-kube-prome-operator-cbf896985-fb5fc 1/1 kube-prom-stack-kube-state-metrics-57c8c84df6-hflgj 1/1 kube-prom-stack-grafana-74d8979894-sjv77 3/3 prometheus-kube-prom-stack-kube-prome-prometheus-0 2/2 loki-0 1/1 loki-promtail-sg8bv 1/1 Running You will get a Grafana configured with a Prometheus data source and other data sources as well....

March 29, 2023 · 2 min · Denis Nuțiu