- 博客(62)
- 资源 (2)
- 收藏
- 关注
原创 Spring Boot使用JavaMailSender发送邮件
https://www.cnblogs.com/wxc-xiaohuang/p/9532631.html1、邮箱报错javax.mail.AuthenticationFailedException: 535 Login Fail. Please enter your authorization code参考:https://blog.youkuaiyun.com/qq_41879385/article/details/1042598522、为了包含附件的电子邮件,你必须使用 Spring的JavaMailS
2020-11-17 11:04:52
224
原创 Protege初学者
1、Protege使用参考:Protege4.3使用入门(一):http://www.cnblogs.com/i-bugs/p/3558147.htmlProtege4.3使用入门(二):http://www.cnblogs.com/i-bugs/p/3559209.htmlProtege的搭建和使用基础:http://m.blog.chinaunix.net/uid-18899774
2016-04-07 20:01:21
2513
原创 测试协同CS模式下的客户端操作通知时间 采用协议TCP
方法1:抓取发送的数据包和接收的数据,获取时间方法2:由发送者将自己的时间作为一项数据发送给接收者方法3:采用日志,记录发送时间和接收时间#pragma once#define WIN32_LEAN_AND_MEAN#include #include#include#includeusing namespace std;class LogHelper{public:
2016-03-17 16:56:37
732
原创 C++获取时间 场景写日志
#include "stdafx.h"#include #include#include#includeusing namespace std;int _tmain(int argc, _TCHAR* argv[]){ //获取当前日期 time_t t = time(0); char tmp[64]; strftime(tmp,sizeof(tmp),"%Y%m%d",
2016-03-17 16:43:50
1059
原创 不同字符的数量是fibonacci数的子字符串
题目1 : Lucky Substrings时间限制:10000ms单点时限:1000ms内存限制:256MB描述A string s is LUCKY if and only if the number of different characters in s is a fibonacci number. Given a string consisting of only l
2015-04-24 22:43:06
1059
原创 按照字典的顺序输出字符串,并不允许重复
#include#include#includeusing namespace std;struct subStr{ string s; friend bool operator<(const subStr a,const subStr b) { return a.s>b.s; }}newS;priority_queue q;//Output the strings
2015-04-24 21:34:53
1116
转载 n&(n-1)的运用——二进制数中1的个数、判断它是否是2的方幂
//二进制数中1的个数int Count(int v){ int num = 0; while(v) { v &= (v-1); num++; } return num;}//判断n是否为2的方幂bool isPower(int n){ return n>0&&((n&(n-1))==0);}
2015-04-23 22:54:45
682
原创 编程之美2.1——求二进制数中1的个数
#includeusing namespace std;#define i1 0xFFint main(){ //扩展1 //将32位拆分为4个8位,之后采用查表法 unsigned long a; a = 65536; int a1 = a&i1; a = a>>8; int a2 = a&i1; a = a>>8; int a3 = a&i1; a = a>>8;
2015-04-23 21:15:40
606
转载 编程之美1.9——高效率地安排见面会
#include#includeusing namespace std;const int N = 6;struct Time{ int begin; int end;};bool forbit[N];//禁止数组,为false的时候,表示当前该颜色可以使用 int maxcolors;Time times[N];int color[N]={0};int cmp(cons
2015-04-23 11:14:21
663
转载 使用快速排序例程进行排序——qsort函数
参考:http://www.cplusplus.com/reference/cstdlib/qsort/
2015-04-22 22:29:22
555
原创 编程之美3.3——类似——两个字符串的最长公共子序列(LCS)
#include #include #include using namespace std; #define MAXN 10001 char A[MAXN]; char B[MAXN]; int dp[MAXN][MAXN]; // 设Z为A和B的最长公共子序列,dp[i][j]表示A从位置i开始的后缀与 // B从位置j开始的后缀的最长公共子序列
2015-04-16 22:39:25
591
转载 编程之美3.2——电话号码对应英语单词
#include using namespace std; const int MaxLength = 3; char c[10][10] = {"", "", "ABC", "DEF", "GHI", "JKL", "MNO", "PQRS", "TUV", "WXYZ"}; int total[10] = {0,0,3,3,3,3,3,4,3,4}; int number[
2015-04-16 20:54:19
837
原创 编程之美3.1——字符串循环移位
#include#includeusing namespace std;//子串、反序、查找//穷举所有循环移位,逐个进行字符串匹配,时间复杂度:o(n^2)void fun1(string s1,string s2){ string temp,part1="",part2=""; int j = s1.length(); bool r = false; for(int i=0
2015-04-16 18:39:32
656
转载 C#保存文件时自动重名的方法
参考:http://www.oschina.net/code/snippet_4873_1460http://www.linuxidc.com/Linux/2015-02/113879.htm
2015-04-13 10:14:50
2099
原创 C#调用C++dll 传出字符串
//C++ 函数返回字符串#include #include using namespace std;//错误const char* getStr1(){ string s = "1"; return s.c_str();}//正确string getStr2(){ string s = "1"; return s;}//正确const void getStr3(
2015-02-19 20:49:54
6027
原创 CreateThread 线程参数示例
结构体:struct Msg{ unsigned char type; short option; unsigned short totalLen; unsigned char* data;};struct ResponseProcParam{ Msg msg; void* p_socket; MsgManagement manage;};创建线程:Response
2015-02-03 17:59:17
695
转载 C++ map struct find
参考:http://stackoverflow.com/questions/9647110/using-struct-as-key-and-value-for-map-find-operation-giving-error 【参考2 Answers】示例:struct IPPOINT{ string ip; string port;};inline bool operator<
2015-01-27 20:33:43
1583
原创 C#调用C++ dll,并向调用的函数传递“函数指针”
SocketBLL(C++dll项目):BLL.h文件:#pragma once#include typedef void(*MsgManagement)(int);MsgManagement MsgManage;HANDLE h;DWORD WINAPI RecieveTransientMsg(LPVOID pParam);extern "C" _declspec(dll
2015-01-27 19:23:47
4472
转载 c++/cli 读取配置文件app.config所需的设置
app.config文件: 自定义类SQLHelper:public static readonly string CONN_STRING = ConfigurationManager.ConnectionStrings["MusicConnectionString"].ConnectionString.ToString();问题:CONN_STRING为null,
2015-01-27 13:16:21
1900
原创 C++ Windows thread pool
参考:http://www.cnblogs.com/wz19860913/articles/1274214.htmlhttps://msdn.microsoft.com/en-us/magazine/cc163327.aspx
2015-01-26 10:23:11
867
原创 socket传输文件 写文件的时候需要注意的
//读取8.mp3文件(269,260 字节)写到1.mp3,分成4份,标号为1,2,3,4 写入顺序为1,3,2,4//若是写文件的时候,每次都打开再关闭,结果:文件大小正确,用UltraEdit查看二进制和原来的一致,但是听一下会发现有问题,拖到音频编辑工具上面波形也不一样#include #include using namespace std;int main () { con
2015-01-21 17:17:00
1088
转载 wxwidgets显示中文
解决:wxString s = wxT("中文");参考:http://blog.youkuaiyun.com/eyefamily/article/details/75167931. windows下wxWidgets 2.9.1 , VC2005编译, Unicode 和wxWidgets 2.9.1 , mingw32编译, Unicode事实证明用这两个编译器产生的代码对中文乱
2014-12-19 10:15:44
3408
原创 Error:assert "m_count == -1 || m_count == -2" failed in UpdatesCountFilter wxWidgets
错误原因:继承wxFrame的类ChatFrame中的控件进行析构的时候,产生的错误解决:关于界面的类有关的析构,需要由主线程来执行
2014-12-11 16:55:44
1444
1
转载 C++ 获取文件的大小
long getFileLen(char* fileName){ long l,m; ifstream file (fileName,ios::in|ios::binary); l = file.tellg(); file.seekg (0, ios::end); m = file.tellg(); //13,406,741 file.close(); cout << "size
2014-11-19 22:06:52
722
原创 C#windowForm 从php函数返回的Url获取到json并解析,下载文件
WebClient client = new WebClient(); string regionURL = "http://222.31.76.240:8080/?r=databaseInterface/GetdetailsBySongAndArtistName&songName=That Will Be The Day&artistName=%E9%99%88%E5%A5%95";
2014-11-03 15:45:43
1173
转载 CLR:将System.Net命名空间引用到C++里面
#using using namespace System;using namespace System::Net;
2014-11-02 21:41:53
1959
转载 wxWidgets——Error: Cannot initialize OLE when using CLR
解决方案:https://forums.wxwidgets.org/viewtopic.php?f=1&t=25447
2014-10-30 21:18:03
1341
转载 SQL Server-存储过程(Procedure),带入参数和出参数
参考:http://www.cnblogs.com/ylbtech/archive/2012/08/14/2638257.html
2014-09-23 21:22:48
969
原创 Socket接收问题
//接收一条服务器返回消息shil const int MAX_BUF = 1200*2; char recvbuf[MAX_BUF]; //这一次获取的字节 char nextbuf[MAX_BUF*2]; //这一次留下的字节 char nowbuf[MAX_BUF*2]; //这一次总的字节 int iRet; //这一次获取的字节数 int nRet = 0;
2014-09-03 16:17:24
566
原创 error C2061: 语法错误 : 标识符“***” error C2146: 语法错误 : 缺少“;” C++两个类相互引用问题
参考:http://blog.youkuaiyun.com/goodlixueyong/article/details/6254703//A.h#include "B.h"class A{ int i; B* b;}; //B.hclass A;class B{ int i; A* a;}; //B.cpp#include
2014-09-02 21:19:47
1009
转载 Socket 长连接 心跳包
1.如何知道谁在线? Server维护一个list就ok了(存所有人的ip,名字,在线等) 2.如何让服务器随时能找到你? 前提:内网机器如果不主动向外发起连接,外网机没法直连内网的,这也是内网机安全的原因之一吧,又因为路由器会把这个关系记录下来,但是过一段时间这个记录可能会丢失 ,所有每一个客户端每隔一定时间就会向服务器发送消息,以保证服务器可以随时找到你,这东西被
2014-07-18 03:47:47
636
转载 C# System.DBNull string
(string)Eval("p_countions")改为Eval("p_countions").ToString()
2014-07-17 22:00:26
477
转载 error MSB6006: “mt.exe”已退出,代码为 31。
参考:http://blog.163.com/lvlijuan001@126/blog/static/779971982012183567882/解决:
2014-07-17 03:24:25
1387
转载 error LNK2028 C++调用C++ dll过程中
error LNK2028: 无法解析的标记(0A000321) "public: static int __cdecl BLL::cre
2014-07-17 02:34:22
2147
转载 C++调用C#动态dll
参考:http://blog.youkuaiyun.com/canhui2009/article/details/7865850
2014-07-17 02:16:27
451
转载 C++ string、char*、const char* 之间相互转换
参考:http://www.jb51.net/article/36449.htm
2014-07-17 02:11:16
680
转载 C++ 调用C++动态链接库dll
http://www.cppblog.com/codejie/archive/2009/09/24/97141.html
2014-07-16 16:42:32
662
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人