From: "Rico Lopez Liparte" Newsgroups: 3talk.joke Subject: =?big5?B?UHJvZ3JhbW1lcnMgrN2s3adh?= Lines: 831 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_020E_01C4ACD5.3C3786E0" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 219.79.36.33 Message-ID: <41657b4e$1@news.3home.net> Date: 8 Oct 2004 01:22:22 +0800 X-Trace: news.3home.net 1097169742 219.79.36.33 (8 Oct 2004 01:22:22 +0800) Organization: 3home.net Path: news.3home.net Xref: news.3home.net 3talk.joke:39614 This is a multi-part message in MIME format. ------=_NextPart_000_020E_01C4ACD5.3C3786E0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable The Evolution of a Programmer High School/Jr.High =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 10 PRINT "HELLO WORLD" 20 END First year in College =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D program Hello(input, output) begin writeln('Hello World') end. Senior year in College =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (defun hello (print (cons 'Hello (list 'World)))) New professional =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #include void main(void) { char *message[] =3D {"Hello ", "World"}; int i; for(i =3D 0; i < 2; ++i) printf("%s", message[i]); printf("\n"); } Seasoned professional =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #include #include class string { private: int size; char *ptr; public: string() : size(0), ptr(new char('\0')) {} string(const string &s) : size(s.size) { ptr =3D new char[size + 1]; strcpy(ptr, s.ptr); } ~string() { delete [] ptr; } friend ostream &operator <<(ostream &, const string &); string &operator=3D(const char *); }; ostream &operator<<(ostream &stream, const string &s) { return(stream << s.ptr); } string &string::operator=3D(const char *chrs) { if (this !=3D &chrs) { delete [] ptr; size =3D strlen(chrs); ptr =3D new char[size + 1]; strcpy(ptr, chrs); } return(*this); } int main() { string str; str =3D "Hello World" cout << str << endl; return(0); } Master Programmer =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820) ] library LHello { // bring in the master library importlib("actimp.tlb"); importlib("actexp.tlb"); // bring in my interfaces #include "pshlo.idl" [ uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820) ] cotype THello { interface IHello; interface IPersistFile; }; }; [ exe, uuid(2573F890-CFEE-101A-9A9F-00AA00342820) ] module CHelloLib { // some code related header files importheader(); importheader(); importheader(); importheader("pshlo.h"); importheader("shlo.hxx"); importheader("mycls.hxx"); // needed typelibs importlib("actimp.tlb"); importlib("actexp.tlb"); importlib("thlo.tlb"); [ uuid(2573F891-CFEE-101A-9A9F-00AA00342820), aggregatable ] coclass CHello { cotype THello; }; }; #include "ipfix.hxx" extern HANDLE hEvent; class CHello : public CHelloBase { public: IPFIX(CLSID_CHello); CHello(IUnknown *pUnk); ~CHello(); HRESULT __stdcall PrintSz(LPWSTR pwszString); private: static int cObjRef; }; #include #include #include #include #include "thlo.h" #include "pshlo.h" #include "shlo.hxx" #include "mycls.hxx" int CHello::cObjRef =3D 0; CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk) { cObjRef++; return; } HRESULT __stdcall CHello::PrintSz(LPWSTR pwszString) { printf("%ws\n", pwszString); return(ResultFromScode(S_OK)); } CHello::~CHello(void) { // when the object count goes to zero, stop the server cObjRef--; if( cObjRef =3D=3D 0 ) PulseEvent(hEvent); return; } #include #include #include "pshlo.h" #include "shlo.hxx" #include "mycls.hxx" HANDLE hEvent; int _cdecl main( int argc, char * argv[] ) { ULONG ulRef; DWORD dwRegistration; CHelloCF *pCF =3D new CHelloCF(); hEvent =3D CreateEvent(NULL, FALSE, FALSE, NULL); // Initialize the OLE libraries CoInitializeEx(NULL, COINIT_MULTITHREADED); CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &dwRegistration); // wait on an event to stop WaitForSingleObject(hEvent, INFINITE); // revoke and release the class object CoRevokeClassObject(dwRegistration); ulRef =3D pCF->Release(); // Tell OLE we are going away. CoUninitialize(); return(0);=20 } extern CLSID CLSID_CHello; extern UUID LIBID_CHelloLib; CLSID CLSID_CHello =3D { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */ 0x2573F891, 0xCFEE, 0x101A, { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 } }; UUID LIBID_CHelloLib =3D { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */ 0x2573F890, 0xCFEE, 0x101A, { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 } }; #include #include #include #include #include #include "pshlo.h" #include "shlo.hxx" #include "clsid.h" int _cdecl main( int argc, char * argv[] ) { HRESULT hRslt; IHello *pHello; ULONG ulCnt; IMoniker * pmk; WCHAR wcsT[_MAX_PATH]; WCHAR wcsPath[2 * _MAX_PATH]; // get object path wcsPath[0] =3D '\0'; wcsT[0] =3D '\0'; if( argc > 1) { mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1); wcsupr(wcsPath); } else { fprintf(stderr, "Object path must be specified\n"); return(1); } // get print string if(argc > 2) mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1); else wcscpy(wcsT, L"Hello World"); printf("Linking to object %ws\n", wcsPath); printf("Text String %ws\n", wcsT); // Initialize the OLE libraries hRslt =3D CoInitializeEx(NULL, COINIT_MULTITHREADED); if(SUCCEEDED(hRslt)) { hRslt =3D CreateFileMoniker(wcsPath, &pmk); if(SUCCEEDED(hRslt)) hRslt =3D BindMoniker(pmk, 0, IID_IHello, (void **)&pHello); if(SUCCEEDED(hRslt)) { // print a string out pHello->PrintSz(wcsT); =20 Sleep(2000); ulCnt =3D pHello->Release(); } else printf("Failure to connect, status: %lx", hRslt); // Tell OLE we are going away. CoUninitialize(); } return(0); } Apprentice Hacker =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #!/usr/local/bin/perl $msg=3D"Hello, world.\n" if ($#ARGV >=3D 0) { while(defined($arg=3Dshift(@ARGV))) { $outfilename =3D $arg; open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n" print (FILE $msg); close(FILE) || die "Can't close $arg: $!\n" } } else { print ($msg); } 1; Experienced Hacker =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #include #define S "Hello, World\n" main(){exit(printf(S) =3D=3D strlen(S) ? 0 : 1);} Seasoned Hacker =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % cc -o a.out ~/src/misc/hw/hw.c % a.out Guru Hacker =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % cat Hello, world. ^D New Manager =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 10 PRINT "HELLO WORLD" 20 END Middle Manager =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D mail -s "Hello, world." bob@b12 Bob, could you please write me a program that prints "Hello, world."? I need it by tomorrow. ^D Senior Manager =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % zmail jim I need a "Hello, world." program by this afternoon. Chief Executive =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D % letter letter: Command not found. % mail To: ^X ^F ^C % help mail help: Command not found. % damn! !: Event unrecognized % logout ------=_NextPart_000_020E_01C4ACD5.3C3786E0 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
The Evolution of a = Programmer
 
 

