This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
#include <asm/types.h> | |
#include <sys/socket.h> | |
#include <linux/netlink.h> | |
#include <linux/inet_diag.h> | |
*/ | |
import "C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
import os | |
import time | |
import random | |
from hashlib import sha1 | |
char_alphabet = "abcdefghijklmnopqrstuvwxyz" | |
char_digit = "0123456789" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 演示两个 goroutine 修改同一块数据结构 | |
// TODO: 加上锁 | |
package main | |
import "fmt" | |
func updateData(a *[]int, quit chan int) { | |
for i := 20; i < 30; i++ { | |
*a = append(*a, i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"math/rand" | |
"net" | |
"net/http" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let React = require('react'); | |
let ReactDOM = require('react-dom'); | |
let Relay = require('react-relay'); | |
class Item extends React.Component { | |
render() { | |
let { group } = this.props.store | |
return <p><b>{group.id}</b>: {group.name}</p> | |
} | |
}; |