The evolution of a programmer and of a hacker

January 9th, 2008
The Evolution of a Programmer

High School/Jr.High

 10 PRINT "HELLO WORLD"
 20 END

First year in College
 program Hello(input, output)
   begin
     writeln('Hello World';)
   end.

Senior year in College
 (defun hello
   (print
     (cons 'Hello (list 'World))))

New professional
 #include <stdio.h>
 void main(void)
 {
   char *message[] = {"Hello ", "World"};
   int i;

   for(i = 0; i < 2; ++i)
     printf("%s", message[i]);
   printf("\n");
 }

Seasoned professional
 #include <iostream.h>
 #include <string.h>

 class string
 {
 private:
   int size;
   char *ptr;

 public:
   string() : size(0), ptr(new char('\0';)) {}

   string(const string &s) : size(s.size)
   {
     ptr = new char[size + 1];
     strcpy(ptr, s.ptr);
   }

   ~string()
   {
     delete [] ptr;
   }

   friend ostream &operator <<(ostream &, const string &);
   string &operator=(const char *);
 };

 ostream &operator<<(ostream &stream, const string &s)
 {
   return(stream << s.ptr);
 }

 string &string::operator=(const char *chrs)
 {
   if (this != &chrs)
   {
     delete [] ptr;
    size = strlen(chrs);
     ptr = new char[size + 1];
     strcpy(ptr, chrs);
   }
   return(*this);
 }

 int main()
 {
   string str;

   str = "Hello World";
   cout << str << endl;

   return(0);
 }

Master Programmer
 [
 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(<windows.h>);
     importheader(<ole2.h>);
     importheader(<except.hxx>);
     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  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 == 0 )
     PulseEvent(hEvent);

 return;
 }

 #include <windows.h>
 #include <ole2.h>
 #include "pshlo.h"
 #include "shlo.hxx"
 #include "mycls.hxx"

 HANDLE hEvent;

  int _cdecl main(
 int argc,
 char * argv[]
 ) {
 ULONG ulRef;
 DWORD dwRegistration;
 CHelloCF *pCF = new CHelloCF();

 hEvent = 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 = pCF->Release();

 // Tell OLE we are going away.
 CoUninitialize();

 return(0); }

 extern CLSID CLSID_CHello;
 extern UUID LIBID_CHelloLib;

 CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
     0x2573F891,
     0xCFEE,
     0x101A,
     { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
 };

 UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
     0x2573F890,
     0xCFEE,
     0x101A,
     { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
 };

 #include <windows.h>
 #include <ole2.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #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] = '\0';
 wcsT[0] = '\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 = CoInitializeEx(NULL, COINIT_MULTITHREADED);

 if(SUCCEEDED(hRslt)) {

     hRslt = CreateFileMoniker(wcsPath, &pmk);
     if(SUCCEEDED(hRslt))
  hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);

     if(SUCCEEDED(hRslt)) {

  // print a string out
  pHello->PrintSz(wcsT);

  Sleep(2000);
  ulCnt = pHello->Release();
  }
     else
  printf("Failure to connect, status: %lx", hRslt);

     // Tell OLE we are going away.
     CoUninitialize();
     }

 return(0);
 }

