## Is checking if the length of a C program that can generate a string is less than a given number decidable?

I was given this question:

Komplexity(S) is the length of the smallest C program that generates the string S as an output. Is the question “Komplexity(S) < K” decidable?

With respect to decidability, I only know about the Halting Problem and just learned about Rice’s Theorem while searching online (though I don’t think it can be applied here?). I couldn’t reduce the problem to any undecidable problem I know about. Thanks in advance for any help

## Dynamic length of union of segments (1d Klee’s measure problem)

Finding the length of union of segments (1-dimensional Klee’s measure problem) is a well-known algorithmic problem. Given a set of $$n$$ intervals on the real line, the task is to find the length of their union. There is a simple $$O(n \log n)$$ solution involving sorting endpoints of all intervals and then iterating over them while keeping track of some counters.

Now let’s look at a dynamic variant of this problem: we are receiving $$n$$ segments one after another and the task is to find the length of the current union of segments after each new segment arrives. It seems like a natural generalization, however, I cannot find much information about this version of the problem. I wonder if it is still possible to solve this problem in $$O(n \log n)$$ time in an offline setting, i.e. when we are given all segments beforehand and can preprocess them in some way before giving an answer for each segment.

I feel like a modification of a segment tree might be useful here. In every node we need to keep track of both the total sum of lengths of segments (or their parts) corresponding to this node and the length of their union. However, I cannot figure out how to implement this modification without performance of one update degrading to linear time in some cases. Maybe using a segment tree is not the right approach and a better way exists.

## Should user input be validated/checked for it’s length in PHP (server side) as a security measure?

important to note that this user input is something that after validation & sanitation – will be inserted into a database, and later on be shown to other users on the same web site. (example: a forum) I’m referring to both a case when I know in advanced what’s the length I should expect from the user and a case in which I don’t but know vaguely that’s not more than 100 length. I’m trying to figure out if there is any security advantages for checking user input length in PHP. taking into account I’m already validation & sanitation user input based on the type of content I’m expecting using regex. I know this differs from language to language to I want to refer to PHP this time, but any referring to other language like Java, .NET, python etc. would be fine.

## Excerpt length decision

What should I take into account when limiting the text visible on a listing? I’m using a list layout with images on the left side, a title, a meta line and the excerpt, And I’ve wondering if there are any best practices like:

• limiting the excerpt to full sentences only without breaking the sentences
• limiting the text to fill n lines
• limiting the words and using justified text alignment …

What do you think?

## ED25519 private key length in different implementations

So, I seem to have some confusion around ED25519 private keys in different implementations. Both Bouncy Castle as well as OpenSSL generate 32 byte private keys. However libSodium seems to want 64 byte private keys, as does ST’s crypto library (see UM1924).

So how are these systems interoperable in regards to this?

## How to determine minimum word length of regular language

Given a regular language $$L$$ and a regular expression $$r$$ with $$L=L(r)$$. Is it possible to determine the minimum length of words of $$L(r)$$ by the structure of $$r$$?

A straightforward example:

Let’s say we have a regular expression $$r=aac^*aa$$, then $$L(R) = \{aaaa, aacaa, aaccaa, \dots, aac^naa\}$$. To determine the minimal length I would erase everything that is postfixed with $$*$$, leaving $$r’=aaaa$$. Now I would count the concatenations and add 1, which would yield in this example, not unsurprisingly, a minimum length of 4.

Is there a general approach to do this for more complex expressions?

## What should be minimum password length for security today? [duplicate]

• What's the best length for randomly generated passwords? (Security vs. compatibility) 4 answers
• It's well into 2017 – what's the latest best practise password policy 2 answers

What should be mimimum user password lenght for security today if we use uppercase, lowercase, number and special character?

## Fastest algorithm to find all the possible paths of length $n$ from a give node in a directed graph?

I am trying to find the fastest algorithm to find all the possible paths of length $$N$$ from a given node in a directed graph.

My solution is to do a modification of breadth first search from the given node for $$N$$ iteration. Its time complexity is around $$\theta(V+E)$$. But the problem is $$|V|$$ & $$|E|$$ becomes exponential because as long as there is an edge, the same node can be visited again.

Can there be a solution of this problem with polynomial time complexity? It seems this problem has optimal substructure solution. Is there any solution using dynamic approach?

## Are number of states in a NFA same as Pumping length?

So i was reading a post on Minimum pumping length of regular language where Yuval Filmus has proved that a pumping lemma might have lesser number of states than a minimal DFA. But What about NFA’s? Are NFA’s able to give us minimum pumping length?

For example say we have a language L= $$(10)^∗$$, though for this minimal DFA will have $$3$$ states but NFA will have only $$2$$ states, which in fact is the pumping length of the language. So are NFA’s able to give us exact pumping length of a language?

## Difference between max length of the record vs record size limit

As per RFC 5246 (TLS) the max possible length of the record is 2^14.

But I could see now a new parameter “Maximum record size limit”.

Why do we have the new parameter “Maximum record size limit” since RFC 5246 already mentions Max possible length is 2^14