FAQ Database Discussion Community


PHP Repeating Results in Loop

php,wordpress,loops,repeat
Hello guys so I have this simple problem and I need help solving it. I am creating a simple PHP shortcode for WordPress where it takes 3 inputs audio text and totalposts. I was able to create the layout of the shortcode but I dont know why but its repeating...

Weekday Local Notification Not Firing

ios,ios8,nsdate,uilocalnotification,repeat
I'm building an application that allows the user to have a local notification to repeat every weekday, because apple doesn't have a repeat interval for WeekDays I needed to create a local notification for every week day. I made a for loop looping 5 times the number of days in...

Merging data frames row-wise and column-wise in R

r,merge,repeat,na
How can one merge two data frames, one column-wise and other one row-wise? For example, I have two data frames like this: A: add1 add2 add3 add4 1 k NA NA NA 2 l k NA NA 3 j NA NA NA 4 j l NA NA B: age size...

Python izip and repeat memory behaviour

python,repeat
I have nested function calls where also multiprocessing is applied. izip or repeat or something seems to be making copies of objects rather than passing by reference, some packing and unpacking is also done in the meantime. Here is the structure in order of call: def main(): print 'Rel_list id...

Remove repetitive string from sentence in java

java,string,repeat
I am working on java code in which I want to remove repetitive words. Following code works fine to remove them if I get space in any word for example: 1298 Anthony 1298 Anthony, it will make it like: 1298 Anthony But for any other special character like: 1298 Anthony.ef...

Map an XML list into a Word repeating component (Word 2013)

xml,excel,ms-word,schema,repeat
I have an xml file that I have generated from an excel spreadsheet. This xml represents the rows and columns of the spreadsheet. For instance: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <data-set xmlns="dummy.xsd"> <record> <LastName>Smith</LastName> <Sales>16753</Sales> <Country>UK</Country> <Quarter>Qtr 3</Quarter> </record> <record> <LastName>Johnson</LastName> <Sales>14808</Sales> <Country>USA</Country>...

Refresh to repeat control not working normal after deleting 1 row

javascript,refresh,xpages,repeat
I have a field named "selectedTime" in a document, this fields stores the selected timings added by user.Adding times is working perfect.This is back-end. Now I will explain this issue of selecting date from front end.I have given a button add to add times.The custom control of date-time gets added...

Track value changes in a repetitive list in Python

python,list,repeat
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, if not thousands),...

How to repeat captcha letters

javascript,audio,captcha,repeat
So, i have this captcha php code, that randomly generates a string and creates an image with it... Now i am trying to do a system that will repeat the letters. I have used a speech synthetizer to create sounds for letters and numbers from 0-9 and a-z. But my...

Edit box in repeat control with default value does not update on delete

xpages,repeat,editbox
I have a Repeat control in which I have a edit box which has passed a default value.There is a Delete button to delete that row. just for test I have used a computed field along with the edit box.Computed field is also passed the same value as edit box.Now...

Sort my str_repeat

php,sorting,repeat,alphabetical
I have spent the past 6 hours trying to figure out how to sort my str_repeat alphabetically based on game. So far all I have been able to do is get it to show the first one in the list as if it was alphabetized. Here is my code. $result...

Create an array of sub-arrays with the value of an element and the number of times it has repeated in JavaScript

javascript,arrays,algorithm,unique,repeat
I'm trying to take an array (for an example, an array of years) and then make a new array of sub-arrays which tells, firstly, the unique element in the original array and, secondly, how many time it was repeated. For example, lets say I start of with an array of...

XPages repeat control and button

xpages,repeat
I have a repeat control on an XPage displaying item summary. To view other details, the user clicks on a button (inside the repeat) which will set a viewScope variable to the rowIndex of the repeat and then open up a modal to display the remeaining item details. I am...

Android GestureDetector onScroll unexpected behavior

android,distance,gesture,repeat
I have SimpleGestureDetectorListener and implemented onScroll as follows: public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { Log.i("MOVE_LARGE", "e1.getY=" + e1.getY()+" "+"e2.getY="+e2.getY()); Log.i("MOVE_SMALL", "distanceY=" + distanceY); FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) fragmentContainer.getLayoutParams(); int nextMargin = params.topMargin - (int) distanceY; if (Math.abs(distanceY )> MOVE_TRESHOLD) { setContainerMargin(nextMargin); } return true; }...

