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
package org.buffr.Sketch20091118_02; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.content.Context; | |
import android.graphics.*; | |
import android.view.View; | |
public class Sketch20091118_02 extends Activity | |
{ |
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 ruby | |
# -*- coding: utf-8 -*- | |
# | |
# worker starter | |
# x process starter ? | |
# x process runner ? | |
# (元process-manager.pl) | |
# | |
# - 複数種類のworkerプロセスを複数まとめて起動する | |
# - configで指定するプロセスは任意のプログラム(rubyに限らない) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="org.buffr.Sketch20091125_01" | |
android:versionCode="1" | |
android:versionName="1.0"> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application android:label="@string/app_name"> | |
<activity android:name=".Sketch20091125_01" | |
android:label="@string/app_name"> | |
<intent-filter> |
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 ruby | |
# -*- coding: utf-8 -*- | |
# | |
# forkしたプロセスのcopy-or-writeの確認 | |
# linuxのproc/#{pid}/smaps相当がosxで何かわからなかったのでとりあえずpsのRSSみて親子の実メモリ使用量を見る | |
# | |
# 2009-12-09 koyachi | |
require 'digest/md5' | |
should_forked = (ARGV[0] == 'fork') ? 1 : nil |
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
みかんを食べながらkathy graysonのブログを見るブックマークレット | |
javascript:(function(interval,move){setInterval(function(){window.scrollBy(0,move)}, interval);})(100,5); |
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 ruby | |
$:.unshift File.dirname(__FILE__) + '/../../lib/' | |
require 'rubygems' | |
require 'q4m' | |
database = "test_q4m" | |
table = "example_json_queue_monitor" | |
sql = "CREATE TABLE IF NOT EXISTS #{table} (v TEXT NOT NULL) ENGINE=QUEUE;" | |
begin |
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 which(cmd) | |
result = `which #{cmd}` | |
result.chomp | |
end | |
# kim-gearman-rubyからコピペ+ | |
def start_gearmand(port = 4730) | |
cmd = "#{gearmand_path} -d -p #{port} --pid-file=#{gearmand_pidfile(port)}" | |
system cmd | |
gearmand_pid(port) |
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 ruby | |
require 'rubygems' | |
#require 'scissor' | |
#require 'scissor/echonest' | |
require 'echonest' | |
require 'yaml' | |
file = ARGV[0] || 'vera_lynn-over_the_rainbow.mp3' | |
echonest = Echonest 'YOUR_KEY' |
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
# linuxでscreencast | |
ffmpeg -f oss -i /dev/audio -s 800x600 -r 15 -f x11grab -i :0.0+0,27 -sameq -y screenrec.mp4 | |
via | |
- http://polishlinux.org/linux/ubuntu/screencasts-in-ubuntu-part-2/ | |
- http://bbs.archlinux.org/viewtopic.php?id=66305 |
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
# randomsortする前に試してたもの | |
# うまく交叉させられなかったのでやめた | |
# via http://www.ibm.com/developerworks/jp/linux/library/l-genperl/ | |
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'scissor' | |
beats = [56.54187, 57.45314, 58.39871, 59.33056, 60.26698, 61.17596, 62.09638, 63.00536, 63.91434, 64.82103, 65.72315, 66.6207, 67.50452, 68.39063, 69.27217, 70.06129, 70.77629, 71.66926, 72.55537, 73.49408, 74.42962, 75.40833, 76.35507, 77.26986] |