## pumping lemma – Prove that \$0^m1^n\$ is not regular with \$m neq n\$

I need to show that $${0^m1^n} text{ with } m neq n$$ is not regular.

I tried to do this using the pumping lemma. Take $$s=0^{d_1} 1^{d_2}$$ with $$d_1 neq d_2$$. Given a decomposition $$s=xyz$$, there are $$3$$ possibilities.

$$1.$$ $$y$$ contains only $$0$$‘s.

If $$d_1 < d_2$$ and $$|y|=1$$, $$d_1$$ will eventually be equal to $$d_2$$, which is not accepted by $$L$$.

$$2.$$ $$y$$ contains only $$1$$‘s.

If $$d_2 < d_1$$ and $$|y|=1$$, $$d_1$$ will eventually be equal to $$d_2$$, which is not accepted by $$L$$.

$$3.$$ $$y$$ has the form $$(0)^+(1)^+$$

We illustrate this with an example. If we take $$xyz$$, then $$xyyz$$ will have a $$1$$ flowed inside the row’s of $$0$$‘s and that is not accepted by $$L$$ as first we have all $$0$$‘s and then $$1$$‘s.

Consequently, $$L$$ cannot be regular.

## regex – The formulation of a regular expression for multiple lines

I have an input text from which I would like to separate specific pattern. I heard that best way is to use regex. I was trying to write it by my own, but I can do it only for a single line and the text that I want to separate consist of multiple line.
Quotes destroy the structure of the text, or I don’t know how to do it properly. I want to separate 4 lines
1st line
`.*b(grabi|atakuje).*`
2nd line
`((.+)|(.+)).*bBohater`
3th line
`bJednostki.*(?)`
4th line
`bPrzybeda.*(0-2)(0-3)+:(0-5)(0-9)+:(0-5)(0-9)`

I have no idea how should I do this using just one regex formula.

Example input text

Oddziały przychodzące (16)

►► LOCKDOWN ◄◄ Respect grabi osadę Laszram
‭(‭−‭23‬‬|‭−‭20‬‬)‬ Legionista Pretorianin Centurion Equites legati Equites imperatoris Equites caesaris Taran Ognista katapulta Konsul Osadnik Bohater
Jednostki ? ? ? ? ? ? ? ? ? ? ?
Przybędą w 0:03:30 godz.o 00:21:33
★★Covid – 20 PRO★★ Respect grabi osadę Laszram
‭(‭−‭66‬‬|‭−‭69‬‬)‬ Legionista Pretorianin Centurion Equites legati Equites imperatoris Equites caesaris Taran Ognista katapulta Konsul Osadnik Bohater
Jednostki ? ? ? ? ? ? ? ? ? ? ?
Przybędą w 0:10:41 godz.o 00:28:44
★★Covid – 20 PRO★★ Respect grabi osadę Laszram
‭(‭−‭66‬‬|‭−‭69‬‬)‬ Legionista Pretorianin Centurion Equites legati Equites imperatoris Equites caesaris Taran Ognista katapulta Konsul Osadnik Bohater
Jednostki ? ? ? ? ? ? ? ? ? ? ?
Przybędą w 0:12:12 godz.o 00:30:15

Oddziały w tej osadzie i jej oazach (1)

Example single output

★★Covid – 20 PRO★★ Respect grabi osadę Laszram
‭(‭−‭66‬‬|‭−‭69‬‬)‬ Legionista Pretorianin Centurion Equites legati Equites imperatoris Equites caesaris Taran Ognista katapulta Konsul Osadnik Bohater
Jednostki ? ? ? ? ? ? ? ? ? ? ?
Przybędą w 0:12:12 godz.o 00:30:15

## All string matches for regular expression

Given a regular expression, the ask is to find all matches in a string, str.
Most implementations give longest match only. For example, [a]* in str “aaaaaa”, the regex libraries in C++ or python only provide the longest match, i.e. { “aaaaaa”, “” } at position 0 and 6 respectively.
,
How can one obtain all matches like { “” , “a”, “aa”, “aaa”, “aaaa”, “aaaaa”, “aaaaaa”} with C++ regex libraries.

## graphics card – Why laptop GPU’s are smaller than regular PC’s GPU’s

Maybe this is a stupid question to ask, but I was always wondering, why laptop graphics cards are significantly smaller than pc ones. Let’s compare Laptop with RTX 2080 Super

And some regular RTX 2080 Super – RTX 2080 Super sample image

And regular RTX 2080 Super is quite a bit bigger than the laptop itself. This laptop isn’t even 3cm thick, where the only GPU seems to be exceeding that.

As I know, in Laptops only GPU main chip is soldered on (And VRAM ye ye ye…) But then the next question rises up. Why we can’t just make some kind of GPU socket on the motherboard, and that would make PC’s a lot smaller, excluding that bulky GPU PCB.

## finite automata – Regular language is closed given transposition of rightmost character to leftmost

It would appear straightforward to show that a regular language is closed given the transposition of the rightmost character to the front. However after drawing a few sample DFA for the phenomenon, I’ve been unable to come up with a generalized ‘concept’ or ‘proof’ that shows it’s true for all regular languages. Could anyone help me out? It’s on occasions like these that I see the value of formal definitions for DFA (instead of just drawings), however it’s been a while since I’ve studied those.

## regex – Regular Expression for parsing a decimal number

I have an input field for entering a decimal number. The field should allow only the numbers 0-9, the comma (,) or the dot (.). The comma/dot should be allowed only once. And there should be only two decimals.

The following regex works partially: value.replace(/(^0-9,.)/g, ”)

Basically, it replaces everything but numbers, comma and dot with empty string. But I do not know how enforce only one comma/dot and two decimals.

Do you have any thoughts?

## regex – Better way to find if value matches list of regular expressions

Sample code, see if a value matches any regex from a list:

``````    private val regex: List<Regex> = ...

fun matches(value: String): Boolean {
regex.forEach { re ->
if (re.matches(value))
return true
}
return false
}
``````

It works, but I’m wondering if there is a more elegant way to do this. Note that I don’t want to evaluate all of them, but stop whenever there is a match.

## formal languages – Check if given safety properties are regular, and if so construct NFAs

Let $$mathit{AP} = {a, b, c}$$. Consider the following LT properties:

1. Between two neighboring occurrences of $$a$$, $$b$$ always holds.
2. Between two neighboring occurrences of $$a$$, $$b$$ occurs more often than $$c$$.

For each of these properties $$P_i$$ (where $$1 leq i leq 2$$), decide if it is a regular safety property (justify your answers) and if so, define the NFA $$A_i$$ with $$L(A_i) = mathrm{BadPref}(P_i)$$.

## How to keep a custom map visible during a regular google maps search?

I have a custom map saved. On the computer, I view it by going to `[Hamburger Icon] > Your places > Maps`. When I click on the map, I can see the places on that map. But I want to search hotels near some of those places, and I can’t figure out how. When I hit the back arrow, the map disappears. How can I keep my custom map visible during a normal Goole maps search? Surely this has to be possible…

## Valid B1/B2 "R" (regular) on expired diplomatic passport

Can I use my valid regular (non diplomatic visa) issued in my old and expired diplomatic passport with my new regular passport?