自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 资源 (8)
  • 收藏
  • 关注

原创 动态类型识别 : 利用多种方法进行动态类型识别

//动态类型识别 : 利用多态进行动态识别 #include using namespace std;class Parent{public: enum{ ID = 0 }; virtual int type() { return ID; }};class Child : public Parent{public: enum{ ID = 1 }; int t

2015-12-30 22:30:36 871 1

原创 在构造函数中抛出异常的结果

//异常处理 #include using namespace std;class Test{ private: int* p; public: Test() { cout << "Test() "<< endl; p = new int[5]; throw 2; } ~Test() //在构造函数中抛出异常,因对象不完整,造成析

2015-12-30 15:27:21 557

原创 C++中异常处理

//异常处理 #include using namespace std;int Test(int i){ if(i == 1) { throw 0; } else if(i == 2) { throw 'a'; } else if(i == 3) { throw "Hello"; } else if(i == 4) { throw 0.5;

2015-12-30 10:51:08 324

转载 如何判定一个变量是指针还是非指针

//如何判定一个变量是指针还是非指针 #include using namespace std;templatevoid isPtr(T*){ cout << "void isPtr(T*)" << endl;}void isPtr(...){ cout << "void isPtr(...)" << endl;}int main(){ int i = 0; c

2015-12-29 11:02:36 880

原创 STL 中 算法的遍历和排序

//STL 中 算法的遍历和排序 #include #include #include using namespace std;void Show(int & value) //自定义的显示函数{ cout << value << endl;} int Compare(const int& a ,const int& b) /

2015-12-28 21:32:51 374

原创 STL 中 链表(双向链表)和迭代器(iterator)的使用

//STL 中 链表(双向链表)和迭代器的使用 ,,迭代器就理解成指向元素的指针#include #include using namespace std;void ListUsage(){ list l; for(int i=0;i<5;i++) { l.push_back(i+1); //压入元素 } cout << "Elements in l

2015-12-28 20:55:17 1522

原创 STL----stack 和queue的使用

//STL 中 栈和队列的使用 #include #include #include using namespace std;void StackUsage(){ stack s; for(int i=0;i<5;i++) { s.push(i+1); //压栈操作 } cout << "Elements in stack is :" << e

2015-12-28 20:23:52 309

原创 STL----vector

//STL 中 向量的使用 (理解成数组类比较好理解,是用模板类实现的) #include #include using namespace std;int main(){ vector array(10); cout << "Elements in array is : " << endl; for(int i=0;i<array.size();i++) {

2015-12-28 19:59:30 396

原创 类模版的使用----智能指针

// SmartPointer.h #ifndef _SMARTPOINTER_H_#define _SMARTPOINTER_H_templateclass SmartPointer{ private: public: SmartPointer(); SmartPointer(T* pointer); ~SmartPointer(); T& operator

2015-12-28 15:58:00 279

原创 非类型模版参数

#include #include #include using namespace std;template void fn(){ T array[N] = {0}; for(int i=0;i<N;i++) { array[i] = i+1; cout << array[i] << " "; } cout << endl;}int main(){

2015-12-28 11:02:46 424

原创 类模版的特化 及 特化的继承

#include #include #include using namespace std;template class Test{private:public:T test(T v){cout return v; }protected:};//类模版的特化 template class

2015-12-27 22:19:02 1836

原创 类模版的工程应用

类模版的工程应用#include #include #include using namespace std;template class A{ private: public: T Add(T a,T b); T Minus(T a,T b); protected: };template T A::Add(T a,T b){ r

2015-12-27 20:16:12 355

原创 函数模版遇上函数重载会发生什么呢?

当函数模版遇上函数重载会发生什么呢?函数模版可以像普通函数一样被重载C++编译器优先考虑普通函数;如果函数模版可以产生一个更好的匹配,那么选择模版;可以通过空模版实参列表的语法限定编译器只通过模版匹配。#include #include #include using namespace std;int Max(int a,int b){ cout << "int

2015-12-26 16:40:04 335

原创 C++ ----模版

#include #include #include using namespace std;template void Swap(T& a,T& b){ T t = a; a = b; b = t;}int main(){ int a = 1; int b = 2;cout << "---------------自动类型推倒调用---------------

2015-12-26 15:09:50 282

原创 指针常量与常量指针

DEV-C编辑器结果: printf("---------------------------------\n"); const int* ip = &a; //常量指针,,地址可变 //*ip = b; //[Error] assignment of read-only location '*ip' ip = &b; printf("------------

2015-12-23 14:49:09 305

BootLoader技术内幕

