Most voted questions
150,413 questions
Sort by count of
-
10
votes2
answers2220
viewsWhat is the difference between Docker-Compose and Dockerfile?
What is the difference between Docker-Compose and Dockerfile, specifically? Docker-Compose uses Dockerfile or vice versa? Can I make every configuration with just one of them? If so, which?…
-
10
votes2
answers171
viewsBesides structures like "for", "while", "goto" or recursion, is there any other way to repeat something in the programming?
In structured programming, we have structures as links for, while and similar structures, in addition to goto, that allow us to realize repetitions. In functional programming, recursion is used to…
-
10
votes2
answers85
views"this" within object properties
In the code below, the first console.log(this) returns the object example (so far so good). The second console.log(this) returns the object window. Why does this happen? Why, even inside an object,…
-
10
votes3
answers598
viewsWhat is the difference between keys and parentheses in an Arrow Function in Javascript?
What is the relevant difference between keys ({ }) and parentheses (( )) in a return of a function? const example = () => ( ... ); Versus: const example = () => { ... };…
javascript function characteristic-language syntax arrow-functionsasked 4 years, 11 months ago novic 35,673 -
10
votes1
answer130
viewsFunctionality of ":" in C#
Recently I was developing a C# application with Visual Studio and I came across a somewhat unusual situation: public void Upload(object model) { FOO: var text = "teste"; } In the code, FOO: does not…
-
10
votes1
answer231
viewsHow to use IBM Cloud services with POST request in Python?
I am trying to use IBM Cloud’s "Speech To Text" service in my Python application via POST requests with the package requests. The problem is that I am confused about the URL that should be used and…
-
10
votes2
answers6959
viewsWhat is the difference between npm and npx?
I am studying React Activate and noticed that many places use the command: npx react-native run-android Why can’t I use the following command? npm react-native run-android And what’s the difference…
-
10
votes2
answers158
viewsWhat happens to memory when "realloc()" reallocates a memory block to a value less than the original?
Suppose I allot a dynamic matrix of 10 ints and assign some values values to it, then I use the function realloc() to reallocate the matrix to 3 ints, what happens to the other 7 ints, they will be…
-
10
votes3
answers603
viewsWhy is it allowed to delete elements from an array defined as const?
Assuming I have set an array to const: const array = [1,2,3] Why is it possible for one of these elements to be removed? This would not be a way to reassign the array? It’s possible I’ll make one:…
-
10
votes2
answers586
viewsWhat does #noqa in Python mean?
Sometimes I find this comment in some Python code: #noqa. What does it mean? It’s specific to Python?
-
10
votes1
answer1426
viewsOn Github, what’s the difference between a project and a repository?
On Github, I saw that I can create a repository, but I can also create a project. What’s the difference between one and the other? When should I create a project instead of a repository and vice…
githubasked 5 years ago emanoellucas 886 -
10
votes3
answers2440
viewsWould the HTTP 418 "I’m a Teapot" response be valid?
A certain API is returning me a status 418 I'm a teapot, I saw that it is part of the protocol HTCPCP. ;,' _o_ ;:;' ,-.'---`.__ ; ((j`=====',-' `-\ / `-=-' The use of this status can be considered…
http-statusasked 5 years ago Homer Simpson 3,001 -
10
votes4
answers985
viewsCompare string with array to return the most compatible item
How to compare to string with the array and return whatever has more compatible words? Example: string = "uma frase qualquer aqui" array = ["frase qualquer", "uma qualquer aqui", "nada compatível"]…
-
10
votes1
answer169
viewsWhat is formal documentation?
On the website of W3schools they mention the expression "formal documentation". It is Most common to use single line comments. Block comments are often used for formal Documentation. What is a…
-
10
votes2
answers197
viewsWhen to use Lazy<> from C#
Where is a good scenario to use the initializer Lazy<> of the C#? I ask this because I understand the concept behind the Lazy loading (delay the instance of an object to only when it is…
-
10
votes2
answers216
viewsWhat are the correct tools to debug Javascript code for viewing in the Browser?
Recently, looking at a question here from Stackoverflow, I noticed a user comment that said console log. and the Alert were not correct ways to debug Javascript codes. This question left me…
-
10
votes2
answers210
viewsHow does an "if" work internally?
The if is widely used in programming, and he plays several important roles in a programmer’s everyday life. The code seems to magically run if an expression is passed in the if is true, otherwise…
if characteristic-language compilation language-independentasked 5 years, 2 months ago NinjaTroll 1,752 -
10
votes2
answers219
viewsWhy do we use a "get" before declaring a function in Angular?
Why do we use a get before declaring a function in Angular or Javascript? That’s an Angular practice? get funcaoExemplo() { return this.exemplo.length === (this.exemplo2 + 1); }…
-
10
votes4
answers94
viewsHow do I make the CSS class not affect anyone who has a particular class?
I have a ul where it is a menu in which items that are not inside a ul son have the tag dropdown-toggle. The items that are in ul son doesn’t have that tag. The class .navbar-solid is applied to…
-
10
votes2
answers5589
viewsWhy should we use PHP_EOL?
I’ve been informed that PHP_EOL sets the end of the line, ok. But why should I write. echo 'a'.'<br>'.PHP_EOL; echo 'b'; If the echo 'a'.'<br>'; echo 'b'; It has the same effect, what…
-
10
votes1
answer1792
viewsWhat’s the difference between "Big O", "Big Theta" and "Big Omega"?
What use are each of these "Big O", "Big Theta" and "Big Omega" and when to use each to describe the complexity of an algorithm?
-
10
votes1
answer2963
viewsHow to get the original branch?
Whenever I create a branch X, I create it from another. How to know which branch I created the branch from X?
gitasked 5 years, 4 months ago Octavio Augusto 101 -
10
votes2
answers217
viewsWhy does this if check "if it’s ! false" instead of "if it’s true"?
I came across this piece of code: function showPrimes(n) { for (let i = 2; i < n; i++) { if (!isPrime(i)) continue; alert(i); // a prime } } function isPrime(n) { for (let i = 2; i < n; i++) {…
-
10
votes1
answer125
viewsWhat is the latest and stable version of HTTP?
I would like to know the latest version of HTTP and the most stable and used version of it.
httpasked 5 years, 5 months ago Samuel Cavalcanti 127 -
10
votes4
answers5082
viewsWhat does /= mean in Python?
Can anyone tell me what //= means in python? On line 8 of this code has the use of it. n = int(input("Digite um numero menor que 10: ")) aux, reverso = n, 0 while aux != 0: dig = aux%10 reverso =…
-
10
votes3
answers727
viewsWhat is the difference between client-server and three-tiers?
In the chapter of Software Design (SWEBOK) when talking about architecture styles are cited client-server and three-tiers: Various Authors have identified a number of major architectural Styles:…
-
10
votes4
answers333
viewsHow to manipulate these objects with Javascript?
I have the following objects: { letter: "A", num1: "1", num2: "2", num3: "3" } { letter: "B", num1: "3", num2: "2", num3: "1" } { letter: "C", num1: "2", num2: "3", num3: "1" } I would like to…
-
10
votes1
answer4230
viewsWhat is the difference between export and export default?
What is the difference between using the reserved word export and export default. For example: export class Helper { } export default class Helper { }…
-
10
votes2
answers908
viewsCapitalize Javascript text, ignoring abbreviations
I have a Javascript code to capitalize text that treats some exceptions. However, I would like to address a few more, such as ignoring abbreviations, which would be to have a point before or after…
-
10
votes2
answers785
viewsHow to check if an XML file is valid with PHP?
As I understand the answers of this question from the OS, the XMLReader::isValid() checks "only the current node, not the whole document". What does that mean? In case I want to validate if xml is…
-
10
votes2
answers73
viewsOn the implementation of some() and Every()
I’m trying to understand how the implementation of some() and every(), but I did not understand very well the two implementation algorithms. some(): Array.prototype.mySome = function(callback,…
-
10
votes3
answers184
viewsDifferences in the method call
Why some methods can be called consecutively, example: string a = ""; a.Replace("a", "b").Replace("b","c");// o replace foi chamado 2x And others cannot be called the same? ClasseA A = new…
c#asked 5 years, 7 months ago Marceloawq 971 -
10
votes2
answers1147
viewsShould I declare a variable within the "if" or separate condition?
I need to call a function that can return false or a value, and in case it returns the precise value manipulate it. So I made a code similar to the one below: //A função que é chamada é muito mais…
-
10
votes1
answer752
viewsWhy doesn’t CORS block Postman and derivatives?
I am creating a Restful API with Nodejs and express and in it, I am using Cors to "control" requests. In the browser works, if I make a request to this API by the console of the site here of…
-
10
votes1
answer1138
viewsWhy does Bootstrap 4 use "rem" and "em" instead of pixels?
As you can see here and here, Bootstrap 4 uses the drives rem and em instead of using in px. Code snippet using the unit rem: $display1-size: 6rem !default; $display2-size: 5.5rem !default;…
-
10
votes3
answers685
viewsPrevent the CMD command interpreter from using the operators passed via parameter/argument?
There is a way to prevent operators present in past arguments, via command line, from being used/interpreted by the interpreter CMD in C, C++ or C#? I want to make use of characters present in the…
-
10
votes2
answers1395
viewsHow do I allow only certain applications to access my API?
I am developing an API using Express, which should be used only by an application in the browser, built using React and an application, made using React Native. The question is: how can I restrict…
-
10
votes5
answers9012
viewsHow to replace more than one character in the replace method in Python 3?
I have the text and need to remove all punctuation marks using just one method replace(), without using tie as well. My initial idea would be to use texto.replace('.', ''), this for each type of…
-
10
votes1
answer177
viewsWhat is Type Annotation?
I’m reading a book about Typescript and I came across something that caught my attention which is the Type Annotation. Take the example: function foo(): { a: number, b?: number } { if (this.a <=…
-
10
votes2
answers124
viewsHow to read the Git help manual?
I’m trying to learn more about Git and I’m bumping into a basic question, I don’t know how to read the manual. I understand some things, but I’m not sure yet what the symbols are used for: [],…
-
10
votes1
answer114
viewsWhy is 16 equal to 020 in Javascript?
I was comparing CPF’s when I got the following expression: if(16 == 020){ console.log(true) }else{ console.log(false) } The result of this expression is true, I’d like to understand why.…
-
10
votes1
answer382
viewsWhat is and what is a Bloom Filter for?
I was reading an answer here at Sopt (yes, it’s funny) and I saw about Bloom Filter, I wanted more information about him. Besides what it is and what it’s for, where I can use in practice?…
-
10
votes2
answers108
viewsHow to order a select 1 to 255?
Personal I have a query of a table with Ips numbers from 1 to 255 of various ranges. When I do SELECT IPS FROM ipvalidos WHERE REDE ='{$rede}' ORDER BY IPS It selects from 10.0.0.100 before…
-
10
votes2
answers2429
viewsWhat is the logic behind the "days * 24* 60* 60* 1000"?
Reading some things about cookies, always observe the calculation dias * 24* 60* 60* 1000 What is the logical reasoning behind this?
-
10
votes4
answers401
viewsSkipping route due to poorly formatted parameter is a syntax error?
For example, I have the route GET: /user/{id}, id passes a regular expression validation of type [0-9]+. When performing requests with the verb GET for the following Urls: /user/17, returns user…
-
10
votes1
answer272
viewsComparison: CTE vs CURSOR
I do not know if this is a question that many ask, but I have always had it in mind almost always. Usually, when I need to deliver a script corrective to a customer, used only to be executed once, I…
-
10
votes1
answer194
viewsWhat is the difference between Media Query Pointer and Any-Pointer?
I was seeing a way to determine if the user access is done by a Desktop, usually having a mouse as an interaction device. Or if the user is accessing via a mobile device, usually without the mouse…
-
10
votes2
answers4144
viewsDifference between _Blank/_self and Blank/self
I wonder if there is any recommendation in the use of Html attributes target with or without the _ before the value, I see that it’s kind of standard to use it with _, but if it is absent the…
-
10
votes1
answer766
viewsTo learn C++ is it necessary to learn C?
In case I want to learn about C++ I need to learn C before or they are different?
-
10
votes1
answer328
viewsHow to analyze the performance impact of a code snippet in ADVPL?
I have the following code in ADVPL: Static Function linhaJson(cTabela, cChave, lVerificaExclusao) local cTipo local xResult local cJson := "{" dbSelectArea("ZX1") ZX1->(dbSetOrder(1))…