Questions tagged [repeat]

"repeat" refers to the action of doing something over again.

Note that this tag can often be replaced by the more specific or tags.

3161 questions
9
votes
8 answers

Repeating elements in a vector with a for loop

I want to make a vector from 3:50 in R, looking like 3 4 4 5 6 6 7 8 8 .. 50 50 I want to use a for loop in a for loop but it's not doing wat I want. f <- c() for (i in 3:50) { for(j in 1:2) { f = c(f, i) } } What is wrong with it?
Max
  • 109
  • 5
9
votes
6 answers

Is there any build-in function in VBScript to repeat a string N-times?

There is a function in VBScript String(number,character) returns a string that contains a repeating character of a specified length. E.g.: String(5, "A") ' output: "AAAAA" Is there any function to repeat a string? E.g.: RepeatString(5, "Ab") …
Ivan Gerasimenko
  • 2,381
  • 3
  • 30
  • 46
9
votes
2 answers

UserNotification in 3 days then repeat every day/hour - iOS 10

UILocalNotification has been depreciated so I would like to update my code to the UserNotification framework: let alertDays = 3.0 let alertSeconds = alertDays * 24.0 * 60.0 * 60.0 let localNotification:UILocalNotification =…
Greg Robertson
  • 2,317
  • 1
  • 16
  • 30
9
votes
4 answers

Repeat each item in a list a number of times specified in another list

I have two lists, x and y: >>> x = [2, 3, 4] >>> y = [1, 2, 3] I want to use these to create a new list. The new list will have each element in x repeated the number of times specified by the corresponding element in y. Hence, the desired output…
abcd
  • 10,215
  • 15
  • 51
  • 85
9
votes
2 answers

Regex to determine if string is a single repeating character

What is the regex pattern to determine if a string solely consists of a single repeating character? e.g. "aaaaaaa" = true "aaabbbb" = false "$$$$$$$" = true This question checks if a string only contains repeating characters (e.g.…
Continuity8
  • 2,403
  • 4
  • 19
  • 34
9
votes
3 answers

Angular nested ng-repeat filter items matching parent value

I am passing in 2 arrays to my view. I would like my nested loop to only display where it's parent_id value matches the parent.id. Eg. arr1 = {"0":{"id":326,"parent_id":0,"title":"Mellow Mushroom voucher","full_name":"Patrick","message":"The voucher…
davet
  • 117
  • 1
  • 1
  • 6
9
votes
4 answers

Create a continuously rotating square on the screen using animateKeyframesWithDuration

I tried to use the code below to create a continuously rotating square on the screen. But I don't know why the rotational speed is changing. How could I change the code to make the rotational speed invariable? I tried different…
NixiliaAK
  • 93
  • 1
  • 4
9
votes
1 answer

Java Timer Every X Seconds

So, I basically need a command to run every 5 seconds, but the Timer doesn't work... I tried so many different methods, The only thing that works is the Thread.sleep(Milliseconds); But that causes my whole game to stop working... If I try using a…
Grim Reaper
  • 561
  • 4
  • 6
  • 22
9
votes
3 answers

Fast and Precise Python Repeating Timer

I need to send repeating messages from a list quickly and precisely. One list needs to send the messages every 100ms, with a +/- 10ms window. I tried using the code below, but the problem is that the timer waits the 100ms, and then all the…
dwpriest
  • 123
  • 1
  • 1
  • 6
9
votes
3 answers

Animate bubbles upwards continuously with CSS3?

See the following image: https://i.stack.imgur.com/F3znK.png See those transparent circles in the background? What i want to do is make them animate from the bottom up, and then manually jump down (off screen) and re-start the animation. The circles…
qwerty
  • 5,166
  • 17
  • 56
  • 77
9
votes
5 answers

How to stop background image repeating for empty space?

Just ran into a problem with repeating background image. In the case when the content is very short, shorter than the monitor height, the background image is still repeating for the extra space. Please refer to the screenshot. Orange bar is my…
Aaroninau
  • 143
  • 1
  • 3
  • 10
8
votes
1 answer

StateListDrawable and tiled bitmap

This is my custom selector (StateListDrawable)
kamil zych
  • 1,682
  • 13
  • 21
8
votes
2 answers

Building a matrix by merging the same row vector multiple times

Is there a matlab function which allows me to do the following operation? x = [1 2 2 3]; and then based on x I want to build the matrix m = [1 2 2 3; 1 2 2 3; 1 2 2 3; 1 2 2 3]
Simon
  • 4,999
  • 21
  • 69
  • 97
8
votes
4 answers

Repeat each row N times in Google Sheets

I have a column containing 3 rows and I want to be able to repeat those rows 5 times each. Example Name Dog Cat Ball Desired…
Wes Foster
  • 8,770
  • 5
  • 42
  • 62
8
votes
1 answer

How to get List consisted by repeated items in Perl6?

I try to use: (^10).map({0}) to generate a list with 10 '0'. Is there another way to do it?
Sun Wenjie
  • 123
  • 6