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帝国的崛起 前言: 分享技术之前先请允许我分享一下黄永玉老先生说过的话:“明确的爱,直接的厌恶,真诚的喜欢.站在太阳下的坦荡,大声无愧地称赞自己.” <编程常识知多少> <走 ...
随机推荐
- Quantization Method
如上一篇Quantization所说,可以在编码端通过设置offset来调整量化后的值,从而趋向于期望的量化值,而且在逆量化公式可以看出offset值在逆量化的时候是不会用到的. 目前来说,确定off ...
- 关于兄弟QWidget间的位置重叠
转自:http://hi.baidu.com/dbzhang800/item/a7bf1f1e983c6af964eabf45?qq-pf-to=pcqq.group 缘起 csdn上一用户抱怨:她的 ...
- UVa 10837 A Research Problem 欧拉函数
题意: 给你一个欧拉函数值 phi(n),问最小的n是多少. phi(n) <= 100000000 , n <= 200000000 解题思路: 对于欧拉函数值可以写成 这里的k有可能是 ...
- 甲骨文公司 Oracle
甲骨文公司 甲骨文公司,全称甲骨文股份有限公司,是全球最大的企业软件公司,总部位于美国加利福尼亚州的红木滩.甲骨文是继Microsoft之后,全球收入第二多的软件公司.甲骨文公司1989年正式进入中国 ...
- Python自动化之Django的CSRF
什么CSRF? CSRF, Cross Site Request Forgery, 跨站点伪造请求.举例来讲,某个恶意的网站上有一个指向你的网站的链接,如果 某个用户已经登录到你的网站上了,那么当这个 ...
- H5页开发规范/通用规范
兼容目标 主流移动设备:iPhone 4+ .三星.魅族.华为.红米.小米1S 以上及主流 Android 千元机型:请特别关注iPhone4/4s.魅族MX4.华为P6等机型 操作系统:iOS 7. ...
- Zimbra8.x邮件服务器安装及配置
官网地址:http://www.zimbra.com/downloads 下载说明: 1. 版本: zimbra有两个大版本:Open Source Edition和 Network Ed ...
- 【开源项目】Android 手写记事 App(半成品)
该项目已上传到 CSDN 的 Git 平台中 项目地址:https://code.csdn.net/gd920129/whiteboard GIT SSH:git@code.csdn.net:gd92 ...
- Android应用程序之间共享文字和图片(一)
以下为TestReceiveShare1工程 MainActivity如下: package cn.testreceiveshare1; import java.util.ArrayList; imp ...
- C#&Sql获取中文字符拼音首字母的方法
C#获取字符拼音首字母,可以存储在数据库中以备将来按字母搜索的需求. public static string GetAc(string s) { try { string temp = Servic ...