High=20 School/Jr.High
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
10 PRINT "HELLO WORLD"
20=20 END
 

First year in=20 College
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
program Hello(input,=20 output)
begin
    writeln('Hello=20 World')
end.
 

Senior year in=20 College
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D
(defun hello
(print
(cons 'Hello=20 (list 'World))))
 

New=20 professional
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#incl= ude <stdio.h>
void=20 main(void)
{
    char *message[] =3D {"Hello ",=20 "World"};
    int i;
 
    for(i =3D 0; = i < 2;=20 ++i)
        printf("%s",=20 message[i]);
    printf("\n");
}
 

Seasoned=20 professional
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D
#include <iostream.h>
#include=20 <string.h>
 
class = string
{
   =20 private:
    int size;
    char=20 *ptr;
 
   =20 public:
    string() : size(0), ptr(new char('\0'))=20 {}
 
    string(const = string=20 &s) : size(s.size)
    {
   =20     ptr =3D new char[size + 1];
   =20     strcpy(ptr, s.ptr);
    = }
 
   =20 ~string()
    {
    =    =20 delete [] ptr;
    }
 
    friend = ostream=20 &operator <<(ostream &, const string=20 &);
    string &operator=3D(const char=20 *);
};
 
ostream = &operator<<(ostream=20 &stream, const string &s)
{
    = return(stream=20 << s.ptr);
}
 
