2013年9月25日

VirtualBox,Kernel driver not installed (rc=-1908)

摘要: http://hi.baidu.com/spt_form/item/316d6207b47b8ee03499020aVirtualBox,Kernel driver not installed (rc=-1908)Fedora安装Virtualbox后无法运行,要求执行/etc/init.d/vboxdrvsetup在Fedora下安装了Virtualbox,发现运行时出现以下问题:12Kerneldrivernotinstalled(rc=-1908)TheVirtualBoxLinuxkerneldriver(vboxdrv)iseithernotloadedorthereisapermi 阅读全文

posted @ 2013-09-25 16:50 wangbokun 阅读(1393) 评论(0) 推荐(0) 编辑

go运算符

摘要: package mainimport ( "fmt")func main() { fmt.Println(^2)}-3package mainimport ( "fmt")func main() { fmt.Println(1 << 10)}[ `go run test1.go` | done: 193.264246ms ] 1024/*6 : 011011: 1011----------------------& 0010 = 2 // 逻辑与| 1111 = 15 // 逻辑或^ 1101 = 13 //两个都是1的话不成立&am 阅读全文

posted @ 2013-09-25 15:14 wangbokun 阅读(396) 评论(0) 推荐(0) 编辑

go iota

摘要: package mainimport ( "fmt")const ( a = 'A' b c = iota d)func main() { fmt.Println(a) fmt.Println(b) fmt.Println(c) fmt.Println(d)}[ /dinglicom/gowork/project/test/ ] # go run test1.go[ `go run test1.go` | done: 641.241905ms ] 65 65 2 3以定义常量的顺序次数有关系,递增加1,再每个常量表达式组会初始化重新计数 阅读全文

posted @ 2013-09-25 14:42 wangbokun 阅读(228) 评论(0) 推荐(0) 编辑

go之匿名字段

摘要: struct,定义的时候是字段名与其类型一一对应,实际上Go支持只提供类型,而不写字段名的方式,也就是匿名字段,也称为嵌入字段。当匿名字段是一个struct的时候,那么这个struct所拥有的全部字段都被隐式地引入了当前定义的这个struct。package mainimport ( "fmt")type Human struct { name string age int weight int}type Student struct { Human speciality string}func main() { mark := Studen... 阅读全文

posted @ 2013-09-25 00:06 wangbokun 阅读(310) 评论(0) 推荐(0) 编辑

导航