This file contains hidden or 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 long RationalNumber(long i, long j) | |
{ | |
if (j == 1) | |
{ | |
if (i == 0) | |
return 1; | |
else if (i == 1) | |
return 2; | |
} |
This file contains hidden or 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 MathNet.Numerics.LinearAlgebra.Double; | |
using MathNet.Numerics.LinearAlgebra.Generic; | |
public class PolynomialRegression | |
{ | |
private int _order; | |
private Vector<double> _coefs; | |
/// <summary> | |
/// Calculates polynom regression for xData = [x1, x2, ... , xn] and yData = [y1, y2, ... , yn]. |
This file contains hidden or 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.Collections.Generic; | |
using System.Drawing; | |
public class PolygonTriangulator | |
{ | |
/// <summary> | |
/// Calculate list of convex polygons or triangles. | |
/// </summary> | |
/// <param name="Polygon">Input polygon without self-intersections (it can be checked with SelfIntersection().</param> | |
/// <param name="triangulate">true: splitting on triangles; false: splitting on convex polygons.</param> |
This file contains hidden or 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
echo off | |
:LOOP | |
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "Asciimation_1_3.cs" | |
"Asciimation_1_3.exe" > "Asciimation_1_3.cs" | |
type "Asciimation_1_3.cs" | |
goto LOOP | |
:END |
This file contains hidden or 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
echo off | |
:LOOP | |
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "QuineSnake.cs" | |
"QuineSnake.exe" > "QuineSnake.cs" | |
type "QuineSnake.cs" | |
goto LOOP | |
:END |
This file contains hidden or 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
echo off | |
:LOOP | |
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" "QuineClock.cs" | |
"QuineClock.exe" > "QuineClock.cs" | |
type "QuineClock.cs" | |
goto LOOP | |
:END |
This file contains hidden or 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
class Test | |
{ | |
@ApiModelProperty(value = | |
"0123456789012345678901234567890123456789" + | |
"0123456789012345678901234567890123456789" + | |
"0123456789012345678901234567890123456789" + | |
"0123456789012345678901234567890123456789" + | |
"0123456789012345678901234567890123456789" + | |
"0123456789012345678901234567890123456789" + | |
"0123456789012345678901234567890123456789" + |
This file contains hidden or 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 static System.Console; | |
using static System.Math; | |
using static System.DayOfWeek; | |
using static System.Linq.Enumerable; | |
namespace CSharp6Samples | |
{ | |
public class Test | |
{ | |
// Initializers for auto-properties |
This file contains hidden or 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
List<IToken> codeTokens = new List<IToken>(); | |
List<IToken> commentTokens = new List<IToken>(); | |
Lexer preprocessorLexer = new CSharpLexer(new AntlrInputStream(sourceCode)); | |
// Collect all tokens with lexer (CSharpLexer.g4). | |
var tokens = preprocessorLexer.GetAllTokens(); | |
var directiveTokens = new List<IToken>(); | |
var directiveTokenSource = new ListTokenSource(directiveTokens); | |
var directiveTokenStream = new CommonTokenStream(directiveTokenSource, CSharpLexer.DIRECTIVE); | |
CSharpPreprocessorParser preprocessorParser = new CSharpPreprocessorParser(directiveTokenStream); |
This file contains hidden or 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 CSharp6FeaturiesWalker : CSharpSyntaxWalker | |
{ | |
public bool CSharp6Featuries { get; private set; } | |
public CSharp6FeatureWalker() | |
{ | |
} | |
public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node) | |
{ |
OlderNewer