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
| import requests | |
| from multicorn import ForeignDataWrapper | |
| from multicorn.utils import log_to_postgres, ERROR | |
| __author__ = "Ernst-Georg Schmid" | |
| __copyright__ = "Copyright (c) 2019 Ernst-Georg Schmid" | |
| __license__ = "PostgreSQL" | |
| __version__ = "2.0" | |
| class OWMForeignDataWrapper(ForeignDataWrapper): |
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
| from vectors import Vector | |
| from math import atan2 | |
| v1 = Vector(70.47130647130646,93.56190476190476,316.37118437118437) # Schreibtisch | |
| v2 = Vector(73.91990231990232,96.26080586080586,328.06642246642247) # Schreibtisch + 20 h | |
| v3 = Vector(-87.71428571428571,-183.37533577533577,-63.27423687423687) # Fenster | |
| m1 = v1.magnitude() | |
| m2 = v2.magnitude() | |
| m3 = v3.magnitude() |
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
| import time | |
| import struct | |
| import os | |
| import uuid | |
| import json | |
| from boto3 import resource | |
| from boto3.dynamodb.conditions import Key | |
| from bluepy.btle import UUID, Peripheral, Scanner | |
| from decimal import Decimal | |
| from datetime import datetime |
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
| CREATE EXTENSION IF NOT EXISTS plpython3u; | |
| CREATE OR REPLACE FUNCTION py_create_ed25519_keypair () | |
| RETURNS text[] | |
| AS $$ | |
| import axolotl_curve25519 as curve | |
| import os | |
| import base64 | |
| randm32 = os.urandom(32) |
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
| DROP TYPE public.fraction CASCADE; | |
| CREATE TYPE public.fraction AS | |
| (z numeric(1000,0), | |
| n numeric(1000,0)); | |
| CREATE OR REPLACE FUNCTION frac_make_fraction(z NUMERIC(1000,0), n NUMERIC(1000,0)) | |
| RETURNS fraction AS $$ | |
| declare retval fraction; | |
| BEGIN |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Sun Nov 13 00:00:06 2016 | |
| @author: ergo | |
| """ | |
| import select | |
| import psycopg2 | |
| import psycopg2.extensions | |
| import threading |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Sun Nov 13 00:00:06 2016 | |
| @author: ergo | |
| """ | |
| import select | |
| import psycopg2 | |
| import psycopg2.extensions |
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
| from multicorn import ForeignDataWrapper | |
| import urllib2 | |
| class SoilGridsForeignDataWrapper(ForeignDataWrapper): | |
| def __init__(self, options, columns): | |
| super(SoilGridsForeignDataWrapper, self).__init__(options, columns) | |
| def execute(self, quals, columns): |
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
| from multicorn import ForeignDataWrapper | |
| import json | |
| import urllib2 | |
| class SoilGridsForeignDataWrapper(ForeignDataWrapper): | |
| def __init__(self, options, columns): | |
| super(SoilGridsForeignDataWrapper, self).__init__(options, columns) | |
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
| INSERT INTO plr_modules VALUES (0, 'library(e1071)'); | |
| INSERT INTO plr_modules VALUES (1, 'mysvm <- readRDS("mysvm.RDS")'); |