This file contains 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
DROP SCHEMA IF EXISTS playground CASCADE; | |
CREATE SCHEMA IF NOT EXISTS playground; | |
CREATE DOMAIN playground.isbn AS text CONSTRAINT valid_isbn CHECK (VALUE ~ '^\d{1,5}-\d{1,7}-\d{1,7}-\d{1}$'); | |
CREATE DOMAIN playground.urn_isbn AS text CONSTRAINT valid_urn_isbn CHECK (VALUE ~ '^urn:ISBN:\d{1,5}-\d{1,7}-\d{1,7}-\d{1}$'); | |
CREATE OR REPLACE FUNCTION playground.extract_isbn(isbn, urn_isbn) | |
RETURNS BOOL | |
AS $$ | |
BEGIN |
This file contains 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; | |
using System.Text.RegularExpressions; | |
record ProductId | |
{ | |
public string URN { get; } | |
private static readonly string URNPattern = @"^urn:ISBN:\d{1,5}-\d{1,7}-\d{1,7}-\d{1}$"; | |
public ProductId(string urn) |
This file contains 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
CREATE OR REPLACE FUNCTION walk_graph(param_node_id INTEGER) | |
RETURNS TABLE (id INTEGER) | |
LANGUAGE plpgsql | |
AS $$ | |
DECLARE | |
var_node_ids INTEGER[] := ARRAY[param_node_id]; | |
var_iteration_node_ids INTEGER[] := ARRAY[param_node_id]; | |
BEGIN | |
WHILE array_length(var_iteration_node_ids, 1) > 0 LOOP |
This file contains 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
DROP TABLE IF EXISTS edges, nodes; | |
CREATE TABLE nodes | |
( | |
id INTEGER PRIMARY KEY | |
); | |
CREATE TABLE edges | |
( | |
"from" INTEGER NOT NULL REFERENCES nodes(id), |
This file contains 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
{ | |
"currentServiceTime": "2007-12-24T18:21Z", | |
"serviceName": "MyService", | |
"hostname": "host123.somedomain", | |
"deployed Version": "1.2.3-24534535", | |
"integrationPoints": [ | |
{ | |
"id": "POSTGRES_APPDONAIN_CORE", | |
"type": "database", | |
"host": "pgsql2.somedomain", |
This file contains 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
{ | |
"type": "IntegrationPointFailure", | |
"subtype": "ConnectionIssue", | |
"detail": { | |
"type": "kafka", | |
"host": "broker1.kafka. somedomain ", | |
"status": "SOLVED", | |
"issueBegin": "2007-12-24T18:21Z", | |
"issueEnd": "2007-12-24T18:21Z", | |
"codeReference": { |
This file contains 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
{ | |
"type": "IntegrationPointFailure", | |
"subtype": "ConnectionIssue", | |
"detail": { | |
"type": "kafka", | |
"host": "broker1.kafka.somedomain", | |
"status": "OPEN", | |
"issueBegin": "2007-12-24T18:21Z", | |
"codeReference": { | |
"file": "MyKafkaSuperService.java", |
This file contains 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
SELECT '123' <-> '123abcd', '123abcd' | |
UNION | |
SELECT '123' <-> 'a123bcd', 'a123bcd' | |
UNION | |
SELECT '123' <-> 'ab123cd', 'ab123cd' | |
UNION | |
SELECT '123' <-> 'abcd123', 'abcd123' | |
?column? |?column?| | |
---------+--------+ |
This file contains 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
pilgram,1050 | |
Pilgramgasse, 1050 Wien 0.5 <---- | |
U-Bahn Station Pilgramgasse, 1050 Wien 0.7586207 | |
Pilgramgasse, 1050 Wien 0.46153843 <---- | |
U-Bahn Station Pilgramgasse, 1050 Wien 0.7407408 | |
=============== |
This file contains 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
1 sensor = dev.V().has("Sensor", "sensor_name", "1002688"). | |
2 next() | |
3 dev.V(sensor). // look up a sensor | |
4 until(hasLabel("Tower")). // until you reach a tower | |
5 repeat(out("send"). // keep walking out the send edge | |
6 simplePath()) // remove cycles |
NewerOlder