This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
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
-module(group_subscriber_sup). | |
-author("jzornig"). | |
-behaviour(supervisor). | |
-define(SERVER, ?MODULE). | |
-define(BROKER, "localhost"). | |
-define(BROKERPORT,9092). | |
-define(TOPIC,<<"test">>). | |
-define(CHILD_SPECS, | |
[ |
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
####################################################### | |
## this code was used in a Jupyter notebook | |
## therefore some jupyter specific lines are commented out | |
#%matplotlib inline | |
#%config InlineBackend.figure_format = 'retina' | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import torch |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: bucardo | |
# Required-Start: $remote_fs $syslog postgresql-9.3 | |
# Should-Start: postgresql-9.3 | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Manage bucardo | |
# Description: Start, stop, restart bucardo |
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
from turbodbc import connect, make_options, Error | |
## Provide connection details here | |
host = '' | |
database = '' | |
user = '' | |
password = '' | |
options = make_options(prefer_unicode=True) | |
connection = connect(connection_string='DRIVER={};SERVER={};DATABASE={};UID={};PWD={}'.format('{SQL Server}', host,database,user,password), turbodbc_options=options) |
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
import pyodbc | |
## Provide connection details here | |
host = '' | |
database = '' | |
user = '' | |
password = '' | |
connection = pyodbc.connect('DRIVER={};SERVER={};DATABASE={};UID={};PWD={}'.format('{SQL Server}', host,database,user,password)) | |
cursor = connection.cursor() |