Unexpected output of a Prolog script - prolog

leftHand(empty).
rightHand(empty).
inHands :-
write("Left hand:"),
nl,
leftHand(X),
tab(2),
write(X),
nl,
nl,
write("Right hand:"),
rightHand(Y),
tab(2),
write(Y),
nl.
I expect inHands. to return something like this:
Left hand:
empty
Right hand:
empty
However, this is what I saw:
24 ?- inHands.
[76, 101, 102, 116, 32, 104, 97, 110, 100, 58]
empty
[82, 105, 103, 104, 116, 32, 104, 97, 110, 100, 58] empty
true.
What am I doing wrong here?

Turns out I have to use single quotes like this:
write('My text').

Related

i am trying to use DeadLetterPublishingRecoverer but not working

2020-04-28 18:49:05.388 ERROR 14531 --- [ntainer#0-0-C-1] o.s.k.l.DeadLetterPublishingRecoverer : Dead-letter publication failed for: ProducerRecord(topic=LP_EVENT.DLT, partition=4, headers=RecordHeaders(headers = [RecordHeader(key = kafka_dlt-original-topic, value = [76, 80, 95, 69, 86, 69, 78, 84]), RecordHeader(key = kafka_dlt-original-partition, value = [0, 0, 0, 4]), RecordHeader(key = kafka_dlt-original-offset, value = [0, 0, 0, 0, 0, 0, 0, 1]), RecordHeader(key = kafka_dlt-original-timestamp, value = [0, 0, 1, 113, -66, -64, -61, 43]), RecordHeader(key = kafka_dlt-original-timestamp-type, value = [67, 114, 101, 97, 116, 101, 84, 105, 109, 101]), RecordHeader(key = kafka_dlt-exception-fqcn, value = [111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 76, 105, 115, 116, 101, 110, 101, 114, 69, 120, 101, 99, 117, 116, 105, 111, 110, 70, 97, 105, 108, 101, 100, 69, 120, 99, 101, 112, 116, 105, 111, 110]), RecordHeader(key = kafka_dlt-exception-message, value = [76, 105, 115, 116, 101, 110, 101, 114, 32, 109, 101, 116, 104, 111, 100, 32, 39, 112, 117, 98, 108, 105, 99, 32, 118, 111, 105, 100, 32, 111, 114, 103, 46, 120, 109, 46, 108, 112, 46, 101, 118, 101, 110, 116, 46, 97, 112, 105, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 69, 118, 101, 110, 116, 76, 105, 115, 116, 101, 110, 101, 114, 46, 112, 114, 111, 99, 101, 115, 115, 69, 118, 101, 110, 116, 40, 111, 114, 103, 46, 120, 109, 46, 108, 112, 46, 101, 118, 101, 110, 116, 46, 99, 111, 109, 109, 111, 110, 46, 109, 111, 100, 101, 108, 46, 118, 111, 46, 69, 118, 101, 110, 116, 80, 97, 121, 108, 111, 97, 100, 44, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 115, 117, 112, 112, 111, 114, 116, 46, 65, 99, 107, 110, 111, 119, 108, 101, 100, 103, 109, 101, 110, 116, 41, 32, 116, 104, 114, 111, 119, 115, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 69, 120, 99, 101, 112, 116, 105, 111, 110, 39, 32, 116, 104, 114, 101, 119, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 59, 32, 110, 101, 115, 116, 101, 100, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 32, 105, 115, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 82, 117, 110, 116, 105, 109, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110, 58, 32, 102, 97, 105, 108, 101, 100, 59, 32, 110, 101, 115, 116, 101, 100, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 32, 105, 115, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 82, 117, 110, 116, 105, 109, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110, 58, 32, 102, 97, 105, 108, 101, 100]), RecordHeader(key = kafka_dlt-exception-stacktrace, value = [111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 76, 105, 115, 116, 101, 110, 101, 114, 69, 120, 101, 99, 117, 116, 105, 111, 110, 70, 97, 105, 108, 101, 100, 69, 120, 99, 101, 112, 116, 105, 111, 110, 58, 32, 76, 105, 115, 116, 101, 110, 101, 114, 32, 109, 101, 116, 104, 111, 100, 32, 39, 112, 117, 98, 108, 105, 99, 32, 118, 111, 105, 100, 32, 111, 114, 103, 46, 120, 109, 46, 108, 112, 46, 101, 118, 101, 110, 116, 46, 97, 112, 105, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 69, 118, 101, 110, 116, 76, 105, 115, 116, 101, 110, 101, 114, 46, 112, 114, 111, 99, 101, 115, 115, 69, 118, 101, 110, 116, 40, 111, 114, 103, 46, 120, 109, 46, 108, 112, 46, 101, 118, 101, 110, 116, 46, 99, 111, 109, 109, 111, 110, 46, 109, 111, 100, 101, 108, 46, 118, 111, 46, 69, 118, 101, 110, 116, 80, 97, 121, 108, 111, 97, 100, 44, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 115, 117, 112, 112, 111, 114, 116, 46, 65, 99, 107, 110, 111, 119, 108, 101, 100, 103, 109, 101, 110, 116, 41, 32, 116, 104, 114, 111, 119, 115, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 69, 120, 99, 101, 112, 116, 105, 111, 110, 39, 32, 116, 104, 114, 101, 119, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 59, 32, 110, 101, 115, 116, 101, 100, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 32, 105, 115, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 82, 117, 110, 116, 105, 109, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110, 58, 32, 102, 97, 105, 108, 101, 100, 59, 32, 110, 101, 115, 116, 101, 100, 32, 101, 120, 99, 101, 112, 116, 105, 111, 110, 32, 105, 115, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 82, 117, 110, 116, 105, 109, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110, 58, 32, 102, 97, 105, 108, 101, 100, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 100, 101, 99, 111, 114, 97, 116, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 55, 49, 54, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 105, 110, 118, 111, 107, 101, 69, 114, 114, 111, 114, 72, 97, 110, 100, 108, 101, 114, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 55, 48, 52, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 100, 111, 73, 110, 118, 111, 107, 101, 82, 101, 99, 111, 114, 100, 76, 105, 115, 116, 101, 110, 101, 114, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 54, 50, 49, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 100, 111, 73, 110, 118, 111, 107, 101, 87, 105, 116, 104, 82, 101, 99, 111, 114, 100, 115, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 53, 52, 57, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 105, 110, 118, 111, 107, 101, 82, 101, 99, 111, 114, 100, 76, 105, 115, 116, 101, 110, 101, 114, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 52, 53, 55, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 105, 110, 118, 111, 107, 101, 76, 105, 115, 116, 101, 110, 101, 114, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 50, 48, 55, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 112, 111, 108, 108, 65, 110, 100, 73, 110, 118, 111, 107, 101, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 57, 54, 54, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 114, 117, 110, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 57, 48, 49, 41, 10, 9, 97, 116, 32, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 99, 111, 110, 99, 117, 114, 114, 101, 110, 116, 46, 69, 120, 101, 99, 117, 116, 111, 114, 115, 36, 82, 117, 110, 110, 97, 98, 108, 101, 65, 100, 97, 112, 116, 101, 114, 46, 99, 97, 108, 108, 40, 69, 120, 101, 99, 117, 116, 111, 114, 115, 46, 106, 97, 118, 97, 58, 53, 49, 49, 41, 10, 9, 97, 116, 32, 106, 97, 118, 97, 46, 117, 116, 105, 108, 46, 99, 111, 110, 99, 117, 114, 114, 101, 110, 116, 46, 70, 117, 116, 117, 114, 101, 84, 97, 115, 107, 46, 114, 117, 110, 40, 70, 117, 116, 117, 114, 101, 84, 97, 115, 107, 46, 106, 97, 118, 97, 58, 50, 54, 54, 41, 10, 9, 97, 116, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 84, 104, 114, 101, 97, 100, 46, 114, 117, 110, 40, 84, 104, 114, 101, 97, 100, 46, 106, 97, 118, 97, 58, 55, 52, 56, 41, 10, 67, 97, 117, 115, 101, 100, 32, 98, 121, 58, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 82, 117, 110, 116, 105, 109, 101, 69, 120, 99, 101, 112, 116, 105, 111, 110, 58, 32, 102, 97, 105, 108, 101, 100, 10, 9, 97, 116, 32, 111, 114, 103, 46, 120, 109, 46, 108, 112, 46, 101, 118, 101, 110, 116, 46, 97, 112, 105, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 69, 118, 101, 110, 116, 76, 105, 115, 116, 101, 110, 101, 114, 46, 112, 114, 111, 99, 101, 115, 115, 69, 118, 101, 110, 116, 40, 69, 118, 101, 110, 116, 76, 105, 115, 116, 101, 110, 101, 114, 46, 106, 97, 118, 97, 58, 51, 53, 41, 10, 9, 97, 116, 32, 115, 117, 110, 46, 114, 101, 102, 108, 101, 99, 116, 46, 78, 97, 116, 105, 118, 101, 77, 101, 116, 104, 111, 100, 65, 99, 99, 101, 115, 115, 111, 114, 73, 109, 112, 108, 46, 105, 110, 118, 111, 107, 101, 48, 40, 78, 97, 116, 105, 118, 101, 32, 77, 101, 116, 104, 111, 100, 41, 10, 9, 97, 116, 32, 115, 117, 110, 46, 114, 101, 102, 108, 101, 99, 116, 46, 78, 97, 116, 105, 118, 101, 77, 101, 116, 104, 111, 100, 65, 99, 99, 101, 115, 115, 111, 114, 73, 109, 112, 108, 46, 105, 110, 118, 111, 107, 101, 40, 78, 97, 116, 105, 118, 101, 77, 101, 116, 104, 111, 100, 65, 99, 99, 101, 115, 115, 111, 114, 73, 109, 112, 108, 46, 106, 97, 118, 97, 58, 54, 50, 41, 10, 9, 97, 116, 32, 115, 117, 110, 46, 114, 101, 102, 108, 101, 99, 116, 46, 68, 101, 108, 101, 103, 97, 116, 105, 110, 103, 77, 101, 116, 104, 111, 100, 65, 99, 99, 101, 115, 115, 111, 114, 73, 109, 112, 108, 46, 105, 110, 118, 111, 107, 101, 40, 68, 101, 108, 101, 103, 97, 116, 105, 110, 103, 77, 101, 116, 104, 111, 100, 65, 99, 99, 101, 115, 115, 111, 114, 73, 109, 112, 108, 46, 106, 97, 118, 97, 58, 52, 51, 41, 10, 9, 97, 116, 32, 106, 97, 118, 97, 46, 108, 97, 110, 103, 46, 114, 101, 102, 108, 101, 99, 116, 46, 77, 101, 116, 104, 111, 100, 46, 105, 110, 118, 111, 107, 101, 40, 77, 101, 116, 104, 111, 100, 46, 106, 97, 118, 97, 58, 52, 57, 56, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 109, 101, 115, 115, 97, 103, 105, 110, 103, 46, 104, 97, 110, 100, 108, 101, 114, 46, 105, 110, 118, 111, 99, 97, 116, 105, 111, 110, 46, 73, 110, 118, 111, 99, 97, 98, 108, 101, 72, 97, 110, 100, 108, 101, 114, 77, 101, 116, 104, 111, 100, 46, 100, 111, 73, 110, 118, 111, 107, 101, 40, 73, 110, 118, 111, 99, 97, 98, 108, 101, 72, 97, 110, 100, 108, 101, 114, 77, 101, 116, 104, 111, 100, 46, 106, 97, 118, 97, 58, 49, 55, 49, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 109, 101, 115, 115, 97, 103, 105, 110, 103, 46, 104, 97, 110, 100, 108, 101, 114, 46, 105, 110, 118, 111, 99, 97, 116, 105, 111, 110, 46, 73, 110, 118, 111, 99, 97, 98, 108, 101, 72, 97, 110, 100, 108, 101, 114, 77, 101, 116, 104, 111, 100, 46, 105, 110, 118, 111, 107, 101, 40, 73, 110, 118, 111, 99, 97, 98, 108, 101, 72, 97, 110, 100, 108, 101, 114, 77, 101, 116, 104, 111, 100, 46, 106, 97, 118, 97, 58, 49, 50, 48, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 97, 100, 97, 112, 116, 101, 114, 46, 72, 97, 110, 100, 108, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 105, 110, 118, 111, 107, 101, 40, 72, 97, 110, 100, 108, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 106, 97, 118, 97, 58, 52, 56, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 97, 100, 97, 112, 116, 101, 114, 46, 77, 101, 115, 115, 97, 103, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 105, 110, 118, 111, 107, 101, 72, 97, 110, 100, 108, 101, 114, 40, 77, 101, 115, 115, 97, 103, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 106, 97, 118, 97, 58, 51, 48, 52, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 97, 100, 97, 112, 116, 101, 114, 46, 82, 101, 99, 111, 114, 100, 77, 101, 115, 115, 97, 103, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 111, 110, 77, 101, 115, 115, 97, 103, 101, 40, 82, 101, 99, 111, 114, 100, 77, 101, 115, 115, 97, 103, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 106, 97, 118, 97, 58, 56, 54, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 97, 100, 97, 112, 116, 101, 114, 46, 82, 101, 99, 111, 114, 100, 77, 101, 115, 115, 97, 103, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 111, 110, 77, 101, 115, 115, 97, 103, 101, 40, 82, 101, 99, 111, 114, 100, 77, 101, 115, 115, 97, 103, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 106, 97, 118, 97, 58, 53, 49, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 97, 100, 97, 112, 116, 101, 114, 46, 82, 101, 116, 114, 121, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 108, 97, 109, 98, 100, 97, 36, 111, 110, 77, 101, 115, 115, 97, 103, 101, 36, 48, 40, 82, 101, 116, 114, 121, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 106, 97, 118, 97, 58, 49, 50, 48, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 114, 101, 116, 114, 121, 46, 115, 117, 112, 112, 111, 114, 116, 46, 82, 101, 116, 114, 121, 84, 101, 109, 112, 108, 97, 116, 101, 46, 100, 111, 69, 120, 101, 99, 117, 116, 101, 40, 82, 101, 116, 114, 121, 84, 101, 109, 112, 108, 97, 116, 101, 46, 106, 97, 118, 97, 58, 50, 56, 55, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 114, 101, 116, 114, 121, 46, 115, 117, 112, 112, 111, 114, 116, 46, 82, 101, 116, 114, 121, 84, 101, 109, 112, 108, 97, 116, 101, 46, 101, 120, 101, 99, 117, 116, 101, 40, 82, 101, 116, 114, 121, 84, 101, 109, 112, 108, 97, 116, 101, 46, 106, 97, 118, 97, 58, 50, 49, 49, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 97, 100, 97, 112, 116, 101, 114, 46, 82, 101, 116, 114, 121, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 111, 110, 77, 101, 115, 115, 97, 103, 101, 40, 82, 101, 116, 114, 121, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 106, 97, 118, 97, 58, 49, 49, 52, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 97, 100, 97, 112, 116, 101, 114, 46, 82, 101, 116, 114, 121, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 111, 110, 77, 101, 115, 115, 97, 103, 101, 40, 82, 101, 116, 114, 121, 105, 110, 103, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 65, 100, 97, 112, 116, 101, 114, 46, 106, 97, 118, 97, 58, 52, 48, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 100, 111, 73, 110, 118, 111, 107, 101, 79, 110, 77, 101, 115, 115, 97, 103, 101, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 54, 55, 48, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 105, 110, 118, 111, 107, 101, 79, 110, 77, 101, 115, 115, 97, 103, 101, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 54, 53, 51, 41, 10, 9, 97, 116, 32, 111, 114, 103, 46, 115, 112, 114, 105, 110, 103, 102, 114, 97, 109, 101, 119, 111, 114, 107, 46, 107, 97, 102, 107, 97, 46, 108, 105, 115, 116, 101, 110, 101, 114, 46, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 36, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 115, 117, 109, 101, 114, 46, 100, 111, 73, 110, 118, 111, 107, 101, 82, 101, 99, 111, 114, 100, 76, 105, 115, 116, 101, 110, 101, 114, 40, 75, 97, 102, 107, 97, 77, 101, 115, 115, 97, 103, 101, 76, 105, 115, 116, 101, 110, 101, 114, 67, 111, 110, 116, 97, 105, 110, 101, 114, 46, 106, 97, 118, 97, 58, 49, 54, 48, 56, 41, 10, 9, 46, 46, 46, 32, 56, 32, 109, 111, 114, 101, 10])], isReadOnly = true), key=null, value=Hello(name=Ankit, Payload=[{"serialNo": "3545145628662", "eventTime": "2020-04-22 23:59:59"}]), timestamp=null)
java.lang.IllegalArgumentException: Magic v1 does not support record headers
at org.apache.kafka.common.record.MemoryRecordsBuilder.appendWithOffset(MemoryRecordsBuilder.java:412) ~[kafka-clients-2.3.1.jar:na]
at org.apache.kafka.common.record.MemoryRecordsBuilder.appendWithOffset(MemoryRecordsBuilder.java:451) ~[kafka-clients-2.3.1.jar:na]
at org.apache.kafka.common.record.MemoryRecordsBuilder.append(MemoryRecordsBuilder.java:508) ~[kafka-clients-2.3.1.jar:na]
at org.apache.kafka.common.record.MemoryRecordsBuilder.append(MemoryRecordsBuilder.java:531) ~[kafka-clients-2.3.1.jar:na]
at org.apache.kafka.clients.producer.internals.ProducerBatch.tryAppend(ProducerBatch.java:106) ~[kafka-clients-2.3.1.jar:na]
at org.apache.kafka.clients.producer.internals.RecordAccumulator.append(RecordAccumulator.java:224) ~[kafka-clients-2.3.1.jar:na]
at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:917) ~[kafka-clients-2.3.1.jar:na]
at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:856) ~[kafka-clients-2.3.1.jar:na]
at org.springframework.kafka.core.DefaultKafkaProducerFactory$CloseSafeProducer.send(DefaultKafkaProducerFactory.java:590) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.core.KafkaTemplate.doSend(KafkaTemplate.java:404) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.core.KafkaTemplate.send(KafkaTemplate.java:241) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.DeadLetterPublishingRecoverer.publish(DeadLetterPublishingRecoverer.java:214) [spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.DeadLetterPublishingRecoverer.accept(DeadLetterPublishingRecoverer.java:159) [spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.DeadLetterPublishingRecoverer.accept(DeadLetterPublishingRecoverer.java:53) [spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.FailedRecordTracker.skip(FailedRecordTracker.java:101) [spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.support.SeekUtils.lambda$doSeeks$2(SeekUtils.java:75) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_242]
at org.springframework.kafka.support.SeekUtils.doSeeks(SeekUtils.java:72) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.SeekToCurrentErrorHandler.handle(SeekToCurrentErrorHandler.java:198) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeErrorHandler(KafkaMessageListenerContainer.java:1704) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeRecordListener(KafkaMessageListenerContainer.java:1621) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.doInvokeWithRecords(KafkaMessageListenerContainer.java:1549) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeRecordListener(KafkaMessageListenerContainer.java:1457) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.invokeListener(KafkaMessageListenerContainer.java:1207) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.pollAndInvoke(KafkaMessageListenerContainer.java:966) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer.run(KafkaMessageListenerContainer.java:901) ~[spring-kafka-2.3.4.RELEASE.jar:2.3.4.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_242]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_242]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_242]
The error says:
Magic v1 does not support record headers
record headers are introduced in Apache Kafka 0.11.0.0. Can it be that your brokers are older or that the topic you are using is using an older message format (note, that if a topic is created with an old broker and the brokers are updated, the older message format is kept if not explicitly updated, too).

How to assert list of values in ascending order?

Here is a list of values in an array:
[463, 246, 216, 194, 154, 152, 147, 140, 129, 128, 123, 118, 118, 102, 102, 101, 97, 96, 93, 85]
How can I ensure/assert through RSpec that the array list is in ascending order?
The simplest way is probably:
expect(array.sort).to eq(array)
"Ascending" means "the next element is not smaller than the current". You can encode that into a predicate easily:
expect(array.each_cons(2).all? {|a, b| a <= b }).to be_truthy
Note that Array#sort is not stable, so something like
expect(array.sort).to eq(array)
does not work!

ruby incompatible encodings when moving files

I'm (unfortunately) trying to move/rename a file with UTF-8 chars in it's name. For some reason when I try to move it, I get this error:
ERROR Encoding::CompatibilityError: incompatible character encodings: ASCII-8BIT and UTF-8
I've added begin..rescue block to see the exception thrown, and I get that no file of such name exists (it does exists, I've checked). Currently the strings are encoded in UTF-8. I'm running windows, and I'm not using Rails. Here are the bytes of the filename (E:/Filmy/Avengers 2 - Věk Ultrona (2015) cz dabing, akční, scifi BRRip.avi):
[69, 58, 47, 70, 105, 108, 109, 121, 47, 65, 118, 101, 110, 103, 101, 114, 115, 32, 50, 32, 45, 32, 86, 195, 132, 226, 128, 186, 107, 32, 85, 108, 116, 114, 111, 110, 97, 32, 40, 50, 48, 49, 53, 41, 32, 99, 122, 32, 100, 97, 98, 105, 110, 103, 44, 32, 97, 107, 195, 132, 197, 164, 110, 196, 130, 194, 173, 44, 32, 115, 99, 105, 102, 105, 32, 66, 82, 82, 105, 112, 46, 97, 118, 105]
To move the file I'm just using the simple:
File.rename(from, to)
What encoding should I use? Any other ideas?
Thank you

