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
# convert from webm to mp3 | |
ffmpeg -i input.webm output.mp3 | |
# split mp3 file to several audio files whose length is 3600s and the names of these files begin with out<id>.mp3 | |
ffmpeg -i out.mp3 -f segment -segment_time 3600 -c copy out%03d.mp3 |
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
from moviepy.editor import * | |
import moviepy.video.fx.all as vfx | |
clip = VideoFileClip('fname.mp4') | |
mclip = clip.fx(vfx.mirror_x) # all frame in clip will be mirrored in x-axis | |
mclip.write_videofile('mirror_fname.mp4') | |
################################################## | |
clip = VideoFileClip('fname.mp4') |
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
Arts & Entertainment | |
Aquarium | |
Arcade | |
Art Gallery | |
Bowling Alley | |
Casino | |
Circus | |
Comedy Club | |
Concert Hall | |
Country Dance Club |
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 urllib2 | |
import json | |
s = '{"data": [{"text": "I love Titanic."},{"text": "I hate Titanic."}]}' # 2 short text that we want to do sentiment analysis | |
response = urllib2.urlopen('http://www.sentiment140.com/api/bulkClassifyJson', s) # request to server | |
page = response.read() # get the response | |
print page # print the result |
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 bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <netj@sparcs.org> | |
# Created: 2010-08-16 | |
set -um | |
# check input | |
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; } |