for-loop

SetTimeout inside a for loop

微笑、不失礼 提交于 2020-01-25 23:43:26
问题 I'm trying to write a script that changes the z-index of 3 images. Basically the script should target the current image and apply a higher z-index on the next image, like a sort of carousel but with a z-index rather then active class. The challenge is to set the z-index after a specific interval. The problem is that the first image is displayed and then the last one. This is my code: Html: <div class="changingimages"> <img src="#" data-time="3000" width="100%" class="alternateimage

SetTimeout inside a for loop

删除回忆录丶 提交于 2020-01-25 23:42:27
问题 I'm trying to write a script that changes the z-index of 3 images. Basically the script should target the current image and apply a higher z-index on the next image, like a sort of carousel but with a z-index rather then active class. The challenge is to set the z-index after a specific interval. The problem is that the first image is displayed and then the last one. This is my code: Html: <div class="changingimages"> <img src="#" data-time="3000" width="100%" class="alternateimage

How do I run an encryption program multiple times to strengthen the encode?

蹲街弑〆低调 提交于 2020-01-25 13:17:08
问题 Here is my code so far. I need to run the encode part of the code 5 times and then decode the encode the same number of times. I figured out how to encode the message but now I can't figure out how to run the "encode" or "decode" variable back through the code to strengthen the ecryption. public class Codes { /** * Encode and decode a message using a key of values stored in * a queue. */ public static void main(String[] args) { int[] key = {7, 6, 5, 2, 8, 5, 8, 6, 4, 1}; Integer keyValue;

Dividing Array in half

大憨熊 提交于 2020-01-25 11:07:11
问题 I am having trouble with my trial-and-error code. It's hard coded for what I am needing it to do... where the array is set to get random binary when it's ran. I wanted to isolate the problem, but it never wants to print numerator and denominator's values! So my assumption is it's never getting the said values. I hard-coded something because I wanted to see if this would work, dividing an array of 0's and 1's. I converted the first half (of 8 bits) to a string, then parsed it to numerator. I

Dividing Array in half

情到浓时终转凉″ 提交于 2020-01-25 11:04:45
问题 I am having trouble with my trial-and-error code. It's hard coded for what I am needing it to do... where the array is set to get random binary when it's ran. I wanted to isolate the problem, but it never wants to print numerator and denominator's values! So my assumption is it's never getting the said values. I hard-coded something because I wanted to see if this would work, dividing an array of 0's and 1's. I converted the first half (of 8 bits) to a string, then parsed it to numerator. I

R - multiple loop counter variables

不羁的心 提交于 2020-01-25 10:11:13
问题 I need to write loops where each iteration has a unique set of variable values. It is not a nested loop "for each i do (for each j do)" type problem. Below is just an example problem, what the loop is doing is not important, it is being able to use multiple variables for each iteration for the loop. simple loop: df <- data.frame(num = 1:5) lookup <- data.frame(colors = c("red", "green", "blue"), pets = c("cat", "dog", "rabbit"), stringsAsFactors = FALSE) for (color in lookup$colors) { df[,

Bash Script Loop Out of Memory?

我与影子孤独终老i 提交于 2020-01-25 08:08:30
问题 In bash I need to run a script that loops from i=1 to i=99999999 but it always run out of memory. Is there any workaround? or is there a max value for i? first=1 last=99999999 randomString="CXCXQOOPSOIS" for val in $( seq $first $last ) do padVal=$( printf "%010d\n" $val ) hash=$( echo -n $randomString$padVal | md5sum ) if [[ "$hash" =~ ^000000) ]]; then echo "Number: $val" >> log_000000 echo "$val added to log - please check." fi done 回答1: bash provides C-like syntax for loop: first=1 last

How would you loop every 30 minutes

流过昼夜 提交于 2020-01-25 07:53:07
问题 Trying to make a for loop that has the HHMM outputted in a data-time HTML field. I currently have: for ($i = 1; $i <= 20; ++$i) { echo '<div class="mb-timer-hour"><div class="mb-timer-half" data-time="0830"></div></div>'; } Except this outputs data-time="0830" every time. I then tried $h = 30; $h + 30 but this then goes: 0800, 0830, 0860, 0890, ... Is it possible to loop 0800, 0830, 0900, 0930, ... ? The start time and end times are user variables which is why I haven't hard coded an array.

How can I compare multiple Google Sheet values using Google Apps Script? [closed]

孤街浪徒 提交于 2020-01-25 07:52:05
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed yesterday . I'm having difficulty trying to simultaneously compare multiple values from one sheet with multiple values with another sheet. To explain below... I'm using App Script (Javascript-based) for Google Sheet. I have two tables. The first table is the PINPOINT table (500 rows, all unique

using for-loop in azure pipeline jobs

若如初见. 提交于 2020-01-25 07:26:06
问题 I'm gonna use a for-loop which scans the files (value-f1.yaml, values-f2.yaml,...) in a folder and each time use a filename as a varibale and run the job in Azure pipeline job to deploy the helmchart based on that values file. The folder is located in the GitHub repository. So I'm thinking of something like this: pipeline.yaml stages: - stage: Deploy variables: azureResourceGroup: '' kubernetesCluster: '' subdomain: '' jobs: ${{ each filename in /myfolder/*.yaml}}: valueFile: $filename -