自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

菜鸟的逆袭

我是菜鸟 我怕谁!!

  • 博客(97)
  • 资源 (5)
  • 收藏
  • 关注

原创 第一次作业 图解汇编代码以及分析计算机是如何工作的

朱毅   原创作品转载请注明出处  《Linux内核分析》MOOC课程http://mooc.study.163.com/course/USTC-1000029000 C程序代码如下:int g(int x){ return x + 2;}int f(int x){ return g(x);}int main(void){ return f(3) + 1;

2015-03-08 22:58:18 1550

转载 IRET指令详解

copy from http://lion3875.blog.51cto.com/2911026/532347当使用IRET指令返回到相同保护级别的任务时,IRET会从堆栈弹出代码段选择子及指令指针分别到CS与IP寄存器,并弹出标志寄存器内容到EFLAGS寄存器。当使用IRET指令返回到一个不同的保护级别时,IRET不仅会从堆栈弹出以上内容,还会弹出堆栈段选择子及堆栈指针分别到SS

2012-11-13 23:27:14 16616

转载 C语言中的static

在C语言中,static的字面意思很容易把我们导入歧途,其实它的作用有三条。(1)第一个作用:隐藏。当我们同时编译多个文件时,所有未加static前缀的全局变量和函数都具有全局可见性。为理解这句话,我举例来说明。我们要同时编译两个源文件,一个是a.c,另一个是main.c。下面是a.c的内容#include增加这条语句char a = ‘A‘; // global variablevo

2012-11-12 20:08:22 1027

转载 解惑—Linux中的地址空间(一)

copy from http://blog.csdn.net/chenglian_999/article/details/4974265有这么一系列的问题,是否在困扰着你:用户程序编译连接形成的地址空间在什么范围内?内核编译后地址空间在什么范围内?要对外设进行访问,I/O的地址空间又是什么样的?先回答第一个问题。Linux最常见的可执行文件格式为elf(Executable and L

2012-11-11 04:01:18 948

转载 Linux中的栈

copy from http://blog.csdn.net/chenglian_999/article/details/4785720 以前我在看关于Linux原理的内容的时候,总遇到什么内核栈、用户栈。今天单独的看了一下Linux中栈的使用,在这里作一下总结。一、linux中的堆栈      Linux0.11核中总共涉及到了四种栈:系统引导时候的临时栈;内核初始化使用的栈;内

2012-11-11 03:11:47 799

转载 内存分布图

开机时系统会以实模式进入,此时可访问的内存只有1M大小,这时的内存分配情况如下所示(此时由bios主导这一M内存的使用情况):0x 0 0 0 0 0|| 10x64K=640K; 基本内存|0x 9 F F F F0x A 0 0 0 0|| 2x64K=128K;  作为显存使用|       0xa0000-0xb0000 EGA/VGA/XGA/XV

2012-11-01 16:03:29 3709

转载 C语言类型转换规则

摘至《LinuxC编程一站式学习》3.1 Integer Promotion在一个表达式中,凡是可以使用int 或unsigned int 类型做右值的地方也都可以使用有符号或无符号的char 型、short 型和Bit-field。如果原始类型的取值范围都能用int 型表示,则其值被提升为int 型,如果表示不了就提升为unsigned int 型,这称为Integer Promotio

2012-07-25 02:25:11 4916

转载 linux getpid 小结

copy from:  http://blog.sina.com.cn/s/blog_759dc36b0100p8y4.html当运行任何一个UNIX命令时,shell至少会建立一个进程来运行这个命令,所以可以把任何在UNIX系统中运行的程序叫做进程;但是进程并不是程序,进程是动态的,而程序是静态的,并且多个进程可以并发的调用同一个程序。    系统中每一个进程都包含一

2012-07-19 20:23:12 5715

转载 VC6.0中float(单精度)在内存中的存储格式

