|
|
用户名:sszllx 笔名:sszllx 地区: 行业:其他 |
| 日 | 一 | 二 | 三 | 四 | 五 | 六 |
ipmessage-linux1
简单分析一下飞鸽传书协议
当飞鸽传书启动时,会发出一个包,各式如下
"1:100:shirouzu:jupiter:6291457:"
其中,1位飞鸽版本号,100位包号,shirouzu是用户名,jupiter是主机名,6291457为命令,十六进制0x600001,意思是告诉这一网段的所有开飞鸽的主机“加我一个吧”
c++再学习1
1.ostream_iterator
int main()
{
*oo = "hello"; //means cout << "hello"
++oo;
*oo = "world\n";
}
2.enum keyword {a=3, b=9} 的枚举符范围
undelete
This program recovers the files deleted uncarefully on the floppy.
need tools:masm611 ,winimage ultraedit,, virtual pc
.model small
.386p
.data
BS_OEMName DB 'Lj'
BPB_BytsPerSec DW 512
BPB_SecPerClus DB 1
BPB_RsvdSecCnt DW 1
BPB_NumFATs DB 2
BPB_RootEntCnt DW 224
BPB_TotSec16 DW 2880
BPB_Media DB 0F0h
BPB_FATSz16 DW 9
BPB_SecPerTrk dw 18
BPB_NumHeads DW 2
BPB_HiddSec DD 0
BPB_TotSec32 DD 0
BS_DrvNum db 0
BS_Reserved1 DB 0
BS_BootSig DB 29h
BS_VolID DD 0
BS_VolLab DB 'Lj0.1 '
BS_FileSysType DB 'FAT12 '
baseofund equ 9000h
offsetofund equ 0100h
rootdirsectors equ 14 ;根目录占用空间数
firsectorofrootdir equ 19 ;根目录的位置,第19扇区
rsector dw 0;要读的扇区号
flag db 0e5h,
.code
org 100h
start proc
mov ax,@data
mov ds,ax
xor ah,ah
xor dl,dl
int 13h ;软驱复位
mov word ptr [rsector],firsectorofrootdir
mov ax,baseofund
mov es,ax
mov bx,offsetofund
mov ax,rsector
mov cl,1
call readsector
mov di,offsetofund
mov al,flag
label_cmp_E5:
cmp al,es:[di] ;查看根目录条目的第一个字节是不是e5
jz label_ok
label_different:
and di,0ffe0h ;di回到根目录条目开始处
add di,20h ;di指向下一个条目
mov cl,byte ptr es:[di] ;将第一个字节内容送到cl中
cmp cl,00h ;比较是否为00h,如果是00h说明所有文件均已访问到
jnz label_cmp_E5
jmp label_end
label_ok:
and di,0ffe0h
mov cl,66 ;字符B
mov es:[di],byte ptr cl
add di,20h
mov cl,byte ptr es:[di]
cmp cl,00h
jnz label_cmp_E5
label_end:
mov bx,offsetofund
mov ax,9000h
mov es,ax
mov ax,firsectorofrootdir;
mov cl,1
call writesector ;写扇区
mov ax,4c00h
int 21h
readsector proc
push bp
mov bp,sp
sub esp,2
mov byte ptr [bp-2],cl
push bx
mov bl,byte ptr bpb_secpertrk
div bl
inc ah
mov cl,ah
mov dh,al
shr al,1
mov ch,al
and dh,1
pop bx
mov dl,bs_drvnum
read:
mov ah,2
mov al,byte ptr [bp-2]
int 13h
jc read
add esp,2
pop bp
ret
readsector endp
writesector proc
push bp
mov bp,sp
sub esp,2
mov byte ptr [bp-2],cl
push bx
mov bl,byte ptr bpb_secpertrk
div bl
inc ah
mov cl,ah
mov dh,al
shr al,1
mov ch,al
and dh,1
pop bx
mov dl,bs_drvnum
write:
mov ah,3
mov al,byte ptr [bp-2]
int 13h
jc write
add esp,2
pop bp
ret
writesector endp
start endp
end
writing 4
While some people believe that a person’s essential qualities are inherited at birth, others insist that the circumstance under which the person grows up should be principally responsible for the kind of person he becomes. I can’t deny that a person’s essential qualities are inherited at birth to some extent. However, I hotly hold that the circumstance is the most key factor for the person’s growth. According to a experimentation by Dr. Troy who is the professor of the
cooperation and competition
There are countless articles on the relation of cooperation and competition. Some people say that the best preparation for life is learning to be cooperative. Others take the opposite view and say that learning to be competitive is the best preparation. As far as I am concerned, the cooperation and competitive is equally important. Chairman Mao once made a famous remark about competition, “To battle with God is great fun! To battle with earth is great fun! To battle with people is great fun!” His words have illustrated that the competition is regarded as something formidable by a brave. But cooperation has the same importance to us. Nowadays, the majority of enterprises pay more attention to a person who has a personality with a quality of cooperation. For instance, with the rapid growth of the scale of software, more and more software engineers have joined into one development project. As a result, they must work well with each other. I hold that the competition can make someone progressive, and the cooperation can make the work run smoothly and get a wonderful result. In a word, they are all necessary to us.
Should Schools and Universities be commercialized?
School, a temple of learning, is regarded as a sacred place in traditional Chinese view. But, with the reform and open policy was carried out in china, more and more commercial activity impact on the campus. The apartment of the university is more and more luxury than it was. Generally, it contains bedroom, toilet and sitting room, even kitchen. All of this could not have been imagined just 10 years ago. This is merely the lodging. There is a sharp enhance of many aspects of the campus life. This result in some students and their family had to charge more tuition. There is a tendency, as recent investigation has point out that there are an increasing number of the poor students who can’t afford the tuition which is set down by the school. Their parents had to borrow money from their friends and relative for the tuition. Some of them even sold their blood to hospital. In another side of this phenomenon, although the tuition fee is more than it was, the commercial activity also brings many conveniences to college students. Many convenient shops which close to the lodging house can make easy for students to shop. The comfortable living condition can make students hard to study.
Writing 1
Some have argued that luck is more important than hard work. Such idea, if not entirely unacceptable, is somewhat doubtful and needs a careful consideration. As the proverb says that the success belongs to the man who is in readiness for his activity. Although luck is necessary part of the success, it isn’t more important than hard work forever. For instance, as a football player, he needs luck in the game. But he must make great efforts to practice his skills everyday. Those who don’t success often complain their bad luck. They always couldn’t wake up to the reason why they always can’t success . In fact, the reason is lack of the readiness for their activity and the great effort. As for me, I am ready for the examination for master candidates. Sometimes, I hear a discussion about a person who don’t make more efforts than others passed the examination. I have no reason believe those rumors. Perhaps, there are many clever people. But it is impossible to gain the knowledge without study hard. Einstein is regarded as a genius. But he said that even genius also make effort. No pain, no gain. I believe that truth.
Self-criticism
To the Manager of a bookstore
Last Sunday, I went to your bookstore to buy a textbook which, you know, it’s very important for my study. But when I reached home, I found many errors in the book and went back to change for another one immediately. To my surprise, the waiter with bad attitude was reluctant to answer my questions. The waiter didn’t agree to change the book for me. I can’t accept this result, because of the quality problem. I insist that he should change it, but he refused. I sincerely hope that you will review your management system, with the view to providing better service to the public. I trust that you will now consider this matter seriously and make an effort to prevent the recurrence of this kind.