Apprentice Hacker
 #!/usr/local/bin/perl
 $msg="Hello, world.\n";
 if ($#ARGV >= 0) {
   while(defined($arg=shift(@ARGV))) {
     $outfilename = $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
 #include <stdio.h>
 #define S "Hello, World\n"
 main(){exit(printf(S) == strlen(S) ? 0 : 1);}

Seasoned Hacker
 % cc -o a.out ~/src/misc/hw/hw.c
 % a.out

Guru Hacker
 % echo "Hello, world."

New Manager
 10 PRINT "HELLO WORLD"
 20 END

Middle Manager
 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
 % zmail jim
 I need a "Hello, world." program by this afternoon.

Chief Executive
 % letter
 letter: Command not found.
 % mail
 To: ^X ^F ^C
 % help mail
 help: Command not found.
 % ####!
 !: Event unrecognized
 % logout

Have a nice time, hope you are getting ready for univ (or work) :p

Popularity: 9% [?]

funny clips …with a sad reality

December 31st, 2007

Well, am not doing any politics here, i am a politic as far as this blog is concerned, i was surfing youtube when i found a nice vid :p

I guess this might let some of you to reflect on the new year :p

Ofcourse, i am neutral to all these political stuffs on this blog, so, pas vinn koz politic ar moi, mo pa ar okenn parti moi.

non political stuffs
lecourse souwal :D

parodie draguerr

Happy new year ppl.

Popularity: 2% [?]

The internet is for porn

December 31st, 2007

lol watch this video :p

Sometimes i really believe that this is true.

Popularity: 3% [?]

How to kill yourself like a man

December 30th, 2007

So i was just googling randomly, then out of curiosity, i wanted to understand how famous serial killers killed their victims (really just out of curiosity.. since its good to know the minds of ppl.. for me atleast).

Anywayz, i googled, how to kill a man.. and i got a surprising result :p

Entitled: How to kill yourself like a man, lmao, it is a MUST read.

http://www.thebestpageintheuniverse.net/c.cgi?u=manly_suicide 

hahahahaha fucken hilarious naa? :p comment then :p

Popularity: 4% [?]

No Christmas tree for me this year :(

December 24th, 2007

:( :(:(:(:(

I just realized that since the house construction start,ed we had moved everything to an aunts place, so even the plastic Christmas tree has been sent there (sure i prefer a real tree, but its tiring to go and cut down one.. and its bad to do that :p).

So, what was i saying,… yes, since i just realized i don’t have any Christmas tree i can’t decorate one, so, i am sitting sad in my corner damning the world and feeling jealous as to how many persons are decorating their tree right now and i am being deprived of that small pleasure which i like sooo much.. ohh well.. i wonder if by some hours i’ll get crazy enough to decorate the big litchi tree infront of my house to make it look like a Christmas tree.. though thinking of it now.. i won’t have enough decorations for that.. ohhh well.. we’ll see…

Merry Christmas to you all.

edit: After a second thought i won’t decorate my litchi tree.. this will appear as if i am not respecting the Christmas tradition.

Popularity: 1% [?]

french military victories

December 19th, 2007

Well guys and gals,

go on google.com

type in “french military victories” (without the quotes of course)

then press “I’m feeling lucky”

Look well at the page :p

If you know more like that, post em up :p

hihihiihi

also to try (thanks to cedric): anti-war peace protesters

Popularity: 2% [?]

A whole new meaning to garantie d’usage

December 19th, 2007

I was downloading something today, and well, i’ve sent a complaint last time, that i was still in my ‘garantie d’usage’ period and i still was getting crappy download speeds, so what’s the use of having something called ‘garantie d’usage?

Enfin, you can be the judge if you want:

garantie dusage you say?

I still have like 185MB left to download before i exceed my 1GB limit to go beyond the garantie d’usage, and what is the download speed? 8kB/s?? wtf is that?

And this is not just today, this was the case last month also, and the case this month also, i am fed up and thought i’ll rant about  that.

telecom et MYT bann souserrr.

+$3|v3n

Popularity: 3% [?]

Mind test

December 18th, 2007

I was bored, so i did a mind test, and result is…

 

ENTP – “Inventor”. Enthusiastic interest in everything and always sensitive to possibilities. Non-conformist and innovative. 3.2% of the total population.

Extroverted (E) 61.29% Introverted (I) 38.71% Intuitive (N) 60% Sensing (S) 40% Thinking (T) 66.67% Feeling (F) 33.33% Perceiving (P) 67.5% Judging (J) 32.5%

Free Jung Personality Test (similar to Myers-Briggs/MBTI)

 

and careers that i can take… (i have underlined what i found to be true and what i always thought i should do)

ENTP

 

risk taker, easy going, outgoing, social, open, rule breaker, thrill seeker, life of the party, comfortable in unfamiliar situations, appreciates strangeness, disorganized, adventurous, talented at presentation, aggressive, attention seeking, experience junky, insensitive, adaptable, not easily offended, messy, carefree, dangerous, fearless, careless, emotionally stable, spontaneous, improviser, always joking, player, wild and crazy, dominant, acts without thinking, not into organized religion, pro-weed legalization

 

(Couma linn konE mo pro-weed legalization :D )

favored careers:

 

dictator, computer consultant, international spy, tv producer, philosopher, comedian, music performer, it consultant, figher pilot, politician, diplomat, entertainer, game designer, bar owner, freelance writer, creative director, strategist, news anchor, professional skateboarder, airline pilot, comic book artist, college professor, private detective, mechanical engineer, lecturer, ambassador, astronomer, research scientist, judge, web developer, scholar, fbi agent, cia agent, electrical engineer, assassin

 

(Baap assasin tou mo kapav vini, dictator and spy la mo ti p doutE meme sa, mais assasin la mo pa ti pensE ki vrai meme lot kikenn pou remarkE)

disfavored careers:

 

personal assistant, wedding planner, travel agent, secretary, interior decorator, clerical employee, government employee, social worker, pre school teacher, copy editor, child care worker, hospitality worker, occupational therapist, home maker

 

(defnitivement sux badly at those ones)

 

Ohh well, i don’t really believe in those tests, but just for the sake of killing boredom, it was great to do. I found the link from my friend infinity’s blog btw :) .

 

+$3|v3n

Popularity: 2% [?]

adios

December 11th, 2007

maybe, i am a hypocrite, well, my friends did a lot for me, when i was sick, they came and helped me etc, i am really happy and proud to have got friends like those, but its time to part, and to say goodbye, it may not be a wise decision, but to prevent things from worsening, i prefer to sever links to the gang i used to be with in univ…

its my choice, it may not be the right choice, but.. its my choice, ohh well, am not gonna be missed by anybody anyways, so, this is a hard moment in my life so i blogged about it.

guys, this one is the drop that overflowed the vase, monn manz mo cou monn alE meme, can’t stand it anymore.

+$3|v3n

Popularity: 1% [?]

fun!

December 1st, 2007

Test week is over…

Fun weeksssss begins:

So, what shall i do?

  • Exercise to lose some weight.
  • Spend more time with my wonderful gf
  • Watch bleach
  • Watch heroes season 2
  • Watch prison break 3
  • Watch movies lots of movies
  • Work on our (mine and Cindy) final year project
  • Do things which are private more often :p    (while(true){2(); 4();}) :p
  • Day Dream
  • Camping with friends
  • Spend some time on the hmu cms
  • Help with the house construction
  • Garden a bit (I wish to grow some vegetable for fun.. i’ll post on that later :p.. i like gardening)
  • Learn whatever i feel like learning
  • Go to the UoM’s end of year party (never went, want to go this year.. too bad gf doesn’t want to).
  • Have tea leisurely under my litchi tree :p feeling the air brush on my face… while i sit and think about “Why?”.

Yuuuhuuuuuuuuuuuuu tests are overrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr, have fun everybodyyyyy.

+$3|v3n

Popularity: 3% [?]