Copy  From  http://hi.baidu.com/chumingyu/blog/item/ff7b583829604d3c96ddd8b6.html浮点型变量在计算机内存中占用4字节(Byte),即32-bit。遵循IEEE-754格式标准。一个浮点数由2部分组成:底数m 和 指数e。                          ±mantissa × 2exp

2012-06-07 01:52:25 3968

原创 10878 - Decode the tape

Problem ADecode the tapeTime Limit: 1 second"Machines take me by surprise with great frequency."Alan TuringYour boss has just unearthed a roll of old computer tapes. The tape

2012-05-30 01:44:16 1083

原创 537 - Artificial Intelligence?

Artificial Intelligence? Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all, the pupils have to read and understan

2012-05-29 01:33:11 846

原创 10361 - Automatic Poetry

Problem IAutomatic PoetryInput: standard inputOutput: standard outputTime Limit: 2 secondsMemory Limit: 32 MB “Oh God”, Lara Croft exclaims, “it’s one of these dumb riddles again!”

2012-05-28 23:57:52 957

转载 ubuntu中rhythmbox音乐播放器乱码问题

copy from http://hi.baidu.com/zouziwei/blog/item/bdc653db4a7671fd39012fe3.html播放器出现乱码的根本原因是ubuntu下默认的字符编码和windows的默认字符编码不同,所以会有乱码解决方案有两个:一是换一个支持windows字符编码格式的播放器,比如QuodLibet,终端中输入以下命令即可:sudo a

2012-05-27 22:31:53 2617

转载 Linux下DIR,dirent,stat等结构体详解

