May 2009 Archives

coming soon...

| | Comments (4)

1.9 compatibility:

I've been focusing on 1.9 compatibility lately and while most of my stuff was good to go, there were still some lingering issues here and there. Check it:

% ./sanity_report.rb
Project: 1.8.6-p287, 1.8.6-p368, 1.8.7-p160, 1.8.7-p72, 1.9.1-p0, 1.9.1-p129
hoe            : T, T, T, T, T, T : needs release
ZenTest        : T, T, T, T, T, T : needs release
minitest       : T, T, T, T, T, T : needs release
RubyInline     : T, T, T, T, T, T : needs release
sexp_processor : T, T, T, T, T, T : needs release
ParseTree      : T, T, T, T, T, T : needs release
ruby_parser    : T, T, T, T, T, T : needs release
ruby2ruby      : T, T, T, T, T, T : up-to-date
heckle         : T, T, T, T, T, T : needs release
flog           : T, T, T, T, T, T : needs release
flay           : T, T, T, T, T, T : needs release
vlad           : T, T, T, T, T, T : needs release
ruby_to_c      : T, T, T, T, F, F : needs release
png            : T, T, T, T, F, F : needs release

passed: 74 failed: 4

...fear the coming avalanche... :P

Hoe Awesomeness:

I'm also working on a total revamp of hoe by finally figuring out a good way to make it pluggable and splitting out almost all of its functionality into plugins (all still activated by default). As a result, hoe.rb is currently 44% of the original size and is much much cleaner. That also means that things that I considered orthogonal to hoe can be written by others and easily available to you. It also has a new DSLish way of defining specs

Imagine:

Hoe.plugin :perforce
Hoe.plugin :minitest
Hoe.plugin :email

Hoe.spec "hoe" do
  developer "Ryan Davis", "ryand-ruby@zenspider.com"

  self.rubyforge_name = "seattlerb"

  blog_categories << "Seattle.rb" << "Ruby"
  publish_emails << "ruby@zenspider.com" << "ruby-talk@ruby-lang.org"

  pluggable!
end

None of those plugins exist yet... Here is what I've pulled out so far:

% ls lib/hoe
clean.rb    flay.rb     package.rb  rcov.rb
debug.rb    flog.rb     publish.rb  signing.rb
deps.rb     inline.rb   rake.rb     test.rb

and the plugin structure is really easy:

module Hoe::Blah
  def initialize_blah   # optional
    # ...
  end

  def define_blah_tasks # mandatory
    # ...
  end
end

user registration fixed

| | Comments (1)

Alex Chaffee told me yesterday that he couldn't sign up for an account to create a comment. Apparently that's been the case since I upgraded the blog a major version of MT. I didn't have the system-wide email address set so it couldn't send you a confirmation email.

I've fixed that and enabled everyone who was pending that didn't look like a spammer. sorry.

hamlet, via adium

| | Comments (0)
set hamlet to readtext "~/Documents/Text/hamlet.txt"

tell application "Adium"
  set victim to chat id "AIM.victim"
  repeat with aparagraph in paragraphs of hamlet
    try
      send victim message aparagraph
    on error
      -- ignore
    end try
  end repeat
end tell

Yes, I really do have hamlet.txt (and hamlet-1-line.txt) in my documents folder. They're great for testing... Even better for the bug reports they inevitably generate.

zenprofiler helps answer WHAT is being called the most. spyon helps answer WHERE those calls are being made. ZenProfiler provides a faster version of the standard library ruby profiler. It is otherwise pretty much the same as before. spyon provides a clean way to redefine a bottleneck method so you can account for and aggregate all the calls to it.

% ruby -Ilib bin/zenprofile misc/factorial.rb 50000
Total time = 3.056884
Total time = 2.390000

          total     self              self    total
% time  seconds  seconds    calls  ms/call  ms/call  name
 50.70     1.64     1.64    50000     0.03     0.05 Integer#downto
 19.63     2.27     0.63   200000     0.00     0.00 Fixnum#*
 14.19     2.73     0.46    50000     0.01     0.05 Factorial#factorial
  9.93     3.05     0.32        1   320.36  3047.10 Range#each
  5.54     3.23     0.18        2    89.40   178.79 ZenProfiler#start_hook

Once you know that Integer#downto takes 50% of the entire run, you can use spy_on to find it. (See misc/factorial.rb for the actual code):

% SPY=1 ruby -Ilib misc/factorial.rb 50000
Spying on Integer#downto

Integer.downto

50000: total
50000: ./misc/factorial.rb:6:in `factorial' via 
       ./misc/factorial.rb:6:in `factorial'

Changes:

1.0.0 / 2008-09-17

Wraps rbaddeventhook so you can write fast ruby event hook processors w/o the speed penalty that comes with settrace_func (sooo sloooow!). Calls back into ruby so you don't have to write C.

% ruby demo.rb 
# of iterations = 1000000
                          user     system      total        real
null_time             0.120000   0.000000   0.120000 (  0.125279)
ruby time             0.560000   0.000000   0.560000 (  0.562834)
event hook            3.160000   0.010000   3.170000 (  3.175361)
set_trace_func       34.530000   0.100000  34.630000 ( 34.942785)

Changes:

1.0.0 / 2009-05-19

(via Brodie's Thinking Forth: A Language and Philosophy for Solving Problems)

  • Determine your goal.
  • Picture the problem as a whole.
  • Develop a plan.
  • Think of an analogous problem.
  • Work forward.
  • Work backward.
  • Believe.
  • Recognize the auxiliary problem(s).
  • Step back from the problem.
  • Use whole-brain thinking.
  • Evaluate your solution. Look for other solutions.

Wilson is a pure ruby x86 assembler. No, really. Worst Idea Evar.

Why "wilson"? I wanted to name it "metal", but there is an existing project with that name... So I'm naming it after Wilson Bilkovich, who is about as metal as you can get (and it is easier to spell than "bilkovich", even tho that sounds more metal).

Changes:

1.1.0 / 2009-05-08

  • 1 major enhancement:

    • Added Object#asm for inline assembly. 100% ruby, no C.
  • 7 minor enhancements:

    • Added arg(n) for cleanly accessing ruby arguments.
    • Added debugging output if $DEBUG.
    • Added defasm and asm test cases.
    • Added fromruby and sped up toruby a teeny amount.
    • Improved benchmark code
    • Refactored ASM DSL to Object#assemble.
    • Sped up tests a fair amount by optimizing supportsProcessor.
  • 2 bug fixes:

    • Found a bug in the nasm manual that wilson parses. Fixed SAR.
    • Found a bug in the nasm manual that wilson parses. Fixed cmp.
  • http://rubyforge.org/projects/seattlerb

About this Archive

This page is an archive of entries from May 2009 listed from newest to oldest.

April 2009 is the previous archive.

June 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.32-en