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
10
votes
10 answers

math random number without repeating a previous number

Can't seem to find an answer to this, say I have this: setInterval(function() { m = Math.floor(Math.random()*7); $('.foo:nth-of-type('+m+')').fadeIn(300); }, 300); How do I make it so that random number doesn't repeat itself. For example if…
daryl
  • 14,307
  • 21
  • 67
  • 92
10
votes
2 answers

Android - How to avoid repetition in multiple Manifest files?

My project has 3 Manifest files: flavour/AndroidManifest.xml flavourDebug/AndroidManifest.xml flavourRelease/AndroidManifest.xml Here is flavour/AndroidManifest.xml:
10
votes
1 answer

Regex character repeats n or more times in line with grep

I need to find the regex expression to find a character that repeats 4 or more times with grep. I know that the expression is {n,}, so if I need to find lines, for example, when the character "g" repeats 4 or more times, in theory with grep man page…
Goncatin
  • 125
  • 1
  • 1
  • 6
10
votes
3 answers

Postgresql: How to repeat query as soon as finished?

Let's say I have a query like so: SELECT * FROM a WHERE a.Category = 'liquid' ORDER BY a.MeasurementTime DESC; and I want to see the results coming into the database 'live'. How can I write a query for Postresql which will repeat as soon as the…
pookie
  • 3,796
  • 6
  • 49
  • 105
10
votes
4 answers

Repeat elements in one list based on elements from another

Given the following lists: a = [0, 5, 1] b = [1, 2, 1] I'd like to repeat each element of [a] by the number of its corresponding position in [b] to produce this: [0, 5, 5, 1] i.e. 0 occurs 1 time, 5 occurs 2 times, and 1 occurs 1 time.
Dance Party2
  • 7,214
  • 17
  • 59
  • 106
10
votes
2 answers

How can I return multiple identical rows based on a quantity field in the row itself?

I'm using oracle to output line items in from a shopping app. Each item has a quantity field that may be greater than 1 and if it is, I'd like to return that row N times. Here's what I'm talking about for a table product_id, quanity 1, 3, 2, 5 And…
user126715
  • 3,648
  • 3
  • 23
  • 25
10
votes
10 answers

Repeat array to a certain length?

I'm having an array for example with 4 elements array("a", "b", "c", d"); what is the fastest way to repeat this array to create a new array with a certain length, e.g 71 elements?
Teiv
  • 2,605
  • 10
  • 39
  • 48
10
votes
4 answers

How Does One Make Scala Control Abstraction in Repeat Until?

I am Peter Pilgrim. I watched Martin Odersky create a control abstraction in Scala. However I can not yet seem to repeat it inside IntelliJ IDEA 9. Is it the IDE? package demo class Control { def repeatLoop ( body: => Unit ) = new Until( body…
peter_pilgrim
  • 1,160
  • 11
  • 18
10
votes
2 answers

Combinations With Repetitions C#

I need assistance with Combinations with Repetition. Have searched all over the net and although I found a few examples I can't understand them completely. My goal is simple a function (CombinationsWithRepetiion) receives list with items (in this…
user3218608
  • 133
  • 1
  • 5
10
votes
3 answers

iPhone dev -- performSelector:withObject:afterDelay or NSTimer?

To repeat a method call (or message send, I guess the appropriate term is) every x seconds, is it better to use an NSTimer (NSTimer's scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:) or to have the method recursively call itself at…
mk12
  • 25,873
  • 32
  • 98
  • 137
10
votes
2 answers

Angularjs - How to apply different class in conditionally to repeat directive

I need to apply a different class to a according to the $index of the repeat directive. For example
...
I need to apply a different style to depending…
Aitiow
  • 882
  • 2
  • 9
  • 18
10
votes
4 answers

Repeat same HTML code in several pages

I have a really hard time searching for this, because I have no idea how to call it. I'll try to describe the process I want, and see if any of you know such an editor. I have a website that has the same html component repeated in them, for example,…
poet
  • 111
  • 1
  • 1
  • 7
9
votes
7 answers

All permutations with repetition using scala

I am looking for the scala way to give all permutations without repetitions. I know there are some postings on this site already but they seem to have a slightly different problem. I am searching for all permutations with repetitions. For…
peri4n
  • 1,389
  • 13
  • 24
9
votes
4 answers

Why did the ListView repeated every 6th item?

I have a ListView that is filled by a Custom Adapter with a specific Layout. The Adapter is mapped to a HashMap with the specific Elements that contains the Data for each ListView Element. The Data in the hashMap is correct, but the ListView repeats…
divadroit
  • 91
  • 1
  • 2
9
votes
3 answers

css start repeating background from defined position

#container{ background:url(images/bg-main.png) repeat-y; width: 903px; background-position: 0px 687px; background-position: bottom; height: 1200px; margin-left: auto; margin-right: auto; } #content{ …
ilija veselica
  • 9,414
  • 39
  • 93
  • 147