repeated

How can I find repeated letters with a Perl regex?

I am looking for a regex that will find repeating letters. So any letter twice or more, for example: booooooot or abbott I won't know the letter I am looking for ahead of time. This is a question I was asked in interviews and then asked in interviews. Not so many people get it correct. ...

Regex: How to match a string that contains repeated pattern ?

Is there a regex pattern that will match a string that contains repeated pattern, e.g.: "a"|"b","c"|"d",...,"y"|"z" Do you have any idea? Thanks. ...

How can I efficiently extract repeated elements in a Ruby array?

I have an array like [1,1,1,2,4,6,3,3] and I would like to get the list of repeated elements, in this case [1,3]. I wrote this: my_array.select{|obj|my_array.count(obj)>1}.uniq But it is tragically inefficient (o(n²)). Do you have a better idea? If possible concise. Thanks ...

Loop Through Listbox in VB.net or C# and Set Values to Label Text?

I have items in a listbox control that I would like to repeatedly (when it gets to the last one, repeat) loop through and set the text to a label. I'm stuck, please help! ...

How to find a repeated string and the value between them using regexes?

How would you find the value of string that is repeated and the data between it using regexes? For example, take this piece of XML: <tagName>Data between the tag</tagName> What would be the correct regex to find these values? (Note that tagName could be anything). I have found a way that works that involves finding all the tagNames ...

C# Best way to replace x repeated tokens by one token

If I have: Some text More text Even more text What is the more elegant way to obtain: Some text More text Even more text All with knowing the number of repeated tokens ...

Google Protocol Buffer repeated field C++

I have the below protocol buffer. Note that StockStatic is a repeated field. message ServiceResponse { enum Type { REQUEST_FAILED = 1; STOCK_STATIC_SNAPSHOT = 2; } message StockStaticSnapshot { repeated StockStatic stock_static = 1; } required Type type = 1; optional StockStati...

Persistent variables on a page in PHP

On a page I am working on, I have several distinct pieces of PHP, such as one in the head to handle dynamic Javascript and one in the main body for table creation. However, many of the operations, SQL queries, etc. are the same between the two area. For example, I keep having to reconnect to the same database over and over. Is there some...

Java: Execute a method at a specified time interval

Hello I have this problem. I need to have a method repeated endlessly, if possible, but without overloading the system. As I understand, while(true) { ...code... } will hang the system. What would you suggest me to use which won't hang the system? Thanks Also: The execution of a my method may take up to 5 minutes, or 50 millisecond...

repeated dates in rows

Hello, I have grid view.It contain date columns. I dont want to show repeat date in all the rows. I mean i have to show on top once. Please see my grid below. On Date Added column i want to show date only once if it is same date added. Date Added Who Added Updated Who Updated Action Code Comment Edit 02/05/01 UTA 02/05/01 UTA 008 ...

utility to find longest possible repeated strings

Is there any tool or utility or perl/python script that can find longest repeated substrings in a large text file and print those patterns and the number of times each pattern occurs? ...

Html dynamically repeated border-image

I have a table which border I want to have a sort of zig-zag shape. I want the table to have an automatic size; resizing depending on how big the browser is. But rrathe than just having an image that gets stretched I want a seamless image that gets repeat instead. I found out this can be done with CSS3's Border-image but by looking and B...

Regex to match 4 repeated letters in string using java pattern

i want to match something like aaaa, aaaad, adjjjjk. Something like this ([a-z])\1+ was used to match the repeated characters but i am not able to figure this out for 4 letters. ...

Removing duplicates without overriding hash method

Hello, I have a List which contains a list of objects and I want to remove from this list all the elements which have the same values in two of their attributes. I had though about doing something like this: List<Class1> myList; .... Set<Class1> mySet = new HashSet<Class1>(); mySet.addAll(myList); and overriding hash method in Class1...

Find a repeated numbers out of 3 boxes

I have 3 boxes, each box contain 10 piece of numbered paper (1 - 10) but there is a number the same in all 3 boxes eg: box1 has number 4 and box2 has number 4 and box3 also has number 4. How to find that repeated number in java with an efficient/fastest way possible? ...

Repeated TableViewCells show up when I try to reuse tableviewcells... how do I get the new ones to show?

I am having a problem with my code skipping over the if(cell == nil) after about nine trips through the cellForRowAtIndexPath. Then items in my table start repeating and do so every nine items. When I remove the if(cell == nil) line, the table comes out beautifully, with all the data in the right order. However, if I scroll to the bottom...

SQL retrieve yearly repeated event

How to write a sql statement to retrieve repeated yearly event, which mean retrieve all the event regardless year only match with month and date. Select * from Event where [date] = date ? ...

iReport: trying to hide elements B,C and D when value in A is repeated

Hi, I have a iReport question: Let's say we have 4 columns on a detail band: A,B,C and D. Column A can have the same value, and repeated values should be hidden. So I uncheck the "Print Repeated Values" property. That works. But now I also want to hide the columns B and C when column A is empty. Adding a "Print When Expression" on B a...

How do i make Android app which do something every X second

Hello i wanna do apliacation which every 1 second call function or do something else. I have this code which is not working can you tell what is wrong? public class App5_Thread extends Activity implements Runnable { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInsta...