Error importing JSON file into LUIS List entity - azure-language-understanding

I am following the suggested LUIS syntax when importing a file, but throws an error "A valid json file is required". I am not sure what it does not like about the file. I even tried a truncated file, and it does not like it. Here is complete content of my file:
[
{
"canonicalForm": "4214441",
"list": [
"SHASTA COUNTY RISK MANAGEMENT REDDING"
]
},
{
"canonicalForm": "4476278",
"list": [
"SEDGWICK UC 14533 SAN DIEGO"
]
}
]

The contents of your file looks fine, but from your screenshot, it looks like the file extension used is .txt. Change your file extension to .json, eg. insuranceco.json.

Related

Laravel validation error message show only short form

I got used to request to validate before entering the API side function itself, but recently, when I moved the controller function to services then, the error message became like the below sample.
{
"message": "validation.min.string",
"errors": {
"password": [
"validation.min.string"
]
}
}
But when I use the same way build in the new project, the error message show as usual as below
{
"message": "The name must only contain letters.",
"errors": {
"name": [
"The name must only contain letters."
]
}
}
I found that I had added an en language file under res resources\lang\en, which caused this issue, so may I know how I can change back to this version without removing the en file? Thanks

Add an allowed tag name to the HTML language mode

I'm using Foundation for Emails, which has a few unique tag names that are later parsed. Specifically, VSCode doesn't seem to like <spacer>:
How do I add <spacer> as an known/allowed tag so it's not redded out by VSCode?
You can use HTML custom data. Create a JSON file, e.g. spacer.html-data.json:
{
"version": 1.1,
"tags": [
{
"name": "spacer",
"description": "Foundation spacer",
"attributes": [
{
"name": "size",
"description": "Spacer size"
}
]
}
]
}
And include it in your VS Code JSON configuration:
"html.customData": [
"./spacer.html-data.json"
]
Note that this has to be a path relative to your opened folder/workspace.
EDIT: Oh, I just realized that this does not prevent the red colouring in this special case. Probably this is becaue spacer used to be a valid HTML tag but is deprecated now. I have no idea how to change this behaviour in VS code.

ADF V2 The required Blob is missing wildcard folder path and wildcard file name

