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
#!/usr/bin/env python | |
import pytesseract | |
import Image | |
import cv2 | |
# some func | |
def click_prt_pix_color(event, x, y, flags, param): | |
if event == cv2.EVENT_LBUTTONDOWN: | |
print('pixel(%d, %d) color is %s' % (x, y, img[y, x])) |
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
#!/usr/bin/env python2 | |
import numpy as np | |
# sigmoid function (return 0.0 to 1.0 for -inf to +inf value) | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
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
#!/usr/bin/env python3 | |
import os | |
import sys | |
if __name__ == '__main__': | |
for line in sys.stdin: | |
sys.stdout.write(line) | |
if 'keyword1' in line: | |
print('play bip 1') |
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
#!/usr/bin/env python3 | |
# particle simulator on python3 with tk | |
import tkinter as tk | |
import math | |
class Particle(object): | |
def __init__(self, x, y, size=2, color='saddle brown'): |
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
#!/usr/bin/python3 | |
# detect tones in sound spectrum with scipy FFT | |
# here sound source is a USB microphone with ALSA (channel 1) | |
from collections import deque | |
import struct | |
import sys | |
import time | |
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
#!/usr/bin/env python3 | |
# tree grow simulator on python3 with tk | |
import tkinter as tk | |
from random import randint | |
from enum import Enum | |
class TreePart(Enum): |
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
#!/usr/bin/env python3 | |
import http.client | |
import dateutil.parser | |
import datetime | |
import time | |
import json | |
ZERO = datetime.timedelta(0) |
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
#!/usr/bin/env python3 | |
from tkinter import * | |
from random import randint | |
from collections import deque | |
from itertools import chain | |
class CanGraph(Canvas): | |
def __init__(self, master, **options): |
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
#!/usr/bin/env python3 | |
import http.client | |
import json | |
connection = http.client.HTTPConnection('localhost', port=5000) | |
headers = {'Content-type': 'application/json'} | |
connection.request('GET', '/set/foo?value=474', headers=headers) | |
response = connection.getresponse().read() |
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
<!DOCTYPE html> | |
<?php | |
require 'Predis/Autoloader.php'; | |
Predis\Autoloader::register(); | |
$r = new Predis\Client(); | |
?> | |
<html> | |
<head> | |
<title>Test REDIS</title> | |
</head> |