摘要: While static libraries are useful and essential tools, they are also a source of confusion to programmers because of the way the Unix linker uses them to resolve external references.During the symbol resolution phase, the linker scans the relocatable object files and archives left to right in the sa 阅读全文
posted @ 2014-03-23 09:28 sangoly 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1、用来触发BroadcastReceive的Intent和启动Activity或Service的Intent是不兼容的。2、当文件名做为ContentProvider查询的一部分返回的时候,不应该直接访问文件,应该使用帮助器类(ContentResolver或者openInputStream方法)来访问二进制数据。此方法可以解决linux进程安全问题,并能通过ContentProvider保证所有数据访问实现的规范化。3、模拟器(emulator)与仿真器(simulator)的区别:仿真器工具的工作原理是创建一个与实际环境100%接近的测试环境,但是,它只能接近实际平台,并且这不代表仿真器 阅读全文
posted @ 2014-03-07 22:01 sangoly 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1 import java.io.InputStream; 2 import java.io.RandomAccessFile; 3 import java.net.URL; 4 import java.net.URLConnection; 5 6 public class MultithreadsDownload { 7 public static void main(String[] args) { 8 final int DOWNLOAD_THREAD_NUM = 4; 9 final String FILE_NAME = "... 阅读全文
posted @ 2014-03-03 14:51 sangoly 阅读(209) 评论(0) 推荐(0) 编辑
摘要: The combination of the new hardware supplied by Intel and AMD ,and the new versions of GCC targeting these machines makes x86-64code substantially different from that generated for IA32 machines. The main features include:1、Pointers and long integers are 64 bits long. Integer arithmetic operations s 阅读全文
posted @ 2014-03-02 10:12 sangoly 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 模拟指针,也就是清华严老师《数据结构-C语言描述》中的静态链表,静态链表的引用是使用一段连续的存储区还模拟指针的功能,可以有效的利用一段连续内存进行一定范围内可变的子链表的空间分配,此数据结构原理比较简单,但是实现起来(至少我个人感觉)有一些绕,原因在于结点的指针域和所申请的整个空间数组的下标都是用整型来表示,极易出错,由于使用连续存储区,稍有不甚将指针地址错写成数组下标则很容易出错并且很难被发现。 以下为本次实现的模拟指针代码,由三个文件构成: 1、 simulatedPointer.h 定义了模拟指针的一些基本结构和方法 2、excp.h 和前面一样,包含定制的异常类... 阅读全文
posted @ 2014-02-27 21:39 sangoly 阅读(1367) 评论(0) 推荐(0) 编辑
摘要: Berkeley DB是一个嵌入式的数据库,它适合于管理海量的、简单的数据。关键字/数据(key/value)是Berkeley DB用来进行数据管理的基础。每个key/value构成了一条记录,而整个数据库实际上就是由许多这样的结构单元构成的,使用其提供的API访问数据库时,只需要提供关键字就能访问到相应的数据。当然也可以在提供Key和部分Data来查询符合条件的相近数据。 Berkeley DB底层实现采用B树,可以看成能够存储大量数据的HashMap。Berkeley DB是通过环境对象EnvironmentConfig来对数据库进行管理的,每个EnvironmentConfig对... 阅读全文
posted @ 2014-02-27 15:56 sangoly 阅读(1558) 评论(1) 推荐(1) 编辑
摘要: 第一种是使用arping工具: 1 #!/usr/bin/env python 2 import subprocess 3 import sys 4 import re 5 6 def arping(ipaddress = "192.168.1.1"): 7 p = subprocess.Popen("/usr/sbin/arping -c 2 %s" % ipaddress, shell = True, 8 stdout = subprocess.PIPE) 9 out = p.stdout.read()10 ... 阅读全文
posted @ 2014-02-26 16:30 sangoly 阅读(1978) 评论(0) 推荐(0) 编辑
摘要: 间接寻址(indirect addressing)是公式化描述和链表描述的组合。采用这种方法,可以保留公式化描述方法的许多优点,在单位时间内访问每个元素,可采用二叉搜索方法在对数时间内对一个有序表进行搜索等等。与此同时,也可以获得链表描述方法的重要特色---在诸如插入和删除操作期间不必对元素进行实际的移动。因些,大多数间接寻址链表操作的时间复杂度都有元素的总数无关。 说到底,间接寻址只是一个每链只有一个节点的邻接矩阵。实现起来简单方便,兼具顺序表与链表的优点。 本次程序采用仍使用C++语言实现,为保证通用性使用模板机制。 程序结构: 1、IndirectAddr.h ... 阅读全文
posted @ 2014-02-26 13:35 sangoly 阅读(1053) 评论(0) 推荐(0) 编辑
摘要: Not all conditional expressions can be compiled using conditional moves. Most significantly, the abstract code we have shown evaluates both then-expr and else-expr regardless of the test outcome. If one of those two expressions could possibly generate an error condition or a side effect, this coul.. 阅读全文
posted @ 2014-02-26 11:45 sangoly 阅读(428) 评论(0) 推荐(0) 编辑
摘要: CF: Carry Flag.The most recent operation generated a carry out of the most significant bit. Used to detect overflow for unsigned operations.ZF: Zero Flag. The most recent operation yielded zero.SF: Sign Flag. The most recent operation yielded a negative value.OF: Over Flag. The most recent operation 阅读全文
posted @ 2014-02-25 13:39 sangoly 阅读(160) 评论(0) 推荐(0) 编辑