ws=D: $t IF ".$*." == ".." (cd D:\1Stop-Project\TradingParterManagement) ELSE (cd $*) $t subl .

Client Server
—> syn=1 seq=x —>
<— ack=x+1 seq=y <—
—> ack=y+1 seq=z —>

Summary:

Equivalent to HTTP status 100. System.Net.HttpStatusCode.Continue indicates
that the client can continue with its request.

Continue = 100,

Summary:

Equivalent to HTTP status 101. System.Net.HttpStatusCode.SwitchingProtocols
indicates that the protocol version or protocol is being changed.

SwitchingProtocols = 101,

Summary:

Equivalent to HTTP status 200. System.Net.HttpStatusCode.OK indicates that
the request succeeded and that the requested information is in the response.
This is the most common status code to receive.

OK = 200,

Summary:

Equivalent to HTTP status 201. System.Net.HttpStatusCode.Created indicates
that the request resulted in a new resource created before the response was
sent.

Created = 201,

Summary:

Equivalent to HTTP status 202. System.Net.HttpStatusCode.Accepted indicates
that the request has been accepted for further processing.

Accepted = 202,

Summary:

Equivalent to HTTP status 203. System.Net.HttpStatusCode.NonAuthoritativeInformation
indicates that the returned metainformation is from a cached copy instead
of the origin server and therefore may be incorrect.

NonAuthoritativeInformation = 203,

Summary:

Equivalent to HTTP status 204. System.Net.HttpStatusCode.NoContent indicates
that the request has been successfully processed and that the response is
intentionally blank.

NoContent = 204,

Summary:

Equivalent to HTTP status 205. System.Net.HttpStatusCode.ResetContent indicates
that the client should reset (not reload) the current resource.

ResetContent = 205,

Summary:

Equivalent to HTTP status 206. System.Net.HttpStatusCode.PartialContent indicates
that the response is a partial response as requested by a GET request that
includes a byte range.

PartialContent = 206,

Summary:

Equivalent to HTTP status 300. System.Net.HttpStatusCode.MultipleChoices
indicates that the requested information has multiple representations. The
default action is to treat this status as a redirect and follow the contents
of the Location header associated with this response.

MultipleChoices = 300,

Summary:

Equivalent to HTTP status 300. System.Net.HttpStatusCode.Ambiguous indicates
that the requested information has multiple representations. The default
action is to treat this status as a redirect and follow the contents of the
Location header associated with this response.

Ambiguous = 300,

Summary:

Equivalent to HTTP status 301. System.Net.HttpStatusCode.MovedPermanently
indicates that the requested information has been moved to the URI specified
in the Location header. The default action when this status is received is
to follow the Location header associated with the response.

MovedPermanently = 301,

Summary:

Equivalent to HTTP status 301. System.Net.HttpStatusCode.Moved indicates
that the requested information has been moved to the URI specified in the
Location header. The default action when this status is received is to follow
the Location header associated with the response. When the original request
method was POST, the redirected request will use the GET method.

Moved = 301,

Summary:

Equivalent to HTTP status 302. System.Net.HttpStatusCode.Found indicates
that the requested information is located at the URI specified in the Location
header. The default action when this status is received is to follow the
Location header associated with the response. When the original request method
was POST, the redirected request will use the GET method.

Found = 302,

Summary:

Equivalent to HTTP status 302. System.Net.HttpStatusCode.Redirect indicates
that the requested information is located at the URI specified in the Location
header. The default action when this status is received is to follow the
Location header associated with the response. When the original request method
was POST, the redirected request will use the GET method.

Redirect = 302,

Summary:

Equivalent to HTTP status 303. System.Net.HttpStatusCode.SeeOther automatically
redirects the client to the URI specified in the Location header as the result
of a POST. The request to the resource specified by the Location header will
be made with a GET.

SeeOther = 303,

Summary:

Equivalent to HTTP status 303. System.Net.HttpStatusCode.RedirectMethod automatically
redirects the client to the URI specified in the Location header as the result
of a POST. The request to the resource specified by the Location header will
be made with a GET.

RedirectMethod = 303,

Summary:

Equivalent to HTTP status 304. System.Net.HttpStatusCode.NotModified indicates
that the client's cached copy is up to date. The contents of the resource
are not transferred.

NotModified = 304,

Summary:

Equivalent to HTTP status 305. System.Net.HttpStatusCode.UseProxy indicates
that the request should use the proxy server at the URI specified in the
Location header.

UseProxy = 305,

Summary:

