SpelEvaluationException: EL1007E '#' not well managed when trying to develope a dialog answering with 'emails' - ibm-watson

I'm writing a Dialog that identifies some required capabilities and provides as output the name and the email of the person having those capabilities.
I wrote a dialog node that provides an output like this: "The person you are looking for is name-surname and the email is xxxxx#yyyy.com" , but if I run it I receive the following error "SpelEvaluationException: EL1007E"
The error disappear when replacing the '#' in the answer with any other character
I also tried to build a context variable containing the email and building the answer using the variable but the error is the same.
Any suggestion?
Thanks

You need to escape the # by adding \\ so it should be x\\#y.com

Related

Send multi-line signature to Metamask via web3js

Checked all the similar questions suggested and couldn't find an answer, unfortunately.
Is there a way to send a multi-line message to metamask via web3.eth.personal.sign as the first parameter? (The problem is how to get multiple lines, not how to actually send a message there)
A more eloquent example of my question can be seen in the image attached. There are multiple paragraphs on separate lines: 'Welcome to OpenSea!', 'Click "Sign" to sign in..." etc.
Thanks a lot!
You can either use \n or use instead of '' or "" when you send the message. The option with takes the spacing in the content into consideration (in js).

What's a way to implement backspace working in field in ncurses

I am try to create tui via ncurses. And I have same problem.
There are two fields:
Name
_______
Password
_______
How to implement backspace-support in each field ?
And how to use '*' to show each character in password-field ? (Now I use field_opts_off(field[1], O_PUBLIC);and it doesn't show characters in password-field, only move cursor).
Thank you.
There is no tutorial for the forms package that I recall. However, the ncurses test-programs (which are available separately as ncurses-examples) contains a program demo_forms which does implement deletion by maintaining the edited field contents as a hidden field buffer, and decrementing its length in the case for REQ_DEL_CHAR.
Here is a screenshot of the program:
Regarding the "non-ncurses" suggestion: dialog is a curses/ncurses application, and has no particular dependency upon bash.
"Non-ncurses" solution (just for an alternative):
You can use dialog program to perform this task in a very easy way. Just run some linux system commands from C to achieve a nice TUI.
If you want to install it, the package name is dialog too.
For a textfield, you can do: dialog --inputbox <text> <height> <width> [<init>]
For a password field: dialog --passwordbox <text> <height> <width> [<init>]
For more info: http://bash.cyberciti.biz/guide/Bash_display_dialog_boxes

Best way to use Assertion in Page Object Model (POM)?

I m Using following assertion to read the validation message in POM but sometimes testcases may give different Validation message which makes TestCase fail , i want to get that Validation message if the testcase fails so that i can debug easily
// Assert whether Account Created Successfully or Not
WebElement element = driver.findElement(By.xpath("//html/body/table[2]/tbody/tr/td/form/table/tbody/tr/td/font"));
String strngAcc = element.getText();
System.out.println(strngAcc);
Assert.assertEquals(" Account Information Created Successfully", strngAcc);
If the Validation got was "Account Already exists" , the Testcase fails indicating that
xpath could not found //html/body/table[2]/tbody/tr/td/form/table/tbody/tr/td/font
i want to capture that validation "Account Already exists" .
please provide me a way to pick the validation actually displaying
PS : I Dont want to go with Screen Shot Capture method
Please don't use xpaths that are too literal in the placement in the html code because by doing this, your tests become brittle and can easily break (e.g. if the structure of the dom changes a bit).
It sounds like the xpath of the correct validation message and "Account Already exists" message are different...What does the structure of the elements look like in html? Again, your xpath may be too specific. Could you give more info?
Your problem isn't the assertion, it's fact that WebDriver cannot find the element it's looking for with that xpath.
Rather than using this absolute XPath, you should look for better ways to find the element you're looking for. Do any of the elements the validation error have specific ID's that you can search for? You'll have to post a snippet of the HTML if you want any more specific help than that.

cakephp2x email subject line length

I am trying to send an email using CakePHP 2x utility CakeEmail, I am getting all my values dynamically as below-
$Email = new CakeEmail();
$Email->from($from_id);
$Email->to($to_id);
$Email->subject($subject);
$Email->send($body);
Sometimes email is sending without any failure, but sometimes it wont. Finally I found the issue with the subject line length. Whenever my subject line is getting bigger then the email is not sending properly through programmatically. But, whenever my subject is line is less than nearly 75 characters then its working perfectly. So, how can I fix this issue by enlarging subject line length. Normally in gmail there is no restriction of subject length. But programmatically it is not allowing in CakePHP 2x CakeEmail utility.
Do you use SMTP. If not then please send mail using SMTP. and the check.
Please follow the given link bellow.
http://book.cakephp.org/2.0/en/core-utility-libraries/email.html
Got the solution by myself. Simply change the core behavior of Email functionality in Cake Lib. Open \lib\Cake\Network\Email\MailTransport.php and edit line no - 47 as below
$this->_mail($to, str_replace(array("\r","\n"), "", $email->subject()), $message, $headers, $params);
So, the basic change is to remove "New Line" & "Carriage Return" from Subject text. Whenever our subject text becomes more than 75 characters, framework will automatically put new line in the subject text, which wont work while on sending emails.

DotNetNuke Event Logging format

Using DotNetNuke 5.
I am using the EventLogController along with LogInfo to add custom messages to the event logs in dot net nuke.
Within LogInfo we have a method to Add a Property/Value. I am under the assumption that the Controller.AddLog(logInfo) converts the properties & vlaues into XML using the LogInfo->Serialize method for DNN to store it.
My problem is that I want linebreaks in my message. Is there anyway I can add a newline. "\r\n" wouldn't work, wouldn't work, CDATA escaped wouldn't work. Everything gets escaped through the Log function.
How do I pretty print the log message myself?
Regards, V
Sadly, due to the HTML encoding that is done on all messages, you are going to be out of luck trying to do this in the DNN event Log.
Depending on what/where you are, you have a few options.
You can add them as individual detail lines using properties, see my example below.
You could report on something yourself, using a custom log table or something similar
If you are in the context of a Scheduled Job, you can log to that history, which is NOT escaped.
Examples
Log Properties
objLog = new DotNetNuke.Services.Log.EventLog.LogInfo();
objLog.AddProperty("SecureMyInstall", "Phase 2 Error Processing User Accounts");
objLog.LogTypeKey = DotNetNuke.Services.Log.EventLog.EventLogController.EventLogType.HOST_ALERT.ToString();
objLogger.AddLog(objLog);
The content of the logs is displayed as HTML, so you should be able to put <br /> to add line breaks.

Resources