This is the bowerrc file. I want to search in 2 urls for the polymer components. Is it possible to do that? Neither of the url is local.
{
"registry": {
"search": [
"url1",
"url2"
]
},
"strict-ssl" : false,
"resolvers" : [
"bower-art-resolver"
],
}
Related
I'm new to couchbase. I want to update channels for some of the documents through sync functions. But right now, it is not updating but adding an extra channel to the document's meta but not removing the existing channel. Can anyone suggest how I can remove the existing channel in the document?
Sync Function:
function(doc, oldDoc) {
//....
if (doc.docType === "differentType") {
channel("differentChannel");
expiry(2332800);
return;
}
//.......
}
Document:
{
"channels": [
"abcd"
],
"docType": "differentType",
"_id" : "asjnc"
}
Metadata:
{
"meta": {
"id": "asjnc",
"rev": "64-1b500000000",
"expiration": 1650383285,
"flags": 0,
"type": "json"
},
"xattrs": {
"_sync": {
"rev": "1-db30e607872",
"sequence": 777,
"recent_sequences": [
777
],
"history": {
"revs": [
"1-db30e607872"
],
"parents": [
-1
],
"channels": [
[
"differentChannel"
]
]
},
"channels": {
"differentChannel": null
}
}
}
}
Expectation of the document with the same metadata:
{
"channels": [ ], // <--- no channels
"docType": "differentType",
"_id" : "asjnc"
}
With this sync function, for the document of type differentType, the channel differentChannel is set in the xattrs section in the metadata. But the channel that was added earlier from the couchbaseLite is not getting removed. Can anyone help?
I answered this in the Couchbase Forums: https://forums.couchbase.com/t/remove-channels-from-a-document/33212
The "channels" property in a document is counter-intuitively not describing what channels the document is currently in - it's just a user-definable field that happens to be the default routing for channels if you don't specify a sync function. It's up to the writer of the document what it should contain.
If you have another means of channel assignments (like "docType" in your case), then you don't need to specify "channels" in the document. The sync metadata shows that the document is in "differentChannel" at revision 1-db30e607872 but the contents of the document can be arbitrary.
I do not code in JSON and I'm trying to configure some settings for Terminus on Sublime Text 3. Why isn't my code working? I suspect it has something to do with the colons because they appear to be a different color than on the README page. Thanks in advance!
[
"default_config": {
"linux": null,
"osx": "PowerShell",
"windows": null
},
"preserve_keys" : [
"ctrl+k",
"ctrl+p",
"ctrl+z",
"ctrl+c",
"ctrl+v",
"ctrl+x"
],
"theme": "default"
]
You should replace [ ] with { } like that:
{
"default_config": {
"linux": null,
"osx": "PowerShell",
"windows": null
},
"preserve_keys" : [
"ctrl+k",
"ctrl+p",
"ctrl+z",
"ctrl+c",
"ctrl+v",
"ctrl+x"
],
"theme": "default"
}
If you want to store data using key value, you have to use { }. If you want to store data in json as an array, you have to use [ ]. This is the difference which made you an error.
Here's a good tutorial that you can use: https://www.digitalocean.com/community/tutorials/an-introduction-to-json
It's all preety simple
I believe this is a general question about JSON and how VS-code handles settings, but I will give a specific example below that regards the LaTeXWorkshop extension.
I am used to overwriting settings in settings.json by adding lines such as "option": value".
But what if "option" expects a list, and I just want to append a new element to the defaults, without removing the defaults. How do I do that?
Specific Example using LaTeXWorkshop
The default for the latex-workshop-latex-recipe option is given by this (see here):
[
{
"name": "latexmk 🔃",
"tools": [
"latexmk"
]
},
{
"name": "pdflatex ➞ bibtex ➞ pdflatex`×2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
}
]
I want to add the following item to this list without removing the two defaults:
{
"names": ".Rnw: knitr -> latexmk",
"tools": [
"knitr",
"latexmk"
]
}
If I add this to my settings, the default recipes seem to be deleted:
"latex-workshop.latex.recipes" : [{
"names": ".Rnw: knitr -> latexmk",
"tools": [
"knitr",
"latexmk"
]
}],
How do I append instead of replacing?
I have a site hosted in Firebase Hosting and it works fine when I just load content from the current public folder. But I can't load anything from a subdir like /img/logo.png.
I've searched here and over the internet, but found no working solution. Some similar questions I tried:
Images not showing up in hosted site
How to include subdirectories in firebase hosting
My includes are like <script src="js/index.js"></script>
My firebase.json:
{
"database": {
"rules": "database.rules.json"
},
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"headers": [ {
"source" : "**/*.#(eot|otf|ttf|ttc|woff|font.css)",
"headers" : [ {
"key" : "Access-Control-Allow-Origin",
"value" : "*"
} ]
}, {
"source" : "**/*.#(jpg|jpeg|gif|png)",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=7200"
} ]
}, {
"source" : "404.html",
"headers" : [ {
"key" : "Cache-Control",
"value" : "max-age=300"
} ]
} ]
}
}
Solved it by running firebase deploy inside Bash on Ubuntu on Windows.
Previously, I was using firebase cli on plain Windows 10.
i am building a conversation on the watson conversaton, and in a point, togeter with my "response" json, i woul also link to set a new intent for the user, i tried to add this to the json, but with no result.
There is a way to do this?
As you can see in the Official documentation, you can use context variables for save values.
A context variable is a variable that you define in a node, and
optionally specify a default value for. Other nodes or application
logic can subsequently set or change the value of the context
variable.
So, in this case, you'll create in your JSON advance (like your example) something like:
{
"context": {
"intent": "fgts",
"confidence": 1
},
"output": {
"text": {
"values": [
"Your text here"
],
"selection_policy": "sequential"
}
}
}
And in your back-end application, you can access the value in the response JSON object from your POST /message, with something like: response.context.intent and response.context.confidence
Obs.: By default, Watson Conversation service will return the name of the intent that Watson recognizes and the confidence level.
If really after these instructions you want to use your method. You can see my example below:
{
"output": {
"text": {
"values": [
"text here"
],
"selection_policy": "sequential"
},
"intents": "test"
}
}
And your app return:
{ intents: [ { intent: 'helpBot', confidence: 0.5930036529133407 } ],
entities: [],
input: { text: 'ajuda' },
output:
{ text: [ 'text here' ],
nodes_visited: [ 'node_16_1511443279233' ],
intents: 'test',
log_messages: [] },
context:
{ conversation_id: '83d88b05-7c76-457d-bd5f-7820be455a3e',
system:
{ dialog_stack: [Object],
dialog_turn_counter: 2,
dialog_request_counter: 2,
_node_output_map: [Object],
branch_exited: true,
branch_exited_reason: 'fallback' } } }
See more about accessing values using Conversation Service.