Can updateInterval be set for a design document? - couchbase

In Couchbase 2.2, I have set the updateInterval parameter both globally (for the view update daemon) and for an individual design document. It appears that only the global setting is always taking effect. On the other hand, if I set updateMinChanges for a design document, it takes effect just fine.
Curiously, the documentation example does not show updateInterval being set for a design document:
{
"_id": "_design/myddoc",
"views": {
"view1": {
"map": "function(doc, meta) { if (doc.value) { emit(doc.value, meta.id);} }"
}
},
"options": {
"updateMinChanges": 1000,
"replicaUpdateMinChanges": 20000
}
}
Can updateInterval be set for a design document?

it is not currently possible to set an updateInterval at the design document level. A feature request has been added to provide this function # https://www.couchbase.com/issues/browse/MB-11594

Related

In Google Slides, trying to set AutofitType to 'Shrink text on overflow' ('TEXT_AUTOFIT')

I have tried the following code but discovered that although the AutofitTypes are enumerated, only "NONE" works.
requests = [(
{ updateShapeProperties: {
objectId: shape.getObjectId(),
shapeProperties: {
autofit: {
autofitType: "NONE" // vs. "TEXT_AUTOFIT"
}
},
fields: "autofit.autofitType"
}
}
)]
response = Slides.Presentations.batchUpdate({requests: requests}, deck.getId());
So I changed my logic and created the TEXT_BOX in Slides with the desired AutofitType. To my chagrin, when I issued my first shape.getText().replaceAllText('text placeholder','new text'), the Autofit option has been reset to NONE.
Any thoughts on how I can script the setting of AutofitType?

How do I rotate an image using google docs api in google scripts?

