All Questions
11,709 questions
0
votes
1
answer
80
views
For loop for every two files in an array using SLURM
I have a list of files I store in an array :
file1.txt file2.txt file3.txt file4.txt file5.txt file6.txt file7.txt file8.txt
declare -a files=( *.txt )
I need to iterate every two files. I ...
0
votes
2
answers
47
views
SAS dynamically convert all columns but one into numeric (missing values included)
I'm trying to convert all my columns to numeric except the first column which I want to keep character. They are currently character-based and are missing. I tried the following code below.
/*fake ...
0
votes
0
answers
18
views
How do I return Error with non-integer parameters? [duplicate]
const sumAll = function(x, y) {
let sum = 0;
if (x < 0 || y< 0 || isNaN(x) || isNaN(y) || Number(x) !== x || Number(y) !== y ) {
return "ERROR";
} else { if (x > y) {
...
-1
votes
1
answer
54
views
Generate and loop through pairs in a code block [duplicate]
I am trying to generate a list of unique pairs from two ranges. I then want to use this list of unique pairs as part of a URL in a loop to download a large batch of data.
I have managed to generate my ...
0
votes
2
answers
72
views
Loop through a state array in React and switch each item to true using setTimeout
I have an array in state:
const [show, setShow] = useState([false, false, false, false])
These affect whether or not an image is displayed.
I'd like to iterate through them one by one, using a delay ...
0
votes
1
answer
78
views
Parsing a multi-line YML array into a loop
I've been scouring the web to help point me in the right direction but to no avail.
I'm trying to take multi-line array from one YML file and parse the values into a different ansible playbook:
...
0
votes
1
answer
56
views
Quickly load paragraphs into an array
My Word VBA sub adds paragraphs of the active document to an array, one at a time. It adds the style name to a parallel array.
It's really slow, even with ScreenUpdating turned off.
(If it matters, I ...
0
votes
1
answer
71
views
Assembly: calculation of string index
As a beginner to Assembly, I've been practicing disassembling and reverse engineering on Intel x86 assembly in IDA.
The current program I'm trying to figure out validates the user given password by ...
0
votes
1
answer
100
views
bash adding values and iterating an array [duplicate]
For the below script, list of elements in bash array is printed as expected within the loop, but when the same is printed outside the loop, its not. Can you please provide pointers on what is being ...
0
votes
1
answer
70
views
Creating a 'for' or 'if-else' selector for checking dynamically sized python List
I'm trying to mask 8752 images with transformers like this
from transformers import pipeline
from PIL import Image
import requests
import cv2
import numpy as np
from matplotlib import pyplot as plt
...
-4
votes
1
answer
71
views
Making a List with Arithmetic Progression [duplicate]
[Doing an assignment where I have to have to run the formula a(n) = 2*n - 5 (n>=1)] 100 times and have those in a list so that I can grab terms and compare and bunch of other stuff. This is what my ...
-2
votes
1
answer
83
views
modifying items in byte[] arrays using loops (C#)
I got a byte[] array from an input file (ASCII text file) and I'm trying to delete all bytes of a pre-set hex value, without converting the array to string and without using lists.
This is the code I ...
0
votes
2
answers
68
views
Manipulating 2d arrays in C++ and having trouble iterating through all of the data to create new arrays / go through the loops for the operation
I am writing a program for C++ that takes the user input with the first line containing the n integer ranging from 1-9 that informs on the grid size for the following data. then the grid with n number ...
1
vote
3
answers
72
views
Looping with Multiple Arrays
i am having trouble creating an efficient code that loops and returns the result for 7 scenarios starting in a particular cell and having each scenario return in the cell immediately below the ...
1
vote
1
answer
58
views
Bash array value different inside while loop [duplicate]
I have a pretty simple shell script that uses a while loop to read values from a file, place them into an array and then print the content of the array. It correctly displays the content of the array ...