Key value in AWSIoTDataManager - swift

I am working with a project where I don't get it the value of
awsiotdatamanager is static string or it generated from AWS. I found it like this in sample code Also I read code this and this but I am getting more and more confused.
let AWSIoTDataManager = "MyIotDataManager"
let iotDataManager = AWSIoTDataManager(forKey: AWSIoTDataManager)
Thanks in advance :)

Related

youtube_explode_dart package has wrong documentation

I am trying to use flutter youtube_explode_dart package but I am facing some errors mainly two
with video.property
Code:-
var video = yt.videos.get('https://youtube.com/watch?v=Dpp1sIL1m5Q');
var title = video.title; // Error in this line
with streamManifest
Code:-
// Error saying streamManifest is not defined
var streamInfo = streamManifest.muxed.withHigestVideoQuality();
Link to the documentation code :- https://pub.dev/packages/youtube_explode_dart
If anyone has used the package or knows the fix PLEASE HELP!
use
manifest=yt.videos.streamsClient.getManifest(url);
after getting manifest then
var streamInfo = manifest.muxed.withHigestVideoQuality();
then use this hopefully your error will be solved please let me know if solved

Getting error 'Insight.Database.FastExpando' does not contain a definition for 'Set1'

The following code is giving the above error, and I cannot figure out why:
var x = _sqlConn.Connection().QueryResults<Results>("MyDb.dbo.get_records", new { id = theId });
int retVal = x.Outputs.Return_Value;
if (retVal == 0) // ...meaning result set was also returned...fine to this point.
{
var list = x.Outputs.Set1; // exception thrown here with above error
var temp = list.FirstOrDefault();
I have been using other features of Insight.Database for a number of years, but have not had to retrieve a SQL RETURN value at the same time as a recordset. The SQL itself works correctly in SSMS, returning a result set and the RETURN value of 0, as expected. This is happening in VS2019, .NET 4 and .NET 4.5.2; Insight.Database 5.2.7 and 5.2.8.
I got this code from the following page:
https://github.com/jonwagner/Insight.Database/wiki/Specifying-Result-Structures
where it shows this:
var results = connection.QueryResults<Beer, Glass>("GetAllBeersAndAllGlasses");
IList<Beer> beers = results.Set1;
which I combined with the following code from here:
https://github.com/jonwagner/Insight.Database/wiki/Output-Parameters
var results = connection.QueryResults<Results>("MyProc", inputParameters);
var p = results.Outputs.p;
That part works. It's accessing .Set1 that is failing, and I am not sure how to track down why.
I do not have experience with the FastExpando class, but Jon promised magic, and I want to believe. Thanks for any help.
I haven’t tried results+dynamic objects in a while…
I think it is because you are doing:
QueryResults<Results> and Results is an Insight type
You probably want:
QueryResults<MyType>
And then you get back a Results<MyType>
Which contains the return val and Set1
If not, post a ticket over on github and we will help you out.

Cannot invoke 'SaveUserData' with an argument list of type '(Dictionary<String, Int>)'

When I'm trying to save data to file, this Error came out.
Please help me, thanks!
var UserData:Dictionary<String,Int> = ["Level":1,"energy": 20,"EXP":0]
func SaveUserData (UserData :Dictionary<String,Int>){...}
SaveAndReadUserData.SaveUserData(UserData) // The Error came out from here

Uploading to cloud storage with API, RequestException

Can anyone tell me why this code gets a request exception?
Google.Apis.Storage.v1.Data.Object obj = new Google.Apis.Storage.v1.Data.Object();
obj.Bucket = "testbucket1817";
obj.ContentType = "binary/octet-stream";
obj.SelfLink = #"C:\Users\User\Desktop\file";
obj.Name = "filename";
Google.Apis.Storage.v1.ObjectsResource.InsertRequest uploadrequest = new ObjectsResource.InsertRequest(storagecredentials, obj, "testbucket1817");
uploadrequest.Execute();
When run I get this error message-
Required [400]
Errors [
Message[Required] Location[ - ] Reason[required] Domain[global]
Message[Required] Location[ - ] Reason[required] Domain[global]
]
I'm not sure about the selflink thing or the content type (for an xml file) but there's nothing anywhere that actually says how this should be done.
Thanks anyone
InsertMediaUpload seems to work fine. Don't know what the difference is from InsertRequest other than I can figure out where to put the data with InsertMediaUpload. So whatever file you want to upload, just set a stream as File.Open(yourfile, FileMode.Open) and set an object like I did in the question.
Google.Apis.Storage.v1.ObjectsResource.InsertMediaUpload uploadmedia = new
ObjectsResource.InsertMediaUpload(ss, object, "bucketname", fileStream, "binary/octet-stream");
that sets up the upload and then uploadmedia.Upload() executes.
Thanks everyone!
Ross

Facebook & Classic ASP - Passing custom parameters to fan page tab - error with no data

We have our app working using this code (Is it possibile to pass parameters to the callback URL of a FB app which is accessed through a tab?), but the issue arises when there is no app_data parameter passed in. Here is an example of what we mean:
Works Fine: ("test" is written out fine)
https://www.facebook.com/phillypours/app_397493550309543?app_data=test
Does NOT Work:
https://www.facebook.com/phillypours/app_397493550309543
Code used with Base64 Encode & JSON Decode:
myArray = Split(Request("signed_request"), ".")
encoded_sig = myArray(0)
payload = myArray(1)
sig = base64_decode(Replace(encoded_sig, "-_", "+/"))
set data = JSON.parse(base64_decode(Replace(payload, "-_", "+/")))
Response.Write data.app_data
This is the error we receive when no parameter is passed in:
Object doesn't support this property or method: 'data.app_data'
Anyone have any thoughts on how to trap for this? I cannot do anything with "data.app_data" since this is what throws the error.
Any help would be greatly appreciated!!!
Thank you.
Dennis
I found a work around for this. Wanted to share to others could benefit. thanks, Dennis
<!--#INCLUDE VIRTUAL="/includes/fb_base64.asp"-->
<!--#INCLUDE VIRTUAL="/includes/fb_json_decode.asp"-->
Function parsePageSignedRequest()
If Request("signed_request") <> "" Then
myArray = Split(Request("signed_request"), ".")
payload = myArray(1)
payload_decoded = base64_decode(payload)
set data = JSON.parse(payload_decoded)
If instr(payload_decoded,"""app_data""") Then
AppData = data.app_data
End If
If instr(payload_decoded,"liked"":true,") Then
LikeStatus = True
End If
End If
End Function