string = &string::operator=3D(const char=20 *chrs)
{
    if (this !=3D = &chrs)
   =20 {
        delete [] = ptr;
   =20     size =3D strlen(chrs);
    =    =20 ptr =3D new char[size + 1];
        = strcpy(ptr,=20 chrs);
    }
   =20 return(*this);
}
 
int = main()
{
   =20 string str;
 
    str =3D = "Hello=20 World"
    cout << str << = endl;
 
   =20 return(0);
}
 

Master=20 Programmer
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
[uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
]
library=20 LHello
{
    // bring in the master=20 library
    = importlib("actimp.tlb");
   =20 importlib("actexp.tlb");
 
    // bring in = my=20 interfaces
    #include "pshlo.idl"
 
    = [
   =20 uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
   =20 ]
    cotype THello
   =20 {
        interface=20 IHello;
        interface=20 IPersistFile;
    };
};
 
[
exe,=20 uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
]
module=20 CHelloLib
{
 
    // some code = related=20 header files
   =20 importheader(<windows.h>);
   =20 importheader(<ole2.h>);
   =20 importheader(<except.hxx>);
   =20 importheader("pshlo.h");
   =20 importheader("shlo.hxx");
   =20 importheader("mycls.hxx");
 
    // needed=20 typelibs
    = importlib("actimp.tlb");
   =20 importlib("actexp.tlb");
   =20 importlib("thlo.tlb");
 
    = [
   =20 uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
   =20 aggregatable
    ]
    coclass=20 CHello
    {
        = cotype=20 THello;
    };
};
 

#include=20 "ipfix.hxx"
 
extern HANDLE = hEvent;
 
class CHello : public=20 CHelloBase
{
    public:
   =20 IPFIX(CLSID_CHello);
 
    = CHello(IUnknown=20 *pUnk);
    ~CHello();
 
    HRESULT = __stdcall=20 PrintSz(LPWSTR pwszString);
 
   =20 private:
    static int cObjRef;
};
 
#include = <windows.h>
#include=20 <ole2.h>
#include <stdio.h>
#include=20 <stdlib.h>
#include "thlo.h"
#include "pshlo.h"
#include=20 "shlo.hxx"
#include "mycls.hxx"
 
int CHello::cObjRef =3D = 0;
 
CHello::CHello(IUnknown *pUnk) = :=20 CHelloBase(pUnk)
{
    = cObjRef++;
   =20 return;
}
 
HRESULT __stdcall = CHello::PrintSz(LPWSTR=20 pwszString)
{
    printf("%ws\n",=20 pwszString);
   =20 return(ResultFromScode(S_OK));
}
 

CHello::~CHello(void)
{
 
    // when the = object count=20 goes to zero, stop the server
   =20 cObjRef--;
    if( cObjRef =3D=3D 0 = )
   =20     PulseEvent(hEvent);
 
   =20 return;
}
 
#include = <windows.h>
#include=20 <ole2.h>
#include "pshlo.h"
#include "shlo.hxx"
#include=20 "mycls.hxx"
 
HANDLE hEvent;
 
int _cdecl main(
int = argc,
char *=20 argv[]
) {
    ULONG ulRef;
    = DWORD=20 dwRegistration;
    CHelloCF *pCF =3D new=20 CHelloCF();
 
    hEvent =3D=20 CreateEvent(NULL, FALSE, FALSE, NULL);
 
    // = Initialize the OLE=20 libraries
    CoInitializeEx(NULL,=20 COINIT_MULTITHREADED);
 
   =20 CoRegisterClassObject(CLSID_CHello, pCF,=20 CLSCTX_LOCAL_SERVER,
    REGCLS_MULTIPLEUSE,=20 &dwRegistration);
 
    // wait on = an event to=20 stop
    WaitForSingleObject(hEvent, = INFINITE);
 
    // revoke = and release=20 the class object
   =20 CoRevokeClassObject(dwRegistration);
    ulRef =3D=20 pCF->Release();
 
    // Tell OLE = we are going=20 away.
    CoUninitialize();
 
    return(0); =
}
 
extern CLSID = CLSID_CHello;
extern UUID=20 LIBID_CHelloLib;
 
CLSID CLSID_CHello =3D { /*=20 2573F891-CFEE-101A-9A9F-00AA00342820=20 */
0x2573F891,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, = 0x00, 0x34,=20 0x28, 0x20 }
};
 
