Most voted questions
150,413 questions
Sort by count of
-
4
votes2
answers376
viewsSELECT displaying products except the results of another SELECT
I have this SELECT that picks up the 6 best selling products: SELECT IdProduto, SUM(QtdProdutoPedido) as QtdProdutoPedido FROM tb_pedidoproduto GROUP BY IdProduto ORDER BY QtdProdutoPedido DESC…
-
4
votes3
answers1617
viewsSet value 0 when the number is negative
How do I assign 0 when the value in the column in Mysql is negative? Or is there some kind of data that only has positive numbers?
mysqlasked 6 years, 10 months ago user92401 -
4
votes1
answer261
viewsHeritage in object-oriented programming
I was reading that article today and I came across the following statement: "Inheritance refers to the ability of an object to access methods and other properties of another object." Inheritance…
-
4
votes1
answer612
viewsImport data from central bank to R
I would like to know if it is possible and how to import data from the central bank directly to R If there is a specific api or package to access the time series
-
4
votes1
answer4332
viewsHow do JOIN in 4 tables or more?
I need to make a select on four tables but I’m having a headache with it, follows the image of how they are related: It would be something like : SELECT integrantes.id_integrante,…
-
4
votes3
answers858
viewsHow to make a Union of two queries using Django Filter
I was racking my brain to do union of two darlings using Django Filter and I ended up doing it on hand (Model.objects.raw("SELECT....")). How could I union with Django’s ORM? Note: I have 2…
-
4
votes3
answers1015
viewsRemove style added with . css() Function with jQuery
I’m changing CSS with jQuery and need to remove the style I added: if(cor != 'ffffff') $("body").css("background-color", cor); else // remover style ? The line above runs whenever a color is…
-
4
votes3
answers5591
viewsHow to Configure CORS correctly in Spring Boot?
First I’ll tell you what happens! I developed a simple Spring Boot project to show on screen a GRID having as Frond-End the Angular, the request of the java API is the port 8080 and Angular is port…
-
4
votes3
answers138
viewsIn structures (struct) is it necessary to use getters and setters or only in classes (class)?
It is necessary to use setters and getters in structures to maintain good practice or is needed only in classes?
-
4
votes2
answers7073
viewsPut If to Where
I got the following Where WHERE 1 = 1 AND (0 = 0 OR 1 = 1) inicio do if AND (2 = 2 OR 3 = 3) fim do if How would I do if? The idea is that a value per parameter comes and if that value satisfies the…
-
4
votes1
answer114
viewsDOUBT About the use of SELECT and Standard Tables
I have a question as to the advantages of having standardised tables and their forms of use within a SELECT. Suppose the following tables: -------------- | tb_endereco | -------------- | id | | rua…
-
4
votes1
answer52
viewsHow to make a temporary powerup?
Hello. I’m developing a game in which the player throws some balls (shots), so I created a powerup that decreases the time between the thrown balls. I need to make the time between the balls back to…
-
4
votes1
answer221
viewsCapacity of schools in Golang
One Slice can vary with the need and can add items to it, right? It is possible to view the size and its capacity (len and cap, respectively). In the tour by Go, there is a "lesson" from append,…
-
4
votes3
answers510
viewsHow to make an error message for this situation?
arq=open('filmes.txt','r') filmes = arq.readlines() def buscaPorGenero(): genero=str(input("Digite o gênero do filme: ")) while(True): for linha in filmes: linha = linha.split(";") if genero in…
-
4
votes1
answer64
viewsCompiler indicates non-existent Enum that exists
I’m using the Mono compiler. When I tried to compile this: using static System.Globalization.CharUnicodeInfo; using static System.Globalization.UnicodeCategory; namespace AS3Kit.Lexical { static…
-
4
votes1
answer821
viewsOptimize factorial calculation using vector
Statement of the question: Read an array A of vector type with 5 integer numerical elements. Construct a matrix B of the same type, each element of the matrix B being the factorial of the…
casked 6 years, 10 months ago rafael marques 939 -
4
votes2
answers683
viewsHow to run INSERT only if the record does not exist?
I’d like to wear something like sqlite insert into table (column) values ('')if not exist;…
-
4
votes1
answer123
viewsWhen to do unit tests in Javascript?
As far as it is advantageous to do unit testing in the presentation layer, and, what would be the scenarios where unit testing in Javascript is advantageous? Only advantageous if you have…
-
4
votes1
answer392
viewsRandomly select lines
I am developing a very complex system, where, in some cases I need to select only a few fields, a friend who has more experience in the area gave me some tips, but he did not explain why. I have the…
-
4
votes3
answers3012
viewsAggregate function on R
Good afternoon. I’m using the function aggregate to group some data. However, I am only using one variable to add up. I would like to use more than one variable. Is this possible? I am using the…
-
4
votes1
answer474
viewsCode to generate user password hash in Oracle 10G with C#?
I need to authenticate users in a web application in the Oracle 10g database, but the credentials are native to the database by running an Oracle Forms application already, and we would like to keep…
-
4
votes1
answer2281
viewsRegex no Delphi
A help with regular expressions in Delphi 10 please. I need to check the following on a string: Size ranging from a minimum of 6 characters to a maximum of 20 characters; Character type: a-z or A-Z…
-
4
votes1
answer3746
viewsHow to change the font on a chart in R?
I want to use the source Times New Roman on the chart, but the R/Rstudio returns an error message saying not to find it. Obviously the source is somewhere because I use MS Word, for example. A while…
-
4
votes3
answers857
viewsDollar next to number in Tostring format
When I try to format a value using .ToString("c2") do . NET the symbol of the coin comes stuck with the number. This makes the formatting ugly and wrong to my point of view. Example:…
-
4
votes3
answers5016
viewsReplace NA in R language
I would like to replace NA (Missing) for a word. I have the following data: structure(list(NOME = c("ABC", "ADD", "AFF", "DDD", "RTF", "DRGG" ), TIPO = c("INTERNACAO", "", "CONSULTA", "EXAME", "",…
rasked 6 years, 11 months ago Bruno Avila 867 -
4
votes1
answer73
viewsAre methods objects in Ruby?
Ruby’s got the class Proc, that is defined in the documentation as Blocks of code that have been bound to a set of local variables. Once bound, the code may be called in Different contexts and still…
-
4
votes2
answers350
viewsWhy is it necessary to close file?
Why is this line required in Java? fout.close(); Context: LinkedList values = new LinkedList(classe.getTurma().values()); if (!values.isEmpty()) { FileOutputStream fout = null; String FILE =…
-
4
votes1
answer630
viewsWhy does the decrease of the subnet mask fold the size of the original network?
Reading about IP protocol and network addressing, I don’t understand why the "diminishing" the size of the subnet mask in 1 bit, generates a "augmentation" network size. I understood the reason for…
-
4
votes2
answers1297
viewsProblem with gets and fgets
I’m having problems with the gets function and fgets... Always when I use them, the program skips the input, ie the user can not type the string, but it only works with scanf, just that I need to…
casked 6 years, 11 months ago System_4n4n 57 -
4
votes3
answers158
viewsDoubt about sql query
I have a question. I believe it is nothing complex, but I could not solve. For example, I have this query: select * from Paciente where ClinicaID = 3 Your result would be these 3 records:…
-
4
votes2
answers164
viewsHow to check if a certain sequence of Elements exists in R?
I have a vector like this: vectorx<-c(3,3,1,1,1,2,2,2,2,2,2,2,2,2) And I want to check if the sequence 3,3,1,1,1,2 exists. It turns out that this sequence can be in any vector position, I just…
rasked 6 years, 11 months ago Vivian Ribeiro 195 -
4
votes1
answer94
viewsOrganize a time series
I have a base with collected information on weight gain per animal. They were collected at different intervals for each animal. Follow part of the base just below Animal Dia Ganho 5 2 0.99 5 9 1.01…
-
4
votes1
answer126
viewsWhat is the most performative way to convert an int into the sum of its digits?
I have a certain int and would like to turn it into another that is the result of the sum of your digits in the best possible way. For example: int n = 2601; Should result in 9 since this is the…
-
4
votes1
answer1340
viewsWhat are the differences between the HASH and BTREE algorithms used in an index?
I realized that I can create two types of indexes for one determining field in Heidisql, which use the algorithm HASH or BTREE, see below: See the CREATE code from an example table for the…
-
4
votes1
answer57
viewsadd column that shows how many times a value has repeated from that row back
I’m having trouble creating a column that shows how many times a row has repeated itself, but not in the entire dataset, but in that line back. Ex: NOME ANO MES COLUNA_QUE_QUERO_CRIAR A 2016 4 1 A…
rasked 6 years, 11 months ago Geovani Ferreira 129 -
4
votes1
answer416
viewsHow to group Counts for different queries into one?
I need to make an SQL query to count indications, I have the following querys: SELECT 'FACEBOOK', COUNT(id) FROM `clientes` where indicacao like '%face%' SELECT 'Instagram', COUNT(id) FROM…
-
4
votes1
answer939
viewsMobile First: Show image only on desktop
How best to make an image appear only on desktop? Usually I add one media query to place a display: none when open in the mobile. But this image is processed by mobile, just not displayed. What is…
-
4
votes5
answers212
viewsGet array object by description in index
It is possible to use the property of an object as an index of a array, as described in the example below? using System; public class Program { public static void Main() { var myObjectArray = new…
-
4
votes2
answers4078
viewsHow to show date without time with Date()
I’m mounting a date to be displayed in an input, this will be today’s date less a day, but I need only the date and is showing me Date and Time, how can I do? What I got so far is this: var Hoje =…
javascriptasked 6 years, 11 months ago adventistapr 5,498 -
4
votes3
answers294
viewsTransform Set<Integer> into Set<String>
I need to store a Set<Integer> within a sharedpreferences, however it only accepts Set<String>, has how to make this conversion ? Set<Integer> checados = group.getCheckedIds();…
-
4
votes2
answers435
viewsUPDATE PHP com Javascript
I am trying to carry out the UPDATE, but gives the following error: Notice: Undefined index: id in C: wamp www Sitephp base updateFunctioning.php on line 4. Follow my code Function function…
-
4
votes3
answers1317
viewsRemove duplicate values from an array - php
I need to remove duplicate values from a PHP array, for example: $array = ('2015', '2015', '2012', '2013', '2014', '2014', '2016') I wish I had the output: Array ( [0] => 2012 [1] => 2013 [2]…
-
4
votes1
answer95
viewsString Contains Empty returns true
Why when using the Contains("") in a string not empty returns true? Example if ("MinhaString".Contains("")) { Console.WriteLine("String contém vazio"); }…
-
4
votes2
answers1593
viewsHow to insert sequence in non-automated field
I need to insert records in a table with data from another continuing the sequence of a column that already exists in it, but the column I want to continue the sequence is not auto-incremented and…
-
4
votes1
answer37
viewsOther account data with facebook authentication
I am implementing authentication by facebook and wanted to, when entering the application with the account data, save also full name, photo, among other data. Searching, I got the following code:…
-
4
votes1
answer150
viewsDoes Xamarin generate Java source code?
I read that with Xamarin it is possible to program in C# for example, and generate a native application Android and IOS. After programming in C#, does it generate sources in Java? I can after making…
-
4
votes1
answer2068
viewsCOUNT and GROUP BY in two columns
Personal I am facing a doubt with a particular query, I have searched everywhere on the subject but without success. If there’s any other way to do what I’m trying, I’d appreciate the information So…
-
4
votes1
answer5565
viewsHow to remove an item at an array position?
Example: string[] x = {"3","2","1"}; I just want to take off the item "2" array x, resulting in: x = {"3","1"};…
-
4
votes2
answers494
viewsHow to store an array in a string?
Example: string x; string[] y = {"5", "0","0","5","5"}; x = "50055" I want to put it all together into one variable. I will store in a variable not print.
-
4
votes2
answers2096
viewsHow to make the system display an error message when it is not number?
How to make the system return some message like "This value must be numerical" in the problem below? (menu one and two have already been defined, this is just a cut) print("MENU PRINCIPAL") while…
pythonasked 6 years, 11 months ago Leonardo Alves 63