自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(46)
  • 资源 (2)
  • 收藏
  • 关注

原创 程序员的自我修养 -- 链接、装载与库

首先声明,这是一本好书。:)-- 但是存在一些问题,也有可能是我理解的不够。。 ?2012.11.221.6.2 线程安全互斥量(Mutex)描述说,哪个线程获取了互斥量,哪个线程就要负责释放,其他线程越俎代庖去释放互斥量是无效的。---------------------------------这里说法是错误的,最起码针对Linux实现的pthread

2012-11-22 20:36:33 1347 2

原创 GNU Autotools (autoconf, automake, libtool, etc.) 自动化编译 (2) 多目录和动态链接库

0. 基础    先阅读GNU Autotools (autoconf, automake, libtool, etc.) 自动化编译 (1) 简单示例并成功执行、理解所说内容。1. 先提供一个脚本。拷贝所有内容保存为文件atdir.sh并添加可执行权限,然后执行。注意,最好不要以根用户身份执行它。#!/bin/shecho "Autotools for autotools

2012-02-15 23:55:49 2461 2

原创 GNU Autotools (autoconf, automake, libtool, etc.) 自动化编译 (1) 简单示例

0. 操作平台: Linux1. 软件包安装(Debian)yes | sudo apt-get install gcc make autoconf automake libtool2. 从一个例子谈起。    2.0 完整拷贝如下代码直接在终端执行或者保存为auto-example.sh,添加执行权限执行。或者参考2.1~2.5逐步执行。echo "creat

2012-02-14 17:40:22 3601 1

原创 Introduction to Algorithms 算法导论 第4章 递归式 学习笔记及习题解答

第4章 递归式主方法:         n=1:                T(n) = Θ(1)        n>1:                T(n) = aT(n/b) + Θ(n)   (a≥1, b>1)4.1 代换法1). 猜测解的形式2). 用数学归纳法找出使解真正有效的常数改变变量:T(n) = 2T(⌊n^(1/2)⌋)

2012-02-09 22:41:00 2897 4

原创 Introduction to Algorithms 算法导论 第3章 函数的增长 学习笔记及习题解答

