How does the asterisk (*) work in the wildcard matching problem?

This is a wildcard matching problem. Given a pattern P containing letters and character * that can match an arbitrary string of characters (including an empty string), my task is to write a polynomial-time algorithm to determine whether such a pattern P occurs in a given text T. So here is my answer for the problem.

We can use dynamic programming to solve this problem. Let us have a 2D boolean array dp[i][j]. dp[i][j] returns true if there is a match between the pattern and the string.  Initialize dp[i][j] = false  -dp[0][0] = true since an empty string matches an empty pattern.  -dp[0][j] = dp[0][j-1] (= true) if P[j] = * for 1<= j <=m since an empty string matches ‘*’ as long as previous characters match. In other words, once P[j-1] != “*”, dp[0][j] will be false afterwards.  -If P[j] = ‘*’, we have dp[i][j] = dp[i-1][j] || dp[i][j-1]  For dp[i-1][j], ‘*’ acts as an empty string. E.g. ab and ab*  For dp[i]p[j-1], ‘*’ acts as any sequences. E.g. abcd and ab*  In other words, if P[j] = ‘*’ and (dp[i-1][j] || dp[i][j-1]) = true, dp[i][j] = true    -If P[j] = T[i], it boils down to match T(i-1) and P(j-1). dp[i][j] = dp[i-1][j-1]  For other cases, dp[i][j] is false.  Pseudocode:  tLen = T.length  pLen = P.length    Initialize dp[tLen+1][pLen+1] = false  Dp[0][0] = true  For j = 1 to pLen            If P[j] = ‘*’                     dp[i][j] = dp[0][j-1]  for i =1 to tLen            for j=1 to pLen                     if P[j] = ‘*’                               dp[i][j] = dp[i][j-1] or dp[i-1][j]                     else if P[j] = T[i]                               dp[i][j] = dp[i-1][j-1]                      else   dp[i][j] = false  Return dp[tLen][pLen]   The algorithm fills a tLen x pLen table, so the running time is O(nm)   

During a discussion in class, my professor said my answer is vague. He asked me if I had considered * can appear in the middle of the pattern and it can appear several times in the pattern. In particular, consider pattern

abcccdeeef

and string

abcdcccccdefefeefeeef

How does this algorithm determine, which c in the pattern should match with which c in the text? How does it with e?

My understanding towards this problem is that what matters is the final result of dp[tLen][pLen] and we use a table to compare substrings with each other.The character * would probably match any character it encounters. We just derive our answers from previous steps to fill out the whole table so that we can get the final result of dp[tLen][pLen]. However, for his specific question, I can’t think of a reasonable way to answer. Any help with the explanation would be appreciated.

Why CORS is still securing an open api where all requests have a wildcard (*)?

In case of an open API, the only possible value for Access-Control-Allow-Origin is a wildcard (*), since you can’t have a list of allowed domains.

Still, this seems not to bug developpers and appears to keep the system secure. How is that possible? Isn’t allowing all domains to make every request the same as not having SOP or CORS Policy?

It might be that I don’t really get the security provided by CORS, but as I understood it, it avoid an unwanted domain to use session cookies of a user without his consent. Still, I don’t get why it protect the user to see his account used for unwanted purposes once a data modifying route is opened to this domain.

can I use a wildcard in a datasheet view custom filter to NOT show titles that begin with certain words?

I have a calendar list view and want to be able to filter on the title to NOT show items that begin with the word Deleted.

Can you use a wildcard at the end of Deleted to grab all titles that begin with deleted?

Example Does Not equal Deleted*

Thanks, Rhonda

udisksctl unmount with wildcard possible?

I use Ubuntu bionic. Is it possible to umount with udisksctl unmount with wildcards? Short story, when I plug in my backupdrive a user systemd.service start my backskript. when the backup is ready I have to unmount every patition with udisksctl unmount -b /dev/sdc1 and so on. I can nothing find in the manpages. I want to create on desktop a starter to umount all partition of my backudrive at once.

Creating a PFX File for Wildcard SSL Certificate

I am trying to install a Wildcard SSL Certificate in IIS on Windows Server. It only accepts the .pfx file format for importing & installing an SSL certificate for hosted applications. I got the .csr file from CA as it was a wildcard cert.

I downloaded and installed OpenSSL for Windows (Latest version).

I placed the .crt file & .key file into C:\Program Files\OpenSSL-Win64\bin.

Then I ran this command to generate a random file:

set RANDFILE=C:\Program Files\OpenSSL-Win64\bin\<RANDOMFILENAME>.rnd 

Then I ran this command to give a path of config file:

set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg 

Finally, I ran this command

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt 

The result of this was:

unable to load private key 140406554043456:error:0909006C:PEM routines: get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: ANY PRIVATE KEY 

I want to know if I’m making any mistake in the steps that I followed. I also want to know the reason of this error. I have the copy of private key & .crt file

Following are some more inputs which will make my question more specific.

  1. I have the copy of generated-private-key.key file & .crt file. I changed the file names before executing the OpenSSL command. I even created the random file & config file.

  2. The SSL certificate that I got from CA is a wildcard certificate, which I used to install on multiple subdomains of a customer. It was successful. Now while creating the .pfx file once again, I’m facing this problem.

  3. A .pfx file should be created only on the server which was used to create .csr file. In our case, we got the .csr file from CA as it was a wildcard certificate.

(Thanks in advance. Any help is appreciated)

Creating a PFX File for Wildcard SSL Certificate

I am trying to install a Wildcard SSL Certificate in IIS on Windows Server. It only accepts the .pfx file format for importing & installing an SSL certificate for hosted applications. I got the .csr file from CA as it was a wildcard cert.

I downloaded and installed OpenSSL for Windows (Latest version).

I placed the .crt file & .key file into C:\Program Files\OpenSSL-Win64\bin.

Then I ran this command to generate a random file:

set RANDFILE=C:\Program Files\OpenSSL-Win64\bin\<RANDOMFILENAME>.rnd 

Then I ran this command to give a path of config file:

set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg 

Finally, I ran this command

openssl pkcs12 -export -out certificate.pfx -inkey privateKey.key -in certificate.crt 

The result of this was:

unable to load private key 140406554043456:error:0909006C:PEM routines: get_name:no start line:../crypto/pem/pem_lib.c:745:Expecting: ANY PRIVATE KEY 

I want to know if I’m making any mistake in the steps that I followed. I also want to know the reason of this error. I have the copy of private key & .crt file

Following are some more inputs which will make my question more specific.

  1. I have the copy of generated-private-key.key file & .crt file. I changed the file names before executing the OpenSSL command. I even created the random file & config file.

  2. The SSL certificate that I got from CA is a wildcard certificate, which I used to install on multiple subdomains of a customer. It was successful. Now while creating the .pfx file once again, I’m facing this problem.

  3. A .pfx file should be created only on the server which was used to create .csr file. In our case, we got the .csr file from CA as it was a wildcard certificate.

(Thanks in advance. Any help is appreciated)

Wildcard Query for SharePoint Rest API

I tried using this example as search parameter “Share*” but the result return nothing.

            KeywordQuery keywordQuery = new KeywordQuery(clientContext);              keywordQuery.QueryText = SearchParameter;              keywordQuery.EnablePhonetic = true;                keywordQuery.EnableOrderingHitHighlightedProperty = true;             //keywordQuery.SummaryLength = 500;               SearchExecutor searchExecutor = new SearchExecutor(clientContext);              ClientResult<ResultTableCollection> results = searchExecutor.ExecuteQuery(keywordQuery);              clientContext.ExecuteQuery();