Most voted questions
150,413 questions
Sort by count of
-
8
votes2
answers332
viewsHow does the computer "know" the alphabetical order when comparing two chars?
I have a question about Caesar’s cipher program: #include<iostream> #include<string.h> using namespace std; int main() { cout<<"Enter the message:\n"; char msg[100];…
-
8
votes2
answers863
viewsConvert binary to decimal without using "parseint()"
I’m trying to make a script binary to decimal number conversion. I know what to use parseInt() It’s enough, but it’s not what I want here. Apparently the code had worked, but when the binary number…
-
8
votes2
answers185
viewsAdd 1 day to a date
I need to pick up the next day after today. To do this I was trying: var data = new Date() ; var dia = data.getDate(); dia = data.setDate(dia + 1); Only that the end of the return is 1585748377830…
-
8
votes2
answers105
viewsHow does an array of functions recognize the position of the next element?
Why do you ask: The question may seem strange, but is that I am a beginner in programming and at this moment I am studying pointers to function and in an example in the book by which study is…
-
8
votes2
answers626
viewsWhat is the . gitattributes file for?
When should I use the .gitattributes ? What can I do with it ? When not using this file ? It’s good practice to always have a file .gitattributes in my repositories ?…
gitasked 4 years, 7 months ago Bruno Campos 226 -
8
votes1
answer385
viewsWould "Promise.all" (and other similar functions) be an example of Javascript parallelism?
In Javascript, we have the Promise.all, that solves an array of promises in a single Promise. This process is apparently parallel, since the promises are resolved at the same time, and not in a…
-
8
votes2
answers2392
viewsWhat is the meaning of the term "Hard Coded"?
What the term means Hard Coded? It is considered a bad programming practice? How to exemplify a code Hard Coded and its consequences from development to end-user use?…
-
8
votes1
answer250
viewsIn how many milliseconds is the drag event fired?
On the website of W3schools they mention that the event takes place in 350 milliseconds: Note: While dragging an element, the ondrag Event Fires Every 350 milliseconds. Only that it varies this…
javascriptasked 4 years, 8 months ago marquinho 489 -
8
votes1
answer1006
viewsWhat is a microprogramming?
What is microprogramming? How important it is?
-
8
votes3
answers179
viewsTwo different parameters that an accepted function can classify as having O(n²) complexity?
Let’s say I define a function as follows, which accepts an argument a be a array two-dimensional numbers: function totalSum(a) { let total = 0; for (const elem of a) { for (const subElem of elem) {…
-
8
votes1
answer64
viewsWhat is the advantage of implementing the Angular lifecycle event interfaces?
Angular has an interface for each event of its life cycle, for example, OnInit for the method ngOnInit Since it is not necessary to implement such interfaces in order to benefit from the events,…
angularasked 4 years, 9 months ago Costamilam 9,556 -
8
votes3
answers1939
viewsSeparate integer and decimal part into a number using Javascript
I’m trying to make an algorithm that consists of: Take a number, for example 46.5. Go through this value and divide the entire part of the floating, ie, the whole part will stay in one variable, and…
javascriptasked 4 years, 9 months ago Luh 103 -
8
votes1
answer140
viewsFunction to void pointer conversion*
Recently, I was trying to solve a problem in a program of mine in C and, by chance, I came across some answers from Stack Overflow in English which stated that converting a pointer to a function to…
-
8
votes1
answer132
viewsIn Rust how does ampersand and asterisk work?
I came from Java recently and I’m studying Rust. Language has a totally different paradigm than I was used to, but it caught my attention. For never having messed with C or C++, sometimes I find…
-
8
votes1
answer150
viewsIs there any way to decrease the size of a function’s call?
Example: StringFormats.DateTimeToShortDateStrPtBR(); If you add this method several times in the same line the code will be very extensive, repetitive and confusing. The method is just an example,…
-
8
votes1
answer128
viewsWhy is Javascript not showing the decimal home number?
The example below normally sample the two zero: console.log(100); But when placing a decimal place or more it does not show: console.log(100.000);…
-
8
votes1
answer428
viewsWhat are the differences between the methods "equals()", "compareTo()", and even "=="?
I am aware that there are differences between comparing objects using equals(), compareTo() and even the operator ==, but in detail what are the differences between them and the care we should take…
-
8
votes2
answers537
viewsHow to recover only one specific stash file?
Suppose I did have a.txt, b.txt and c.txt that have been modified in a given branch and that I have used the command git stash in all of them to hide the changes. If I rotate the git stash pop, I…
gitasked 4 years, 10 months ago Wallace Maxters 102,340 -
8
votes1
answer314
viewsWhat is the correct term, key word or reserved word?
In programming we have certain "special words" that do specific things. These words are popularly called keywords or reserved words. What is the correct term for these words? Examples: if, double,…
terminologyasked 4 years, 10 months ago NinjaTroll 1,752 -
8
votes3
answers10568
viewsWhat is the difference between using += and =+ in Python?
I’m having a hard time understanding the difference in logic between: x += n And: x =+ n
-
8
votes2
answers118
viewsWhat’s the difference between executing code inside or outside the "for" keys?
In Javascript or C, there is some difference between using for in the normal way: for(var i = 0; i < 10; i++){ console.log(i); } or execute the codes within the parentheses? Example: for(var i =…
-
8
votes1
answer304
viewsRecursiveness in Python
Next guys, I have a matrix that is a naval battle board represented by the list: tab = [['.', '.', '#', '#', '#'], ['.', '.', '.', '.', '.'], ['#', '#', '#', '#', '#'], ['.', '.', '.', '.', '.'],…
-
8
votes2
answers118
viewsWhy does multiple variable assignment create a list when used with the asterisk operator?
Suppose there is a tuple with three values, ('a', 1, 'b'), and you want to assign the first value in one variable and keep the rest in another. For this you can do: a, *b = ('a', 1, 'b') Thus, a…
-
8
votes1
answer460
viewsWhat is " : " (two points) in C#?
I still don’t understand what the two points represent and why this code isn’t running. int soma = 0; int[] lista = { 3, 7, -6, 10, -1, 0, -1, 4}; for (int i : lista) { if (i > 0) { soma = soma +…
-
8
votes2
answers100
viewsValidate difference of 5 points for more or less
I need to make a validation if a value has a difference of up to 5, both for positive and negative. I wonder if there is any Javascript function that helps me in this, without having to do the…
javascriptasked 5 years, 1 month ago wDrik 1,406 -
8
votes1
answer2629
viewsWhy does it occur and how to resolve an error of "out of Bounds" or "out of range" or something?
I’ve seen errors and exceptions like "subscript out of range" or "index out of Bounds" or some combination of words like that. What that mistake means and how it usually is the way to correct them?…
-
8
votes2
answers245
viewsWhat’s the benefit of signing a commit with a GPG key?
What changes from a signed and verified commit to a unsigned commit? What’s the benefit of signing commits with the GPG key?
-
8
votes2
answers525
viewsCheck if the Base64 character set is an image
I have a data encoding called Base64 in this format below:…
-
8
votes2
answers145
viewsHow to get all interfaces of an object?
I need to list all interfaces that an object implements. From what I understand, I could do the following: Object misterioso; .... misterioso.getClass().getInterfaces(); but this would only take the…
-
8
votes1
answer4854
viewsConvert a str to datetime in Python
I am creating a task manager that should receive a task with a deadline. This manager will check how many days left to the deadline and let you know when to arrive. However, I am having a problem…
-
8
votes1
answer691
viewsInput Date type with year containing 6 digits
Look at the snippet just below, that the input of the kind date when typed in the value year, it is possible to insert 4, 5 or 6 digits to be exact: <input type="date"> My doubts are exactly:…
-
8
votes2
answers174
viewsFilling a list using its size as a stop criterion
I’m creating a code that defines a function that depends on two variables (Z and N). This program defines the sum of these variables and attaches each possible sum in an empty list. The list must…
-
8
votes2
answers178
viewsWhat is this if trying to say?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta…
-
8
votes2
answers114
viewsWhat is the function of Asreadonly() in C#?
I’m studying List in C#, I searched on the internet but still did not understand how it works. List<string> list = new List<string>(); list.Add("Maria"); list.Add("Lucas");…
-
8
votes1
answer276
viewsCHALLENGE: Algorithm for updating rectilinear motion uniformly varied aiming inertia at a certain end point
Question I want an algorithm that updates (from an instant to another, with a certain time interval between the two) a uniformly varied movement aiming at a final value making the fastest possible…
-
8
votes1
answer39629
viewsVscode keyboard shortcuts for comments
In Vscode I am not able to run some shortcuts. The comments shortcut, for example, does not work. The shortcut would be Ctrl+/, but all shortcuts that need a key that has more than one letter or…
visual-studio-codeasked 5 years, 3 months ago GratefullyDead 373 -
8
votes1
answer170
viewsWould it be bad practice to insert monetary symbols directly into the bank?
In a system I had to tamper with wage values and commissions, perform calculations on them and the like. However I went to analyze that the monetary symbols are being inserted directly in the…
-
8
votes2
answers214
viewsInverting two variables without using a temporary
How can I reverse the value of a for b and b for a without using another variable? For example, a worthwhile 1 becomes real b worthwhile 3 and b becomes real a that was worth 1. #antes de inverter a…
-
8
votes1
answer1176
viewsWhat are and what are .js.map files for?
I downloaded the latest version of Boostrap (4.3.1 today). and I noticed that in the js folder, came several files with the end . map js/bootstrap.bundle.js js/bootstrap.bundle.js.map…
-
8
votes1
answer794
viewsPermission PHP file
I have a file PHP inside the Linux opt directory. Inside it I have a script with queries to update a database, with password and login connection of the database. This file is set inside a bash file…
-
8
votes1
answer775
viewsHow to have multiple languages in a single application?
Listening to a technology podcast on Nubank, CTO and Principal Engineer comment that they use Java, Kotlin, React Native and Flutter to develop the Android app and everything generates a single…
android react-native software-architecture kotlin flutterasked 5 years, 4 months ago Alisson Marqui 1,128 -
8
votes1
answer5919
viewsOptimal maximum resolution for displaying content in mobile mode
Taking as an example the Bootstrap 4 grid system whose classes treat the content with breakpoints specific according to the screen width resolution of the device (considering the viewport as…
-
8
votes4
answers711
viewsWhy are literal objects declared with const in Javascript currently?
Because of Ecmascript 6 I see examples that declare literal objects with the reserved word const. Code example: // Versão utilizada atualmente const obj = { x: 'example' }; // Versão utilizada…
-
8
votes1
answer176
viewsDeep, Machine Learning and AI. What are your differences?
About Deep Learning, Machine Learning and Artificial Intelligence, what are your main differences? What are your principles? They are all who can learn and solve problems of their own nature? How to…
-
8
votes1
answer165
viewsWhat is the difference between a Uint8array and a Uint8clampedarray?
I was reading about Uint8Array and Uint8ClampedArray on MDN, more specifically on the Typedarrays and I came across a table that compares the different types. They’re basically the same, only one is…
javascriptasked 5 years, 6 months ago fernandosavio 9,013 -
8
votes3
answers1885
viewsLongest word in a sentence in the list - Python
The code in Python need to find the largest word in the typed phrase that will be stored in the list, being displayed later. The only thing I know about the resolution of this code is using the…
-
8
votes2
answers59817
viewserror: failed to push some refs
trying to push to the repository and being rejected $ git push origin master To https://github.com/me/myproject ! [rejected] master -> master (fetch first) error: failed to push some refs to…
-
8
votes1
answer7609
viewsHow to acquire information from the IEC (Investor’s Electronic Channel)?
Forgive my layperson, but there is an API that allows me to pull a user negotiations, knowing the login and password of the same ? Or would it be the case to make a Crawler ? I’ve seen several…
-
8
votes3
answers644
viewsHow to create a "Main" in an application that consumes a REST service that has all the entities in the system?
I am with the following web application created initially for and web using Spring Boot, Spring Security and Thymeleaf (authentication and authorization). I did a REST job and separated the…
-
8
votes3
answers650
viewsWhat is the best way to build a Mysql table with recipe items? All ingredients in one row or one ingredient per row?
I’m used to creating websites with few database records, so I don’t care about the speed of query and I have no experience with large volumes of information. But now I am creating a website recipes,…