Snippets tagged json

  • Convert an object to json, and json to object

    There is a namespace System.Runtime.Serialization.Json To serialize generic object you can do like this...

    73 people like this

    Posted: 6 years ago by Tuomas Hietanen

  • Stackoverflow API script

    A script that consumes the Stackoverflow API in a dynamic fashion

    6 people like this

    Posted: 5 years ago by Mauricio Scheffer

  • Rename JSON properties

    Rename JSON property names by reconstructing JSON object.

    3 people like this

    Posted: 4 years ago by Dmitry Lobanov

  • Retail with units of measure

    Sample retail domain model, using F# types (records and discriminated unions) with JSON sample data using F# Data type provider.

    1 people like this

    Posted: 3 years ago by Tomas Petricek & Phil Trelford

  • Fast(er) Set creation

    Set creation can be quite slow for large sets (> 15000ish string items). If input sequence to create the set is sorted then some optimizations can be applied. For even larger unordered sets (> 30000ish string items) it can be faster doing an up front sort on the data, and then using the Set creation method as described. 1) Set.union is very fast when the greatest element in one of the sets is less than the smallest element in the other; basically becoming an O(1) operation. And Set.add is faster for smaller sets than larger sets, given O(log2 n) of the add operation. So when we have ordered data, makings lots of smaller sets from the stream and union-ing them together can provide a performance boost. 2) On top of the method described in (1), because all the sets are immutable inputs and outputs, then they can be partitioned off onto Tasks to perform the set creation in parallel. If you are using Newtonsoft's Json.net, then provided is a JsonConverter that can be added to the serializer to use this for Set creation like: serializer.Converters.Add Newtonsoft.fastFSharpSetConverter

    2 people like this

    Posted: 1 years ago by manofstick

  • Datatype generic JSON string <-> type

    A simple example of using datatype generic JSON operations from Infers.Toys.

    1 people like this

    Posted: 12 months ago by Vesa Karvonen