Catchable fatal error in formatting.php

I'm running a WordPress 4.4.2. I have one site that's working fine. When I went to set up another site, I got the following error upon trying to save the "general" settings page: Catchable fatal error: Object of class WP_Error could not be converted to string in /{site-url}/wp-includes/formatting.php on line 1025' Before saving the settings, I deleted the existing sample page and sample post and created a new page. Didn't touch anything else. After researching the problem, I have done …
Category: Web

What would be the right tool for gathering data structure analytics in a data stream?

We are processing pretty big number of JSON objects (hundreds of thousands daily) and we need to gather insights about the processed objects. We are interested in gathering the following analytics of each field of the processed JSON objects: Percentage when present and missing (null/empty can be considered an equivalent of missing) Possible values and percentage when the value is used for high frequent values Possible number of elements in an array and percentage when the number occurs Because the …
Category: Data Science

WordPress 404 Images - Images not found after deleted from media

I am trying to develop the website to find images that have been deleted from the media library as they were not needed. These Images that I have deleted have previously been on pages but have been replaced on the page now... but if you go to https://tools.pingdom.com/#!/ctzBfY/http://waggypetservices.co.uk you can see that some of the deleted images are still being called... this call also be seen in the page source. My question is how can I find what is calling …
Category: Web

Any way to represent a random forest regressor model?

currently doing some EDA into a random forest regressor that was built; there seems to be observations where the model prediction is off. what library can i use to visualise the representation of the random forest for me to understand better how the model splits for each node, etc. the model is built in pyspark (pyspark.ml.RandomForestRegressor)
Category: Data Science

Are labels associated with a model or a dataset?

I'm not sure if I have this backwards or not, so I'll explain a bit of what is going on. I want to use Unity's Barracuda api to use an onnx model for classification and detection (depending on the model). Some example projects I've found have a model and labels handy, so it's easy to map the outputs to the labels. ie, if the 5th element has the highest score, i can look up the 5th label and find it …
Category: Data Science

How do I add a tag slug to a category URL to filter posts?

I want to add an option to my site to filter posts by one specific tag on the category page and at the same time have a nice URL (no query strings). So something like this: https://example.com/%category%/ - standard category link (currently) https://example.com/%category%/%tag%/ - a page like the above, but displaying posts from a specific category AND tag. Is this possible? If so, how can I achieve this? I would also like to note that for posts I have such …
Category: Web

WordPress Multisite with NGINX, subfolders, and FROM a subfolder

Dear fellow WordPress enthusiasts, I am using WordPress multisite. The default blog works, with permalinks, but not the subblogs. I get a redirect loop when trying to access /wp-admin on a network site. I am using FastCGI with Facebook's HHVM; similar to plain vanilla FastCGI. I know I am missing server blocks to redirect files: I want, first and foremost, to understand why I'd get a redirect loop on sub-sites. Thank you for your help. My nginx configuration is as …
Category: Web

Differentiable loss function for ranking problem in regression model

In regression problem, we may need a loss function to measure the relative ranking accuracy between targets $y$ and predicted values $y_{pred}$. Abviously, the simple MSE does not consider such ranking relations. A straight choice is the so-called IC (Information Coefficient) $$IC\propto corr(\text{rank}(y), \text{rank}(y_{pred}))$$ which use the correlation between two ranks. However, rank function is not differentiable, thus it can't be used in loss function for regression which uses gradient propagation to update the parameters. Another choice might be a …
Category: Data Science

Replace default og:image tag YOAST

I'm trying to replace the default image picked by yoast (featured image) with a custom with the relative og:image:width and og:image:height, but seems a mission impossible! I tryed with this: function my_own_og_function() { $my_image_url = 'http://www.mywebsite.net/wp-content/uploads/TEST-A.jpg'; $GLOBALS['wpseo_og']->image( $my_image_url ); // This will echo out the og tag in line with other WPSEO og tags } add_action( 'wpseo_opengraph', 'my_own_og_function', 29 ); But yes, the image is replaced, only is without og:image:width and og:image:height So i'm wondering, is there away to make …
Category: Web

