Two Approaches to Searching Users in Active Directory

Source: Two Approaches to Searching Users in Active Directory Thu, Oct 18 2018 I’m sure there are more than two ways to perform searches against Active Directory, however I wanted to highlight two approaches: DirectorySearcher and PrincipalSearcher. The former, DirectorySearcher comes from System.DirectoryServices and it’s the more “bare-metal” version of the two. PrincipalSearcher, of System.DirectoryServices.AccountManagement provenance, is more of a query by example pattern and I’d … Read moreTwo Approaches to Searching Users in Active Directory

SQL server identity column values start at 0 instead of 1

Source:   I’ve got a strange situation with some tables in my database starting its IDs from 0, even though TABLE CREATE has IDENTITY(1,1). This is so for some tables, but not for others. It has worked until today. I’ve tried resetting identity column: DBCC CHECKIDENT (SyncSession, reseed, 0); But new records start with 0. … Read moreSQL server identity column values start at 0 instead of 1

How to save data (e.g. Html) to database and retrieve it properly

Source: The rule of thumb is the following: Store in your database the RAW HTML without any encodings or sanitizings. A SQL server doesn’t care if you store some string containing XSS code. When displaying this output to your page make sure that it is sanitized. So: [HttpPost, ActionName(“Create”)] [ValidateAntiForgeryToken] public ActionResult Create(Post model) … Read moreHow to save data (e.g. Html) to database and retrieve it properly

What is database collation?

Source: What is collation? Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width. Case sensitivity If A and a, B and b, etc.are … Read moreWhat is database collation?

What is bind() and why is used in networking?

Source: It “binds” a socket to an address, otherwise it doesn’t know what address (ip-address/port pair) it should listen to. And bind can be used on the client side as well. One example is on a computer with multiple network cards connected to the same network, but the client only want to be seen as coming from … Read moreWhat is bind() and why is used in networking?

MySQL thread pool versus connection pool


Given that thread and connections in the MySQL Server have been so intertwined, it is easy to confuse the purpose of the MySQL Thread Pool and the purpose of a Connection Pool.

The aim of a Connection Pool is that the MySQL clients should not be forced to constantly do connect and disconnect. Thus it is possible to cache a connection in the MySQL client when a user of the connection no longer needs it. Thus another user that needs a connection to the same MySQL Server can reuse this cached connection later on.

This saves execution time in both the client and the server. It does however not change the dynamics of how many queries are executed in parallel in the MySQL Server. This means that the likelihood of too many concurrent queries to execute in the MySQL Server is the same with or without a Connection Pool.

Also a Connection Pool operates on the client side. This means that it doesn’t see the state of the MySQL Server when deciding whether to send a query to the MySQL Server or not. Thus it doesn’t have the required information to decide whether to queue a query or not. Only the MySQL Server have this information and thus the MySQL Thread Pool has to operate in the MySQL Server. It cannot perform its task on the client side.

Thus it is easy to see that the MySQL Thread Pool and a Connection Pool are orthogonal and can be used independent of each other.



SQL Server- Duplicate Values in Identity Columns

Source: SQL Server internally manages the values of Identity Columns and does not generate any Duplicate Values. The problem occurs when we manually insert or RESEED the Identity Values. Today I will give a couple of examples which can result in Duplicate Identity Values : RESEED Identity Values can generate Duplicate Records: Whenever we RESEED … Read moreSQL Server- Duplicate Values in Identity Columns

What is the difference between a domain, a workgroup, and a homegroup?

  Source:   Applies to Windows 7   Domains, workgroups, and homegroups represent different methods for organizing computers in networks. The main difference among them is how the computers and other resources on the networks are managed. Computers running Windows on a network must be part of a workgroup or a domain. Computers running Windows on … Read moreWhat is the difference between a domain, a workgroup, and a homegroup?

How to properly exit a c# application

From MSDN: Application.Exit Informs all message pumps that they must terminate, and then closes all application windows after the messages have been processed. This is the code to use if you are have called Application.Run (WinForms applications), this method stops all running message loops on all threads and closes all windows of the application. Environment.Exit … Read moreHow to properly exit a c# application

Exploring MySQL variables

Source: The interactive_timeout variable was introduced in very early MySQL days primarily  in order to make it possible to have a low timeout setting for server-side scripts and a higher setting for interactive clients operated by a human. The server scripts will use the (typically low) wait_timeout setting and the interactive clients will use the (typically higher) interactive_timeout setting. We have … Read moreExploring MySQL variables