Most voted questions
150,413 questions
Sort by count of
-
6
votes1
answer133
viewsWhy do we use "<>" in Typescript?
Why do we use <> in Typescript? Example: funcaoExemplo(x: X<any>, x: X): Observable<X<any>>
-
6
votes1
answer247
viewsSize of a list list using list.Capacity
Creating a list of lists: List<List<int>> myList = new List<List<int>>(); I add elements in myList with 1 element: myList.Add(1); When I do debug.writeLine(myList.capacity)…
-
6
votes2
answers3244
viewsMultipart Formdata is a data structure?
How it works "behind the scenes". I know that when we send a request and the body we define as JSON, this is a data structure that will be sent in JSON form, in which case Multipart Formdata is also…
asked 5 years ago Lucas de Carvalho 6,427 -
6
votes1
answer90
viewsUsing static factory methods instead of constructors
I’ve been doing some research on this subject after I read in Joshua Block’s book, Effective Java, Item 1, about the use of static factory methods rather than building builders. There in the text he…
-
6
votes1
answer79
viewsDoubt in algorithmic analysis
I’m having a hard time proving f(n)=Omega(g(n)), then g(n) = O(f(n)). How would this proof? With calculation and theory?
asked 5 years ago Ana Caroline 65 -
6
votes2
answers768
viewsWhat is the usefulness of the console.dir() in Javascript?
var body = document.getElementsByTagName("body"); console.dir(body) Well, an interactive list of object properties will be returned, but what is the usefulness of this, what I’m trying to say is…
javascriptasked 5 years, 1 month ago Null 523 -
6
votes2
answers110
viewsWhat’s the difference of foreach(function) and foreach(function())? Why does the first work and the second does not?
error: Undefined is not a Function const heros = ['visage', 'enchant', 'lone'] const nome = 'reubber' function dotinha(nome) { return console.log(`'heroi é: ${nome}`) } /*heros.forEach(dotinha)…
javascriptasked 5 years, 1 month ago Reubber 85 -
6
votes2
answers125
viewsMerge two features
I have 1 branch in my project 1 - Master I created 1 more branch and developed 1 Feature. I now have 2 branchs 1 - Master 2 - feature1 I started to develop another Feature and now I have 3 branchs 1…
gitasked 5 years, 1 month ago Leandro Castro 306 -
6
votes1
answer63
viewsHow do I create a new method for a constructor?
There is a Date constructor (which is the date constructor that already comes in JS), and I would like to create a lastYear() method that brings the "year = year-1" (for example and learning…
javascriptasked 5 years, 1 month ago Juliano Henrique 271 -
6
votes1
answer64
viewsHow does the creation of a proxy work under the table?
I’ve had a lot of fun creating interface proxies in Java. For example, the following proxy was required on Sqldroid to run version 5.2.4 of Flyway (and also to catch the path of the file created by…
-
6
votes4
answers1946
viewsIncorrect Date/Time Formatting Nan/Nan/Nan Nan:Nan:Nan
The Field DateTime that returns from Database is formatted as dd/MM/yyyy hh:mm:ss, by now when you start looping ($each) the code below the format changes to: "/Date(1566322265000)/". I created this…
-
6
votes1
answer111
viewsDifference between overall, const and define()
So I was studying about POO and MVC structures with PHP and saw that we often need to use global variables (accessible throughout the application) and what’s the difference of using: global $nome =…
-
6
votes1
answer68
viewsWhat is the numbering next to the Unix commands?
I often see command descriptions like this: Like which(1) Unix command. Find the first instance of an Executable in the PATH. [Source] Or this: A cat(1) clone with Wings. [Source] What are these…
-
6
votes2
answers89
viewsBackslashes on the way: do they influence anything?
I never understood why some systems use the \ and others use the / for the same purpose: to divide paths and addresses. There is no pattern from which to use, or at least couldn’t find a. While…
characteristic-language operating-system file-system pathasked 5 years, 1 month ago CypherPotato 9,292 -
6
votes1
answer44
viewsWhat exactly does Rest syntax return, just the elements or some special object?
Doing some exercises, I realized that it is possible to use the map function in a Rest that apparently only returns pure elements. also realized that it is not possible to apply a typeof nor…
-
6
votes2
answers191
viewsTypescript - Incorrect code output - Date
Why the output from that code is: Pessoa { Id: 1, Name: 'Maicon Gabriel Friedel', DateOfBirth: 1997-02-22T03:00:00.000Z } Code: import pessoa from './pessoa' pessoa.Id = 1; pessoa.Name = 'Maicon…
-
6
votes1
answer51
viewsDetect implicit Intent action when the Android Operating System changes the time manually
I need to detect in my application when user changes system time manually. How do I do this? For example: If user restarts the device I can detect this event with on my Broadcast receiver so: if…
-
6
votes1
answer138
viewsWhy do auto properties exist in C#?
I have a doubt, because in C# there are auto properties that are usually used like this: public double price {get; private set;} and because she’s a public she can be accessed directly and on top I…
-
6
votes3
answers3708
viewsWhat is the difference between useMemo and React useCallback?
I know that useMemo and useCallback are two new Hooks React. However, I still don’t quite understand the difference between them. What’s the difference between "return a memoised value" and "return…
-
6
votes2
answers108
viewsLine breaking problems and correctly display real value conversion on C#
I made a simple C# code that asks you to enter name, age, weight, city and state, performs normally only that it appears some problems as instead of the weight being 60.5KG gets 605KG and wanted to…
-
6
votes3
answers185
viewsWhere to place a function "toFixed()` to round up the value?
I would like to round off the final value of my code with the .toFixed() but I don’t know where to put. Here is the code: <script type="text/javascript"> function conversao(fahreinheit) {…
-
6
votes1
answer1288
viewsHow do I delete a commit from github history?
I would like to delete a commit made on github but WITHOUT deleting the changes, which is why I discovered that in one of my files the code contained personal information and by altering it that…
-
6
votes2
answers758
viewsWhat is Fat JAR?
In my daily studies on Java on the Internet, I found some references and comments from programmers using this name "Fat JAR", in the context of configuration and deployment of Java applications. As…
-
6
votes2
answers454
viewsHow to write acronyms in camelCase?
How should I treat acronyms in camelCase? should I leave them fully uppercase or just the first letter? What would the variable look like algumaCoisaSiglaAleatoria? Or algumaCoisaSIGLAAleatoria?…
-
6
votes4
answers99
viewsSimplify value localization in arrays in PHP
I have the arrays as below: $records = [ ["id"=>"1", "name"=>"Alpha"], ["id"=>"2", "name"=>"Bravo"], ["id"=>"3", "name"=>"Charlie"], ["id"=>"4", "name"=>"Delta"],…
-
6
votes3
answers4742
viewsConvert string to dd/mm/yyyy hh:mm format
How can I convert a date that is string to a date type? I tried to do it this way but it didn’t work: var string = "19/07/2019 14:18" var date = new Date(string); When I give a console.log(date);…
-
6
votes5
answers146
viewsIs there a disadvantage or is it harmful to use null types?
I always have trouble receiving null values from the database because I forget to use the cancellable types and face the same problem: The type cannot be null This usually happens with attributes…
-
6
votes1
answer145
viewsHow to detect screen width smaller than height with CSS?
I have a div with position: fixed which occupies the entire screen and which is only displayed when the width of the screen is less than the height. With Javascript I can do this check and show or…
-
6
votes2
answers73
viewsWhat makes a code have different visual representations in different browsers?
I have a website that I am developing on which I have a top set menu (a navbar). The problem is this navbar has different views on Chrome and Firefox. I’d like to know why this is happening. I use…
-
6
votes2
answers153
viewsHow to apply decorators that are classes in other class instance methods?
I’m trying to implement a class that’s a method Decorator python. The idea is to apply it to the methods of other classes. However, it is getting lost in the reference self of the annotated class…
-
6
votes2
answers1019
viewsselect bringing all un-duplicated records based on a single column
How can I bring all records from a column that are not repeated. For example: | tela | url | perfil | dataCriacao | --------------------------------------------- | dica | /dica/ | ROLE_CDL |…
-
6
votes1
answer69
viewsWhat is the impact on the browser when there is infinite and direct interaction in HTML?
I have several polygons that change their points infinitely (while on the page), this interaction is done by a js plugin and in my code I have these calls: var config = { targets: '', points: [],…
-
6
votes3
answers1299
viewsShould every table have Primary key?
I believe my question is both conceptual and technical. My whole problem started when I made an SQL Server database and in it there were some tables without primary key, such tables would serve…
c# asp.net-mvc sql-server entity-framework entity-framework-6asked 5 years, 4 months ago Nelson Francisco 147 -
6
votes2
answers1649
viewsWhat is the underscore (or underline _ ) for in the repeating structure?
What this _ ago? Why it is being used in the code snippet below? print('3 numeros') data = [] for _ in range(3): data.append(input()) numbers = list(map(int, data)) print(numbers)…
-
6
votes1
answer99
viewsWhy do typed accessors run the process faster?
I was reading an article by how to improve the performance of a Reader data using ADO.NET and in this article he cites the use of Typed Accessors to perform this function, from what I understand it…
-
6
votes1
answer157
viewsHelp with first neural network
I am beginner in dealing with Nns, and need help and explanation in certain things with my first project. Basicamento, to making an NN for checkers, my input are the black parts of the board (8x4)…
-
6
votes1
answer131
viewsWhy can the class be picked up by Javascript while loading the page and the ID not?
I was doing some tests with Javascript and I came across an interesting "phenomenon", but I could not find a good explanation to explain it. Follows the code: <!DOCTYPE html> <html>…
-
6
votes1
answer200
viewsIs a Python dictionary as efficient as a tree or a hash?
I use a lot of Python dictionaries: dic = dict() #ou dic = {} dic['113654'] = {'nome': 'João', 'idade': 21} dic['853872'] = {'nome': 'Maria', 'idade': 27} dic['427845'] = {'nome': 'Fernando',…
-
6
votes2
answers165
views -
6
votes1
answer502
viewsManage transactions in Java EE @Transactional
I’m having trouble trying to "inherit" the transaction from Java EE of my layer of service to the layer of repository. My intention is for the transaction to target my service function. Enabling me…
-
6
votes2
answers208
viewsWhat is the actual implementation of "in" in Python?
This week I found myself wondering what the actual implementation of "in" in Python is. To try to answer, I went to look the official documentation about his details, and only say that: For…
-
6
votes2
answers479
viewsTypescript build does not support Commonjs from Node.js
Let’s say I have a module alert.ts: export default function alert(message: string): void { console.log('Alerta: ' + message) } When performing the build using the tsc, and try to use the code…
-
6
votes2
answers67
viewsIs there a problem with using invented tags and attributes?
I was looking at some websites and noticed some tags that are not patterns like <div> <span> etc.... So I decided to test and saw that these tags work normally with css and javascript,…
-
6
votes2
answers61
viewsIs it still recommended to treat IE (Internet Explorer) in Crossbrowser tests?
Today we know that 80% or more of website access is mobile, and that technologies are increasingly advancing in this direction as the PWA and the AMP. Source:…
-
6
votes1
answer1432
viewsTranslation of programming languages
Whenever I search about "translation of programming language in Google" I only get tutorials of how to rewrite from one language to another, and never what I really want to know: Is there any…
characteristic-languageasked 5 years, 5 months ago Breno 978 -
6
votes3
answers201
viewsRounding up
I have these values, where contrato.Count = 63 and 63/50 = 1.26. I’d like you to round up 2, I’m doing it this way: decimal arrendondamento = contrato.Count / 50; var valorArredondado =…
-
6
votes5
answers9207
viewsChange the color of the text by clicking a button
<html> <head> <meta charset="utf-8"/> <style> .alterar{ color:red; text-align: justify; } </style> <title></title> </head> <body> <h1>…
-
6
votes1
answer4362
viewsFree Mysql remote access 8
I’m testing the new version 8 of Mysql, and encountered some difficulty in releasing remote access (specifically, using the Workbench). What I found was same question on Soen, and only one…
-
6
votes1
answer347
viewsWhat are dataclasses and when to use them?
In version 3.7* calls were added dataclasses which were designed from the PEP 557 and consists of using a decorator, dataclass, in "normal classes". What are these dataclasses? What are the benefits…
-
6
votes2
answers163
viewsWhat do these question marks mean?
What do the question marks on that get. What do they mean int? and ?? in this line of code, I have already found examples that used ? and ?? but never so many in a single line and this gets a little…