How to make scopes with different settings in settings.json file | VSCode? - json

I want to change colors of my color theme in VSCode and I got stuck with scope and settings properties in settings.json file.
"[Palenight Theme]": {
"textMateRules": [
{
"scope": ["string.quoted.double.html",
"meta.attribute.content.html",
"meta.tag.metadata.meta.void.html",
"text.html.derivative",
],
"settings": {
"foreground": "#bcb9ff",
},
}
],
}
I tried to add another scope and settings properties but it doesn't work, it completely overrides the first one even though it contains completely different properties.
"[Palenight Theme]": {
"textMateRules": [
{
"scope": ["string.quoted.double.html",
"meta.attribute.content.html",
"meta.tag.metadata.meta.void.html",
"text.html.derivative",
],
"settings": {
"foreground": "#bcb9ff",
},
//Completely overrides the first one.
"scope": ["entity.name.tag.html",],
"settings": {
"foreground": "#fff",
},
}
],
}
How can I achieve this?

As #rivo8 said, instead of adding properties to the body of the first object, you should add a new object the the "textMateRules" array, basically doing it like this:
"[Palenight Theme]": {
"textMateRules": [
{
"scope": ["string.quoted.double.html",
"meta.attribute.content.html",
"meta.tag.metadata.meta.void.html",
"text.html.derivative",
],
"settings": {
"foreground": "#bcb9ff",
},
},
{
//Completely overrides the first one.
"scope": ["entity.name.tag.html",],
"settings": {
"foreground": "#fff",
},
},
],
}

Related

How to transcode MP4 video with SRT subtitle on AWS Elemental MediaConvert

I have a MP4 video with SRT captions and I need to transcode them with media convert. In media convert I set automatic ABR and I specified the SRT origin path.
At the moment, I have tested the following:
I set SRT file in one output and video/audio in another
I set SRT, video and audio in the same output
For the first test, the job finish successfully, but on the S3 bucket there isnt any .SRT file. For the second test, the job fails with "aption destination type [SRT] requires a raw muxer." message
This is my JSON for the first test
{
"Queue": "arn:aws:mediaconvert:us-east-1:{{ACCOUNT-NUMBER}}:queues/Default",
"UserMetadata": {},
"Role": "arn:aws:iam::{{ACCOUNT-NUMBER}}:role/{{MY-ROLE-NAME}}",
"Settings": {
"TimecodeConfig": {
"Source": "ZEROBASED"
},
"OutputGroups": [
{
"Name": "DASH ISO",
"Outputs": [
{
"ContainerSettings": {
"Container": "MPD"
},
"VideoDescription": {
"ScalingBehavior": "DEFAULT",
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "H_264",
"H264Settings": {
"InterlaceMode": "PROGRESSIVE",
"ScanTypeConversionMode": "INTERLACED",
"NumberReferenceFrames": 3,
"Syntax": "DEFAULT",
"Softness": 0,
"GopClosedCadence": 1,
"GopSize": 90,
"Slices": 1,
"GopBReference": "DISABLED",
"SlowPal": "DISABLED",
"EntropyEncoding": "CABAC",
"FramerateControl": "INITIALIZE_FROM_SOURCE",
"RateControlMode": "QVBR",
"CodecProfile": "MAIN",
"Telecine": "NONE",
"MinIInterval": 0,
"AdaptiveQuantization": "AUTO",
"CodecLevel": "AUTO",
"FieldEncoding": "PAFF",
"SceneChangeDetect": "ENABLED",
"QualityTuningLevel": "MULTI_PASS_HQ",
"FramerateConversionAlgorithm": "DUPLICATE_DROP",
"UnregisteredSeiTimecode": "DISABLED",
"GopSizeUnits": "FRAMES",
"ParControl": "INITIALIZE_FROM_SOURCE",
"NumberBFramesBetweenReferenceFrames": 2,
"RepeatPps": "DISABLED",
"DynamicSubGop": "STATIC"
}
},
"AfdSignaling": "NONE",
"DropFrameTimecode": "ENABLED",
"RespondToAfd": "NONE",
"ColorMetadata": "INSERT"
},
"AudioDescriptions": [
{
"AudioTypeControl": "FOLLOW_INPUT",
"AudioSourceName": "Audio Selector 1",
"CodecSettings": {
"Codec": "AAC",
"AacSettings": {
"AudioDescriptionBroadcasterMix": "NORMAL",
"Bitrate": 96000,
"RateControlMode": "CBR",
"CodecProfile": "LC",
"CodingMode": "CODING_MODE_2_0",
"RawFormat": "NONE",
"SampleRate": 48000,
"Specification": "MPEG4"
}
},
"StreamName": "latino",
"LanguageCodeControl": "FOLLOW_INPUT",
"LanguageCode": "SPA"
}
]
},
{
"ContainerSettings": {
"Container": "MPD"
},
"CaptionDescriptions": [
{
"CaptionSelectorName": "Captions Selector 1",
"DestinationSettings": {
"DestinationType": "SRT"
},
"LanguageCode": "SPA",
"LanguageDescription": "latino"
}
]
}
],
"OutputGroupSettings": {
"Type": "DASH_ISO_GROUP_SETTINGS",
"DashIsoGroupSettings": {
"SegmentLength": 30,
"MinFinalSegmentLength": 0,
"Destination": "s3://{{BUCKET-NAME}}/streaming15/dash-iso/",
"FragmentLength": 2,
"SegmentControl": "SINGLE_FILE",
"MpdProfile": "ON_DEMAND_PROFILE",
"HbbtvCompliance": "NONE"
}
},
"AutomatedEncodingSettings": {
"AbrSettings": {
"MaxAbrBitrate": 8000000,
"MinAbrBitrate": 600000
}
}
}
],
"AdAvailOffset": 0,
"Inputs": [
{
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0",
"AlphaBehavior": "DISCARD"
},
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"InputScanType": "AUTO",
"TimecodeSource": "ZEROBASED",
"CaptionSelectors": {
"Captions Selector 1": {
"SourceSettings": {
"SourceType": "SRT",
"FileSourceSettings": {
"SourceFile": "s3://{{BUCKET-NAME}}/PROMO_CAP_01.srt"
}
}
}
},
"FileInput": "s3://{{BUCKET-NAME}}/PROMO_CAP_01.mp4"
}
]
},
"AccelerationSettings": {
"Mode": "DISABLED"
},
"StatusUpdateInterval": "SECONDS_60",
"Priority": 0
}
What I am missing?
According to the AWS Elemental MediaConvert user guide, SRT is not a supported output for a DASH-ISO output group when the input caption type is SRT.
Here's a link to that guide (reference page 176):
https://docs.aws.amazon.com/mediaconvert/latest/ug/mediaconvert-guide.pdf
The supported caption outputs for SRT input in DASH-ISO are:
Burn in
IMSC (as sidecar .fmp4)
IMSC (as sidecar .xml)
TTML (as sidecar .fmp4)
TTML (as sidecar .ttml)
Additionally, there is a gap in the documentation. SRT->DASH-ISO+WebVTT is supported, even though it is not listed. The documentation will be corrected, but I wanted to share that with you in case it helps.
If you must send SRT to the output destination, then you could create a separate output group where the caption is in a track with no container (see pages 192-196 in the document).

