for reference:
sudo mount -o remount,size=7G /dev/shm
Monthly Archives: June 2009
how to check all checkboxes in a web page
there’s a firefox extension that will do it.
download/install it: https://addons.mozilla.org/en-US/firefox/addon/2708
then highlight the ones you want to toggle
then right click and it shows up on the menu.
phew!
This useful for adding your planetlab slice to all nodes, for example.
ruby candlesticks graphs [percentiles, quartiles]
using gnuplot ! [gnuplot gem]
straight from the gnuplot candlesticks demo [demo/candlesticks.dem]
rdp@rdp-vm:~/Downloads/gnuplot-4.2.5/demo$ cat test.rb
# 1 1.5 2 2.4 4 6.
# 2 1.5 3 3.5 4 5.5
# 3 4.5 5 5.5 6 6.5
a = [1,2,3]
b = [1.5, 1.5, 4.5]
c = [2,3,5]
d = [2.4, 3.5, 5.5]
e = [4,4,6]
f = [6,5.5, 6.5]
require 'rubygems'
require 'gnuplot'
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
plot.title "Example"
plot.ylabel "x"
plot.xlabel "x^2"
plot.xrange "[0:11]"
plot.yrange "[0:10]"
plot.data << Gnuplot::DataSet.new( [a,b,c,d,e,f] ) do |ds|
ds.using = "1:3:2:6:5"
ds.with = "candlesticks lt 3 lw 2 title 'Quartiles' whiskerbars"
#ds.notitle
end
plot.data << Gnuplot::DataSet.new( [a,b,c,d,e,f] ) do |ds|
ds.using = "1:4:4:4:4"
ds.with = "candlesticks lt -1 lw 2"
ds.notitle
end
end
end
gnuplot how to plot percentiles
I’d recommend plotting them as candlesticks
http://gnuplot.sourceforge.net/demo_4.3/candlesticks.html
??
bufferedreader buffered FileInputStream
what you want for buffered binary incoming file data in java is “BufferedInputStream”
ref:
http://java.sun.com/j2se/1.4.2/docs/api/java/io/BufferedInputStream.html
ruby tape woe
reading from a tape, then again, resulted in
irb(main):010:0> b = File.new ‘/dev/nst0′, ‘r’
Errno::EBUSY: Device or resource busy – /dev/nst0
from (irb):10:in `initialize’
from (irb):10:in `new’
from (irb):10
from :0
fix:
close the first handle [though it's already past EOF, apparently it needs a local close, too]
irb(main):011:0> a.close
=> nil
note you’ll want to read in chunks of 64*1024, even if it doesn’t actually return you chunks of that size, for some odd reason
github woe
git pull
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
meant do:
$ exec ssh-agent bash
$ ssh-add ~/.ssh/id_rsa
ref:
http://blog.stonean.com/2008/04/17/github-and-public-key/
http://www.cs.indiana.edu/csg/FAQ/Security/openssh.html
possibly caused by too restrictive of firewalls [?]
how to split an array into sub arrays
from rails’ active support:
Array#split
http://weblog.rubyonrails.org/2006/11/26/1-2-new-in-activesupport
[1,2,3,4,5].split( 2)
=> [1,2], [3,4], [5]
how to add files to an rdoc command line and specify a main for a gem’s rdocs rubygems
I think once upon a time you did it like
rdoc some_files FILES=README.txt
but now it’s
rdoc README.txt some_files
[?]
This appears to break gem rdocs
gem rdocs need to specify this via
s.rdoc_options = ["--title", "EventMachine", "--main", "README", "--line-numbers"]
and
s.extra_rdoc_files = ["README", "RELEASE_NOTES", "COPYING", "GNU", "LEGAL", "TODO"]
see eventmachine-win32′s gemspec for an example
[ANN] ruby documentation for every single rubygems
Just posted an announcement about my new site that has the rdocs for all gems–check it!
http://programming-gone-awry.blogspot.com/2009/06/rdocs-for-all-gems-from-rubyforge.html