Most voted questions
150,413 questions
Sort by count of
-
29
votes1
answer7393
viewsWhy does Java consume so much memory?
I wrote this little program in Java to download images of a thread in a imageboard: public class FourChanThreadImageDownloader { private static void usage() { System.out.println("java…
-
29
votes1
answer1008
viewsWhen to increment the version using Semantic Versioning?
When using Semantic Versioning we define different versions in the X.Y.Z format being X, Y, Z nonnegative integers. Thus, given an X.Y.Z version: We increment X if a modification incompatible with…
-
29
votes2
answers10012
viewsWhat are Network Sockets and Websockets?
I am studying real-time Node.js programming and I have arisen some doubts regarding network sockets. I found nothing explained in detail, so I decided to open the question. What is a network socket…
-
29
votes5
answers69449
viewsHow to make a regular expression for mobile phone?
How to create a regular expression to validate the phone field you accept 99-99999999 (DDD + 8 numbers) or 99-999999999 (DDD + 9 numbers). And that when typing it add the dash - automatically!…
-
29
votes1
answer22467
viewsMacro to access site with login
I run a daily routine of accessing the Serasa site and make the CNPJ query. I need to develop a macro to access this Serasa site, log in and then query, and then play the information in Excel.…
-
29
votes1
answer12710
viewsHow to read from stdin in C?
How should I read characters, digits and strings stdin? getchar; fgetc; fgets; getc; scanf; I’m here trying to read from the console and there’s always something wrong with reading it. I have tried…
-
29
votes3
answers660
viewsShould we validate function parameters?
In languages like Java, method parameters are "validated" in the build (at least the type): public void facaAlgo(String str) { // ... } // em algum outro lugar: int i = 2; this.facaAlgo(i); // erro…
-
29
votes2
answers17231
viewsCan Visual Studio Community be used in commercial projects?
I read this week that there is now an edition of VS called Visual Studio Community. Already has the 2013 version to download and will have the 2015 as soon as it comes out. From what I was reading,…
-
29
votes1
answer10807
viewsWhen and how to implement Parcelable vs Serializable?
After a long time using the Serializable implementation in my classes on the Java platform (Android), I discovered Parcelable, but I was in doubt regarding the following questions below: 1. When to…
-
29
votes2
answers12489
views -
29
votes2
answers13485
viewsComposer - Autoload and PSR-0 vs PSR-4
I’m starting to study Composer and am developing a system where I separate files from the core of the application files, as follows: / root |-- /src |-- /App |-- /DBConfig |-- /Controller |-- /Model…
-
29
votes3
answers1131
viewsString and its efficiency
Doubt I would like to know what design patterns or other "nerdy" things have been applied to this class StringBuffer. Why does String create new objects in a concatenation? As far as I know, String…
-
29
votes3
answers19104
viewsUnderstanding threads in C#
I’m trying to figure out how to use Tasks and asynchronous methods in C#, but every place I see about it in internet mentions a "usual multithreading" form that would be different from the use of…
-
29
votes3
answers5730
viewsWhen should we declare a method static?
As a general rule, it is considered bad programming practice to use static methods. But in what situations it is justified (or not justified)? For example: if I were to create a simple method to…
-
29
votes3
answers10218
viewsHow to create a real-time notification system similar to Stack Overflow?
I am developing a Help Desk system, and would like some ideas on how to create a notification system similar to Stack Overflow itself, whenever some new support is registered. I intend to use PHP,…
-
29
votes9
answers30430
viewsHow to debug code in PHP?
For example, in javascript we have the console.log to debug, find out where the bugs are, etc. And in PHP, which ones would be best manners?
-
29
votes8
answers95476
viewsHow to check with jQuery if there is a checkbox checked?
I would like to know which Checkbox is checked with Jquery. To catch all the checks I made the following code var checado=false; $(obj).find("input[name='analisar']").each(function(){…
-
29
votes7
answers9251
viewsIn C#, what is the await keyword for?
I was studying this documentation about Asp.net Identity, and in the examples in C# has a keyword that I don’t know, which is the await, example : [HttpPost] [AllowAnonymous]…
-
29
votes6
answers66760
views"foreach" in Javascript
By way of example, in PHP we have the function foreach() (English) which allows us to execute a certain code for each element found in a matrix: <?php $arr = array(1, 2, 3, 4, 5, 6); foreach…
-
29
votes3
answers4056
viewsHow to get the value of the current percentage of an upload?
I’m working with PHP, but I imagine it can be done only with javascript/jQuery. When I upload the browser shows the percentage in the status bar. I would like to take this value and create from it a…
-
29
votes3
answers13164
viewsWhat are the default sizes of android images?
I’m creating my first app on the Android platform and as far as I know one of the negatives of this platform is that existing devices on the market have different screen sizes. I created a project…
-
28
votes6
answers4346
viewsWhat is the difference between attribute and field in the classes?
When I am studying object-oriented programming, at times I hear about fields and attributes of a class, but the two seem to be different definitions to refer to the same thing. What’s the…
-
28
votes2
answers2065
viewsWhat is "positive zero" and "negative zero" in float and double types?
In response of this link the operation of the atan2(), and its translation of documentation by Victor Stafusa, there are some excerpts that I highlight below: (...) If the first argument is positive…
-
28
votes4
answers1037
viewsWhat is reverse proxy?
When I was setting up the PHP FPM (PHP module that allows the use of Fastcgi), I stumbled on the term Reverse Proxy when I was researching some tutorials on how to set it up in Apache 2. Example…
terminologyasked 7 years, 4 months ago Wallace Maxters 102,340 -
28
votes1
answer1203
viewsWhat is an opaque value?
Sometimes I see in documentation or specifications that a certain value, in general, string, can, or should, be considered opaque. What does this really mean? What are the characteristics that…
-
28
votes3
answers466
viewsComments weigh in?
Comments weigh? I leave comments throughout my code, will influence something on the site? I’m saying more specifically in HTML, CSS, Javascript, PHP.
-
28
votes5
answers2672
viewsWhat is the </datalist> tag for?
When I was using Sublime Text to edit a file html, I realized that he suggested a tag with the name of datalist. I had never seen about this tag before, but it seems that really exists. As I did not…
-
28
votes6
answers1694
viewsWhy not use a Boolean parameter?
I’ve seen in some places you shouldn’t wear something like this: int teste(object obj, bool especial) { ... } There within the function some operation will be done or not, depending on what you…
function encoding-style software-engineering parameters booleanasked 7 years, 11 months ago Maniero 444,682 -
28
votes3
answers38239
viewsHow to change the language of Visual Studio 2017?
If you follow the step by step installation of Visual Studio 2017, it installs the operating system language. How to change language to English?
-
28
votes2
answers3404
viewsHow do I migrate from Date and Calendar to the new Java 8 Date API?
Until Java 7, we had the classes Date and Calendar to represent dates. To convert them to Strings, the easiest way was with the use of SimpleDateFormat. Java 8 has introduced a new date API. How can…
-
28
votes2
answers1906
viewsWhat is the View in the MVC standard?
I started in 2016 to wear pattern MVC, the concept of Model and Controller I fully understand, but the question of View intrigue me. What is the View on a model MVC? I know that’s what the customer…
-
28
votes1
answer1626
viewsWhat is Flyweight Pattern?
Researching a little to better understand the logic that leads strings in Java to be immutable, I found out that "internment" of Strings is an example of the pattern Flyweight. In accordance with…
pattern-design software-engineering memory-management immutability flyweightasked 8 years, 3 months ago Anthony Accioly 20,516 -
28
votes5
answers1775
viewsWhy is it bad practice to have int attributes?
I saw in the answer to that question /questions/17015/qual-o-uso-de-uma-variável-estática-ou-final-em-java/17136#17136, that: It is bad practice to have int attributes, unless they are "constant" or…
-
28
votes4
answers1189
viewsHow does a search engine work?
I am making it clear that I am not asking how to make my site appear better in the search index. Today we have several search engines. Some very well known as Google and Bing and others not so much,…
-
28
votes3
answers17504
viewsWhat is the purpose of Transient and Volatile in Java?
Sometimes when I declare my attributes I notice the transient and the volatile. I have the following doubts The transient and volatile are access modifiers? What is the purpose of using them?…
-
28
votes2
answers8284
viewsWhat does the REGEX shortcut mean?
I see a lot of people wearing \s in regex thinking its meaning is ' ' (space) because I tell you, it’s not, at least not only that. But then what does the \s in REGEX?…
-
28
votes1
answer9577
viewsWhat’s a greedy algorithm?
What is an Algorithm Greedy ? What are its characteristics ? What are its advantages and disadvantages ?
-
28
votes1
answer3003
viewsHow does the Repository standard work?
I was doing a study on a framework in PHP called Symfony. When I was studying about the database research, I realized that there are some differences in relation to the searches, as in frameworks as…
database oop pattern-design software-engineering repositoryasked 9 years, 2 months ago Wallace Maxters 102,340 -
28
votes3
answers619
viewsTimestamp limit January 19, 2038
How to fix this bug? echo date('c', mktime(1, 2, 3, 4, 5, 2038)); Upshot 1970-01-01T00:00:00+00:00
-
28
votes2
answers1630
viewsWhat does the + sign in CSS mean?
For example: .input__field--minoru:focus + .input__label--minoru::after { } I’m having an effect here, but I don’t understand this sign + you have in the framework. Final Result…
-
28
votes4
answers62720
viewsHow to style a "file" input?
I have this structure: <section id="cadastro" class="cadastroVersao pg-i"> <div class="titulo"> <h1><i class="icon-clientes"></i>Cadastro de versão</h1> <a…
-
28
votes2
answers3688
viewsWhat are the advantages and disadvantages of minifying Javascript scripts?
And which mini-guards can I use?
-
28
votes2
answers12475
viewsWhat is the Antiforgerytoken?
What is the AntiForgeryToken and what it serves as in an ASP.NET MVC application?
-
28
votes2
answers16435
viewsWhat are the out and ref parameters
What is the use of parameter types ref and out of a method in C#? What is the difference between the two? Some example of each one’s use.
-
28
votes6
answers2843
viewsWhat is the correct term to call someone who makes HTML code?
HTML - Hipertext Markup Language We all know that HTML is a text markup language and not programming, but what would be the correct term to call someone who is writing in HTML? Could we say that he…
-
28
votes1
answer39248
viewsHow do I undo a "git add" before a commit?
I added by mistake arquivos using the command git add and I haven’t executed one yet git commit. There is a way to undo or remove these files from the commit?…
gitasked 9 years, 9 months ago Paulo Costa 3,976 -
28
votes4
answers35105
viewsUse of ? and : in PHP
Can you explain to me what it’s for ? and : in PHP? For example in this case: public function url_format($post,$extra=FALSE) { $title = isset($post->post_title) ? $post->post_title :…
-
28
votes2
answers13710
viewsWhat codes does the Central Bank currency listing webservice accept?
I had to develop a routine that would take the sale price of the dollar and insert it into a table in the bank. The central bank provides a webservice where it is possible to make the queries. For…
web-serviceasked 9 years, 11 months ago Tiago Crizanto 1,192 -
28
votes2
answers1891
viewsHow to design a basic socket client application
First of all I apologise for the long text, and for the various points raised. I thought it best to cast everyone on a question just because they are interrelated and because I think anyone with…
-
28
votes7
answers33990
viewsHow do SELECT all fields except a few?
It is known (and has been asked) which should be avoided SELECT * in some cases in bank queries. But let’s imagine that I have a table with 50 columns, and I want to select 40 of them. Just the fact…