Posts by bruno101 • 717 points
33 posts
-
0
votes1
answer52
viewsA: Trigger Insert in the same table
According to @Ricardopunctual and @Motta, the solution I was developing would not work, as it would end up falling into a recursion of the query, the resolution was indicated by means of a procedure…
-
0
votes1
answer52
viewsQ: Trigger Insert in the same table
Hello, I have a table where I keep records of movements, it is inserted a record where it is possible to inform a payment installment, for example, a purchase made in 12 times whose current…
-
-3
votes1
answer193
viewsA: Difficulty in C: read two functions at the same time[Completed]
A possible solution would be: // todo código anterior printf("(1)Comida (2)Carinho (3)Banho (4)...\n"); printf("Digite uma opção:\n"); scanf("%d",chose); //variavel de escolha de ação Sleep(1000);…
-
1
votes2
answers136
viewsQ: Python flask Static status 304
The flask is returning me the following error: 127.0.0.1 - - [13/Jun/2019 22:55:07] "GET /destino/17 HTTP/1.1" 200 - 127.0.0.1 - - [13/Jun/2019 22:55:07] "GET /static/css/bootstrap/bootstrap.min.css…
-
1
votes1
answer1209
viewsA: POST communication Ajax for Flask
The system was responding in the correct way, the reason for not performing the successful function is because it is misspelled, it should be success and not sucess. It is important to note that the…
-
3
votes1
answer1209
viewsQ: POST communication Ajax for Flask
I would like a help with a Python application using the Flask framework, I want to send and receive data via Javascript using Ajax, but I’m not sure how to do, all I got was a collection of…
-
0
votes2
answers100
viewsA: I can’t edit cloned git files on the PC
There is this matter HERE that can help you better understand how the process works. The two errors that can occur is: You are not a collaborator, and therefore not allowed to work on the project.…
-
0
votes3
answers1163
viewsA: Error using Else: "'Else' without a Previous 'if'"
There’s a mistake in the if and in the else, these block commands (if-Else, for, while, do-while, switch-case.) do not carry the ;. See your if and else: if((med1+med2>med3) &&…
-
1
votes3
answers732
viewsA: Write a function that returns the larger of two numbers passed as arguments
See the example below: def bigger(): a = int(input('informe um valor: ')) b = int(input('Informe outro valor: ')) if a > b: print('O valor a é maior',a) else: print('O valor b é maior',b)…
python-3.xanswered bruno101 717 -
2
votes1
answer51
viewsA: Table 6, what am I missing? LANGUAGE C
It’s actually quite simple, your mistake is in the printf within the for, in it you’re wearing %.0f but this formatting is for float and your value is int, then use the %d, see rotating on IDEONE.…
-
1
votes2
answers78
viewsA: Doubt in vector in c
From what I can understand, you want to make a countdown count of how many times this function was called, arriving at the value 0 (zero) it returns to the initial value. #include <stdio.h>…
-
0
votes1
answer73
viewsQ: Single values average filter in dictionary list
I have the following dictionary list in Python 3.7: a = [ {'linha': 0, 'porcentagem': 1.0, 'id': 3, 'nome': 'bruno'}, {'linha': 8, 'porcentagem': 1.0, 'id': 7, 'nome': 'teste'}, {'linha': 12,…
-
0
votes1
answer59
viewsA: SQL Sorting and Grouping
Your question got a little fuzzy, but we’ll try. SQL has a sort command, it is the order by which may be asc (defult) or desc (descending order). basically you should do: select [campos] from…
-
1
votes3
answers188
viewsA: Read two notes and display a string according to the average between them
I would risk something like: media = (nota_1 + nota_2)/2 if media <= 4.0: print('reprovado') elif media >= 7.0: print('aprovado') else: print('exame') Now, it’s not enough to know HOW, but yes…
-
1
votes4
answers461
viewsA: How can a group of parameters be required if at least one of them is informed?
From what I understand, what you want is to force the passage of the two values or not pass any, the middle ground does not interest you, that’s it? In some languages the method superscript is…
-
6
votes1
answer263
viewsA: Why doesn’t this python code work?
Your code is working, just needed a few adjustments, let’s do a step-by-step analysis of it: lista = [ 1, 2, 3, [7, 8, 10, [1, 2, 3, 5]], 1, [2, 3, 9]] # aqui tu cria tua lista de elementos for a in…
python-3.xanswered bruno101 717 -
0
votes4
answers300
viewsA: Doubt about denial operator
In JS a Boolean comparison is made with the internal value, if empty, it means 0 (zero) or false, when it has something it understands as 1 (one) or true. Java treats the string as a string and not…
-
0
votes2
answers212
viewsA: PHP percentage calculation and save to Database
$stmt->bindParam(':precofinal', $_POST['precofinal'], PDO::PARAM_STR); You don’t have a $_POST['precofinal']. I advise to change the values of the bank, leaving everything as a string is not a…
-
1
votes1
answer111
views -
11
votes2
answers1334
viewsA: What is the difference between Double and Double in java?
The class Double involves a primitive type value double on an object. An object of the type Double contains a single field whose type is double. In addition, this class provides several methods to…
-
0
votes3
answers91
views -
0
votes1
answer45
viewsQ: 2 calls to the same table in Sqlite (output different than expected)
Given the following 2 tables: CREATE TABLE IF NOT EXISTS sugestoes ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, texto VARCHAR(250), autor VARCHAR(250), itens VARCHAR(250), pontos INTEGER );…
-
1
votes1
answer113
views -
3
votes2
answers3545
viewsA: How to print the percentage sign in Python 2/3?
Just use another sign %. a = 42 print("valor de a: %d%%" %a) >> valor de a: 42%
-
0
votes1
answer2192
viewsQ: Java Web Service SOAP with objects
Hello, I am learning to use web-services and I stopped with a problem, maybe it is something silly, but I did not find solution, I am hosting my application in Heroku and I will leave here the…
-
3
votes1
answer637
viewsQ: Random value in C++
I was practicing a little C++, I created that simple data game exercise, so I came across a problem, how can I generate random values in C and C++? Taking a look at the site (c plus) I found an…
-
8
votes2
answers1802
views -
3
votes1
answer793
viewsQ: Pointer from struct to struct
Hello, I had asked a previous question about this problem, however I was able to solve but not learn about the problem itself so I tried to isolate it by creating a specific code for this problem…
-
0
votes1
answer317
viewsA: Help with C nested structs
Problem solved. Link: Properly functioning solution I chose to use an array of char instead of a pointer (I confess that I do not know what changes between one and the other in this use). I created…
-
1
votes1
answer317
viewsQ: Help with C nested structs
I was creating in C a list and using a struct, after finishing I tried to see what changed with a struct nestled, created two structs basic, one receiving only one value and another receiving this…
-
0
votes2
answers179
viewsA: Set position Cursor Windows & Linux with same code
Well, as for the linux routine I don’t know how to inform, actually I don’t know if there is any native way to do this, because this is something related to the operating system, it’s a specific…
-
1
votes3
answers492
viewsA: Using an operator on a switch case
I don’t know if I understood your doubt correctly, but if I understand it correctly it is possible yes See the code: #include <stdio.h> int main() { char op; scanf(" %c", &op); switch (op)…
-
4
votes1
answer1222
viewsQ: Scanf is not stopping on repeat
I have a loop while which will only end when 0 (zero) is entered. I have a variable which will receive a command option. Inside the loop I own a switch marry where: 0) exits the program (returns to…