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. Add ssh key to shh config: | |
Host github.com | |
IdentityFile C:\Users\XXX\.ssh\github_id_rsa | |
2. Auto-start OpenSSH Authentication Agent (via PowerShell as admin) | |
Set-Service ssh-agent -StartupType Automatic | |
3. Make git use Window's OpenSSH installation and not its own: |
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
def ihvp(f, w, v, n, alpha): | |
# calculate the inverse hessian vector product | |
# cast to list (this is important if w is a generator) | |
w = list(w) | |
p = tuple(list(v).copy()) | |
for j in range(n): | |
grads = torch.autograd.grad(f, w, grad_outputs=v, retain_graph=True) |
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 builtins as __builtin__ | |
import sys | |
import io | |
class VoidPrinter: | |
def __init__(self): | |
pass | |
def __enter__(self): | |
self._stdout_bkp = sys.stdout |
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
parent = ['heute', 'sitze', 'ich', 'hier', 'und', 'morgen', 'sitze', 'ich', 'auch', 'dort'] | |
child = ['sitze', 'ich', 'auch'] | |
def search(parent, child): | |
found = False | |
for i in range(len(parent)): | |
if parent[i] == child[0]: | |
found = True | |
for j, word in enumerate(child): | |
if word != parent[i+j]: |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:vm="clr-namespace:SMSIP2.ViewModels;" | |
xmlns:conv="clr-namespace:SMSIP2.Converters" | |
x:Class="SMSIP2.CourseListPage" | |
Title="{Binding Title}" | |
xmlns:helpers="clr-namespace:SMSIP2.Core.Helpers;assembly=SMSIP2.Core" | |
x:Name="BrowseItemsPage"> |
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
lst = [(123, 456, 789), (123, 465, 789), (125, 456, 734)] | |
import numpy as np | |
#get unique IDs | |
fstuniq = np.unique([x[0] for x in lst]) | |
snduniq = np.unique([x[1] for x in lst]) | |
trduniq = np.unique([x[2] for x in lst]) | |
print(fstuniq) | |
print(snduniq) |
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
C:\Users\*>pip install cupy --no-cache-dir -vvvv | |
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect | |
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect | |
Collecting cupy | |
1 location(s) to search for versions of cupy: | |
* https://pypi.python.org/simple/cupy/ | |
Getting page https://pypi.python.org/simple/cupy/ | |
Starting new HTTPS connection (1): pypi.python.org | |
"GET /simple/cupy/ HTTP/1.1" 200 930 | |
Analyzing links from page https://pypi.python.org/simple/cupy/ |
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
C:\Users\Roland\Desktop\tmp\gym>conda install pachi-py | |
Fetching package metadata ........... | |
PackageNotFoundError: Package missing in current win-64 channels: | |
- pachi-py | |
C:\Users\Roland\Desktop\tmp\gym> | |
C:\Users\Roland\Desktop\tmp\gym> | |
C:\Users\Roland\Desktop\tmp\gym> |
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
#improves the output of keras on Windows | |
import os | |
os.environ['TF_CPP_MIN_LOG_LEVEL']='3' | |
import tensorflow as tf | |
tf.logging.set_verbosity(tf.logging.ERROR) | |
import logging | |
logging.getLogger("tensorflow").setLevel(logging.WARNING) | |
import numpy as np | |
import keras as K |