12 2012 档案

摘要:1.获取设备列表:#include "pcap.h"main(){ pcap_if_t *alldevs; pcap_if_t *d; int i=0; char errbuf[PCAP_ERRBUF_SIZE]; /* Retrieve the device list from the local machine */ if (pcap_findalldevs_ex(PCAP_SRC_IF_STRING, NULL /* auth is not needed */, &alldevs, errbuf) == -1) { fpri... 阅读全文
posted @ 2012-12-30 11:56 godjob 阅读(438) 评论(0) 推荐(0)
摘要:以太网ethernet代码/* This is an Ethernet frame header. */struct ethhdr { unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */ unsigned short h_proto; /* packet type ID field */};ARP头部/* ARP protocol opcodes. */#define ARPOP_REQUEST 1 /* ... 阅读全文
posted @ 2012-12-29 23:41 godjob 阅读(573) 评论(0) 推荐(0)
摘要:[本文英文原文链接:Improving Your Python Productivity / 外刊IT评论]我已经使用Python编程有多年了,即使今天我仍然惊奇于这种语言所能让代码表现出的整洁和对 DRY编程原则的适用。这些年来的经历让我学到了很多的小技巧和知识,大多数是通过阅读很流行的开源软件,如 Django, Flask, Requests中获得的。下面我挑选出的这几个技巧常常会被人们忽略,但它们在日常编程中能真正的给我们带来不少帮助。1. 字典推导(Dictionary comprehensions)和集合推导(Set comprehensions)大多数的Python程序员都知道且 阅读全文
posted @ 2012-12-26 19:33 godjob 阅读(202) 评论(0) 推荐(0)
摘要:1.TheServerSide这是一个老牌的IT信息网站,从名称上你就能看出,它是关注服务器端编程的,以Java和Java周边信息为主,不过最近它也有向客户端和微软产品 扩展的趋势。这个网站最初是以免费发放《Mastering Enterprise JavaBeans》这本电子书出名的,现在这本书已经更新到了ELB 3.0版,你现在仍然可以从网站上免费下载这本书。这个网站的内容包括IT新闻咨询,专家评论,专家访谈视频,会议视频等。2.infoqinfoq上一个重点就是敏捷开发,内容很丰富,而且这个网站还提供中文版,但可能是翻译耗时的原因,中文内容总是比英文内容滞后几天。3.Digg 的科技频道 阅读全文
posted @ 2012-12-21 16:31 godjob 阅读(323) 评论(0) 推荐(0)
摘要:The Broken PedometerThe ProblemA marathon runner uses a pedometer with which he is having problems. In the pedometer the symbols are represented by seven segments (or LEDs):But the pedometer does not work properly (possibly the sweat affected the batteries) and only some of the LEDs are active. The 阅读全文
posted @ 2012-12-01 22:48 godjob 阅读(429) 评论(0) 推荐(0)