上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 45 下一页

2010年12月30日

摘要: http://poj.org/problem?id=2993学会了用strtok()函数分割字符串Emag eht htiw Em PlehTime Limit:1000MSMemory Limit:65536KDescriptionThis problem is a reverse case of theproblem 2996. You are given the output of the problem H and your task is to find the corresponding input.Inputaccording to output ofproblem 2996.O 阅读全文
posted @ 2010-12-30 12:49 yming0221 阅读(177) 评论(0) 推荐(0)

2010年12月29日

摘要: 我在ubuntu 10.04仍然碰到这个问题。1.如果开机不是自动登录,可以将密钥环密码设为和登录密码一致。这样登录后自动解密密钥环。2.如果是自动登录,可以将密钥环密码留空。确认警告:但空密码带来安全问题,密钥环密码全被明文存储了。此时可以直接看到~/.gnome2/keyrings/login.keyring里面明文存储的密码。不过,幸好该文件仅当前用户可读写。如果在有安全问题的环境,比如其他不可信任的人可以登录你的系统,并能获得root权限,那是不安全的。如果是那样,必须不设自动登录,并让缺省密钥环密码和登录密码一致,并注意人离开时锁屏。 阅读全文
posted @ 2010-12-29 19:13 yming0221 阅读(579) 评论(0) 推荐(0)
摘要: 基于UDP协议和GTK+用户界面的Linux Socket端到端通信程序设计详细设计文档一、UDP编程函数声明1、socket()函数声明:#include <sys/types.h>#include <sys/socket.h>int socket(int domain, int type, int protocol);UDP协议参数选择domain为AF_INET,type为SOCK_DGRAM,protocol值为0。表示建立一个AF_INET族的数据包套接字,UDP使用的套接字使用SOCK_DGRAM选项。2、通用的的套接字地址类型为struct sockadd 阅读全文
posted @ 2010-12-29 13:27 yming0221 阅读(359) 评论(0) 推荐(0)

2010年12月28日

摘要: //为了和DSP兼容,TSint64和TUint64设置成TSint40和TUint40一样的数//结果VC中还是认为是32位的,显然不合适//typedefsignedlongintTSint64;//typedefunsignedlongintTUint64;//ANSIC中规定longlong才能表示64位//参见:http://msdn.microsoft.com/en-us/library/s3f49ktz.aspx//可惜VC++6.0不认识longlong,会报errorC2632:'long'followedby'long'isillegalty 阅读全文
posted @ 2010-12-28 13:16 yming0221 阅读(225) 评论(0) 推荐(0)
摘要: 字符串模拟排序http://poj.org/problem?id=2996Help Me with the GameTime Limit:1000MSMemory Limit:65536KDescriptionYour task is to read a picture of a chessboard position and print it in the chess notation.InputThe input consists of an ASCII-art picture of a chessboard with chess pieces on positions described 阅读全文
posted @ 2010-12-28 13:08 yming0221 阅读(85) 评论(0) 推荐(0)
摘要: http://poj.org/problem?id=3006Dirichlet's Theorem on Arithmetic ProgressionsTime Limit:1000MSMemory Limit:65536KDescriptionIfaanddare relatively prime positive integers, the arithmetic sequence beginning withaand increasing byd, i.e.,a,a+d,a+ 2d,a+ 3d,a+ 4d, ..., contains infinitely many prime n 阅读全文
posted @ 2010-12-28 07:39 yming0221 阅读(118) 评论(0) 推荐(0)

2010年12月27日

摘要: 本程序的通信是基于UDP协议的传输实现服务器端:server.h/*********************************** * server.h * * the header files and functions * ***********************************/#include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <stdio.h> #include <errno.h> #include 阅读全文
posted @ 2010-12-27 15:16 yming0221 阅读(328) 评论(0) 推荐(0)

2010年12月25日

摘要: 【摘要】 本文介绍了Linux平台下的Xwindow图形窗口编程工具GTK,并给出了用GTK编程的基本要素和步骤。【关键词】GTK,回调函数,消息处理器,调节器GTK(GIMP Toolkit)是一个图形用户编程的接口工具。它注册完全免费,所以用来开发自由软件或商业软件都不需要花费什么。现在很多Linux集成系统都已经将GTK1.2版本打包进去了。包括RedHat Linux 6.0以上版本,还有中文化的Turbo Linux等等。它也越来越被普遍的应用于UNIX系统编程。还有一个组件叫Glib,它包含了一些标准应用的新扩展用来提高GTK的兼容性。用于Linux系统的某些函数可能不适合标准的U 阅读全文
posted @ 2010-12-25 22:27 yming0221 阅读(517) 评论(0) 推荐(0)
摘要: 最近看了一些网络编程的书籍,一直以来总感觉网络编程神秘莫测,其实网络编程入门还是很容易学的,下面这些代码是我在linux下编写的,已经运行过了,编译之后就可以运行了。有不足之处希望大家多多指出,共同学习交流。 套接字是一种进程间的通信的方法,不同于以往介绍的进程间通信方法的是,它并不局限于同一台计算机的资源,例如文件系统空间,共享内存或者消息队列。套接字可以认为是对管道概念的扩展——一台机器上的进程可以使用套接字与另一台机器上的进程通信。因此客户与服务器可以分散在网络中。同一台机器上的进程间也可以用套接字通信。套接字是一种通信机制,客户/服务器系统既可以在本地单机上运行,也可以在网络中运行。套 阅读全文
posted @ 2010-12-25 22:25 yming0221 阅读(256) 评论(0) 推荐(0)
摘要: 1. socket()2. bind()3. connect()4. listen()5. accept()6. send()和recv()7. sendto()和recvfrom()8. close()和shutdown()9. getpeername()10. gethostname()socket()------------------------------------------------ 我们使用系统调用socket()来获得文件描述符: #include <sys/types.h> #include <sys/socket.h> int socket(i 阅读全文
posted @ 2010-12-25 22:19 yming0221 阅读(115) 评论(0) 推荐(0)
上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 45 下一页

导航