C# WPF run a function every second

To run a function every second use the DispatcherTimer Class https://docs.microsoft.com/en-us/dotnet/api/system.windows.threading.dispatchertimer?redirectedfrom=MSDN&view=netframework-4.8 DispatcherTimer will tick evey second calling dispatcherTimer_Tick. You can set the interval with a timespan

GitHub Action WorkFlow HCL to YML for AWS Lambda Deploy

To migrate https://github.com/marketplace/actions/aws-lambda-deploy to using yml. Your workflow looks something similar to this: Migrating this to YML Note that you need to add the Access Key ID and Secret Access Key to Github Security

Tagged with:

Connect to a different port with SQL Server Management Studio

Microsoft SQL Server Management Studio (SSMS) will default connect to port 1421 and there’s not obvious way to changing the port number. However it is possible by using a comma in the server name. So in the example:database-1.eu-west-1.rds.amazonaws.com,1521First the server

Tagged with:

Check if two dictionaries have same keys in python

I was lazy loading a large json file and wanted to collect only two keys. Running through with ujson I had to check that I had the correct data. I needed to check if my tmp dict was what I

Tagged with:

Change a value with configparser for python

configparser is a great module to store configuration information into a filehttps://docs.python.org/2/library/configparser.html a config file could look like this: To load the value from the file To change the value in the file:

Tagged with:

Dictionary changed size during iteration while using pop() in python

Running through a json file remove all keys but one This is fine running python2 but in python3 you will run into this error Calling keys() in python2 makes a copy of the keys that we iterate through. This is

Tagged with:

Remove non letter characters before and after characters in Python

To remove none letters characters from the beginning and end in python use regex from the re.py library. I needed it to remove spaces as well but not in between the words. Here’s what I did: Output:

Tagged with:

AWS Lambda – name ‘Key’ is not defined

When going through the example from https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.04.html I ran into the following error message: The error come from this line The issue was that I was only importing boto3, this is not enough. Guess I have to read the whole

Code sign wants to sign using key Allow button not working

A rather stupid error without any indication on what’s wrong. The button Allow always and Allow doesnt work for “Code sign wants to sign using key”. You can press it but does not do anything and the system doesn’t say

Tagged with: ,

Plex on Synology “failed to run the package service”

Got following message from Plex “failed to run the package service” when installing and trying to run it. I had missed adding certificate key. There’s a good tutorial here at plex The public key that needs to be added in

Tagged with: ,