上一页 1 ··· 5 6 7 8 9 10 11 12 下一页
摘要: pthread_key_tThread local storage key (opaque)DeclarationSource position: ptypes.inc line 233typepthread_key_t=cuint;cuintC type: unsigned integer (natural size)DeclarationSource position: ctypes.inc line 40typecuint=cuint32;--------------------------------------------------------------------------- 阅读全文
posted @ 2011-05-15 16:43 lxgeek 阅读(509) 评论(0) 推荐(0) 编辑
摘要: 实现: int s, con; struct sockaddr_in cliaddr, servaddr; if ( argc != 3 ) { printf( "uasage: httpd <IPaddress> <Port>"); exit( 0 ); } s = socket(AF_INET, SOCK_STREAM, 0); bzero(&servaddr, sizeof(servaddr)); servaddr.sin_family = AF_INET; inet_pton( AF_INET, argv[1], &(serv 阅读全文
posted @ 2011-05-12 22:14 lxgeek 阅读(3190) 评论(0) 推荐(0) 编辑
摘要: In many situations when designing statistical software, the number of variables a dis-crete distribution will have is not known in advance (at compilation time). There existsa need to generate discrete multidimensional distributions on the fly.Multi-way arraysOne obvious way to store these multidime 阅读全文
posted @ 2011-05-12 09:40 lxgeek 阅读(346) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <fstream>#include <string>#include <vector>#include <string.h>#include <stdlib.h>#include <stdio.h>using namespace std;typedef struct ring{ char a; struct ring *flink; struct ring *slink;} ring;ring* sring = NULL;ring* hring = NUL 阅读全文
posted @ 2011-05-08 19:00 lxgeek 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Is Friday the 13th really an unusual event?That is, does the 13th of the month land on a Friday less often than on any other day of the week? To answer this question, write a program that will compute the frequency that the 13th of each month lands on Sunday, Monday, Tuesday, Wednesday, Thursday, Fr 阅读全文
posted @ 2011-05-03 17:23 lxgeek 阅读(630) 评论(0) 推荐(0) 编辑
摘要: A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to any or all of the other friends. Likewise, each friend might or might not receive money from any or all of the other friends. Your goal in this probl 阅读全文
posted @ 2011-05-01 22:45 lxgeek 阅读(702) 评论(0) 推荐(0) 编辑
摘要: 先介绍opendpi如何设置各个协议的处理,然后介绍如何处理每一个包,最后是软件的流程图。第一:首先看下要用到的重要的宏View Code #define IPOQUE_SAVE_AS_BITMASK(bitmask,value) (bitmask)=(((IPOQUE_PROTOCOL_BITMASK)1)<<(value)) #define IPOQUE_BITMASK_COMPARE(a,b) ((a) & (b)) #define IPOQUE_BITMASK_MATCH(x,y) ((x) == (y)) #define IPOQUE_BITMASK_COMPAR 阅读全文
posted @ 2011-04-21 20:55 lxgeek 阅读(2758) 评论(1) 推荐(0) 编辑
摘要: 先贴会有用的相关内容:struct iphdr {#if BYTE_ORDER == LITTLE_ENDIAN uint8_t ihl:4, version:4;#elif BYTE_ORDER == BIG_ENDIAN uint8_t version:4, ihl:4;#else# error "BYTE_ORDER must be defined"#endif uint8_t tos; uint16_t tot_len; uint16_t id; uint16_t frag_off; uint8_t ttl; uint8_t protocol; uint16_t c 阅读全文
posted @ 2011-04-18 19:58 lxgeek 阅读(5194) 评论(1) 推荐(2) 编辑
摘要: /** author: lx date 4.11 2011 biref BN*/#pragma once#include <string>#include <map>#include <vector>#include <iostream>using namespace std;typedef pair< char, float > inter;/* struct of node */struct nbnode{ char name[20]; /* name */ vector< inter > nodeprob; /* p 阅读全文
posted @ 2011-04-11 19:38 lxgeek 阅读(412) 评论(0) 推荐(0) 编辑
摘要: #pragma once#include<list>using namespace std;class roundrobin//class representing round robin scheduling{ int *rq;//request times int n;//number of processes int q;//time quantum int *w;//wait times int *t;//turn-around times int *a;//arrival times list<int> order;public: roundrobin(voi 阅读全文
posted @ 2011-04-10 14:24 lxgeek 阅读(2638) 评论(0) 推荐(1) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 下一页