## cmd – Regular expression in batch

I have the following code in Powershell

``````if (\$ url -match "^ https: //www.youtube")
``````

As I can perform the same batch control, I tried with the following, but nothing:

``````echo% url% | findstr "^ https: //www.youtube * \$"> null

if% url% == 0 (

echo the variables is correct

) of other (

echoing the varaible is not correct

)
``````

## Root / Regular Share Permissions on Windows Server 2016

I can access `\ server share` using my current ID.

To access `\ server c \$` I need to authenticate with the help of an administrative account on `server`.

Once authenticated with the help of the administrative account, my permissions for `\ server share` reflects those of the administrative account when `server` runs Windows Server 2016, but reflects my current ID in the case of Windows Server 2008 R2.

Is it possible to disable the old?

## postgresql – Postgres: why does this trigram index slow down queries on regular expressions?

I have a text `key values` column in Postgres:

``````select * from test5 limit 5;

id | key values
---- + --------------------------------------------- ---- ---------
1 | ^ first 1 | second 3
2 | ^ first 1 | second 2 ^ first 2 | second 3
3 | ^ first 1 | second 2 | second 3
4 | ^ first 2 | second 3 ^ first 1 | second 2 | second 2
5 | ^ first 2 | second 3 ^ first 1 | second 3
``````

My queries must exclude the `^` middle character of the match, so I use regular expressions:

``````explain analyze select count (*) from test5 where keyvalues ​​~ * & # 39;  ^ first 1[^^]+ second 0 ';

