//顏色初始化 if(!has_colors() || start_color() == ERR){ endwin() printf("Terminal does not support color.\n") EXIT(1) } init_pair(1, COLOR_GREEN, COLOR_BLACK) init_pair(2, COLOR_RED, COLOR_BLACK) init_pair(3, COLOR_CYAN, COLOR_BLACK) init_pair(4, COLOR_WHITE, COLOR_BLACK) init_pair(5, COLOR_MAGENTA, COLOR_BLACK) init_pair(6, COLOR_BLUE, COLOR_BLACK) init_pair(7, COLOR_YELLOW, COLOR_BLACK) //寫字符串 for(i = 1 i <= 7 i++) { attron(COLOR_PAIR(i)) printw("color pair d in normal mode\n", i) } for(i = 1 i <= 7 i++) { attron(COLOR_PAIR(i) | A_BLINK | A_UNDERLINE) printw("color pair d in normal mode\n", i) }
標簽: start_color has_colors Terminal endwin
上傳時間: 2014-01-14
上傳用戶:vodssv
//建立窗口 win1 = newwin(15, 50, 1, 1) box(win1, ACS_VLINE, ACS_HLINE) mvwprintw(win1, 2,1, "WINDOW 1") mvwprintw(win1, 4,1, "Press any key switching to window 2") win2 = newwin(15, 40, 4, 20) box(win2, ACS_VLINE, ACS_HLINE) mvwprintw(win2, 2,1, "WINDOW 2") //建立子窗口 subwin = derwin(win2, 5, 25, 4, 5) box(subwin, ACS_VLINE, ACS_HLINE) mvwprintw(subwin, 2,1, "Sub Window of Window2") //刷新屏幕 refresh() wrefresh(win1) wrefresh(win2) touchwin(win1) wrefresh(win1) getch() touchwin(win2) mvwprintw(win2, 12,1, "Press any key to EXIT...") wrefresh(win2) //等待按鍵 getch() //結束 delwin(win1) delwin(subwin) delwin(win2) endwin()
標簽: ACS_VLINE ACS_HLINE mvwprintw win
上傳時間: 2017-06-12
上傳用戶:plsee
1.建立一個抽象數據類型的二叉樹演示程序,菜單包括Creak(建樹),Traval(遍歷),LEAVES(葉子結點),DISPLAY(顯示),DESTROY(銷毀),EXIT(退出)。 2待加工的數據為字符型,在過程中鍵入.
上傳時間: 2017-06-12
上傳用戶:sxdtlqqjl
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
Java program asking the user to enter a number and will be printed out 10 times and enter a letter "x" to EXIT.
上傳時間: 2017-08-11
上傳用戶:www240697738
將編碼的差分跳頻系統等效為串行級聯碼,充分利用頻率轉移函數所產生的網格關聯信息, 采用軟輸入軟輸 算法,進行類Turbo串行迭代譯碼,能有效改善系統的誤比特性能. 此,如何實現差 分跳頻系統串行級聯結構的外編碼器和頻率轉移函數(( 函數)的匹配設計是值得深入研究的問題.基 于互信息的外信息轉移圖(EXIT)能有效預測迭代譯碼的收斂特性,并根據E xlT選擇適當的內、外碼 進行級聯.采用基于互信息的Exn、用分析差分跳頻串行級聯結構中外編碼器和G函數的外信息轉移 過程,提出了一種采用EXIT圖選擇G函數及外編碼器的方法.通過對陔l方法的理論分析和性能仿真, 結果表明,在一定的輸入先驗信息量條件下,信噪比越高,G函數輸 互信息量越大;在給定信噪比條件 下,不同G 函數劉 應的輸出互信息量隨輸入先驗信息量增長速度不同,能有效實現對性能較好的G 函 數的選擇;對于給定G甬數,在不同外編碼方式下,通過E xlT閣能得到迭代譯碼收斂的門限值;能反應 出不同編碼方式下的收斂特性的好壞,從而實現外編碼器和G函數的匹配設計.
標簽: 南京大學學報
上傳時間: 2015-04-27
上傳用戶:xiefuai
將編碼的差分跳頻系統等效為串行級聯碼,充分利用頻率轉移函數所產生的網格關聯信息, 采用軟輸入軟輸 算法,進行類Turbo串行迭代譯碼,能有效改善系統的誤比特性能. 此,如何實現差 分跳頻系統串行級聯結構的外編碼器和頻率轉移函數(( 函數)的匹配設計是值得深入研究的問題.基 于互信息的外信息轉移圖(EXIT)能有效預測迭代譯碼的收斂特性,并根據E xlT選擇適當的內、外碼 進行級聯.采用基于互信息的Exn、用分析差分跳頻串行級聯結構中外編碼器和G函數的外信息轉移 過程,提出了一種采用EXIT圖選擇G函數及外編碼器的方法.通過對陔l方法的理論分析和性能仿真, 結果表明,在一定的輸入先驗信息量條件下,信噪比越高,G函數輸 互信息量越大;在給定信噪比條件 下,不同G 函數劉 應的輸出互信息量隨輸入先驗信息量增長速度不同,能有效實現對性能較好的G 函 數的選擇;對于給定G甬數,在不同外編碼方式下,通過E xlT閣能得到迭代譯碼收斂的門限值;能反應 出不同編碼方式下的收斂特性的好壞,從而實現外編碼器和G函數的匹配設計.
標簽: G函數
上傳時間: 2015-04-27
上傳用戶:xiefuai
簡單命令使用grep等的使用 [zorro@isch ~]$ history 1 ifconfig 2 su 3 EXIT 4 ls 5 cd Desktop/ 6 ls 7 tar zxcf VMwareTools-8.4.5-324285.tar.gz 8 tar zxvf VMwareTools-8.4.5-324285.tar.gz 9 cd vmware-tools-distrib/ 10 ls 11 ./vmware-install.pl 12 su 13 ls 14 cd .. 15 ls 16 rm VMwareTools-8.4.5-324285.tar.gz 17 rm -r vmware-tools-distrib 18 ls 19 make 20 ls 21 cd redis/ 22 quit 23 ls 24 ca redis/ 25 cd redis/ 26 cd redis-2.8.17 27 make 28 cd redis-2.8.17 29 ls 30 cd redis-2.8.17 31 cd str 32 cd src 33 ls 34 ./redis-cli 35 ls 36 cd redis-2.8.17 tar.gz 37 make 38 cd src 39 ./redis-server .. /redis.conf 40 ./redis-cli 41 ./redis-server ../redis.conf 42 vi test1.sh 43 ./test1.sh 44 vi test.sh 45 ./test.sh 46 ls 47 chmod 777 test.sh 48 ./test.sh 49 vi express 50 $ grep –n ‘the’ express 51 clear 52 grep -n 'the' express 53 vi express 54 grep -n 'the' express 55 grep -vn 'the'express 56 grep -vn 'the' express 57 grep -in 'the' express 58 vi test2.c 59 grep -l 'the' *.c 60 grep -n 't[ae]st' express 61 grep -n 'oo' express 62 grep -n '[^g]oo' express 63 grep -n '[a^z]oo' express 64 grep -n '[0^9]' express 65 grep -n '^the' express 66 vi express 67 sed -e 'd' express 68 sed -e '1d' express 69 sed -e '1~7d' express 70 sed -e '$d' express 71 sed -e '1,/^$/d' express 72 ls 73 cd 74 pwd 75 history [zorro@isch ~]$
標簽: 簡單命令使用
上傳時間: 2016-05-24
上傳用戶:12345678gan
asp實現限制一個ip只能訪問一次的方法 <% '///////////////////////////////////////////////////// '// // '//作用:一個IP地址只允許訪問本頁一次 // '//引用:<!-- #include file="Check_Ip.asp" --> // '// // '///////////////////////////////////////////////////// 'Response.Charset = 936 '設置輸出編碼為簡體中文 'Response.Buffer = false '關閉緩沖區 Dim Fso,ts,IpList,Cfs '設置Cookies函數 Function SetCookie() Response.Cookies("IsBrow") = "Brow" Response.Cookies("IsBrow").Expires = Date+365 End Function '記錄IP地址函數 Function WriteIp(FileName, IpAddress) Set Fso = Server.CreateObject("Scripting.FileSystemObject") Set ts = Fso.OpenTextFile(Server.MapPath(FileName),8,true) ts.WriteLine IpAddress ts.Close Set ts = Nothing Set Fso = Nothing End Function '讀取IP地址函數 Function ReadIpList(FileName) Set Fso = Server.CreateObject("Scripting.FileSystemObject") If Not Fso.FileExists(Server.MapPath(FileName)) Then CreateFile("Iplist.txt") EXIT Function End If Set ts = Fso.OpenTextFile(Server.MapPath(FileName)) Iplist = ts.ReadAll ts.Close Set ts = Nothing Set Fso = Nothing ReadIpList = Iplist End Function '創建文件函數 Function CreateFile(FileName) Set Fso = Server.CreateObject("Scripting.FileSystemObject") Set Cfs = Fso.CreateTextFile(Server.MapPath(FileName)) Cfs.Close Set Cfs = Nothing Set Fso = Nothing End Function '關閉當前IE窗口函數(注:IE6下通過,其他瀏覽器未測試) Function CloseWindow() 'Response.Write "<script>window.location='javascript:window.opener=null;window.close();'</script>" Response.Redirect "http://www.baidu.com" End Function Ip = Request.ServerVariables("REMOTE_ADDR") '獲取瀏覽者IP地址 Cookie = Request.Cookies("IsBrow") '獲取當前Cookies 'Response.Write Cookie If Request.ServerVariables("HTTP_X_FORWARDED_FOR") <> "" Then Response.Write "本站不允許使用代理訪問" Response.End() Else If Cookie = "Brow" Then CloseWindow() Else If Instr(ReadIpList("Iplist.txt"),Ip) <>0 Then CloseWindow() Else WriteIp "Iplist.txt" , Ip End If SetCookie() End If End If %>
上傳時間: 2016-07-14
上傳用戶:helei0915
#include "string.h" #include "ctype.h" #include "stdio.h" search(char pd[]) {FILE *fp; int time=0,i=0,j=0,add[80],k=0,m; char *ch, str[900]; m=strlen(pd); if((fp=fopen("haha.txt","r"))==NULL) { printf("Cannot open this file\n"); EXIT(0); } for(;!feof(fp);i++) { str[i]=fgetc(fp); if(tolower(str[i])==tolower(pd[k])) {k++; if(k==m) if(!isalpha(i-m)&&!isalpha((str[i++]=fgetc(fp)))) { time++; add[j]=i-m+1; j++; k=0; } else k=0; } } if(time) { printf("The time is:%d\n",time); printf("The adders is:\n"); for(i=0;i
標簽: 查詢學會少年宮
上傳時間: 2016-12-29
上傳用戶:767483511