Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Pages: [1] 2  All

Author Topic: The Evolution  (Read 17349 times)

0 Members and 1 Guest are viewing this topic.

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
The Evolution
« on: July 13, 2003, 02:17:04 PM »

High School/Jr.High

Code: [Select]
10 PRINT "HELLO WORLD"
20 END

First year in College

Code: [Select]
program Hello(input, output)
    begin
    writeln('Hello World')
    end

Senior year in College

Code: [Select]
(defun hello
    (print
    (cons 'Hello (list 'World))))

New professional

Code: [Select]
#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

Code: [Select]
#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

Code: [Select]
[
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 PrintSz(LPWSTR pwszString);

private:
    static int cObjRef;
};

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

int CHello::cObjRef = 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 == 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

Code: [Select]
#!/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
Code: [Select]
#include <stdio.h>
#define S "Hello, World\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}

Seasoned Hacker

Code: [Select]
% cc -o a.out ~/src/misc/hw/hw.c
% a.out

Guru Hacker

Code: [Select]
% cat
Hello, world.
^D

New Manager

Code: [Select]
10 PRINT "HELLO WORLD"
20 END

Middle Manager

Code: [Select]
mail -s "Hello, world." bob@b12 <mailto:bob@b12>
Bob, could you please write me a program that prints "Hello, world."? I need it by tomorrow.
^D

Senior Manager

Code: [Select]
% zmail jim
I need a "Hello, world." program by this afternoon.

Chief Executive

Code: [Select]
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
Logged

Click here to sign my sig!

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:The Evolution
« Reply #1 on: July 13, 2003, 04:04:42 PM »

LOL  ;D
In what category do you belong?

And just because I can't stop posting off-topic:
Have you noticed, that me, McCoy, Jan & Jerrot are the only only ones posting in this forums? Come on people! Don't be that shy!
« Last Edit: July 13, 2003, 04:05:40 PM by odnorf »
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:The Evolution
« Reply #2 on: July 13, 2003, 04:12:12 PM »

Hehe, great :) I'm afraid I belong to the "Master Programmer" category right now, trying to interconnect WME and .NET. I think I'm gonna bash the computer pretty soon... :)
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:The Evolution
« Reply #3 on: July 13, 2003, 04:43:22 PM »

trying to interconnect WME and .NET

I hope that you are only refering to the "string table editor" and not the engine itselft. I wouldn't like the engine to require the .NET framework (which is pretty stupid and out-of-standards IMHO).
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:The Evolution
« Reply #4 on: July 13, 2003, 04:53:03 PM »

I hope that you are only refering to the "string table editor" and not the engine itselft.
I'm talking about support for next-gen tools, not the engine itself, don't worry.


I wouldn't like the engine to require the .NET framework (which is pretty stupid and out-of-standards IMHO).
Well, think about .NET framework as an operating system component that has been added...later :) Same as for example DirectX.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
Re:The Evolution
« Reply #5 on: July 13, 2003, 06:13:17 PM »

In what category do you belong?

Well, I think that right now I'm nearer to "new professional" than anything else...


Have you noticed, that me, McCoy, Jan & Jerrot are the only only ones posting in this forums? Come on people! Don't be that shy!

I can tell you that there's a lot of people that only check the forums (sometimes a lot of times a day) but don't write... and most don't even log-in... I've seen sometimes that I'm the only one logged-in, but there's 3 or 4 guest on-line... I don't know why, though...
« Last Edit: July 13, 2003, 06:15:12 PM by McCoy »
Logged

Click here to sign my sig!

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:The Evolution
« Reply #6 on: July 14, 2003, 04:03:48 PM »

Well, think about .NET framework as an operating system component that has been added...later :) Same as for example DirectX.

Yeah.. this is true, but I don't like DirectX too... :) In my priorities opensource and/or free (as in no-money-to-use) & crossplatform is on the top of the list. So the .NET framework and the "DirectX SDK" don't "qualify" for me...

