Skip to content

Instantly share code, notes, and snippets.

On vacation

Ivan Kochurkin KvanTTT

View GitHub Profile
KvanTTT / PolygonTriangulator.cs
Created Oct 8, 2012
Short solution for splitting concave polygon on convex polygons or triangles with other utils (SelfIntersection checking).
View PolygonTriangulator.cs
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>
View Client-Server-Interaction.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
KvanTTT / Kochurkins.cmd
Created Sep 12, 2018
Script for generating genealogy tree inside Git repository
View Kochurkins.cmd
chcp 65001
mkdir Kochurkins
cd Kochurkins
git init
git checkout --orphan @I36@
git commit -m "Татьяна : Birth F" --date "01/01/1970 00:00:00" --author "Татьяна <>" --allow-empty
git checkout --orphan @I35@
git commit -m "Степан Голобоков : Birth M" --date "01/01/1970 00:00:00" --author "Степан Голобоков <>" --allow-empty
git checkout --orphan @I33@
KvanTTT / CSharpAntlrParser.cs
Last active Jul 24, 2018
ANTLR C# runtime code fragment for correct C# code parsing with preprocessor directives (for CSharp grammar in oficial repository:
View CSharpAntlrParser.cs
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);
View PolynomialRegression.cs
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].
KvanTTT /
Last active May 21, 2018 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1


Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

KvanTTT /
Created Feb 25, 2018


  • Некорректная обработка чисел больше размерности int. Например, 9999999999999999999=-1981284353.
  • IndexOutOfRangeException в случае пустого ввода и в случае если оператор умножения или сложения находятся в начале: +2, *2.
  • Программа не покрыта тестами.
  • Дублирование логики в switch - case. Символьный тип элементарно перевести в число, а блок с проверкой от '0' до '9' заменяется одной строчкой. То же самое относится к операторам '*' и '+'.
View Tetration.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
View CSharp6_features.cs
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
KvanTTT / Expression.cs
Created Sep 12, 2017
Parser that can add and sum integer numbers
View Expression.cs
using System.Collections.Generic;
using static System.Console;
namespace Expressions
public enum Operation
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.