Questions tagged as 'array'

2
answers

"Join" elements of a single vector

I have a vector with four elements that are numbers represented in hexadecimal form. What I need to do is concatenate these four elements (I think this is not the right word but I have not found a better one)? For example: int v[4]={0x...
asked by 24.02.2015 / 22:15
1
answer

Similarity of Texts

Good evening guys, I would like a help from you, as I'm starting in R, and I have a demand, where I have to signal the lines where you have the similar phrases. For this, I am using the stringdist library. However, I can only make the comparison...
asked by 18.01.2018 / 02:57
1
answer

Function to check if all elements of an array of variables are null

Suppose I have an array where each element of this array is a variable that stores a string inside it. Example: error{ [nome] : null; [sobrenome] : "sobrenome inválido"; [estado] : null; } I would like the program to ident...
asked by 28.09.2018 / 15:52
1
answer

Return array of integers except 0. How do I?

The method receives two numbers per parameter, and returns an array with the odd numbers between these two numbers. public static int[] oddNumbers(int l, int r) { int odd[] = new int[r]; for(int i=0; i<odd.length;i++){ if(...
asked by 30.07.2017 / 19:23
1
answer

Generate random numbers in C?

I need to generate 5 random numbers in a range between -10 and +10. How could I do this? I've already seen that you can use shuffle , malloc or even realloc , but being new to C, I do not quite understand how I can make it w...
asked by 04.06.2017 / 23:06
2
answers

Go through an array where the index is a Date

How do I go through an Array where the index is a date that varies with each query in the database. Just one detail, the dates are dynamic with each query. Array arrives this way: Array ( [2018-04-07] => Array (...
asked by 29.03.2018 / 19:23
3
answers

Filter array value [duplicate]

My array will be: $arr = array(); while($r = mssql_fetch_assoc($query)) { $arr = array('cnpj' => $r['cnpj'], 'empresa' => $r['nome']); } No while, there are several results (repeated CNPJ), and I would like to assemble the ar...
asked by 29.11.2017 / 13:43
2
answers

Vectors in Python

Very well, I come from C-thread, and I'm having a hard time creating vectors in python. In C if I wrote vet = [5]; I would create a vector called vet with 5 indices. I wanted to know how to do this in python but I'm a beginner and I can not do i...
asked by 06.05.2017 / 04:23
2
answers

How to get the length of a char array?

How do I get the size of a set of char ( char** )? The way I'm trying is always returning me the value 4. const char* opcSalgados[] = { "Pastel", "Mini pizza", "Coxinha", "Pao de queijo", "Pao de frango com queijo", "Pao de carne"...
asked by 14.12.2017 / 16:45
1
answer

WHERE in bigint field []

I have to make a query to see if the code of a group is in the permissions to see the field. SELECT * FROM callcenter.pausa WHERE habilitado = 1 AND permissao_ver::varchar ilike '%1%' ORDER BY pausa ASC Result: {26,9,10,7...
asked by 25.01.2017 / 19:25