自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(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.csdn.net/qq_41879385/article/details/1042598522、为了包含附件的电子邮件,你必须使用 Spring的JavaMailS

2020-11-17 11:04:52 165

原创 C# 调用 C++ 在Release下重新生成的问题

如果要修改C++项目下的代码,需要在Debug下重新生成后,才能在Release下重新生成

2016-06-03 00:34:15 796

原创 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 2399

原创 测试协同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 673

原创 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 1007

原创 不同字符的数量是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 1006

原创 按照字典的顺序输出字符串,并不允许重复

#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 1062

转载 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 623

原创 编程之美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 556

转载 编程之美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 613

转载 ~0uLL >> 1

0uLL:unsigned long long 类型的0~:“二进制 按位 否 运算符”>>:右移运算符

2015-04-23 10:00:36 4351

转载 使用快速排序例程进行排序——qsort函数

参考:http://www.cplusplus.com/reference/cstdlib/qsort/

2015-04-22 22:29:22 504

原创 编程之美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 529

转载 编程之美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 724

原创 编程之美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 610

转载 C#保存文件时自动重名的方法

参考:http://www.oschina.net/code/snippet_4873_1460http://www.linuxidc.com/Linux/2015-02/113879.htm

2015-04-13 10:14:50 2016

原创 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 5872

原创 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 635

转载 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 1506

原创 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 4266

转载 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 1805

原创 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 797

原创 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 1033

转载 wxwidgets显示中文

解决:wxString s = wxT("中文");参考:http://blog.csdn.net/eyefamily/article/details/75167931. windows下wxWidgets 2.9.1 , VC2005编译, Unicode  和wxWidgets 2.9.1 , mingw32编译, Unicode事实证明用这两个编译器产生的代码对中文乱

2014-12-19 10:15:44 3187

原创 Error:assert "m_count == -1 || m_count == -2" failed in UpdatesCountFilter wxWidgets

错误原因:继承wxFrame的类ChatFrame中的控件进行析构的时候,产生的错误解决:关于界面的类有关的析构,需要由主线程来执行

2014-12-11 16:55:44 1318 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 663

原创 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 1105

转载 CLR:将System.Net命名空间引用到C++里面

#using using namespace System;using namespace System::Net;

2014-11-02 21:41:53 1905

转载 wxWidgets——Error: Cannot initialize OLE when using CLR

解决方案:https://forums.wxwidgets.org/viewtopic.php?f=1&t=25447

2014-10-30 21:18:03 1286

转载 SQL Server-存储过程(Procedure),带入参数和出参数

参考:http://www.cnblogs.com/ylbtech/archive/2012/08/14/2638257.html

2014-09-23 21:22:48 926

原创 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 511

原创 error C2061: 语法错误 : 标识符“***” error C2146: 语法错误 : 缺少“;” C++两个类相互引用问题

参考:http://blog.csdn.net/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 937

转载 Socket 长连接 心跳包

1.如何知道谁在线?      Server维护一个list就ok了(存所有人的ip,名字,在线等)   2.如何让服务器随时能找到你?   前提:内网机器如果不主动向外发起连接,外网机没法直连内网的,这也是内网机安全的原因之一吧,又因为路由器会把这个关系记录下来,但是过一段时间这个记录可能会丢失 ,所有每一个客户端每隔一定时间就会向服务器发送消息,以保证服务器可以随时找到你,这东西被

2014-07-18 03:47:47 564

转载 C# System.DBNull string

(string)Eval("p_countions")改为Eval("p_countions").ToString()

2014-07-17 22:00:26 430

原创 C++ CLI 类型 Object[]

C#中Object[]   相对的 C++中array

2014-07-17 21:25:45 661

转载 error MSB6006: “mt.exe”已退出,代码为 31。

参考:http://blog.163.com/lvlijuan001@126/blog/static/779971982012183567882/解决:

2014-07-17 03:24:25 1292

转载 error LNK2028 C++调用C++ dll过程中

error LNK2028: 无法解析的标记(0A000321) "public: static int __cdecl BLL::cre

2014-07-17 02:34:22 1910

转载 C++调用C#动态dll

参考:http://blog.csdn.net/canhui2009/article/details/7865850

2014-07-17 02:16:27 406

转载 C++ string、char*、const char* 之间相互转换

参考:http://www.jb51.net/article/36449.htm

2014-07-17 02:11:16 627

转载 C++ 调用C++动态链接库dll

http://www.cppblog.com/codejie/archive/2009/09/24/97141.html

2014-07-16 16:42:32 621

图书借阅管理软件

shenru

2016-12-09

Cracking the coding interview 5th

Cracking the coding interview 5th

2015-10-17

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除