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
21
votes
4 answers

R repeat function until condition met

I am trying to generate a random sample that excludes certain "bad data." I do not know whether the data is "bad" until after I sample it. Thus, I need to make a random draw from the population and then test it. If the data is "good" then keep…
user1491868
  • 596
  • 4
  • 15
  • 42
19
votes
5 answers

Add UIToolBar to all keyboards (swift)

I'm trying to add a custom UIToolBar to all of my keyboards with as little repetition. The way I'm currently doing it requires me to add the code to all my viewDidLoads and assign every textfield's delegate to the viewController I'm using. I have…
Vivian
  • 797
  • 2
  • 6
  • 13
19
votes
5 answers

Android - Running a background task every 15 minutes, even when application is not running

I need to build a background task that runs every 10/15 minutes (doesn't really matter, either is good), even when the application is not running. How can I accomplish this? I can't seem the wrap my head around this. I read I could use some sort of…
DijkeMark
  • 1,284
  • 5
  • 19
  • 41
18
votes
2 answers

PHP: Most frequent value in array

So I have this JSON Array: [0] => 238 [1] => 7 [2] => 86 [3] => 79 [4] => 55 [5] => 92 [6] => 55 [7] => 7 [8] => 254 [9] => 9 [10] => 75 [11] => 238 [12] => 89 [13] => 238 I will be having more values in the actual JSON file. But by looking at this…
Gopi
  • 231
  • 1
  • 2
  • 7
18
votes
7 answers

Element-wise array replication in Matlab

Let's say I have a one-dimensional array: a = [1, 2, 3]; Is there a built-in Matlab function that takes an array and an integer n and replicates each element of the array n times? For example calling replicate(a, 3) should return…
Dima
  • 38,860
  • 14
  • 75
  • 115
18
votes
1 answer

How to write right repeat texture with three.js

I search to repeat texture on the model. On all examples or questions I found only this like as: var lavaTexture = THREE.ImageUtils.loadTexture( 'images/lava.jpg' ); lavaTexture.wrapS = lavaTexture.wrapT =…
Laurane Bernard
  • 209
  • 1
  • 2
  • 10
17
votes
1 answer

How can I repeat the headers of an iTextSharp PdfPTable on each page?

How can I get iTextSharp to repeat the headers of a PdfPTable on each page of the generated PDF?
user147031
  • 183
  • 1
  • 2
  • 6
16
votes
7 answers

How can I write a tiny Bash shell script to repeat an action every 5 seconds?

I want to copy a file from one location to another every five seconds. I don’t want to set up a cronjob because this is only temporary and needs to be fully under my control. Can I write a .sh that will do this? (I’m on Mac OS X.)
Alan H.
  • 16,219
  • 17
  • 80
  • 113
16
votes
4 answers

REGEX - Matching any character which repeats n times

How to match any character which repeats n times? Example: for input: abcdbcdcdd for n=1: .......... for n=2: ......... for n=3: .. ..... for n=4: . . .. for n=5: no matches After several hours my best is this…
Ferit
  • 8,692
  • 8
  • 34
  • 59
16
votes
5 answers

How to Loop/Repeat a Linear Regression in R

I have figured out how to make a table in R with 4 variables, which I am using for multiple linear regressions. The dependent variable (Lung) for each regression is taken from one column of a csv table of 22,000 columns. One of the independent…
user4438232
16
votes
5 answers

Repeat copies of array elements: Run-length decoding in MATLAB

I'm trying to insert multiple values into an array using a 'values' array and a 'counter' array. For example, if: a=[1,3,2,5] b=[2,2,1,3] I want the output of some function c=somefunction(a,b) to be c=[1,1,3,3,2,5,5,5] Where a(1) recurs b(1)…
Doresoom
  • 7,398
  • 14
  • 47
  • 61
15
votes
7 answers

How to repeat a dash (hyphen) in shell

How can I repeat the character - n times in shell? I have read and tried this, but this does not work for -. It throws error invalid option. Below is the exact command that I used: printf '-%.0s' {1..100} Original posted line: printf '-%0.s'…
Sonu Mishra
  • 1,659
  • 4
  • 26
  • 45
15
votes
2 answers

Does Enumerable.Repeat() do a deep copy?

If I use the following: var myList = Enumerable.Repeat(myCustomObject, 2); Will the Second element in the list be a deep copy of the first one? Note: myCustomObject can be any Object Edit: Could you also please let me know the potential use of…
Mahesh Velaga
  • 21,633
  • 5
  • 37
  • 59
14
votes
2 answers

Android image background repeat

I have a image used for a LinearLayout background Let's say image has 20x100 px I want to make the image repeat only on x axes ... something like this in css background-repeat:repeat-x; The LinearLayout is kinda big (1024 x 680 px) so my image…
tinti
  • 1,455
  • 8
  • 23
  • 39
14
votes
4 answers

Repeating a texture over a plane in SceneKit

I have a 32x32 .png image that I want to repeat over a SCNPlane. The code I've got (See below) results in the image being stretched to fit the size of the plane, rather than repeated. CODE: let planeGeo = SCNPlane(width: 15, height: 15) let…
krntz
  • 613
  • 1
  • 6
  • 11