鹏哥给的玩意儿 运算一下试试自己的电脑能跑多块
Written by 小锋 on 09-02-20 10:29 AM
鹏哥给的玩意儿 运算一下试试自己的电脑能跑多块
附件:super_pi_mod.rar (43.04 K, 下载次数:357)
Written by 小锋 on 09-02-12 12:48 AM

设置x_axis_labels标签稍微有些复杂,之前介绍过x_axis对象有提供过set_labels_from_array方法,是创建对象方式标签,格式:
set_labels_from_array( $a ) //参数是一个数组定义
注意上面方法是x_axis对象的方法,别搞错!
OFC提供更进一步的设置x轴标签显示的参数,就是x_axis_labels
对象:x_axis_labels
方法:
事例代码:
效果演示:
点击查看PHP输出的格式
更为细节的设置x轴标签对象x_axis_label,注意和上面所说的x_axis_labels就一个s区别
对象:x_axis_label($text, $colour, $size, $rotate)
参数依次是标签名、标签颜色、标签大小、旋转方式("vertical" "diaganol" or "horizontal" )
方法:
事例代码:
转自http://www.51toria.cn/article.asp?id=137
Written by 小锋 on 09-02-12 12:46 AM

对象:y_axis
事例代码:
注意:y_axis默认位置是在左边,想设置在右边就要用与它有相同方法的另一个对象是y_axis_right,它们的方法一致!还有注意一些方法的重合性
效果演示:
正负y轴:
右边y轴:
点击查看PHP输出的格式
点击查看Y轴正负值格式
点击查看Y轴右边格式
转自http://www.51toria.cn/article.asp?id=134
Written by 小锋 on 09-02-08 10:35 PM
- #!/bin/bash
- i=0
- while [ $i -le 31 ]
- do
- if(($i < 10))
- then
- KK="0${i}"
- else
- KK=${i}
- fi
- `mv log_${KK}.txt log_01.txt`
- mysqlimport -uroot -p`cat xx` xx_logs /data/backup/xx/db/save_0131/xx_utf8/log_01.txt
- `mv log_01.txt tmp/log_${KK}.txt`
- sleep 5
- i=$(($i+1))
- done
Written by 小锋 on 09-02-06 9:03 AM
就是你本地掉了 。。。服务器还是会在跑的
tcsh
php xx.php &
Written by 小锋 on 09-02-06 1:48 AM
str_pad($i,2,'0',STR_PAD_LEFT)
Written by 小锋 on 09-02-04 1:18 AM
复制某个目录下面的所有文件到另外一个目录……
» 阅读全文
Written by 小锋 on 09-02-04 1:17 AM
- function DeletePath(mDirName: string): Boolean; { 返回删除指定目录是否成功 }
- var
- vSearchRec: TSearchRec;
- vPathName: string;
- K: Integer;
- begin
- Result := True;
- vPathName := mDirName + '\*.*';
- K := FindFirst(vPathName, faAnyFile, vSearchRec);
- while K = 0 do begin
- if (vSearchRec.Attr and faDirectory > 0) and
- (Pos(vSearchRec.Name, '..') = 0) then begin
- FileSetAttr(mDirName + '\' + vSearchRec.Name, faDirectory);
- Result := DeletePath(mDirName + '\' + vSearchRec.Name);
- end else if Pos(vSearchRec.Name, '..') = 0 then begin
- FileSetAttr(mDirName + '\' + vSearchRec.Name, 0);
- Result := DeleteFile(PChar(mDirName + '\' + vSearchRec.Name));
- end;
- if not Result then Break;
- K := FindNext(vSearchRec);
- end;
- FindClose(vSearchRec);
- Result := RemoveDir(mDirName);
- end;
Written by 小锋 on 09-02-02 12:59 AM
<?php
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
// Note our use of ===. Simply == would not work as expected
// because the position of 'a' was the 0th (first) character.
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";
}
// We can search for the character, ignoring anything before the offset
$newstring = 'abcdef abcdef';
$pos = strpos($newstring, 'a', 1); // $pos = 7, not 0
?>
Written by 小锋 on 09-02-02 12:52 AM
nginx中如果一个server节点有多个域名,并且在不是访问主域名的情况下如果进行rewrite跳转,会自动把域名转换成主域名。比如:
1 2 3 4 5 |
server {
server_name www.my.com www.site.com;
rewrite ^/$ /src/login.php redirect;
......
}
|
这里如果访问www.site.com的话会自动跳转到www.my.com/src/login.php,而不是www.site.com/src/login.php。
解决方法:
如果nginx版本在0.6.x及以上版本的话使用
1 2 3 4 5 6 |
server {
server_name www.my.com www.site.com;
server_name_in_redirect off;
rewrite ^/$ /src/login.php redirect;
......
}
|
老版本的话可以使用
1 2 3 4 5 6 7 |
server {
server_name www.my.com www.site.com;
location = / {
rewrite ^ /src/login.php redirect;
}
......
}
|
关键点:
如果server_name_in_redirec为on,那么nginx将使用server_name中的第一个 server name来进行rewrite跳转。如果设置成off的话nginx将使用请求中Request Headers中的host来进行rewrite跳转。
server_name_in_redirec 可以在配置文件中 http , server 和 location 区域级别中使用。