Prevent repetition of output characters in c

c,string,character,output,repeat
Here I have a code that is to output the vowels used in a string and ignore the consonants. However it repeats the output of the vowel if that vowel is used more than once in the input string. Is there some way that I can prevent repetition of characters...

Do-While to ask user to repeat entire int main programme

c++,user-interface,main,repeat,do-while
Very new to programming and l can't find any basic explanation online or code that will work well for what l need. I have a fairly long piece of programme (approx 300 lines) it all works. This is the structure to give an idea: #include <iostream> #include <stdlib.h> #include <time.h>...

ASP.net MVC Razor (.cshtml) way to freeze or repeat column headers when scrolling

razor,asp.net-mvc-5,repeat,freeze,columnheader
Is there any way to freeze column headers for ASP.net MVC Razor(.cshtml) when scrolling? I am not using a separate gridview library, at least not currently. I can use .cshtml, or alternatively (if needed) javascript or jquery. One of our managers asked me this, and it is (IMHO) a good...

Unitegallery not working with repeat control

xpages,repeat
I would like to use Unitegallery carrousel with some pictures who's urls are in a view. I tried the following : <xp:this.resources> <xp:script src="/JQueryXSnippet.js" clientSide="true"></xp:script> </xp:this.resources> <script type='text/javascript' src='unitegallery/js/unitegallery.min.js'></script> <link rel='stylesheet' href='unitegallery/css/unite-gallery.css' type='text/css' /> <script type='text/javascript'...

Excel vba how to repeat an if then else condition on rows

loops,excel-vba,if-statement,row,repeat
I want to repeat my 'if then else' condition on the 30 rows that follow. This is my code (I am new to this). Dim score As Range, result As Double If Range("A2") = "2a" Then Range("C2") = 20 Else If Range("A2") = "3c" Then Range("C2") = 23 So at...

continuation of program when user inputs yes

java,while-loop,repeat
Ok so my program works fine but at the end it asks if the user would like to input another set of integers and if they type "yes" the process starts over. My program is starting over, but it keeps all the same user inputs so it just keeps repeating...

Repeat chunk of data got from select statement multiple times

sql,repeat
1)I have the following query select CRESTACode,Latitude,Longitude from airgeography..tgeography where countryname in ( 'St. Maarten') and crestacode is not Null Result: CRESTACode Latitude Longitude 6 18.035187 -63.076599 How do I repeat this data multiple times to get 3000 rows of same data in a table ?...

How can I repeat this array of 2d pairs using Numpy?

