Skip to content

Instantly share code, notes, and snippets.

View wweic's full-sized avatar
😀
Hacking

Wei Chen wweic

😀
Hacking
View GitHub Profile
@wweic
wweic / code_contest_template.cpp
Created October 9, 2012 07:34
Code template for programming contest
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
@wweic
wweic / lambda.ss
Created October 31, 2012 12:38
notes of chapter 9 of "The little schemer"
#lang scheme
;; notes about Y combinator and related.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; function never stop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define eternity
(lambda (x)
(eternity x)))
@wweic
wweic / reg_parser.ml
Created August 1, 2013 03:05
Parse regular expression pattern. using recursive descent.
(* Parse a subset of regular expression, using recursive descent *)
(* modified from https://code.google.com/p/sharable-stuff/ *)
type regexp =
| Empty_String
| Char of char
| Union of regexp * regexp
| Concat of regexp * regexp
| Star of regexp
@wweic
wweic / ycomb.rkt
Created August 19, 2013 04:13
A simple Y-combinator deduction.
#lang racket
; a simple example to deduce Y-combinator for factorial function
; author: Wei Chen([email protected])
; 1.
; we can use lambda extraction to get reference to self
(define f1
(lambda (fac)
(lambda (x)
;; A Scheme-to-C compiler.
;; Author: Matthew Might
;; Site: http://matt.might.net/
;; http://www.ucombinator.org/
;; The purpose of this compiler is to demonstrate
;; the most direct possible mapping of Scheme into C.
;; Toward that end, the compiler uses only two
;; intermediate transformations: mutable-variable
@wweic
wweic / weird-ml.ml
Created January 1, 2014 16:09
OCaml typing weirdness
type atype = {a : int}
type btype = {a : int; b : int}
let accept {a = x} = x
(*
---> val accept : btype -> int = <fun>
select the last record type which contains the fields
*)
@wweic
wweic / weirg_go.go
Created January 26, 2014 02:44
weird-go.go
package main
import (
"fmt"
)
func a ()[]int {
var arr [16]int
for i := range arr {
arr[i] = i
@wweic
wweic / tools.md
Last active August 29, 2015 14:17 — forked from nrc/tools.md

Rust developer tools - status and strategy

Availability and quality of developer tools are an important factor in the success of a programming language. C/C++ has remained dominant in the systems space in part because of the huge number of tools tailored to these lanaguages. Succesful modern languages have had excellent tool support (Java in particular, Scala, Javascript, etc.). Finally, LLVM has been successful in part because it is much easier to extend than GCC. So far, Rust has done pretty well with developer tools, we have a compiler which produces good quality code in reasonable time, good support for debug symbols which lets us leverage C++/lanaguge agnostic tools such as debuggers, profilers, etc., there are also syntax highlighting, cross-reference, code completion, and documentation tools.

In this document I want to layout what Rust tools exist and where to find them, highlight opportunities for tool developement in the short and long term, and start a discussion about where to focus our time an

% Some people asked the LaTeX template for http://pluskid.org/assets/chiyuan-resume.pdf
% So I put a sample here. Feel free to use / modify it. Note you need to use xelatex to
% compile it and change the fonts to the ones you prefer and have on your system.
\documentclass[11pt]{article}
\usepackage{color}
\definecolor{ColorURL}{rgb}{0.1,0.12,0.45}
\usepackage[colorlinks=true,urlcolor=ColorURL]{hyperref}
\usepackage{fontspec,xunicode,xltxtra}
\usepackage[left=.8in,right=.8in,top=.9in,bottom=.7in]{geometry}
\usepackage{setspace}
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default