I have googled but must not be using the correct terms. I am trying to add a script to my WordPress plugin that takes a url and returns a reformatted image. I know this is frowned upon as hotlinking. The image in my case is supplied by a website imaging service. The image takes from 3 to 5 seconds to be generated. I have a java script that sets my preview image src tag once the website url is entered …
After reading a while, I am confused now about my LSTM data structure. Assuming that I have a supervised learning problem with 1000 samples and 40 features as input. Now I want to create 10 timesteps of x. My resulting dimension of Keras data structure is x: (1000, 10, 40) with every two-dimensional matrix (1000, 40) shifted row-wise and ten times. The question is now: Which dimension has my target y to be? My dimension is y=[1000,1] for one resulting …
I'm trying to create a new panel in the edit-post sidebar (Wordpress Gutenberg), I already managed to set the panel with the title and the text in the content part but I need to add a button there and no I find a way to do it. var registerPlugin = wp.plugins.registerPlugin; var PluginDocumentSettingPanel = wp.editPost.PluginDocumentSettingPanel; // var btn = wp.element.createElement( 'button' ); var el = wp.element.createElement; var __ = wp.i18n.__; /* I tried to do it with a function, but …
I'm a noob. I have copied the header.php from the parent theme, I have added some snippets and things work. However, I would like to be able to add those same snippets either using a plugin or via functions.php so when/if the theme is updated, I don't need to redo everything. I've tried many things but none of them work. I wonder if the problem is where the snippets are placed by using a plugin or that the HTML element …
I'm using a dataset contains about 1.5M document. Each document comes with some keywords describing the topics of this document(Thus multi-labelled). Each document belongs to some authors(not just one author for a document). I wanted to find out the topics interested by each author by looking at documents they write. I'm currently looking an LDA variation (labeled-LDA proposed by D Ramaga: https://www.aclweb.org/anthology/D/D09/D09-1026.pdf .). I'm using all the documents in my dataset to train a model and using the model to …
I'm using WordPress Twenty Sixteen theme. Now I've a menu item named Product and it has a sub menu. The product page has a permalink as usual, but I want to remove it i.e., when I click on this menu item, it shouldn't perform any action, just like clicking on a text. However, it should not lose its hover color while doing so. I found a solution pointer-events: none, but it removes the hover color. I don't want to use …
I have trained a classifier algorithm on a sentiment analysis model which classifies the reviews scraped off Amazon as Positive or Negative. Now for each class, I want to get the keywords from the review i.e. reason for the positive or negative review. For example if I have a review "the quality of the shirt is the worst!". I want to get the keyword as "quality". Similarly "Really liked the fitting of the shirt" should return "fitting" as the keyword. …
I am new in wordpress dev. I am building a plugin and I have a question I have a custom table in the database Is there any way to create a Custom Post type connected to this table? I am using CPT ui btw How can I approach this problem? any ideas? Thank you in advance
I work with two datasets. The first dataset contains fluor values measured every minute. The second dataset contains certain events and their time. We know that these events cause peaks in fluor values shortly before and shortly after the event time. A simplified reproducible example in R: Here I provide a simplified version of the R code I use to relate the fluor values to events. I have a series of fluor values measured every minute. Next I have a …
I need to store some post IDs in the DB in a custom table/field. The IDs will have to be stored in a serialized format. I know that, ie. for the options, serialization is done automatically for add/update functions (add_option(), update_option()). Is there a built-in WP function to serialize data for any other case? Or should I just use serialize()? Similarly, as soon as the data will be retrieved, is there a stock WP function to unserialize it, or will …
I have created a lot of custom CSV importers for WordPress in the past and I have come across issues related to the time it takes for them to finish processing. Whenever the importer starts running, it starts off importing a lot of posts per second but this speed keeps decreasing and I am trying to figure out the reason for this and if whether there is something that I can do to speed up things. Some importers I create …
I'm trying to create a new column called Class which is a calculated column. Basically when the Math class is NA then the class will be the CS class, otherwise it will be vice versa. How can I do this in python? Table name is Classes MathClass | CSClass | Class ------------------------------ Trig | NA | Trig NA | Java | Java NA | Python | Python
I have some meta fields in WordPress created by theme and i want to update it by using php. The metafield stores url and i want to add some string after current url in custom meta. i tried these method Assign/update the custom field value for all posts and made changes 'post_category' => array(14,16,19); to select a particular category but it edited all posts of all categories. and used this method to change meta field but it removed url and …
I took the data from here and wanted to play around with multidimensional scaling with this data. The data looks like this: In particular, I want to plot the cities in a 2D space, and see how much it matches their real locations in a geographic map from just the information about how far they are from each other, without any explicit latitude and longitude information. This is my code: import pandas as pd import numpy as np from sklearn …
I am working a data-set with more than 100,000 records. This is how the data looks like: email_id cust_id campaign_name 123 4567 World of Zoro 123 4567 Boho XYz 123 4567 Guess ABC 234 5678 Anniversary X 234 5678 World of Zoro 234 5678 Fathers day 234 5678 Mothers day 345 7890 Clearance event 345 7890 Fathers day 345 7890 Mothers day 345 7890 Boho XYZ 345 7890 Guess ABC 345 7890 Sale I am trying to understand the campaign …
My project: Wordpress, Woocommerce, Bootstrap 4, bs4navwalker My problem: Custom dropdown item added by WP filter. I have one navbar, 3 differents menus inside (using bs4navwalker), a badge for the cart and a search form. See code. I'm using a filter (add_filter( 'wp_nav_menu_items',) to add login, logout and myaccount details in my navbar, everything is ok, but i'd like to add these items inside a dropdown. The filter just creates one or two more items to the 'user' menu. I …
I want to keep a check if the user has a particular password, so I have been trying it with wp_check_password but the account for which it is checked gets logged out and can't login again till there is a call of wp_check_password in the code. Digging into the code, I found out that it sets the password by using the new hash. and moreover if I am using wp_check_password( 'hello', md5('hello'), 1 );, it doesn't even check what is …
My site has two custom types: Auction and Lot. Lots are connected to an Auction via the post_parent field. I added an Auction column to the Lots list in the admin area. function theme_lot_custom_columns($columns){ $new = array(); foreach($columns as $key => $value) { if ($key=='date') { // Put the Auction column before the Date column $new['auction'] = __('Auction'); } $new[$key] = $value; } return $new; } add_filter('manage_lot_posts_columns', 'theme_lot_custom_columns'); function theme_lot_custom_column($column, $post_id) { if ($column === 'auction'){ $post = get_post($post_id); if …
I have used one hot encoder [1,0,0][0,1,0][0,0,1] for my functional classification model. The predicted probabilities for test data yprob = model.predict(testX) gives me : yprob = array([[0.18120882, 0.5803128 , 0.22847839], [0.0101245 , 0.12861261, 0.9612609 ], [0.16332535, 0.4925239 , 0.35415074], ..., [0.9931931 , 0.09328955, 0.01351734], [0.48841736, 0.25034943, 0.16123319], [0.3807928, 0.42698202, 0.27493873]], dtype=float32) I would like to compute the Accuracy, F1 score and the confusion matrix from this. The sequential api offers a predict_classes function to do it. yclasses = model.predict_classes(testX) and …
I'm trying to target a few of our WooCommerce product pages "Add to Cart" buttons to say different things. This code works for targeting one product and leaving the rest default: add_filter( 'woocommerce_product_single_add_to_cart_text', 'woo_custom_cart_button_text' ); function woo_custom_cart_button_text( $text ) { global $product; if ( 123 === $product->id ) { $text = 'Product 123 text'; } return $text; } I tried adding an elseif statement after the first if but it's not resolving: add_filter( 'woocommerce_product_add_to_cart_text', 'woo_custom_cart_button_text' ); // CHANGES INLINE BUY …
I want to detect anomalies in the bank data set in an unsupervised learning method. However, in the bank data set, all columns except time and amount were categorical data, and about half of them had more than 90 percent missing values. This data set tries to detect anomalies through unsupervised learning. I'm currently using Autoencoder to access it, but I wondered if this would work. Also, because the purpose is to detect whether data is abnormal when data comes …
EDIT: Yay, solved it! I needed to use new WP_Comment_Query( $args ) and set my $args to only include the current post and the meta chosen. Thanks! Thanks to the wonderful help of the community here, I have created a dropdown menu above my comments section to choose between BUY | SELL | TRADE | TALK. EDIT: I've changed my comment.php file. It now filters by comment_meta - YAY! Except, it gets ALL comments with this meta value. How do …
In my comments.php, I loop through the comments like this: if (have_comments()) : ?> <ol class="post-comments"> <?php wp_list_comments(array( 'style' => 'ol', 'short_ping' => true, 'callback' => 'better_comments' )); ?> </ol> <?php endif; where better_comments() is defined as follows: function better_comments($comment, $args, $depth) { ?> <li class="comment byuser comment-author-admin bypostauthor even thread-even depth-1"> <div class="comment-body"> <p>hello</p> <p> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </p> </div> </li> <?php } The comment_reply_link call gives me a reply button on my …
As an exercise, I created a very simple transformer model that just sees the same simple batch of dummy data repeatedly and (one would assume) should quickly learn to fit it perfectly. And indeed, training reaches a loss of zero quickly. However I noticed that the loss does not stay at zero, or even close to it: there are occasional large jumps in the loss. The script below counts every time that the loss jumps by 10 or more between …
I need to design a marker image that should be detected by the neural network. I am aware that it is not a complex task just to detect an image and this can be done with OpenCV alone. However the detector but this should also work also in pure visibility conditions (low light, out of focus, worn out/partially damaged, makes tiny part of the image only, etc). The background around the marker image is just the real world, difficult to …
I have create search box using ajax.If i enter any value in search input box that this value search in post title or post meta data and get all data of this value in custom post type.also query check only post title and specific post meta data. Not check in Post content or any other field. I have tried this query $args = array( 's' => $keyword, 'numberposts' => -1, 'post_type' => 'store', 'meta_query' => array( 'relation' => 'OR', array( …
I have a website centered around music. I have 3 main post types- 'Artist', 'Release', and 'Version'. There are 4 types of 'Version'- album, single, video, misc. Artist is parent of Release. (artist has a single -> many relationship with releases) Release is a parent of Version. (Release has a single-> many relationship with version) I've established these relationships in the plugin toolset types. In my single-artist page, I have releases displayed in sections. Here's an example of the code …
My understanding of VAE is that unlike Autoencoders, it does not directly give you a discrete encoding (latent code vectors n-dim) instead, it gives you both mu and sigma (n- dim mean vectors and n-dim standard deviation vectors). Then you have epsilon which you use to sample from a normal distribution with mu and sigma to create z. When combining mu, sigma and epsilon, you get z which is the one decoded by the VAE's decoder. z is basically the …
Im looking to count how many meta keys exist within a post, because each time a specific user action happens, a new meta key is created with a date in it. I have this, which does not return anything (I'm looking for a number)... ... $post_title = $row->post_title; $id = $row->ID; $post_count = $wpdb->get_var(" SELECT COUNT(DISTINCT $wpdb->postmeta.meta_key) FROM $wpdb->posts LEFT JOIN $wpdb->postmeta WHERE $wpdb->posts.post_type = 'things' AND $wpdb->postmeta.meta_key = 'dates' AND post_id = $id "); echo $post_title . ' (' …
I'm using the Gutenslider plugin on my home page to display some graphic design samples. However, I don't see an option to position the captions below the slide image. Guten drops them smack in the middle of the image. I launched the dev tools in the tab I'm previewing in and if I add absolute positioning to the (caption) paragraph element or its container, I end up pushing the caption downward, but it eventually disappears when it goes beyond the …
So I've built a testimonials post type into my WordPress theme added it to a slider on the homepage but I'm getting confused when it comes to adding the rating given by the customers can anyone point me in the right direction im not interested in using a plugin function custom_testimonials() { $labels = array( 'name' => __( 'testimonials' ), 'singular_name' => __( 'Testimonials' ), 'all_items' => __( 'All Testimonials' ), 'view_item' => __( 'View Testimonial' ), 'add_new_item' => __( …
I apologize I am a ML novice, but I am trying to learn. I am making a classifier based on this dataset to predict mental health disorders based on features. I wanted to run a very simple NB classifer model but I keep getting a bad input shape error (I want to feed in features such as age, ethnicity and gender to yield potential diagnoses). Unfortunately, I am having trouble diagnosing where my error is coming from and troubleshooting. Any …
Ok here's the scenario: I have added a custom section to an existing theme so that it shows up in the theme customization page (customize.php). The problem I am having is that I don't know how to notify wordpress when changes are made in my custom control. I guess I am missing something in my code because it should do it in automatic? Here is some sample code: $wp_customize->add_section('my_section', array( 'title' => 'My title', 'description' => 'My description', 'priority' => …
I use a quick redirects plugin and it's changing my URLs after the fact and thereby breaking some of my links. I never want wordpress to change & to #038;. There is an unwanted solution to turn off all wp_texturize by placing: remove_filter('the_content', 'wptexturize'); I don't want to disable everything, just the & conversion in URLs. I can physically modify wp-includes/formatting.php by commenting out this line, but it didn't work: $content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&#038;$1', $content); I don't want to do …
I'm currently conducting a review for quantitative methods being used for tropical inland fisheries. One of the major problems for modeling methods in tropical inland fisheries is the lack of data available. Fisheries assessments are difficult with widely distributed, small-scale fisheries. As many of the people living in tropical regions are subsistence fishers, they directly consume fish without any recordings of the catch. I'm trying to find statistical/mathematical modeling methods that are able to deal with data-limited systems. I do …