python中多进程与Linux 下的C基本相同。 fork的基本使用 先看最简单的例子: # coding: utf-8
import os def my_fork(): pid = os.fork() if pid == 0: print 'this is child, pid = %d, pa...
分类:
编程语言 时间:
2014-11-12 22:58:05
阅读次数:
300
继常量池后继续解析,代码如下:short tempShort = stream.readShort(); System.out.print("access_flags----->"); String value = UtilMap.getClassAccessMap().get(Long.val.....
分类:
编程语言 时间:
2014-11-12 22:48:39
阅读次数:
499
反正知道了就是知道,不知道也想不到,很快#include #include #include using namespace std;inline void print_prime_k(long long p, long long k) { printf("%lld", p); ...
分类:
其他好文 时间:
2014-11-12 20:59:25
阅读次数:
211
条件与循环
条件执行:
name = raw_input('What is your name? ')
if name.endswith('Gumby'):
print 'Hello, Mr.Gumby'What is your name? Gumby
Hello, Mr.Gumbyname = raw_input('What is your name? ')
if name.endswit...
分类:
编程语言 时间:
2014-11-12 19:50:03
阅读次数:
245
2,"id"=>4);
print_r(($b));
echo $b['name'];
$a=1;
while ( $a...
分类:
Web程序 时间:
2014-11-12 19:48:38
阅读次数:
160
x=1
whilex<10:
y=list(range(x))
forziny:
z+=1
print(‘%d*%d=%d‘%(x,z,x*z),end=‘‘)
x+=1
print(‘\n‘)
分类:
编程语言 时间:
2014-11-12 17:58:56
阅读次数:
237
$ gedit price.py
#!/usr/bin/env python
width = input('Please enter width: ')
price_width = 10
item_width = width - price_width
header_format = '%-*s%*s'
format = '%-*s%*.2f'
print '=' * width...
分类:
编程语言 时间:
2014-11-12 16:33:21
阅读次数:
248
跳过'src/emacs'和它下边的所有文件,列出其它发现的文件,执行下边的命令:1. find . -path './src/emacs' -prune -o -print只查找当前目录下,不搜索任何当前目录下的所有子目录2. find . -maxdepth 1 -name "*sql"1,2条...
分类:
其他好文 时间:
2014-11-12 16:24:12
阅读次数:
181
主要内容:无符号和有符号之间转换、两数相加溢出后数值计算
#include
/* 这个函数存在潜在漏洞 */
float sum_elements(float a[], unsigned length)
{
int i;
float result = 0;
for(i = 0; i <= length - 1; i++)
{
result += a[i];
print...
分类:
编程语言 时间:
2014-11-12 15:05:39
阅读次数:
267
命令行运行Python脚本
Linux下先创建一个hello.py
$ gedit hello.py
输入:
#!/usr/bin/env python
print 2+2保存退出,运行:
$ python hello.py
4我们也可以让它变得和普通程序一样执行
执行之前,让脚本文件具备可执行属性:
$ chmod a+x hello.py运行脚本:
$ ./hello.py ...
分类:
编程语言 时间:
2014-11-12 13:47:51
阅读次数:
180