## Must I two-weapon fight with different weapon types or can they be matching?

I think I’m clear on two-weapon fighting (thanks to Two-Weapon Fighting & Bonus Action in 5e) except for one thing. The PHB says (p. 195):

When you take the Attack action and attack with a light melee weapon that you’re holding in one hand, you can use a bonus action to attack with a different light melee weapon that you’re holding in the other hand. [emphasis mine]

Does a “different” weapon mean a different type of weapon, or just a different physical instance of a weapon? In other words, can I fight with two shortswords (one in each hand), or would I have to use a dagger or some other type of light weapon in my off hand?

## No route was found matching the URL and request method. I don’t understand where the problem is

When I send parameters, I get this: No route was found matching the URL and request method.

/**   * Add json data on plugin.  *   * */ add_action('rest_api_init', 'register_api_hooks'); function register_api_hooks() {   register_rest_route(     'passwordless_register/v0', '/register/(?P<name>[a-zA-Z0-9-]+)/(?P<email>[a-zA-Z0-9-]+)/?aam-jwt=(?P<token>[a-zA-Z0-9-]+)',     array(       'methods'  => 'POST',       'callback' => 'wc_rest_user_endpoint_handler',     )   ); }  /**  * Register a new user  *  * @param  WP_REST_Request $request Full details about the request. * @return array$  args.  **/ function wc_rest_user_endpoint_handler($request) {$  request = new WP_REST_Request( 'POST', 'passwordless_register/v0/register/(?P<name>[a-zA-Z0-9-]+)/(?P<email>[a-zA-Z0-9-]+)/?aam-jwt=(?P<token>[a-zA-Z0-9-]+)' );   $username =$  request['name'];   $email =$  request['email'];   $response = array();$  error = new WP_Error();   if (empty($username)) {$  error->add(400, __("name field 'username' is required.", 'wp-rest-user'), array('status' => 400));     return $error; } if (empty($  email)) {     $error->add(401, __("Email field 'email' is required.", 'wp-rest-user'), array('status' => 400)); return$  error;   }   $user_id = username_exists($  username);   if (!$user_id && email_exists($  email) == false) {       $password = wp_generate_password( 20, false );$  user_id = wp_create_user($username,$  password, $email); if (!is_wp_error($  user_id)) {       // Ger User Meta Data (Sensitive, Password included. DO NOT pass to front end.)       $user = get_user_by('id',$  user_id);       // $user->set_role($  role);       $user->set_role('subscriber'); // WooCommerce specific code if (class_exists('WooCommerce')) {$  user->set_role('customer');       }       // Ger User Data (Non-Sensitive, Pass to front end.)       wp_nonce_field( 'wpa_passwordless_login_request', 'nonce', false );       $unique_url = wpa_generate_url($  email , $nonce );$  response['code'] = 200;       $response['message'] = __("User '" .$  username . "' Registration was Successful", "wp-rest-user");       $response['mail'] = __("Mail '" .$  email . "' Registration was Successful", "wp-rest-email");       $response['password'] = __("Pass '" .$  password . "' Registration was Successful", "wp-rest-pass");       $response['url'] = __("Link '" .$  unique_url . "' Registration was Successful", "wp-rest-url");     } else {       return $user_id; } } else {$  error->add(406, __("Email already exists, please try 'Reset Password'", 'wp-rest-user'), array('status' => 400));     return $error; } return new WP_REST_Response($  response, 123);           } add_action( 'after_setup_theme', 'passwordless_register/v0' ); 

## SSL not working fine, Home url not matching with site url wordpress errors

I deployed WordPress through Bitnami so after adding an SSL certification I started getting warnings from my WordPress dashboard of my site URL not matching with Home URL I was directed to my WordPress settings To reset back to https://www.healthviewonfraweb.xyz instead of http but I saw that I could not do that on the my settings, I had to login my Myphpadmin to do it there but WP-OPTION still has the correct URL which is https://www.healthviewonfraweb.xyz but still not reflecting on my WordPress

My problem now is why is the URL on my WordPress General settings is http://www.healthviewonfraweb.xyz/ instead of https://www.healthviewonfraweb.xyz and still cannot be changed from there or why is the site URL on my wp-option not same with the one on my WordPress General settings.

Thank you

## Combinatorial Problem similar in nature to a special version of max weighted matching problem

I have a problem and want to know if there is any combinatorial optimization that is similar in nature to this problem or how to solve this special version of the max weight matching problem.

I have a general graph $$G(\mathcal{V},\mathcal{E},\mathcal{W})$$. I want to find a maximum weight matching of the graph $$G$$ that must cover a certain subset of vertices and has a specific size. For example, if I have a graph with eight vertices, I want to find a max weighted matching that must cover the subset of vertices $$\mathcal{V}’=\{1,2,3\}$$ and the size of the matching is $$\lceil{|\mathcal{V}’|/2}\rceil$$. So one more vertex needs to be chosen that maximizes the weighted matching. How to find the optimal solution in polynomial time if possible?

## Why Burrow’s Wheeler Matching (FM-Index) is favored for DNA read matching

I noticed that FM-indexing is a preferred way to match strings in large data sets, and in particular DNA sequencing wiki-article. I know that with this method, it can eliminate space dependencies thanks to compression methods. However, alternatives like Knuth-Morris-Pratt Algorithm or Rabin-karp are highly effective in terms of extra space complexity with $$O(|Pattern| + 1)$$ and $$O(1)$$ respectively. These, are the complexity that would take if I were to code them so there might be better ways.

Overall, Burrows-Wheeler transform doesn’t do all that much both in terms of time and space. So why is it favored? My current assumption is that it can be modified to do approximate pattern matching. Does that imply Rabin-karp or KMP cannot be modified to efficiently calculate approximate matches?

## Weighted Online Matching. A randomized approach

Let’s consider the edge weighted online matching problem.

It is obvious, that any deterministic algorithm can’t be competitive against an oblivious adversary. Since any new edge could have arbitrary large weight.

Can a randomized algorithm improve upon this result?

## leetcode 10. Regular Expression Matching edge cases

Please tell me how to deal with edge case such as s:"aa", p:"a*"in else if (p[j] == '*') branch. One way I know is to increase the size of dp like vector<vector<bool>> dp(s.size() + 1, vector<bool>(p.size() + 1, false) ); However, in that case the index of dp will not be the same with the index of for loop.

The problem is as follows:
Given an input string (s) and a pattern (p), implement regular expression matching with support for ‘.’ and ‘*’.

'.' Matches any single character. '*' Matches zero or more of the preceding element. 

The matching should cover the entire input string (not partial).

Here is the code:

class Solution { public:     bool isMatch(string s, string p) {         vector<vector<bool>> dp(s.size(), vector<bool>(p.size(), false) );         dp[0][0] = (s[0] == p[0] ? true : false);                  for (int i = 1; i < s.size(); i++) {             for (int j = 1; j < p.size(); j++) {                 if (s[i] == p[j] || p[j] == '.') {                     dp[i][j] = dp[i - 1][j - 1];                 } else if (p[j] == '*') {                     dp[i][j] = dp[i - 1][j] || dp[i][j - 2];                 } else if (s[i] != p[j]) {                     dp[i][j] = false;                 }             }         }                  return dp[s.size() - 1][p.size() - 1];     } }; 

## Matching superimposed image

We are given two grayscale images, one of which contains a large, mostly contiguous patch from the other one. The patch can be altered with noise, its levels may be stretched, etc.

Here’s an example

We would like to determine the region of the image which was copied onto the other image.

My first instinct was to look at the local correlation. I first apply a little bit of blur to eliminate some of the noise. Then, around each point, I can subtract a gaussian average, then look at the covariance weighted by that same Gaussian kernel. I normalize by the variances, measured in the same way, to get a correlation. If $$G$$ is the Gaussian blur operator, this is:

$$\frac{G(A \times B) – G(A)G(B)}{\sqrt{(G(A^2)-G(A)^2)(G(B^2)-G(B)^2)}$$

The result is… not too bad, not great:

Playing with the width of the kernel can help a bit. I’ve also try correlating Laplacians instead of the images themselves, but it seems to hurt more than it helps. I’ve also tried using the watershed algorithm on the correlation, and it just didn’t give very good results.

I’m thinking part of my problem is not having a strong enough prior for what the patch should be like, perhaps a MRF would help here? Besides MRF, are there some other techniques, perhaps more lightweight that would apply? The other part is that correlation doesn’t seem to be all that great at measuring the distance. There are places where the correlation is very high despite the images being very visually distinct. What other metrics could be of use?

## ReplaceAll with pattern matching not working with list of lists

Abstract This is just a learning exercise for me. I am trying to create a function that will take a list of vectors, multiply them by a constant if constant is given, and then add all vectors. If we have no constants then the list looks like this: {list1, list2,...}. However if we want to scale one or more vectors the list would look like this: {{c1,list}, {c2,list}}. I can get it to work with one list whether it has a constant or not but not for a list of lists.

u = {1, -2}; v = {2, -5}; c1 = 4; c2 = -3; vec1 = {u, c1}; vec2 = {c2, v}; ReplaceAll[{vec1, vec2}, {x_List, c_} -> c  x] (* gives wrong values *) vec1 /. {x_List, c_} -> c*x (* this works but not if x_List and c_ reordered *) {c1*u, c2*v} (* this is the value I am seeking *) 

## Pattern matching on function application

Suppose we have a function f :: a -> b and a function g :: b -> a such that f . g = id. You might say that g is the “inverse” of f (and vice versa). Could we then pattern match on something like f x on the left hand side by replacing occurences of x with g x on the right hand side? For example:

-- Here, (- 3) is the "inverse" of (+ 3), or more generally, (- n) is the "inverse" of (+ n)  subtractThree (x + 3) = x subtractThree x = (x - 3) 

This just randomly came to my mind and I’m wondering if there is something fundamentally wrong with this.

Edit: This is my first post here and I’m unsure whether this is the right kind of question for this community. Please don’t hesitate to close this if this doesn’t belong here.