## Ambiguous behavior of the while () cycle in c

Since the while cycle ends its execution by false expression, despite the following they are giving different outputs. Unable to track

``````#include
int main()
{
//code snippet 1
while(0){
;
}
printf("C");
return 0;
}
``````

this gives way

``````c
``````

Y

``````#include
int main()
{
//code snippet 2
while(printf("%d")){
;
}
printf("c");
return 0;
}
``````

this gives way

``````0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
``````

Since the printf () function returns the number of characters printed and no character is printed, therefore, it should not result in an infinite loop since 0 has the false logical value.

## What is the name of the UX pattern to show an ambiguous count of likes, votes, etc.?

While browsing several social media platforms, I find this vote button in favor, which shows an ambiguous count of the things mentioned above.

Is there a name for such a pattern?

## Ambiguous grammar demonstration exercise

Hi, I'm stuck in an ambiguous grammar exercise. I need an example that shows that this grammar is ambiguous.
Former:

S -> aT | bR

R -> a | aS | bRR

T -> b | bS | ATT

Thank you!

## How to show timestamps that are not ambiguous?

issue: I need to name the log files in such a way that the file name is not ambiguous.

My initial solution was to move from the largest to the smallest unit with zero padding in each unit …

## `201912051357040042.log`

In the previous example, you could assume that everything is filled with zeros and a 24-hour clock, so the record was recorded on …

## 2019-12-05 13: 57: 04.0042

Adding some characters could make the file name even more readable in this way …

## `2019-12-05_13-57-04-0042.log`

Ambiguity arises when the hours are less than `13`

## `2020-02-14_12-30-11-8675.log`

One could also assume that the record was written "super early on Valentine's day" or "Around lunchtime on Valentine's Day"

## Is there any way to name the log file, so it is impossible to assume the wrong timestamp?

(The shorter the name of the file, the better, but you can assume that there is no limit to the length of the file name)

All I can think about is this, but maybe someone else has a more concise solution …

## no context: does the following grammar have an inherently ambiguous language?

The grammar is as follows:

$$S rightarrow aaAb | aab | To$$

$$A rightarrow aaAb | aAb | epsilon$$

I think this grammar has an unequivocal equivalent grammar as follows.

First let's rewrite the grammar in the following way, so that this grammar has the same language as one in question:

$$S rightarrow aaSb | aSb | epsilon$$

Because this grammar generates $$L = {a ^ nb ^ m: m le n le 2m }$$

This grammar only uses two productions in some order to derive strings and then uses null production to complete the derivation.

So, the idea is that we can order the use of production in such a way that any use of $$S rightarrow aaSb$$ Production does not arrive before the use of any production $$S rightarrow aSb$$. And following this idea, it is very easy to generate this grammar.

$$S rightarrow aSb | To$$

$$A rightarrow aaAb | epsilon$$

.

Another argument is as follows:

Why $$2k_1 + k_2 = n$$ Y $$k_1 + k_2 = m$$ for some $$not negative spatial integer space k_1, k_2$$. (here $$k_1$$ Y $$k_2$$ corresponds to the production usage number of form $$S rightarrow aSb$$ Y $$S rightarrow aaSb$$ respectively.)

After solving the previous equations, we find that $$k_1 = m-n$$ hence the value of $$k_1$$ It will be unique for any perticular chain. Which means we must use a fixed number of times the production of the form $$S rightarrow aSb$$. Which consequently means that in our last rewritten grammar there is a fixed point for a perticular chain where you must perform $$S rightarrow A$$.

Please help me with this. I want to know if this language is inherently ambiguous or not?

## Algorithms: Count compound words with ambiguous decomposition

I have a set of words $$D$$, and I make compound words concatenating a fixed number $$n$$ of words from $$D$$ (Repeats are allowed). Let's call those words $$n$$-composites. I want to know how many different compound words can be formed and how many $$n$$-composites can be formed in $$to$$ forms for each value of $$to$$. For example, yes $$D$$ is `{hell, hello, open, pen}` Y $$n = 2$$, the compound word `hellopen` can be formed as `hell + open` or `hello + pen`, so there are 16 different pairs of words in $$D$$, but only 15 different words of 2 compounds on $$D$$.

Formally, leave $$mathscr A$$ be a finite size alphabet $$ge 2$$, $$D$$ a finite set of words in length $$ge 2$$ finished $$mathscr A$$Y $$n ge 2$$ an integer The set of valid $$n$$compound word is $$C = {u_1 ldots u_n mid (u_1, ldots, u_n) in D ^ n }$$. Let's call ambiguity of a word $$w$$ The number of $$n$$-tuples $$(u_1, ldots, u_n) in D ^ n$$ such that $$u_1 ldots u_n = w$$. (So, an ambiguity of 0 means that the word is not in $$C$$, an ambiguity of 1 means that the word can be broken down uniquely, and larger ambiguities mean words that can be formed in multiple ways).

