Harold is a kidnapper who wrote a ransom note, but now he is worried it will be traced back to him through his handwriting. He found a magazine and wants to know if he can cut out whole words from it and use them to create an untraceable replica of his ransom note. The words in his note are case-sensitive and he must use only whole words available in the magazine. He cannot use substrings or...
Simple data buffering/streaming algorithm – helper functionality
In this tutorial, a simple but useful data buffering/streaming algorithm is presented. It is not optimal but easy to understand and modify according to your needs… This library assumes that we need to use a big amount of data in a memory limited system. The library handles the all the data transferring procedure in a way that the user is able to easily get the amount of data without...
How to write data to the internal FLASH memory of an STM32
There is a common practice of today’s embedded systems to perform firmware upgrade using custom procedures in order to support different communication protocols during the data transfer such as (KWP2000 etc). For that reason the stock STM bootloader(DFU) is not useful and the development should proceed by creating a custom bootloader that supports the requested functionalities as well as...
HTTP-Request abstraction in C#
There are several ways to perform HTTP GET, POST.. requests in C#. The following example is using the legacy HttpRequest Class provided by .NetFramework without adding one more additional dependency (Nuget Packages) for something that works really well in .NET implementation and is usually unnecessary for small hobby projects but also not a good practice in professional projects. WebRequest and...
C# Flexible API for PEAK-CAN USB (PCANBasic)
There are several USB-to-CAN devices, however for developers usually there is limited support (at least free) and when you have to do things quick could lead to unexpected problems. For that reason, and due to the fact that nowadays several devices are using CANBuses below is a quick-n-dirty way to interface your PC application to a CANbus. In this post, you will find a simple yet effective way...
Convert uint8_t array to char* HEX representation in C
Long story short, this function just creates a char array which contains the HEX representation of a uint8_t (bytes) array. Useful if you don't want to use sprintf etc..
A better version of Flowlayoutpanel Control in C#
The FlowLayoutPanel shares many of an ordinary panel control. They ultimately serve the same purpose, which is to organize children controls. In other words, is a container control that provides dynamically layout for the child controls. However, the stock version of the toolbox has some major limitations in terms of performance. For that reason the following minor modifications can improve your...
How to make a single file application in WPF C# – Merging DLLs
Sometimes there is a necessity to deliver your applications in a simple and fast way. However, creating a whole installer project for just a few assemblies is not the optimal solution, and packaging up a zip file must be accompanied by “Unzip this into a folder in your programs directory and create a shortcut…” which brings us back to the whole installer business we started with. Having...
A simple generic C Stack for static or dynamic memory usage
Following the previous post about Queues, In this post i publish a simple modular stack written in C which can be used either by assigning a static space for the elements of a dynamic one (malloc etc). In computer science, a stack is an abstract data type that serves as a collection of elements, with two principal operations: push, which adds an element to the collection, and pop, which removes...
A simple generic C Queue for static or dynamic memory usage
In this post i publish a simple modular queue written in C which can be used either by assigning a static space for the elements of a dynamic one (malloc etc). Queue is a particular kind of abstract data type or collection in which the entities in the collection are kept in order. The only requirement is that the memory space which will hold the queue items have to be allocated in prior. Below is...