關於 libpcap的安裝

我用以下的方式安裝libpcap,./configuremakemake install並且用下面的代碼測試:#include <stdio.h>#include <stdlib.h>#include <pcap.h>int main( int argc, char** argv ){ char *dev, errbuf[PCAP_ERRBUF_SIZE]; dev = pcap_lookupdev( errbuf );

貝葉斯網路 未學習前資料結構

/** 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]

httpd的基本原理

代碼Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include <sys/socket.h>#include <string.h>#include <netinet/in.h>#include <errno.h>int main(int argc, char** argv){int s, con;

Linux下安裝NS2軟體

由於論文中會用到NS2軟體,重來沒有用過,現在嘗試在Linux下安裝NS2軟體,安裝的步驟總結如下:1. 下載NS2的軟體包:wget http://sourceforge.net/project/showfiles.php?group_id=149743&package_id=169689&release_id=588643(這個網址我沒試過)2.  解壓下載的軟體包: tar zxvf ns-allinone-2.33.tar.gz    3.  找到解壓後的檔案:cd

Ubuntu下安裝samba伺服器

Ubuntu下安裝samba伺服器:步驟1:Ubuntu下安裝samba    #apt-get install samba    #apt-get install smbfs步驟2:添加linux使用者    #useradd user1     //添加使用者名稱user1    #passwd user1 //給使用者名稱user1添加密碼    #mkdir /home/user1 //建立user1的home目錄,如果不用這個使用者名稱來登陸linux,此步驟不是必需    

圖的廣度優先搜尋 (參考演算法導論)

#__author__=lx#__date__=2011-10-03#__brief__=BFSfrom collections import dequedef BFS( G, s ): d = [] color = [] p = [] L = deque() for i in range( len( G ) ): if i != s:

對 main 的 argc argv有點困惑 寫了實驗代碼

#include <stdlib.h>#include <stdio.h>intmain( int argc, char** argv ){ int i = 0; for ( ; i < argc; i++ ) { printf( "argv[%d] is %s\n", i, argv[i] ); } int arg_c = argc; char**

opendpi 源碼分析(一)

先貼會有用的相關內容: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;

《Programming Pearls》 column 2中問題二中解法 (不知道對不對哦)

/* * author: lx * date: 2011-09-16 * brief: programming pearls column2 */#include <stdio.h>#include <stdlib.h>voidmove_vector( char* b, int m, int n ){ int i = 0; int j; char temp; for ( ; i < n ; i++ )

bnt_1 一個用於貝葉斯網路的matlab的工具

N = 4;dag = zeros( N, N );C = 1; S = 2;R = 3;W = 4;dag( C, [R S] ) = 1;dag( R, W ) = 1;dag( S, W ) = 1;node_sizes = 2*ones(1,N);%node_sizes = [ 4 2 3 5];%建立有向非循環圖onodes = [];bNet = mk_bnet( dag, node_sizes );%建立條件機率表bNet.CPD{C} = tabular_CPD( bNet,

機器學習(一) 貝葉斯法則與概念學習

  貝葉斯學習演算法應用於機器學習的有兩個原因,第一:貝葉斯學習能夠計算顯式的假設機率,如樸素貝葉斯分類器。第二:貝葉斯方法為理解機器學習的其他方法提供了手段,如分析FIND-S演算法。  貝葉斯法則對與貝葉斯學習至關重要,其形式如下:  貝葉斯法則提供了一種計算假設機率的方法,它基於假設的先驗機率、給定假設下觀察到不同資料的機率以及觀察到的資料本身。其中P(H)用來代表在沒有訓練資料前假設H擁有的初始機率,因此其通常被稱為先驗機率(prior

圖的深度優先搜尋(參考演算法導論)

#__author__=lx#__date__=2011-10-03#__brief__=DFStime = 0d = []f = []color = []p = []def DFS_VISIT( G, i ): color[ i ] = 'gray' global time time += 1 d[i] = time print i+1 for v in G[i]: if

快速排序 v0.1

/* * author:lx * breif: 2011.09.22 * brief: quick-sort */#include <stdio.h>#include <stdlib.h>voidquick_sort( int *x, int l, int u ){ if ( l >= u ) { return; } int m = l; int i;

find-s 演算法

實現《機器學習》19頁的FIND-S演算法。驗證不同的執行個體順序開始於非最特殊假設。#__author__=lx#__date__=2011.10.18#__brief__=FIND-S, from 'machine learning' 19def find_s(): x1 = [ 'sunny', 'warm', 'nurmal', 'strong', 'warm', 'same' , 1 ] x2 = [ 'sunny', 'warm',

hash表建立 很久沒寫資料結構了

/** auhtor:lx date 4.9 2011 brief hash table*/#include <stdio.h>#include <stdlib.h>#include <stdbool.h>#define hash_num 5typedef char Bool;struct hash_node{int date; /*結點值*/struct hash_node *next; /*下一個節點*/ Bool found;}

迴圈鏈表

#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

ubuntu 上 建立大檔案 超過2G

/** author lx date 3.24 2011 contact lxlenovostar@gmail.com biref cp a big file to anthor file.*/#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>#include <unistd.h>#include <stdio.h>

通過命令列指定監聽的IP和連接埠

實現: 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);

fcntl 的學習過程

#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include "ourhdr.h"#include "error.c"#include "f10.17.c"static void lockabyte(const char *, int, off_t );int lock_reg( int fd, int cmd, int type, off_t offset, int whence,

Greedy Gift Givers

文章目錄 IMPORTANT NOTEPROGRAM NAME: gift1INPUT FORMATSAMPLE INPUT (file gift1.in)OUTPUT FORMATSAMPLE OUTPUT (file gift1.out) A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of

總頁數: 61357 1 .... 6400 6401 6402 6403 6404 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.