openpgp4fpr:260032D45A1BB80D4662D16E7F0B72A0F5468326
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
// License: MIT | |
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
using System.Runtime.Serialization.Formatters.Binary; | |
internal class Program |
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
// Original | |
public static Expression DispatchMethod( | |
Expression instance, | |
IEnumerable<MethodBase> methods, | |
IList<Type> typeArguments, | |
IList<Expression> arguments | |
) | |
{ | |
return methods | |
.Select(m => m is MethodInfo && ((MethodInfo) m).IsExtensionMethod() |
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
[color "branch"] | |
plain = normal | |
remote = red | |
local = normal | |
current = green | |
upstream = blue | |
worktree = cyan # not in doc | |
[color "diff"] | |
context = normal |
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; | |
using System.Threading; | |
namespace ConsoleApplication1 | |
{ | |
public class TaskQueue : IDisposable | |
{ | |
//仕事キュー |
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 reply = Chars.Digit() | |
.Or(Chars.Any().Message("not a digit")) | |
.Many() | |
.Select(cs => new string(cs.ToArray())) | |
("12a3b".AsStream()); | |
reply.Status.Dump(); // Success | |
reply.Left.Value.Value.Dump(); // "12a3b" | |
reply.Messages.Dump(); | |
// [ not a digit (1:5,1:5), | |
// not a digit (1:3,1:3), |
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
// Yacq | |
private static readonly Grammar _standard = new Grammar(); | |
public static Grammar Standard | |
{ | |
get | |
{ | |
return _standard; | |
} |
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.Linq.Expressions; | |
using System.Net; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace TinyTweet |
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 static Attribute[] GetAttributes(Expression expr) | |
{ | |
switch (expr.NodeType) | |
{ | |
case ExpressionType.MemberAccess: | |
return Attribute.GetCustomAttributes(((MemberExpression) expr).Member); | |
case ExpressionType.Invoke: | |
return Attribute.GetCustomAttributes(((MethodCallExpression) expr).Method); | |
case ExpressionType.Index: | |
return Attribute.GetCustomAttributes(((IndexExpression) expr).Indexer); |
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 TypeName | |
{ | |
public String Namespace { get; set; } | |
public String[] HierarchicalNames { get; set; } | |
public override String ToString() | |
{ | |
return String.Join("+", this.HierarchicalNames); | |
} | |
} |
NewerOlder