UUID LIBID_CHelloLib =3D { /*=20 2573F890-CFEE-101A-9A9F-00AA00342820=20 */
0x2573F890,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, = 0x00, 0x34,=20 0x28, 0x20 }
};
 
#include = <windows.h>
#include=20 <ole2.h>
#include <stdlib.h>
#include=20 <string.h>
#include <stdio.h>
#include = "pshlo.h"
#include=20 "shlo.hxx"
#include "clsid.h"
 
int _cdecl main(
int = argc,
char *=20 argv[]
) {
    HRESULT hRslt;
    = IHello=20 *pHello;
    ULONG ulCnt;
    = IMoniker *=20 pmk;
    WCHAR wcsT[_MAX_PATH];
    = WCHAR=20 wcsPath[2 * _MAX_PATH];
 
    // get = object=20 path
    wcsPath[0] =3D '\0';
    = wcsT[0] =3D=20 '\0';
    if( argc > 1) {
   =20     mbstowcs(wcsPath, argv[1], strlen(argv[1]) +=20 1);
       =20 wcsupr(wcsPath);
    }
    else=20 {
        fprintf(stderr, "Object path = must be=20 specified\n");
       =20 return(1);
    }
 
    // get print = string
    if(argc > 2)
   =20     mbstowcs(wcsT, argv[2], strlen(argv[2]) +=20 1);
    else
       =20 wcscpy(wcsT, L"Hello World");
 
    = printf("Linking to=20 object %ws\n", wcsPath);
    printf("Text String = %ws\n",=20 wcsT);
 
    // = Initialize the OLE=20 libraries
    hRslt =3D CoInitializeEx(NULL,=20 COINIT_MULTITHREADED);
 
    = if(SUCCEEDED(hRslt))=20 {
        hRslt =3D = CreateFileMoniker(wcsPath,=20 &pmk);
       =20 if(SUCCEEDED(hRslt))
        =    =20 hRslt =3D BindMoniker(pmk, 0, IID_IHello, (void = **)&pHello);
 
    =    =20 if(SUCCEEDED(hRslt)) {
       =20     // print a string out
   =20         = pHello->PrintSz(wcsT);
    =
    =    =20     Sleep(2000);
        =     ulCnt =3D pHello->Release();
    =     }
       =20 else
            = printf("Failure=20 to connect, status: %lx", hRslt);
 
    =     //=20 Tell OLE we are going away.
       =20 CoUninitialize();
    }
 
   =20 return(0);
}
 

Apprentice=20 Hacker
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#!= /usr/local/bin/perl
$msg=3D"Hello,=20 world.\n"
if ($#ARGV >=3D 0) {
   =20 while(defined($arg=3Dshift(@ARGV))) {
    $outfilename = =3D=20 $arg;
    open(FILE, ">" . $outfilename) || die = "Can't=20 write $arg: $!\n"
    print (FILE = $msg);
   =20 close(FILE) || die "Can't close $arg: $!\n"
    }
} = else=20 {
    print ($msg);
}
1;
 

Experienced = Hacker
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
#i= nclude=20 <stdio.h>
#define S "Hello, World\n"
main(){exit(printf(S) = =3D=3D=20 strlen(S) ? 0 : 1);}
 

Seasoned = Hacker
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
% = cc -o=20 a.out ~/src/misc/hw/hw.c
% a.out
 

Guru = Hacker
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
% = cat
Hello,=20 world.
^D
 

New=20 Manager
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
1= 0 PRINT "HELLO WORLD"
20 END
 

Middle=20 Manager
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
m= ail -s "Hello, world."
bob@b12
Bob, = could you=20 please write me a program that prints "Hello, world."?
I need it by=20 tomorrow.
^D
 

Senior=20 Manager
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%= zmail jim
I need a "Hello, world."=20 program by this afternoon.
 

Chief = Executive
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D% letter
letter: Command not=20 found.
% mail
To: ^X ^F ^C
% help mail
help: Command not = found.
%=20 damn!
!: Event unrecognized
% = logout
------=_NextPart_000_020E_01C4ACD5.3C3786E0-- -- 「金時保險顧問」提供各類保險,如汽車、家傭、火險、辦公室、商舖、貨運及勞保。 另提供汽車上會及意外索償服務。 http://www.now-insure.com 查詢熱線: 21481223 10M"地獄火"寬頻免費試用3天 http://www.cyberec.com/