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
''' | |
README | |
To use this script you must have python and numpy installed. | |
Just download the script, open up the terminal and execute the | |
script as './interpolate.py -i' for the interactive mode | |
and './interpolate -f file' to use a file as the data source. | |
the file must be formatted as input/output pairs separated by a comma. | |
The script will print a list as output. The first number is the constant, |
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
#!/usr/bin/env python | |
from os import system | |
import sys, tty | |
import alsaaudio | |
system('export DISPLAY=:0') | |
mixer=alsaaudio.Mixer() |
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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
# C extensions | |
*.so | |
# Distribution / packaging | |
build/ | |
develop-eggs/ |
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
#!/usr/bin/env python3 | |
import threading | |
class led_thread(threading.Thread): | |
def run(self): | |
print('Doing led stuff') | |
#Other stuff | |
class listener_thread(threading.Thread): |
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 threading,time,urllib.request,queue | |
class fetcher(threading.Thread): | |
def __init__(self,print_lock,url_queue,threadId): | |
self.Id=threadId | |
self.print_lock=print_lock | |
self.url_queue=url_queue | |
threading.Thread.__init__(self) | |
def run(self): |
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 conversation(conversation_dict): | |
conversations=[i for i in conversation_dict] | |
for index,conv in enumerate(conversations): | |
print("{0}. {1}".format(index+1,conv)) | |
choice=int(input("What do you say (enter number)?")) | |
outcome=conversation_dict[conversations[choice-1]] | |
if not type(outcome)==dict: | |
outcome() | |
else: | |
conversation(outcome) |
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
#!/usr/bin/env python3 | |
""" | |
A script for duckdns | |
""" | |
import urllib.request | |
import time | |
INTERVAL=300 |
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
#!/usr/bin/env python3 | |
''' | |
A script to determine the lowest triangular number with over 500 divisors | |
''' | |
import math | |
class Memoize(object): |
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
#!/usr/bin/python3 | |
def generate_permutations(sequence): | |
if len(sequence)==1: | |
yield sequence | |
elif len(sequence)>1: | |
for index, item in enumerate(sequence): | |
for perm in generate_permutations(sequence[:index]+sequence[index+1:]): | |
yield [item]+perm |
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
music_directory "/mpd/Music" | |
playlist_directory "/mpd/conf/playlists" | |
db_file "/mpd/conf/database" | |
log_file "/mpd/conf/log" | |
pid_file "/mpd/conf/pid" | |
state_file "/mpd/conf/state" | |
sticker_file "/mpd/conf/sticker.sql" | |
user "mpd" | |
group "mpd" |
OlderNewer