Most voted questions
150,413 questions
Sort by count of
-
3
votes2
answers168
viewsPython 3: How to understand this string
I have a question, I am a beginner and I am reading the book "Introduction to Programming with Python" 3° Edition. And I came across this code below. Program 4.3 - Income Tax Calculation salario =…
-
3
votes1
answer95
viewsI can’t login after I enter the user’s email and password
I made a login system, only that does not enter the system where always returns to the home screen and does not enter the conditional I want, I think this is happening in the file valida_login.php.…
phpasked 4 years, 6 months ago Márcio Pimentel 41 -
3
votes2
answers54
viewsWhat does the # operator do before a parameter in the definition of a macro?
One of the possible macro definitions assert(), as I found in Mingw’s code,. #define assert(_Expression) \ (void) \ ((!!(_Expression)) || \ (_assert(#_Expression,__FILE__,__LINE__),0)) I don’t…
-
3
votes1
answer749
viewsError in kivy installation
I can’t install the kivy on my computer, I’ve never touched Pip before, I’m putting the commands on cmd and gives error. I am running the following commands: python -m pip install docutils pygments…
-
3
votes2
answers421
viewsWhat is the default sorting (order) of the result of an SQL query?
Suppose I have a table called "student" in the database, and its columns are nome, matricula and curso, your primary key being the column matricula. The column matricula does not have auto_increment…
-
3
votes1
answer1251
viewsHow to use the Assert statement?
To Documenting informs that: During development, use a statement assert for interrupt normal execution if a condition is false. The instruction assert ensures, for example, the manipulation of…
-
3
votes2
answers164
viewsUpcasting and subsequent downcasting allows you to access the attribute of the original type?
When I make a upcasting, object 1 will be converted to its supertype and an object 2 is created When object 1 is instantiated before doing the upcasting, has attributes that do not exist in the…
-
3
votes1
answer203
viewsWhat are the main advantages of the Restful Api?
Regarding the REST API maturity model, level 2 consists of "HTTP + Resources + Verbs". What are the advantages over level 1 and zero? In addition to organizing the API.
-
3
votes1
answer66
viewscompare javascript objects
in this script, which compares objects in javascript, even if I pass equal values (to my understanding, but which all indicates is wrong), the return remains false. someone could help me better…
-
3
votes4
answers292
viewsHow to find the index of an object in a javascript list
I am trying to get the index of an object in the following list: let list = [ {nome: joão, idade: 15}, {nome: pedro, idade: 17}, {nome: felipe, idade: 12}, ] But when I try to use command…
javascriptasked 4 years, 6 months ago Only_A_Perfil 95 -
3
votes1
answer326
viewsBest Practices for Creating Widgets
I know two ways to create widgets, extending StatelessWidget class MeuWidget extends StatelessWidget { const MeuWidget({Key key}) : super(key: key); @override Widget build(BuildContext context) {…
-
3
votes1
answer88
views -
3
votes0
answers47
viewsWhat are the cardinalities of the Indians?
Checking the Index using the following command: show indexes from tabela_exemplo; The column Cardinality left me in doubt. It holds an integer value for each index pointed to one or more columns…
-
3
votes1
answer43
viewsVisible index or not?
About using the parameter Visible of index of a table, I would like to know: What is the effect of this parameter on a table field? This parameter is specific to Mysql or found in other BD? Will…
-
3
votes1
answer218
viewsStack implementation in C, how to pass values?
I am trying to implement a stack in C. The prompted by the teacher is already basically done which was to show an error if the stack was full or empty. But when going to main I found great…
-
3
votes1
answer40
viewsToggler doesn’t work
I am studying Django and found the following problem when using the staticsfiles, the Toggler that appears when the screen is reduced does not extend my bootstrap navbar, I did not find the error.…
-
3
votes0
answers22
viewsWhat are Rest parameters?
Recently I discovered that there are Rest parameters in the Javascript which has the following syntax: function (a, b, ...c) { // Code. } But I didn’t understand very well what they are, what they…
javascriptasked 4 years, 6 months ago felipe cardozo 275 -
3
votes1
answer169
viewsReturn function of the next ASCII character in C
Do a function: strShift() that receives a string with alphabet letters and returns a new string with letters replaced by their successors in the ASCII table. For example, "Ana" returns "Bob" and…
-
3
votes4
answers1648
viewsCount consonants in the sentence
The program must count the number of consonants in the sentence. If only one word is typed it counts right, but if I give space, ie, write a sentence it does not count right. #include…
-
3
votes1
answer157
viewsRunning functions simultaneously in Python3
I have a snippet of a code that performs "text to Speech", but to see the print() function I have to wait for the playsound() function to end. Is there any way to make the script run the print()…
-
3
votes1
answer73
viewsIdentify accented letters and print a warning
I need to make a program that accepts only letters without accent, and for that I’m trying to do something that identifies a letter with accent and then print a warning about the error, but when I…
-
3
votes1
answer313
viewsRegex to capture spaces, except within quotation marks
I would like a regular expression (PHP) to exclude double spaces out of quotes. update tabela set¬ nome='alberto da silva',¬ telefone='1234'¬ ) I want to capture double spaces, enters, tabs out of…
-
3
votes1
answer48
viewsWhy can’t I print the values of a chained list?
I need to generate an empty chained list and do three operations with it: Add an element to the end of the list Remove an item from the list Insert n elements at the end of the list Finally, the…
javaasked 4 years, 6 months ago Guilherme Cherobim 33 -
3
votes1
answer2002
viewsWhat is Java 8 Optional for? How to use it?
What is the use of Optional Java 8? How to use this feature? The best answers I found on the site were these... What is the difference between the orelse() and orElseGet() methods of…
-
3
votes1
answer129
viewsHow to call a variable within another function
I’m trying to call the name variable within the forward functionQuadro. But it’s not working. var pergunta = document.querySelectorAll(".pergunta"); var indiceAtual = 0; function iniciar(){…
javascriptasked 4 years, 6 months ago Christian Silva 31 -
3
votes2
answers88
viewsI cannot invoke a Setter or getter in Javascript
I was doing some object orientation exercises and in the solution the teacher used set and get. I realized that even if I do it like the teacher, it doesn’t work. I can solve it without get and set,…
-
3
votes4
answers1041
viewsDoubt Exercise Python
The challenge is: Write a program that receives as inputs (use the input function) two integers corresponding to the width and height of a rectangle, respectively. The program must print a string…
-
3
votes1
answer72
viewsError in calculating a PA with Haskell
The function does not return the expected result but I followed the formula and can not understand the error in logic. I hope to return the term i-th. termoPA :: Int -> Int -> Int -> Int…
-
3
votes1
answer48
viewsHow would the code below look in pure Javascript?
I’m having a hard time finding a way for a function to find a variable from another function within my code as I type into a text box, even though the variable is global. I will try through the code…
-
3
votes1
answer183
viewsPython recursive method that returns how many times a given element appears in a vector
I want to make a recursive method in Python that returns how many times an element appears in an array. Below follows my code using binary search: def binaryrec(valor, itens, menor, maior): vezes =…
-
3
votes1
answer56
viewsWhat is the reason for using "super()" before creating daughter class variables?
I found this question which speaks almost of the same subject but her focus is on access to parent class methods. And my doubt is to know why the use of super() before the declaration of variables…
-
3
votes1
answer283
viewsWhat’s the difference between using a div and React.Fragment?
I am studying React more in depth and in one of the courses I am following is cited the use of <React.Fragment> to render multiple elements at once. Normally in my components I use a…
-
3
votes1
answer115
viewsWhy is my canvas not working properly?
let canvas = document.querySelector('#canvas'); let ctx = canvas.getContext('2d'); ctx.fillStyle = 'green'; ctx.fillRect(10, 10, 50, 50); #canvas { width: 500px; height: 500px; background: red; }…
-
3
votes1
answer138
viewsHow to Know if the Form that is the son of a Tpanel is open
Opa! I have a question. How to know if a form assigned as a child of a TPanel this fir? My form is being created like this: if not(Assigned(Form2)) then begin Form2 := TForm2.Create(self);…
-
3
votes1
answer87
viewsShutdown the computer when a particular program shuts down
I’m turning an old CPU into a Minecraft server. When turning the computer on, I can get it to open the server via script (starting a -jar file), however, I would like to have it shut down as soon as…
-
3
votes1
answer53
viewsUse of only one attribute of an entity
I’m building a Rest API for Cities and Customers registration. My problem would be in relation to the Customer class that has as attributes personal data of the customer and a City, that would be…
-
3
votes1
answer701
viewsHow to use a COUNT with condition?
I have a table quarto, wanted to return the amount of rooms you have on each floor (the room has an attribute andar), but I don’t know how to get him back from every floor SELECT andar, COUNT(*…
-
3
votes2
answers852
viewsInsert elements in the correct position in an ordered list
I wonder why this code does not work for the exercise below, because when it comes to the values that will be intermediate in the list, they end up being reversed (the example I used to test if it…
-
3
votes0
answers40
viewsWhat is the difference between super(Father, self). __init__() and super(). __init__ in Python3+?
In this code I’m studying he declares it the way super(RandomWalker, self).__init__(), but I always see it said that in Python3+ it can be said as super().__init__(): import torch.nn as nn import…
python-3.xasked 4 years, 7 months ago Aldimir Bruzadin 31 -
3
votes1
answer125
viewsWhere does the memory space required for each element in a C string array come from?
In C, you can group a set of string's, which are arrays of char's within a array without having to define 2 dimensions for this? That’s why you use a array pointer char's and simply defines the…
-
3
votes2
answers168
viewsString.split() function with separator containing brackets and asterisk
I have the following code: String teste = "meta[[*]]etapa[[*]]especif[[*]]unid[[*]]qtd[[*]]01/01/2000[[*]]02/02/2000[[**]]"; String[] split = teste.split("[[*]]"); for (String string : split) {…
-
3
votes2
answers146
viewsError concatenating string from path
In this program right at the beginning has a function that creates a folder in the user’s documents to save some information Giving a research I came to the conclusion that it should stay like this:…
-
3
votes1
answer46
viewsformat paragraph <p>
I run some js functions in a given text. adding classes and removing classes. The final html generates some breaks in the paragraph, like this: <p style="text-align: left;"> “obviamente” “ nem…
-
3
votes2
answers90
viewsView div according to day and time
I’m setting up a system (kind of emergency) for the church, for live broadcasting, because of social isolation. On the page where I am incorporating live, on the church website, I want that if the…
-
3
votes2
answers107
viewsList Birthday Kids of the Day Using Laravel
I use the code below that gives me a list of birthdays per month, but would need for the current date. Example: today 09/04 and the list display. $aniversariantesDoMes =…
-
3
votes1
answer54
viewsImplement only direct methods from an interface
Let’s say I have the interface Vehicle: public interface Vehicle { void moveForward(); void moveBackward(); void moveLeft(); void moveRight(); } And the interface LandVehicle: public interface…
-
3
votes1
answer689
viewsMemory release in python dictionaries
I’m trying to develop a program that temporarily stores a significant amount of variables. These variables are stored in RAM memory, inside dictionaries. But I’m having a hard time understanding how…
-
3
votes2
answers92
viewsText appears fast
The page is running all right, but when I click on the menu it displays the text very fast and then deletes. Could someone give me a light why the text disappears after the click?…
-
3
votes3
answers125
viewsSave or remove accent on a Textareafor
Hello. I have a Textareafor which receives the HTML content, however when saving the data, the accents and special characters are encoded and I have problems later when editing or viewing the data.…
-
3
votes4
answers422
viewsWhat is the best way to convert an int array to String in Java?
What is the best method to convert {1, 2, 3, 4, 5} for "12345" ? Example: int[] array = {1, 2, 3, 4, 5}; array.toString(); // Existe alguma função que faça isso? I know you can do it with a for loop…