Most voted questions
150,413 questions
Sort by count of
-
8
votes2
answers2073
viewsFind the largest and smallest element of a matrix
I have the following code: def processa(matriz): print('----- Matriz Lida -----') for i in range(len(matriz)): for j in range(len(matriz[0])): print(matriz[i][j].center(6), end=' ') print() return…
-
8
votes2
answers3945
viewsJavascript usage of ${variable}
I was reading this article on AJAX when I came across this way of using a variable inside a string: let cep = document.getElementById('cep').value;…
-
8
votes3
answers259
viewsNegative lookbehind only works on Google Chrome, is there an alternative to other browsers?
The regex /(?<!,),(?!,)/ has instability in some versions of browsers. I found this regex in the system of the company I work, and I didn’t understand very well the purpose of it. Apparently the…
-
8
votes3
answers223
viewsHow to simplify a problem to get the names of the months of the year?
I am beginning to program in C and I realized this problem whose statement is the following: Write an exercise that asks the user for a one-month number and prints the name of the month on the…
-
8
votes3
answers931
viewsHow to query with Count
I have the table Upshot with thousands of data, Table Result NOME_CASA, NOME_OPONENTE, RESULTADO_FINAL, NOTA_FINAL. timeAzul timePreto 1 2 timeAzul timeBranco 2 2.10 timeBranco timeAzul 3 2.20…
-
8
votes2
answers828
viewsParametric polymorphism and overload in Java and C++
The following question fell in IFSP’s tender procedure: In Java and C++ programming languages, parametric polymorphism is materialized, respectively, by the functionalities and/or characteristics:…
-
8
votes3
answers229
viewsWhy is an anonymous function seen as an object in PHP?
$f = function() { echo "OK"; }; echo gettype($f); Returns Object when theoretically looking was to return function. - In JS: var f = function() {}; typeof f; Returns function.…
-
8
votes2
answers1800
viewsIn which table is the foreign key in a ratio 1 to 1?
In an SQL relationship of two tables 1 to 1, there is some rule that defines which table the foreign key will be in?
-
8
votes1
answer450
viewsWhat is considered primitive in a programming language?
What is considered primitive in a programming language? Only the types or other language resources are also primitive?
-
8
votes1
answer116
viewsResolve/Reject play role in javascript?
As mentioned in the title, the resolve and Reject of a Promise already "make paper" of Return or yes (depending on the occasion) I need to use the Return? Explaining with code, I could do these two…
-
8
votes1
answer177
viewsWhat are the standardization phases of a CSS property?
Sometimes I search the site Can I Use browser compatibility of some CSS properties and some acronyms, such as: LS, WD, ED, CR etc., such as property clip-path show me the acronym CR: I did some…
-
8
votes1
answer1603
viewsFormat percentage in python
How should I format the percentage for this example? import pandas as pd flights = pd.read_csv('data/flights_until_june.csv', sep=',') sum_null = flights.isnull().sum()…
-
8
votes1
answer641
viewsWhat is a reference location?
There are several answers here that talk about locality of reference, but do not explain what is. Where it is applied? And why it’s so important for data structures and algorithms?…
-
8
votes1
answer2652
viewsCommand "TRIM" SQL Server
I’m working with Sql Server, and I need to make a trim as a result of a consultation. I did it this way: select TRIM(NUMERO) from ENDERECO In the Sql Server Management the command is "recognized",…
-
8
votes2
answers164
viewsRemove all Environment elements containing numbers and uppercase letters
Consider the objects: vectorA<-1:10 vectorU<-1:10 vector<-1:10 vector1<-1:10 vector86<-1:10 How to remove objects containing numbers? How to remove objects containing uppercase…
-
8
votes1
answer329
viewsImporting the java.lang. package*
Adding the studies in Java I came across a package so much that special, the java.lang, where the author of the book mentions that we do not need to perform the import of that package. There’s a…
-
8
votes3
answers971
viewsLine with NULL value is disregarded by the SUM function?
I participated in the IFNMG competition, a test prepared by the CEFET Foundation. I solved the following question and marked the letter C, but the feedback says that the correct is the letter A.…
-
8
votes1
answer280
views"#define" defines a global variable?
I’ve always used a few definebut now this doubt has arisen, when I use a #define am I creating a global variable? Is there any harm in this use? Example: make program to read 10 numbers: I put in…
casked 5 years, 10 months ago Vitor Gonçalves 552 -
8
votes2
answers174
viewsHow to do with CSS Downloader bar with animated background?
I saw this element that actually works as a "Loader" while the image is loading etc. And I tried to replicate it. Not the dynamics to function as a Loader, but yes this effect of the passing lines…
-
8
votes2
answers666
viewsOnly with CSS is there any way to make a "Toast"? An element that goes up and then click to close it?
In mobile there is a very common component that is known as "Toast", but I kept thinking about how to adapt it only with HTML and CSS Is there any way to do something like this "component" above…
-
8
votes2
answers555
viewsCommand SQL PARTITION BY?
I am reading and it was not very clear the command PARTITION BY in the creation of tables in structured databases (SQL), a basic example: CREATE TABLE employees ( id INT NOT NULL AUTO_INCREMENT…
-
8
votes2
answers12531
viewsCheck for special characters in a string using Regexp
I need to validate a password field that must contain at least one special character. Is there any Regexp expression to do this check? E.g. var patt = [a-z]; // verifica a existência de letras…
-
8
votes2
answers144
viewsPrint the result of a for JS inside a <p>
I’m doing a college paper that consists of making a tabuada generator. It’s working perfectly when I use it console.log to show the result, but when I use .innerHTML = resultado to display in a tag…
-
8
votes1
answer725
viewsDifference between Hashmap and Treemap
What are the main differences between HashMap and TreeMap? Regarding use, in which situations it is recommended to use each one?
-
8
votes2
answers1618
viewsHow to go through string and replace ** with <b></b>
Lately I have used some systems that have the following function, when writing a text between ** it turns this text into bold for example: Julio *Enrique* dos Santos expected result will be: Julio…
-
8
votes5
answers2803
viewsHow to make CSS a paragraph with Capitular letter (Drop Caps)
I would like to style only the first letter of each paragraph of my text, but I don’t want to have to separate that letter with a <span>, because I want to keep the correct semantics of the…
-
8
votes2
answers4064
viewsChange title style within a tag
You can change the style only with CSS from the attribute title that some HTML tags have? <a href="#" title="Alterar esse estilo aqui">Passe o mouse</a> Note that by default it has only…
-
8
votes3
answers1297
viewsHow to have more than one Edge in an Element with CSS
I have one element, but I wanted it to have several edges. I didn’t want to have to use several divs for this... I wanted something around 10 to 8 edges. Is there any more practical way to put more…
-
8
votes0
answers160
viewsWhat is the difference between text() and html()?
What’s the difference between text() and html()? $("#div").html('<a href="example.html">Link</a><b>hello</b>'); vs $("#div").text('<a…
-
8
votes2
answers112
viewsAbstract methods do not require implementation
I am doing a job and implemented an abstract method, the case makes a class inherit this, but the compiler does not accuse error for the lack of implementation of the methods. I’m doing it wrong?…
-
8
votes2
answers1771
viewsTurn columns into rows
I have the following structure: http://sqlfiddle.com/#! 9/738aa6/1 CREATE TABLE Viagem ( Idasemvolta int, Idacomvolta int ); INSERT INTO Viagem VALUES (64, 39) With the following select: select…
-
8
votes1
answer62
viewsDo exceptions cause problems for performance?
When working in an application whose performance is important, NO USE of exceptions. With this comes doubt "what makes the exceptions so bad for performance?" In practical terms what is the need to…
-
8
votes1
answer201
viewsElement removal with Javascript
Remove an element using Jquery is the simplest and most objective thing there is, first you capture the element and then remove it: $('#elemento').remove(); I arrived in a situation where I need to…
-
8
votes3
answers5803
viewsDifference between $.ajax(), $.get() and $.load()?
What’s the difference between $.ajax(), $.get() and $.load()? Which is the best to use and under which conditions?
-
8
votes1
answer720
viewsHow to customize emojis (Unicode) of a page?
On Windows operating system while using emojis the source used by browsers usually is the Segoe UI Emoji Note: in Firefox it has its own "emoji system", I believe it uses the Twemoji Mozilla: -…
-
8
votes1
answer178
viewsHow to improve this: Hell callback?
I am finishing the development of an ad system, the system uses the redis server to save data and display campaigns directly from ram memory, since the pathology of these systems require a lot of…
-
8
votes2
answers1283
viewsHow to access the elements of a set (set)?
I’m studying about ensembles (set) in Python because I’m going to use it in an algorithm to find paths in a graph, it’s for a college discipline that I’m having. I created two set examples using two…
-
8
votes3
answers337
viewsHow to find the occurrence of equal integer values in a vector?
I need to find frequency of ages in a vector. I know how to do this when the vector is small, but not when it is large. Consider the vector below: int[] idade =…
javaasked 6 years, 1 month ago Van Ribeiro 1,482 -
8
votes2
answers523
viewsEval vs Ast.literal_eval: what are the differences?
In Python it is common to read that ast.literal_eval is an alternative to eval. Are the functions equivalent? Everything one does to another also does? In security matters, there is priority in…
-
8
votes2
answers214
viewsWhy isn’t this "for" loop infinite?
public class Loop { public static void main(String[] a) { int cont=0; for (int i=0; i>=0; i+=2, cont++); System.out.println("cont:"+cont); }} Caught my attention the condition of the loop is…
-
8
votes1
answer4263
viewsWhat is the difference between ASC or DESC in clustered indices?
When I’m going to create an index no clustered in SQL SERVER, appears in SSMS the option to choose if the option "Columns" is ASC or DESC, as shown below: It is usually used ASC or DESC for sorting…
-
8
votes3
answers440
viewsGet the elements around a selected in the matrix
The idea is to create an integer array with the amount of user-defined rows and columns. Then an existing value in the matrix must be informed and the program must return the values immediately to…
-
8
votes4
answers121
viewsShould I use two IF’s or an operator?
Best practice for checking two conditions? In the example I’m going to give, are not very long checks but what is the best practice and what is the difference? (It happened to me that I found myself…
-
8
votes1
answer162
viewsWhat is the need to use the suffix "f" in a numerical constant in C?
It is necessary to add f at a value float within the parameters of a if? Example: if (a == 2.5f && a > 2.0f) {}…
-
8
votes1
answer446
viewsWhat is the Graalvm?
What is it different from JVM? And why did you create it? What is the advantage of using it? Can use on mobile? Are you an official of Oracle? Are you ready to use? Do you have any restrictions?…
-
8
votes1
answer107
viewsWhat does @ do in variable names?
In the response code of this question on Soen I found an unfamiliar statement line on C#. I tested this line and it works, but I didn’t understand the meaning of this character @ behind the member’s…
-
8
votes1
answer139
viewsHow to avoid conflict of data between two PUT requests on HTTP?
What techniques can we use to avoid the collision between data of two PUT requests so that the changes of the second request do not override those of the first? Let’s imagine the situation: There is…
-
8
votes4
answers1814
views -
8
votes1
answer147
viewsWhy do these two ways of initializing the same list in Python generate structures of different sizes?
It is common to need to initialize a list in Python with a defined amount of elements and we can do this in two ways: 1) multiplying the list with an element by the desired amount; or 2) using the…
-
8
votes2
answers2322
viewsHow to ignore accents in an SQL query?
How could I perform a query ignoring words with letters that contain accents? Example of words: Olá, é, Lógica, Pão I tried using the command collate noaccents as follows: select c.* from Curso c…