Posts by guissoares • 221 points
7 posts
-
1
votes1
answer1878
viewsA: Matrix scheduling in Python
There are five possible indexes in your matrix, ranging from 0 to 4. On the line for i in range(5): you execute five iterations, making the value of linha_aux range from 1 to 5. This way, in the…
-
0
votes4
answers634
viewsA: Find and delete different characters between strings
Here is my solution (based on reply of José Henrique, but with some amendments): def remove_caracteres(modelo, palavra): i = 0 # Índice na palavra a ser testada n = 0 # Número de caracteres do…
-
3
votes1
answer385
viewsA: Get all the text from a typed line
I did this test here and it read the whole line. How are you checking the value read? It may be that the error is in this part. Look at my code: #include <stdio.h> #include <stdlib.h>…
-
1
votes2
answers363
viewsA: File reading
One of the problems is that in your code you are not reading to the end of the line. Comments, for example, are not being ignored. In function LeNumeroDeTestes() you can put a while to proceed to…
-
1
votes1
answer350
viewsA: How to make a process wait for 'brothers'
The problem is that you are putting the commands of wait() before the commands of fork() creating the next processes. For example, in P2, before executing the wait() what hopes P4 you must perform…
-
1
votes2
answers1079
viewsA: How to compare if the contents of two columns string of a data frame are similar
Here’s a possible solution, in Python: #-*- coding: utf-8 -*- from unidecode import unidecode ignore_list = ['de', 'do', 'da', 'dos', 'das'] def parse_name(full_name): name_list = full_name.split()…
-
2
votes3
answers2408
viewsA: Allocate memory in C for structure vector
You must set the pointer carros as just struct CARRO *carros. The way you wrote it, you were defining carros as a vector of pointers of structures, rather than simply a vector of structures. Also,…