第一篇:Q2V8程序計算器輸入數據操作方法
Q2V8程序計算器輸入數據操作方法(1);
連續交點平曲線與豎曲線三維坐標正反算步驟;
進入 1 菜單
按 MENU2 進入 列表模式
按 SHIFTSET UP 設置串列文件(List File;File 1--6)
按F1設置(輸入串列文件 號碼;1--6 中的一個)
清除當前選定串列的數據;
按 MENU1進入RUNMAT模式
按 SHIFTPRGM調出程序功能菜單
清除命令; F6F1F3回車(清除了當前串列的全部數據)
(1)平曲線
按 MENU2進入 列表模式(輸入平曲線數據)
List 1List2List3List4List5List6List7(起點樁號)(起點X坐標)(起點Y坐標)(入口緩曲參數)(圓曲半徑)(出口緩曲參數)(交點轉)(不輸入)(交點X坐標)(交點Y坐標)(入口緩曲參數)(圓曲半徑)(出口緩曲參數)(交點轉角)
.....................(不輸入)(終點X坐標)(終點Y坐標)
按 MENU9進入選擇執行 Q2V8程序界面回車
輸入1(只計算平曲線數據)XY(1)/H(2)/XYH(3)=?
顯示出;平曲線總的交點個數(不包含起終點)hor-total JD num= 輸入0(重新計算平曲線數據)new(0)/old(≠0)hor-JD data=?
顯示出;輸入平曲線 起點的交點號 hor-curve start JD num=?
輸入0(要計算的起點的交點號)(機器開始計算等待.........)
查看計算的結果按 MENU2進入 列表模式(計算按結果如下JD1---JDn)List 1List2List3List4List5List6List7
(起點樁號)(起點X坐標)(起點Y坐標)(入口緩曲參數)(圓曲半徑)(出口緩曲參數)(交點轉角)(交點樁號)(交點X坐標)(交點Y坐標)(入口緩曲參數)(圓曲半徑)(出口緩曲參數)(交點轉角)
.....................(終點X坐標)(終點Y坐標)
查看轉角值(度分秒)也就是(弧度制變 角度制);
按OPTNF6F2F5
第二篇:23. 模擬計算器數字輸入及顯示
23. 模擬計算器數字輸入及顯示
1. 實驗任務
(1. 開機時,顯示“0”
(2. 第一次按下時,顯示“D1”;第二次按下時,顯示“D1D2”;第三按下時,顯示“D1D2D3”,8個全顯示完畢,再按下按鍵下時,給出“嘀”提示音。
2. 電路原理圖
圖4.23.1 3. 系統板上硬件連線
(1. 把“單片機系統”區域中的P1.0端口用導線連接到“音頻放大模塊”區域中的SPK IN端口上;
(2. 把“單片機系統“區域中的P3.0-P3.7端口用8芯排線連接到“4X4行列式鍵盤”區域中的C1-C4 R1-R4端口上;(3. 把“單片機系統”區域中的P0.0-P0.7端口用8芯排線連接到“動態數碼顯示”區域中的A-H端口上;
(4. 把“單片機系統:區域中的P2.0-P2.7端口用8芯排線連接到“動態數碼顯示”區域中的S1-S8端口上; 4. 相關程序設計內容
(1. 行列式鍵盤輸入及按鍵功能設定;(2. 動態數碼顯示;(6#include 3..
數
C
碼
顯語
示
言
方
式源
處
程
理
; 序
char char
code
char
dispbitcode[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
dispbuf[8]={0,16,16,16,16,16,16,16};
char dispbitcount;
char char char char
temp;i,j;
key;keypos;alarmflag;
*p,unsigned
char
count)while(count>0){ *(p+count)=*(p+count-1);count--;} } void { TMOD=0x01;TH0=(65536-4000)TL0=(65536-4000)TR0=1;ET0=1;EA=1;
/ %
main(void)
256;256;while(1){ P3=0xff;P3_4=0;temp=P3;temp=temp if { for(i=50;i>0;i--)for(j=200;j>0;j--);temp=P3;temp=temp if { temp=P3;temp=temp switch(temp){ case key=7;break;case key=8;break;case key=9;break;case key=10;break;} if((key>=0){ keypos++;if(keypos<8){ change(dispbuf,keypos);dispbuf[0]=key;} else { keypos=8;alarmflag=1;}
&
&
& &&
0x0f;
(temp!=0x0f)
0x0f;
(temp!=0x0f)
0x0f;
0x0e:
0x0d:
0x0b:
0x07:(key<10))} temp=P3;P1_0=~P1_0;temp=temp while(temp!=0x0f){ temp=P3;temp=temp } alarmflag=0;} }
P3=0xff;P3_5=0;temp=P3;temp=temp if { for(i=50;i>0;i--)for(j=200;j>0;j--);temp=P3;temp=temp if { temp=P3;temp=temp switch(temp){ case key=4;break;case key=5;break;case key=6;break;case key=11;break;} if {((key>=0)
& &
&
&
& &&
0x0f;
0x0f;
0x0f;
(temp!=0x0f)
0x0f;
(temp!=0x0f)
0x0f;
0x0e:
0x0d:
0x0b:
0x07:(key<10))keypos++;if(keypos<8){ change(dispbuf,keypos);dispbuf[0]=key;} else { keypos=8;alarmflag=1;} } temp=P3;P1_0=~P1_0;temp=temp while(temp!=0x0f){ temp=P3;temp=temp } alarmflag=0;} }
P3=0xff;P3_6=0;temp=P3;temp=temp if { for(i=50;i>0;i--)for(j=200;j>0;j--);temp=P3;temp=temp if { temp=P3;temp=temp switch(temp){ case key=1;break;case
&
& &
&
&
0x0f;
0x0f;
0x0f;
(temp!=0x0f)
0x0f;
(temp!=0x0f)
0x0f;
0x0e:
0x0d: key=2;break;case key=3;break;case key=12;break;} if((key>=0){ keypos++;if(keypos<8){ change(dispbuf,keypos);dispbuf[0]=key;} else { keypos=8;alarmflag=1;} } temp=P3;P1_0=~P1_0;temp=temp while(temp!=0x0f){ temp=P3;temp=temp } alarmflag=0;} }
P3=0xff;P3_7=0;temp=P3;temp=temp if { for(i=50;i>0;i--)for(j=200;j>0;j--);temp=P3;
&&
&
& &
0x0b:
0x07:
(key<10))
0x0f;
0x0f;
0x0f;
(temp!=0x0f)temp=temp if { temp=P3;temp=temp switch(temp){ case key=0;break;case key=13;break;case key=14;break;case key=15;break;} if((key>=0){ keypos++;if(keypos<8){ change(dispbuf,keypos);dispbuf[0]=key;} else { keypos=8;alarmflag=1;} } temp=P3;P1_0=~P1_0;temp=temp while(temp!=0x0f){ temp=P3;temp=temp } alarmflag=0;}
& & && & & 0x0f;
(temp!=0x0f)
0x0f;
0x0e:
0x0d:
0x0b:
0x07:
(key<10))
0x0f;
0x0f;} } } void t0(void)
interrupt { TH0=(65536-4000)/ TL0=(65536-4000)
% P0=dispcode[dispbuf[dispbitcount]];P2=dispbitcode[dispbitcount];dispbitcount++;if { dispbitcount=0;} if { P1_1=~P1_1;} }
using
0
256;256;
(dispbitcount==8)
(alarmflag==1)
第三篇:cakePHP常用數據操作方法總結
CakePHP常用數據操作方法總結
0.測試相關信息
1.數據表(1)zmkm_tests Id int(11)primary key Name char(10)Password char(32)Type tinyint(2)(2)zmkm_relations Id int(11)primary key Test_id int(11)Content text 2.Model:Test,Relation 3.Controller:test,relation 一.查詢
1.find($type,$params)I.$params,查詢的限制條件,格式如下
$params = array('conditions' => array('SQL中的where條件'), 'fields' => array('查詢字段'), 'order' => array('排序字段,SQL中的order by 條件'), 'group' => array('分組字段,SQL中的group by 條件'), 'limit' => 'm,n',// 查詢記錄條數,SQL中limit 'page' =>'n' // 還有recursive和callbacks等不常用的參數,略過);
II.$type,查詢的類型
(1)$type = 'first',find的默認參數,查找符合條件的第一條數據.示例1: 查找數據表中第一條記錄
$lists = $this->Test->find();SQL:SELECT `Test`.`Id`, `Test`.`name`, `Test`.`password`, `Test`.`type` FROM `zmkm_tests` AS `Test`
WHERE 1 = 1
LIMIT 1
結果: $lists = array([“Test”]=>
array(“Id”=>“1”
“name”=>“37892533”
“password”=>“2f441e566f1bbb7d1faaf32e85035048”
“type”=>“3”))示例2:查找一條type=1的記錄
$lists = $this->Test->find('first',array('conditions'=>array('Test.type' => '1')));SQL:SELECT `Test`.`Id`, `Test`.`name`, `Test`.`password`, `Test`.`type` FROM `zmkm_tests` AS `Test`
WHERE `Test`.`type` = 1
LIMIT 1
結果:$lists = array(“Test”=>
array(“Id”=>“3”
“name”=>“37892533”
“password”=>“5997124ee980322f8a62a758dda4deee”
“type”=>“1”))
(2)$type = 'all',查找所有符合條件的記錄 示例:查找所有type為[1,2,3]的記錄
$lists = $this->Test->find('all',array('conditions' => array('Test.type' => array('1','2','3'))));SQL:SELECT `Test`.`Id`, `Test`.`name`, `Test`.`password`, `Test`.`type` FROM `zmkm_tests` AS `Test`
WHERE `Test`.`type` IN(1, 2, 3)
結果: $lists = array(0 => array('Test'=>array('id'=>1,'name'=>.....)), 1=>array(.....)...);
(3)$type = 'list',返回一個索引數組,key第一列字段,若不指定fields,則value為第二列的字段
示例:查找 10 $condition = array('conditions'=>array('Test.id Between ? And ? ' => array(10,20)), 'order' => 'Test.type desc');$lists = $this->Test->find('list',$condition);SQL:SELECT `Test`.`id`, `Test`.`name` FROM `zmkm_tests` AS `Test` WHERE `Test`.`id` Between 10 And 20 ORDER BY `Test`.`type` DESC 結果: $lists = array('12' => '47192536' , '10'=>'68192536' ,.....); (4)$type = 'count' , 計數,返回一個整數 示例:查找type!=(1,2)的記錄條數 $con['conditions'] = array('not'=>array('Test.type' =>array(1,2)));$num = $this->Test->find('count',$con);SQL:SELECT COUNT(*)AS `count` FROM `zmkm_tests` AS `Test` WHERE NOT(`Test`.`type` IN(1, 2)) 結果: int(14)(5)$type = 'neighbors',查詢符合條件的記錄的前后兩條記錄 示例:查找id=33 且滿足 type<3 的前后兩條記錄 $condition = array('field' => 'id',// *(必須 篩選字段) 'value' => '33', // *(必須 field的值) 'conditions' => array('type < ' => '3'),'fields'=> 'id,name,type', // *(必須 查找字段)); $lists = $this->Test->find('neighbors',$condition);SQL:執行兩條SQL: Query: SELECT `Test`.`id`, `Test`.`name`, `Test`.`type` FROM `zmkm_tests` AS `Test` WHERE `type` < 3 AND `Test`.`id` < '33' ORDER BY `Test`.`id` DESC LIMIT 1 Query: SELECT `Test`.`id`, `Test`.`name`, `Test`.`type` FROM `zmkm_tests` AS `Test` WHERE `type` < 3 AND `Test`.`id` > '33' ORDER BY `Test`.`id` ASC LIMIT 1 結果: array(2){ “prev”=> array(“Test”=>rray(“id”=>“32”,“name”=>“44392536”,“type”=>“2”)) “next”=> array(“Test”=>array(“id”=>“39”,“name”=>“14292536”,“type”=>“1”))) 2.findByField($params):通過字段查找記錄,只返回一條記錄,函數名需要用駝峰式書寫 示例1:通過數據表中的id查找 $lists = $this->Test->findById('3');SQL:SELECT `Test`.`Id`, `Test`.`name`, `Test`.`password`, `Test`.`type` FROM `zmkm_tests` AS `Test` WHERE `Test`.`id` ='3' LIMIT 1 結果:略 示例2:通過數據表中的type查找 $lists = $this->Test->findByType(array('3','5','7')); SQL:SELECT `Test`.`Id`, `Test`.`name`, `Test`.`password`, `Test`.`type` FROM `zmkm_tests` AS `Test` WHERE `Test`.`type` IN('3', '5', '7')LIMIT 1 結果:略 注:對于數據表中類似“user_status”的字段,方法名為findByUserStatus()3.Field($field,$condition),查找一個字段,函數返回字段值 示例:查找id=34的password $password = $this->Test->field('password',array('Test.id'=>'34'));SQL:SELECT `Test`.`password` FROM `zmkm_tests` AS `Test` WHERE `Test`.`id` = '34' LIMIT 1 結果: string(32)“2f441e566f1bbb7d1faaf32e85035048” 二.添加數據 1.save($data),插入一條記錄,返回以model名為key值的$data數組(1).$data中無數據表的主鍵對應的字段值,則插入一條新紀錄 示例:插入一條記錄 $data = array('name' => 'zhongsou','passowrd' => md5(time()),'type' => rand(0,9));$this->Test->save($data);$lastInsertId = $this->Test->id; // 插入的一條記錄的id SQL: INSERT INTO `zmkm_tests`(`name`, `password`, `type`)VALUES('zhongsou', '0674ab9bda247f85a5e4aa49ecb73b38', 9) 注:如果$data中存在數據表中沒有的字段,則插入時忽略(2).saveAll($data),插入單個模型的多條記錄,或者是該模型的關聯記錄 A.向同一個model插入多條記錄,在cakePHP手冊中介紹有誤,$data數組的格式應該如下: $data = array('0' => array('name' => 'abc' , 'password' => 'b2c'), '1' => array('name' => '123' , 'password' => 'p2p'));或者: $data = array('0' => array('Test' =>array('name' => 'abc' , 'password' => 'b2c')), '1' => array('Test' => array('name' => '123' , 'password' => 'p2p')));SQL:執行多條insert語句 B.插入關聯記錄,新建關聯表M_relation,test_id為外鍵,關聯M_test(id),關聯關系為一對一(hasOne),關聯關系需要在model中定義,$data數據格式 $data = array('Relation' => array('test_id' => 3020,'content' => 'www.tmdps.cnMIT (3).$data中有數據表的主鍵對應的字段值,則修改該記錄的相應字段值 $data['Test'] = array('id' => '78','name' => 'zhongsou','password' => md5(time()),'type' => rand(0,9));$this->Test->save($data);$updataId = $this->Test->id; // 修改的記錄的id SQL:執行兩條SQL,進行插入和更新的判斷 SELECT COUNT(*)AS `count` FROM `zmkm_tests` AS `Test` WHERE `Test`.`id` = '78' UPDATE `zmkm_tests` SET `name` = 'zhongsou', `password` = '2816c19a87b69d758799054dc8b4cc2e', `type` = 9 WHERE `zmkm_tests`.`id` = '78' 三.修改 1.updateAll($data,$condition),更改所有符合條件的記錄 示例:修改name字段 $data = array('name' => “'souhu'”);$condition = array('Test.name' => 'zhongsou');$result = $this->Test->updateAll($data,$condition);SQL:UPDATE `zmkm_tests` AS `Test` SET `Test`.`name` = 'souhu' WHERE 'Test'.`name` = 'zhongsou' 2.saveField('field',$value),修改一個字段值,需要先指定id 示例:修改id=89 的name $this->Test->id = 89;$this->Test->saveField('name','other');SQL:UPDATE `zmkm_tests` SET `name` = 'other' WHERE `zmkm_tests`.`id` = 89 四.刪除 1.delete(),刪除一條記錄,需要先指定id,返回boolean 示例:刪除id=105的記錄 $this->Test->id = '106';$result = $this->Test->delete();SQL: SELECT COUNT(*)AS `count` FROM `zmkm_tests` AS `Test` WHERE `Test`.`id` = '106' DELETE `Test` FROM `zmkm_tests` AS `Test` WHERE `Test`.`id` = '106' 2.deleteAll($condition),刪除多條記錄,$condition為刪除條件 示例:刪除id>100 & type!= [1,2,3] 的記錄 $condition = array('id >' => 100, 'not' => array('type'=>array('1','2','3')));$this->Test->deleteAll($condition);SQL: 分成兩條SQL執行的 SELECT `Test`.`id` FROM `zmkm_tests` AS `Test` WHERE `id` > 100 AND NOT(type IN(1, 2, 3))DELETE `Test` FROM `zmkm_tests` AS `Test` WHERE `Test`.`id` IN('102', '103', '104') 附:若把cakePHP的debug設為2依然無法在頁面上打印SQL語句,則可以通過調用如下方法: /** * 獲取SQL執行的日志 * return array */ function printSQL(){ $sources = ConnectionManager::sourceList();$logs = array();foreach($sources as $source){ $db =& ConnectionManager::getDataSource($source); if(!$db->isInterfaceSupported('getLog'))continue; $logs[$source] = $db->getLog();} return $logs;} SAS學習總結 一、SAS的數據錄入 (1)直接輸入 data first; input name $ salary; datalines;a 12b 34c 56d 78 ; run; 注意:datalines的位置以及數據錄入后的分號 (2)借助infile可讀入文本格式為dat、txt、csv A.最簡單的形式 data first; infile 'c:userslichaodesktopsasdatatoadjump.dat'; input Toadname $ Jump1 Jump2 Jump3 Jump4; run; proc print data=work.first; run; B.有空格的情況,需要數一下 data second; infile 'c:userslichaodesktopsasdataonionring.dat'; input Name $ 1-19 Jump1 22-24 Jump2 25-28 Jump3 30-31 Jump4 33-34 Jump5 37 Jump6 40; run; proc print data=work.second; run; C.格式重復的情況 data third; infile 'c:userslichaodesktopsasdataexercise.dat'; input Num1 Num2 Num3 @@; run; proc print data=work.third; run; 注意:@@的用法 D.其他的格式 Ⅰ.輸出特定的行 data icecream; infile 'c:userslichaodesktopsasdataicecreamsales2.dat' firstobs=3 obs=5; input Flavor $ 1-9 Location Boxessold; run; proc print data=icecream; run; 注意:firstobs和obs的位置不要改變,而且兩者可以單獨使用 Ⅱ.有缺失值 data class; infile 'c:userslichaodesktopsasdataallscores.dat' missover; run; proc print data=class; run; 注意:在有缺失值的情況下,如果輸出有錯誤的話就用missover Ⅲ.非正常的輸入: data third; infile 'c:userslichaodesktopsasdatapumpkin.dat'; input Name $16.num 3.type $2.date $11.(num1 num2 num3 num4 num5)(4.1);run; proc print data=third; run; 注意:16.和3.、4.1等的表示方法,都是表示寬度,相比較數列數的方法更有效;輸入格式相同的話可以加括號把格式寫在后面的括號里。 Ⅳ.日期的輸入: 按照數值處理,根據情況,使用MMDDYYw.或者 DDMMYYw.(3)import 錄入其他格式的文件(可導入的格式非常多) proc import datafile='c:userslichaodesktopsasdatasecond.xls' dbms=xls out=mydata replace;sheet=“sheet1$”; range=“a1:b3”; run; proc print data=mydata; run; 注意:sheet表示單元表的名字,range表示導入的數據范圍 input name $ test1 test2 test3 test4 test5; 學生體質健康數據上報簡要操作流程 寧夏海原縣三河鎮中心小學 孟范軍 打開“學生體質健康網”——登錄本校 第一步 新增一年級班:學校基本信息設置——年級班級管理——新增一年級班 第二步 填寫新增學生信息:學生體測數據管理——學生基本信息導入——下載學生基本信息模板——填寫新增學生信息——選擇文件(學生基本信息模板)——導入(系統) 第三步 填寫體測模板:學生體測數據管理——學生體測成績導入——下載體測模版——刪除減少學生——分發到各班——進行體質測試,填寫測試數據——收集匯總數據——刪除免測學生 第四步 填寫導入測試環境信息模板:學校基本信息設置——測試環境信息——模版導入——下載模板——填寫內容(要填寫完整)——模版導入——選擇文件——導入 第五步 導入體測模板:學生體測數據管理——學生體測成績導入——選擇文件(本校體測模板)——導入(注意:不要急于上報!!) 第六步 成績測算及上報:按F5刷新頁面,在學生體測數據管理中查看學生成績——數據下載(評分),統計優秀、良好、及格、不及格人數,計算達標率,如果達標率高于85%,則進入“學生體測數據上報”環節——上報。如果達標率低于85%,則考慮測試工具是否準確,測試方法是否有誤,如果都沒問題,讓學生繼續鍛煉一個階段,重新測試。 關鍵提示:1.學生基本信息只導入新增學生,如一年級學生、轉入的學生。如無學籍,用L+身份證號代替。2.復學的學生:系統中學生信息更新慢,可能默認在復學前班級,上傳學生基本信息模板和體測模板時系統提示“此學籍號與年級標號不對應,請核實學生所對應的年級編號”,可登錄系統——學生體測數據管理——輸入該生學籍號——搜索(查詢到該生信息)——在學生基本信息模板里更改學生年級、班級信息,與網上保持一致。3.各模版中班級編號、班級名稱要一致。 4.學生來源不填寫,填寫身份證號有可能導致上傳時發生錯誤,一般不填寫。 5.出生日期用《由身份證或學籍號自動生成出生日期表格》生成,簡便快捷。如果仍出現錯誤提示,則用查找、替換方式,將日期中的“-”或“/”再次替換。 6.在輸入任何數據時,請避免使用空格鍵。在輸入姓名、等成績等數據時,為了對齊,會習慣性地使用空格鍵,導致輸入數據錯誤,不能上傳。 7.測試信息模板中所有信息要填寫完整,否則上傳數據會被退回。第四篇:SAS數據輸入總結
第五篇:學生體質健康數據上報簡要操作方法[范文]