版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、線性預(yù)測(cè)與Levinson-Dubin 算法實(shí)現(xiàn),移動(dòng)端實(shí)現(xiàn)右側(cè)字母 A-Z的滑動(dòng)觸摸選擇 映射遠(yuǎn)程端口到本地Shell/ 批處理用shell將svn的提交信息生成運(yùn)維使用的更新文檔Shell/批處理用SQL語句斷開某個(gè)數(shù)據(jù)庫的所有活動(dòng)連接SQL,用udp的方式傳輸文字,用于填寫支付密碼的textfieldint query() / 掃描int index, len, result;node *p = root; /Trie入 口result = 0;len = strlen(str);for(int i = 0; i nextindex = NULL & p != root) /跳轉(zhuǎn)失敗指針
2、p = p-fail;p = p-nextindex;if(p = NULL)p = root;node *temp = p; /p不動(dòng),temp計(jì)算后綴串while(temp != root & temp-count != -1) result += temp-count;temp-count = -1;temp = temp-fail; return result;/使用Qt仿寫系統(tǒng)記事本/圖片輪播器,定時(shí)器使用GCD/網(wǎng)頁版的簡易跳舞機(jī)int main()int num;while(1)head= tail = 0;scanf(%d, &num);if (num = 0) break;r
3、oot = new node();getchar();for(int i = 0; i num; +i)(gets(keyword);insert(keyword);build_ac();scanf(%s, str);printf(%dn, query();return 0;/下拉菜單鼠標(biāo)鍵盤事件/元素?fù)?jù)指定html適配移動(dòng)設(shè)備/原生js當(dāng)前時(shí)間以及倒計(jì)時(shí)package mainimport (io/ioutilnet/http net/fmtencoding/json)/黃金數(shù)據(jù)調(diào)用示例代碼-聚合數(shù)據(jù)/ 在線接口文檔:www/docs/29/const APPKEY =*您申請(qǐng)的APPKEY
4、func main()/1.上海黃金交易所Request1()/2.上海期貨交易所Request2()/3.銀行賬戶黃金Request3()/1.上海黃金交易所func Request1()/請(qǐng)求地址juhe :=web:8080/finance/gold/shgold/初始化參數(shù)param:=.Values/ 配置請(qǐng)求參數(shù),方法內(nèi)部已處理encode問題,中文參數(shù)可以直接傳參 param.Set(key,APPKE丫)APP Keyparam.Set(v,)/JSON格式版本(0 或 1)默認(rèn)為 0/發(fā)送請(qǐng)求data,err:=Get(juhe,param)if err!=nilfmt.Er
5、rorf( 請(qǐng)求失敗,錯(cuò)誤信息:rn%v,err)elsevar netReturn mapstringinterfacejson.Unmarshal(data,&netReturn)if netReturnerror_code.(float64)=0fmt.Printf(接口返回 result 字段是:rn%v,netReturnresult)/2.上海期貨交易所func Request2()/請(qǐng)求地址juhe :=web:8080/finance/gold/shfuture/初始化參數(shù)param:=.Values/ 配置請(qǐng)求參數(shù),方法內(nèi)部已處理encode問題,中文參數(shù)可以直接傳參 par
6、am.Set(key,APPKE丫)APP Keyparam.Set(v,)/JSON格式版本(0 或 1)默認(rèn)為 0/發(fā)送請(qǐng)求data,err:=Get(juhe,param)if err!=nilfmt.Errorf( 請(qǐng)求失敗,錯(cuò)誤信息:rn%v,err)elsevar netReturn mapstringinterfacejson.Unmarshal(data,&netReturn)if netReturnerror_code.(float64)=0fmt.Printf(接口返回 result 字段是:rn%v,netReturnresult) /3.銀行賬戶黃金func Reque
7、st3()/ 請(qǐng)求地址juhe kweb:8080/finance/gold/bankgold/初始化參數(shù)param:=.Values/配置請(qǐng)求參數(shù),方法內(nèi)部已處理encode問題,中文參數(shù)可以直接傳參param.Set(key,APPKE丫)APP Key/ 發(fā)送請(qǐng)求data,err:=Get(juhe,param)if err!=nilfmt.Errorf(請(qǐng)求失敗,錯(cuò)誤信息:rn%v,err)else var netReturn mapstringinterface json.Unmarshal(data,&netReturn) if netReturnerror_code.(float
8、64)=0fmt.Printf(接口返回 result 字段是:rn%v,netReturnresult) / get網(wǎng)絡(luò)請(qǐng)求func Get(api string,params .Values)(rsbyte ,err error) var *.,err=.Parse(api)if err!=nilfmt.Printf(解析錯(cuò)誤:rn%v,err)return nil,err /如果參數(shù)中有中文參數(shù),這個(gè)方法會(huì)進(jìn)行Encode.RawQuery=params.Encode() resp,err:=http.Get(.String() if err!=nilfmt.Println(err:,e
9、rr)return nil,err)defer resp.Body.Close()return ioutil.ReadAll(resp.Body)/ post 網(wǎng)絡(luò)請(qǐng)求,params 是.Values 類型func Post(api string, params .Values)(rsbyte,err error)resp,err:=http.PostForm(api, params)if err!=nilreturn nil ,err)defer resp.Body.Close()return ioutil.ReadAll(resp.Body)代碼描述:基于 GO勺黃金數(shù)據(jù)接口調(diào)用代碼實(shí)例關(guān)
10、聯(lián)數(shù)據(jù):黃金數(shù)據(jù)代碼C#代碼using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Net;using System.IO;using Xfrog.Net;using System.Diagnostics;using System.Web;/黃金數(shù)據(jù)調(diào)用示例代碼-聚合數(shù)據(jù)/ 在線接口文檔:www/docs/29/ 代碼中 JsonObject 類下載地址:/download/gcm3206021155665/7458439/namespace ConsoleAP
11、Iclass Programstatic void Main(string args)appkeystring appkey = *”;配置您申請(qǐng)的/1.上海黃金交易所string 1 = web:8080/finance/gold/shgold;var parameters1 = new Dictionary();parameters1.Add(key, appkey);/你申請(qǐng)的 keyparameters1.Add(v , ); /JSON格式版本(0 或 1)默認(rèn)為 0string result1 = sendPost(1, parameters1, get);JsonObject n
12、ewObj1 = new JsonObject(result1); String errorCode1 = newObj1error_code.Value;if (errorCode1 = 0) Debug.WriteLine(成功);Debug.WriteLine(newObj1); else /Debug.WriteLine(失敗);Debug.WriteLine(newObj1error_code.Value+:+newObj1reason.Value); /2.上海期貨交易所string 2 = web:8080/finance/gold/shfuture;var parameters
13、2 = new Dictionary();parameters2.Add(key, appkey);/你申請(qǐng)的 keyparameters2.Add(v , ); /JSON格式版本(0 或 1)默認(rèn)為 0string result2 = sendPost(2, parameters?, get);JsonObject newObj2 = new JsonObject(result2); String errorCode2 = newObj2error_code.Value;if (errorCode2 = 0) Debug.WriteLine(成功);Debug.WriteLine(newO
14、bj2); else/Debug.WriteLine(Debug.WriteLine(newObj2error_code.Value+:+newObj2reason.Value); )/3.銀行賬戶黃金string 3 = web:8080/finance/gold/bankgold;var parameters3 = new Dictionary();parameters3.Add(key, appkey);/你申請(qǐng)的 keystring result3 = sendPost(3, parameters3, get);JsonObject newObj3 = new JsonObject(r
15、esult3);String errorCode3 = newObj3error_code.Value;if (errorCode3 = 0)(Debug.WriteLine(成功);Debug.WriteLine(newObj3);) else ( /Debug.WriteLine(失敗);Debug.WriteLine(newObj3error_code.Value+:+newObj3reason.Value); )/ / Http (GET/POST)/ / 請(qǐng)求 / 請(qǐng)求參數(shù) / 請(qǐng)求方法 / 響應(yīng)內(nèi)容 static string sendPost(string , IDictiona
16、ry parameters, string method)(if (method.ToLower() = post)(HttpWebRequest req = null;HttpWebResponse rsp = null;System.IO.Stream reqStream = null;try(req = (HttpWebRequest)WebRequest.Create();req.Method = method;req.KeepAlive = false;req.ProtocolVersion = HttpVersion.Version10;req.Timeout = 5000;req
17、.ContentType =application/x-www-form-encoded;charset=utf-8;byte postData =Encoding.UTF8.GetBytes(BuildQuery(parameters, utf8);reqStream = req.GetRequestStream();reqStream.Write(postData, 0, postData.Length);rsp = (HttpWebResponse)req.GetResponse();Encoding encoding = Encoding.GetEncoding(rsp.Charact
18、erSet);return GetResponseAsString(rsp, encoding);catch (Exception ex)(return ex.Message; finally(if (reqStream != null) reqStream.Close();if (rsp != null) rsp.Close();else(/創(chuàng)建請(qǐng)求HttpWebRequestrequest = (HttpWebRequest)WebRequest.Create( + ?+ BuildQuery(parameters, utf8);/GET請(qǐng)求request.Method = GET;req
19、uest.ReadWriteTimeout = 5000;request.ContentType = text/html;charset=UTF-8;HttpWebResponse response =(HttpWebResponse)request.GetResponse();Stream myResponseStream = response.GetResponseStream();StreamReadermyStreamReader = new StreamReader(myResponseStream,Encoding.GetEncoding(utf-8);/返回內(nèi)容string re
20、tString = myStreamReader.ReadToEnd();return retString;/ /組裝普通文本請(qǐng)求參數(shù)。/ / Key-Value形式請(qǐng)求參數(shù)字典 / 編碼后的 t# 求數(shù)據(jù) static string BuildQuery(IDictionary parameters, string encode)StringBuilder postData = new StringBuilder();bool hasParam = false;IEnumeratorKeyValuePair dem = parameters.GetEnumerator();while (de
21、m.MoveNext()string name = dem.Current.Key;string value = dem.Current.Value;/忽略參數(shù)名或參數(shù)值為空的參數(shù)if(!string.IsNullOrEmpty(name)/& !string.IsNullOrEmpty(value) if (hasParam) postData.Append(&);postData.Append(name);postData.Append(=);if (encode = gb2312)postData.Append(HttpUtility.Encode(value, Encoding.Get
22、Encoding(gb2312); else if (encode = utf8) postData.Append(HttpUtility.Encode(value,Encoding.UTF8); ) else postData.Append(value);)hasParam = true;)return postData.ToString();)Ill Ill把響應(yīng)流轉(zhuǎn)換為文本。III III 響應(yīng)流對(duì)象 III 編碼方式 III 響應(yīng)文本 static string GetResponseAsString(HttpWebResponse rsp, Encoding encoding) Sy
23、stem.IO.Stream stream = null;StreamReader reader = null;tryII以字符流的方式讀取 HTTP響應(yīng)stream = rsp.GetResponseStream();reader = new StreamReader(stream, encoding);return reader.ReadToEnd();) finally釋放資源ll if (reader != null) reader.Close();if (stream != null) stream.Close();if (rsp != null) rsp.Close();)代碼PH
24、P代碼I* c遠(yuǎn)程傳輸工具*I public function post_c($,$body,$header,$type=POST)$ch = c_init();c_setopt($ch,COPT_,$);c_setopt($ch,COPT_HEADER,0);0只要正文c_setopt($ch,COPT_TIMEOUT,5);設(shè)置超時(shí)時(shí)間c_setopt($ch,COPT_CONNECTTIMEOUT,5);/將c_exec()獲取的信息以文件流的形式返回,而不是直接輸出。c_setopt($ch,COPT_RETURNTRANSFER,1);/增加header頭信息/ array_push
25、($header,Accept:application/json);/ array_push($header,Content-Type:application/json);/ array_push($header,http:multipart/form-data);if(count($body)0)c_setopt($ch,COPT_POSTFIELDS,$body);if(count($header)0)c_setopt($ch,COPT_HTTPHEADER,$header);/設(shè)置上傳文件相關(guān)c_setopt($ch,COPT_FOLLOWLOCATION,true);c_setopt(
26、$ch,COPT_MAXREDIRS,3);/ 遞歸c_setopt($ch,COPT_SSL_VERIFYPEER,false);對(duì)認(rèn)證證書來源的檢查c_setopt($ch,COPT_SSL_VERIFYHOST,0);從證書中檢查 SSL 加密算法switch ($type) case GET:c_setopt($ch,COPT_HTTPGET,1);break;case POST:c_setopt($ch,COPT_POST,1);break;case PUT:c_setopt($ch,COPT_CUSTOMREQUEST,PUT);break;case DELETE:c_setopt
27、($ch,COPT_CUSTOMREQUEST,DELETE); break;/上傳文件相關(guān)設(shè)置c_setopt($ch,COPT_ENCODING,gzip);c_setopt($ch,COPT_USERAGENT,SSTS Browser/1.0);c_setopt($ch,COPT_USERAGENT,Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0;Trident/4.0);/模擬用戶使用的瀏覽器if(c_errno($ch)return c_error($ch);$content = c_exec($ch);c_close($ch);
28、/ 關(guān)閉c資源,并且釋放系統(tǒng)資源$result = json_decode($content,true);if(!empty($result)return $result;elsereturn $content;代碼C/C+代碼/*編譯指令$ /opt/sybase/OCS-16_0/bin/cpre64 -m teststu.cp$ cc -m64 -g -DSYB_LP64 -I. -I/opt/sybase/OCS-16_0/include teststu.c/opt/sybase/OCS-16_0/include/sybesql.c -L/opt/sybase/OCS-16_0/lib
29、 -lsybct64-lsybtcl64 -lsybcs64 -lsybcomn64 -lsybintl64 -lsybunic64 -rdynamic -ldl -lnsl -lm-o teststu*/#include /*建立通訊區(qū)域*/EXEC SQL INCLUDE SQLCA;/* These tokens must be declared in a declare section* because they are used in declare sections below.*/EXEC SQL BEGIN DECLARE SECTION;#define TYPESIZE 13
30、#define TIDSIZE 6EXEC SQL END DECLARE SECTION;#define EOLN 0/* Forward declarations of the error and message handlers and* other subroutines called from main().*/void error_handler();void warning_handler();intmain(int argc, char *argv口)/*聲明宿主變量*/EXEC SQL BEGIN DECLARE SECTION;/* storage for login na
31、me and password. */char username30;char sname30;char password30;char server30;EXEC SQL END DECLARE SECTION;/*錯(cuò)誤處理*/EXEC SQL WHENEVER SQLERROR CALL error_handler();EXEC SQL WHENEVER SQLWARNING CALL warning_handler();EXEC SQL WHENEVER NOT FOUND CONTINUE;/*連接至ij SQL SERVER服務(wù)器*/* Copy the user name and
32、password defined in sybsqlex.h to* the variables declared for them in the declare section.*/strcpy(username, mymotif);strcpy(password, wxwpxh);strcpy(server, MYMOTIFVOSTRO145480);EXEC SQL CONNECT :username IDENTIFIED BY :password using :server;EXEC SQL USE testdb;EXEC SQL DECLARE cl CURSOR FORSELECT
33、 SNAME FROM STUDENT;EXEC SQL OPEN c1;printf(name in table studentn);do EXEC SQL FETCH cl INTO :sname;if (sqlca.sqlcode != 0) break;printf( student name = %sn, sname ); while ( 1 );EXEC SQL CLOSE c1;return(0);/*錯(cuò)誤處理程序*/* void error_handler()* Displays error codes and numbers from the SQLCA and exits
34、with* an ERREXIT status.*/voiderror_handler(void)(fprintf(stderr, n* SQLCODE=(%ld), sqlca.sqlcode);if (sqlca.sqlerrm.sqlerrml)(fprintf(stderr, n* ASE Error );fprintf(stderr, n* %s, sqlca.sqlerrm.sqlerrmc);fprintf(stderr, nn);exit(-1);/* void warning_handler()* Displays warning messages.*/voidwarning
35、_handler(void)(if (sqlca.sqlwarn1 = W)(fprintf(stderr,n* Data truncated.n);if (sqlca.sqlwarn3 = W)(fprintf(stderr,n* Insufficient host variables to store results.n);return;代碼Log4j配置org.slf4jslf4j-log4j12導(dǎo)入這個(gè)包,會(huì)引入下面兩個(gè)jarorg.springframeworkspring-context-supportcommons-loggingcommons-logging-api1.1org.springframeworkspring-orm!-當(dāng) spring-config.xml 文件中配置 需要力入止匕包-org.aspectjaspectjweaverorg.sp
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年無人機(jī)物流配送效率創(chuàng)新報(bào)告及未來五至十年智慧物流報(bào)告
- 2026年智能冰箱保鮮技術(shù)報(bào)告及未來五至十年家電技術(shù)報(bào)告
- 《網(wǎng)絡(luò)文學(xué)IP影視改編中的改編劇本改編與影視傳播》教學(xué)研究課題報(bào)告
- 2026年元宇宙虛擬世界報(bào)告及未來五至十年數(shù)字經(jīng)濟(jì)報(bào)告
- 初中教師數(shù)字教學(xué)能力提升策略與培訓(xùn)課程評(píng)價(jià)體系構(gòu)建教學(xué)研究課題報(bào)告
- 2025年智慧養(yǎng)殖物聯(lián)網(wǎng)技術(shù)驅(qū)動(dòng)牧場管理提升行業(yè)報(bào)告
- 2025年農(nóng)產(chǎn)品區(qū)域公用品牌維權(quán)報(bào)告
- 安全用電防雷知識(shí)課件
- 2026年智能清潔設(shè)備越障系統(tǒng)項(xiàng)目項(xiàng)目建議書
- 安全用電電器培訓(xùn)課件
- 冬季駕駛車輛安全培訓(xùn)
- 施工項(xiàng)目高效人員配置與設(shè)備管理方案
- 采血后預(yù)防淤青的按壓方式
- 醫(yī)學(xué)師承出師考核申請(qǐng)表
- 光伏電站基礎(chǔ)知識(shí)500題及答案
- 深度學(xué)習(xí):從入門到精通(微課版)全套教學(xué)課件
- 晚期癌癥疼痛控制課件
- 2025年云南省職教高考電工技術(shù)類《電工基礎(chǔ)理論知識(shí)》考試復(fù)習(xí)題庫(含答案)
- 《護(hù)理學(xué)導(dǎo)論》課程標(biāo)準(zhǔn)
- 醫(yī)師手術(shù)授權(quán)與動(dòng)態(tài)管理制度
- 3d和值怎么算最準(zhǔn)確范文
評(píng)論
0/150
提交評(píng)論