Equivalent to HTTP status 306. System.Net.HttpStatusCode.Unused is a proposed
extension to the HTTP/1.1 specification that is not fully specified.

Unused = 306,

Summary:

Equivalent to HTTP status 307. System.Net.HttpStatusCode.RedirectKeepVerb
indicates that the request information is located at the URI specified in
the Location header. The default action when this status is received is to
follow the Location header associated with the response. When the original
request method was POST, the redirected request will also use the POST method.

RedirectKeepVerb = 307,

Summary:

Equivalent to HTTP status 307. System.Net.HttpStatusCode.TemporaryRedirect
indicates that the request information is located at the URI specified in
the Location header. The default action when this status is received is to
follow the Location header associated with the response. When the original
request method was POST, the redirected request will also use the POST method.

TemporaryRedirect = 307,

Summary:

Equivalent to HTTP status 400. System.Net.HttpStatusCode.BadRequest indicates
that the request could not be understood by the server. System.Net.HttpStatusCode.BadRequest
is sent when no other error is applicable, or if the exact error is unknown
or does not have its own error code.

BadRequest = 400,

Summary:

Equivalent to HTTP status 401. System.Net.HttpStatusCode.Unauthorized indicates
that the requested resource requires authentication. The WWW-Authenticate
header contains the details of how to perform the authentication.

Unauthorized = 401,

Summary:

Equivalent to HTTP status 402. System.Net.HttpStatusCode.PaymentRequired
is reserved for future use.

PaymentRequired = 402,

Summary:

Equivalent to HTTP status 403. System.Net.HttpStatusCode.Forbidden indicates
that the server refuses to fulfill the request.

Forbidden = 403,

Summary:

Equivalent to HTTP status 404. System.Net.HttpStatusCode.NotFound indicates
that the requested resource does not exist on the server.

NotFound = 404,

Summary:

Equivalent to HTTP status 405. System.Net.HttpStatusCode.MethodNotAllowed
indicates that the request method (POST or GET) is not allowed on the requested
resource.

MethodNotAllowed = 405,

Summary:

Equivalent to HTTP status 406. System.Net.HttpStatusCode.NotAcceptable indicates
that the client has indicated with Accept headers that it will not accept
any of the available representations of the resource.

NotAcceptable = 406,

Summary:

Equivalent to HTTP status 407. System.Net.HttpStatusCode.ProxyAuthenticationRequired
indicates that the requested proxy requires authentication. The Proxy-authenticate
header contains the details of how to perform the authentication.

ProxyAuthenticationRequired = 407,

Summary:

Equivalent to HTTP status 408. System.Net.HttpStatusCode.RequestTimeout indicates
that the client did not send a request within the time the server was expecting
the request.

RequestTimeout = 408,

Summary:

Equivalent to HTTP status 409. System.Net.HttpStatusCode.Conflict indicates
that the request could not be carried out because of a conflict on the server.

Conflict = 409,

Summary:

Equivalent to HTTP status 410. System.Net.HttpStatusCode.Gone indicates that
the requested resource is no longer available.

Gone = 410,

Summary:

Equivalent to HTTP status 411. System.Net.HttpStatusCode.LengthRequired indicates
that the required Content-length header is missing.

LengthRequired = 411,

Summary:

Equivalent to HTTP status 412. System.Net.HttpStatusCode.PreconditionFailed
indicates that a condition set for this request failed, and the request cannot
be carried out. Conditions are set with conditional request headers like
If-Match, If-None-Match, or If-Unmodified-Since.

PreconditionFailed = 412,

Summary:

Equivalent to HTTP status 413. System.Net.HttpStatusCode.RequestEntityTooLarge
indicates that the request is too large for the server to process.

RequestEntityTooLarge = 413,

Summary:

Equivalent to HTTP status 414. System.Net.HttpStatusCode.RequestUriTooLong
indicates that the URI is too long.

RequestUriTooLong = 414,

Summary:

Equivalent to HTTP status 415. System.Net.HttpStatusCode.UnsupportedMediaType
indicates that the request is an unsupported type.

UnsupportedMediaType = 415,

Summary:

Equivalent to HTTP status 416. System.Net.HttpStatusCode.RequestedRangeNotSatisfiable
indicates that the range of data requested from the resource cannot be returned,
either because the beginning of the range is before the beginning of the
resource, or the end of the range is after the end of the resource.

RequestedRangeNotSatisfiable = 416,

Summary:

Equivalent to HTTP status 417. System.Net.HttpStatusCode.ExpectationFailed
indicates that an expectation given in an Expect header could not be met
by the server.

