Questions tagged [outofrangeexception]

An exception that is thrown because the value of a variable is outside the allowed range

272 questions
0
votes
0 answers

Getting strange Index Error only some of the time in Python Json and BeautifulSoup

I am getting some strange Index error ONLY some of the time with the following codes: # coding=utf-8 from bs4 import BeautifulSoup as bs from urllib import urlopen import json import csv link = 'https://familysearch.org/pal:/MM9.1.1/KH21-F11' Soup…
0
votes
1 answer

Error creating substrings from input file

I'm trying to create substrings from my from each line of my input file. I noticed that when i create a substring from substr(0,2) position zero it prints out correctly but if I start from anywhere greater than 0 it throws this…
Jason Yao
  • 3
  • 1
0
votes
1 answer

Index out of range at "int msgLength = BitConverter.ToInt32(gzBuffer, 0);"

I am currently working on some game made in C# XNA. Since I need to send a huge chunk of data over net (bout 96kb), I am using some string compressor/decompressor code, which I found on the internet. The code looks like this: public static…
Mark
  • 133
  • 1
  • 2
  • 8
0
votes
3 answers

Is there a way to prevent invalid row range in powerbuilder

Is there a way to prevent invalid row range in powerbuilder. IF dw_lista_campanias.GetSelectedRow(0) > 0 AND dw_lista_campanias.object.est_camp[dw_lista_campanias.GetRow()] = 'EO020' THEN when dw_lista_campanias.object.est_camp index is 0 an…
mchl0208
  • 59
  • 2
  • 10
0
votes
2 answers

C# List of List of Lines Index was out of range

I have a problem very much like the one mentioned here: ArgumentOutOfRangeException Was Unhandled I believe that contiguousLines[columnNum].Add(...) is what is causing the error because I am indexing with columnNum List freeLines = new…
AChrapko
  • 166
  • 2
  • 2
  • 13
0
votes
1 answer

Catching an out of range exception for a particular variable in C#

In the code below I read through a smartsheet from column to column running some code until it throws an outofrange exception whereby I make the cellNumber = 0, and increase the row number (in other words move to a new line). while (rowNumber <…
Danrex
  • 1,657
  • 4
  • 31
  • 44
0
votes
1 answer

C# ArgumentOutOfRange Exception, can not figure it out

I am getting ArgumentOutOfRange Exception (Index was out of range. Must be non-negative and less than the size of the collection.) in my app that deals with graphics (but I guess that it is not that important to figure out where the error is). Here…
0
votes
2 answers

std::out_of_range exception when searching for matches in vector of strings

In my C++ program I have a text file that I read line by line into a vector called flights and afterwards I search for some strings inside this vector of strings, but unfortunately if I don't find any matches I get the following error A flights…
Nimajik
  • 95
  • 1
  • 1
  • 10
0
votes
3 answers

std::out_of_range error?

I'm dealing with a file with a linked list of lines with each node looking like this: struct TextLine{ //The actual text string text; //The line number of the document int line_num; //A pointer to the next line TextLine *…
vette982
  • 4,782
  • 8
  • 34
  • 41
0
votes
1 answer

IndexError: string index out of range with Python when reading big .txt file

I'm trying to create a beginners level program with Python but I get the following error when reading big .txt files: Traceback (most recent call last): File "P4.py", line 58, in maximo = diccionario.get(keyword[1]) #maximo is a…
Cheknov
  • 1,892
  • 6
  • 28
  • 55
0
votes
1 answer

VBA valid RGB value throws out of range exception

I pieced together the following code from other StackOverflow articles that solved similar problems. Dim light As MsoRGBType, dark As MsoRGBType light = RGB(195, 214, 155) dark = RGB(79, 98, 40) ws.Shapes("Arrow1").Fill.ForeColor.RGB = dark In the…
bhnn
  • 225
  • 5
  • 17
0
votes
1 answer

Why does it crash when I reach my 2D Array? out_of_range

#include #include #include #include #include using namespace std; int gradeExam(string answerKeyARR[]); int main() { const int QUESTIONS = 10; const int MAX_STUDENTS = 250; ifstream…
0
votes
1 answer

Static variables/deque and objects

I have a problem with static vars/deque and objects. I am calculating some statistics for a real time data stream - mean, median, skew etc. As this is streaming data I make use of static vars, or in this version static container (deque). I have made…
Joerg
  • 63
  • 1
  • 1
  • 4
0
votes
1 answer

Scipy stats.skew -- IndexError: tuple index out of range

I am getting a wierd error.... this doesn't happen if I use np.random.random instead of np.random.randint >>> import numpy as np >>> import scipy.stats as stats >>> rdata = np.random.randint(5000) >>> skew = stats.skew(rdata) Traceback (most recent…
baconwichsand
  • 1,161
  • 2
  • 13
  • 31
0
votes
1 answer

Why is my date out of range for some dates but not others?

I'm using bootstrap-datepicker-rails (v. 1.3.0.2) in my rails 4.0.9 project, and seeing some strange behavior with it in development and production, as the title explains. I've already had a look at this question, but it seems my issue is not the…