1. 查看文件内容常用的命令
cat : 由第一行显示文件内容
tac: 从最后一行开始显示,与cat相反
nl : 文件内容和行号一起输出
more: 一页一页显示
less: 与more类似,可以往前翻页
head: 取头部几行
tail: 取尾部几行
od: 以二进制方式读取文件内容...
分类:
系统相关 时间:
2014-07-08 21:30:55
阅读次数:
253
代码注释比较详细:
#include
#include
using namespace std;
struct Node{
int data;
Node* next;
};
Node* head = NULL;
bool create() {
head = (Node*)malloc(sizeof(Node));
if(NULL == head) return false;...
分类:
其他好文 时间:
2014-07-08 21:05:05
阅读次数:
238
def Merge(head1, head2):
if head1 == None: return head2
if head2 == None: return head1
psuhead = ListNode(-1)
tail = psuhead
while head1 and head2:
if head1.val < head2.val:
cur = head1
...
分类:
其他好文 时间:
2014-07-08 18:46:04
阅读次数:
227
本文记录5种创造型模式的剩下两种:建造者模式(Builder)、原型模式(PROTOTYPE)。一、建造者模式(别名:生成者模式)将复杂对象的构建和它的表示分离,使得同样的构建过程可以创建不同的表示。一个完整的建造者模式包含以下几个概念:1、产品类 Productpublic class Person {
private String head;
private Str...
分类:
编程语言 时间:
2014-07-08 17:45:02
阅读次数:
193
题目
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant spac...
分类:
其他好文 时间:
2014-07-08 13:46:26
阅读次数:
205
斐波那契数列的几种不同的算法,递归的不同实现: 1 #include "stdio.h" 2 #include "math.h" 3 4 5 int factorial_tail(int n,int acc1,int acc2) 6 { 7 if (n < 2) 8 re...
分类:
其他好文 时间:
2014-07-06 16:40:31
阅读次数:
204
今天解决png图片在IE6下的背景透明问题,找到了一个好方法。之前的解决方案会造成错位,使页面变形。现把这个方法公布如下,本人亲测可以正常使用,如果你在使用中出现问题,请看实例中的说明(英文不精的童鞋可以用谷歌翻译哟) 在页面中head部分加上如上代码,是为了让IE6以下浏览...
分类:
Web程序 时间:
2014-07-06 13:57:10
阅读次数:
173
简单的插入排序,总是超时,暂且放在这记录一下。
class Solution:
# @param head, a ListNode
# @return a ListNode
def insertionSortList(self, head):
if head == None or head.next == None:
return head
psuhead...
分类:
编程语言 时间:
2014-07-06 11:52:20
阅读次数:
230
可以练习下链表的逆置。
def PrintListReversingly(head):
if head == None:
return
if head:
PrintListReversingly(head.next)
print head.val
def reverse(head):
if head == None or head.next == None:
return...
分类:
其他好文 时间:
2014-07-06 09:29:57
阅读次数:
214
1.首先制作一个16x16的icon图标,命名为cssbbs.ico(这里的名字可以随便改!),放在根目录下。2.然后将下面的代码嵌入head区:如果直接把图标命名为favicon.ico放在网站根目录下,浏览器会自动寻找这个图标,并在网页标题栏中显示。另外想在浏览器的收藏夹里也加入ICO图标的话,...
分类:
Web程序 时间:
2014-07-05 20:52:45
阅读次数:
247