ExpectationFailed = 417,

Summary:

Equivalent to HTTP status 426. System.Net.HttpStatusCode.UpgradeRequired
indicates that the client should switch to a different protocol such as TLS/1.0.

UpgradeRequired = 426,

Summary:

Equivalent to HTTP status 500. System.Net.HttpStatusCode.InternalServerError
indicates that a generic error has occurred on the server.

InternalServerError = 500,

Summary:

Equivalent to HTTP status 501. System.Net.HttpStatusCode.NotImplemented indicates
that the server does not support the requested function.

NotImplemented = 501,

Summary:

Equivalent to HTTP status 502. System.Net.HttpStatusCode.BadGateway indicates
that an intermediate proxy server received a bad response from another proxy
or the origin server.

BadGateway = 502,

Summary:

Equivalent to HTTP status 503. System.Net.HttpStatusCode.ServiceUnavailable
indicates that the server is temporarily unavailable, usually due to high
load or maintenance.

ServiceUnavailable = 503,

Summary:

Equivalent to HTTP status 504. System.Net.HttpStatusCode.GatewayTimeout indicates
that an intermediate proxy server timed out while waiting for a response
from another proxy or the origin server.

GatewayTimeout = 504,

Summary:

Equivalent to HTTP status 505. System.Net.HttpStatusCode.HttpVersionNotSupported
indicates that the requested HTTP version is not supported by the server.

HttpVersionNotSupported = 505,

Auto Property Initializers

public class Developer
{
public bool DrinksCoffee {get;set;} = true;
}

Dictionary Initializers

var devSkills = new Dictionary<string, bool>();

devSkills["C#"] = true;
devSkills["HTML"] = true;

var devSkills = new Dictionary<string, bool>() {
["C#"] = true,
["VB.NET"] = true,
["HTML"] = true
};
```

### String Interpolation

```csharp
string test = "test1" + "with " + test2 + " finished.";
string test2 = string.Fromat("{0} {1}, {2} @ {3}", test1, test3, test4, test5);

var testCsharp6 = $"{firstName} {middleName} {lastName} , {jobTitle} @ {Company}";

Null Conditional Operator

public string[] GenerateCoffeeOrder(Coffee[] favCoffee)
{
var order = favCoffee?.Select(x => $"{x.Name} - {x.Size}").ToArray();

return order;
}

\?.\

  • “?” If the variable is null, then return null.
  • Otherwise execute whatever is after the “.”

Name of Expression

public string[] GenerateCoffeeOrder(Coffee[] favCoffee)
{
if (favCoffee == null)
{
throw new ArgumentNullException("favCoffee");
}

var order = favCoffee.Select(x => $"{x.Name} - {x.Size}").ToArray();

return order;
}

public string[] GenerateCoffeeOrder(Coffee[] coffeeOrders)
{
if (coffeeOrders == null)
{
throw new ArgumentNullException(nameof(coffeeOrders));
}

var order = coffeeOrders.Select(x => $"{x.Name} - {x.Size}").ToArray();

return order;
}

Expression Bodied Functions & Properties

public class Coffee {
public string Name {get;set;}
public string Size {get;set;}
public string OrderDescription => $"{Name} - {Size}";
}

Exception Filters

catch (SqlException ex) when (ex.ErrorCode == -2)
{
return "Timeout Error";
}
catch (SqlException ex) when (ex.ErrorCode == 1205)
{
return "Deadlock occurred";
}
catch (SqlException)
{
return "Unknown";
}

catch (SqlException ex) when (HttpContext.Current.Identity.Name == "Boss Man" || DateTime.Now.DayOfWeek == DayOfWeek.Saturday || DateTime.Now.DayOfWeek == DayOfWeek.Sunday) {
// Do nothing
}

Static Using

public double GetArea(double radius)
{

return Math.PI * Math.Pow(radius, 2);
}

