Home » .NET » Page 8

.NET

CoreCLR Documentation

Today I want to show you some documentation that is not directly from the MSDN. Instead, it comes from the team that works on the CoreCLR. So this documentation can be found on GitHub. The CoreCLR is the Open Source implementation of the .NET Runtime from Microsoft. It is open and cross-platform. I selected this documentation since it is very interesting ...

Read More »

Buffer Allocation Strategies – Explaining the solution

In my previous post, I threw a bunch a code at you, with no explanation, and asked you to discuss it. Here is the code, with full discussion below. [ThreadStatic] private static Stack<byte[]>[] _buffersBySize; private static byte[] GetBuffer(int requestedSize) { if(_buffersBySize == null) _buffersBySize = new Stack<byte[]>[32]; var actualSize = PowerOfTwo(requestedSize); var pos = MostSignificantBit(actualSize); if(_buffersBySize[pos] == null) _buffersBySize[pos] = ...

Read More »

Retrieving Table Metadata from SQL Server Catalog Views

Introduction All database systems that I’ve worked with have some sort of system tables that provide information about the tables, columns, indexes, constraints, etc in a database. SQL Server is no exception; in fact there are different ways of querying its System Catalog. We’re going to look at one of these: Catalog Views, which can be queried easily. Being able to ...

Read More »

MSDN Dive – WPF documentation

Let’s go on with the WPF documentation this week. There are some interesting documents that can help you to understand how the WPF works and how you can gain more performance in your applications, once you understand the internals. Freezable Objects – Learn: What freezables are. How freezables work internally. How freezable can help you to improve performance. How to ...

Read More »

Concurrent max value

For a feature in RavenDB, I need to figure out the maximum number of outputs per document an index has. Now, indexing runs in multiple threads at the same time, so we ended up with the following code:   var actualIndexOutput = maxActualIndexOutput; if (actualIndexOutput > numberOfAlreadyProducedOutputs) { // okay, now let verify that this is indeed the case, in ...

Read More »

Working with views in Griffin.Yo

Griffin.Yo is a SPA library written in typescript. My goal is to create a simple library which is easy to get started with, but powerful enough to support building complex web applications. This post will show you how you can work with views in Griffin.Yo. Views are simple HTML pages. They do not contain or facilitate a template language. All ...

Read More »

Snake. Smooth and accurate following behaviour

Following another object is one of the most basic movement behaviours an item can exhibit – both in the real world, and in games. There are many different ways in which objects can follow each other, and depending on the circumstances, different kinds of movement may be appropriate. Today we will look at one particular kind: A number of objects ...

Read More »

Production postmortem: The case of the intrasingent new database

A customer called us to tell that they had a problem with RavenDB. As part of their process for handling new customers, they would create a new database, setup indexes, and then direct all the queries for that customer to that database. Unfortunately, this system that has worked so well in development died a horrible death in production. But, and ...

Read More »

Converting between Structs and Byte Arrays

In object oriented code bases, we tend to express most of not all of our data in highly semantic and contextual ways – that is, we use classes that contain both data and behaviour, and often even more information through inheritance, attributes, and more. However, sometimes we need to extract the data contained in these types – for example for ...

Read More »

Authenticating with Active Directory

Hi! If you work in a corporate environment, chances are that your Windows machine is connected to a domain based on Active Directory. In today’s article, we’re going to write a very simple program that allows us to verify a user’s credentials for the domain using Active Directory. In order to try this out, you’re going to need an Active ...

Read More »