Pages

May 20, 2010

Macro

Cited from BTP300 Chris seneca cs Web

  • Continuation
  • A macro definition may extend over several lines. The backslash character - \ - immediately followed by the end-of-line character identifies a continuation onto the next line. For example,

    #define PI 3.141\
    592654
    is the same as
    #define PI 3.141592654

  • Efficiency and Flexibility

    Function-like macros provide efficient and flexible solutions. They avoid the overhead of function calls and do not impose type constraints on the parameters in the macro definition.

  • #define SQUARE(x)  ((x) * (x)) /* NOTE THE PARENTHESES *// Fardad noted in class
  • Side-Effects

    Macro definitions can also generate side effects. Because the pre-processor substitutes textual patterns rather than values, it can generate repeated evaluations of expressions that were intended to be a single evaluation. Such as area(r++).

  •  #define PI 3.14
    #undef PI
    #define PI 3.14159 /* OK */
    #define AREA(r) PI * r * r
  • Predeined macros
  •      printf("The name of the source file is %s\n", __FILE__);
    printf("The date of its translation is %s\n", __DATE__);
    printf("The time of its translation is %s\n", __TIME__);
    if (__STDC__ != 0)
    printf("Compiled under Standard C\n");
    else
    printf("Not compiled under Standard C\n");
reference macro
Cited from course BTP300 , Chris, seneca cs web
  • C and C++ compilers process source code in three distinct stages: pre-processing, compilation proper and linking
  • mixed language program require linkage convention declarations to ensure that the function identifiers used in the definition and in the function call are identical

  • To resolve this incompatibility, we direct the C++ compiler to use the "C" linkage convention in calling hello() rather than the default C++ convention. We do so by wrapping the include directive in a linkage convention declaration:
  •  extern "C" {            /* identifies C linkage convention */
    #include "hello.h"
    }

May 19, 2010

learning steps of SVN

A repository location, however, is always a URL.
Schema Access Method
file:/// direct repository access (on local disk)
http:// access via WebDAV protocol to Subversionaware
Apache server
https:// same as http://, but with SSL encryption.
svn:// access via custom protocol to an svnserve
server
svn+ssh:// same as svn://, but through an SSH tunnel.

C:\> svn checkout file:///X:/path/to/repos

C:\> svn checkout "file:///X|/path/to/repos"


I create a personal Repository on my local disk. It seems pointless to create a personal Repos as long as only me use my pc at beginning, but I think it's still good idea to keep it in case i can trace my history codes even on offline status. It's kind of "Time Machine". I just wonder it is possible to sync one folder to 2 repositories?

May 17, 2010

OOP344

Is Prof. Fardad's oop344 need use brain to get good mark?
The answer is "YES", I guess. I Didn't use my brain for long, it seems stuck right now, not sure how much lube I should fill in to run it smoothly, might it's mission impossible. Well, I will try my best. It's time to warm up.

May 13, 2010

mIRC

WebBased IRC
http://webchat.freenode.net/

the mIRC client supports multi-threads. just right click the mIRC tray icon then click the channel name just above 'exit' it can switch back the channel I want. I cann't switch it back by press alt-tab keys.

register username

/msg nickserv register
  1. To keep your email address private, rather than displaying it publicly, mark it as hidden:
    /msg nickserv set hidemail on
  2. It's useful, but not required, to have an alternate nick grouped to your account. For example, if your primary nick is foo:
    /nick foo_
    and then
    /msg nickserv group
  3. If you're running an older version of xchat and you've requested a cloak, you may need to follow these instructions so that your client will properly identify to Nickserv before joining any channels. Recent versions of xchat appear to handle things just fine.

  4. Configure your client to identify itself to nickserv automatically whenever it connects to freenode so that it's less likely you'll connect to the network without being identified to nickserv. The easiest approach is to specify your nickserv password as a server password.

May 12, 2010

May 12, 2010

My first blog, which will be dedicated to OOP344.

Fardad tries to let his students be familiar with lots of tools to apply in the open source environment. I like the point.

So far I have a personal wiki under the zenit site, a blog at myoop344blog.blogspot.com.

I installed svn client on my pc, and will install one on my mac.

also I have already added my personal information to student list, and my blog to planet CDOT feeder list

installed a mIRC client I can login yesterday but I cann't login today since I tried to register the nicename xlu44 on the freenode irc server.

I set my target on this course is A+.