public double GetArea(double radius
{
return PI * Pow(radius, 2)
;

}

Await in Catch and Finally Blocks

Extension Add in Collection Initializers

Youtube:

Enhanced .NET Unit Testing | David Gardiner

AutoFixture

https://github.com/AutoFixture/AutoFixture/

Approval Tests

Shouldly

dotMemory Unit

NBench

{
"hot_exit": false,
"remember_open_files": false
}

It’s usually just easier to skip the mouse altogether—or it would be if Sublime didn’t mess up multiselect when word wrapping. Here’s the official documentation on using the keyboard and mouse for multiple selection. Since it’s a bit spread out, I’ll summarize it:

Where shortcuts are different in Sublime Text 3, I’ve made a note. For v3, I always test using the latest dev build; if you’re using the beta build, your experience may be different.

If you lose your selection when switching tabs or windows (particularly on Linux), try using Ctrl + U to restore it.

Mouse

Windows/Linux

Building blocks:


  • Positive/negative:


    • Add to selection: Ctrl

    • Subtract from selection: Alt In early builds of v3, this didn’t work for linear selection.


  • Selection type:


    • Linear selection: Left Click

    • Block selection: Middle Click or Shift + Right Click On Linux, middle click pastes instead by default.


Combine as you see fit. For example:


  • Add to selection: Ctrl + Left Click (and optionally drag)

  • Subtract from selection: Alt + Left Click This didn’t work in early builds of v3.

  • Add block selection: Ctrl + Shift + Right Click (and drag)

  • Subtract block selection: Alt + Shift + Right Click (and drag)

Mac OS X

Building blocks:


  • Positive/negative:


    • Add to selection:

    • Subtract from selection: ⇧⌘ (only works with block selection in v3; presumably bug)


  • Selection type:


    • Linear selection: Left Click

    • Block selection: Middle Click or + Left Click


Combine as you see fit. For example:


  • Add to selection: + Left Click (and optionally drag)

  • Subtract from selection: ⇧⌘ + Left Click (and drag—this combination doesn’t work in Sublime Text 3, but supposedly it works in 2)

  • Add block selection: ⌥⌘ + Left Click (and drag)

  • Subtract block selection: ⌥⇧⌘ + Left Click (and drag)

Keyboard

Windows


  • Return to single selection mode: Esc

  • Extend selection upward/downward at all carets: Ctrl + Alt + Up/Down

  • Extend selection leftward/rightward at all carets: Shift + Left/Right

  • Move all carets up/down/left/right, and clear selection: Up/Down/Left/Right

  • Undo the last selection motion: Ctrl + U

  • Add next occurrence of selected text to selection: Ctrl + D

  • Add all occurrences of the selected text to the selection: Alt + F3

  • Rotate between occurrences of selected text (single selection): Ctrl + F3 (reverse: Ctrl + Shift + F3)

  • Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: Ctrl + Shift + L

Linux


  • Return to single selection mode: Esc

  • Extend selection upward/downward at all carets: Alt + Up/Down Note that you may be able to hold Ctrl as well to get the same shortcuts as Windows, but Linux tends to use Ctrl + Alt combinations for global shortcuts.

  • Extend selection leftward/rightward at all carets: Shift + Left/Right

  • Move all carets up/down/left/right, and clear selection: Up/Down/Left/Right

  • Undo the last selection motion: Ctrl + U

  • Add next occurrence of selected text to selection: Ctrl + D

  • Add all occurrences of the selected text to the selection: Alt + F3

  • Rotate between occurrences of selected text (single selection): Ctrl + F3 (reverse: Ctrl + Shift + F3)

  • Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: Ctrl + Shift + L

Mac OS X


  • Return to single selection mode: (that’s the Mac symbol for Escape)

  • Extend selection upward/downward at all carets: ⌃⇧⇡, ⌃⇧⇣ (See note)

  • Extend selection leftward/rightward at all carets: ⇧⇠/⇧⇢

  • Move all carets up/down/left/right and clear selection: , , ,

  • Undo the last selection motion: ⌘U

  • Add next occurrence of selected text to selection: ⌘D

  • Add all occurrences of the selected text to the selection: ⌃⌘G

  • Rotate between occurrences of selected text (single selection): ⌥⌘G (reverse: ⌥⇧⌘G)

  • Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: ⇧⌘L

Notes for Mac users

On Yosemite and El Capitan, ⌃⇧⇡ and ⌃⇧⇣ are system keyboard shortcuts by default. If you want them to work in Sublime Text, you will need to change them:


  1. Open System Preferences.

  2. Select the Shortcuts tab.

  3. Select Mission Control in the left listbox.

  4. Change the keyboard shortcuts for Mission Control and Application windows (or disable them). I use ⌃⌥⇡ and ⌃⌥⇣. They defaults are ⌃⇡ and ⌃⇣; adding to those shortcuts triggers the same actions, but slows the animations.

In case you’re not familiar with Mac’s keyboard symbols:


  • is the escape key

  • is the control key

  • is the option key

  • is the shift key

  • is the command key

  • et al are the arrow keys, as depicted