Cannot include partial conversation in Botium Watson Assistant test with #include - automated-tests

I tried following partial conversation documentation to include a partial conversation file using #include syntax.
I want to use many partial conversations, not just in beginning/end but in middle of conversation as well. Which is the correct syntax?
Error:
context: {
err: Error: Failed to parse conversation. Section "include" unknown.
at linesToConvoStep (/Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/helper.js:76:38)
at parseMsg (/Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/CompilerTxt.js:69:14)
at pushPrev (/Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/CompilerTxt.js:79:34)
at /Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/CompilerTxt.js:93:9
at Array.forEach (<anonymous>)
at CompilerTxt._compileConvo (/Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/CompilerTxt.js:89:11)
at CompilerTxt.Compile (/Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/CompilerTxt.js:43:19)
at ScriptingProvider.Compile (/Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/ScriptingProvider.js:407:21)
at ScriptingProvider.ReadScript (/Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/ScriptingProvider.js:493:27)
at /Users/afreed/Code/workspace/my-botium-project/node_modules/botium-core/src/scripting/ScriptingProvider.js:452:71,
message: `ReadScript - an error occurred at 'immediate-pound-out_with_partial.convo.txt' file: Failed to parse conversation. Section "include" unknown.`
}
Test convo immediate-pound-out_with_partial.convo.txt:
immediate pound out, templated second strike
#bot
Hi, how can I help you?
#me
0
UPDATE_CUSTOM SET_WATSON_CONTEXT|vgwIsDTMF|"Yes"
#bot
I can't handle DTMF here
#me
0
UPDATE_CUSTOM SET_WATSON_CONTEXT|vgwIsDTMF|"Yes"
#include SECOND-STRIKE
#bot
Please hold while I transfer you
If I replace #include SECOND-STRIKE with the following, it works. (This seems odd - effectively defining #bot section twice.)
#bot
INCLUDE SECOND-STRIKE
Partial convo file second-strike.pconvo.txt:
SECOND-STRIKE
#bot
I still didn't understand.
Found this similar question, which is unclear about adding partials in the middle of a conversation.

The #include syntax is only available with the most recent release 1.11.2 Please check your Botium Core version

Related

GlideApp symbol not found in Android Studio 4.1

I have been using Glide 4.11.0 and Realm 6.0.2 for some time now, and recently upgraded Android Studio 4.0.x to 4.1. All has been going fine. Today I ran the lint checker, and started doing some "clean up", nothing out of the ordinary (it would seem). One of the things I did a lot of was to replace switch statements that were testing against R.id. with if-else statements per the lint warning about what's gonna happen in Gradle 5.0.
When I did this, I did use a number of int variables I named 'id' that were to replace the value to compare - i.e. instead of a switch statement that would be:
switch (menuOpt.getId()) {
case R.id.xxx:
...
}
I would do:
int id = menuOpt.getId();
if ( id == R.id.XXX) {
} else if....
per the new guidelines.
Suddenly, on a full build AS complains that it no longer recognizes GlideApp, and I am also getting a very weird message about Realm not being able to process correctly:
C:\BLD\AndroidStudioProjects\InTouch\app\src\main\java\com\reddragon\intouch\ui\MediaPlayerActivity.java:61: error: cannot find symbol
import com.reddragon.intouch.utils.GlideApp;
^
symbol: class GlideApp
location: package com.reddragon.intouch.utils
C:\BLD\AndroidStudioProjects\InTouch\app\src\main\java\com\reddragon\intouch\ui\MediaDialogActivity.java:92: error: cannot find symbol
import com.reddragon.intouch.utils.GlideApp;
^
symbol: class GlideApp
location: package com.reddragon.intouch.utils
C:\BLD\AndroidStudioProjects\InTouch\app\src\main\java\com\reddragon\intouch\ui\MediaListActivity.java:48: error: cannot find symbol
import com.reddragon.intouch.utils.GlideApp;
^
symbol: class GlideApp
location: package com.reddragon.intouch.utils
Note: Version 10.0.0 of Realm is now available: https://static.realm.io/downloads/java/latest
Note: Processing class Album
error: Class "Album" contains illegal final field "id".
Note: [1] Wrote GeneratedAppGlideModule with: []
Class "Album" contains illegal final field "id".
4 errors
I have had the field 'id' in my Album class for about 2 years with no issues!
No manner of rebuild, invalidating cache and restarting, syncing gradle files or "reload all from disk" seems to help.
Actually, if I invalidate and restart, I don't get the red squiggle in the offending classes that are referencing GlideApp, but as soon as I start to run the app and it goes through a build process it errors out.
I Googled a bit and found one post where there seemed to be some conflict between Realm and Glide (RequestOptions), but the strange thing to me is why would this suddenly start occurring?
I have validated that the GlideAppjava class is in fact getting built - I am using the debug build variant, and I can see in the file system GlideApp.java that is in the ap_generated_sources/debug directory in the proper package where I have my class that extends AppGlideModule with the #GlideModule annotation.
So GlideApp is getting generated. It just isn't getting recognized.
One of the other new things is that I've recently created a Dynamic Feature module. This module does depend on a class that is in the base module (where GlideApp is referenced). Not sure if this is relevant (I had many, many successful builds before I started doing lint clean-up).
So frustrating! Any help appreciated.
It turns out that the answer was staring right at me, although somewhat hidden: part of the lint check that I did was accept some suggestions about making variables 'final' - including those that are used in Realm classes to define Realm objects. Realm doesn't like that - above build error output includes as a last line the statement 'Class "Album" contains illegal final field "id".'
"Album" extends RealmObject, and the "auto accept" of the lint's suggestion to make some of the fields final was the culprit.
I think this issue with Realm caused a ripple effect somehow with the other annotation processing - when I went back to all the RealmObject classes and removed the "final" declaration, build now completes smoothly.

