Play application.conf : Where to consult the list of all possible variable? - playframework-2.3

Where can i find the list of all possible variable that is possible to set in play application.conf ?
I can't find this information on playframework website.
Thank you

If you use IDE such as eclipse or IntelliJ, you can inspect Play.application().configuration() at runtime while debugging and it will contain all possble configuration key/value pairs. It briefly looks as follows:
{
"akka":{ },
"application":{ },
"applyEvolutions":{ },
"awt":{ },
"db":{ },
"dbplugin":"disabled",
"evolutionplugin":"enabled",
"file":{ },
"java":{ },
"jline":{ },
"line":{ },
"logger":{ },
"os":{ },
"path":{ },
"play":{ },
"promise":{ },
"report":{ },
"sbt":{ },
"sun":{ },
"user":{ }
}

There is no such list of all possible variables, since the application.conf is arbitrarily extensible by all sorts of tools and components, most of them third party, and can contain any config the user wants.
For example: the configuration detailing Play's thread pools is really just Akka configuration.
The key things (DB config, languages, evolutions) are in the template, either with default values or commented out, when you initialise a new Play application.
The config page on the site discusses some additional configuration you might need, but this mostly relates to concerns external to the application, like launching and logging.

Related

How do I modify parameters in a Container Overrides section of a Step Functions machine?

