Categories
Mastering Development

setTimeout not working client side on landing page

Good Afternoon, I am trying to have a loading animation for the pages on my site, but the client-side setTimeout function is not working. I have the same function on a test page with no bootstrap and no other scripts and it works, but once I put the script on my landing page it doesn’t […]

Categories
Mastering Development

Get spiral index from location in 1d, 3d

Based on a known {x,y,z,…} coordinate, I’m looking for the index of a location. A 2-dimensional (2d) solution, is provided here. I’m now trying to extend this to two other dimensions: 1d and 3d (and possibly to generalize to higher dimensions). For 1d, I ended up with the following algorithm (Matlab code), where the walk […]

Categories
Mastering Development

How do I update a table inside a python interface on Tkinter with input?

I am developing a python interface with login and an information table, but I found an obstacle that is preventing me from moving. I have tried to make the user able to modify (or update) a data table. At first I thought I would just need to give the row id and the chosen column […]

Categories
Mastering Development

How to optimize a function that matches observations according to certain criteria

I am looking for a more efficient way of doing an operation with a given dataframe. library(purrr) library(dplyr) Here is a step by step description: First, there is the function possible_matches, that for each observation i in df, gives the index of rows that are possibly matchable to i, which are going to be used […]

Categories
Mastering Development

family tree in SWI PROLOG

there is some error with the grandma , cousin, brother, uncle rules i tried so many rules but still could not find the correct one it returns false , please helpppppppppp /*rules*/ male(james). male(charles). male(william). female(megan). male(george). female(catherine). female(diana). female(elizabith). parent(james, charles). parent(james, elizabeth). parent(charles, catherine). parent(charles, william). parent(charles, megan). parent(elizabeth, diana). parent(diana, george). /*rules*/ […]

Categories
Mastering Development

ROS – SerializationError when writing a bagfile with custom ROS message

I have a created a custom ros message which has the following format # Header information std_msgs/Header header # Model string model # Data uint8[] data The data is a list of 4D lists reading from csv file def createData(csv_file): x,y,z,w = np.loadtxt(dataFile, usecols=(0,1,2,3), \ skiprows=0, delimiter="\t", unpack=True) p = [] for p1, p2, p3, […]

Categories
Mastering Development

Merging dataframes with different with different column names into one column in R (e.g. using dplyr::bind_rows() )

I imported this excel sheet as a list of dataframes. I want to merge the list into one dataframe. bind_rows() allow me to easily add together the dataframes, but the issue is that I have a variable/column that has different names in each dataframe. bind_row() will by default create two separate columns, with empty values […]

Categories
Mastering Development

Turn SpatialPointsDataframe to SpatialGridDataframe

I am trying to convert a SpatialPointsDataframe to a SpatialGridDataframe in order to use the slopeasp() function from the landsat package to get the values for slope. I tried to convert the SpatialPointsDataframe to a raster to convert it but it also didn’t work and I get the error. Error in as(pts, "spatialGridDataFrame") : no […]

Categories
Mastering Development

MATLAB and python gives different answer for quaternion

I have a rotation matrix in MATLAB PC=[0.4822 0.5070 0.7145 -0.4086 0.8516 -0.3285 0.7750 0.1336 -0.6177]; quat=rotm2quat(PC); %gives me [0.3937, 0.8641, 0.0319, 0.3119] %which is [w,x,y,z] Same matrix in python from scipy.spatial.transform import Rotation as R rot=[[0.4822 , 0.5070 , 0.7145],[-0.4086 , 0.8516 , -0.3285],[ 0.7750 , 0.1336 , -0.6177]] r=R.from_dcm(rot) print(r.as_quat()) # gives me […]

Categories
Mastering Development

Convert a list from findall predicate to a string prolog

I am struggling to identify a way to convert a list to string. This list is the output from a findall predicate. see below my code. edge(a,b). edge(a,c). edge(b,c). edge(c,d). edge(c,e). edge(d,e). edge(f,g). edge(g,h). route(X, Z, []) :- edge(X, Z). route(X, Z, [Y|T]) :- edge(X, Y), route(Y, Z, T). allways(X, Y) :- findall(E, (route(X, Y, […]