How to Add a Container Class to Standard Gutenberg Blocks

I am using ACF fields to create custom Gutenberg Blocks. I am running into an issue however where I need to go in and out of a container div depending on the block. So I cant just add a container div around the_content(); What I'm trying to do is add a class to each of the standard Gutenberg blocks, so I can add the container styles to each of those blocks, making it easier to go in and out of …
Category: Web

Embedding from Transformer-based model from paragraph or documnet (like Doc2Vec)

I have a set of data that contains the different lengths of sequences. On average the sequence length is 600. The dataset is like this: S1 = ['Walk','Eat','Going school','Eat','Watching movie','Walk'......,'Sleep'] S2 = ['Eat','Eat','Going school','Walk','Walk','Watching movie'.......,'Eat'] ......................................... ......................................... S50 = ['Walk','Going school','Eat','Eat','Watching movie','Sleep',.......,'Walk'] The number of unique actions in the dataset are fixed. That means some sentences may not contain all of the actions. By using Doc2Vec (Gensim library particularly), I was able to extract embedding for each of the sequences …
Category: Data Science

WordPress get last inserted user id

I want to disable user_login field into my CMS. They are register only their email adress. I think to create secret user login by programmatically. I think for accessibility and manageability also I want to use their ID'. For this I want to know last user's ID. I know the unprofessional way of doing this. A way as below, <?php $args = array( 'orderby' => 'registered', 'order' => 'DESC', 'number' => 1 ); $users = get_users($args); $last_user_registered_ID = $users[0]->ID; But …
Category: Web

WordPress WooCommerce email notifications going to spam folder

I have just built a new WordPress site for a client, and repointed the domain's (mellowmarshfarm.com) DNS records to the new hosting service, Flywheel. The client's custom email address is hosted by a different provider, and the notifications for the site are forwarded from WordPress via fw-mail.com, but they are going to the client's and customers' spam folders. I have tried adding x.fw-mail.com to the mail host's SPF record, but it didn't make a difference: v=spf1 ip4:[redacted] include:spf.antispamcloud.com include:x.fw-mail.com +a …
Category: Web

How to divide earth into polygons based on a collection of labeled coordinates?

I have around one million labeled coordinates(latitude, longitude) all around the world, with around 10,000 unique labels(location_id). Each point corresponds to exactly one class(location_id). Each class is densely distributed over 1-10km. radius; With more density around its centroid. How can I create an earth multi-polygon consisting of 10,000 polygons? Basically dividing the earth into 10,000 polygons. The separation would be based on the density of points in each location. The more points clumped in a location, the bigger its polygon's …
Category: Data Science

how do I turn off whatever causes links to be embedded as URL's site title

When I print a url onto my site, it automatically gets wrapped in: <blockquote class="wp-embedded-content" data-secret="tDj3qpdVAi"><a href="https://www.example.com/">Example Domain</a></blockquote> even though all I printed to the page is "https://www.example.com/". What is this mechanism and how can I disable either on a specific page or site-wide? What I Tried adding the code here to my functions file: https://crunchify.com/how-to-disable-auto-embed-script-for-wordpress-4-4-wp-embed-min-js/ adding both snippets of code (separately) from here to my functions file: https://kinsta.com/knowledgebase/disable-embeds-wordpress/#:~:text=Disable%20Embeds%20in%20WordPress%20With,the%20core%20contributors%20to%20WordPress.
Category: Web

How to analyse the accuracy and loss graphs of model history?

I want to understand how to analyse the loss and accuracy (any metric) graphs that we plot from the model training history. Here's my graph, What can we say from the slope of graph? Does it matter? As you can see the validation and training loss-accuracy are pretty much the same for the most part. What does this mean? Usually the val accuracy is higher than training accuracy in the beginning but we don't see that here. Am I doing …
Category: Data Science

