Posts by Jefferson Quesado • 22,370 points
421 posts
-
22
votes2
answers1602
viewsA: What is Inter Process Communication (IPC)?
CPI: inter process Communication. The easiest part of the question has already been answered, but it covers much more underneath. I’m going to take the liberty here and tell you that process is all…
-
9
votes1
answer517
viewsA: Parallelize python Odd-Even Sort sorting algorithm
General idea for the ordination To make the most of the parallelism, try to use the communication between parallel tasks as little as possible, so you won’t need synchronisation during the…
-
13
votes3
answers971
viewsA: Is POO the same in all languages?
tl;dr mathematically yes; in practice, one or the other paradigm makes some constructions meaningless Object orientation is a mathematical branch of treating mathematical entities that have…
-
3
votes3
answers138
viewsA: Is it possible to use for loop to reduce C code?
You have a very special case there. I believe that EEPROM_A## be a family of macros. Macros work at the pre-processing level of the source file, a purely textual processing that takes place before…
-
10
votes1
answer1457
viewsA: Error while creating Makefile
Repeat after me: never include .c for no other reason We can use yours more efficiently Makefile using automatic variables. See that answer explaining a little about the variable $<. For an…
-
1
votes1
answer113
viewsA: How to change Cartesian file coordinates in an automated way
Let’s iterate over a number of desired coordinates. For that, I’ll need a little bit of integer arithmetic in the bash and, in iteration, let’s use a command expansion (I talk more about command…
-
3
votes1
answer127
viewsA: PUT and DELETE methods with Httpstream?
Do Javadoc (my griffin): The default type is GET. You can also define a custom type, like if you want to use restful services. In this case, the header will be set to what you store in the httpType…
-
1
votes3
answers1827
viewsA: Shell Script - compress one file at a time inside the Current Folder
Let’s talk about Unix The current directory is also known as Working directory. In the Unix world, there is the command pwd which means print Working directory. Basically is a built-in available in…
bashanswered Jefferson Quesado 22,370 -
1
votes1
answer133
viewsA: How to extract an attribute of type totalcross.util.Date from a JSON
The class totalcross.json.JSONFactory interprets shallow data setters and deep objects with standard builder. What would be a shallow datum? It’s data that doesn’t have data internally. And deep…
totalcrossanswered Jefferson Quesado 22,370 -
0
votes2
answers1421
viewsA: How do I convert a SQL Server backup file into . BAK for . CSV?
Understanding the file . BAK The file . BAK is a system restore point file. It allows you to restore all in your database. To understand what a database is, I recommend reading of this reply by…
sqlanswered Jefferson Quesado 22,370 -
11
votes1
answer1341
viewsA: How can I list all invalid emails?
TL;DR Generally speaking, the most standard emails follow the regular expression [^@]+@[^.@]+\.[^@]+. In sql, more or less the following takes the a good part positive cases of email: SELECT * FROM…
-
1
votes2
answers205
viewsA: Why do some functions that work with C strings start with *?
Being pedestrian in reading function statement This mistake happens due to the School of Style code of the person who wrote this function. I will write equivalent headers, each in a distinct style:…
-
0
votes2
answers418
viewsA: Problem with Table UPDATE based on summation of another table
His logic was almost right. Two details were missing. You don’t want to do an update based on a merge. You just want to do it based on a grouping. You want the total traffic of a given MAC address…
-
1
votes1
answer418
viewsA: Count the amount of my IF records
Take your appointment, let’s call it Q_ORIGINAL. Declare her in a CTE. To get used to Ctes, it is an alternative to Subqueries that I find very elegant. Let’s start from here, which gets exactly the…
-
13
votes2
answers5048
viewsA: What is a context-free language?
To Reply by @Victor Stafusa is excellent, I come here only to deepen some points. Parlance One language is a subset (finite or infinite) words generated by the operator Kleene star on a set of…
-
21
votes1
answer7076
viewsA: What’s the point of git push -u?
-u | --set-upstream When your branch is not mapped to a remote upstream repository, you can use this setting to set and push at the same time to push and, if push succeeds, set the upstream as being…
-
0
votes2
answers169
viewsA: Passing struct to function giving error
What you wish you had done was: void ordenar(agenda *vet) { /* apenas o código da ordenação aqui, sem leitura de arquivo; essa função deve apenas ordenar o vetor */ ... } agenda…
canswered Jefferson Quesado 22,370 -
5
votes2
answers10186
viewsA: How to order a chained list in alphabetical order?
My idea to solve your problem is to use Quick Sort to sort your list simply chained. So I’m going to use a function here impl_comp which will compare two elements of the list (data will be passed,…
-
3
votes1
answer104
viewsA: A creak within a range
We will divide your problem into parts: Avoid entering a value if any conditions occur Identify existence of intersection in real number ranges So we can independently treat each point…
sqlanswered Jefferson Quesado 22,370 -
3
votes2
answers96
viewsA: C++: File header not recognizing class
In C has a concept called forward declaration. I know this concept for functions, where I can declare the existence of the function to, only at a later time, explain how is the implementation. In…
-
6
votes11
answers38715
viewsA: How to check if the variable string value is number?
I missed an answer with regular expression. For whole patterns: import re # pacote com as rotinas de expressão regular pattern_int = re.compile(r"(0|-?[1-9][0-9]*)") entrada = input() if…
-
1
votes2
answers146
viewsA: Where is the error of that code?
I was looking here for an algorithm that would use the prime factors of the number to determine whether it is perfect or not, but I couldn’t find anything related. It must be because factoring and…
canswered Jefferson Quesado 22,370 -
8
votes3
answers2734
viewsA: How to use the REPEAT command in this algorithm?
I can sin in the exact syntax of Portugol/Visualg, but the idea is valid. I ask to correct any slippage my The repita, as well as the para is a repeat instruction. Use : repita # códigos e mais…
portugolanswered Jefferson Quesado 22,370 -
4
votes2
answers742
viewsA: Deny/hide access to files starting with dot, like . git, . svn, . Ds_store, . yml
For file server case, it is more reliable to block direct access to files/directories that start with prefix ., because it usually contains configuration information that can be confidential, better…
-
5
votes1
answer4559
viewsA: Divisible - Portugol (VISUALG)
As I don’t know the exact syntax of portugol/visualg, please correct any slip This is a problem whose answer needs to meet a decision question and also needs to meet the formatting of an answer.…
-
7
votes3
answers2425
viewsA: Why in Java is the size of an array an attribute and a String and a method?
Just to give more details to reply from @user28595. Like the @Maniero noted in his comment, strings are immutable entities. In the other comments more links have been placed on the subject of…
-
0
votes3
answers4799
viewsA: How to remove clasps in a regex?
About regular expressions in general, for uses other than Javascript Always walk with the Guide to Green Aurelius regular expressions (direct link to the list part). You can by closing the square…
-
2
votes1
answer2486
viewsA: Stack, pop function, it has to remove at the end
A stack or a queue is managed with behavior. Just follow the respective contract that reaches the battery behavior or the queue behavior desired. The contract of pile is lifo: last in, first out…
-
1
votes1
answer691
viewsA: Removing elements from a Python list
Only after the@AndersonCarlosWoss identified that there was another identical question, I saw that his answer is much wider than mine. See /a/190086/64969 Use list comprehension Be it sala a student…
-
2
votes1
answer264
viewsA: C - Structures for point, polygonal line and polygon
Although you do not need this to answer your question, a line is defined by two points : start and end point. Therefore, it should be : typedef struct { Ponto p0, p1; } Linha; A polygonal line…
-
4
votes2
answers480
viewsA: Deleting lines only if any cell in the worksheet is empty (using a script)
We want to select only lines that have two filled cells in a csv. For this we can use the following regular expression : ^..*,..*$ I am using simple regular expressions, so that even processors that…
-
3
votes2
answers1752
viewsA: Split a worksheet into multiple worksheets
Observing: this question aims at an answer in Python, but I believe this answer in bash can bring new air and, also, serves as curiosity To make a proper textual treatment in bash, I am assuming…
-
1
votes1
answer640
viewsA: MYSQL+PHP, How to add items from different tables SUM()?
Note: I have a limitation that I don’t have a Mysql available to test, so I’m running tests on Sqlite; so if any syntax is incorrect, please correct/notify me To know the relationship between parent…
-
2
votes1
answer65
viewsA: Is it correct to cast an exception within a Synchronized?
Releasing exceptions is a normal process in Java development. It has no side effect. The Totalcross virtual machine has exception handling very similar to that of the JVM. In the international Stack…
-
9
votes1
answer1523
viewsA: Python. pyc file function
Python, like Java, works with a virtual machine. In the case of Java, it is mandatory to send to the virtual machine only the compiled code, therefore the code of the .class. In Python, the virtual…
-
6
votes3
answers6084
viewsA: Recursive palindromus C
Taisbevalle’s response is beautiful, but I felt it did not touch where Marcelo de Sousa made his mistake. Strings Basically, the problem was not in the recursion understanding, but in the string…
-
2
votes2
answers3403
viewsA: Largest number function in a tree
The first step I take when solving a problem is knowing what I’m dealing with. In our case, we have a binary tree in which all nodes, not just leaves, have real value (ie, not just index values). It…
canswered Jefferson Quesado 22,370 -
1
votes1
answer81
viewsA: Strange behaviour of Rand() function
I read both documents, in English and Portuguese. I can say that there is a very big difference between them. See the documentation in English if you have no problem with English. I also checked the…
-
26
votes3
answers1101
viewsA: What is the difference between architecture, engineering, science, analysis, design, programming and coding?
Computer Science Computer Science is an area of mathematics, as is the name of a college course. In the faculty of Computer Science (sometimes referred to as Computer Sciences), You study the basics…
-
4
votes3
answers3586
viewsA: In programming, what is an object?
Adding to Maniero’s magnificent response. From past context, I believe you are dealing with an object-oriented language with access to primitive types such as Java and C#. An object in an abstract…
-
1
votes2
answers997
viewsA: Join lines from a text file
We can assume we use bash 4 up, right? In this case, we have associative vectors/mappings. Since we’re working with text, this is the type of basic variable of bash, then we’re home. Let’s call our…
algorithmanswered Jefferson Quesado 22,370 -
7
votes2
answers1778
viewsA: What is a binary operator
Binary operator is one that gets two operands. And this can be a pain in Bash. Something I usually do a lot is to check if one number is larger than or equal to another. For this, I use the test…
-
1
votes2
answers1183
viewsA: Add multiple objects to a list
I believe that what happens is the reuse of the object called frame. In your code, at no time do you create a new object to call frame; you simply keep using the same object for everything. Java…
java-eeanswered Jefferson Quesado 22,370 -
3
votes3
answers1815
viewsA: How to start a range from 1
There are 3 ways to call the range in Python: range(INI, FIM, INC), this is, shall we say, the basic form of range in Python. The range starts with value INI, being incremented by the value INC at…
-
13
votes2
answers13039
viewsA: What is CI/CD? Benefits and Risks
I can tell you a little bit about my experience in my workplace. A priori summary: we are working to try to start a reliable IC to then have a CD to deliver value to the customer as soon as…
-
1
votes1
answer338
viewsA: Multiplication of C++ matrices
In the first point, you are using the value of the variables ia, ib, ja, jb, ic, jc before populating them. So they have only garbage and their program has erratic behavior. If you really want to…
c++answered Jefferson Quesado 22,370 -
3
votes1
answer1694
viewsA: How to determine intercession between polygons?
I think it’s reasonable to assume that the polygons in question are convex polygons. If one of the polygons is concave, the intersection can be a multiplicity of polygons: Before we begin to address…
canswered Jefferson Quesado 22,370 -
2
votes1
answer257
viewsA: Makefiles, include function
tl;dr makefile makes the expansion of your variables and commands working with text replacement; included files can be generated again and in this case read the makefile is restarted; a target can…
makefileanswered Jefferson Quesado 22,370 -
22
votes1
answer631
viewsA: What is the difference between DI, Factories and locators?
Dependency injection and Locator service (I’m assuming that with Locator you meant Service Locator) are ways of doing dependency inversion. Factories, in turn, care about instantiating objects…
-
1
votes2
answers212
viewsA: How to prevent my site from falling, when running a "heavy" script?
The first point I see is to try to make your code more testable, separate it into smaller units to know how each of them behaves, how much it needs, etc. I see here that you iterate over a…