I am using the next to show in a loop of posts the current post and the total of posts published. $post_query = new WP_Query($args); $postAmount = wp_count_posts( 'post' )->publish; <?php echo $post_query->current_post + 1 ?> / <?php echo $postAmount ?> This returns 1/20, 2/20, etc Does someone know how to add a leading zero so it shows 01/20, 02/20, etc? Thanks a lot in advance
I created a wordpress website and I use google map API. I would like to add restrictions to prevent troubles. So I get the IP of the website from my hosting services and I also ping it to double check. I added it on the list of authorized IP but I still have an error message (Google Maps JavaScript API error: RefererNotAllowedMapError) and it is impossible to display a card. I can't understand what am I missing there. To be …
I’m trying to apply the pre_get_posts to a specific core/query block, in order to programatically modify the number of posts displayed when a custom attribute is set. If I use the render_block hook, the block is already pre-rendered and so modifying the query using pre_get_posts has no effect. Is there any way to achieve this? (I don't need help adding the custom attribute; I've done so already using block filters.)
I have scientific database with articles and coauthors. using this database I am training word2vec model on co-authors. Use use case here is to disambiguate authors. I was wondering my approach here can be improved or any suggestions will greatly be appreciated. Code
I'm trying to render the block HTML dynamically by injecting it within a core/query block. The injection is working fine using DOMDocument, but I can't find out how to render the embed HTML. I can use wp_oembed_get for the iframe, but I need the wrapper DIVs, aspect ratio by provider, and so on.
i just want to create a custom Table in my WordPress database and i saw many php functions to deal with that my question now is : can i just create them with an sql command and for what do i need to keep an eye on ?
I got a very strange error when run conda env create -f environment.yml. Due to proprietary information, I cannot share the content of environemnt.yml, except that it contains a pip section - pip - pip: - sqlalchemy - pyyaml It seems to run OK up to the creation of the requirements.txt file, and then throw the following error Collecting package metadata: done Solving environment: done Preparing transaction: done Verifying transaction: done Executing transaction: done # >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<< Traceback …
I am working in a PHO environment in Heroku with ClearDB. At some point (really low), I get this error: WordPress database error User 'XX' has exceeded the 'max_questions' resource (current value: 3600) for query SHOW TABLES LIKE 'wp\\_users' made by display_setup_form. I guess this is an error due to use the free database plan of ClearDB. However, after getting that error (spotted in the server logs), the server is redirecting to the install screen. Is there any way to …
I want to tokenize text data and am unable to proceed due to a type error, am unable to know how to proceed to rectify the error, To give some context - all the columns - Resolution code','Resolution Note','Description','Shortdescription' are text data in English- here is the code that I have written : #Removal of Stop words: from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import stopwords from nltk.tokenize import RegexpTokenizer tokenizer = RegexpTokenizer(r'\w+') stop_words = set(stopwords.words('english')) tokenizer = RegexpTokenizer(r'\w+') dfclean_imp_netc=pd.DataFrame() …
I have been experimenting with keras/tensorflow to build up my confidence and am currently trying to build a LSTM model that forecast the price of a stock based on the price of the stock in the previous ten days. Lets start by saying that the results were terrible in the beginning (the model was predicting an almost constant value with a mae of 20%. I've identified the culprit (or so I think) of such underperformance in the batch size, I …
A friend created a plugin for me which allows the users to mark posts as read or unread. The code of this plugin is the following : edit of the code ! <?php /** * @package Read-Unread * @version 1.0 */ /* Plugin Name: Read-Unread Plugin URI: http://www.google.fr Description: Read-Unread plugin Author: Moi Version: 1.0 Author URI: http://www.google.fr */ global $wpdb; $table_name = $wpdb->prefix . "users_read"; $sql = "CREATE TABLE IF NOT EXISTS `$table_name` ( `ID_USER` int(11) NOT NULL, `ID_POST` …
I have a huge dataset with the categorical columns in features and also my target variable is categorical. All the values are not ordinal so I think it is best to use one hot encoding. But I have one issue that my target variable have 90 classes so if I do one hot encoding there will be 90 columns as the target columns and it will become to much complex. But as all the values are not ordinal can I …
I'm using WP API to get posts in my application and I'm trying to exclude some posts from query using filter[post__not_in]. after removing filter in WP 4.7, I'm using WP REST API filter parameter plugin to get it back. and it works for all parameters but for post__not_in it's not effecting at all, I still get all posts. I saw some closed issues about this on WP API repo on github, they said that post__not_in are not allowed for unauthenticated …
I'm trying to use Gutenberg's InnerBlocks with ACF Blocks in my allowedBlocks I have [ 'core/heading', 'core/paragraph', 'core/buttons'] In my 'core/buttons' block I'd like to allow multiple buttons, but it only seems to enable one. My block template is as follows: [ [ 'core/heading', [ 'level' => 3, 'placeholder' => __( "Add Heading...", THEMENAME ), 'align' => 'center', 'className' => 'has-text-align-center', ], ], [ 'core/paragraph', [ 'placeholder' => __( "Add paragraph text...", THEMENAME ), 'align' => 'center', ], ], [ …
i tryed to return multiple Values from an Ajax Call, I would Like to retun Value a and value b in two separat Variables in my Ajax function. Is it posible to do that? or could I use an Array? Or should i do for every Call a own Function? My Function: "here i will do one ore more Database querys" function rob_ajax_vorlage() { global $wpdb; $a = "100"; echo $a; $b = "200"; //second value that doesen work jet …
Can anyone please suggest me how to arrive to the best optimal values for number of layers, number of neurons parameters of the deep learning model in DDQN algorithm for cartpole problem. As input and output neurons are 4 and 2 respectively for cartpole, are there any scientific reasons or maths behind choosing number of hidden layers and neurons in them. I have followed this link to build reinforcement learning algorithm https://pylessons.com/CartPole-reinforcement-learning/
I do have a problem on my WordPress site. In the frontend there is a spam post (not a comment, a post) visible to everybody. I don't know where it comes from and all malware scans were negative so far. However, in order to solve this problem I will need to delete this post. But it can't be seen in the backend. As you can see on the given screenshot the posts area shows "all posts" with the number of …
What is the easiest and easy to explain feature importance calculation for linear regression? I know I can use Shap to compute feature importance, but I find it difficult to explain it to stakeholders, and the coefficient is not a good measure of feature importance since it depends on the scale of the feature. Some suggested (standard deviation of feature)*feature coefficient as a good measure of feature importance.
I have 2000 samples with 50 sensors signal every millisecond during 600 milliseconds. This means a 2D record for each sample. I would like to predict a continuous value. I would like to try autokeras for this regression problem. Could someone point to a tutorial or some advise to start with?
I just create a site on my Multisite domain (example.com), for instance site1.example.com After this, I try to enter on https://site1.example.com/wp-admin, but I'm redirected to https://www.example.com/wp-signup.php?new=example.com My .htaccess containt this lines: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] I have installed, among others, this plugins …
The images are identical except for the presence of the stripe on the side. I am trying to use a classify the images into 2 classes: greenStripe, noGreenStripe. I tried to use tensorflow retrain with a small dataset (~40 pictures in each class and batch size of 8) but the results where really bad. I am afraid to commiting to training using more data as it is time consuming. What do you suggest? Is there a better approach or does …
I am implementing some special search options that should exclude anything not of the type post. The Events Calendar is interfering and modifying the query on the fly anyway. My query mod just looks like: $query->post_type And I am doing this before the query in question: remove_action( 'pre_get_posts', [ 'Tribe__Events__Query', 'pre_get_posts' ], 50 ); remove_action( 'parse_query', [ 'Tribe__Events__Query', 'parse_query' ], 50 ); ...and restoring the actions afterward to resume normal operation. So with this debug code: add_filter('query', function($sql) { global …
A plugin I am using creates a custom post type for articles ie. 'ht_kb'. In my themes front page I have a custom loop displaying recent posts of the standard 'post' type. On the same front page I have another custom loop displaying recent posts of the plugins custom 'ht_kb' post type. The standard post type loop works as expected, but with the custom post type loop I am getting the error as posted below. I am having difficulty understanding …
What is the most convenient way to visualize Softmax values after calling the CNN prediction function? Do I have to collect different probability values and feed them to the matplotlib or are there any more convenient ways/libraries to do this? Below is one example what I mean:
Consider the following scenario: Suppose two lists of words $L_{1}$ and $L_{2}$ are given. $L_{1}$ contains just bad-written phrases (like 'age' instead of '4ge' or 'blwe' instead of 'blue' etc.). On the other hand, each element of $L_{2}$ is a well-written version of each element of $L_{1}$. Here is an example: $$L_{1}=[...,dqta \ 5ciencc,...,s7ack \ exch9nge,...],$$ $$L_{2}=[...,stack \ exchange,...,data \ science,...].$$ Problem: Is there any strategy to try to predict which element $w^{\prime}$ in $L_{2}$ is the syntactically correct counterpart …
I'm working on NMT model which the input and the target sentences are from the same language (but the grammar differs). I'm planning to pre-train and use BERT since I'm working on small dataset and low/under resource language. so is it possible to feed BERT to the seq2Seq encoder/decoder?
i Use WordPress Media Uploader on Frontend to allow users to upload Thumbnail for there UGC site. I also show a Preview of the Image on Frontend. When a user clicks the button the Media Uploader opens user uploads image, sets it as Featured Image and we are good. But, the Image Preview still shows old Image. I have a WordPress Site, based on User Generated Content, where people can create posts via a Frontend Form. When A user updates …
There is manufacturing data with 10 process variables. Normal and bad labeling are not done. It's tabular fdata. Do you have a paper that only uses data that are not labeled to predict defects or to find variables that affect them? I thought about using the Outlier Detection Algorithm (Isolation Forest, Autoencoder) to predict defects, but I can't find a way because I don't know the exact defect rate. I can't think of a way to verify it, so I'd …
Hello Stack Exchange people, I created a custom post type called articles. I also created a taxonomy city for that specific post type. I can create a custom post and set a city to it and it gives me the url I'm wishing to read this page. https://www.example.com/blog/city_name/title_of_the_article/ The thing I wish to do is to create a city page that will act like the regular archive.php but just for the city of the custom post types. For example, I …
Suppose I have a response variable y and and a set of feature variables (x1, x2 ... xn). I wish to find which of x1...xn are the best features for y in a regression problem (the relationship might not be linear). Is there any way I can do this kind of feature selection without using any correlation measure or regression function in the process (i.e. I cannot use any filter or wrapper methods)?
My goal is to find the worst affected industries from COVID—19 in terms unemployment. In terms of the data I will use for this task, I have a time series county-wise unemployment rate data of each month and business distribution data. Business distribution data contains number of establishments in each county by their respective industries. (Manufacturing -121, Accommodation and Food Services -564, Construction-32 etc.) Unemployment rate data gives monthly unemployment rate in each county. From this data, what would your …
Is there any way to add a new email address along with admin email who receives same email as the admin.like : on placing an order admin receives 'NEW ORDER RECEIVED' but customers receives 'THANKS FOR YOUR ORDER' I know how to add an email on placing order as customer but is there any way where admin and that added email recipient will receive same email.and after the order is placed remove that email.
I'm working building a genetic algorithm that will learn to play snake. I've worked out how to add/remove layers and neurons in the model, allowing the model's size to change through mutation. But this brings the problem of how to perform crossover when models will have different numbers/sizes of layers. If it was just the size of each layer that could change, it would be one thing. I can handle that. But I just can't figure out how to do …
I came across an adapted question from the famous ISLR book and realise I am unsure of the answer. Does anyone know? Interested in the intuition here! Cost-complexity pruned trees with $\alpha=1$ relative to unpruned trees (select one): a. Will have better performance due to increased flexibility when its increase in bias is less than its decrease in variance. b. item Will have better performance due to increased flexibility when its increase in variance is less than its decrease in …
I am currently trying to fit a KNeighborsClassifier (scikit-learn implementation) to about a gigabyte of training data. From every resource I've read online, a k-nearest-neighbors classifier is a "lazy" classifier in that the fitting process is simply storing a copy of the training data. Then when you make a prediction, you search through the training data to make the prediction. But when I call fit, it fails, telling me it cannot allocate 800 gigabytes of memory. I believe it's trying …