Problem protecting a page with a password

As we know, there is a built-in option in WP to protect a certain page with a password. Under the general settings for the page, I choose to show it only with password and set the password accordingly. When visiting the page, indeed there is a text box for typing in the password and submit button. The problem is that when I type in the password I set (the right one, I swear) and click the submit button, the page …
Category: Web

LSTM with input of actual time step

I'm working on an implementation of LSTM neural network to forecast energy consumption. I have a dataset with load, series of weather parameters and indicator of it's bank holiday or not. I first did a network with input of 24 lag (using function from this tutorial). So I have a dataset like this, but with 18 variables and from ($t_{-24}$) var1(t-1) var2(t-1) var1(t) var2(t) 1 0.0 50.0 1 51 2 1.0 51.0 2 52 3 2.0 52.0 3 53 4 …
Category: Data Science

Date transformation for KNN

I have data set with date features like 01/01/2019 and I would like to use KNN. However, I cannot find a good transformation for dates that has a meaningful distance result for the last feature. For example: f1 | 1 | 2 | 3 | 4 | 01/01/2019 f2 | 10 | 3 | 12 | 1 | 14/01/2019 Does anyone have any recommendations?
Category: Data Science

Are there any open datasets for commercial use?

I am creating a bootcamp for data analyst and it's been 2 days I am looking for some good dataset fit for commercial use that I can use to create Tableau and Power BI tutorials. Even on kaggle some datasets are licensed as CC0 but when you track back the company the data was scrapped from, it states that the data shouldn't be used for commercial use (e.g Zomato dataset). Are there any good data sources which I can use …
Category: Data Science

Fatal error: Uncaught Error: Class 'WP_Block_Styles_Registry'

I am having some issues determining the solution to this problem below. The website was sent to our team to fix. Turned on error reporting in wp-config.php: define('WP_DEBUG', true); WordPress version: 5.3.2PHP version: 7.2 WordPress Theme: Grow Pro Fatal error: Uncaught Error: Class 'WP_Block_Styles_Registry' not found in /home/website/public_html/clientsite.com/wp-includes/script- loader.php:2902 Stack trace: #0 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(288): enqueue_block_styles_assets('') #1 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(312): WP_Hook->apply_filters(NULL, Array) #2 /home/website/public_html/clientsite.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #3 /home/website/public_html/clientsite.com/wp-includes/script- loader.php(2856): do_action('enqueue_block_a...') #4 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(288): wp_common_block_scripts_and_styles('') #5 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(312): WP_Hook->apply_filters(NULL, Array) #6 /home/website/public_html/clientsite.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #7 …
Category: Web

"Source paper" of the method Reduction in library Sumy

Does anybody know or can help me to find the source paper of the method "Reduction" of the library "sumy"? This method is here: Reduction where it says that it is based on here, but in none of these places I am able to find the source. At this description, it only says that: "Graph-based summarization, where a sentence salience is computed as the sum of the weights of its edges to other sentences. The weight of an edge between …
Category: Data Science

Website completely messes up when logging out

Alright so the website is completely perfect when I am logged into the WP-ADMIN page but if I log out of there, the website is completely messed up. All the formatting is broken and everything looks weird. You can see it for yourself here: https://www.CounterBoosting.com This is how it looks when logged in: https://s18.postimg.io/k4pviuh0n/after.png One thing to note is that /wp-admin suddenly leads to Page not found 404 and that I can only login using /wp-login.php Does anyone know what …
Category: Web

Migration to WP - Couldn't load image

Situation: I'm trying to migrate static page made with HTML/CSS/JS into Wordpress. The images won't load. They work in HTML, but when I migrate into PHP there are only alt-descriptions visible. Upon examining it in the Mozilla Dev Tools, there is a correct link to the image that displays the image upon clicking. However, on the migrated WP site there's an error "Couldn't load image". Directory seems correct, but image just won't load. What I tried. get_theme_file_uri() <img src="<?php echo …
Category: Web

