Posts by Marlon Bahniuk • 489 points
12 posts
-
3
votes4
answers1138
viewsA: Delete the last line of a txt file
To work with large files this is a possible solution: import os with open('arquivo.txt', 'r+', encoding = "utf-8") as arquivo: # Move o ponteiro (similar a um cursor de um editor de textos) para o…
pythonanswered Marlon Bahniuk 489 -
0
votes1
answer78
viewsA: What to call Named Query in main? JPA
To use the @Namedquery you need to be with all the JPA already configured. If this is the case you can make the call as follows: List results =…
-
3
votes1
answer181
viewsA: How to avoid access to the database?
What are the best ways to protect the database data, and several people have access to the database, but not all should be able to see all the data (specific tables or fields). In a perfect world,…
-
8
votes1
answer7465
viewsA: How to undo the last push done on Github?
How are you trying to rewrite the repository history, which is not a good practice, when doing the push it is necessary to use the flag -f: git push -f But the ideal would be for you to make another…
-
3
votes1
answer105
viewsA: String comparison gone wrong - Python
Your code is correct, the only thing that is wrong is to search for the code. The correct thing would be to do in the same way as you did to search for the product name. Remembering how you are…
-
2
votes1
answer46
viewsA: Java Reflection nested objects
Yes, you can access the attributes of a class through the functions getDeclaredFields() and getType(), and keep repeating until you get where you want. Class pessoaClass = Pessoa.class; Field[]…
-
2
votes3
answers131
viewsA: How to relate questions to a question
Another option would be to make an associative table between User_questions and Question options, indicating which or which are the correct answers(ids) or which are the correct values. This way it…
-
0
votes1
answer113
viewsA: PDO Bindvalue - Array Where
It is not possible to use bindValue to create whole rules, as the query is sent to the server to prepare it and then the values are sent separately. Your array_where is not being "concatenated" with…
-
0
votes2
answers547
viewsA: Update php variable from one page without reloading it through another page form
Only with php, you will not be able to do this. It is not possible for one page to communicate with another directly while on different machines. Even on the same machine, it is not possible through…
-
1
votes1
answer72
viewsA: Paging using PHP
You should start enumerating your pages from scratch(Adding +1 to the display). if to display the button on the previous page you need one more rule not to display when on the first page. The first…
-
0
votes2
answers832
viewsA: Inheritance and polymorphism in python
In function sobrenome is missing the return def sobrenome(self): return super(Sobrenomes, self).nome()
-
0
votes1
answer587
viewsA: What is Quirks Mode and Browser Standards Mode?
In short, the Quirks Mode is a way to emulate the non-standard rendering behaviors of Netscape Navigator 4 and Internet Explorer 5. It has emerged as a way to avoid breaking websites created before…