how to handle Alexa Echo Show built-in intent - echo

According to the echo show documentation, ONLY the AMAZON.PreviousIntent, and AMAZON.MoreIntent have to be handled by the skill developer.
I've written the following code for them, but Alexa says an error occurred when invoking both previous and next intents on the echo show.
SpeechletResponse speechletResp = new SpeechletResponse();
DelegateDirective dd = new DelegateDirective();
List<Directive> directiveList = new ArrayList<>();
directiveList.add(dd);
speechletResp.setDirectives(directiveList);
speechletResp.setNullableShouldEndSession(null);
return speechletResp;
Any idea how to fix this?

I think the error is curring here:
speechletResp.setNullableShouldEndSession(null);
You should set if the session will end or not, with a true or false.

Related

How to check whether the user is a new user or not in #assistant/conversation package

In the actions-on-google package I have used the following logic to check whether the user is a new user or not.
conv.user.last.seen
But in the new #assistant/conversation package i have used the same logic but it fails stating that the seen is not found. I tried the following logic which shows the current date and time which makes the logic to pass all time.
conv.user.lastSeenTime
Does anyone tried to show whether the user is a new or not in the new #assistant/conversation package?
I ‘m dealing with a similar issue of how to differentiate between new vs returning users with google console’s action builder. The Main invocation is the part of the conversation I'm using this in. (Brand new to the forum so forgive me if I didn’t grasp your question.) I used the same logic as you did, and it did deploy correctly for me using the cloud function's inline editor for the webhook. So I ‘m not entirely sure what’s going on but here are some resources. The following tutorial and code was helpful/ worked for me (https://youtu.be/nVbwk4UKHWw?t=700 )
const { conversation } = require('#assistant/conversation');
const functions = require('firebase-functions');
const app = conversation({debug:true});
app.handle('greeting', conv => {
let message = 'Welcome to App';
if (conv.user.lastSeenTime) {
message = 'Welcome back to App!';
}
conv.add(message);
});
exports.ActionsOnGoogleFulfillment = functions.https.onRequest(app);

sahi onScriptFailure doesn't seem to work

I am new to Sahi and I am just trying to take a screenshot on script errors.
I have tried to used their demo and the script the website provides for the task, but the onScriptFailure doesn't seem to trigger. I added the alert box and changed the log in name to trigger a failure. Sorry if i'm missing something obvious.
function onScriptError($e){
_focusWindow();
_takeScreenShot();
_alert("test me");
}
onScriptFailure = onScriptError;
_navigateTo("http://sahi.co.in/demo/training/");
_setValue(_textbox("user"), "test");
_setValue(_password("password"), "secret");
_click(_submit("TriggerError"));
I was using Sahi Pro. I actually got the answer from their support department. This is what he had me do:
var onScriptError = function ($e) {
_focusWindow();
_takeScreenShot();
_alert("test me");
}
onScriptFailure = onScriptError;
_navigateTo("http://sahi.co.in/demo/training/");
_setValue(_textbox("user"), "test");
_setValue(_password("password"), "secret");
_click(_submit("TriggerError"));
HI You can use the GlobalInclude.sah file which has the code for the error handling.
you can edit this file to make the script behave according to your needs

Making VB Browser Make Facebook Status

I am trying to make a vb script to log into my facebook and update my status. The problem is, the submit button does not have an ID I can find using the page info with Chrome. The script I have so far is:
Try
Dim fileReader As String
fileReader = My.Computer.FileSystem.ReadAllText("pathtotext") ' I sensoored my path
fileReader2 = My.Computer.FileSystem.ReadAllText("pathtotext") 'I sensored my path
WebBrowser1.Document.GetElementById("email").SetAttribute("value", fileReader2)
WebBrowser1.Document.GetElementById("pass").SetAttribute("value", fileReader)
WebBrowser1.Document.GetElementById("loginbutton").InvokeMember("click")
Catch ex As Exception
WebBrowser1.Document.GetElementById("u_0_10").SetAttribute("value", "Can I make a status?")
WebBrowser1.Document.GetElementById("submit").InvokeMember("click")
End Try
All of this works, except the submit button. I used "submit" because that was the type and no ID is showing up. Thanks in advance for all help.
P.S - For future reference, how did you find the id for this button? "If you give a starving man a fish he shall be filled; teach him to fish, however and he shall never go hungry again" - Anonymous
you can use this
Dim htmlElements As HtmlElementCollection = WebBrowser1.Document.All
For Each ClickOnElementButton As HtmlElement In htmlElements
If ClickOnElementButton.InnerText = "Post" Then
ClickOnElementButton.InvokeMember("click")
End If
Next
instead of the old code

Zend Framework - ZFDebug - Log - Log Custom Errors

When using ZFDebug, is it possible to add custom messages to the 'Log' tab?
So you could use something like:
$this->log('Error: Couldn't find the user');
Has anyone managed to achieve this?
I have never used ZFDebug before and wasn't aware of it. Your post piqued my interest, so I installed it and have been trying to achieve what you want to do. I will probably add it to my dev toolbox as I use ZF a lot.
You can achieve what you want by using the mark() method of ZFDebug_Controller_Plugin_Debug_Plugin_Log which takes two arguments. The first is the message you want to send and the second is a boolean which, when set to true (default is false), will send your message to the 'log' tab.
The following code worked for me:-
$debug = Zend_Controller_Front::getInstance()
->getPlugin('ZFDebug_Controller_Plugin_Debug');
$logger = $debug->getPlugin('log');
$logger->mark('Logging a message now', true);
Or to use your example (with the syntax error fixed :) )
$logger->mark("Error: Couldn't find the user", true);
As you can see this produced the desired output:-
Not quite as simple as you wanted, I know, but it's close and you could always wrap it in a function.

Finish all activities in Basic4Android

I have an application with many activities, sharing the same Menu, which is created in a code module. This Menu has an option "Exit". How do I finish all running activities without using ExitApplication? Do I have to create a variable in the code module (ExitNow as boolean) and check it in every Activity_Resume of every activity?
put activity.finish as the code for your exit button
try this one.
Intent intent = new Intent(getApplicationContext(), Home.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
type this in prossec global :
Dim GExit as boolean
Gexit= false
type in all resume in all activity this code:
if Gexit = true then activity.finish
and type this code in your BTNEXIT:
Gexit= true
activity.finish
I tried a lot of examples but this really worked for me
Intent intent = new Intent(getApplicationContext(), HomeActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);