Questions tagged as 'algoritmos'

2
answers

How to find out if each character after the variable i of a for, is a number, and if it is to add a comma at the end

I have the following: for (int i = 0; i < result.length(); i++) { if(result.substring(i).matches("[0-9]+") && result.substring(i+1).matches("[0-9]+")) { result += ","; } } What I want...
asked by 28.10.2017 / 05:23
3
answers

Dynamic text writing animation that identifies when to skip the line or if the writing space is over?

I have an animation that writes lines of text in a text box, but when it reaches the end of the text box, the words pop up to the next line in the middle of the animation. What I want to achieve is that the word skips to the next line before...
asked by 11.12.2017 / 21:56
3
answers

Block control if else

The program executes without problems, but always writes the last statement printf("lo siento, no puedo calcularlo"); Is there any way I can not get out of this condition? #include <stdio.h> #include <conio.h> int main...
asked by 15.09.2017 / 01:55
1
answer

spiral matrix in c

I did an algorithm to generate a spiral matrix given the amount of rows and columns, but it does not work for all the matrices and I do not know very well what the error could be #include <stdio.h> int main (void) { unsigned short fi...
asked by 20.08.2017 / 06:02
1
answer

How to optimize search for duplicate byte arrays in C #?

I have the following list of Objects: List<PacketData> packetList = new List<PacketData>(); public class PacketData{ public DateTime timestamp {get; set;} public byte[] data {get; set;} public bool isDuplicated {get; s...
asked by 10.03.2017 / 03:16
2
answers

Exact movements with Delta-Time. In SDL with C ++

I'm creating a 2D game with C ++ and SDL , where in time management I use the Delta-Time technique / em> (delta time) for movements with smooth movements. The execution is perfect, however there are displacements of objects (platforms) th...
asked by 09.01.2017 / 09:56
2
answers

How can I traverse an html table as if it were a coordinate table?

My problem is this, I'm trying to insert some values into a database (dynamic) html with editable fields, I already have the function that inserts, but my problem is how to relate the value that I place in the table with what I want through a jq...
asked by 07.11.2016 / 22:04
1
answer

Error applying the EM algorithm to generate a Phase Type

From some data I am generating (weibull) I am trying to make a Phase Type fitting using the MS algorithm in R. However, when generating the density function (matrixp) I get the following error: "matrizp[j,i]= pmf(data[j],lambds[i],rs[i]) repl...
asked by 11.05.2017 / 04:53
2
answers

Concatenate in a cycle in C

I have a problem, when I want to go concatenating it is the variable of type string temp every time the cycle is repeated this variable is restarted. Why is this happening and what can I do to solve it? void processData( int *digits, int digit...
asked by 26.02.2017 / 04:43
1
answer

Unique length of segments of a line

I am trying to get the distance traveled in a collection of straight line trips. The rule to determine the distance is that only the only sections count, if it happens more than once only the first counts. Example: ╔═══════╦═══════╦═══════╗ ║...
asked by 22.04.2017 / 07:02