/>
小さな工夫と発見の蓄積
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
avconv -vn -i hoge.mp4 -f mp3 -b:a 64k hoge.mp3
avconv -vn -i hoge.mp4 -f mp3 -q:a 9 hoge.mp3
for file in *.[mM][pP]4; do avconv -y -vn -i "$file" -f mp3 -b:a 64k "${file%.*}.mp3"; done for file in *.[mM][pP]4; do avconv -y -vn -i "$file" -f mp3 -q:a 9 "${file%.*}.mp3"; done
find -type f -name "*.mp4" -print0 | xargs -0 -n 1 -i avconv -y -vn -i {} -f mp3 -b:a 64k {}.mp3 find -type f -name "*.mp4" -print0 | xargs -0 -n 1 -i avconv -y -vn -i {} -f mp3 -q:a 9 {}.mp3
library(ggplot2) library(reshape2) x <- read.csv('http://blog.cnobi.jp/v1/blog/user/ca2e456143c0d20195537cc5daa5fd14/1399760770', sep='\t', as.is=T) z <- read.csv('http://blog.cnobi.jp/v1/blog/user/ca2e456143c0d20195537cc5daa5fd14/1399761108', sep='\t', as.is=T, header=F) fit <- loess(rent ~ lon + lat, data=x, span=0.5) gd <- 100 lon <- seq(min(x$lon), max(x$lon), length=gd) lat <- seq(min(x$lat), max(x$lat), length=gd) D <- expand.grid(lon=lon, lat=lat) v <- melt(predict(fit, D), value.name='rent') v$lon <- as.numeric(gsub('lon=', '', v$lon)) v$lat <- as.numeric(gsub('lat=', '', v$lat)) p <- ggplot(v, aes(lon, lat, z=rent)) p + geom_point(aes(col=rent), linetype='blank', size=5, shape=15) + stat_contour(bins=10, col='white', size=1.2) + stat_contour(bins=10) + geom_line(data=z, aes(V4, V3, z=V3), size=2, col='lightgreen') + geom_line(data=z, aes(V4, V3, z=V3), size=1.2, color='coral4') + geom_text(data=z, aes(V4, V3, z=V3, label=V1), size=5.12, col='white', fontface=2) + geom_text(data=z, aes(V4, V3, z=V3, label=V1), fontface=2, size=5) + scale_colour_gradientn(colours=rich.colors(10)) p + geom_tile(aes(fill=rent)) + stat_contour(bins=10, col='white', size=1.2) + stat_contour(bins=10) + geom_line(data=z, aes(V4, V3, z=V3), size=2, col='lightgreen') + geom_line(data=z, aes(V4, V3, z=V3), size=1.2, color='coral4') + geom_text(data=z, aes(V4, V3, z=V3, label=V1), size=5.12, col='white', fontface=2) + geom_text(data=z, aes(V4, V3, z=V3, label=V1), fontface=2, size=5) + scale_fill_gradientn(colours=rich.colors(10))
l = [] d = {} t = () type(l), type(d), type(t) isinstance(l, list), isinstance(l, dict), isinstance(l, tuple) isinstance(d, list), isinstance(d, dict), isinstance(d, tuple) isinstance(t, list), isinstance(t, dict), isinstance(t, tuple)Output:
<type 'list'> <type 'dict'> <type 'tuple'> True False False False True False False False Trueクラスのインスタンスの場合、type()は"instance"と判別されるが、isinstance()は上と同様に機能するようだ。
class Hoge: def __init__(self): pass h = Hoge() type(h) isinstance(h, Hoge)Output:
<type 'instance'> True