Categories
Mastering Development

How to display particular rows from JSON data in Ionic 4

I have two JSON data given below: userMcData=[{“MACHINE_ID”:4,“MCNAME”:“RF21”},{“MACHINE_ID”:5,“MCNAME”:“RF22”},{“MACHINE_ID”:6,“MCNAME”:“RF23”}] userMcData JSON shows the Machine ID and Machine Name. items=[{“Mcname”:“RF21”,“Side”:“L”,“Breaks”:101,“1”:20,“2”:10,“3”:15,“4”:11,“5”:9,“6”:10,“7”:6,“8”:8,“9”:12,“10”:0,“11”:0,“12”:0,“13”:0,“14”:0},{“Mcname”:“RF21”,“Side”:“R”,“Breaks”:94,“1”:18,“2”:11,“3”:11,“4”:3,“5”:11,“6”:18,“7”:10,“8”:5,“9”:7,“10”:0,“11”:0,“12”:0,“13”:0,“14”:0},{“Mcname”:“RF22”,“Side”:“L”,“Breaks”:151,“1”:12,“2”:13,“3”:13,“4”:25,“5”:15,“6”:12,“7”:29,“8”:17,“9”:15,“10”:0,“11”:0,“12”:0,“13”:0,“14”:0},{“Mcname”:“RF22”,“Side”:“R”,“Breaks”:316,“1”:51,“2”:27,“3”:23,“4”:26,“5”:28,“6”:57,“7”:39,“8”:41,“9”:24,“10”:0,“11”:0,“12”:0,“13”:0,“14”:0},{“Mcname”:“RF23”,“Side”:“L”,“Breaks”:164,“1”:15,“2”:22,“3”:19,“4”:14,“5”:13,“6”:20,“7”:15,“8”:22,“9”:24,“10”:0,“11”:0,“12”:0,“13”:0,“14”:0},{“Mcname”:“RF23”,“Side”:“R”,“Breaks”:0,“1”:0,“2”:0,“3”:0,“4”:0,“5”:0,“6”:0,“7”:0,“8”:0,“9”:0,“10”:0,“11”:0,“12”:0,“13”:0,“14”:0}] items JSON shows the Machine ID,Side,and some more columns. In this JSON, each Machine must have 2 rows. Both the JSON data are dynamic. I want to show this data as given below: Image1 I want to […]

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

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 Linux

problem escaping quotes in script

I’m constructing a command line for use with the ‘mogrify’ tool [part of imagemagick]. the finalised command line looks something like this : mogrify -stroke yellow -draw ‘line 0,0 0,319’ -draw ‘line 125,0 125,319’ -draw ‘line 652,0 652,319′ file.png I echo the command before executing it. If I copy/paste this echo’d line as a new […]

Categories
Development Python

Parsing a .pdb file in Python and creating a dictionary for specific record types

First, let me start by saying that I’m doing this as a Python exercise and I’m not allowed to use Biopython. I am writing a script that will help me parse any .pdb file generated from a trajectory. I am trying to create a dictionary that would link the chain variable with the resNumber variable. […]

Categories
Development Domain

GUI how to connect 2 frames and hand over a String array?

I want to connect frame one JFrame(WagenGUI) with another JFrame(ausgewaehlterWagen) and hand over a String array from WagenGUI to ausgewaehlerWagen, which contains the vehicle, which was selected in the JComboBox. I thought that I just could hand over the String array to ausgewaehlterWagen (Wagen = vehicle) and it could work. Unfortunately I get a wall […]

Categories
Development

How to get extremes from already determined groups of peak/valley indexes? [python]

I’m sorry if i’m butchering the question but essentially i have 3 arrays. One array which is the signal data, and an array of peak indexes and an array of valley indexes. The problem however is that sometimes there will be multiple indexes for a peak in a row before there is a valley index. […]

Categories
Development

Combine blocks of different images and produce a new image

I have six photographs. I changed them into block structure. Consider an image of size 200×200. 1. I converted into blocks of 10×10 so now I have 400 blocks in total each of size 10×10. I did this for each image. 2. Then I found the mean value for each block. Again for all images. […]

Categories
Development MySQL

How to improve MySQL stored procedure run for 20 seconds

I have a stored procedure which will run for 20 seconds and make high cpu usage, I found it in the slow query log, this stored procedure always exist and will run for 15 to 30 seconds. I believe this stored procedure caused the high CPU usage. So I am trying to use explain to […]

Categories
Development

How to efficiently parse large HTML div-class and span data on Python BeautifulSoup?

The data needed: I want to scrape through two webpages, one here: https://finance.yahoo.com/quote/AAPL/balance-sheet?p=AAPL and the other: https://finance.yahoo.com/quote/AAPL/financials?p=AAPL. From the first page, I need values of the row called Total Assets. This would be 5 values in that row named: 365,725,000 375,319,000 321,686,000 290,479,000 231,839,000 Then I need 5 values of the row named Total Current […]