def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return wordsdef sort_words(words): """Sorts t...
分类:
其他好文 时间:
2014-10-24 16:26:57
阅读次数:
166
问题:
Initialized empty Git repository in /data1/mouxuan/fastsocket-private/.git/
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
解决步骤:
1、cd ~/.ssh
2、ssh-keygen...
分类:
其他好文 时间:
2014-10-24 11:06:30
阅读次数:
256
Pasha has many hamsters and he makes them work out. Today,
n hamsters (n is even) came to work out. The hamsters lined up and each hamster either sat down or stood up.
For another exercise, Pasha n...
分类:
其他好文 时间:
2014-10-24 11:06:01
阅读次数:
238
今天看到CSDN博客的勋章换了图表,同时也增加显示了博客等级,看起来都听清新的,感觉不错!
【题目】
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
click to show follow up.
Follow up:
Did yo...
分类:
其他好文 时间:
2014-10-24 11:01:34
阅读次数:
219
斜率斜率斜率.........
#include
#include
#include
#include
#include
#include
#include
using namespace std;
struct node
{
int x,y;
node(){}
node(int a,int b){x=a;y=b;}
};
int main...
分类:
其他好文 时间:
2014-10-23 19:20:00
阅读次数:
187
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
class Solution {
public:
void rotate(std::vector >...
分类:
其他好文 时间:
2014-10-23 12:37:18
阅读次数:
187
grep -q用于if逻辑判断 安静模式,不打印任何标准输出。如果有匹配的内容则立即返回状态值0。zzx@sdcm152:~$ cat at.txt 04:55:00 up 12:02, 0 users, load average: 0.00, 0.01, 0.05zzx@sdcm152:...
分类:
其他好文 时间:
2014-10-23 12:10:06
阅读次数:
241
先介绍一个非常基础的函数:try_to_wake_up()此函数的作用是:从等待队列中唤醒一个进程,让后将其放到就绪队列中。staticinttry_to_wake_up(structtask_struct*p,intstate,intwake_flags)参数的含义:p:表示的是将要被唤醒的进程;state:可以被唤醒的进程的状态掩码;wake_flag..
分类:
其他好文 时间:
2014-10-23 06:58:36
阅读次数:
253
唤醒等待队列中的等待进程的函数wake_up()函数的核心实现函数是__wake_up_common()函数。__wake_up_common(wait_queue_head_t*q,intmode,intnr_exclusive,intwake_flags,void*key)参数介绍:q:是等待队列头;mode:是进程的状态模式其取值为:TASK_INTERRUPTIBLE,TASK_UNITERRUP..
分类:
其他好文 时间:
2014-10-23 06:51:54
阅读次数:
579
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
关键点:1)判断链表是否有环。
2)一个小坑在判断root和root的next是否为空上。
3)可以看为追及问题。最关键的坑在判断快走(每次走2步的节点),走1步会...
分类:
其他好文 时间:
2014-10-23 00:03:10
阅读次数:
276