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
14
votes
5 answers

Android - Run a thread repeatingly within a timer

First of all, I could not even chose the method to use, i'm reading for hours now and someone says use 'Handlers', someone says use 'Timer'. Here's what I try to achieve: At preferences, theres a setting(checkbox) which to enable / disable the…
sarkolata
  • 370
  • 2
  • 7
  • 17
13
votes
3 answers

Add multiple triggers to single quartz job

I want to dynamically add triggers to a job, but can't find any helpful methods off of Scheduler I though i would just be able to call the scheduleJob method an repetitively, but this gives me tthe ObjectAlreadyExists Exception "because one already…
rediVider
  • 1,266
  • 2
  • 13
  • 30
13
votes
29 answers

Finding repeated words on a string and counting the repetitions

I need to find repeated words on a string, and then count how many times they were repeated. So basically, if the input string is this: String s = "House, House, House, Dog, Dog, Dog, Dog"; I need to create a new string list without repetitions and…
Hans
  • 545
  • 2
  • 10
  • 20
13
votes
2 answers

Repeat animation angular 4

I created the following animation: fade.animation.ts: import { Component } from '@angular/core'; import { trigger, state, animate, query, transition, style, stagger } from '@angular/animations'; export let fade = trigger('fade', [ state('void',…
ararb78
  • 1,137
  • 5
  • 19
  • 44
13
votes
2 answers

Fastest way to create new array with length N and fill it by repeating a given array

I want to allocate a new array with the length N and fill it up by repeating a given array. The interface looks like this: T[] repeat(T[] array, int n); To clarify what I mean here is a small example: String a = {"a", "b", "c"}; // b =…
Flown
  • 11,480
  • 3
  • 45
  • 62
13
votes
5 answers

Repeat a block of code a fixed number of times

I'm trying to repeat a block of code, without using a condition, yet still only repeating it a specific number of times. Basically, something like this: repeat(50) { //Do stuff here. } Is there a way to do this? Other than copying and pasting…
Serdnad
  • 602
  • 2
  • 9
  • 17
12
votes
1 answer

CSS: Repeat Table Header after Page Break (Print View)

I have html table for printing with repeat header and footer. Everything works, document to break automatically. But now i would like to break page after any element. I use to css property page-break-after and set it to always. Yes, its works, but…
Erik Márföldi
  • 206
  • 1
  • 2
  • 10
12
votes
4 answers

Angular 5 - equivalent to $interval from AngularJS

I'm trying to find the equivalent of the $interval from AngularJS into Angular 5. $interval will repeat a function call or a block a specified number of times with a delay in-between. This is what I would like to do, written in…
Bogdan Pușcașu
  • 545
  • 2
  • 7
  • 21
12
votes
6 answers

Best way to repeat an observable every minute rxjava

I have the following method: public class ParentalControlInteractor { public Single isPinSet() { return bamSdk.getPinManager().isPINSet(); } } I want to call this function to run once, then repeat every minute until infinity…
Kristy Welsh
  • 7,828
  • 12
  • 64
  • 106
12
votes
3 answers

Python Numpy repeating an arange array

so say I do this x = np.arange(0, 3) which gives array([0, 1, 2]) but what can I do like x = np.arange(0, 3)*repeat(N=3)times to get array([0, 1, 2, 0, 1, 2, 0, 1, 2])
Runner Bean
  • 4,895
  • 12
  • 40
  • 60
12
votes
5 answers

Is it possible to override the keydown repeat delay, in JavaScript?

The objective is manually set a held key's "repeat rate". For example, when in a text box and pressing and holding the X key, I understand that there is browser-specific ways of repeating the pressed character. In some, it pauses, then continuously…
jeffjenx
  • 17,041
  • 6
  • 57
  • 99
11
votes
1 answer

timeit.timeit VS timeit.Timer.repeat - What is the best practice?

I would like to optimize a function 'myfunc()'. I have several ways to write it, and I would like to check the fastest code. For that, we can use the 'timeit' module. But there are several ways to use it. The most obvious, and apparently the most…
F. Varlet
  • 173
  • 1
  • 9
11
votes
1 answer

How to make a function be called every 2 ticks

I'm making a bukkit plugin for my friend, and I want to find out how to call a function every 2 ticks (1/10th of a second).
Henry
  • 342
  • 1
  • 2
  • 13
11
votes
3 answers

How to set up cron job on CentOS

I don't know how to set up cron with ssh? I opened ssh and typed "crontab -e". What do I do then? I want to repeat the function every minute. I have this code as "cron command to run": php -f…
Velid Vrabac
  • 111
  • 1
  • 1
  • 4
10
votes
3 answers

Repeat a background brush in WPF

and thank you. This question is very similar to this old, unanswered question here: How to paint notebook-like lines as TextBox background? However, it is not the same - not exactly. I would like to create a notepad, lined paper-like background but…
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233