加载中
postgresql记录

安装源 yum localinstall http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm 安装数据库 yum install postgresql94-server postgresql94-contrib 初始化...

2014/08/14 16:42
109
判断vps类型

wget http://people.redhat.com/~rjones/virt-what/files/virt-what-1.12.tar.gz tar zxvf virt-what-1.12.tar.gz cd virt-what-1.12/ ./configure make && make install virt-what...

2013/07/05 11:45
474
golang 反射

package main import (   "fmt"   "reflect" ) type Person struct{} func (p *Person) Run() {   fmt.Println("person running") } func doit(object interface{}, method in...

2013/06/30 00:39
1K
golang读取json格式的天气预报

使用天气预报的接口:http://weather.china.xappengine.com/api?city=南宁 (找了好久才找到一个支持拼音的,不过好像小地方是没数据的) 访问得到json格式压缩的数据,格式化后 { "pu...

2013/06/30 00:34
3K
【转】GO Check if file exists

finfo, err := os.Stat("filename.txt") if err != nil { // no such file or dir return } if finfo.IsDir() { // it's a file } else { // it's a directory }...

2013/06/13 15:55
265
[转]GO RAND

package main import ( "fmt" "time" "math/rand" ) func main() { r := rand.New(rand.NewSource(time.Now().UnixNano())) for i:=0; i<20;...

2013/05/14 11:40
136
[转]GO LIST

package main import (   "container/list"   "fmt" ) func main() {   // 生成队列   l := list.New()   // 入队, 压栈   l.PushBack(1)   l.PushBack(2)   l.PushBack(3)   l.Pu...

2013/05/14 11:26
248
[转]beego cache

package beego import (   "errors"   "fmt"   "strconv"   "sync"   "time" ) var (   DefaultEvery int = 60 // 1 minute ) type BeeItem struct {   val interface{} ...

2013/05/13 11:08
993
[转]beego safe map

package beego import (   "sync" ) type BeeMap struct {   lock *sync.RWMutex   bm map[interface{}]interface{} } func NewBeeMap() *BeeMap {   return &BeeMap{     lock:...

2013/05/13 11:06
678
[转]beego log

package beego import (   "log"   "os" ) //-------------------- // LOG LEVEL //-------------------- // Log levels to control the logging output. const (   LevelTrace...

2013/05/13 11:04
409
[转]GO LOG FILE

package main import (   "fmt"   "log"   "os" ) func main(){   logfile,err := os.OpenFile("d:/test.log",os.O_RDWR|os.O_CREATE,0);   if err!=nil {     fmt.Printf("%s\r\n",er...

2013/05/13 11:00
174
[转]GO UUID

Here is a simple UUID generator, it uses version 4, Pseudo Random, as described in RFC 4122 uuid.go package uuid import ( "encoding/hex" "crypto/rand" ) func GenUUID(...

2013/05/13 10:55
641

没有更多内容

加载失败,请刷新页面

没有更多内容

返回顶部
顶部