Most voted questions
150,413 questions
Sort by count of
-
6
votes2
answers3248
viewsCapture repeated elements from a Javascript array
I need to remove the repeated values of a vector and play these repeated values in another vector, I found this code that removes the repeated values, but I do not know how to capture them, and I am…
-
6
votes2
answers2537
viewsWhen should I use a Property instead of a Python attribute?
If I set the class Person down below: class Person: def __init__(self, name): self.__name = name In this other way: class Person: def __init__(self, name): self.name = name self.kind = kind…
-
6
votes2
answers820
viewsDifference between non-relational database models
When it comes to non-relational databases, we have some options, such as the Document database and Graph database. Regarding the two, what are the main differences and benefits of using each?…
-
6
votes1
answer152
viewsWhat are Evergreen Browsers? Does this philosophy also apply to system development?
I heard that term, Evergreen Browsers in an English lecture on the evolution of browsers etc., but I didn’t quite understand what this concept would be. What would be a browser Evergreen or what is…
-
6
votes2
answers1136
viewsWhat is the purpose of using "Else" together with Try/except in Python?
In Python, what’s the advantage of using else in a block try/catch? If in this example below: try: f = open('texto.txt', 'r') except IOError: print('O arquivo não existe!') else: print(f.read())…
pythonasked 5 years, 6 months ago Thiago Krempser 1,878 -
6
votes2
answers135
viewsDifference between metacharacters . * and +
Consider this set of strings: my_names <- c('onda', 'ondas', 'ondass', 'ondassssssss', 'ond', 'on') Using the R language, I checked the metacharacters .* and + bring the same information:…
-
6
votes4
answers461
viewsHow can a group of parameters be required if at least one of them is informed?
In Python we have the default values, which are optional when we call a function. I was wondering if there’s any way to make a group of values optional, like if you pass all those values or none.…
pythonasked 5 years, 7 months ago Matheus Cezario 69 -
6
votes1
answer141
viewsHow to determine a gap condition between records?
In the case of records containing date and/or time, how to determine that between the first record returned and the others there is always the same interval? Let’s take this example: Raw data:…
-
6
votes1
answer3395
viewsError creating table with INDEX VISIBLE in Workbench
I created a diagram of a BD using Mysql Workbench and had it generated. But the following error happens when I run the query: Executing SQL script in server ERROR: Error 1064: You have an error in…
-
6
votes1
answer181
viewsRegex using preg_replace to separate values according to ")"
I need to use a string separation for the occurrences of closing of parentheses and a space after, with the following technique I managed to do: preg_replace('/[\)][\s]/', '$0--> $1', '1 () 2 ()…
-
6
votes2
answers796
viewsHow to separate a string by commas, except when you have a space later
I have a string and I need to separate it into one array. However, the separator character needs to be the comma (,), but if you have a space right after (", ") she is preserved in separation. I’m…
-
6
votes3
answers965
viewsList JSON data with Javascript
I’m trying to list the data of a JSON through Javascript, but it only presents in the list a position 0. Below follows the JSON: [ { "id":"23" }, { "id":"24" } ] I have the following code below…
-
6
votes2
answers301
viewsDiv with position: Fixed loses total container width
In the example below, see that the div naturally occupies the whole width of the body, but when I click the button Fix to change the property position for fixed, it loses its full width, looking…
-
6
votes1
answer96
viewsWhat is the logic for discovering all possible numbers that add up to the requested number?
But note that the number on the left is always higher than the number on the right. I’ve tried several ways, but I don’t think I understand the logic to create an algorithm that does this so I…
-
6
votes3
answers839
viewshow to select zero Count
have these tables (example) Municipio (id, nome) 1, Santos 2, Sao Paulo 3, Rio de Janeiro 4, Florianopolis 5, Porto Alegre 6, Natal Cliente (id, nomecliente, cidade) 1, Joao, 1 2, Pedro, 3 3, Maria,…
-
6
votes1
answer57
viewsselect with order by
I have a simple table with only one text field, no field auto increment and indexes CREATE TABLE teste (Nome varchar(30) NOT NULL) I inserted the information in this table in the following order:…
-
6
votes2
answers162
viewsCentralize Divs responsibly
Next, I always looked for a solution to this type of problem, but never found. I have the following codes. <style> .allboxframes { margin: 0 auto; max-width: 100%; } .box-frames { margin: 0…
-
6
votes3
answers20560
viewsPick first and last name and abbreviate middle names only with the initial
I would like to address the following string: string nome = "Rafael Rodrigues Arruda de Oliveira" With the following criteria:: Keep first and last name; Abbreviate the other names (middle names)…
-
6
votes1
answer67
viewsIs there a correct way to pass parameters to search?
I am making a Restfull application and it occurred to me the following doubt: "Am I passing parameters in the correct way for this method?" The method in question is this:…
-
6
votes1
answer591
viewsAdd list values with different sizes
I have two lists with varying numbers and sizes. For example: array 1 ['1', '142', '33', '33', '9', '2'] array 2 ['1', '12', '7', '-2', '39', '11', '31', '49', '50', '1'] How do I make a loop to add…
-
6
votes2
answers640
viewsHow to allow white space in any part of the sequence in a regular expression?
I have a field that accepts at least 12 alphanumeric characters, including 9 numeric characters. But there is a catch, that accepts white space whatever the position. function validaCampo(sCampo) {…
-
6
votes1
answer86
viewsIs there a shortcut to go to the last edited line?
In Sublime Text, I’ve already happened to be editing a line of code and have to check a code right above to see what I’m going to implement. Turns out, when I do this, I miss a shortcut so I get…
-
6
votes1
answer745
viewsWhat is the usefulness of the exclamation (non null assertion Operator) in Typescript?
I recently discovered that in Typescript we can use the operator of non null assertion simply putting a ! where you want to check. When I saw it, I thought it was like in C#, that we have the ?,…
javascript typescript characteristic-language operators nullableasked 5 years, 8 months ago Francisco 7,472 -
6
votes1
answer4099
viewsDefinition and use of @Property
Good afternoon, I’m starting to study object orientation and I’m not getting a very good understanding of what the function is and when to use @Property. But from what I understood up to the moment…
-
6
votes2
answers549
viewsWhat is the difference between Fuzzy logic and boolean logic?
Was reading regarding Fuzzy logic and I realized that it has relations with boolean logic. However, I was very confused at the point that defines the relation of the logic of Fuzzy with the boolean,…
-
6
votes1
answer177
viewsWhen to use Memorycache?
I would like a real example, not necessarily a code, on when use the MemoryCache on Web systems. What types of situation ask for its use? A little context: I participated in an interview where they…
-
6
votes1
answer2392
viewsWhat does the MIT license mean?
Copyright (C) [year] [copyright holders] Permission is hereby granted, free of Charge, to any person obtaining a copy of this software and Associated Documentation files (the "Software"), to Deal in…
googleasked 5 years, 8 months ago Pedro Guilherme 86 -
6
votes2
answers256
viewsConcatenate columns and return the relation by SELECT
Suppose I have the following tables and their relations: Tabela A Col 1 Col 2 Col 3 Tabela B Col 1 Col 2 Col 3 Tabela C Col 1 Col 2 Col 3 Tabela D Col 1 Col 2 Col 3 Relacionamentos: A (col 1)…
-
6
votes7
answers1523
viewsHow to calculate the median of a line in a date.frame in R?
I have a database and my goal is to perform some behavior analysis of classes per line. Example: print(DADOS) Linha A B C D E L1 4 3 2 2 4 L2 1 11 1 1 1 L3 0 1 2 3 4 L4 2 0 0 8 0 Using the example…
-
6
votes3
answers293
viewsHow to know if class instance inherits another class?
I’m using reflection to know if one class inherits another, what I found was this: bool herda = typeof(A).IsAssignableFrom(typeof(B)); But I want to do it in the variable getting your type. Here’s…
-
6
votes1
answer360
viewsWhat is the use of the functions with underline (_) at the end?
Consider the functions of the following Packages: dplyr library(dplyr) gorup_by_ summarise_ mutate_ transmute_ tidyr library(tidyr) gather_ spread_ separate_ unite_ What is the usefulness of these…
-
6
votes2
answers73
viewsEstimate variable of difficult isolation
Good afternoon collaborators. I am having difficulty estimating a parameter via R programming to complete my processing routine. The equation I am using is the one described below, where I have all…
rasked 5 years, 8 months ago Henrique Faria de Oliveira 725 -
6
votes1
answer44
viewsFocus on minutes in time type input
Is there any way to "focus" the minutes of a input of the kind time? By default, the focus() direct to the "hours" that is the beginning of the input, empty or filled: <link…
-
6
votes3
answers820
viewsHow to exit the FOR loop within the Switch structure?
I’m in a noose FOR and I want to lock him inside the Switch, but when I give break within the Switch he comes out of Switch and continues the loop FOR, someone can tell me how to get out of the loop…
-
6
votes1
answer177
viewsDifference between props and propsData
In the Vue.js we have how to insert data into components through props as follows. const hello = { template: '<div>{{ message }}', props: ['message'] }; new Vue({ el: '#app', data: { message:…
-
6
votes2
answers1072
viewsWhat use is Notmapped?
I’d like to know what the [NotMapped] and when to use it?
-
6
votes2
answers236
viewsRemove unwanted characters from a List<string> without going through the list
Be the following excerpt a Windows Forms application. List<string> lista_strings = new List<string>(); for (int i = 0; i < 2000; i++) { lista_strings.Add("TST1234"); //preenchendo a…
-
6
votes3
answers144
viewsType declaration in parentheses
I am porting an application done in c to C++ and found the following function statement: set_funcao(0, (double)pow((double)2, 32) ); What does the type in parentheses mean? It is the type of return…
-
6
votes2
answers5439
viewsHow to use PHP on the command line?
Is it possible to use PHP on the command line? How does language use work in this environment? It is possible to develop scripts and run them as shell scripts?
-
6
votes1
answer62
viewsAlign queries and pass your results as alias for SOMA
So I’m running two queries that return me the amount X of items per month over a year. The first consultation gives me the following result The 'no column name' would be the months, so I have no…
sqlasked 5 years, 8 months ago Lucas Tadeu Egídio Arruda 281 -
6
votes3
answers150
viewsJson format is valid, but conceptually incorrect. How to argue?
We recently requested a service for a partner company, to consult with some people. The service was designed from scratch to meet a particular system demand of ours. This is a simple Rest service,…
-
6
votes1
answer100
viewsWhy is "vector" considered a "list" in some cases?
Consider the objects: for(i in 1:6){ names<-paste0("var",i) assign(names,runif(30,20,100)) } dataset<-do.call( cbind.data.frame, mget(ls(pattern='*v')) ) cluster<-kmeans(dataset,centers=3)…
-
6
votes1
answer90
viewsHow do I know my function is breaking SOLID POO?
I left a function below that will be the subject of the question, basically I would like to know if this function breaks any principle of SOLID/Clean Code by itself ? This doubt arose because…
-
6
votes2
answers386
viewsRegular expression C# console application
I have a list of words, for example: São Paulo 9000-000 a 9999-9999 Barigui 8000-0000 a 8999-999 I want to take only the numbers, with the same trace and separate, in another list for example, I…
-
6
votes1
answer108
viewsHow to reflect on overloaded operators in C#?
My problem is this: I’m writing an interpreter and I need to perform dynamic operations between various types. For this use dynamic links provided by DLR consisting of a static object encapsulated…
-
6
votes2
answers372
viewsWith CSS to make a color shadow on a text?
I saw this text template and I thought it was pretty cool, so I tried to replicate it and it didn’t work out so well... In fact I even managed to put a gradient that pleases me inside the text, but…
-
6
votes4
answers1049
viewsString list + . Split()
The command string.Split() separates a string in a array of the kind string[]. How to use the string.Split() to separate strings in a list List < string>?…
-
6
votes1
answer1756
viewsIs it possible to create a certificate in PFX format and set an OID for some parameters?
I need to generate a certificate to simulate an e-CPF. I am creating an implementation to query and validate the digital certificate information e-CPF and e-CNPJ with my application. The extraction…
-
6
votes1
answer453
viewsWhy is Serif Font used so little on the Web and in Apps?
I do not seek answers based on opinion! The other day I saw one Kindle, and I noticed that he was using by default a font-family with serif. What is a serif source After that I was asked. Amazon…
-
6
votes3
answers1491
viewsMYSQL and REGEX Phone Number
I need to select records that have in the middle of the phone numbers text to delete (automatic moderation). It’s a forum, people every day comment and put phone numbers in the middle of the…