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
1 answer

JQuery fadeIn gets called twice after fadeOut

The situation: I have 8 slides. When the page starts all are hidden except for the starting one, when first one is clicked it fades out and then 3 more fade in one after another, when 3 are there they fadeout(max number which can fit is 3) and then…
6
votes
2 answers

Java Server Guessing Game

I'm creating a server where clients connect to play a guessing game they are also to get points from doing this. My only problem at the moment is that whenever my client guesses the number correctly it jumps to the server and says 'server null'. I…
James
  • 139
  • 3
  • 7
6
votes
3 answers

LibGDX repeating TextureRegion

I am using LibGDX for a project, and I am trying to tile/repeat a texture across a specific amount of space. At the moment I am using a TextureRegion set to the proper size, and any extra space off of the texture is being filled as you would expect…
Shamrock
  • 436
  • 1
  • 8
  • 17
5
votes
4 answers

Repeating a section of an image in CSS

I want take a section of a picture, for example the middle of a picure, and repeat only that section in the background of a div. Is this even remotely possible? I suppose I could do this in javascript, but that would be messy. In theory the answer…
B T
  • 57,525
  • 34
  • 189
  • 207
5
votes
8 answers

jquery - repeat animation for X times

How can I write this more efficiently? HTML Js $(document).ready(function(){ var offs = 0, speed = 700; $('.navigation-left').animate({ left:…
klawisz
  • 81
  • 1
  • 3
5
votes
4 answers

Strange behaviour of function Sleep() used in repeat until in Delphi

I have function which is reaction on button click. When I click on the button it should start repeat and write values form an array and show them in labels on main form. Problem is with function sleep - there is some bug or something, cause when I…
user1097772
  • 3,499
  • 15
  • 59
  • 95
5
votes
3 answers

Is there any case in python when using a while loop would be best practice?

I'm doing some python benchmarking, and I've discovered that repeat(None) is much faster than while True or while 1: >>> def bench7(): ... foo = 0 ... a = time() ... for i in repeat(None): ... foo += 1 ... if foo == 100000000: ... …
OmnipotentEntity
  • 16,531
  • 6
  • 62
  • 96
5
votes
6 answers

R repeat elements of data frame

I have searched the internet, but I haven't been able to find a solution to my problem. I have a data frame of numbers and characters: mydf <- data.frame(col1=c(1, 2, 3, 4), col2 = c(5, 6, 7, 8), col3 = c("a",…
Sisse
  • 291
  • 1
  • 4
  • 14
5
votes
2 answers

developing daily alarm in android

I have this piece of code that fire the alarm once by setting a time and date using the TimePicker and the DatePicker in another activity. I want to modify it in a way that whenever I set a time and a date it will fire the alarm everyday at the same…
zoza
  • 127
  • 3
  • 12
5
votes
2 answers

Catch repeat letters in PHP - Regular expressions

I have to check user input to make sure name, last name (etc...) are entered correctly and are valid. I have to build a regexp that check if a user enters repeated letters in the first name , last name etc... Example: AAAron = bad because of the 3…
Tech4Wilco
  • 6,740
  • 5
  • 46
  • 81
5
votes
1 answer

Why does this loop repeat each iteration twice?

The function below prints each number twice. Could someone explain how it works? I tried debugging but all I can see is that the value of i only increases on every second iteration. async function run(then) { for (let i = 1; i <= 10; i++) { …
Leonor
  • 357
  • 2
  • 8
5
votes
3 answers

Repeat python function at every system clock minute

I've seen that I can repeat a function with python every x seconds by using a event loop library in this post: import sched, time s = sched.scheduler(time.time, time.sleep) def do_something(sc): print("Doing stuff...") # do your stuff …
Jepessen
  • 11,744
  • 14
  • 82
  • 149
5
votes
1 answer

What is the spaced repetition algorithm to generate the day intervals?

I am implementing a flashcard game and I want to implement spaced repetition. I don't need something complex like in SuperMemo, but simply space the learning based on the score for each card. What I am looking for at the moment is how to calculate…
laurent
  • 88,262
  • 77
  • 290
  • 428
5
votes
3 answers

How to repeat rows by their value by multiple columns and divide back

Let's say I have this dataframe: > df <- data.frame(A=1:5, B=c(0, 0, 3, 0, 0), C=c(1, 0, 0, 1, 0), D=c(0, 2, 0, 0, 1)) > df A B C D 1 1 0 1 0 2 2 0 0 2 3 3 3 0 0 4 4 0 1 0 5 5 0 0 1 How would I go about converting it to: A B C D 1 1 0 1 0 2 2 0…
U13-Forward
  • 69,221
  • 14
  • 89
  • 114
5
votes
5 answers

R repeat in column based on value in row

I have a dataframe like the following: Name School Weight Days Antoine Bach 0.03 5 Antoine Ken 0.02 7 Barbara Franklin 0.04 3 I would like to obtain an output like the following: Name School 1 2 3 4 5 6 …