Skip to content

Instantly share code, notes, and snippets.

View sdcb's full-sized avatar
👋
Console.WriteLine("Hello World");

ZHOU Jie sdcb

👋
Console.WriteLine("Hello World");
View GitHub Profile
@sdcb
sdcb / AddCharToLexer-Unicode.cs
Last active May 17, 2018 14:09
AddCharToLexer-Unicode support
public virtual void AddCharToLexer(int c)
{
if (c >= 0xD800 && c <= 0xDBFF)
{
int c2 = this.input.ReadChar();
if (c2 >= 0xDC00 && c2 <= 0xDFFF)
{
c = ((c - 0xD800) * 0x400) + (c2 - 0xDC00) + 0x10000;
}
else
@sdcb
sdcb / material.module.ts
Created May 8, 2018 07:04
material.module.ts
import { FormsModule } from '@angular/forms';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
MatCardModule,
MatAutocompleteModule,
MatButtonModule,
MatBadgeModule,
MatBottomSheetModule,
MatButtonToggleModule,
@sdcb
sdcb / msdn.fs
Created March 30, 2018 03:02
msdn.fs
open FSharp.Data
open System
open OfficeOpenXml
open System.IO
open OfficeOpenXml.FormulaParsing.Excel.Functions.Math
open Polly
open System.Net
type HomePage = HtmlProvider<"./Samples/Home.html">
type Products = JsonProvider<"./Samples/Products.json">
@sdcb
sdcb / Program.fs
Last active March 23, 2018 02:22
F# iis log top N
open System
open System.IO
type IISLogItem = {
date :DateTime;
time :DateTime;
``s-ip`` :string;
``cs-method`` :string;
``cs-uri-stem`` :string;
``cs-uri-query`` :string;
@sdcb
sdcb / FF.cs
Last active January 1, 2020 09:45
LL(1) First & Follow C# edition
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace MyLL1
{
public interface IRule
{
string Name { get; }
@sdcb
sdcb / Lexer.cs
Last active April 24, 2017 07:22
Lexer.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace MyLexer
{
public class TokenDefinition
{
public string Name { get; set; }
@sdcb
sdcb / CMakeLists.txt
Created January 27, 2017 03:34
directxtk-cmake
cmake_minimum_required(VERSION 3.0)
project(directxtk)
add_library(directxtk
Src/AlphaTestEffect.cpp
Src/BasicEffect.cpp
Src/BinaryReader.cpp
Src/CommonStates.cpp
Src/DDSTextureLoader.cpp
Src/DGSLEffect.cpp
@sdcb
sdcb / DeviceResources.h
Last active February 3, 2017 03:46
dxtk
//
// DeviceResources.h - A wrapper for the Direct3D 11 device and swapchain
//
#pragma once
namespace DX
{
// Provides an interface for an application that owns DeviceResources to be notified of the device being lost or created.
interface IDeviceNotify
@sdcb
sdcb / ImageFinder.cs
Created January 13, 2017 13:30
ImageFinder
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@sdcb
sdcb / MsgTool.cs
Last active January 13, 2017 14:04
douyutv barrage C# 弹幕获取
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;