Posts by Vinicius Macelai • 364 points
15 posts
-
1
votes1
answer87
viewsQ: Algorithm for certain letter combination
I have the following problem, I want to know the combinations of certain letter in the string, example: AAbA Viraria AAbA, AAb, Ab, bA, b I arrived at the following code, but does not contemplate…
-
0
votes1
answer66
viewsQ: Access user data via Django template
I have the user model that I extended from the Django standard class TradingUser(User): avatar = models.ImageField(upload_to='images/', default='images/none.jpg') Only when I try to access this…
-
1
votes1
answer1220
viewsA: Float rounding up in python 3
To round a number up, use python Math’s own library, along with the function Ceil import math print(math.ceil(4000/18)) This will result in 223 Edit: As in the comments there is an extra code should…
-
1
votes1
answer429
viewsQ: Create a table with initial data in Django
I want to create a table with the names/ types of a template, in this case, are documents, I have this template code class Document(models.Model): hash = models.CharField(max_length=256) name =…
-
0
votes0
answers50
viewsQ: Progress bar before function run
I have a certificate issuing page, and it takes some time to create the request and keys, as it is all done in the browser. I want to implement a progress bar so the user doesn’t get the impression…
-
2
votes1
answer108
viewsA: Encrypt URL and reduce PHP encryption size
Your question contains some errors. First that Base64 is not a cryptographic function, it only encodes its contents in 64 characters, there is not necessarily a size reduction. Second as it is only…
-
0
votes2
answers55
viewsQ: Async function returning before result
I have this function in JS, using Forge library, for generating pair of keys. The problem that when trying to use the async function to perform the generation, the function is returning before…
-
1
votes1
answer1180
viewsQ: Docker Database Connection Problem
I migrated my application to a Docker container, it was working all right, until a moment I had to change the bank’s population scripts and recreate the bank, but I had this problem that I do not…
-
0
votes1
answer51
viewsQ: SQL query without repeated element
I have this query in sql SELECT "Certificates"."Email", "Organizations"."CommonName", "Certificates"."Id", "Certificates"."OrganizationId" FROM "Certificates" INNER JOIN "Organizations" ON…
sqlasked Vinicius Macelai 364 -
0
votes1
answer1026
viewsQ: Submit a single div Reload post
I have a form that I want to pass via POST, but without giving Reload on the full page, after sending the information, I wish a div of that Reload in its content, I have the following code:…
-
1
votes1
answer200
viewsA: Indexerror: image index out of range using PIL
The two for are being traversed by nova_height and nova_width, which are the original height and width multiplied by 2, and you are using getPixel to pick up the image pixel at the position. That…
-
4
votes1
answer325
viewsA: How to convert bitcoin to real?
You have to know the bitcoin quotation, I believe it is the variable $bitcoin_price and multiply by the amount of Coins. $total = $bitcoin_price * $amount_bitcoin…
phpanswered Vinicius Macelai 364 -
4
votes1
answer2211
viewsA: Clear string in Python (remove escape characters)
You can use Regex(Regular expressions) to find such words, follow a short example: import re test1 = "31teste123 regex===" test2 = "++++//jamanta+++de+++//pedra++++" def formatString(string):…
pythonanswered Vinicius Macelai 364 -
1
votes2
answers3297
viewsQ: Iterate for with two variables
I have the following code: def hasPalin(string): begin = 0 end = len(string)-1 result = "" while(begin < len(string)/2): if (string[begin] == string[end]): result += string[begin] else: break…
pythonasked Vinicius Macelai 364 -
2
votes2
answers1536
viewsA: function to return the integer number
When you are calling your function back, inside your print, you are not passing the parameter that will be used. There is also an error in your return, your indentation is wrong, this way the second…