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
#include <iostream> | |
#include <future> | |
#include <vector> | |
#include <random> | |
#include <ctime> | |
#include <cstdlib> | |
#include <future> | |
#include "stopwatch.hpp" |
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
Dir.glob('**/*.{mp3,MP3}') do |file| | |
str = `ffmpeg -i "#{file.gsub(/"/, '\"')}" 2>&1 >/dev/null` | |
m = str.match(/title\s+:\s+(.+)$/) | |
m2 = str.match(%r|track\s+:\s+(\d+)(?:/\d+)?$|) | |
if m && m2 | |
renamename = "%02d-#{m[1]}.mp3" % m2[1].to_i | |
File.rename(file, renamename) | |
end | |
end |
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
Dir.glob('*.mp3') do |file| | |
t = `ffmpeg -i "#{file}" 2>&1 | awk '$1=="track"{print $3}'`.strip | |
next if t.empty? | |
m = /^.+? - (.+)$/.match(file) | |
n = "%02d-#{m[1]}" % t.to_i | |
File.rename(file, n) | |
end |
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
#include <windows.h> | |
#include <psapi.h> | |
#include <string> | |
#include <cstring> | |
#include <iostream> | |
#include <random> | |
#include <ctime> | |
#include <algorithm> | |
#include <vector> | |
#include <cstdlib> |
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
i = 0 | |
j = 1000000 | |
k = 1000157 | |
Dir.glob('*.JPG').sort.sort_by{|v| [File.mtime(v), i += 1]}.map do |v| | |
filename = sprintf('%d.JPG', j += 1) | |
File.rename(v, filename) | |
filename | |
end.each do |v| | |
File.rename(v, sprintf('P%d.JPG', k += 1)) | |
end |
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
#define UNICODE | |
#define _UNICODE | |
#include <windows.h> | |
#include <string> | |
#include <sstream> | |
#include <iomanip> | |
#include <cstdlib> | |
#include <boost/format.hpp> | |
#include <boost/optional.hpp> |
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
# encoding: UTF-8 | |
# 写真の焦点距離を読み込んで適当に出力(ExifTools必須) | |
THREAD_NUM = 4 | |
dirname = (ARGV.length < 1 ? '.' : ARGV[0]) + '/**/*' | |
filereg = ARGV.length < 2 ? /\.jpe?g$/i : Regexp.new(ARGV[1], Regexp::IGNORECASE) | |
filelist = Dir.glob(dirname).reject{|name| !(File.file?(name) && File.basename(name) =~ filereg)} |
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
# encoding: UTF-8 | |
# 写真の撮影日を読み込んで適当に出力 | |
THREAD_NUM = 4 | |
dirname = (ARGV.length < 1 ? '.' : ARGV[0]) + '/**/*' | |
filereg = ARGV.length < 2 ? /\.jpe?g$/i : Regexp.new(ARGV[1], Regexp::IGNORECASE) | |
filelist = Dir.glob(dirname).reject{|name| !(File.file?(name) && File.basename(name) =~ filereg)} |
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
# encoding: UTF-8 | |
load 'smtpserver.rb' | |
require 'tmail' | |
require 'kconv' | |
require 'net/http' | |
require 'socket' | |
require 'oauth' | |
require 'twitter' |
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
(function(){ | |
var ShowLoadingManager = function(count, ele, loading, done, divstyle){ | |
if(count > 0){ | |
this.count = count; | |
this.done = done; | |
var div = document.createElement('div'), div_c = document.createElement('div'); | |
if(ele instanceof Node){ | |
var style = ele.currentStyle || document.defaultView.getComputedStyle(ele, ''); | |
if(style.position === 'static'){ |
NewerOlder