上一页 1 ··· 7 8 9 10 11

2013年3月25日

用LINQ对Dictionary排序

摘要: 代码如下 : static void Main(string[] args) { Dictionary<int, int> di = new Dictionary<int, int>(); di.Add(9, 1); di.Add(0, 6); di.Add(2, 8); var sortedDict = (from entry in di orderby entry.Key ascending select entry) .T... 阅读全文

posted @ 2013-03-25 00:26 齐文宣 阅读(304) 评论(0) 推荐(0)

2013年2月28日

difference between char, nchar, varchar, and nvarchar

摘要: Just to clear up... or sum up...nchar and nvarchar can store Unicode characters.char and varchar cannot store Unicode characters.char and nchar are fixed-length which will reserve storage space for number of characters you specify even if you don't use up all that space.varchar and nvarchar are 阅读全文

posted @ 2013-02-28 21:54 齐文宣 阅读(151) 评论(0) 推荐(0)

2013年2月22日

sql server 内置函数

摘要: function Binary_CheckSum对大小写敏感,想忽略大小写可用CheckSum.These functions are also valuable for comparing and indexing long string columns. Instead of creating an index on such column, you can add a column based onthe checksum or binary checksum of the value in the string column and index it instead. This typ 阅读全文

posted @ 2013-02-22 14:38 齐文宣 阅读(159) 评论(0) 推荐(0)

2013年2月3日

在tablepage的datagridview中,加上按列值搜索相应记录的方法

摘要: 要实现的效果是:tablepage中有一个datagridview,当用户鼠标点在datagridview列标题时,浮现一个textbox,比如当前列标题是姓名,那么用户输入张三,datagridview张三那行就被定位,变成selected状态 。具体代码如下:首先在窗体构造函数加2个delegate InitializeComponent(); dgv_compare.MouseHover+=new EventHandler(dgv_compare_MouseHover); dgv_compare.MouseLeave+=n... 阅读全文

posted @ 2013-02-03 13:34 齐文宣 阅读(285) 评论(0) 推荐(0)

2013年1月17日

存一段代码备用,CopyPaste.cpp

摘要: // ==========================================================// Copy / paste routines//// - Floris van den Berg (flvdberg@wxs.nl)// - Alexander Dymerets (sashad@te.net.ua)// - Herv� Drolon (drolon@infonie.fr)// - Manfred Tausch (manfred.tausch@t-online.de)// - Riley McNiff (rmcniff@marexgroup.com)// 阅读全文

posted @ 2013-01-17 03:57 齐文宣 阅读(315) 评论(0) 推荐(0)

把Nehe 纹理教程06,用freeImage改写

摘要: 程序如下:/* * This Code Was Created By Jeff Molofee 2000 * A HUGE Thanks To Fredric Echols For Cleaning Up * And Optimizing The Base Code, Making It More Flexible! * If You've Found This Code Useful, Please Let Me Know. * Visit My Site At nehe.gamedev.net */#include <w... 阅读全文

posted @ 2013-01-17 03:38 齐文宣 阅读(368) 评论(0) 推荐(0)

2013年1月16日

c++全局变量,局部变量不赋初值的区别

摘要: 可以用下面的小程序测试#include <iostream>float gf;int main(){ float lf; std::cout<<gf<<std::endl; std::cout<<lf<<std::endl; return 0;}显示结果是 0 1.4013e-045所以,全局变量不赋初值也可以,默认为0,局部变量不赋初值,不能当成0用。 阅读全文

posted @ 2013-01-16 23:43 齐文宣 阅读(624) 评论(0) 推荐(0)

2013年1月12日

什么时候需要用memset将结构内存设为0

摘要: 在多线程程序设计一书中,有这样的代码: WNDCLASS wc; memset(&wc, 0, sizeof(wc)); wc.lpfnWndProc = MainWndProc; wc.hInstance = hInstance; wc.hIcon = LoadIcon (hInstance, "GenIco"); wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hbrBackground= GetSysColorBrush... 阅读全文

posted @ 2013-01-12 03:37 齐文宣 阅读(485) 评论(0) 推荐(0)

上一页 1 ··· 7 8 9 10 11

导航