Recent snippets

  • SFTP with SSH.Net

    SFTP with SSH.Net

    1 people like this

    Posted: 6 hours ago by Tuomas Hietanen

  • Azure Cosmos DB - Graph get started

    Translation of the Azure Cosmos DB Graph-get-started sample project (https://github.com/Azure-Samples/azure-cosmos-db-graph-dotnet-getting-started/tree/master/GraphGetStarted) A Cosmos DB account must first be created e.g. via the Azure Portal & from these the endpoint & authorization key are retrieved. Given these, the script creates: (i) Document Client (ii) Database (iii) Graph (aka Document Collection). From Gremlin expressions (strings) the command CreateGremlinQuery creates queries (IDocumentQueries) that can be executed to read from or modify the graph.

    1 people like this

    Posted: 6 days ago by roguetrainer

  • The Eff Monad via delimited continuations

    The Eff Monad via delimited continuations, based on http://kcsrk.info/papers/eff_ocaml_ml16.pdf.

    1 people like this

    Posted: 17 days ago by NIck Palladinos

  • Making QR-code image having contact information (VCard) with Google Chart API

    Making QR-code image having contact information (VCard) with Google Chart API. If you scan this image with mobile phone, you can directly add new person to your contacts.

    1 people like this

    Posted: 25 days ago by Tuomas Hietanen

  • Optimal Cloud Coloring & famous 4 color map

    Four colors will print a map so adjacent states have different color. F# has clear concise code. Map has a list of pairs sharing a border. Incremental improvements in the code can be less use of key word 'function'. Since syntax is not ambiguous can it be fixed in the compiler? so '=function |' changes to '=|' ? Welcome to improve. Harrop,Mathias,Jack,Art,HR,fwaris,Don Syme, sffs... Thanks! Musa.Jahanghir@Live.com AVCLive1.com

    6 people like this

    Posted: 26 days ago by Musa Jahanghir

  • tutorial, test, tennis, clarity, simplicity in f#

    f# short and sweet may help beginners. Score on winning a point, Winning number first and other players is labeled: b example "0",b ->"15", b. A special case of draw-deuce is "40", "A" -> "40","40" If player 2 wins a point score calling is flipped as 2->score(b,a). fold (fun to call for each element in the test list) (initials "0","0") [test list of winning player] Notice f# is perhaps easier and clearer than pseudo code and verbose description. An improvement suggestion for Don is if syntax is not confused can word function be made optional so = |... or -> |.. so syntax is ever more clearer?

    7 people like this

    Posted: 26 days ago by Musa Jahanghir

Popular snippets

  • FSX Structure

    I use this basic template when writing .fsx files that I might want to compile. It adjusts the difference in command line/entrypoint handling between a script and a compiled assembly. This example shows the details for a WPF script — replace the #r's and/or remove the STAThread for a WinForms or Console script.

    115 people like this

    Posted: 6 years ago by Blake Coverett

  • Partition a sequence until a predicate is satiated

    This function is given a partition predicate and a sequence. Until the predicate returns false, a list will be filled with elements. When it is, both the list and the remainder of the sequence will be returned. Note that this example preserves the laziness of the unchecked sequence elements.

    68 people like this

    Posted: 6 years ago by Rick Minerich

  • Minimal XML DSL

    This snippet provides a very small internal DSL for creating and querying XML using the underlying XLinq classes.

    357 people like this

    Posted: 6 years ago by Blake Coverett

Snippets by tags

html (14) collections (16) tutorial (17) sequences (47) monad (20) fparsec (14) fold (19) silverlight (21) reflection (18) staging (18) quotations (17) lists (13) array (18) computation builder (14) recursion (26) lazy (18) agent (20) f# (42) mailboxprocessor (25) wpf (18)

View all...

Database contains 2170 snippets out of which 1494 is public.