char*c="char*c=%c%s%c;main(){printf(c,34,c,34);}";main(){printf(c,34,c,34);}The ultimate program of this sort has been found at the Obfuscated C Contest (see links): A source code with length 0 compiles (with a special Makefile) to a executable with length 0 which does nothing (which is the same as the source code).
SYSTEM REQUIREMENTS 2386 PROCESSOR OR HIGHER 628.8 MEGAHERTZ MODEM 719.7 MB FREE DISK SPACE 3546 MB RAM 432323 MB ROM 2353700 MB RPM ANTILOCK BRAKING SYSTEM 2 TURTLE DOVES NOTE: This software will not work on your computer.
LICENSING AGREEMENT:
By breaking this seal, the user
hereinafter agrees to abide by all
the terms and conditions of the
following agreement that nobody ever
reads, as well as the Geneva Convention
and the UN Charter and the Secret
Membership Oath of the Benevolent
Protective Order of the Elks and such
other terms and conditions, real and
imaginary, as the Software Company
shall deem necessary and appropriate,
including the right to come to the
user's home and examine the user's
hard drive, as well as the user's
underwear drawer if we feel like it,
take it or leave it, until death do
us part, one nation indivisible, by
the dawn's early light, finders keepers,
losers weepers, thanks you've been a great
crowd, and don't forget to tip your servers.
The Installation Program will now examine your system to see what would be the best way to render it inoperable. Is it OK with you? Choose one, and be honest: A. YES B. SURE
CONGRATULATIONS The installation program cannot think of anything else to do to your computer and has grown bored. You may now attempt to run your software. If you experience any problems, electrical shocks, insomnia, shortness of breath, nasal discharge, or intestinal parasites, you should immediately *!@!$)$ %@&*^) $*!#$_$*^&
"There may be 50 ways to leave your lover, but there are only 4 ways out of this airplane..."
After landing: "Thank you for flying Delta Business Express. We hope you enjoyed giving us the business as much as we enjoyed taking you for a ride."
As the plane landed and was coming to a stop at Washington National, a lone voice came over the loudspeaker: "Whoa, big fella. WHOA!"
After a particularly rough landing during thunderstorms in Memphis, a flight attendant on a Northwest flight announced: "Please take care when opening the overhead compartments because, after a landing like that, sure as hell everything has shifted."
From a Southwest Airlines employee...."Welcome aboard Southwest Flight XXX to YYY. To operate your seatbelt, insert the metal tab into the buckle, and pull tight. It works just like every other seatbelt, and if you don't know how to operate one, you probably shouldn't be out in public unsupervised. In the event of a sudden loss of cabin pressure, margarine cups will descend from the ceiling. Stop screaming, grab the mask, and pull it over your face. If you have a small child traveling with you, secure your mask before assisting with theirs. If you are traveling with more than one small child... pick your favorite.
Weather at our destination is 50 degrees with some broken clouds, but we'll try to have them fixed before we arrive. Thank you, and remember, nobody loves you, or your money, more than Southwest Airlines."
"Your seat cushions can be used for flotation, and in the event of an emergency water landing, please paddle to shore and take them with our compliments"
Once on a Southwest flight, the pilot said, "We've reached our cruising altitude now, and I'm turning off the seat belt sign. I'm switching to autopilot, too, so I can come back there and visit with all of you for the rest of the flight."
"Should the cabin lose pressure, oxygen masks will drop from the overhead area. Please place the bag over your own mouth and nose before assisting children or other adults acting like children."
"As you exit the plane, make sure to gather all of your belongings. Anything left behind will be distributed evenly among the flight attendants. Please do not leave children or spouses."
"Last one off the plane must clean it."
And from the pilot during his welcome message: "We are pleased to have some of the best flight attendants in the industry... Unfortunately none of them are on this flight...!"
Heard on Southwest Airlines just after a very hard landing in Salt Lake City: The flight attendant came on the intercom and said, "That was quite a bump and I know what y'all are thinking. I'm here to tell you it wasn't the airline's fault, it wasn't the pilot's fault, it wasn't the flight attendants 'fault...it was the asphalt!"
Overheard on an American Airlines flight into Amarillo, Texas, on a particularly windy and bumpy day. During the final approach the Captain was really having to fight it. After an extremely hard landing, the Flight Attendant came on the PA and announced, "Ladies and Gentlemen, welcome to Amarillo. Please remain in your seats with your seatbelt fastened while the Captain taxis what's left of our airplane to the gate!"
Another flight attendant's comment on a less than perfect landing: "We ask you to please remain seated as Captain Kangaroo bounces us to the terminal."
An airline pilot wrote that on this particular flight he had hammered his
ship into the runway really hard. The airline had a policy which required
the first officer to stand at the door while the Passengers exited, smile,
and give them a "Thanks for flying XYZ airline." He said that in light of
his bad landing, he had a hard time looking the passengers in the eye,
thinking that someone would have a smart comment. Finally everyone had
gotten off except for this little old lady walking with a cane. She said,
"Sonny, mind if I ask you a question?"
"Why no Ma'am," said the pilot, "what is it?" The little old lady said,
"Did we land or were we shot down?"
After a real crusher of a landing in Phoenix, the Flight Attendant came on with, "Ladies and Gentlemen, please remain in your seats until Capt. Crash and the Crew have brought the aircraft to a screeching halt against the gate. And, once the tire smoke has cleared and the warning bells are silenced, we'll open the door and you can pick your way through the wreckage to the terminal."
Part of a flight attendant's arrival announcement: "We'd like to thank you folks for flying with us today. And, the next time you get the insane urge to go blasting through the skies in a pressurized metal tube, we hope you'll think of us here at US Airways."
(P = The problem logged by the pilot)
(S = The solution and action taken by the maintenance engineers)
P - Left inside main tire almost needs replacement.
S - Almost replaced left inside main tire.
P - Test flight OK, except autoland very rough
S - Autoland not installed on this aircraft.
P - #2 propeller seeping prop fluid
S - #2 propeller seepage normal - #1,3,4 propellers lack normal seepage.
P - Something loose in cockpit
S - Something tightened in cockpit
P - Dead bugs on windshield
S - Live bugs on backorder
P - Autopilot in altitude-hold mode produces a 200-fpm descent.
S - Cannot reproduce problem on ground
P - Evidence of a leak on right main landing gear.
S - Evidence removed.
P - DME volume unbelievably loud.
S - Volume set to more believable level.
P - Friction locks cause throttle levers to stick.
S - That's what they're there for!
P - IFF inoperative
S - IFF always inoperative in OFF mode.
P - Number 3 engine missing.
S - Engine found on right wing after brief search.
P - Aircraft handles funny.
S - Aircraft warned to "Straighten Up, Fly Right, and Be Serious."
P - Target radar hums.
S - Reprogrammed target radar with words.
If Microsoft made toasters...
Every time you bought a loaf of bread, you would have to buy a
toaster. You wouldn't have to take the toaster, but you'd still have
to pay for it anyway. Toaster'95 would weigh 15000 pounds (hence
requiring a reinforced steel countertop), draw enough electricity to
power a small city, take up 95% of the space in your kitchen, would
claim to be the first toaster that let's you control how light or
dark you want your toast to be, and would secretly interrogate your
other appliances to find out who made them. Everyone would hate
Microsoft toasters, but nonetheless would buy them since most of the
good bread only works with their toasters.
If Apple made toasters...
It would do everything the Microsoft toaster does, but 5 years
earlier.
If The Rand Corporation made toasters...
It would be a large, perfectly smooth and seamless black cube. Every
morning there would be a piece of toast on top of it. Their service
department would have an unlisted phone number, and the blueprints
for the box would be highly classified government documents. The
X-Files would have an episode about it.
If the NSA made toasters...
Your toaster would have a secret trap door that only the NSA could
access in case they needed to get at your toast for reasons of national security.
If NASA made toasters...
The toast would burst into flames shortly after popping up.
Does DEC still make toasters?...
They made good toasters in the '70s, didn't they?
If Hewlett-Packard made toasters...
They would market the Reverse Polish Toaster, which takes in toast
and gives you regular bread.
If Sony made toasters...
Their Sony Toastman, which would be barely larger than the single
piece of bread it is meant to toast, can be conveniently attached to
your belt.
If the Franklin Mint made toasters...
Every month, you would receive another lovely hand-crafted piece of
your authentic Civil War pewter toaster.
If Cray made toasters...
They would cost $16 million but would be faster than any other
single-slice toaster in the world, at least for a couple of years.
If Thinking Machines made toasters...
You would be able to toast 64,000 thousand pieces of bread at the
same time.
If Timex made toasters...
They would be cheap and small quartz-crystal wrist toasters that
take a licking and keep on toasting.
If Radio Shack made toasters...
The staff would sell you a toaster, but not know anything about
it. You would be able to buy all the parts to build your own
toaster.
If K-Tel sold toasters...
They would not be available in stores, and you would get a free set
of Ginsu knives.
If Sun made toasters...
They would be beige with dimpled surfaces and zigzag sides,
the buttons and cable would be in pale purple,
every piece would carry a little sun logo,
and the bread would go in at the side.
If Sun made toasters...
Every time you bought a loaf of bread,
you would have to ´phone up the bakery,
give them the serial number of your toaster and bread loaf
and so get from them a single slice bread toasting license.
Of course, what with your multi slice capable UltraToaster,
you feel kinda dumb doing toast one slice at the time.
No problem, just buy more loafs of bread and license them too.
What, you have more than one toaster
and want to toast a loaf on more than one of them?
Hey, what are you, difficult?
NOTE: This is a confirmed true story.
NOTE 2: Someone wrote me this is not a true story.
Taoism: Shit Happens.
Hare Krishna: Shit Happens Rama Rama Ding Dong.
Hinduism: This Shit Happened Before.
Islam: lf Shit Happens, Take a Hostage!
Zen: What is the Sound of Shit Happening?
Buddhism: When Shit Happens, is it Really Shit?
Confucianism: Confucius Say, "Shit Happens"
7th Day Adventist: Shit happens on Saturdays.
Protestantism: Shit Won' t Happen if I Work Harder.
Catholicism: If Shit Happens, I Deserve It.
Jehovah's Witness: Knock, Knock, "Shit Happens"
Unitarian: What is This Shit?
Mormon: Shit Happens Again & Again & Again.
Judaism: Why Does This Shit Always Happen to Me?
Rastafarianism: Let's Smoke This Shit!
/* TOP SECRET Microsoft(c) Code Project: Chicago(tm) Projected release-date: Summer 1998 */ #include "win31.h" #include "win95.h" #include "evenmore.h" #include "oldstuff.h" #include "billrulz.h" #define INSTALL = HARD char make_prog_look_big[1600000]; void main() { while(!CRASHED) { display_copyright_message(); display_bill_rules_message(); do_nothing_loop(); if (first_time_installation) { make_50_megabyte_swapfile(); do_nothing_loop(); totally_screw_up_HPFS_file_system(); search_and_destroy_the_rest_of_OS/2(); hang_system(); } write_something(anything); display_copyright_message(); do_nothing_loop(); do_some_stuff(); if (still_not_crashed) { display_copyright_message(); do_nothing_loop(); basically_run_windows_3.1(); do_nothing_loop(); do_nothing_loop(); } } if (detect_cache()) disable_cache(); if (fast_cpu()) { set_wait_states(lots); set_mouse(speed, very_slow); set_mouse(action, jumpy); set_mouse(reaction, sometimes); } /* printf("Welcome to Windows 3.11"); */ /* printf("Welcome to Windows 95"); */ printf("Welcome to Windows 98"); if (system_ok()) crash(to_dos_prompt); else system_memory = open("a:\swp0001.swp", O_CREATE); while(something) { sleep(5); get_user_input(); sleep(5); act_on_user_input(); sleep(5); } create_general_protection_fault(); }
RELATIONSHIPS:
First, a man does not call a relationship a relationship - he refers to
it as "that time when me and Suzie were making whoopi on a semi-regular
basis."
When a relationship ends, a woman will cry and pour her heart out to her
girlfriends, and she will write a poem titled "All Men Are Idiots." Then
she will get on with her life.
A man has a little more trouble letting go. Six months after the breakup
- at 3 am early on a Sunday morning - he will call and say "I just wanted
to let you know you ruined my life, and I'll never forgive you, and
I hate you, and you're a total floozy. But I want you to know there's
always a chance for us." This is known as the "I Hate You/I Love You"
drunken phone call, that 99% of all men have made at least once. There
are community colleges that offer courses to help men get over this
need; alas these classes rarely prove effective.
SEX:
Women prefer 30-45 minutes of foreplay.
Men prefer 30-45 seconds of foreplay. Men consider driving back to her
place as part of the foreplay.
MATURITY:
Women mature much faster than men. Most 17-year-old females can
function as adults.
Most 17-year-old males are still trading baseball cards and giving each
other wedgies after gym class. This is why high school romances rarely
work out.
COMEDY:
Let's say a small group of men and women are in a room, watching tele-
vision, and an episode of "The Three Stooges" comes on. Immediately,
the men will get very excited - they will laugh uproariously, and even
try to imitate the actions of Curly, man's favorite stooge.
The women will roll their eys and groan and wait it out.
HANDWRITING:
To their credit, men do not decorate their penmanship. They just
chicken-scratch.
Women use scented, colored stationery and they dot their "i's" with
circles and hearts. Women use ridiculously large loops in their "p's"
and "g's." It is a royal pain to read a note from a woman. Even when
she's dumping you, she'll put a smiley face at the end of the note.
BATHROOMS:
A man has at most six items in his bathroom - a toothbrush, toothpaste,
shaving cream, razor, a bar of soap, and a towel from the Holiday Inn.
The average number of items in a typical woman's bathroom is 437. A man
would not be able to identify most of these items.
GROCERIES:
A woman makes a list of things she needs and then goes to the store and
buys these things.
A man waits until the only items left in his fridge are half of a lemon,
and something turning green. Then he goes grocery shopping. He buys
everything that looks good. By the time he reaches the checkout counter,
his cart is packed tighter than the Clampett's car on The Beverley
Hillbillies. Of course, this will not stop him from going to the
10-items-or-less lane.
GOING OUT:
When a man says he's ready to go out, it means he's ready to go out.
When a woman says she's ready to go out, it means that she WILL be ready
to go out, as soon as she finds her other earring, finishes putting on
her makeup...
MIRRORS:
Men are vain; they will check themselves out in the mirror.
Women are ridiculous; they will check out their reflections in any shiny
surface - mirrors, spoons, store windows, toasters, Joe Garagiola's head...
GARAGES:
Women use garages to park their cars and to store their lawnmowers.
Men use garages for many things. They hang license plates in garages,
they watch TV in garages, and they build useless wooden things in garages.
MOVIES:
For women, their favorite movie scene is when Clark Gable kisses Vivien
Leigh for the first time in "Gone With The Wind."
For men, it's when Jimmy Cagney shoves a grapefruit in Mae Clark's face
in "Public Enemy."
JEWELRY:
Women look nice when they wear jewelry.
A man can get away with wearing one ring, and that's it. Any more than
that, and he will look like a lounge singer named Vic.
MENOPAUSE:
When a woman reaches menopause, she goes through a variety of complicated
emotional, psychological, and biological changes. The nature and degree
of the changes varies with the individual.
Menopause in a man provokes a uniform reaction. He buys aviator glasses,
a snazzy French cap and leather driving gloves, and goes shopping for an
expensive foreign sports car.
THE TELEPHONE:
Men see the telephone as a communications tool. They use the telephone
to send short messages to other people.
A woman can visit her girlfriend for two weeks, and upon returning home,
she will call the same friend and they will talk for three hours.
LOW BLOWS
Let's say a man and a woman are watching a boxing match on
television, and one of the fighters is felled by a low blow.
The woman says "Oh, gee, that must hurt."
The man doubles over and actually feels pain.
DIRECTIONS:
If a woman is out driving and she finds herself in unfamiliar
surroundings, she will stop at a gas station and ask for directions.
Men consider this to be a sign of weakness. A man will never stop and
ask for directions. Men will drive in a circle for hours, all the while
saying things like, "Looks like I've found a new way to get there," and,
"I know I'm in the neighborhood. I recognize that White Hen store."
ADMITTING MISTAKES:
Women will sometimes admit making a mistake.
The last man who admitted that he was wrong was Gen. George Custer.
RICHARD GERE:
Women like Richard Gere because he is sexy in a dangerous way.
Men hate Richard Gere because he reminds them of that slick guy who
works out at the health club and dates only married women.
DRESSING UP:
A woman will dress up to go shopping, water the plants, empty the
garbage, answer the phone, read a book, get the mail...
A man will dress up for: weddings, funerals.
NUDITY IN MOVIES:
Every actress in the history of movies has had to do a nude scene. This
is because every movie in the history of movies has been produced by men.
The only actor who has ever appeared nude in the movies is Richard Gere.
This is another reason why men hate him.
CAMERAS:
Men take photography very seriously. They'll shell out $4,000 for state-
of-the-art equipment, and build darkrooms, and take photography classes.
Women purchase Kodak Instamatics, and often produce better-looking shots.
LOCKER ROOMS:
In the locker room, men talk about three things: money, football, and
women. They exaggerate about money, they don't know football nearly as
well as they think they do, and they fabricate stories about women.
Women talk about one thing in the locker room - sex. Not in abstract
terms, either. They're graphic and technical, and they *never* lie.
LAUNDRY:
Women do laundry every couple of days.
A man will wear every article of clothing he owns, including his
surgical pants that were hip about eight years ago, before he will do
his laundry. When he is finally out of clothes, he will wear a dirty
sweatshirt inside out, rent a U-Haul and take his mountain of clothes to
the laundromat, and expect to meet a beautiful woman while he is there.
WEDDINGS:
When reminiscing about weddings, women talk about the "ceremony."
Men talk about "the bachelor party."
CHEERLEADERS:
Female cheerleaders are cute, sexy, fresh, and all-American.
Male cheerleaders are scary.
SOCKS:
Men wear sensible socks. They wear standard white sweatsocks.
Women wear strange socks. They are cut way below the ankles, have
pictures of clouds on them, and have a big fuzzy ball on the back.
TOYS:
Little girls love to play with toys. Then, when they reach the age of
11 or 12, they lose interest.
Men never grow out of their obsession with toys. As they grow older,
their toys simply become more expensive and impractical. Examples of
mens toys: miniature TV's, car phones, complicated juicers and
blenders, graphic equalizers, small robots the serve cocktails on
command, video games, and anything that blinks, beeps and requires at
least six "D" batteries to operate.
PLANTS:
A woman will ask a man to water her plants while she is on vacation.
The man will water the plants.
The woman returns five days later, to an apartment full of dead plants.
No one knows why this happens.
NICKNAMES:
With the exception of female body-builders, who call each other names
like "Ultimate Pecs" and "Big Turk," women eschew the use of nicknames.
If Gloria, Suzanne, Deborah and Michelle get together for lunch, they
will call each other Gloria, Suzanne, Deborah and Michelle.
But if Mike, Dave and Jack go out for a brewski, they will affectionately
refer to each other as Bullet-Head, Peanut-Brain, and Useless.
One little boy stood up and offered, "My best friend, who lives next door, was playing in the street, and a car came along and ran over him. That would be a tragedy." "No," said Clinton, "That would be an accident."
A little girl raised her hand. "If a school bus carrying 50 children drove off a high cliff, killing everyone in the bus, that would be a tragedy". "I'm afraid not," said the President. "That's what we would call a great loss."
The room grew silent. No other children would volunteer an answer. President Clinton searched the room. "Isn't there someone here who can give me an example of a tragedy?"
Finally, in the back of the room, a small boy raised his hand. In a quiet voice, he said, "If Air Force One, carrying you and Mrs. Clinton were struck by a missile and blown to smithereens, that would be a tragedy."
"Fantastic," said Clinton. "That's right. And can you tell me why that would be a tragedy?"
"Well," said the boy, "because it wouldn't be an accident, and it certainly wouldn't be a great loss."
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 <sorry_for_the_missing_includes.h> #include <someone_deleted_them.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-IOIA-9A9F-OOAA00342820) ] library LHello { // bring in the master library importlib("actimp.tlb"); importlib("actexp.tlb"); // bring in my interfaces #include "pshio.idl" [ uuid(2573F8F5-CFEE-IOlA-9A9F-OOAA00342820) ] cotype THello { interface IHello; interface IPersistFile; }; }; [ exe, uuid( 257 3F8 9 0-CFEE-10 IA-9A9F-OOAAO 0342820) ] 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( "thio.tlb" ); [ uiid(2573F891-CFEE-IOIA-9A9F-OOAA00342820), aggregatable ] coclass CHello { cotype THello; }; }; #include "ipfix.hxx" extern HANDLE hEvent; class CHello : public CHelloBase { public: IPFIX(CLSID_CHello) ; CHello (lUnknown *pUnk); ~CHello ( ) ; HRESULT __stdcall PrintSz(LPWSTR pwszString); private: static int cObjRef; }; #include #include #include #include #include "thlo.h" #include "pshlo.h" ftinclude "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 #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 = new CHelloCF(); hEvent = CreateEvent (NULL, FALSE, FALSE, NULL); // Initialize the OLE libraries ColnitializeEx (NULL, COINIT_MULTITHREADED) ; CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, sdwRegistration) ; // wait on an event to stop WaitForSingleObject(hEvent, INFINITE) ; // revoke and release the class object CoRevokeClassObj ect ( dwRegistration ) ; ulRef = pCF->Release(); // Teil OLE we are going away. CoUninitialize(); return ( 0 ) ; } extern CLSID CLSID_CHello; extern UUID LIBID_CHelloLib; CLSID CLSID_CHello = { /* 2573F891-CFEE-IOIA-9A9F-OOAA00342820 */ Ox2573F891, OxCFEE, 0x10 IA, ( Ox9A, Ox9F, 0x00, OxAA, 0x00, 0x34, 0x28, 0x20 } }; UUID LIBID_CHelloLib = { /* 2573F890-CFEE-IOIA-9A9F-OOAA00342820 */ 0x257 3F8 90, OxCFEE, OxIOlA, { Ox9A, Ox9F, 0x00, OxAA, 0x00, 0x34, 0x28, 0x20 } }; #include #include #include #include #include #include "pshLo.h" #include "shLo.hxx" #include "clsLd.h" int _cdecl main( int argc, char * argv [ ] ) { HRESULT hRsIt; 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 hRsIt = CoInitializeEx(NULL, COINIT_MULTITHREADED); if(SUCCEEDED(hRslt)) { hRsIt = CreateFileMoniker(wcsPath, &pmk); if(SUCCEEDED(hRslt) ) hRsIt = 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", hRsIt); // Teil 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); }
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
% cat Hello, worid. ^D
New Manager
10 PRINT "HELLO WORLD" 20 END
Middle Manager
mail -s "Hello, world." bob@bl2 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