Skip to content

Instantly share code, notes, and snippets.

package main
import "golang.org/x/tour/tree"
import "fmt"
// Walk walks the tree t sending all values
// from the tree to the channel ch.
// DFS in order
func Walk(t *tree.Tree, ch chan int) {
if t != nil {
@delongGao
delongGao / web_crawler.go
Created December 30, 2019 21:45
golang tour web crawler exercise
package main
import (
"fmt"
"sync"
// since we use waitgroup instead, no need for time anymore
// "time"
)
type Fetcher interface {
@delongGao
delongGao / everyday_things.sh
Created March 20, 2015 18:29
code snippets, ad-hoc thing
sudo postfix start # start postfix mail service on mac
@delongGao
delongGao / ndarray
Created February 25, 2014 08:20
code to generate ndarray in python
nn_train = np.ndarray((bdata_train.shape[0],3),dtype=float,buffer=np.array([bdata_train[:,0],bdata_train[:,5],bdata_train[:,12]]))
{ "name": "Delong","age": "24","College": "UW", }