Posts by Evilmaax • 2,613 points
115 posts
-
1
votes2
answers67
viewsA: Change the color of the Microsoft Edge scrollbar
For now it’s impossible to do this in the Edge, as documented by the Mozilla developer community. Anything beyond that with just a whim.…
-
1
votes1
answer57
viewsA: Conditional to execute sql statement
The same way. Postgres accepts, for example: IF ... THEN IF ... THEN ... ELSE IF ... THEN ... ELSIF ... THEN ... ELSE An example of If is: IF parentid IS NULL OR parentid = '' THEN RETURN fullname;…
postgresqlanswered Evilmaax 2,613 -
0
votes1
answer805
viewsA: Error running Ionic Cordova run android --device command
Delete the entire folder node_modules within your project and then run the following command: npm install @ionic/app-scripts@latest --save-dev It will work again.…
-
5
votes4
answers1546
viewsA: Take specific value from a JSON or XML
I suggest you use the library Json.net that can be downloaded here. Then it’s just: using Newtonsoft.Json; ... var result = JsonConvert.DeserializeObject<teste>(json); Where the teste…
-
0
votes2
answers679
viewsA: Is it possible to pass a vector as a parameter in Visualg?
To declare a vector in Visualg use vet: vetor [1..10] de real. Then iterate with it use vet[1], for example. Note that the total number of variables supported by Visualg is 500 and each element of…
-
4
votes1
answer285
viewsA: Does the Python Tkinter library still exist?
It depends on the version of Python or Ubuntu you are running, among other things, but yes, Tkinter still exists. If you are using Python 3: sudo apt-get update sudo apt-get install python3-tk If…
-
0
votes1
answer1006
viewsA: Python: "list index out of range"
In the verificar = self.tree.column(titulos_listbox[ix], width=None) the program passes column by column searching which of them has width equal to nothing to, in the if next, assign the width of…
-
1
votes3
answers8005
viewsA: Problem when pushing on Github
Just run the following commands and then push again git fetch git reset --hard origin/master
-
0
votes1
answer415
viewsA: Error connecting Python to Oracle BD
You are running different architectures of Python and Oracle. Since your Pyhton is 64 bits, your database also needs to be 64 bits. Do so: Download the 64-bit Oracle client and install here at this…
-
5
votes2
answers145
viewsA: How to leave the background of Visual Studio 2008 in dark theme?
First you have to download the Wakeroad Ink theme Then go the following way (mine is in English) Tools > Import & export settings Follow the assistant and you’re done…
-
0
votes1
answer95
viewsQ: Receive data input as Python 3 literal value
Developing an encryption algorithm, at some point the user will insert the message to be decrypted. The message will be inserted in bytes, in the format…
-
1
votes1
answer163
viewsA: Padding error encrypting AES CBC mode with Pycrypto
To whom it may concern, follow the way I solved the problem with this answer. In my job I was generating a iv random at each execution, which is good, however, was not keeping this iv. So when I was…
-
1
votes1
answer163
viewsQ: Padding error encrypting AES CBC mode with Pycrypto
I have the following code working perfectly: from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad key = b'Sixteen byte key' data = 'some text to encrypt'.encode("UTF-8") data =…
-
7
votes1
answer115
viewsQ: Doubt strings Pyhton
I created an algorithm that encrypts words and messages. To work it needs a simple numeric key, such as 9, 4, 2, where the first letter will be displaced 9 positions, the second 4, etc. All running…
-
3
votes1
answer66
viewsA: Doubt in the functioning of a Python code (Classes and objects)
It seems to me you’re making a mess between function statement and function call. In your example the functions are being only declared. They’re not being called to execution. Thus, there is no…
-
2
votes1
answer611
viewsA: Return HIGHER value with condition
I used Index, Corresp, Minor, Abs and Today formulas, so be sure to find the corresponding formulas in your program. The result for my spreadsheet is…
-
2
votes1
answer1393
viewsQ: Returning value via VBA
I created a database in Excel that should accept only 1 CPF. So I created the following function that checks and prevents repeated entries from being entered. Function verifica_cpf(cpf As Integer)…
-
6
votes2
answers413
viewsA: What’s the difference between "Issues" and "Pull Requests"?
Issues, of the English problems, is the section where users report bugs and where the community discusses how to resolve them. Pull Request is when you clone the project, make some improvements and…
-
2
votes1
answer202
viewsA: Error in python print
This happens because after the name is wrong, you ask for it to be inserted again, but within the function check. So, as long as the name is entered correctly in this second attempt, it is "stuck"…
-
5
votes2
answers507
viewsA: How to Improve Maximum Common Divisor Algorithm - URI 1028
I was able to solve it by implementing recursion thanks to @Anderson’s tip Carlos Woss in the comment above. To whom it may concern, follow the algorithm. def mdc(A, B): return A if not B else…
-
2
votes2
answers507
viewsQ: How to Improve Maximum Common Divisor Algorithm - URI 1028
I’m solving this URI problem which basically calls for the maximum common divide between two values to be found. I originally resolved with the math.gcd in half a dozen lines, however, the code was…
-
1
votes1
answer1233
viewsA: Excel: load list of names according to the selection of another list
I don’t know how is organized your spreadsheet and the data, but looking at the formula you created can do so: =DESLOC(A1 !$B$3;CORRESP(F14; A1 !$B$3: A1 !$B$52;0)-1;1;1) That way, if you put 100 in…
-
0
votes1
answer48
viewsQ: Search for NULL mysql via Java
I intend to save a residence in my database via java when one of the searched parameters is NULL, but it turns out I can’t find a way to pass that command. My code is: public Usuario…
-
2
votes1
answer2174
viewsA: attach file and send vba email
First place the following line before the End Sub of its first function Call Abrir_outlook Then add this second function. Note that I have commented on some fields that may not be useful to you. Sub…
-
2
votes1
answer150
viewsA: function if - true copy cell and glue in another
Really the method passed by Ricardo Pontual in the commentary is easier. But if you really need a VBA, use Sub se_condicao() If Range("F10").Value = Range("O11").Value Then Range("G2").Copy…
-
1
votes2
answers1911
viewsA: 2 commands in the same python line
There are many ways to do it. I think the coolest and most organized is to declare the variables at the beginning, including declaring them in the same line, just as you want to do in print. If I…
-
1
votes1
answer39
viewsA: Git Bash is suggesting saving to removable disk
To set Bash’s start location do the following: Right-click the Git Bash icon and go to properties. In the shortcut tab, field iniciar em: inform the site to be started. But I particularly prefer to…
-
3
votes1
answer60
viewsQ: An app’s background color ratio x energy efficiency
Thinking about a mobile application, which is the best color palette in relation to energy consumption? For example, let’s say I’m developing an app and want to focus on battery consumption.…
-
0
votes1
answer72
viewsQ: Problem with weighted average logic
According to all the sources I have consulted, several to be sure, the weighted average is calculated as follows:: Add up all the values that have the same weight, then multiply this sum by the said…
-
-2
votes2
answers402
viewsA: Strings in python
Hello. I’m going to make the simplest example possible, because I think it makes it easier to understand. Then it’s up to you to step up, take tests and learn more. How to encode string reading from…
-
2
votes2
answers3532
viewsA: Copy rows from a table that match one criterion and paste into another Excel sheet
As you did not give an example of the code I rode this from here with what you went through. Do the tests or check out the logic here and try to apply to your case. Insert the following code into…
-
0
votes1
answer357
viewsA: Excel VBA Advanced Filter Problem
Do a test after changing the range containing the criteria for the data source sheet: change this line CriteriaRange:=Sheets("BD2").Range("A1:C2") for CriteriaRange:=Sheets("BD1").Range("A1:C2")…
-
0
votes1
answer45
viewsQ: Displaying full Fractions result
I am generating number simplifications through the Fractions package. All right until you find numbers where the simplification goes to the maximum, ie reducing one of the terms to "1". When this…
python-3.xasked Evilmaax 2,613 -
0
votes2
answers3992
viewsA: I can’t download pygame
Since I don’t know what method you used, I’ll give you the best two, in my opinion: Automatic method Use the shortcut Ctrl + Alt + S to enter the settings Go on Project: Nome_do_Projeto Click on…
-
7
votes2
answers99
viewsQ: Why split this operation into two cause result changes?
I made a simple algorithm that solved Fibonacci in 2 logical operations within the loop. I decided to look for a better way and found a version that makes in only 1 calculation inside the loop. It…
-
1
votes3
answers1588
viewsA: Python Floating Point Problem 3
While @Pedro’s response was helpful, I found the answer with examples and everything in the OS. Here is the link My code, now working perfectly, was the following to whom it interested: from decimal…
-
1
votes3
answers1588
viewsQ: Python Floating Point Problem 3
I’m writing an algorithm where variable increment float in 0.2, however, after a few increments instead of incrementing 2.2 for 2.4, for example, the program increments to 2.4000000000000004 I’ve…
-
1
votes1
answer2255
viewsA: How to select two tables in mysql?
Dude, your tables aren’t optimized and you’re going to have problems down the road with names, references, etc., like using CPF as a user id in the shopping table. The most appropriate would be to…
-
1
votes1
answer478
viewsQ: Passing string to team
I’m taking 2 strings in the format hh:mm:ss to then calculate the time spent between them in days, hours, minutes and seconds format. I have already split and have all fields separated into their…
-
3
votes1
answer82
viewsQ: How to improve this code
A few days ago I asked for help here in the OS to parse JSON in Java and I got what I wanted, however, I had to do a "gambiarra" by not knowing a better way. It’s working, but I’m sure the code can…
-
-1
votes1
answer151
viewsQ: kill all netbeans processes at the same time
Hello My question is not directly linked to programming, but is related and I believe it will help a lot of people. The problem is this: I am working with server and sockets in Netbeans and every…
-
0
votes2
answers2117
viewsA: How do I change Image via VBA
Good morning Rodolfo The command to call this function in VBA is Application.Dialogs(xlDialogInsertPicture).Show It serves both Powerpoint as Excel and Word.…
-
9
votes5
answers140931
viewsA: How to limit decimal numbers in Python?
In Python 3 has a new feature that makes this task much easier, is the .format() that you will use when printing the result on the screen. To print your comado with only 2 decimal places just do the…
-
1
votes0
answers353
viewsQ: What are hosts on a computer network?
All computers connected in a network are hosts, right? According to Wikipedia the hosts are hardware that communicate with other network nodes, so a router can be considered a host? And what…
-
1
votes1
answer188
viewsA: Doubt Inner Join, left Join mysql
For anyone who might be wanting the answer, I made the solution not with inner or left join, but rather with Union SELECT Nome_livro, count(livro_1) as 'mais retirados' from (select nome_livro,…
-
3
votes1
answer188
viewsQ: Doubt Inner Join, left Join mysql
I am working with the following tables: CREATE TABLE livro ( Id_livro int NOT NULL, Nome_livro CHAR(40) NOT NULL, Pg int, Edicao int, Editora int NOT NULL, Assunto int NOT NULL, Preco decimal (5,2)…
-
2
votes1
answer36
viewsQ: mysql subquerie
Guys I’m with the following structure: CREATE TABLE Cliente ( Id_cliente int NOT NULL, Nome_cliente CHAR(30) NOT NULL, Endereco CHAR(40), Telefone char(12), PRIMARY KEY (Id_cliente) ) Engine=InnoDB;…
-
1
votes1
answer37
viewsQ: Data mask
I am using a Jformattedtextfield with the mask (##:##) for the user to enter an hour and my program to search the database returning the values corresponding to this time. My problem is that in the…
-
0
votes1
answer32
viewsQ: Error searching in Database
My application is integrated to my bank and makes several queries, but in one of them something unexpected is happening, because the search is not performed. Note that my instruction line is simple…
-
2
votes2
answers1192
viewsQ: Maximum value for srand((unsigned)time(NULL);
I was reading about the random numbers not being so random and I saw that one way out was to feed a seed with the srand((unsigned)time(NULL) ); To make tests I generated a vector of 100,000…