Questions tagged [range]
A range is an extent of values between its lower and upper bound. It can refer to a DOM Range, the Ruby Range class, the Python range function, Perl 5's `..` operator, Perl 6's Range Class, or PostgreSQL's range types.
10,573
questions
0
votes
0
answers
5
views
Why does the for loop not work for the some iteration of range(N, N)?
I have written a program using for loop but for some iteration the loop doesn't run
Below is the code I have written in python:
N = int(input())
for i in range(2, N + 1):
print('This iteration ...
-1
votes
3
answers
58
views
Why does the range element in my code have problems when is uses the last number?
I am using the following code, which just selects a random number from a range and uses it as chance for other elements to be selected, and it works fine with no errors, but occasionally the number ...
0
votes
0
answers
6
views
How do I use the for loop in conjunction with other functions?
How do I use a for loop with range () iterate over the alphabet a to z (using Ord () to traverse and chr () to get the characters in the sentence only? I am supposed to display each letter in ...
0
votes
0
answers
14
views
OpenSearch range query not working correctly on dates?
I have created an index using the OpenSearch.Client library and I perform queries on it, again using OpenSearch.Client.
I have noticed that some range queries do not work as expected on date fields.
I ...
0
votes
0
answers
21
views
Get Point from Another Table based on Category and Value Range
I am trying to get a column which specify the points by comparing the value from original table to min and max value from another table. I have a main table, which consists of few columns of values ...
0
votes
0
answers
11
views
Implementing a range slider unto a 3d isosurface in plotly
I am attempting to add a range slider into a 3d isosurface that represents temperature in a room. Slider, isosurface example
I have been smashing my head against the wall trying to implement this, ...
0
votes
3
answers
76
views
Why is the last element of vector words not analyzed & how does it go outside the range?
I successfully print the # of sixes, threes, and twos, but not the one, and the program errors out for going outside the range of words after I return 0;
int main()
{
vector<string> words;
...
0
votes
0
answers
25
views
Excel VBA: "Application-defined or object-defined error" when writing to a cell [duplicate]
Environment: Excel v 2108 under Windows 11 Pro 64
The Internet has a lot about the "Application-defined or object-defined error" in Excel VBA. Even StackOverflow has many Q&As about it, ...
1
vote
2
answers
59
views
For Each - evaluate - order of values depending if spilling function from worksheet or string parameter
I need a function to extract values from a dynamic range generated by an excel spilling function and saving them into a dynamic array. For this purpose I use a For Each loop. It should work ...
1
vote
1
answer
63
views
Idiomatic way to iterate over a string and replace value in original string with mapped value
I have a working solution on iterating over a string and mapping the rune to a mapping
package main
import (
"fmt"
)
func main() {
numToString := map[rune]string{
'0': &...
0
votes
2
answers
35
views
Create a dropdown list of numbers in sequence
I want to create a dropdown list of numbers in sequence e.g. 1,2,3,...,n using data validation. I open the validation dialogue box, select List, but what do i type in the "Source" input box?
...
1
vote
2
answers
36
views
Set a minute range in an input time HTML5
I have an Angular project, where one of the components have an input time like:
<div class="start">
<p>Inicio:</p>
<input type="time" class="form-...
1
vote
1
answer
32
views
How to store in a variable, the range address from a user selected range
I want a variable to store the "range address" (e.g. "B2:E4") of a range that was selected by a user.
I'm trying things along these lines:
Sub print_selected_range
Dim oSheet as ...
2
votes
1
answer
24
views
Linux shell script command variable with brackets for range selection
I'm working on a shell script that creates a listing of files based on the filename, but I need to use a specified range using brackets. Eg. {30..35}
Somehow the shell script doesn't accept the ...
0
votes
0
answers
37
views
VBA-Excel not responding when using a big range in my vba code
I´m working with the Worksheet_Change event, the range in which the event detects changes is large. When i try to make changes in a cell inside the range excel stops working and shows the message: Not ...
0
votes
2
answers
38
views
Create ranges with CASE statemant - ERROR: Each GROUP BY expression must contain at least one column that is not an outer reference
I'm tring to create ranges using CASE but I have a problem with counting the numbers of appearances. At the moment my code looks like this:
SELECT
CASE
WHEN engine_capacity < 1 THEN 'less than ...
-3
votes
1
answer
56
views
I found this syntax for printing prime numbers and l am quite confused. I would like this community to clarify
Nums = range(1,60)
def is_prime(Nums):
for x in range(2, Nums):
if (Nums%x) ==0:
return False
return True
prime_numbers = list(filter(is_prime,Nums))
Print(prime_numbers)...
0
votes
0
answers
39
views
Time span 6 months in python
I want to create a column of days-count like this
DATE DAYS_COUNT
12/05/2022 0
15/10/2022 156
15/04/2023 338
15/10/2023 521
15/04/2024 704
15/10/2024 887
15/04/2025 1.069
15/10/2025 ...
0
votes
2
answers
16
views
How to write less than (in IMB CPLEX)
I am writing a code in cplex.
forall (l in Line) {
(0.5<d_fic[lineconect[l].fromnode]<=1.0) => (0.5<alpha[l]<=1.5);
}
the error that I am getting - (Function operator<.<=(...
0
votes
0
answers
45
views
Excel VBA - ordering columns into range
I have a multi-sheet workbook I'm looping through to pull out key data ranges into an array. A couple of the sheets don't follow the standard format and so instead of simply grabbing Range("D6:...
-3
votes
0
answers
35
views
Rearranging numbers of an array in ascending order and returning the sum of the numbers [duplicate]
The expected outcome of the following code is 45, but the output is 0; why is this?
I ran the code below expecting outcome of the following code is 45, but the output is 0; why is this?
The function ...
0
votes
0
answers
23
views
Trying to delete rows by including a variable in the Range object using xlwings
Not entirely sure why this does not work.
for x in ws.range('E2','E'f'{last_row}'):
if x.value != "CAD":
del_row = x.row
xw.Range(del_row,del_row).api....
-1
votes
2
answers
97
views
In Tkinter, how to manage specific "functions" for checkboxes created with list()?
I have these checkboxes and therefore i want to manage them as easily as possible (previously i had created them with place(x=..., y=...):
PROBLEM: For each checkbox i need a different function. By ...
0
votes
0
answers
52
views
RangeError: Maximum call stack size exceeded NEXTJS
I'm still a beginner in Nextjs
I get range error when i try to fetch products from database,
ihave the same exact code for categories with no problem at all...
this my nextjs server action:
export ...
0
votes
1
answer
24
views
Excel VBA Detect A KeyPress Only When Cell In A Certain Range Is Selected
I have a spreadsheet and I would like to use KeyPress to detect if the user presses 1, 2, 3 or 4 keys. I have a range on my sheet that is 10 cells by 20 cells and I only want to KeyPress event to ...
0
votes
1
answer
20
views
Randomisation macro - need the data from multiple columns produced, not just the first column
This tool produces a random set of 10 claim numbers - but I have other data corresponding to those claim numbers that I'd also like displayed.
It produces the 10 random claim numbers but instead of ...
-1
votes
1
answer
54
views
Range over buffered channel into a slice [closed]
I am having a problem with a Go buffered channel, as I am trying to iterate a value from it and I am getting an error report. Here is the code:
package main
import (
"fmt"
)
func main() {
...
0
votes
1
answer
43
views
Get time ranges in Postgres, based on separate column value
I am trying to get start/end date or timerange from table, based on status of a certain column.
Imagine having the following structure :
date | flag
------------------------+------
...
0
votes
0
answers
13
views
Ehcache limit port ranges
From the Ehcache documentation, https://www.ehcache.org/apidocs/2.6.9/net/sf/ehcache/distribution/RMICacheManagerPeerListener.html
The cache peer listener have parameters as
port - a port in the range ...
0
votes
0
answers
16
views
Is it possible to create a function that requires an argument in a specific range of numbers in python? [duplicate]
Let's say that I have a function which adds 2 numbers together:
def add(a:int, b:int):
return a+b
It works, but I want the function to require the second number b to be between 1 and 10,
is it ...
1
vote
2
answers
53
views
Why do I get an error trying to print out a list one way vs the other? [duplicate]
if you have a list for ex:
list = ["a", "b", "c", "d"]
and you want to print it out, what is the difference between:
for letter in list:
print(letter)
for ...
3
votes
1
answer
82
views
Calculate rowwise Min/Max across a variable range of columns in R
For a data analysis in R I am trying to calculate a variable A1, which is the minimum value across a range of values. The tricky thing is that the start of the range varies depending on the index of a ...
0
votes
1
answer
47
views
C++20 ranges sort and filter combined?
For my terminal emulator I'm trying to implement the DOS dir command. As you can see here, it supports the /a option (apply filters) and the /o option (sort). Each one can be used with multiple ...
0
votes
1
answer
56
views
Excel dynamic formula with SUMPRODUCT and OFFSET
I have 3 columns in excel:
column P is a range of numbers starting from 1 until 11, then from 1 until 14 and so on, it is never the same number of rows
column W has numbers that are dependent on ...
-6
votes
3
answers
321
views
I can use random to get a random value from a range. How do I make math evaluator that does opposite and also has access to math modules?
I want to build a math evaluator for a private use (no security limitations when doing eval operations) that can give me possible outcomes of mathematical statements. Assume random() here refers to ...
0
votes
1
answer
22
views
How can I split the words in a range to a column?
I want the data of the range A2:B6 to be placed inside the column C with the following conditions: non-duplicate, non-empty and sorted.
I have Microsoft Excel 2021.
please help me.
Screenshot01
Myfile
...
0
votes
0
answers
28
views
Deep Backtesting doesn't go back further than a year?
I am testing a strategy on the ES! 1 5-min candle.
I'm using deep backtesting and I'm a Pro member.
I'm trying to test all available data, but it will only go back roughly one year.
Tradingview says ...
0
votes
0
answers
30
views
HTML Range Construction Issue
Using CaretPositionFromPoint function : ( https://developer.mozilla.org/en-US/docs/Web/API/Document/caretPositionFromPoint )
let range = document.caretPositionFromPoint(selectionRectX, selectionRectY)
...
1
vote
0
answers
33
views
Using images as emojis in a contenteditable div used as a chat input
I have a little chat feature I am working on and I am using images as emojis.
What I did was, when an emoji is clicked two elements are created, the first is a span with the background image of the ...
1
vote
1
answer
64
views
.Range(.Cells ... vs .Range( Cells... vs "Microsoft Learn" page
Surely the essence of my Question has come up before. What may be new about my Question is that it refers to what I hope is an error on this Microsoft.Learn page, and possibly my inane/deep questions. ...
0
votes
0
answers
19
views
FInd range of in-betweeen nodes
Suppose we have a htmlblock like <p><a>abc</a>[]<br></p>and now we drag and drop a node at the position of the square brackets.
In my current range I have 'abc' as the ...
1
vote
2
answers
34
views
How to merge two lists in r to make a list of ranges?
I have lists in R as follows:
start <- c(1, 5, 11)
end <- c(2, 9, 13)
how do I concatenate them to make a list of non-contiguous ranges in this manner:
c(1:2, 5:9, 11:13)
1
vote
2
answers
51
views
Type Mismatch Error on Range in For Each loop
I would like to use an entire column as my range for my code, but I keep running to Type Mismatch error, This is my Code.
Dim xRgDate As Range
Dim xCellDate As Range
...
0
votes
0
answers
19
views
Constrain entry widget to a min & max value, i.e. for Minutes constrain to 0 to 99, and for seconds constrain to 0 to 60 (not 59)
I have a bunch of time entry widgets, grouped as mins:secs.
I want to constrain the minutes to 2 digits in the range 0 to 99, and the seconds also to 2 digits and range to 0 to 60, but as I type the ...
1
vote
1
answer
61
views
Swift substring range function doesn’t find match in specific cases
I am trying to find the range of substrings in a Tamil string. The range function particularly seems to have issues for substrings ending with the Unicode modifier glyph ‘Tamil pulli’ (U+0BCD).
The ...
1
vote
1
answer
43
views
How do I copy a Table column and paste it into another table column on another sheet?
I have two worksheets. I enter weekly numbers into a column on one sheet and at the end of the week I copy those numbers to a table column on the other sheet. I clear the contents and start with new ...
0
votes
1
answer
32
views
VBA to Clear Dependent Drop-Down List When the Parent List Changes
I don’t know VBAs at all but am piecing together tidbits from various online tutorials. I could use a your advice, as I simply can't get the result I need. In the example below, cell A10 contains a ...
0
votes
1
answer
44
views
google sheet query, extract a range of cells from a range of columns
Firts of all hi everyone
I'm new of this forum and I have a very low experience of the powerful gooogle sheet query
My problem is to get a range of cells from a range of columns.
In the shared file ...
0
votes
1
answer
46
views
What i am doing wrong? Excel lock range
What i am doing wrong?
I get error "impossible to set range property "locked"
For i = 1 To ActiveWorkbook.Worksheets.Count
For j = 1 To 2000
For k = 1 To 500
If ...