Most voted questions
150,413 questions
Sort by count of
-
12
votes1
answer1550
viewsWhy can’t you declare a variable within a case?
Why don’t you compile? #include <stdio.h> int main(void) { int valor = 0; scanf("%d", &valor); switch (valor) { case 0: int variavel = 1; printf("%d", variavel); break; default: int…
-
12
votes1
answer510
viewsHow to generate reports using Nosql?
i own a Message document and in my Nosql database I can have thousands of messages as follows: [{"origem":1,"destinatario":1,"created_at":"2016-12-20","conteudo":"P ligula pellentesque ultrices"},…
nosqlasked 8 years, 1 month ago Emília Parsons 131 -
12
votes6
answers1348
viewsIs there an alternative to system('cls') in PHP Console?
I’m using PHP (5.7) on the console (Windows 10), but I’m not able to clear the screen. I give a system('cls') and only a little square with a question mark appears, without cleaning the screen. I’ve…
-
12
votes1
answer479
viewsIs inheritance a bad practice for all languages?
I took a course in architecture of Java projects and the instructor told me that heritage in Java is considered a bad practice, which should always be avoided and is preferable if possible to use…
oop software-engineering encoding-style inheritanceasked 8 years, 1 month ago Fernando Bittencourt 174 -
12
votes2
answers1960
viewsEmpty delegate ( delegate { } )
What returns the instruction delegate { }? Would be an empty delegate? In which situations would it be necessary to create an empty delegate?
-
12
votes1
answer3396
viewsHow does authentication with digital certificate work?
I want to authenticate via digital certificate in a web application. I have been able to read the data of my digital certificate that is connected to my machine. The question is: "How to…
-
12
votes1
answer148
viewsWhen it comes to Python’s "list", is it wrong to call it an "array"?
In an answer given to a question I asked here on the site, I fixed a user who wrote "array" when referring to a Python "list". I did this because it is a common nomenclature to be used in Python,…
-
12
votes5
answers15940
viewsHow to create a directory in Python?
How can I use Python to create a certain directory? For example: app/ main.py How could I create a directory called temp inside app through Python main.py?…
-
12
votes4
answers3402
viewsHow to detect the operating system with Python?
How can I do in Python to identify which operating system is being used?
-
12
votes2
answers7652
viewsWhat is User Agent Stylesheets?
Studying on CSS I came across the term User Agent, or standard style sheets used by browsers in case of absence of style sheets. What is the User Agent? Each browser has one User Agent? Is there any…
-
12
votes2
answers5293
viewsWhat is an Iterator?
Studying the STL in C++, I almost always come across the term iterator, example: std::vector<int>::iterator it; What is the function of a iterator?…
-
12
votes1
answer3675
viewsWhat is the difference between "dependencies" and "devDependencies"?
What’s the difference between saving a component like "dependencies" or "devDependencies" in the Bower, npm, commiserate among others using this structure ?…
-
12
votes2
answers688
viewsClass copy in C#
In C++ programming to copy one class, to another, just do the following: minhaClasse* class_1 = new minhaClasse(); minhaClasse* class_2 = new minhaClasse(); *class_2 = *class_1; // Faz a atribução…
-
12
votes4
answers549
viewsProblem with polymorphism
I have a polymorphism problem. But before I explain it, I want to make it clear that I’m still learning a lot, so if you want to throw my structure in the garbage, be my guest. I have a project that…
-
12
votes1
answer12831
viewsWhat are the main differences between VB.NET, VB6 and VBA?
What are the main differences between VB.NET, VB6 and VBA?
-
12
votes1
answer4323
viewsWhat is the purpose of the JSON column in MYSQL?
I realized that Mysql has released a new feature, which is the column can have the type JSON (which can even be saved in binary, as I was reading). Documentation: As of Mysql 5.7.8, Mysql Supports a…
-
12
votes2
answers2428
viewsCan I market software that uses a GPL license?
First of all, I must say that I am not making use of a Software under the GPL license, but of a package where the original source code was not changed, and I use only the generated DLL. Let’s say I…
-
12
votes1
answer660
viewsHow to optimize the game Battleship in JAVA?
I don’t know if this is allowed here on the site, so in case I’m breaking any rules let me know! I recently started learning the JAVA language. I made a naval battle game (human x computer) using…
-
12
votes2
answers4433
viewsThe concept of High Order Functions in Javascript
I’m reading Eloquent Javascript to have a javascript base. I was understanding well, since the fundamental does not change in relation to other languages, such as data types (int, string, bool,…
javascriptasked 8 years, 5 months ago wdarking 553 -
12
votes1
answer480
viewsPassing parameters with Asp.Net MVC
In asp.Net MVC. What’s the difference between using ViewBag, ViewData e View Tipada? And when we should use them, there is some specific situation? There is a difference in performance between them?…
-
12
votes2
answers1508
viewsChoice of hash generation method in PHP
My doubt started when I decided to re-examine the method I was using to get the user’s password and store it in the database. After reading that one, that one and that one questions here on the…
-
12
votes3
answers1093
viewsHow to check if at the end of String is one or zero?
How can I check whether at the end of a string is 0? The problem with this code is that the string may contain: jrp_documento.jrp_doc_001fornecedor|0 My need is to check if at the end of the string…
-
12
votes1
answer717
viewsWhat are the main differences and advantages between PHP and Hack languages?
I see that the syntax of both are quite similar, but surely they have their differences, after all they are not one. What are your differences? I’ll put some items I think are important for the…
-
12
votes2
answers965
viewsIs there any way to run a java program (.jar) from a C or C++ program?
I wonder if there’s a way I can write a program .jar, and write a C/C++ program that called the JVM to run the file .jar. Is it possible? If so, can you give me an example of code or an instruction…
-
12
votes2
answers5258
viewsHow to redirect http to https
Well surely there must already be a question very similar to this in stackoverflow. But before they mark it as a duplicate, I have a specification that I haven’t found any "equal" question to this…
-
12
votes3
answers10007
viewsA3 Digital Certificate, e-CPF, how to access information with Javascript
I am having to develop an application, which for security purposes, it is necessary to use an e-CPF by users when trying to log in. I just need to check if the e-CPF number matches the registered…
-
12
votes1
answer191
viewsIs it correct for a method to make the same exception for two different reasons?
I’m practicing TDD simulating an alarm system. Alarm centers work connected to sensors that detect intrusion (opening a door or window, or movement within a room, for example). They have a fixed…
-
12
votes3
answers1771
viewsWhat is the purpose of the magical __clone method?
In PHP we have the magic method __clone. It serves to define a behavior when you clone an object through the keyword clone. So far so good. But I did not understand very well why to have this…
-
12
votes3
answers5760
viewsIs there any equivalent of "$(Document). ready()" with pure Javascript?
In jQuery, we need to use $(document).ready() to know if the document has been loaded and then safely run our jQuery script. According to jQuery documentation A page can’t be manipulated Safely…
javascriptasked 8 years, 7 months ago Wallace Maxters 102,340 -
12
votes2
answers1209
viewsHow to manipulate bit by bit an integer in c or ccs?
I want to change a bit an integer variable in C/CSS for pic. Ex: change some bit to turn another number. 15 = 0b00001111 -> 0b00001101 = 13.…
-
12
votes5
answers259
viewsLogin based on email domain
I’m thinking of a system where only users who have email with domain name empresa.com may register. After registration an email will be sent to validate the email. So far so good, I can easily…
-
12
votes1
answer208
viewsIs there any error suppression mechanism in C# similar to the PHP arroba?
I’m studying C#, but I’m used to programming in PHP. I know that in PHP it is possible to delete some error messages by putting the @ (arroba) at the beginning of the expression. For example, if I…
-
12
votes3
answers1460
viewsArea of intersection of two polygons
How to calculate the area of intersection between two polygons? For example: a = matrix(c(0 ,0 ,2 ,0 ,2 ,2 ,0 , 2, 0, 0), byrow = T, ncol = 2) b = matrix(c(.5, 0 ,1 , 1, 1.5, 0, .5, 0), ncol = 2,…
rasked 8 years, 8 months ago Wagner Jorge 1,377 -
12
votes3
answers5129
viewsWhat is the difference between using single and double quotes in C#?
In PHP, when we use single quotes or double quotes, both forms have the functionality to declare a string. There is only one small difference. I am now starting a study with C#. When I went to try…
-
12
votes1
answer4119
viewsWhat is a multi-paradigm language?
The question title already sums up everything I want to know. Visual Basic . NET, C#, Boo, C++ are multi-paradigm languages. What is a paradigm? And a multi-paradigm language?
-
12
votes1
answer1018
viewsMinify HTML code
It is normal to see minified Javascript files, for performance gain. Today we see some sites that minify everything, including the code itself HTML, as an example east of here. (use the option to…
-
12
votes2
answers815
viewsHow does the logic of Where in the Entity Framework work?
I’m studying C# and I just made my first query in the Database: using System; using System.Data.Entity.Core; using System.ComponentModel.DataAnnotations; using…
-
12
votes1
answer2664
viewsWhat are the characteristics of structured programming?
I would like to know what are the characteristics that define the paradigm of structured programming, and what is the difference of this paradigm with the paradigm of procedural programming? Both…
-
12
votes2
answers381
viewsJava 8 "default method" versus C# "extend method"
Java 8 introduces the concept of "standard method" to allow adding new features to an interface. C# provides "extension methods" that allow "adding" methods(features) to existing types. Taking into…
-
12
votes4
answers1339
viewsEquivalent to Excel SOMASES, in R
I am deepening in R and looking for a function that is equivalent to the sums of excel. I have this following DF: Day.of.Week Hour Quantidade 5 21 5044 3 12 5024 1 11 4725 0 16 4643 1 15 4601 4 14…
rasked 8 years, 10 months ago Felipe Amaral Rodrigues 309 -
12
votes2
answers11304
viewsWhat are the differences between the values "en" and "en-BR" of the lang attribute?
I was unable to notice any difference between both values in the tests. Does anyone know? To help: the first two characters of the value define the Language Code Reference (ISO 639-1) and the last…
-
12
votes1
answer738
viewsWhat is Application Rules and what are the differences with Business Rules?
According to the definition of this website: Business rule is what defines the way to do business, reflecting internal policy, the defined process and/or the basic rules of conduct. That is, it is a…
-
12
votes1
answer3813
viewsWhat is the "application/Ld+json" type for in a <script> tag?
I was looking at the source code of the Kickass page and this excerpt caught my eye: <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "url":…
-
12
votes2
answers3152
viewsWhat is CSRF attack and what damage can it cause?
I’m seeing some people mentioning such attacks CSRF here at Stack Overflow. What I’d like to know is: What is an attack CSRF? How it’s done? What damage can it cause? How can I avoid CSRF attacks?…
-
12
votes2
answers9932
viewsWhat is the difference between . prop() and . attr()?
Do these two jQuery functions do exactly the same thing? Or is there any difference between the same. You are informed that the function .prop() came from jQuery 1.6 She came to replace .attr() ?…
-
12
votes2
answers3664
viewsHow to prevent CSRF attack without PHP frameworks?
I have the following files based on other scripts I tried to study: authenticate.php <?php session_start(); if (isset($_POST['token'], $_POST['login'], $_POST['senha'])) { $token =…
-
12
votes3
answers2210
viewsWhat is the purpose of the builder of an Enum?
In Java constructors are required to create an object in memory, i.e., to instantiate the class that has been defined. Meanwhile, I discovered that a Enum has a builder, but he is not a class, and I…
-
12
votes3
answers2963
viewsHow to measure the complexity of an algorithm?
I need to know if my algorithm meets the demand of the following statement: Implement an algorithm with O(n) complexity that performs the factorial of a number x such that x belongs to Naturals.…
casked 8 years, 11 months ago Murilo Formiga 163 -
12
votes1
answer6364
viewsWhat are the advantages of using object-oriented databases?
What are the advantages and disadvantages of using object-oriented databases in relation to relational databases? What are the most commonly used object-oriented databases?
-
12
votes3
answers307
viewsIs there a difference in performance between "echo" content and HTML content?
The use of echo PHP to display on the screen any content differs in performance to use this same content directly in HTML? For example, if I use a PHP file: <?php echo "<p>Seja bem-vindo ao…