python中使用二进制也很方便 1、表示1 one = 0b12 two = 0b103 three = 0b11 2、操作1 print 5 >> 4 # Right Shift2 print 5 << 1 # Left Shift3 print 8 & 5 # Bitwise ...
分类:
编程语言 时间:
2014-11-20 18:40:00
阅读次数:
183
#### 获取配置文件配置路径,javapath为配置项,var为具体的配置值eval $(awk -F "javapath=" '{if($2=="") {print $2} else {print "var="$2}}' 1.sh)echo $var#####计算MD5值file=1.shmd5...
分类:
系统相关 时间:
2014-11-20 18:32:05
阅读次数:
168
table的使用:redat1 = {["mon"] = 1, ["tue"] = 2}print(redat1["mon"])redat2 = {1, 3}print(redat2[1])输出:1 1二维:d = {}d[1123] = {["q"] = 1,["w"] = 2,["e"] = 3...
分类:
其他好文 时间:
2014-11-20 18:28:15
阅读次数:
554
swap(int *p1,int *p2){ int temp; temp=*p1; *p1=*p2; *p2=temp;}main(){ int a,b; int *pointer_1,*pointer_2; scanf("%d%d",&a,&b); ...
分类:
其他好文 时间:
2014-11-20 18:25:29
阅读次数:
134
1、item1 my_dict ={'a':1,'b':2}2 print my_dict.items()3 4 [('a', 1), ('b', 2)] 2、keys,values1 my_dict ={'a':1,'b':2}2 print my_dict.keys()3 print my...
分类:
编程语言 时间:
2014-11-20 18:24:25
阅读次数:
131
';$num =6; //要取得$result =array_slice($number,0,$num);//array_slice 从下表为0的开始抓取6个print_r($result);?>';print_r($tmp);?>';print_r(array_rand($tmp,2));?...
分类:
Web程序 时间:
2014-11-20 18:22:39
阅读次数:
153
package main
import (
"fmt"
//"time"
)
type Test struct {
a int
b float64
c string
}
func main() {
//各类型通用:
// %v 值的默认格式表示
// %+v 类似%v,但输出结构体时会添加字段名
// %#...
分类:
其他好文 时间:
2014-11-20 15:46:43
阅读次数:
101
问题: Sublime Text 在build Python时,如果python源代码里有中文,例如“print(‘中文’)”,Sublime Text 会报 [Decode error - output not utf-8] 分析: ???在Sublime Text里,新建一个python源码文件,...
分类:
其他好文 时间:
2014-11-20 13:50:59
阅读次数:
238
#include long power(int x,int n){long p;for (p=1;n>0;--n)p*=x;return (p);}void main(){int x,m;printf("Enter x and m:");scanf(%d%d",&x,&m);printf("X po...
分类:
编程语言 时间:
2014-11-20 07:55:25
阅读次数:
140
1 创建lua打飞机项目
cocos new T32Lua -dE:\Installed\cocos2d-x-3.2\cocos2d-x-3.2\projects -l lua
2 项目代码
Common.lua
--用于打印日志信息
function cclog(...)
print(string.format(...
分类:
其他好文 时间:
2014-11-20 01:33:37
阅读次数:
660