Google Form is not following section based answering. It redirects on the basis of the answer chosen but shows the section supposed to be skipped too - forms

My form has the following sections
A
B
C
D
E
F
I have one question in section A on the basis of which it is supposed to redirect to either B or C. those filling b should be seeing c and vice versa and should directly continue to fill D E F normally. However, those filling B are redirected to C even though it says to go to section D (or 4 in the picture). What is at the end of section BThe redirection question in Section A I am not a coder (as may be apparent) but wanted to know if this a logic issue or a google forms issue
I was expecting it to skip section C and go to D, but that did not happen.

Related

Joining Enumerated and Symbol Column in kdb+ using Over

Im looking at two tables, one with an enumerated column the other is not. Im using (,/) to join them together and it doesn't unenumerate the data. (uj/) and last (,\) both do. Does anyone why this might be the case?
KDB+ 4.0 2021.04.26 Copyright (C) 1993-2021 Kx Systems
q)enum:`a`b
q)t1:([]c1:`enum$`a`b)
q)t2:([]c1:`a`b)
q)(,/) (t1;t2)
c1
--------
`enum$`a
`enum$`b
`a
`b
q)(uj/) (t1;t2)
c1
--
a
b
a
b
q)last(,\) (t1;t2)
c1
--
a
b
a
b
q)```
I suspect it's because ,/ (along with raze) is given special treatment by the interpreter while the others aren't.
An actual append-over gives you the result you want:
q)0N!({x,y}/)(t1;t2);
+(,`c1)!,`a`b`a`b
So even though {x,y}/ appears to be the same as ,/, that isn't always the case due to the "special treatment" under the covers

AS400 Macro, input fields count

5250 emulator:
Hello everyone, I want an operator which will count that input fields as it is shown on attached picture. In this case i have 5 input field.
Thanks in advance and best regards
It can be done!
Download this source: http://www.code400.com/ffd.php
You can comment out the GETKEY section from FFDRPG as you won't need that and it will probably cause it to fall over anyway.
Also, rememember when you use the command, to put the record format name in as well as your display file name - don't just leave *FIRST in there or you'll just get the fields from the first record format in the display file.
EDIT:
You'll need to add an extra field to the ListDs data structure:
D ListDs DS
D SfFld 1 10
D SfType 11 11
D SfUse 12 12
D BufferOut 13 16B 0
D FieldLen 21 24B 0
D Digits 25 28B 0
D Decimals 29 32B 0
D FieldDesc 33 82
If you add the 3rd field SfUse, you can check whether it contains 'I' so you only count Input Capable fields.
Check out the QUSLFLD API https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/apis/quslfld.htm if you want to see exactly what information can be retrieved by this API.
The example in the download uses the most basic format FLDL0100 but more information can be retrieved if you ask for format FLDL0200 or FLDL0300 but they will take longer to execute and you shouldn't need the extra info to achieve what you're after.
I'm not sure if this is possible, but you might find some joy with the DSM APIs.
QsnQry5250 has a maximum number of input fields return parameter, but it may just show you the maximum allowed on the display rather than the number you have on your screen.
There's an example here https://www.ibm.com/support/knowledgecenter/en/ssw_i5_54/apis/dsm1g.htm
And the API documentation here https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/apis/QsnQry5250.htm
Sorry I can't be of more help - I've never used those APIs and can't think of another way to achieve what you're after.
If you tell us the reason you need to know the number of input fields on screen, we may be able to suggest another way to achieve what you want to achieve.
Damian

Answer Set Programming: Group into two sets so that those who like each other are in same set, and dislike = different set

I'm basically a beginner to Answer Set Programming (CLINGO), so I've been attempting this problem for hours now.
person(a;b;c;d;e;f).
likes(b,e; d,f).
dislikes(a,b; c,e).
People who like each other must be in the same set, and cannot be in the same set as someone they dislike.
So the output should be:
b,e | a, c, d,f
I know the logic behind it; partition it so that if an element is in both likes & dislikes, then it should be in its own set, and everything else in the other. But this is declarative programming, so I'm not sure how to tackle this. Any help would be appreciated.
Try this one, it should work for you:
person(a;b;c;d;e;f).
like(b,e; d,f).
dislike(a,b; c,e).
group(1..2).
% every person belongs to one group only.
1{in(S,G): group(G)}1 :- person(S).
% no two persons who do dislike each other are in the same group
:- in(X, G), in(Y, G), dislike(X,Y).
#show in/2.
The result you'll get is:
a & b are in different group.
and c & e are in different group.
The result you can get is like:

Crystal Reports XI - Only show Details lines ending in 'C'

Hopefully a straight forwards question.
I have a Report that runs from a stock system, it prints to show all the products in a customers order, as well as a general 'Thank you for your order..' message.
In the details section it currently shows Product and Product Description for everything within that order.
I have a new client though who wants another version of this report, one which only shows the details lines where the Product Code ends in the letter 'C'.
I'm guessing I need to suppress the details section but I'm not sure what Formula I should be using.
I also can't say for certain that all their product codes will remain the same length. I think about 95% of them will be 8 characters, but any 'special edition' versions may have extra characters in.
Thanks in advance for your help.
A suppression formula needs to return a Boolean value, so a formula checking the last character in your Product Code field should do it:
right(trim({ProductCode}),1) = 'C'
To make it work for a single client, you could do something like this (warning: I'm rusty with Crystal syntax - take it with a grain of salt):
IF {CustomerCode} = 123
THEN right(trim({ProductCode}),1) = 'C'
ELSE false
right(trim({ProductCode})) <> 'C'

How should list be represented in ASP (Answer Set Programming)?

A processor 'a' takes care the header 'a' of a message 'a_b_c_d' and passes the payload 'b_c_d' to the another processor in the next level as following:
msg(a, b_c_d).
pro(a;b;c;d).
msg(b, c_d) :- pro(X), msg(X, b_c_d).
msg(c, d) :- pro(X), msg(X, c_d).
msg(d) :- pro(X), msg(X, d).
#hide. #show msg/2. #show msg/1.
How should I represent list 'a_b_c_d' in ASP, and change the above to general cases?
No, official way, but I think most people don't realize you can construct cons-cells in ASP.
For instance, here's how you can get items for all lists of length 5 from elements 1..6
element(1..6).
listLen(empty, 0).
listLen(cons(E, L), K + 1) :- element(E); listLen(L, K); K < 5.
is5List(L) :- listLen(L, 5).
#show is5List/1.
resulting in
is5List(cons(1,cons(1,cons(1,cons(1,cons(1,empty))))))
is5List(cons(1,cons(1,cons(1,cons(1,cons(2,empty))))))
is5List(cons(1,cons(1,cons(1,cons(1,cons(3,empty))))))
...
There is no 'official' way to handle lists in ASP as far as I know. But, DLV has built-in list handling similar to Prolog's.
The way you implement a list, the list itself cannot be used as a term and thus what if you want to bind between variables in the list and other elements of a rule? Perhaps you would like something such as p(t, [q(X), q(Y)]) :- X != Y.
You can try implementing a list as (a, b, c) and an append predicate but the problem is ASP requires grounding before computing answer-sets. Consequently a list defined in this way whilst more like lists in Prolog would mean the ground-program contains all ground-instances of all possible lists (explosion) regardless of whether they are used or not.
I therefore come back to my first point, try using DLV instead of Clingo if possible (for this task, at least).
By using index, I do have a way to walk a list, however, I do not know this is the official way to handle a list in ASP. Could someone has more experience in ASP give us a hand? Thanks.
index(3,a). index(2,b). index(1,c). index(0,d).
pro(a;b;c;d). msg(3,a).
msg(I-1,N) :- pro(P), msg(I,P), index(I,P), I>0, index(I-1,N).
#hide. #show msg/2.
You can use s(ASP) or s(CASP) ASP systems. Both of them support list operations like prolog. You might need to define the list built-in in ASP .