转自:http://onlyaa.com/html/javascript/index.htm
/*javascript 使用正则表达式替换*/
var str = 'hfggds';
str = str.replace(/^\s+/gi, '');
str = str.replace(/\s+$/gi, '');
/*string <=> integer*/
/*整型与字符型相互转换*/
var s = 1;
s = s + "";
s = new String (2345);
n = 1*s;

/*枚举*/
Enumator
{
a = 0,
b = 1,
c,
};
/*定义一个对象*/
/*define a object*/
var obj = {
a: 1,
b: 2,
c: function(g){alert(g)},
d: 4
}
alert(obj['a']);
obj.c("obj.c");
obj.c = function(){
alert(this.b);
};
obj.c();

var obj = new Object();
obj.a = 1;
obj.b = 2;
obj.c = function(){};
/*数组的定义*/
/*define array*/
var array = new Array();
var array = [[1,2],[3,4]];


/*模块之间值的传递*/
1.通过global全局变量传递
2.通过return返回
a.返回变量 return var;
b.返回一个对象 return {};
3.通过类的属性传递

/*取得variant类型*/
typeof variant
/*类的方法*/
/*类的构造函数*/
// this only constructor for creating other class
var __CLASS = {
create: function() {
return function() {
this._initialize.apply(this, arguments);
};
}
};
//创建类
var chartData = __CLASS.create();
//定义类
chartData.prototype={
m_a : 0,
m_p : null,
_initialize : function(a, p){
this.m_a = a;
this.m_p = p;
this.data = [];
},
fa : function(){
var _this = this;
alert(_this.m_a); 
}
}
//使用类
var aa = new chartData;
//默认构造
aa._initialize("aa", null);
//调用方法
aa.fa();
/*show window status*/
function showms() {
var str = '(x='+event.x+', y=' + event.y + ')';
window.status = str;
}

/* 自动设置大小 */
<script language="javascript">
attachEvent('onresize', function(){
alert(screen.availWidth);
});
</script>

===
vim:filetype=changelog
标签: js
日期: 2016-11-25 17:30:06, 8 years and 51 days ago

atomic只能保证读写的原子性,即有三个线程A,B,C 同时操作一个atomic的属性p。其中 线程A读取p值,线程B和线程C分别向p赋值。在这种情况下线程A读取的p值只可能有三种情 况,A初始值,线程B赋的值和线程C赋的值。因为,atomic保证了读写操作的原子性。但线 程A所读的值是不能确定的,所以不具备线程安全性。另外,如果出现线程D,在线程A,B, C进行读写操作的同时,释放掉属性p,则有几率会造成崩溃,也是线程不安全的情况。

标签: objc
日期: 2016-11-18 17:30:06, 8 years and 58 days ago
for (before-all; condition; after-each) {
}

for loop

标签: c
日期: 2016-11-11 17:30:06, 8 years and 65 days ago

2009-03-21 publish in 百度空间

1、SendMail
$>mail -s "title" usrname
text
.<退出编译>
Cc:

$>mail -s "title" usrname < text.mail


2、RecvMail

$>mail
"/var/spool/mail/root": 1 message 1 unread
>N 1 xxxxxxxx@localho ......
&1
q "quit and move to ~/mbox"
x "quit"

参考:
[1]http://www.mqney.com/archives/001859.html
[2]《rh033-unit5》:http://v.youku.com/v_playlist/f1528851o1p5.html
标签: linux
日期: 2016-11-04 17:30:06, 8 years and 72 days ago