The literature of cryptography has a curious history. Secrecy, of course, has always played a central
role, but until the First World War, important developments appeared in print in a more or less
timely fashion and the field moved forward in much the same way as other specialized disciplines.
As late as 1918, one of the most influential cryptanalytic papers of the twentieth century, William F.
Friedman’s monograph The Index of Coincidence and Its Applications in Cryptography, appeared as
a research report of the private Riverbank Laboratories [577]. And this, despite the fact that the work
had been done as part of the war effort. In the same year Edward H. Hebern of Oakland, California
filed the first patent for a rotor machine [710], the device destined to be a mainstay of military
cryptography for nearly 50 years.
function [U,center,result,w,obj_fcn]= fenlei(data)
[data_n,in_n] = size(data)
m= 2 % Exponent for U
max_iter = 100 % Max. iteration
min_impro =1e-5 % Min. improvement
c=3
[center, U, obj_fcn] = fcm(data, c)
for i=1:max_iter
if F(U)>0.98
break
else
w_new=eye(in_n,in_n)
center1=sum(center)/c
a=center1(1)./center1
deta=center-center1(ones(c,1),:)
w=sqrt(sum(deta.^2)).*a
for j=1:in_n
w_new(j,j)=w(j)
end
data1=data*w_new
[center, U, obj_fcn] = fcm(data1, c)
center=center./w(ones(c,1),:)
obj_fcn=obj_fcn/sum(w.^2)
end
end
display(i)
result=zeros(1,data_n) U_=max(U)
for i=1:data_n
for j=1:c
if U(j,i)==U_(i)
result(i)=j continue
end
end
end
made by: kangkai
data:2008.11.23
this one is used to test arm7 str71x.
use a led to test GPIO.
a---------P0.0
b---------P0.1
c---------P0.2
d---------P0.3
e---------P0.4
f---------P0.5
g---------P0.6
just run it and you will see the led to show 0-9 all the time.
【目的】 設(shè)計一個算符優(yōu)先分析器,理解優(yōu)先分析方法的原理。
【要求】 使用算符優(yōu)先分析算法分析下面的文法:
E’ → #E#
E → E+T | T
T → T*F | F
F → P^F | P
P → (E) | i
其中i可以看作是一個終結(jié)符,無需作詞法分析。具體要求如下:
1. 如果輸入符號串為正確句子,顯示分析步驟,包括分析棧中的內(nèi)容、優(yōu)先關(guān)系、輸入符號串的變化情況;
2. 如果輸入符號串不是正確句子,則指示出錯位置。