今天看到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
下面介绍精灵、动画精灵、按钮精灵、文本的常用使用方法
一、精灵相关
1.添加精灵
//创建精灵
Sprite bar_up = new Sprite(400, 0, RegionRes.getRegion(Res.BAR_UP), getVertexBufferObjectManager());
//将精灵添加至BaseEntityGroup或其子类(如:Scene、L...
分类:
其他好文 时间:
2014-10-22 18:27:15
阅读次数:
175
Mac OS X系统图形表示方法
? = shift
? = control
? = option / alt
Home=fn + ?
End=fn + ?
Page Up=fn + ▲
Page Down=fn + ▼
删除后一个字符(普通键盘的Delete)=fn + delete
截图保存整个屏幕到桌面=shift + command + 3
保存整个屏幕到剪...
分类:
系统相关 时间:
2014-10-22 18:17:27
阅读次数:
345
在布局文件里,假设有3层 , 一层是button, textview等常见组件, 二层是嵌套的RelativeLayout, 三层是LinearLayout, 而一个触摸屏幕的事件无非就是ACTION_DOWN, ACTION_MOVE, ACTION_UP. 而手指从按下到松开离开屏幕, 其实事件分发的传递已经经过了这三层. 这里说下它的处理过程, 也算是巩固记忆了.
首先, dis...
分类:
其他好文 时间:
2014-10-22 18:14:12
阅读次数:
215