Most voted questions
150,413 questions
Sort by count of
-
6
votes1
answer71
viewsRecursive Problems - Too Much Memory - Angular 9 - Settimeout()
Guys, I’m building an API and I need to make requests every three seconds on the server. Follows the code: countAcess() { if (this.menuExa && this.appService.requestValid()) {…
-
6
votes1
answer669
viewsWhy do formatting options not work with lists, dictionaries, and other objects?
When I want to print a number or string, I can use f-strings (in Python >= 3.6) or str.format, and I can only pass the variable between keys, or use the formatting options. Ex: numero, texto =…
python python-3.x characteristic-language python-internals cpythonasked 4 years, 6 months ago hkotsubo 55,826 -
6
votes2
answers114
viewsError converting string to numeric value
I have a string and I need to convert it to number, in case I need to convert it to a real value, but I’m not getting it. Below is an example where I try to convert the contents of a string into…
javascriptasked 4 years, 6 months ago Pedro Silva 147 -
6
votes2
answers967
viewsWhat happens to a SESSION when it expires in PHP or refreshes the page?
What happens when Session time expires ? (This time is usually 24 minutes by default). Example: When logging in we set the credentials of a particular user on $_SESSION, with the data resulting from…
-
6
votes2
answers119
viewsC# properties for those who know Java
What a Java programmer needs to know about basic properties (properties) in order to read code written in C#?
-
6
votes1
answer292
viewsShould we create an empty constructor in Java?
It is good practice to always declare a builder, even if it is empty, for the class? I find it unnecessary, because the compiler automatically creates. I have seen people who always create and…
-
6
votes3
answers128
viewsMap with dynamic array and property
I’m trying to create a function map, whose array and property to be returned are dynamic, that is, can be passed as a function parameter. Let’s take the array below as a use case. const students = […
-
6
votes5
answers427
viewsHow to run faster a code that calculates the number of factorial digits of a number?
The code must print how many digits have the factorial of N. I am trying to perform a simple factor challenge on the URI site and when I submit the code the answer is always "Time limit exceeded",…
-
6
votes1
answer63
viewsWhat are the differences between comparison operators in Erlang?
In Erlang, we have the following comparison operators: =:= =/= == /= It is said that the latter two can be used to make comparison between integers and floats, since the first two differentiate one…
-
6
votes2
answers1125
viewsWhat current languages are used for Windows application development?
What current languages are used for Windows application development? I would like to know which ones have dependencies, like Java that needs to install JRE or some . NET that need you to install .…
-
6
votes2
answers398
viewsWhat are the differences between a type and interface alias in Typescript?
Typescript allows us to create aliases for types. For example: type State = 'inactive' | 'active' | 'banned'; The type allows to also create types for objects, such as: type User = { username:…
-
6
votes3
answers264
viewsReceive a string and put keys in it
I have a script that receives a string. I need to receive this string and add it to its key ends. I have a problem when placing: variavel = input('informe um valor') print(f'{variavel} aqui vem um…
-
6
votes1
answer209
viewsWhy, when an iterator is not used, is an emoji "broken" into two parts?
Considering the code passage below: const str = 'Olá! '; str.split('').forEach((char) => console.log(char)); Note that all characters were separated from the string correctly. However, the emoji…
-
6
votes1
answer182
viewsAlgorithm O(n log n) to identify contiguous intervals given a range list
I have the following problem: Given a list with n continuous intervals, return a list of m continuous intervals such that: every point of the entry list is contained in any of the intervals of the…
-
6
votes1
answer94
viewsWhat is the purpose of the module in Elixir?
I’m studying Elixir and I came across the keyword defmodulo, I used to define a basic module that displays a message: defmodule Mensagem do def escreve(msg) do IO.puts msg end end Calling in the…
-
6
votes3
answers303
viewsWhen I compare two strings to the "bigger" and "smaller" operators, what am I comparing?
var a = "a"; var b = "b"; if (a < b) // verdadeiro console.log(a + " é menor que " + b); else if (a > b) console.log(a + " é maior que " + b); else console.log(a + " e " + b + " são iguais.");…
-
6
votes3
answers167
viewsWhy when rounding the sum of two numbers, the result is Nan?
Why when rounding the sum of the two values below returns NaN? numero1 = '1,10'; numero1 = parseFloat(numero1.replace(/[^0-9,]*/g, '').replace(',', '.')).toFixed(2); // output: 1.10 numero2 =…
javascriptasked 4 years, 7 months ago ElvisP 1,523 -
6
votes1
answer92
viewsWhat’s the " operator" on Bash?
i=1 aux=3 aux=$(($aux^$i)) echo $aux #2 Can someone explain me this code?
-
6
votes1
answer177
viewsHow to reduce the number of loops to calculate the smallest difference between all the numbers in a list?
The program below returns the smallest possible difference between all the elements of a list: def calculo(A): r = float("inf") n = len(A) for i in range(0, n-1): for j in range(1, n): if abs(A[i] -…
-
6
votes0
answers46
viewsWhat is a (Node) node in Javascript?
I came across that term knot or Node in Javascript on the website of MDN Web Docs what would that be? NOTE: I am not referring to the application platform Node.js.…
javascriptasked 4 years, 7 months ago marquinho 489 -
6
votes2
answers89
viewsProblem with DRY
The problem: compare two arrays and give a dot whenever a number of one array is larger than the other. Ex) A = [1, 2, 2] B = [2, 1, 1] result = [2, 1] The answer I found: function a($a, $b){ $a1 =…
-
6
votes2
answers583
viewsA recursive function can replace while and for?
If so, how could I, for example, create a recursive function equivalent to the code below? lista = list(range(1000)) for i in lista: print(i)
-
6
votes1
answer822
viewsWhat is the difference between the orelse() and orElseGet() methods of java.util.Optional?
What is the difference between the methods orElse() and orElseGet(), class java.util.Optional?…
-
6
votes2
answers1334
viewsSQL decimal field size
I am making a form, and in the database documentation there are some numerical fields that are divided into 2 parameters. Ex: Field: Cost Type: NUMERIC Tam.: (12,4) What does this size divide and…
-
6
votes1
answer165
viewsHow does the "+" operator work in Javascript?
Recently I had seen on the website of MDN Web Docs that it was possible to convert a String in a Number even in the example below: let n1 = "10"; console.log(typeof n1); //=> string ("10") The…
javascript characteristic-language typing operators type-conversionasked 4 years, 8 months ago felipe 61 -
6
votes2
answers409
viewsPython algorithm complexity with two loops
This algorithm is used to return the element that repeats most in a list: def algorithm_x(a): x = 0 y = 0 for i in range(0, len(a)): k = 1 for j in range(i+1, len(a)): if a[i] == a[j]: k = k + 1 if…
pythonasked 4 years, 8 months ago Pirategull 659 -
6
votes4
answers727
viewsCheck Object inside an Array using index()
I was solving some challenges of a Javascript course I’m doing, and came across a small problem: I have the following object array: var numberObjects = [ {number: 1}, {number: 2}, {number: 3},…
javascriptasked 4 years, 8 months ago Mateus Daniel 537 -
6
votes3
answers11154
viewsCreate local branch from a remote branch
I have a cloud branch on Github called x1 and I need to create a local branch called xlocal from that cloud branch called x1. How do I do that?
-
6
votes3
answers230
viewsCode shortcut for multiple git commands
How do I have only one command run another automatically on git? Example: When sending git atalho perform the following instructions: git status git add Post.txt git commit -m "aqui coloco uma…
-
6
votes2
answers140
viewsHow do I access getters and sub-class setters?
In this application we have the class Automóvel: public class Automovel { private String marca; private String matricula; private String anoConstrucao; private Motor motor; private int preco = 0;…
-
6
votes6
answers623
viewsWhat is the reason for the application of the concept LIFO (Last In, First Out)?
Is there an advantage in implementing the concept LIFO (Last In, First Out) or is it just a semantic question to represent an order in algorithm logic?
computer-scienceasked 4 years, 9 months ago raphael 2,131 -
6
votes1
answer197
viewsWhat is a Pentester?
Browsing the internet, I saw some hackers talking that they work or worked as Pentesters and I would like to understand more about this profession. There is some difference between Pentester, Hacker…
-
6
votes2
answers120
viewsApproximation mysql filter
I came across some cases where users reported me not in the database, certain clients, I noticed that it is common to abbreviate the middle names or the absence of them, for example: Name: João…
-
6
votes1
answer1809
viewsHow to concatenate object properties with Javascript?
I have two objects in Javascript, with the following data: const objeto1 = { prop1: 'a', prop2: 'b', prop3: 'c' } const objeto2 = { prop4: 'd', prop5: 'e', prop6: 'f' } I wanted to take all these…
-
6
votes1
answer117
viewsCan I create function parameters like string?
I am trying to delve into functions and in the example of the site MDN Web Docs they have the following example: var math = { 'factit': function factorial(n) { console.log(n) if (n <= 1) { return…
-
6
votes1
answer346
viewsWhat would be the standardization and specification of a programming language?
I did not understand, very well what is a specification of a programming language and much less what is to standardize a programming language, more precisely the programming language Javascript, so…
-
6
votes1
answer5238
viewsHow to disable compressed folders in Vscode?
Recently VS Code is leaving the subfolders created in lines (compatactate). How can I show them in the tree view?…
visual-studio-codeasked 4 years, 10 months ago Sena Oliveira 364 -
6
votes0
answers164
viewsHow to handle "large iterations" using recursion?
In the context of functional programming, it is said that any type of loop repeats (such as for or while) should be set aside in favor of recursion. But as the number of elements of the work begins…
-
6
votes1
answer132
viewsIs using ID as a global variable a good practice in JAVASCRIPT?
I discovered that there is a new way to rescue and define values to any HTML tag, using its ID as a variable: <html> <head> <title>Meu Teste</title> </head>…
-
6
votes3
answers2675
viewsIs it possible to include more than one variable per input in Python?
In C I can do it: printf("Informe 3 numeros'); scanf("%d%d%d", &a,&b,&c); Can I do a similar process in Python? I did some searches and found that I can do so: a,b,c = input('informe 3…
-
6
votes1
answer1867
viewsPython integer split operator
Can anyone explain why this function returns -2 and not -1? print(-3//2) The operator // does not return the entire part of the division?…
-
6
votes1
answer404
viewsHow does type "Unknown" work in Typescript?
The guy unknown is a Feature a little more recent language, and is said as a any, only that type safe. So I was left with some doubts: What is your difference from any? It is safe to use it for type…
-
6
votes2
answers917
viewsHow to make an all-white PNG image with CSS only?
I have an image, which is the client’s logo, all colored. At times, I need this completely white logo, to apply on dark backgrounds. I don’t always want to have to use two Pngs and I wonder if you…
cssasked 4 years, 10 months ago Wallace Maxters 102,340 -
6
votes3
answers641
viewsWhat is Unobtrusive Javascript?
What is Unobtrusive Javascript and what its differential when writing Javascript functions in the HTML document?
-
6
votes1
answer312
viewsHow to organize the use of the z-index attribute?
One thing I’ve always found in CSS to be the most disorganized thing is the use of z-index. Often some frameworks/libraries, or even some developers, place an exaggerated value on z-index, causing…
-
6
votes1
answer219
viewsHow does the . NET "using" and Garbage interface work?
In a reply now deleted here on the site it seems that there was some confusion with the content indicating the use of GC.Collect() and how the using C# works. So how does it actually work using and…
-
6
votes2
answers465
viewsForce CSS and JS cache clean
I work with a server. Whenever I change my CSS/JS and upload to the server, it does not directly change the version of my file, it is cached. I mean, I always have to clear the cache and then see…
-
6
votes4
answers729
viewsHow to get the month formatted with zero left in Typescript
I’m trying to get the month in Typescript with Node.js, I’m trying to get it like this: const today = new Date(); var todayMonth = today.getMonth() + 1 if(todayMonth < 10) { todayMonth = '0' +…
-
6
votes1
answer2441
viewsApplication does not work after generating . APK
I am facing a problem when trying to generate an app apk developed in Android Studio. After generating the . apk to install the app on other phones, the app is installed but does not open. On mobile…
-
6
votes0
answers895
viewsPython word search
Guys, I’m trying to do a word search. The first lines should contain letters with white space, then speak the number of words and say which word. The output should contain the diagram with the word…
python-3.xasked 4 years, 11 months ago Igor 61