Xamarin Android Fragment Inflation, Binary XML file line #1: Binary XML file line #1: Error inflating class fragment

I have been following a book on Xamarin Android development and I am getting an issue when inflating a fragment. The error message states
"Binary XML file line #1: Binary XML file line #1: Error inflating class fragment". This error is being thron in the OnCreate of the Activity for the ListFragment. If anyone wishes to look at the code I have wrapped PoiListActivity in a try catch block to get this error.
From what I can tell, my layouts have correct axml and I'm not getting any build errors indicating the C# code is fine. If anyone is able to help, it would be greatly appreciated as I've been battering my head for a few days and it's blocking me from learning further.
Code can be found here
Book being followed is this
To have more info on what's going on, better output the entire exception and not just its message. Or simply remove the try/catch block to see the full error in debug output. The inner exception tells us:
Android.Views.InflateException: Binary XML file line #1: Error inflating class fragment --->
Java.Lang.RuntimeException: Content has view with id attribute 'android.R.id.list' that is not a ListView class
This means you need to add android:id="#android:id/list" to the ListView in PoiListFragment.axml. For more info, please see here.
Next time when asking a question, please provide more info like indicating the file name, including some code, etc.

Deploying Microsoft.Maps/account

I have used an ARM Template to deploy a Microsoft.Maps/account resource to Azure.
That was successful:
Resource Microsoft.Maps/accounts 'nzmoebasedemo0000bt' provisioning status is succeeded
I'd like to retrieve the Primary key generated, within the ARM template, in order to persist it to a KeyVault.
I looked in https://resource.azure.com but the Maps/account provider was not listed, so could find no hint as to what property to read.
I tried:
[listKeys(resourceId('Microsoft.Maps/account', 'parameters('keyVaultVaultSecretMapsAccountResourceName')'), providers('Microsoft.Maps', 'account').apiVersions[0]).keys[0].value]"
Abd got back:
#{parameters=; status=Trial run failed. ; outputs=; provisionStateSucceeded=False; deploymentOutput=; errorCode=InvalidTemplate; errorMessage=Deployment template validation failed: 'The template resource 'azure.arm.base.keyVault.vault.secret' at line '168' and column '9' is not valid: Unable to evaluate template language function 'providers': function requires the second argument to be a multi-segmented resource type excluding the resource provider namespace. Invalid function argument 'account'. Please see https://aka.ms/arm-template-expressions/#providers for usage details.. Please see https://aka.ms/arm-template-expressions for usage details.'.}
Which in this case...seems incorrect.
What am I not seeing/getting?
Thanks!
Edit:
As per suggestion given, the following did pass a test run.
"[listKeys(resourceId('Microsoft.Maps/account', parameters('keyVaultVaultSecretMapsAccountResourceName')), '2018-05-01').keys[0].value]"
But when actually run, got the following:
1:02:35 AM - Resource Microsoft.Maps/account 'nzmoebasedemo0000bt' failed with message '{
"error": {
"code": "InvalidResourceType",
"message": "The resource type could not be found in the namespace 'Microsoft.Maps' for api version '2018-05-01'."
}
}'
Edit again:
As per guidance given in the comments, the following works! (after correcting api version, spelling mistake, and using 'primaryKey' property:
"[listKeys(resourceId('Microsoft.Maps/accounts', parameters('keyVaultVaultSecretMapsAccountsResourceName')), '2018-05-01').primaryKey]"
So the problem was due to a typo, the provider\resource is Microsoft.Maps/accounts

Error while compiling botan sample example in Qt

I am trying to find out the error for two days but still haven't got this unknown reason figure out.
I have configured and compiled Botan library. Everything goes ok but when try to write this sample code to be run..
S2K* s2k = get_s2k("PBKDF2(SHA-256)");
s2k->set_iterations(4049);
SecureVector<byte> key_and_IV = s2k->derive_key(48, passphrase).bits_of();
SymmetricKey key(key_and_IV, 32);
it says error: 'class Botan::PBKDF' has no member named 'set_iterations'
How can I solve this problem ?
The Botan docs for v1.11.1 report that the function get_s2k() has been deprecated, recommending that you use get_pbkdf() instead.
According to the docs, get_sdk(algospec) just returns the result of a call to get_pbkdf(algo_spec) which will give you a pointer to an instance of the class Botan::PBKDF.
First things first then, your code needs to be something more like:
PBKDF *s2k = getpbkdf("PBKDF2(SHA-256)");
Unfortunately without knowing what you want to do with s2k I can't help any further, as the docs have no reference to a public member function of PBKDF called set_iterations(). You're getting the error you mention because Botan::PBKDF really does have no member named set_iterations. You need to read the docs, work out what the purpose of set_iterations() was in your now deprecated example and hence how to achieve that purpose in the newer version of the library.
Possibly you missed your library header... as your error message says: 'has no member named...'

Compiler Error Message: CS0103: The name 'Database' does not exist in the current context [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Razor-based view doesn't see referenced assemblies
I am a Newbie in ASP.net
I am trying to connect to a database and I keep getting this error
**Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: CS0103: The name 'Database' does not exist in
the current context
Source Error:
Line 1: #{
Line 2: var db = Database.Open("demo"); '
Line 3:
Line 4:
Source File: c:\Users\Ayoya\Documents\My Web Sites\demo\Page.cshtml
Line: 2
**
Can anyone tell me whats wrong?
Thank you
The compiler's already telling you what's wrong - it doesn't know what you mean by Database. Is that mean to be a property of the page, or is it the name of a type with a static Open method? It's not clear from the code itself, and obviously the compiler can't find the name either.
Work out what name you mean, then work out why the compiler can't see it, then fix that. If you need more help on any of these steps, you'll need to provide more information.
(As an aside, I completely agree with dbaseman: putting database calls in your view is a bad idea.)
If you're opening a database in your Razor view, that is completely the wrong approach. Your logic should go in the Controller, not the View. Consider creating a "view model" class that contains all the data needed for your view, and populate that class from the Controller.
Probably the reason this piece of code isn't working is that you will need to specify the full namespace of Database. I'm not sure what that class is, though; if it's in a separate DLL, you'll have more problems. Again, though, you should circumvent this problem by putting your database logic in the controller.

Resources