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

Repeating background image in native iPhone app

Short of putting a UIWebView as the back-most layer in my nib file, how can I add a repeating background image to an iPhone app (like the corduroy look in the background of a grouped UITableView)? Do I need to create an image that's the size of the…
Frank Schmitt
  • 25,648
  • 10
  • 58
  • 70
48
votes
4 answers

Initializing a vector of vectors having a fixed size with boost assign

Having a vector of vector with a fixed size, vector > v(10); I would like to initialize it so that it has in all elements a one dimensional vector with initialized value (for example 1). I have used Boost Assign as follows v =…
saloua
  • 2,433
  • 4
  • 27
  • 37
47
votes
5 answers

Fastest way to count number of occurrences in a Python list

I have a Python list and I want to know what's the quickest way to count the number of occurrences of the item, '1' in this list. In my actual case, the item can occur tens of thousands of times which is why I want a fast way. ['1', '1', '1', '1',…
prrao
  • 2,656
  • 5
  • 34
  • 39
45
votes
4 answers

How do I repeat the last n changes in Vim?

Doing . repeats the last change. Doing 2. repeats the last change two times. But imagine I want to repeat the change before the last one. How do I do it in Vim?
scc
  • 10,342
  • 10
  • 51
  • 65
43
votes
2 answers

CABasicAnimation unlimited repeat without HUGE_VALF?

I'm trying to perform auto repeat of my image rotation animation with CABasicAnimation. I have tried to search on web how to set such property but was unable to find that. Is it really no such property for CA animation? I know that you can set some…
Centurion
  • 14,106
  • 31
  • 105
  • 197
40
votes
5 answers

How to repeat tensor in a specific new dimension in PyTorch

If I have a tensor A which has shape [M, N], I want to repeat the tensor K times so that the result B has shape [M, K, N] and each slice B[:, k, :] should has the same data as A. Which is the best practice without a for loop. K might be in other…
River
  • 572
  • 1
  • 4
  • 11
40
votes
2 answers

Repeating each element of a numpy array 5 times

import numpy as np data = np.arange(-50,50,10) print data [-50 -40 -30 -20 -10 0 10 20 30 40] I want to repeat each element of data 5 times and make new array as follows: ans = [-50 -50 -50 -50 -50 -40 -40 ... 40] How can I do it? What…
puti
  • 537
  • 1
  • 5
  • 9
40
votes
1 answer

AngularJS checkbox ng-repeat and selected objects?

I am trying to do it in proper way with less pain, but i can't figure out how to deal with ng-model and binding it to the selected list etc and moreover i need to populate that list in later time and keep selected objects in it. categories = [ {…
Jakub Kuchar
  • 1,665
  • 2
  • 23
  • 39
38
votes
8 answers

How to repeat a command with substitution in Vim?

In Unix the ^ allows you to repeat a command with some text substituted for new text. For example: csh% grep "stuff" file1 >> Results grep "stuff" file1 csh% ^file1^file2^ grep "stuff" file2 csh% Is there a Vim equivalent? There are a lot of times…
Whaledawg
  • 4,234
  • 4
  • 26
  • 21
36
votes
4 answers

Repeat rows in a pandas DataFrame based on column value

I have the following df: code . role . persons 123 . Janitor . 3 123 . Analyst . 2 321 . Vallet . 2 321 . Auditor . 5 The first line means that I have 3 persons with the role Janitors. My problem is that I would need to have one line for…
aabujamra
  • 4,494
  • 13
  • 51
  • 101
36
votes
1 answer

Generate a repeating sequence based on vector

I am trying to take an existing vector and repeat each element of it six times. I feel like this should be easy using rep() but I keep hitting the wall. Basically I would like to take this vector: 1027 1028 1030 1032 1037 And turn it into…
Stedy
  • 7,359
  • 14
  • 57
  • 77
36
votes
2 answers

How to make NumberPicker non-recurring

Is there any attribute to tell a (standard) NumberPicker to stop after its last value? E.g. if my MinValue was 0 and my MaxValue was 5 the NumberPicker just repeats itself after the 5, so that the user could scroll endlessly.
Simon Flückiger
  • 555
  • 1
  • 6
  • 11
35
votes
7 answers

repeat css background image a set number of times

is there a way to set the number of times a background image repeats with css?
Moudy
  • 858
  • 2
  • 11
  • 19
34
votes
8 answers

Repeat an array with multiple elements multiple times in JavaScript

In JavaScript, how can I repeat an array which contains multiple elements, in a concise manner? In Ruby, you could do irb(main):001:0> ["a", "b", "c"] * 3 => ["a", "b", "c", "a", "b", "c", "a", "b", "c"] I looked up the lodash library, and didn't…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
31
votes
4 answers

Print header/footer on all pages (Print Mode)

content spanning several pages...
I want to print #header and #footer on every page in print mode. I searched a lot but…
eozzy
  • 66,048
  • 104
  • 272
  • 428