1.
信号量机制的缺陷问题:在上面的生产者消费者实例中,信号量的工作机制如下(我们以生产者的代码为例):1 down(&empty);2
down(&mutex);3 enter_item(item);4 up(&mutex);5
up(&full);如果交换1号和2号语句,变成:1 down(&m...
分类:
其他好文 时间:
2014-06-06 22:36:54
阅读次数:
336
键盘移动 (Move)一切都从键盘的移动k-> 上 upj-> 下
downh-> 左 leftl-> 右 rightz-> 重画屏幕,当前光标变成屏幕的第一行 (redraw current line at
top of window)CTRL-f-> 跳到下一页 (page down)CTRL-...
分类:
其他好文 时间:
2014-06-05 15:48:07
阅读次数:
354
思路: 进入/usr/local/apache2/htdocs/ipa/ 循环读取
/root/shell/wget/down.txt 每次一行,每一行直接就是一条命令,直接 $line
就可以执行,如果执行成功把脚本按日期保存下来,错误也保存到错误日志中按日期,都执行完成后,把当前时间插入到txt...
分类:
其他好文 时间:
2014-06-03 06:50:48
阅读次数:
388
1、Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
clas...
分类:
其他好文 时间:
2014-06-02 23:13:22
阅读次数:
290
本题使用动态规划法, 或者记忆法,加上递归法。
不加上递归法,好像很麻烦,因为我们不知道其初始值,只知道其最终值,所以只能往下递推了,这样使用记忆法就比动态规划要方便了。
使用二维表设计其递归记忆表,防止重复计算。还是十分困难的,动态规划法有时候不一定比记忆法要好。
递归记忆法的学名: top-down with memoization; Introduction to Algorithm的Dynamic programming 这章有介绍...
分类:
其他好文 时间:
2014-06-02 23:04:24
阅读次数:
397
所谓端口聚合,指的是把两个或多个物理端口捆绑成一个逻辑链路,两设备多个端口两两相连,从而增加链路带宽,可起到负载均衡的作用,而且多条线路间还能形成冗余备份。比方说,两个千M端口聚合后带宽就有2G,如果其中一个端口down了或线路出问题了并不影响网络的正常运行,只是..
分类:
其他好文 时间:
2014-06-02 14:25:02
阅读次数:
232
Appliesto:
OracleServer-EnterpriseEdition-Version:8.1.7.4to11.2.0.2.0-Release:8.1.7to11.2
GenericUNIX
当检查oracle实例后台进程不存在这时启动启动数据库报错:
ORA-01081:"cannotstartalready-runningORACLE-shutitdownfirst"
造成此种原因是
Orphanedsharedmemor..
分类:
数据库 时间:
2014-06-02 04:04:29
阅读次数:
844
题意:对数列有三种操作:
Print operation l,?r. Picks should write down the value of .
Modulo operation l,?r,?x. Picks should perform assignment a[i]?=?a[i] mod x for
each i (l?≤?i?≤?r).
Set operation k...
分类:
其他好文 时间:
2014-06-02 02:56:56
阅读次数:
465
相信不少同学和我一样遇到这个问题,有时候搞的还要重启电脑,那究竟是什么原因导致的呢,很明显,你的端口被占用了,那下面给出终极解决方案一、首先描述症状,如下图二、出现问题了,首先确定你的sdk目录是不是真的在Console输出的那个位置,如果是的话。接下来现在就要看看到底是谁占用了端口。打开命令编辑器...
分类:
移动开发 时间:
2014-05-31 15:40:38
阅读次数:
366
Given a binary tree, find its maximum depth.The
maximum depth is the number of nodes along the longest path from the root node
down to the farthest le...
分类:
其他好文 时间:
2014-05-30 15:03:42
阅读次数:
237