Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
127 views

I am iterating over a List<int> in C# and attempting to remove elements based on a condition. var numbers = new List<int> { 1, 2, 3, 4, 5 }; foreach (var n in numbers) { if (n % 2 == ...
Kazu's user avatar
  • 27
Advice
0 votes
7 replies
160 views

So I've been using this code for generating such statements following This Reddit post: #define LOOP(seq) END(A seq) #define BODY(x) int x; #define A(x) BODY(x) B #define B(x) BODY(x) A #define A_END #...
Doofus's user avatar
  • 3
Best practices
0 votes
2 replies
129 views

Essentially I am trying to create a dataset that is dependent on prior rows to generate values for any given row. I then would like to run this loop over many IDs for an entire dataset. Current set up ...
triangle_coder's user avatar
Best practices
1 vote
6 replies
96 views

In a user control class, I have this code to react to button clicks. The code shall match the tag of a toggle button with the identical tag of another user control, so the button could switch the ...
MaSta's user avatar
  • 19
0 votes
1 answer
90 views

Hi I'm trying to implement a stateprocessor for my custom logic., ideally we are streaming and I want the custom logic of calculating packet loss from a previous row. i implemented the stateprocessor ...
Pranav ramachandran's user avatar
1 vote
3 answers
264 views

I want to check all cells in a column for a value to send an email. I created the If check. How do I make it go through a loop to check all cells in the column? This is the VBA code I made but I can ...
Marco Bakx's user avatar
0 votes
1 answer
89 views

I am building an ADF pipeline that uses a ForEach activity to iterate over a bunch of sites. The HTTP endpoint is generated dynamically by use of a @concat expression & fed into the HTTP activity ...
Balajee Addanki's user avatar
1 vote
1 answer
232 views

I know that a simple R "for" loop like the following: n <- 20 for (i in 1:n) { print(i) } can be represented by a flowchart like: However, in any set of flowchart symbols there is the ...
JulioSergio's user avatar
1 vote
2 answers
129 views

I am writing a program, that will divide my students into groups. Lets say the groups are A, B, C and D. In each group there can be only so many students. Those numbers I have in a global variable: &...
trinarSK's user avatar
3 votes
1 answer
162 views

I have a csv file on the webserver (eg. 5GDPR6LR-1.csv) The csv file consists of data from an associative array written to file using fputcsv() within a foreach() loop. The problem occurs when I try ...
Stackman's user avatar
  • 501
1 vote
2 answers
75 views

Why the following code caused dead loop? const s = new Set([1]); s.forEach(e => { s.delete(e) s.add(e) }) I tried to change the order about delete and add operation,the dead loop ...
Turbo Zhang's user avatar
0 votes
1 answer
94 views

I’m working in Azure Data Factory. I have a Lookup activity that gets a list of authors from a SQL table. Then, in a ForEach loop, I want to run a Copy activity for each author to fetch only that ...
Neiko's user avatar
  • 1
1 vote
1 answer
72 views

