webbing exchange and Semantisize and Free Online Course in Ruby on Rails Powered by Google App Engine

Sunday, March 23, 2008

can you raed tihs?

Aoccdrnig to a rscheearch at an Elingsh uinervtisy, it deosn't mttaer
in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is
taht frist and lsat ltteer is at the rghit pclae. The rset can be a
toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae
we do not raed ervey lteter by itslef but the wrod as a wlohe.

Thursday, March 13, 2008

List Of EBooks

I've uploaded several ebooks for your reading pleasure. You guys can get it at http://mindstorminc.net/books . Please give your reviews and happy reading!

Tuesday, March 11, 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;


 

string() : size(0), ptr(new char[1]) { ptr[0] = 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 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

", 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.

% damn!

!: Event unrecognized

% logout

Anonymous

project ?


Something I stumbled on

Thursday, March 6, 2008

How To Be An Expert

To be frank the text below is not wholly mine. I sort of plucked it (plucked not copied) from a Java fan's site and added my own stuff in there.

The only thing standing between you-as-amateur and you-as-expert is dedication. All that talk about prodigies? We could all
be prodigies (or nearly so) if we just put in the time and focused. At
least that's what the brain guys are saying. Best of all--it's almost never too late.


Seriously. How many people think they've missed their opportunity to
be a musician, or an expert golfer, or even a chess grand master
because they didn't start when they were young? Or because they simply lacked natural talent?
Those people are (mostly) wrong. According to some brain scientists,
almost anyone can develop world-class (or at least top expertise)
abilities in things for which they aren't physically impaired.
Apparently God-given talent, natural "gifts", and genetic
predispositions just aren't all they're cracked up to be. Or at least
not in the way most of us always imagined. It turns out that rather
than being naturally gifted at music or math or chess or whatever, a
superior performer most likely has a gift for concentration,
dedication, and a simple desire to keep getting better. In theory,
again, anyone willing to do what's required to keep getting better WILL get better.



Maybe the "naaturally talented artist" was simply the one who practiced a hell of a lot more. Or rather, a hell of a lot more deliberately. Dr. K. Anders Ericsson,
professor of psychology at Florida State University, has spent most of
his 20+ year career on the study of genuises, prodigies, and superior
performers. In the book The New Brain (it was on my coffee table) Richard Restak quotes Ericsson as concluding:



"For the superior performer the goal isn't just repeating the
same thing again and again but achieving higher levels of control over
every aspect of their performance. That's why they don't find practice
boring. Each practice session they are working on doing something
better than they did the last time."



So it's not just how long they practice, it's how they practice. Basically, it comes down to something like this:



Most of us want to practice the things we're already good at, and
avoid the things we suck at. We stay average or intermediate amateurs
forever.



Yet the research says that if we were willing to put in more hours, and to use those hours to practice the things that aren'tPotentially brilliant.
We need, as Restak refers to it, "a rage to master." That dedication to
mastery drives the potential expert to focus on the most subtle aspects
of performance, and to never be satisfied. There is always more to
improve on, and they're willing to work on the less fun stuff. Restak
quotes Sam Snead, considered one of the top five golfers of the
twentieth century, as saying: so fun, we could become good. Great.



"I know it's a lot more fun to stand on the practice tee and rip
your driver than it is to chip and ptch, or practice sand shots with
sand flying back in your face, but it all comes back to the question of
how much you're willing to pay for success."



There's much more to the brain science around this topic, of
course--I'm just doing the highlights. And a lot of the research is
new, made possible today by how easy it is for researchers to get time
with an fMRI or PET scan. And I stretched just a little... there is
some thought that to be, literally, THE best in the world at chess, or
the violin, or math, or programming, or golf, etc. you might indeed
need that genetic special something. But... that's to be THE
best. The research does suggest that whatever that special sauce is, it
accounts for only that last little 1% that pushes someone into the
world champion status. The rest of us--even without the special
sauce--could still become world (or at least national) class experts,
if we do the time, and do it the right way.



Where this ties into passionate users is with the suck threshold and
kick-ass (aka "passion") threshold. Your users will typically fall into
one of the three categories in the graphic: expert, amateur, or
drop-out. The drop-outs decide that during that "I suck at this" phase,
it isn't worth continuing. They give up. Is that something you can work
on? Do you know what your attrition rate is?



But the most troubling--and where we have the most leverage--is with the amateur who is satisfied with where they are.this
[less efficient, less powerful] way and it's easy for me to just keep
doing it like that." In other words, they made it past the suck
threshold, but now they don't want to push for new skills and
capabilities. They don't want to suck again. But that means
they'll never get past the kick-ass threshold where there's a much
greater chance they'll become passionate about it. The further up that
capability curve they are, the higher-res the user experience is!
These are the folks who you overhear saying, "Yes, I know there's a
better way to do this thing, but I already know how to do it



Can we help make it easier for them to continue on the path to becoming expert? Remember, being better is better.
Whatever you're better at becomes more fun, more satisfying, a richer
experience, and it leads to more flow. This is what we're trying to do
for our users.



Oh yes, about that never too late thing... most of us can kiss that
Olympic ice skating medal good-bye. And at 5' 4", my basketball career
is probably hopeless. But think about this... actress Geena Davis nearly qualified for the US Olympic archery team in a sport she took up at the age of 40, less than three years before the Olympic tryouts.



And if the neuroscientists are right, you can create new brain
cells--by learning (and not being stuck in a dull cubicle)--at
virtually any age. Think about it... if you're 30 today, if you
take up the guitar tomorrow, you'll have been playing for TWENTY years
by the time you're 50. You'll be kicking some serious guitar butt. And
if you're 50 today, there's no reason you can't be kicking guitar butt
at 70. What are you waiting for?