現在位置: 首頁 > cssi7136發表的所有文章
  • 04月
  • 21日
編程語言 ⁄ 共 2492字 評論關閉
       今天起開始總結下MATLAB的文件操作函數。MATLAB的確用起來很方便,前提是你了解它的函數~       MATLAB的幫助文檔看的那叫一個似懂非懂啊,特此總結。對我而言, fread的主要調用形式是這樣的:       data = fread(fid, N, 'str')        fid不用說,自然是文件句柄(如fid=fopen('abc.txt' ,'r')),N是讀入的元素個數,'str'是格式。在以前不會用的時候,格式都是直接省略的,這個時候函數就一個字節一個字節地從文件中讀入數據,再在MATLAB中轉化為double形式。       如果文件時二進制文件,這樣讀當然沒問題,......
閱讀全文
  • 05月
  • 25日
綜合 ⁄ 共 176字 評論關閉
UIAlertView *myAlert = [[UIAlertView alloc]initWithTitle:@"顯示時間" message:tmpStr delegate:self cancelButtonTitle:@"取消" otherButtonTitles:nil];   //AlertView彈出    [myAlert show];  
閱讀全文
  • 05月
  • 18日
綜合 ⁄ 共 1367字 評論關閉
最近客戶那邊說,有個sqlserver的存儲過程耗時太長,內存佔用率大,效率低下,希望我改進一下,以前對sql的存儲過程沒什麼研究,這裡轉載了一位朋友的文章,做個總結,然後準備綜合根據此文章中介紹的方法來進行優化,希望能有一定的效果。 優化存儲過程有很多種方法,下面介紹最常用的7種。 1.使用SET NOCOUNT ON選項 我們使用SELECT語句時,除了返回對應的結果集外,還會返回相應的影響行數。使用SET NOCOUNT ON後,除了數據集就不會返回額外的信息了,減小網絡流量。 2.使用確定的Schema 在使用表,存儲過程,函數等等時......
閱讀全文
  • 04月
  • 15日
綜合 ⁄ 共 459字 評論關閉
題目描述:編寫一程序,從鍵盤輸入一個不超過40個字符的串,然後逆序輸出。 分析:循環輸入,每次輸入判斷是否為回車,是則結束,否則字符進棧,使用一個寄存器保存輸入的字符數,以便輸入完成後修改出棧次數,完成逆序。 代碼: stack segment dw 100 dup(?) top label word stack ends code segment start: assume ss:stack,cs:code mov ax,stack mov ss,ax mov sp,offset top mov cx,40 ;次數控制 mov bx,0 loop1: mov ah,01H int 21h cmp al,0DH ......
閱讀全文
  • 04月
  • 09日
