Most voted questions
150,413 questions
Sort by count of
-
3
votes1
answer46
viewsUse of generators with while results in infinite loop
I made a small example of using generators to better understand how it works in php. the method getValues is an example of values that would come from a database or any other data source that…
-
3
votes2
answers93
viewsHow to print accents in Lua
I’m starting to learn moon now, and I can’t print accents print("Olá mundo") returns Ol├í mundo in both the VS Code terminal and powershell, there is a way to fix this?…
luaasked 4 years, 1 month ago Levy Barbosa 51 -
3
votes1
answer90
viewsMerge different database queries
"It is possible to join information from tables of other databases?" This doubt arose when I needed to do a survey make a comparison of data in tables of different stores, Every store has its own…
-
3
votes1
answer187
viewsHow to interrupt the execution of jQuery each?
I have a problem going through Rows (from one DIV that is inside another DIV) with the method each. When a condition is true, I need to interrupt the loop and display a message to the user, but I’m…
-
3
votes1
answer42
viewsNotice message by adding year, month and day with the ymd() function of the lubridate
I’m practicing with the pack hflights I install the package; I load the package; and I carry the lubridate install.packages("hflights") library(hflights) library(lubridate) The data (Year, Month,…
-
3
votes2
answers91
viewsreplace more than one char utitlizando . replace()
I have the following function: public String replaceCharToNull(int row, int colum) { String result; result = (((String)jTableLoan.getModel().getValueAt(row, colum)).replace("x", "")); return result;…
-
3
votes2
answers107
viewsHow to decrease the tab opened in Visual Code and show navigation arrow between tabs?
How to decrease the tab opened in Visual Code and show navigation arrow between tabs? In case, I want to decrease the size of the tab of each open file, and/or when I open several files, be able to…
visual-studio-codeasked 4 years, 2 months ago Rebeca Nonato 1,163 -
3
votes1
answer41
viewsPlot factors (spp) of metaMDS in ggplot
I want to plot the species in the clusters of the metaMDS result using ggplot. I tried so, but gives error:Error: Aesthetics must be either length 1 or the same as the data (20): label.…
-
3
votes2
answers95
viewsHow to print a class in c++?
Good afternoon, what am I doing wrong in printing the Team class (name, number of members) in the penultimate line of the code? Shows the error: Invalid operands to Binary Expression…
c++asked 4 years, 2 months ago Maria Fernanda Pedrosa 39 -
3
votes1
answer47
viewsShow value 0 when no data is available
To show in an sql query, value 0 when there is no data in the table? SELECT ae.dt_data, to_char(ae.dt_data, 'dy'), case when to_char(ae.dt_data, 'dy') = 'sun' then 'Domingo' when to_char(ae.dt_data,…
-
3
votes2
answers119
viewsHow to use 'Else if' correctly?
I built a function called min which returns the smallest number that is passed in one of its two arguments. When the numbers are equal it returns null. I was able to make the code work as follows:…
-
3
votes1
answer510
viewsBest worst case sorting algorithm
I want to know which algorithm has the best performance when dealing with its worst case compared to others dealing with each with its own worst case, all applied in array ordering. To better…
-
3
votes1
answer101
viewsImprove performance in iteration
I have a C# method that receives a List<string> and I must return a string with the list of members of the List<string> ordered by number of occurrences and then alphabetically. I did…
-
3
votes1
answer53
viewsWhat are the differences between setInterval x requestAnimationFrame?
I am creating an application where I need to check if an X element was created on the page and thus take some actions. To make that check, I’m using the setInterval. A few minutes ago, I remembered…
-
3
votes2
answers272
viewsFunction that compares characters from a string and returns true or false
I’m trying to make a function that should return true or false if the first and last characters are equal. However, comparing them is giving error of out of range and I can’t identify the reason:…
-
3
votes3
answers87
viewsQuantity return error in deleting the registration of a sale in PHP code
I’m having trouble with my code that excludes a record of a sale and that must make the replenishment of the quantity of products in the table of origin. Example of how this code works: On the table…
-
3
votes1
answer142
viewsRegex is not checking the accented character, even though it is in the expression
I have the following Python regex to filter my application text input: import re good_chars_regexp = re.compile(r"^[A-Za-záéíóúÁÉÍÓÚâêîôÂÊÎÔãõÃÕçÇ00-9\,\.\-\?\"\'\’\!\“\s\;\:\“\”\–\‘\’\’\/\\]+$",…
-
3
votes3
answers713
viewsCombination of two lists in Python
I need a code that discovers possible passwords in a universe of LLLDDD (L=letter, d=digit), I found it easier to apply the conditions separately and I arrived at two lists: lpossiveis:['ABD',…
-
3
votes3
answers133
viewsRound Decimal
Dear gentlemen I’m doubtful of rounding in python. I know, for example, that if I have a variable like this,: n=2.23445 print (f'o valor de n é {n:.2f}) will print 2.23 But in the case of a list?…
pythonasked 4 years, 3 months ago user201087 -
3
votes1
answer51
viewsCreate 2 zipped files with files from a folder
I’m trying to create a code that reads a directory with pdf files and creates 2 zipped files containing these pdf, in my code, I only managed to play all pdf in a single zipped file, my question is…
-
3
votes1
answer170
viewsHow to send keyboard commands to emulator?
Eai Galera, I’m trying to make a program to make an automatic combo in a fighting game (The King of Fighters 2002), I’ve tried to use libraries like pyautogui, Keyboard, ctypes and etc, but I can’t…
-
3
votes1
answer56
viewsCreate bar with CSS
A client asked to create a menu based on the image below: How could I make these bars with CSS? I’m using Bootstrap for development. <div class="collapse navbar-collapse"…
cssasked 4 years, 3 months ago user24136 -
3
votes3
answers230
viewsRemove lowercase letters from a list
I was trying to make a program that could identify whether a letter is in upper case or in Lower case in a list, so that it would delete the lower case letters. frase = ("A B C D e f g h") new =…
-
3
votes0
answers45
viewsProblems with split captions in ggplot2
Hello, I’d like your help on subtitles using the ggplot2. I want to extract a caption to use in another graphic that uses plot_grid, but I don’t know why, but the same code works (Figure 1) and…
-
3
votes2
answers70
viewsHow to make calculations with instances of a class, or even with new instances?
I want to do an operation with two, or more, instances of a class. Is there any way to do this? Example: class myClass{ constructor(a){ this.a = a } } var myObj1 = new myClass(2) var myObj2 = new…
javascriptasked 4 years, 3 months ago Luís HNrique 307 -
3
votes1
answer46
viewsHow to print/insert in an organized way inside a csv file a tuple in Python
Would anyone know how to print a tuple as follows: amount_of_commits,author 148, Steve Ellis 2, Alex Kwiatkowski 2, Thomas 1, Dan Forbes 1, David Parker 1, John Barker 1, Thomas Hodges…
-
3
votes3
answers146
viewsPrint more variable text
A doubt, as I print (print) a variable x after a text in R. As in the python you do. print (f"seu numero é",x)
-
3
votes1
answer281
viewsHow to use Deep-linking in React Native?
How to pass a URL in this format https://www.google.co.uk/? code=3a549132-8966-4ae1-a951-7e873452df3c&state=febe0bc9-8b38-4a78-a122-7e36c398a14a by the browser in a way that opens the…
react-nativeasked 4 years, 3 months ago João pedro 104 -
3
votes2
answers93
viewsLaravel 6 escaping html Blade template
I am displaying news registered in the database using Windows and Blade template, only that html is being escaped, I have tried several ways but I can not solve. My controller returning query result…
-
3
votes1
answer74
viewsWhat is the meaning of the word Soundness in the context of programming languages?
I always see that term when I’m reading about type systems, I’d like to know: What is its meaning within the context of programming languages? What it means a language has a type system Sound? What…
terminology characteristic-language language-independentasked 4 years, 3 months ago Denis Rudnei de Souza 3,686 -
3
votes1
answer238
viewsTable creation error (ORA-00904)
I don’t know if it’s my glasses that are in trouble, but I can’t see where I’m going wrong. If you can help me. I read that the mistake could be happening by the way I’m declaring mine PRIMARY KEY,…
-
3
votes2
answers61
viewsDo generic Helper/Utility classes hurt the Single Responsibility Principle (SRP)?
The classes Helper/Utility with generic methods, which are used for various purposes, violate the Single Liability Principle (SRP)? The following is an example of some methods in the class: function…
-
3
votes2
answers92
viewsWhat is the difference between creating a method inside the constructor or inside the prototype property?
When I see other programmers' JS code some define the methods within the constructors themselves others define the methods in the property prototype such as, for example: function Mouse() {…
javascriptasked 4 years, 4 months ago Mirian cherbo 95 -
3
votes1
answer517
viewsCalculation of age in Java
I have a code that should calculate the age, but in my test I can’t catch the day nor the month of Data and yet age comes wrong due to this. On the test returns 32 years, while it should be 31.…
-
3
votes1
answer93
viewsCHALLENGE: Spline algorithm(s) with derivative continuity(s)
It is known that a polynomial fn:x->y=c0+x*c1+x²*c2+x³*c3+...+x^n*cn can meet the N=n+1 conditions and from n=1 there is convenience to use in Spline formulas, for example f1 can meet the…
-
3
votes1
answer89
viewsLast characters of a data.frame column in R
I have a table within a date.frame, and I need to get only the last two characters of that table, how do I do that? bs.: I was trying to do it using str_sub, but in it I can only define which…
-
3
votes1
answer835
viewsHow to add days to a date with Moment.js?
I’m trying to calculate the deadline of my site in days, IE, I put "14 days" and it turns into 00/00/0000. I’m doing it this way, but she’s taking the full date and turning it into days, I want to…
-
3
votes2
answers293
viewsReplace string chunk between 2 indexes
I have a long string inside a txt file, for example, let’s say my string is about that: strg = '123456 BANANA 00 SP' In position 14 and 15 we have the "00", I’m gonna need to replace up front The…
-
3
votes1
answer62
viewsHow does this piece of code work?
My doubt is more precisely in line "8", line containing the for. I’ve never seen one used this way. I understood the logic of the line, but the operation of this iteration made me very curious.…
-
3
votes2
answers72
viewsHow to turn a column with a sentence per row into a column where each row is a word of these phrases?
I have the following structure: structure(list(frases = c("agricultura pecuária e serviços relacionados", "produção de lavouras temporárias", "cultivo de cereais", "cultivo de arroz", "cultivo de…
-
3
votes4
answers876
viewsHow to capitalize all words in an array using toUpper?
The function needs to return all words of the array in uppercase. function transformaParaMaiusculo(palavras){ for (let i=0; i<palavras.lengh; i++){ palavras.push(palavras[i].toUpperCase()) }…
-
3
votes1
answer51
viewsChange the native console function.log
There is some way to change the console’s native function.log, but keep the old one? Ex: console.log = (e) => { antigoConsoleLog(e); alert(e); //exemplo minhaFuncao(e); //exemplo }…
-
3
votes1
answer46
viewsComposition Graph using ggplot2
How can I produce a composition chart using ggplot2 reproducing the same model as the figure below? Sample matrix: x<-c(0, 1.52, 8.12, 0, 0.29, 0, 3, 4, 1.2, 1.1) y<-c(4.8, 3.03, 6.82, 9.76,…
-
3
votes2
answers239
viewsWhat is the difference between ", " and "+" in Python?
In a code mensagem = "ola " nome = input("Diga seu nome ") print (mensagem + nome ) mensagem = "ola" nome = input("Diga seu nome ") print (mensagem , nome ) The two do the same function , with the…
-
3
votes1
answer234
viewsValidate input by accepting specific amount of letters and numbers in javascript "for an RA, ex: p3087748"
I did a validation in HTML using pattern, I tried to put letters and numbers at the same time. But I believe that there is no way to determine the minimum of letter and numbers. Example: Only one…
-
3
votes1
answer117
viewsStarting point of axis X using scale_x_date()
I am making a stacked area chart and use the following code ggplot(gdados, aes(Commissioned, acum, fill = Country)) + geom_area(col=c('black')) + scale_fill_brewer(palette = "Paired")+…
-
3
votes1
answer85
viewsWhy does x += y add the values in an iteration?
I don’t understand why this code r += v sum the values. I would like someone to explain to me why the output of this code: for c in range (0, 10): v = int(input("numero: ")) r += v…
-
3
votes1
answer101
viewsAre there advantages to using closures to maintain state rather than class?
It is very common to use classes to encapsulate state and some methods that modify it, such as this counter: class Counter { #val = 0; increment(step = 1) { this.#val += step; } retrieve() { return…
-
3
votes1
answer55
viewsProcessing time and clock time
What is the difference between processing time and clock time?
-
3
votes1
answer44
viewsDo I lose commit history if I switch to remote branch?
If I change the Git remote I end up losing commit history to the new remote?