I am not sure if this is possible with XSLT but I am trying to get the below XML into a format where it is name, title, date (if same date then only get date once), last value of In time (might not be ...
BryanG's user avatar
  • 29
-3 votes
1 answer
72 views

I am trying to code a leaderboard in SwiftUI. The data comes from an array of ranked users so that I should be able to get the rank from the index of the array, but I'm finding it surprisingly ...
user6631314's user avatar
  • 2,050
1 vote
1 answer
69 views

I have the following multiprocessing code using R6 class. library(R6) library(doParallel) registerDoParallel(cores = 4) # https://github.com/r-lib/R6/issues/141 a1 <- 2 C1 <- R6Class( public ...
sunheng's user avatar
  • 53
0 votes
1 answer
107 views

std::vector<std::vector<bool>> grid(4, std::vector<bool>(4, true)); std::for_each(grid.begin(), grid.end(), [](auto& row) { std::for_each(row.begin(), row.end(), [](auto& ...
YuZ's user avatar
  • 463
0 votes
0 answers
50 views

I have a 300-line script that defines the function sim(pars, n.sim). The problem is in my attempt to use more than one core of my laptop. I run my simulation, wrapping the right parameters like this: ...
Gianluca Sala's user avatar
0 votes
0 answers
75 views

I'm working on an R package 'mypkg' and use devtools::load_all() inside an Rstudio project to simulate what loading it would look like after making changes. This works fine for all my code except for ...
Jon's user avatar
  • 763
0 votes
1 answer
70 views

So, I'm currently working on a mod for a game, and I might end up having to do this for other mods in the future, so I'd like to know if there is a way to do it with the FOR/DO command in Windows' ...
Emma from Mike's party's user avatar
0 votes
2 answers
129 views

I am trying to write come terraform code that will take a nested object and create resources, normally this would be done with the dynamic block but the resouce in question doesn't support this, and ...
Andrew Mitchell's user avatar
1 vote
1 answer
86 views

I have the following code: import SwiftUI func TableColumnView<T>(title: String? = nil, k : KeyPath<T, Int>) -> some TableColumnContent<T, KeyPathComparator<T>> where T:...
Marco de Wit's user avatar
  • 2,836
-2 votes
1 answer
84 views

I frequently would like to iterate over a view of some underlying data structure, e.g. a backwards iteration or only a slice of a list. The Java standard library has some support for multiple iterator ...
Taren's user avatar
  • 32
0 votes
1 answer
35 views

I have the following example: LIST_JOB = job1 job2 job3 define macro $(info "JOB: $(1)") job_$(1): job.f90 ifort -c job.f90 $(shell touch job.f90) endef all: rule rule: $(foreach ...
TobiR's user avatar
  • 203
0 votes
2 answers
71 views

I am brand new to PowerShell and have gone through tutorials to learn the basics. I'm now at the point where it's a step beyond my knowledge and could use some guidance. Scenario: I have a Projects ...
Christopher Pye's user avatar
1 vote
1 answer
78 views

Wanted to ask what the ideal or best approach is to continuing past an RPC unavailable error when trying to loop through a list of remote machines. I don't need to fix anything about it, just skip to ...
Jeremy Patrick's user avatar
1 vote
1 answer
46 views

Correct me if I'm wrong, but shouldn't the below change each element in the array $List to 'ZZZ'? > $List = @('a','b') > ForEach($i In $List) { $i = 'ZZZ' } > $List a b
Ryan.James's user avatar
0 votes
1 answer
97 views

The following code is simple and works when trying to compare previous values from one column to the next. The only problem is that it is displayed one row below where I want. So the numbers do not ...
user26136009's user avatar
0 votes
0 answers
59 views

I want a CloudFormation template to be able to create a list of repositories in a role's Trust relationship, to look like this: Effect": "Allow", "Principal": { "...
user2459876's user avatar
0 votes
1 answer
41 views

Mock the sftp-list operation especially the attributes with file name and its path. These attributes are used in a for each loop are not available.
PSAFOL's user avatar
  • 13
0 votes
1 answer
50 views

in a bash script, I want to get some values as an array, and loop on each value, but the problem when I loop on the values, only one value get read in the logic, while other values disappeared. list=()...
AlCo2's user avatar
  • 55
0 votes
0 answers
38 views

I have a slow running function that I execute in multiple settings in parallel using doFuture together with foreach. I would like to receive regular progress updates from each execution using ...
Lukas D. Sauer's user avatar
3 votes
2 answers
239 views

I have a report that I have automated. the report is a CSV file, and it is split every 80,000 lines, so I regularly end up with reports in multiple parts. I have a large function that processes the ...
Kain's user avatar
  • 33
0 votes
1 answer
31 views

The official documentation says that "Note that foreach does not modify the internal array pointer", but on some books I found this: Maybe both sentences are right because the internal ...
Federica Guidotti's user avatar
1 vote
2 answers
83 views

I want to change the navbar color when my specific div is hitting the top of the page. It only does it on my second request and not on my first, even though the console says it is working. I can't ...
Lisa's user avatar
  • 29
0 votes
0 answers
26 views

I am working with Motion's InView function to detect different elements within the ViewPort, so I am currently giving it a NodeListOf. When I do this, it creates a general Intersection Observer, one ...
Ulises Cortés's user avatar
0 votes
0 answers
67 views

I'm having some difficulty setting up parallel computing with a progress bar in R. I tried using the doSNOW package following the solution here, but no progress bar appeared. The code also took over ...
Kristin's user avatar
0 votes
0 answers
50 views

I have to run a simulation study for a model we developed in my phd. I have 64 simulation settings consisting of combinations of different parameters and sample sizes (1000 or 10,000), and I want to ...
kenny's user avatar
  • 1
1 vote
1 answer
93 views

I know git diff --check will list all files having leftover conflict marker, but it doesn't actually show the diff. I think the command to show the diff in all files having leftover conflict marker ...
Ooker's user avatar
  • 3,404
0 votes
0 answers
109 views

I am developping a R function than used a function code in Rcpp (i am already new to this). I wanted to make simulations and run the same r functions in a cluster of x cores. Unfortunately when I do ...
Max13's user avatar
  • 37
1 vote
0 answers
57 views

I have quite complicated additive models (GAMs) to be processed in R. Since it already takes several days (not finished yet) for even one model, and I would like to process some 100s, I would like to ...
Maki's user avatar
  • 119
0 votes
0 answers
22 views

The code bellow executes in parallel the function "mhrcmx_dep_rep_int" (written in c++) of my R package "mhrcmxIntDepL": ### paths path = paste0(fs::path_home(),'/rcpedroso/CAI/'); ...
rcpedroso's user avatar
0 votes
1 answer
76 views

I am converting a large data frame into a big.matrix object to enable parallel processing (otherwise, the data frame is too large and I run out of RAM). My code is currently like this: df <- data....
JuM24's user avatar
  • 161
2 votes
1 answer
1k views

I have a PowerShell script that I converted to an EXE with Win-PS2EXE.The problem is that I'm using Foreach -parallel and it doesn't work with PowerShell 5.0, I need this EXE to run with the latest ...
Vicc's user avatar
  • 23
1 vote
0 answers
61 views

String test = "123456789"; for(char c: test.toCharArray()) { System.out.println(c); } My question here is: does test.toCharArray() get called everytime during the iteration i.e. in here ...
Raj Kundalia's user avatar
0 votes
2 answers
151 views

I have a range consisting of a variable number of rows and 4 columns (A,B,C,D). I need to loop through each of the rows and add the number in column D to the number in column C and then clear the ...
Ezra Martin's user avatar
0 votes
2 answers
64 views

In the below the screen shot , mentioned nested element as child array. I wanted to remove child array element , I used below the script but it's only remove first element. removeChildWidget(parIndex:...
Samir Sheikh's user avatar
  • 2,452
1 vote
1 answer
158 views

I've been coding in Rust for some time but I am often caught off-guard by these nuances. For example, this works: use std::thread::JoinHandle; fn main() { let all_threads: Vec<JoinHandle<()&...
Paperino's user avatar
  • 1,019
0 votes
1 answer
334 views

I have variables declared inside a ForEach loop in Azure Data Factory, and they are being assigned sequentially. The values stored in these variables are used for incremental loading, specifically to ...
Navneet Goyal's user avatar
0 votes
1 answer
36 views

I am having issue with looping through my API call decoded JSON data within a navigation list. I have successfully put the data into a variable and just can't seem to work out how to loop through the ...
Paul's user avatar
  • 71
-1 votes
1 answer
71 views

I have a large xml which contain many records as child elements. There are many test elements and inside each test element many testchild elements. There are around 200 elements or 300 or more. As all ...
mili's user avatar
  • 27

1
2 3 4 5
516