- 博客(126)
- 资源 (3)
- 收藏
- 关注
原创 leetcode 1209. 删除字符串中的所有相邻重复项 II(python)
个相邻且相等的字母,并删除它们,使被删去的字符串的左侧和右侧连在一起。先删除 "eee" 和 "ccc",得到 "ddbbbdaa"重复进行无限次这样的删除操作,直到无法继续为止。在执行完所有删除操作后,返回最终得到的字符串。再删除 "bbb",得到 "dddaa"最后删除 "ddd",得到 "aa"倍重复项删除操作」将会从。
2023-03-22 09:47:54 332
原创 leetcode 1437. 是否所有 1 都至少相隔 k 个元素(python)
第二个 1 和第三个 1 之间只隔了 1 个元素。每个 1 都至少相隔 2 个元素。
2023-03-22 08:26:59 167
原创 TypeError at /test/ reverse() missing 1 required positional argument: ‘viewname‘
【代码】TypeError at /test/ reverse() missing 1 required positional argument: ‘viewname‘
2023-03-20 20:31:55 115
原创 前端在用{%url ‘index ’ ‘xxx’%时报错,NoReverseMatch at /xxx
【代码】前端在用{%url ‘index ’ ‘xxx’%时报错,NoReverseMatch at /xxx。
2023-03-20 17:41:08 148
原创 显示‘str‘ object has no attribute ‘get‘
python manage.py runserver 0.0.0.0:8000,会认为是公网访问,实际是本地访问,所以会访问失败!
2023-03-19 16:09:00 327
转载 matplotlib quiver 部分参数理解
https://www.cnblogs.com/gujianmu/p/12853643.html
2022-03-10 14:08:03 353
原创 anaconda下环境管理相关命令
anaconda下python环境管理相关命令1.查看python版本python --version2.查看anaconda下的环境conda info -e3.添加3.7版本的Python环境conda create -n tensorflow python=3.74.切换到创建的环境activate tensorflow5.退出所在Python环境deactivate6.删除已安装的Python环境conda remove -n tensor
2021-03-15 17:25:14 88
原创 c++基础练习——十六进制转十进制
注意:类型的范围!!!!!!!!!!错误:第四个测试点一直过不去,最后发现是因为整数过大,设置的res类型为int,导致超出范围。改正:将res类型改为范围更大的longlong 型。#include<iostream>#include<string>using namespace std;int main(){ string s; cin>&g...
2020-04-24 17:46:44 264
原创 c++基础练习——闰年判断
#include<iostream>using namespace std;int main(){ int n; cin>>n; if(n%4==0&&n%100!=0||n%400==0){ cout<<"yes"<<endl; }else{ cout<<"no"<<endl; } ...
2020-04-24 16:10:12 344
原创 c++基础练习——字符串对比
#include<iostream>#include<string>#include<cstring>using namespace std;int main(){ string s1,s2; int l=0,r=0; getline(cin,s1); getline(cin,s2); if(s1.length()!=s2.length())...
2020-04-19 17:04:11 795
原创 c++基础练习——时间转换
#include<iostream>using namespace std;int main(){ int n,h,m,s; cin>>n; h=n/3600; m=(n-3600*h)/60; s=n-3600*h-60*m; cout<<h<<':'<<m<<':'<<s; return 0...
2020-04-17 17:29:49 810
原创 c++基础练习——阶乘计算
#include<iostream>using namespace std;int main(){ int n,cp,j,i=1,x; int res[10000]; res[0]=1; cin>>n; for(int ii=1;ii<=n;ii++){ cp=0; j=0; while(j<i){ x=res[j]*ii+...
2020-04-17 08:46:12 816
原创 c++基础练习——数列特征
#include<iostream>#include<vector>using namespace std;void InsertSort(int a[], int len){ for(int i=0;i<len;i++){ int temp=a[i]; for(int j=i-1;j>=0;j--){ if(temp<a[j]){...
2020-04-16 20:25:00 265
原创 c++基础练习——查找整数
#include<iostream>#include<vector>using namespace std;int main(){ int n,m,a,tag=-1; vector<int> res; cin>>n; for(int i=0;i<n;i++){ cin>>m; res.push_back(...
2020-04-16 20:10:29 684
原创 c++基础练习——杨辉三角形
#include<iostream>#include<vector>using namespace std;int main(){ int n; cin>>n; vector< vector<int> > res; vector<int> mid; vector<int> next;//mid保...
2020-04-16 20:02:32 418
原创 c++基础练习——特殊的数字
#include<iostream>#include<vector>using namespace std;int main(){ vector<int> res; for(int i=1;i<=9;i++){ for(int j=0;j<=9;j++){ for(int q=0;q<=9;q++){ if(i*i...
2020-04-16 19:28:37 456
原创 c++基础练习——回文数
#include<iostream>#include<vector>using namespace std;int main(){ vector<int> res; for(int i=1;i<=9;i++){ for(int j=0;j<=9;j++){ res.push_back(1001*i+110*j); } }...
2020-04-16 19:21:52 862
原创 c++基础练习——特殊回文数
#include<iostream>#include<vector>using namespace std;int main(){ int n; cin>>n; vector<int> res; if(n<=45){ for(int i=1;i<=9;i++){ for(int j=0;j<=9;j++){...
2020-04-16 19:04:31 304
原创 c++基础练习——数列排序
前几次一直是得分14,但是发现输入输出是正确的。最后发现是因为输出形式有问题,少写了空格。但是这个格式错误在测试用例的输入输出中看不出来。#include<iostream>using namespace std;void InsertSort(int a[], int len){ for(int i=0;i<len;i++){ int temp=a[i]; ...
2020-04-15 20:29:51 554
原创 c++入门训练——Fibonacci数列
#include<iostream>using namespace std;int main(){ int f1=1,f2=1; long long n,res=0; cin>>n; for(int i=3;i<=n;i++){ res=f1+f2; f1=f2; f2=res%10007; } cout<<f2; retu...
2020-04-15 20:21:03 235
原创 c++入门训练——A+B问题
#include<iostream>using namespace std;int main(){ int a,b; cin>>a>>b; cout<<a+b<<endl; return 0;}
2020-04-15 20:06:58 700
原创 c++入门训练——序列求和
#include<iostream>using namespace std;int main(){ long long n,res=0; cin>>n; for(int i=1;i<=n;i++){ res+=i; } cout<<res; return 0;}
2020-04-15 20:05:52 642
原创 c++入门训练——圆的面积
#include<iostream>#include<stdio.h>using namespace std;int main(){ double PI=3.14159265358979323; double r; cin>>r; printf("%.7f", PI*r*r); return 0;}
2020-04-15 20:04:40 760
原创 gensim库安装(镜像)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gensim
2020-03-20 15:21:47 4597 1
原创 jieba库安装(镜像)
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jieba
2020-03-06 15:10:38 22598 7
原创 规范数据集格式(lm-1m)
file = open('F:/ml-1m/ratings.txt')while 1: line = file.readline() line=line.replace("::", " ") line = line.split(" ", 4) str=line[0]+' '+line[1]+' '+line[2] # 打开一个文件 fo = ope...
2020-01-12 20:15:04 1080
原创 'dict' object has no attribute 'has_key'
has_key方法在python2中是可以使用的,在python3中删除了。eg:if dict.has_key(key):改为:if key in dict:
2020-01-11 21:15:13 595
转载 嵌入(embedding)层的理解
首先,我们有一个one-hot编码的概念。 假设,我们中文,一共只有10个字。。。只是假设啊,那么我们用0-9就可以表示完比如,这十个字就是“我从哪里来,要到何处去”其分别对应“0-9”,如下:我 从 哪 里 来 要 到 何 处 去0 &...
2020-01-11 14:36:46 7408 3
原创 html的date类型文本框自动获取并填充当前日期
<!DOCTYPE html><html lang="en"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>显示当前日期</title></head><body&g...
2019-12-14 19:53:14 2588
原创 idea操作已有(已连接)数据库出错(sqlite和MySQL数据库)
最近对数据库的操作一直出问题,同样的代码,自己就是跑不出来。后来发现,原因很愚蠢:我之前数据库有同名的数据库,在连接数据库时自然而然就连上了之前的数据库!!!解决方法:直接在idea的database里面右键数据库,remove即可。或者也可以在命令行窗口命令实现表的删除。然后重新建一个空数据库并在idea的database进行连接即可。...
2019-12-13 20:47:28 581
原创 IDEA连接mysql数据库显示错误
1.首先已经事先在电脑上安装了mysql,没安装的可以参考菜鸟教程等等~2.(时区错误)进入命令窗口(Win + R),在命令行窗口跳转到mysql安装目录下的bin目录下,我这里是C:\Program Files\MySQL\bin3.在命令行窗口输入连接数据库的语句mysql -hlocalhost -uroot -p回车,输入密码,回车4.(此步可跳过)在命令行窗口输入...
2019-12-10 16:04:19 393
原创 module 'tensorflow' has no attribute 'random_uniform'
tf1.*版本一键转化为2.0版本tf_upgrade_v2 --infile v1.*.py --outfile v2.0.pytf2.0里名字有所改变,用tf.random.uniform代替
2019-11-21 18:20:39 2525
转载 pyside2出现qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""错误解决办法
https://blog.csdn.net/ouening/article/details/81093697
2019-11-21 16:30:43 1134
转载 新电脑重新安装win10+python3.6+anaconda+tensorflow1.12(gpu版)
https://www.cnblogs.com/gaofighting/p/9917456.html
2019-11-21 00:24:46 266
书店 进销存 管理系统.rar
2019-11-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人