How do I escape a Swift doc comment Callout? - swift

I have the following doc comment in Swift:
/**
- Trace
- ↓
- Debug
- ↓
- Information
- ↓
- Warning
- ↓
- Error
*/
The line that says "Warning" does not render in Xcode because "- warning" is a keyword callout in swift doc comments. How can I escape the callout?

Not a perfect solution, but you could surround Warning with backticks (`). This will change its display style slightly:
/**
- Trace
- ↓
- Debug
- ↓
- Information
- ↓
- `Warning`
- ↓
- Error
*/

You can use a zero-width space (​) before the keyword:
/**
- Trace
- ↓
- Debug
- ↓
- Information
- ↓
- ​Warning
- ↓
- Error
*/

Related

can slot take entity values without a action function or forms in RASA?

is it possible to pass values in the entity to slots without form or writing an action function?
nlu.yml
nlu:
- intent: place_order
examples: |
- wanna [large](size) shoes for husky
- need a [small](size) [green](color) boots for pupps
- have [blue](color) socks
- would like to place an order
- lookup: size
examples: |
- small
-medium
-large
- synonym: small
examples: |
- small
- s
- tiny
- synonym: large
examples: |
- large
- l
- big
- lookup: color
examples: |
- white
- red
- green
domain.yml
version: "2.0"
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- place_order
entities:
- size
- color
slot:
size:
type: text
color:
type: text
responses:
utter_greet:
- text: "Hey! can I assist you ?"
utter_order_list:
- text : "your order is {size} [color} boots. right?"
stories.yml
version: "2.0"
stories:
- story: place_order
steps:
- intent: greet
- action: utter_greet
- intent: place_order
- action: utter_order_list
debug output: it recognize entity , but the value is not passed to slot
Hey! can I assist you ?
Your input -> I would like to place an order for large blue shoes for my puppy
Received user message 'I would like to place an order for large blue shoes for my puppy' with intent '{'id': -2557752933293854887, 'name': 'place_order', 'confidence': 0.9996021389961243}' and entities '[{'entity': 'size', 'start': 35, 'end': 40, 'confidence_entity': 0.9921159148216248, 'value': 'large', 'extractor': 'DIETClassifier'}, {'entity': 'color', 'start': 41, 'end': 45, 'confidence_entity': 0.9969255328178406, 'value': 'blue', 'extractor': 'DIETClassifier'}]'
Failed to replace placeholders in response 'your order is {size} [color} boots. right?'. Tried to replace 'size' but could not find a value for it. There is no slot with this name nor did you pass the value explicitly when calling the response. Return response without filling the response
"slot" is an unknown keyword. you should write "slots" instead of "slot" in the domain file and it will work.

k8s: error converting YAML to JSON: yaml: line 33: found character that cannot start any token

hope you are doing fine,
i got that error :error:
error converting YAML to JSON: yaml: line 33: found character that cannot start any token
while trying to deploy this cronjob on my k8s cluster, can you please check and let me know if you have any clues about the reason of having this error ?
the file is as follows:
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: resourcecleanup
spec:
# 10:00 UTC == 1200 CET
schedule: '0 10 * * 1-5'
jobTemplate:
spec:
template:
metadata:
annotations:
iam.amazonaws.com/role: arn:aws:iam::%%AWS_ACCOUNT_NUMBER%%:role/k8s/pod/id_ResourceCleanup
spec:
containers:
- name: resourcecleanup
image: cloudcustodian/c7n
args:
- run
- -v
- -s
- /tmp
- -f
- /tmp/.cache/cloud-custodian.cache
- /home/custodian/delete-unused-ebs-volumes-policies.yaml
volumeMounts:
- name: cleanup-policies
mountPath: /home/custodian/delete-unused-ebs-volumes-policies.yaml
subPath: delete-unused-ebs-volumes-policies.yaml
env:
- name: AWS_DEFAULT_REGION
value: %%AWS_REGION%%
volumes:
- name: cleanup-policies
configMap:
name: cleanup-policies
restartPolicy: Never
---
change:
value: %%AWS_REGION%%
to:
value: "%%AWS_REGION%%"
Strings containing any of the following characters must be quoted.
:, {, }, [, ], ,, &, *, #, ?, |, -, <, >, =, !, %, #, `
Could not find in kubernetes docs, but from ansible yaml syntax:
In addition to ' and " there are a number of characters that are
special (or reserved) and cannot be used as the first character of an
unquoted scalar: [] {} > | * & ! % # ` # ,.
The problem could be from your indentation method, Try using spaces and not tabs for your indentation. Use 2 spaces for each indentation. Hope this helps.

regex to search multiple pattern

Edited my code, tried a different approach to get the desired output.
Let me know if it's correct
import re
pattern1 = re.compile(r'\b(ERROR)')
pattern2 = re.compile(r'^\d+-\d+-\d+')
count =0
with open('sample.txt',encoding='utf-8')as f:
for i in f:
a= re.search(pattern1,i)
if a:
count = count + 1
b = re.search(pattern2,i)
if b:
print(b.group(),':',a.group())
print('Total ERROR in the logfile:',count)
***output:***
2019-11-22 : ERROR
2019-11-22 : ERROR
2019-11-20 : ERROR
Total ERROR in the logfile: 3
log.txt
2019-11-22 16:46:46,985 - main - INFO - Starting to Wait for Files
2019-11-22 16:46:56,645 - main - INFO - Starting: Attempt 1 Checking for New Files
2019-11-22 16:47:46,488 - main - INFO - Success: Downloading the Files from Cloud Storage: Return
2019-11-22 16:48:48,180 - main - ERROR - Failed: Waiting for files the Files
2019-11-22 16:49:17,918 - main - INFO - Starting to Wait for Files
2019-11-22 16:49:32,160 - main - INFO - Starting: Attempt 1 Checking for New Files
2019-11-22 16:49:39,329 - main - WARNING - Success: Downloading the Files from Cloud Storage:
2019-11-22 16:53:30,706 - main - WARNING - Starting to Wait for Files
2019-11-22 16:53:48,180 - main - ERROR - Failed: Waiting for files the Files
2019-11-20 10:00:00,121 - main - ERROR - Failed: Waiting for files the Files
The pattern you should be using to match error lines is:
^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\bERROR\b.*$
Your updated script:
pattern1 = re.compile(r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\bERROR\b.*$')
count = 0
with open('log.txt',encoding='utf-8')as f:
for i in f:
a = re.search(pattern1, i)
if a:
count = count + 1

How to define a macro variable using equation with variables from dataset in SAS Miner

I am trying to use &let in the beginning of my script to define a new macro variable... it should consist of equation from variables from dataset. The equation looks something like this, but SAS always gives me error like this (Runtime error was encountered, please see the log...).
The equation:
%let var_bad = (receivable_actual * 0.5) -
(EM_EVENTPROBABILITY * 0.02 * receivable_actual) +
((1 - EM_EVENTPROBABILITY) * 0.5 * (receivable_actual - amt_instalment));
Can you guys help me fix it?
Thanks,
Adam
#Jetzler: These are the errors it shows me in log.
ERROR 214-322: Variable name ( is not valid.
ERROR 22-7: Invalid option name -.
ERROR 23-7: Invalid value for the KEEP option.
---
23
1 ! (receivable_actual * 0.5) - (EM_EVENTPROBABILITY * 0.02 * receivable_actual) + ((1 - EM_EVENTPROBABILITY) * 0.5 * (receivable_actual - amt_instalment))
- -
214 22
ERROR 214-322: Variable name * is not valid.
ERROR 22-7: Invalid option name +.
1 ! (receivable_actual * 0.5) - (EM_EVENTPROBABILITY * 0.02 * receivable_actual) + ((1 - EM_EVENTPROBABILITY) * 0.5 * (receivable_actual - amt_instalment))
--- -
214 22
14338 + rename=(em_eventprobability = score_no_call));
-------
22 22
201 76
ERROR 214-322: Variable name 0.5 is not valid.
ERROR 22-7: Invalid option name *.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, -, :, ;, END, INDSNAME, KEY, KEYS, NOBS, OPEN, POINT, DATA, LAST, NULL.
ERROR 201-322: The option is not recognized and will be ignored.
ERROR 76-322: Syntax error, statement will be ignored.
Why don't you just calculate the variable in the dataset and then select it into a macro variable?

iPhone Dividing string into multi line and display as Label

I've a string as follows:
#define BEEF_LABLE #"Recommended Internal Temp 145 - Medium Rare 160 - Medium 170 - Well done"
I want to display it in a 4 lines label. "Recommended Internal Temp" in one line, "145 - Medium Rare" in 2nd line, "160 - Medium" in 3rd line and "170 - Well done" in 4th line.
How can I split the text accordingly.
yourLabel.lineBreakMode = UILineBreakModeWordWrap;
yourLabel.numberOfLines = 0;
and add ("\n") in the String accordingly... like this
#define BEEF_LABLE #"Recommended Internal Temp \n 145 - Medium Rare 160 \n- Medium \n 170 - Well done"