Skip to main content

All Questions

Tagged with
1 vote
1 answer
191 views

What are the main ways to do a reverse iteration in Nim?

I'm learning Python. I recently learned about Nim and began to study it too. I liked the python+pascal syntax and the speed of C. Unfortunately, there is much less educational information and ...
Lucius_Will's user avatar
0 votes
1 answer
61 views

How to iterate backwards with a custom iterator in Java using permutations

I am trying to create a a class of Permutation that extends Iterator and adds two methods: previous() and hasPrevious(). It must offer a constructor with one argument: a string containing the ordered ...
Kate Johnson's user avatar
0 votes
1 answer
250 views

kdb/Q How to iterate on a function x number of times?

I'm new to kdb/Q, what is the equivalent of iteration, where I need to run a function 10 times? In Python, it would be something like creating some kind of iterator, using a while loop to run the ...
mmv456's user avatar
  • 23
0 votes
3 answers
2k views

TestDome - Malware Analysis in C++

I'm practicing this problem on TestDome, and I found myself stuck with the final step of the malware process, namely, replacing the correct position with a value of 0. My program accurately prints out ...
RexyCode's user avatar
1 vote
1 answer
62 views

creating a function looping through multiple subsets and then grouping and summing those combinations of subsets

I am attempting to build a function that processes data and subsets across two combinations of dimensions, grouping on a status label and sums on price creating a single row dataframe with the ...
JLuu's user avatar
  • 363
0 votes
1 answer
50 views

Looping through combinations of subsets of data for processing

I am processing sales data, sub-setting across a combination of two distinct dimensions. The first is a category as indicated by each of these three indicators ['RA','DS','TP']. There are more ...
JLuu's user avatar
  • 363
0 votes
1 answer
188 views

KDB+ Q Create a looping/iteration id column

I have a kdb/q question I would like some help with. Please see the table below `A B Run 99 newcol Start 99 newcol Start 99 newcol Start 99 newcol During 99 newcol During 99 newcol End ...
user avatar
0 votes
2 answers
151 views

Iterate over multiple elements at once Python [duplicate]

If I have a list like l=[1,2,3,4,5,6]. If I do something like: for i in l: print(i) It will print all element separately. 1 2 3 4 . . . Is there a way to iterate simultaneously over multiple ...
Will's user avatar
  • 1,787
0 votes
0 answers
40 views

how to iterate over firestore document id in flutter

I have returned all the IDs of my firestore documents, and now I need to get the index of each one. Until now I get an error: "Spread elements in a list or set literals must implement 'Iterable' &...
Giovanni's user avatar
  • 575
2 votes
3 answers
76 views

If True: turn following values to True in list of booleans until nth position after True is reached

I have a list of booleans l = [False, False, False, True, False, False, False] that I want to turn into l_new = [False, False, False, True, True, True, False] That means, whenever there is a True in ...
Fabian Pascher's user avatar
3 votes
1 answer
620 views

Kotlin: loop through finite values returned by a next function

Background info A common pattern in some programming languages is to have a function that when called, returns the next value until the end of the finite sequence is reached, in which case it keeps ...
Devabc's user avatar
  • 5,141
1 vote
2 answers
41 views

Iterate through a function until exact value or certain range is reached

I have a function that takes gross income as input and gives me the net income as output: gross_net <- function(gross_income, social_security = 0.2, tax =...
r-newbie's user avatar
  • 149
0 votes
0 answers
31 views

How to iterate over a dataframe that's processed in another function? [duplicate]

I want to use the reactome2py package to analyse pathways by adapting the Reference code. I want to iterate over the dataframe (e.g., df for data_linear_cna.txt). Reference code: https://colab....
Anon's user avatar
  • 1,505
0 votes
1 answer
205 views

Python is not running my codes in else statement

I am doing the first Hog project for CS61A, a UC Berkeley Intro CS course that publishes all its materials online, to self-study CS(Link:https://inst.eecs.berkeley.edu/\~cs61a/sp20/) For its first ...
Miller Yuan's user avatar
5 votes
1 answer
1k views

Access iterator inside its for loop

I am testing a custom bi-directional iterator in rust but i ran into error error[E0382]: borrow of moved value: `iter` --> src/main.rs:40:13 | 37 | let mut iter = BiIterator::from(vec![...
muppi090909's user avatar

15 30 50 per page
1
2 3 4 5
16