Posts by Felipe Avelar • 9,507 points
190 posts
-
25
votes1
answer10051
viewsA: Difference between TLS and SSL protocols
Man, briefly the TLS protocol is an evolution of SSL. How is it possible to remove of this class on TLS and SSL at UFRJ: The differences between SSL and TLS are very small and technical, but they…
-
5
votes1
answer342
viewsA: Python UI - How to Do
There are some modules of python that allow you to make a graphical user interface: The module Tkinter is a widely used option. However if you want something more professional, you can use the Pyqt…
pythonanswered Felipe Avelar 9,507 -
2
votes3
answers640
viewsA: What is the use of nested blocks in Java?
This is mainly used to declare that a variable belongs only to that scope. For example: public class Teste{ public static void main(String[] args){ Teste.imprime(); } public static void imprime(){ {…
javaanswered Felipe Avelar 9,507 -
9
votes3
answers5124
viewsA: Treat python numbers by adding dot
As can be seen in documentation, to use thousands-square formatting using the character ,, the following code is sufficient: '{0:,}'.format(num_int) If you want to modify the , for .:…
pythonanswered Felipe Avelar 9,507 -
2
votes2
answers2696
viewsA: How to run a subprocess with admin permission?
After some time searching the internet, I found in SOEN that answer who basically does what I want. It speaks of a script created by Preston Landers, which executes the runas, proposed by @utluiz…
-
3
votes4
answers1193
viewsA: Color loop in text
What you need to do is change the order of array color each round. Your code should look like this: var deslocamento = 0; setInterval(function() { //Removi os vetores cores e letras para dar uma…
-
6
votes3
answers546
viewsA: Run program inside Try/Catch
How can you tell by reading the end of that Article, the two main arguments are performance and integrity. Performance The first and most obvious reason not to use a try/catch in the entire program…
-
19
votes3
answers36150
viewsA: How to use Mysql on Android
How is it answered here, it is possible to use an online database, in your case Mysql, as long as you have a: Webservice Client Webservice You must make the request in the bank and return a response…
-
9
votes2
answers903
viewsA: Is it possible to upload files without using php, just with jquery?
The answer is yes and no. Yes, it is possible to make one upload system without PHP. And no, it’s not possible to just do with jQuery. What happens is that jQuery is a Javascript that works on the…
-
6
votes3
answers4083
viewsA: Running jar in client from browser
The exec() PHP runs a command server-side, since it is not a language client-side. Running a JAR through the browser To execute a jar in the browser, as you wish, what I would indicate is to use a…
-
4
votes2
answers2696
viewsQ: How to run a subprocess with admin permission?
I’m making a script that accesses the cmd windows, via subprocess. Only I need to rotate the cmd as an administrator. The solution I found, does not satisfy me, which would be to use the runas. What…
-
17
votes8
answers45427
viewsQ: How to disable the scroll of a web page?
I’ve been trying to disable one-page scrolling. All I have found are type solutions: #container{ overflow: hidden; } But that’s just occult scroll bar. How I would disable scrolling, even with it…
-
2
votes2
answers2591
viewsA: How to set the width of columns in a generated Excel spreadsheet as HTML?
As suggested by the @bfavaretto comment, you are just forcing the browser to suggest that the best way to upload a file is with excel. If you want to set the column width this way, you can create a…
-
7
votes3
answers4097
viewsA: How to randomly color Divs with a Javascript Color Array?
I imagine what you want is this: window.onload = function(){ var box = document.getElementsByClassName('box'); var background = ["#f36", "#C3C", "#fc0", "#FC6", "#9C0"]; cor=0; div=0;…
-
3
votes8
answers2292
viewsA: Why create an object using the superclass?
Calm down, let’s go in pieces. Why gives build error? First of all, you can’t access trocaCordas, because musico1 happens to be a drummer when you put musico1 = musico2. What are the advantages of…
-
11
votes11
answers97880
viewsA: Center image vertically within a div
That should solve your problem: div img { display: block; margin-left: auto; margin-right: auto; }
-
101
votes6
answers42802
viewsQ: What is the difference between . on("click", Function() {}) and . click(Function() {})?
I usually use it because I learned it was the more correct, the assignment of events as follows: $('seletor').on('click', function(){}); However, I see many developers using the following syntax:…
jqueryasked Felipe Avelar 9,507 -
2
votes5
answers2130
viewsA: How to add a class to a <li> by clicking on it, leaving only it with this class?
First you must remove the class from any li within the ul: $('#id_ul li').removeClass('minha_classe'); Then you add in li that was clicked the event: $(this).addClass('minha_classe'); this should be…
-
3
votes4
answers775
viewsA: Static service class in web application
It will depend on how you use these classes. But, for this, we will go in parts What does the Static? The keyword static means that, to which it refers, belongs the class and not the instance. Thus,…
-
5
votes5
answers1668
viewsA: How to use a language other than Javascript in your browser?
As cited in that reply, Browsers do not use other languages by default internally. But alternatively, libraries appear in other javascript-based languages and frameworks that generate javascript. A…
-
2
votes1
answer2276
viewsA: Read multiple objects in Java serialized file
Try to read it as follows: while(true){ try{ p = (Produto)leitorObj.readObject(); produtos.add(p); catch(Exception e){ break; } } return produtos; I imagine this should solve your problem. I’m…
-
6
votes1
answer730
viewsQ: Create a method in an involved function
The javascript allows you to create involve functions as can be seen in that SOEN response and in that reply. With the help of these answers I managed to involve a function spy, as in the code…
javascriptasked Felipe Avelar 9,507 -
5
votes2
answers271
viewsA: Can anyone identify the error in that code?
The mistake is in that part: if(tipo == 'anterior'){ sessionStorage.Contar=Number(sessionStorage.Contar)-1; if(sessionStorage.Contar == 0){ sessionStorage.Contar=0; } } the if should be equal to -1…
-
5
votes3
answers784
viewsA: Set the threads priority in C++11
According to that answer the standard C++11 library does not provide standard support for thread priority control. (The author still believes that this will not change in C++14) In the same answer…
-
12
votes5
answers10429
viewsA: How to exchange the value of two variables in Java?
As can be seen here it is impossible to make a method swap, the traditional way (passing the values by reference), in Java, since Java only accepts pass by value. However, several solutions are…
-
5
votes1
answer254
viewsQ: What is a client-side Prepared statement?
I am starting to develop a page using PHP and, as I am still knowing the language, I decided to search which module to use to make the connection to a Mysql database. From of that answer, found that…
-
3
votes4
answers359
viewsA: Difficulty storing object property in Javascript
From what I saw in your code, at no time do you declare the m_oClickCallBack within the scope of MyButton. It is necessary within the MyButtonadd the line: var m_oClickCallBack; For more…
javascriptanswered Felipe Avelar 9,507 -
21
votes8
answers45010
viewsA: What is the difference between C# and ASP.NET?
ASP.NET is a thing and C# is another. ASP.NET is a Microsoft web framework designed to enable developers to create web pages faster and more dynamically. C# is a programming language, also developed…
-
1
votes2
answers319
viewsA: What should Query be to get a tuple result where the value of a column is 'x'?
You can restrict the search value in the query to do this. For example: SELECT nome FROM inscricao WHERE categoria_inscricao = <valor desejado> ORDERBY nome ASC This query will return only the…
-
2
votes2
answers4655
viewsA: How to apply bold to a manually created PDF document text snippet?
EDITION: As explained in the comments, the VB2PDF class, but I’ll leave the example of the library vbPDF if anyone has a question with her. How to bold VB2PDF: As can be seen in the site…
-
2
votes3
answers920
viewsA: Can using non-priminal variable type in C# affect performance?
As you can see in that SOEN response the difference between the types Int32 and int, what we can extend to String and Int64. The only difference is increase in readability in the case of Int32 and…
-
14
votes7
answers10092
viewsA: How to make child form change values in parent form C#?
It is possible to solve your problem by passing the reference from father to son. I imagine you create an instance of this Form daughter inside the Form parent, therefore, it is sufficient to pass…
-
1
votes1
answer243
viewsA: Get an image of the body of an email, write to the database or in memory and show it in a new Viewer
As I proposed in the comments, it seems to be the ideal solution to convert the image to String Base64 and then just unfurl it. Since I’m basing that you’re using C#, my answer will be in C#, if…
-
9
votes4
answers4778
viewsA: How do value types and reference types work in Javascript?
Javascript has a difference between data types yes, despite being a language of weak typing. You can find the types of data that javascript supports here. Therefore, Javascript does not allow the…
-
3
votes1
answer867
viewsA: How to return to "waypoint_order" in the Google Directions API?
I imagine you put the optimizeWaypoints: true, taken from the documentation of the Google Directions API: waypoint_order contains an array indicating the order of any waypoints in the calculated…
-
26
votes6
answers9431
viewsA: When should var be used in Javascript?
What the documentation says? As defined by mozilla documentation: The Scope of a variable declared with var is the enclosing Function or, for variables declared Outside a Function, the global Scope…
javascriptanswered Felipe Avelar 9,507 -
8
votes2
answers1894
viewsA: How to align strings to use in a listview?
Based on the comments, I could understand that what you want is a dynamic Listview. For this, you will need to create a Adapter specifically for this and fill in each row of the ListView with a…
-
4
votes7
answers7922
viewsA: Convert an array of floats to integer
I think an iteration by list already solves your problem without needing the astype. Using list compression it is possible to perform this conversion in a much simpler way: a = [1.1,2.2,3.3] b =…
-
2
votes3
answers9326
viewsA: Is it possible to use Sqlite as client-server?
As you wrote, it is not recommended that Sqlite be used with a server (since it is serveless), but there are a few ways to resolve it: Use the Sqlitening OR You can simulate a client-server…
-
0
votes2
answers313
viewsA: Database on does not reflect changes in the same Activity
Maybe he’s running the SELECT before performing the COMMIT in the database, so it picks up ghost data. When it updates the application the database is "commited" because the application terminates…