C++:vector遍历,拷贝,插入

vector遍历: 类C遍历,按插入顺序 vector<int> a = {1,2,3,4,5}; for(int i=0;i<a.size();i++) printf("%d%s",a[i],i==a.size()-1?"\n":" "); 迭代器遍历 vector<int> a =
分类: 其他 发布时间: 10-17 22:41 阅读次数: 0

C++:const

变量不能变: const int a = 1; //a不可被修改 指针自己不能变 int a = 1; int* const b = &a; //b只能被用来指向a,b=&c;是非法的 指针指向的数字不能变 int a = 1; const int* b = &a; //*b++;是非法的,但可以通过a++来修改b指向的数字 函数实参不能变 void ...
分类: 其他 发布时间: 10-17 22:41 阅读次数: 0

POJ:1737

楼教主男人八题中的第一题: 最大50座不同城市,组成全联通图的数量,不取模。 #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <vector> #define maxn 5
分类: 其他 发布时间: 10-17 22:41 阅读次数: 0

windows:删除指定后缀的bat脚本

@echo off :start @echo please pull in your python project root directory: @set /p dir_path= @if not exist "%dir_path%" echo.directory not exit!&goto :start @echo please input delete suffix @set /p...
分类: 其他 发布时间: 10-17 22:40 阅读次数: 0

POJ:1738

楼教主男人八题第二题,5W个叶子节点合并最小费用 最小权费和二叉树:GW算法 #include <cstdio> #include <cstring> using namespace std; #define maxn 50050 #define maxV 1000000001 int S = 1; int L = 0; long long V[maxn]; in...
分类: 其他 发布时间: 10-17 22:40 阅读次数: 0

Scrapy:测试代理ip

import requests try: requests.get('http://www.baidu.com', proxies={'http': 'http://101.96.11.73:8080'}) except: print('connect failed') else: print('success')
分类: 其他 发布时间: 10-17 22:40 阅读次数: 0

Mac:QQ登录失败err=0x12c

删掉~/Library/Containers/下的com.tencent.qq文件夹
分类: 其他 发布时间: 10-17 22:40 阅读次数: 0

Ubuntu:Your CPU supports instructions that this TensorFlow binary was not compiled to use:AVX AVX2

不要紧的问题 用一下代码屏蔽掉: import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
分类: 其他 发布时间: 10-17 22:39 阅读次数: 0

ubuntu:禁用更新

sudo vim /etc/apt/apt.conf.d/50unattended-upgrades 注释掉 Unattended-Upgrade::Allowed-Origins { // "${distro_id}:${distro_codename}-security"; // "${distro_id}:${distro_codename}-updates"; // "${dis...
分类: 其他 发布时间: 10-17 22:39 阅读次数: 0

Ubuntu18:查看显卡型号和驱动版本

lspci | grep -i nvidia # 查看显卡型号 sudo dpkg --list | grep nvidia-* # 查看驱动版本
分类: 其他 发布时间: 10-17 22:39 阅读次数: 0

Ubuntu18:wine和qq

环境介绍: 系统:ubuntu18LTS 一共分两步,第一步安装wineHQ: 删除所有之前安装的wine依赖包: dpkg -l | grep wine # 查找所有wine的依赖包 sudo apt-get --purge remove wineXXX # 卸载对应wine依赖包 添加仓库: wget -nc https://dl.winehq.org/wine-builds/Relea...
分类: 其他 发布时间: 10-17 22:39 阅读次数: 0

Ubuntu18:WPS

wps 官网下载deb版本 安装: sudo dpkg -i wps-office_10.1.0.6757_amd64.deb
分类: 其他 发布时间: 10-17 22:38 阅读次数: 0

Ubuntu:一条命令拆分大文件

许多时候,拆分大文件可能第一时间会想到用python写脚本 其实一条命令就可以 mkdir text_chunks split --lines=10000 review.json text_chunks/text_chunk_
分类: 其他 发布时间: 10-17 22:38 阅读次数: 0

python:批量安装包

有时候需要安装很多的包,一个一个安装是很麻烦的。 可以采用以下的批量安装的做法: 新建一个requirements.txt,内容如下: six tqdm torchtext>=0.2.1 future 然后运行命令: pip install -r requirements.txt 即可 ...
分类: 其他 发布时间: 10-17 22:38 阅读次数: 0

python:查看cuda版本

cat /usr/local/cuda/version.txt
分类: 其他 发布时间: 10-17 22:38 阅读次数: 0

ubuntu18:ss配置

环境说明: ubuntu18LTS python3.6.5 安装依赖包(我的电脑只需要装这一个,根据后面步骤的报错去装需要的依赖包): sudo apt-get update sudo apt-get install python-setuptools m2crypto 自行切到venv下的python(使用ubuntu自带python不太好): pip install shadowsocks...
分类: 其他 发布时间: 10-17 22:37 阅读次数: 0

nlp:中文编码类型

GB2312:简体中文编码方式,一个汉字占用两个字节,在大陆是主要编码方式。 BIG5:繁体中文编码方式,主要在台湾地区使用 GBK:支持简体和繁体中文,不支持某些非拉丁字母 UTF-8:兼容ASCII,兼容万国语言 ...
分类: 其他 发布时间: 10-17 22:37 阅读次数: 0

vue的冒泡事件

<div @click="divEven" style="border:1px #188eee solid;"> <a href="www.baidu.com" @click="aEven">百度链接</a> </div> <!--stop的使用:阻止事件冒泡的发生--> &
分类: 其他 发布时间: 10-17 22:36 阅读次数: 0

ECharts 注意点

yAxis轴的数据和 series中的 yAxisIndex: 坐标值相对性 vue  https://www.npmjs.com/package/vue-echarts 解决销毁实例和内存泄露 <chart ref="chart" :options="options" v-if="options" :auto-resize="autoResize" :watchShallow="...
分类: 其他 发布时间: 10-17 22:36 阅读次数: 0

边界值 null undefined {} 等的处理

循环跳过不存在的元素 if(!a[i]) continue;  // 跳过 null, undefined ,' ',0,不存在的元素 if(a[i] === undefined) continue; 跳过undefined + 不存在的元素   null表示一个“空”的值,它和0以及空字符串''不同, 0是一个数值, ''表示长度为0的字符串。 undefined,它表示“未定义”...
分类: 其他 发布时间: 10-17 22:36 阅读次数: 0