Most voted questions
150,413 questions
Sort by count of
-
5
votes2
answers202
viewsIs there a difference between a perfect binary tree and a balanced binary tree?
How can I understand a balanced binary tree and a perfect binary tree?
terminologyasked 5 years, 2 months ago Carlos 119 -
5
votes2
answers1797
viewsAdding spaces in Javascript
I need some help with that... We want to represent a ladder with variable height, using an array of strings. For example, a ladder with height 3, we will represent with the following array: var…
javascriptasked 5 years, 3 months ago Douglas Morais 106 -
5
votes4
answers330
viewsCreate "dark" function on the site!
I am developing a website and wanted to implement that famous "dark" function so that the user can choose. Searching and mining our dear internet, I managed to have a certain result, I created the…
-
5
votes1
answer3822
viewsWhat is debug? What is it for and how to do it?
People while I am programming always see in the IDE’s a part called debug, I don’t really know how it works and what it’s for exactly since I don’t know if it looks like code editing but I believe…
-
5
votes8
answers3758
viewsExercise taking the position of the array
I’m doing an exercise but I can’t go through all the necessary validations. Write the function "medalText(number)", which takes a number as a parameter, using only an "if". You have to return the…
-
5
votes1
answer516
viewsWhat is the difference between an Entity and a Model (MVC and the like)?
In object orientation both are classes usually used to represent something that will be persisted (not that it is mandatory to persist), but what is the difference between them? Or are they…
-
5
votes1
answer298
viewsCompare objects in R
I have two dataframes: atualizada PIMPF_Br_A_1_sa PIMPF_Br_A_2_sa 1995-01-01 74.35501 35.59109 1995-02-01 74.06131 35.43400 1995-03-01 74.06131 35.93259 and: atualizada PIMPF_Br_A_1_sa…
-
5
votes1
answer51
viewsHow to use multiple repository sources with priority in NPM?
I know it is possible to use local records with the command npm config set registry <registry url> However, as I understand it, this command changes the NPM to search only in that repository.…
npmasked 5 years, 3 months ago Felipe Avelar 9,507 -
5
votes1
answer67
viewsIs it possible not to allow duplicity in a combination of 2 columns or more?
I know that SQL Server has the Primary Keys and start not to allow duplicate records, but it is possible to do this through 2 columns or more? As an example, I have a table with column, house and…
-
5
votes0
answers49
viewsConsider return routes in the same way
I’m having trouble coding the variable rota in the R so that it assumes a unique value when the route is the same, independent of the point of origin (first 4 characters of the route variable) and…
-
5
votes1
answer143
viewsWhy are instance variables usually initialized in the constructor?
I have seen several codes where the instance variables of a class are initialized in the constructor, even I do it myself by watching others do it. But I never understood it. Logical that has the…
oop variables software-engineering builder initializationasked 5 years, 3 months ago NinjaTroll 1,752 -
5
votes1
answer82
viewsExpression does not return the desired result when the data is captured by the input
I made an expression to calculate compound interest with monthly contribution, based On that website The expression went like this: function jurosCompostosComAporte(p,m,i,n){ let valorFuturo,…
javascriptasked 5 years, 3 months ago Lucas 53 -
5
votes3
answers115
viewsRegular expression of citations in R
I would like to extract all reference keys I use in a document markdown beginning with the character @. Here is an example of the different ways I can quote a document using this key: line <-…
-
5
votes1
answer36
viewsWhy can’t I use add operator in function with this?
Why when I run the following code: function Pessoa(){ this.idade = 0; console.log(this.idade); setTimeout(function() { this.idade++; console.log(this.idade); }, 2000); } new Pessoa(); My way out is…
-
5
votes2
answers200
viewsWhat’s the opposite of . equals in C#?
I’m doing a left Join where I want to pick up just what’s on the left table and there’s no right one. I’m using LINQ and Entityframework. I made a code that takes the similarities, follows below:…
database .net entity-framework entity-framework-6 ormasked 5 years, 3 months ago Garota de Programas 57 -
5
votes1
answer466
viewsWhy, at Angular, do we use interrogation?
Because in Angular we use interrogation, for example: *ngIf="listaxpto?.clientes.length"
-
5
votes3
answers325
viewsIs it possible to override a base class property?
I have a class Cliente, which is the basis. In it I have the property Celular with Data Annotation "Required". I wonder if it is possible to use a property Cellular in class ClientePersonalizado,…
-
5
votes1
answer104
viewsIs it recommended to explain all variables?
This is a question as to the readability of the code or if there is any style pattern as to this. Well, the Zen of Python tells us that Explicit is Better than implicit. but how to interpret this?…
-
5
votes2
answers86
viewsHow does ORDER BY draw columns in case of a repeated value?
Suppose I make one SELECT sort of like this: SELECT * FROM "users" ORDER BY "createdAt"; In this context, if I have data that has the same value in the field createdAt, how SQL will sort these…
-
5
votes4
answers130
viewsString Manipulation in Javascript?
I have the following code var wcalcAlm = ('0140') alert(wcalcAlm) //retorno esperado ('01:40') I need that after the 2 position of the variable wcalcAlm be included :, thus having the following…
-
5
votes1
answer125
viewsFormatting Titles in Table of Contents Rmarkdown (R)
That’s my code in Rmarkdown: --- title: "Formatando Table of Contents" author: "Laura" date: "`r Sys.Date()`" output: pagedown::html_paged: toc: true toc_depth: 3 self_contained: false --- #…
-
5
votes3
answers253
viewsCannot implicitly convert "decimal" type to "int" in C#function code
This code averages the arithmetic or weighted average of the 3 student grades based on your choice of average according to the use of the Equals, code error is exactly this conversion of decimal for…
-
5
votes1
answer57
views -
5
votes2
answers95
viewsSearch Duplicity in the table
I have a chart with 3 million phones, and I have the code for each customer. My goal is to find which phone repeats on different customers. For that, I can count how many times he repeats, but I…
mysqlasked 5 years, 4 months ago Gilson Andrade 61 -
5
votes1
answer60
viewsWhy can’t Ambroses support type notes?
We know that Python, as of version 3.6, supports annotating types in functions and variables, according to the PEP 526 -- Syntax for Variable Annotations and PEP 3107 -- Function Annotations. def…
-
5
votes1
answer138
viewsUntreated POO code exception (Get and Set) from C#
The code in question is used to calculate the circle area value using keywords get and set. After I occurred CS1729 error a constructor was created to fix it private double valor; public…
-
5
votes1
answer116
viewsHow to find the intersection between a line and a mathematical function?
I have a problem where I need to find the intersection of two mathematical functions. I have the formula of the first function and two coordinates, where ab and cd are my points. To pass these…
-
5
votes2
answers269
viewsWhat is the maximum size of a variable of type int in Javascript?
I intend to make an algorithm that creates prime numbers, and I need to know what the number limit is that I can have on a variable. If anyone can help me, thank you very much
javascriptasked 5 years, 5 months ago XTRADE XTRADE 117 -
5
votes1
answer122
viewsHow does Windows manage installation frameworks?
Today you were asking me how the management of frameworks on Windows. The new version is coming out .NET 5, that means I will have to install this version to install programs made with this version…
-
5
votes2
answers99
viewsRequire function with another associated function?
In a simple chat project, which I have already used and works 100%, it is used const express =require('express');//para http const app = express();//instancia const http = require…
-
5
votes1
answer621
viewsPrime Numbers in JAVA
I’m doing a job in Java, where the user must enter numbers smaller than 20, and then this program must tell which numbers are prime. I don’t know if my logic is right, but on the console nothing…
javaasked 5 years, 5 months ago ayanami001 53 -
5
votes1
answer753
viewsWith CSS is it possible to make a triangle with curved edges?
My intention is to get into this form. Only with CSS without SVG. Does anyone have a solution to this? The code I have so far is this. #tri { width: 0; height: 0; border-top: 0px solid transparent;…
-
5
votes1
answer230
viewssimplexml_load with xmlns problem
Well I have done everything I knew but is giving an error saying xmlns is not absolute. I have checked the xml and is correct now when simplexml_load_string(): namespace Warning : xmlns: URI…
-
5
votes1
answer1150
viewsWhat is the difference between findByIdAndRemove and findByIdAndDelete in Mongoose?
I’m looking for the difference between the two and I can’t find it. They’re synonymous?…
-
5
votes3
answers177
viewsWhy does the this(6) command inside a constructor initialize the class array?
In the code: public class Lista{ int [] a; int n; public Lista(){ this(6); } public Lista(int i){ this.a = new int [i]; this.n = 0; } public static void main(String [] args){ Lista l = new Lista();…
-
5
votes1
answer106
viewsIs an executable in imperative programming language smaller than an executable in object-oriented language?
Well, that is, usually object-oriented programs have several calls to small methods for passing messages, encapsulation is also a common consequence of the model, not to mention polymorphism and…
-
5
votes1
answer752
viewsWhat’s the difference between "Future.whenComplete" and "Future.then"?
The Dart language provides several mechanisms for handling asynchronous calls. One I’m very used to is modifying await, which can be used in functions marked as async. However, we are sometimes in a…
-
5
votes2
answers4605
viewsGIT - Commit to another branch
I am working on a project that has two branchs (master and dev). I started the implementation of a new Feature in the system but, halfway through, I realized I was making the changes in the master,…
-
5
votes1
answer54
viewsMatch between dictonary and array
GOAL: I’m trying to match one dictonary and a array. I want to check if the contents of the array are contained in KEY NAME dictonary, if it is it should return me the whole line of dictonary.…
-
5
votes1
answer92
views.clone() not registering Select value in cloned DIV
Good afternoon guys, I think it may be something really stupid, but I can’t identify why the clone that I make of my page to be able to print 2 ways, is not capturing SELECT value of my products, it…
-
5
votes1
answer269
viewsHow to improve/optimize a color image conversion code to grayscale
I am testing turn a black and white image on the nail and managed using the following code. import cv2 imagem = cv2.imread("goku-jr.jpg") for coluna in imagem: for pixel in coluna: media =…
pythonasked 5 years, 6 months ago LucasElias 83 -
5
votes1
answer35
viewsGraphic problem
How to arrange the view on the y-axis? import matplotlib.pyplot as plt with open("text.txt") as f: data=f.read() data=data.split('\n') x=[row.split(' ')[0] for row in data] y=[row.split(' ')[1] for…
-
5
votes1
answer95
viewsWhere is the function taking the current time?
I have a function that returns the current time. Where does this value come from? Phone time? Server? Just follow my lead: public static Date getAgora() { Calendar calendar = Calendar.getInstance();…
-
5
votes2
answers516
viewsArray.push() always stacking the last foreach item
I am working on the development of a dynamic table and I am facing problems to create the rows of this table according to the columns I have and the information I receive from the API. Considering…
-
5
votes1
answer129
viewsHow to find a specific id within a list?
I’ll try to summarize. I have a list in which I have elements with various ids. I would like to select a specific element within that list. Only that the ID value that will be searched for will be…
-
5
votes3
answers903
viewsHow to assign Fetch value to a variable
I have the following code below dia_do_mes = {}; fetch('https://api.myjson.com/bins/dhhvz') .then(response => { return response.json() }) .then(r => { console.log(r) }) .catch(err => { //…
javascriptasked 5 years, 6 months ago user159172 -
5
votes1
answer2535
viewsHow to keep Appbar and Bottomnavigationbar between pages
I’d like some help from you guys on an app in Flutter. I’m creating the routes named to navigate between the App pages. However, I was unable to maintain Appbar and Bottomnavigationbar during…
flutterasked 5 years, 6 months ago Joao Barbosa 366 -
5
votes1
answer310
viewsHow to implement a pagination using PHP and Ajax
I make a query in the database through PHP that receives the data from an AJAX. (And then returns the query data to AJAX) So far so good. The problem is that I would like to paginate these data…
-
5
votes2
answers279
viewsHow does a black box test work?
In my software test class the teacher talked about this type of test very superficially and I ended up not being able to ask him more details regarding the test. Therefore, I would like to know how…
-
5
votes2
answers367
viewsArtificial Intelligence for Games in Unity
I’m creating a game at Unity, and I’m looking to do some bosses, but for that I need to study artificial intelligence, and I have no idea where to start, I looked for books but they are very scarce,…