Posts by Gomiero • 5,286 points
130 posts
-
3
votes1
answer2225
views -
2
votes1
answer748
viewsA: Sqlite with Javascript does not work
The problem is happening in function call transaction.executeSql to insert data into the table. This function does not accept parameters of callback for error or success (tested in Google Chrome,…
-
3
votes1
answer206
viewsA: What type of project do you use to create a multiplayer game in Construct 2?
Its version of Construct 2 is old and has no multiplayer engine. The multiplayer engine was included in the version: r164 The solution is you upgrade to a newer version. Check if your version is…
-
3
votes4
answers385
viewsA: Obtaining the Rest of a Floating Point
Three forms: #include <math.h> double a=1.13; // -> Forma 1 double f1 = a - ((long) a); // -> Forma 2 double temp; double f2 = modf(a, &temp); // -> Forma 3 double f3 =…
-
1
votes2
answers1150
viewsA: Pass pythonic form parameters
I’m not sure I understand correctly, but follow an example: def Pessoa(nome, idade, flag): print("Nome: {0}".format(nome)) print("Idade: {0}".format(idade)) print("Flag: {0}".format(flag)) In the…
-
2
votes1
answer1799
viewsA: How to add a team (time counter) in Game
Here is a simple implementation example. div to present the time: <div style="z-index:1; background:rgb(50, 50, 255); opacity: 0.7; width:70px; height:20px;"> <p id="display_tempo"…
-
1
votes3
answers211
viewsA: Regex to ignore invalid file names
The expression below, finds the names files with the characters of the list .\~#%&*{}:<>?|"-!:: ^[^\\\#\%\&\*\{\}\:\<\>\?\|\"\-\!]+$ See a use case working in regex101 ^ match at…
-
5
votes3
answers5080
viewsA: Clear C buffer with fflush() or __fpurge()
According to this link - in English: The function fflush(), operates only on output buffers and if you force use with an input buffer (eg: stdin, used by scanf), the result is undefined. In this…
-
30
votes3
answers1005
viewsA: How to convert animation in Canvas/JS to SVG?
Update: Animation with Javascript For a simpler approach, see Animation (below) The animation of objects in a document SVG with Javascript can be made of various forms, such as: changing the…
-
1
votes1
answer420
viewsA: Problem compiling python in pyqt libraries, with py2exe
According to the information on this site: Pyqt 4.7 and py2exe error There is a recommendation to remove (or temporarily move to some other location), the directory port_v3, that in your question is…
-
5
votes3
answers186
viewsA: How to include columns in a Dataframe in Julia?
To include the new column, simply assign the value(s) to that new column. Example: df[:SinX] = sin(df[:X]) head(df) X SinX 1 0.0 0.0 2 0.06346651825433926 0.0634239196565645 3 0.12693303650867852…
-
5
votes3
answers186
viewsQ: How to include columns in a Dataframe in Julia?
I got the following DataFrame generic with 100 lines: using DataFrames df = DataFrame(X=LinRange(0.0,2π,100)); head(df) 6×1 DataFrame │ Row │ X │ │ │ Float64 │ ├─────┼───────────┤ │ 1 │ 0.0 │ │ 2 │…
-
2
votes1
answer752
viewsA: How to make a sum in Lambda with recursive logic using successor and predecessor?
According to the OS response in English: https://stackoverflow.com/questions/481692/can-a-lambda-function-call-itself-recursively-in-python It is possible to assemble a logical sum (or other…
-
1
votes1
answer325
viewsA: Problem with While condition in C++
According to the OS post (in English): https://stackoverflow.com/questions/10349857/how-to-handle-wrong-data-type-input The reason the program enters an infinite looping is because of one flag…
-
3
votes1
answer1893
viewsA: How to load 3D models of "obj" files to a Pyopengl application?
To import 3D graphics files (e.g., Wavefront obj, Collada, etc.) in an application Pyopengl, 4 simple operations are required: Create a dialog for the application Configure the parameters of Opengl…
-
6
votes2
answers108
viewsA: Cast in sockets
Extracted from the OS response: https://stackoverflow.com/a/13620771/3134655 The structure iphdr is used to directly access the structure of a package IP. In the code snippet below (taken from the…
-
1
votes1
answer1597
viewsA: Kruskal’s algorithm problem C++
I ran the program and it provided the following output (no errors, and with the input data you entered): 4 5 3 5 6 7 1 5 5 5 5 5 5 7 7 7 2 7 7 7 7 7 7 7 (E, F) = 3 (D, F) = 4 (G, H) = 5 (B, D) = 6…
-
1
votes2
answers2386
viewsA: How to make the if of multiple variables with "or" work?
Another option, besides the previous answer, is to use a structure if-else chained: #include<stdio.h> int main(){ int n; puts("ESCOLA UMA OPCAO"); puts("1. opcao1"); puts("2. opcao2");…
-
4
votes1
answer551
viewsA: Sorting with heapsort
From what I understand, the question refers to the first part of the algorithm, which is the construction of the heap. Like the traditional implementations of heapsort (siftDown) use a tree…
classificationanswered Gomiero 5,286 -
2
votes1
answer610
viewsA: How to handle the FPU stack in the x86 Assembly using NASM and functions in c?
The logic in using FPU is correct. There are only two problems in the program: 1) Data load for FPU When performing the function scanf to read the data, the informed format string is %d, so the read…
-
0
votes2
answers195
viewsA: Compile Linux-ready Assembly on OSX
As per this post in the OS in English: https://stackoverflow.com/questions/13091987/x64-nasm-pushing-memory-addresses-onto-the-stack-call-function The address of the message 'hello' must be related…
-
18
votes2
answers1063
viewsA: Challenge of the Ant Colony
By the text of the problem, I’m guessing the origin is this site: http://br.spoj.com/problems/ANTS10/ As the comments: of @Abriel: is a problem involving graph theory and @Eric-silva: It seems to me…
-
2
votes2
answers525
viewsA: Error with sem_init() function on Linux
According to the post in the OS (in English): Undefined Reference issues using Semaphores If you are on a Linux system, you need to include the library pthreads and rt (as the documentation in…
-
3
votes2
answers1988
viewsA: A Good Fortran Random Number Generator
There are several algorithms for number generation pseudo random and the choice of the ideal algorithm depends very much on the objective for which the numbers will be generated. The most widely…
-
2
votes1
answer85
viewsA: Does not write on screen, turns black and should appear a square 2x2
In VGA video mode (13h), it is possible to plot the points in two different ways: 1) Accessing the service 0Ch of the BIOS (however, this method is slow): mov ah, 0ch ; serviço 0Ch mov bh, 00h ;…
-
0
votes2
answers540
viewsA: Python: index 5324 is out of Bounds for Axis 0 with size 5040
As the space variable s can reach a maximum value of 0.524 in looping: while s <= 0.524 and v >= 0 Within the function B(s) (which calculates the magnetic field as a function of space), this…
-
4
votes1
answer9720
viewsA: How to list folder files on the network
To access UNC paths from the command prompt, Windows provides the command pushd, which creates a temporary path access letter (in reverse alphabetical order from Z:) and changes the current…
-
4
votes1
answer360
viewsA: C# Parallel.Foreach Javascript equivalent
To modify the collection within the function onmessage, you need to use a reference to the collection itself (self), instead of the variable 'result': self[event.data[0]] = event.data[1]; Just to…
-
3
votes1
answer797
viewsA: Read files with ";" in Fortran
There are several possible strategies to read the file in csv format with delimiter ';' and separate read fields. Below follows a commented example, which reads each line of the file and stores it…
-
2
votes1
answer578
viewsA: Handle services with powershell
The simplest way to run the script as Administrator by default is to directly configure the shortcut to "Run as Administrator": Right-click the shortcut and select "Properties" On the "Shortcut"…