Logo

Who is talking?

Archive

F#: Disabling SSL Certificate validation

about 1 year ago | Kristof Mattei: Kristof's blog

Yesterday I wanted to download some content off a website with F#, however unfortunately the certificate of the website was expired. let result = try let request = "https://somewebsite/with/expired/ssl/certificate/data.json?paramx=1&paramy=2" |> WebRequest.Create let response = request.GetResponse () // parse data let parsed = "..." Ok parsed with | ex -> Error ex If we execute this, … Continue reading "F#: Disabling SSL Certificate validation" The post F#: Disabling SSL Certificate validation appeared first on Kristof's blog.

F#: Disabling SSL Certificate validation

about 1 year ago | Kristof Mattei: Kristof's blog

Yesterday I wanted to download some content off a website with F#, however unfortunately the certificate of the website was expired. let result = try let request = "https://somewebsite/with/expired/ssl/certificate/data.json?paramx=1&paramy=2" |> WebRequest.Create let response = request.GetResponse () // parse data let parsed = "..." Ok parsed with | ex -> Error ex If we execute this, … Continue reading "F#: Disabling SSL Certificate validation" The post F#: Disabling SSL Certificate validation appeared first on Kristof's blog.

Be careful with npm shrinkwrap

over 1 year ago | Kristof Mattei: Kristof's blog

Recently we had the issue that we used version x of an npm package. However in the course of time this package was updated by the author and contained a critical bug, which broke our AWS deployments. Locally this was no issue because we had a version installed that satisfied the version requirements. In order … Continue reading "Be careful with npm shrinkwrap" The post Be careful with npm shrinkwrap appeared first on Kristof's blog.

Be careful with npm shrinkwrap

over 1 year ago | Kristof Mattei: Kristof's blog

Recently we had the issue that we used version x of an npm package. However in the course of time this package was updated by the author and contained a critical bug, which broke our AWS deployments. Locally this was no issue because we had a version installed that satisfied the version requirements. In order … Continue reading "Be careful with npm shrinkwrap" The post Be careful with npm shrinkwrap appeared first on Kristof's blog.

DynamoDb & updating objects: it’s doesn’t react like SQL!

almost 2 years ago | Kristof Mattei: Kristof's blog

