Most voted questions
150,413 questions
Sort by count of
-
12
votes1
answer4268
viewsHow to get any kind of cookie using Selenium?
Summary To summarize everything I said here below, I need to open Whatsapp Web read the QR Code and save cookies so that at the next Selenium startup I do not need to read the QR Code again. I found…
-
12
votes1
answer3054
viewsWhat is a pure function?
When studying functional programming, I heard a lot of the term "pure function", or Pure Function. What characterizes this type of function and what is its importance for the functional paradigm?…
function terminology language-independent functional-programmingasked 7 years, 2 months ago vinibrsl 19,711 -
12
votes2
answers312
viewsOptimization of SQL code
How can I optimize the following code to not use 3 Selects and not plaster the query to only 3 status ( SELECT * FROM historico WHERE his_status = 'FRACASSO' ORDER BY his_data DESC LIMIT 50 ) UNION…
-
12
votes3
answers808
viewsHow to calculate the difference between the server time and the user’s computer?
I need to adapt my code to calculate the difference between the server time where the site is hosted and the user’s computer time so as not to overload my system. I am mounting a table where I will…
-
12
votes3
answers1595
viewsIs it bad practice to put numbers as id in HTML elements? If so, why?
I have a loop printing HTML elements, for example: for($i = 0; $i < 3; $i++){ echo "<div id='$i'>$i</div>"; } Is it bad practice to put numbers as id in HTML elements? If yes why?…
-
12
votes3
answers5645
viewsWhat is the purpose of declaring a function within a function?
In Python it is possible to declare a function within another function, as shown in the following code. def foo(palavra=None): print(palavra) def bar(outra_palavra=None): print(outra_palavra) if…
-
12
votes2
answers1007
viewsWhat is Ellipsis in Python?
In the list of native constants from Python, you can find Ellipsis. print(Ellipsis, type(Ellipsis)) #-> (Ellipsis, <type 'ellipsis'>) In Python 3, there is still syntactic sugar ... that…
-
12
votes0
answers192
viewsHow to write programs that support internationalization using cmake?
I am writing a small software in c++ and I would like to be able to translate it into other languages. Looking quickly over the internet the most accepted tool in linux environments is the GNU…
-
12
votes4
answers229
viewsIs overloading methods less performatic?
I was reading about interfaces as part of my studies and came across an overloaded class (overloading) methods, with two comments saying that it should be avoided. I was in doubt about it affecting…
-
12
votes4
answers4874
viewsIs there a programming language in Portuguese? If so, what are they applied to?
As we are used to, "all" programming languages (or almost all, I don’t know) follow the American standard, both in the English language (for, while, if, class, date) how much in date/time and…
-
12
votes3
answers2531
viewsHow to select all columns except one in particular?
There is the possibility to select all columns of a table: SELECT * FROM wp_rw_programacao WHERE id = $id But I need to eliminate the result of the column id. It is possible?…
-
12
votes5
answers357
viewsHow to dim the blue light on a website?
I am developing a website, and would like to dim the blue light (as night mode), however, I have not found a way to do this. Is there any means by CSS, JS or some other language?
-
12
votes3
answers1178
viewsWhat is the difference in use between the Matcher() and find() methods?
I’m trying to understand the difference in the use of these two methods of the class Matcher, but I couldn’t understand it from the description of the documentation that says: public Boolean…
-
12
votes1
answer11212
viewsWhat exactly is a CLI?
From what I understand, there are several CLI’s. Example: Ionic CLI Angular CLI Cordova CLI But what exactly is a CLI? It is possible to use these frameworks without the use of these CLI’s?…
terminologyasked 7 years, 4 months ago viana 27,141 -
12
votes2
answers3744
viewsHow does the "for" inline command work?
I made a question about a Python algorithm, but reply of user Anderson Carlos Woss he used a kind of for inline that I had never seen and that left me confused. Follow the code section corresponding…
-
12
votes3
answers1357
viewsIs it wrong to use multiple cases for the same action on the switch?
It’s wrong to do that with the switch? I programmed like this with him, it’s wrong? switch(estado){ case "AL": case "BA": case "CE": case "MA": case "PB": case "PE": case "PI": case "RN": case "SE":…
-
12
votes4
answers316
viewsIs it bad practice to make this comparison?
To compare two values with a single one, I can do as in the example: if(foo == "abc" || foo == "54") { ... } But as I need to add more conditions, it starts to get complicated: if(foo == "abc" ||…
-
12
votes2
answers1397
viewsDynamic subdomain system
I recently saw an app/site called Sarahah, and an interesting feature was that when registering, the username became a subdomain, something like "usuario1.site.com.br", is there any way to do this…
-
12
votes2
answers6600
viewsWhat is and how to implement a Java Listener?
Although I’ve already asked the Differences between listeners and Adapters in swing and also if Listeners are an Observer implementation?, I would like a more detailed explanation regarding. What…
-
12
votes3
answers172
viewsWhat is the difference in the 3 types of variables and how do they behave in the compiler?
For test questions, I made the following code: static int valor1 = 10 / 5; static int valor2() => 10 / 5; static int valor3 => 10 / 5; public static void Main() {…
-
12
votes4
answers27125
viewsMulti-line selection in VS Code
Is there any way to make multi-line selection in VS Code, the way it is done in Sublime and other IDE’s? I tried the ALTSHIFT + arrow that works in Visual Studio, but instead of selecting multi-line…
visual-studio-codeasked 7 years, 5 months ago Oralista de Sistemas 23,115 -
12
votes1
answer996
viewsEstimate the Poisson - R distribution
I have a grafo and calculated the distribution of degrees and degree as follows: dd <- degree_distribution(graph) d <- degree(graph) From that, I cherished the Power Law, to see if my…
-
12
votes3
answers556
viewsAn image with display:None is loaded? Consume data?
I’m developing a layout responsive and would like to decrease the size of the images according to the resolution. I used the display: none but saw in the inspetor de elementos that it is being…
-
12
votes2
answers670
viewsWhat is it, Prism?
What kind of Prism is that? Is it eating? Or programming? I’ve never heard of it. Tag: prism I don’t want to know everything, but basic information about what this is.…
-
12
votes2
answers129
viewsWhy can’t I declare an attribute as an object?
I have a class A and I’m creating a class B. I want one of the attributes of B is an object of A. Why the notation public $objeto = new A(); is not correct?…
-
12
votes4
answers299
viewsWhat does the "do" function do in Javascript?
I searched a lot and I can’t find the functionality of do in Javascript. Example: function b(a, b) { do a = a[b]; while (a && 1 !== a.nodeType); return a }…
-
12
votes1
answer293
viewsWhat are the best practices with implementation of Dryioc, Fluentvalidation and Lazy?
I’m building an architecture based on the use of Lazy, DryIoc e o FluentValidation. I intend to do all validations with the object. When actually using the object I will instantiate it (Start). I…
-
12
votes2
answers1794
viewsHow to Thread a class method
I need to perform a parallel process using php, I installed the extension pthreads and I looked at some examples but didn’t see how I could implement it. Class: <?php class Negociacao{ /* Retorna…
-
12
votes3
answers329
viewsWhat are "code units"?
I want to know what units of code mean? I saw that term in a reply here at Sopt and I was in doubt. Code units shall be short and have only one responsibility. Link to the question I saw the term…
-
12
votes1
answer3203
viewsWhat are the pillars of object-oriented programming?
In general, I’ve seen some places say that object-oriented programming has 3 fundamental pillars, in others I’ve seen saying that it’s 4 pillars. How many and what are the pillars of object-oriented…
-
12
votes1
answer25845
viewsIn Python we have the switch function?
In Python we have the function switch? wanted to create a program but didn’t want to use many if, and that’s why the function switch help, but I’ve seen several videos Python lessons and no talk of…
-
12
votes2
answers736
views -
12
votes2
answers675
viewsSum of Timespan in C#?
In the sum of two variables of the type Timespan with the language c# I was able to observe that it happens as if it were a mathematical operation of two simple numbers, example: TimeSpan t1 =…
-
12
votes3
answers414
viewsAlgorithm for distributing entries from an encyclopedia based on number of characters per day
I managed a list of entries from an encyclopedia and I want to find the best way to separate the entries so that I choose a number of days and I have a schedule of which entries to read per day.…
algorithmasked 7 years, 8 months ago Filipe Teixeira 502 -
12
votes1
answer3906
viewsJavascript - Difference between `this` and `self`
I would like to understand and help the community with information. What’s the difference in the use of this and self in Javascript? Basically: What? Why use? How to use?…
javascriptasked 7 years, 9 months ago Bruno Heringer 1,338 -
12
votes3
answers425
viewsDifference between '$()' and 'jQuery()'
It is common to see, in codes that use jQuery, references to selectors using the $(). Only I’ve already found codes using jQuery() to make darlings selection. What is the difference between them?…
-
12
votes4
answers11601
viewsSet constant in Python
How can I declare a constant in Python the same way I do in C with #Define PI 3.1415 or in java public final double PI = 3.1415…
-
12
votes1
answer1057
viewsConvert any string to UTF-8 without knowing the original character set
I need a function or class that ensures that data sent from a form (from anywhere in the world) go to the bank in UTF-8 encoding. I tried to, $string = iconv(mb_detect_encoding($text), "UTF-8",…
phpasked 7 years, 10 months ago user60252 -
12
votes3
answers327
viewsQuery to get 1024 sum in maximum 3 transactions
I want to display people’s names (recipient) who received at least 1024 in a maximum of 3 transactions. Here the table "transfers": sender | recipient | date | amount…
mysqlasked 7 years, 10 months ago zwitterion 2,876 -
12
votes1
answer1016
viewsWhat is Python Egg?
Reading a book about Python, the author shows a command in which it is possible to create a Egg and make upload of your package on Pypi (python official package repository). Basically using the…
-
12
votes1
answer1898
viewsWhat is Class Coupling?
I was reading this reply in relation to the design standards relating to Serviceprovider and Servicecontainer, however, the AR Euler01 cited a pattern that mentions class coupling, and it was at…
-
12
votes1
answer605
viewsWhat is required to achieve maximum entropy?
I’ve been studying a little bit about random numbers and hashes, Yet something somehow still confuses me. In several groups related to cryptography I read about people talking about the addiction of…
-
12
votes1
answer751
viewsWhat is the method group?
Coding in C# I ended up making a mistake, perhaps by familiarity with other languages that I usually work, and forgot the parentheses. string.Concat(numero.ToString, "A") I got the following…
-
12
votes3
answers1090
viewsIn programming, what is the actor model?
I have a co-worker who is an advocate of model actor (model of actors, in Portuguese). In general, it seems to be a software architecture to be applied in distributed systems or in the cloud. From…
software-architecture competition microservices actor-modelasked 7 years, 11 months ago Bruno Costa 5,878 -
12
votes3
answers464
viewsShould the checkbox label be on the right or left of the controller?
Usually we put the label to the left of the data entry control. Well, it has layouts but this is a common good. By linearity would be the case of label continue left. But it’s very common to see the…
-
12
votes2
answers319
viewsDocument.getElementById('ID'). func(....) vs ID.func(...)
Yesterday I came across a curious thing, I had no idea you could do it this way. Until now I did it this way: document.getElementById('a').innerHTML = 'CONTENT'; <div id="a"></div> But…
-
12
votes1
answer1922
views -
12
votes2
answers490
viewsWhy is it not recommended to use Defaulttablemodel?
I searched some sites about how to fill a table in java and many suggested to avoid the DefaultTableModel? Why should one avoid using this class for more complex object cases? What does its use…
-
12
votes1
answer218
viewsHow does "free()" know how much memory it has to release?
When we use the malloc() we say how many bytes we need. But free() we do not say. How he knows how much he needs to be released?
-
12
votes1
answer9161
viewsWhat is Segmentation fault?
This error often occurs in code with problems. I don’t see it occurring in other languages. Why does it occur? What does it mean?