Example of non-regular context free language L such that prefix(L) is regular

Suppose we have some non-regular context free language L. Suppose we also have language of all prefixes of words in L.

What can be an example of non-regular language L such that language of it’s prefixes is regular (Can be represented by a finite automaton)?

I don’t understand how language of prefixes can ever be regular, since the set of prefixes of a word include the word itself.

For example $ L= a^nb^n$ is my non-regular language. The language of it’s prefixes would include : $ \epsilon,a^n$ where $ n\ge 1$ ,$ a^nb$ where $ n\ge 1$ etc…

But what about b’s ? We need to know how many a’s there were in the first place. Therefore I don’t see how the language of prefixes can be regular.

Finding a Context- free grammar (CFG) for the language [duplicate]

This question already has an answer here:

  • How to prove that a language is context-free? 2 answers
  • How to convert PDA to CFG 2 answers

I am trying to find a CFG for the language A below. I have spent hours on this but still could not find the answer. I also came up with the idea that this may not a context- free language but there is actually a PDA that recognizes it. I would very much appreciate if anyone can help me with this.

                    A= {0^a 1^b 0^c 1^d | a+b < c+d, a,b,c,d>=1} 

Old ODBC app throws “cannot generate sspi context” on Windows 10

An old Access 2003 .adp project is currently running on Windows 7 machines, while SQL Server 2008 is on the backend. Since the app is moved to a Windows 10 machine, the app will trigger “Connot generate SSPI context” error.

There are a lot of messages over the Internet to explain possible reasons and solutions.

In our case, we may overcome the problem running Msaccess.exe from commandline, using:

runas /netonly /user:userdomain\useralias "C:\Program Files\<path-to-office-folder>Msaccess.exe" 

The downside is that the user is prompted for password each time the shortcut is being used.

Is there a way to fix this so that the app (or Windows 10) are addressing the domain user name correctly, avoiding the error?

Context Free Grammar – Starting with x Number of Chars and Ending with n != x Number of Chars

I am trying to create a context free grammar in Extended Backus–Naur form, which starts with a non-empty sequence of A‘s and is followed by a non-empty sequence of B‘s. With the special condition that the number of B‘s has to be unequal to the number of A‘s.

Thus, the grammar should generate words like:

  • AAAABBB
  • AAABB
  • ABBB

So basically I could do something like this:

$ \ G=(N,T,P,Sequence)$

$ \ N = \{Sequence\}$

$ \ T = \{A,B\}$

$ \ P = \{Sequence=AA(Sequence|\epsilon)B\}$

But then the words would always have $ \ 2n$ A‘s and n B‘s:

  • AAB
  • AAAABB
  • AAAAAABBB

So how is it possible to make the number of A‘s uncorrelated of the number of B‘s, without being equal?

Is it bad UX for a form to be presented in different formats (either in a modal or separate page), depending on context?

I’m designing an internal tool in which a user, at certain points, will need to fill out a fairly detailed form in order to add a piece of content to our user-facing platform.

However, the challenge I’m facing is that the form is available at different points in the user’s journey, and I’m wondering if I can format the presentation of the form differently (either as a modal or a separate page) depending on where the user is and what they’re doing, to cater to separate use cases. Namely, I’d like to present it within a modal when the user is on a page where they’ll be engaged with a different, priority task, but needs to quickly fill out the form to create a piece of content, and then resume with the main task.

But elsewhere in the tool, I’d like to present the form on a separate page when the user is on the page where all those content pieces live – so that when the user clicks a “+New Content” CTA, they’ll be taken to a separate page where they’ll fill out the form.

Ultimately, I’m trying to cater to these separate use cases with these different interactions, but is the resulting inconsistency bad? Trying to understand the tradeoff here.

I hope this all makes sense, thanks for taking a look!

Difference between ⫾ (U+2AFE) and ⫿ (U+2AFF) in the context of Dijkstra’s Guarded Command Language?

Continuing https://tex.stackexchange.com/questions/435986/how-to-draw-the-box-of-dijkstras-guarded-command-language, what is the difference in the intended usage of ⫾ (Dijkstra choice, U+2AFE) and ⫿ (n-ary Dijkstra choice, U+2AFF) in the context of the Guarded Command Language (GCL) of Dijkstra? In other words, when do you use ⫾ and when ⫿ for typesetting GCL programs? Moreover, can you confirm or reject Barbara’s answer?

Related: http://latex.org/forum/viewtopic.php?t=32939

Ways to transition SELinux domain / process context (securing SELinux boundaries)

(Apologies for multi-question. Theme is the same, but there are quite a few edge cases.)

Browsing the web, I come across resources (see below), but they don’t make this quite clear what the situation really is, so this is my attempt to clarify and gather info that I am missing.


Ways to transition

I gather there are at least three ways for process to transition into another domain. I will list them as rules that are displayed by sesearch:

  1. type_transition <source> <file_label>:process <target>” – process in source domain can execute a file with file_label, which will then have target domain.
  2. “allow <source> <target>:process dyntransition” – process in source domain can use /proc/self/attr/current to transition into target domain.
  3. “allow <source> <target>:process transition” – process in source domain can use /proc/self/attr/exec to transition into target domain when exec is called.

Are there any other ways?


Protections for these transitions

Besides the above rules, transitions will also require:

  • “allow <source> <file_label>:file { execute read getattr }” (is getattr really required? read?) – for type_transition and probably transition
  • “allow <target> <file_label>:file entrypoint” – for type_transition and probably transition
  • “allow <source> <target>:process setexec” – for transition
  • “allow <source> <target>:process setcurrent” – for dyntransition

Other potential problems

  • In case of memfd_create+exec(“/proc/self/fd/%d”), is the file_label same as the “symlink” label? I assume for normal /proc/self/fd/ entries symlink would be followed, so that should be fine.
  • Can a ptraced process transition to another domain? Experiments tell me exec fails with EPERM in case of type_transition, and there’s a denial logged because of missing process ptrace permission from source to target. Would this work with dyntransition?

Resources:

  • https://selinuxproject.org/page/NB_Domain_and_Object_Transitions
  • https://selinuxproject.org/page/NB_ObjectClassesPermissions
  • https://wiki.gentoo.org/wiki/SELinux/Tutorials/How_does_a_process_get_into_a_certain_context