Categories
Mastering Development

I have a warning “passing argument 2 of ‘bins’ make integer from pointer without cast”, could anyone help me?

In a binary search, I have the warning I wrote in the title: #include <stdio.h> int bins(int, int, int, int);/*this function do a binary search*/ int main() { int n, low, high, v[]={0,1,2,3,4,5,6,7,8,9,10}; low=0;high=11; printf(“please enter the num you want to find\n:”); scanf(“%d”, &n); printf(“%d”, bins(n, v, low, high)); return 0; } int bins(int n, […]

Categories
Mastering Development

Determine if 2 segments located in 2 matrices intersect

I have two matrices stored as numpy arrays, each containing a number of segments. They look as such: ts = np.array([[ 26., 13., 40., 0.], [ 67., 17., 48., 79.], [ 8., 102., 11., 117.]]) vs = np.array([[ 237.01219512, 7.52439024, 158.50929615, 119.50398406], [ 237.01219512, 7.52439024, -113.48853868, 481.39398281], [ 158.50929615, 119.50398406, 154.50068752, 102.91663802]]) Basically each storing […]

Categories
Mastering Development

PyQT5 with matplotlib figure, the event loop is already running

I have a program, which by clicking button on PyQT app shows matplotlib figure in another window. When i click button, that windows shows, but on Figure nothing happends and in console i get this: QCoreApplication::exec: The event loop is already running I have a 3 classes and file with PyQT5 Gui. 3 class get […]

Categories
Mastering Development

Classical molecular dynmaics simulation by Sci-lab

I am doing classical molecular dynamics simulation where we are using the fact that interaction between two molecules i.e in our case noble gas is determined by LJ potential curve.To solve it we are using velocity velret method to do. Below is the code and paramter done in scilab where N=32,v0=1,tf=15 My code function [x,y]=artrial(N,v0,tf) […]

Categories
Mastering Development

If I want to store the user input in an array in Risc-v,how do I store the values and compare it

If I want to store the user input in an array in risc-v,how do I store the values and compare it  for example in mips I can do it like: addi $t1,$v0,0 sw $t1,array($t0) addi $t0,$t0,4 and then compare it like: lw $t2,array($t3) beqz $t2,label # if t2 = 0 then go to label addi […]

Categories
Ask Mathematics

Differential forms on Smooth affine plane Curve , Exercise

I am new to the concept of differential forms on Riemann surfaces and I would like to know if I am thinking about this right and if this is the way they work . So the exercise is Suppose we have a smooth affine plane curve $X$ defined by $f(u,v)=0$, show that $du$ and $dv$ […]

Categories
Mastering Development

Fortran Error: Rank mismatch in array reference (2/1)

i am looking for your help on this where i kept on getting an error at variables in do loops: Rank mismatch in array reference (2/1). I am new at Fortran and still couldnt completely understand creating two dimensional array and that is where i got the error. I am basically trying to create 2000×25000 […]

Categories
Mastering Development

Numpy point cloud to image

I have a point cloud which looks something like this: The red dots are the points, the black dots are the red dots projected to the xy plane. Although it is not visible in the plot, each point also has a value, which is added to the given pixel when the point is moved to […]

Categories
Mastering Development

Mips program infinite loop issue

I am currently trying to figure out why my mars program for creating an array is getting stuck in an infinite loop. I am trying to create an array using different functions and in the create array function the program is supposed to jump into a get number function and return the value to store […]

Categories
Development

What is mistake of this MIPS procedure call?

this MIPS code contain a function int func(int a, int b) that calls another function foo(a,b). func: addi $sp,$sp,-4 sw $ra, 0($sp) addi $a0,$a0,1 addi $a1,$a1,2 jal foo addi $a0,$v0,4 add $v0,$a0,$a1 lw $ra,0($sp) addi $sp,$sp,4 jr $ra This code contains some mistakes but I don’t know where wrong.