And I know what you might thinking... WME is not opesource and it depends on DirectX too.... well... what can I say? I like WME so MUCH that I changed my priorities (and don't forget that it's free for my needs) :) (Althought I really would like to see an OpenGL/SDL interprenter for MacOS, Linux, BeOS, etc someday... :) )
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:The Evolution
« Reply #7 on: July 15, 2003, 03:06:22 PM »

Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:The Evolution
« Reply #8 on: July 15, 2003, 05:47:29 PM »

Check this: http://www.codeproject.com/managedcpp/Quake2.asp

 ;D

:) OK... I didn't say that the .NET Framework doesn't have good features. All I said is that I prefer crossplatform, instead of some OS-specific code. And to tell you the truth I was more impressed by the changes to code to make it build as a c++ program, than the radar application... :)
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:The Evolution
« Reply #9 on: July 15, 2003, 06:14:51 PM »

Well, .NET actually *is* designed to be cross-platform. But of course, we all know which platforms will Microsoft support.  On the other hand, there's the Mono project...

And I just love the C# language ;)
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:The Evolution
« Reply #10 on: July 15, 2003, 06:40:52 PM »

On the other hand, there's the Mono project...

Oh.... good! :) I didn't know about it. How exactly this is working? Does a piece of code in c# has to be changed a lot to compiled under linux? Or c# works like Java (that any standard-compliant code can run on any os that has the Java runtime environment).

And I just love the C# language ;)

Does it really has so many good features for a windows-programmer?

EDIT: I forgot to say that I am also very skeptic about ANY new standard a BIG company tries to "push" to the masses. It usually sucks (whether in features, or licence). If it weren't for the nececcary tools I have to use as I graphic designer, I would had linux as my primary OS and windows2000 as a secondary OS for my games (I can't stop playing adventure games :)).

EDIT2: Just because I am really curious : Is wme interprenter (and NOT the tools) uses A LOT of windows-specific-code (except the DirectX ofcourse)?

EDIT3: If you think that I am asking to many questions about wme, please say so :)
« Last Edit: July 15, 2003, 07:05:48 PM by odnorf »
Logged
fl*p

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
Re:The Evolution
« Reply #11 on: July 15, 2003, 07:53:26 PM »

Well, talking about Quake...

http://tenebrae.sourceforge.net/

I LOVE it :P Yeah, off-topic... who cares?  ;D
Logged

Click here to sign my sig!

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:The Evolution
« Reply #12 on: July 15, 2003, 08:02:27 PM »

We can't keep a thread in topic! :)

Anyway, that's a cool link! Maybe we all should exchange links someday (I have 150 links in my bookmarks, how many do you have?).
Logged
fl*p

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
Re:The Evolution
« Reply #13 on: July 15, 2003, 09:02:40 PM »

Mhh... not much, because the bookmark system of IE is so crappy that is a mess to have a lot of them... so I only have the most important links. I have the other ones in my head, and when I want them back, I put the things that I remember from them in google, and I get them in no time. That link, for example, I dont have it in the bookmarks, I putted quake and tenebrae in google because that was what I remembered from it.
Logged

Click here to sign my sig!

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:The Evolution
« Reply #14 on: July 15, 2003, 09:47:24 PM »

Mhh... not much, because the bookmark system of IE is so crappy that is a mess to have a lot of them... so I only have the most important links.

Still using IE? Why? There are much better alernates out there. IMO the BEST browser is Mozilla. It's the most standard-compliant, it's fast enough (no matter what some people might say), has all the features you will ever need (tabs, ads-blocking, pop-up blocking, good bookmark system and hundrents more) and it's STABLE. And don't forget that it's being improved all the time while IE is an unstable browser that can't even open most of the pages properly because M$ doesn't want to fix it's rendering engine.

Did you notice that we have changed the subject 4-5 times in this thread? :) The good thing is that it's in the general category so it doesn't matter, but we might scare the new members away!.... :)
Logged
fl*p
Pages: [1] 2  All
 

Page created in 0.022 seconds with 20 queries.