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
| Uri sourceBaseUri; | |
| var isValidUri = Uri.TryCreate("ftp://somedomain.com/somefolder/someotherfolder/somefile.zip", UriKind.Absolute, out sourceBaseUri); | |
| if(isValidUri) | |
| { | |
| Console.WriteLine("URI is valid"); | |
| } | |
| if(sourceBaseUri.Scheme == Uri.UriSchemeFtp) | |
| { |
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 inverse x = 1.0/x | |
| let inverseNext x = 1.0/(x+2.0) | |
| let substractNextInverse x = inverse x - inverseNext x | |
| let skip4List accuracy = [1.0 .. 4.0 .. accuracy] | |
| let add a b = a + b | |
| let inverses accuracy = (List.map substractNextInverse (skip4List accuracy)) | |
| let PI accuracy = (List.reduce add (inverses accuracy)) * 4.0 | |
| let pi10000000 = PI 10000000.0 |
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
| var aesAlgorithm = new System.Security.Cryptography.AesManaged(); | |
| aesAlgorithm.GenerateIV(); | |
| aesAlgorithm.GenerateKey(); | |
| var key = aesAlgorithm.Key; | |
| var iv = aesAlgorithm.IV; | |
| Console.WriteLine(key.Length); | |
| Console.WriteLine(key); | |
| Console.WriteLine(iv.Length); | |
| Console.WriteLine(iv); |
NewerOlder