Questions tagged as 'array'

2
answers

Physically delete a struct type record

I need to physically delete a record created within a struct defined in my program, but in every way I tried (Set it to NULL , Create another struct and save all records that were not deleted in it ). I registered the foll...
asked by 29.08.2015 / 15:30
1
answer

How to convert a stdClass to array, recursively?

I have the following object: $a = new stdClass; $a->id = 1; $a->nome = 'wallace'; $a->parentes = new stdClass; $a->parentes->pai = 'Sidney'; $a->parentes->mae = 'Maria'; $a->parentes->esposa = 'Cirlene'; I know t...
asked by 18.10.2015 / 00:40
1
answer

How to do 'Loop' in multidimensional 'Array' in Bash?

Situation: I need to create a multidimensional array script. Example: Table 1 > > Fields id and name Table 2 > > id and phone fields Current script: #!/bin/bash declare -A arr arr[tabela1]=id arr[tabela...
asked by 08.09.2015 / 16:26
1
answer

Checkbox values in array session as string

I want to put a array in the values of a checkbox but as string and so that they are separated by% use in a mysql query array('string1','string2') . These values come from a checkbox for a session: $variavel= $_SESSION['checkbox...
asked by 23.06.2015 / 19:38
1
answer

Sort by javascript sales node

How can I make javascript sort this array through the sales node? [{"codigo":"produto003059","vendas":0},{"codigo":"produto003062","vendas":0},{"codigo":"produto003067","vendas":4},{"codigo":"produto003068","vendas":1},{"codigo":"produto003070...
asked by 19.06.2015 / 21:33
1
answer

Simplify Probability function with priority

I have this function that works the way I want it to. It gets a value between -2 to 2 to set the priority to choose between two strings. My question is: How can I simplify the function? function random_str($val){ if($var == '-2') { $ou...
asked by 29.06.2015 / 16:44
1
answer

How to read the return from webservice json (WEBSERVICE - JSON)

I have this JSON : { "articleList": { "conversas": [ { "cd_resultadofinanceiro": "24", "cd_feedbackfinanceiro": "61", "mm_resultado": "Tomar as devida providencia judiciais.", "dt_resultado": "2015...
asked by 17.07.2015 / 14:27
1
answer

jLinq - Perform dynamic query picking values from 'Select'

I'm using jLinq to search for a Array of Objetos I would like this search to be dynamic, taking the values of Selects My example: <select id="firt"><option>Select 1</option></select> <selec...
asked by 24.06.2015 / 20:03
1
answer

How to find the average by the number of filled vectors?

I need to calculate the average of a vector, but considering only those that had the fields filled out. For example: HTML: <label for="Cmes222">Valor:</label> <input type="text" id="Cmes222" name="Tmes222"><br> &l...
asked by 18.04.2015 / 18:16
1
answer

Add element to an Array

I need to add lista.get(i) to an array, it will be added to the array with the value of key spec_linha-criativa changed. However, in my code I always lose the reference and when j = 1 my list has the same values. For examp...
asked by 03.07.2015 / 20:31