Questions tagged as 'bucle-for'

1
answer

error when compiling main c ++ file

There is an error that has come up to me several times, I have modified the classes to remove that error, but it keeps coming out when executing the main, I do not know what it is referring to, we appreciate help. this is the main code: #in...
asked by 27.09.2017 / 01:27
3
answers

Loops nested in R

I have 3 dataframes that contain the following information: df1 COD LON LAT ALT C037 -289.976 432.165 162 E000 -274.107 430.783 218 C068 -228.623 428.395 596 df2 #So many data by COD as dates (which...
asked by 15.05.2018 / 10:50
1
answer

Simplify method using lambda expressions

I have this simple method: public void setComboBoxItems(List<User> users, List<Client> clients) { for (User user : users) { usersIds.addItem(user.getId()); } for (Client client : clients) { clientsIds.a...
asked by 15.12.2018 / 17:49
1
answer

Python: 'numpy.int32' object is not iterable

I'm constantly having this error and I do not know how to fix it. This is the code: import numpy as np import itertools import random g_row=10 g_col=10 m_prob = np.ones((g_row, g_col), dtype=np.int) s_acomulada = list(itertools.accumulat...
asked by 26.05.2018 / 02:26
0
answers

forEach vs. for in javascript does not come out the same

This is a JavaScript exercise that you can find on the following page: FreeCodeCamp excercise This is my code: function checkCashRegister(price, cash, cid) { debugger; var toReturn = cash - price; var cashArray = [0.01, 0....
asked by 18.08.2018 / 18:12
1
answer

Compare two values of a property of different json

I need to compare the value of a property from 2 different jsons to be able to show something on the screen. For example : 1st json: { registros: [ { "paciente": 2, "problema": { "nota": "Mano derec...
asked by 11.09.2018 / 03:28
0
answers

You doubt about cycle or loop for

I have a question about ciclo for , is that I have a form where I send and I receive the following variables: case 'updatePD': //ACTUALIZACION DEL COLABORADOR if(!empty($_POST['consecutivo'])){ $n=count($_POST['consecutivo']); $iddatosp...
asked by 23.04.2018 / 15:38
1
answer

Avoiding the use of For

Once again here trying to do things without the use of for , I have a problem that has a solution with for but I would like to give it a focus without for . The problem is that I have some data with days and I want to creat...
asked by 03.06.2018 / 15:53
2
answers

Fill a html select by means of a javascript cycle

I want to fill a select dynamically with years, starting from the year 2000 to 2050, through a for javascript. But the code still does not work for me. HTML <select id="año"> </select> JAVASCRIPT select = document.getElemen...
asked by 02.08.2018 / 23:33
3
answers

Android - Change Switch with Intents to For with Intents

I have a switch with many cases and same code and I want to pass it to a for to reduce code but it gives me a programming error. How can I do it? @Override public void onItemClick(AdapterView<?> parent, View view, int positio...
asked by 26.04.2018 / 19:33