How To Save Data From Remote APIs To ACF?

I've been attempting to ingest remote data from an api partner into Wordpress. To data I've used wpallimport plugin, but it's quite limited. How would one connect with a remote api and then save the data to a an ACF field either one time or periodically? I've test out wp_remote_get($apiUrl); and even created a POC but saving the data to the WP database has not been successful yet.
Category: Web

error while running lasso.py

The following is the error code generated while running lasso.py. Can anybody help in fixing the same. Here is the code: from cvxpy import * import numpy as np import cvxopt from multiprocessing import Pool # Problem data. n = 10 m = 5 A = cvxopt.normal(n,m) b = cvxopt.normal(n) gamma = Parameter(nonneg=True) # Construct the problem. x = Variable(m) objective = Minimize(sum_squares(A*x - b) + gamma*norm(x, 1)) p = Problem(objective) # Assign a value to gamma and find the …
Category: Data Science

Filter wp_mail based on content type

I can current filter the content type of the wp_mail function: add_filter( 'wp_mail_content_type', function( $content_type ) { return 'text/html'; }); And I can filter the message content add_filter( 'wp_mail', function( $args ) { $args['message'] = 'Filtered text here'; return $args; }); But how can I only do the latter conditionally? I only want to filter the message when the content type == text/plain. I'm guessing there is a super-simple solution to this, but I haven't worked it out yet.
Category: Web

Is there any point in using a colab TPU for inference?

I have a colab pro+ subscription and like many, I'm finding that the GPU allowance is rather small compared to the price. While I wait for GPU access I was wondering if the TPU VM would be a substitute. It's running now and seems slower. I have not adjusted my code. Is there any point in this? To be honest, I'm not quite clear on the difference between a TPU and a GPU. I ran lscpu in the console and …
Topic: tpu colab gpu
Category: Data Science

NLP - support comments analysis

I am new to NLP and looking for some direction since after all my reading I haven't found a definite approach and the subject matter is vast. The project is to focus on specific fields of support comments using NLP and Python. The goal is that from the comments I want to verify that the comment is in fact a well made comment for that field. Some requirements is the context of entered text is relevant to the field it …
Topic: bert nlp python
Category: Data Science

Tortoise SVN showing 'Access to '/!svn/me'' forbidden error.

I recently want to commit a change to my WordPress plugin repo but it has been showing 'Access to '/!svn/me' forbidden' error whenever I wanted to commit any changes. Some articles have adviced me to check if my username and password are correct but it seems not to be the right solution because my login credentials are actually correct. Please, has anyone faced this issue before or is there an alternative to TortoiseSVN that I can use? Thank you!
Category: Web

Get post / page ID from ACF Link field

I'm trying to recieve post ID from link using ACF link field: <?php $link = get_sub_field('offer_link'); $id = get_the_ID(); if( $link ): ?> <a href="#post-<?php echo $id; ?>" target="<?php echo $link['target']; ?>"><?php echo $link['title']; ?></a> <?php endif; ?> but instead of ID of link I get the ID of current page. How should it be done?
Category: Web

Is there wights of voice or audio for VGG or Inception?

I want to use VGG16 (or VGG19) for voice clustering task. I read some articles which suggest to use VGG (16 or 19) in order to build the embedding vector for the clustering algorithm. The process is to convert the wav file into mfcc or plot (Amp vs Time) and use this as input to VGG model. I tried it out with VGG19 (and weights='imagenet'). I got bad results, and I assumed it because I'm using VGG with wrong weights …
Category: Data Science

Is there a way to make [Table Of Content] plugin while not using revision data?

I have a problem while using TOC plugins 'cause all of TOC plugins use revision data to recognize header tag. I'm using my own metadata (custum field) plugin and the data doens't show on the revision page. It means that the TOC plugins can not recognize my header tag data on the post page. Any great ideas? This is one of the TOC plugins and you could see the "get the revision" public function widget( $args, $instance ) { global …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.