How to add a custom REST field to limit data when fetching?

Images don’t show by default in REST API so I have added a featured image url manually and this works ok https://i.imgur.com/l5R7XKl.png add_action(‘rest_api_init’, ‘register_rest_images’ ); function register_rest_images(){ register_rest_field( array(‘post’), ‘feature_img_url’, array( ‘get_callback’ => ‘get_rest_featured_image’, ‘update_callback’ => null, ‘schema’ => null, ) ); } function get_rest_featured_image( $object, $field_name, $request ) { if( $object[‘featured_media’] ){ $img =…

Details

fail2ban error with firewalld (f2b-

I have been using fail2ban for months without any issues but after a CentOS upgrade it stopped working. It seems it doesn’t create the iptables entries. I have already tried restarting fail2ban, restarting the VPS, and all the basic stuff. The relevant errors are: In /var/log/fail2ban.log: 2020-01-12 12:15:52,994 fail2ban.actions [496]: NOTICE [postfix-reject-dynamo] Restore Ban 12.160.87.219…

Details

Non-conformable arrays in neural network – neuralnet package

I am trying to create a neural network using this code: countries=read.table(‘countries.txt’,header =TRUE,sep=’\t’,quote=””,dec=”,”) #install.packages(“neuralnet”) library(neuralnet) trainset<-countries[1:85,] testset<-countries[86:118,] retea<-neuralnet(Tari.europene~Enrolement_P+Enrolement_S, trainset, hidden=4, lifesign=”minimal”, linear.output=FALSE, threshold=0.1) and I get this error: hidden: 4 thresh: 0.1 rep: 1/1 steps: Error in x – y : non-conformable arrays Also , the results for this line are: dput(trainset[c(“Tari.europene”, “Enrolement_P”, “Enrolement_S”)]) I…

Details