Categories
Mastering Development

Encrypt with CryptoJS in JavaScript gives me different results from Java encryption

I am trying to replicate with CryptoJS an encryption done in Java using another library. The encryption’s result in Java is [111,60,-98,107,-60,5,-17,91,-52,60,-105,64,-88,31,97,-102,118,-39,-28,3,70,-12,21,-69,70,-22,-12,-91,102,-21,-88,5,82,-66,-122,34,14,-115,7,82,-55,38,-90,74,-4,62,104,104,61,-78,57,59,-51,31,84,-115,-45,-98,-87,-11,53,98,45,2,-52] and I know that this is the correct payload. So, I am replicating the same encryption with the same values but I don’t get the same array of bytes. The steps are: I […]

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 System & Network

smartctl on Linux, does not report certain S.M.A.R.T. values

I am hearing occassional (1/hour) clicking or switching sound (“tic-tic” and not “tic”) from my computer and try to investigate the health of the hard-drives first (mechanical WDC, 4 years old). I am running smartctl -A /dev/sda on Fedora Linux (30, updated recently). But in its report I can’t see the following S.M.A.R.T. values: 187 […]

Categories
Development

SELECT list is not in GROUP BY error but I got a result cleary

here is a code that I made. SELECT substr(to_char(birthday, ‘YYYY’), 1, 3) || ‘0’, emp_type, AVG(pay) FROM emp2 WHERE substr(to_char(birthday, ‘YYYY’), 1, 3) IN ( ‘196’, ‘197’, ‘198’, ‘199’ ) GROUP BY substr(to_char(birthday, ‘YYYY’), 1, 3), emp_type; The code is simple, just group people by 1960s, 1970s ,1980s ,1990s and find an average pay by […]

Categories
Development

How can I add one of two random numbers to each row of a csv proportionately?

I have a csv that contains 100 rows by three columns of random numbers: 100, 20, 30 746, 82, 928 387, 12, 287.3 12, 47, 2938 125, 198, 263 … 12, 2736, 14 In bash, I need to add another column that will be either a 0 or a 1. However, (and here is the […]

Categories
Development

Better way to reduce a sorted list of numbers by merging values in close proximity?

I have a list of numbers with following values as an example. 2, 99, 101, 150, 198, 201, 300 We assume the above array will always be sorted in an ascending order. My goal is to average out values which are in proximity to each other defined by a variable x. Assuming x = 5 […]

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

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
Angular Development Plugins

How to change size of one segmenet of ChartJS pie in Angular?

Simple question stated in the topic – i’ve been struggling with this for a couple of hours, googling and playing with the code but I can’t find any solution. BONUS question: How can i format the legend so that every label is in a separate row? So the first pic shows what I managed […]

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. […]