Questions tagged as 'array'

1
answer

How to report the highest consecutive sequence? [closed]

I'm hooked on this algorithm where I create an integer vector with n positions and need to show the largest consecutive sequence. I'll leave the statement to try to be more specific. "Create an algorithm where the user types 50 integers of...
asked by 03.09.2017 / 15:32
0
answers

Vector in OpenGL

Hello, I'm venturing into OpenGL and so far I know the basics of creating figures. I need to create a number of bars ranging from 1 to 64, the problem is that I need to do this with a FOR. When the first for counter starts, it creates the first...
asked by 01.09.2017 / 18:05
1
answer

Array Multidimensional PHP foreach [duplicate]

I would like to know how to do a model search of a car using foreach, given the table below: /* Carro modelo ano toyota "corrola","allion","Ranx","mark" 2008 Mazda...
asked by 01.09.2017 / 15:17
1
answer

How to transform a random vector into an ordered vector without losing the correlation in Matlab

Hello, I am trying to run a power flow program (electrical engineering). The routine works perfectly if the bar number vector is of the type: A=[1;2;3;4;5;6;7;8] The problem is that eventually I come across vectors of the type: B=[1;2;7;8...
asked by 06.09.2017 / 18:56
1
answer

How to access the contents of this subArray?

I can access the contents of an Array like this: {{teste02[0]}} And I get the following as a return: {"assigned_date":"1969-12-31 21:00:00.000","user_id":"101","role_id":"101","group_id": {"path":"/administrador","displayName":"Administra...
asked by 28.08.2017 / 15:16
1
answer

String for an array inside a loop - javascript / nodejs

I want to pass the strings of a txt file to an array and as soon as each line was passed to the array the program would run it normally, then it would repeat and pick up the second string from the txt file. Everything is being done in javascript...
asked by 10.09.2017 / 14:42
1
answer

More elegant ways to reverse integers, arrays, and strings in Python

Save! I've been looking for elegant ways to reverse strings, arrays, and integers in Python. What do you think of my codes below and what do they suggest to improve them? They work ... Thank you! frase = 'eu gosto de python'[::-1] num...
asked by 28.10.2015 / 00:33
1
answer

Vector product in C with .dat file entry

Be the code below, where the input file vecores.dat, in each line, has 6 numbers where the first 3 are components of an "u" vector and the last 3 are components of a "v" vector. output file vector.dat should have 3 components in each vector prod...
asked by 07.09.2017 / 19:25
1
answer

Array and Glob Doubts

I want to get 2 foreach entries and delete one based on another, for example. In a foreach I have the value "stackoverflow" and in the other I also have the same, and then one overrides the other and then the 2 do not appear in echo. What am...
asked by 02.09.2017 / 20:52
2
answers

Question about vector in C

Good evening, I have a question in the code I made below, my teacher requested that the values name, ra, n1, n2 be read and the average of 40 students should be read, I am trying to do it when I try to run my program is not calculating the media...
asked by 22.08.2017 / 05:06