#include<stdio.h> #include<string.h> #include<limits.h> #include<unistd.h> #include<sys/types.h> #define PROMPT_STRING "[myshell]$" #define QUIT_STRING "exit\n" static char inbuf[MAX_CANON] char * g_ptr char * g_lim extern void yylex() int main (void){ for( ){ if(fputs(PROMPT_STRING,stdout)==EOF) continue if(fgets(inbuf,MAX_CANON,stdin)==NULL) continue if(strcmp(inbuf,QUIT_STRING)==0) break g_ptr = inbuf g_lim = inbuf + strlen(inbuf) yylex() } return 0 }
上傳時間: 2016-12-31
上傳用戶:colinal
//順序表的建立、查找、插入與刪除 #include <stdio.h> #include <malloc.h> #include <stdlib.h> #define ListSize 100 //表最大長度 //結構定義 typedef struct SeqList { int node[ListSize] //存放表結點 int length //當前表長度 } SeqList //插入元素 insertList(SeqList *list, int e) { int i=list->length-1 //先將i指定為最后一項 if(i>=ListSize-1) //表已經達到最大長度ListSize { printf("表已滿,不能增加新的項!\n")
上傳時間: 2014-01-17
上傳用戶:dongqiangqiang
s document describe davicom ic dm9000 DM9000_h.h . this ic can be used in the embedded systems and network lan cards. its is 10/100Mpbs ic.
標簽: 9000 document describe embedded
上傳時間: 2013-12-10
上傳用戶:xyipie
//初始化 initscr() //獲得屏幕尺寸 getmaxyx(stdscr, h, w) //畫背景 for(i=0 i<h i++) for(j=0 j<w j++){ mvaddch(i, j, ACS_CKBOARD) } refresh() //建立窗口 pad = newpad(80, 128) for(i=0 i<80 i++){ char line[128] sprintf(line, "This line in pad is numbered d\n", i) mvwprintw(pad, i, 0, line) } //刷新屏幕 refresh() prefresh(pad, 0, 1, 5, 10, 20, 45) for(i=0 i<50 i++){ prefresh(pad, i+1, 1, 5, 10, 20, 45) usleep(30000) } //等待按鍵 getch()
標簽: getmaxyx initscr stdscr for
上傳時間: 2014-08-30
上傳用戶:龍飛艇
跨數據庫平臺: n 支持 oracle 的OCI n 支持DB2的CLI, n 支持ODBC(通過ODBC,可支持SQL SERVER,MySQL等) Ø 跨OS平臺: n 標準C++語言,支持 unix/linux/windows Ø 使用簡單: n 只有一個頭文件 n 接口簡潔.otl_stream, otl_connect, otl_exception等就可以完成大部分工作 n 相對 ProC等嵌入式開發,代碼能相應減少 Ø 性能: n 直接訪問數據庫API接口,具有API接口的高效率,可靠性 Ø 穩定性: n 開源代碼,唯一的代碼文件otlv4.h,可以了解所有基于數據庫API的實現細節 n 從1996年開始,到今已10余年. Ø 可讀性及可維護性: n 標準C++代碼,不需要任何預處理 n 使用流的形式,輸入輸出異常簡潔 n 減少大量代碼, n 代碼結構更加簡潔 參考資料: http://otl.sourceforge.net/
上傳時間: 2017-06-14
上傳用戶:cainaifa
BP神經網絡程序,C語言源代碼 如下: #include "iostream.h" #include "iomanip.h" #include "stdlib.h" #include "math.h" #include "stdio.h" #include "time.h" #include "fstream.h" #define N 120 //學習樣本個數 #define IN 3 //輸入層神經元數目 #define HN 2 //隱層神經元數目 #define ON 2 //輸出層神經元數目 #define Z 20000 //舊權值保存-》每次study的權值都保存下來 double P[IN] //單個樣本輸入數據 double T[ON] //單個樣本教師數據 double U11[IN][HN] //輸入層至第一隱層權值 double V[HN][ON] //隱層至輸出層權值 double X1[HN] //第一隱層的輸入 double Y[ON] //輸出層的輸入 double H1[HN] //第一隱層的輸出 double O[ON] //輸出層的輸出 double YU_HN1[HN] //第一隱層的閾值 double YU_ON[ON] //輸出層的閾值 double err_m[N] //第m個樣本的總誤差 double a //學習效率 double alpha //動量因子
標簽: include iostream iomanip stdlib
上傳時間: 2017-06-15
上傳用戶:xinzhch
LDPC 譯碼器 function [vhat]=decode_ldpc(rx_waveform,No,amp,h,scale) [vhat]=decode_ldpc(rx_waveform,No,amp,h,scale)
標簽: decode_ldpc rx_waveform vhat function
上傳時間: 2014-01-13
上傳用戶:fxf126@126.com
g a w k或GNU awk是由Alfred V. A h o,Peter J.We i n b e rg e r和Brian W. K e r n i g h a n于1 9 7 7年為U N I X創建的a w k編程語言的較新版本之一。a w k出自創建者姓的首字母。a w k語言(在其所有的版本中)是一種具有很強能力的模式匹配和過程語言。a w k獲取一個文件(或多個文件)來查找匹配特定模式的記錄。當查到匹配后,即執行所指定的動作。作為一個程序員,你不必操心通過文件打開、循環讀每個記錄,控制文件的結束,或執行完后關閉文件。
上傳時間: 2014-01-02
上傳用戶:hwl453472107
client socket include <sys/types.h> include <sys/socket.h> include <stdio.h> include <netinet/in.h> include <arpa/inet.h> include <unistd.h> int main() { int sockfd int len struct sockaddr_in address int result char ch = A sockfd = socket(AF_INET, SOCK_STREAM, 0) address.sin_family = AF_INET address.sin_addr.s_addr = inet_addr("127.0.0.1") address.sin_port = 9734 len = sizeof(address) result = connect(sockfd, (struct sockaddr *)&address, len) if(result == -1) { perror("oops: client") exit(1) } write(sockfd, &ch, 1) read(sockfd, &ch, 1) printf("char from server = c\n", ch) close(sockfd) exit(0) }
上傳時間: 2017-07-29
上傳用戶:wab1981
learningMatlab PhÇ n 1 c¬ së Mat lab Ch ¬ ng 1: Cµ i ® Æ t matlab 1.1.Cµ i ® Æ t ch ¬ ng tr×nh: Qui tr×nh cµ i ® Æ t Matlab còng t ¬ ng tù nh viÖ c cµ i ® Æ t c¸ c ch ¬ ng tr×nh phÇ n mÒ m kh¸ c, chØ cÇ n theo c¸ c h íng dÉ n vµ bæ xung thª m c¸ c th« ng sè cho phï hî p. 1.1.1 Khë i ® éng windows. 1.1.2 Do ch ¬ ng tr×nh ® î c cÊ u h×nh theo Autorun nª n khi g¾ n dÜ a CD vµ o æ ® Ü a th× ch ¬ ng tr×nh tù ho¹ t ® éng, cö a sæ
標簽: learningMatlab 172 199 173
上傳時間: 2013-12-20
上傳用戶:lanwei