本文详细地介绍了基于嵌入式系统中的 OS 启动加载程序 ―― Boot Loader 的概念、软 件设计的主要任务以及结构框架等内容。 一、引言 在专用的嵌入式板子运行 GNU/Linux 系统已经变得越来越流行。一个嵌入式 Linux 系统 从软件的角度看通常可以分为四个层次: 1. 引导加载程序。包括固化在固件(firmware)中的 boot 代码(可选),和 Boot Loader 两大部分。 2. Linux 内核。特定于嵌入式板子的定制内核以及内核的启动参数。 3. 文件系统。包括根文件系统和建立于 Flash 内存设备之上文件系统。通常用 ram disk 来作为 root fs。 4. 用户应用程序。特定于用户的应用程序。有时在用户应用程序和内核层之间可能还会包 括一个嵌入式图形用户界面。常用的嵌入式 GUI 有:MicroWindows 和 MiniGUI 懂。 引导加载程序是系统加电后运行的第一段软件代码。回忆一下 PC 的体系结构我们可以知 道,PC 机中的引导加载程序由 BIOS(其本质就是一段固件程序)和位于硬盘 MBR 中的 OS Boot Loader(比如,LILO 和 GRUB 等)一起组成。BIOS 在完成硬件检测和资源分配后 ,将硬盘 MBR 中的 Boot Loader 读到系统的 RAM 中,然后将控制权交给 OS Boot Load er。Boot Loader 的主要运行任务就是将内核映象从硬盘上读到 RAM 中,然后跳转到内核 的入口点去运行,也即开始启动操作系统。

2014-08-30

vivi-boot loader

初始化本阶段要使用到的硬件设备。 检测系统内存映射(memory map)。 将 kernel 映像和根文件系统映像从 flash 上读到 RAM 空间中。 为内核设置启动参数。 调用内核。 1.1 Boot Loader 的 stage1 1.1.1 基本的硬件初始化 这是 Boot Loader 一开始就执行的操作,其目的是为 stage2 的执行以及随后的 kernel 的执行准备好一些基本的硬件环境。它通常包括以下步骤(以执行的先后顺序): 1. 屏蔽所有的中断。为中断提供服务通常是 OS 设备驱动程序的责任,因此在 Boot Loader 的执行全过程中可以不必响应任何中断。中断屏蔽可以通过写 CPU 的中断屏蔽寄存器或状态寄存器(比如 ARM 的 CPSR 寄存器)来完成。 2. 设置 CPU 的速度和时钟频率。 3. RAM 初始化。包括正确地设置系统的内存控制器的功能寄存器以及各内存库控制寄存器等。 4. 初始化 LED。典型地,通过 GPIO 来驱动 LED,其目的是表明系统的状态是 OK 还是 Error。如果板子上没有 LED,那么也可以通过初始化 UART 向串口打印 Boot Loader 的 Logo 字符信息来完成这一点。 5. 关闭 CPU 内部指令/数据 cache。 VIVI在第一阶段完成以下任务

2014-08-30

the java programming language fourth editionArnoldGoslingHolmes06

the java programming language fourth editionArnoldGoslingHolmes06 Direct from the creators of the Java™ programming language, the completely revised fourth edition of The Java™ Programming Language is an indispensable resource for novice and advanced programmers alike. Developers around the world have used previous editions to quickly gain a deep understanding of the Java programming language, its design goals, and how to use it most effectively in real-world development. Now, Ken Arnold, James Gosling, and David Holmes have updated this classic to reflect the major enhancements in Java™ 2 Standard Edition 5.0 (J2SE™ 5.0). The authors systematically cover most classes in Java's main packages, java.lang.*, java.util, and java.io, presenting in-depth explanations of why these classes work as they do, with informative examples. Several new chapters and major sections have been added, and every chapter has been updated to reflect today's best practices for building robust, efficient, and maintainable Java software.

2014-08-30

ascii-码表

ASCII码使用指定的7位或8位二进制数组合来表示128或256种可能的字符。标准ASCII码也叫基础ASCII码,使用7位二进制数来表示所有的大写和小写字母,数字0到9、标点符号,以及在美式英语中使用的特殊控制字符(这里需要特别注意:ASCII码与标准ASCII码的位数上的区分,标准ASCII码是7位二进制表示)。 十进制编码 (对应)缩写字符(或功能/解释) 0 NUL(null) 空字符 1 SOH(start of headline) 标题开始 2 STX (start of text) 正文开始 3 ETX(end of text) 正文结束 4 EOT (end of transmission) 传输结束 5 ENQ (enquiry) 请求 6 ACK (acknowledge) 收到通知 7 BEL (bell) 响铃 8 BS (backspace) 退格 9 HT (horizontal tab) 水平制表符 10 LF (NL line feed, new line) 换行键 11 VT (vertical tab) 垂直制表符 12 FF (NP form feed, new page) 换页键 13 CR (carriage return) 回车键 14 SO (shift out) 不用切换 15 SI (shift in) 启用切换 16 DLE (data link escape) 数据链路转义 17 DC1 (device control 1) 设备控制1 18 DC2 (device control 2) 设备控制2 19 DC3 (device control 3) 设备控制3 20 DC4 (device control 4) 设备控制4 21 NAK (negative acknowledge) 拒绝接收 22 SYN (synchronous idle) 同步空闲 23 ETB (end of trans. block) 传输块结束 24 CAN (cancel) 取消 25 EM (end of medium) 介质中断 26 SUB (substitute) 替补 27 ESC (escape) 换码(溢出) 28 FS (file separator) 文件分割符 29 GS (group separator) 分组符 30 RS (record separator) 记录分离符 31 US (unit separator) 单元分隔符 32 space 空格 33 ! 34 " 35 # 36 $ 37 %

2014-08-30

Flex_&_Bison.zip

介绍Flex及Bison使用的高清pdf。

2021-04-21

Linux’s IPsec implementation.pdf

描述IPsec 在Linux下的实现及背景内容,包含Linux下IPsec工具,内核IPsec支持等内容。

2021-04-21

空空如也

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

TA关注的人

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