In Crafty:
int OptionMatch(char *command, char *input){
/* ************************************************************ * * * check for the obvious exact match first. * * * ************************************************************ */
if (!strcmp(command, input))
return (1);
/* ************************************************************ * *
* now use strstr() to see if "input" is in "command." *
* the first requirement is that input matches command *
* starting at the very left-most character; * * * ************************************************************ */
if (strstr(command, input) == command)
return (1);
return (0);
}
It seems better to use "if " than "if-else" if it returns in the statement...
星期二, 十二月 20, 2005
星期四, 十二月 01, 2005
Learning about static construct function
http://blog.joycode.com/ghj/archive/2004/08/24/31504.aspx Using the static construct function, we can realize that the many subclass only realize the base class's construct function once. Many class need to call a function Send of a Controller class, therefore the Controller is used as base class. But the pipeline is unique, therefore it can only be initialized once, to build a pipeline. Therefore, the pipeline is initialized in construct function, and because the subclass will also call the construct function of the base class, I use the static construct function. Reading the blog articles, I found it fit for this status.
SnowyNight in Shenyang, China
The first snow eventually falls before December, at the alst day of November. I received from Lily that :---------------
Today has been December.
The Chopin has been sang in November;
it is not known where December is Debussy or Liszt.
Fir, ingle and party in the west;
but also nice reading forbidden books in ancient world.
Wish you a happy December.
----------------
Winter is always romantic, like the snowy night...
星期一, 十月 31, 2005
Transcript
Reviewing my transcript, I found a interesting phenomenon: all the experiment courses and most of the philosophy courses are A while the paper-based courses are about 75-80......Actually, I prefer doing experiment to listening lectures and taking tests. Therefore, doing research will be a fitable future to persue. :)
星期六, 十月 29, 2005
补昨天的作业ShellExecute
A small exe when the disk is inserted. It is the main menu. EXEs and chm and http may be opened by clicking button. I like this ShellExecute~
在mfc里打开网址和应用程序的东东,不错~
ShellExecute(m_hWnd,NULL, "http://www.qitiandasheng.com", NULL,NULL,SW_SHOWMAXIMIZED);
ShellExecute(m_hWnd,"open","~tmp0.1st.exe","","", SW_SHOW );//~tmp0.1st.exe is an exe in your USB disk. Just copy it to use^^. I guess so, and I succeed!
In addition, I learned to make autorun.inf. It is quite easy to make a fast one.
在mfc里打开网址和应用程序的东东,不错~
ShellExecute(m_hWnd,NULL, "http://www.qitiandasheng.com", NULL,NULL,SW_SHOWMAXIMIZED);
ShellExecute(m_hWnd,"open","~tmp0.1st.exe","","", SW_SHOW );//~tmp0.1st.exe is an exe in your USB disk. Just copy it to use^^. I guess so, and I succeed!
In addition, I learned to make autorun.inf. It is quite easy to make a fast one.
订阅:
博文 (Atom)