Questions tagged as 'array'

3
answers

Data of an Array

I'm having a tricky little problem here, the logic I should use for this kind of procedure is a bit tricky. Well, it's the following: I have an array with the following data: var dados = [ {'id':1,'nome':'dom','horario1':'01:00','h...
asked by 22.02.2016 / 14:31
2
answers

Sort array in rails [closed]

I can not sort my array in descending order of id. <%@vendas = Vendas.find(:all,:order=>"id, DESC")%>     
asked by 22.02.2016 / 15:21
1
answer

Include variable in json result [closed]

if($_GET['operacao'] == 'banners'){ header('Content-Type: application/json; charset=utf-8'); $rs = $mysqli->query("SELECT foto AS image FROM banners"); $registros = mysqli_num_rows($rs); $arr = array(); $url = "http://www...
asked by 11.12.2015 / 18:20
1
answer

Angularjs, How to create Checkbox to insert array in MongoDb

I have created a collection in mondoDB called Mangas , where it has " name, author, gender and info Gender is array. I have a form that will receive the values name, author and info, Checkbox needs to be filled as Array with values to...
asked by 02.02.2016 / 19:50
1
answer

Combination of digits A to Z (Crosse Join)

I'm doing an algorithm that gives the combination in 4 digits from A to Z. I did using vectors in Pascal like this: var i:integer; j:integer; k:integer; l:integer; vect1:array[1..26] of string; vect2:array[1..26] of string;...
asked by 20.02.2016 / 21:45
1
answer

Get the index of the array in the foreach

I have the following CarrinhoDao.php class that creates an array of Carrinho.php objects that creates an object of class Produto.php I'm doing foreach in the resulting array: <?php require_once "controlls/uti...
asked by 17.12.2015 / 18:50
1
answer

How to put variable within quotes in javascript? [duplicate]

I need to make this code work. But whenever I put the variable in place or inside the "" it does not work. //jvectormap data var visitorsData = { "US": 398, //USA "SA": 400, //Saudi Arabia "CA": 1000, //Canada "DE": 500, //Germany "FR": 760,...
asked by 21.11.2015 / 19:09
3
answers

Problem with vector in C

I do not know where it is wrong, if I put the value 7 in the matrizA and 7 in the matrizB and 14 in the matrizC that will accumulate the value of A and B, of course but if I put above 14 of the error.    Make a program to...
asked by 26.09.2015 / 04:33
2
answers

How to put two $ row results in variable?

The code below gives error, it does not add the results of $row , only the comma and the period. What to do? Code that does not work      mysql_select_db('cadastro',$conexao); $sql="select * from usuario"; $resultado = mysql_quer...
asked by 30.09.2015 / 06:33
1
answer

Logic of all possible mixtures of values of a variable quantity array. PHP

I'm breaking my head to create a logic that does the following: Get an array of N positions, within these positions define all possible possibilities without repeating the key of a position. Example: Array ('A', 'B', 'C') A AB ABC B.C A...
asked by 25.08.2015 / 15:28