Questions tagged as 'array'

1
answer

Return vector of integers in java

I'm trying to read a vector of integers and return the amount of ones and the number of zeros, but it always returns at least a zero, even though I did not enter that value. Debugging the code, even at the time of reading, if I enter 5 times the...
asked by 27.01.2015 / 02:58
3
answers

Array assignment in variable

Is there a proper way to do this highlighted code snippet? $numeros = range(0, 9); shuffle($numeros); $id = array_slice($numeros, 1, 9); $mult = $id[0].$id[1].$id[2].$id[3].$id[4].$id[5].$id[6].$id[7].$id[8]; echo $mult; In other words, m...
asked by 02.02.2015 / 23:24
2
answers

How to search a string inside an object in an array?

I would like to look up the word "script" inside an object, which would be the Roteiro variable. I started trying to figure something out after searching the internet, but I got lost, and it did not work, so I need help with the reason...
asked by 12.02.2015 / 20:03
2
answers

Creating an array of type double (not a multidimensional array)

I need to pass two values of type double to a AsyncTask in my application. I tried to define an array using the following code: double latitude = location.getLatitude(); double longitude = location.getLongitude(); double[] coord...
asked by 23.06.2014 / 21:26
2
answers

How to format strings and store them in a dynamic vector

In several parts of my code I just need to use bash commands to run programs on Ubuntu. To do this, format the command using sprintf and then run it with the system function. Ex: sprintf(sprintfoutput, "makeblastdb -in %s -dbtype prot -out...
asked by 30.06.2018 / 03:00
1
answer

Sorting an Array

I have my class ItemList public class ItemListPropaganda { private int iconeRid; private String texto; private int valor; public ItemListPropaganda(String texto, int iconeRid, int valor) {...
asked by 15.10.2014 / 18:28
2
answers

Exchange array data between 'S' and 'N'

I have a function that I will adapt for a button, which will exchange a data within an array, between S and N . The code I have is: var array = [{"nome":"1","faltou":"N","goleiro":"N","pago":"N"},{"nome":"2","faltou":"N","golei...
asked by 18.10.2018 / 23:44
1
answer

Display the position of a given value in a vector in the R

I started studying R in a short time and I have studied this language a lot. However, I'm having trouble getting the position of a vector, ie the order in which a certain value is written to that vector. Eg: > vector
asked by 22.10.2017 / 00:55
1
answer

"rankear" array in Python

I have a problem and I can not solve it, it's the following I have a list of type list:    ['Words', 4], ['evidenced', 3], ['presented', 2],   [1], [1], ['performed'], [1] Where the first term is the word and the second the repetition of i...
asked by 22.09.2017 / 05:16
1
answer

Find String in ArrayList

ArrayList<String> posicoes = new ArrayList<String>(); posicoes.add("Ricardo;01051509912;gmail"); posicoes.add("Renato;123456789123;hotmail"); posicoes.add("Rodrigo;09873923121;yahoo"); I have a ArrayList whose name is po...
asked by 30.08.2017 / 05:23