码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
【C++】Geekband-专题二:虚指针和内存分配
1. 传统继承类的设计 static void print_object(const char* name, void* this_, size_t size) { void** ugly = reinterpret_cast(this_); size_t i; printf("created %s... ...
分类:编程语言   时间:2016-04-22 09:26:12    阅读次数:310
Linux网络相关查询脚本
转载 1. 查看TCP连接状态 netstat -nat |awk '{print $6}'|sort|uniq -c|sort -rn netstat -n | awk '/^tcp/ {++S[$NF]};END {for(a in S) print a, S[a]}' 或 netstat -n ...
分类:系统相关   时间:2016-04-21 23:30:34    阅读次数:262
python学习笔记(一)
1、最基本的IO语句 name=input() print('hello,',name) 2、python还允许用r''表示''内部的字符串默认不转义 print('\\\t\\') print(r'\\\t\') 3、空值用none表示,但不能理解为0。因为0是有意义的。 4、java是静态语言, ...
分类:编程语言   时间:2016-04-21 22:03:40    阅读次数:270
go的同步模型
首先来看一段代码,这是The Go Memory Model一文中的一个例子 var a, b int func f() { a = 1 b = 2 } func g() { print(b) print(a) } func main() { go f() g() } 其实需要说的是两点: 第一: ... ...
分类:其他好文   时间:2016-04-21 20:29:28    阅读次数:128
shell 分析 nginx 日志统计
1.统计ip访问量前10的ip地址cataccess.log|awk‘{print$1}‘|sort|uniq-c|sort-nr|head-n102.查看当天ip访问量统计cataccess.log|grep"21/Apr/2016"|awk‘{print$1}‘|sort|uniq-c|sort-nr3.查看访问前10的页面统计cataccess.log|grep"21/Apr/2016"|awk‘{print$7}‘|sort|uniq-c|sor..
分类:系统相关   时间:2016-04-21 18:49:14    阅读次数:232
进程数据共享
进程各自持有一份数据,默认无法共享数据#!/usr/bin/envpython#coding:utf-8frommultiprocessingimportProcessfrommultiprocessingimportManagerimporttimeli=[]deffoo(i):li.append(i)print‘sayhi‘,liforiinrange(10):p=Process(target=foo,args=(i,))p.start()print‘ending‘,..
分类:系统相关   时间:2016-04-21 18:47:58    阅读次数:250
利用iptable limit模块限制ip下载速度
#!/bin/bash#SPEED=`/bin/bash/etc/zabbix/script/flow.sh|cut-d‘.‘-f1`SPEED=`/bin/bash/root/flow.sh|cut-d‘.‘-f1`[-z$SPEED]&&SPEED=1EXIST=`iptables-n-v-L|grepCC-FLOW|wc-l`if[$SPEED-gt1250];thenIP=`netstat-antup|grepESTABLISHED|awk‘{print$5}‘|grep-o"\([0..
分类:其他好文   时间:2016-04-21 15:24:32    阅读次数:433
tc流控脚本 ,动态保证每个ip有1M带宽
tc主脚本:#!/bin/bash#./root/tc_functionsNUM=2DEV=eth0init_tc$NUMwhile:;do#IP=`netstat-antup|grepESTABLISHED|grep80|cut-d":"-f8`IP=`netstat-antup|grepESTABLISHED|grep80|awk‘{print$5}‘|grep-o"\([0-9]\{1,3\}\.\)\{1,3\}[0-9]\{1,3\}"|sort-rn|uniq-c|awk‘{print$2..
分类:其他好文   时间:2016-04-21 15:22:35    阅读次数:152
echo print() print_r() var_dump()的区别
echo print() print_r() var_dump()的区别 常见的输出语句 echo()可以一次输出多个值,多个值之间用逗号分隔。echo是语言结构(language construct),而并不是真正的函数,因此不能作为表达式的一部分使用。print()函数print()打印一个值( ...
分类:其他好文   时间:2016-04-21 13:25:25    阅读次数:131
python-01,自动写入文件
有一个考勤员工名单,每次增加删除人员太麻烦,找python简单写一个脚本进行管理,01,实现人员追加操作#addamddeletecard #coding=utf-8 wfile=open(‘account.dat‘) readfile=wfile.read() print"请输入新社员信息。" print"社员信息如:C07004,dddd,于欣,2,020353,,,,,,,,,," ..
分类:编程语言   时间:2016-04-21 11:58:36    阅读次数:151
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!