What is wrong with my function and for-loop?

I am currently trying to count the absolute number of countries in a long string. I have loaded a data frame named "countries" with column "Countries", consisting of all countries in the world. I want to make a function that searches any string, loop...
more »

2017-10-03 14:10 (2) Answers

How to sort chararrays manually with a loop?

I need to check if two strings are anagrams but I cant use arrays.sort ... I know that I have to use for loop but I do not know how to start so that the chararray would be sorted alphabetically. Please, help me. import java.util.Scanner; public clas...
more »

2017-09-30 17:09 (1) Answers

How to use multiple XMLHttpRequest?

I need to get 8 JSON from 8 different URL. I stored the query string that I have to change in an Array and I loop through it with a for loop. Here is my code: var index = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx",...
more »

2017-09-30 16:09 (3) Answers

VBA: Return Strings from For Function in 2 Columns

I have no coding background but have always been curious to try it out. I've been enjoying it so far but have recently been stumped. I have exhausted my limited understanding and research on trying to figure this out, so any help is much appreciated!...
more »

2017-09-30 02:09 (2) Answers

classes and Loop inside python

i am trying my first code in python writing classes and objects.. here is the code: class Order: def __init__(self,A): self.a= A def user1(self): x = len(self.a) i =0 while i < x: value = A[i] y = valu...
more »

2017-09-23 07:09 (1) Answers

Loop is Getting Stuck on First Interval

I realise some of you will spot this in a second but for some reason I cant get the loop to cycle more than the initital loop, when hitting the button with the onclick command. //creat array with my questions var qArray = [ 'What is the answer to ...
more »

2017-09-22 23:09 (2) Answers

HTML Tag in Array Value

The Requirement is to append an HTML element from Array Value to DOM template: { 0: { h1: '<h1>Hi</h1>' }, 1: { h2: '<h2>Hi</h2>' }, 2: { h3: '<h3>Hi</h3>' } } I have...
more »

2017-09-13 12:09 (1) Answers

why c for loop condition accepts initialization

Yesterday I have attended an interview, there I saw a weird program snippets. By initial glance I decide that Snippet has compilation error in it. But when came home and tried manually in C compiler I found I was totally wrong See interview code ...
more »

2017-09-11 18:09 (6) Answers

Pasting Data on same column as Date found Looping

I have a macro which looks if dates in sheet 2 matches the dates in sheet 3, if date found , i need the macro to copy the data into sheet 3 on the same line as the date. The Problem , I am not not able to paste the data on the same line as the date...
more »

2017-09-10 10:09 (1) Answers

Iterate over list of NumPy matrices

I've got a list with row matrices: rows = [ matrix([[1, 0, 0]]), matrix([[0, 1, 0]]), matrix([[0, 0, 1]]) ] and I attempted to loop over these using for (a, b, c) in rows:, but instead of this working, I got an error: ValueError: not enough valu...
more »

2017-09-07 22:09 (3) Answers

Excel VBA - If Else still performing Else

My code is fairly simple but a bit puzzling. I might be committing a minor error - pardon my newbie-ness. The Sheets.Add.Name line still gets executed despite having Boolean = True, thus a new worksheet is created with the Sheet# naming convention. ...
more »

2017-09-07 03:09 (1) Answers

For Each loop error VBA

I have written a code which do the next things: clears defined ranges of cells and remove any background color (except first tab); resets the tab color; I took a hint from here: Excel VBA For Each Worksheet Loop Here it is: Sub ClearAll() D...
more »

2017-09-05 10:09 (2) Answers

Fetching Data From Database using PDO For Loop PHP

I am working on a project with a database structure of 6 Rows which has up to 3 columns on each row. The First Column is the user_id (Primary Key) The Second Column is the user_name The Third Column is the status which has a value of either 0 or 1 (...
more »

2017-09-04 11:09 (0) Answers