[Question]
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to t...
分类:
其他好文 时间:
2014-05-07 05:37:44
阅读次数:
278
Qt中事件分发源代码剖析
Qt中事件传递顺序:
在一个应该程序中,会进入一个事件循环,接受系统产生的事件,并且进行分发,这些都是在exec中进行的。
下面举例说明:
1)首先看看下面一段示例代码:
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MouseEvent w;
w.sho...
分类:
其他好文 时间:
2014-05-07 04:35:25
阅读次数:
390
Given a triangle, find the minimum path sum
from top to bottom. Each step you may move to adjacent numbers on the row
below.For example, given the fol...
分类:
其他好文 时间:
2014-05-07 02:55:24
阅读次数:
377
程序与进程:
程序(program)是一个普通文件,是机器代码指令和数据的集合,这些指令和数据存储在磁盘上的一个可执行映像中。所谓可执行映像就是一个可执行文件的内容。使用6个exec函数中的一个由内核将程序读入内存,并使其执行。
进程(process)是一个动态的实体,它具有生命周期,系统中进程.....
分类:
其他好文 时间:
2014-05-07 02:33:54
阅读次数:
352
Jquery 方式获取 iframe Dom元素
测试页面代码:
jquery方式,访问iframe页面dom元素
function getIframeDom(){
// 获取iframe的test元素
var test = $("#frame_1").contents().find("#test");
alert(test.html())
}...
分类:
Web程序 时间:
2014-05-06 23:14:38
阅读次数:
343
本章关注单进程运行环境:启动&终止、参数传递和内存布局等。
进程启动终止
如图所示:
启动:内核通过exec函数执行程序,在main函数运行之前,会调用启动例程(start-up routine),取得命令行参数和环境变量。可以把启动例程理解为exit(main(argc,argv))。终止:五种正常终止方式(从main方法返回/exit/_exit/最后一个线程返回/最...
分类:
其他好文 时间:
2014-05-06 22:03:53
阅读次数:
514
findfind命令是我们常用的查找文件的命令,它是一个非常强大的查找指令,但相对话费的时间会很长,并且非常消耗资源。语法:find【路径】【参数】【表达式】【-exec-ok...】指令{}\;{}代表find找到的文件;\禁止转义;{}\;之间是有空格的;;表示本指令结束-execfind命令对匹配..
分类:
系统相关 时间:
2014-05-06 20:57:13
阅读次数:
501
#find/usr-namepxelinux.0#find/usr/share-namepxe*#find/usr-namepxelinux.?#tail/etc/passwd#find/-userapache#find/-usernamed#df-i#find/-inum1016273--execrm-fr{}\;#find/-size+204800-execrm-fr{}\;#find/etc-nameinit*-okls-l{}\;#find/-size204800#find/-size+204800(..
分类:
其他好文 时间:
2014-05-06 16:44:34
阅读次数:
258
selinux限制apacheexec执行cgi一、起因某日发现smokeping访问失败,发布的apache进程不存在;在/usr/local下找不到任何apache文件,怀疑apache是rpm安装,使用/etc/init.d/httpd启动后果真listen8001端口···二、排查1、获取error日志的关键内容启动后尝试刷新8001下的smokep..
分类:
系统相关 时间:
2014-05-06 16:39:10
阅读次数:
689
chen@chen-pc~/demo/abc/bin$railsc
/home/chen/.rvm/gems/ruby-2.0.0-p451/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in`autodetect‘:CouldnotfindaJavaScriptruntime.Seehttps://github.com/sstephenson/execjsforalistofavailableruntimes.(ExecJS::RuntimeUnavailable)..
分类:
编程语言 时间:
2014-05-06 16:13:25
阅读次数:
407