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

Javascript: Random number out of 5, no repeat until all have been used

I am using the below code to assign a random class (out of five) to each individual image on my page. $(this).addClass('color-' + (Math.floor(Math.random() * 5) + 1)); It's working great but I want to make it so that there are never two of the same…
user2860129
  • 75
  • 1
  • 1
  • 4
7
votes
3 answers

Matlab: repeat every column sequentially n times

I'm pretty much beginner so it's probably possible to do what I want in a simple way. I have a matrix 121x62 but I need to expand it to 121x1488 so every column has to be repeated 24 times. For example, transform this: 2.2668 2.2667 …
papkin
  • 71
  • 1
  • 1
  • 2
7
votes
7 answers

How to set iTunes 11 in shuffle or repeat mode via applescript

According to http://dougscripts.com/ setting shuffle and repeat modes via applescript is broken in iTunes 11. According to this stackoverflow answer shuffle is now a playlist independent setting. Thus, I tried to set the shuffle value via the UI,…
user113101
  • 73
  • 1
  • 5
7
votes
2 answers

OpenGL glColorPointer repeat colors?

Imagine that you've got one of these guys: (source: codesampler.com) Aka GL_TRIANGLE_STRIP. If you wanna color it using different colors, you could use: glColorPointer(4, GL_UNSIGNED_BYTE, 0,…
quano
  • 18,812
  • 25
  • 97
  • 108
7
votes
2 answers

Bitmap repeat + rounded corners

I am trying to create rectangle with rounded corners and background as repeated bitmaps. I am writing like this, but getting bitmaps in the corners. Could anyone help out? background.xml
Elena
  • 119
  • 2
  • 8
7
votes
5 answers

Finding a repeating sequence at the end of a sequence of numbers

My problem is this: I have a large sequence of numbers. I know that, after some point, it becomes periodic - that is, there are k numbers at the beginning of the sequence, and then there are m more numbers that repeat for the rest of the sequence.…
Istarion
  • 93
  • 1
  • 5
6
votes
4 answers

How can I get a counter variable in Vim without python or ruby?

I do NOT have python/ruby enabled. My Question: I frequently have to write things like the following: %macro(200701);x gzip /home/test/200701.txt;run; %macro(200702);x gzip /home/test/200702.txt;run; %macro(200703);x gzip…
Dan
  • 9,935
  • 15
  • 56
  • 66
6
votes
4 answers

How to Stop Repeating Alarm Services in Android?

I have totalTime = 1 hr and and intervalTime = 5min, both are in millisecond, I want to repeat my GPSSetting services every interval and after completion of totaltime this repeating shoud be stop. AlarmManager am = (AlarmManager)…
user938893
6
votes
2 answers

Rust Macros: Repeat n times based on number of arguments without using the actual argument

Is it possible to repeat something n times based on the number of arguments without using the actual argument? My usecase would be to implement an Enum variant, that takes 1 or more type params as well as an implementation that matches the enum…
nveo
  • 361
  • 1
  • 2
  • 9
6
votes
4 answers

set Background Image and xml Resource

I am using the following below code to round the corners of RelativeLayout. I save this as mybackground.xml in drawable folder. It's working fine for rounding the corner but the problem is that I also want to add an transparent image as a background…
aftab
  • 1,141
  • 8
  • 21
  • 40
6
votes
3 answers

Repeat a function N times in Julia (composition)

I'm trying to make a function that compose a function f(x) by itself N times, something like that: function CompositionN(f,N) for i in 1:N f(x) = f(f(x)) end return f(x) I need that the function…
6
votes
1 answer

Rust macro_rules nested repetition

In a macro_rules! transcriber, nested repetitions are not handled properly. This works fine: macro_rules! demo_macro { ($op:tt; $($arg:tt),*) { ($($op * $arg),*) } } fn main() { println!("{?:}", demo_macro!(2; 1,2,3)); } and…
Solomon Ucko
  • 5,724
  • 3
  • 24
  • 45
6
votes
0 answers

Base.repeat for numerical arrays vs. Base.kron

I recently came across extending some of the numerical arrays that I work with along different axes and in different orders, and the repeat function of Base using inner and outer came quite handy. However, it seems like the kron function is…
A.Yazdiha
  • 1,336
  • 1
  • 14
  • 29
6
votes
3 answers

R: Repeat value until new value appears by group, only once first non-NA value appears

I'm looking to repeat values until a new value appears by group. I have a function that I found online a while back that almost does what I am looking for, but not quite. Here is that function: repeat.before <- function(x) { ind <-…
Jared Annibale
  • 125
  • 1
  • 6
6
votes
4 answers

R - delete consecutive (ONLY) duplicates

I need to eliminate rows from a data frame based on the repetition of values in a given column, but only those that are consecutive. For example, for the following data frame: df = data.frame(x=c(1,1,1,2,2,4,2,2,1)) df$y <-…
ebb
  • 274
  • 2
  • 6
  • 16