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
#include <stdio.h> | |
#include <string.h> | |
typedef char Digit; | |
typedef struct { | |
Digit digits[3]; | |
} Row; | |
typedef union { |
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 | |
# -*- coding:utf-8 -*- | |
position = lambda name: { | |
'a':(1, 2, 3), 'd':(7, 4, 1), 'g':(9, 8, 7), 'j':(3, 6, 9), | |
'b':(4, 5, 6), 'e':(8, 5, 2), 'h':(6, 5, 4), 'k':(2, 5, 8), | |
'c':(7, 8, 9), 'f':(9, 6, 3), 'i':(3, 2, 1), 'l':(1, 4, 7), | |
}[name] | |
def solve(data): |
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 | |
# -*- coding:utf-8 -*- | |
# | |
# Lyrics converter | |
# | |
# version: 2017.4.18 | |
# author: @shiracamus | |
# github: https://github.com/shiracamus/lyrics_converter | |
# | |
# Need to install mutagen module |
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 | |
# -*- coding:utf-8 -*- | |
from itertools import product | |
class Group: | |
def __init__(self, missionaries, cannibals): | |
self.missionaries = missionaries |
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
def divide_file(filePath, chunkSize): | |
def read(): | |
with open(filePath, 'rb') as f: | |
while True: | |
data = f.read(chunkSize) | |
if len(data) == 0: | |
return | |
yield data |
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
words = {1: 'One', 2: 'Two', 3: 'Three', 4: 'Four', 5: 'Five', 6: 'Six', | |
7: 'Seven', 8: 'Eight', 9: 'Nine', 10: 'Ten', 11: 'Eleven', | |
12: 'Twelve', 13: 'Thirteen', 14: 'Fourteen', 15: 'Fifteen', | |
16: 'Sixteen', 17: 'Seventeen', 18: 'Eighteen', 19: 'Nineteen', | |
20: 'Twenty', 30: 'Thirty', 40: 'Forty', 50: 'Fifty', 60: 'Sixty', | |
70: 'Seventy', 80: 'Eighty', 90: 'Ninety', 100: 'Hundred', | |
1000: 'Thousand', 1000000: 'Million', 1000000000: 'Billion'} | |
units = sorted(words, reverse=True) | |
def number2word(number): |
NewerOlder