綜合 ⁄ 共 334字 評論關閉
document.onkeydown = function(e){ // alert(1) var keycode = ""; if(navigator.appName == "Microsoft Internet Explorer") { keycode = event.keyCode; // var realkey = String.fromCharCode(event.keyCode); }else{ keycode = e.which; // var realkey = String.fromCharCode(e.which); } if(keycode == "27"){ // alert(27) $.pdialog.closeCurrent() } // alert("按鍵碼: " + keycode + "字符: " + ......
閱讀全文
  • 04月
  • 04日
綜合 ⁄ 共 873字 評論關閉
題目鏈接:Click here~~ 題意: 給一個長度為 n 的 {0,1} 序列 {an},w 次詢問。 每次詢問關於區間 [l,r] 和定值 k,在首項為 l + k-1 且公差為 k 的項上全變為1,而其他項全變為0 所需的步數。 每步只能對一個元素進行改變。 思路: 首先,原問題其實等價於求出這些等差序列中的項和其他項分別含有多少個 0 和 1。 由於 k 是定值,而詢問的對象有個共同的規律,公差為 k,意味着它們對 k 的餘數一定相同。 於是可以根據 k 的餘數進行分組,原序列中的每個元素一定落且僅落在一個組內,再對原序列和分好組的序列分別維護......
閱讀全文
  • 02月
  • 21日
綜合 ⁄ 共 1564字 評論關閉
求從左上角到右下角所經過的數字之積末尾所含0最小的個數 最終的積可以看成A*2^x*5^y,0的個數就是x,y中較小的數, 所以只需要分別dp求出出現2,5的最小個數,再進行比較,選最小的一個 題目有個陷進: 就是給的數據可以為0,如果出現0的話,經過0這點的話結果為0,就是1個0, 如果不經過0的話,答案可能為0也可能>=1,所以只要求出不經過0出現最小0的個數跟1比較, 如果大於1的話,最小的就是經過0的答案,否則就不經過0. #include<stdio.h> #include<string.h> #define N 1001 #define inf 0x3fffffff int d......
閱讀全文
  • 02月
  • 14日
綜合 ⁄ 共 790字 評論關閉
NSString *name = userNameTF.text;         NSString *str = passWordTF.text;                 //使用base64對NSString對象編碼         NSData *nsdata = [str dataUsingEncoding:NSUTF8StringEncoding];         NSString *pass = [nsdata base64EncodedStringWithOptions:0];                   NSString *url = [NSString stringWithFormat:@"%@padweb/l?user=%@&pwd=%@",kbaseURL,name,pass]; -----------------   NSString *username = [contentArray objectAtIndex:2];             NSStri......
閱讀全文
  • 02月
  • 10日
綜合 ⁄ 共 6178字 評論關閉
So you're building an Android app, and you want your app to display its build number on an About screen. You want the build number to be a unique identifier like the Subversion revision number. That's easy, you say: I'll build a simple About screen, put a TextView in it, and use Subversion keyword substitution, like this: package com.kasperowski.example; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.TextView; public class Build......
閱讀全文
  • 02月
  • 08日
綜合 ⁄ 共 4328字 評論關閉
1編譯CCCommon.cpp 提示信息: [armeabi] Compile++ thumb: cocos2dx_static <= CCCommon.cpp D:/cocos2D/cocos2d-2.0-x-2.0.4/cocos2d-2.0-x-2.0.4/samples/HelloCpp/proj.android/../../../cocos2dx/platform/android/CCCommon.cpp: In function 'void cocos2d::CCLog(char const*, ...)': D:/cocos2D/cocos2d-2.0-x-2.0.4/cocos2d-2.0-x-2.0.4/samples/HelloCpp/proj.android/../../../cocos2dx/platform/android/CCCommon.cpp:44:72: error: format not a string literal and no format arguments [-Werror=format-securit......
閱讀全文
  • 11月
  • 27日
綜合 ⁄ 共 7771字 評論關閉
以下是滇狐收集和整理的一些有用的 VIM 插件, 大部分插件都有自己詳細的說明書, 因此這裡就不詳細介紹每個插件的安裝和使用方法了。 通過這些插件, VIM 能夠變成一個非常強大的平台, Happy VIMming! 如果想詳細了解默認的插件插件安裝路徑, 請看這裡。 1 程序設計 1.1 Tag List 下載地址: 官方站點 官方描述: The “Tag List” plugin is a source code browser plugin for Vim and provides an overview of the structure of source code files and allows you to efficiently browse through source code files for differ......
閱讀全文
  • 11月
  • 19日
綜合 ⁄ 共 1504字 評論關閉
如果要查看磁盤還剩多少空間,當然是用df的命令了。 [root@localhost ~]# df -h  文件系統              容量 已用 可用 已用% 掛載點  /dev/sda2              14G   11G 2.6G 82% /  /dev/sda1              99M   14M   81M 14% /boot  tmpfs                 442M 275M 168M 63% /dev/shm  /dev/mapper/vg_test-lv_test                         24M 1.3M   21M   6% /mnt/lvm  [root@localhost ~]# 當然你可能並不關係磁盤還剩餘多少空間,你是需要知道當前的文件夾下的磁盤使用情況: [root@localhost ~]# du --max-depth=1 ......
閱讀全文