String index out of range: -2 是什么意思呢? [问题点数:20分,结帖人xiaohuanying]

Bbs1
本版专家分:0
结帖率 80%
Bbs8
本版专家分:46570
Blank
红花 2015年7月 Java大版内专家分月排行榜第一
2015年6月 Java大版内专家分月排行榜第一
2011年2月 Java大版内专家分月排行榜第一
Blank
黄花 2015年5月 Java大版内专家分月排行榜第二
2013年5月 Java大版内专家分月排行榜第二
Blank
蓝花 2011年5月 Java大版内专家分月排行榜第三
2011年1月 Java大版内专家分月排行榜第三
Bbs6
本版专家分:6530
Bbs3
本版专家分:612
Bbs5
本版专家分:2283
Bbs5
本版专家分:2827
Bbs1
本版专家分:0
奇怪的 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谢谢
报错String index out of range是什么意思?在线等
报错String <em>index</em> <em>out</em> of <em>range</em><em>是什么</em><em>意思</em>?在线等
String index out of range: 48
String <em>index</em> <em>out</em> of <em>range</em>: 48
faster-rcnn系列assert (boxes[:, 2] >= boxes[:, 0]).all()和loss偶尔为nan的问题
问题综述这些问题的根源都是faster-rcnn系列在处理生成pascal voc数据集时,为了使像素以0为起点,每个bbox的左上右下坐标都减1,如果你的数据里有坐标为0,一般是x1或y1,这时x1 = 0-1 = 65535,就会出现下面的问题1,2。
Faster_rcnn训练自己的数据集(2)
在看了一些深度学习的目标检测的论文后,想着去用开源的代码去跑一下,看看实际的效果。于是小菜就想着直接把faster_rcnn用起来,包括前期的faster_rcnn安装和配置并运行其中的一个demo.py。后面是用自己的数据集训练faster_rcnn的模型。   1. 准备工作: 1) 搭建caffe框架 这个可以参考Linux先搭建caffe的笔记。 2) 安装第三方依赖包
Faster-RCNN+ZF用自己的数据集训练模型(Python版本)
说明:本博文假设你已经做好了自己的数据集,该数据集格式和VOC2007相同。下面是训练前的一些修改。 (做数据集的过程可以看这里) Faster-RCNN源码下载地址: Matlab版本:https://github.com/ShaoqingRen/faster_rcnn Python版本:https://github.com/rbgirshick/py-faster-rcnn
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
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这是一个发布的别人的网站,可是里面有很多地方都报的这同一个错,怀疑不是单纯的下标越界问题,不晓得原因究竟出在哪里?希望有遇到类似情况 的高手解答一下迷津,谢了!!!
String index out of range: -1 异常,急需处理
nnnn  
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相关的代码贴出来了,但不是很理解这个数组怎么就越界了。也不知道怎么去修改
训练Faster R-CNN出现的errors
1. assert (boxes[:, 2] >= boxes[:, 0]).all() AssertionError目前临时解决的方法: 在 imdb.py中:for b in <em>range</em>(len(boxes)): if boxes[b][2] < boxes[b][0]: boxes[b][0] = 0asser
深度学习实践经验:用Faster R-CNN训练Caltech数据集——训练检测
前言前面已经介绍了如何准备数据集,以及如何修改数据集读写接口来操作数据集,接下来我来说明一下怎么来训练网络和之后的检测过程。修改模型文件faster rcnn有两种各种训练方式: Alternative training(alt-opt) Approximate joint training(end-to-end) 两种方法有什么不同,可以参考我这篇博客,推荐使用第二种,因为第二种使用的显存更小,而
Ubuntu16.04+cuda8.0+cudnn5.1配置faster-rcnn的方法以及训练自己的数据出现的问题
Ubuntu16.04+cuda8.0+cudnn5.1配置faster-rcnn的方法以及训练自己的数据出现的问题
Faster-RCNN训练自己的数据集
就目前我在了解到的资料来看,训练RCNN系列,一般有两种思路: 修改CNN的工程代码,适应自己的数据集格式 将自己的数据格式做成VOC2007形式的数据集 从工作量来看,无疑后者更容易一些,本文的思路也是如此。 首先是图片的命名格式,虽然图片的命名理论上不会影响训练。因为训练的数据都是从txt文件中读取图片的名称。但是为了统一数据集,仍然建议批量、有规律的命名数据图片。我的数据集是jpg格式,和PA
py-faster-rcnn + ZF 实现自己的数据训练与检测(二)
0.前言 在前面的一篇博客中,介绍了如何实现py-faster-rcnn的配置以及在PASCAL VOC 2007上面的训练,本节,来讲诉如何制作并训练自己的数据集。 1.制作自己的数据集
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
HTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: Exception in JSP: /<em>index</em>.jsp:75rnrn72: bordercolor="#3F96E3">rn73: rn74: rn75: rn77: rn78: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnroot cause rnrnorg.apache.jasper.JasperException: Exception in JSP: /product/newproductinfo.jsp:74rnrn71: color="Navy">rn72: rn76: rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.<em>index</em>_jsp._jspService(org.apache.jsp.<em>index</em>_jsp:133)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnroot cause rnrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -1rn java.lang.String.sub<em>string</em>(String.java:1768)rn org.apache.jsp.product.newproductinfo_jsp._jspService(org.apache.jsp.product.newproductinfo_jsp:147)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)rn org.apache.jsp.<em>index</em>_jsp._jspService(org.apache.jsp.<em>index</em>_jsp:133)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rn com.erp.fiter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.15
错误提示: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
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> 的错误,请各位知道的加以指点
index out of range exception??
<em>index</em> <em>out</em> of <em>range</em> exception??rnrn[color=#FF0000]error code:rnrn if (!Convert.IsDBNull(reader["Name"]))rn username = reader["Name"].ToString();[/color]rnrnrn2. source 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[color=#339966] exists = true;rn if (!Convert.IsDBNull(reader.GetValue(2)))[/color]???????????????rn username = reader.GetValue(2).ToString();rn if (!Convert.IsDBNull(reader["password"]))rn pwd = reader["password"].ToString();rn rn rn reader.Close();rn return exists;rnrn rnrnrn
字符串异常:String index out of range: -2
字符串异常:String <em>index</em> <em>out</em> of <em>range</em>: -2 使用字符subString操作的时候,经常会出现一个String <em>index</em> <em>out</em> of <em>range</em>: -1,这个是典型的下标越界,其实位置小于0,结束位置大于字符长度都会报 -1 这个异常。 -2这个异常就比较少见了,但是可以确定,它是和-1不同的异常,但是同样发生在subString方法里面; 这个异常挺难触发的,...
socket连接,关于String index out of range:-1?求大神帮忙!
-
轻松解决String index out of range
在做算法题时遇到了报错,原因是字符串的索引越界,特意写博文来告诉那些和我有类似问题的小伙伴,能解决您的问题不胜荣幸 查看自己的代码,原来int的类型范围越界 int的范围:-2147483648-------2147483647 long的范围:-9223372036854775808-------9223372036854775807 把int该为long就可以了 ...
String index out of range 报错详解(转载)
今天偶然遇到这样的一个情况,找了一下知道这个解决方法: https://blog.csdn.net/sinat_36220051/article/details/81874773
String index out of range: -2问题
今天突然遇到这个问题。String <em>index</em> <em>out</em> of <em>range</em>: -2不知道为什么?请高手指点迷津。 java.lang.StringIndexOutOfBoundsException: S
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>
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: 0
09:57:40,051 ERROR Dispatcher:38 - Exception occurred during processing request: String <em>index</em> <em>out</em> of <em>range</em>: 0rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 0rn at java.lang.String.charAt(String.java:658)rn at org.hibernate.type.CharacterType.get(CharacterType.java:52)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:186)rn at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:175)rn at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)rn at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2267)rn at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1443)rn at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1371)rn at org.hibernate.loader.Loader.getRow(Loader.java:1271)rn at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:619)rn at org.hibernate.loader.Loader.doQuery(Loader.java:745)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)rn at org.hibernate.loader.Loader.loadEntity(Loader.java:1953)rn at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)rn at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)rn at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3270)rn at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)rn at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)rn at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)rn at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)rn at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)rn at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1080)rn at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1028)rn at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:623)rn at org.hibernate.type.EntityType.resolve(EntityType.java:431)rn at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:140)rn at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:898)rn at org.hibernate.loader.Loader.doQuery(Loader.java:773)rn at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)rn at org.hibernate.loader.Loader.doList(Loader.java:2449)rn at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192)rn at org.hibernate.loader.Loader.list(Loader.java:2187)rn at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)rn at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)rn at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)rn at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)rn at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)rn at com.bjpowernode.drp.base.daoImp.ClientDaoImp.getfindById(ClientDaoImp.java:89)rn at com.bjpowernode.drp.base.serviceImp.ClientServiceImp.getfindById(ClientServiceImp.java:22)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)rn at com.sun.proxy.$Proxy18.getfindById(Unknown Source)rn at com.bjpowernode.drp.base.action.ClientAction.getfindById(ClientAction.java:31)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:239)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:161)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)rnrnrnrn[color=#FF0000]rn以上这些是异常信息,我确定我是执行这条语句出错:rnhibernateTemplate.get(Client.class, id);rn我也确定id有值 比如10001是数值型int,rn百思不得其解,赐教!rn[/color]
index out of range" 问题">遇到的一个"String index out of range" 问题
原来   sub<em>string</em>
String index out of range: 0
String <em>index</em> <em>out</em> of <em>range</em>: 0 异常信息 是字符串下标越界 导致这个问题的原因有 很多 我这边的是 mysql数据中的一个字段是char类型值为空导致的 为什么会这样呢? 百度了一下 感觉一个大神的回答相对靠谱点 这个要从char类型和<em>string</em>类型的数据来看。 char类型是值类型,存在在栈上,在编译时要求分配内存,所以必须为其赋初值,其他值类型如int,do...
字符串异常: java.lang.StringIndexOutOfBoundsException: String index out of range: -2
这个异常出现的原因是你在切割字符串的时候即subString(startIndex,endIndext)的时候,startIndex比endIndext要大,就汇报这个错误。一般来说在你读一个文件的是里面有空行就会容易报这个错误!...
String index out of range: 100 报错详解
一个很奇葩的报错,出错情况: 在这里进行debug之后可以看到,异常在sub<em>string</em>中: 也就是判断字符串的时候报错:具体原因就是<em>string</em>字符串<em>index</em>of的值本身只有5,然后在这里去取其第100 个字符作为截止,因此就会报这个错;   知识点:主要是堆String概念不清。下面针对字符串相关概念做一个简介。 针对上述问题解决办法: ...
String index out of range: 6
老是说 字符串索引超出范围 到底哪里错了????
求助: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: -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: 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
请问这个错误怎么改:String index out of range: 10
代码如下: text/html;charset=gb23
String index out of range: -1怎么处理啊
public void parseRequestInfo(){ if(null==requestInfo||(requestInfo=requestInfo.trim()).equals("")){
Java String index out of range: -1
出现这个异常,对应的位置加上 if (sax.lastIndexOf("字符")!=-1){ ...... }
由String index out of range: -1引发的思考
由String <em>index</em> <em>out</em> of <em>range</em>: -1引发的思考 废话不多说,这个错误很容易就能明白其含义:字符串的索引越界了。 一般都是字符串操作引起的,最典型的: String str = “123456789”;//字符串长度是9 String tempStr = str.sub<em>string</em>(0, 10);//一定报错:String <em>index</em> <em>out</em> of <em>range</em>: 10 该错误是由于字符串操作过程中抛出StringIndexOutOfBoundsException异常
java.lang.StringIndexOutOfBoundsException:String index out of range:-1
程序如下:rnrn包上述错误,没见过怎么回事?
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”,却总是报这个错,有谁也碰到过这个问题吗?
2 ^ Index是什么意思
Private Sub Command1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) rn If Option2(Index).value Then '判断当前选择的模式是否为JOG模式 Rtn = GT_Stop([color=#FF0000]2 ^ Index[/color], 0) '按位平滑停止当前的轴 rn End IfrnEnd Subrn这是固高板卡的一个函数调用,我想知道2 ^ Index<em>是什么</em><em>意思</em>。听别人说好像和什么二进制有关。没听懂。。。。rn有没有哪位大神帮忙解释一下[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/15.gif][/img]
string subscript out of range
我使用rntemp.erase(temp.end()-1);rn后编译时没错,运行时出现RT错误!高手帮忙啊!
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出现如下提示,但是服务并没发生中断之类的错误。这个问题<em>是什么</em>原因导致呢。该如何解决呢
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
list index out of bounds(0)是什么意思
list <em>index</em> <em>out</em> of bounds(0)<em>是什么</em>问题,什么地方错了
index out of bounds(0)"是什么意思">" list index out of bounds(0)"是什么意思
" list <em>index</em> <em>out</em> of bounds(0)"<em>是什么</em><em>意思</em>
请问jsp出错提示org.apache.jasper.JasperException: String index out of range: 8,是什么错误呢?
请问jsp出错提示org.apache.jasper.JasperException: String <em>index</em> <em>out</em> of <em>range</em>: 8,<em>是什么</em>错误呢?
string subscript out of range! 急!!!!
rn编译程序出现的Assert问题!rn弹出一个Visual C++ Debug Library错语!rnrn错误点:rnrnQueryInterface()查找接口时,请问这程情况一般<em>是什么</em>问题!?
求助:string subscript out of range
新手求助!rn//Main.cpprn#include rn#include rn#include rn#include rnint main()rnrn using namespace std;rn ofstream <em>out</em>File;rn <em>out</em>File.open("可修复装备.txt");rn ifstream inFile;rn inFile.open("Commodity.ini");rn if (!inFile.is_open())rn rn c<em>out</em> <<
救命啊!!!老是报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
让人迷糊的String index out of Range??新手求解
[code=Java]rnpublic int Run(String s)rn rn int len = s.length(); //字符串长度lenrn int n=0;rn int i=1;rn rn for (i=1;i,返回一个答案ans;rnrn当输入上述例子提示: StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 18rnrn求解??万分感谢
怎么会出现String index out of range: 25的情况?
我用以下语句时:if(content.length()>30) title=title.sub<em>string</em>(0,25)+"...";怎么出现了String <em>index</em> <em>out</em> of <em>range</em>: 25的情况!这<em>是什么</em>问题所引起的?有进好像又不会出现这种问题。请高手指点。
提示string subscript out of range
[code=c]int main()rnrn int i, j;rn <em>string</em> _strIn;rn vector>stu; //動的な二次元vector配列stuを宣言するrn vector_stu; //動的なvector配列_stuを宣言するrn <em>string</em> token;rn int bugs = 0;rnrn //ifstream fin("E:\\newfile.csv"); //CSV OPENrn ifstream fin("E:\\01.csv");rnrn while (getline(fin,_strIn)) //一行ずつ読み込むrn rn <em>string</em>stream sstr(_strIn);rnrn while (getline(sstr,token,',')) //”、”マックを分けるマックとして、一行の文字列を分けるrn rn _stu.push_back(token); //vector配列に文字列を一個ずつ入れるrn rnrn stu.push_back(_stu); //vector配列を二次元vector配列に入れるrn _stu.clear(); //_stu リセットrn /*c<em>out</em> << _strIn << endl;*/rn rnrn for (i=0;i
多文件上传的 问题 String index out of range: -1在线等!
我做了一个多文件的上传,但是测试的是总是提醒我这样的话String <em>index</em> <em>out</em> of <em>range</em>: -1rnrn不知道<em>是什么</em><em>意思</em>,希望大家帮帮,代码在这!哪个地方需要改进rnpublic ActionForward execute(rn ActionMapping mapping,rn ActionForm form,rn HttpServletRequest request,rn HttpServletResponse response) rn CompanyintroForm companyintroForm = (CompanyintroForm) form;rn FormFile file = companyintroForm.getTheFile();rn FormFile file2 = companyintroForm.getTheFile2();rn FormFile file3 = companyintroForm.getTheFile3();rn Map fileMap = new HashMap();rn fileMap.put("file" , file);rn fileMap.put("file2" , file2);rn fileMap.put("file3" , file3);rn Set fileSet = fileMap.entrySet();rn Iterator iter = fileSet.iterator();rn// 取当前系统路径E:\Tomcat5\webapps\strutsUpload\ 其中strutsUpload为当前contextrn String filePath = this.getServlet().getServletContext().getRealPath("/");rn// 保存文件的文件夹rn File savePath = new File(filePath + "UploadFiles\\");rn filePath = filePath+ "UploadFiles\\";rn if (!savePath.exists()) rn savePath.mkdir();rn rn while (iter.hasNext()) rn Map.Entry unit = (Map.Entry) iter.next();rn String key = (String) unit.getKey();rn FormFile file0 = (FormFile) unit.getValue(); rn //文件大小符合要求,且是图片文件rn if ((file.getFileSize() >= 1)&& DealPhoto.isPhoto(file)) rn //图片类别rn String photoType = key.sub<em>string</em>(key.<em>index</em>Of("*") + 1, keyrn .lastIndexOf("*"));rn //图片描述rn String photoName = key.sub<em>string</em>(key.lastIndexOf("*") + 1, keyrn .length());rn rn //存数据库操作,在数据库中保存文件的名称,类型,及在服务器上的相对路径rn //rn rn //判断是否重名rn if(DealPhoto.isFileExist(file.getFileName(),filePath))rn DealPhoto.rename(file.getFileName(),filePath);rn try rn InputStream stream = file.getInputStream();// 把文件读入rn // 建立一个上传文件的输出流 rn OutputStream bos = new FileOutputStream(filePath+file.getFileName());rn int bytesRead = 0;rn byte[] buffer = new byte[8192];rn while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) rn bos.write(buffer, 0, bytesRead);// 将文件写入服务器rn rn bos.close();rn stream.close();rn catch (Exception e) rn e.printStackTrace();rn rn rnrn rn return mapping.findForward("haha");rn rnrnrnrn
(上传问题)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请帮小弟解惑! 在此谢过了!
String index out of range: -1超出索引?怎么办?
页面实现修改图像的代码出错rnrnrnrn[code=java]int count=p_image.<em>index</em>Of("images");rn String p_image_temp=p_image.sub<em>string</em>(count,p_image.length());[/code]rnrnrnrn修改后不会出现错误,当时无法识别路径了rn[img=https://img-bbs.csdn.net/upload/201606/26/1466928775_251240.png][/img]rnrn[code=java]int count=p_image.<em>index</em>Of("images");rn String p_image_temp=p_image.sub<em>string</em>(count+1,p_image.length());[/code]rnrnrnrn该怎么办???
为什么会出现 String index out of range: -13 异常的?
int start = xmlMsg.<em>index</em>Of(tagName_1);rn rn start += tagName_1.length(); //计算向后偏移长度rnrn int end = xmlMsg.<em>index</em>Of(tagName_2);rn rn // 截取之间消息的值rn String value = xmlMsg.sub<em>string</em>(start, end).trim();rn System.<em>out</em>.println(value);rnrnrn在最后两个语句出现了这样的错误:rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: -13rn at java.lang.String.sub<em>string</em>(String.java:1937)rn at util.tools.MessageOperation.getXMLValue(MessageOperation.java:62)rn at server.RecTranThread.run(RecTranThread.java:488)rnrn麻烦大家了~~
求救Tomcat4.04 + jdk1.4.0 遇到 String index out of range: 23
程序如下rnrnrnrn rnrnrn rnrnrnrnrnrnrnrnrnrnrnrnrn每刷新3次到4次出现如下错误,rnrnApache Tomcat/4.0.4 - HTTP Status 500 - Internal Server Errorrnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage Internal Server Errorrnrndescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.rnrnexception rnrnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 23rn at java.lang.String.sub<em>string</em>(String.java:1473)rn at org.apache.jsp.time$jsp._jspService(time$jsp.java:68)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)rn at java.lang.Thread.run(Thread.java:536)rnrn
javax.servlet.ServletException: String index out of range: 10这是什么原因
同一种类别下面有按照xx,yy,zz等等搜索,有时输入xx是出现上述错误,有时输入yy时出现上述错误,这<em>是什么</em>原因,该如何解决啊?谢谢大哥们指教
String index out of 4解决方法
String <em>index</em> <em>out</em> of 4解决方法
关于Grid Index Out Of Range 的问题
我在窗体中添加了一个PageContol组件,通过切换PageContol的页面来实现不同数据表的全部记录显示,代码如下rnprocedure TForm2.PageControl1Change(Sender: TObject);rnbeginrn if pagecontrol1.TabIndex=0 thenrn beginrn datamodule1.ADOQuery2.Close;rn with datamodule1.ADOQuery1 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource1;rn DBNavigator1.DataSource:=datamodule1.DataSource1;rn end;rn if pagecontrol1.TabIndex=1 thenrn beginrn datamodule1.ADOQuery1.Close;rn with datamodule1.ADOQuery2 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 计划外培训项目表 order by 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource2;rn DBNavigator1.DataSource:=datamodule1.DataSource2;rn end;rnend;rn窗体显示时Pagecontrol的Tab<em>index</em>为0,代码如下:rnprocedure TForm2.FormShow(Sender: TObject);rnbeginrn dbgrid1.DataSource:=datamodule1.DataSource1;rn dbnavigator1.DataSource:=datamodule1.DataSource1;rn with datamodule1.ADOQuery1 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rnend;rnrn然后我又增加了一个按钮,点击时显示表的全部记录,代码如下:rnprocedure TForm2.QueryAllClick(Sender: TObject);rnbeginrn if pagecontrol1.TabIndex=0 thenrn beginrn datamodule1.ADOQuery2.Close;rn with datamodule1.ADOQuery1 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 年度培训计划表 order by 年度, 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource1;rn DBNavigator1.DataSource:=datamodule1.DataSource1;rn end;rn if pagecontrol1.TabIndex=1 thenrn beginrn datamodule1.ADOQuery1.Close;rn with datamodule1.ADOQuery2 dorn beginrn close;rn sql.Clear;rn sql.Add('select * from 计划外培训项目表 order by 编号 ASC');rn open;rn last;rn end;rn DBGrid1.DataSource:=datamodule1.DataSource2;rn DBNavigator1.DataSource:=datamodule1.DataSource2;rn end;rnend;rnrn现在的问题在于,当窗体显示时,我点击该按钮,就会出错,弹出出现异常:Grid <em>index</em> <em>out</em> of <em>range</em> 。rn利用F7跟踪调试,发现错误在last这条语句上。rnrn我搞了半天也没弄明白为什么会出错,敬请大家赐教!!!!!!
grid index out of range是什么问题,怎么解决?
-
grid index out of range是什么问题如何解决?
-
index out of range"提示......">又一个"Grid index out of range"提示......
为何我的Adoquery增加记录有时会出现"Grid <em>index</em> <em>out</em> of <em>range</em>"?何解?
求助:IndexError: list index out of range
使用Spyder(python 3.6)代码为:rn#!/usr/bin/env python3rnimport sysrnrnfrom xlrd import open_workbookrnfrom xlwt import Workbookrnrninput_file = sys.argv[1]rn<em>out</em>put_file = sys.argv[2]rnrn<em>out</em>put_workbook = Workbook()rn<em>out</em>put_worksheet = <em>out</em>put_workbook.add_sheet('jan_2013_<em>out</em>put')rnrnwith open_workbook(input_file) as workbook:rn worksheet = workbook.sheet_by_name('january_2013')rn for row_<em>index</em> in <em>range</em>(worksheet.nrows):rn for column_<em>index</em> in <em>range</em>(worksheet.ncols):rn <em>out</em>put_worksheet.write(row_<em>index</em>, column_<em>index</em>, worksheet.cell_value(row_<em>index</em>, column_<em>index</em>))rn<em>out</em>put_workbook.save(<em>out</em>put_file)rnrn执行:python 2excel_parsing_and_write.py sale_2013 L<em>out</em>put.xlsrnrn出现问题,输出;rnPython 3.6.2 |Anaconda custom (64-bit)| (default, Sep 19 2017, 08:03:39) [MSC v.1900 64 bit (AMD64)]rnType "copyright", "credits" or "license" for more information.rnrnIPython 6.1.0 -- An enhanced Interactive Python.rnrnrnrnrunfile('C:/LearnPython/excel/2excel_parsing_and_write.py', args='sales_2013.xlsx', wdir='C:/LearnPython/excel')rnTraceback (most recent call last):rnrn File "", line 1, in rn runfile('C:/LearnPython/excel/2excel_parsing_and_write.py', args='sales_2013.xlsx', wdir='C:/LearnPython/excel')rnrn File "H:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfilern execfile(filename, namespace)rnrn File "H:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfilern exec(compile(f.read(), filename, 'exec'), namespace)rnrn File "C:/LearnPython/excel/2excel_parsing_and_write.py", line 8, in rn <em>out</em>put_file = sys.argv[2]rnrnIndexError: list <em>index</em> <em>out</em> of <em>range</em>
关于“Grid index out of range”的问题
我的程序rn 1)所用控件rn TDBGrid *DBGrid1;rn TDBNavigator *DBNavigator1;rn TDataSource *DSSQL;rn TQuery* Query1;rn 2)控年设置rn DSSQL->DataSet = Query1;rn DBNavigator1->DataSource = DSSQL;rn DBGrid1->DataSource = DSSQL;rnrn 3)出错的情况rn 3-1) 第一次执行rnrn Query1->Close();rn Query1->SQL->Clear();rn Query1->SQL->Add("select * from aa where qsOpen():rnrn 然后点击DBNavigator1控件的“Last”按钮,程序正常rn 3-2)第二次执行rnrn Query1->Close();rn Query1->SQL->Clear();rn Query1->SQL->Add("select * from aa where qsOpen():rnrn 然后点击DBNavigator1控件的“Last”按钮,程序报“Grid <em>index</em> <em>out</em> of <em>range</em>”错. 点警告框的“确定”按钮后,进入C++Builder的调试状态,不作任何变动,直接rn“RUN”按钮,回到程序运行状态,再按DBNavigator1控件的“Last”按钮,程序又正常。rn 以后每再次重新用SQL查询后,想到数据集的最后一条记录(用语句Query1->Last();也一样),非要出次错,才会正常,不知是何道理,不知有何对策,我估计是DBGrid1的设置有误,但不知具体原因。rn 请赐教,rn为感!!rnrnrn
dbGrid index out of range怎么解决
我利用adoquery控减连接数据库。用dbgrid空件显示内容,但是如果数据库中的纪录超过了一定的数量的时候,救护出现错误:代码如下:rngrid <em>index</em> <em>out</em> of <em>range</em>rnrn我知道是dbgrid控减的问题,从那里可以设置dbgrid空间的范围属性。
index out of range"">dbgird控件---->"grid index out of range"
我在用dbgird控件时, 当dbgird的宽度变大到一定程度, 当点击insert键插入信息时就出错,信息如下:rn"grid <em>index</em> <em>out</em> of <em>range</em>"  如何解决???什么原因???
Grid Index out of Range (TDBAdvGrid/D7)
我知道这个是表格索引越界了,可是dbGrid有没有办法不通过代码只是通过控件设置就可以自动添加记录呢?rnrn顺便请教一个问题,某个数字字段,要求值在2000-500000,dbGrid的输入格可以直接设置只接受符合条件的输入吗?
delphi6 'grid index out of range' 'TDBNavigator'
TDBGrid可以顯示資料rn我使用TDBNavigator去控制TDBGrid的上一筆跟下一筆還有最後一筆跟第一筆rnrn執行時,如果先案最後一筆rn他就會出現Grid <em>index</em> <em>out</em> of <em>range</em>rnrn如果今天先按下一筆再案最後一筆,程式就可以很順利的執行rn請問rn這是什麼原因??rnrn我有網查了,說要去檢查<em>index</em>是不是 0 到 Count - 1 的数值rn想請問一下哪一個的<em>index</em>是TQUERY還是TDBGRID還是??
SSRS 2008 “Index was out of range…” Error
sql server report从05升级到08,查看报表出现如下问题,在05下看没有任何问题,大虾解决!!!rnrn客户端呈现期间出错。rnIndex was <em>out</em> of <em>range</em>. Must be non-negative and less than the size of the collection. Parameter name: <em>index</em>
python程序错误IndexError: list index out of range
新学习python这个问题总是没法解决希望大家帮帮忙rn源码:rn[code=python]#! /usr/bin/env pythonrn#coding=utf-8rnimport timernimport osrnstr1 = open( r'C:\Users\python\Desktop\url.txt' ,'r').readlines()rnnum = 0rnwhile num %(str1[num])rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>
脚本报错:IndexError: list index out of range
[code=Python]j=0rnd=os.listdir(DBDIR)rnfor j in <em>range</em>(0,len(d)-1):rn if d[j][-3:] != 'sql':rn del d[j][/code]rnrnrn这段代码为什么总是报IndexError: list <em>index</em> <em>out</em> of <em>range</em>啊rnrn调试了一下,发现出错后,j的值是301rnrn但我led(d)值是300,我已经限制<em>range</em>(0,299),为什么j值会超出啊rn
Gridview删除的时候提示Index was out of range
[code=HTML]rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrn[code=C#]rnprotected void Page_Load(object sender, EventArgs e)rn rn if (!IsPostBack)rn rn showdata(0);rn rn rnrn //显示数据rn protected void showdata(int pageIndex)rn rn SqlConnection sqlcon;rn <em>string</em> strCon = ConfigurationSettings.AppSettings["ConnectionString"];rn <em>string</em> sqlstr = "select * from tjnews where type='发表文章' or type='实验室活动'";rn sqlcon = new SqlConnection(strCon);rn SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);rn DataSet myds = new DataSet();rn sqlcon.Open();rn myda.Fill(myds, "tjnews");rn DataView view = myds.Tables["tjnews"].DefaultView;rn <em>string</em> sort = "date desc,id desc";rn view.Sort = sort;rnrn GridView1.DataKeyNames = new <em>string</em>[] "id" ;//不加这个不能执行"删除"功能rn GridView1.DataSource = view;rn GridView1.PageIndex = pageIndex;rn GridView1.DataBind();rn rnrn //翻页事件rn protected void fangye(object sender, GridViewPageEventArgs e)rn rn showdata(e.NewPageIndex);rn rnrn //提示rn protected void tishi(object sender, GridViewRowEventArgs e)rn rn //如果是绑定数据行 ,判断是否是数据行rn if (e.Row.RowType == DataControlRowType.DataRow)rn rn //当鼠标停留时更改背景色rn e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF'");rn //当鼠标移开时还原背景色rn e.Row.Attributes.Add("onmouse<em>out</em>", "this.style.backgroundColor=c");rnrn if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)rn rn ((LinkButton)e.Row.Cells[6].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('你确认要删除吗?')");rn rn rnrn //显示编号rn if (e.Row.RowIndex != -1)rn rn int id = e.Row.RowIndex + 1;rn e.Row.Cells[0].Text = id.ToString();rn rn rnrn //删除rn protected void RowDeleting(object sender, GridViewDeleteEventArgs e)rn rn GridViewRow row = GridView1.Rows[e.RowIndex];rnrn DataSet ds = new DataSet();rn <em>string</em> strcn = ConfigurationSettings.AppSettings["ConnectionString"];rn SqlConnection cn = new SqlConnection(strcn);rn cn.Open();rn <em>string</em> sql = "delete from tjnews where id ='" + int.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString()) + "'";rn SqlCommand cm = new SqlCommand(sql, cn);rn cm.ExecuteNonQuery();//执行rn cn.Close();rnrn showdata(0);rn rn[/code]rnrn点击删除的时候会提示Index was <em>out</em> of <em>range</em>,在服务器上会,本地不会,请问<em>是什么</em>原因?
Python2.7:数据清洗的list index out of range问题
```rnfrom csv import readerrnrndata_rdr = reader(open('mn.csv','rb'))rnheader_rdr = reader(open('mn_headers.csv','rb'))rnrndata_rows = [d for d in data_rdr]rnheader_rows = [h for h in header_rdr]rnrnbad_rows = []rnrnfor h in header_rows:rn if h[0] not in data_rows[0]:rn bad_rows.append(h)rnrnfor h in bad_rows:rn header_rows.remove(h)rnrnprint len(header_rows)rnrn Traceback (most recent call last):rn File "/home/sewell-hoo/datafiles/test_list<em>index</em>.py", line 12, in rn if h[0] not in data_rows[0]:rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>rn```rn正在读《python数据处理》一书,这是第7章第2小节的内容:rn处理2个CSV文件,却一直提示List <em>index</em> <em>out</em> of <em>range</em>,实在是想不到哪里错了。rn请忽略图中配图的文件'mn_header_update.csv',两者是一个文件rnrn![图片说明](https://img-ask.csdn.net/upload/201711/06/1509974191_107534.png)
Python3 Error: list index out of range
[code=python]rnrnf = open ('userinfo.txt')#flie_adrnlines = f.readlines()rnnum_f = 0rnnum_m = 0rnfor i in lines:rn name = i.split(',')[0]rn birthday = i.split(',')[1]rn print(name,birthday)rn if i.split(',')[2] == 'male':rn num_m = num_m+1rn else:rn num_f = num_f +1rnprint ("There is %d male emp" %num_m)rnprint ("There is %d emp in this office" %(num_m+num_f))rnrn[/code]rnrn[code=text]rnuserinfo.txtrnrnfox,1995,male,rnhanmeimei,1990,female,rnliming,1989,male,rnasdf,1995,female,rn[/code]rnrnrn执行结果为 rn[code=python]rnfox 1995rnhanmeimei 1990rnliming 1989rnasdf 1995rnTraceback (most recent call last):rn Flie "test.py", line 14, in rn birthday = i.split(',')[1]rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>rn[/code]rnrn这个报错无法理解 15行print已经成功输出了 反过头说14行超限了rnrnpython版本是3.5.0 rn系统是Red Hat Enterprise Linux 6rn用vim编译
[SQLServer 2000 Driver for JDBC]Column index 2 is out of range
用java做个网站,读取数据的时候语句写成select top 10 z.* from zmjob z inner join userinfo u on u.userid = z.userid where z.id not in (select top 10 id from zmjob) where ............就报错rn——————————————————————————————————————————————————————rnjava.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Column <em>index</em> 2 is <em>out</em> of <em>range</em>.rn at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn at com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)rn at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)rn at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)rn at com.webcms.struts.publicfunction.JobAllFunction.JobList_zp(JobAllFunction.java:22)rn at com.webcms.javabeans.JobFunction.JobList_zp(JobFunction.java:28)rn at org.apache.jsp.Job.mcsend_jsp._jspService(mcsend_jsp.java:79)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)rn at com.webcms.struts.datebase.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)rn at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)rn at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)rn at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)rn at java.lang.Thread.run(Thread.java:619)rn——————————————————————————————————————————————————————rn我要是把那个z.*写成*数据全读就没事,或者z.id,z.name。。。。写也没事rn这是为那般啊
javax.servlet.ServletException: java.sql.SQLException: Column Index out of range, 2 > 1.
org.apache.jasper.JasperException: An exception occurred processing JSP page /chazhao.jsp at line 61rnrn58: while(i 1. rn我的代码有上传,请大家帮我看看,谢谢!
/*+index.... index*/ 是什么意思?
具体作用<em>是什么</em>,执行查询能提高速度吗?rn我测试后发现,不加更快呢,还是多次调用才能提高速度.
重装系统,获取宽带连接密码下载
我们经常在装系统之前需要备份的一个重要东西就是宽带上网账户密码,但是这个东西好多人不会记,怎么办呢,有了这个东西,能读出你的密码。 相关下载链接:[url=//download.csdn.net/download/zgl8309/2301341?utm_source=bbsseo]//download.csdn.net/download/zgl8309/2301341?utm_source=bbsseo[/url]
免费网站制作软件_褐色宾馆网站源码下载
模板介绍: 褐色风格的的宾馆网站模板,结构简洁,风格清晰,设计感强,适合制作宾馆、酒店,饭店、装修公司等企业网站..... 宽度:1000px 对齐:居中 主色:褐色 结构:div+css 运行环境:asp.net2.0(或以上) 后台地址:pageadmin网站管理系统 相关下载链接:[url=//download.csdn.net/download/woshiaq_download/5136968?utm_source=bbsseo]//download.csdn.net/download/woshiaq_download/5136968?utm_source=bbsseo[/url]
wifi共享软件下载
wifi共享软件(windows Vista & windows 7) 相关下载链接:[url=//download.csdn.net/download/u012420375/6389953?utm_source=bbsseo]//download.csdn.net/download/u012420375/6389953?utm_source=bbsseo[/url]
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件
我们是很有底线的