Posts by gato • 22,329 points
373 posts
-
0
votes1
answer77
viewsA: Even if you get it right, the message doesn’t change!
In the method random you need to pass the class instance (an object) Screen with the self being that it represents its graphical interface, and through the self we can access the property txt which…
-
8
votes1
answer290
viewsQ: What is the relationship of Conway’s Law with software systems?
I was reading about the conway law. However, I still cannot understand it and its relationship with the structure of the systems. The provision of the law is as follows:: Any Organization that…
-
4
votes0
answers38
viewsQ: Do the processes executed in parallel relate to the number of Cpus nuclei?
I’m studying the module multiprocessing of Python, in which allow me to run several processes in parallel (in my understanding). As an illustration case let’s see the example below: import time from…
-
6
votes2
answers156
viewsQ: What are the principles of the dependency injection mechanism?
It has been a while since I try to understand the injection mechanism of dependency and its main essence, however, it does not enter my mind, maybe it is by not understanding the fundamentals and…
-
2
votes1
answer42
viewsQ: What are covering, Composite and compound compared to Dexes?
I’m reading on Left in Mysql and I came up with three terms that I can’t quite understand that are: covering, Composite and compound. These terms are strongly linked to the use of Dexes, however, I…
-
4
votes0
answers37
viewsQ: What are the differences between Asymchronism, Parallelism and Multithread?
Sometimes the terms Asynchronous, Multithread and Parallelism appears whenever I do a search related to multiprocessing or something related. However, I have a hard time understanding the…
-
0
votes1
answer31
viewsA: Local login validation
PHP has the function array_search which can be used for your case check in the documentation and heed her return. Example: <?php $user = 'admin'; $pass = 'senha'; //Usúarios e senhas que podem…
-
1
votes2
answers1401
viewsA: Installation libraries jupyter notebook
This means that the pandas is not installed because they are trying to find his module. You can use Pip: pip install pandas
-
7
votes2
answers165
viewsQ: What is the purpose of ? (question mark) in calling a function?
I’m studying the module Enum of the Elixir language in which it provides various functions that allows working with enumerables, However, one thing caught my attention in the call of some of the…
-
1
votes1
answer1063
viewsA: How to use pep8 in Vscode?
Go to the extension settings and search by config python.formatting.provider then set the value to autopep8, see below: See on documentation of Visual Studio Code.…
-
5
votes1
answer72
viewsQ: What is Big Data and what is its relationship to the relational model?
I was reading about big data, However, I still can’t understand what the big data would actually be in its essence. I have always used the RDBMS model for data storage and manipulation and at this…
-
3
votes0
answers47
viewsQ: What 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…
-
5
votes1
answer348
viewsQ: What is Pattern Matching?
I’m reading about the Pattern matching and I’m still very confused about this feature because it’s something new for me. Here are some examples: {:ok, result} = {:ok, 12} {:okay, 12} and 12 = result…
-
6
votes1
answer94
viewsQ: What is the purpose of the module in Elixir?
I’m studying Elixir and I came across the keyword defmodulo, I used to define a basic module that displays a message: defmodule Mensagem do def escreve(msg) do IO.puts msg end end Calling in the…
-
1
votes0
answers48
viewsQ: What is the relationship and differences between Process and Thread?
I’m reading regarding the class Process and in the documentation it says that it follows the implementation of Threads, however, I have a question regarding the process class and threads. Doubts How…
-
25
votes5
answers527
viewsQ: What is programming logic and computational thinking?
Lately I’ve been looking at some programming courses and I’ve noticed that they talk about a lot of things like frameworks and tools and focus little on the language itself, and that’s led me to…
computer-scienceasked gato 22,329 -
5
votes2
answers675
viewsQ: What is RDD (resilient Distributed dataset)?
I’m studying about Spark in Python and the acronym RDD always appears. However I can’t understand what this nomenclature is really about. So I’d like to know what it is resilient Distributed dataset…
-
2
votes0
answers129
viewsQ: How does the implementation test work?
I was reading the reply of Maniero regarding software testing and had a point in the reply that left me with doubt, so I would like a more detailed explanation regarding. The quote that left me…
-
3
votes1
answer111
viewsQ: Is there a relationship between data science and data analysis?
I was reading about data analysis and I had a question about the concept data science and data analysis. I can’t see the difference between the two terms, they both seem to me the same thing. Doubt…
terminologyasked gato 22,329 -
1
votes2
answers230
viewsA: What is the size_hint_x attribute in Kivy for?
According to the documentation: size_hint is a Referencelistproperty for the properties (size_hint_x, size_hint_y). That is, the size_hint receives a tuple in which it will be assigned to…
-
7
votes6
answers19845
viewsQ: How to change the name of the pandas dataframe column?
I am using pandas to process a CSV file in the following structure: nome;idade Fulano;28 Joao da Silva;27 Maria;29 The reading of the file is done as follows: import pandas as pd df =…
-
9
votes2
answers1354
viewsQ: What are the differences between an image and a container?
I’m reading about the Docker and I was confused about what a container and a image, the understanding of both are not clear to me. Questions What is a container in the context of Docker? What is an…
-
4
votes1
answer284
viewsA: I try to run a python function and it returns me None
There are some problems in your code. First, you’re not using the keyword return to specify the variable and the value to be returned by the function, simply add to your code: return lista Second,…
-
3
votes4
answers5284
viewsQ: How to center the elements within a div?
I’m trying to align the elements that are three circles with their respective descriptions within my div center using the following class: .center { margin:auto; } However, I did not succeed in this…
-
1
votes2
answers174
viewsA: Programming exercise C
Instead of keeping the whole word in the member estadocivil use only one character to represent what you want. Being: S single; C for married; D for divorced; So you can use a function…
-
2
votes7
answers115219
viewsA: Mask for CPF and CNPJ in the same field
I went through this problem too, where it was necessary to have a dynamic mask that could change shape to CPF or CNPJ. And since I’m only using Javascript I used a library that uses Vanilla…
-
5
votes1
answer584
viewsQ: What types of authentications are supported by HTTP?
I intend to delve deeper into authentications that are in the context of HTTP protocol, however, I don’t know their types. Therefore, I would like a brief explanation regarding the authentications…
-
2
votes1
answer126
viewsQ: How does the life cycle and visibility of the Flask object work. g?
In Flask there’s an object called g or Flask.g that according to the documentation is used for data storage. And this object is used when assigning something to it. For example: def get_db(): if…
-
4
votes1
answer83
viewsQ: Why is it hard to name things?
Reading this question I came across the following sentence: There are only two hard problems in Computer Science: cache invalidation and naming Things. -- Phil Karlton The focus is on the second…
-
1
votes0
answers41
viewsQ: What are "caches" in relation to web applications?
In the Inphinit Framework it is possible to cache HTTP responses, see an example: Route::set('GET', '/hello', function () { $cache = new Cache; if ($cache->cached()) { return; } return…
-
5
votes1
answer880
viewsQ: What is the purpose of the "request" and "Response" objects of a web framework?
Many frameworks that are based on routes use two objects at the time it executes the action corresponding to the route. See an example on Slim: $app->get('/hello/{name}', function (Request…
-
1
votes1
answer69
viewsA: Result of a command in a variable
You can use the function popen() who invokes the shell and returns a type structure FILE*. To do this just specify the command and the type that is for reading "r" in this case. An illustrative…
-
1
votes2
answers72
viewsA: What is the most practical way to change the sign from a numeric variable to a positive one?
In the module Operator there is the function neg() in which it allows us to apply an arithmetic negation, consisting of the inversion of the sign. Import the function neg() module operator: from…
python-3.xanswered gato 22,329 -
8
votes4
answers4137
viewsA: Is there a "main()" function in Python?
There is no function main() in Python, at least not explicitly. What we have is '__main__' which is the name of the scope of the code executed in top-level, and is defined in __name__ the name of…
-
1
votes1
answer85
viewsQ: What is the purpose of the "Pyobject" structure and what are the objectives of its members?
I’m analyzing the structure Pyobject of Cpython. The code for this structure follows below. Structure PyObject: typedef struct _object { _PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt; struct _typeobject…
-
2
votes1
answer704
viewsQ: How does Python handle common functions and internal Python functions?
I’m looking at Python’s dual functions compared to the common functions that use def to create them. See an example of a common function that converts a number to binary: def…
-
2
votes1
answer91
viewsQ: What are the terms Weak Entity, Weak Relationship and One Optional/Mandatory?
I’m using an online tool yEd Live to model a MER diagram. However, there are some elements that use terms in which leave me with some doubts. Those terms are: Weakentity (rectangle) Weakrelationship…
-
17
votes2
answers653
viewsQ: How does Python treat the "Yield" command internally?
Was reading on command yield from Python, and it seems to me that this command creates a Generator which would be a kind of data list in which the return on value occurs over demand, as if the last…
-
7
votes1
answer926
viewsQ: What would be WSGI?
I was reading about the term WSGI to understand a little more the operation of web applications in Python, and I realized that some microframeworks like Flask uses this technology. However, I still…
-
1
votes1
answer744
viewsQ: How does the "extends" and "block endblock" commands of Jinja2 work?
I’m using Jinja2 to create templates for my application. However, I was confused about two of its features. The features are: The command extends: {% extends 'pagina-exemplo.html' %} and the command…
-
4
votes1
answer164
viewsQ: What is each of the "data types" of the DOM?
I’m studying about the GIFT and I came up with a question regarding his data types, which are: document element nodeList node attribute namedNodeMap I didn’t really understand what each type of data…
-
6
votes2
answers549
viewsQ: What 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,…
-
2
votes2
answers174
viewsA: Problem with input of more than one integer with input
Realize that you must make a checking before to ensure that it is a number that is coming through the entrance, this is done by the function isdigit(). See below the example: numeros = [int(v) for v…
-
10
votes3
answers1899
viewsA: Repetition of if/Else how to reduce and improve code?
If you have to keep the variables Lstr_Resultado_N can add them to a list and use the method Count to count the number of occurrences according to a condition specific. Take an example: public class…
-
9
votes3
answers566
viewsQ: How does Python handle and represent an array internally?
In Python any type of array is of class type list, see: array = ['Gato', 'Jake', 'Finn'] print(type(array)) Exit: <class 'list'> That is, every array is an object of list. However, there is…
-
4
votes3
answers243
viewsA: Use of functions in Python
Think of a function whenever you want to do something specific. Let’s use your code as an example: def areaTinta(altura, largura): area = altura * largura tinta = area / 2 print('-' * 50)…
-
6
votes2
answers173
viewsA: Search range of numbers (string type) with Expression Lambda?
The operator >= does not work on strings in lambda expression, maybe in the future this will change. To get this behavior you must use the method Comparet, I believe I’m the closest to this. I…
-
1
votes1
answer87
viewsQ: Does the Flask micro-framework use the Action Based or Component Based architecture?
Was reading about the frameworks Action Based and Component Based. I have already used the Slim micro-framework and know that it is an Action Based framework, IE, more focused on actions, and the…
-
2
votes2
answers485
viewsA: How to list only PDF documents in PHP?
You can use the function: glob ( string $pattern [, int $flags = 0 ] ) : array for this purpose and specify what type of file pattern you want, which in case would be PDF. Take an example: foreach…
-
3
votes1
answer141
viewsQ: What gains do I get in specifying the type of a function’s argument?
It is now possible to define the type of argument that a function will receive. See this small illustration example: def soma1(v1: int, v2: int): return v1 + v2 def soma2(v1, v2): return v1 + v2…