Categories
Ask Mathematics

How to obtain the common numbers between this 2 sequences?

Any odd number can be written as: $$ n = \left(\frac{n + 1}{2}\right)^2 – \left(\frac{n – 1}{2}\right)^2 $$ If I take: $$ a^2=\left(\frac{n + 1}{2}\right)^2 $$ and: $$ b^2=\left(\frac{n – 1}{2}\right)^2 $$ If I subtract $1$ from $a$ or $b$, then $3$ to the previous, then $5$ and so on, I will always obtain $n$ […]

Categories
Development

How contour an image area with known coordenates?

I have an ultrasound image and the coordenates (array of x and y points) of the tumour of each image. How can I make a contour around the tumour with those known coordenates using “cv.drawContours()”? I wish to delete all the information around the tumour and stay only with the tumour image/information. temp=np.array([[284., 60.],[276., 59.],[269., […]

Categories
Development

Two-Way Repeated Measures ANOVA: Error in lm.fit()… 0 non-na cases (rstatix)

I am trying to run a Two-Way Repeated Measures ANOVA using the R Statix package based on the description from here however I am running into the subject error with my dataset. The data consist of 10 replicate biomass measurements recorded at each of 8 Locations across 5 months (10 reps x 8 locations x […]

Categories
Development

Writing function to find longest path through list (recursion maybe?)

I have a sorted list of up to 50 items as so: [50,120,160,180,190,250,260,280,300,400,410,475] and I have legal possible ‘spaces’ in another list (about 20): [30, 60, 70] basically I’m trying to figure out the longest line possible using those spaces as the allowed amount between each value That is in this case, we’d have 50,120,180,250,280 […]

Categories
Development

JFreeChart bar chart category axis offset

I’m using JFreeChart to generate a bar chart, which is working fine. Dataset contains multiple values but if dataset contains only one value bar is getting displayed in middle instead of bottom: I need it to display like following: Following is the code that I am using to generate the bar chart: double max = […]

Categories
Development

Logistic Regression of Coordinates (flow_from_dataframe)

I am trying to run an image through a simple Conv net and get an x and a y (coordinates) as outputs. I have a pandas Dataframe consisting of three lists: df = pd.DataFrame({‘filename’:full_path_list, ‘x_coordinate’: x_coordinate,’y_coordinate’: y_coordinate}) full_path_list: a list of strings which are paths to the images x_coordinate : the x coordinate I am […]

Categories
Development

findContour function finds only one contour

I have been trying to find contours of brown regions on frame on the right side. roi and result firstly, i think i need a region of interest. and my coordinates are fixed. (378,68),(271,260) So, I am using findContour and drawContour functions on this region of interest. I can find region of interest sucessfully. But […]

Categories
Development

How to minimize the sum of the elements in the final array after performing k number of operation

This question is asked in my interview coding and there were 12 test cases and i am only able to pass 8 of them. minSum(List values, int k) method need to complete. Example : nums = [10,20,7] and k=4 ans answer for this array is 5+5+4=14. Each operation consists of removing element from the array, […]

Categories
Development

How to create a .prn file fill with variables and pull to printer for print barcodes in java 8

I want to create a .prn file for printing bulk quantity of barcodes. Here the sample code that provide the company. here i want to push this code via java code to printer directly SIZE 103.1 mm, 30 mm DIRECTION 0,0 REFERENCE 0,0 OFFSET 0 mm SET PEEL OFF SET CUTTER OFF SET PARTIAL_CUTTER OFF […]

Categories
Development

When (if ever) to modify checkpointed metadata of streaming query in case of failure?

I have a doubt regarding Spark Checkpoints. I have spark streaming application and I’am managing Checkpoint n HDFS using following approach :- val checkpointDirectory = “hdfs://192.168.0.1:8020/markingChecksPoints” df.writeStream .foreachBatch { (batchDF: DataFrame, batchId: Long) => batchDF .write .cassandraFormat( “table”, “keyspace”, “clustername” ) .mode(SaveMode.Append) .save() } .outputMode(OutputMode.Append()) .option(“checkpointLocation”, checkpointDirectory) } Now When I run the Application, in […]