Categories

## How to delete a node from the Hashmap C

I have an HashMap (struct table). It contains nodes doubly linked with two parameters: key, value. Hashmap may contains every data type. Insertion of nodes is generic, so the user must choose what data type insert in the hashmap. My aim is to create a generic function in order to delete a node with a […]

Categories

## How to force multiple r plots to have the same length of x-ticks? [duplicate]

Several packages in R are able to arrange mulitple plots into a grid, such as gridExtra and cowplot. The plots in the same row/column is by default aligned on their boundary. The following is an example. Three histograms are vertically arranged on the same plot. You can notice that the x-ticks are not algned and […]

Categories

## Editing a file based on a pattern appearance

I have a file that contains text and numbers like this: state(1, s(1,a), [s(1,b)]). state(1, s(1,b), [s(1,a)]). state(1, s(2,a), [s(2,b)]). state(1, s(2,b), [s(2,a)]). state(1, s(3,a), [s(3,b)]). state(1, s(3,b), [s(3,a)]). state(1, s(4,a), [t(1), t(2)]). state(1, s(5,a), [t(1), t(3)]). state(1, s(6,a), [s(6,b)]). state(1, s(6,b), [s(6,a)]). …so on I want the numbering with in s(x,y) to change as […]

Categories

## Intersection coordinates (lat/lon) of two circles (given the coordinates of the center and the radius) on earth

I am not that experienced in python but improving it thanks to this community! I desperately need a function which takes the input and gives the ouput below: Input: 1- Latitude/longitude coordinates of the center of circle 1 (e.g. (50.851295, 5.667969) ) 2- The radius of circle 1 in meters (e.g. 200) 3- Latitude/longitude coordinates […]

Categories

## How to add labels to multiple ggplot graphs (A, B, C)

I am trying to add the labels A, B, and C to the top left hand corner of each of these graphs. I have tried cowplot::draw_plot_label(), but nothing seems to work. Can anyone help? These A, B and C labels are not the main title of each plot. # Packages library(ggplot2) library(gridExtra) library(cowplot) # 1st […]

Categories

## How to calculate the angles between each two successive lines in polygon

I tried to calculate the angles between each two successive lines in the polygon using the law of Cosines: $cos(C) = \frac{a^2+b^2-c^2}{2ab}$, but I’m getting the Error: ValueError: math domain error, because the value of the cos obtained from that rule was out of range [-1, +1]. can you please advise me how […]

Categories

## Return blank cell if other cells have content

I would like to return a blank cell if either cells O2 or P2 are blank. Both O2 and P2 have a formula linking to another cell. Each thing that I try seems to put a number in my cell even when O2 or P2 are populated. Cell A2 has a date, so if O2 […]

Categories

## 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

## Prepared statement with parameters repeated multiple times throughout the query

I have a complex query issued via JDBC consisting of 2 string parameters and multiple SELECT statements, some of which nested. The same DB TABLE is queried multiple times and each query parameter is reused twice throughout the body. Looking at the JDBC driver logs I see that the 2 parameters (each of which appears […]

Categories

## Prepared statement with parameters repeated multiple times throughout the query

I have a complex query issued via JDBC consisting of 2 string parameters and multiple SELECT statements, some of which nested. The same DB TABLE is queried multiple times and each query parameter is reused twice throughout the body. Looking at the JDBC driver logs I see that the 2 parameters (each of which appears […]