LibSigC++
对libsigc++的简单介绍。libsigc++是实现类型安全回调的一个C++模板库。
在很多情况下,检测事件的代码与处理事件的代码需要去耦合,特别在GUI编程里面。按键点击事件的检测与点击事件的处理是分开的。
与C++的异常处理的情况相似,检测到异常的代码并不知道如何去处理异常,需要将异常交给用户代码去处理。
libsigc++提供了信号(signal)和槽(slot)的概念。slot对应一个回调函数,信号(signal)与槽(slot)相关联(attach),但一个信号被发射(emit)时,相对应的槽被调用。
sigc::signal<返回类型,参数类型,...> * onxxxx
onxxxx=new sigc::signal<返回类型,参数类型,...>
onxxxx->connect(sigc::mem_fun(...));
onxxx->emit(...)
2007年9月7日星期五
懒惰的程序员: Interview questions
懒惰的程序员: Interview questions
netcasper,我一直在订阅他的blog,很好的程序员。
推荐的两个面试问题:
Why should I join you?
都是很狂妄的问题。
netcasper,我一直在订阅他的blog,很好的程序员。
推荐的两个面试问题:
- What are your long-term goals?
- What book is currently on your nightstand?
Why should I join you?
都是很狂妄的问题。
Sample Interviews - Miguel de Icaza
Sample Interviews - Miguel de Icaza
Mono的一些interviews问题,not face-to-face interviews,而是通过email分派实际的编程任务。
列举了俩个interviews的例子。
Am posting here two of the interviews that we used in the past to hire for positions into the Windows.Forms group and the Mono VM engine. These interviews are typically conducted over two to three weeks.
这两个题我都没有看懂。
什么是Mono呢
http://www.mono-project.com/
Mono的一些interviews问题,not face-to-face interviews,而是通过email分派实际的编程任务。
列举了俩个interviews的例子。
Am posting here two of the interviews that we used in the past to hire for positions into the Windows.Forms group and the Mono VM engine. These interviews are typically conducted over two to three weeks.
这两个题我都没有看懂。
什么是Mono呢
http://www.mono-project.com/
Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix. Sponsored by Novell (http://www.novell.com), the Mono open source project has an active and enthusiastic contributing community and is positioned to become the leading choice for development of Linux applications.
inet_ntoa(), inet_aton()
inet_ntoa(), inet_aton()
点分十进制IP地址字符串与struct in_addr数据结构的相互转换。
点分十进制IP地址字符串与struct in_addr数据结构的相互转换。
#include
#include
#include
char *inet_ntoa(struct in_addr in);
int inet_aton(const char *cp, struct in_addr *inp);
in_addr_t inet_addr(const char *cp);
gethostbyname(), gethostbyaddr()
gethostbyname(), gethostbyaddr()
主机名与IP地址之间的相互映射。
原型:
主机名与IP地址之间的相互映射。
原型:
#includestruct hostent {
#include
struct hostent *gethostbyname(const char *name);
struct hostent *gethostbyaddr(const char *addr, int len, int type);
gethostbyaddr虽然传递的参数是char* 类型的,但实际传的时候应该是addr是指向struct in_addr的指针,
而len为sizeof(struct in_addr),type为AF_INET.
char *h_name; /* official name of host */
char **h_aliases; /* alias list */
int h_addrtype; /* host address type */
int h_length; /* length of address */
char **h_addr_list; /* list of addresses */
}
订阅:
博文 (Atom)