QUERY PLAN
-------------------------------------------------- -------------------------------------------------- ----------------------------------
Finalize Aggregate (cost = 78383.31..78383.32 rows = 1 width = 8) (real time = 7332.030..7332.030 rows = 1 loops = 1)
-> Gather (cost = 78383.10..78383.30 lines = 2 width = 8) (real time = 7332.021..7337.138 lines = 3 loops = 1)
Expected workers: 2
Launched workers: 2
-> Partial aggregate (cost = 77383.10..77383.10 rows = 1 width = 8) (real time = 7328.155..7328.156 rows = 1 loops = 3)
-> Seq parallel scan on test5 (cost = 0.00..77382.50 lines = 238 width = 0) (real time = 7328.146..7328.146 lines = 0 loops = 3)
Filter: (key-values ​​~ * & # 39;  ^ first 1[^^]+ second 0 (text)
Lines removed by filter: 1666668
Planning time: 0.068 ms
Run Time: 7337.184 ms

``````

The query works (no match of lines), but is much too slow at> 7 seconds.

I thought that indexing with trigrams would help, but no luck:

``````create an extension if it does not exist pg_trgm;
create an index on test5 using gin (keyvalues ​​gin_trgm_ops);

explain analyze select count (*) from test5 where keyvalues ​​~ * & # 39;  ^ first 1[^^]+ second 0 ';
QUERY PLAN
-------------------------------------------------- -------------------------------------------------- ---------------------------------------------
Aggregate (cost = 1484.02..1484.03 lines = 1 width = 8) (real time = 23734.646..23734.646 lines = 1 loops = 1)
-> Bitmap heap analysis on test5 (cost = 1480.00..1484.01 rows = 1 width = 0) (real time = 23734.641..23734.641 rows = 0 loops = 1)
Check again Cond: (keyvalues ​​~ * & # 39;  ^ first 1[^^]+ second 0 (text)
Lines removed by checking the index: 5000005
Heap blocks: exact = 47620
-> Bitmap index analysis on test5_keyvalues_idx (cost = 0.00..1480.00 rows = 1 width = 0) (real time = 1756.158..1756.158 rows = 5000005 loops = 1)
Cond Index: (keyvalues ​​~ * & # 39;  ^ first 1[^^]+ second 0 (text)
Planning time: 0.412 ms
Running time: 23734.722 ms
``````

The query with the trigram index is 3x slower! It always returns the correct result (zero line). I expected the trigrams index to immediately understand there is no `second 0` chain anywhere, and be super fast.

(Motivation: I want to avoid normalizing the `key values` in another table, so I'm trying to encode the corresponding logic into a single `TEXT` field using text indexing and regular expressions instead. The logic works, but is too slow, as is JSONB.)

## javascript – How to validate a form with JS using a regular expression?

I'm trying to validate my HTML form with JS by means of a regular expression, but it does not work.

``````

Practice 2

function formValidation(form) { // The following function is referenced to Example 6, provided in the Lecture 05 - Example Files

var nameExpression = /^[a-z]+( [a-z]+)*\$/i
var formValid = true;

if (!nameExpression.test(document.getElementById("fname").value)) {
formValid = false;
document.getElementById('fname-error').style.display = "inline-block";
//displays the error message with inline-block
} else {
document.getElementById('fname-error').style.display = "none";
//hides the error message with none
}

return formValid;

Practice form

<form method = "post" action = ""onsubmit =" return formValidation (this); ">
First name

* Required field, alphabetic characters, spaces and hyphens only.

Sex
Female
Male

Age

13 to 18
18 and over

``````

What I'm waiting for is that the error message appears when the entry does not match the regular expression, without the form being sent. But it does not work at all.

## Need people for regular online data entry jobs

Hi,
I want people to enter data online.
The work consists essentially of 1200 forms to be completed within 7 days. Each form will take a maximum of 2 minutes (if you enter it correctly)
Errors are not allowed in this job. The maximum error allowed is 50 errors. Payment will be made after 3 days from the date of submission. (Once after the QA / QC check). Only the workers of the series being concerned, it will be a regular work.
Send me a message with your prices and payment method to …

Need people for regular online data entry jobs

## input fields – How to define the number of people assigned to an activity in a user-friendly way (with regular updates)?

I am working on an online gaming application. The user (player) must assign people to different types of activities on multiple views. Each view has 1 to 5 activities and a maximum number of people. The user can assign 0 to MAX people split between activities. The maximum number of people will increase over time.

Here is an example for one of these views. Let's say there are 3 activities (A, B, C) and 10 people available. Here are some examples of possible distributions:

``````                                            A | B | C | Total
case 1: 10 | 0 | 0 | ten
case 2: 3 | 3 | 4 | ten
case 3: 1 | 0 | 2 | 3
case 4: 0 | 1 | 3 | 4
``````

The user will regularly update these assignments. And I'm looking for a way to manage it easily.

I've thought about the following / ui.

sliders:
the percentage of people assigned is important, that's why I thought of the sliders. Sometimes the user does not care if 4 or 5 people are assigned to an activity, he just wants a 50-50 distribution. Against: It is not easy for the user to define a specific number of people (number entry next to the cursor?)

[+][-] buttons with number of entry:
the user can click on the plus or minus buttons or directly set the number of people assigned to the activity. The percentage can also be displayed next to the entry. Against: the user can not affect all remaining people available without calculation (or spam [+] icon).

(source: bootsnipp.com)

Zero, decrease, increase, maximum: maybe something similar to page navigation could also be useful. It's like [-][+] but also allows the user to assign all remaining people if necessary. Maybe the arrows are not a good choice of UI, but just to give you an idea:

What do you think? Should I try a mix with [-][+] and min / max with the displayed percentage? Could the sliders help?

## automata – Examples of infinite sets of regular and non-regular languages ​​whose union is regular and non-regular

With regard to a and b, let us make the following observation:

Each language is a union of regular languages.

This stems from the identity
$$L = bigcup_ {w in L} {w }.$$

For part c, it's easy to write $$Sigma ^ *$$ as a union of an infinity of distinct and non-regular languages. Use your non-regular preferred language $$L$$,
$$Sigma ^ * = bigcup_ {w in Sigma ^ *} (L cup {w }).$$

For part d, take again your favorite non favorite language $$L$$. then
$$L = bigcup_ {n = 0} ^ infty {w in L: | w | geq n }.$$
Since $$L$$ is infinite, an infinite number of vertices would be distinct.

## Properties of closing of non regular language under complement?

• Suppose I have the language L1, which is a common language. So, since the current language is closed to the complement, the complement of the language L1 is also a common language.
• But let's say that if the complement of L1 is a non-regular language, is it safe to conclude that L1 is also a non-regular language?

Since I'm trying to prove a language, the L1 is not a regular language and the pumping lemma does not work well with this case. But I can easily prove that the complement of L1 is not regular, I wonder if this option is possible.

## regex – How to create a regular expression that accepts special characters

I have the following regular expression:

``````^ (? = (?:. *  d) {1}) (? = (?:. *[A-Z]) {1}) (? = (?:. *[a-z]) {1})  S {8,16} \$
``````

Try to complete this example but I must add to this regular expression that validates special characters, for example: `(@ \$? ¡-_)`.

The regular expression must validate the following:

length 8 characters
validate at least 1 digit
validate at least 1 capital letter
validate the lowercase letters and
Validate at least 1 special character

## Regular measurement not sigma over

Does anyone know an example of a non-regular $$sigma$$ finite measure ?? I know some examples of no $$sigma$$ finished measures, but they all seem not to be regular for me.