grid index out of range是什么问题如何解决? [问题点数:20分,结帖人nhjoy]

Bbs2
本版专家分:245
结帖率 100%
Bbs7
本版专家分:14943
Blank
蓝花 2001年12月 Delphi大版内专家分月排行榜第三
grid index out of range是什么问题,怎么解决
-
关于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 db<em>grid</em>1.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现在的<em>问题</em>在于,当窗体显示时,我点击该按钮,就会出错,弹出出现异常:Grid <em>index</em> <em>out</em> of <em>range</em> 。rn利用F7跟踪调试,发现错误在last这条语句上。rnrn我搞了半天也没弄明白为什么会出错,敬请大家赐教!!!!!!
关于“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
index out of range"提示......">又一个"Grid index out of range"提示......
为何我的Adoquery增加记录有时会出现"Grid <em>index</em> <em>out</em> of <em>range</em>"?何解?
grid index out of range"">dbgird控件---->"grid index out of range"
我在用dbgird控件时, 当dbgird的宽度变大到一定程度, 当点击insert键插入信息时就出错,信息如下:rn"<em>grid</em> <em>index</em> <em>out</em> of <em>range</em>"  <em>如何</em><em>解决</em>???什么原因???
Grid Index out of Range (TDBAdvGrid/D7)
我知道这个是表格索引越界了,可是dbGrid有没有办法不通过代码只是通过控件设置就可以自动添加记录呢?rnrn顺便请教一个<em>问题</em>,某个数字字段,要求值在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還是??
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
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(string username,string 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
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
dbGrid index out of range怎么解决
我利用adoquery控减连接数据库。用db<em>grid</em>空件显示内容,但是如果数据库中的纪录超过了一定的数量的时候,救护出现错误:代码如下:rn<em>grid</em> <em>index</em> <em>out</em> of <em>range</em>rnrn我知道是db<em>grid</em>控减的<em>问题</em>,从那里可以设置db<em>grid</em>空间的范围属性。
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.substring(<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.substring(<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.substring(<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.substring(<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.substring(<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.substring(<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.substring(<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.substring(<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
[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.substring((i * PerPage));rn System.<em>out</em>.println(str[i].length());rn rn else rn rn str[i] = news.substring((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谢谢
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>>>
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
String index out of range: 48
String <em>index</em> <em>out</em> of <em>range</em>: 48
String index out of range: -2问题
今天突然遇到这个<em>问题</em>。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.substring(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]
index out of range"?CSDN到底有没有高人?">"Grid index out of range"?CSDN到底有没有高人?
为何我的Adoquery增加记录有时会出现"Grid <em>index</em> <em>out</em> of <em>range</em>"?何解?用的是DBGrid,代码应没错,就好象:rnDataModule1.adoquery1.close;rnDataModule1.adoquery1.sql.text:='select * from ddxx';rnDataModule1.adoquery.open;rnwith DataModule1.adoquery1 dornbeginrn last;rn id:=fieldbyname('ddid').asinteger;rn append;rn edit;rn fieldbyname('ddid').asinteger:=id+1;rn post;rnend;rnrn是不是我的DBGRID一定要显视如ddxx表里的所有fields才行?rnrn
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)
Grid index out of range错误怎么回事?急急急急!!!
ClientDataSet.dataRequest后,用.dataRequest.<em>index</em>Defs.add增加了rn几个索引用来排序,然后在ClientDataSet的<em>index</em>name设了一个值,当在次ClientDataSet.dataRequest后,然后重新设<em>index</em>name,会出现Grid <em>index</em> <em>out</em> of <em>range</em>错误(我使用了DBGrid连到ClientDataSet),怎么<em>解决</em>?rn
在快速拖gdgrid滚动条时出现grid index out of range!
这是否是db<em>grid</em>控件中的bug这个错误现象只在很长超出显示范围进才出现。我都不知根源<em>是什么</em>。请指教。
out of range 怎么解决?
装的是fc4,用的是图形界面,可能是设置显示的时候出错,现在进入系统不到3秒种,显示器就显示<em>out</em> of <em>range</em>,我该怎样设置才能设置成合适的频率
String index out of range: -2 是什么意思呢?
String <em>index</em> <em>out</em> of <em>range</em>: -2 <em>是什么</em>意思呢?rn-1是越界,-2呢?rn请高手解释一下啊!
String index out of range:6 请问这个错误信息是什么意思
String <em>index</em> <em>out</em> of <em>range</em>:6 请问这个错误信息<em>是什么</em>意思rnrn那位高手能给点意见阿
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.substring(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这是一个发布的别人的网站,可是里面有很多地方都报的这同一个错,怀疑不是单纯的下标越界<em>问题</em>,不晓得原因究竟出在哪里?希望有遇到类似情况 的高手解答一下迷津,谢了!!!
String index out of range: -1 异常,急需处理
nnnn  
报错String index out of range是什么意思?在线等
报错String <em>index</em> <em>out</em> of <em>range</em><em>是什么</em>意思?在线等
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相关的代码贴出来了,但不是很理解这个数组怎么就越界了。也不知道怎么去修改
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.substring(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.substring(i,j); rnfujiazym=fujiazym.substring(j+1,m); rn rn执行后出现错误提示, rnjava.lang.StringIndexOutOfBoundsException: String <em>index</em> <em>out</em> of <em>range</em>: 500 rn我的数据库中的titleAlternative字段大小是500.请教是何原因rnrn
求助: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出现<em>问题</em>,输出;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>
string index out of range字符串怎么越界了?
打印出来s.encode('hex')是 0300 但是打印s[1]却报下面错误?rnstring <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.substring(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]
求助: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字段中是否有相同部分,用到了字符串的substring()方法rn我测试过多次,但每次报错的数据都不一样,都报数组越界的错。rnrnIR_SID IR_SRCNAME rn----------- -------------------------rn5963 JB 3540-1983 ; rnrnrnIR_SID IR_SRCNAME rn----------- -------------------------rn7216 JB/T 8648.2-1997 ; rnrnIR_SRCNAME的数据是我要用substring()方法处理的数据,运行一次会报处理JB 3540-1983出现数组越界的错,再重新运行一次会报处理JB/T 8648.2-1997出现数组越界的错,运行多少次就会出现多少次不同的数据报错,并且都是数组越界,我的<em>问题</em>是[color=#FF0000]如果真的是某个数据或者某些数据在用substring()处理的时候有错的话应该是一直报错,为什么运行一次就报不同的数据有错呢?[/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.substring(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().substring(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]
SSRS 2008 “Index was out of range…” Error
sql server report从05升级到08,查看报表出现如下<em>问题</em>,在05下看没有任何<em>问题</em>,大虾<em>解决</em>!!!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这个<em>问题</em>总是没法<em>解决</em>希望大家帮帮忙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>
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
脚本报错: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 string strCon = ConfigurationSettings.AppSettings["ConnectionString"];rn string 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 string sort = "date desc,id desc";rn view.Sort = sort;rnrn GridView1.DataKeyNames = new string[] "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 string strcn = ConfigurationSettings.AppSettings["ConnectionString"];rn SqlConnection cn = new SqlConnection(strcn);rn cn.Open();rn string 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>原因?
java.lang.StringIndexOutOfBoundsException:String index out of range:-1
程序如下:rnrn包上述错误,没见过怎么回事?
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编译
String index out of range: -6 的错误
初次使用hibernate,然后将一个页面中的数据插入到数据库中时,就阴魂不散的发生了这个错误,我插入的值只是一位:“1”,却总是报这个错,有谁也碰到过这个<em>问题</em>吗?
Python中遇到IndexError: list index out of range怎么解决
编码如下:rn# coding=gbkrnimport socketrnimport sysrns=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)rn# 假设192.168.0.103是接收端机器的IP地址rns.sendto(sys.argv[1].encode(),("192.168.0.103" ,5000))rns.close()rn错误提示:rnTraceback (most recent call last):rn File "C:\Users\admin\eclipse-workspace\111\src\111.py", line 6, in rn s.sendto(sys.argv[1].encode(),("192.168.0.103" ,5000))rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>rn请问怎么<em>解决</em>啊,谢谢啦
out of range 怎么解决啊????????
我在安装RADHAT9和红旗5时都出现OUT OF RANGE显示器也黑屏!!!!rn在网上查到是显卡还是显示器的<em>问题</em>!!rn请问怎么<em>解决</em>啊!!??????????rn
Java out of range 问题
import java.util.*; rnimport java.io.*;rnrnpublic class test rn public static void main(String args[]) rn String M="Calif";rn rn Random rng=new Random();rn rn String K = "";rn StringBuffer my = new StringBuffer(M);rn StringBuffer my2 = new StringBuffer(K);rn System.<em>out</em>.println("length of this String is "+my.length());rn int Length=my.length();rn for(int r=0;r
Number is out of range问题
rn以下数据有可能是整数、小数相加。rncdsData.FieldByName('Total_Count').AsFloat :=cdsData.FieldByName('Total_Count').AsFloat+1;rnrn经常出现Number is <em>out</em> of <em>range</em><em>问题</em>
设置行高时报错 grid out of index
使用控件:ehlib 5.2rn在使用代码rnTStringGrid(DBGridEh1).RowHeights[1] = 50rn时,一直报错rn确定原表内有数据行10条。rn使用db<em>grid</em>eh,adoquery,关联无误。rn以上错误有人能帮我下么?
关于out of range问题
我用ClientDataSet执行下边的sql语句rnselect max(SHOW_SEQUENCE)as s from modulern未报错rn但是付值时temp:=temp_cds.fieldbyname('s').AsString;rn报错 <em>out</em> of <em>range</em>rn这是怎抹回事
请问:如何解决index is out of date.
现象:rn 1、对TTable 设置第二索引(副索引),没有建主索引。rn 2、在数据未发生变动的情况下,一切正常,操作很好。rn 3、在数据发生变动的情况下,无论是采用程序改变还是采用explore,或者Desktop 等工具改变之后,再使用它,就提示:Index is <em>out</em> of date.rn自我判断:rn 1、可以确认的根源是:副索引没有和数据变动结果保持一致。rn 2、其他方法不用考虑,主要方法有二:rn A.在程序中,适时地先删除该索引,并立即重新创建它,达到更新目的。rn B.在程序中,调用某个索引功能,实现对它的同步更新。rn处理结果:rn 1、两中方法都未成功,但我不想采取不用副索引的其他回避方法。rn 2、程序删除该索引很成功,但创建时不是很成功,没有反应。rn提问:rn 在使用副索引的时候,<em>如何</em>保持其与实际数据的同步更新?rn 请给出具体方法和代码,谢谢。rn 急,急,急!rnrn(提问原因:本人有5年没具体写代码了,现时间紧张,看CB只有1月时间不到,但能<em>解决</em>这里大家提出的绝大多数<em>问题</em>。希望高手给予帮助,大家交个朋友。)rn
Column index X is out of range.如何解决
rnrnrnrnrn rn 无标题文档rnrnrnrnrnrnrnrn运行结果提示如下:rntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /1/SqlReadFile.jsp at line 28rnrn25: while(rs.next())rn26: rn27: rn28: path=path+rs.getObject(10).toString();rn29: String txt=rs.getObject(3).toString();rn30: File fp=new File(path,txt);rn31: FileReader fr=new FileReader(fp);rnrnrnStacktrace:rn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjavax.servlet.ServletException: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Column <em>index</em> 10 is <em>out</em> of <em>range</em>.rn org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)rn org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)rn org.apache.jsp._1.SqlReadFile_jsp._jspService(SqlReadFile_jsp.java:111)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:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrnrnroot cause rnrnjava.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Column <em>index</em> 10 is <em>out</em> of <em>range</em>.rn com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)rn com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)rn com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)rn com.microsoft.jdbc.base.BaseResultSet.getObject(Unknown Source)rn org.apache.jsp._1.SqlReadFile_jsp._jspService(SqlReadFile_jsp.java:86)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:374)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rnrn<em>如何</em><em>解决</em>这个<em>问题</em>,还请广大网友指点》rn谢谢!
list index out of bounds(0)是什么问题?怎么解决
请问各位,我在登录local server是弹出一个提示框说:“list <em>index</em> <em>out</em> of bounds(0)”rn这个<em>是什么</em><em>问题</em>?怎么<em>解决</em>?我重装了interbase 还是于是无补的,该怎么<em>解决</em>这个<em>问题</em>啊?谢谢赐教!
Index is out of date的问题
为什么会有Index is <em>out</em> of date的错误,<em>如何</em>避免和<em>解决</em>
爬取淘宝评论时出现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...
[D]关于IndexError: list index out of range问题
我编了个小程序 读取文件数据,运行时总提示IndexError: list <em>index</em> <em>out</em> of <em>range</em> ,我仔细检查了,索引并没有越界啊,还有其他原因导致这个错误吗 代码太长了 贴出部分代码 希望大家帮忙看看 感激不尽 rn[code=Python] file1=open('%s' % mgt) #从mgt文件中读取信息rn global line1rn line1=[]rn global line1numrn line1num=0rn for eachline in file1.readlines():rn line1.append(eachline)rn line1num+=1 rn global componentsrn components=[]rn global compnumrn compnum=0rn i=0rn cps=0rn cpo=0rn while i
python爬虫中碰到IndexError: list index out of range问题
[code=python]soup = BeautifulSoup ( html, "lxml" )rntrs = soup.find_all('tr')[1:]rnmovies = []rnfor tr in trs:rn movie = rn tds = tr.find_all("td")rn title = tds[0].stringrn category = tds[1].stringrn nums = tds[2].stringrn city = tds[3].stringrn time = tds[4].stringrn movie['title'] = titlern movie['category'] = categoryrn movie['nums'] = numsrn movie['city'] = cityrn movie['time'] = timern movies.append(movie)rnprint(movies)[/code]rn代码如上,会显示如下错误:rn[code=python]Traceback (most recent call last):rn File "E:/资源/python 爬虫/bs4_hj/123123.py", line 138, in rn category = tds[1].stringrnIndexError: list <em>index</em> <em>out</em> of <em>range</em>[/code]rn小白技术有限,但是觉得应该是tds列表<em>问题</em>,但是不知道怎么修改,可以指导一下吗
py转exe问题 出现tuple index out of range
我想把py转为exe文件。rnrn在网上找的方法,做setup.pyrn[code=python]rnfrom distutils.core import setuprnimport py2exernsetup(console=["killexe.py"])rn[/code]rnrn另外我的killexe.pyrn[code=python]import osrnos.system("taskkill /IM SogouCloud.exe /F")rnprint("complete")rn[/code]rnrn然后再win 控制台上执行python setup.py py2exern报下面的错误rnrn[code=python]rnE:\Python>python setup.py py2exernrunning py2exernTraceback (most recent call last):rn File "setup.py", line 3, in rn setup(console=["killexe.py"])rn File "C:\Program Files\lib\distutils\core.py", line 148, in setuprn dist.run_commands()rn File "C:\Program Files\lib\distutils\dist.py", line 966, in run_commandsrn self.run_command(cmd)rn File "C:\Program Files\lib\distutils\dist.py", line 985, in run_commandrn cmd_obj.run()rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\distutils_buildexe.py", line 188, in runrn self._run()rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\distutils_buildexe.py", line 267, in _runrn builder.analyze()rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\runtime.py", line 160, in analyzern self.mf.import_hook(modname)rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\mf3.py", line 120, in import_hookrn module = self._gcd_import(name)rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\mf3.py", line 274, in _gcd_importrn return self._find_and_load(name)rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\mf3.py", line 357, in _find_and_loadrn self._scan_code(module.__code__, module)rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\mf3.py", line 388, in _scan_codern for what, args in self._scan_opcodes(code):rn File "C:\Users\nasri.yang\AppData\Roaming\Python\Python37\site-packages\py2exe\mf3.py", line 417, in _scan_opcodesrn yield "store", (names[oparg],)rnIndexError: tuple <em>index</em> <em>out</em> of <em>range</em>rnrnE:\Python>[/code]rnrn这个应该代码本身没有<em>问题</em>,是不是 版本支持方面的<em>问题</em>?rn
多文件上传的 问题 String index out of range: -1在线等!
我做了一个多文件的上传,但是测试的是总是提醒我这样的话String <em>index</em> <em>out</em> of <em>range</em>: -1rnrn不知道<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.substring(key.<em>index</em>Of("*") + 1, keyrn .lastIndexOf("*"));rn //图片描述rn String photoName = key.substring(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请帮小弟解惑! 在此谢过了!
关于index range scan的问题
假设有一个表其中a和b两列构成唯一索引。rn当查询条件只有a的时候发现,执行计划为<em>index</em> <em>range</em> scan,使用的唯一索引rnrn那请问这样的话,和我在a上建立一个普通索引有差别吗?
vector subscript out of range问题
[code=c]rnfor(std::vector::size_type i = lineStr.size() - 1; i >= 0; i--)rnrn sscanf(lineStr[i],"%s %s %s %s %s %s %s %s",pCode,pName,pStr,pGroup,pValue,pUnit,pMin,pMax);rnrn[/code]rn这段代码有什么<em>问题</em>么,求各位大大们解答,谢谢了
index is out of date如何处理?????
有一个Paradox7的表,用Desktop打开的时候提示“<em>index</em> is <em>out</em> of date”,然后就不能打开表了,里面的数据都看不到了,怎么<em>解决</em>呢?
如何解决LIST INDEX OUT OF BOUNDS的问题(在线HELP)
我用的是PARADOX的数据库。表的一个字段类型是图片。 rn插入图片时用 rntable1.insertrecord(edit1.text,image1.picture) rn编译通过了, 运行时图片是a.bmp类型, rn出现了错误"LIST INDEX OUT OF BOUNDS",请求各位高手的指
List index out of bounds (1)是什么错误
前几天想做一个智能查询的东西,就是在编辑框里输入内容,马上模糊检索数据库中的相关记录,并在下面提示出来,我的思路是用一个edit和一个listbox来实现,edit设置onchange事件,即时的由edit.text的内容搜索数据库,然后将结果赋给listbox的items,并设置listbox可见,listbox的click事件则将选择的内容赋到edit中。编译没有<em>问题</em>,但是在实际运行时,当我在listbox中选择一项时,就弹出List <em>index</em> <em>out</em> of bounds的错误,请问这<em>是什么</em>原因啊,是不是需要设置什么属性?SOS!
list index out of bounds(0)是什么意思
list <em>index</em> <em>out</em> of bounds(0)<em>是什么</em><em>问题</em>,什么地方错了
“list index out of bounds (0)”是什么东西????
那该死的 delphi,我的程序运行时总报“list <em>index</em> <em>out</em> of bound(0)”rn这<em>是什么</em>东西啊????????rnwith Query1 dornbeginrn close;rn sql.Text:='select * from tb_1';rn open; // <-------就这里错,前面没有错,后面也没有,,??????rnend;rn这肯定是一个 bug!!!!!!!!!rnrn啊,我快疯了!我要咬人啦!!!!!rnrn
index out of bounds(0)"是什么意思">" list index out of bounds(0)"是什么意思
" list <em>index</em> <em>out</em> of bounds(0)"<em>是什么</em>意思
悬赏求解决SUBSCRIPT OUT OF RANGE,BASIC.
BASIC做的一个灰色模型程序,运行后提示"SUBSCRIPT OUT OF RANGE",指针在2090行.求高手<em>解决</em>.源代码如下:rn10 REM****************************************************rn20 REM* ****灰色状态方程计算程序***** *rn30 REM* NAME:GM(1,N) *rn40 REM****************************************************rn100 CLS : PRINT "********GM(1,N)*********"rn110 DIM Y(10, 60): GOSUB 5000rn120 OPEN "i", #1, WJ$rn130 INPUT #1, GS, T0, TNrn140 MN = TN - T0 + 1rn150 FOR I = 1 TO GSrn160 INPUT #1, MC$(I)rn170 FOR J = 1 TO MNrn180 INPUT #1, Z(I, J)rn190 NEXT: NEXTrn200 CLOSErn210 PRINT : PRINT "ZHI BIAO SHU:"; GS, "QI SHI SHI XU"; T0, "ZHONG ZHI SHI XU"; TNrn220 PRINT : INPUT "JIAN MO QI SHI NIAN $ XUHAO T1="; T1rn230 INPUT "JIAN MO ZHONG ZHI NIAN & XUHAO T2="; T2rn240 PRINT "JIAN MO QI ZHI NIAN & XU HAO)"; T1; "---"; T2rn250 M = T2 - T0 + 1: M0 = T1 - T0 + 1rn260 GOTO 1370rn270 DIM A(M, N), B(N, M), C(N, N * 2), D(N, N * 2), E(N, 1), X(N), X0(N, M), X1(N, M), G(M), XX(N, MN)rn280 GOTO 1370rn290 FOR I = 1 TO Nrn300 FOR J = M0 TO M - 1rn310 A(J, I) = B(J, I)rn320 NEXT Jrn330 NEXT Irn340 PRINT "***************A(i,j)******************"rn350 FOR I = M9 TO M - 1rn360 FOR J = 1 TO Nrn370 PRINT A(I, J); " ";rn380 NEXT Jrn390 PRINTrn400 NEXT Irn410 PRINT "************AtA**************"rn420 FOR I = 1 TO Nrn430 FOR K = 1 TO Nrn440 C(I, K) = 0rn450 FOR J = M0 TO M - 1rn460 C(I, K) = C(I, K) + B(I, J) * A(J, K)rn470 NEXT Jrn480 PRINT C(I, K); " ";rn490 IF I = K THEN 520rn500 C(I, K + N) = 0rn510 GOTO 530rn520 C(I, K + N) = 1rn530 NEXT Krn540 PRINTrn550 NEXT Irn560 PRINT "***********(AtA)-1************"rn570 FOR I = 1 TO N - 1rn580 FOR K = I + 1 TO Nrn590 FOR J = 1 + I TO 2 * Nrn600 C(K, J) = C(K, J) - C(I, J) / C(I, I) * C(K, I)rn610 NEXT Jrn620 NEXT Krn630 NEXT Irn640 FOR I = 1 TO Nrn650 FOR J = 1 TO N * 2rn660 D(I, J) = C(I, J) / C(I, I)rn670 NEXT Jrn680 NEXT Irn690 FOR I = N TO 2 STEP -1rn700 FOR K = I - 1 TO 1 STEP -1rn710 FOR J = N * 2 TO I STEP -1rn720 D(K, J) = D(K, J) - D(I, J) / D(I, I) * D(K, I)rn730 NEXT Jrn740 NEXT Krn750 NEXT Irn760 FOR I = 1 TO Nrn770 FOR J = N + 1 TO N * 2rn780 PRINT D(I, J); " ";rn790 NEXT Jrn800 PRINTrn810 NEXT Irn820 PRINT "************Yn************"rn830 FOR I = M0 TO M - 1rn840 Y(I, 1) = X0(1, I + 1)rn850 PRINT Y(I, 1); " ";rn860 NEXT Irn870 PRINTrn880 PRINT "**********AtYn***********"rn890 FOR I = 1 TO Nrn900 E(I, 1) = 0rn910 FOR J = M0 TO M - 1rn920 E(I, 1) = E(I, 1) + B(I, J) * Y(J, 1)rn930 NEXT Jrn940 PRINT E(I, 1)rn950 NEXT Irn960 PRINT "***********XI SHU XIANG LIANG*************"rn970 FOR I = 1 TO Nrn980 X(I) = 0rn990 FOR J = N + 1 TO N * 2rn1000 X(I) = X(I) + D(I, J) * E(J - N, 1)rn1010 NEXT Jrn1020 IF I > 1 THEN 1050rn1030 PRINT "^a="; X(I)rn1040 GOTO 1060rn1050 PRINT "^b"; I - 1; "="; X(I)rn1060 NEXT Irn1070 PRINT "------------ZHUANG TAI FANG CHENG HAN SHU---------------"rn1080 PRINT "^X1(t=1)=("; X0(1, M0); ")";rn1090 FOR I = 2 TO Nrn1100 PRINT "-"; X(I) / X(1); "x"; I;rn1110 NEXT Irn1120 PRINT ")e "; -X(1); "t "rn1130 FOR I = 2 TO Nrn1140 PRINT "+"; X(I) / X(1); "x"; I; " ";rn1150 NEXT Irn1160 PRINTrn1170 PRINT "---------------^X1(i)-----------------------"rn1180 FOR J = M0 TO Mrn1190 GOSUB 1850rn1200 G = S * EXP(-X(1) * (J - 1))rn1210 FOR I = 2 TO Nrn1220 G(J) = G + (X(I) / X(1)) * X1(I, J)rn1230 G = G(J)rn1240 NEXT Irn1250 PRINT "^x1("; T1 - M0 + J; ")="; G(J); "------"; X1(1, J)rn1260 NEXT Jrn1270 PRINT "--------NI HE ZHI---------NI HE CHA----------%---------"rn1280 FOR T = M0 TO M - 1rn1290 X = G(T + 1) - G(T)rn1300 E = XX(1, T + 1) - Xrn1310 P = E / XX(1, T + 1)rn1320 IF T1 - M0 + T + 1 < T2 - 4 THEN 1350rn1330 PRINT "^X0("; T1 - M0 + T + 1; ")="; X; "------"; XX(1, T + 1)rn1340 PRINT " e="; E; " q="; P * 100; "%"rn1350 NEXT Trn1360 GOTO 1910rn1370 PRINT "----------YUAN SHI SHU JU-----------"rn1380 FOR I = 1 TO GSrn1390 PRINT MC$(I); " ";rn1400 FOR J = 1 TO MNrn1410 'READ Z(I, J)rn1420 IF J < M0 THEN 1440rn1430 PRINT Z(I, J); " ";rn1440 NEXT J: PRINTrn1450 NEXT Irn1460 PRINT "QING AN REN YI JIAN JI XU------"rn1470 AA$ = INKEY$: IF AA$ = "" THEN 1470rn1480 GOSUB 1970rn1490 PRINT : INPUT "SHU JU PING HUA MA?(y/n)"; DD$rn1500 IF DD$ = "Y" OR DD$ = "y" THEN 1510 ELSE GOTO 1620rn1510 PRINT : PRINT "----------JIAN MO SHU JU-----------"rn1520 FOR I = 1 TO Nrn1530 X0(I, M0) = (3 * XX(I, M0) + XX(I, M0 + 1)) / 4rn1540 PRINT X0(I, M0); " ";rn1550 FOR J = M0 + 1 TO M - 1rn1560 X0(I, J) = (XX(I, J - 1) + 2 * XX(I, J) + XX(I, J + 1)) / 4rn1570 PRINT X0(I, J); " ";rn1580 NEXT Jrn1590 X0(I, M) = (XX(I, M - 1) + 3 * XX(I, M)) / 4rn1600 PRINT X0(I, M)rn1610 NEXT I: GOTO 1670rn1620 PRINT : PRINT "--------------JIAN MO SHU JU----------------"rn1630 FOR I = 1 TO N: FOR J = 1 TO Mrn1640 X0(I, J) = XX(I, J): IF J < M0 THEN 1660rn1650 PRINT X0(I, J); " ";rn1660 NEXT J: PRINT : NEXT Irn1670 PRINT "----------X1(i,j)------------"rn1680 FOR I = 1 TO Nrn1690 T = 0rn1700 FOR J = M0 TO Mrn1710 T = T + X0(I, J)rn1720 X1(I, J) = Trn1730 PRINT X1(I, J); " ";rn1740 NEXT J: PRINTrn1750 NEXT Irn1760 FOR I = 1 TO Nrn1770 FOR J = M0 TO M - 1rn1780 IF I <> 1 THEN 1810rn1790 B(I, J) = -(X1(I, J + 1) + X1(I, J)) / 2rn1800 GOTO 1820rn1810 B(I, J) = X1(I, J + 1)rn1820 NEXT Jrn1830 NEXT Irn1840 GOTO 290rn1850 S0 = X0(1, M0)rn1860 FOR I = 2 TO Nrn1870 S = S0 - X1(I, J) * X(I) / X(1)rn1880 S0 = Srn1890 NEXT Irn1900 RETURNrn1910 PRINT "---------------END----------------"rn1920 INPUT "DAYINJIEGUOMA?(Y/N)"; D$rn1930 IF D$ = "Y" OR D$ = "y" THEN GOSUB 2120rn1940 INPUT "GEN HUAN BIAN LIANG & SHI DUAN JI SUAN MA?(Y/N)"; JX$rn1950 IF JX$ = "Y" OR IX$ = "y" THEN 210rn1960 ENDrn
vector subscript out of range怎样解决
程序代码如下:rn//BinomialQueue.hrnrn#ifndef BINOMIALQUEUE_H_Hrn#define BINOMIALQUEUE_H_Hrnrn#includern#includern#includernusing namespace std;rnrntemplate rnclass BinomialQueuernrnpublic:rn BinomialQueue()rn :theTrees(0),currentSize(DEFAULT_TREE) rnrn BinomialQueue(const BinomialQueue &rhs)rn rn BinomialQueue::operator=(rhs);rn rn BinomialQueue(const Comparable &item)rn :theTrees(0), currentSize(DEFAULT_TREE)rn rn theTrees.push_back(new BinomialNode(item, NULL, NULL));rn rn const BinomialQueue &operator=(const BinomialQueue &rhs)rn rn if(this == &rhs)rn return &this;rn makeEmpty();rn currentSize = rhs.currentSize;rn for(int i = 0; i< rhs.theTrees.size(); ++i)rn theTrees[i] = rhs.theTrees[i];rn return *this;rn rn ~BinomialQueue() makeEmpty(); rnrn bool isEmpty() constrn rn return currentSize == 0;rn rnrn void makeEmpty() constrn rn for(int i = 0; i < currentSize; ++i)rn makeEmpty( theTrees[i] );rn currentSize = 0;rn rnrn const Comparable &findMin() constrn rn int minIndex = findMinIndex();rn return theTrees[minIndex]->element;rn rnrn void insert(const Comparable &x)rn rn BinomialQueue bq(x);rn merge(bq);rn rnrn void deleteMin(Comparable &minItem)rn rn int minIndex = findMinIndex();rn minItem = theTrees[minIndex]->element;rn deleteMin();rn rnrn void deleteMin()rn rn if(isEmpty())rn throw std::underflow_error ("BinomialQueue is empty");rn int minIndex = findMinIndex();rnrn BinomialNode * oldRoot = theTrees[minIndex];rn BinomialNode * deletedTree = oldRoot->leftChild;rn delete oldRoot;rnrn BinomialQueue deletedQueue;rn deletedQueue.theTrees.resize(minIndex + 1);rn deletedQueue.currentSize = (1 << minIndex) - 1;rn for(int j = minIndex - 1; j >= 0; --j)rn rn deletedQueue.theTrees[j] = deletedTree;rn deletedTree = deletedTree->nextSibling;rn deletedQueue.theTrees[j]->nextSibling = NULL;rn rnrn theTrees[minIndex] = NULL;rn currentSize -= deletedQueue.currentSize + 1;rnrn merge(deletedQueue);rn rnrn void merge(BinomialQueue &rhs)rn rn if( this == &rhs)rn return;rnrn currentSize += rhs.currentSize;rnrn if( currentSize > capacity())rn rn size_t oldNumTrees = theTrees.size();rn size_t newNumTrees = max(theTrees.size(), rhs.theTrees.size()) + 1;rn theTrees.resize(newNumTrees);rn for(int i = oldNumTrees; i < newNumTrees; ++i)rn theTrees[i] = NULL;rn rnrn BinomialNode * carry =NULL;rn for(size_t i = 0, j = 1; j < currentSize; ++i, j *= 2)rn rn BinomialNode * t1 = theTrees[i];rn BinomialNode * t2 = i < rhs.theTrees.size() ? rhs.theTrees[i] : NULL;rnrn int whileCase = t1 == NULL ? 0 : 1;rn whileCase += t2 == NULL ? 0 : 2;rn whileCase += carry == NULL ? 0 : 4;rnrn switch (whileCase)rn rn case 0: /* No Tree */rn case 1: /* only this */rn break;rn case 2: /* only rhs */rn theTrees[i] = t2;rn rhs.theTrees[i] = NULL;rn break;rn case 4: /* only carry */rn theTrees[i] = carry;rn carry = NULL;rn break;rn case 3: /* this and rhs */rn carry = combineTrees(t1, t2);rn theTrees[i] = rhs.theTrees[i] = NULL;rn break;rn case 5: /* this and carry */rn carry = combineTrees(t1, carry);rn theTrees[i] = NULL;rn break;rn case 6: /* rhs and carry */rn carry = combineTrees(t2, carry);rn rhs.theTrees[i] = NULL;rn break;rn case 7: /* All Tree */rn theTrees[i] = carry;rn carry = combineTrees(t1, t2);rn rhs.theTrees[i] = NULL;rn break;rn rn rn for(int k = 0; k < rhs.theTrees.size(); ++k)rn rhs.theTrees[k] = NULL;rn rhs.currentSize = 0;rn rnrnrnprivate:rn struct BinomialNodern rn Comparable element;rn BinomialNode * leftChild;rn BinomialNode * nextSibling;rn BinomialNode(const Comparable &e, BinomialNode * lt, BinomialNode * sibling)rn :element(e), leftChild(lt), nextSibling(sibling) rn ;rnrn enum DEFAULT_TREE = 1 ;rnrn mutable size_t currentSize;rnrn vector theTrees;rnrn int findMinIndex() constrn rn int i;rn size_t minIndex;rnrn for(i = 0; theTrees[i] == NULL; ++i)rn ;rnrn for(minIndex = i; i < theTrees.size(); ++i)rn if(theTrees[i] != NULL &&rn theTrees[i]->element < theTrees[minIndex]->element)rn minIndex = i;rnrn return minIndex;rn rnrn int capacity() constrn rn return theTrees.capacity();rn rnrn BinomialNode * combineTrees(BinomialNode * t1, BinomialNode * t2)rn rn if(t1->element > t2->element)rn return combineTrees(t2, t1);rn t2->nextSibling = t1->leftChild;rn t1->leftChild = t2;rn return t1;rn rnrn void makeEmpty(BinomialNode * t) constrn rn if(t != NULL)rn rn makeEmpty(t->leftChild);rn makeEmpty(t->nextSibling);rn delete t;rn rn t = NULL;rn rnrn BinomialNode * clone(BinomialNode * t) constrn rn if(t == NULL)rn return NULL;rn elsern return new BinomialNode(t->element, clone(t->leftChild), clone(t->nextSibling));rn rn;rn#endifrnrnrn//Demo.cpprnrn#includern#include "BinomialQueue.h"rn#includern#includernusing namespace std;rnrnint main()rnrn BinomialQueue bq1;rn BinomialQueue bq2;rn int t;rn srand( (unsigned) time(NULL) );rn for(int i = 0; i < 10; ++i)rn rn t = rand()%100 + 1;rn bq1.insert(t);rn rnrn for(int j = 0; j < 10; ++j)rn rn t = rand()%100 + 1;rn bq2.insert(j);rn rnrn bq1.merge(bq2);rn rn int i;rn while(!bq1.isEmpty())rn rn bq1.deleteMin(i);rn c<em>out</em><< i << endl;rn rnrn return 0;rnrn
TProgressBar property out of range怎么解决
我的ProgressBar1 max为300,min为120,运行时TProgressBar property <em>out</em> of <em>range</em> 错误rn怎么<em>解决</em>啊,怎么让ProgressBar1的<em>range</em> 变大啊
错误:jump out of range ,应该怎样解决?
错误:jump <em>out</em> of <em>range</em> ,应该怎样<em>解决</em>?
vector subscript out of range
小弟用VC6.0编写了个DLL(DLL有多线程)应用程序调用它没有任何<em>问题</em>,但是,当用VS2005重新编译产生DLL,应用程序EXE调用出错了 Expression:vector subscript <em>out</em> of <em>range</em>。我试图用抛出异常来查找,但是不知道该抛出什么异常 。rnrn附:VS2005编译产生的DLL(debug),VC6.0产生的应用程序EXE(debug)rn请问VC6.0 和VS2005 的STL实现有区别吗? 还是其他原因?rnrn
求助--OUT OF RANGE
本人电脑时常启动变青屏,显示“OUT OF RANGE”字样,须再次启动才正常;请问这是显示器的<em>问题</em>吗?<em>如何</em><em>解决</em>?rn本人电脑设定为大字体,不过换成小字体好象也一样;另外就是我通常不关显示器的,这会有<em>问题</em>?rnrn
急死了,----------------------------------------------Subscript out of range
aspSmartUpload 錯誤 '800a0009' rnrnSubscript <em>out</em> of <em>range</em> rnrndownload.asp, 列5 rnrn
subscript out of range
创建对象是出现这个错误,我没用下标阿,这是怎么回事、rnrn出事的地方是rnset obj=server.createobject("Lyfupload.uploadFile")rn
string subscript out of range
我使用rntemp.erase(temp.end()-1);rn后编译时没错,运行时出现RT错误!高手帮忙啊!
Subscript out of range
LyfUpload 错误 '80020009' rnrnSubscript <em>out</em> of <em>range</em> rnrn/金和田/manager/doupload.asp,行 15 rnrnrn代码如下:rnrnrnrnrn rn 文件上传rnrnrnrnrnrnrn rn rnrnrnrn第15行是 set uploadphoto = Server.CreateObject("LyfUpload.UploadFile")rnrn请各位帮忙<em>解决</em>,小弟很急!!!
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><em>是什么</em>原因导致呢。该<em>如何</em><em>解决</em>呢
subscript out of range原因
引用“microsofe runtimr scripting”,读写文件,加密一个应用程序。rn本地运行时没有<em>问题</em>,生成.exe文件交给用户,运行提示“错误9,subscript <em>out</em> of <em>range</em>”rn请教大虾,可能的原因<em>是什么</em>,<em>如何</em><em>解决</em>,谢谢!!!
vector out of range
Hi ,大家好,我是新来的,请多多关照呀。rn在快速排序算法中,出了点<em>问题</em>,请那位高人指点指点,在此先谢了!rn下面是程序原文和<em>问题</em>:rn//quickSort.hrnrn#ifndef QUICKSORT_Hrn#define QUICKSORT_Hrn#include rnrnusing namespace std;rnrntemplaternvoid quickSort( vector a )//对队列a进行快速排序rnrn quickSort( a, 0, a.size()-1 ); //调用重载函数rnrnrntemplaternvoid quickSort( vector a, int left, int right )rnrn if( left>=right ) //如果待排长度为0或1,无需再排rn return;rnrn int pivot=partition( a, left, right ); //进行划分rn quickSort( a, left, pivot-1 ); // 对分割点左半部分进行快速排序rn quickSort( a, pivot+1, right ); //对分割点右半部分进行快速排序rnrnrntemplaternint partition( vector a, int left, int right )rnrnrn int pivot;rn Comparable x=a[ left ]; //以第一个元素为基准rn int i=left;rn int j=right+1;rnrn while( true )rn while( a[ ++i ]x ); //右边比基准大的不动rn if( i>=j ) //划分完毕时退出rn break;rn swap( a[ i ], a[ j ] ); //此时,a[ i ]>=x, 且a[ j ]rn#include rnrnusing namespace std;rnrnint _tmain(int argc, _TCHAR* argv[])rnrn vector< int > v( 9 );rn rn int arr[ 9 ]= 90, 3, 34, 4, 45, 5, 56, 6, 67 ;rn for( int i=0; i<<
slice bounds out of range
[img=https://img-bbs.csdn.net/upload/201705/27/1495850320_223860.png][/img]rnrnb = [0, 0, 0, 0, 0]rnb[2:] 为什么会报错, 不应该是 b[2:] = [0, 0, 0] ?
Recordindex out of range
很简单的一个过程,就是使用TcxDBNavigator控件对一个数据集进行操作控制,在点击删除按钮后出现错误提示‘Record<em>index</em> <em>out</em> of <em>range</em>’,请各位帮帮忙
Parameter index out of range (1 > number of parameters, which is 0).
求解,如题。。。。。
报错:sys.argv[1] IndexError: list index out of range
运行时报错:firstFolder = sys.argv[1]rnIndexError: list <em>index</em> <em>out</em> of <em>range</em>rn怎么回事?rnrn```rnimport numpy as nprnimport cv2rnimport sysrnfrom matplotlib import pyplot as pltrnrn# img = cv2.imread('logo.png',0)rn# # Initiate ORB detectorrn# orb = cv2.ORB_create()rn# # find the keypoints with ORBrn# kp = orb.detect(img,None)rn# # compute the descriptors with ORBrn# kp, des = orb.compute(img, kp)rn# # draw only keypoints location,not size and orientationrn# img2 = cv2.drawKeypoints(img, kp, None, color=(0,255,0), flags=0)rn# plt.imshow(img2), plt.show()rnrnfrom os import listdirrnfrom os.path import isfile, joinrnrnrnclass Application:rn def __init__(self, extractor, detector):rn self.extractor = extractorrn self.detector = detectorrnrn def train_vocabulary(self, file_list, vocabulary_size):rn kmeans_trainer = cv2.BOWKMeansTrainer(vocabulary_size)rn for path_to_image in file_list:rn img = cv2.imread(path_to_image, 0)rn kp, des = self.detector.detectAndCompute(img, None)rn kmeans_trainer.add(des)rn return kmeans_trainer.cluster()rnrn def extract_features_from_image(self, file_name):rn image = cv2.imread(file_name)rn return self.extractor.compute(image, self.detector.detect(image))rnrn def extract_train_data(self, file_list, category):rn train_data, train_responses = [], []rn for path_to_file in file_list:rn train_data.extend(self.extract_features_from_image(path_to_file))rn train_responses.append(category)rn return train_data, train_responsesrnrn def train_classifier(self, data, responses):rn n_trees = 200rn max_depth = 10rn model = cv2.ml.RTrees_create()rn eps = 1rn criteria = (cv2.TERM_CRITERIA_MAX_ITER, n_trees, eps)rn model.setTermCriteria(criteria)rn model.setMaxDepth(max_depth)rn model.train(np.array(data), cv2.ml.ROW_SAMPLE, np.array(responses))rn return modelrnrn def predict(self, file_name):rn features = self.extract_features_from_image(file_name)rn return self.classifier.predict(features)[0]rnrn def train(self, files_array, vocabulary_size=12):rn all_categories = []rn for category in files_array:rn all_categories += categoryrnrn vocabulary = self.train_vocabulary(all_categories, vocabulary_size)rn self.extractor.setVocabulary(vocabulary)rnrn data = []rn responses = []rn for id in <em>range</em>(len(files_array)):rn data_temp, responses_temp = self.extract_train_data(files_array[id], id)rn data += data_temprn responses += responses_temprnrn self.classifier = self.train_classifier(data, responses)rnrn def error(self, file_list, category):rn responses = np.array([self.predict(file) for file in file_list])rn _responses = np.array([category for _ in <em>range</em>(len(responses))])rn return 1 - np.sum(responses == _responses) / len(responses)rnrnrndef get_images_from_folder(folder):rn return ["%s/%s" % (folder, f) for f in listdir(folder) if isfile(join(folder, f))]rnrnrndef start(folders, detector_type, voc_size, train_proportion):rn if detector_type == "SIFT":rn # "Scale Invariant Feature Transform"rn extract = cv2.xfeatures2d.SIFT_create()rn detector = cv2.xfeatures2d.SIFT_create()rn else:rn # "Speeded up Robust Features"rn extract = cv2.xfeatures2d.SURF_create()rn detector = cv2.xfeatures2d.SURF_create()rn flann_params = dict(algorithm=1, trees=5)rn matcher = cv2.FlannBasedMatcher(flann_params, )rn extractor = cv2.BOWImgDescriptorExtractor(extract, matcher)rnrn train = []rn test = []rn for folder in folders:rn images = get_images_from_folder(folder)rn np.random.shuffle(images)rnrn slice = int(len(images) * train_proportion)rn train_images = images[0:slice]rn test_images = images[slice:]rn train.append(train_images)rn test.append(test_images)rnrn app = Application(extractor, detector)rn app.train(train, voc_size)rnrn total_error = 0.0rnrn for id in <em>range</em>(len(test)):rn print(app.error(train[id], id))rn test_error = app.error(test[id], id)rn print(test_error)rn print("---------")rn total_error = total_error + test_errorrnrn total_error = total_error / float(len(test))rn print("Total error = %f" % total_error)rnrnrnfirstFolder = sys.argv[1]rnsecondFolder = sys.argv[2]rndetectorType = sys.argv[3]rnvocSize = int(sys.argv[4])rntrainProportion = float(sys.argv[5])rnrnstart([firstFolder, secondFolder], detectorType, vocSize, trainProportion)rnrnrn```
java.sql.SQLException: Parameter index out of range (1 > number of parameters, w
[code="java"]public class Register rn public static boolean register(String name, String password) rn throws SQLException, ClassNotFoundException rn Class.forName("com.mysql.jdbc.Driver");rn Connection cn = DriverManager.getConnectionrn ("jdbc:mysql://localhost/test", "root", "179401");rn PreparedStatement pst = cn.prepareStatementrn ("select * from temp");rn ResultSet rs = pst.executeQuery();rn rn while (rs.next()) rn if (rs.getString(1).equals(name)) rn System.<em>out</em>.println("The username " + name + " has already existed!");rn return false;rn rn rn rn pst.setString(1, name);rn pst.setString(2, password);rn rn cn.close();rn rn return true;rn rn[/code]rnrn异常 rnjava.sql.SQLException: Parameter <em>index</em> <em>out</em> of <em>range</em> (1 > number of parameters, which is 0).rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)rn com.mysql.jdbc.SQLError.createSQLException(SQLError.java:929)rn com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3711)rn com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3695)rn com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:4546)rn com.v.registration.Register.register(Register.java:22)rn com.v.registration.RegisterAction.execute(RegisterAction.java:9)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn java.lang.reflect.Method.invoke(Method.java:597)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rnrn
Parameter index out of range (1 > number of parameters, which is 0).求解
[code=Java]rnpackage com.asiasoft.studentsmanager;rnrnimport java.util.ArrayList;rnimport java.io.BufferedReader;rnimport java.io.IOException;rnimport java.io.InputStreamReader;rnimport java.sql.*;rnrnimport com.asiasoft.studentsmanager.utils.MyDBUtil;rnrnrnpublic class StudentsManger rn public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException rn rn String uname;rn String pword;rn String sql = "";rn rn InputStreamReader input1 = new InputStreamReader(System.in);rn BufferedReader br1 = new BufferedReader(input1);rn System.<em>out</em>.println("****************");rn System.<em>out</em>.println("**欢迎登陆学员管理系统**");rn System.<em>out</em>.println("****************");rn Connection con1 = MyDBUtil.getConnection();rn PreparedStatement ps = MyDBUtil.getPreparedStatement(con1, sql);rn System.<em>out</em>.print("请输入用户名:");rn uname = br1.readLine();rn System.<em>out</em>.print("请输入密码:");rn pword = br1.readLine();rn ps.setString(1, uname);rn ps.setString(2, pword);rn sql = "select * from students where uname=? & pword=?";rn ResultSet rs1 = ps.executeQuery(sql);rn while(rs1.next())rn if(rs1.next() == true)rn System.<em>out</em>.println("登陆成功!");rn display();rn elsern System.<em>out</em>.println("用户名或密码错误!");rn rn rn rn rn rn rn /*display();*/rn rn rn rn public static void display() throws ClassNotFoundException, SQLException, IOException rn String operater = "";rn int id;rn String uname;rn String pword;rn String email;rn InputStreamReader input rn = new InputStreamReader(System.in);rn BufferedReader br rn = new BufferedReader(input);rn rn Connection con = MyDBUtil.getConnection();rn /*Statement st = con.createStatement();rn ResultSet rs = st.executeQuery("select * from students");*/rn String sql = "select * from students";rn Statement st = MyDBUtil.getStatement(con);rn ResultSet rs = MyDBUtil.getResultSet(st, sql);rn System.<em>out</em>.println("id\t|uname\t|pword\t|email\t");rn rn while(rs.next())rn System.<em>out</em>.println(rs.getString("id")+"\t|"rn +rs.getString("uname")+"\t|"+rn rs.getString("pword")+"\t|"+rn rs.getString("email")+"\t");rn rn System.<em>out</em>.println("********************");rn System.<em>out</em>.println("*增加学生信息 输入add; *");rn System.<em>out</em>.println("*删除学生信息 输入delete; *");rn System.<em>out</em>.println("*修改学生信息 输入update; *");rn System.<em>out</em>.println("*查询学生信息 输入query; *");rn System.<em>out</em>.println("*退出请输入exit; *");rn System.<em>out</em>.println("********************");rn rn rn operater = br.readLine();rn rn rn rn rn if("add".equalsIgnoreCase(operater))rn //addrn System.<em>out</em>.print("请输入要添加的姓名:");rn uname = br.readLine();rn rn System.<em>out</em>.print("请输入要添加的密码:");rn pword = br.readLine();rn rn System.<em>out</em>.print("请输入要添加的邮箱:");rn email = br.readLine();rn rn Student s = new Student();rn s.setUname(uname);rn s.setPword(pword);rn s.setEmail(email);rn String addsql = "insert into students (uname,pword,email) values('"+uname+"','"+pword+"','"+email+"')";rn int addresult = st.executeUpdate(addsql);rn System.<em>out</em>.println("添加成功!");rn display();rn rn else if("delete".equalsIgnoreCase(operater))rn //shanchurn System.<em>out</em>.println("请输入将要删除的编号:");rn id = Integer.parseInt(br.readLine());rn String deletesql = "delete from students where id='"+id+"'";rn int deleteResult = st.executeUpdate(deletesql);rn System.<em>out</em>.println("删除成功!");rn display();rn rn else if("update".equalsIgnoreCase(operater))rn //updatern System.<em>out</em>.println("请输入你所要修改的编号:");rn id = Integer.parseInt(br.readLine());rn System.<em>out</em>.println("请输入修改后的名字:");rn uname = br.readLine();rn System.<em>out</em>.println("请输入修改后的密码:");rn pword = br.readLine();rn System.<em>out</em>.println("请输入修改后的邮箱:");rn email = br.readLine();rn rn String updatesql = "update students set uname='"+uname+"',pword='"+pword+"',email='"+email+"' where id = '"+id+"'";rn int updateResult = st.executeUpdate(updatesql);rn System.<em>out</em>.println("修改成功!");rn display();rn else if("query".equalsIgnoreCase(operater))rn //queryrn System.<em>out</em>.println("请输入要查询的编号:");rn id = Integer.parseInt(br.readLine());rn rn String querysql = "select * from students where id = '"+id+"'";rn rs = st.executeQuery(querysql);rn /*while(rs.next())rn int k = Integer.parseInt(rs.getString("id"));rn if(k!= id)rn System.<em>out</em>.println("查无此人!");rn break;rn elsern continue;rn rn */rn System.<em>out</em>.println("id\t|uname\t|pword\t|email\t");rn while(rs.next())rn System.<em>out</em>.println(rs.getString("id")+"\t|"rn +rs.getString("uname")+"\t|"+rn rs.getString("pword")+"\t|"+rn rs.getString("email")+"\t|");rn rn System.<em>out</em>.println("查询完毕!");rn System.<em>out</em>.println("是否继续使用本系统?(y/n)");rn String j = br.readLine();rn if("y".equalsIgnoreCase(j))rn display();rn elsern System.<em>out</em>.println("谢谢你的使用!");rn rn else if("exit".equalsIgnoreCase(operater))rn System.<em>out</em>.println("谢谢你的使用!!");rn rn rn rn rn rn rn rn rn rn rnrnrn[/code]出现了如题的错误,求高手解答!下面是我的那个数据库的连接。rn[code=Java]package com.asiasoft.studentsmanager.utils;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.PreparedStatement;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnrnpublic class MyDBUtil rn private static String className = "com.mysql.jdbc.Driver";rn private static String url = "jdbc:mysql://localhost/j2ee1111" +rn "?user=root&password=root";rnrn rn rn public static Connection getConnection() throws ClassNotFoundException, SQLExceptionrn Class.forName(className);rn Connection con = DriverManager.getConnection(url);rn return con;rn rn rn public static Statement getStatement(Connection con) throws SQLExceptionrn Statement st = con.createStatement();rn return st;rn rn rn public static PreparedStatement getPreparedStatement(Connection con,String sql) throws SQLExceptionrn PreparedStatement ps = con.prepareStatement(sql);rn return ps;rn rn rn public static ResultSet getResultSet(Statement st,String sql) throws SQLExceptionrn ResultSet rs = st.executeQuery(sql);rn /*int rs1 = st.executeUpdate(sql);*/rn return rs;rn rn rn rn rn public static void closeAllMethod(Connection con,Statement st,ResultSet rs)rn try rn if(rs!=null)rn rs.close();rn rn if(st!=null)rn st.close();rn rn if(con!=null)rn con.close();rn rn catch (SQLException e) rn // TODO 自动生成 catch 块rn e.printStackTrace();rn rn rnrnrn[/code]rnrn出现的<em>问题</em>如下:[code=Java]Exception in thread "main" java.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.SQLError.createSQLException(SQLError.java:1055)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)rn at com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3288)rn at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3272)rn at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:4108)rn at com.asiasoft.studentsmanager.StudentsManger.main(StudentsManger.java:30)[/code]
openBSD操作系统源码下载
openBSD操作系统源码 openBSD操作系统源码 相关下载链接:[url=//download.csdn.net/download/wangbin6818/2142923?utm_source=bbsseo]//download.csdn.net/download/wangbin6818/2142923?utm_source=bbsseo[/url]
ALTER 各系列 epm240 datasheet下载
改资料中的PDF详细描述了,ALTER公司的各个系列的CPLD,FPGA芯片的管脚,及封装图,下载一下可以终身受用! 相关下载链接:[url=//download.csdn.net/download/tom_2_2/2563431?utm_source=bbsseo]//download.csdn.net/download/tom_2_2/2563431?utm_source=bbsseo[/url]
Oracl 数据库班级管理网页下载
能留言,发贴和删除等信息。能管理好现在的留言内容。 相关下载链接:[url=//download.csdn.net/download/jingrenping/2585698?utm_source=bbsseo]//download.csdn.net/download/jingrenping/2585698?utm_source=bbsseo[/url]
相关热词 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天 c#字典序排序 c# 截屏取色 c#中的哪些属于托管机制
我们是很有底线的