Roger's woze

June 30, 2009

resize dev shm

Filed under: Uncategorized — rogerdpack @ 3:55 pm

for reference:
sudo mount -o remount,size=7G /dev/shm

how to check all checkboxes in a web page

Filed under: Uncategorized — rogerdpack @ 1:28 am

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.

June 29, 2009

ruby candlesticks graphs [percentiles, quartiles]

Filed under: Uncategorized — rogerdpack @ 7:55 pm

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

June 27, 2009

gnuplot how to plot percentiles

Filed under: Uncategorized — rogerdpack @ 10:58 pm

I’d recommend plotting them as candlesticks

http://gnuplot.sourceforge.net/demo_4.3/candlesticks.html

??

June 26, 2009

bufferedreader buffered FileInputStream

Filed under: Uncategorized — rogerdpack @ 9:37 pm

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

Filed under: Uncategorized — rogerdpack @ 8:02 pm

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

June 25, 2009

github woe

Filed under: Uncategorized — rogerdpack @ 3:00 pm

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 [?]

June 24, 2009

how to split an array into sub arrays

Filed under: Uncategorized — rogerdpack @ 4:32 pm

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

Filed under: Uncategorized — rogerdpack @ 5:31 am

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

June 23, 2009

[ANN] ruby documentation for every single rubygems

Filed under: Uncategorized — rogerdpack @ 7:19 pm

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

Older Posts »

Powered by WordPress