Questions tagged [iteration]
Iterations are the successive repetitions in loops such as for, foreach or while. Questions with this tag are often concerned about how to best handle a collection of data.
iteration
10,911
questions
-1
votes
1
answer
87
views
C# - WPF - Display list of strings
When I search the equivalent of foreach in xaml WPF, I get ItemControl tutorials, but it is only about presentation
it does not solve the iteration part of it
how do I do this in WPF ???
<TextBox ...
0
votes
1
answer
32
views
Space Optimization for Iterative Depth-First-Search (DFS)
Problem
In most academic literature, the preferred DFS algorithm is always recursive, however, for large Graphs, an iterative variation using a Stack seems much more practical to me, without running ...
0
votes
1
answer
29
views
compilation process in some java question about relate to 2d arrays
public static boolean ContainedArr(boolean[][] photo, boolean[][] sub) { //find if sub is sub array in photo
if (sub.length>photo.length ||sub[0].length>photo[0].length) { //sub bigger ...
2
votes
3
answers
76
views
Is there a way to make combinations of paste0 function with a list?
I have a vector of names:
names <- c("a", "b", "c", "d", "e", "f", "g", "h")
I want to make series of combinations ...
0
votes
0
answers
22
views
Is there a reason that Python allows indexing the class list itself? [duplicate]
I have come across a "feature" of Python that allows one to index the list class (and all classes that implement __getitem__() AFAIK). It took me a non-trivial amount of time to uncover that ...
0
votes
0
answers
21
views
When combining iteration and recursion, how do I express the recursion via tail calls?
I am working on a practice problem and I have found a recursive solution. However, I can't figure out how to express the solution as tail recursion.
I think that the issue that I am having can be ...
3
votes
0
answers
55
views
Python: Iterating through 2 lists
I am trying to implement the following equation:
Where zc is an equally spaced range of values e.g.
t_array = np.arange(z_[0],z_[-1],0.01)
In this case
z_[0] = -15.336
z_[-1] = 15.336
I'm struggling ...
2
votes
2
answers
51
views
Substituting number of simulations (n) in rnorm() using a list of predetermined values
I'm using rnorm() but instead of substituting the number of simulations n with just one variable, I would like to do this multiple times with n having predetermined values from a series of values. (...
0
votes
0
answers
48
views
Iterating a Landsat image collection to display as a layer in google earth engine
I am working with Landsat 8/9 in Google Earth Engine (GEE) and would like some help. I have a list of Landsat images and want to do dNBR calculations to each of them and later displaying each as a ...
-1
votes
1
answer
37
views
LibreOffice Calc - Check if event date is in period of time and return event attribute
In spreadsheet like this:
A
B
C
D
E
1
Shift start
Shift end
Sum of event durations on that shift (min)
2
01.03.2024 15:35
02.03.2024 08:00
105
3
13.03.2024 15:35
14.03.2024 08:00
120
4
28.03....
0
votes
1
answer
66
views
DFS (Depth-first search) vs BFS (Breadth-first search) Space Optimizations
Problem
I am currently digging deep into some optimizations on the classical iterative approaches to both DFS and BFS algorithms. The material I'm currently using at my University presents both ...
-4
votes
1
answer
86
views
C# For loop with try catch finally
I am trying to run for loop for every 5 secs to get the readings from COM port. When successful getting the readings only once. Would like to run the loop even if there is error. sometimes the ...
1
vote
1
answer
82
views
Can Excel functions solve iterative problems?
I want to use Microsoft Excel to project the growth of a pig farming project into which I will inject a fixed amount of cash per month and then use the cash to raise the number of full pigs that the ...
0
votes
0
answers
22
views
Advanced if statements based on opened files
I am trying to encrypt the contents of an Excel file through iteration in a for loop, but I keep getting the error:
TypeError: 'NoneType' object is not iterable
My code:
import tkinter
import random
...
0
votes
0
answers
29
views
Update Blank Values Until the Next Populated Row PHP/MySQL
I don't know how to explain it well, or how to even ask. Here's some of my data:
+------------+------------------------+
| Department | Product Number |
+------------+------------------------+
...