djfish's studio

2/25/2009

five processors

program pass through five different processors before it is ready to be executed
1.EDITOR:input,form terminal
output;a source code file containing C source code and (maybe) preprocessor commands
2.PREPROCESSOR:input,source code file
output,source code file with macros expanded and other files included as indicated by preprocessor commands
3.COMPILER:input,source code file with macros expanded,etc.
output,assembly language source code
4.ASSEMBLER:input,assembly language source code file
output,relocatable object code
5.LINKER:input,relocatable object code modules from your programs and from C library
output,executable code
The macro preprocessor will not expand macro names placed inside quotation marks.
Conditional Compilation,
debug use
#include DEBUG
#ifdef DEBUG
printf("in func_1,x=%d\n",x);
#endif

2/18/2009

Who's On First?[zt]

Who's On First?

by Abbott and Costello

A Word-for-Word Transcript

Abbott: Alright, now whaddya want?
Costello: Now look, I'm the head of the sports department. I gotta know the baseball players' names. Do you know the guys' names?
Abbott: Oh sure.
Costello: So you go ahead and tell me some of their names.
Abbott: Well, I'll introduce you to the boys. You know sometimes nowadays they give ballplayers peculiar names.
Costello: You mean funny names.
Abbott: Nicknames, pet names, like Dizzy Dean -
Costello: His brother Daffy -
Abbott: Daffy Dean -
Costello: And their cousin!
Abbott: Who's that?
Costello: Goofy!
Abbott: Goofy, huh? Now let's see. We have on the bags - we have Who's on first, What's on second, I Don't Know's on third.
Costello: That's what I wanna find out.
Abbott: I say Who's on first, What's on second, I Don't Know's on third -
Costello: You know the fellows' names?
Abbott: Certainly!
Costello: Well then who's on first?
Abbott: Yes!
Costello: I mean the fellow's name!
Abbott: Who!
Costello: The guy on first!
Abbott: Who!
Costello: The first baseman!
Abbott: Who!
Costello: The guy playing first!
Abbott: Who is on first!
Costello: Now whaddya askin' me for?
Abbott: I'm telling you Who is on first.
Costello: Well, I'm asking YOU who's on first!
Abbott: That's the man's name.
Costello: That's who's name?
Abbott: Yes.
Costello: Well go ahead and tell me.
Abbott: Who.
Costello: The guy on first.
Abbott: Who!
Costello: The first baseman.
Abbott: Who is on first!
Costello: Have you got a contract with the first baseman?
Abbott: Absolutely.
Costello: Who signs the contract?
Abbott: Well, naturally!
Costello: When you pay off the first baseman every month, who gets the money?
Abbott: Every dollar. Why not? The man's entitled to it.
Costello: Who is?
Abbott: Yes. Sometimes his wife comes down and collects it.
Costello: Who's wife?
Abbott: Yes.
Costello: All I'm tryin' to find out is what's the guy's name on first base.
Abbott: Oh, no - wait a minute, don't switch 'em around. What is on second base.
Costello: I'm not askin' you who's on second.
Abbott: Who is on first.
Costello: I don't know.
Abbott: He's on third - now we're not talkin' 'bout him.
Costello: Now, how did I get on third base?
Abbott: You mentioned his name!
Costello: If I mentioned the third baseman's name, who did I say is playing third?
Abbott: No - Who's playing first.
Costello: Never mind first - I wanna know what's the guy's name on third.
Abbott: No - What's on second.
Costello: I'm not askin' you who's on second.
Abbott: Who's on first.
Costello: I don't know.
Abbott: He's on third.
Costello: Aaah! Would you please stay on third base and don't go off it?
Abbott: What was it you wanted?
Costello: Now who's playin' third base?
Abbott: Now why do you insist on putting Who on third base?
Costello: Why? Who am I putting over there?
Abbott: Yes. But we don't want him there.
Costello: What's the guy's name on third base?
Abbott: What belongs on second.
Costello: I'm not askin' you who's on second.
Abbott: Who's on first.
Costello: I don't know.
Abbott & Costello: THIRD BASE!
Costello: You got an outfield?
Abbott: Oh yes!
Costello: The left fielder's name?
Abbott: Why.
Costello: I don't know, I just thought I'd ask you.
Abbott: Well, I just thought I'd tell you.
Costello: Alright, then tell me who's playin' left field.
Abbott: Who is playing fir-
Costello: STAY OUTTA THE INFIELD! I wanna know what's the left fielder's name.
Abbott: What's on second.
Costello: I'm not askin' you who's on second.
Abbott: Who's on first.
Costello: I don't know.
Abbott & Costello: THIRD BASE!
Costello: The left fielder's name?
Abbott: Why.
Costello: Because!
Abbott: Oh, he's center field.
Costello: Look, you gotta pitcher on this team?
Abbott: Now wouldn't this be a fine team without a pitcher.
Costello: The pitcher's name.
Abbott: Tomorrow.
Costello: You don't wanna tell me today?
Abbott: I'm tellin' you now.
Costello: Then go ahead.
Abbott: Tomorrow.
Costello: What time?
Abbott: What time what?
Costello: What time tomorrow are you going to tell me who's pitching?
Abbott: Now listen. Who is not pitching. Who is on fir-
Costello: I'll break your arm if you say Who's on first. I wanna know what's the pitcher's name.
Abbott: What's on second.
Costello: I don't know.
Abbott & Costello: THIRD BASE!
Costello: You got a catcher?
Abbott: Oh, absolutely.
Costello: The catcher's name.
Abbott: Today.
Costello: Today. And Tomorrow's pitching.
Abbott: Now you've got it.
Costello: All we've got is a couple of days on the team.
Abbott: Well, I can't help that.
Costello: Well, I'm a catcher too.
Abbott: I know that.
Costello: Now suppose that I'm catching, Tomorrow's pitching on my team and their heavy hitter gets up.
Abbott: Yes.
Costello: Tomorrow throws the ball. The batter bunts the ball. When he bunts the ball, me being a good catcher, I wanna throw the guy out at first base. So I pick up the ball and throw it to who?
Abbott: Now that's the first thing you've said right.
Costello: I don't even know what I'm talkin' about!
Abbott: Well, that's all you have to do.
Costello: Is to throw the ball to first base.
Abbott: Yes.
Costello: Now who's got it?
Abbott: Naturally!
Costello: If I throw the ball to first base, somebody's gotta catch it. Now who caught it?
Abbott: Naturally!
Costello: Who caught it?
Abbott: Naturally.
Costello: Who?
Abbott: Naturally!
Costello: Naturally.
Abbott: Yes.
Costello: So I pick up the ball and I throw it to Naturally.
Abbott: NO, NO, NO! You throw the ball to first base and Who gets it?
Costello: Naturally.
Abbott: That's right. There we go.
Costello: So I pick up the ball and I throw it to Naturally.
Abbott: You don't!
Costello: I throw it to who?
Abbott: Naturally.
Costello: THAT'S WHAT I'M SAYING!
Abbott: You're not saying it that way.
Costello: I said I throw the ball to Naturally.
Abbott: You don't - you throw the ball to Who?
Costello: Naturally!
Abbott: Well, say that!
Costello: THAT'S WHAT I'M SAYING! I throw the ball to who?
Abbott: Naturally.
Costello: Ask me.
Abbott: You throw the ball to Who?
Costello: Naturally.
Abbott: That's it.
Costello: SAME AS YOU!! I throw the ball to first base and who gets it?
Abbott: Naturally!
Costello: Who has it?
Abbott: Naturally!
Costello: HE BETTER HAVE IT! I throw the ball to first base. Whoever it is grabs the ball, so the guy runs to second. Who picks up the ball and throws it to What, What throws it to I Don't Know, I Don't Know throws it back to Tomorrow - triple play.
Abbott: Yes.
Costello: Another guy gets up - it's a long fly ball to Because. Why? I don't know. He's on third and I don't give a darn!
Abbott: What was that?
Costello: I said I don't give a darn!
Abbott: Oh, that's our shortstop.