copy from 点击打开链接最近在看Linux下文件操作相关章节,遇到了这么几个结构体,被搞的晕乎乎的,今日有空,仔细研究了一下,受益匪浅。首先说说DIR这一结构体,以下为DIR结构体的定义:struct __dirstream      {       void *__fd;        char *__data;

2012-05-26 17:33:37 79578 9

原创 10010 - Where's Waldorf?

Where's Waldorf? Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line o

2012-05-25 23:00:25 1857

转载 489 - Hangman Judge

Hangman Judge In ``Hangman Judge,'' you are to write a program that judges a series of Hangman games. For each game, the answer to the puzzle is given as well as the guesses. Rules are the

2012-05-20 22:53:22 835

原创 401 - Palindromes

Palindromes A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string"ABCDEDCBA" is apalindrome because it is the same when the

2012-05-17 11:29:27 832

原创 488 - Triangle Wave

Triangle Wave In this problem you are to generate a triangular wave form according to a specified pair ofAmplitude and Frequency.Input and OutputThe input begins with a single positive i

2012-05-15 14:40:28 2354

原创 445 - Marvelous Mazes

Marvelous Mazes Your mission, if you decide to accept it, is to create a mazedrawing program. A maze will consist of the alphabeticcharactersA-Z, * (asterisk), and spaces.Input and O

2012-05-14 22:39:15 1559

原创 414 - Machined Surfaces

Machined Surfaces An imaging device furnishes digital images of two machined surfaces thateventually will be assembled incontact with each other. The roughness of this final contact is to

2012-05-14 20:34:41 2622

原创 494 - Kindergarten Counting Game

Kindergarten Counting Game Everybody sit down in a circle. Ok. Listen to me carefully.``Woooooo, you scwewy wabbit!''Now, could someone tell me how many words I just said?Input and

2012-05-14 19:14:30 903

原创 458 - The Decoder

The Decoder Write a complete program that will correctly decode a set ofcharacters into a valid message. Your program shouldread a given file of a simple coded set of characters and print

2012-05-14 18:57:14 667

原创 10300 Ecological Premium

Problem AEcological PremiumInput: standard inputOutput: standard outputTime Limit: 1 secondMemory Limit: 32 MBGerman farmers are given a premium depending onthe conditions at their farmyar

2012-05-14 18:38:37 1587

原创 勇士Hashmat 100055

Problem AHashmat the brave warriorInput: standard inputOutput: standard output Hashmat is a brave warrior who with his group of young soldiers moves from one place to another to fight agains

2012-05-14 17:05:52 1466

转载 C 文件流

copy from http://blog.sina.com.cn/s/blog_6778368b0100vidz.html1      C文件操作在ANSI C中,对文件的操作分为两种方式,即:ü 流式文件操作ü  I/O文件操作1.1    流式文件操作这种方式的文件操作有一个重要的结构FILE,FILE在stdio.h中定义如下:  以下是引用片段:typ

2012-05-10 10:42:14 12851 2

原创 Linux笔记 find和grep命令

find命令用于搜索文件。其完整语法为:find [path] [options] [tests] [actions]path是要搜索的路径,可以是绝对路径也可以是相对路径。options有许多选项可用,以下列出一些主要的选项                   选项                                               含义

2012-05-09 11:20:01 3959

转载 brk(),sbrk(),malloc(),calloc()

copy from http://blog.csdn.net/clearriver/article/details/5423251brk和sbrk主要的工作是实现虚拟内存到内存的映射.在GNUC中,内存分配是这样的:       每个进程可访问的虚拟内存空间为3G,但在程序编译时,不可能也没必要为程序分配这么大的空间,只分配并不大的数据段空间,程序中动态分配的空间就是从这一块分配的。如果这

2012-05-09 02:00:23 2584

转载 C语言位域

copy from 点击打开链接有些信息在存储时,并不需要占用一个完整的字节, 而只需占几个或一个二进制位。例如在存放一个开关量时,只有0和1 两种状态,用一位二进位即可。为了节省存储空间,并使处理简便,C语言又提供了一种数据结构,称为“位域”或“位段”。所谓“位域”是把一个字节中的二进位划分为几个不同的区域,并说明每个区域的位数。每个域有一个域名,允许在程序中按域名进行操作。 这样就

2012-05-09 01:03:05 656

原创 Linux程序设计笔记 第一章

<!--@page {margin:2cm}p {margin-bottom:0.21cm; direction:ltr; color:#000000; text-align:justify; widows:0; orphans:0}p.western {font-family:"Times New Roman",serif; font-size:1

2012-05-08 10:42:56 1060

原创 Linux下的umask函数

umask函数为进程设置文件模式创建屏蔽字,并返回以前的值。函数原型为:#include mode_t umask(mode_t cmask);cmask是由下表列出的9个常量中的若干个按位“或”构成的S_IRUSR       用户读S_IWUSR      用户写S_IXUSR       用户执行S_IRGRP       组读S_IWGRP

2012-05-06 23:45:01 25984 1

转载 有效用户ID 实际用户ID

copy from 点击打开链接第9位表示文件类型,可以为p、d、l、s、c、b和-:p表示命名管道文件 d表示目录文件 l表示符号连接文件 -表示普通文件 s表示socket文件 c表示字符设备文件 b表示块设备文件第8-6位、5-3位、2-0位分别表示文件所有者的权限,同组用户的权限,其他用户的权限,其形式为rwx:r表示可读,可

2012-05-04 19:18:16 1055

转载 linux stat函数讲解

stat函数讲解表头文件:    #include              #include 定义函数:    int stat(const char *file_name, struct stat *buf);函数说明:    通过文件名filename获取文件信息,并保存在buf所指的结构体stat中返回值:      执行成功则返回0,失败返回-1,错误代码存于

2012-05-03 15:58:53 862

转载 dup()以及dup2()函数介绍

dup和dup2也是两个非常有用的调用,它们的作用都是用来复制一个文件的描述符。它们经常用来重定向进程的stdin、stdout和stderr。这两个函数的 原形如下:                        #include int dup( int oldfd );int dup2( int oldfd, int targetfd )    利用函数dup,我们可以复

2012-05-02 15:33:01 1373

原创 C语言早期函数声明与定义

ANSI C同较早版本C语言之间的最大区别在于函数的声明与定义的形式的不同int power(int base, int n);这是ANSI C的函数声明power(base, n)int base, n;此为早期C语言版本的函数声明早期C语言版本中参数名在圆括号内指定, 参数类型在左花括号之前声明。如果没有声明某个参数的类型,则默认是int类型。

2012-04-28 09:59:24 1704 2

转载 进程调度—最大优先数

#include #include #include typedef struct table{ int key; /*进程ID号*/ int priority; /*优先数值*/ char message[10]; /*进程说明信息*/ struct table *next;}node;/***********************************

2012-03-04 10:32:38 1328

转载 进程调度—分级调度

#include #include #include typedef struct table{ int key; /*进程ID号*/ int priority; /*优先数值*/ char message[10]; /*进程说明信息*/ struct table *next;}node;/***********************************

2012-03-04 10:32:09 1657

转载 进程调度—时间片轮转

#include #include #include typedef struct table{ int key; /*进程ID号*/ int run_time; /*进程所需要的运行时间*/ char message[10]; /*进程说明信息*/ struct table *next;}node;node *creat(vo

2012-03-04 10:31:31 1708

转载 进程调度—先来先服务

#include #include #include typedef struct table{ int key; /*进程ID号*/ int sequence; /*进程进入队列顺序号*/ char message[10]; /*进程说明信息*/ struct table *next;}node;/* 定义函数,建立进程链表*/node *creat(

2012-03-04 10:30:56 1325

转载 进程出队

#include #include #include typedef struct processpcb{ int id; /*??*/ struct processpcb *next;}node;node *creat(void) //??{ node *head, *p1, *p2; int n = 0; printf("Input processpcb ta

2012-03-04 10:30:09 8256

转载 进程入队

#include #include #include typedef struct processpcb{ int id; /*进程控制块编号*/ struct processpcb *next;}node;node *creat(void) //创建进程控制块{ node *head, *p1, *p2; int n = 0; printf("Input pro

2012-03-04 10:29:40 1033

PHP和Mysql Web开发完整源代码

这是《Php和Mysql web开发》第四版的所有源代码,注意是全部的源代码,没有章节的都有。

2014-01-17

莱昂氏unix源代码分析(英文版+完整源码

莱昂氏unix源代码分析(英文版+完整源码

2012-05-19

经典的C++语言学习教程

一份非常经典的C++的学习教程 带了习题 很适合新手学习 希望大家会喜欢

2009-07-05

国际程序设计大赛作品

国际程序设计大赛的作品欣赏 先来第一个: 一段纯 3D 的 DOS 动画,据说是获一等奖的作品。虽然它不是最精美的, 但是当你得知它只有 4K 时,会不会立刻疯死掉呢? 附件 3ddemo.com 再来一个: 幽灵古堡 farb-rausche 64.0 KB (65,536 字节) 恰好 65536 字节,显然是参赛作品。它非常漂亮(利用了 Direct3D),更让人惊奇的是只有 64K!而更让人震惊的是,如果不压缩的话它的数据大小是 1.6G!再体会一次“奇迹”! 附件 castle.exe 再来一个: 死亡阴影 64.0 KB (65,536 字节) 附件 ( ) death.exe 火域幻境 73.0 KB (74,752 字节) 虽然大小超过了 64K 的限制,但是它的效果可称为程序中的艺术品了! 附件 ( ) fire.exe fr-016 farb-rausche 16 字节 (16 字节) Let's rock hard!一个 DOS 里的小动画。看上去似乎没有什么特别,但是如果看到它的大小(16 字节),什么感觉????? 附件 ( ) fr-016.com 第七天堂 Exceed 64.0 KB (65,536 字节) 由于参赛的要求是在 64K 之内即可,不少参赛者未免会有不到 65536 字节就有吃亏的感觉。 这是个 恰好 64K 的作品,可能利用了 DirectX 引擎,效果很好。 附件 ( ) heaven7.exe 金属迷城 6.00 KB (6,144 字节) 考虑到它的大小时,你会不会体会到奇迹的含义 附件 ( ) metal.exe

2009-07-05

空空如也

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

TA关注的人

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