Issue while creating a job for AWS Elemental media convert

I am having some issue while creating a job for AWS Elemental media convert.
I have followed the following sequence.
1.) Create a new job
2.) Add input and configurations
3.) Add File output group and configure destination settings
4.) Under Output change Container to No Container
5.) Under Output remove Audio
6.) Under Output -> Video change Codec to JPEG to Frame Capture
7.) Configure frame rate (rate which captures will be produced (more notes and examples below))
8.) Configure max capture settings
I got the following error:
Job_contains_the_following_error:
/outputGroups: Should not match the schema
Here is my job JSON:
{
"Settings": {
"AdAvailOffset": 0,
"Inputs": [
{
"FilterEnable": "AUTO",
"PsiControl": "USE_PSI",
"FilterStrength": 0,
"DeblockFilter": "DISABLED",
"DenoiseFilter": "DISABLED",
"TimecodeSource": "EMBEDDED",
"VideoSelector": {
"ColorSpace": "FOLLOW",
"Rotate": "DEGREE_0"
},
"AudioSelectors": {
"Audio Selector 1": {
"Offset": 0,
"DefaultSelection": "DEFAULT",
"ProgramSelection": 1
}
},
"FileInput": "s3://field-live-user-data/udariyan.mp4"
}
],
"OutputGroups": [
{
"Name": "File Group",
"OutputGroupSettings": {
"Type": "FILE_GROUP_SETTINGS",
"FileGroupSettings": {
"Destination": "s3://field-live-user-data/"
}
},
"Outputs": [
{
"VideoDescription": {
"ScalingBehavior": "DEFAULT",
"TimecodeInsertion": "DISABLED",
"AntiAlias": "ENABLED",
"Sharpness": 50,
"CodecSettings": {
"Codec": "FRAME_CAPTURE",
"FrameCaptureSettings": {
"FramerateNumerator": 30,
"FramerateDenominator": 100,
"MaxCaptures": 2,
"Quality": 80
}
},
"DropFrameTimecode": "ENABLED",
"ColorMetadata": "INSERT",
"Width": 1280,
"Height": 720
},
"ContainerSettings": {
"Container": "RAW"
},
"Extension": "jpg"
}
],
"CustomName": "customGroup"
}
]
},
"Queue": "arn:aws:mediaconvert:us-east-1:469030323850:queues/Default",
"Role": "arn:aws:iam::469030323850:role/myMediaConverter"
}
Currently, you can't have a job template with frame capture only:
AWS Dev forums on this topic

Fiware: NGSI v2 susbcription: getting notified only about the attribute that has changed

