周末啦. 今天抽了个机会把博客的模板好好整理了一下, 汉化了小部分内容, 主要添加了些Google Adsense的广告.记得刚申请这个域名的时候就去申请Google Adsense了, 只不过那个时候几天之后给我回信告诉我不通过申请, 因为浏览量太小了. 也难怪, 新站嘛. 现在通过申请了, 我也就加上了, 倒是真不指望能赚几毛钱, 最起码这种东西放在网站上多少说明我的站有点价值吧.

郁闷死了. 还是VSTO的问题, 怎么也部署不了了. Adnan心急的很, 我也很着急, 可越是这种有的可以有的不行的情况是最难处理的. 希望周末的时候能有时间再试一试.
英文还是很重要的, Adnan一着急就亲自跑来了, 跟他交流得用英文, 说实话开始心里比较发毛, 侃了一会儿就好一些了, 说话也连贯了…嘿嘿. 专业外语咱还是没问题的, 毕竟那些个词在中文里也还是那些个词, 平常就没人用中文念那些东西, 就是Visual Studio 2008这样的数字注意别念顺口了就行了~

唉. 写了一篇, 被Windows Live Writer死掉吃掉了. 气死我了. 最近比较烦, 乱七八糟的事情越来越多, 头绪也越来越多. 我真的很不喜欢和我控制不了的事情打交道. 不过还算好的是最起码白天能够坐下来好好做点事情了. 能够坐在岗位上仔仔细细认认真真耐心编一天程, 真的是够耐心, 像刚来的时候一样了. 在MSRA, 每个人都可以用远程桌面连接到数台服务器, 在上面做开发, 我很喜欢远程桌面这个东西, 因为在那里可以将人从喧嚣的世界中分离出来, 在那里没有Outlook, 没有QQ, 没有MSN, 戴上耳机, 没有电话. 多么美好的却昂贵的源代码世界.

这是来自新加坡国立大学的一个页面,它记录了一个程序员从入门到精通,再到黑客,再荣升经理和CEO时所写的代码,
正如我们访客(注: cnbeta的访客)所评论的那样,这位程序员从青蛙变成了蛤蟆,相信同为程序员的你,看了之后您会会心一笑,我们的生活何尝不是如此呢?

High School/Junior 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
void main(void)
{
char *message[] = {“Hello “, “World”};
int i;for(i = 0; i < 2; ++i)
printf(“%s”, message[i]);
printf(“\n”);
}
Seasoned professional #include
#include

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-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();
importheader();
importheader();
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
#include
#include
#include
#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\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
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
#include
#include
#include
#include
#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
#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, world.
^D
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

中文原文: http://www.cnbeta.com/articles/38875.htm
英文原文: http://sunsite.nus.edu.sg/pub/humour/prog-evolve.html

NND. 被VSTO的Deployment问题折腾了一整天, 最终找到一个Microsoft发布的Deploying Visual Studio 2005 Tools for Office Solutions Using Windows Installer文档(共分两部分, Part 1 和Part 2, 打印出来满满24页小字A4), 按照这个文档仔仔细细从头执行到尾, 结果, 不work. 崩溃… 气死我了. 搞了四五个小时是这个结果. NND. 折腾到12点才无奈地回去睡觉了. 明天接着搞…

Windows安全性搞得乱七八糟, 还给正常的程序开发以安全为目的造成这么多麻烦, 唉…

七十天了噢. 刚来北京的时候觉得实习结束还远着呢, 现在看看那是指日可待啊. 回程的日子手机已经开始提示了, 真正到了该准备的时候了.

今天用时代互联的赠券注册了一个域名, 准备为后面开发同济网的一个项目做准备了.

Mentor们从丽江回来了. 好多人黑了不少, 看起来一定玩的很High. 实习生的好日子也就此结束~ 说起来还是挺怀念这几天的. 每天成日地开着Outlook, 邮件却只有一封两封, 还是集团内部广告邮件, 爽死. 不过那样的生活毕竟不充实, 不如在Mentor们的领导下开会干活来的效率高… 忙死了,导致我昨天生生没空写Blog. 算了, 今天也不写了. 本意是这样的, 还是稍微记录一下吧. 行了, 干活去…