Category "loops"

The loop over two arrays take LONG

Thanks for your helps, I have two arrays: A (100k row, 10 col) and B (100k row, 12 col) The following code (thanks to BSALV) loop through A and B => It takes

Target Individual Form Instance/Counter Inside A PHP While Loop

I have a PDO prepared statement that I use on a single-image page where a user is going to be able to download that specific image. I currently have a counter t

How can i use loop in aiml pandorabots for countries population?

i am creating a chat bot with aiml in pandorabots who knows the population of all countries and cities . How can i ask the chat bot "tell me the 10 countries wi

How to reset this string scanning code for a new letter?

I'm in the middle of homework and nearly finish. This is my code #include <stdio.h> #include <stdlib.h> void main() { char word[100],*ptr,input

Calculate the sum of values within an array of objects [duplicate]

I am trying to find the total sum for each item sold inside an array, like so: The array looks like this: [ { 'Some Title Item', '22',

Getting "throw new Error('Callback was already called.')"

I've been getting this bizarre error out of the blue when I run npm run build (built the program many times before). C:\Users\PomoJota\node_modules\neo-async\as

Confusion with an infinite while loop, concerning Scanner.nextInt();

I am having problems with understanding why code is not working. My objective is to keep reading the input of the user until the user finally enters "5", to whi

Create li from loop through array and display to HTML as a list

I am learning javaScript and I want to loop array and display to HTML as a list. How can I do that? Array: var array = ['Slide 1', 'Slide 2', 'Slide 3', 'Slid

Return the first word with the greatest number of repeated letters

This is a question from coderbyte’s easy set. Many people asked about it already, but I’m really curious about what’s wrong with my particular

Make calculations across multiple tables based on the table suffix in Bigquery

I have a database of daily tables (with prefixes formatted as yyyymmdd) with customers info, and I need to get a 90 day timeline of 90 day ARPUs (average revenu

Filter array by skipping every nth element from the end

Is there an efficient way to get an array by skipping every n elements starting from the end (so that the last element is always in the result)? Basically, I ha

How to exit a program if a blank line is entered?

I just want to exit the program if a blank line is entered. What do I need? I've tried sys.exit(), but that doesn't quit the program, just returns a blank whi

Excel VBA: Loop and finding multiple values in a range then copying the offset cells in the same range in a categorized list in another worksheet

I am in need of help with looping through a range (In this case Column "C") and finding 5 specific words (Sort, Set, Shine, Standardize, and Sustain) and then o

Is it necessary to avoid loops for updating models in laravel?

I'm trying to sort multiple records for a model based on a field and store their ranks in DB. Like below: $instances = Model::orderBy('field')->get(); $ran

Duplicate things a specific number of times in racket

I'm trying to write a program that takes in a phrase and a number (n) and returns a list that contains the phrase repeated n times. What I have so far looks lik

Making a certain statement loop forever in Python

while 1 == 1: do = raw_input('What would you like to do?') In the above example you can see that the code is meant to make something loop forever, for exam

How can I print every minute using Datetime with Python

As an example, I want to print, "1 min", every time 1 minute has passed using time or datetime. I cant use time.sleep(60) because I have more code that needs t

Rewriting strlen() in C [closed]

if anyone has ever wanted to try and rewrite a string function in C, would this code work to replace the standard strlen() function? I have no

General approach to modifying an array while looping through it

Is it safe in Perl6 (as opposed to perl5 or other languages) to loop through an array while modifying it? For instance, if I have an array of websites to downlo

Looping over pandas DataFrame

I have a weird issue that the result doesn't change for each iteration. The code is the following: import pandas as pd import numpy as np X = np.arange(10,100)