Blog

Trace 'function enter/leave' events with a .NET profiler + detect StackOverflow. Assembler code included!
Trace 'function enter/leave' events with a .NET profiler + detect StackOverflow. Assembler code included!
Prevent routing if unsaved changes exist [VueJS]
Apply a very small hack to prevent the user from accidentally switching to another page without saving changes [VueJS]
Call function in unmanaged DLL from C# and pass custom data types [Marshal]
This article shows how you can write a custom marshaler in order to call into unmanaged DLL's and pass custom data to the functions.

Projects

dev.to-posts

This repo contains all posts at dev.to.

overview

xbutton-blocker

This little tool blocks those side buttons:

It can be used for all those that bought one of those cheap mices that don't come with a configuration tool by the manifacturer and want to get rid of those side buttons.

Motivation

Read more about my doings here: How I got rid of those useless mouse buttons using Windows Hooks

Download

Go to the release page. Please note that you have to use the 32Bit version if you want to block the buttons in all 32bit processes and the 64 bit version to block them in all 64 bit processes.

ezb_adapter

Read EUR exchange rates for every date for every available currency from the public ECB API

Usage

There are two possible use cases where you can use this library. First you can fetch the data directly from ecb. To do this, use following code:

    class Program
    {
        static void Main(string[] args)
        {
            var client = new Client(10, new List<Currency> { Currency.USD, Currency.JPY }, new DateTime(2018, 10, 1), new DateTime(2018, 10, 9));
            var result = client.BuildForDate();

            if (result.State == ConverterState.Success)
            {
                Console.WriteLine($"100$ on 5. of October are {result.GetEuroFrom(Currency.USD, 100, new DateTime(2018, 10, 5))}€ at a exchange rate of {result.GetEuroFxFrom(Currency.USD, new DateTime(2018, 10, 5))}");
            }
            else
            {
                Console.WriteLine("Error while retriving fx data: " + result.State);
            }

            Console.ReadKey();
        }
    }

Secondly you can pass a path to a text file that contains the content of the ecb API:

...
	client.BuildFromEzbFile("....")
...

Expanding the date range

The ECB does not deliver a rate for every day. For example for Sundays no rates are delivered. If you build the client to fetch rates from e.g. Sunday to next Monday which can be a holiday and you then try to get the rate of the first Sunday, then you will not get any rate. To avoid this, the date range is expanded 10 days at both sides.

Notes

Please check the result state before using it. The ecb server is not always available.

Links

Travis CI

Drawings