This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void Main() | |
| { | |
| var validEmailList = new List<EmailAddress>() | |
| { | |
| new EmailAddress("[email protected]"), | |
| new EmailAddress("[email protected]", true) | |
| }; | |
| IsValidPrimaryCollection(validEmailList) | |
| .Dump("One email marked as primary"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
| Enable-RemoteDesktop | |
| #Browsers | |
| cinst firefox | |
| #CLI Tools | |
| cinst openssh | |
| cinst poshgit | |
| cinst cmder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ValidDecimalAttribute : ValidationAttribute | |
| { | |
| public decimal MinValue { get; set; } = decimal.MinValue; | |
| public decimal MaxValue { get; set; } = decimal.MaxValue; | |
| public override bool IsValid(object value) | |
| { | |
| if (value != null && !(value is string)) | |
| return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Notes: | |
| concat :: [[a]] -> [a] | |
| concat xss = [x | xs <- xss, x <- xs] | |
| len :: [a] -> Int | |
| len xs = sum [1 | _ <- xs] | |
| factors :: Int -> [Int] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HttpContext.Current = new HttpContext( | |
| new HttpRequest("", "http://tempuri.org", ""), new HttpResponse(new StringWriter())); | |
| NameValueCollection headers = HttpContext.Current.Request.Headers; | |
| Type t = headers.GetType(); | |
| const BindingFlags nonPublicInstanceMethod = BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance; | |
| t.InvokeMember("MakeReadWrite", nonPublicInstanceMethod, null, headers, null); | |
| t.InvokeMember("InvalidateCachedArrays", nonPublicInstanceMethod, null, headers, null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| namespace BuildRunner.Services | |
| { | |
| public class ProcessBuilder | |
| { | |
| public ProcessStartInfo ProcessStartInfo { get; private set; } | |
| private Process _instance; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :- dynamic event/1. | |
| :- dynamic rule/3. | |
| :- dynamic situation/6. | |
| %%%%%%%%%%%%% Event Database (our working memory, or what we know) | |
| event([(freq_visited_terrorist_url(abcal), tq([]))]). | |
| event([(visited_url(jackson,abcal,10), tq(5,15))]). | |
| event([(passport_record(jackson,country-xyz),tq(5,35))]). | |
| event([(near(jackson,gg_bridge), tq(20,25))]). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let get5 = new Promise((resolve, reject) => resolve( 5 )); | |
| let add1 = n => n + 1; | |
| get5 | |
| .then(add1) | |
| .then(add1) | |
| .then(add1) | |
| .then(add1) | |
| .then(console.log); // 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% This is our Prolog program—the beginnings of a full-fledged AI system. | |
| %% The symbol to the left indicates a comment. First one declares the objects | |
| %% in our rules. The number indicates the number of arguments for the object. For | |
| %% example, “has_toll/2” indicates that “has_toll” takes two arguments. | |
| :- dynamic has_toll/2. | |
| :- dynamic is_type/2. | |
| :- dynamic has_purpose/2. | |
| %% Here are three rules with variables. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( function ( window, $ ) { | |
| "use strict"; | |
| window.AjaxController = api | |
| function api( controller ) { | |
| this.controllerUrl = "/api/" + controller + "/"; | |
| } | |
| api.prototype.Post = function ( endpoint, data ) { |
NewerOlder