贵灯提供的简单打印函数,非原创; 注意: do{}while(false); 的使用(内部多个判断,用
do false 中的 break 可以避免使用 if true 引起的嵌套层数过多); 关键段 CRITICAL_SECTION 的使用,封装了 lock 和
unlock 函数; 不定长参数 ...
分类:
其他好文 时间:
2014-05-16 04:26:20
阅读次数:
321
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings....
分类:
其他好文 时间:
2014-05-15 13:27:07
阅读次数:
233
for变量in列表;do语句1语句2done列表的生成逐个给出如/etc/inittab/etc/使用通配符如forfilein/var/*使用命令如forfilein`ls/var`数字序列{起始数字..结束数字}如{1..100}或者`seq起始步长步长结束步长`使用for循环遍历目录#!/bin/bash
#version:0.1
#author:ml
#pragram:this..
分类:
其他好文 时间:
2014-05-15 12:40:38
阅读次数:
280
【题目】
原文:
1.7 Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.
译文:
写一个函数处理一个MxN的矩阵,如果矩阵中某个元素为0,那么把它所在的行和列都置为0.
【分析】
【思路一】
遍历一次矩阵...
分类:
其他好文 时间:
2014-05-15 12:27:37
阅读次数:
293
摘自:http://www.poluoluo.com/jzxy/201204/163035.html在逛codeproject网站的时候,突然看到一篇文章:How
to write plugin in Jquery.如果对E文好的同学 ,可以看上面的连接。现在我把上面网站的及结合自己的想法写这篇文章...
分类:
Web程序 时间:
2014-05-15 10:36:02
阅读次数:
405
直接上代码function test () { } document.write(typeof
test() + "") document.write(typeof new test() +
"")输出结果undefinedundefined好理解,因为test函数没有返回值。那new的时候为什么会...
分类:
编程语言 时间:
2014-05-15 10:00:35
阅读次数:
367
1.为什么使用循环结构? 主要解决代码重复使用时的多次书写。2.循环有些?
java循环有while for do...while foreach四种3.while 循环条件和循环体是循环的两个关键。
循环条件都市boolean类型的表达式。循环条件成立,则执行循环体,循环体执行结束,再判断条件,如...
分类:
编程语言 时间:
2014-05-15 09:45:01
阅读次数:
271
由于现网有时候要测试很多端口的连通性,所以就写了个小脚本,实现批量测试将telnet成功的写入到telnet_alive.txt中,失败则写入telnet_die.txt中#!/bin/bash#thisscripttestUPtootherhost.#Iplist=/opt/script_test/iplist.dataPortnumber=7001foripin$(catiplist.data)do(slee..
分类:
Web程序 时间:
2014-05-15 08:46:11
阅读次数:
385
【题目】
A sequence of N positive integers (10 N , each of them less than or equal 10000, and a positive integer S (S <
100 000 000) are given. Write a program to find the minimal length of the subse...
分类:
其他好文 时间:
2014-05-15 07:58:17
阅读次数:
329
MySQL has a number of global buffers, i.e. your
SGA. There are also a number of per session/thread buffers that combined with
other memory usage const...
分类:
其他好文 时间:
2014-05-15 07:34:17
阅读次数:
307