Skip to content

Instantly share code, notes, and snippets.

Avatar
🕊️
Progressing

Marvin Hansen marvin-hansen

🕊️
Progressing
View GitHub Profile
View type-db-ml.notes.md

For the OSS / Single node

• Build two different TypDB Docker containers, one normal, and the other one with all major ML libraries embedded. These are: DGL.ai. Pytorch & MXNet & Tensorflow.

• Add a sample repo i.e. “Research” with the following workflow demonstrated in Python:

  • Connect to local TypeDB
  • Run Query
  • Transform results into NetworkX graph
View client_test.go
// Copyright (c) 2021. Marvin Friedrich Lars Hansen. All Rights Reserved. Contact: marvin.hansen@gmail.com
package web_socket
import (
"testing"
"time"
)
func TestNewWebSocketClient(t *testing.T) {
View Error
Second and all subsesquent runs throw a connection timeout error until the IB gateway has been restarted.
API connection failed: TimeoutError()
Traceback (most recent call last):
File "C:/Users/marvi/AppData/Roaming/JetBrains/PyCharm2020.2/scratches/ib-test.py", line 19, in <module>
ib.connect('127.0.0.1', 4003, clientId=49, timeout=7)
File "C:\Users\marvi\Anaconda3\envs\ib-monitor\lib\site-packages\ib_insync\ib.py", line 271, in connect
return self._run(self.connectAsync(
File "C:\Users\marvi\Anaconda3\envs\ib-monitor\lib\site-packages\ib_insync\ib.py", line 310, in _run
return util.run(*awaitables, timeout=self.RequestTimeout)
View Mapping.yaml
apiVersion: getambassador.io/v2
kind: Mapping
metadata:
annotations:
getambassador.io/resource-changed: 'true'
name: web
namespace: default
spec:
prefix: /web/
service: '10.0.1.75:80'
View Server-Auth-NO-GRAPHQL.py
from flask import Flask
from flask_httpauth import HTTPTokenAuth
from utils.AuthUtils import authenticate_token
app = Flask(__name__)
auth = HTTPTokenAuth(scheme='Basic')
@auth.verify_token
def verify_token(token):
@marvin-hansen
marvin-hansen / Error-msg.txt
Last active October 16, 2019 12:15
Python Zip File Upload
View Error-msg.txt
C:\Users\marvi\Anaconda3\python.exe C:/Users/marvi/PycharmProjects/DNL/ScratchFiles/Scratch_Upload.py
Traceback (most recent call last):
File "C:\Users\marvi\Anaconda3\lib\site-packages\urllib3\contrib\pyopenssl.py", line 304, in _send_until_done
return self.connection.send(data)
File "C:\Users\marvi\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1737, in send
self._raise_ssl_error(self._ssl, result)
File "C:\Users\marvi\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1639, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (10054, 'WSAECONNRESET')
@marvin-hansen
marvin-hansen / Feature Ranking.csv
Created March 26, 2019 19:08
Feature Ranking S&P 500
View Feature Ranking.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
close-1 0.999928
close-2 0.999861
close-3 0.999801
==
RSI-22 0.9988
RSI-12 0.997525
RSI-13 0.996789
RSI-21 0.996472
RSI-15 0.996436
RSI-14 0.996155
View gist:1fd4523ec3432cb5522c6e6013911301
Depended variable: "close"
Correlation Matrix
close close-delta ... TRIX-3 TRIX-4
close 1.000000 0.029377 ... 0.758351 0.792568
close-delta 0.029377 1.000000 ... 0.210154 0.317279
close-1 0.999928 0.017344 ... 0.611584 0.499947
close-2 0.999861 0.017645 ... 0.357971 0.152115
close-3 0.999801 0.015416 ... 0.050165 -0.228239
UP_BB 0.808487 0.342091 ... 0.942839 0.989947
@marvin-hansen
marvin-hansen / Auto-Regression.py
Last active March 21, 2019 11:56
Fast.ai notes
View Auto-Regression.py
#Lib versions
#Python Version: 3.6.7
#Pandas Version: 0.24.2
#Numpy Version: 1.16.2
#FastAI Version: 1.0.50.post1
#PyTorch Version: 1.0.1.post2
#GPU Acceleration
#GPU: NVDIA K80
@marvin-hansen
marvin-hansen / setup.sh
Last active October 31, 2017 03:56
Creates a fast.ai DL environment on Google Cloud
View setup.sh
# Preare disk
# Here sdb is the device ID I get from lsblk
# Uncomment if you want to use a shared disk.
# Details on: # https://cloud.google.com/compute/docs/disks/add-persistent-disk
# You can add a persistent disk already when creating a computing instnance
#echo "Format Disk"
#sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb
#sudo mkdir -p /mnt/disks/data
#echo "Mount Disk"