RSS

Monthly Archives: October 2017

C# Bit Shorthand

1 << 0; // Result is 1
1 << 1; // Result is 2
1 << 2; // Result is 4
1 << 3; // Result is 8

The way this works is, the binary value of first operand (the left) is shifted by number of bits of the second operand. Something like this:

1 is 00001 in binary which is 1 << 0
2 is 00010 in binary which is 1 << 1
3 is 00100 in binary which is 1 << 2
So on, so forth.

Another way to look at it is "adding X zero in the first operand's binary, where X is second operand.".

The kicker is that, second operand is only the first 5 bits (low-order five bits), means 00000 to 11111 (which is 31)

Reference: MSDN << Operator

Advertisements
 
Leave a comment

Posted by on October 28, 2017 in General

 

Tags:

Change Azure Storage Emulator Database

By default, it’s going to: (localdb)\mssqllocaldb or other local database depends on SQL / SDK version installed. Check this link for more local database instances.

To change to use SQL instance:

The command:

C:\> AzureStorageEmulator.exe init /server <SQLServerInstance>

Example:

C:\> AzureStorageEmulator.exe init /server .\

Reference:
Microsoft Azure

 
Leave a comment

Posted by on October 24, 2017 in General

 
 
%d bloggers like this: