What are the rules for class names in IBM Watson Visual Recognition service? - ibm-cloud

I'm exploring IBM Watson Visual Recognition service and when I create a classifier using classnames like 'black-dog' (i.e. black-dog_positive_example), this classname is later returned as 'black_dog' (with underscore replacing dash) when I classify an image using the /v3/classify endpoint.
But when I retrieve the classifier details with the /v3/classifiers/{classifier_id} the class is correctly listed as 'black-dog'.
So, my result for GET /v3/classifiers/{classifier_id} is like:
{
"classifier_id": "dog_561932172",
"name": "dog",
"owner": "xxxxxxxx-xxx-xxx-xxx-xxxxxxxxxxxx",
"status": "ready",
"created": "2016-07-30T22:06:39.327Z",
"classes": [
{"class": "black-dog"}
]
}
While my result for GET /v3/classify is
{
"custom_classes": 1,
"images": [
{
"classifiers": [
{
"classes": [
{
"class": "black_dog",
"score": 0.546941
}
],
"classifier_id": "dog_561932172",
"name": "dog"
}
],
"image": "20160620_142113.jpg"
}
],
"images_processed": 1
}
So is this expected or a defect? Should I avoid using "-" in class names? Are there any other rules for the value of a classname?

Update:
Updated via Matt's answer.
Talked with the support team, and it is indeed a bug. Here was their response:
Thanks for pointing this out. I reproduced and confirmed with dev team, and we do consider this inconsistency between the listed class name and the class name in results is a bug.
And this is because the class name been altered in result from what is submitted.
I have raised a ticket for tracking on this. According to developer, currently the output can be either a document to list the substitutions or find a way to remove them.
...so they are currently working on it.

Are there any other rules for the value of a classname?
We made an update, and the service should no longer modify any class names like replacing a dash with an underscore. Instead, it will not accept class names with any of these characters for custom learning: \,|,*,{,},$,-,/,',`,"
(You'll see the dash is included in there.) Spaces are acceptable. The update is not retroactive, so existing class names that were modified during training are not affected.

Related

How do i map fields based on a condition when using the Azure DevOps Migration Tools?

I have a custom field on my Azure DevOps user stories that maps directly to the same custom field on the target project. However i want to be able to fill it with data from another field in case the custom field is empty on the source, like this:
if Field A on Source is "ABC" then Field A on Target would be "ABC".
if Field A on Source is "" then Field A on Target would get its value from Field B.
How do i achieve this? I tried using the MultiValueConditionalMapConfig but i can't find any examples online so i have no idea how it works and trial and error was fruitless. The documentation doesn't explain how this specific mapping works so asking here was my only option.
Here is MultiValueConditionalMapConfig sample:
"FieldMaps": [
{
"$type": "MultiValueConditionalMapConfig",
"WorkItemTypeName": "*",
"sourceFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
},
"targetFieldsAndValues": {
"Field1": "Value1",
"Field2": "Value2"
}
}
]
if Field A on Source is "" then Field A on Target would get its value from Field B
However, I’m afraid that there is no supported condition expression in serval FieldMap from the configuration.json sample file.Please refer to doc:Getting started with VSTS sync Migrator
About FieldMaps refer to :Azure DevOps Migration Tools
You can discuss in this website:migration discussions for more detailed information.

Enable users of github program to configure their own DCMake prefix path

