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
29
votes
16 answers

Check for repeated characters in a string Javascript

I was wondering if there is a way to check for repeated characters in a string without using double loop. Can this be done with recursion? An example of the code using double loop (return true or false based on if there are repeated characters in a…
yinjia
  • 804
  • 2
  • 10
  • 20
29
votes
7 answers

How to repeat some action certain times on Vim?

In Vim, I usually want to repeat some series of commands some times. Say, I want to comment 5 lines, I would use I//j .j.j.j.j Is there any way to repeat the last ".j" part several times?
Martín Fixman
  • 9,055
  • 9
  • 38
  • 46
28
votes
5 answers

make string of N characters

Say I have a number=20 and a $value=7. If I want to make a string of 20 7's using PHP. what's the quickest way to make this? So output like: $a='77777777777777777777'; Any functions to make this easier?
David19801
  • 11,214
  • 25
  • 84
  • 127
28
votes
5 answers

repeatedly applying a function until the result is stable

I want to repeatedly apply a function simplify' until the result is "stable" (i.e. simplify'(x) == x): simplify :: Expr -> Expr simplify expr = let iterations = iterate simplify' expr neighbours = zip iterations (tail iterations) …
fredoverflow
  • 256,549
  • 94
  • 388
  • 662
28
votes
3 answers

Repeat jQuery ajax call

How to repeat jQuery ajax call every 10 seconds? $(document).ready(function() { $.ajax({ type: "GET", url: "newstitle.php", data: "user=success", success: function(msg) { …
user370306
28
votes
6 answers

How can I repeat the line in notepad++?

How can I repeat the line in notepad++ ? For example I have the following input: a 01 a 02 a 03 a 04 And I would like it to become: a 01 a 01 a 02 a 02 a 03 a 03 a 04 a 04 So every line should be displayed twice.
tahafahed
  • 383
  • 1
  • 3
  • 7
28
votes
8 answers

How do I check if my array has repeated values inside it?

So here is my array. double[] testArray = new double[10]; // will generate a random numbers from 1-20, too lazy to write the code I want to make a search loop to check if any values are being repeated. How do I do that? I would prefer not to use…
puretppc
  • 3,232
  • 8
  • 38
  • 65
27
votes
3 answers

How to detect if a notification has been dismissed?

Is there any way in Android to detect when a user swipes a notification to the left and deletes it? I'm using an alarmmanager to set a repeating alert and I need my repeating alert to stop when the notification is cancelled by the user. Here's my…
NewGradDev
  • 1,004
  • 6
  • 16
  • 35
24
votes
4 answers

Repeat Rows N Times According to Column Value

I have following table. Table A: ID ProductFK Quantity Price ------------------------------------------------ 10 1 2 100 11 2 3 150 12 1 …
franchesco totti
  • 582
  • 1
  • 7
  • 28
23
votes
5 answers

How to create different pendingintent so filterEquals() return false?

I'm using AlarmManager to set up repeating intents but it has caused some little troubles so hope anyone could help. Summary There are 2 pending intents. One runs at 1000 and another runs at 2000 every day. Each contains a row id from the database…
markbse
  • 1,023
  • 3
  • 13
  • 26
23
votes
1 answer

Android Drawable: layer-list repeat bitmap does not load when entirely covered

I have three full screen week views that are loaded at one time (previous, next, current). Each week view has 7 columns (one for each day of the week) with a drawable background. My drawable resource background is
700 Software
  • 85,281
  • 83
  • 234
  • 341
23
votes
2 answers

Emacs repeat string n times

I'm learning the basics of navigating/editing in Emacs and I'm curious how one could accomplish the following task: Repeat the string 'bla ' n times in normal text editing mode. Let's say I want to repeat it five times to generate 'bla bla bla bla…
sammy34
  • 5,312
  • 5
  • 29
  • 42
22
votes
2 answers

Populate a new array with the same element repeated N times

Basically I need to create this array (given x = 3) array('?','?','?'); I could do for ($i = 0; $i < 3; $i++) $arr[] = '?'; But it's not so elegant. Is there any other way?
anon
21
votes
4 answers

make image( not background img) in div repeat?

I'm trying to repeat-y an image that's in a div and no background image but haven't figured how. Could you please point me to a solution? My code looks like this:
Alex
  • 449
  • 1
  • 4
  • 16
21
votes
5 answers

How do I match a pattern with optional surrounding quotes?

How would one write a regex that matches a pattern that can contain quotes, but if it does, must have matching quotes at the beginning and end? "?(pattern)"? Will not work because it will allow patterns that begin with a quote but don't end with…
Jake
  • 2,925
  • 5
  • 22
  • 21