Skip to content

Instantly share code, notes, and snippets.

View akfish's full-sized avatar
🎯
刻舟求剑

大芡猫 akfish

🎯
刻舟求剑
View GitHub Profile
@akfish
akfish / q_full_adder.q
Created May 27, 2014 05:31
Quantum Full Adder
// This is a semi-quantum fulladder. It adds to b_in
// a c-number. Carry-in bit is c_in and carry_out is
// c_out. xlt-l and L are enablebits. See documentation
// for further information
proc muxfa a, b_in, c_in, c_out, xlt_l, L, total //a,
if a == 0//00
Toffoli b_in, c_in, c_out
@akfish
akfish / comment-count.ejs
Last active August 29, 2015 14:01
Hexo多说
<a href="<%= post.path %>#comments"><span class="ds-thread-count" data-thread-key="<%= post.path %>" data-count-type="comments">没有评论</span></a>
@akfish
akfish / concept.md
Created May 13, 2014 08:58
Shader.Js Concept

Shader.Js

Goal

  • Write WebGL shaders in JavaScript (shader classes)
  • Compile shader classes to GLSL at runtime or compile time
  • Assemble and run glProgram (material) seamlessly in JavaScript syntax

Review of Native WebGL Shading Workflow

@akfish
akfish / README.md
Last active August 29, 2015 14:00
BSC 5th Edition

Bright Star Catalogue, 5th Revised Ed. (Hoffleit+, 1991. Annotated by AKFish, 2014)

The Bright Star Catalogue, 5th Revised Ed. (Preliminary Version)

Hoffleit D., Warren Jr W.H.

<Astronomical Data Center, NSSDC/ADC (1991)>

=1964BS....C......0H

@akfish
akfish / tips.md
Created April 30, 2014 02:40
Coffee Meets Backbone

Override Constructor

class GlContainer extends Backbone.View
  constructor: (@selector) ->
    super arguments

Use =&gt;

@akfish
akfish / concept.md
Created April 16, 2014 22:27
hexo-series concept

Hexo-Series Plugin Concept

Usage

See another document.

Source Storage

In source folder:

@akfish
akfish / content.md
Created March 7, 2014 22:26
The Making of Sarcasm (3) - Irony Grammar Class Generation

The Making of Sarcasm (3) - Irony Grammar Class Generation

Overview

An Irony grammar class is a C# class derived from Irony.Parsing.Grammar that defines the grammar for a language. The overall structure can be easily done by templating so it is not worth not worth discussing. We will concentrate on the actual work that is performed in its constructor:

  1. Decalare and initialize variables for terminals
  2. Decalare and initialize variables for non-terminals
  3. Defines rules
@akfish
akfish / concept.md
Last active August 29, 2015 13:57
Sarcasm AST Mapping Syntax

Sarcasm AST Mapping Syntax

Goal

  • Specify and generate AST node class
  • Map and automatically intialize AST node's fields

The Syntax

For NonTerminal

@akfish
akfish / full.md
Last active August 29, 2015 13:56
Emit C# Proxy Class at Runtime with ILGenerator

Emit C# Proxy Class at Runtime with ILGenerator

Problem Description

In C#, we often run into objects or services that provide dynmaic method invocation by a single method like:

public abstract class ProxyBase
{
  protected abstract object Invoke(object someMethodRelatedInfo, object[] arguments);
@akfish
akfish / Sarcasm.md
Last active August 29, 2015 13:56
Make Better Irony with Sarcasm

Sarcasm Grammar Specification

Introduction