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 requests | |
import shutil | |
divids = ['101', '102', '103', '104', '105', '106', '107', '108', '109', '111', '112', '113', '114', '115', '117', | |
'118', '119', '120', '121', '122', '124', '125', '126', '127', '128', '130', '131', '132', '133', '134', | |
'135', '136', '137', '138', '139', '140', '144', '145', '146', '148', '149', '150', '151', '152', '153', | |
'155', '156', '157', '158', '159', '160', '161', '162', '163', '164', '165', '166', '167', '168', '169', | |
'170', '171', '172', '173', '174', '175', '176', '177', '178', '179', '180', '182', '183', '185', '186', | |
'187', '188', '189', '190', '191', '192', '193', '194', '195', '196', '197', '198', '199', '200', '201', | |
'203', '204', '205', '207', '208', '209', '210', '211', '212', '213', '214', '215', '216', '217', '218', |
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
# pip install eyeD3 | |
import eyed3 | |
from eyed3 import mp3 | |
f = mp3.Mp3AudioFile('2-297a587f40fdc0064c44f2e5247d7bf7.mp3') | |
# Now: | |
# >>> f.info.sample_freq | |
# 24000 | |
# >>> f.info.bit_rate |
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
function sieveOfAtkin(limit){ | |
var limitSqrt = Math.sqrt(limit); | |
var sieve = []; | |
var n; | |
//prime start from 2, and 3 | |
sieve[2] = true; | |
sieve[3] = true; | |
for (var x = 1; x <= limitSqrt; 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
[DesignerGenerated] | |
public class Form1 : Form | |
{ | |
// Fields | |
[AccessedThroughProperty("AboutToolStripMenuItem")] | |
private ToolStripMenuItem _AboutToolStripMenuItem; | |
[AccessedThroughProperty("AudioToolStripMenuItem")] | |
private ToolStripMenuItem _AudioToolStripMenuItem; | |
[AccessedThroughProperty("CloseToolStripMenuItem")] | |
private ToolStripMenuItem _CloseToolStripMenuItem; |
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 SimpleHTTPServer | |
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def send_head(self): | |
"""Common code for GET and HEAD commands. | |
This sends the response code and MIME headers. | |
Return value is either a file object (which has to be copied | |
to the outputfile by the caller unless the command was HEAD, | |
and must be closed by the caller under all circumstances), or |
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 | |
'''A script to calculate adler32 checksum of given files''' | |
BLOCKSIZE=256*1024*1024 | |
import sys | |
from zlib import adler32 | |
for fname in sys.argv[1:]: | |
asum = 1 | |
with open(fname,"rb") as f: |
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 os | |
from PIL import Image | |
def extractFrames(inGif, outFolder): | |
frame = Image.open(inGif) | |
nframes = 0 | |
while frame: | |
frame.save( '%s/%s-%s.gif' % (outFolder, os.path.basename(inGif), nframes ) , 'GIF') | |
nframes += 1 |