This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static boolean validateXMLSchema(String xsdPath, String xmlPath){ | |
| try { | |
| SchemaFactory factory = | |
| SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); | |
| Schema schema = factory.newSchema(new File(xsdPath)); | |
| Validator validator = schema.newValidator(); | |
| validator.validate(new StreamSource(new File(xmlPath))); | |
| } catch (IOException | SAXException e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
| ; #Warn ; Enable warnings to assist with detecting common errors. | |
| SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
| SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
| #:: | |
| Send, ! | |
| !:: | |
| Send, # | |
| return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // these probably need some input checks | |
| // recursive | |
| private static Object getValue(Object baseArray, int dim, int[] coordinates) { | |
| if (dim + 1 >= coordinates.length) { | |
| return Array.get(baseArray, coordinates[dim]); | |
| } | |
| else { | |
| return getValue(Array.get(baseArray, coordinates[dim]), dim + 1, coordinates); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static ProcessorFactory compileSchema(final String schema) | |
| throws URISyntaxException, IOException { | |
| Compiler compiler = Daffodil.compiler(); | |
| ProcessorFactory factory = compiler.compileSource(Resources.getResource(schema).toURI()); | |
| if (factory.isError()) { | |
| factory.getDiagnostics() | |
| .forEach(diagnostic -> { | |
| LOGGER.error(diagnostic.getMessage(), diagnostic.getSomeCause()); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: 0.2 | |
| phases: | |
| install: | |
| commands: | |
| - pip install cfn-lint | |
| build: | |
| commands: | |
| - cfn-lint --template ./template.yaml --regions $AWS_REGION | |
| - aws cloudformation validate-template --template-body file://$(pwd)/template.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl 'https://findtreatment.samhsa.gov/locatorExcel' \ | |
| -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0' \ | |
| -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' \ | |
| -H 'Accept-Language: en-US,en;q=0.5' \ | |
| --compressed \ | |
| -H 'Content-Type: multipart/form-data; boundary=---------------------------11366494723913231758399599945' \ | |
| -H 'Origin: https://findtreatment.samhsa.gov' \ | |
| -H 'Connection: keep-alive' \ | |
| -H 'Referer: https://findtreatment.samhsa.gov/locator' \ | |
| -H 'Cookie: _ga=GA1.2.646319725.1548901673' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var x = g.V(new []{1, 2, 3}).BothE().OtherV().Path().By(__.ValueMap<object, Path>(true)).Range<Path>(0, 10).ToList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| g.E() | |
| .Union<IDictionary<object, object>>(__ | |
| .Project<object>("e", "v", "IN", "OUT") | |
| .By(__.Id()) | |
| .By(__.ValueMap<object, object>(true)) | |
| .By(__.InV().Union<object>(__.Id(), __.Label()).Fold()) | |
| .By(__.OutV().Union<object>(__.Id(), __.Label()).Fold())) | |
| .ToList() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Generic; | |
| using GraphStore.Models; | |
| using Gremlin.Net.Process.Traversal; | |
| using Gremlin.Net.Structure; | |
| using static Gremlin.Net.Process.Traversal.AnonymousTraversalSource; | |
| using static Gremlin.Net.Process.Traversal.__; | |
| using static Gremlin.Net.Process.Traversal.P; | |
| using static Gremlin.Net.Process.Traversal.Order; | |
| using static Gremlin.Net.Process.Traversal.Operator; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo yum install -y java-1.8.0-devel | |
| sudo /usr/sbin/alternatives --config java | |
| mkdir -p /opt/ | |
| wget https://archive.apache.org/dist/tinkerpop/3.4.1/apache-tinkerpop-gremlin-console-3.4.1-bin.zip | |
| mv apache-tinkerpop-gremlin-console-3.4.1-bin.zip /opt/ | |
| unzip /opt/apache-tinkerpop-gremlin-console-3.4.1-bin.zip | |
| cd apache-tinkerpop-gremlin-console-3.4.1 && wget https://www.amazontrust.com/repository/SFSRootCAG2.pem | |
| cat <<EOF > /opt/apache-tinkerpop-gremlin-console-3.4.1 | |
| hosts: [your-neptune-endpoint] | |
| port: 8182 |
NewerOlder