在前面的教程中,我们已经接触了一些函数,比如print函数。Dart中的函数与其他常见语言(如C、C#、Java)中的函数非常相像。如 var?y?=?f(x); 表示调用函数f并传递实参x,以它的返回值初始化变量y。 现在比较系...
分类:
编程语言 时间:
2015-05-25 14:56:27
阅读次数:
118
#!/bin/sh
#countmemory_used_rate,disk_used_rate
#@yuanwb2015-5
#disk_used_rate
#Dependonrealstorageplacetheparameter‘Location‘needtoalter.
Location=/dev/sda1
Disk_Used_Rate1=$(df-h|grep$Location|awk‘{print$5}‘)
free1=`echo$Disk_Used_Rate1|awk-F%‘{print$1}‘..
分类:
系统相关 时间:
2015-05-25 14:56:12
阅读次数:
286
#!/bin/sh
#countmemory_used_rate,disk_used_rate
#@yuanwb2015-5
#disk_used_rate
#Dependonrealstorageplacetheparameter‘Location‘needtoalter.
Location=/dev/sda1
Disk_Used_Rate1=$(df-h|grep$Location|awk‘{print$5}‘)
free1=`echo$Disk_Used_Rate1|awk-F%‘{print$1}‘..
分类:
系统相关 时间:
2015-05-25 14:54:26
阅读次数:
381
#!/bin/sh
#countmemory_used_rate,disk_used_rate
#@yuanwb2015-5
#disk_used_rate
#Dependonrealstorageplacetheparameter‘Location‘needtoalter.
Location=/dev/sda1
Disk_Used_Rate1=$(df-h|grep$Location|awk‘{print$5}‘)
free1=`echo$Disk_Used_Rate1|awk-F%‘{print$1}‘..
分类:
系统相关 时间:
2015-05-25 14:53:22
阅读次数:
261
#!/bin/sh
#countmemory_used_rate,disk_used_rate
#@yuanwb2015-5
#disk_used_rate
#Dependonrealstorageplacetheparameter‘Location‘needtoalter.
Location=/dev/sda1
Disk_Used_Rate1=$(df-h|grep$Location|awk‘{print$5}‘)
free1=`echo$Disk_Used_Rate1|awk-F%‘{print$1}‘..
分类:
系统相关 时间:
2015-05-25 14:53:13
阅读次数:
303
import functoolssorted_ignore_case = functools.partial(sorted,cmp=lambda s1, s2: cmp(s1.upper(), s2.upper()),key=str.lower)print sorted_ignore_case(['...
分类:
其他好文 时间:
2015-05-25 07:25:46
阅读次数:
147
#!/usr/bin/python
#coding:utf8
classchen():
name="华仔真帅"
deffun1(self):#公有方法可以直接被调用
printself.name
print"----------------我是公有方法"
self.__fun2()
def__fun2(self):#私有方法先被本类的公有方法调用,然后外部访问该公有方法
printself.name
print"..
分类:
编程语言 时间:
2015-05-24 19:07:13
阅读次数:
146
在Python中可以用内置函数type查看对象的类型,isinstance查看某个对象是某个类实例,通过type可以实现动态类,以及通过metaclass实现动态类type()与isinstance()判断对象类型import typesclass Hello():
def hello(self, name='World'):
print('hello %s' % name)...
分类:
编程语言 时间:
2015-05-24 15:50:29
阅读次数:
168
#include
using namespace std;
class B
{
public:
B(int x=0)
{
X=x;
cout<<"B("<<x<<")\n";
}
~B()
{
cout<<"~B()\n";
}
void print()
{
cout ...
分类:
其他好文 时间:
2015-05-24 11:39:12
阅读次数:
199
#include
using namespace std;
class A
{
public:
A()
{
a=0;
}
A (int i)
{
a=i;
}
void print()
{
cout<<a<<" ";
}
private:
int a;
};
clas...
分类:
其他好文 时间:
2015-05-24 10:12:05
阅读次数:
167