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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / Azure Speech Service.linq
Created September 18, 2018 07:29
Azure text to speech LINQPad
<Query Kind="Program">
<Output>DataGrids</Output>
<Reference>&lt;RuntimeDirectory&gt;\System.Net.Http.dll</Reference>
<NuGetReference>Microsoft.CognitiveServices.Speech</NuGetReference>
<NuGetReference>NAudio</NuGetReference>
<NuGetReference>NAudio.Lame</NuGetReference>
<Namespace>Microsoft.CognitiveServices.Speech</Namespace>
<Namespace>NAudio.Wave</Namespace>
<Namespace>System.Net.Http</Namespace>
<Namespace>System.Net.Http.Headers</Namespace>
@sdcb
sdcb / 斗鱼弹幕.linq
Last active September 18, 2018 14:38
斗鱼弹幕(LINQPad-C#).linq
<Query Kind="Program">
<Output>DataGrids</Output>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<Namespace>Newtonsoft.Json.Linq</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
<Namespace>System.Net.Sockets</Namespace>
</Query>
public static void Main(string[] args)
{
@sdcb
sdcb / sdmap test.linq
Created September 21, 2018 05:05
sdmap test(LINQPad).linq
<Query Kind="Statements">
<Reference>&lt;RuntimeDirectory&gt;\System.Configuration.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Data.Services.Client.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Data.Services.Design.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Design.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Runtime.Serialization.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.ServiceModel.Activation.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.ServiceModel.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Web.ApplicationServices.dll</Reference>
<Reference>&lt;RuntimeDirectory&gt;\System.Web.dll</Reference>