自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

zxc120389574的博客

谨慎乐观。

  • 博客(47)
  • 收藏
  • 关注

原创 垃圾分类

垃圾种类垃圾具体内容厨余垃圾骨骼内脏、菜梗菜叶、果皮、茶叶渣、残枝落叶、剩菜剩饭可回收垃圾玻璃类、牛奶盒、金属类、塑料类、废纸类、织物类其他垃圾宠物粪便、烟头、污染纸张、破旧陶瓷品、灰土、一次性餐具有害垃圾废电池、废墨盒、废油漆桶、过期药物、废灯管、杀虫剂...

2019-11-29 17:34:55 336

原创 Windows中为Latex添加.sty文件和.cls文件

转自https://blog.csdn.net/u013587021/article/details/52903785基于Ctex,亲测有效。

2019-11-25 20:47:04 2561 2

原创 nvidia-smi上实时显示神经网络的训练状态

实现效果如下原理  利用setproctitle不断地刷新process name。实现步骤import setproctitleclass Config(object): def __init__(self): self.process_title = 'V-Net(debug)' self.epochs = 1000 ...

2019-11-22 20:08:45 541

原创 正则表达式规则

非打印字符字符描述\cx匹配由x指明的控制字符。例如, \cM 匹配一个 Control-M 或回车符。x 的值必须为 A-Z 或 a-z 之一。否则,将 c 视为一个原义的 ‘c’ 字符。\f一个换页符。\n一个换行符。\r一个回车符。\s任何空白字符,包括空格、制表符、换页符等等。\S任何非空白字符。等价于 [^ \f\n\r\t...

2019-11-21 09:52:22 149

原创 lingo入门

教学视频https://www.bilibili.com/video/av36145650?from=search&seid=3369887614110536070

2019-11-20 19:53:26 118

原创 数字序列中某一位的数字

#include <iostream>using namespace std;int digitAtIndex(int );int countOfIntegers(int );int digitAtIndex(int, int);int beginNumber(int);int digitAtIndex(int index) { if (index < 0) {...

2019-11-20 19:51:45 94

原创 1~n整数中1出现的次数【不懂】

#include <iostream>using namespace std;int NumberOf1Between1AndN(int n);int NumberOf1(const char* strN);int PowerBase10(unsigned int n);int NumberOf1Between1AndN(int n) { if (n <= 0)...

2019-11-20 19:50:26 86

原创 批量下载bilibili视频

2019.11.20bilibili视频除很少部分视频外,大部分几乎无法下载了。1、搜【annie github】,点击release下载程序,配置PATH2、下载FFmpeg Builds,配置PATH3、命令行运行即可annie及其手册:https://github.com/iawia002/annieFFmpeg Builds:https://ffmpeg.zeranoe.c...

2019-11-20 19:49:08 914

原创 局域网打印机

注意:连接局域网内的共享计算机时,要用目标地址的IP来连接,不要用主机名。

2019-11-20 19:45:06 117

原创 15 二进制中1的个数

·思想:尽量不要动原数据,负数位移时就会带上符号位,容易出问题。新建一个flag用于移动比较。#include <iostream>using namespace std;int NumberOf1(int n) { int count = 0; unsigned int flag = 1; while (flag) { if (n & flag) { ...

2019-11-20 19:38:32 101

原创 14 剪绳子

·注意:至少要切一刀。·特点:从长度4往后,一定是切割比不切割要大。#include <iostream>#include <vector>#include <algorithm>using namespace std;int maxProductAfterCutting_solution1(int length) { if (length &l...

2019-11-20 19:37:29 78

原创 13 机器人的运动范围

#include <iostream>using namespace std;int getDigitSum(int number) { int sum = 0; while (number > 0) { sum += number % 10; number /= 10; } return sum;}bool check(int threshol...

2019-11-20 19:36:32 115

原创 12 矩阵中的路径

#include <iostream>using namespace std;void printMap(bool *visited, int rows, int cols) { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { cout << visited[...

2019-11-20 19:35:59 109

原创 11 旋转数组的最小数字

·二分法搜索方法:#include <iostream>using namespace std;int Min(int * numbers, int length) { if (numbers == NULL || length <= 0) { throw new std::exception("Invalid parameters"); } int ind...

2019-11-20 19:33:32 124

原创 快速排序

#include "stdafx.h"#include <iostream>using namespace std;int RandomInRange(int start, int end) { if (start >= end) { throw new std::exception("error"); } return rand() % (end - st...

2019-11-20 19:30:06 80

原创 10 斐波那契数列

·效率对比:递归与非递归。差距很大。#include <iostream>using namespace std;long long Fibonacci(unsigned int n) { if (n <= 0) { return 0; } if (n == 1) { return 1; } return Fibonacci(n-1) + Fib...

2019-11-20 19:29:30 255

原创 9 用两个栈实现队列

#include <iostream>#include <stack>using namespace std;template<typename T> class CQueue {public: CQueue(void) {}; ~CQueue(void) {}; void appendTail(const T& node); T...

2019-11-20 19:27:43 85

原创 8 二叉树的下一个节点

·理解关键:先序遍历的意思是先遍历左子树,等到左子树全部遍历完之后才遍历自己,然后是右子树。#include <iostream>using namespace std;struct BinaryTreeNode { int m_nValue; BinaryTreeNode* m_pLeft; BinaryTreeNode* m_pRight; BinaryTreeN...

2019-11-20 19:26:43 106

原创 7 重建二叉树

·注意:前序序列和中序序列中都不能有重复的数字。#include "stdafx.h"#include <iostream>using namespace std;struct BinaryTreeNode { int m_nValue; BinaryTreeNode* m_pLeft; BinaryTreeNode* m_pRight;};BinaryTreeN...

2019-11-20 19:25:58 115

原创 6 从尾到头打印链表

·思想:本质上栈和递归实际上是同一个东西。栈能实现的,递归也能实现;递归能实现的,栈也能实现。但是小心递归导致栈溢出。// ConsoleApplication1.cpp : Defines the entry point for the console application.//#include <iostream>#include <stack>using...

2019-11-20 19:25:27 93

原创 5 替换空格

·思想:倒着copy// ConsoleApplication1.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <iostream>using namespace std;// length是数组string的最大容量,字符串实际长度并不知道...

2019-11-20 19:24:35 90

原创 字符串不同初始化方式区别

#include <iostream>using namespace std;int main() { char str1[] = "hello world"; char str2[] = "hello world"; char *str3 = "hello world"; char *str4 = "hello world"; if (str1 == str2) ...

2019-11-20 19:23:44 146

原创 4 二维数组中的查找

#include <iostream>using namespace std;// 从右上角开始bool Find(const int* matrix, const int &rows, const int &columns, const int &number) { bool found = false; if (matrix != NULL &...

2019-11-20 19:20:31 118

原创 3 数组中重复的数字

#include <iostream>using namespace std;bool duplicate(int numbers[], int length, int* duplication) { //检查前两变量 if (numbers == NULL || length <= 0) { return false; } //检查每一个元素 for (i...

2019-11-20 19:18:25 161

原创 1 赋值运算符函数

·思想:利用临时对象,进行指针交换(所指内存空间的交换),间接进行赋值,防止new出现异常覆盖掉原数据。/*******************************************************************Copyright(c) 2016, Harry HeAll rights reserved.Distributed under the BSD li...

2019-11-20 19:13:07 85

原创 OpenCV3+python3实现视频转字符动画

import sysimport osimport timeimport threadingimport cv2import pyprind# 图片转字符画的原理:首先将图片转为灰度图,每个像素都只有亮度信息(用 0~255 表示)。# 然后我们构建一个有限字符集合,其中的每一个字符都与一段亮度范围对应,# 我们便可以根据此对应关系以及像素的亮度信息把每一个像素用对应的字符表示,...

2019-11-20 18:31:54 989

原创 random_shuffle

#include <iostream>#include <vector>#include <algorithm>using namespace std;int main() { vector<int> vect; for (int i = 0; i < 100; i++) { vect.push_back(i); ...

2019-11-20 18:28:53 106

原创 文件IO

·ofstream:#include <iostream>#include <fstream>using namespace std;int main() { ofstream OpenFile("file.txt"); if (OpenFile.fail()) { cout << "打开文件错误!" << endl;...

2019-11-20 18:26:07 72

原创 template

·这里class关键字表明T是一个类型,后来为了避免class在这两个地方的使用可能给人带来混淆,所以引入了typename这个关键字,它的作用同class一样表明后面的符号为一个类型,这样在定义模板的时候就可以使用下面的方式了: template…·在模板定义语法中关键字class与typename的作用完全一样。·typename的一个重要用途:class MyArray { ...

2019-11-20 18:24:12 234

原创 rand()

·思想:srand()提供种子,rand()产生很大的随机数。#include "stdafx.h"#include <iostream>using namespace std;int main() { srand(1); for (int i = 0; i < 10; i++) cout << rand() << '\t'; c...

2019-11-20 18:22:19 552

原创 clock()

·clock()计时函数clock()是C/C++中的计时函数,而与其相关的数据类型是clock_t。在MSDN中,查得对clock函数定义如下:clock_t clock(void) ;简单而言,就是该程序从启动到函数调用占用CPU的时间。这个函数返回从“开启这个程序进程”到“程序中调用clock()函数”时之间的CPU时钟计时单元(clock tick)数。·例子:// ConsoleA...

2019-11-20 18:17:59 167

原创 python编码问题

• 在文件头部添加: # encoding: utf-8• 或者在文件头部添加: # coding=utf-8

2019-11-20 18:14:45 71

原创 KMP

·思想全在代码注释中。#include <iostream>#include <string>using namespace std;#define N 8#define MAX_NEXT 100void GetNext(string t, int next[]) { int j, k; //分别指向两个相同的字符串 j = 0; k = -1; ...

2019-11-20 18:06:43 52

原创 一字符串前缀与另一字符串后缀的最大相同子串

·思想来源于KMP,非常巧妙:KMP匹配失败后,模式串指针j正好就是模式串的前缀与字符串的后缀的最大重叠长度。#include<iostream>#include<string>using namespace std;const int maxn = 1e5 + 10;void cal_next(string str, int* next, int len){...

2019-11-20 18:04:43 741

原创 【C++】生成随机数

·生成指定范围[start, end]内的一个数:#include "stdafx.h"#include <iostream>using namespace std;int RandomInRange(int start, int end) { if (start >= end) { throw new std::exception("error"); } ...

2019-11-20 17:59:40 208

原创 随机构建一棵二叉树

·完全二叉树【不带parent指针】#include <iostream>using namespace std;struct BinaryTreeNode { int m_nValue; BinaryTreeNode* m_pLeft; BinaryTreeNode* m_pRight;};/*********************************...

2019-11-20 17:58:03 2264

原创 可视化树结构

/********************************** 可视化树结构**********************************/void padding(char ch, int n){ int i; for (i = 0; i < n; i++) putchar(ch);}void print_node(struct BinaryTreeN...

2019-11-20 17:52:43 846

原创 长途出行准备

准备好行李。准备好车票、证件、手机、充电器。准备路餐。上厕所、手机充电、接满水杯。

2019-11-20 17:50:33 103

原创 auto.js脚本入门

·根据此视频入门即可https://www.bilibili.com/video/av54488377?from=search&seid=15888036743951343421·把Auto.js的“后台弹出界面” 的权限打开,不进入Auto.js也可以运行调试脚本。...

2019-11-20 17:36:52 900 2

原创 手动安装谷歌Chrome扩展插件

·针对,解决方法如下:下载出来是个CRX文件修改crx成rar,只修改文件的格式就可以将rar解压出来将解压出来的文件全部放在一个文件夹里然后通过扩展程序——加载已解压的扩展程序——选中这个文件夹即可更新...

2019-11-20 17:32:27 503

空空如也

空空如也

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

TA关注的人

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