随笔分类 -  源码

摘要:void quicksort(int arr[], const int BEGIN, const int END) { if (BEGIN >= END) { return; } int i = BEGIN + 1; int j = END; while(i arr[BEGIN]) { ... 阅读全文
posted @ 2018-05-04 17:11 朝雾之归乡 阅读(249) 评论(0) 推荐(0) 编辑
摘要:欧几里得算法的原理:基于这样一种观察,两个整数x和y(x>y)的最大公约数等同于y和(x%y)的最大公约数; 数t整除x和y,当且仅当t整数y和(x%y);这是因为:x = t*y + x%y; 具体代码如下: 阅读全文
posted @ 2018-04-27 11:49 朝雾之归乡 阅读(912) 评论(0) 推荐(0) 编辑
摘要:#include #include using namespace std; typedef struct node* list; struct node { int Item; list next; }; void Display(list head) { list t = head; while (nullptr != t) { ... 阅读全文
posted @ 2018-04-26 14:36 朝雾之归乡 阅读(299) 评论(0) 推荐(0) 编辑
摘要:#include #include using namespace std; typedef struct node* list; struct node { int Item; list next; }; static void DisplayList(list head) { if (head->next == nullptr) { ... 阅读全文
posted @ 2018-04-25 09:53 朝雾之归乡 阅读(362) 评论(0) 推荐(0) 编辑
摘要:#include #include int main(int argc, char *argv[]) { int i = 2, j = 0; long N = atol(argv[1]); int *a = malloc(N*sizeof(int)); if (NULL == a) { printf("There is no enough... 阅读全文
posted @ 2018-04-21 13:26 朝雾之归乡 阅读(365) 评论(0) 推荐(0) 编辑
摘要:备注:多项式0x8005的含义是: x^15 + x^2 + 1 阅读全文
posted @ 2017-07-06 14:21 朝雾之归乡 阅读(3374) 评论(0) 推荐(1) 编辑
摘要:程序思路: 1. 调用cdll.LoadLibrary将dll导入进来; 2. 32bit的dll在64bit的Python中无法使用; 阅读全文
posted @ 2016-10-08 17:13 朝雾之归乡 阅读(11296) 评论(0) 推荐(0) 编辑
摘要:程序思路: 阅读全文
posted @ 2016-09-28 15:47 朝雾之归乡 阅读(8848) 评论(0) 推荐(0) 编辑
摘要:【实现思路】 1. 读入文件; 2. 利用python的正则表达式模块,查找匹配字符串; 阅读全文
posted @ 2016-09-21 14:05 朝雾之归乡 阅读(13519) 评论(0) 推荐(0) 编辑
摘要:Function IsFileExists(ByVal strFileName As String) As Boolean If Dir(strFileName, 16) Empty Then IsFileExists = True Else IsFileE... 阅读全文
posted @ 2016-01-25 16:43 朝雾之归乡 阅读(543) 评论(0) 推荐(0) 编辑
摘要:在BOM中记录中有物料编码,物料名称,物料规格等,而且依据BOM已经生成了相应的文件,如采购规格书,检验规格书等,这个时候需要获得这些文件的标题,并且生成一个列表,可以使用下面的VBA代码,具体代码如下:Function IsFileExists(ByVal strFileName As Strin... 阅读全文
posted @ 2015-12-04 16:38 朝雾之归乡 阅读(324) 评论(0) 推荐(0) 编辑
摘要:#/bin/shIFS=$(echo -en "\n\b")function myrename(){ for filename in $(ls $1 -1) do if [ -f $filename ]; then tmp=$(echo $filen... 阅读全文
posted @ 2015-11-08 17:29 朝雾之归乡 阅读(220) 评论(0) 推荐(0) 编辑
摘要:Sub setname() Dim I As Integer Dim pspname As String Dim pspnumber As String Dim path As String Dim srcPath As String Dim srcPath2 A... 阅读全文
posted @ 2015-11-07 14:35 朝雾之归乡 阅读(2936) 评论(0) 推荐(0) 编辑
摘要:Public Function AddRows(pos As Integer, amount As Integer) Dim rpos As Integer rpos = pos + 1 For i = 1 To amount ActiveSheet.Rows(rpo... 阅读全文
posted @ 2015-09-30 16:39 朝雾之归乡 阅读(1115) 评论(1) 推荐(0) 编辑
摘要:#include #include #define BUFF_SIZE 1024int main(int argc,char *argv[]){ int a = 0; int iSock = 0, tmpSock = 0; int opt = 0; int iRet = 0; int iRes = 0; int iFileDesc = 0; int iFileRet = 0; unsigned short usPeerPort = 11000; char *pPeerIP = "192.168.1.100"; unsigned char pRecvBuff[20480]; 阅读全文
posted @ 2013-12-18 17:41 朝雾之归乡 阅读(544) 评论(0) 推荐(0) 编辑
摘要:#include #include int main(int argc,char *argv[]){#define PERCENT 100#define THOUSAND 1000 int a = 0; int iSock = 0, tmpSock = 0; int opt = 0; int iRet = 0; int iRes = 0; int iFileDesc = 0; int iFileRet = 0; unsigned short usPeerPort = 11000; char *pPeerIP = "192... 阅读全文
posted @ 2013-12-18 16:58 朝雾之归乡 阅读(685) 评论(0) 推荐(0) 编辑
摘要:【备注】if常用的判断语句 1、if exist d:\test.txt (echo D盘下有test.txt存在) else (echo D盘下不存在test.txt) 2、if "abc"=="xyz" (echo 字符串abc等于字符串xyz) else (echo 字符串abc不等于字符串x 阅读全文
posted @ 2013-07-23 16:45 朝雾之归乡 阅读(4010) 评论(0) 推荐(0) 编辑
摘要://获取数据中bit为1的位置和总数int32_t ParseBitOfData(uint32_t uiData, uint8_t usBitTotal, ListData *pRes){ int32_t iRet = 0; uint8_t i = 0; uint8_t usTotal = 0; uint32_t uiTmp = uiData; printf("Data:0x%X; Bit:%d.\n", uiData, usBitTotal); if (usBitTotal > 32) { return RET_FAIL; } ... 阅读全文
posted @ 2013-03-04 12:20 朝雾之归乡 阅读(730) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/perl -wuse strict;use Spreadsheet::ParseExcel;my $parser = Spreadsheet::ParseExcel->new();my $pWorkbook = $parser->Parse('ExcelName.xls');my $pWorksheet = $pWorkbook->Worksheet('SheetName');my $cell = $pWorksheet->Cell(35, 1); #Cell(row, col), start with 0my $m 阅读全文
posted @ 2013-02-28 16:17 朝雾之归乡 阅读(1170) 评论(0) 推荐(0) 编辑
摘要:typedef char int8_t;typedef short int16_t;typedef int int32_t;typedef unsigned char uint8_t;typedef unsigned short uint16_t;typedef unsigned int uint32_t;typedef char * pint8_t;typedef short * pint16_t;typedef int * pint32_t;typedef unsigned char * puint8_t;typedef unsigned short * puint16_t;typedef 阅读全文
posted @ 2013-01-23 20:42 朝雾之归乡 阅读(509) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示