Categories
Mastering Development

Using Matplotlib, how to display Y-axis values ordered in HH24:MI format

I am unable to sort the job finish time (Y-Axis). Currently it is displaying what each Y-axis has. I am going to have more Y-axis added in future. Is there any way of sorting the Y-Axis values? My sample code is pasted below and a screenshot of the issue is attached. Screenshot attached from matplotlib […]

Categories
Mastering Development

addConditionalFormatting is not found in exceljs

I am using exceljs 3.8.2. In documentation there is an method addConditionalFormatting for conditional formatting. But after installation this method is not found. I am using below code. import { Workbook, Worksheet, Cell, Fill, Row } from ‘exceljs’; worksheet.addConditionalFormatting({ ref: ‘A1:E7’, rules: [ { type: ‘expression’, formulae: [‘MOD(ROW()+COLUMN(),2)=0’], style: {fill: {type: ‘pattern’, pattern: ‘solid’, bgColor: […]

Categories
Mastering Development

Pushing strings onto the beginning and end of an array created during for loop

Right now I have for loop that is returning an array with the numbers 1 – 90, but am having trouble replacing the numbers 1 and 90 with the strings stored in my variables far and close (respectively). const far = “01/01/20” const close = “03/01/20” const pushNinetyDays = () => { let arr = […]

Categories
Mastering Development

Transform my Java Swing program to an MVC program?

I was given the task to come up with a small game in Swing and implement it as an MVC (Model View Control) program. I’m new to MVC. So far I’ve finished the whole program in 1 Java file (View), what code do I need to change and insert in the Model file, in order […]

Categories
Mastering Development

How to compare elements within a list of case classes?

I have case class Person Person(id: String, birthdate: Int, movedate: Int ) And a list of these case classes called personRegistry personRegistry(Person(A1, 1, 5), Person(A2, 22, 30), Person(A3, 4, 20), ……) How do I find whether any of the Person’s have their birthdate / movedate fall within other Persons’ birthdate and movedate, and then group […]

Categories
Mastering Development System & Network

Migration of password hashes from glftpd 2.01 (PKCS5_PBKDF2_HMAC_SHA1) to proftpd + mod_sql_passwd

For migrating from the de-factor closed source glftpd 2.01 to proftpd I need to migrate password hashes of the user accounts from glftpd to proftpd. Reading about the topic I figured mod_sql_passwd should do the trick. I therefore set up my proftpd server like this: <global> SQLBackend mysql SQLAuthTypes Crypt SQLAuthenticate users groups SQLConnectInfo testdbuser@testdbhost […]

Categories
Mastering Development

How to use expand.grid values to run various model hyperparameter combinations for ranger in R

I’ve seen various posts on how to select the independent variables for a model by using expand.grid and then create a formula based on that selection. However, I prepare my input tables beforehand and store them in a list. library(ranger) data(iris) Input_list <- list(iris1 = iris, iris2 = iris) # let’s assume these are different […]

Categories
Mastering Development

valueerror: bad input shape (951, 20)

The Python program shows the error valueerror: bad input shape (951, 20) when the last code is executed. import pandas as pd import numpy as np df=pd.read_csv(‘C:/Demo Datasets/Lesson 6/voice-classification.csv’) from sklearn.preprocessing import LabelEncoder y=df.iloc[:,-1] gender_encoder=LabelEncoder() y=gender_encoder.fit_transform(y) from sklearn.preprocessing import StandardScaler scalar=StandardScaler() scalar.fit(x) x=scalar.transform(x) from sklearn.model_selection import train_test_split x_train,y_train,x_test,y_test=train_test_split(x,y,test_size=.3,random_state=100) from sklearn.svm import SVC svc_model=SVC() svc_model.fit(x_train,y_train) y_pred=svc_model.predict(x_test) […]

Categories
Mastering Development

How To Make this table

I wish i can make this table Table that’s my array $column1=array(1,9,17,25,33,41,49,57); $column2=array(2,10,18,26,34,42,50,58); $column3=array(3,11,19,27,35,43,51,59); $column4=array(4,12,20,28,36,44,52,60); $column5=array(5,13,21,29,37,45,53,61); $column6=array(6,14,22,30,38,46,54,62); $column7=array(7,15,23,31,39,47,55,63); $column8=array(8,16,24,32,40,48,56,64); $totalArray=count($column1);

Categories
Ask Mathematics

Finding the population given the average, the median and the interquantil range. 15Yo homework question.

My 15y old little brother had a math homework that I failed to solve. In the table below : 1/. The average is 1.5 2/. The Median is 2 3/. The interquantil range is 5 Value -1 0 2 4 Total Population ? ? ? ? 20 a b c d My deduction are : […]