軟件質(zhì)量是被大多數(shù)程序員掛在嘴上而不是放在心上的東西! 除了完全外行和真正的編程高手外,初讀本書,你最先的感受將是驚慌:“哇!我 以前捏造的 除了完全外行和真正的編程高手外,初讀本書,你最先的感受將是驚慌:“哇!我 以前捏造的 C++/ C 程序怎么會(huì)有那么多的毛病?” 。 別難過,作者只不過比你早幾年、多幾次驚慌而已。 面 請花一兩個(gè)小時(shí)認(rèn)真閱讀這本百頁經(jīng)書,你將會(huì)獲益匪淺,這是前面 1 N- 1 個(gè)讀者的 建議。
上傳時(shí)間: 2016-08-13
上傳用戶:lansedeyuntkn
批處理感知器算法的代碼matlab w1=[1,0.1,1.1;1,6.8,7.1;1,-3.5,-4.1;1,2.0,2.7;1,4.1,2.8;1,3.1,5.0;1,-0.8,-1.3; 1,0.9,1.2;1,5.0,6.4;1,3.9,4.0]; w2=[1,7.1,4.2;1,-1.4,-4.3;1,4.5,0.0;1,6.3,1.6;1,4.2,1.9;1,1.4,-3.2;1,2.4,-4.0; 1,2.5,-6.1;1,8.4,3.7;1,4.1,-2.2]; w3=[1,-3.0,-2.9;1,0.5,8.7;1,2.9,2.1;1,-0.1,5.2;1,-4.0,2.2;1,-1.3,3.7;1,-3.4,6.2; 1,-4.1,3.4;1,-5.1,1.6;1,1.9,5.1]; figure; plot(w3(:,2),w3(:,3),'ro'); hold on; plot(w2(:,2),w2(:,3),'b+'); W=[w2;-w3];%增廣樣本規(guī)范化 a=[0,0,0]; k=0;%記錄步數(shù) n=1; y=zeros(size(W,2),1);%記錄錯(cuò)分的樣本 while any(y<=0) k=k+1; y=a*transpose(W);%記錄錯(cuò)分的樣本 a=a+sum(W(find(y<=0),:));%更新a if k >= 250 break end end if k<250 disp(['a為:',num2str(a)]) disp(['k為:',num2str(k)]) else disp(['在250步以內(nèi)沒有收斂,終止']) end %判決面:x2=-a2*x1/a3-a1/a3 xmin=min(min(w1(:,2)),min(w2(:,2))); xmax=max(max(w1(:,2)),max(w2(:,2))); x=xmin-1:xmax+1;%(xmax-xmin): y=-a(2)*x/a(3)-a(1)/a(3); plot(x,y)
上傳時(shí)間: 2016-11-07
上傳用戶:a1241314660
#define TM1638_STB PORTC_Bit1 #define TM1638_CLK PORTC_Bit2 #define TM1638_DIO_IN DDRC_Bit3=0 #define TM1638_DIO_OUT DDRC_Bit3=1 #define TM1638_DIO PORTC_Bit3 #define TM1638_DIO_DataIN PINC_Bit3 void TM1638_Write(unsigned char DATA) //寫數(shù)據(jù)函數(shù) { unsigned char i; TM1638_DIO_OUT; for(i=0;i<8;i++) { TM1638_CLK=0; delay_us(1); if(DATA&0X01) TM1638_DIO=1; else TM1638_DIO=0; DATA>>=1; TM1638_CLK=1; delay_us(1); } } unsigned char TM1638_Read(void) //讀數(shù)據(jù)函數(shù) { unsigned char i; unsigned char temp=0; TM1638_DIO_IN; for(i=0;i<8;i++) { temp>>=1; TM1638_CLK=0; delay_us(1); if(TM1638_DIO_DataIN==1) temp|=0x80; TM1638_CLK=1; delay_us(1); } return temp; }
標(biāo)簽: 驅(qū)動(dòng) TM1638
上傳時(shí)間: 2017-01-12
上傳用戶:ds68
RealView Developer Suite v2.2 破解 (2009-12-11) 使用RealView Developer Suite v2.2,傳說中的RVDS 2.2,破解也有問題,經(jīng)過我琢磨。 破解步驟修改如下: 1)用generate產(chǎn)生license file (注意自己的系統(tǒng)時(shí)間 最好是真實(shí)的當(dāng)前時(shí)間,如果時(shí)間比較舊的話,產(chǎn)生的license file 將不能注冊。license file 和系統(tǒng)時(shí)間、網(wǎng)卡物理地址、硬盤的序列號有關(guān)) 2)安裝軟件 3)license Wizard 選 Install Wizard ... 選擇license file 目錄 4)應(yīng)用補(bǔ)丁注入工具Patch.exe給下邊列出的文件注入校驗(yàn)和。文件目錄見下邊。 從這個(gè)論壇下載說明少了4個(gè)文件路徑,導(dǎo)致的結(jié)果就是無法啟動(dòng)調(diào)試部分。 關(guān)于 no license check out 以上作完了就加載一個(gè)*.axf文件實(shí)驗(yàn)吧,看看還有沒有no license check out ,這時(shí)你在看軟件注冊信息 Enjoy ;-) Install, apply our patch then generate license file with the keygen. ------------- the files need to be patched: %Install Path%\IDEs\CodeWarrior\CodeWarrior\5.6.1\1592\win_32-pentium\bin\Plugins\License\oemlicense.dll %Install Path%\IDEs\CodeWarrior\RVPlugins\1.0\86\win_32-pentium\oemlicense\oemlicense.dll %Install Path%\RDI\armsd\1.3.1\66\win_32-pentium\armsd.exe %Install Path%\RDI\AXD\1.3.1\98\win_32-pentium\axd.exe %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armasm.exe %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armcc.exe %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armcpp.exe %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\armlink.exe %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\fromelf.exe %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\tcc.exe %Install Path%\RVCT\Programs\2.2\349\win_32-pentium\tcpp.exe %Install Path%\RVD\Core\1.8\734\win_32-pentium\bin\tvs.exe %Install Path%\RVD\Core\1.8\734\win_32-pentium\bin\xry100.dll
上傳時(shí)間: 2017-01-18
上傳用戶:zbxinu
The AP2406 is a 1.5Mhz constant frequency, slope compensated current mode PWM step-down converter. The device integrates a main switch and a synchronous rectifier for high efficiency without an external Schottky diode. It is ideal for powering portable equipment that runs from a single cell lithium-Ion (Li+) battery. The AP2406 can supply 600mA of load current from a 2.5V to 5.5V input voltage. The output voltage can be regulated as low as 0.6V. The AP2406 can also run at 100% duty cycle for low dropout operation, extending battery life in portable system. Idle mode operation at light loads provides very low output ripple voltage for noise sensitive applications. The AP2406 is offered in a low profile (1mm) 5-pin, thin SOT package, and is available in an adjustable version and fixed output voltage of 1.2V, 1.5V and 1.8V
上傳時(shí)間: 2017-02-23
上傳用戶:w124141
設(shè)有二元函數(shù) f(x,y) = f(x) + f(y) 其中: f(x) = f(x-1) * x (x >1) f(x)=1 (x=1) f(y) = f(y-1) + f(y-2) (y> 2) f(y)=1 (y=1,2) 請編程建立 3 個(gè)并發(fā)協(xié)作進(jìn)程,它們分別完成 f(x,y)、f(x)、f(y)
上傳時(shí)間: 2017-04-21
上傳用戶:WWSAE
取各障礙物頂點(diǎn)連線的中點(diǎn)為路徑點(diǎn),相互連接各路徑點(diǎn),將機(jī)器人移動(dòng)的起點(diǎn)和終點(diǎn)限制在各路徑點(diǎn)上,利用最短路徑算法來求網(wǎng)絡(luò)圖的最短路徑,找到從起點(diǎn)P1到終點(diǎn)Pn的最短路徑。上述算法使用了連接線中點(diǎn)的條件,因此不是整個(gè)規(guī)劃空間的最優(yōu)路徑,然后利用遺傳算法對找到的最短路徑各個(gè)路徑點(diǎn)Pi (i=1,2,…n)調(diào)整,讓各路徑點(diǎn)在相應(yīng)障礙物端點(diǎn)連線上滑動(dòng),利用Pi= Pi1+ti×(Pi2-Pi1)(ti∈[0,1] i=1,2,…n)即可確定相應(yīng)的Pi,即為新的路徑點(diǎn),連接此路徑點(diǎn)為最優(yōu)路徑。
標(biāo)簽: 遺傳算法 路徑規(guī)劃 matlab
上傳時(shí)間: 2017-05-05
上傳用戶:tttt123
用迭代法求方程 x3-x2-1=0 在[1.3, 1.6]內(nèi)的一個(gè)實(shí)根,選初值x0 =1.3,迭代一步。
標(biāo)簽: gggggg
上傳時(shí)間: 2017-05-09
上傳用戶:mic0000
/****************temic*********t5557***********************************/ #include <at892051.h> #include <string.h> #include <intrins.h> #include <stdio.h> #define uchar unsigned char #define uint unsigned int #define ulong unsigned long //STC12C2051AD的SFR定義 sfr WDT_CONTR = 0xe1;//stc2051的看門狗?????? /**********全局常量************/ //寫卡的命令 #define write_command0 0//寫密碼 #define write_command1 1//寫配置字 #define write_command2 2//密碼寫數(shù)據(jù) #define write_command3 3//喚醒 #define write_command4 4//停止命令 #define TRUE 1 #define FALSE 0 #define OK 0 #define ERROR 255 //讀卡的時(shí)間參數(shù)us #define ts_min 250//270*11.0592/12=249//取近似的整數(shù) #define ts_max 304//330*11.0592/12=304 #define t1_min 73//90*11.0592/12=83:-10調(diào)整 #define t1_max 156//180*11.0592/12=166 #define t2_min 184//210*11.0592/12=194 #define t2_max 267//300*11.0592/12=276 //***********不采用中斷處理:采用查詢的方法讀卡時(shí)關(guān)所有中斷****************/ sbit p_U2270B_Standby = P3^5;//p_U2270B_Standby PIN=13 sbit p_U2270B_CFE = P3^3;//p_U2270B_CFE PIN=6 sbit p_U2270B_OutPut = P3^7;//p_U2270B_OutPut PIN=2 sbit wtd_sck = P1^7;//SPI總線 sbit wtd_si = P1^3; sbit wtd_so = P1^2; sbit iic_data = P1^2;//lcd IIC sbit iic_clk = P1^7; sbit led_light = P1^6;//測試綠燈 sbit led_light1 = P1^5;//測試紅燈 sbit led_light_ok = P1^1;//讀卡成功標(biāo)志 sbit fengmingqi = P1^5; /***********全局變量************************************/ uchar data Nkey_a[4] = {0xA0, 0xA1, 0xA2, 0xA3};//初始密碼 //uchar idata card_snr[4]; //配置字 uchar data bankdata[28] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7}; //存儲(chǔ)卡上用戶數(shù)據(jù)(1-7)7*4=28 uchar data cominceptbuff[6] = {1,2,3,4,5,6};//串口接收數(shù)組ram uchar command; //第一個(gè)命令 uchar command1;// //uint temp; uchar j,i; uchar myaddr = 8; //uchar ywqz_count,time_count; //ywqz jishu: uchar bdata DATA; sbit BIT0 = DATA^0; sbit BIT1 = DATA^1; sbit BIT2 = DATA^2; sbit BIT3 = DATA^3; sbit BIT4 = DATA^4; sbit BIT5 = DATA^5; sbit BIT6 = DATA^6; sbit BIT7 = DATA^7; uchar bdata DATA1; sbit BIT10 = DATA1^0; sbit BIT11 = DATA1^1; sbit BIT12 = DATA1^2; sbit BIT13 = DATA1^3; sbit BIT14 = DATA1^4; sbit BIT15 = DATA1^5; sbit BIT16 = DATA1^6; sbit BIT17 = DATA1^7; bit i_CurrentLevel;//i_CurrentLevel BIT 00H(Saves current level of OutPut pin of U2270B) bit timer1_end; bit read_ok = 0; //緩存定時(shí)值,因用同一個(gè)定時(shí)器 union HLint { uint W; struct { uchar H;uchar L; } B; };//union HLint idata a union HLint data a; //緩存定時(shí)值,因用同一個(gè)定時(shí)器 union HLint0 { uint W; struct { uchar H; uchar L; } B; };//union HLint idata a union HLint0 data b; /**********************函數(shù)原型*****************/ //讀寫操作 void f_readcard(void);//全部讀出1~7 AOR喚醒 void f_writecard(uchar x);//根據(jù)命令寫不同的內(nèi)容和操作 void f_clearpassword(void);//清除密碼 void f_changepassword(void);//修改密碼 //功能子函數(shù) void write_password(uchar data *data p);//寫初始密碼或數(shù)據(jù) void write_block(uchar x,uchar data *data p);//不能用通用指針 void write_bit(bit x);//寫位 /*子函數(shù)區(qū)*****************************************************/ void delay_2(uint x) //延時(shí),時(shí)間x*10us@12mhz,最小20us@12mhz { x--; x--; while(x) { _nop_(); _nop_(); x--; } _nop_();//WDT_CONTR=0X3C;不能頻繁的復(fù)位 _nop_(); } ///////////////////////////////////////////////////////////////////// void initial(void) { SCON = 0x50; //串口方式1,允許接收 //SCON =0x50; //01010000B:10位異步收發(fā),波特率可變,SM2=0不用接收到有效停止位才RI=1, //REN=1允許接收 TMOD = 0x21; //定時(shí)器1 定時(shí)方式2(8位),定時(shí)器0 定時(shí)方式1(16位) TCON = 0x40; //設(shè)定時(shí)器1 允許開始計(jì)時(shí)(IT1=1) TH1 = 0xfD; //FB 18.432MHz 9600 波特率 TL1 = 0xfD; //fd 11.0592 9600 IE = 0X90; //EA=ES=1 TR1 = 1; //啟動(dòng)定時(shí)器 WDT_CONTR = 0x3c;//使能看門狗 p_U2270B_Standby = 0;//單電源 PCON = 0x00; IP = 0x10;//uart you xian XXXPS PT1 PX1 PT0 PX0 led_light1 = 1; led_light = 0; p_U2270B_OutPut = 1; } /************************************************/ void f_readcard()//讀卡 { EA = 0;//全關(guān),防止影響跳變的定時(shí)器計(jì)時(shí) WDT_CONTR = 0X3C;//喂狗 p_U2270B_CFE = 1;// delay_2(232); //>2.5ms /* // aor 用喚醒功能來防碰撞 p_U2270B_CFE = 0; delay_2(18);//start gap>150us write_bit(1);//10=操作碼讀0頁 write_bit(0); write_password(&bankdata[24]);//密碼block7 p_U2270B_CFE =1 ;// delay_2(516);//編程及確認(rèn)時(shí)間5.6ms */ WDT_CONTR = 0X3C;//喂狗 led_light = 0; b.W = 0; while(!(read_ok == 1)) { //while(p_U2270B_OutPut);//等一個(gè)穩(wěn)定的低電平?超時(shí)判斷? while(!p_U2270B_OutPut);//等待上升沿的到來同步信號檢測1 TR0 = 1; //deng xia jiang while(p_U2270B_OutPut);//等待下降沿 TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1;//定時(shí)器晚啟動(dòng)10個(gè)周期 //同步頭 if((324 < a.W) && (a.W < 353)) ;//檢測同步信號1 else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } //等待上升沿 while(!p_U2270B_OutPut); TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1;//b.N1<<=8; if(a.B.L < 195);//0.5p else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } //讀0~7塊的數(shù)據(jù) for(j = 0;j < 28;j++) { //uchar i; for(i = 0;i < 16;i++)//8個(gè)位 { //等待下降沿的到來 while(p_U2270B_OutPut); TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1; if(t2_max < a.W/*)&&(a.W < t2_max)*/)//1P { b.W >>= 2;//先左移再賦值 b.B.L += 0xc0; i++; } else if(t1_min < a.B.L/*)&&(a.B.L < t1_max)*/)//0.5p { b.W >>= 1; b.B.L += 0x80; } else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } i++; while(!p_U2270B_OutPut);//上升 TR0 = 0; a.B.H = TH0; a.B.L = TL0; TH0 = TL0 = 0; TR0 = 1; if(t2_min < a.W/*)&&(a.W < t2_max)*/)//1P { b.W >>= 2; i++; } else if(t1_min < a.B.L/*a.W)&&(a.B.L < t1_max)*/)//0.5P //else if(!(a.W==0)) { b.W >>= 1; //temp+=0x00; //led_light1=0;led_light=1;delay_2(40000); } else { TR0 = 0; TH0 = TL0 = 0; goto read_error; } i++; } //取出奇位 DATA = b.B.L; BIT13 = BIT7; BIT12 = BIT5; BIT11 = BIT3; BIT10 = BIT1; DATA = b.B.H; BIT17 = BIT7; BIT16 = BIT5; BIT15 = BIT3; BIT14 = BIT1; bankdata[j] = DATA1; } read_ok = 1;//讀卡完成了 read_error: _nop_(); } } /***************************************************/ void f_writecard(uchar x)//寫卡 { p_U2270B_CFE = 1; delay_2(232); //>2.5ms //psw=0 standard write if (x == write_command0)//寫密碼:初始化密碼 { uchar i; uchar data *data p; p = cominceptbuff; p_U2270B_CFE = 0; delay_2(31);//start gap>330us write_bit(1);//寫操作碼1:10 write_bit(0);//寫操作碼0 write_bit(0);//寫鎖定位0 for(i = 0;i < 35;i++) { write_bit(1);//寫數(shù)據(jù)位1 } p_U2270B_CFE = 1; led_light1 = 0; led_light = 1; delay_2(40000);//測試使用 //write_block(cominceptbuff[4],p); p_U2270B_CFE = 1; bankdata[20] = cominceptbuff[0];//密碼存入 bankdata[21] = cominceptbuff[1]; bankdata[22] = cominceptbuff[2]; bankdata[23] = cominceptbuff[3]; } else if (x == write_command1)//配置卡參數(shù):初始化 { uchar data *data p; p = cominceptbuff; write_bit(1);//寫操作碼1:10 write_bit(0);//寫操作碼0 write_bit(0);//寫鎖定位0 write_block(cominceptbuff[4],p); p_U2270B_CFE= 1; } //psw=1 pssword mode else if(x == write_command2) //密碼寫數(shù)據(jù) { uchar data*data p; p = &bankdata[24]; write_bit(1);//寫操作碼1:10 write_bit(0);//寫操作碼0 write_password(p);//發(fā)口令 write_bit(0);//寫鎖定位0 p = cominceptbuff; write_block(cominceptbuff[4],p);//寫數(shù)據(jù) } else if(x == write_command3)//aor //喚醒 { //cominceptbuff[1]操作碼10 X xxxxxB uchar data *data p; p = cominceptbuff; write_bit(1);//10 write_bit(0); write_password(p);//密碼 p_U2270B_CFE = 1;//此時(shí)數(shù)據(jù)不停的循環(huán)傳出 } else //停止操作碼 { write_bit(1);//11 write_bit(1); p_U2270B_CFE = 1; } p_U2270B_CFE = 1; delay_2(560);//5.6ms } /************************************/ void f_clearpassword()//清除密碼 { uchar data *data p; uchar i,x; p = &bankdata[24];//原密碼 p_U2270B_CFE = 0; delay_2(18);//start gap>150us //操作碼10:10xxxxxxB write_bit(1); write_bit(0); for(x = 0;x < 4;x++)//發(fā)原密碼 { DATA = *(p++); for(i = 0;i < 8;i++) { write_bit(BIT0); DATA >>= 1; } } write_bit(0);//鎖定位0:0 p = &cominceptbuff[0]; write_block(0x00,p);//寫新配置參數(shù):pwd=0 //密碼無效:即清除密碼 DATA = 0x00;//停止操作碼00000000B for(i = 0;i < 2;i++) { write_bit(BIT7); DATA <<= 1; } p_U2270B_CFE = 1; delay_2(560);//5.6ms } /*********************************/ void f_changepassword()//修改密碼 { uchar data *data p; uchar i,x,addr; addr = 0x07;//block7 p = &Nkey_a[0];//原密碼 DATA = 0x80;//操作碼10:10xxxxxxB for(i = 0;i < 2;i++) { write_bit(BIT7); DATA <<= 1; } for(x = 0;x < 4;x++)//發(fā)原密碼 { DATA = *(p++); for(i = 0;i < 8;i++) { write_bit(BIT7); DATA >>= 1; } } write_bit(0);//鎖定位0:0 p = &cominceptbuff[0]; write_block(0x07,p);//寫新密碼 p_U2270B_CFE = 1; bankdata[24] = cominceptbuff[0];//密碼存入 bankdata[25] = cominceptbuff[1]; bankdata[26] = cominceptbuff[2]; bankdata[27] = cominceptbuff[3]; DATA = 0x00;//停止操作碼00000000B for(i = 0;i < 2;i++) { write_bit(BIT7); DATA <<= 1; } p_U2270B_CFE = 1; delay_2(560);//5.6ms } /***************************子函數(shù)***********************************/ void write_bit(bit x)//寫一位 { if(x) { p_U2270B_CFE = 1; delay_2(32);//448*11.0592/120=42延時(shí)448us p_U2270B_CFE = 0; delay_2(28);//280*11.0592/120=26寫1 } else { p_U2270B_CFE = 1; delay_2(92);//192*11.0592/120=18 p_U2270B_CFE = 0; delay_2(28);//280*11.0592/120=26寫0 } } /*******************寫一個(gè)block*******************/ void write_block(uchar addr,uchar data *data p) { uchar i,j; for(i = 0;i < 4;i++)//block0數(shù)據(jù) { DATA = *(p++); for(j = 0;j < 8;j++) { write_bit(BIT0); DATA >>= 1; } } DATA = addr <<= 5;//0地址 for(i = 0;i < 3;i++) { write_bit(BIT7); DATA <<= 1; } } /*************************************************/ void write_password(uchar data *data p) { uchar i,j; for(i = 0;i < 4;i++)// { DATA = *(p++); for(j = 0;j < 8;j++) { write_bit(BIT0); DATA >>= 1; } } } /*************************************************/ void main() { initial(); TI = RI = 0; ES = 1; EA = 1; delay_2(28); //f_readcard(); while(1) { f_readcard(); //讀卡 f_writecard(command1); //寫卡 f_clearpassword(); //清除密碼 f_changepassword(); //修改密碼 } }
標(biāo)簽: 12345
上傳時(shí)間: 2017-10-20
上傳用戶:my_lcs
已知系統(tǒng)函數(shù)為H(z)=1/[(1-0.2z^-1)(1-0.3z^-1)(1+0.4z^-1)]。試用長除法求h(n)的6點(diǎn)輸出。 答案:clc;clear all;b=1;a=poly([0.2,0.3,-0.4]);x=deconv([1,zeros(1,6+4-1-1)],a)
上傳時(shí)間: 2017-10-21
上傳用戶:zhouhua
蟲蟲下載站版權(quán)所有 京ICP備2021023401號-1