Why to use captcha when SOP exists? [closed]

I just read about SOP (same origin policy), and I tried to learn this more and learn how it works. I tried to reset my password (In a chat forum) using HTTP Requests in Python, and most of them have captcha, why do websites need captcha when SOP exists?

The SOP doesn’t allow other places to perform those tasks, right? And how can attackers bypass the SOP and try to reset other people’s passwords?

What happens when a banished creature would return to an extradimensional space that no longer exists?

Consider the following scenarios.

1. Banished from a portable hole, portable hole is destroyed.

A portable hole is described as a ten foot deep, six foot diameter extradimensional space. Suppose I jump into my portable hole after spreading it out on the ground, and I am followed by an enemy. Once we are both inside my portable hole, I cast banishment:

If the target is native to a different plane of existence than the one you’re on, the target is banished with a faint popping noise, returning to its home plane. If the spell ends before 1 minute has passed, the target reappears in the space it left or in the nearest unoccupied space if that space is occupied. Otherwise, the target doesn’t return.

My enemy is banished to its home plane. Next, I climb out of my hole, get a safe distance away, and toss in my bag of holding:

Placing a bag of holding inside an extradimensional space created by a handy haversack, portable hole, or similar item instantly destroys both items and opens a gate to the Astral Plane.

The portable hole is destroyed, and finally I break my concentration on banishment before the full minute has passed.

2. Banished from a rope trick right before the spell ends.

Rope trick says:

an invisible entrance opens to an extradimensional space that lasts until the spell ends. […] Anything inside the extradimensional space drops out when the spell ends.

So I cast rope trick while I’m being chased, and my pursuer pursues me into my little rope trick room, where I am patiently holding banishment. I banish my pursuer, climb out of my rope trick room, and and cast dispel magic on the rope:

Choose one creature, object, or magical effect within range. Any spell of 3rd level or lower on the target ends.

Again, no space to return to as I break my concentration on banishment before the one minute is up.

What happens to the banished creature when banishment ends? Banishment is very specific that the creature returns to the space it left from. Both the actual extradimensional space and the 5 foot square space the creature previously occupied is gone, as well as all nearest unoccupied spaces. What happens?

Is this language L = {w $\in$ {a,b}$^*$ : ($\exists n \in \mathbb{N} $)[$w|_b = 5^n$]} regular?

Let’s say we have the language L = {w $ \in$ {a,b}$ ^*$ : ($ \exists n \in \mathbb{N} $ )[$ w|_b = 5^n$ ]}. I want to know if this is a regular language or not. How do I go about doing this? I’m familiar with the Myhill-Nerode theorem but I don’t know how to apply it.

How are scientific research projects planned? In particular computer science, but possibly there exists processes for all research?

Possibly some context: Take any research endeavor. Finding a vaccine. Going to the moon. Clean energy. I don’t have a background in these scientific areas so picking one closer to home (Comp Sci) might be better. But the idea is how to battle the Unknowns? How to do it economically? How to make progress while not getting analysis paralysis?

Some might suggest a scrum, or an agile process try to solve these questions. I’m not certain that they address the same level or kinds of Unknowns.

Are there previous experiences that work, and those that don’t work? And why? The questions grows on the way forward through unknowns, and by definition the Unknown doesn’t exactly have a road map, and new context is developed regularly.

This maybe simply the question of the ‘meta’ variety: Is there research on comp sci research? If so does Comp Sci research have approaches or techniques that they rely on?

Mysql, Getting all rows in which field ends in a specific character, and another field exists that is the same but doesn’t end in that character

I need to get all rows which end in a specific character, P for example, but in which a similar key sans the P exists. I have no idea how to approach this one in MySQL.

This is very small example, my actual data is huge with other columns also.

+------------+ |    key     | +------------+ | value_100  | | value_100P | | value_101  | | value_101  | | value_102  | | value_102P | | value_103P | | value_104P | +------------+ 

The query would output,

+------------+ |    key     | +------------+ | value_100P | | value_102P | +------------+ 

Proving a certain primitive recursive function exists

Assume $ f\colon ω × ω → ω$ is a computable function. How can we prove that there is a primitive recursive function $ g\colon ω × ω → ω$ where the following holds:

$ ∀n [∃s(f(n, s) = 1) ↔ ∃k(g(n, k) = 1)]$

So for every $ n$ , there is an $ s$ such that $ f(n, s) = 1$ if and only if there is a $ k$ such that $ g(n, k) = 1$ .

Been working on this problem for a while now, if anyone could please help?

Given a CFG $G=(V_N, V_T, R, S)$ and one of its nonterminals $v$ determine if there exists a production chain $S \Rightarrow^* v \alpha$?

