Helloworld和程序员人生
高中时期
- 10 PRINT "HELLO WORLD"
- 20 END
大学新生
- program Hello(input, output)
- begin
- writeln(\'Hello World\')
- end.
高年级大学生
- #include <stdio.h>
- int main(void)
- {
- printf("Hello, world!\\n");
- return 0;
- }
- </stdio.h>
职业新手
- #include <stdio.h>
- void main(void)
- {
- char *message[] = {"Hello ", "World"};
- int i;
- for(i = 0; i < 2; ++i)
- printf("%s", message[i]);
- printf("\\n");
- }
- stdio.h>
职业老手
- #include <iostream>
- #include <string>
- using namespace std;
- 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);
- }
- /string></iostream>
大师级
- [
- 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);
- }
- </stdio.h></string.h></stdlib.h></ole2.h></windows.h></ole2.h></windows.h></stdlib.h></stdio.h></ole2.h></windows.h></except.hxx></ole2.h></windows.h>
黑客学徒
#!/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;
有经验的黑客
- #include <stdio.h>
- #define S "Hello, World\\n"
- main(){exit(printf(S) == strlen(S) ? 0 : 1);}
- stdio.h>
老练的黑客
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
超级黑客
% echo "Hello, world."
一线经理
- 10 PRINT "HELLO WORLD"
- 20 END
中层经理
mail -s "Hello, world." bob@b12
Bob, could you please write me a program that prints "Hello, world."?
I need it by tomorrow.
^D
高级经理
% zmail jim
I need a "Hello, world." program by this afternoon.
首席执行官
% letter
letter: Command not found.
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
Helloworld和程序员人生的更多相关文章
- php大力力 [033节] 随便看看:PHP程序员学习C++
php大力力 [033节] 随便看看:PHP程序员学习C++ 2014 兄弟连高洛峰 PHP教程14.1.7 在PHP脚本中操作MySQL数据库4 观看 - 56.com http://www.med ...
- 程序人生 | 35岁以上的 iOS 程序员都到哪里去了?
1.网上流传华为公司正在清理 34 岁以上的员工. " 中国区开始集中清理 34 + 的交付员工,...... 去向是跟海外服务部门交换今年新毕业的校招员工,也就是进新人,出旧人. 这些旧人 ...
- 80后,天才程序员, Facebook 第一任 CTO,看看开挂的人生到底有多变态?
鸡仔说:今天介绍一位天才程序员--亚当·德安格洛(Adam D'Angelo),他被<财富>杂志誉为"科技界最聪明的人之一",大学去了被誉为"天才" ...
- 其实每个行业都有各自的辛苦,好的程序员并不累,他们乐此不疲(见过太多在职位事业、人生方向上随转如流的人,累了疲乏了就去做别的事情了。必须有自己的坚守和立足的点,自我驱动,否则沦为在别人的体制制度中被驱赶一生)good
作者:陈柯好链接:https://www.zhihu.com/question/39813913/answer/104275537来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注 ...
- 敏捷史话(七):从程序员、作家到摇滚乐手——Andy Hunt的多面人生
与其说 Andy Hunt 是敏捷宣言的创始人,不如说他是一名专业作家来得更为合适.他的<实用程序员><程序员修炼之道:从小工到专家><编程 Ruby:实用程序员指南&g ...
- 比尔·盖茨写的最古老程序曝光:BAT程序员膜拜 #精选程序人生
比尔·盖茨31岁,就成为世界首富.很多人好奇,作为世界第一大PC系统的创始人,抛弃世界首富的头衔,单单从程序员角度来讨论,比尔盖茨的代码水平如何? 其实,比尔·盖茨对写代码有一种狂热的喜好.上高中的时 ...
- 程序人生:02我来告诉你,一个草根程序员如何进入BAT
本文摘自左潇龙博客,原文出处:http://www.cnblogs.com/zuoxiaolong/p/life54.html 引言 首先声明,不要再问LZ谁是林萧,林萧就是某著名程序员小说的主角名字 ...
- 【程序人生】程序员真会玩,工作996,生病ICU
昨天Github上一个项目彻底爆红了网络,短短一天star数突破一万,Issues已破1800,大家纷纷说出有关企业的不合理加班行为,句句吐露程序员的心声,掀起了一波抵制加班潮,抵制996. 该项目里 ...
- Java匹马行天下之C国程序员的秃头原因
Java帝国的崛起 前言: 分享技术之前先请允许我分享一下黄永玉老先生说过的话:“明确的爱,直接的厌恶,真诚的喜欢.站在太阳下的坦荡,大声无愧地称赞自己.” <编程常识知多少> <走 ...
随机推荐
- 转:如何查看linux版本 如何查看LINUX是多少位
原文来自于:http://blog.csdn.net/hongweigg/article/details/7192471 一.如何得知自己正在使用的linux是什么版本呢,下面的几种方法将给你带来答案 ...
- 转:memset用法详解
功 能 将s所指向的某一块内存中的每个字节的内容全部设置为ch指定的ASCII值, 块的大小由第三个参数指定,这个函数通常为新申请的内存做初始化工作, 其返回值为指向S的指针. [编辑本段 ...
- 读取pdf文件 .选择了itextsharp 库
此库还是比较成熟.看博客园很多文章都介绍了此库 用法 如果项目用到读取pdf. 我这只是提供个思路.或者提供个方法.用itextsharp 能方便实现 StringBuilder text = ne ...
- 【Git】Git教程
http://www.liaoxuefeng.com/
- Ubiquitous Religions
http://poj.org/problem?id=2524 这道题就是并查集. #include<cstdio> #include<cstring> #include< ...
- h.264加权预测
帧间运动是基于视频亮度(luma)不发生改变的一个假设,而在视频序列中经常能遇到亮度变化的场景,比如淡入淡出.镜头光圈调整.整体或局部光源改变等,在这些场景中,简单帧间运动补偿的效果可想而知(实际编码 ...
- -_-#【Backbone】Model
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- Mustache.js语法学习笔记
原文地址:http://www.cnblogs.com/flypig88/archive/2012/05/14/2497780.html 看了Mustache的github,学学其中的语法,做个笔记 ...
- 同时安装Xcode6和Xcode7导致出现N多UUID 模拟器解决办法
[摘要:1.完整退出Xcode 和 摹拟器 2.末端中输进以下两居指令 $ sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService$ ...
- IE浏览器下面要实现滤镜(transparent),必须要加filter
遇到的问题是: ie9下面的a标签样式是background-color:transparent;导致链接失效,点不动.这个问题跟IE9及其以下a标签链接加 background-color:tran ...