I have a Step Functions Machine the definition file of which looks as such:
"ContainerOverrides": [
{
"Name": "Foo",
"Environment": [
{
"Name": "Foo"
"Value": "Bar"
},
],
"Command.$": "States.Array($.Foo,$.Foo,$.Bar,$.Bar,$.Bar)"
}
]
},
that I am trying to rewrite into Typescript (CDK). I've gotten the following few lines.
containerOverrides: [{
containerDefinition: Foo,
environment: [
{ name: 'Foo', value: 'Bar'},
],
command: ['States.Array($.Foo,$.Foo,$.Bar,$.Bar,$.Bar)'],
}],
I'm a bit confused about how to go about this.
When I deploy the above CDK code, I get as output:
"Command": [
"States.Array($.Foo,$.Foo,$.Bar,$.Bar,$.Bar)"
],
My confusion is in regards to the following: The ContainerOverrides method doesn't accept parameters, but I need to modify a parameter (Command.$), so how can I possibly do that? I came across this post where somebody seems to have a similar issue, but when I try to apply the proposed solution, of simply writing
command: JsonPath.arrayAt('States.Array($.Foo,$.Foo,$.Bar,$.Bar,$.Bar)'
I get told that ''Cannot use JsonPath fields in an array, they must be used in objects''
TL;DR The current implementation of EcsRunTask doesn't permit this. The general-purpose CallAwsService construct does.
The EcsRunTask construct is the CDK's implementation of the ECS optimised integration. The construct only accepts an array of strings as override commands. It cannot produce substitutable output like "Command.$": "$.commands" that's needed to read the override command from the execution input. This is a limitation of the CDK implementation, not of the ECS optimized integration itself.
The cleanest solution is to use the CallAwsService construct, which implements the SDK service integration. It requires manual configuration. The API-specific config goes in the parameters prop. The prop is loosely typed as { [string]: any }. It's flexible, but it's your job to provide the expected syntax for the ecs:RunTask SDK call. Here is the relevant bit for your question:
parameters {
Overrides: {
ContainerOverrides: [
{ Command: sfn.JsonPath.array("sh", "-c", sfn.JsonPath.stringAt("$.cmd")), },
],
},
}
It produces the expected command override in the Step Functions task definition:
"Command.$": "States.Array('sh', '-c', $.cmd)"

Can't get intellisense working for Windows Terminal settings.json

I am trying to enable intelli-sense when I am editing the settings.json of the Windows Terminal. When this file is open auto-complete mostly does not work. I can seemingly get some suggestions, but it definitely does not include everything in the schema. For example, If i go to add a new command, man listed in schema , like 'newTab' to do pop up as possible options, unlike in this video: https://www.youtube.com/watch?v=NfgAOxfv0QU
schema is "https://aka.ms/terminal-profiles-schema",
I see an "unable to resole schema. Click to Retry" error in the bottom tray of VSCode. I can click to retry but nothing happens.
the $schema property has a squiggle underneath it that says "Draft 2019-09 schemas are not fully supported"
my settings.json looks like this (the default i think)
{
"json.schemas": [
{
"fileMatch": [
"/myfile"
],
"url": "schemaURL"
}
],
"[json]": {
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
}
}
More specifically, I DO get suggestions from the schema here:
"profiles":
{
"list":
[
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"colorScheme": "Campbell Powershell",
"padding": "8, 8, 8, 8" //suggestions work here
},
But NOT here:
"actions":
[
{"command": "xxx", "keys":"zzz"} // no completion suggestions here
]
In neither case do I see squigglies under properties that are not in the scheme (e.g. if I mistype padding above)
It appears you're facing a known issue which has been raised here https://github.com/microsoft/vscode/issues/98724. This issue is still open.
A duplicate issue contains a work around however, which may be worth trying - https://github.com/microsoft/terminal/issues/7683.
"https://github.com/microsoft/terminal/raw/e504bf21402bca34e45863370aad9fefd543c292/doc/cascadia/profiles.schema.json". That was the last version before the schema was upgraded to draft 2019-09. If you change the schema URL like that, I think it will avoid the Draft 2019-09 schemas are not yet fully supported warning in Visual Studio Code...
Further down a user reports the workaround was successful for them.
Consider voting the GitHub issue!

Trying to punch sheep again

I am unfamiliar with json code outside of making Minecraft models. I am trying to add back the old functionality of punching sheep for wool via a behavior pack for windows 10 edition. This is what I tried adding to the events section.
"minecraft:on_hurt_by_player": {
"spawn_items": { "table": "loot_tables/entities/sheep_shear.json" },
"event": "minecraft:on_sheared",
"target": "self"
},
and
"minecraft:on_hurt_by_player": {
"spawn_items": { "table": "loot_tables/entities/sheep_shear.json" },
"on_hurt_by_player"{
"event": "minecraft:on_sheared",
"target": "self"
}
},
I must be missing something. The instruction I have found is so vague and it's not like Microsoft has an open source code to scour either.
minecraft:on_hurt_by_player is not a valid trigger condition.
Vanilla does not supply this loot condition, nor anything that would approximate it, so it is unlikely that you will be able to accomplish your change without writing some Java.

getDegree()/isOutgoing() funcitons don't work in graphAware/neo4j-to-elasticsearch mapping.json

Neo4j Version: 3.2.2
Operating System: Ubuntu 16.04
I use getDegree() function in mapping.json file, but the return would always be null; I'm using the dataset neo4j tutorial Movie/Actor dataset.
Output from elasticsearch request
mapping.json
{
"defaults": {
"key_property": "uuid",
"nodes_index": "default-index-node",
"relationships_index": "default-index-relationship",
"include_remaining_properties": true
},
"node_mappings": [
{
"condition": "hasLabel('Person')",
"type": "getLabels()",
"properties": {
"getDegree": "getDegree()",
"getDegree(type)": "getDegree('ACTED_IN')",
"getDegree(direction)": "getGegree('OUTGOING')",
"getDegree('type', 'direction')": "getDegree('ACTED_IN', 'OUTGOING')",
"getDegree-degree": "degree"
}
}
],
"relationship_mappings": [
{
"condition": "allRelationships()",
"type": "type",
}
]
}
Also if I use isOutgoing(), isIncoming(), otherNode function in relationship_mappings properties part, elasticsearch would never load the relationship data from neo4j. I think I probably have some misunderstanding of this sentence only when one of the participating nodes "looking" at the relationship is provided on this page https://github.com/graphaware/neo4j-framework/tree/master/common#inclusion-policies
mapping.json
{
"defaults": {
"key_property": "uuid",
"nodes_index": "default-index-node",
"relationships_index": "default-index-relationship",
"include_remaining_properties": true
},
"node_mappings": [
{
"condition": "allNodes()",
"type": "getLabels()"
}
],
"relationship_mappings": [
{
"condition": "allRelationships()",
"type": "type",
"properties": {
"isOutgoing": "isOutgoing()",
"isIncomming": "isIncomming()",
"otherNode": "otherNode"
}
}
]
}
BTW, is there any page that list all of the functions that we can use in mapping.json? I know two of them
github.com/graphaware/neo4j-framework/tree/master/common#inclusion-policies
github.com/graphaware/neo4j-to-elasticsearch/blob/master/docs/json-mapper.md
but it seems there are more, since I can use getType(), which hasn't been listed in any of the above pages.
Please let me know if I can provide any further help to solve the problem
Thanks!
The getDegree() function is not available to use, in contrary to getType(). I will explain why :
When the mapper (the part responsible to create a node or relationship representation as ES document ) is doing its job, it receive a DetachedGraphObject being a detached node or relationship.
The meaning of detached is that it is happening outside of a transaction and thus query operations are not available against the database anymore. The getType() is available because it is part of the relationship metadata and it is cheap, however if we would want to do the same for getDegree() this can be seriously more costly during the DetachedObject creation (which happen in a tx) depending on the number of different types etc.
This is however something we are working on, by externalising the mapper in a standalone java application coupled with a broker like kafa, rabbit,.. between neo and this app. We would not, however offer the possibilty to requery the graph in the current version of the module as it can have serious performance impacts if the user is not very careful.
As last, the only suggestion I can give you is to keep a property on your node with the updates of degrees you need to replicate to ES.
UPDATE
Regarding this part of the documentation :
For Relationships only when one of the participating nodes "looking" at the relationship is provided:
This is used only when not using the json definition, so you can use one or the other. the json definition has been added later as addition and both cannot be used together.
For answering this part, it means that the nodes of the incoming or outgoing side, depending on the definition, should be included in the inclusion policy for nodes, like hasLabel('Employee') || hasProperty('form') || getProperty('age', 0) > 20 . If you have an allNodes policy then it is fine.

export whole Neo4j database / cypher result to GraphJSON

I´ve already had a look at different post like this and this but nothing seems to be answered 100%.
My current problem is, that I want to visualyze - and ideally - analyze my Neo4j-Graph with a library (or software/tool).
The database-server is running on a remote (virtual) server and it seems that there is no chance to export the database to a format where I can work on with.
I´ve tried exporting the graph in a .graphml-file to import this file in Gephi, but Gephi doesn´t find the properties. Gephi-streaming with apoc-procedures and the graph-streaming plugin also does not work, because it´s a remote server (also with the tool mentioned here).
Now I´m currently testing around with Alchemy.js... So far, so good. But as it seems there´s no way to export the graph/query to the GraphJson-format?
Is there really no "easy" way to export the data?
Thanks for your help in advance!
This is how I would proceed
Run this query from the post you mentioned in the Neo4j Browser or in any bolt driver:
MATCH (a)-[r]->(b)
WITH collect(
{
source: id(a),
target: id(b),
caption: type(r)
}
) AS edges
RETURN edges
Now that you have loaded the data, you can simply download it as JSON using download button.(if you are using bolt driver ignore)
Either you manually downloaded JSON from Neo4j Browser or you are using bolt driver, you will end up with something like this.
{
"columns": [
"edges"
],
"data": [
{
"row": [
[
{
"source": 31288,
"target": 152,
"caption": "HAS_PAYMENT_METHOD"
}
]
],
"meta": [
null
],
"graph": {
"nodes": [
],
"relationships": [
]
}
}
]
Now all you have to is to filter out data.row results and you are done. Probably using bolt driver is the better choice as you have to clean up data anyway and it doesnt run into issues with returning a lots of data to the browser(it might crash).
Update: added python version
from neo4j.v1 import GraphDatabase
driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "neo4j"))
session = driver.session()
result = session.run("MATCH (a)-[r]->(b) WITH collect({source: id(a),target: id(b),caption: type(r)}) AS edges RETURN edges")
for record in result:
print(record["edges"])
Hope this helps