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
| module Persimmon.FsCheck | |
| open Persimmon | |
| open FsCheck | |
| open System.Diagnostics | |
| open FsCheck.Random | |
| open System | |
| type FsCheckConfig = { | |
| MaxTest : 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
| namespace Fake.Testing | |
| #if !FAKE | |
| #load "../../../../.fake/build.fsx/intellisense.fsx" | |
| #r "netstandard" | |
| #endif | |
| [<RequireQualifiedAccess>] | |
| module Persimmon = | |
| open System |
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
| #r "system.xml.linq" | |
| open System.IO | |
| open System.Xml.Linq | |
| let projectFiles = | |
| [ | |
| for dir in Directory.GetDirectories(".") do | |
| yield! Directory.GetFiles(dir, "*.fsproj") | |
| yield! Directory.GetFiles(dir, "*.csproj") |
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
| > System.Text.Encoding.Default.WebName;; | |
| val it : string = "shift_jis" |
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
| #r "System.Net.Http" | |
| #r "System.Xml" | |
| #r "System.Xml.Linq" | |
| open System | |
| open System.Net.Http | |
| open System.Xml.Linq | |
| let client = new HttpClient() |
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
| module InferredFloatRepro | |
| open Microsoft.FSharp.Compiler.SourceCodeServices | |
| open System.IO | |
| let inferredFloatFunction x = 0.0 + x | |
| let annotatedFloatFunction (x: float): float = 0.0 | |
| let inferredIntFunction x = 0 + x | |
| type Dummy = Dummy |
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
| DECLARE @a AS bigint = 1103515245; | |
| DECLARE @b AS bigint = 12345; | |
| DECLARE @c AS bigint = 2147483647; | |
| DECLARE @x AS bigint = (@a * 3 + @b) % @c; | |
| DECLARE @y AS bigint = (@a * @x + @b) % @c; | |
| WITH t AS( | |
| SELECT | |
| 0 AS Id |
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
| (* | |
| Prefixを導入した理由は、同じ'aでもqueryとtargetの'aは別物としたい。 | |
| 例) | |
| query: string -> 'a -> 'a | |
| target: 'a -> int -> int | |
| この場合マッチして欲しい。 | |
| 'aを同じとしてしまうと、string = 'a = intとなってマッチしない。 | |
| *) | |
| type Prefix = Target | Query | |
| type Type = |
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 beginPage = fsi.CommandLineArgs.[1] |> int | |
| let endPage = fsi.CommandLineArgs.[2] |> int | |
| let actualBeginPage = function | |
| | 1 -> 1 | |
| | n -> (n - 2) / 4 * 2 + 3 | |
| let actualEndPage n = actualBeginPage n + 1 | |
| printfn "%d-%d" (actualBeginPage beginPage) (actualEndPage endPage) |
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
| open System | |
| open System.IO | |
| let rec resetDirectory (timestamp: DateTime) path = | |
| printfn "%s" path | |
| Directory.SetCreationTime(path, timestamp) | |
| Directory.SetLastAccessTime(path, timestamp) | |
| Directory.SetLastWriteTime(path, timestamp) |
NewerOlder