I am trying to use a wild card folder path that is being supplied by getmetadata and foreach. The actual file name within these folders ends with _Problem_1.csv however i get the following error. can anyone advise me on where i am going wrong?
{ "errorCode": "2200", "message": "ErrorCode=UserErrorSourceBlobNotExist,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The
required Blob is missing. Folder path: client-uploads/[{\"name\":\"A001\",\"type\":\"Folder\"},{\"name\":\"A002\",\"type\":\"Folder\"},{\"name\":\"A004\",\"type\":\"Folder\"},{\"name\":\"A006\",\"type\":\"Folder\"},{\"name\":\"A623\",\"type\":\"Folder\"}]/.,Source=Microsoft.DataTransfer.ClientLibrary,'",
"failureType": "UserError", "target": "Copy data1", "details": [] }
You can try having your Copy activity inside the forEach activity and having for each items dynamic expression as below, which will get the list of all Folder names (This will also include file names if any exists in the folder you are pointing in getmetadata activity).
ForEach Activity Dynamic expression:
Items : #activity('getFolderNames').output.childItems
Here are child Items from getMetaData:
{
"childItems": [
{
"name": "A001",
"type": "Folder"
},
{
"name": "A002",
"type": "Folder"
}
],
"effectiveIntegrationRuntime": "DefaultIntegrationRuntime (West US)",
"executionDuration": 0,
"durationInQueue": {
"integrationRuntimeQueue": 0
},
"billingReference": {
"activityType": "PipelineActivity",
"billableDuration": {
"Managed": 0.016666666666666666
}
}
Than you have to use the "item().name" in the wild card file path expression field of copy activity, to get the name of folder per iteration of forEach activity.
In my sample, I have tried below concat expression to point to the correct folder path name for each iteration.
Wildcard Folder path: #{Concat('input/MultipleFolders/', item().name)}
This will return:
For Iteration 1: input/MultipleFolders/A001
For Iteration 2: input/MultipleFolders/A002
Hope this helps..

Google Drive API upload file with custom property, properties missing from response

I am trying to save a google drive file with custom properties, but its not working and due to the very poor documentation of the Google API, i am struggeling with this. Here is my code so far:
$g = new FileCtrl();
$fileMeta = new Google_Service_Drive_DriveFile();
$fileMeta->name = $file['name'];
$fileMeta->parents = [$g->googleDriveFolderId];
$fileMeta->appProperties = (object)['lead_id'=>$file['lid'], 'sales_package_id'=>$file['pid'], 'user_id'=>$user->uid];
//$fileMeta->size = $file['size'];
$fileData = array(
'data' => $fileContent,
'mimeType' => $file['media_type'],
'uploadType' => $file['multipart'],
);
//create file in google drive
$res = $g->client->files->create($fileMeta, $fileData);
It is not returning an error and the event is saved, but without the custom properties!?
You are probably looking for the properties in the returned file resource.
The reason they aren't there is that Drive only returns a small number of the file properties (name, mime type, id). If you want to see the full file resource you need to include fields=* in the request. So a correct request would look something like
POST https://content.googleapis.com/drive/v3/files?fields=*
I don't know the PHP library, so you'll need to figure that bit out. It will be something like
'fields' => '*',
I just tested this.
Request:
{
"name": "Linda Test",
"mimeType": "application/vnd.google-apps.document",
"appProperties": {
"TestingId": "1"
}
}
Response:
{
"kind": "drive#file",
"id": "1mhP2EW4Kbl81F5AuJ4zJ2IPoeI56i_Vd5K-dfGJRj6Y",
"name": "Linda Test",
"mimeType": "application/vnd.google-apps.document"
}
Do a file.get to check the file metadata.
{
"kind": "drive#file",
"id": "1mhP2EW4Kbl81F5AuJ4zJ2IPoeI56i_Vd5K-dfGJRj6Y",
"name": "Linda Test",
"mimeType": "application/vnd.google-apps.document",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"parents": [
"0AJpJkOVaKccEUk9PVA"
],
"appProperties": {
"TestingId": "1"
},
...
}
I suggest you check your uploaded file using the File.get method after its returned to be sure that it was added. To my knowledge there is now way to see these added fields via the Google drive website interface. If after ruining a file.get you still find that it wasn't uploaded i suggest you log this as a bug with the Google APIs PHP client library team. This works with raw rest requests it could be an issue with the library.

firefox-addon-sdk localization of add-on options

In firefox Add-On builder there is a possibility to drop add-on preferences into the properties window in an "Extra package.json Properties" field.
The preferences for localization look like this:
{ "preferences": [
{
"type": "string",
"name": "myStringPref",
"value": "this is the default string value",
"title": "My String Pref"
}
....
]}
}
Question: How can i localize the labels of the addon-options?
Here is essential of manual localization.
create locale files in json format
create locale listing file in json format
download addon package(xpi file) from Add-on Builder
rename file extension .xpi to .zip
expand zip file
create locale folder in the root of addon
copy locale files into locale folder
copy locale listing file into root folder
zip all files and folders on root folder.
rename file extension .zip to .xpi
file tree:
my-addon
| locales.json
|
+---data
+---lib
+---locale
en-US.json
fr-FR.json
ja-JP.json
samples:
locales.json
{"locales":[
"en-US",
"fr-FR",
"ja-JP"
]}
en-US.json
{
"test": "test en-US",
"test2": "test2 en-US"
}
fr-FR.json
{
"test": "test fr-FR",
"test2": "test2 fr-FR"
}
ja-JP.json
{
"test": "test ja-JP",
"test2": "test2 ja-JP"
}
You can localize the labels of the addon preferences by add some json files into addon package file(xpi) manually.
I wrote "How To" document in Japanese, just yesterday.
You can get it through Google Translate.
I beleive that this document will help you.
http://translate.google.co.jp/translate?sl=ja&tl=en&js=n&prev=_t&hl=ja&ie=UTF-8&u=http%3A%2F%2Fbacky0175.at.webry.info%2F201310%2Farticle_4.html&act=url
Note:
Google Translate makes some weird translation. :-(
Sorry for inconvenient.
backy0175
No it's not possible to do this at the moment.

Resources