I have this subscription:
{
"id": "5a27abba56256c402cec5654",
"description": "my subscription",
"status": "active",
"subject": {
"entities": [
{
"idPattern": ".*"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 56939,
"lastNotification": "2018-01-29T09:06:45.00Z",
"attrs": [],
"attrsFormat": "normalized",
"http": {
"url": "http://notif_url"
},
"lastFailure": "2018-01-24T15:10:08.00Z",
"lastSuccess": "2018-01-29T09:06:45.00Z"
}
}
Using it I can get notified about new entities whithout specifiying a particular entity ID.
The problem is that when one entity attribute changes I get notified about all attributes.
Is it possible to get notified only about the attribute that has changed and keeping in the same time the possibility to discover new entities?
Something like in if attribut x changed in the condition part, get notified about it:
"condition": {
"attrs": [attribute_X]
}
"notification": {
"attrs": [attribute_X]
}
Thanks!
It works the way you mention. I mean, using:
"condition": {
"attrs": [ "attribute_X" ]
}
...
"notification": {
"attrs": [ "attribute_X" ]
}
Whenever attribute named attribute_X changes (or appears first time, typically at entity creation time) you will receive a notification including only attribute_X

How to add parameters to CFLint rule

I want to set specific parameters for the built-in CFLint rules using CFLint 1.2.3. Unfortunately, there is currently no clear description how to do that.
So I tried to set them in different ways within the configuration having a look at the project test files and the provided JSON schema:
As defined in one of the test files:
{
"rule" : [
{
"name": "VariableNameChecker",
"className": "VariableNameChecker",
"message": [
{
"code": "VAR_TOO_SHORT",
"severity": "INFO",
"messageText": "Variable ${variable} SHORTER THAN ${MinLength}!"
}
],
"parameter": [
{
"name": "MinLength",
"value": "5"
}
]
}
],
"inheritParent" : true
}
Within the rule object:
{
"rule": [ ],
"excludes": [ ],
"includes": [
{
"code": "VAR_TOO_SHORT",
{
"parameter": {
"MinLength": "5"
}
}
}
],
"inheritParent": false
}
As separate global property:
{
"rule": [ ],
"excludes": [ ],
"includes": [
{
"code": "VAR_TOO_SHORT",
}
],
"parameter": {
"MinLength": "5"
}
"inheritParent": false
}
I also tried different naming conventions as parameter name like VariableNameChecker.MinLength and also writing parameters instead of parameter, though without luck.
What is the correct syntax to specify the parameters?
The only ways to override a plugin param prior to CFLint 1.3.0 are
(1) replace the cflint.definition.json file with your own
(2) set a system property in the form ClassName DOT parameter. for example:
java -DVariableNameChecker.MinLength=5 cflint-1.2.3-all.jar -file
In CFLint 1.3.0 the following will work:
{
"parameters" : {
"VariableNameChecker.MinLength": "5"
}
}

Configure the behaviour of R linters in Sublime 3

I am using lintr in Sublime 3 via SublimeLinter 3 and the SublimeLinter-contrib-lintr plugin. On the lintr README.md file there is a short mention on how to configure what linters should be used:
{
"user": {
"linters": {
"r": {
"linters": "with_defaults(line_length_linter(120))"
}
}
}
}
However, I am using it in conjunction with SublimeLinter-contrib-lintr and I can't get it to work. My SublimeLinter.sublime-settings file looks like this:
{
"user": {
"debug": true,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"lintr": {
"#disable": false,
"args": [],
"cache": "TRUE",
"excludes": [],
"linters": "default_linters"
}
},
"mark_style": "outline",
"no_column_highlights_line": false,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [],
"windows": [
"C:/Program Files/R/R-3.3.3/bin/x64"
]
},
"python_paths": {
"linux": [],
"osx": [],
"windows": []
},
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": false,
"show_marks_in_minimap": true,
"syntax_map": {
"r extended": "r"
},
"warning_color": "DDB700",
"wrap_find": true
}
}
The lintr package has a bunch of linters (see this link). What I would live to achieve is to discard some of them (i.e., not use, for instance, assignment_linter). Do you have any idea how to achieve this? It should be possible, right?
Edit 1:
I noticed that by changing "linters": "default_linters" to "linters": "assignment_linter", only the errors falling under assignment_linter will be picked. I tried to expand it using an array, but it doesn't work:
...
"lintr": {
"#disable": false,
"args": [],
"cache": "TRUE",
"excludes": [],
"linters": [
"assignment_linter",
"object_name_linter"
]
}
...
Inside the Sublime 3 console, the message error message with this attempt is: Error: unexpected '[' in "lint(cache = TRUE, commandArgs(TRUE), [".
Edit 2: possible solution
Looking at with_defaults inside the lintr package I found two ways of choosing only the linters I am interested in. Assuming that I only want assignment_linter and no_tab_linter, the configuration is:
"linters": "default_linters[c('assignment_linter', 'no_tab_linter')]" or
"linters": "with_defaults(assignment_linter, no_tab_linter, default = NULL)"
It works, but are there other less error-prone approaches? With this approach if I want to discard just one linter I have to list all the others.
Regarding your question for "Edit 2", you can discard a single linter as follows:
{
"user": {
"linters": {
"r": {
"linters": "with_defaults(some_default_linter = NULL)"
}
}
}
}
... where some_default_linter is the name of a linter from the list lintr::default_linters.