2014年3月29日

【Mysql】insert

摘要: The INSERT privilege enablesrows to be inserted into tables in a databasecreate database Susake;use Susake;create table Test(a int, b int);insert into Test values(1, 2); 阅读全文

posted @ 2014-03-29 19:15 至死丶不渝 阅读(116) 评论(0) 推荐(0) 编辑

【Windows API】Button Control Structures

摘要: ①BUTTON_IMAGELISTContains information about an image list that is used with a button control②BUTTON_SPLITINFOContains information that defines a split button (BS_SPLITBUTTON and BS_DEFSPLITBUTTON styles)③NMBCDROPDOWNContains information about a BCN_DROPDOWN notification④NMBCHOTITEMContains informati 阅读全文

posted @ 2014-03-29 05:19 至死丶不渝 阅读(226) 评论(0) 推荐(0) 编辑

【动态规划】最大子段和

摘要: 设序列n,起始值为0状态:s[i]是否加上dp[i - 1]1.若前一项为正,则dp[i] = dp[i - 1] + s[i]2.若前一项为非正,则dp[i] = s[i]3.用max记录最大的dp[i]#include #include int s[6] = { 0, 6, -1, 5, 4, -7 };int dp[100];int main(int argc, char *argv[]){ int sum = 0, max = 0; memset(dp, 0, sizeof(dp)); for (int i = 1; i 0) dp[i] = ... 阅读全文

posted @ 2014-03-29 05:12 至死丶不渝 阅读(105) 评论(0) 推荐(0) 编辑

【Mysql】delete

摘要: The DELETE privilege enablesrows to be deleted from tables in a databasecreate database Susake;use Susake;create table Test(a int, b int);insert into Test values(1, 2);insert into Test values(2, 3);delete from Test where a = 1;drop table Test;drop database Susake; 阅读全文

posted @ 2014-03-29 05:05 至死丶不渝 阅读(207) 评论(0) 推荐(0) 编辑

【Windows API】Button Control Notifications

摘要: ①BCN_DROPDOWNSent when the user clicks a drop down arrow on a button. The parent window of the control receives this notification code in the form of a WM_NOTIFY message②BCN_HOTITEMCHANGENotifies the button control owner that the mouse is entering or leaving the client area of the button control. Th 阅读全文

posted @ 2014-03-29 03:05 至死丶不渝 阅读(280) 评论(0) 推荐(0) 编辑

【贪心】Huffman Code

摘要: 1.构造Huffman Tree,每次取最小和次小的2个1 1 = 2 此时 2 3 62 3 = 5 此时 5 65 6 = 11 此时 11Huffman Tree如下 11 5 6 2 31 12.构造前缀编码(左0右1)#include #include int w[4] = { 6, 3, 1, 1 };typedef struct{ int weight; int LChild, RChild, parent;}HTNode;typedef struct{ HTNode *nod... 阅读全文

posted @ 2014-03-29 02:58 至死丶不渝 阅读(159) 评论(0) 推荐(0) 编辑

【Mysql】alter

摘要: The ALTER privilege enables use of ALTER TABLE to change thestructure of tables. ALTER TABLE also requires theCREATE and INSERT privileges. Renaming atable requires ALTER andDROP on the old table,ALTER,CREATE, andINSERT on the new tablecreate database Susake;use Susake;create table Qing(a int, b int 阅读全文

posted @ 2014-03-29 02:50 至死丶不渝 阅读(121) 评论(0) 推荐(0) 编辑

【Boost】Accumulators

摘要: 1.CountThe count feature is asimple counter that tracks the number of samples pushed into the accumulatorset#include #include using namespace boost::accumulators;int main(int argc, char *argv[]){ accumulator_set > acc; acc(0); acc(1); acc(2); assert(count(acc) == 3); return 0;}2.Co... 阅读全文

posted @ 2014-03-29 02:23 至死丶不渝 阅读(555) 评论(0) 推荐(1) 编辑

【Windows API】Button Control Messages

摘要: ①BCM_GETIDEALSIZEGets the size of the button that best fits its text and image, if an image list is present. You can send this message explicitly or use the Button_GetIdealSize macro②BCM_GETIMAGELISTGets the BUTTON_IMAGELIST structure that describes the image list assigned to a button control. You c 阅读全文

posted @ 2014-03-29 02:10 至死丶不渝 阅读(432) 评论(0) 推荐(0) 编辑

【分治】二分查找

摘要: 设序列n1.分:在序列n中找到key,相当于在left, right中找到key即可2.治:每次取middle与key比较,若相同则返回middle + 1,否则返回-1#include int Divide_conquer(int n_Susake[], int key, int length){ int left = 0, right = length + 1, middle; while (left != right) { middle = (left + right) / 2; if (n_Susake[middle] == key) re... 阅读全文

posted @ 2014-03-29 01:54 至死丶不渝 阅读(145) 评论(0) 推荐(0) 编辑

导航