Skip to content

Instantly share code, notes, and snippets.

package com.kuaizhan.form.service;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import com.kuaizhan.form.model.Answer;
public class StatQueue {
@sharewind
sharewind / pr.md
Created April 23, 2014 02:09 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

package main
import (
"fmt"
"os"
"os/signal"
"syscall"
// "time"
)
package main
import (
"bufio"
"flag"
"fmt"
"io"
"net"
"os"
"os/signal"
@sharewind
sharewind / golang closure
Last active January 1, 2016 06:49
golang closure
package main
import "fmt"
func intSeq() []func() int {
i := 0
var result = make([]func() int, 10)
for ; i < 10; i++ {
result[i] = func() int {
i += 1
type T struct {
A int
B string
}
t := T{23, "skidoo"}
s := reflect.ValueOf(&t).Elem()
typeOfT := s.Type()
for i := 0; i < s.NumField(); i++ {
f := s.Field(i)
fmt.Printf("%d: %s %s = %v\n", i,