//颜色初始化 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-10
上传用户: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