C中的标准输入输出可以进行重定向到文件。示例程序:(C Primer Plus示例8.2)// echo_eof.c -- 重复输入,直到文件的结尾#include int main(void){ int ch; while ( (ch = getchar()) != EOF) ...
分类:
其他好文 时间:
2014-07-01 22:43:32
阅读次数:
273
//扩展Array原型,编写一个去除数组重复项的方法// 算法一,两层循环,性能差Array.prototype.unique = function(){ var len = this.length, i; // 两两比较(数组长度大于1) while ( --len > 0 ) ...
分类:
其他好文 时间:
2014-07-01 20:46:35
阅读次数:
229
1. 一个机构要为新学员分配住宿,一共有x个学员,每个房间能住6人,用一个公式来计算需要的房间数. 答案:(x+5)/6. 这个同样适用于分页问题,x就是总记录数,6就是每页显示数。2. 让x值在0到9之间不断循环变化,写出相应的代码:int x=0;while(true){x=(x+1)%10;}...
分类:
其他好文 时间:
2014-07-01 19:28:53
阅读次数:
143
前面已经学习过auto_ptr,这里补充另外一种智能指针,比auto_ptr要更强力更通用的shared_ptr。 shared_ptr 简介及使用选择 几乎所有的程序都需要某种形式的引用计数智能指针,这种指针让我们不再需要为两个对象或更多对象共享的对象的生命周期而编写复杂的逻辑(写起来有点绕口)....
分类:
其他好文 时间:
2014-07-01 13:25:27
阅读次数:
217
Lua提供了一组传统的,小巧的控制结构,包括用于条件执行的if,用于迭代的while、repeat和for。所有的控制结构都有一个现实的终止符号:if for while 都以end结尾,repeat以until作为结尾。控制结构中的条件表达式可以使任何的值,Lua将所有false和nil的值视为“...
分类:
其他好文 时间:
2014-07-01 12:41:38
阅读次数:
253
public class FillQueueThread extends Thread {
private Queue queue;
public FillQueueThread(Queue queue){
this.queue = queue;
}
@Override
public void run() {
while(true){
try {
boolean a...
分类:
数据库 时间:
2014-07-01 11:20:37
阅读次数:
332
//这里实现 某个文件下的所有图片,并列出来!
header("Content-type:text/html;charset=utf8");
$handle=opendir('.');
echo "目录 handle: $handle\n";
echo "档案:\n";
while ($file = readdir($handle)) {
if(@eregi("[_\.0-...
分类:
Web程序 时间:
2014-07-01 11:19:52
阅读次数:
233
1、错误描述
java.sql.SQLException: ORA-0064:error occurred at recursive SQL level 1.
ORA-06153:unable to extend table SYS.AUD$ by 8192 in tablespace SYSTEM.
ORA-02002:error while writing to audit trail.
O...
分类:
数据库 时间:
2014-07-01 08:01:47
阅读次数:
463
Ø 读取文件的时间
#!/bin/bash
for file in `ls /root`
do
stat $file>1.txt
sed -n "7p" 1.txt>2.txt
usetime= awk -F ":" '{print $2}' 2.txt
echo "time="$file $usetime
done
Ø 读取文件的每行while...
分类:
其他好文 时间:
2014-07-01 06:49:51
阅读次数:
204
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.mapView = [[MKMapView alloc] initWithFrame:self.view.bounds];
self.mapView.mapType =...
分类:
其他好文 时间:
2014-07-01 06:17:34
阅读次数:
758