- type of
stopchannel tobool, less bytes? - graceful shutdown of the cron instance
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 sys | |
| import math | |
| import random | |
| """ | |
| Point clustering using Python [http://moderndata.plot.ly/point-clustering-in-python/] | |
| This is an improved version of the KMeans Clustering Algorithmn | |
| Which was originally implemented by 'Ian Danforth'. | |
| [Reference: https://gist.github.com/iandanforth/5862470] |
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
| [{"eventId": "6", "visitor": {"abbreviation": "CHA", "players": [{"playerid": 101107, "lastname": "Williams", "jersey": "2", "firstname": "Marvin", "position": "F"}, {"playerid": 203087, "lastname": "Lamb", "jersey": "3", "firstname": "Jeremy", "position": "G"}, {"playerid": 201587, "lastname": "Batum", "jersey": "5", "firstname": "Nicolas", "position": "G-F"}, {"playerid": 202391, "lastname": "Lin", "jersey": "7", "firstname": "Jeremy", "position": "G"}, {"playerid": 1626151, "lastname": "Harrison", "jersey": "9", "firstname": "Aaron", "position": "G"}, {"playerid": 202689, "lastname": "Walker", "jersey": "15", "firstname": "Kemba", "position": "G"}, {"playerid": 203798, "lastname": "Hairston", "jersey": "19", "firstname": "PJ", "position": "F-G"}, {"playerid": 203148, "lastname": "Roberts", "jersey": "22", "firstname": "Brian", "position": "G"}, {"playerid": 203584, "lastname": "Daniels", "jersey": "30", "firstname": "Troy", "position": "G"}, {"playerid": 203469, "lastname": "Zeller", "jersey": "40", "first |
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
| /* | |
| Hide radio button (the round disc) | |
| we will use just the label to create pushbutton effect | |
| */ | |
| input[type=radio] { | |
| display:none; | |
| margin:10px; | |
| } | |
| /* |
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
| document.addEventListener('DOMContentLoaded', function() { | |
| document.querySelectorAll('label')[0].classList.add('button-press'); | |
| document.addEventListener('click', function(e) { | |
| var e = e || window.event, | |
| target = e.target || e.srcElement, | |
| text = target.textContent || target.innerText; | |
| if (target.tagName.toLowerCase() == 'label') { | |
| var labels = document.querySelectorAll("label"); |
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
| # | |
| # Setup the Docker repository | |
| # | |
| echo "update apt package index" | |
| sudo apt-get update | |
| echo "allow apt to use HTTPS" | |
| sudo apt-get install \ | |
| apt-transport-https \ |
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 cv2 | |
| import pyautogui | |
| # using a screen size specific region | |
| screen = pyautogui.screenshot(region=(200, 100, 1000, 700)) | |
| screen_img_gray = cv2.cvtColor(np.array(screen), cv2.COLOR_RGB2GRAY) |
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 cv2 | |
| import numpy as np | |
| # load and find the dimension attritbutes of the template image | |
| template_img = cv2.imread('./gray-template.png', 0) | |
| w, h = template_img.shape[::-1] | |
| # OpenCV's template matching method | |
| res_img = cv2.matchTemplate( | |
| screen2, template_img, cv2.TM_CCOEFF_NORMED |
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 pytesseract | |
| image_text = pytesseract.image_to_string(cropped_image) |
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 gensim.models.keyedvectors import KeyedVectors | |
| # load local word2vec model | |
| model = KeyedVectors.load_word2vec_format( | |
| os.getenv('SEMANTRIS_SOLVER_WORD2VEC_PATH'), | |
| binary=True | |
| ) | |
| # list of tuples containing the word and similarity score | |
| associated_word_tuples = model.most_similar(word, topn=20) |