python,arrays,numpy,repeat
I have an array that I want to repeat. test = numpy.array([(1, 11,), (2, 22), (3, 33)]) Now numpy.repeat(test, 2, 0) numpy.repeat(test, 2, 1) results in array([[ 1, 11], [ 1, 11], [ 2, 22], [ 2, 22], [ 3, 33], [ 3, 33]]) array([[ 1, 1, 11, 11], [...

no repeat in javascript

javascript,jquery,repeat
Hello i am new in javascript so sorry for the elementary question, so i want to make the same action to many button it is easy i want to make buttons actives when i click on it so there is my code: var button = document.querySelector(".button_cadre_work"); button.addEventListener("click", function(e) { this.classList.toggle("is-active");...

Duplicate values with Polymer template repeat

templates,polymer,repeat,web-component
Okay any I have a strange thing happening with my polymer template <polymer-element name="my-playlist" attributes="info"> <template> <core-ajax url="/getlist" method="POST" auto response="{{data}}" handleAs="json"> </core-ajax> <style> </style> <core-selector class="list"> <template repeat="{{k in data}}"> <core-ajax url="http://api.soundcloud.com/tracks/{{k.track}}.json?client_id=9a6dccd301f1d1cbab751e0a1ec82e2e" method="GET" auto response="{{response}}" handleAs="json">...

How to make c# Random Numbers repeat

c#,random,numbers,repeat
I'm trying to generate random arrays to test my homework assignments. The Problem is that the numbers generated are always unique , and I need some repeating numbers from time to time. Here is the code I came up with: static int[] RandomIntArray() { Random rnd = new Random(); Console.Write("Enter...

repeating child with this.props of parent react element

javascript,components,reactjs,parent-child,repeat
Currently i m working on creating react components, and i need to repeat the child components, based on this.props.value of parent component. I am struggling to find any good examples. here is my code var LiComponent = React.createClass({ render:function(){ return( <div> <span>{this.props.label}</span> <span>{this.props.value}</span> </div> ); } }); var StatsComponent =...

PHP: Most frequent value in array

php,arrays,json,repeat
So I have this JSON Array: [0] => 238 [1] => 7 [2] => 86 [3] => 79 [4] => 55 [5] => 92 [6] => 55 [7] => 7 [8] => 254 [9] => 9 [10] => 75 [11] => 238 [12] => 89 [13] => 238 I will...

r create matrix from repeat loop output

r,repeat
For each value n in some vector N, I want to compute the percentage of values exceed n for each variable in my data frame T. Consider the following input data frame: T <- data.frame(A=c(0.1,0.2,0.3), B=c(0.3,0.3,0.9),C=c(1,0.5,0)) T # A B C # 1 0.1 0.3 1.0 # 2 0.2 0.3...

How would I go back to a certain line Visual Basic 2013?

vb.net,visual-studio,repeat
I am currently using visual basic to create a project and am stuck on a certain point... I am trying to get back to a certain point once the selected operation was completed. I would like to repeat the Button1_Click sub if that's possible. Heres my code so far. Private...

Most efficient way to create multidimensional array of same chars? [C++]

c++,arrays,dictionary,multidimensional-array,repeat
sorry if this has been answered somewhere else. I am pretty new and do not know how to really explain a question like this. Right now, I'm seeking to create a [5]x[5] array all of the '+' character. Here's what I have: #include <iostream> using namespace std; int main() {...

How to know the if some combination repeats using matlab

matlab,repeat
Please allow me to post this admin: ok so this is my problem, i want to generate all combination of a, and b, for example 1 and 2, having a combinations of (1,2), (2,1),(-1,2), and (2,-1), so 4 combination, but i want only one combination as representative of all 4...

Repeating contents of a file into another file using Python

python,repeat
So I am new to Python and I am trying to create a script that reads 10 lines of data from one text file and then repeats that data 1000 times and writes it to another text file. Reading the file is not the problem, but this is what I...

Repeat a sound/action every certain time

python,date,time,while-loop,repeat
I'm trying to write a Python program that reproduces a sound every certain hour, but it doesn't really work. When I test the code and the specified time comes, it will keep repeating the sound forever. Here is the code: import os from datetime import datetime now = datetime.now() currentHour...

How to go back to “repeat” in Prolog?

prolog,repeat
Is it possible to go back to repeat in Prolog without calling the function (predicat) and without making a new function? I have the following code test :- nl, write('Welcome.'),nl, repeat, write('Print this message again? (yes/no)'),nl, read(Ans),nl, ( Ans == yes -> write('You selected yes.'), nl ; write('You selected no.')...

ImageView inside Gridview repeating image when scrolling (using ImageDownloader)

android,gridview,imageview,repeat
As the title says, I have this problem. Because I need to retrieve images from the network, I have implemented a solution which is explained here I will post the Adapter and ImageDownloader code (I have taken the liberty to modify the downloader in order to make the functionality more...

Trying to delete the selected item in the XPages repeat control, but does not work

xpages,control,repeat,delete-row
I am trying to delete the selected item in the Xpages repeat control, but it does not work. Please help? Here is my code in the repeat control section <xp:repeat id="repeat1" rows="30" var="eachQuestion" value="#{questions}" indexVar="rowIndex"> <tr> <td>...</td> <td> <xp:link styleClass="btn btn-danger" id="deleteLink"> <xp:eventHandler event="onClick" action="#{javascript:eachQuestion.getDocument().remove(true);}" submit="true" refreshMode="partial" refreshId="listContainer" /> <i...