- 博客(10)
- 资源 (2)
- 收藏
- 关注
转载 30 Python Language Features and Tricks You May Not Know About
original article: http://sahandsaba.com/thirty-python-language-features-and-tricks-you-may-not-know.html#unpacking1.1 Unpacking>>> a, b, c = 1, 2, 3>>> a, b, c(1, 2, 3)>>> a, b, c = [1,
2014-03-10 08:57:08 900
原创 算法导论学习笔记之五--同时得到最大和最小值复杂度3(n/2)
def get_min_max(l): if len(l) < 1: return None if len(l) == 1: return (l[0], l[0]) if l[0] < l[1]: min = l[0] max = l[1] else: min = l[1]
2014-03-09 01:13:05 827
原创 算法导论学习笔记之四--堆排序
def left(i): return i*2 + 1def right(i): return i*2 + 2def parent(i): return (i-1) / 2def max_heapify(A, i): l = left(i); r = right(i); if l A[i]: largest = l
2014-03-08 17:48:48 510
翻译 写给linux系统管理员看的systemd 六 chroot 和防越狱(systemd作者blog翻译过来的)
作为系统管理员或者开发者你迟早碰到chroot()环境。chroot()系统调用只是改变进程和子进程的根目录/, 由此来限制进程能看到的文件目录树结构。chroot()有两种主要应用:
2014-03-07 20:19:09 5081
原创 算法导论学习笔记之三--如何理解和记忆master定理
Master 理论中的递归函数:T(n) = aT(n/b) + f(n), (a>=1, b >1)理解:aT(n/b)表示子项繁殖的速度, f(n)表示给定规模所需常规开销记忆:记实例不记公式实例1:merge排序算法复杂度nlog(n)递归函数: 实例2:普通矩阵乘法算法复杂度(n**3)递归函数:
2014-03-04 15:59:38 1331 1
翻译 写给linux系统管理员看的systemd 五 关闭的三个级别(systemd作者blog翻译过来的)
http://0pointer.de/blog/projects/three-levels-of-off关闭的三个级别systmed中, 关闭一个服务(或者其它unit)有3个基本. 让我们看看都是哪些:你能stop一个服务. 那只是简单的终止服务的运行实例,其它事情做的很少. 如果由于某激活(比如手动激活,socket激活,总线激活,系统启动激活或者硬件插拔激活)需要
2014-03-03 21:54:44 2174
翻译 写给linux系统管理员看的systemd 四 杀掉服务(systemd作者blog翻译过来的)
原文地址:http://0pointer.de/blog/projects/systemd-for-admins-4.htmlKilling ServicesKilling a system daemon is easy, right? Or is it?Sure, as long as your daemon persists only of a single process
2014-03-02 21:20:04 4075
原创 算法导论学习笔记之二--分而治之(divide-and-conquer approach)
如果一个问题当它的规模缩小的时候,问题性质不变,并且问题的规模最小的时候简单可解,就可以采用divide-and-conquer 方法。divide-and-conquer 分以下4步进行:直接解答: 如果问题足够下,可以直接给出答案分解: 把问题分解成同样性质的几个子问题攻克:递归解决子问题。合并:把解决好的子问题合在一起,组成原有问题的答案# 假设问题为
2014-03-02 17:21:31 5089
原创 循环不变性(loop invariant)-证明算法的正确性的一种方法
循环不变性是在算法中循环的前后都保持不变的一种属性。利用循环不变性证明算法正确应该满足3个条件:(算法导论中提到的)初始条件: 首次循环前不变性成立保持条件: 一次循环前不变性如果成立,则下次循环开始前不变性成立终止条件: 循环结束后,循环不变性应能表明程序的正确性例1(正确的程序)def INSERTION_SORT(A): j = 1 while j
2014-03-02 04:21:45 15653
翻译 写给linux系统管理员看的systemd 三如何把SysV Init脚本转换成一个systmed的service文件 (systemd作者blog翻译过来的)
原文地址:http://0pointer.de/blog/projects/systemd-for-admins-3.htmlHow Do I Convert A SysV Init Script Into A systemd Service File?Traditionally, Unix and Linux services (daemons) are started
2014-03-01 22:02:49 4226
make electronics
2014-07-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人