How to use variables in Prolog query shell?

I know that I can use variables in Prolog shell (something like using '$' character, I think...but I don't remember...)
If I execute the following query it seems to work fine:
?- leggiFile('dataggare.txt', ListaTesto), tokenizzaLista(ListaTesto, TokenizedList, 1).
ListaTesto = [68, 117, 114, 97, 110, 116, 101, 32, 105|...],
TokenizedList = [t(1, [68, 117, 114, 97, 110, 116, 101]), t(-1, [32]), t(2, [105, 108]), t(-1, [32]), t(3, [77, 101, 100|...]), t(-1, [44]), t(-1, [32]), t(4, [...|...]), t(..., ...)|...]
But if I try to execute the two query leggiFile/2 and tokenizzaLista/2 separately, in this way go into error:
?- leggiFile('dataggare.txt', ListaTesto).
ListaTesto = [68, 117, 114, 97, 110, 116, 101, 32, 105|...].
?- tokenizzaLista($ListaTesto, TokenizedList, 1).
ERROR: variable `ListaTesto' does not exist
Why? it seems to me very strange. What am I missing?
?- open('uty.pl',read,S).
S = <stream>(0x236d4d0).
?- read($S,K).
K = (:-module(uty, [atoi//2, cache_file/2, cache_path/4, call_nth/2, cat/2, count_solutions/2, ... / ...|...])).
?- read($S,K).
K = (:-reexport(nb_uty, [ (<<)/2, (>>)/2, ++ / 2, (**)/2])).
...
but I'm not sure if garbage collection could disturb...
Documentation states
Bindings resulting from the successful execution of a top-level goal are asserted in a database if they are not too large.

Two stars in a Prolog list

what are the two stars in a list?
[53, 5, 1, 53, 97, 115, 53, 50, 52, 121, 55, 56, 55, 97, 4, 1, 98, **]
I tried searching but no success.
The stars indicate that the term contains itself, e.g.
?- X = f(X).
X = f(**).
?- L = [53, L].
L = [53, **].
This is the case at least in older versions of SWI-Prolog.
See also https://lists.iai.uni-bonn.de/pipermail/swi-prolog/2009/001707.html.

Resources