Searching after filtering, AngularJS

I'm using ui-select to create a multiple select that can be searched, but I think this problem can be replicated in any ng-repeat-like structure. I have an array of languageIsoCodes, like this: [es, en, it, ca, ar, af, al, fr] I have a repeat loo...
more »

2017-11-29 18:11 (0) Answers

Array size in C++

I made a code in which I had to take the size of an array as the user’s input and its elements too and print them. #include <iostream> using namespace std; //Compiler version g++ 6.3.0 int main() { int i; cout<<"\nenter t...
more »

2017-11-29 11:11 (2) Answers

Copy Paste Cells under certain Conditions

I would like some help with the code I'm currently having issues with. This is what the code is designed to do: Inside the "Data" sheet, the code looks for "[whichever term] - Competency", and when it finds it, the steps are as follows: Highlight...
more »

2017-11-27 18:11 (0) Answers

Loop to add new columns with ifelse

I would like to make my code more efficient, I have a survey where my data looks like: survey <- data.frame( x = c(1, 6, 2, 60, 75, 40, 27, 10), y = c(100, 340, 670, 700, 450, 200, 136, 145)) #Two list...
more »

2017-11-27 10:11 (3) Answers

How to read a traceback in R

I have a large dataset of polygons and, with a loop, I am trying at some point to find, calculate and store intersections. On the 870th iteration, the loop stops and I get the error : Error in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower...
more »

2017-11-21 14:11 (1) Answers

access variable from outside loop

I know that this is fundamental JS, but I'd like a simple explanation. From what I've read, If i declare an empty variable outside of my loop, the variable inside the loop should be accessible globally? Or am I totally wrong? I would like to access ...
more »

2017-11-18 15:11 (3) Answers

How to properly loop through array keys in PHP

If I have an array with multiple keys and values, like this. $array = array( 'key1' => 'value1', 'key2' => 'value2', ); Are there any standards how to loop through an array when I only use the keys? Solution 1: foreach(array_keys($array...
more »

2017-11-16 17:11 (1) Answers

Optimizing subsetting with data.table in a loop

I have a basic question on how to optimize the following code. This is a very very abbreviated version of my code. Basically, I have a large data.table (> 50M rows) and I would like to subset the data very often (say 10000 times) and run some functio...
more »

2017-11-14 21:11 (1) Answers

Why this for loop is infinite?

I have such for loop and when step is (0;1) it becomes infinite. If step is [1;..) it works well. public interface FindMinI { double function(double x); static double findMinOfFuncOnInterval(int begin, int end, double step, FindMinI func) { dou...
more »

2017-11-11 18:11 (3) Answers

Optimization of simple algorithm

I have this problem: Given the lengths of laps run by two joggers (at the same speed), return the #number of laps. Each must run before they arrive at the starting point at the same #time. and this code: def nbr_of_laps(x, y) result = [] l...
more »

2017-11-11 05:11 (1) Answers

Shifting Objects Up in an Array

I'm creating a program that creates an array of objects in random positions in an array size 8. Once created, I need them to sort so that all the objects in the array are shifted up to the top, so no gaps exist between them. I'm almost there, but I c...
more »

2017-11-07 07:11 (4) Answers

JMeter - need to loop through the array

I am using JSON Path Extractor and I am getting back an array: DeedIDs=["5411ab7ccbda71fb38f5adf9","5411ab7dcbda71fb38f5adfa","55d7000dfbffa917247e09bf","5411ab7acbda71fb38f5adf4","5411ab79cbda71fb38f5adf3","5408b9e2cbda7138f4452129","5408b9e2cbda71...
more »

2017-11-05 15:11 (3) Answers

Can't use integer as an array index

I am trying to pass an integer to a Async task and access a list by that index withing. However I get this error "in List cannot be applied". Here is the relevant code. The Async task doesn't accept primitive int as an argument. src = new ArrayLi...
more »

2017-10-20 16:10 (3) Answers

for without increment vs while

I'm currently studying computer science in Germany but did work on several C/C++ opensource projects before. Today we kind of started with C at school and my teacher said it would be a no go to modify a for loop variable inside the loop, which I abso...
more »

2017-10-17 11:10 (4) Answers

Using one-page URL alongside search function

First of all, apologies if this question seems repetitive or one that you feel I have not done my due diligence on. I normally scour the Internet before, but I feel as if I need to ask. So, basically, I'm building a one-page dynamic website which l...
more »

2017-10-14 18:10 (1) Answers

PHP Foreach Loop to Print All Emojis

I see that there's better support of Emojis in PHP 7 but no packaged set/library of emojis to reference from. As of now, I have to search and look for the UNICODE of the emoji I desire at Would th...
more »

2017-10-14 00:10 (3) Answers

Python 3 - Counting up with two different values

I am trying to figure out how to count up to a certain integer (as a range) alternating between two different numbers like 2 and 3. So that the output would be 2 5 7 10 12 15 etc. I started off trying to alter a simple while loop like the following ...
more »

2017-10-13 14:10 (10) Answers

Using Apply Function in R as alternative to Loop

Looking for help. I am looking to create a balance build whereby the start balance in each row is dependent on the end balance from the preceeding row. The End Balance in the preceeding row is a calculation: End Balance = Start Balance + Payments - ...
more »

2017-10-13 14:10 (0) Answers

How to save each file in a for loop using matlab

I have three files named as modis1.hdf, modis2.hdf and modis3.hdf in one folder. I am able to read files individually using my command. for i=1:3 or for i=1 lst_try=['D:\lst2016\lst_try\modis',num2str(i),'.hdf']; lst_3(:,:,:,:,i)=hdfread(lst_try,...
more »

2017-10-11 12:10 (1) Answers