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

UILocalNotification fires after reinstalling the app

My app has an alarm function using UILocalNotification, and it works great. However, if the user uninstalls the app, then later REINSTALLS it, he would receive all the "in between" notifications at once. I have tried to call: [[UIApplication…
Enzo Tran
  • 5,750
  • 6
  • 31
  • 36
6
votes
2 answers

image background - how to repeat image as background rather than stretch it

I have an image I want to use as a background to some layout. the problem is the image contains a texture of slant lines, so if i use a 1 pixel width image or a 9 patch the image is stretched and the texture is Twitching, so i can see the slant…
lior
  • 61
  • 1
  • 1
  • 2
6
votes
2 answers

C++ Grouping repetitions within Vector

I've got a file structured like this: A 123456 0 G 123456 5 A 235334 0 B 123456 2 Each piece of information is being stored like so: temp.code >> temp.personid >> temp.data I've stored this information in a Vector ifstream fin("test.txt"); …
Courtney White
  • 612
  • 8
  • 22
6
votes
2 answers

why do repe and repne do the same before movsb?

I have an assembly test soon, and while preparing, I noticed something strange. repe movsb was repeating while ZF=0, and I was teached that repe should repeat while CX not equal to zero and while ZF=1. I did some testing and discovered that before…
user7064593
  • 63
  • 1
  • 6
6
votes
2 answers

Find longest repeating substring in JavaScript using regular expressions

I'd like to find the longest repeating string within a string, implemented in JavaScript and using a regular-expression based approach. I have an PHP implementation that, when directly ported to JavaScript, doesn't work. The PHP implementation is…
Jon Cram
  • 16,609
  • 24
  • 76
  • 107
6
votes
3 answers

Repeat the rows in a data frame based on values in a specific column

I would like to repeat entire rows in a data-frame based on the samples column. My input: df <- 'chr start end samples 1 10 20 2 2 4 10 3' df <- read.table(text=df, header=TRUE) My expected output: df <- 'chr start…
user3091668
  • 2,230
  • 6
  • 25
  • 42
6
votes
3 answers

How to use the {n} syntax of regex with CMake

I have this string "2017-03-05-02-10-10_78205" and I want to match it with this pattern [0-9]{4}(-[0-9]{2}){5}_[0-9]+ but it doesn't work on CMake. See this example in CMake : set(stuff "2017-03-05-02-10-10_78205") if( "${stuff}" MATCHES…
cromod
  • 1,721
  • 13
  • 26
6
votes
6 answers

How to idiomatically call C++ functions based on variable value?

Suppose I have a data type enum TreeTypes { TallTree, ShortTree, MediumTree }. And I have to initialize some data based on one particular tree type. Currently I have written this code: int initialize(enum TreeTypes tree_type) { if (tree_type ==…
bodacydo
  • 75,521
  • 93
  • 229
  • 319
6
votes
3 answers

Predictable Javascript array shuffle

I'm trying to predictably shuffle javascript arrays the same way each time the webpage is loaded. I can shuffle the arrays randomly, but every time i reload the page it's a different sequence. I'd like it to shuffle the arrays the same way every…
Protopop
  • 169
  • 6
6
votes
5 answers

Track value changes in a repetitive list in Python

I have a list with repeating values as shown below: x = [1, 1, 1, 2, 2, 2, 1, 1, 1] This list is generated from a pattern matching regular expression (not shown here). The list is guaranteed to have repeating values (many, many repeats - hundreds,…
prrao
  • 2,656
  • 5
  • 34
  • 39
6
votes
2 answers

Cypher: how to find all the chains of single nodes not repeated?

I want to find ALL the paths starting and ending from/to a specific node. I would like that each node in a path appears only once. For example, in a graph like…
mdalp
  • 77
  • 6
6
votes
1 answer

In Haskell, what is the most common way to apply a function to every Nth element of a list?

Its very common where I come across some list of elements xs and want to do something to do something with every Nth element. The simplest example would be the Sieve or Erastothenes, where you want to "knock out" every multiple of a given prime. The…
6
votes
4 answers

Django - Tips to avoid repeating code in views

I'm moving from a PHP background into Django development via python, mostly for the sake of tackling a MVC (or MVT) that I feel makes the most sense, although in this pattern I've started to notice a lot of repeated code in my views. For example,…
neopickaze
  • 981
  • 8
  • 14
6
votes
3 answers

Python - simplify repeated if statements

I am very new to python and looking for a way to simplify the following: if atotal == ainitial: print: "The population of A has not changed" if btotal == binitial: print: "The population of B has not changed" if ctotal == cinitial: …
6
votes
1 answer

Finding repetitive substrings

Having some arbitrary string such as hello hello hello I am I am I am your string string string string of strings Can I somehow find repetitive sub-strings delimited by spaces(EDIT)? In this case it would be 'hello', 'I am' and 'string'. I have…
Jendas
  • 3,359
  • 3
  • 27
  • 55