Consider a situation where people work together on the same code base; c++ with cmake. Code base depends on a library, that must be installed separately.
Each user may have the library in a different location. A user may invoke cmake like this:
cmake -DCMAKE_PREFIX_PATH=/path/for/that/user .
However, this is not very easy in all circumstances (e.g. windows and visual studio), and requires retyping. So instead, we have
list(APPEND CMAKE_PREFIX_PATH "/path/for/user")
In the CMakeLists.txt. This works, but requires people to constantly change that path after pulling a branch, which is annoying and easily forgotten. Is it possible to configure in a way that pulling new branches does not override this path, once set on a specific machine?
You can have each of your users create their own CMakeUserPresets.json file, and set it in the cacheVariables field of a configurePresets entry.
// CmakeUserPresets.json
{
"version": , // pick one
"cmakeMinimumRequired": {
"major": , // pick one
"minor": , // pick one
"patch": // pick one
},
"configurePresets": [
{
"name": "starball",
"displayName": "Starball's config",
"description": "Starball's private configuration preset",
"generator": "...",
"binaryDir": "...",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "..."
},
"environment": {}
}
],
// ...
}
Make sure to put CMakeUserPresets.json in your .gitignore file (or whatever else you have to do for your specific VCS so that the user preset file isn't tracked in the VCS).

How to show spellchecker(wrong spelling with underline) in TextFormField in Flutter?

In my application I have a story line - Forgive user typos in search makes it effortless for the users. So what exactly I want when I type something in TextFormField it should do spellchecker. Is there is any solution for that in flutter? Kindly find the attached screenshot.
You should use a spellcheck api service for this like Bing Spell Check API it will return the mistakes in the text and you can underline them. Here is the respond of your text;
{
"_type": "SpellCheck",
"flaggedTokens": [
{
"offset": 14,
"token": "Sofyware",
"type": "UnknownToken",
"suggestions": [
{
"suggestion": "Software",
"score": 0.9140160264956476
}
]
}
]
}
here is some APIs you can check them out and select which one works for you.
And here is a package include english words that you can check if the word inside it; https://pub.dev/packages/list_english_words
This feature has landed in Flutter 3.7. To use it, add this parameter to your EditableText or TextField:
spellCheckConfiguration: kIsWeb ? null : SpellCheckConfiguration().
(The spell check configuration currently seems to break on web)

Refer separately deployed components for reuse in an ui5 app

i'm developing some apps, for which everyone needs to show a document in the same way. For this i created a new component which handles my documents in a separate component. I then just want to reuse this component from my different apps.
To embed my reuse component i used something like this in my view.xml:
<core:ComponentContainer
name="de.mycomp.base.DocViewer"
component="de.mycomp.base.DocViewer"
settings='\{"param1":"value1"\}'/>
To access it during runtime i have to declare the namespace of the reuse component and associate it with an resource-url. To achive this, i used the following coding in the init-method of my Component.js which uses my reuse-component DocViewer.
jQuery.sap.registerModulePath("de.mycomp.base.DocViewer", "/sap/bc/ui5_ui5/sap/zdocviewer");
zdocviewer in this case is the name of the bsp-application to which the reuse-component was deployed on premise. To have this also work in webide and on SAP-Cloud-Plattform i needed to add an entry to neo-app.json
like this:
{
"path": "/sap/bc/ui5_ui5/sap/zdocviewer",
"target": {
"type": "application",
"name": "docviewer"
},
"description": "my base document viewer"
},
where docviewer is the name of the deployed app with the reuse component on SCP.
The type application implies that this destination is an app.
This works so far on premise and on sap cloud.
but my problem is that i dont want to have the registerModulePath in my Component.js. Nearly every configuration of components takes place in the manifest.json file. So i tried to move this coding line to configuration in manifest.json, but i failed so far.
Here's what i did:
i added a dependency in section sap.ui5 and there in the dependency-entry like this:
"components": {
"de.dvelop.base.DvelopBaseDocViewer": {
"lazy": true
}
}
i added the following entry to sap.ui5 part
"resourceRoots": {
"de.dvelop.base.DvelopBaseDocViewer": "/sap/bc/ui5_ui5/sap/zdocviewer"
},
The problem here is, that its not allowed to use absolute paths in the value-part of the resource-root entries. So this is invalid:
- /sap/bc/ui5_ui5/sap/zdocviewer
- ../sap/bc/ui5_ui5/sap/zdocviewer
Only this is valid:
- sap/bc/ui5_ui5/sap/zdocviewer
- ./sap/bc/ui5_ui5/sap/zdocviewer
So this annotation is only usable for embedded components, where the reuse-component is in the same deployed project. But this is not my understanding of a reuseable component. So changing something in that component would make it neccessary to copy the files to all the app-projects using the component. And they all have to be deployed again.
So for now i made a fallback to the jquery.sap.registerModulePath because this works with deployed components to refer them from other independent components.
Or does anybody have an idea how to handle this better or more proper within manifest.json?
kind regards
Matthias
see here: ui5 reuse components: https://github.com/Yelcho/UI5-Comp-Routing
you mixed up here old and new approches, wrinting all steps in this answer would be very long. Here brief step to step approche:
define your componentUsages
"componentUsages": {
"myDoc": {
"name": "com.company.myDoc",
"settings": {},
"componentData": {},
"lazy": true
}}
define path mapping, in resourceRoots
"resourceRoots": {
"com.company.myDoc": "/sap/bc/ui5_ui5/sap/zdocviewer"
},
define a targed type component
"targets": {
"myDocTarget": {
"type": "Component",
"usage": "myDoc"
}
use nested routing
.getRouter()
.navTo("myDocRoute", {
id: oBindingContext.getProperty("CategoryID")
}, {
products: {
route: "list",
parameters: {
}
}
});

How to get builds by specifying multiple tags by TeamCity REST API?

I have some builds. Each build has two tags. Tags show module name and version. So tags loogs like one-module and 1.2.3 or two-module and 4.5.6.
I can do this:
/httpAuth/app/rest/builds/?locator=tags:one-module,branch:unspecified:any&fields=build(tags(tag))
I will get this:
{
"build": [
{
"tags": {
"tag": [
{
"name": "1.2.4"
},
{
"name": "one-module"
}
]
}
},
{
"tags": {
"tag": [
{
"name": "1.2.3"
},
{
"name": "one-module"
}
]
}
}
]
}
Now I want to get latest build with tags one-module and 1.2.4. How I can do this?
I try this:
/httpAuth/app/rest/builds/?locator=tags:one-module,1.2.4,branch:unspecified:any&fields=build(tags(tag))
But I got this:
Error has occurred during request processing (Bad Request).
Error: jetbrains.buildServer.server.rest.errors.LocatorProcessException: Bad locator syntax: Invalid dimension name :'1.2.4'. Should contain only alpha-numeric symbols or be known one. Details: locator: 'tags:one-module,1.2.4,branch:unspecified:any', at position 16
Invalid request. Check locator is specified correctly.
I have TeamCity version 9.1.6. TeamCity REST API BuildLocator documentation says:
tags: - ","(comma) - a delimited list of build tags (only builds
containing all the specified tags are returned)
So, I try to select build by 2 or more tags like this. This doesn't work?
What I am doing wrong? How I can get build latest build by 2 or more tags?
I accidently find the way to get build by two or more tags.
Solution: use build locator this way: tags:(one-tag,two-tag,three-tag,etc-tag)
I am not sure it is correct solution. If it is correct JetBrains just forgot to update docs for TC REST API. Or it is just something internal for TeamCity. I asked about here in comments to the docs.
Since Teamcity 10 you can also just list several tag clauses (or 'not' tag clauses), e.g.
http://server/guestAuth/app/rest/builds?locator=defaultFilter:false,tag:sel,not:tag:unres
Oddly, I've not found a way to select for builds with any of several tags.
Either of the above solutions will work for obtaining builds with multiple tags. This one is now legacy: tags:(one-tag,two-tag,three-tag,etc-tag).
Current docs recommend to do it this way: tag:one-tag,tag:two-tag
Unfortunately, you can't use more than one "not" tag clause (either in the legacy syntax or the current).
If you try to use more than one "not" tag clause in the legacy syntax, you just get a bad result--i.e. a build or builds that only exclude one of the excluded tags; if you use the current syntax, you get a 400 bad request with the following exception: "Only single 'not' dimension is supported in locator."