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 sys, pygame | |
pygame.init() | |
class Gfx(object): | |
""" | |
This class takes care of drawing the state of the search to a window using pygame | |
""" | |
size = width, height = 960, 540 |
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
(1600,1200) | |
(0,0) (1346,260) | |
(18,50,330,918) | |
(46,960,184,172) | |
(220,1060,136,140) | |
(388,0,42,1178) | |
(246,984,156,56) | |
(500,938,194,262) | |
(606,166,402,622) | |
(1088,146,62,1028) |
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 sqlparse | |
from django.db import connection | |
from django.core.signals import request_finished | |
def finished(sender, **kwargs): | |
for query in connection.queries: | |
print "\n" + "(" + query['time'] + " s) " + sqlparse.format(query['sql'], reindent=True, keyword_case="upper") + "\n" | |
if len(connection.queries) > 0: | |
print "NUMBER OF DB QUERIES FOR THIS REQUEST:", len(connection.queries) | |
request_finished.connect(finished) |
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
sudo apt-get update | |
sudo apt-get -y dist-upgrade | |
# /boot/grub/menu.lst keep the local version. (or maybe not? replacing it could maybe be a good idea, and could avoid some of the hassle below) | |
sudo apt-get install -y gcc g++ gfortran build-essential git wget linux-image-generic libopenblas-dev python-dev python-pip python-nose python-numpy python-scipy linux-headers-generic-lts-trusty linux-source | |
# sudo apt-get install linux-headers-`uname -r` | |
sudo rm /boot/grub/menu.lst | |
sudo update-grub |
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
sudo apt-get update | |
sudo apt-get -y dist-upgrade | |
sudo apt-get install -y gcc g++ gfortran build-essential linux-image-generic libopenblas-dev python-nose python-numpy python-scipy linux-headers-generic-lts-trusty linux-source | |
sudo rm /boot/grub/menu.lst | |
sudo update-grub | |
wget http://developer.download.nvidia.com/compute/cuda/7_0/Prod/local_installers/cuda_7.0.28_linux.run |
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 matplotlib.pyplot as plt | |
import mlflow | |
import numpy as np | |
from sklearn import metrics | |
def plot_confusion_matrix( | |
cm, class_names, title="Confusion matrix", cmap=plt.cm.Blues, normalize=False | |
): | |
""" |
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 os | |
import re | |
import subprocess | |
import tempfile | |
import uuid | |
from pathlib import Path | |
import numpy as np | |
from scipy.io.wavfile import write |
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 script is meant to be used in a Homey Flow with the | |
* 'Run a script with an argument' in the 'And'-column. | |
* The argument must be the name of the device, then a less than or greater than character (< or >) and finally a number between 0 and 1, e.g. "Zip Nord Venstre<0.5" (note: no spaces around the < or > character!) | |
*/ | |
if (typeof args[0] !== 'string') { | |
throw new Error('This script must be run from a Flow!'); | |
} |
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 script is meant to be used in a Homey Flow as an 'And' card. | |
*/ | |
let sensorName = 'Relativ Strømpris' | |
log(`sensorName: ${sensorName}`); | |
// Get all devices | |
const devices = await Homey.devices.getDevices(); |
OlderNewer