Today I stumbled upon the following bug: We had an object with some properties that we wanted to update, but only if a certain property of that object is not set, i.e. it should be null. { "Id": 1, // Id is the HashKey } In this case we wanted to update the object with … Continue reading "DynamoDb & updating objects: it’s doesn’t react like SQL!" The post DynamoDb & updating objects: it’s doesn’t react like SQL! appeared first on Kristof's blog.

DynamoDb & updating objects: it’s doesn’t react like SQL!

almost 2 years ago | Kristof Mattei: Kristof's blog

Today I stumbled upon the following bug: We had an object with some properties that we wanted to update, but only if a certain property of that object is not set, i.e. it should be null. { "Id": 1, // Id is the HashKey } In this case we wanted to update the object with … Continue reading "DynamoDb & updating objects: it’s doesn’t react like SQL!" The post DynamoDb & updating objects: it’s doesn’t react like SQL! appeared first on Kristof's blog.

AWS & Encryption keys: Revert manually edited policy

about 2 years ago | Kristof Mattei: Kristof's blog

Since we’ve been working with AWS we sometimes did stuff that, after looking back on it, wasn’t the best approach. One of those things was manually applying Key Policies on Encryption Keys. It currently looked like this: Notice the sentence: We’ve detected that the policy document for this key has been manually edited. You may … Continue reading "AWS & Encryption keys: Revert manually edited policy" The post AWS & Encryption keys: Revert manually edited policy appeared first on Kristof's blog.

AWS & Encryption keys: Revert manually edited policy

about 2 years ago | Kristof Mattei: Kristof's blog

Since we’ve been working with AWS we sometimes did stuff that, after looking back on it, wasn’t the best approach. One of those things was manually applying Key Policies on Encryption Keys. It currently looked like this: Notice the sentence: We’ve detected that the policy document for this key has been manually edited. You may … Continue reading "AWS & Encryption keys: Revert manually edited policy" The post AWS & Encryption keys: Revert manually edited policy appeared first on Kristof's blog.

Topshelf install, PowerShell and Get-Credentials

over 2 years ago | Kristof Mattei: Kristof's blog

In the project I’m currently working at we use PowerShell script for configuration and build execution. This means that if you get a new laptop, or a new member joins the team, or even when you need to change your Windows password, you just need to run the script again and it will set up … Continue reading "Topshelf install, PowerShell and Get-Credentials" The post Topshelf install, PowerShell and Get-Credentials appeared first on Kristof's blog.

Topshelf install, PowerShell and Get-Credentials

over 2 years ago | Kristof Mattei: Kristof's blog

In the project I’m currently working at we use PowerShell script for configuration and build execution. This means that if you get a new laptop, or a new member joins the team, or even when you need to change your Windows password, you just need to run the script again and it will set up … Continue reading "Topshelf install, PowerShell and Get-Credentials" The post Topshelf install, PowerShell and Get-Credentials appeared first on Kristof's blog.

When frameworks try to be smart, AngularJS & Expressions

over 2 years ago | Kristof Mattei: Kristof's blog

One of my colleagues just discovered this bug/feature in AngularJS. Using an ngIf on a string "no" will result in false. HTML: <div ng-app> <div ng-controller="yesNoController"> <div ng-if="yes">Yes is defined, will display</div> <div ng-if="no">No is defined, but will not display on Angular 1.2.1</div> <div ng-if="notDefined">Not defined, will not display</div> </div> </div> JavaScript: function yesNoController($scope) { … Continue reading "When frameworks try to be smart, AngularJS & Expressions" The post When frameworks try to be smart, AngularJS & Expressions appeared first on Kristof's blog.

When frameworks try to be smart, AngularJS & Expressions

over 2 years ago | Kristof Mattei: Kristof's blog

One of my colleagues just discovered this bug/feature in AngularJS. Using an ngIf on a string "no" will result in false. HTML: <div ng-app> <div ng-controller="yesNoController"> <div ng-if="yes">Yes is defined, will display</div> <div ng-if="no">No is defined, but will not display on Angular 1.2.1</div> <div ng-if="notDefined">Not defined, will not display</div> </div> </div> JavaScript: function yesNoController($scope) { … Continue reading "When frameworks try to be smart, AngularJS & Expressions" The post When frameworks try to be smart, AngularJS & Expressions appeared first on Kristof's blog.

Enabling dynamic compression (gzip) for WebAPI and IIS

over 2 years ago | Kristof Mattei: Kristof's blog

A lot of code on the internet refers to writing custom ActionFilters, or even HttpHandlers that will compress your return payload for you. For example, see this package (which with its name implies that it is Microsoft, but then says it’s not Microsoft). At the moment of writing the above-linked package even throws an error … Continue reading "Enabling dynamic compression (gzip) for WebAPI and IIS" The post Enabling dynamic compression (gzip) for WebAPI and IIS appeared first on Kristof's blog.

Enabling dynamic compression (gzip) for WebAPI and IIS

over 2 years ago | Kristof Mattei: Kristof's blog

A lot of code on the internet refers to writing custom ActionFilters, or even HttpHandlers that will compress your return payload for you. For example, see this package (which with its name implies that it is Microsoft, but then says it’s not Microsoft). At the moment of writing the above-linked package even throws an error … Continue reading "Enabling dynamic compression (gzip) for WebAPI and IIS" The post Enabling dynamic compression (gzip) for WebAPI and IIS appeared first on Kristof's blog.

Update on handedness (menu location)

almost 3 years ago | Kristof Mattei: Kristof's blog

A while back I wrote how to change the handedness (which seems to be the correct term, instead of the dreadful ‘Menu on the wrong side with a touch screen’). I got a machine in my hands which exhibited the previously mentioned problem. However Tablet PC Settings weren’t installed, so we couldn’t open the tab. After … Continue reading "Update on handedness (menu location)" The post Update on handedness (menu location) appeared first on Kristof's blog.

Update on handedness (menu location)

almost 3 years ago | Kristof Mattei: Kristof's blog

A while back I wrote how to change the handedness (which seems to be the correct term, instead of the dreadful ‘Menu on the wrong side with a touch screen’). I got a machine in my hands which exhibited the previously mentioned problem. However Tablet PC Settings weren’t installed, so we couldn’t open the tab. After … Continue reading "Update on handedness (menu location)" The post Update on handedness (menu location) appeared first on Kristof's blog.

The impact of SqlDataReader.GetOrdinal on performance

about 3 years ago | Kristof Mattei: Kristof's blog

I recently had a discussion about the impact of SqlDataReader.GetOrdinal on execution of a SqlClient.SqlCommand. I then decided to run some code to measure the difference, because I think that’s the only way to get a decent opinion. This is the code that I’ve used to run a certain query 1000 times: private void InvokeQuery(Action mapObject) … Continue reading "The impact of SqlDataReader.GetOrdinal on performance" The post The impact of SqlDataReader.GetOrdinal on performance appeared first on Kristof's blog.

The impact of SqlDataReader.GetOrdinal on performance

about 3 years ago | Kristof Mattei: Kristof's blog

I recently had a discussion about the impact of SqlDataReader.GetOrdinal on execution of a SqlClient.SqlCommand. I then decided to run some code to measure the difference, because I think that’s the only way to get a decent opinion. This is the code that I’ve used to run a certain query 1000 times: private void InvokeQuery(Action mapObject) … Continue reading "The impact of SqlDataReader.GetOrdinal on performance" The post The impact of SqlDataReader.GetOrdinal on performance appeared first on Kristof's blog.

Menu on the wrong side with a touch screen?

about 3 years ago | Kristof Mattei: Kristof's blog

When you’re reading this you probably have a touch screen. So, I never use my touch screen. Almost never. But I did notice that by default my menus in Windows (from a menu bar, not a ribbon) appear (when possible) on the right side of the clicked menu item. Like this: Goosebumps. Something is off. … Continue reading "Menu on the wrong side with a touch screen?" The post Menu on the wrong side with a touch screen? appeared first on Kristof's blog.

Menu on the wrong side with a touch screen?

about 3 years ago | Kristof Mattei: Kristof's blog

When you’re reading this you probably have a touch screen. So, I never use my touch screen. Almost never. But I did notice that by default my menus in Windows (from a menu bar, not a ribbon) appear (when possible) on the right side of the clicked menu item. Like this: Goosebumps. Something is off. … Continue reading "Menu on the wrong side with a touch screen?" The post Menu on the wrong side with a touch screen? appeared first on Kristof's blog.

TransactionScope & SqlConnection not rolling back? Here’s why…

about 3 years ago | Kristof Mattei: Kristof's blog

A while back we ran into an issue with one of our projects where we executed a erroneous query (missing DELETE statement), and then left the database in an inconsistent state. Which is weird, considering the fact that we use a TransactionScope. After some digging around I found the behavior I wanted, and how to … Continue reading "TransactionScope & SqlConnection not rolling back? Here’s why…" The post TransactionScope & SqlConnection not rolling back? Here’s why… appeared first on Kristof's blog.

About a dictionary, removing and adding items, and their order.

over 3 years ago | Kristof Mattei: Kristof's blog

I had a weird problem today using a Dictionary. The process involved removing and adding data, and then printing the data. I assumed that it was ordered. I was wrong! Let me show you: var dictionary = new Dictionary<int, string>(); dictionary.Add(5, "The"); dictionary.Add(7, "quick"); dictionary.Add(31, "brown"); dictionary.Add(145, "fox"); dictionary.Remove(7); // remove the "quick" entry After a […] The post About a dictionary, removing and adding items, and their order. appeared first on Kristof's blog.

Default values and overloads are not the same!

over 3 years ago | Kristof Mattei: Kristof's blog

Consider the following class of the Awesome(r) library, using default parameters. public class Foo { public void DoCall(int timeout = 10) { /* awesome implementation goes here */ } } You get the dll and that class & function in your code, like this: Foo foo = new Foo(); foo.DoCall(); Can’t get much easier than […] The post Default values and overloads are not the same! appeared first on Kristof's blog.

Make sure unattended.xml is not encrypted!

almost 4 years ago | Kristof Mattei: Kristof's blog

I was playing around with Sysprep when I hit a weird issue with VirtualBox and Encrypted folders on the host. Setup: unattended.xml on the host, encrypted (with Windows EFS). Virtual Machine, hosted in VirtualBox I mounted the folder with unattended.xml (and other files) inside the VirtualBox and started sysprep (sysprep+shutdown.cmd just executes the sysprep with […]

Windows 8.1 Preview install: error 0x800705AA – 0x2000C

almost 4 years ago | Kristof Mattei: Kristof's blog

Yesterday I was trying to upgrade a VM to Windows 8.1. The VM had Windows 8 on it. The host software I used was Hyper-V from Windows 8.1 Preview By itself the VM worked fine, and I was able to … Continue reading → The post Windows 8.1 Preview install: error 0x800705AA – 0x2000C appeared first on Kristof's blog.