Posts by gato • 22,329 points
373 posts
-
4
votes5
answers7954
viewsA: Removing the " n" from a string read using fgets()
The function fgets() is similar to the function gets(), however, in addition to being able to read from a data file and include the new line character in the string, it also specifies the maximum…
-
1
votes3
answers113
viewsA: Query in Sqlserver
You should remove double quotes ("") table controle and the countryside ribbons and also specify the query parameter you are using. Would look like this: FrMRelatorio.ADOQuery1.SQL.add('Select *…
-
2
votes4
answers3646
viewsA: Capture selected value in grid checkbox
An example of how to pick up the values marked on checkbox: List<int> codigos = new List<int>(); if (bool.Parse(DataGridView.CurrentRow.Cells[2].FormattedValue.ToString()) == true) {…
-
3
votes3
answers2790
viewsA: Convert Pointer to string
The Pointer and the pointer definition Delphi, some kind of dice. A pointer stores the address of a variable that is in memory, and through it you can access the value of the variable that the…
-
2
votes2
answers3240
viewsA: How to take information from one function and use it in another?
As its two functions perform calculation you must specify that it returns a certain value. See the function soma(): int soma(void) { int valor, soma, result; soma = 0; printf("Foi escolhida a…
-
1
votes2
answers106
viewsQ: Error changing static property value
I have my class DadosConexao, this class is responsible for storing the connection string of the database, it contains the following properties: A statistical property StringConexao. isServ…
-
15
votes2
answers6497
viewsQ: What is pointer to pointer?
How to use it pointer to pointer? I find it hard to tell what it is memory address and memory value when I try to use pointer to pointer, it seems mysterious to me. Someone could give me an…
-
11
votes1
answer2858
viewsQ: When should I use the "?" operator in C?
When I should use the ternary operator ? in C? #include <stdio.h> int main(void) { int valor, resultado; printf("\nValor: "); scanf("%d", &valor); resultado = valor < 10 ? 50 : 0;…
-
2
votes2
answers1691
viewsA: How to get the line of a particular Python matrix dice
In the example, I informed the position of line as fixed and then informed the initial position of the spine until the final position: lista1 = [1, 6, 4, 4, 5] lista2 = [2, 2, 3, 4, 6] lista3 = [3,…
python-3.xanswered gato 22,329 -
3
votes1
answer3358
viewsA: Query in relationship table N:N
Try this way: SELECT O.NOME, P.TITULO, FROM Orientador AS O INNER JOIN Projeto_has_Orientador AS P ON (P.idOrientador = O.idOrientador) WHERE P.idOrientador = <id do orientador> Here you can…
-
1
votes1
answer4344
viewsQ: Equation of 1° degree in C
How can I implement a algorithm calculating an equation of 1° grade in C? I know that a first-degree equation to be solved must follow three steps: 1°: Group the numbers on one side of the = all…
-
2
votes1
answer114
viewsA: Bank related creation
Relationship between entities is the type of occurrence between entities. Types of relationship: There are three types of relationship between entities: one-on-one one-to-many many-to-many In your…
-
5
votes1
answer1901
viewsQ: How to use realloc() dynamically in struct allocation?
I have a structure struct TMedidorEletrico *medidor;, and it is necessary to reallocate the memory to this structure dynamically, until the user closes the loop. Memory must be reallocated one step…
-
1
votes3
answers1492
viewsA: While repeating structure to recalculate in C
You can also use the while as follows: #include <stdio.h> #define MAX 10 int main(void) { int vetInt[MAX], soma_par, i, op; while(1) { soma_par = 0; printf("\nInforme 10 numeros inteiros.\n");…
-
6
votes0
answers85
viewsQ: How to collect requirements?
How can I collect requirements and prepare them for develop a system? Is there any way analyze that I can use for this purpose?
-
1
votes1
answer491
viewsQ: How to get the contents of the selected cell in the Qtableview Python Grid?
How can I get the contents of cell selected in a Grid of the kind QTableView in Python? Follow the code below: __author__ = 'Dener' from PyQt4.QtCore import * from PyQt4.QtGui import * import sys…
-
3
votes1
answer400
viewsQ: Which component to use in Pyqt4 to display records of an on-screen SQL query?
I’m developing a graphical Python desktop application using Pyqt4 (Qt Designer), my doubt is about which component use to display on my screen frmTelaPesqAluno records of an SQL query, and how to…
-
6
votes2
answers2741
viewsA: How to identify a specific number in any numerical value?
The solution to the above problem is to use the @Alexandre Borela function ProcuraNumero(int NumeroProcurado, int NumeroAlvo) in a loop for. Solution: #include <stdio.h> #include…
-
5
votes2
answers2741
viewsQ: How to identify a specific number in any numerical value?
For example, my variable valor (whole type) has the value 1354, note that the number 13 appears at this numeric value. How can I identify a specific number at any other numeric value? I’d like an…
-
11
votes2
answers70082
viewsQ: How to concatenate multiple Strings in Python?
The following method c.filtraNome(nome) carry out a consultation at the bank (sqlite3), however, I don’t know how I can group each field and return the already formatted query in the following way:…
-
5
votes2
answers1026
viewsQ: How to resolve "Typeerror: must be Unicode, not str" error in Python?
When backing up my database on Sqlite3, the Python interpreter returns the following message: Typeerror: must be Unicode, not str on the line f.write("%s\n" % linha), I couldn’t find a solution…
-
4
votes2
answers7055
viewsQ: What is the purpose of the sizeof command?
What is the purpose of the command sizeof in c language? I know I can use it to allocate memory and create vectors dynamically as follows vetInt = malloc(sizeof(int) * tamanho);. Other than that…
-
5
votes2
answers7902
viewsQ: How to define the vector size dynamically in C?
In language C I can define a vector specifying the size for example int vet[3]; how can I set the size of vector dynamically, for example by asking the user to inform the size of the vector ?…