- 博客(29)
- 资源 (2)
- 收藏
- 关注
原创 VS编译EXIV2(以2013为例)
下载资源库(尽量下载示例版本,可能会因为版本问题造成编译失败): exiv2-0.26 curl-7.39.0 expat-2.1.0 libssh-0.5.5 openssl-1.0.1j zlib-1.2.7编译过程: 1.将后面的五个资源库,放在和EXIV库中和exiv2-trunk文件夹统计目录下,并将这五个文件夹的后缀去掉。 2.进入...
2018-06-12 20:35:37
1175
原创 隐写工具的相关库使用
1.Jpeglib,动态链接的库,算做第三方库,容易与VC的底层库冲突,编译Jpeg时应严格与所使用项目的属性保持一致(常规--》MFC的使用、C/C++--》代码生成---》运行库)2.STCs:直接添加,注意应包括common.h、common.c等文件,另该库依赖boost库,需添加。3.boost:项目属性--》通用属性--》VC++目录--》包含目录--》添加boost文件夹的绝
2017-08-16 16:12:34
513
转载 C/C++内存泄漏及检测
“该死系统存在内存泄漏问题”,项目中由于各方面因素,总是有人抱怨存在内存泄漏,系统长时间运行之后,可用内存越来越少,甚至导致了某些服务失败。内存泄漏是最难发现的常见错误之一,因为除非用完内存或调用malloc失败,否则都不会导致任何问题。实际上,使用C/C++这类没有垃圾回收机制的语言时,你很多时间都花在处理如何正确释放内存上。如果程序运行时间足够长,如后台进程运行在服务器上,只要服务器不宕机就一
2017-07-24 18:24:39
1801
原创 8.12 K-生成树
问题:k-SPANNING TREE问题是这样的:输入:无向图G=(V, E) 输出:G的一个生成树,其中所有的节点度数都不超过k——如果该树存在。 请证明对任意k>=2: (a)k-生成树问题是一个搜索问题。 (b)k-生成树问题是NP-完全的。(提示:由k=2开始,考虑该问题与Rudrata路径问题的关联。)答:(a) k-生成树问题能够
2017-07-01 11:29:52
369
转载 详解使用icomoon生成字体图标的方法并应用
最近项目大量用到字体图标,大家也知道,字体图标任意缩放不会失真,也大大减少请求数量,非常好用。以下将讲解本人如何根据美工提供的.svg文件生成字体图标并应用。借助一个在线生成工具:https://icomoon.io/app/#/select1、进入网址:主页面2、新建一个图集3、添加.svg图片(可以使用现成的,也可
2017-06-30 20:32:41
920
原创 1000. 函数求值
问题:定义超级和函数F如下:F(0, n) = n,对于所有的正整数n..F(k, n) = F(k – 1, 1) + F(k – 1, 2) + … + F(k – 1, n),对于所有的正整数k和n. 请实现下面Solution类中计算F(k, n)的函数(1 例1:F(1, 3) = 6 例2:F(2, 3) = 10 例3:F(10,
2017-06-28 16:33:03
215
原创 1003. 相连的1
问题:对于一个01矩阵A,求其中有多少片连成一片的1. 每个1可以和上下左右的1相连. 请为下面的Solution类实现解决这一问题的函数countConnectedOnes,函数参数A为给出的01矩阵,A的行数和列数均不大于1000. 函数的返回值是问题的答案. 例1:A=100010001答案为3. 例2:A=1101010111
2017-06-28 10:44:33
202
原创 1002. 等价二叉树
问题:两个二叉树结构相同,且对应结点的值相同,我们称这两个二叉树等价. 例如:以下两个二叉树等价 1 1 / \ / \ 2 3 2 3而以下两个则不等价 1 1 / \ / \ 2
2017-06-27 18:21:29
231
原创 1001. 会议安排
问题:N个会议要同时举行,参会人数分别为A[0], A[1], ..., A[N-1]. 现有M个会议室,会议室可容纳人数分别为B[0], B[1], ..., B[M-1]. 当A[i] 1 请为下面的Solution类实现解决上述问题的函数assignConferenceRoom. 函数参数A和B的意义如上,返回值为最多可安排的会议数. class Solutio
2017-06-27 16:55:12
1065
原创 260. Single Number III
问题:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:
2017-06-26 17:59:04
164
原创 238. Product of Array Except Self
问题:Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division a
2017-06-26 15:49:25
145
原创 139. Word Break
问题:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more dictionary words. You
2017-06-26 15:13:55
182
原创 147. Insertion Sort List
问题描述:Sort a linked list using insertion sort.分析:链表插入排序需要建立一个新的链表,按序遍历,让新链表中的合适节点指向新的节点代码:class Solution {public: ListNode* insertionSortList(ListNode* head) { ListNode* new_head
2017-06-23 13:55:12
154
原创 113. Path Sum II
问题描述:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5
2017-05-31 18:40:11
187
原创 102. Binary Tree Level Order Traversal
问题描述:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3
2017-05-31 17:27:12
173
原创 让VS2013 MFC程序兼容windows xp系统
用VS2013静态编译出来的MFC程序在Windows XP系统上运行时,程序异常无法运行,但在兼容XP模式下可运行,用如下方法改正则可默认兼容XP,无需设置。1、修改平台工具集2、修改运行库在编译执行便可在XP下正常运行。PS:若程序引入第三方库,在修改运行库时可能会引起新的问题,这是因为编译第三方的库的问题,只需在用MTD重新编译第三方库即可。
2017-05-16 16:17:46
684
原创 56. Merge Intervals
问题:Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].Subscribe to see which companies asked
2017-05-10 21:01:44
176
原创 55. Jump Game
问题描述:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.De
2017-05-10 19:53:08
154
原创 16. 3Sum Closest
问题:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have
2017-05-03 19:07:34
164
原创 10. Regular Expression Matching
问题描述:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire
2017-04-03 21:50:23
176
原创 6. ZigZag Conversion
问题:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P
2017-03-26 21:56:12
170
原创 25.Reverse Nodes in k-Group
问题:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the number
2017-03-18 19:00:18
167
原创 VS运行时库
在Windows下进行C++的开发,不可避免的要与Windows的底层库进行交互,然而VS下的一项设置MT、MTd、MD和MDd多种运行库,特别是你工程使用了很多第三方库的时候,极容易出现各种链接问题。例如如下错误:网上大多数解决方案是忽略libcmt.lib,忽略后会产生如下问题:1> uafxcwd.lib(appcore.obj) : error LNK2001: 无法解析的
2017-03-13 17:56:15
2313
原创 5. Longest Palindromic Substring
问题描述:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.分析:需要以每一个字母开始去遍历寻找与随后的字母是否构成回文:1、构成回文,则判断长度是否比之前的会问长度更长:1)若比之前的回文长度更长,
2017-03-09 20:17:58
244
转载 Use MFC in a Static Library 和 use MFC in a Shared DLL 的区别
如果选择use MFC in a Shared DLL 的话,你编译后的程序中不包含MFC库,所以文件会比较小,但是如果你的程序直接移到一个没有安装过MFC的机器上时,可能会导致找不到MFC的DLL。如果选择Use MFC in a Static Library ,那你编译后的程序就直接包含了调用MFC的部分的库,文件可能会大一些,但是可以直接移到其他机器上运行。前者是动态
2017-03-05 21:04:28
664
原创 vs中动态链接库和静态链接库的创建及使用
区别静态库编译之后会生成对应的.lib文件,在工程A中使用时,配置A的属性,首先要附加的include 路径里,添加.lib库对应的头文件所在的路径。然后在链接器设置里,附加的库路径里添加.lib库所在的路径,然后在链接器的输入里,添加.lib库的名字即可。动态链接库的创建的不同之处在于,需要在所有函数的声明前边加上 __declspec(dllexport) ,动
2017-03-04 22:33:48
1300
原创 vs工程中添加外部头文件及库
在VS工程中,添加c/c++工程中外部头文件及库的基本步骤: 1、添加工程的头文件目录:工程---属性---配置属性---c/c++---常规---附加包含目录:加上头文件存放目录。 2、添加文件引用的lib静态库路径:工程---属性---配置属性---链接器---常规---附加库目录:加上lib文件存放目录。 3、然后添加工程引用的lib
2017-03-03 15:59:50
2060
原创 2. Add Two Numbers
问题:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and r
2017-03-02 13:46:41
173
原创 456.132 Pattern
问题:Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i j kand ai < ak < aj. Design an algorithm that takes a list of n numbers as
2017-02-24 21:39:11
187
EXIV静态库(包含编译的资源库)
2018-06-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人