3.1 渐近记号表示算法的渐近运行时间的记号是用定义域为自然数集N = {0, 1, 2, ...}的函数来定义的。这些记号用来表示最坏情况运行时间T(n)。Θ记号    Θ(g(n)) = {f(n): 存在正常数c1,c2和n0,使对所有的n≥n0,有0 ≤ c1*g(n) ≤ f(n) ≤ c2*g(n)}O记号    O(g(n)) = {f(n): 存在正常数c和

2012-01-05 17:51:39 2601

原创 Introduction to Algorithms 算法导论 第2章 算法入门 学习笔记及习题解答

2.1 插入排序插入排序解决的问题:    输入:n个数构成的序列    输出:排序输入序列为,满足a1' ≤ a2' ≤ ... ≤ an'伪码: INSERTION-SORT(A) for j <- 2 to length[A] do key <- A[j] i <- j - 1 whi

2011-12-29 15:42:12 6208 3

原创 Introduction to Algorithms 算法导论 第1章 基础知识 学习笔记及习题解答

什么是算法    定义良好的计算过程,取一个或者一组值作为输入,产生一个或一组输出值。1.1-1 给出一个真实世界的例子,其中包括着下列的某种计算问题:排序,确定多矩阵相乘的最佳顺序,或者找出凸壳。    排序:        这个是最常见的。比如:        某公司市场部季度销售额排名。        Alexa网站排名。(什么是Alexa?http:

2011-12-29 02:05:01 1846

原创 Introduction to Algorithms (算法导论) 学习笔记 -- Chapter 9

Chapter 9 Medians and Order Statistics (中位数和顺序统计)n个元素中查找最小或最大元素,需要进行n-1次比对。同时查找最小和最大的元素,最坏情况下需要进行⌈3n/2 - 2⌉次比较(⌈⌉为上取整)证明:对于n为奇数,初始设置min和max均为第一个元素,剩下n-1个元素为偶数,对于n为偶数,比对前两个元素,设置较小的为

2011-12-23 14:56:24 1439

原创 形形色色的计算机语言

PostScript(PS)        PostScript(PS)是主要用于电子产业和桌面出版领域的一种页面描述语言和编程语言。            http://en.wikipedia.org/wiki/PostScript            http://zh.wikipedia.org/zh-cn/PostScript

2011-12-13 11:27:56 858

原创 深入理解 GNU GRUB - 03 diskboot.S 3.3 diskboot.S详细注释

转载注明出处(cppgp: http://blog.csdn.net/cppgp)diskboot.S位于grub-1.98/boot/i386/pc/目录,采用AT&T汇编语法编写。详细注释如下:/* * GRUB -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2006,2007,2009,2010 Free Software Foundation, Inc. * * GRUB is fre

2011-05-10 09:09:00 2368 1

原创 深入理解 GNU GRUB - 03 diskboot.S 3.1 diskboot.S执行时的环境 & 3.2 diskboot.S代码结构

转载注明出处(cppgp: http://blog.csdn.net/cppgp)diskboot.S位于目录boot/i386/pc/,最终生成diskboot.img。这部分指令被加载到0x8000~0x81FF。diskboot.img加载GRUB内核到0x8200开始的内存位置,并将系统控制权交给GRUB内核。用到的BIOS例程和boot.S中相同。因此本章只描述如下内容:  1)    diskboot.S执行时的环境  2)    diskboot.S代码结构  3)    di

2011-05-10 09:05:00 1732

原创 深入理解 GNU GRUB - 02 boot.S 2.5 MBR过程模拟实现

2.5 MBR过程模拟实现现在,我们对系统引导的第一步已经有了一个详细的认识。为了更深一步的理解MBR和这些BIOS调用,提供一些测试题目:  1)    开机后在屏幕上输出”Hello cppgp”,并在一定时间后重复输出。  2)    开机后紧跟着读取第二个扇区,并且显示整个扇区512字节到屏幕上。实现上述功能,编译生成512字节的IMG文件,设置虚拟机通过软盘引导,选择使用软盘镜像文件,设置镜像文件为我们编译生成的IMG文件,就可进行测试。下文首先简单介绍虚拟机配置,然后实现上述

2011-04-25 11:18:00 1647

原创 深入理解 GNU GRUB - 02 boot.S 2.4 boot.S详细注释

grub 1.98 深入理解 boot.S 详细 注释

2011-04-25 11:08:00 3066

原创 深入理解 GNU GRUB - 02 boot.S 2.2 MBR结构 2.3 boot.S代码结构

<br />转载注明出处(cppgp: http://blog.csdn.net/cppgp)<br /> <br />2.2 MBR结构<br />历史悠久的MBR结构自从IBM兼容PC出现以来一直就没变过(但是为支持2TiB以上硬盘而出现的GUID/EFI结构将更改MBR结构)。MBR结构分为三部分,分别是引导指令、分区表DPT (Disk Partition Table)、幻数Magic (Magic=0x55AA)。其中引导指令占用446字节(0~0x1BD),DPT占用64字节(0x1BE

2011-04-25 11:05:00 1943

原创 深入理解 GNU GRUB - 02 boot.S 2.1 相关BIOS例程

转载注明出处(cppgp: http://blog.csdn.net/cppgp)。2. boot.S: GRUB引导第一步boot.S位于目录boot/i386/pc/。这部分指令被加载到0x7C00~0x7DFF。主要工作包括:配置寄存器;设置堆栈;检测引导盘;检测引导盘读取模式;读取另一扇区指令。这个过程用到几个BIOS例程,并且对主引导记录(MBR, Master Boot Record)结构有很大的依赖。因此boot.S我们分作四步进行详细描述:1)    相关BIOS例程2)   

2011-04-25 10:59:00 2469

原创 深入理解 GNU GRUB - 01

1. 概述1.1 GRUB是什么GNU GRUB是一款多重引导程序。简单来讲,引导程序是计算机开机运行的第一个软件,它的使命是装载操作系统并运行。实际上,由于平台、存储介质、操作系统、文件系统等的多样性,引导程序都很复杂,同时,引导程序要求有更高安全性、健壮性。GNU GRUB支持多平台(例如X86、PowerPC等)、多存储介质(例如硬盘、软盘、光盘、U盘)、多操作系统(例如Linux、Gnu Hurd等)、多重引导(例如Windows等)、多文件系统(例如Ext2、Ext3、Ext4、FAT32

2011-04-25 10:52:00 3977

原创 Linux总线驱动-02: struct bus_type 结构体

本文测试系统为:Ubuntu 10.10 x86_64 2.6.35-24-generic上节中,除了简单的框架,我们还看到了一个和总线驱动相关的结构体bus_type。这个结构体的定义在include/linux/device.h中。本节先简单介绍结构体中的成员,再对每个成员作详细描述。struct bus_type { const char *name; struct bus_attribute *bus_attrs; struct device_attribute *dev_attrs;

2011-04-19 13:41:00 7267

原创 Linux总线驱动-01: 一个简单的示例

本文测试系统为:Ubuntu 10.10 x86_64 2.6.35-24-generic在新的驱动核心支持下,实现一个什么都不做的总线驱动是很简单的。如下,拷贝代码并保存为ycbus.c:/* * ycbus: a software bus driver (virtual bus driver) * * a trivial ycbus driver */#include #include struct bus_type ycbus_type = { .name

2011-04-14 17:02:00 6710 1

原创 C Reference Manual Reading Notes: 010 Definition and Replacement

1. synopsis     The #definepreprocessor command causes a name (identifier) to become defined as amacro to the preprocessor.  A sequences of tokens, called the body ofthe macro, is associat

2009-08-24 21:45:00 1572

原创 C Reference Manual Reading Notes: 009 Preprocessor Lexical Conventions

    The preprocessor does not parse the source text, but it doesbreak it up into tokens for the purpose of locating macro calls. Thelexical conventions of the preprocessor are somewhat different f

2009-08-23 23:05:00 671

原创 C Reference Manual Reading Notes: 008 The C Preprocessor and Preprocessor Commands

1. The C preprocessor    The C preprocessor is a simple macroprocessor that conceptually processes the source text of a C program before the compiler proper reads the source program. In some impleme

2009-08-23 19:05:00 581

原创 C Reference Manual Reading Notes: 007 C++ Compatibility

1. Character Sets    The token respelling and trigraphs inStandard C are part of the C++ Standard, but they are not common inpre-Standard C++ implementations. Boths C and C++ allow universalch

2009-08-23 14:25:00 523

原创 C Reference Manual Reading Notes: 006 Constants

    The lexical class of constants includes four different kinds of constants: integers, floating-point numbers, characters, and strings. Suck tokens are called literals in other languages to distingu

2009-08-06 22:34:00 510

原创 Reset the password of linux fedora

1. power the computer and into grub-select-face.2. select the OS and input e         Fedora (...)         Ubunto(...)         Windows3. select line which begin with "kernel" and input ch

2009-08-03 15:58:00 507

原创 C Reference Manual Reading Notes: 005 Tokens ( Without Constants )

    Five classes of tokens: operators, separators, identifiers, keywords, and constants.     (1) operators and separators.             ! % ^ & * - + = ~ | . / ?             += -= *= /= %=  

2009-08-02 01:45:00 551

原创 C Reference Manual Reading Notes: 004 Comments

    Standard C supported two stylized comments:      (1) Begin with the two characters /* and ends with the first subsequent occurence of the two characters */.      (2) Begin with the characters

2009-08-01 19:47:00 468

原创 C Reference Manual Reading Notes: 003 Multibyte and Wide Characters

    To accommodate non-english alphabets that may contain a large number of characters, Standard C introduces wide characters and wide strings.  To present wide characters and wide strings in the exte

2009-08-01 19:06:00 460

原创 C Reference Manual Reading Notes: 002 Whitespace, Line Termination, and Lines Length Limits

   The blank(space), end-of-line, VT, FF, HT, and comments are known collectively as whitespace character (WSC). These characters are ignored except insofar as they are used to separate adjacent token

2009-08-01 17:34:00 409

原创 C Reference Manual Reading Notes: 001 Character set

1. CHARACTER SET    A C source file is a sequence ofcharacters selected from a character. C programs are written using thefollowing characters:   1). the 52 Latin capital and small letters: A~

2009-07-29 23:16:00 780

原创 CSS Study Notes 1: CSS Import Method

 1. The link tag     example:      rel="stylesheet" type="text/css" href="import.css" />

2009-06-27 10:59:00 1134

原创 emacs 基本操作指令整理(1)

-x -f              -x find-file                             查找文件并在新缓冲区打开-x -v             -x find-alternate-file            查找另外一个文件替换掉当前已读入的文件-x i                                  -x insert-file 

2009-06-24 09:29:00 531

原创 starDict 在 window 下的安装

1. 到 http://stardict.sourceforge.net/download.php 下下载 exe 文件。我下载的 stardict-3.0.2.exe 2. 到 http://stardict.sourceforge.net/Dictionaries_zh_CN.php 下面下载词典。下载 tarbal 的即可。词典很多,选择自己喜欢的下载。 3. 用 win

2009-06-22 17:22:00 725

原创 动态库查找路径设置

一直在用 LD_LIBRARY_PATH 设置动态苦查找路径在开发时使用。今天设置后不起作用,想了半天才想起来需要 export。记此一笔: [sh]# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`

2009-06-22 14:17:00 636

原创 fedora10 启用 Win+D 显示桌面

在 windows 下习惯了 win+D 键实现显示桌面。因此在 fedora10 下也设置下: fedora10 显示桌面默认快捷方式是 ++D。现更改为 +D 。如下: 1. 如果没安装 gconf-editor,则先安装: yum install gconf-editor 2. shell 下运行 gconf-editor 命令或者 执行 “Applications

2009-06-21 23:54:00 703

原创 fedora10 yum install 错误:Package *.rpm is not signed

不知道是否是因为关闭了 selinux 的原因,突然间在使用 yum 安装时出现如下错误: Package *.rpm is not signed*.rpm 为应用程序包 解决方案是:更改 /etc/yum.conf 下的 gpgcheck=1 为 gpgcheck=0 关于 yum.conf 的详细可参考 man yum.conf。其中对 gpgcheck 的描述是:

2009-06-21 21:42:00 3440

原创 fedora10 amsn 出现 tls 模块无法工作的错

安装 amsn 后运行,出现 tls 无法通过 selinux 的错误。我通过 chcon 添加了属性(通过 ls -Z 可查看相关属性):[root@localhost]# ls -Z /lib/* | less-rwxr-xr-x  root root system_u:object_r:lib_t:s0       /lib/libcap.so.2.10// ...[root

2009-06-21 21:32:00 514

原创 fedora 下的词典:stardict

习惯了 windows 下使用 xdict。不过觉得 stardict 也挺好用的: [root@localhost]# yum install stardict 然后到 http://stardict.sourceforge.net/Dictionaries_zh_CN.php 下载词典 rpm。我下载了去全不能下载的然后用 yum install staridct-* 进行了安

2009-06-21 09:06:00 1780 1

原创 fedora 下给 firefox 安装 adobe flash player 插件

使用 yum、rpm 等尝试安装了一遍。全部失败(firefox查找不到)其实最简单的方式就是下载 .tar.gz 包,然后解压缩,移动文件 libflashplayer.so  到 ~/.mozilla/plugins/ 即可

2009-06-21 08:30:00 1465

原创 fedora pdf 和 chm 软件安装

pdf:evinvechm: gnochm直接用 yum install application_name 安装即可。

2009-06-21 01:03:00 735

原创 fedora 中文输入问题

新安装的 fedora10 无法输入中文。解决方案如下: 1. 选择 “System --> Preferences --> Personal --> Input Method” 2. 选中 Enable input method feature 3. 点击 Input Method Preferences 进入 SCIM 配置界面 4. FrontEnd 项 Gl

2009-06-21 00:48:00 589

TCP/IP Illustrated Volume 1.chm

TCP/IP 详解卷一英文版。CHM格式。TCP/IP网络编程必备书籍。国际知名的Unix和网络专家 W.Richard Stevens 作品。

2009-06-28

Effective_STL(中文版)

不用多说了,进阶STL的经典教程

2007-07-26

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除