This file contains 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
#region License | |
// Copyright (c) 2007 James Newton-King | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation | |
// files (the "Software"), to deal in the Software without | |
// restriction, including without limitation the rights to use, | |
// copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the | |
// Software is furnished to do so, subject to the following |
This file contains 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
#region License | |
// Copyright (c) 2007 James Newton-King | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation | |
// files (the "Software"), to deal in the Software without | |
// restriction, including without limitation the rights to use, | |
// copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the | |
// Software is furnished to do so, subject to the following |
This file contains 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 data = new | |
{ | |
hello = "world", | |
people = new[] { "James", "Brendan", "Amy" } | |
}; | |
string dson = DsonConvert.SerializeObject(data, Formatting.Indented); | |
// such | |
// "hello" is "world", | |
// "people" is so |
This file contains 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
set OLDDIR=%CD% | |
rmdir /s /q .\Working | |
mkdir .\Working | |
chdir Working | |
call git clone git://github.com/JamesNK/Newtonsoft.Json.git | |
rmdir Newtonsoft.Json\.git /s /q | |
chdir Newtonsoft.Json\Build |
This file contains 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
public class MetroPropertyNameResolver : DefaultContractResolver | |
{ | |
protected internal override string ResolvePropertyName(string propertyName) | |
{ | |
return ":::" + propertyName.ToUpper() + ":::"; | |
} | |
} | |
public class MetroStringConverter : JsonConverter | |
{ |
This file contains 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
set OLDDIR=%CD% | |
rmdir /s /q .\Working | |
mkdir .\Working | |
chdir Working | |
call git clone git://github.com/JamesNK/Newtonsoft.Json.git | |
rmdir Newtonsoft.Json\.git /s /q | |
chdir Newtonsoft.Json\Build |
This file contains 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
[Test] | |
public void IsMultipleTests() | |
{ | |
// true | |
Console.WriteLine(IsMultiple(0.0075, 0.0001)); | |
Console.WriteLine(IsMultiple(500.4, 0.001)); | |
Console.WriteLine(IsMultiple(500.4, 0.0001)); | |
Console.WriteLine(IsMultiple(500.4, 0.00001)); | |
Console.WriteLine(IsMultiple(500.4, 0.000001)); | |
Console.WriteLine(IsMultiple(500.4, 0.0000001)); |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
namespace ConsoleApp1 | |
{ |
This file contains 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
[2018-05-21T23:17:57] [TestLifetime] [Information] Starting test "CanCloseStreamMethodEarly_json_ServerSentEvents_default" | |
[0.000s] [ServerLogScope] [Information] Server log scope started. | |
[0.000s] [Microsoft.AspNetCore.SignalR.Client.HubConnection] [Verbose] Waiting on Connection Lock in "StartAsyncCore" ("/_/src/Microsoft.AspNetCore.SignalR.Client.Core/HubConnection.cs":239). | |
[0.000s] [Microsoft.AspNetCore.SignalR.Client.HubConnection] [Debug] Starting HubConnection. | |
[0.001s] [Microsoft.AspNetCore.Http.Connections.Client.HttpConnection] [Debug] Starting HttpConnection. | |
[0.001s] [Microsoft.AspNetCore.Http.Connections.Client.HttpConnection] [Debug] Establishing connection with server at 'http://127.0.0.1:1903/default'. | |
[0.002s] [Microsoft.AspNetCore.Http.Connections.Client.Internal.LoggingHttpMessageHandler] [Verbose] Sending HTTP request "POST" 'http://127.0.0.1:1903/default/negotiate'. | |
[0.004s] [SERVER Microsoft.AspNetCore.Server.Kestrel] [Debug] Connection id "0HLDVE3S42R5H" started. | |
[0.004s] [SERVER Micro |
This file contains 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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks> | |
</PropertyGroup> | |
</Project> |
OlderNewer