I would like to calculate the number of different compound words, that is, the size of $$C$$. I am also interested in the amount of words with ambiguity. $$to$$ for every value of $$to$$, and especially the number of unambiguous compounds ($$a = 1$$) Obviously, this can be done by listing all $$| D | ^ n$$ combinations and store its multiplicity in a multi-set structure, but that has a huge cost of memory and time. Is there a better way? I have the feeling that it would help build a set of prefixes and suffixes, but I can't understand how to chain them.

If the exact calculation is not practical, you would be satisfied with an estimate. How can I test my dictionary for a reliable estimate? In addition, if there is a method that works well, except in some pathological cases, and it is possible to avoid those pathological cases by eliminating some words of $$D$$, that is still fine for my application.

I am specifically interested in the following case of practical use: $$D$$ it is a set of a few thousand common words in English (all lower case), and $$n$$ It is approximately 3 to 8. The application is the generation of passwords of "correct horse battery staple" style: how much bias is introduced if it does not put spaces between words?

## jsf – when adding omniface library I get WELD-001318: Unable to resolve an ambiguous dependency

I'm using JSF 6.2 in eclipse, I have a p: dataTable that I want the filters to be preserved during the session

``````
``````

Reloading the page in the table does not appear filtered until you click on update to the table by means of a button. What I'm trying to do is make an update to the table when loading the page

``````import org.omnifaces.util.Ajax;
@ManagedBean (name = "myBean")
@ViewScoped
public class myBean {
List of fix list

@PostConstruct
public void init () {
list = listObjects ()
Ajax.update ("form: table");
}
}
``````

``````
org.omnifaces.resourcehandler.UnmappedResourceHandler

``````

Add the project to the omnifaces-2.6.1 library which is what makes it listen, if you like the library, even if you do not add the Ajax line in the bean or the change in faces-config the result is the same

``````javax.servlet.ServletException: WELD-001318: Unable to resolve an ambiguous dependency between: - Managed bean [class myBean] with qualifiers [@Any @Default], - Handled Bean [class otroBean] with qualifiers [@Any @Default]
javax.faces.webapp.FacesServlet.service (FacesServlet.java:671)
io.undertow.servlet.handlers.ServletHandler.handleRequest (ServletHandler.java:85)
io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest (ServletSecurityRoleHandler.java:62)
io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest (ServletDispatchingHandler.java:36)
org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest (SecurityContextAssociationHandler.java:78)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest (SSLInformationAssociationHandler.java:131)
io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest (ServletAuthenticationCallHandler.java:57)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest (AbstractConfidentialityHandler.java:46)
io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest (ServletConfidentialityConstraintHandler.java:64)
io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest (AuthenticationMechanismsHandler.java:60)
io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest (CachedAuthenticatedSessionHandler.java:77)
io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest (AbstractSecurityContextAssociationHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest (JACCContextIdHandler.java:61)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43)
io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest (ServletInitialHandler.java:292)
io.undertow.servlet.handlers.ServletInitialHandler.access \$ 100 (ServletInitialHandler.java:81)
io.undertow.servlet.handlers.ServletInitialHandler \$ 2.call (ServletInitialHandler.java:138)
io.undertow.servlet.handlers.ServletInitialHandler \$ 2.call (ServletInitialHandler.java:135)
io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest (ServletInitialHandler.java:272)
io.undertow.servlet.handlers.ServletInitialHandler.access \$ 000 (ServletInitialHandler.java:81)
io.undertow.servlet.handlers.ServletInitialHandler \$ 1.handleRequest (ServletInitialHandler.java:104)
io.undertow.server.Connectors.executeRootHandler (Connectors.java:202)
io.undertow.server.HttpServerExchange \$ 1.run (HttpServerExchange.java:805)
``````

## trace – Are these expressions not the same? The output of Mathematica is ambiguous.

The following graph indicates that the first expression is equal to the second. But how can I use Mathematica to prove it's true?

``````Plot[(-(Log[(1 - P)/P]/Log in[10])) - (Log in[-(P/(-1 + P))]/Log in[10]), {P, 0, 1}]
``````

An attempt to simplify indicates that the expressions are not the same:

``````FullSimplify[(-(Log[(1 - P)/P]/Log in[10])) - (Log in[-(P/(-1 + P))]/Log in[10])]
``````

``````(Log in[-1 + 1/P] + Log[-(P/(-1 + P))])/Log in[10]
If the original NFA has $$k$$ States, then the new NFA will have $$2k ^ 2$$ You can convert it into a DFA with $$4 ^ {k ^ 2}$$ state
We can reduce the number of states in the corresponding DFA by building the power set directly. In each step, we will remember, for each step, if (i) it is impossible to be in that state, (ii) it is possible to be in that state, but there is a single execution of this type, (iii) it is possible to be in the state , and there are at least two of these executions. A state is accepting if there is an acceptance status of type (iii), or at least two acceptance states of type (ii). This construction uses only $$3 ^ k$$ states, and so it matches your suggestion.