- 浏览: 529745 次
- 性别:
- 来自: 山东济南
文章分类
最新评论
-
dragon_8844:
非常不错,nice
java.util.concurrent 多线程框架 -
wusendong:
很好的文章!受益匪浅,谢谢!
java.util.concurrent 多线程框架 -
SINCE1978:
你也关注并发啊
java.util.concurrent 多线程框架 -
lku1314:
这个不错 刚刚找到这个组建 以前孤陋寡闻了 像lz学习!标 ...
quartz 在WEB中应用小结 -
lliiqiang:
人们对于目标需要的需求明确的去做,对于目标以外的因素是随机的执 ...
flex和后端的数据交互(一)--XML和HTTPService
http://www.blogjava.net/flyingbug/archive/2006/05/18/46862.html
--------------------------------------------------------------------------------
中学阶段
10 PRINT "HELLO WORLD"
20 END
--------------------------------------------------------------------------------
大学一年级
program Hello(input, output)
begin
writeln('Hello World')
end.
--------------------------------------------------------------------------------
大学高年级
(defun hello
(print
(cons 'Hello (list 'World))))
--------------------------------------------------------------------------------
初级程序员
#include <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message );
printf("\n");
}
--------------------------------------------------------------------------------
编程老鸟
#include <iostream.h>
#include <string.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 << end
return(0);
}
--------------------------------------------------------------------------------
编程高手
[
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\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 <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);
}
--------------------------------------------------------------------------------
黑客初阶
#!/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);}
--------------------------------------------------------------------------------
黑客高手
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
--------------------------------------------------------------------------------
黑客
% cat
Hello, world.
^D
--------------------------------------------------------------------------------
初级经理
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.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
中学阶段
10 PRINT "HELLO WORLD"
20 END
--------------------------------------------------------------------------------
大学一年级
program Hello(input, output)
begin
writeln('Hello World')
end.
--------------------------------------------------------------------------------
大学高年级
(defun hello
(cons 'Hello (list 'World))))
--------------------------------------------------------------------------------
初级程序员
#include <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message );
printf("\n");
}
--------------------------------------------------------------------------------
编程老鸟
#include <iostream.h>
#include <string.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 << end
return(0);
}
--------------------------------------------------------------------------------
编程高手
[
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\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 <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);
}
--------------------------------------------------------------------------------
黑客初阶
#!/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);}
--------------------------------------------------------------------------------
黑客高手
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
--------------------------------------------------------------------------------
黑客
% cat
Hello, world.
^D
--------------------------------------------------------------------------------
初级经理
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
--------------------------------------------------------------------------------
发表评论
-
java动态编程一例
2009-12-22 08:37 1616Test.java package test; im ... -
tomcat SSL基本配置
2009-11-30 09:25 1530切换到$TOMCAT_HOME下: 1.生成 server ... -
Oracle 10g自带性能监测工具
2009-11-04 09:08 3178安装Oracle 10g时可以选择安装自带的性能监测工具,对于 ... -
Liferay应用界面
2009-09-16 17:26 2239我们用Liferay Portal开发的项目,已有小成,sho ... -
Liferay Iframe Portlet
2009-09-01 08:30 5912The Iframe portlet makes it pos ... -
LifeRay 5.1.2 使用struts1.1时ClassNotFoundException
2009-08-25 10:37 1268今天修改一个portlet时出现 java.lang.Clas ... -
Tomcat 5 中文路径问题
2009-08-06 10:02 1422在tomcat 5下一个动态加载svg图形文件的页面; 页面中 ... -
dhtmlxtree使用中的CharConversionException: isHexDigit
2009-08-04 16:48 2012使用dhtmlxtree时,点击树节点异步加载子节点数据时,在 ... -
程序员五大层次,你属于哪一层?
2009-07-14 13:54 1243软件界一个无 ... -
第一次面别人
2009-05-27 09:40 1711“面”不是吃的,是看的。 从换了工作以后都很忙,周 ... -
liferay中使用struts时jar文件冲突
2009-05-26 13:52 1766异常: java.lang.NoSuchMethodE ... -
犹豫中,不知道该怎么办了!
2009-03-04 10:38 1235先说说我现在的公司, ... -
参数传递的浏览器差异
2008-10-19 22:32 1764情况大体是这样的:一个头页面header.jsp上有一个搜索框 ... -
该死的黑客
2008-09-22 15:06 1440公司一台对外网服务的linux系统数据库服务器,上周五被人破译 ... -
A Tutorial on Clustering Algorithms
2008-07-02 09:50 3114A Tutorial on Clustering Algor ... -
The Examples for Quartz Time Format
2008-05-16 15:02 1804The Examples for Quartz Time Fo ... -
让人头疼的新手
2008-05-13 11:25 4977刚进公司没多久时,领导让我带两个新人(07年7月份毕业的)。他 ... -
昨天参加了一次面试
2008-05-06 11:40 2940象去年这个时候一样, ... -
开发小记
2008-02-13 15:54 14981. 在oracle中字符串拼 ... -
javascript实现日期操作的工具包
2007-12-13 13:39 3331最近一个小项目中用到了dwr,其中使用到了日期型数据;查了一下 ...
相关推荐
综上所述,Microsoft基本类库MFC是Windows程序员的强大工具,它提供了丰富的类库和框架,降低了Windows应用开发的复杂性。通过深入理解MFC的核心概念和组件,开发者可以更高效地构建功能丰富的Windows应用程序。
C++20是C++语言的一次重大进化,它与C++11一样具有里程碑式的意义,为现代C++编程带来了深远的影响。 C++20的新特性包括但不限于: 1. **模块化(Modules)**:模块系统引入了对源代码的封装,提高了编译效率,...
遗传算法是一种基于生物进化原理的优化方法,广泛应用于机器学习领域。MATLAB作为一种强大的数值计算和数据可视化工具,是实现遗传算法的理想平台。本压缩包包含的代码详细展示了如何在MATLAB环境中应用遗传算法解决...
Java 和 .NET 都内置了垃圾回收机制,而在 C++ 中,程序员通常需要手动管理内存。 8. **哲学与经济学在软件开发中的应用**: 作者引用 Karl Popper 的观点,强调理论需要通过实践来验证,这在软件开发中意味着不断的...
在JNI的进化过程中,相关开发指南和规范的更新也在不断进行,以保证Java开发者可以更好地利用本地代码,同时避免出现常见的陷阱和错误。开发者在使用JNI时,必须严格遵循规范,才能确保本地代码与Java代码之间的正确...
随着C++语言的发展,STL也在不断进化,新的C++标准引入了更多支持STL的功能,如C++11的`auto`关键字简化了类型推断,`nullptr`提供了更安全的空指针表示,以及`<tuple>`等新容器的加入,使得STL的应用更加广泛和强大...
- C# 使用垃圾回收机制来自动管理内存,减轻了程序员管理内存的负担,避免了常见的内存泄漏问题。 #### 五、表达式与声明 - **表达式**:C# 中的表达式是由操作符和操作数组成的计算单元。 - **声明**:用于定义...
机构光(深度)相机是一种先进的视觉传感器,它能够捕捉到物体的三维信息,不仅包括颜色信息,还有距离信息。这种技术在机器人导航、自动化、增强现实、虚拟现实、3D建模等领域有着广泛的应用。...
综上所述,编译原理及实践不仅涉及编译器的核心概念和结构,还包括了编译器设计的多个方面,如语言理论、自动化构建工具、编程语言的进化、以及编译器与开发环境的集成。掌握这些知识点,对于理解现代计算机语言和...
C++是一种广泛应用于系统软件、应用软件、游戏开发、设备驱动等领域的高级编程语言,其标准不断进化以适应现代计算需求。C++20是该语言的一个重要里程碑,引入了许多新特性,包括Coroutine、Module、Concept和Range...
其中,JavaScript语言的进化,尤其是ES6(ECMAScript 2015)的引入,为数组操作带来了许多新的便利。在这个第五单元的PPTX电子版中,主要探讨了ES6中关于数组的一些新特性,这些特性极大地提高了开发者在处理数组时...
- **命名空间**:命名空间是C++03中引入的一个重要概念,它允许程序员将标识符分组到不同的命名域中,从而有效地避免了全局命名冲突的问题。通过使用关键字`namespace`来定义命名空间,并可以通过`using`指令来引入...
虽然随着技术的发展,Pandas已经进化到更先进的版本,但这些基本功能和理念始终贯穿其中,对于初学者和经验丰富的数据分析师来说,理解并熟练运用Pandas的这些特性至关重要。通过深入学习和实践,我们可以更高效地...
OCaml以其高效、安全和强大的类型系统而受到程序员的喜爱。 WordPress的核心功能包括博客平台、网站构建工具和内容管理,它为用户提供了一套易于使用的界面来创建、编辑和发布内容。其开源特性意味着全世界的开发者...