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.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Razor.Language; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp; |
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; | |
namespace ConsoleApp | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
var a = 1; | |
{ |
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.Linq; | |
namespace Test | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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.Concurrent; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace AsyncScheduler | |
{ | |
public class ActionQueueScheduler : IDisposable | |
{ | |
private readonly ConcurrentQueue<Func<Task>> queue; |
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
// .NET framework 4.6.1 / x64 + Release | |
// https://github.com/acple/ParsecSharp/tree/5ea648b20ac28cc032a669c8fbe0f346e3e947fc | |
using System.Diagnostics; | |
using static System.Console; | |
using static Parsec.Parser; | |
using static Parsec.Text; | |
namespace _ | |
{ |
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.Diagnostics; | |
using static System.Console; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// 末尾再帰の検証 .NET framework 4.6.1 / Release_x64 | |
//A(10000000); // -> StackOverflowException!!!! |
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; | |
namespace Acple.ForbiddenExtensions | |
{ | |
public static class Extensions | |
{ | |
public static TResult 変換するやつ<T, TResult>(this T value, Func<T, TResult> processor) | |
{ | |
return processor(value); | |
} |
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.Reactive.Linq; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var source = Observable.Return(0) // (int 0)で長さ1 |
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.Reactive.Linq; | |
using System.Reactive.Subjects; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
//http://msdn.microsoft.com/ja-jp/library/cc981895.aspx | |
public static class Extensions | |
{ | |
public static double Median(this IEnumerable<double> source) | |
{ | |
var count = source.Count(); | |
if (count == 0) throw new InvalidOperationException("Cannot compute median for an empty set."); | |
return source.OrderBy(x => x).Take((count / 2) + 1).Skip((count - 1) / 2).Average(); | |
} |