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帝国的崛起 前言: 分享技术之前先请允许我分享一下黄永玉老先生说过的话:“明确的爱,直接的厌恶,真诚的喜欢.站在太阳下的坦荡,大声无愧地称赞自己.” <编程常识知多少> <走 ...
随机推荐
- 『Python』 爬取 WooYun 论坛所有漏洞条目的相关信息
每个漏洞条目包含: 乌云ID,漏洞标题,漏洞所属厂商,白帽子,漏洞类型,厂商或平台给的Rank值 主要是做数据分析使用:可以分析某厂商的各类型漏洞的统计:或者对白帽子的能力进行分析..... 数据更新 ...
- [转]Windows平台下安装Hadoop
1.安装JDK1.6或更高版本 官网下载JDK,安装时注意,最好不要安装到带有空格的路径名下,例如:Programe Files,否则在配置Hadoop的配置文件时会找不到JDK(按相关说法,配置文件 ...
- windows下bat批处理实现守护进程(有日志)
开发部的一个核心程序总是会自己宕机,然后需要手工去起,而这个服务的安全级别又很高,只有我可以操作,搞得我晚上老没法睡,昨晚实在受不了了,想起以前在hp-ux下写的shell守护进程,这回搞个windo ...
- Qt:截图工具,任意大小矩形截图、全屏截图
http://blog.csdn.net/rl529014/article/details/53146440
- 如何在一台机器上安装两个MYSQL数据库
1.正常安装第一个mysql(安装步骤省略) 2.在控制面板里停止第一个mysql服务 3.将C:\Program Files\MySQL目录下的所有目录和文件copy到另外一个路径,我这里是copy ...
- Bloom Filter(布隆过滤器)
布隆过滤器用于测试某一元素是否存在于给定的集合中,是一种空间利用率很高的随机数据结构(probabilistic data structure),存在一定的误识别率(false positive),即 ...
- app开发历程————服务器端生成JSON格式数据,采用Unicode编码,隐藏中文
今天,问以前的同事,他们写接口按什么编码,怎么看到有\u的一些看不懂的内容,一问,原来是信息隐藏,防止信息泄漏. 然后在网上查了Java如何把中文转换成unicode编码,转自:http://blog ...
- sqlserver 时间格式化
SELECT CONVERT(varchar(), GETDATE(), ) :12AM SELECT CONVERT(varchar(), GETDATE(), ) // SELECT CONVER ...
- 本地存储-webStorage
webStorage 提供了一种方式让网站能够把信息存储到你本地的计算机上,并在以后需要的时候进行获取.这个概念和cookie相似,区别是它是为了更大容量存储设计的.Cookie的大小是受限的,并且每 ...
- HDOJ 2102
如果传送门'#'的另一层是传送门'#'或者是墙'*',就可以理解为这两层的这个位置都是'*'了 还有就是传送门'#'传过去可以是空地'.' 也可以是目的地'P',不要忽略了 #include < ...