java.lang.StringIndexOutOfBoundsException: String index out of range: 0 [问题点数:40分,结帖人aspnetzhaoye]

Bbs1
本版专家分:12
结帖率 75%
Bbs9
本版专家分:68004
版主
Blank
红花 2016年3月 Java大版内专家分月排行榜第一
2016年2月 Java大版内专家分月排行榜第一
2015年11月 Java大版内专家分月排行榜第一
2015年10月 Java大版内专家分月排行榜第一
2014年8月 Java大版内专家分月排行榜第一
2014年7月 Java大版内专家分月排行榜第一
2014年5月 Java大版内专家分月排行榜第一
Blank
黄花 2016年1月 Java大版内专家分月排行榜第二
2015年12月 Java大版内专家分月排行榜第二
2015年8月 Java大版内专家分月排行榜第二
2015年3月 Java大版内专家分月排行榜第二
2015年1月 Java大版内专家分月排行榜第二
2014年12月 Java大版内专家分月排行榜第二
2014年11月 Java大版内专家分月排行榜第二
2014年6月 Java大版内专家分月排行榜第二
2014年4月 Java大版内专家分月排行榜第二
2014年1月 Java大版内专家分月排行榜第二
2013年11月 Java大版内专家分月排行榜第二
Blank
蓝花 2015年9月 Java大版内专家分月排行榜第三
2015年6月 Java大版内专家分月排行榜第三
2015年5月 Java大版内专家分月排行榜第三
2015年2月 Java大版内专家分月排行榜第三
2014年3月 Java大版内专家分月排行榜第三
2013年12月 Java大版内专家分月排行榜第三
Bbs1
本版专家分:12
Bbs1
本版专家分:12
Bbs1
本版专家分:12
Bbs4
本版专家分:1714
Bbs1
本版专家分:12
Bbs1
本版专家分:12
Bbs1
本版专家分:12
Bbs1
本版专家分:0
Bbs1
本版专家分:0
Bbs1
本版专家分:0
Bbs1
本版专家分:0
java.lang.StringIndexOutOfBoundsException: String index out of range: 9 at java
java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 9 rnat java.lang.String.sub<em>string</em>(String.java:1765) rnat com.sq.entity.builder.Utilities.getStrLen(Utilities.java:1462) rnat org.apache.jsp.entity.member.resenterpriselist_jsp._jspService(resenterpriselist_jsp.java:373) rnat org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:717) rnat org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) rnat org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) rnat org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) rnat javax.servlet.http.HttpServlet.service(HttpServlet.java:717) rnat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) rnat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) rnat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) rnat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) rnat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) rnat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) rnat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) rnat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) rnat org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) rnat org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) rnat org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) rnat java.lang.Thread.run(Thread.java:595) rnrnrn这是一个发布的别人的网站,可是里面有很多地方都报的这同一个错,怀疑不是单纯的下标越界问题,不晓得原因究竟出在哪里?希望有遇到类似情况 的高手解答一下迷津,谢了!!!
java.lang.StringIndexOutOfBoundsException: String index out of range: -6
在解析数据库中一个字段的数据的时候总是报数组越界这个错误,具体情况:rn数据库中有4W多条数据,我要比较a字段和b字段中是否有相同部分,用到了字符串的sub<em>string</em>()方法rn我测试过多次,但每次报错的数据都不一样,都报数组越界的错。rnrnIR_SID IR_SRCNAME rn----------- -------------------------rn5963 JB 3540-1983 ; rnrnrnIR_SID IR_SRCNAME rn----------- -------------------------rn7216 JB/T 8648.2-1997 ; rnrnIR_SRCNAME的数据是我要用sub<em>string</em>()方法处理的数据,运行一次会报处理JB 3540-1983出现数组越界的错,再重新运行一次会报处理JB/T 8648.2-1997出现数组越界的错,运行多少次就会出现多少次不同的数据报错,并且都是数组越界,我的问题是[color=#FF0000]如果真的是某个数据或者某些数据在用sub<em>string</em>()处理的时候有错的话应该是一直报错,为什么运行一次就报不同的数据有错呢?[/color]rnrn下面是具体代码:rn[code=Java]rnconn = DBConnectionManager.getInstance().getConnection();rnString sql = "select IR_SID,IR_URLTITLE,IR_SRCNAME from URLCONTENT";rnSQLHelper.conn = conn;rnlist = SQLHelper.ExecuteReader(sql, null);rnfor(int i = 0 ; i < list.size(); i ++)rnObject[] obj = (Object[]) list.get(i);rnid = Integer.parseInt(obj[0].toString());rnurltitle = ((String) obj[1]).trim();rnif(obj[2] == null||"".equals(((String) obj[2]).trim()))rn srcnames = "";rnelsern srcnames = ((String) obj[2]).trim();rnrnString titlenum = null;rnString newcol = "";rnif(!urltitle.contains("-"))rn urltitle = urltitle+"-";rnrn titlenum = (urltitle.sub<em>string</em>(urltitle.lastIndexOf(" ")+1, urltitle.lastIndexOf("-"))).trim();rn if(srcnames!=null)rn String[] srcname = srcnames.split(";");rn for(int j = 0 ; j < srcname.length ; j ++)rn if(srcname[j]!=null&&srcname[j].length()!=0)rn if(!srcname[j].trim().contains("-"))rn srcname[j] = srcname[j].trim()+"-";rn rn rn String srcnum = (srcname[j].trim().sub<em>string</em>(srcname[j].trim().lastIndexOf(" ")+1, srcname[j].trim().lastIndexOf("-"))).trim();rn if(srcnum.equals(titlenum))rn newcol = srcname[j].trim();rn rn rn rn rn rn updatesql.append("update URLCONTENT set col='"+newcol+"' where IR_SID="+id+";");rnrnconnect = DBConnectionManager.getInstance().getConnection();rnSQLHelper.conn = connect;rnSQLHelper.ExecuteNonQuerys(updatesql.toString(), null);rnSystem.<em>out</em>.println("执行完毕!");rn[/code]
java.lang.StringIndexOutOfBoundsException: String index out of range: -1错误
[img=https://img-bbs.csdn.net/upload/201704/14/1492166177_246376.png][/img][img=https://img-bbs.csdn.net/upload/201704/14/1492166190_367039.png][/img]rnrn //向服务器获取根目录rn public static String getRootList() throws Exceptionrn String json = "\"type\":\"getRootList\"";rn <em>out</em>put.write(json.getBytes());rn <em>out</em>put.flush();rn byte[] b = new byte[1024];rn int len = input.read(b);rn json = new String(b,0,len);//字符串进行转化rnrn Config.ROOT_LIST_JSON_STR = json;rn return json; rn rn[img=https://img-bbs.csdn.net/upload/201704/14/1492166266_975276.png][/img]rntry rn String json_str = Config.service.getRootList();rn System.<em>out</em>.println(json_str);rn JSONObject json = JSONObject.fromObject(json_str);//对json的解析rn rn JSONArray jsonArray_mulu = json.getJSONArray("mulu");rn JSONArray jsonArray_files = json.getJSONArray("files");rn rn this.removeAll();rn rn int count = jsonArray_mulu.size()+jsonArray_files.size();rn rn for (int i = 0; i < jsonArray_mulu.size(); i++) rn JSONObject mulu = jsonArray_mulu.getJSONObject(i);rn rn this.add(new FileJPanel(mulu.getString("rdid"), mulu.getString("did"), "DIR", mulu.getString("dname")));rn rn rn for (int i = 0; i < jsonArray_files.size(); i++) rn JSONObject file = jsonArray_files.getJSONObject(i);rn this.add(new FileJPanel(file.getString("did"), file.getString("fid"), "FILE", file.getString("fname")));rn rn rn rn this.setPreferredSize(new Dimension(508,(count/5+(count%5==0?0:1))*135));rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn javax.swing.JOptionPane.showMessageDialog(this.getParent(), "网络异常,请稍后再试");rn rn相关的代码贴出来了,但不是很理解这个数组怎么就越界了。也不知道怎么去修改
Mybatis批量插入index out of range错误(较偏的错误)
批量插入,错误是何,拒绝转载!前言原因改进ndn前言n往往我们看到网上关于各类关于批量插入报这种错误的文章都是传入的集合为null,或者是参数获取不对等等,但是在开发的时候同事遇到了这种类型的错误,我一直以为是网上那些博客那些原因造成的,于是,两只眼睛一直盯着代码看来许久都没有找出什么问题。那是什么问题呢?n原因n是由于项目中用的是sharding-jdbc来进行数据库连接,而sharding-j...
root cause java.lang.StringIndexOutOfBoundsException: String index out of range
HTTP Status 500 -rnrntype Exception reportrnrnmessagernrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexceptionrnrnorg.apache.jasper.JasperException: java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:502)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:430)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnroot causernrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn java.lang.String.sub<em>string</em>(String.java:1932)rn org.apache.jsp.admin.product_005fadd_005fok_jsp._jspService(product_005fadd_005fok_jsp.java:78)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnnote The full stack trace of the root cause is available in the Apache Tomcat/6.0.33 logs.
java.lang.StringIndexOutOfBoundsException: String index out of range: 116
at java.lang.String.checkBounds(String.java:402)rnat java.lang.String.(String.java:443)rnat jxl.biff.StringHelper.getString(StringHelper.java:164)rnat jxl.read.biff.WriteAccessRecord.(WriteAccessRecord.java:56)rnat jxl.read.biff.WorkbookParser.parse(WorkbookParser.java:821)rnat jxl.Workbook.getWorkbook(Workbook.java:237)rnat jxl.Workbook.getWorkbook(Workbook.java:198)rnat com.iedudata.action.AddStudentResultRecordAction.addExamResult(AddStudentResultRecordAction.java:454)rnat com.iedudata.action.AddStudentResultRecordAction.addStudentResultRecord(AddStudentResultRecordAction.java:89)rnat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rnat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rnat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rnat java.lang.reflect.Method.invoke(Method.java:597)rnat com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rnat com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rnat com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rnat org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)rnat com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rnat com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rnat com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rnat com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rnat com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn
java.lang.StringIndexOutOfBoundsException:String index out of range:-1
程序如下:rnrn包上述错误,没见过怎么回事?
python使用format出现tuple index out of range报错的可能原因及解决
关于python 使用format格式化输出时出现IndexError: tuple <em>index</em> <em>out</em>of <em>range</em>报错的原因及解决方法rn本人python小白,希望用博客记录下自己犯的错误供自己日后编程和大家编程中参考和防范。rnrn上图是本人变成时出现报错的截图,该报错:tuple <em>index</em> <em>out</em> of <em>range</em>意为元组指数超过范围。在这里format里面的参数和前面的槽是一一对应的,因此...
富文本编辑器图片上传失败的BUG解决:IndexError:list index out of range
富文本编辑器图片上传失败的BUG解决n问题原因n我们将通过Django上传的图片保存到了FastDFS中,而保存在FastDFS中的文件名没有后缀名(.png/.jpg/.jif),而ckeditor在处理上传的文件名按照有后缀名来处理,所以会出现bug错误nn解决方法n找到虚拟环境目录中的ckeditor_uploader/views.py文件,如n~/.virtualenvs/meiduo/l...
Selenium自动化进行浏览器窗口切换时,报错:“IndexError: list index out of range
使用的窗口切换方法为:       handles = self.driver.window_handlesnself.driver.switch_to.window(handles[1])原因:   点击链接打开一个新窗口的动作还没有完成时,代码已经开始执行切换窗口动作,导致获取不到列表数据。解决办法:   添加等待时间,等待新窗口加载完毕之后,再执行切换窗口动作。  ...
爬取淘宝评论时出现list index out of range问题
list <em>index</em> <em>out</em> of <em>range</em>  列表越界Traceback (most recent call last):  File &quot;G:/workSpace/Python/TB_Crawler/Crawler_train.py&quot;, line 71, in &amp;lt;module&amp;gt;    print(getCommentsList(ItemURL2))  File &quot;G:/workSp...
Faster RCNN 训练自己的检测模型
一、准备自己的训练数据根据pascal VOC 2007的训练数据集基本架构,第一步,当然是要准备自己的训练图片集,本文直接将自己的准备的图片集(.jpg)扔到如下文件夹下:n$(py-faster-rcnn)/data/VOCdevkit2007/VOC2007/JPEGImages第二步,根据上述自己的要训练检测的物体图片集,标注相应的.xml文件(我是自己写了一个简单的矩形框标注工具,生成相应
python 遍历避免list index out of range 超界问题 ----使用句柄遍历
https://blog.csdn.net/qq_27261889/article/details/80422528n
python列表删除会出现一个错误 list index out of range
1,这是列表在删除的时候出现的一个问题,目的是为了删除列表中的0元素# _*_ coding:utf-8 _*_n# __author__ = 'dragon'nP = [0, 1, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 1, 0,n 44, 1, 0]nfor i in <em>range</em>(0,len(P)-1):n if(P[i] ==
Go语言学习八:切片(slice)和范围(range
// Go 语言切片是对数组的抽象。切片的单词来源于可以对其他数组和切片进行片段截取nnn// Go 数组的长度不可改变,在特定场景中这样的集合就不太适用,n// Go中提供了一种灵活,功能强悍的内置类型切片("动态数组"),n// 与数组相比切片的长度是不固定的,可以追加元素,n// 在追加时可能使切片的容量增大。nnnpackage mainnnnimport "fmt"nnnfunc mai
求助:String index out of range: 0 !!!
[img=https://img-bbs.csdn.net/upload/201606/27/1467029138_584565.png][/img]rn当程序在执行这条语句时,报String <em>index</em> <em>out</em> of <em>range</em>: 0!!异常 但是自己也没有使用过数组之类的容器,求各位大大帮助,已经纠结两天了!
(上传问题)java.lang.StringIndexOutOfBoundsException: String index out of range: -63657
大家好! 小弟为这事苦恼许久。rnrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -63657rnrn错误原因是上传文件导致的。rnrn上传组件:jspSmartUpload.jarrnrn测试图片:pic01.jpgrnrn分辨率为:400×400rnrn大小:66.1 KB (67,704 字节)rnrn占用:80.0 KB (81,920 字节)rnrn本地测试上传,没有错误。但是将程序上传到服务器后,在服务器上测试的时候个别图片就会报错。rnrn不知道大家有没有碰到过这类事情?rnrn请帮小弟解惑! 在此谢过了!
救命啊!!!老是报java.lang.StringIndexOutOfBoundsException: String index out of range: 16?????
我在 往SQLSERVER中循环插入1-1000的ID的时候老是报java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 16,代码如下:rn try rn // connection= DriverManager.getConnection(url11,user11,password11); rn connection.setAutoCommit(false);// 事物处理 rn for(i=0;ialert('卡号[ "+qskh+" ]已存在,请确认你要添加的卡段!');self.history.back();"); rn elsern SQL="";rn SQL="insert into newcard(onlyid,card,lrfs,cardtype,nj,price,dls,ffsj,fffs,ffr) values('"+getOnlyID()+"','"+qskh+"','"+lrfs+"','"+cardtype+"','"+nj+"','"+price+"','未代理',GETDATE(),'"+fffs+"','"+ddd+"')";rn connection= DriverManager.getConnection(url11,user11,password11); rn stmt=connection.createStatement();rn iTmp=stmt.executeUpdate(SQL); rn SQL="";rn rn qskh1=qskh1+1;rn qskh=String.valueOf(qskh1);rn SQL=""; rn rn if(iTmp>0)rn <em>out</em>.println(" ");rn elsern <em>out</em>.println(" ");rn rn rn catch(SQLException e)rn <em>out</em>.print(e);rn connection.rollback();rn
Python学习-机器学习实战-ch04 Bayes
毕业论文写不下去,就逃避来学这个n万事开头难,要勇敢迈出第一步n加油!n========================================================================================n贝叶斯的原理不赘述啦,网上还是有很多资料的nnn创建一个数据集,书中是以文档分类的例子来讲ndef loadDataSet():
faster-rcnn 中训练自己的数据出现的错误
训练过程中错误nnerror 1:assert (boxes[:, 2] >= boxes[:, 0]).all()nnProcess Process-1:nTraceback (most recent call last):nFile "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrapnself
JStorm UI问题排查
现象n点击一个topolog的页面,发现出现错误。njava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -2n java.lang.String.sub<em>string</em>(String.java:1967)n com.alibaba.jstorm.ui.tags.ErrorTag.getErrorContent(Er...
String index out of range: 6
[img=https://img-bbs.csdn.net/upload/201305/18/1368875784_483066.png][/img]rn[img=https://img-bbs.csdn.net/upload/201305/18/1368875946_841555.png][/img]rn[img=https://img-bbs.csdn.net/upload/201305/18/1368875959_219033.png][/img]rnrnrn老是说 字符串索引超出范围 到底哪里错了????
奇怪的 String index out of range
int chars = newsform.getContent().length(); //总字符数 intrn int PerPage = 1000; //每页要分的字符数rn int allpage; //总页数rnrn allpage = (chars + PerPage - 1) / (PerPage); //取得总页数rn rn String str[] = new String[allpage];rnrn String news = getStr(newsform.getContent());rn System.<em>out</em>.println(allpage+"页");rn System.<em>out</em>.println(chars+"个字符");rn for (int i = 0; i < allpage; i++) rn rn if (i==allpage-1) rn rn str[i] = news.sub<em>string</em>((i * PerPage));rn System.<em>out</em>.println(str[i].length());rn rn else rn rn str[i] = news.sub<em>string</em>((i * PerPage), ((i + 1) * PerPage));rn System.<em>out</em>.println("第"+i+"次"+str[i].length());rn rnrn rn rn打印出:rn6页rn5191个字符rn第0次1000rn第1次1000rn第2次1000rn第3次1000rnrn这是错误:String <em>index</em> <em>out</em> of <em>range</em>: 5000rnrn帮我看下怎么会错的?
String index out of range: -1
String <em>index</em> <em>out</em> of <em>range</em>: -1rnrn是怎么回事啊 rnrn谢谢
Ubuntu安装过程中出现Out of Range
Ubuntu安装过程中出现了<em>out</em> of <em>range</em>,如何解决。
String index out of range: 48
String <em>index</em> <em>out</em> of <em>range</em>: 48
react native常见的真机调试错误及警告集锦(持续更新中...)
1,undefined不是函数(评估'_this.registerEvents()')nn由于项目使用了最新的RN版本:0.57.0,所引起的:nn首先在项目目录下运行react-native start --reset-cache;nn之后再运行react-native run-android就可以了;nn2、 TaskQueue: Error with task : Invariant Vio...
Jsoup的小坑
在使用jsoup的cssSelector获取元素时候,获取到元素在父元素中的位置,要使用e.elementSiblingIndex()获取,这个方法获取到的是正常的元素位置,是元素前后标签一一对应的比如在一个div里&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt;所在的位置是5(从0开始)使用e.elementSiblingIndex()可获得5坑在于e.siblingIndex()这个方法...
python3实现《机器学习实战》遇到的问题:range函数
最近在看学习《机器学习实战》这本书。这本书上用的python2的语法,和python3的语法不太一样。由于本人python小白,看了python3的语法,准备自己实现一下代码,遇到了一些问题,故开贴记录一下。rnrnrn书上P82页。书上给出的dataIndex=<em>range</em>(m)然后循环最后一句是rndel(dataIndex[randIndex])rnpython3中这样报错了。rn结果发现原来
python-excel的模块xlrd和xlwt用法及注意事项整理
本文为整理性文章,将会不定期更新,一旦发现bug就会更新。n另外一句话总结一下:这三个模块虽然简单易用,但是bug太多,功能太少,无法吐槽,远远没有perl的excel模块好用。n n目录:n一、主要方法列表n二、已知BUG列表n三、官方文档下载
std::out_of_range 抛出抛出异常
[code=cpp]n// <em>out</em>_of_<em>range</em> examplen #include // std::cerrn #include // std::<em>out</em>_of_<em>range</em>n #include // std::vectorn n int main (void) {n std::vectorint> myvector(
raft之 为什么不能直接commit 上一个term的entry
n n n nnnnn屏幕快照 2017-07-03 下午5.56.36.pngnn上图中, 最上面表示的<em>index</em>, S1~S5分别表示的是服务器, (a)~(b) 代表了不同的场景, 每个小块中的数字表示了itemid。n现分析如下:n(a) 场景: S1是leader,termId是2,写了一条日志到S1和S2,当前机群表示的leader表示为(termI...
pytorch | pytorch实战过程中遇到的问题记录与总结
本篇的普适度不高,都是我个人在一个特定项目中遇到的问题的记录,以防再次出现相同错误时,还要花费力气去查找。nn你可以试着用ctrl+F,输入你想要搜索的关键词,快速确定这里有没有你想要的信息。Have a nice day ^-^nnRuntimeError: Dimension <em>out</em> of <em>range</em> (expected to be in <em>range</em> of [-1, 0], but got 1...
weblogic11g启动时报错
今天在启动weblogic 11g时发现报如下错误:rn rnjava.lang.ClassCastException: com.octet<em>string</em>.vde.backend.BackendRoot cannot be cast to com.octet<em>string</em>.vde.backend.standard.BackendStandardrnat weblogic.ldap.EmbeddedLD...
StringUtil:字符串处理的工具类
一个字符串处理的工具类(●’◡’●) n包含以下功能:判断应用程序是否安装 n字符拆分成数组 nMD5 加密 n拼接后的字符串 n替换字符串 n判断多个参数是否都为空 n将字符串转换成HTML格式的字符串 n将HTML格式的字符串转换成常规显示的字符串 n获取加密的手机号 n检查手机号 n验证固定电话号码 n检查密码有效 n根据<em>string</em>.xml资源格式化字符串 n验证身份证号码 n将元单位数字转
faster rcnn源码解读(五)之layer(网络里的input-data)
faster rcnn用python版本的https://github.com/rbgirshick/py-faster-rcnnnlayer源码地址:https://github.com/rbgirshick/py-faster-rcnn/blob/master/lib/roi_data_layer/layer.pyn源码:n# ------------------------------
Bits index out of range
对 Delphi 5 ClientDataSet, Edit操作, Post时报错 Bits <em>index</em> <em>out</em> of <em>range</em>, insert时正常, 不知是何原因?
index Out of Range "">"DBGrid index Out of Range "
Query1->DisableControl();rnfor(int i=0; iAppend();rn Query1->FiledByName("f1")->Value="sss";rn Query1->FiledByName("f2")->Value="sss1";rn Query1->Post();rnrnQuery1->EnableControl();rnrn为什么加上 :rnQuery1->DisableControl();rnQuery1->EnableControl();rn时有时候会出现"DBGrid <em>index</em> Out of Range " 错误!rn
jfinal 分页时,sql动态传值出错
错误:Parameter <em>index</em> <em>out</em> of <em>range</em> (1 &amp;gt; number of parameters, which is 0)解决方法:此错误是指传入的参数和你要接受的参数不匹配。参数 传多了一个,没有接受参数,或者说 没有占位符 ,你给1个参数错误可能:sql拼写错误导致没识别到接受参数等,或者sql没有写接受参数,又或者你接受的参数位置的单引号周围出现错误。又或者我遇到的这...
String index out of range: -1 异常,急需处理
nnnn  
String index out of range: -2问题
今天突然遇到这个问题。String <em>index</em> <em>out</em> of <em>range</em>: -2不知道为什么?请高手指点迷津。rn[code=Java]java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -2rn at java.lang.String.sub<em>string</em>(String.java:1444)rn at jsp_servlet._fams.__tb_assetscard_car_doadd._jspService(__tb_assetscard_car_doadd.java:203)rn at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)rn at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7047)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)rn at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)rn at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)rn at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)rn at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)rn at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)[/code]
错误提示:String index out of range: 500?
请教大家: rn我在数据录入时把好几个字段用"*"分开,存储在一个字段中。在从数据库中取出数据时,语句如下. rnResultSet rs=st.executeQuery("select * from tblMain"); rnrs.next(); rnString resip=rs.getString("resipID"); rnzym=rs.getString("title"); rnfujiazym=rs.getString("titleAlternative"); rnint m=fujiazym.length(); rnint i=0; rnint j=0; rnint k=0; rnString fjzym[]; rnfjzym=new String[20]; rnrnwhile(!(fujiazym.equals("*"))) rnj=fujiazym.<em>index</em>Of('*'); rnk++; rnfjzym[k]=fujiazym.sub<em>string</em>(i,j); rnfujiazym=fujiazym.sub<em>string</em>(j+1,m); rn rn执行后出现错误提示, rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 500 rn我的数据库中的titleAlternative字段大小是500.请教是何原因rnrn
index out of range exception??
question:rn [color=#0000FF] rn <em>index</em> <em>out</em> of <em>range</em> exception??[/color]rnrnerror code :rnrn [color=#FF00FF] if (!Convert.IsDBNull(reader["Name"]))rn username = reader["Name"].ToString();[/color]rnrnrnsources code:rnrn public bool LoginUser(<em>string</em> username,<em>string</em> pwd)rn rn rn bool exists = false;rn SqlParameter[] parms = new SqlParameter[2];rn parms[0] = new SqlParameter("@name", SqlDbType.NVarChar, 100);rn parms[1] = new SqlParameter("@password", SqlDbType.NVarChar, 100);rn parms[0].Value = username;rn parms[1].Value = pwd;rn SqlDataReader reader = DbTools.ExecuteReader("LoginUserProce", parms);rnrn if (reader.Read())rn rn exists = true;rn [color=#0000FF] if (!Convert.IsDBNull(reader["name"]))rn username = reader["name"].ToString();[/color]rn if (!Convert.IsDBNull(reader["password"]))rn pwd = reader["password"].ToString();rn rn rn reader.Close();rn return exists;rnrn rnrnrn
grid index out of range
beginrn dmData.adoQCode.open;rn dmData.adoQCode.Append;rn dmData.adoQCode.FieldByName('Type').AsString := cbbType.Text;rn dmData.adoQCode.FieldByName('Value').AsString := edtValue.Text;rn dmData.adoQCode.FieldByName('Mem').AsString := edtMem.Text;rn dmdata.adoQCode.Post;rn end;rn我用的是DBgrid和Access库,在添加一条记录时报出grid <em>index</em> <em>out</em> of <em>range</em> 的错误,请各位知道的加以指点
string index out of range字符串怎么越界了?
打印出来s.encode('hex')是 0300 但是打印s[1]却报下面错误?rn<em>string</em> <em>index</em> <em>out</em> of <em>range</em>
自己的数据在caffe上训练识别遇到的问题及解决方案
网上有很多教程,文中的源码大多都是借用别人的,但在自动动手做的时候出现了很多问题,自己查了很多资料,把相关问题记录下,给新手的你一些启示: n如果你是第一次使用caffemodel,建议你参考 nhttp://www.cnblogs.com/denny402/p/5111018.html这个博客,它使用了caffe里自带的生成模型来识别,在caffe/examples/images的目录下,有一张自
数据库最后一个字段Null导致mybatis抛出异常ArrayIndexOutOfBoundsException
数据库最后一个字段Null导致mybatis抛出异常ArrayIndexOutOfBoundsExceptionmybatis抛出异常ArrayIndexOutOfBoundsException项目框架出错原因解决方法nmybatis抛出异常ArrayIndexOutOfBoundsExceptionn项目框架nSpring boot1.5.9 + mybatis3 + mysql-conecto...
String index out of 4解决方法
String <em>index</em> <em>out</em> of 4解决方法
String index out of range: -91 怎么解决?
String files = "[2010-07-19 08:20:51] Uin=1072, UserName=林立, Addr=XXXX:1047, Action=login, Mode=local, Result=0(success)\n"rn+ "[2010-07-19 22:55:08] Uin=1017, UserName=伟文, Addr=XXXX:1070, Action=log<em>out</em>, Mode=local";rn rn String loginTime="";rn int uin=0;rn String userName="";rn String addr="";rn String action="";rn String mode="";rn String result="";rn String[] lines = files.split("\n");rn for(String line:lines)rn rn vo = new LogVO();rnrn int <em>index</em>1 = line.<em>index</em>Of("[");rn int <em>index</em>2 = line.<em>index</em>Of("]");rn loginTime = line.sub<em>string</em>(<em>index</em>1+1, <em>index</em>2);rn rn int <em>index</em>3 = line.<em>index</em>Of("Uin=");rn int <em>index</em>4 = line.<em>index</em>Of(",", <em>index</em>3);rn uin = Integer.parseInt(line.sub<em>string</em>(<em>index</em>3+4, <em>index</em>4));rnrn int <em>index</em>5 = line.<em>index</em>Of("UserName=");rn int <em>index</em>6 = line.<em>index</em>Of(",", <em>index</em>5);rn userName = line.sub<em>string</em>(<em>index</em>5+9, <em>index</em>6);rnrn int <em>index</em>7 = line.<em>index</em>Of("Addr=");rn int <em>index</em>8 = line.<em>index</em>Of(",", <em>index</em>7);rn addr = line.sub<em>string</em>(<em>index</em>7+5, <em>index</em>8);rnrn int <em>index</em>9 = line.<em>index</em>Of("Action=");rn int <em>index</em>10 = line.<em>index</em>Of(",", <em>index</em>9);rn action = line.sub<em>string</em>(<em>index</em>9+7, <em>index</em>10);rnrn int <em>index</em>11 = line.<em>index</em>Of("Mode=");rn int <em>index</em>12 = line.<em>index</em>Of(",", <em>index</em>11);rn mode = line.sub<em>string</em>(<em>index</em>11+5, <em>index</em>12);//到了这里就说下标越界了rn if(line.contains("Result="))rn rn int <em>index</em>13 = line.<em>index</em>Of("Result=");rn int <em>index</em>14 = line.<em>index</em>Of("\n", <em>index</em>13);rn result = line.sub<em>string</em>(<em>index</em>13+7, 8);rn rn rn vo.setLoginTime(loginTime);rn vo.setUin(uin);rn vo.setUserName(userName);rn vo.setAddr(addr);rn vo.setAction(action);rn vo.setMode(mode);rn vo.setResult(result);rn list.add(vo);rn rnrn我现在是从日志里面解析出各个字段信息,但是到mode = line.sub<em>string</em>(<em>index</em>11+5, <em>index</em>12);//这一行就报错:String <em>index</em> <em>out</em> of <em>range</em>: -91,下面一个result也是越界,这个要怎么改呢?rn
String index out of range: -6 的错误
初次使用hibernate,然后将一个页面中的数据插入到数据库中时,就阴魂不散的发生了这个错误,我插入的值只是一位:“1”,却总是报这个错,有谁也碰到过这个问题吗?
工作中遇到的问题之异常
今天在工作中执行项目的时候遇到了一个异常rn1.java.lang.StringIndexOutofBoundException:String <em>index</em> <em>out</em> of <em>range</em>:4rn异常的原因是:表示越界了,你的字符串没有这么大的长度。rn2.在equals中添加参数需要加引号,不加引号 不会报错但是不会之执行这段代码。之前没有注意过这个问题,经过这次遇到这个问题之后,以后会注意这个问题的。
【解决办法】torch交叉熵使用时遇到 Dimension out of range
简述n其实这个问题我很久以前用pytorch写程序的时候就遇到过这个问题,当时纠结了很久之后最后解决了。当时本来就想来写个东西来记录下避免其他人也遇到这样的问题。但后面我个菜鸡就完全忘记了emmmmn展示说明n不同于我以往直接给出结论。这次我会通过展示的方式较为详细的讲解下。nn导入包nnimport torchnimport torch.nn as nnnnn创造这个损失函数类nnloss =...
将int字段改为decimal类型时出现1264 Out of range value的问题分析和处理
有开发同事在验证环境对某个表将int字段改成decimal(10,4)后,提示 1264 Out of <em>range</em> value报错,咨询dba这个为什么会报错,对数据有什么影响?n我收到这问题后,第一反应就是由于字段类型转换,长度不够发生了数据溢出。n于是,下面对模拟该问题进行测试:n1.建测试表nCREATE TABLE `zeng` (n  `_id` int(11) NOT NUL
机器学习实践 学习笔记3 decision trees
决策树(decision trees)nnn工作原理:n决策树属于监督类型的算法,同样,我们有数据集,知道每一条数据的分类。然后我们按照某种规则,选取数据集上的特征作为分割点,把数据集进行划分。循环重复以上动作,直至所有数据集各自的分类都是唯一的,或者所有特征已经被选择无法再进行划分。使用何种规则进行特征的选取下文将会叙述。nnn优点:计算复杂度不高,输出结果易于理解,对中间值的缺失
Redis服务-linux下的配置
关系数据库管理系统-RDMS-数据按照预先设置的组织结构,存储在NoSQL(NoSQL=Not Only SQL)-非关系型数据库-不需要预先定义数据存储结构-表的每条记录都可以有不同的类型和结构主流软件-Redis-MongoDB-Memcached-CouchDB-Neo4j-FlockDB部署Redis服务--Remote Dictionary Server(远程字典服务器)--是一款高性能...
python机器学习及实践(从零开始kaggle竞赛之路)第二章的2.1.2.5集成模型程序报错:numpy.core._internal.AxisError: axis 0 is out of bo
python机器学习及实践(从零开始kaggle竞赛之路)第二章的2.1.2.5集成模型程序报错:numpy.core._internal.AxisError: axis 0 is <em>out</em> of bounds for array of dimension 0:1.原因是本段代码在python3以上执行时:print(np.sort(zip(etr.feature_importances_,bost...
tomcat项目迁移到weblogic过程中遇到的问题(持续更新)
最近因为实在受不了tomcat在myeclipse中的表现,于是转到weblogic上,没想到第一个项目就没有部署成功。可能是我对tomcat的了解不够深入。n1.第一个问题就是 查看日志发现Caused By: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy是这个异常。
Maven构建项目速度太慢的解决办法,以及报错Retrieving archetypes:' has encountered a problem
如果报错信息如下:nRetrieving archetypes:’ has encountered a problemnAn internal error occurred during:"Retrieving archetypesndetails:nAn internal error occurred during: “Retrieving archetypes:”.n看了网上的答案,发现好多坑...
遇到的 string类 +PAT遇到的各种问题
以后遇到什么 就再加上 nns.append(a,'0');   在字符串s的末尾 加上a个'0'nns.insert(0,a,'0');  在字符串下标为0的地方 加上长度为a 的字符'0'nn_____find的用法nnn#include &amp;lt;iostream&amp;gt;nusing namespace std;nint main(){n <em>string</em> a=&quot;abcde&quot;,b=&quot;ab&quot;;n i...
numpy基础
numpy基础nn1、数组nn1)用np.ndarray类的对象表示n维数组nnn实际数据:数组中元素n元数据:描述数组中的元素n将实际数据与元数据分开存放,一方面提高了内存空间的使用效率,另一方面减少对实际数据的访问频率,提高性能nnn2)Numpy数组是同质数组,即所有元素的数据类型必须相同,类似c语言的数组n3)Numpy数组的下标从0开始,最后一个元素的下标为数组长度减1n4)np.nda...
对于windows平台下的vs2010下vector数组提示“vector subscript out of range”很头疼
对于下面的部分代码,在vs2010的windows平台下提示数组越界(编译通过,执行exe提示)但是在深度linux下的codeblock正常。 //第一种形式n /*Vector <em>out</em>line(filterContours.size()+1);n for(size_t i = 0; i < filterContours.size(); i
关于测试平台输出:“你的输出为: java.lang.ArrayIndexOutOfBoundsException: 15”
今天是比较搞笑,做了一个二叉树序列化与反序列化的题目。编译了半天不通过,始终报java.lang.ArrayIndexOutOfBoundsException,也找不问题所在。最后直接对着牛客网网友编译通过的代码敲了一遍,后来发现问题所在。n原代码:npublic class Solution {n public static int <em>index</em>=-1;n String Ser
Python 进阶(二)
9. Picklingn可将整个数据结构中的内容存入文件以便程序下次运行时能够读取。n将一个复杂的列表结构存储到文件中:n&amp;amp;amp;gt;&amp;amp;amp;gt;&amp;amp;amp;gt; import picklen&amp;amp;amp;gt;&amp;amp;amp;gt;&amp;amp;amp;gt; mylist = [23, 'abc', [44, 12]]n&amp;amp;amp;gt;&amp;amp;amp;gt;&amp;amp;amp;gt; f =
Python亲和性分析示例-学习笔记
Python亲和性分析示例-学习笔记import numpy as npndataset_filename = "affinity_dataset.txt"nX = np.loadtxt(dataset_filename)nn_samples, n_features = X.shapenprint("This dataset has {0} samples and {1} features".for
目标检测:Faster rcnn 安装、训练、测试
说明:这个是Faster RCNN刚出来时候的博文记录,最新的可能会有更变,如有问题,请大家查阅官网链接。nnnn先上个检测效果:nn(1)图片人脸检测+关键点 nnnn(2)摄像头实时人脸+关键点nnnn**********************************************************...
机器学习入门读书笔记三(k-近邻算法 kNN) 中
使用k-近邻算法改进约会网站的配对效果nnnn背景:我的朋友海伦一直使用在线约会网站寻找适合自己的约会对象。尽管约会网站会推荐不同人选,但她没有从中找到喜欢的人。经过一番总结,她发现曾交往过三种类型的人:nnnn不喜欢的人魅力一般的人极具魅力的人nnnn尽管发现了上述规律,但海伦依然无法将约会网站推荐的匹配对象归入恰当的分类。她觉得可以在周一到周五约会那些魅力一般的人,而周
string subscript out of range
我使用rntemp.erase(temp.end()-1);rn后编译时没错,运行时出现RT错误!高手帮忙啊!
tomcat启动出现Caused by: java.lang.StringIndexOutOfBoundsException: String index out
亲爱的各位···我在MYSQL项目向ORACLE移值的时候出现一个错误可是却不知道怎么办只好向各位求助,各位帮忙啊!!具体错误如下:(这是在TOMCAT启动项目时候报的错··)rnrnrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)rn at org.apache.catalina.core.StandardService.start(StandardService.java:519)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:581)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: java.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at java.lang.String.charAt(String.java:687)rn at org.hibernate.mapping.Table.setName(Table.java:149)rn at org.hibernate.cfg.Mappings.addTable(Mappings.java:167)rn at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:290)rn at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)rn at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)rn at org.hibernate.cfg.Configuration.add(Configuration.java:669)rn at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:504)rn at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:631)rn at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)rn ... 39 morern2011-6-9 9:47:50 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn2011-6-9 9:47:50 org.apache.catalina.core.StandardContext startrn严重: Context [/Shanwei] startup failed due to previous errors
String out of range : 1303128
engineurl:http://127.0.0.12:8888/transrnparameterKey:config=BR&Code=010&x1=116.810918&y1=39.912719&x2=121.6018793&y2=38.8028643&r<em>out</em>eType=0&language=cn&ver=2.0rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 1303128rn at java.lang.String.checkBounds(String.java:401)rn at java.lang.String.(String.java:442)rn at com.mapabc.sis.server.core.service.impl.BusR<em>out</em>eServiceImpl.byteToString(BusR<em>out</em>eServiceImpl.java:313)rn at com.mapabc.sis.server.core.service.impl.BusR<em>out</em>eServiceImpl.format2NewBusR<em>out</em>eBeans(BusR<em>out</em>eServiceImpl.java:183)rn at com.mapabc.sis.server.core.service.impl.BusR<em>out</em>eServiceImpl.invokeService(BusR<em>out</em>eServiceImpl.java:72)rn at com.mapabc.sis.server.core.service.CoreServices.processRequest(CoreServices.java:192)rn at com.mapabc.sis.server.core.service.CoreServices.doGet(CoreServices.java:343)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.mapabc.sis.server.core.security.SecurityFilter.doFilter(SecurityFilter.java:279)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at com.mapabc.sis.server.core.access.LBSServer.urlforward(LBSServer.java:196)rn at com.mapabc.sis.server.core.access.LBSServer.doGet(LBSServer.java:93)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:662)rnjava.lang.NullPointerExceptionrn at com.mapabc.sis.util.coordsfactory.action.BusR<em>out</em>eCoords.invokeCoords(BusR<em>out</em>eCoords.java:42)rn at com.mapabc.sis.server.core.service.CoreServices.processRequest(CoreServices.java:211)rn at com.mapabc.sis.server.core.service.CoreServices.doGet(CoreServices.java:343)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at com.mapabc.sis.server.core.security.SecurityFilter.doFilter(SecurityFilter.java:279)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)rn at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)rn at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)rn at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)rn at com.mapabc.sis.server.core.access.LBSServer.urlforward(LBSServer.java:196)rn at com.mapabc.sis.server.core.access.LBSServer.doGet(LBSServer.java:93)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:662)rnsum time=9556rnrnrn我在运行服务时tomcat出现如下提示,但是服务并没发生中断之类的错误。这个问题是什么原因导致呢。该如何解决呢
list index out of range 求解
import os,re,linecacherndef fun(path):rn for root,dirs,files in os.walk(path):rn for fn in files:rn rootpath = os.path.join(root,fn)rn filetype=fn.split('.')[1]rn if filetype in['xml']:rn print(rootpath) rn new=(linecache.getline(rootpath,4)).rstrip()rn print (new)rn #print (type(new))rn newsp=new.split('.')rn #print (type(newsp))rn print(newsp[1])rn f= open(rootpath,'r+')rn d=f.read()rn open(rootpath, 'w').write(re.sub(r'a', 'b', d))rn f.close()rn else:rn continuernfun(r'C:\wmpub')rnrnrnrnC:\wmpub\a.xmlrnrnTraceback (most recent call last):rn File "C:\Documents and Settings\Administrator\桌面\test.py", line 21, in rn fun(r'C:\wmpub')rn File "C:\Documents and Settings\Administrator\桌面\test.py", line 14, in funrn print(newsp[1])rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>rn>>>
Row index out of range问题
public class Table1 extends JFramern String rid[] = new String[100];rn int count = 0;rn /*rn * public static void main(String a[]) new Table1(); rn */rn rn public void center(JFrame frame) rn double x = frame.getWidth(); // 居中困难rn double y = frame.getHeight();rn Toolkit kit = Toolkit.getDefaultToolkit();rn Dimension screenSize = kit.getScreenSize();rn double xx = screenSize.getWidth();rn double yy = screenSize.getHeight();rn frame.setLocation((int) (xx / 2 - x / 2), (int) (yy / 2 - y / 2));rn rn public Table1() rn JPanel zuida = new JPanel(new BorderLay<em>out</em>(0, 10));rn JPanel jp1 = fangzi();rn JPanel jp2 = dingdan();rn jp2.setBorder(BorderFactory.createTitledBorder("订单信息"));rn JTabbedPane tp = new JTabbedPane();rn tp.addTab("房间预定", jp1);rn tp.addTab("订单信息", jp2);rn // zuida.add(jp1);rn zuida.add("North", tp);rn JFrame frame = new JFrame("酒店");rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn //zuida.setBackground(new Color(102,204,255)); 设置背景颜色rn zuida.setBorder(new EmptyBorder(5, 5, 5, 5));rn frame.setContentPane(zuida);rn frame.setVisible(true);rn frame.pack();rn center(frame);rn System.<em>out</em>.println("123");rn // frame.setLocationRelativeTo(null);//这个也是居中的方法rn rn JPanel fangzi() rn JTable jiu = jiudian();rn JTable table = order();rn JScrollPane pane = new JScrollPane(jiu); // 加滑轮rn JPanel panel = new JPanel();//rn JPanel panel2 = new JPanel(new FlowLay<em>out</em>(FlowLay<em>out</em>.CENTER, 30, 10));rn JPanel panel3 = new JPanel(new GridLay<em>out</em>(1, 10));rn JPanel panel4 = new JPanel(new BorderLay<em>out</em>(0, 10));rn panel.setPreferredSize(new Dimension(600, 400));rn panel.setLay<em>out</em>(new BorderLay<em>out</em>());rn JButton b1 = new JButton("预订");rn JButton b2 = new JButton("加至购物车");rn JButton b3 = new JButton("预定多个");rn JButton b4 = new JButton("生成订单");rn panel2.add(b1);rn panel2.add(b2);rn panel2.add(b3);rn panel2.add(b4);rn ButtonListener bListener = new ButtonListener(jiu,rid);rn rn JButton b5 = new JButton("查询空房");rn panel3.add(b5);rn rn rn bListener.jPanel = panel;rn bListener.jPanel2 = pane;rn ButtonListener bListener2 = new ButtonListener(table);rn b5.addActionListener(bListener2);rn rn b1.addActionListener(bListener);rn b2.addActionListener(bListener);rn b3.addActionListener(bListener);rn b4.addActionListener(bListener);rnrn panel.add("Center", pane);rn panel.add("S<em>out</em>h", panel2);rn panel.add("North", panel3);rn panel.setBorder(BorderFactory.createTitledBorder("房间信息"));rn rn rn rn return panel;rn rn JPanel dingdan() rn JTable dingdan = order();rn JScrollPane pane = new JScrollPane(dingdan);rn JPanel jp10 = new JPanel(new BorderLay<em>out</em>());rn jp10.add("Center", pane);rn JButton b1 = new JButton("确定");rn JButton b2 = new JButton("刷新");rn jp10.add("S<em>out</em>h", b1);rn jp10.add("North",b2);rn ButtonListener bListener1 = new ButtonListener(dingdan);rn b1.addActionListener(bListener1);rn b2.addActionListener(bListener1);rn return jp10;rn rn JTable order() //生成订单的表格rn Vector lieV = new Vector();rn Vector hangV = new Vector();rn try rn Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");rn Connection con;rn con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DataBaseName=Hotel", "sa", "123");rn PreparedStatement statement = con.prepareStatement("Select * from 订单 where Userid =? ");rn statement.setString(1, new MainClass().getname());rn ResultSet rs = statement.executeQuery();rn while (rs.next()) rn Vector hangv = new Vector();rn hangv.add(Integer.parseInt(rs.getString(1)));rn hangv.add(rs.getString(2)); rn hangv.add((rs.getString(3))); rn hangv.add((rs.getString(4))); rn hangv.add((rs.getInt(5))); rn hangv.add((rs.getString(6))); rn hangv.add((rs.getInt(7)));rn hangV.add(hangv);rn rn catch (Exception e) rn System.<em>out</em>.println("Error" + e);rn rn final Object Lie[] = "订单编号", "用户", "房间编号", "订单日期","数量", "状态","价格" ;rn lieV.add("订单编号");rn lieV.add("用户");rn lieV.add("房间编号");rn lieV.add("订单日期");rn lieV.add("数量");rn lieV.add("状态");rn lieV.add("价格");rn rn //JTable jiu = new JTable(row, Lie); // 建立表格rn DefaultTableModel tableModel = new DefaultTableModel(hangV, lieV);rn JTable jiu = new JTable(tableModel); rn jiu.setPreferredScrollableViewportSize(new Dimension(400, 300));rn jiu.setRowHeight(30);rn jiu.setRowMargin(5);rn jiu.setRowSelectionAllowed(true);rn jiu.setSelectionBackground(Color.WHITE);rn jiu.setSelectionForeground(Color.red);rn jiu.setGridColor(Color.BLACK);rn // jiu.selectAll();rn jiu.setRowSelectionInterval(0, 0);rnrn //jiu.clearSelection();rn jiu.setDragEnabled(false);rn jiu.setShowGrid(true);rn jiu.setShowHorizontalLines(false);rn jiu.setShowVerticalLines(false);rn //jiu.doLay<em>out</em>();rn jiu.setBackground(Color.LIGHT_GRAY);rn //ButtonListener bListener = new ButtonListener(jiu, rid);rn //bListener.otherTable = jiu;rn return jiu;rn rn //!!!!rn JTable jiudian() //生成酒店的表格 rn // 用向量来实现动态的大小rn //Object 可以不用了rn Vector lieV = new Vector();rn Vector hangV = new Vector();rn Object row[][] = new Object[30][30];rn try rn Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");rn Connection con;rn con = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DataBaseName=Hotel", "sa", "123");rn Statement statement = con.createStatement();rn ResultSet rs = statement.executeQuery("Select * from 房间");rn int x = 0;rn int y = 0;rn rn while (rs.next()) rn Vector hangv = new Vector();rn row[x][y] = Integer.parseInt(rs.getString("rid"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = rs.getInt("Rprice");rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("raddress"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("rtype"));rn hangv.add(row[x][y]);rn y++;rn row[x][y] = (rs.getString("rstate"));rn hangv.add(row[x][y]);rn x++;rn y = 0;rn hangV.add(hangv);rn rn catch (Exception e) rn System.<em>out</em>.println("Error" + e);rn rn final Object Lie[] = "编号", "价格", "位置", "类型", "状态" ;rn lieV.add("编号");rn lieV.add("价格");rn lieV.add("位置");rn lieV.add("类型");rn lieV.add("状态");rn rn //JTable jiu = new JTable(row, Lie); // 建立表格rn DefaultTableModel tableModel = new DefaultTableModel(hangV, lieV);rn JTable jiu = new JTable(tableModel); rn jiu.setPreferredScrollableViewportSize(new Dimension(400, 300));rn jiu.setRowHeight(30);rn jiu.setRowMargin(5);rn jiu.setRowSelectionAllowed(true);rn jiu.setSelectionBackground(Color.WHITE);rn jiu.setSelectionForeground(Color.red);rn jiu.setGridColor(Color.BLACK);rn // jiu.selectAll();rn jiu.setRowSelectionInterval(0, 0);rnrn //jiu.clearSelection();rn jiu.setDragEnabled(false);rn jiu.setShowGrid(true);rn jiu.setShowHorizontalLines(false);rn jiu.setShowVerticalLines(false);rn jiu.doLay<em>out</em>();rn jiu.setBackground(Color.LIGHT_GRAY);rnrn return jiu;rn rnrnrnrnrnErrorjava.lang.IllegalArgumentException: Row <em>index</em> <em>out</em> of <em>range</em>rn实在不知道怎么修改rn
Parameter index out of range 谢谢!
谢谢大家!帮我看看这个错误怎么回事,谢谢!!rnrnjava.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of parameters, which is 0).rn at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2493)rn at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:3213)rn at database.LinkDB.addBook(LinkDB.java:35)rn at action.addBookAction.execute(addBookAction.java:37)rn at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)rn at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)rn at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)rn at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)rn at java.lang.Thread.run(Thread.java:595)rn
SPRING接收前台传入List时,超过256报IndexOutOfBoundsException异常
首先看看异常norg.springframework.beans.InvalidPropertyException: Invalid property 'detail[256]' of bean class [com.suning.asvp.mer.entity.InviteCooperationInfo]: Index of <em>out</em> of bounds in property path 'de
List index out of bounds(-1)错误解决办法
解决办件运行弹出List <em>index</em> <em>out</em> of bounds错误.
数据处理 sklearn
contour和contourf都是画三维等高线图的,不同点在于contourf会对等高线间的区域进行填充nimport numpy as npnimport matplotlib.pyplot as pltnfrom matplotlib.colors import ListedColormapnx=np.array([1,2])ny=np.array([1,2])nz=np.array([[...
python之错误解决(持续更新……)
1.UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xbb in position 1057: invalid start bytern解决:rn把data = data.decode(encoding)改成data = data.decode(“ISO-8859-1”)rn2.如果出现乱码,搜素页面源代码,可以看到页面编码为GBK,修改enco...
《机器学习实战》-chapter4-朴素贝叶斯
这一章主要是介绍了朴素贝叶斯的算法思想以及如何构造一个简单的朴素贝叶斯网络用来过滤掉垃圾邮件。nn首先在朴素贝叶斯中有两个非常重要的假设:nn假设所有的特征都是独立的n 假设所有的特征都是同等重要的n具体的细节大家可以在书上找到,下面说一下这一章需要改的地方(由于Python版本不同而导致的错误,我是在python3.6下进行实验的):nnemai/ham/23.txt需要把第二行第一个单词后面的...
Word Count(结对项目)
bithlh n结对项目 nhttps://github.com/John-zjm/Word-Countnn一、PSP表格nn n二、性能分析nn1 因为.c文件有多种格式,为了提高程序的性能和可用性,我们花了半天时间对程序进行了改进,使它能够支持多种格式,提高了程序的实用性。并且我们添加了界面,使程序功能更加完善。nn2 性能分析图nnnn3.消耗最大函数 nnnndef file_name(f...
《机器学习实战》朴素贝叶斯
机器学习实战的朴素贝叶斯一章中的源文件老是提示rnIndexError: <em>range</em> object <em>index</em> <em>out</em> of <em>range</em>rn看源码里怎么都不会溢出啊,除非minLen为0;所以看了下测试集中的两个链接,第一个链接打开后是正常的,第二个打不开了,所以问题就出在这里了,minLen确实等于0了,怎么修改呢?只好把挂掉的链接换一个新的,我换的是参考资料:rnhttp://www.cnbl
麦咖啡macafee免费杀软下载
免费杀软!请大家使用,如不好用,敬请下载新的软件,不谢。共享快乐! 相关下载链接:[url=//download.csdn.net/download/sbngjuo/2030606?utm_source=bbsseo]//download.csdn.net/download/sbngjuo/2030606?utm_source=bbsseo[/url]
实战OO 部署与实施下载
实战OO_部署与实施 实战OO_部署与实施 实战OO_部署与实施 相关下载链接:[url=//download.csdn.net/download/jybusi/2324891?utm_source=bbsseo]//download.csdn.net/download/jybusi/2324891?utm_source=bbsseo[/url]
EB银行票据打印软件下载
银行票据打印 支票打印软件 智能化万能票据打印管理软件。全新票据打印理念,创新Excel界面,使用简单方便;万能票据格式,自定义模板设计,精确格式定义,支持各种打印机,全自动化一键输入方式,人性化操作设置,让每个人都成为票据打印专家 相关下载链接:[url=//download.csdn.net/download/catnang/3183611?utm_source=bbsseo]//download.csdn.net/download/catnang/3183611?utm_source=bbsseo[/url]
文章热词 机器学习教程 Objective-C培训 交互设计视频教程 颜色模型 设计制作学习
相关热词 mysql关联查询两次本表 native底部 react extjs glyph 图标 0基础大数据 0基础学python
我们是很有底线的