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 | |
""" | |
Author: Sayantan Khan | |
Date: 8th September, 2014 | |
""" | |
import matplotlib.pyplot as plt | |
import random |
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
ALSA lib confmisc.c:768:(parse_card) cannot find card '0' | |
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory | |
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings | |
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory | |
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name | |
ALSA lib conf.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory | |
ALSA lib conf.c:4738:(snd_config_expand) Evaluate error: No such file or directory | |
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM default | |
Jan 01 07:09 : alsa_output: Failed to open "Pi Speakers" [alsa]: Failed to open ALSA device "default": No such file or directory | |
Jan 01 07:09 : output: Failed to open audio output |
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" |
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
#!/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/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
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
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
#!/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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
# C extensions | |
*.so | |
# Distribution / packaging | |
build/ | |
develop-eggs/ |