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
8
votes
2 answers

How to define a lot of symbols in SymPy

I am trying to define a lot of variables in "sympy" for symbolic processing. import sympy as sp b_0 = sp.symbols('b_0') b_1 = sp.symbols('b_1') ... b_X = sp.symbols('b_X') and so on with the X going from 1 to 1000. Is there an easy way to do it?
stormer1120
  • 97
  • 1
  • 5
8
votes
4 answers

Combinations with repetition

I'm using Mathematica 7 and with a combinatorica package function I can get all combinations of a certain number from a list of elements where the order doesn't matter and there is no repetition.e.g: in: KSubsets[{a, b, c, d}, 3] out: {{a, b, c},…
dbjohn
  • 975
  • 3
  • 15
  • 24
8
votes
2 answers

SyntaxError: keyword argument repeated

I have the below queryset: site_list = SiverifyVerificationSite.objects.filter(pattern_id=int(p_id), if_target=bundle.obj.pattern.if_target).exclude(ptrf__istartswith='ptrf-mt23run1-') It works if I give one exclude filter whereas If I include the…
SURYA VISWANATHAN
  • 187
  • 1
  • 3
  • 12
8
votes
2 answers

python find repeated substring in string

I am looking for a function in Python where you give a string as input where a certain word has been repeated several times until a certain length has reached. The output would then be that word. The repeated word isn't necessary repeated in its…
Sieglinde
  • 91
  • 1
  • 1
  • 2
8
votes
2 answers

Repeat a Promise until it's not rejected or reach a timeout

I'm still a Promise noob and am trying to figure out how to have my Promise repeat itself. have an ES6 promise that rejects if some global flag is not set. I need it to retry every 500ms until either: the promise returns a resolve, or a max number…
tdc
  • 5,174
  • 12
  • 53
  • 102
8
votes
7 answers

How to repeat "if" statement when output is false

I am working on a simple game in which the user has to guess a random number. I have all the code set up except for that fact that if the guess is too high or too low I don't know how to allow them to re-enter a number and keep playing until they…
Trevn Jones
  • 341
  • 2
  • 4
  • 11
8
votes
1 answer

AlarmManager - How to repeat an alarm at the top of every hour?

I want for an event to fire every hour (at 5:00, 6:00, 7:00, etc...). I tried with a persistent background service with a thread but it wasn't the right solution because of: battery consumption service termination, due to android memory…
daliz
  • 840
  • 2
  • 12
  • 25
8
votes
5 answers

NSArray: add multiple objects with same value

How can I add multiple objects to my NSArray? Each object will have the same value. Ex. I want the value "SO" added to my array 10 times
Matt S.
  • 13,305
  • 15
  • 73
  • 129
8
votes
4 answers

Element-wise array replication according to a count

My question is similar to this one, but I would like to replicate each element according to a count specified in a second array of the same size. An example of this, say I had an array v = [3 1 9 4], I want to use rep = [2 3 1 5] to replicate the…
merv
  • 1,449
  • 3
  • 13
  • 25
8
votes
9 answers

Repeating elements in list Python

Let's say I have a list of strings: a = ['a', 'a', 'b', 'c', 'c', 'c', 'd'] I want to make a list of items that appear at least twice in a row: result = ['a', 'c'] I know I have to use a for loop, but I can't figure out how to target the items…
Albert
  • 505
  • 1
  • 5
  • 7
7
votes
3 answers

How to create a horizontal bar that stretches across screen but is not in the body tag?

Very basic question! I have a background pattern that repeats itself throughout the body tag. I would also like to have a top bar and bottom bar (head/footer) to repeat on the x axis - creating a nice sandwich style of solid color, pattern and…
Tigger
  • 221
  • 1
  • 3
  • 4
7
votes
2 answers

Cocos2d fade in/out action to repeat forever

I'm trying to make a method for my CCSprite based Player class to start the player instance fading in and out until stopped by calling stopAllActions. In my Player class I have: - (void)pulse { [self setOpacity:1.0]; CCAction *fadeIn =…
Steve
  • 6,332
  • 11
  • 41
  • 53
7
votes
1 answer

Is there a way to running a role until it succeeds in a play?

I have a role name system_check. After the system start up, I need to wait until this role succeeds. Is there a way to run this role repeatedly until it succeeds?
Roger
  • 121
  • 2
  • 9
7
votes
2 answers

Generate vector of a repeated string with incremental suffix number

I would like to generate a vector based on repeating the string "FST" but with a number at the end which increments: "Fst1" "Fst2" "Fst3" "Fst4" ... "Fst100"
user3651829
  • 821
  • 1
  • 7
  • 12
7
votes
4 answers

Is there a way to allow spaces in bash bang pattern (repeating last command)

I was wondering if there is a way to repeat a bash command with a subcommand separated by space. For example, if I enter several commands, git add a.txt git status ... other commands starting with git git commit -m "" and do: !git I will run the…
thor
  • 21,418
  • 31
  • 87
  • 173