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 csvLineSplit : string -> string [] = | |
| let folder (acc, escaped) c = | |
| let appendChar () = match acc with | |
| | [] -> [[c]] | |
| | h :: t -> (c :: h) :: t | |
| match c, escaped with | |
| | '\"', _ -> acc, not escaped | |
| | ',', false -> [] :: acc, false | |
| | _, _ -> appendChar (), escaped | |
| Seq.fold folder ([], 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
| let matches (pattern : string) (x : string) : bool = | |
| let rec matchesL pattern x = | |
| match pattern, x with | |
| | [], [] | ['?'], [] | ['*'], []-> true | |
| | '?'::pTail, xHead::xTail -> matchesL pTail xTail || matchesL pTail x | |
| | '*'::pTail, xHead::xTail -> matchesL pTail xTail || matchesL pTail x || matchesL pattern xTail | |
| | pHead::pTail, xHead::xTail when pHead = xHead -> matchesL pTail xTail | |
| | _ -> false | |
| matchesL (Seq.toList pattern) (Seq.toList x) |
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.Threading | |
| open System.Linq | |
| open System.Threading.Tasks | |
| open System.Diagnostics | |
| [<EntryPoint>] | |
| let main argv = | |
| let rand = new Random() | |
| let opCount = 5 |
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
| private void RunXpubXsubTest() | |
| { | |
| using (var context = new Context()) | |
| { | |
| using (var xpub = context.Socket(SocketType.XPUB)) | |
| { | |
| xpub.Bind("tcp://127.0.0.1:5560"); | |
| using (var xsub = context.Socket(SocketType.XSUB)) | |
| { | |
| xsub.Bind("tcp://127.0.0.1:5561"); |