- 博客(37)
- 资源 (52)
- 收藏
- 关注
原创 html模板渲染库(c++实现,语法与django模版语法一致)
介绍cJinja 是一个使用cpp编写的轻量html模版解析库,依赖 ejson (https://github.com/HuangHongkai/ejson) 来实现模版的数据替换(在jinja中称为context,上下文)。模版的语法基本与django jinja一致,功能还算丰富。源码仅有700行,适合学习,觉得不错的点个star吧。(该程序为 https://github.com/Hu...
2019-03-31 19:28:44
1588
原创 TAILQ的使用与源码分析
TAILQ是Linux中的一种双向队列(在libevent中有广泛引用),能实现操作队列需要的各种操作:插入元素,删除元素,遍历队列等。这个队列的优点是插入元素很快。简单的例子#include <sys/queue.h>#include <stdio.h>struct item_t { int value; TAILQ_ENTRY(item_t) ...
2019-03-29 17:33:58
2374
1
原创 轻量c++ json库(源码精简适合学习)
介绍该库为轻量级的c++ json解析与构造库,源码很短,适合学习,觉得ok的点个star吧。提供了的功能:json字符串解析为c++对象(JSONArray和JSONObject)c++对象中获取key-value值c++对象转化为json字符串除此之外,由于json支持了多种数据类型,还可以将JSONArray对象看成是python的list,JSONObject看成是pyth...
2019-03-29 12:34:53
1992
原创 windows录屏投屏,拓展屏投屏
快速开始点击release文件夹下屏幕分享例程.exe,然后访问 http://127.0.0.1:8000 即可看到如下,在release目录下可看到录屏文件save.h264(使用vlc播放器等即可播放,或使用ffmpeg转码)在这里插入图片描述介绍该程序实现windows的录屏,投屏功能。屏幕复制连接到同一个局域网,查看本机ip,然后使用其他设备访问。例如,我的本机ip是1...
2019-03-25 15:25:06
1881
2
原创 Fortran快速入门
最近需要使用fortran,通过网上的资料,快速入门该语言基本程序结构program main !程序开始,main可以自定义implicit none !告诉编译器,所有变量需要声明后才能使用,否则编译失败!主体内容stop !终止程序,相当与C exit(0)end program main数据类型,变量声明与老式C语言一样,所有变量声明在开头,之后就不能声明了progra...
2019-01-16 20:16:47
22111
原创 cpp const引用和右值引用的区别,std::move(移动语义), std::forward(完美转发)
文章目录引言string&amp;amp; 作为函数参数的问题你在使用cpp过程是否遇到过使用string&amp;amp;作为函数参数,main调用的时候编译失败的问题?例如下面这份简单的代码void func(string&amp;amp; a) {}int main() {func(“12323”);}编译器提示如下[Error] invalid initialization of non...
2018-12-20 15:10:52
3668
原创 invalid use of incomplete type和expected class-name before '{' token 问题分析
起源如果你编写c++代码喜欢把实现和声明写在一块的话,可能会出现这个编译错误。意思就是你使用了不完整的类型(尽管你有前置声明)例如下面这份代码class A;class Base {public: // invalid use of incomplete type 'class A' A func(){ return A(); }};class A { };class...
2018-12-17 17:02:25
1024
原创 cpp 函数参数使用引用和const引用的区别(如string和const string&)
在c++中,&amp;代表引用传递,跟指针的作用是一致的,只不过语法上做了一点点修改。c++中函数参数如果是类对象一般使用&amp;来修饰,从而避免不必要的构造和析构。例如class A{ };void func(A&amp;) { }使用A&amp;可以避免调用 A(A&amp;) 来创建临时对象和 ~A() 来销毁临时对象。看下面代码void func(string&amp; ...
2018-12-17 00:27:32
2499
原创 maven基本使用方法(命令行)
本篇记录一下maven在命令行的构建方法,后面讲在idea怎么用。参考 这里 有详细的maven教程。创建maven项目最基本的maven项目创建命令如下mvn archetype:generate -DgroupId={{your_DgroupId}} -DartifactId={{your_projectName} -DarchetypeArtifactId=maven-archety...
2018-12-02 00:35:40
5568
原创 ubuntu apt强制使用ipv4/ipv6
sudo apt-get -o Acquire::ForceIPv4=true install 你的包名今天刚好ipv6出了问题,一直下载不了,用这条命令安装即可。
2018-11-20 11:10:30
1823
原创 django异步任务(celery+rabbitmq+flower可视化)
文章目录安装rabbitmq安装django-celery,flower在settings中配置django-celery安装rabbitmqsudo apt-get install rabbitmq-server添加用户,myuser为用户名,mypassword为用户密码sudo rabbitmqctl add_user myuser mypassword新增管理员用户 myuser...
2018-11-15 11:55:33
2893
1
原创 LeetCode 715. Range Module / 57. Insert Interval(区间查询更新,离散化)
A Range Module is a module that tracks ranges of numbers. Your task is to design and implement the following interfaces in an efficient manner.addRange(int left, int right) Adds the half-open interva...
2018-11-03 23:31:05
443
原创 LeetCode719. Find K-th Smallest Pair Distance (二分法,滑动窗口优化)
Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference between A and B.Example 1:Input:nums = [1,3,1]k =...
2018-11-03 16:31:49
227
原创 LeetCode41. First Missing Positive (数组技巧)
Given an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Example 3:Input: [7,8,9,11,12]Output: 1Not...
2018-11-03 11:11:09
159
原创 LeetCode 891. Sum of Subsequence Widths (找规律)
Given an array of integers A, consider all non-empty subsequences of A.For any sequence S, let the width of S be the difference between the maximum and minimum element of S.Return the sum of the wid...
2018-11-03 09:26:32
211
原创 LeetCode 4. Median of Two Sorted Arrays (求两个有序数组第k大数字,分治法)
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 and num...
2018-11-02 23:42:06
477
原创 LeetCode 665. Non-decreasing Array(LCS思想)
Given an array with n integers, your task is to check if it could become non-decreasing by modifying at most 1 element.We define an array is non-decreasing if array[i] <= array[i + 1] holds for e...
2018-11-02 17:14:18
264
原创 LeetCode 126. Word Ladder II (构造最短路径模型)
Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:Only one letter can be changed at a timeEach...
2018-11-02 17:07:13
276
原创 LeetCode 95. Unique Binary Search Trees II (二叉搜索树计数,卡特兰数)
Given an integer n, generate all structurally unique BST’s (binary search trees) that store values 1 … n.Example:Input: 3Output:[ [1,null,3,2], [3,2,null,1], [3,1,null,null,2], [2,1,3], ...
2018-11-02 12:23:46
203
原创 LeetCode 687. Longest Univalue Path (dfs+bfs)
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root.Note: The length of path between two nodes is r...
2018-11-01 22:22:01
139
原创 LeetCode222. Count Complete Tree Nodes (完全二叉树节点计数技巧)
Given a complete binary tree, count the number of nodes.Note:Definition of a complete binary tree from Wikipedia:In a complete binary tree every level, except possibly the last, is completely fille...
2018-11-01 19:00:41
247
原创 LeetCode 124. Binary Tree Maximum Path Sum(树中最长路径和,递归)
Given a non-empty binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connection...
2018-11-01 11:32:00
140
原创 LeetCode 99. Recover Binary Search Tree (BST重建)
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Example 1:Input: [1,3,null,null,2] 1 / 3 \ 2Output: [3,1,null,null,2]...
2018-11-01 10:55:37
192
原创 LeetCode 685. Redundant Connection II (判断环,有向树,并查集)
In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this node, plus every node has exactly one parent, excep...
2018-10-31 16:50:47
326
原创 LeetCode 133. Clone Graph (dfs,复制图)
Given the head of a graph, return a deep copy (clone) of the graph. Each node in the graph contains a label (int) and a list (List[UndirectedGraphNode]) of its neighbors. There is an edge between the ...
2018-10-31 14:09:53
253
原创 LeetCode 877. Stone Game(简单DP)
Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal.Example 1:Input: s1 = "sea", s2 = "eat"Output: 231Explanation: Deleting "s" from "sea" adds the ...
2018-10-31 13:41:33
176
原创 LeetCode44. Wildcard Matching (DP,注意初始化)
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the e...
2018-10-31 13:23:30
214
原创 LeetCode 45. Jump Game II (贪心/bfs,dfs超时)
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.Your goal is to r...
2018-10-30 21:22:40
394
原创 LeetCode135. Candy (贪心)
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least one can...
2018-10-30 20:12:49
236
原创 LeetCode874. Walking Robot Simulation (模拟题)
A robot on an infinite grid starts at point (0, 0) and faces north. The robot can receive one of three possible types of commands:-2: turn left 90 degrees-1: turn right 90 degrees1 <= x <= ...
2018-10-30 19:06:11
169
原创 LeetCode 5. Longest Palindromic Substring (DP)
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.Example...
2018-10-30 13:34:38
128
原创 Leetcode312. Burst Balloons (DP+DFS)
Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[le...
2018-10-30 13:06:08
150
原创 vs+msys2+yasm 编译libx264+ffmpeg详细解释(32位或64位)
下载msys2下载yasm安装libx264gcc 编译libx264 (.a .dll)msvc编译libx264(.lib .dll)编译ffmpeg(带libx264)题外话:linux,windows下的各种库的含义动态链接库(.dll .so)windows平台(.dll)linux平台(.so)静态库(.a .lib).a.lib内核库(.s...
2018-09-12 22:15:36
3466
原创 编程书籍分享(持续更新....)
本页面分享IT技术书籍,所有的书籍均是完整的pdf,所有书籍都有看过(大部分没看完),都是我认为非常不错的书籍,分享给大家,放在csdn下载。下载积分都设置为1(csdn现在没办法设置成不用积分下载),但如果下载人数太多,csdn会自动把积分调高,如果没有积分的可以在下方留email,我会尽快发给你。课程书籍编程开发C++Linux编程Windows编程汇编PythonJa...
2018-09-09 17:15:28
809
原创 练习9(数论初步)
A - 整除的尾数一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢?Input输入数据有若干组,每组数据包含二个整数a,b(0Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没有空格。Sample Input200 401992 950
2017-03-02 22:45:51
1291
原创 冬训练习5
A。欧拉回路欧拉回路是指不令笔离开纸面,可画过图中每条边仅一次,且可以回到起点的一条回路。现给定一个图,问是否存在欧拉回路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是节点数N ( 1 < N < 1000 )和边数M;随后的M行对应M条边,每行给出一对正整数,分别是该条边直接连通的两个节点的编号(节点从1到N编号)。当N为0时输入结束
2017-02-25 10:41:29
348
原创 2016寒假冬训练习#1
https://vjudge.net/contest/151248#overviewA 没有技巧B题The Dragon of LoowaterOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores
2017-02-23 08:47:04
330
usb4java-javax-1.2.0.jar
2018-06-30
XueTr.exe PCHunter
2018-02-05
gradle-3.3-rc-1-bin.zip
2017-10-26
gradle-4.3-rc-3-all.zip
2017-10-26
交互式计算机图形学(第六版) 源代码
2017-10-22
交互式计算机图形学(第六版) 第二章源代码
2017-10-22
轻量c++服务器框架
2019-04-30
windows屏幕分享和录屏
2019-04-30
html模板引擎c++实现
2019-04-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人