I am using Google Scripts to do a mail-merge like creation of the document. I need to be able to insert to images that are created dynamically. One is as-is and the other needs to be rotated 90-degrees.
I have been able to get the image after appending to the document, but the image attributes do not provide for setting the angle. In reviewing the body of the document there is an area I could insert the angle setting. In the JSON provided, it is the imageProperties. If I could get to it and add "angle": number it should rotate the image.
"revisionId": "AOV_f49iY5wC2Fm-Bm8uhcx6XmmXfNqs_hK-5Ac3PXlhXV5BiFYD4u-4beWO9WdQQCfYmy3nfjODTRrDcdWNIg",
"suggestionsViewMode": "SUGGESTIONS_INLINE",
"inlineObjects": {
"kix.4aowmksp4phx": {
"objectId": "kix.4aowmksp4phx",
"inlineObjectProperties": {
"embeddedObject": {
"imageProperties": {
"contentUri":
https://lh5.googleusercontent.com/aBdOBxBXK_0uaz1b9vJS",
"sourceUri": "http://barcodes4.me/barcode/c39/undefined.png?height=100",
"cropProperties": {}
------->>> "angle": 1.567
},
"embeddedObjectBorder": {
...
Any ideas on how to set the imageProperties.angle value?

How to disable strongloop's API explorer swagger console

I'd like to disable the strongloop api explorer (pref as noted in docs) - not clear if this is a bug or documentation issue.
Setting or replacing component config or using component-config.production as noted in the docs fails and generates an critical error / crashing express.
// Original
{
"loopback-component-explorer": {
"mountPath": "/explorer"
}
}
// changes made to disable
{
"loopback-component-explorer": false
}
Docs:
https://docs.strongloop.com/display/APIC/Preparing+for+deployment#Preparingfordeployment-DisablingAPIExplorer
Remove the loopback-component-explorer entry from your component-config.json file entirely.
You can remove only 'loopback-component-explorer' part from 'component-config.json' and keep the empty object, where the code will not get crashed.
Original code:
{
"loopback-component-explorer": {
"mountPath": "/explorer"
}
}
Updated:
{
}
Also can turn off stack traces, more info here

Creating Chrome extensions to hide DIV display:none; on a specific page

I'm trying to create my first Chrome extension.
It's basically an adblocker for specific elements, in this case - the Facebook comments section.
It works with the all_urls but not with that specific domain.
Manifest file:
{
"name": "My extension",
"version": "1.0",
"manifest_version": 2,
"content_scripts": [
{
"matches": ["http://visir.is/*"], //where your script should be injected
"css": ["style.css"] //the name of the file to be injected
}
]
}
style.css file:
.fbcomment {
display: none;
}
Any ideas how to correct "matches"?
I have tried *://visir.is/* as specified in https://developer.chrome.com/extensions/match_patterns but it only works with all_urls
Viktor,
You are on the wrong way. Your extension should work on Facebook site, and so the matches statement in the manifest must be exactly as the following:
"matches": ["https://www.facebook.com/*"]
Than you need to find all the comments in the timeline (most probably by css class), detect the presence of the target site address (//visir.is/) and then hide these comments.
Because the timeline dynamically load more posts you will also need to observe the new nodes and apply your function on them too (see the example from my Chrome extension below):
var obs = new MutationObserver(function (mutations, observer) {
for (var i = 0; i < mutations[0].addedNodes.length; i++) {
if (mutations[0].addedNodes[i].nodeType == 1) {
$(mutations[0].addedNodes[i]).find(".userContentWrapper").each(function () {
injectFBMButton($(this));
});
}
}
injectMainButton();
});
obs.observe(document.body, { childList: true, subtree: true, attributes: false, characterData: false });

How to make a mobile app screen size aware

I want to make a Cordova (Phonegap) app that can be used on all devices. Including PC screens. I want the layout to adjust the number and layout of panels (views) acording to some simple instructions. I chose the Dojox.app because of the way the config.json file controls the MVC structure of the app.
A Dojox.app uses controllers to handle size and orientation events. The config.json file contains "controllers", "views" and other elements to define the MVC structure of the app
//Mandatory,listen App.emit events,implement dojox/app/Controller
"controllers": [
//listens to "app-init, app-load"
"dojox/app/controllers/Load",
//listens to "app-transition, app-domNode"
"dojox/app/controllers/Transition",
//listens to "app-initLayout,app-layoutVIew,app-resize"
"dojox/app/controllers/Layout"
],
//Mandatory, one or a set of views view1+view2+view3
"defaultView": "home+rightPane",
//Mandatory, Specify Application child views
"views": {
"home":{
//Mandatory set template for defaultViews
"template": "app/views/home/home.html",
"controller" : "app/views/home/home.js",
"defaultView": "rightPane",
/* when transitioning between tabs, use a flip animation by default */
"defaultTransition": "slide",
/* the views available to this scene */
"views": {
"rightPane":{
//Mandatory set template for defaultViews
"template": "app/views/rightPane/right.html",
"controller" : "app/views/rightPane/right.js",
"defaultView": "general",
/* when transitioning between tabs, use a flip animation by default */
"defaultTransition": "slide",
/* the views available to this scene */
"views": {
"about":{
"template": "app/views/about/about.html",
"controller" : "app/views/about/view.js"
},
"wifi":{
"template": "app/views/wifi/wifi.html",
"controller" : "app/views/wifi/wifi.js"
},
"general":{
"template": "app/views/general/general.html",
"controller" : "app/views/general/general.js"
},
"picture":{
"template": "app/views/picture/picture.html",
"controller" : "app/views/picture/picture.js"
},
"bright":{
"template": "app/views/bright/bright.html",
"controller" : "app/views/bright/bright.js"
}
}
}
}
}
},
...
I want to create a custom controller by changeing the "dojox/app/controllers/Layout" to allow for the addition and subtraction of views depending on the screen sizs.
Dojo already has the experimental 'dojox/mobile/ScreenSizeAware' module but it is limited to two panels and does not work (well I haven't been able to) in a MVC environment.
How to go about defining the views in the config.json file and how to create the controller.
I'll give it some serious thought over the next few days. If you have any suggestions please jot them down here.
You should take a look at the dojox/app/tests/mediaQuery3ColumnApp, it will show 1, 2 or 3 columns depending upon the screen size. It includes a custom layout controller which uses css to handle the layout, and a custom navigation controller to try to handle which views to show when transitioning. It is not perfect, there are some issues with the navigation between views when the displayed columns has changed, but it should get you started.
You can run it here:
http://archive.dojotoolkit.org/nightly/checkout/dojox/app/tests/mediaQuery3ColumnApp/
And you can see the code here:
https://github.com/dmachi/dojox_application/tree/master/tests/mediaQuery3ColumnApp
Regards,
Ed