本页文章导读:
▪HDU1358:Period Problem Description
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i <= N) we want to know.........
▪关于信号发生器的相位误差 %关于相位误差
clear
close all
clc
fs=100; %采样率
fc=10; %载波
fpe=1; %相位噪声
t=0:1/fs:100;
c_pe=cos(2*pi*fpe*t);
c_c=cos(2*pi*fc*t);
c_cpe=cos(2*pi*fc*t+c_pe);
C_C=fft(c_c);
C_C=abs(C_C)/length(C_C);
C_CPE=fft(c_cpe);
C_CPE=abs(C.........
▪关于Java程序调用Lotus Notes邮件服务发送邮件的实现(三补充
关于Java程序调用Lotus Notes邮件服务发送邮件的实现(三补充)
程序运行前,还需要注册用户,建立配置文件等操作:
一、注册用户
1. 注册notes 系统用户(假设用户登录名称为:kk/jhh.........
[1]HDU1358:Period
Problem Description
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <= i <= N) we want to know the
largest K > 1 (if there is one) such that the prefix of S with length i can be written as AK , that is A concatenated K times, for some string A. Of course, we also want to know the period K.
Input
The input file consists of several test cases. Each test case consists of two lines. The first one contains N (2 <= N <= 1 000 000) – the size of the string S. The second line contains the string S. The input file ends with a line,
having the number zero on it.
Output
For each test case, output “Test case #” and the consecutive test case number on a single line; then, for each prefix with length i that has a period K > 1, output the prefix size i and the period K separated by a single space; the
prefix sizes must be in increasing order. Print a blank line after each test case.
Sample Input
Sample Output
Test case #1
2 2
3 3
Test case #2
2 2
6 2
9 3
12 4
//一开始完全没有看懂题目的意思,就是说从字符串的第二个开始,看前面是循环串吗,是的话就输出此时的位置,和循环串的周期,周期必须大于1
/*
对next的理解更深入了点儿。
字符编号从0开始,那么if(i%(i-next[i])==0),则i前面的
串为一个轮回串,其中轮回子串出现i/(i-next[i])次。
*/
#include <string.h>
#include <iostream>
#include <stdio.h>
char str[1000005];
int next[1000005];
void getnext()
{
int i = 0,j = -1;
memset(next,0,sizeof(next));
next[0] = -1;
while (str[i])
{
if(j == -1 || str[i] == str[j])
{
i++;
j++;
next[i] = j;
}
else
j = next[j];
}
}
void kmp()
{
int i,t;
for(i = 2;str[i-1];i++)
{
t = i-next[i];
if(i%t == 0 && i/t>1)
printf("%d %d\n",i,i/t);
}
}
int main()
{
int n,cnt = 1;
while(scanf("%d",&n)!=EOF && n)
{
scanf("%s",str);
printf("Test case #%d\n",cnt++);
getnext();
kmp();
putchar(10);
}
return 0;
}
作者:libin56842 发表于2013-1-13 16:51:53 原文链接
阅读:35 评论:0 查看评论
[2]关于信号发生器的相位误差
%关于相位误差
clear
close all
clc
fs=100; %采样率
fc=10; %载波
fpe=1; %相位噪声
t=0:1/fs:100;
c_pe=cos(2*pi*fpe*t);
c_c=cos(2*pi*fc*t);
c_cpe=cos(2*pi*fc*t+c_pe);
C_C=fft(c_c);
C_C=abs(C_C)/length(C_C);
C_CPE=fft(c_cpe);
C_CPE=abs(C_CPE)/length(C_CPE);
F=linspace(0,fs,length(t));
N=floor(length(F)/2);
plot(F(1:N),C_C(1:N),'r');
hold on
plot(F(1:N),C_CPE(1:N));
set(gca,'xtick',[0:1:F(N)]);
grid on;
作者:adream307 发表于2013-1-13 16:51:23 原文链接
阅读:31 评论:0 查看评论
[3]关于Java程序调用Lotus Notes邮件服务发送邮件的实现(三补充
关于Java程序调用Lotus Notes邮件服务发送邮件的实现(三补充)
程序运行前,还需要注册用户,建立配置文件等操作:
一、注册用户
1. 注册notes 系统用户(假设用户登录名称为:kk/jhh),并使其拥有发送邮件的权限。
2. 获取是服务器上 Domino Directory 中该用户KK的 Person 文档BASIC选项卡中
的用户名(kk/jhh,也是KK用户的Notes客户端登录名)
3. 获取该用户的密码,密码必须是同一Person文档BASIC选项卡中的Internet密码值。
4. 获取该用户kk的Person文档BASIC选项卡中Mail file值(如mail\kk)
二、 配置测试程序
在SRC目录建立Mail.properties文件,
\Mail.properties示例:
dominoServerName= dominoServer/jhh
host=10.30.100.98:63148
userName=kk/jhh
password=kk
recipientsAdress=mm/jhh@dommain01,admin/jhh@dommain01,kk/jhh@dommain01
userFilePath=mail/kk.nsf
字段介绍:
dominoServerName字段:domino服务器的名称;
host字段:Domino服务器主机的IP地址(或域名)+”:” + DIIOP服务的端口号
(IP地址见服务器 Server 文档 Baiscs 选项卡的“Fully qualified Internet host name”字段)
userName字段:已注册的notes 系统用户的用户名(如kk/jhh);
(服务器中该用户KK的 Person 文档BASIC选项卡中的用户名)
password字段:该用户的Internet密码;
(同一Person文档BASIC选项卡中的Internet密码值)
userFilePath字段:该用户的Person文档BASIC选项卡中Mail file值(如mail\kk)+.nsf;
recipientsAdress字段:notes系统中收件人的地址(多个收件人以逗号隔开,不加空格)
原文转载自站长网http://www.software8.co/wzjs/java/2583.html
配置完成后,,即可运行测试程序,发送消息到指定的收件人。
至此,该问题已完结,分享给需要的人!
作者:ssoftware 发表于2013-1-13 16:48:52 原文链接
阅读:36 评论:0 查看评论