2/17/2009

variables

DATA TYPE
1. the difference between 'char' and 'int' is that the compiler will reserve int-size memorry locations for the variable.
2.'char' is the smallest size of the data type.
3.number systems:Octal values are preceded by '0',Hex values are preceded by '0x'
4.escape sequences, use backslash character \ followed by a letter.
\n :newline(ie.,linefeed - carriage return)
\t :tab
\b :backspace
\r :carriage return
\\ :backslash
\' :single quote.
numerical escape sequences,example belll='\007'
STORAGE CLASSES
1.automatic variables,'auto' scope in limited to the block in variables declared inside functions are always automatic unless otherwise specified.
automatic variables are local to the block in which they are delare,even when that block is nested within another block.

2/04/2009

about MIT

The first time I know MIT is an abbreviation of Massachusettes Institute of Technology is when I was a student in BIT. Yes, my university imitates MIT,and uses BIT as B means Beijing.And a lot of other universities in China like to use IT as a part of their names.Then SHIT,HIT and so on appeared.
When I worked in Beijing,I knew OpenCourse of MIT by chance.It's really a shock to me.What is the character of a brilliant university?The answer is open
,a share spirit and dare to face the challenges.
Last month,I found MIT World.It provides videos of public events at MIT.It's really a go with the trend of internet.The idea of the MIT World is to find the answer of "Which ideas and innovations can change the world?".I have to say I appreciate MIT and nearly envy its influence.

2/02/2009

love is...

when i was young, i usually like collecting sweet wrappers. There are little comic on it, a serie of 'love is...'.tiny and sweety words on it.really beat my heart.
recently i find this website: http://www.loveisfan.com it really lets me recall the memory.
hope you will like it.and enjoy: Love is...