I am supposed to find an algorithm solving the following problem:

Given a CFG $ \;G=(V_N, V_T, R, S)$ and a nonterminal $ v \in V_N$ determine if there exists a production chain $ S \Rightarrow^* v \alpha$ , where $ \alpha = (V_N + V_T)^*$ .

Not sure if that’s the right term, but in other words we are trying to check if you can yield $ v$ from $ S$ – the starting symbol.

I don’t know anything about the form of the grammar and I can’t convert it into Chomsky’s form as it would introduce new nonterminals and possibly remove $ v$ . Where do I start with this? Any suggestions?


Does a set of formal languages exist such that any DFA for it has $\Omega(c^k)$ states and there exists an NFA for it with $O(k)$ states?

Given an alphabet $ \Sigma : |\Sigma|=c$ , can a set of languages $ \{L_k\}$ be created, such that any DFA for $ L_k$ has $ \Omega(c^k)$ states and a NFA for $ L_k$ exists with $ O(k)$ states?

I’m having trouble creating an $ L_k$ such that any DFA for it has $ \Omega(c^k)$ states. Is a language of strings with a suffix of $ s_k, |s_k|=k$ such a language? Following is a draft proof of that.

Proof by contradiction: let a DFA $ \langle Q, \Sigma, \delta, q_0, F\rangle$ have $ |Q|<c^{k-1}$ . Let $ a, b$ be strings of length $ k$ and $ a_k=(s_k)_1\not=b_k$

Let $ q_a$ and $ q_b$ denote $ \delta(q_0, a)$ and $ \delta(q_0, b)$ , respectively.

There are two cases:

I. there are no $ a,b$ such that $ q_a=q_b$ . Then each string corresponds to a different state, but there are $ c^{k-1}$ such strings, therefore $ |Q|\geq c^{k-1}$ , which is not possilbe.

II. There are $ a,b$ such that $ q_a=q_b$ . Then $ \delta(q_a, s_2s_3\ldots s_k)=\delta(q_b, s_2s_3\ldots s_k)=q_c$ . $ as_2s_3\ldots s_k$ should be accepted and $ bs_2s_3\ldots s_k$ shouldn’t, therefore $ q_c$ is both an accepting state and not an accepting state, which is not possible.

This seems to prove that any DFA for $ L_k$ has at least $ c^{k-1}$ nodes, which is sufficient for $ \Omega(c^k)$ . If my proof is correct, the only task left is to prove that a NFA containing $ O(k)$ nodes exists for $ L_k$ .

The simplest way to do this is to create such a NFA, however I’m not sure how to do that. $ O(k)$ suggests that $ i$ -th node should correspond to the state of “prefix of $ s$ of length $ i$ matches the suffix of the input string”, however I do not follow how such a NFA can be created.

show that this decidable set $C$ exists

I came across this problem which says that given disjoint sets $ A$ and $ B$ s.t $ \bar{A}$ and $ \bar{B}$ are both computably enumerable (c.e.), there exists a decidable set $ C$ s.t. $ A \subseteq C$ and $ A \cap B = \emptyset$ .

I tried out an attempt, but there’s a part of the attempt of which am not so sure… So here’s my attempt:

Since both $ \bar{A}$ and $ \bar{B}$ are c.e. and the fact that $ A$ and $ B$ are disjoint, we have $ \bar{A}-\bar{B}=B$ . We claim that $ B$ is also c.e. (and this is the part which am not sure of). To show that $ \bar{A}-\bar{B}=B$ is c.e., we can have this enumerator $ E$ for $ \bar{A}-\bar{B}$ :

$ E$ : ignore any input

enumerate words $ \{s_1,s_2,s_3,…,s_k\} \in \Sigma^*$ lexicographically from $ k=1$ to $ \infty$

run recognizer $ M_{\bar{A}}$ on input words $ \{s_1,s_2,s_3,…,s_k\}$ for $ k$ steps

run recognizer $ M_{\bar{B}}$ on input words $ \{s_1,s_2,s_3,…,s_k\}$ for $ k$ steps

if both $ M_{\bar{A}}$ and $ M_{\bar{B}}$ accept an input word $ s \in \{s_1,s_2,s_3,…,s_k\}$ , print $ s$

Assuming that $ E$ correctly enumerates $ \bar{A}-\bar{B}$ , since $ B=\bar{A}-\bar{B}$ , we have that $ B$ is c.e.. Since both $ B$ and $ \bar{B}$ are c.e., it follows that $ B$ is decidable.

So to construct $ C$ , we can just set $ \bar{B}=C$ . It follows that $ A \subseteq C$ and $ C$ is decidable.

Is this attempt correct or am I missing something?