Posts by Gomiero • 5,286 points
130 posts
-
1
votes1
answer8780
views -
7
votes3
answers844
viewsA: Sorting of object vectors
Answering the question: The problem that is giving is in the call of the function Sort: The function sort is the type Comparable and must return a value of type bool (and not a pointer to the class…
-
2
votes3
answers315
viewsA: How to access a pointer within a structure?
Assuming you declare a variable x, of the kind expressao_complexa, access can be made directly: ... expressao_complexa x; // atribui um valor x.c_vector.c_parte_real[0] = "1.0"; // imprime o valor…
-
7
votes2
answers413
viewsA: How do I return a particular character from a text?
You can use the command string.sub: > string.sub(text, 5, 5) o This command takes as parameters the string, the initial position and the final position. If the final position is not reported, it…
-
2
votes1
answer38
viewsA: Join method is not working
Probably the parenthesis sign in the command print should be: for row in board: print(" ".join(row)) # -> aqui!! After the change, the program prints: O O O O O O O O O O O O O O O O O O O O O O…
-
3
votes1
answer1582
viewsA: Assign value to a variable in Assembly 8086
The function int 21,1 returns the character read in the register AL (and not in the AH). To load the register value AL in memory position simbolo, use the command: mov [simbolo],al The bracket…
-
3
votes1
answer1446
viewsA: Line exchange in the matrix
I believe you’re using the library numpy, therefore, the variable listaAux stores only a display of the matrix and not the data (and therefore, it "changes" the value). When you change the matrix,…
-
0
votes2
answers1966
viewsA: Pandas Soma Condicional
According to the response of Soen, another possible way to get the sum column is you eliminate the looping and use a groupby (aggregation) to create the new column: df2['soma'] =…
-
4
votes1
answer86
viewsA: Difficulty placing non-significant zeros in a converted binary number
The operator shift has a cap that depends on the platform/compiler. If you are using the gcc on a 64-bit PC platform, for example, and exceeding 64 the behavior of that operator is undefined. A…
-
3
votes3
answers221
viewsA: Redirect page if resolution less than 767px
Without using Jquery, you can check the width of the window, for example through the properties: document.documentElement.clientWidth document width window.innerWidth browser width (with scroll bar)…
javascriptanswered Gomiero 5,286 -
5
votes2
answers2251
viewsA: Chained list - remove function
The function Remove is getting into looping because after the first iteration, the pointer value q is "lost". There are 2 more problems in this function, follow the code below with the commented…
-
2
votes1
answer395
viewsA: Chained list without head, intersection function problem
The function Pertence() is not checking if the parameter p (assigned to the local variable q) is a null pointer and when accessing the element conteudo, error occurs in the Runtime. Just change the…
-
1
votes1
answer529
viewsA: Difficulty with socket.recv()
As the connection will be made to several servers (devices) continuously, it will be necessary to create a socket for each of the servers. The function recv can be set to work in modes: "lock" until…
-
0
votes1
answer511
viewsA: Product of nasm matrices
Follow the main problems in your code: The stack frame created, is not restored before return. At the end of the function, it is necessary to restore the stack: ... mov esp, ebp pop ebp ret The…
-
3
votes1
answer2333
viewsA: How do I split into Assembly?
The instruction div, divides the value (nonsignal integer) stored in the register pair edx:eax (dividend - 64 bits) by the target operator (can be a register or memory position - 32 bits), and…
-
1
votes1
answer153
viewsA: How to set up "gdb" for Intel syntax
The error is occurring because the command is abbreviated ("dis"). Try the complete form of the command (in interactive mode and/or in the file ~/.gdbinit): set disassembly-flavor intel…
-
1
votes1
answer821
viewsA: Python matrix using matplotlib and mplot3d
In 3 points, the script declares the matrix x with Shape (2, 1), however, uses this matrix in multiplication operations with matrices of Shape different (incompatible, for matrix multiplication…
-
1
votes1
answer445
viewsA: Assembly and C++ with Visual Studio 2015 and MASM x86/64
To create files with functions in Assembly 64 bits using Visual Studio 2015 (Community): Right-click your project, enter the menu Build Dependencies and then in Build Customizations.... On the…
-
6
votes2
answers1783
viewsA: Using variable with the sed command
According to the response of Soen: DirUpload=/var/log find $DirUpload | sed "s|$DirUpload\/||g" Use double quotes to expand variables Use a different tab than / (in the example: |)…
-
2
votes1
answer112
viewsA: Requirejs data-main does not work
The mistake happens because the jquery is not loaded at the time of execution. According to the documentation of requirejs (in English): ...it means that you can not assume that the load and…
-
4
votes1
answer95
viewsA: How to create C program that can use parameters?
Comfort indicated in this answer from Sopt: To compare strings in C, use the function strcmp. Example: if (strcmp(argument_value[1], "detailed") == 0) {printf("\n detalllll");}…
-
1
votes1
answer353
viewsA: Run Fortran code that prompts reading data in jupyter-notebook with python Restart kernel
Problem happens due to notebook jupyter unable to process standard input (stdin) in sub-processes. Even if you execute a command shell (run, too, in a sub-process) that uses the standard input, the…
-
7
votes1
answer8320
viewsA: Python Hangman Game
Inside the looping while perguntarNovamente:, you are initiating the variable erros = 0, therefore, every time the looping is executed, this variable returns to zero. A possible solution is to…
-
3
votes2
answers1014
viewsA: How to copy a canvas to an image
A possibility to copy data from canvas for the image (DOM), is to use the method toDataURL(), canvas element (not context!). This method returns the image representation in a format URI (PNG…
-
2
votes1
answer419
viewsA: Implementation of ANSI C queue
For the queue to store generic structures, one possibility is to make the array of elements point to a array pointer-type void ** (to allow deference). To struct is as follows: typedef struct Queue…
-
0
votes1
answer192
viewsA: Problem with Dynamic Allocation - Segmentation Failure
Probably, the problem is happening due to lack of variable initialization dadosEntrada. How this variable is declared in the stack (within the function main), it may contain some value other than…
-
2
votes1
answer2822
viewsA: How to get all the HTML of this page as a string?
According to the comment, the solution is to change the variable url to take only data from the profitability table, which is contained in the iframe. The command line is as follows:: string url…
-
4
votes4
answers1407
viewsA: How to work with values that far exceed the long (64 bit) limit value
There are several ways to store and perform calculations with arbitrary precision numbers. I believe the simplest example is to store the digits that make up the number in a string and do the…
-
0
votes1
answer297
viewsA: Would any kind of collision apply in this case?
I’m not sure I understand exactly the problem, but follow a very simple example, using the logic indicated in the @Luizvieira comment, which I believe is the more efficient for this case (without…
construct-2answered Gomiero 5,286 -
1
votes1
answer280
viewsA: How do two objects always keep the same distance from each other?
As the two objects move parallel and always the same distance, I believe that the simplest solution is to directly challenge the position of second object according to the position of the first,…
construct-2answered Gomiero 5,286 -
1
votes1
answer229
viewsA: Srlua - Problem after compiling
I tested the program with the versions: moon-5.3.2, srlua-5.3.2, classlib 2.04.04; and no errors occurred. Follow the steps used to compile: Archives: C:\tmp\teste-lua>dir /b classlib.lua…
-
8
votes2
answers902
viewsA: Domain . com has more relevance than . Tk to google?
No, it’s no longer relevant. According to this post (in English) from one of Google’s quality search team engineers, this is a myth and the higher-level domain (TLD) has no relevance in the…
-
2
votes1
answer726
viewsA: Python Tkinter text widget in another setting does not allow Insert
I believe the problem is happening because the variable texto does not have a reference within the class, therefore the method escreve cannot access this variable. If this is the problem, a possible…
-
4
votes1
answer719
viewsA: What are Ttys for?
What is the use of these ttys and why there are so many? The tty (The TYpe Writer) is a driver connecting a device physical (e.g.: keyboard, modem, printer) core of the operating system. It is used,…
-
5
votes1
answer3474
viewsA: Functional requirements, non-functional requirements and domain requirements, what are the differences between them?
Are terms that are part of the process of Requirements Engineering. As there is a lot of technical literature available (see links in the end) in this regard, this answer is an "practical example"…
software-engineeringanswered Gomiero 5,286 -
1
votes1
answer132
viewsA: How to preserve Mozilla Firefox Browser Console Log?
In the development console, there is an option Toolbox Options: By clicking this option on the screen Common Preferences, you can choose Enable persistent logs: tested with Firefox 44.0.2 (64-bit)…
-
4
votes1
answer333
viewsA: My character follows the mouse, but keeps turning upside down
How the character has the behavior Bullet activated, I believe that a possible solution is to use the method Set angle of motion (that behavior), instead of Set angle toward of the character. The…
construct-2answered Gomiero 5,286 -
1
votes2
answers58
viewsA: Error using alias and read in Shellscript
How there is a function call CreateFolder at the end of the archive .bashrc, it is already running this function right after login. Follow an example of a function that asks the user the name of the…
-
1
votes3
answers246
viewsA: Deal with exception that guaranteed will not occur
I’m not sure I understand exactly the problem, but I believe you can treat each of these null exceptions separately, and fire new exceptions within the type provided in the method statement comprar.…
-
1
votes2
answers1024
viewsA: How to find the size of a character array?
As the number of responses per student is fixed (in case 5), you can use the function sizeof only with the first element of the vector: sizeof(respostas[0]) Responding to the comment: "the program…
-
0
votes2
answers57
viewsA: Redirect Flex input to a string
Flex reads data from variable yyin, which is of the file or file type. By default, this variable is associated with input STDIN. You can associate this variable to another file or file (e.g., in a…
-
2
votes1
answer742
viewsA: Parser misidentifying tokens (Flex and Bison)
In the Lexer There are 2 problems: Here, the token INT returns an integer number, but in the parser, it expects a type int: integer {digit}+ ... {integer} {adjust(); yylval.ival = atoi(yytext);…
-
1
votes3
answers647
viewsA: Copy file to Clipboard using Powershell
I believe the simplest way is to use the commands type and clip: type C:\NomeArquivo.txt|clip
-
1
votes1
answer1015
viewsA: Custom window other than standard in python
I’m not sure I understand different, but you can change the theme of windows to use native system elements (X11, Windows, etc.) with the command from ttk import *: Example: Without the ttk: With the…
-
8
votes5
answers3446
viewsA: What is the definition of Machine Learning (Machine Learning)?
What Machine Learning Would Be? In accordance with the Wikipedia, are algorithms and techniques that allow the computer to learn, that is, that allow the computer to improve its performance in some…
-
2
votes1
answer49
viewsA: Logical error no for
I’m not sure I understand correctly the problem, but probably the error is on the line: cin >> resp; Within the function Ask_PlayAgain(). In the reading of the standard input, a character is…
-
1
votes1
answer1846
viewsA: How to calculate NPL (NPV) and IRR (IRR) using Javascript?
VPL According to the Wikipedia formula: Net present value [...] is the mathematical-financial formula capable of determining the present value of future discounted payments at an appropriate…
-
1
votes1
answer36
viewsA: Underline between two variables
One possibility is you put the name of variables between keys {}: #!/bin/sh pasta="data-integration" MA="MA1" ano="2015" mes="11" tabela="HT_MA1_ESS_SEG" echo…
-
2
votes1
answer754
viewsA: Algorithm of adjacent numbers with complexity O (N * log (N))
According to the answer: Adjacent values Apparently, the definition of what is valor adjacente for the problem described in the question. A possibility, if the rule for valor adjacente be it: ... A…
-
6
votes1
answer8184
viewsA: Is there anything similar to WITH(NOLOCK) of SQL SERVER in ORACLE?
According to this question in the OS in English, the performance gain occurs when the NOLOCK is used in the clause SELECT. The answer to Oracle is: No, it doesn’t exist. As per the version…