Time of Update: 2018-12-06
實現效果:添加了多條資料到ListView列表裡,在下面的文字框也對應添加“指令名稱”,當我刪除列表裡的一要資料時(可能多條),在下面的文字框也對應刪除對應的文本(文字框的顯示順序與列表不一致)。我想把刪除列表的某條資料寫成一個公用的方法,在方法刪除時,對應的文字框文本也刪除。所以想到的是用yield return.代碼如下:公用方法: public static System.Collections.IEnumerable DeleteListItem(this ListView lv)
Time of Update: 2018-12-06
c++ 11 practise -1-2013-04-12 11:09AM#include <iostream>#include <array>#include <forward_list>#include <string>#include <unordered_set>using namespace std;int main(){ array<int, 3> arr; get<0>(arr) = 1
Time of Update: 2018-12-06
Visitor模式Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-06
被調用的dll項目Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->/*dllDemo.h中*/extern "C" _declspec(dllexport) void Func(void); //介面函式宣告/*dllDemo.cpp中*/#include "dllDemo.h"extern "C" _declspec(dllexport)void
Time of Update: 2018-12-06
C++的前置處理器包括如下12個。#if #else #elif #endif #ifdef #ifndef #undef#error #line #pragma #include #define 第一行7個就是控制語句,重點在後面5個。 1. #define Code highlighting produced by Actipro CodeHighlighter (freeware)http:/
Time of Update: 2018-12-06
以下內容來源於網路,作者不明。轉自:http://advancedcj.wordpress.com/2010/06/18/c-runtime-library-5/ (接上文) 上文描述了雖然各目標模組指定了不同版本的預設標準庫但仍然連結成功的例子,接下來你將目睹因為這種不嚴謹而導致的悲慘失敗。 修改mylib.c成這個樣子: #includevoid foo(){ // just a test , don’t care memory leak _malloc_dbg( 1
Time of Update: 2018-12-06
以下內容來源於網路,作者不明。轉自:http://advancedcj.wordpress.com/2010/06/18/c-runtime-library-2/ (接上文) 四 各種C執行階段程式庫的區別 編譯器連結選項: Visual
Time of Update: 2018-12-06
1.extern "C"
Time of Update: 2018-12-06
Observer C++實現Code highlighting produced by Actipro CodeHighlighter
Time of Update: 2018-12-06
以下內容來源於網路,作者不明。轉自:http://advancedcj.wordpress.com/2010/06/18/c-runtime-library-3/ 許多Visual C++的使用者都碰到過LNK2005:symbol already defined和LNK1169:one or more multiply defined symbols
Time of Update: 2018-12-06
以下內容來源於網路,作者不明。轉自:http://advancedcj.wordpress.com/2010/06/18/c-runtime-library-4/ (接上文) VC帶的編譯器名字叫cl.exe,它有這麼幾個與標準程式庫有關的選項:
Time of Update: 2018-12-06
用C++的 自訂嚮導
Time of Update: 2018-12-06
差不多花了一年時間,才終於對C++有了點感覺。開始想要用它做一些事。就在這時候,剛好看到了《COM本質論》,讀完第一章,驚為神作。在剛畢業那會兒有個誤區(也許誤區都說不上,因為當時對這個職業根本就是沒想法),喜歡追新,什麼新跟著什麼跑。加上第一份工作是使用.net,花了兩個月啃完那本紅皮的C#入門經典,後續任務基本上可以總結為“通過MSDN尋找需要的API來完成對功能需求的堆砌”。C#確實是非常進階的語言,.net庫也非常了不起。C#很成功,如它所期望的,讓程式員真的擺脫了底層原理,也不關心記憶
Time of Update: 2018-12-06
基礎資料型別 (Elementary Data Type) 整型,長整型,浮點,複數,字串 變數 無需聲明或定義類型,在需要時賦值即可使用。 函數定義 def 函數名(參數列表) 變數使用無需聲明或定義類型,函數也因此沒有必要定義傳回型別。預設情況下返回的是None。 函數的注意點 1. 形參是值傳遞2.
Time of Update: 2018-12-06
sys重點關註:sys.stdin、sys.stdout和sys.stderrosos.name 字串指示你正在使用的平台。比如對於Windows,它是'nt',而對於Linux/Unix使用者,它是'posix'。os.getcwd() 函數得到當前工作目錄,即當前Python指令碼工作的目錄路徑。os.getenv()和os.putenv() 函數分別用來讀取和設定環境變數。os.listdir() 返回指定目錄下的所有檔案和目錄名。os.remove()
Time of Update: 2018-12-06
類1. 使用關鍵字class2. 類的方法的第一個參數永遠是self,像顯式的this。 註:第一個參數的名稱是隨意的,也可以不叫self,但它的意義固定。3. 使用類名後加()來建立一個類對象#!/usr/bin/python# Filename: method.pyclass Person: def sayHi(self): print 'Hello, how are you?'p = Person()p.sayHi()4.
Time of Update: 2018-12-06
注釋首碼 # #!/usr/bin/python#Filename:helloworld.pyprint 'Hello Python.' 字串 1. '和"是一樣的2.
Time of Update: 2018-12-06
類的特殊方法 __init__(self,...) 構造__del__(self) 析構__str__(self) print對象或str()時調用__lt__(self,other) 當使用 小於 運算子(<)的時候調用。 類似地,對於所有的運算子(+,>等等)都有特殊的方法。__getitem__(self,key) 讓對象可使用索引操作,[key]__len__(self) 對序列對象使用內建的len()函數的時候調用。
Time of Update: 2018-12-06
使用模組 1. import module 使用時modulename類似namespace 2. from module import 函數和變數列表 類似using namespace的功效,不推薦。 3. import module as anothername
Time of Update: 2018-12-06
注意冒號 if else if ... :縮排else