When I try to login in wordpress it is showing "USER Doesn't Exists"

The main Issues is that I am entering the email address & password that I used in creating my WordPress site in digital but It shows that the email address & username doesn’t exist even I checked in my PhpMyAdmin “WordPress” “wp-user” and I am using the right email, username and password but still shows that user doesn’t exist. However, I tried changing password by using “lost password” section but in that whenever enter my username or email to get …
Category: Web

Plugin main file is constantly been fired on every website visit

Greetings to everyone! I'm working on a WordPress plugin, and while debugging something with the error_log function in the plugin main file, I noticed that the main plugin file is constantly fired... The plugin is more complex but it's stracture can be considered as: myplugin: -- myplugin.php -- fileA.php -- fileB.php In myplugin.php the code is like this: if (!defined("ABSPATH")) { exit(); } include_once plugin_dir_path(__FILE__) . "fileA.php"; include_once plugin_dir_path(__FILE__) . "fileB.php"; class main_class { static function __construct() { error_log("in install …
Category: Web

Getting an ERROR: Cookies are blocked error when logging in to a site on a different domain?

I am getting the following error: ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress. When trying to login to a network site on a different domain with version 5.0.2WordPress. I can login to the primary site, but when going to the dashbaord of the secondary site it redirects to the login screen on the different domain and gives the cookie error. Relevant wp-config.php settings: /* Multisite */ define('WP_ALLOW_MULTISITE', true); define('MULTISITE', true); …
Category: Web

What is the SHAP values for a liner model? How do we derive that?

What is the SHAP values for a linear model? it is given as below in the documentation Assuming features are independent leads to interventional SHAP values which for a linear model are coef[i] * (x[i] - X.mean(0)[i]) for the ith feature. Can someone explain to me how it is derived? Or direct me to a resource explaining the same?.
Category: Data Science

Generating a sequence based on value in another column in Python

I have the following data frame: I would like to add a column with value equal to 1 if flag is 0 and incrementally add 1 in the following rows until the next 0 is encountered (as given in the example below). I have been able to generate the sequence, but the code is extremely slow, so is there a faster way to generate the sequence?
Topic: pandas python
Category: Data Science

How do I override a parent theme's language files with a child theme?

I have a parent theme and a child theme, I would like to override the spanish .mo and .po files in the parent theme (or add them if they are not present in the parent theme) with the es_ES ones in my child theme. I added the folder with the modified mo and po files in the child theme with the same folder name as in the parent theme but this is not working. How can I come about this? …
Category: Web

Suggestions for a multi-class text classification model with a large number of classes?

I was working on a text classification problem where I currently have around 40-45 different labels. The input is a text sentence with a keyword. For e.g. This phone is the most durable in the market is the input sentence and the out label is X and all the words in the output with label X will have durable as a keyword. What would be a good model to fit this? I tried basic SVM, Random Forest but to no …
Category: Data Science

How to find coreset of a given dataset in python?

I am trying to implement the core-means algorithm, which is basically k-means using coreset. I have searched up and down but could not find any libraries or modules which could help me with this. The paper I am following talks about building a coreset using grids, something like a quadtree where you keep dividing the point space in 4 equal parts to find heavy points which makes a coreset. Any help would be greatly appreciated in getting me started as …
Category: Data Science

How to properly reset a nested WP_Query query

I'm missing something here. What's the proper way to reset a query so that it doesn't interfere with any other queries it may be nested in? This is the kind of result I'm going for: Main page This is the main page content. Now let's display some custom nested queries. Outer page 1 Inner post 1 Inner post 2 Outer page 1 content continued... Outer page 2 Inner post 1 Inner post 2 Outer Page 2 content continued... ...etc. But …
Category: Web

What's the purpose of statistical analysis ( statistically important features) vs feature elimination in machine learning

I am developing a classification model for covid19 symptoms (after being ill) and I don't understand statistical analysis importance (some parts of it) 1 Firstly: Basically we perform statystical analysis to learn about data. However what's the purpose of counting mean, standard deviation as shown here: https://www.sciencedirect.com/science/article/pii/S0010482522000762#bib27 What insight will it give me? 2 Moreover: They perform statistical test like Chi-Square to find the statistically significant features. Suppose they have around 15 "blood parameteres" and the tests would tell that …
Category: Data Science

How to combine and separate test and train data for data cleaning?

I am working on an ML model in which I have been provided the data in 2 files test.csv and train.csv. I want to perform data cleaning on both files together be concatenating them and then separating them. I know how to concatenate 2 dataframes, but after data cleaning how will I separate the two files? Please help me complete the code. CODE test = pd.read_csv('test.csv') train = pd.read_csv('train.csv') df = pd.concat([test, train]) //Data Cleaning steps //Separating them back to …
Category: Data Science

Project/scale a set of 2D points to keep a set of similarities constraints

I have a problem similar to this one posted here MDS scikit-learn example. I have a set of similarities between 2D points that I want to place in a map/plane while keeping this similarities as best as I can. The difference is that I want to keep some of this points fixed while optimizing for the others. So following the MDS example provided, say I want to keep 2 specific points from the similarities variable held constant. How should I …
Category: Data Science

Multi-Source Time Series Data Prediction

I was wondering if anyone has experience with time series prediction for data from multiple sources. So for instance, time series $a,b,..,z$ each have their own shape, some may be correlated with others. The ultimate goal is to have a model trained such that the value at time $t+1$ for any given data source can be predicted. I personally have two solutions that in theory could work, but was wondering if anyone knew of other frequently used methods. Multi-task learning …
Category: Data Science

Change links automatically to affiliate links

My goal: I want external links to shops I'm affiliated with (for example amazon) to automatically get the affiliate ID attached to it. Example: link I put in my blog post editor https://www.amazon.com/dp/B07K344J3N/ changes in frontend to https://www.amazon.com/dp/B07K344J3N/?tag=myafftag-02 What I have found: The creator of the theme I'm using is offering something very close to what I'm looking for: add_action('wpfepp_form_actions', 'link_change_custom'); function link_change_custom($data){ if ( !empty( $_POST['rehub_offer_product_url'] ) ) { $url = $_POST['rehub_offer_product_url']; $checkdomain = 'amazon.com'; if (!empty($url) && strpos($url, …
Category: Web

How to enqueue a script which is type module without using script_loader_tag filter?

I'm creating a theme and i want to upload it to envato. I have a javascript file that is type module and i can enqueue it and then use script_loader_tag filter to add type module to it by these lines. wp_enqueue_script( 'slider-js', get_stylesheet_directory_uri() . '/src/js/slider.js', array(), time(), true ); add_filter( 'script_loader_tag', 'add_type_attribute', 10, 3 ); function add_type_attribute( $tag, $handle, $src ) { if ( 'slider-js' !== $handle ) { return $tag; } $tag = '<script type="module" src="' . esc_url( $src …
Category: Web

Gutenberg Editor: dynamicaly change slug field with an ACF field

I have a custom field with ACF named "short_title" and I want the post's slug based on this field instead of the post title field. I already wrote this code: function testSlug($post_id) { if (get_post_type($post_id) == 'my-custom-post-type') { if (defined('DOING_AUTOSAVE' && DOING_AUTOSAVE)) { return; } if (!current_user_can('edit_post', $post_id)) { return; } remove_action('save_post', 'testSlug'); $updated_post = []; $updated_post['ID'] = $post_id; $updated_post['post_name'] = sanitize_title($_POST['acf']['field_61f8bacf53dc5']); wp_update_post($updated_post); add_action('save_post', 'testSlug'); clean_post_cache($post_id); } } add_action('save_post', 'testSlug'); this works great and edit the slug, but on the …
Category: Web

Gutenberg Editor: dynamically edit slug field based on ACF field

I'm trying to edit the slug field on the right panel of Gutenberg editor and edit its content based on a custom field. I noticed that I can access to the field by using wp.data.select('core/editor').getEditedPostSlug(); in JavaScript to interact with the React Component. My question is: how can I edit this field in JavaScript? There's no .setEditedPostSlug() method for this and select the field in normal JS script is impossible because the field's ID is generated each time the panel …
Category: Web

Using keras in R to perform neural network, my model has very low accuracy but the prediction is good and I don't know why

I used the classic dataset - mnist dataset that has 784 columns of pixels and 1 column of the label (from 0 to 9), and I was going to transform the images into their corresponding seven segment display representation. The following is my code. # Convert the labels(digits) in train_set and test_set to seven-segment display train_set$a <- ifelse(train_set$V1 %in% c(0,2,3,5,6,7,8,9),1,0) train_set$b <- ifelse(train_set$V1 %in% c(0,1,2,3,4,7,8,9),1,0) train_set$c <- ifelse(train_set$V1 %in% c(0,1,3,4,5,6,7,8,9),1,0) train_set$d <- ifelse(train_set$V1 %in% c(0,2,3,5,6,8),1,0) train_set$e <- ifelse(train_set$V1 %in% c(0,2,6,8),1,0) …
Category: Data Science

Display widget outside sidebar?

I want to display a widget outside the sidebar, but I can't get my code to work. The theme name is radius-primary-sidebar and my widget id is text-20 (according to the html in the admin page. See image #1). I've tried using the_widget("radius-primary-sidebar", "widget-id=text-20"), but that didn't return anything. What I'm I doing wrong? I'm using wordpress 3.5.2. From /wp-admin/widgets.php in the admin panel.
Category: Web

Read all files from all the folders

I am using Windows, Jupyter Notebook, OpenCV, Mediapipe, Tensorflow. Hello. I have a video Dataset with 100 action folders and each folder has 100 videos(.avi). Frames Per Second is 25. I want to read all the videos in all the action folders to collect the keypoints. I just want help with the code reading all the videos from all the folders using for loop or anything. And is there anyway to check if that code indeed read all the videos …
Category: Data Science

is_main_query() always returning false

I've built a Wordpress site using Oxygen builder. I'm using the 'Post Types Order' plugin to control the post order. I have an Archive Page for a custom Post Type. For the Loop/Oxygen Repeater I'm using the Default WP Query. My Archive page correctly shows the list of posts according to taxonomy. For this custom post type I want to order it Alphabetically. I added the following snippet : add_action( 'pre_get_posts', 'lit_category_filter' ); function lit_category_filter($query) { if ( ! is_admin() …
Category: Web

How to apply K-Medoids in many CFG?

I am having around 1000 DAG(Directed Acyclic Graph) of different files showing java.io.BufferedReader usage. Following is representation of one of the graphs digraph G { 9 [ label="9 : ROOT:setup()#0" ]; 10 [ label="10 : START IF" ]; 12 [ label="12 : java.net.URL.openConnection()#1" ]; 11 [ label="11 : END IF" ]; 13 [ label="13 : java.net.URL.openConnection()#0" ]; 14 [ label="14 : START IF" ]; 16 [ label="16 : java.net.HttpURLConnection.setRequestProperty()#2" ]; 15 [ label="15 : END IF" ]; 17 [ label="17 …
Category: Data Science

add 360 (non-Wordpress) tours in a subfolder with the same name as the main (Wordpress)page of the 360 tours

I'm looking for a solution to put my 360 tours (all in their own subfolder) in the subfolder of the Wordpress page about the tours. For instance: Wordpress page: domain/vr/ Tours: domain/vr/tour1/index.html domain/vr/tour2/index.html The tours are not made in Wordpress and have been uploaded via ftp. Can anyone help me? :)
Category: Web

ACF: If field contain a specific value, update value in another field programatically

how can I change the value of a field based on the value of another field programatically? This other field has already a value but I need to replace / update it. To be more precise: If the Text Field named type has value Houses AND another Text Field named service has value 2, this should be updated in NOT AVAILABLE. Or ... If the Text Field named type has value Parks AND another Text Field named service has value …
Category: Web

Set display name from nickname with register process

It is possible set display name from entered string into nickname registration field? I trying do this with simple hook, but after all it is not work. function set_default_display_name( $user_id ) { $user = get_userdata( $user_id ); $name = $user->nickname; $args = array( 'ID' => $user_id, 'display_name' => $name ); wp_update_user( $args ); } add_action( 'user_register', 'set_default_display_name' ); By default, immediately after registration, display name was set from WP username (login) not nickname. Can sombody help me to set a …
Category: Web

Attitude to text mining and preparing tokens, irrelevant words, low accuracy

For purpose of quite big project I am doing a text mining on some documents. My steps are quite common: All to lower case Tokenization Stop list and stop words Lemmatizaton Stemming Some other steps like removing symbols. Then I prepare bag of words, make DTF and classify to 3 classes with SVM and Naive Bayes. But the accuracy I get is not too high (50-60%). I think that may be because in array of words after all the steps …
Category: Data Science

Multiple conda enviroments in (R) functions using reticulate

For an internally used R package I need to have certain functions load python environments to do part of the processing. The environment cannot be the same one for all functions, unfortunately, due to python package conflicts. So I need to find out how to attach to different conda environments. But I actually fail before that, as what I get when I attach an env: > reticulate::use_condaenv("pyannote") ERROR: The requested version of Python ('/Users/frkkan96/opt/anaconda3/envs/pyannote/bin/python') cannot be used, as another version …
Topic: conda python r
Category: Data Science

get_post_meta($post->ID) returns empty string when in preview mode of custom post type

I've got my custom post type 'event'. I got tne next code in single-event.php: get_header(); the_post(); echo '<pre>'; echo "$post->ID\n"; var_dump(get_post_meta($post->ID)); echo '</pre>'; When I open my event page by normal URI /event/slug/, I got this: 22681 array(17) { ["_edit_lock"]=> array(1) { [0]=> string(13) "1439329938:36" } ["_edit_last"]=> array(1) { [0]=> string(2) "36" } ... } When I open it for preview, like /event/slug/?preview=true&preview_id=22681&preview_nonce=XXXXXXXXXXXXX , I got only this: 22681 string(0) "" (where first line is a correct post ID and …
Category: Web

Language Detection using pycld2

I am trying to use the pycld2 package to detect multiple languages in text. This package provides Python bindings for the Compact Language Detect 2 (CLD2) This is the example I am testing out: import pycld2 as cld2 text = '''The universal connection with an additional advantage: Push-in connection. Terminate solid and stranded (Class B 7 strands or less), as well as ferruled conductors, by simply pushing them in – no tools required. La connessione universale con un ulteriore vantaggio: …
Category: Data Science

Register a script to be enqueued both in admin and front end

As i understand it, admin scripts are supposed to be registered and enqueued through the admin_enqueue_scripts hook and all other scripts at wp_enqueue_scripts so i have set up the following functions to register and enqueue all my scripts in a clear and organized way. My question is, what if i need certain scripts (eg. jquery validate plugin) both in admin and on the front end? what is the recommended method for registering and enqueuing the script in this case? register …
Category: Web

Uncaught TypeError: switchEditors.switchto is not a function

I have the following line of code: switchEditors.switchto(ctmce[0]); which gives this error: Uncaught TypeError: switchEditors.switchto is not a function Searching around I found out that, due to changes to the core in WordPress 4.3, switchEditors.switchto() is not available/usable now. Do you know how can I fix it? You can see the complete code here.
Category: Web

Choose CNN architecture first, then optimize parameters - validation vs test performance to pick architecture?

I am doing a few experiments on medical data. I am about to transfer learn the pretrained networks for my problem. Firstly, I have to pick a network architecture. Secondly, I would like to optimize it's parameters/parameters of optimizer, to get better performance. I would like to pick the network architecture based on 10-fold cross validation of several architectures. I will perform cross validation in a way that I have data split to train:test in a 80:20 manner, then train …
Category: Data Science

About

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