
日常小bug
日常小bug
危笑qwq
这个作者很懒,什么都没留下…
展开
-
bug--ValueError: shapes (1000,152) and (2,1) not aligned: 152 (dim 1) != 2 (dim 0)
两个矩阵因为维度的原因无法相乘。原创 2024-03-13 07:56:49 · 480 阅读 · 0 评论 -
bug--xxoobject has no attribute xxx
Python 创建类的实例后却不能调用写的方法,检查了半天原来是缩进的问题,def函数不应该和class并列。只能说这个英文空格太小了,看不出来。原创 2024-03-09 08:36:38 · 603 阅读 · 0 评论 -
bug -表名用了sql保留字反引号解决mybatis ySQL server version for the right syntax to use near a
错误:mybatis ySQL server version for the right syntax to use near a其实就是写了挺正确的插入语句但是报错原因我的表名是key,和mysql的保留字重复了,用反引号括起来解决:用键盘左上角的顿号写表名字 @Insert("insert into `key` values (#{name},#{key})")...原创 2021-10-10 18:24:54 · 609 阅读 · 0 评论 -
java数据类型强制转换的易错例子
public class java强制转换 { public static void main(String[] args) { int a=4/3; //Math.ceil 返回类型为double,不能用int接收 //int b=Math.ceil(4/3); int b=(int)Math.ceil(4/3); System.out.println(b); System.out.println(a)原创 2021-09-13 15:33:19 · 350 阅读 · 0 评论 -
bug---springboot报错Consider the following: If you want an embedded database (H2, HSQL
错误描述Action: Consider the following: If you want an embedded database (H2, HSQL or Derby), please put i原因在idea创建springboot项目(配置springboot initializer)时勾选了springboot data.,mysql driver这些数据库有关的组件后,并未配置连接信息就启动了springgboot项目解决配置连接参数...原创 2021-09-11 20:39:36 · 896 阅读 · 0 评论 -
bug--if+if(else if)+else结构
public class if和else { public static void main(String[] args) { int a=1; if(a==1){ System.out.println("a"); } if(a!=1){ System.out.println("非a"); }else { System.out.println("b原创 2021-09-07 16:29:33 · 118 阅读 · 0 评论 -
bug--Uncaught SyntaxError: missing ) after argument list/xxnotdefind
错误描述:原因:开始我只注意到那个函数 is not defind,检查了几遍没看出问题,再看第一个错,原来是某个其他函数语法错了,少了个逗号。原创 2021-06-24 15:37:04 · 136 阅读 · 0 评论 -
bug----ajax无法进入success方法
解决之前datatype 是json,改为text后成功执行success方法后台代码见:https://blog.youkuaiyun.com/qw160/article/details/116378335?spm=1001.2014.3001.5501原创 2021-06-19 00:53:13 · 138 阅读 · 0 评论 -
bug---blocked by CORS policy: No ‘Access-Control-Allow-Origin‘ header
bug报错:blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource原因:html在a端口,网页请求的后台在b端口运行,浏览器阻止跨端口访问解决:在c盘新建一个文件夹,例如1.右键浏览器的快捷方式–点击属性2.修改目标在原来的目标加上,注意横杠都是英文的 --disable-web-security -disable-web-security原创 2021-06-19 00:50:02 · 227 阅读 · 0 评论 -
bug--215 Can not add foreign key constraint
错误:215 Can not add foreign key constraint也就是添加外键失败解决见https://blog.youkuaiyun.com/u011951999/article/details/53184845总结起来就是1.设置引擎类型2.两个要关联的属性所有信息必须一样,像类型,字符集,排序规则,长度。。。。...原创 2021-05-28 15:23:24 · 238 阅读 · 0 评论 -
bug-No primary or constructor
错误No primary or single public constructor found for class java.io.File - and no default constructor fo原因使用springboot时一个controller中写了两个方法,第一个是普通的IO方法,第二是是需要注释的servlet方法,我将注释加在了第一个方法上导致报错 @ResponseBody @RequestMapping("deletefolder")解决将以上注释写在正确的方法上一行原创 2021-05-26 19:41:40 · 3995 阅读 · 0 评论 -
bug---xx is not defined at HTMLButtonElement.onclick
错误xx is not defined at HTMLButtonElement.onclick原因我实在js中使用变量拼接一个按钮,用document.write写在网页上,这种情况下按钮调用的函数无法识别拼接的参数解决加上转义符"正确写法 document.write("<button οnclick='showUser(""+zi+"");'>"+data1[i].name+"</button>")原创 2021-05-19 21:00:05 · 788 阅读 · 1 评论 -
bug---javascript Cannot read property ‘value‘ of null
错误描述:Cannot read property ‘value‘ of null-原因:获取input输入框内容时,js代码放在了body的上边,导致运行js时input还未加载,所以会获取不到值 var foldername1 = document.getElementById("foldername").value解决将整个script代码移动到***body标签内***的最后...原创 2021-05-19 19:03:24 · 347 阅读 · 0 评论 -
bug---sql查询中文/Unknown column ‘xxx’ in ‘where clause
错误描述如果下面两种查询弄错了就会出现错误:Unknown column ‘xxx’ in ‘where clausemysql查询的关键字是字符串变量 sql = "select * from stu where major='"+major+"'"; // 设置sql语句普通字符串 sql = "select * from stu where major='字符'"mysql查询的关键字为int sql = "select * from stu where major=原创 2021-05-12 17:27:54 · 173 阅读 · 0 评论 -
bug---easyui datagrid数据表格无法显示
错误复制黏贴官网easyui文档的js方式,无法显示解决在html加上 行列标签<table id="dg"> <!-- 如果这块不写的话,只会显示标题 ,并且由于在上方script中定义了thead,所以在table里在定义一个thead是没有意义的, 当然在页面中也是没有效果的。 --> <tbody> <tr><td>1</td><td>2</td&g原创 2021-05-07 17:12:38 · 503 阅读 · 0 评论 -
bug--java.lang.NoClassDefFoundError: net/sf/json/JSONArray
错误java.lang.NoClassDefFoundError: net/sf/json/JSONArray解决将sf.josn需要的依赖包手动添加到tomcat的lib文件夹下,不能用集成开发工具的导入原创 2021-05-03 17:15:57 · 220 阅读 · 0 评论 -
bug---Before start of result set
错误描述查询数据库时String name=rs.getString()这行报错Before start of result set解决因为ResultSet rs中声明的是一个结果集,所以不能写成这样String name=rs.getString()必须循环遍历while(rs.next()){String name=rs.getString()}...原创 2021-05-03 15:14:27 · 96 阅读 · 0 评论 -
bug---java.lang.NoSuchMethodError
错误:java.lang.NoSuchMethodError如何解决:字面上说这个方法没找到如果你确实写了这个方法,并且还是用到jsp或者sevlet,可能是jar包冲突了我这里发生的是Mysql–connecetor-jar冲突,删掉这个包即可解决...原创 2021-05-03 15:11:02 · 89 阅读 · 0 评论 -
bug---idea修改tomcat访问路径404
问题解决;修改路径不能只改server里面的url,别忘记deployment中的apllicationcontext,这才是路径原创 2021-05-01 15:17:09 · 212 阅读 · 0 评论 -
bug---he driver has not received any packets from the server.
错误:he driver has not received any packets from the server.原因;可能是springboot中配置了数据库但是集成数据库未启动(比如phpstudy和xampp)原创 2021-04-30 14:34:37 · 904 阅读 · 0 评论 -
bug---idea多级文件夹显示
问题解决:原创 2021-04-28 15:17:20 · 134 阅读 · 0 评论 -
bug---Field jdbcTemplate in com.e.demo.controller.lianjie required a bean of type ‘org.springframewo
错误springboot连接阿里云rds数据库报错Field jdbcTemplate in com.e.demo.controller.lianjie required a bean of type ‘org.springframework.jdbc.core.JdbcTemplate’ that could not be found.Consider defining a bean of type ‘org.springframework.jdbc.core.JdbcTemplate’ in you原创 2021-04-28 12:46:11 · 897 阅读 · 0 评论 -
文件站项目docu阶段笔记---后台又java转为php
完整项目代码见阿里云盘,稍后上传debug1 ajax前台表单如何传参给后台php不需要 action=…而是button type=“submit” οnclick="showSite(litter.value),showsite是ajax函数这里外边如果套form表单标签会出错,fom<fom id="demo1" class="tr-slider-form wow fadeInUp" data-wow-duration="1.5s" data-wow-delay=".4s">原创 2021-04-28 11:51:30 · 138 阅读 · 0 评论 -
ajax+php连接阿里云数据库
简略php连接数据库,前端页面通过ajax发送查询请求注意xmlhttp.open(“GET”,“docusql.php?q=”+str,true);?q别忘记写,否则无法传递参数给php整个项目要放在phpstudy的www文件夹中,否则php无效项目代码稍后上传阿里云盘...原创 2021-04-23 15:50:34 · 295 阅读 · 0 评论 -
bug---uniapp报错Component template should contain exactly one root element
错误:Component template should contain exactly one root elementIf you are using v-if on multiple elements, use v-else-if to chain them instead.解决:template标签下必须有一个view标签套在其他元素外面不能是一个view和一个button并列...原创 2021-04-14 15:01:36 · 205 阅读 · 0 评论 -
bug---maven报错 ...dependency not found
错误描述:Dependency ‘com.alibaba:fastjson:1.2.76’ not found解决:关掉idea重新打开即可原创 2021-04-12 16:05:11 · 840 阅读 · 1 评论 -
bug---由于协议未知,无法导航至“localhost:8080
问题描述:由于协议未知,无法导航至“localhost:8080,直接在浏览器地址栏可以访问,但是用a href 无法跳转解决:加上协议即httpa href=“http://localhost:8080/list”>原创 2021-04-07 15:07:56 · 1828 阅读 · 0 评论 -
bug---xxx函数is not defined
问题:解决:script标签引入了外部js,例如src=js/min.js,导致写在htmlbody内部的js代码失效原创 2021-04-04 11:21:04 · 197 阅读 · 0 评论 -
bug--servlet输出中文乱码设置字符集仍然不解决
问题servlet输出中文出现乱码,在网页端显示为“???”,按教程设置utf-8仍然是问号解决在设置字符集的代码之前不能有getwriter代码设置字符集step1:设置eclipse的字符集右键项目–property—resouscestep2:在servlet代码中设置字符集request.setCharacterEncoding("utf-8"); //1 response.setContentType("text/html;charset=utf-8"); //2 r原创 2021-03-23 17:28:42 · 278 阅读 · 1 评论 -
bug--eclipse新建servlet时xml报错/动态web3.1版本jsphtml位置
描述新电脑下载的eclipse,想测试一下就新建了一个servlet,结果一打开web.xml报了很多错,web-app,display-name都报错解决在新建动态web工程时候手欠选择了2.5版本,因为之前用的老版本eclipse都是2.5在改成3.1之后就好了,根本看不到web.xml文件,自动配置...原创 2021-03-23 17:07:19 · 210 阅读 · 0 评论 -
bug---新导入的springboot项目报错
新导入后,大部分代码都报错,这时候可以新建一个空白的springboot项目,后台自动下载依赖。这时候还是有部分代码红的可以点击右侧maven,点击刷新按钮重新加载。原创 2021-03-19 08:38:28 · 244 阅读 · 0 评论 -
bug---javascript代码无效
<script> var person={name:"张三",age="18"}; document.write(person.name); document.write(person.age); function f(){ return 100; } var a=f(); document.write(a); alert("hello"); </script>错误在第二行age=18,应该用冒号.原创 2021-03-05 16:00:29 · 181 阅读 · 0 评论 -
bug--sprintboot写html图片资源找不到
在sprintboot里写了个html,想放一张背景图,怎么也放不进去在浏览器打开f12,发现报错我前端代码写的是本地路径,他找这个图片居然去http。。。我也不知道为啥,只能将计就计,改一下html的background-image路径这样凑个http路径,这行代码在springboot里面还是报错的,但是html语言报错无所谓,直接运行图就出来了...原创 2021-02-03 16:59:10 · 162 阅读 · 0 评论 -
bug---python remove bug
2 for i in list1:remove i这么写是跳着删的如果不跳要改成:for i in list1[:]原创 2020-12-14 14:33:33 · 243 阅读 · 0 评论 -
pyhton复习12/6---小bug
unindent does not match any outer indentation level错误原因:这里多了 个空格,不容易发现原创 2020-12-09 18:04:21 · 92 阅读 · 0 评论 -
bug----python缩进
print("........")^IndentationError: unexpected indent有些行 没有顶格写,报错原创 2020-12-07 17:19:00 · 280 阅读 · 0 评论 -
bug---找不到main方法--设置自动保存
新建一个class,想试试输出,结果报错但是我已经写了psvm原因是没有保存代码解决:CTRL+S保存或设置自动保存原创 2020-10-15 10:23:08 · 114 阅读 · 0 评论 -
小bug---同时开两个spring boot项目
报错:8080已被占用解决:停止一个原创 2020-10-02 16:07:12 · 180 阅读 · 0 评论 -
小bug---连接数据库报错
bugYou must configure either the server or JDBC driver(via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.2.Error creating bean with name ‘jdbc connector’ defined in class path原创 2020-09-27 12:17:21 · 205 阅读 · 0 评论 -
springboot--maven 的bug补充/B站教程地址
https://blog.youkuaiyun.com/jwcxs_m/article/details/80076909?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2基本按照这个网址的设置方法改了设置还加了这原创 2020-09-18 17:54:12 · 138 阅读 · 0 评论