while loops
定义与实例
i = 0
numbers = []
while i < 6:
print "At the top i is %d" % i
numbers.append(i)
i = i + 1
print "Numbers now: ", numbers
print "At the bottom i is %d" % ...
分类:
编程语言 时间:
2014-06-11 00:59:17
阅读次数:
410
一. CPU性能评估1.vmstat [-V] [-n] [depay [count]]-V
: 打印出版本信息,可选参数-n : 在周期性循环输出时,头部信息仅显示一次delay : 两次输出之间的时间间隔count :
按照delay指定的时间间隔统计的次数。默认是1如:vmstat 1 3us...
分类:
系统相关 时间:
2014-06-10 21:07:21
阅读次数:
471
什么是Targeting?Targetingminions是指那些minion会作为运行命令或是执行状态的目标。这些目标可以是一个主机名,系统信息,定义的分组,甚至是自定义的绑定的对象。例如命令saltweb1apache.signalrestart可以重启ID为web1的minion的apache。当然也可以在top文件中使用web1来作..
分类:
其他好文 时间:
2014-06-10 18:52:10
阅读次数:
363
题目
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is trying t...
分类:
其他好文 时间:
2014-06-10 18:43:37
阅读次数:
254
1. 图片背景的设置。1.1 background:url(images/banner_01.jpg)
center top no-repeat; 这样设置的话,收缩窗口后,图片会慢慢被遮挡。1.2
img标签,设置width:100%的方式,收缩图片后,图片会慢慢收缩变形。2.窗口缩小后,出现滚....
分类:
其他好文 时间:
2014-06-10 16:14:20
阅读次数:
201
之前总结uptime和free命令,今天继续来总结一下iostat。给自己留个笔记,同时也希望对大家有用。
版本信息:
sysstat version 9.0.4
(C) Sebastien Godard (sysstat orange.fr)
基本使用:
iostat [ -c ] [ -d ] [ -N ] [ -n...
分类:
移动开发 时间:
2014-06-10 14:51:05
阅读次数:
241
版本信息:
procps version 3.2.8
基本使用:
vmstat [-a] [-n] [-t] [-S unit] [delay [ count]]
[-a]:显示活跃和非活跃内存
[-n]:只在开始时显示一次字段名,针对多次收集信息的情况输出人性化一点
[-t]:在每条信息的末尾,显示收集信息的时间
[-S unit]:使用指定单位显示。参数有 k...
分类:
系统相关 时间:
2014-06-10 14:28:07
阅读次数:
333
栈的定义
1, 栈是一种特殊的线性表
2,栈仅能在线性表的一端进行操作
3,栈顶(Top): 允许操作的一端 允许操作的一端
4,栈底(Bottom): ,不允许操作的一端 不允许操作的一端
这里我们实现了顺序栈和链式栈~~~~...
分类:
编程语言 时间:
2014-06-10 13:49:52
阅读次数:
265
问题:
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
分析:
该问题是符合斐波那契数列的,具体...
分类:
其他好文 时间:
2014-06-10 08:19:31
阅读次数:
194
题目
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
方法
从后往前求解...
分类:
其他好文 时间:
2014-06-10 07:38:21
阅读次数:
171