Most voted questions
150,413 questions
Sort by count of
-
31
votes6
answers36799
viewsHow to read a text file in Java?
I have the file called dados.txt and I want to put it on String. For example: String texto = lerArquivo("conteudo.txt"); Question How to write this method lerArquivo()?…
-
31
votes1
answer29273
viewsWhat’s the difference between break, pass and continue in Python?
The Python documentation in Portuguese is a work in progress, and reasonably confusing as you can see. I have difficulties in English and I found that website that I can’t read. So how can I use…
-
31
votes4
answers28968
viewsWhat is the most appropriate way to concatenate strings?
There are different methods for concatenating strings, such as Concatenating with the operator "abc" + str Formatting String.Format("abc{0}", str); Using the Stringbuilder new…
-
30
votes3
answers5657
viewsWhat is the LOCK TABLES command for?
These days I came across a snippet of an SQL that had the command LOCK TABLES. I had never seen this before and, as little as I could see, it seems to me that this would be to lock the table during…
mysqlasked 6 years, 5 months ago Wallace Maxters 102,340 -
30
votes3
answers814
viewsHow and when to build an object in valid state?
Think of a large class, a complete customer registration for example. It has a huge amount of attributes in it. Many of them need to be initialized in the construction of the object in order for the…
-
30
votes1
answer21527
viewsWhat is the function of the X-UA-Compatible meta tag within HTML
Could you tell me the function of this meta tag within an HTML document? <meta http-equiv="X-UA-Compatible" content="ie=edge">
-
30
votes5
answers7016
viewsHow to delete all duplicates except one?
I have a table that has duplicate records. They shouldn’t be duplicated. Some records duplicated two, five and even thirty times by accident. I need to remove these duplicate records, but I need to…
-
30
votes4
answers4172
viewsCreating a CDN - content delivery network
Wikipedia Networked computer system via the Internet, which cooperate transparently to provide content. CDN are usually deployed in multiple locations. Benefits include reducing bandwidth costs,…
-
30
votes2
answers28407
viewsWhat is the difference between unit test and integrated test
What’s the difference between unit test and integrated test, their benefits and examples to each other.
testing software-engineering tdd language-independentasked 8 years, 11 months ago Al Unser Albuquerque 965 -
30
votes1
answer1625
viewsWhen does Stack Overflow occur?
A question that has everything to do with the name of this site. We know that one of the most commonly used examples to demonstrate the execution stack of a program is recursion. A recursive…
-
30
votes2
answers1659
viewsMeaning of terminology: "Object oriented"
What is the correct term for a fully object-based language (C#), and a language that uses objects but is not completely based on them. Example: VB has (had) several functions that were not in…
-
30
votes2
answers1875
viewsCode plagiarism
In the academic world, plagiarism and referencing are taken seriously. And when it comes to our intellectual creation, to what extent would it be plagiarism to copy and paste snippets of another…
licenseasked 9 years, 5 months ago DaviAragao 2,912 -
30
votes2
answers4104
viewsWhen should I use Inheritance, Abstract Class, Interface, or a Trait?
From PHP 5.4 we have the Trait, that "are mechanisms that help (and greatly) the reuse of code, and serve perfectly to solve the problem of lack of multiple inheritance". Example of Abastrata Class…
php interface inheritance abstract-classes traitasked 9 years, 6 months ago Wallace Maxters 102,340 -
30
votes2
answers45293
viewsWhat is a deploy?
Each module of the project has a .war and a .war exploded, What are the functions of this artifacts in this "deploy" process? And what is Jenkins' function in that context? I understand that deploy…
-
30
votes1
answer1075
viewsPolymorphism in procedural language
One of the characteristics of object orientation is polymorphism, the ability of a method to perform different behaviors according to the context that can be defined by a hierarchy…
-
30
votes3
answers1450
viewsRemote control of an Android is technically possible?
Today I saw the following video: https://www.youtube.com/watch?v=9J7GpVQCfms Shows a bracelet that projects the screen of an Android phone paired on the user’s arm. This then can manipulate the cell…
-
30
votes6
answers1117
viewsAlgorithm against Brute-force
I’ve been thinking about an algorithm against attacks like Brute-force which, as we have seen in case of iCloud, can generate great headaches if treated with indifference. Initially I thought of…
-
30
votes3
answers3275
viewsAlgorithm for faster route calculation between two points in parallel Cartesian layers (3D)
I’m working on a solution that involves determining the least effort route between two points in a building. (Imagine students on their first day of university, and they need to know where it is and…
-
30
votes1
answer46121
viewsWhat is a DTO?
I’ve been dealing with Java for a little while and I always hear the expression DTO related to pulling something from a bank, but I never really understood what it is. Is it just a name to reference…
-
30
votes2
answers22530
viewsHow to capture a photo through the user’s webcam and send via POST?
How to perform the user’s webcam image capture procedure on a registration form to submit via POST? I am looking for a solution that is compatible with most browsers and that is simple to implement.…
-
30
votes3
answers8297
viewsWhat are the principles DRY, KISS and YAGNI?
These three principles (DRY, KISS and YAGNI) are widely cited in web. What are they? Who created them? How and where can they be applied?
-
30
votes3
answers13425
viewsWhat is an interpreted language? Is Java interpreted?
In this question here I quote that Java is an interpreted language, because I always understood it that way. But I was corrected in this comment that Java is no longer interpreted. So I got some…
-
30
votes1
answer10018
viewsWhat is the difference between Javabean and POJO?
I’m new to Java, and I have that question. I searched several places on the internet and asked several friends JAVA programmers but none could explain to me clearly what the difference between the…
-
30
votes7
answers46159
viewsRemove repeated elements within a Javascript array
How to remove repeated elements within a Javascript array? I have for example: var array = ['foo', 'bar', 'foo']; And I want to remove all duplicates to get: ['foo', 'bar']…
javascriptasked 10 years, 8 months ago user8789 301 -
30
votes2
answers5203
viewsMethods and properties in C# - advantages and disadvantages
In C# we have properties with getters and setters, which facilitates the insertion and reading of data in an object when some logic should be performed. In other languages, such as Java these tasks…
-
30
votes5
answers21909
viewsHow do I check if an email actually exists?
I made an email field for the user to register, and now I need a system to check if this email exists. I need that when the user type his email a system check if it exists, if it even has this…
-
30
votes4
answers1879
viewsIs it necessary to add prefixes to some CSS properties?
In many codes the browser compatibility prefixes are added in CSS attributes. Example: .exemplo { -webkit-background-size: 50% 50%; -moz-background-size: 50% 50%; -o-background-size: 50% 50%;…
-
30
votes6
answers10949
viewsHow to measure code performance in PHP?
To measure performance and compare two codes in javascript, I do it like this, in the browser console: // Vamos testar o código 1 console.time('teste1'); for (var i = 0; i++ < 10000;) { $('#table…
-
30
votes3
answers2867
viewsCapitalizing on C#names
I have in my application given names in capital letters, for example: "JOSÉ DA SILVA". I would like to format as follows: "José da Silva". How to do?
-
29
votes2
answers539
viewsHow does antivirus scan my program?
I had a class in college that left me "kind of" puzzled, my teacher was talking about the differences of interpreted languages and compiled languages and pointed out that interpreted languages could…
-
29
votes3
answers10675
viewsWhat are Path Parameters in a URI?
What are the path Parameters of a URI and its function? A URI that defines the parameters represents a resource other than the URI that does not have the parameters? This is, /foo;v=1.0 is a…
-
29
votes3
answers1205
viewsWhat are Proxy, Gateway and Tunnel in the HTTP protocol?
In the HTTP protocol specification, more precisely at RFC 7230, provision is made for the possibility of intermediaries between the user agent (UA), the entity that makes the HTTP request, and…
-
29
votes1
answer916
viewsWhy was . NET Core created?
I already know what it is and how to use it, but wanted to understand the goal of Microsoft for its creation. I know I had problems in the . NET Framework, but I don’t really understand why they…
-
29
votes2
answers3910
viewsWhy is it important to inform users of the cookie policy?
I’ve been browsing several websites that in their headers show messages like: This site uses cookies to improve your navigation. By browsing the site you consent to its use. It’s okay that cookies…
cookiesasked 7 years, 6 months ago Felipe Duarte 6,284 -
29
votes2
answers463
viewsWhat’s a loose comparison?
In the documentation of PHP, on the switch says: Note: Note that the switch/case does loose comparison. What is a loose comparison? And what is the difference between a loose comparison and a rigid…
-
29
votes1
answer544
viewsWhat happens in 1...1 in PHP?
On the web I came across the following piece of code: echo 1...1; Resulting in 10.1. I did the var_dump of the same and the return is: string(4) "10.1" Works with variable assignment: $x = 1...1;…
-
29
votes2
answers48751
viewsWhat are Begin, Commit and Rollback transactions?
What are Begin, Commit, and Rollback Transactions? And how to use them? Example in practice will help a lot in understanding.
-
29
votes3
answers8073
viewsHow is the Global Unique Identifier (GUID) generated?
The Global Unique Identifier is generated so that no other will be generated equal, or will almost never have the same number. var unique = Guid.NewGuid().ToString(); Resultado:…
-
29
votes3
answers514
viewsWhat is the purpose of the software development sequence steps?
I was reading the answers to the question When to use Waterfall and when to use Scrum? and came across something cited by the user utluiz which left me with doubt, which is the sequence of software…
-
29
votes2
answers11436
viewsWhat is the difference between Boolean and Boolean?
I performed some tests using Boolean and boolean and apparently returned the same result. See below: Boolean bool = true; boolean bool2 = true; if(bool) Log.wtf(TAG, "Funciona!"); if(bool2)…
-
29
votes7
answers68940
viewsHow to make SELECT with ORDER BY and different criteria?
People can select with 2 "ORDER BY"? Table CATEGORY: If I make a SELECT like this: select id,nome from CATEGORIA ORDER BY nome ASC Mysql returns the names in alphabetical order, but I need it to…
mysqlasked 8 years, 7 months ago Hugo Borges 5,294 -
29
votes1
answer1530
viewsProperty Vs variables
I’ve always used properties in C# this way: public int Numero { get; set; } Today I asked myself, why do I use this get and set instead of a variable? Is there a difference? I only use it that way…
-
29
votes7
answers13486
viewsIs Delphi an IDE or programming language?
Through a question that appeared here What is a programming language, IDE and compiler?, I had a question: Is Delphi an IDE or programming language? I have heard programmers working with Delphi say…
-
29
votes3
answers880
viewsWhat are the security impacts of a site that has an invalid certificate?
Many Brazilian government websites often do not have valid safety certificates. Examples: https://www.ibama.gov.br/ (expired) https://www.ibge.gov.br/ (auto-signed, invalid URL)…
-
29
votes2
answers1063
viewsChallenge of the Ant Colony
I have a programming marathon problem and I want to know if my solution is right, as well as improvement suggestions. Problem A group of ants are really proud because they have built a magnificent…
-
29
votes3
answers15296
viewsWhat is Yield for?
I’ve been writing some for some time scripts with Python, in some tutorials I am sometimes presented with the yield, that normally arises in repeat structures commonly while. What is it for? And how…
-
29
votes1
answer1130
viewsWhen using async and Defer, is the order of the scripts respected?
For a single script, the load/run order in presence or not of attributes async and defer is clear: with nothing, loads and executes immediately, with async loads in parallel and performs at the end…
-
29
votes1
answer1107
viewsWhat is Null Byte Injection? How to avoid it?
What would that be Null Byte Injection? How to avoid it?
-
29
votes3
answers847
viewsDoes merging PHP files into one only increase performance?
I get the impression that every time I execute the command dump-autoload to generate the autoload of the classes via composer, an archive bootstrap/compiled.php is created. Within it, there seems to…
-
29
votes7
answers53067
viewsKnowing if the number is odd or even
I wonder why nothing happens to my code. Even the variable n the alert appears, but then nothing else happens. var n = prompt("Digite um numero"); var total=n/2; if(n/2=0){ alert("Par"); }…
javascriptasked 9 years, 8 months ago larissa castro alves 293