pikoTutorial - Your source of byte-sized programming knowledge

How to write Arduino Uno code with Python?

pikoTutorial - Your source of byte-sized programming knowledge

Bug of the week #8

pikoTutorial - Your source of byte-sized programming knowledge

Make C++ a better place #2: CppFront as an alternative

pikoTutorial - Your source of byte-sized programming knowledge

Linux and hash command

pikoTutorial - Your source of byte-sized programming knowledge

How to use xargs on Linux?

pikoTutorial - Your source of byte-sized programming knowledge

Combining Bazel with Docker

pikoTutorial - Your source of byte-sized programming knowledge

Hacking Python functions by changing their source code

Combining Bazel with Docker
Posted in

Combining Bazel with Docker

Welcome to the next pikoTutorial! In one of the recent articles, I showed how to build and run Docker containers using CMake. Today, we will see how to do a similar thing, but using Bazel. Today’s project structure: Note: on the contrary to the project structure used in the article…

Combining Bazel with Docker Read More
Bug of the week #11
Posted in

Bug of the week #11

Welcome to the next pikoTutorial ! The error we’re handling today is a C++ compilation error: What does it mean? It often occurs when the compiler encounters a place in the code where it would normally expect a static member function, but the actual function is not static. Let’s say…

Bug of the week #11 Read More
Combining CMake with Docker
Posted in

Combining CMake with Docker

Welcome to the next pikoTutorial ! In one of the recent articles, I showed how to use CMake for setting up a Python project. Today, we will see how to further extend it by adding building of Docker images to the CMakeLists.txt files. Today’s project structure: Top CMakeLists.txt file Nothing…

Combining CMake with Docker Read More
Folding expressions in C++
Posted in

Folding expressions in C++

Welcome to the next pikoTutorial ! What is a folding expression? Imagine that you have a vector of integers and you need to add some predefined values to it. The obvious choice seems to be just using push_back() function applied a couple of times: This works, but look how much…

Folding expressions in C++ Read More
Bug of the week #10
Posted in

Bug of the week #10

Welcome to the next pikoTutorial ! The error we’re handling today is a C++ compilation error: Or a similar one: What does it mean? This error occurs in situations when you provide a declaration of a type, but don’t provide definition of that type. For example, if I try to…

Bug of the week #10 Read More
Bug of the week #9
Posted in

Bug of the week #9

Welcome to the next pikoTutorial ! The error we’re handling today is a ROS runtime error: Typically occurring when calling ROS commands like: What does it mean? To understand where does this error come from, you must understand 2 ROS concepts: Underlay allows you to create in your terminal a…

Bug of the week #9 Read More
UDP multicasting with Python
Posted in

UDP multicasting with Python

Welcome to the next pikoTutorial! The minimal receiver Note for beginners: do not remove line 14 from the receiver implementation! Without the ability to re-use the same address, you will not be able to run more than 1 multicast receiver and you’ll end up with a simple UDP client/server setup.…

UDP multicasting with Python Read More
Bug of the week #8
Posted in

Bug of the week #8

Welcome to the next pikoTutorial! The error we’re handling today is a C++ compilation error: What does it mean? In C++, the error occurs when you try to invoke a function that has been explicitly marked as deleted or implicitly deleted by the compiler. This error commonly arises in relation…

Bug of the week #8 Read More
TCP client/server with Python
Posted in

TCP client/server with Python

Welcome to the next pikoTutorial ! The minimal TCP server A TCP server listens for incoming connections on a specified port and communicates with clients over that connection. The minimal TCP client A TCP client establishes a connection with a server, sends data, and receives responses. Bidirectional communication You can…

TCP client/server with Python Read More
Bug of the week #7
Posted in

Bug of the week #7

Welcome to the next pikoTutorial! The error we’re handling today is a C++ compilation error: What does it mean? The requirement for main to return an integer stems from convention and standardization within the programming languages. In C and C++, the main function is typically defined with a return type…

Bug of the week #7 Read More
Python lru_cache explained
Posted in

Python lru_cache explained

Welcome to the next pikoTutorial! Imagine you’re developing an application that fetches data from external API. For example, a weather app might request current weather conditions for a list of cities and then display them. While the data is updated periodically, repeatedly querying the API with the same city is…

Python lru_cache explained Read More
Data transfer with curl
Posted in

Data transfer with curl

Welcome to the next pikoTutorial! Short for “Client URL,” curl is a command-line tool and library for transferring data with URLs. It supports various protocols, including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, LDAP, and more. Basic usage At its core, curl allows you to fetch content from or send content…

Data transfer with curl Read More
Python reduce explained
Posted in

Python reduce explained

Welcome to the next pikoTutorial! The reduce function is a powerful tool placed in the functools module that facilitates the cumulative application of a function to the items of an iterable (from left to right), to reduce them to a single value. Initially introduced in Python 2, later moved to…

Python reduce explained Read More
Bug of the week #6
Posted in

Bug of the week #6

Welcome to the next pikoTutorial! The error we’re handling today is a Python runtime error: What does it mean? The “too many values to unpack” error typically occurs when there is a mismatch between the number of variables or elements being unpacked and the number of values being assigned. This…

Bug of the week #6 Read More
Custom literals in C++
Posted in

Custom literals in C++

Welcome to the next pikoTutorial! What are C++ literals? Literals in C++ are constant values directly embedded into the code, such as numbers, characters and strings. They represent fundamental data, making the code more readable and expressive. C++ provides several built-in literals, like integer literals (42), floating-point literals (3.14), and…

Custom literals in C++ Read More
Linux and hash command
Posted in

Linux and hash command

Welcome to the next pikoTutorial! What is hash? The hash command in Linux is a built-in shell utility used to optimize the execution of commands by recording paths of the invoked commands, so subsequent executions don’t need to search through the PATH variable again. You can see it in action…

Linux and hash command Read More
Enums vs enum class in C++
Posted in

Enums vs enum class in C++

Welcome to the next pikoTutorial! When dealing with enumerations in C++, developers have two primary options: traditional enum and enum class. Traditional enums vs enum classes At the first glance, the only difference appears to be in the class keyword: The real difference is however in how both of them…

Enums vs enum class in C++ Read More
Bug of the week #4
Posted in

Bug of the week #4

Welcome to the next pikoTutorial! The error we’re handling today is a Git error: which occurs when trying to copy file from another branch using command: What does it mean? It means that the commit hash you provided was not recognized by Git as a valid object which could be…

Bug of the week #4 Read More
How to use xargs on Linux?
Posted in

How to use xargs on Linux?

Welcome to the next pikoTutorial! xargs reads items from standard input, delimited by blanks or newlines and executes the specified command with those items as arguments. Basic usage The most basic pattern of using xargs commands consists of 4 elements: Examples Create files basing on a text file Let’s assume…

How to use xargs on Linux? Read More
Bug of the week #3
Posted in

Bug of the week #3

Welcome to the next pikoTutorial! The error we’re handling today is a C++ linker error: What does it mean? In C++, an “undefined reference” error occurs during the linking stage. This error indicates that the linker cannot find the definition for a function, variable or object that has been declared…

Bug of the week #3 Read More