I have a scenario like this:
/-> C -> D \
A -> B - -> G (Contain values of D and F,
\-> E -> F /
Basically at G I have a list of value produce by D and F, let us call D1 and F1.
To create a new value from G, I have to just unwind to B and user can either choose branch C or E and continue to the end G with value of D2 or F2, or he can pop back to A. Let us say the new value is F2, though ABEFG
Now I'm facing a problem, that is I want to edit the values at G, let us say D1.
I want to be able to pop back to D but also allow users pop back to C etc, but D is not in the workflow ABEFG.
My guess is that I have to back up to B and somehow prepare multiple segues up to D but I have no idea if this kind of workflow exists.
Apparently, there is no such way. The solution I found is
Find the instance of B in navigationController!.viewControllers
popToViewController B
Initiate C & D from Main storyboard with identifier (they are already deallocated anyway)
Setup some properties of C & D from D1
pushViewController C & D
Related
I wonder whether it's possible to give a name to the output of a certain expression to retrieve it from the graph at another part of the code.
For example
def A(a, b):
c = a + b
d = d * a
return d
For debug purposes it would be nice if I could pull out c at another position without returning it through the entire function hierarchy.
Any ideas?
Thanks in advance!
I'm assuming a and b are tensors.
Either you give a name to c using tf.identity
def A(a, b):
c = a + b
c = tf.identity(c, name = "c")
d = d * a
return d
Either you use the tf.add operation instead of +:
def A(a, b):
tf.add(a, b, name = "c")
d = d * a
return d
Either way, you get retrieve c with tf.get_variable('c:0') (You might need to precise the scope if any.)
Consider the following set of functional dependencies on the relation schema R = (A, B, C, D, E). Decompose the relation into a collection of relation schemas in 4NF. Provide detailed information of the decomposition process.
AB →→ C
B → D
A → E
If you start from the top with AB →→ C, doesn't that fit 4nf and you are done?
I've some variables, Lets say a, b, c, d. All belongs to a fixed interval [0, e]
Now i've some relations between them like
a > b
a > c
b > d
Something like this; I want to make a function which print all the possible cases for this.
Example:
a b c d
a c b d
a b d c
a c b d
In essence, what you have is a directed acyclic graph.
A relatively simple approach is to store, for each variable, a set of the variables that must precede them. (In your example, this storage would map b to {a}, c to {a}, and d to {b}.) You can then write a recursive function that generates all valid tails consisting of a subset of these variables (in your case, for example, the subset {c,d} produces two valid tails: [c,d] and [d,c]). This recursive function examines each variable in the subset and determines whether its prerequisites are already met. (For example, since b maps to {a}, any subset including both a and b cannot produce a tail that begins with b.) If so, then it can recursively call itself on the subset excluding that variable.
There are some optimizations you can then perform, if desired. For example, you can use dynamic programming to avoid repeatedly re-computing the set of valid tails for the same subset.
Let's say we have 6 polygons ( A,B,C,D,E, F)in Spatial database.
A touches B,
B touches C and D,
E and F are not connected to other polygons.
A - B
/ \
C D E F
Having Polygon A, I need to query all polygons connected to it , and do it "recursivelly" Cannot describe it better. So the query by A should return A, B, C, D.
Of course, it is possible to do programmatically, first using SDO_RELATE query B by A, and then query C and D by B. But is it possible to do the task with a single query?
Here's a few questions I had on a quiz in a class and just want to verify their correctness.
Grammar:
S -> ABC
A -> df | epsilon
B -> f | epsilon
C -> g | epsilon
1.) The Follow set of B contains g and epsilon (T/F)? Ans: F.
There is no epsilon in the Follow sets, correct? (Only $ aka end of input)
2.) The First set of S contains d, f, g, and epsilon (T/F)? Ans: T.
I said false for this because I thought First(S) = First(A), which g is not a part of. Who is correct?
You are correct. If epsilon is involved, it will be accounted for in the First set, not the Follow set. If it's possible for the production to end the string, then $ goes in the Follow set, not epsilon.
The quiz is correct. The production S can indeed start with any of d, f, and g, and it can also be started by the empty string. Consider the input string g. It matches S, right? A is satisfied by the empty string, B is satisfied by the empty string, and C is satisfied by g. Since A, B, and C are all satisfied, S is satisfied. The first character consumed by S is g, so g must be in First(S).