hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

Thursday

2005.01.27

Rails as an Automation Archetype #

by why in cult

I know you guys can’t get enough of this Rails thing. It’s teh pop0lar href!! Follow that train. Mike Clark has interviewed David Heinemeier Hansson on automation in Rails.

Mike: Sounds like you’ve tried to automate everything that will be the same on most projects.

David: We basically try to make it so that the only thing you need to create is application-specific functionality. All the infrastructure is already configured and ready to run. That means it’s much, much easier to get off to a good start with testing, revision control (we backup your DB schema for you), and the like.

So even though we call it a Rails skeleton, when you create a new empty application, it’s actually more a fully fleshed, but undressed body you’re dealing with (yeah, Rails is that sexy :)).

I’m positive you Railsickos get off on this kind of stuff. (Listen close and hear the sound of #rubyonrails collectively issuing /me swoons.)

Regenerative C #

by why in bits

Fzort on Advogato has a lovely little collection of C magic tricks and puzzles.

Qouth life.c:

char*b=
"        " 
"        " 
"    ##  " 
"   ##   " 
"    #   " 
"        " 
"        " 
"        " 
,*dna[]={
"};main(){int i,j,k,n;char*p;puts(xchar*b=x);for(i=0;i<64;i++,i&7||puts(xzxx))",
"{i&7||putchar(34);for(n=-b[i],k=-8,j=0;j<9;j++,jy3||(k+=8))n+=b[(i+k&56)",
"|(i+jy3-1&7)];putchar(x #x[n==262&&b[i]==35||n==265]);}puts(x,*dna[]={x);for",
"(i=0;i<5;i++)printf(xzxyszx,znx,dna[i]);for(i=0;i<5;i++,putchar(10))for(",
"p=dna[i];*p;++p)putchar(*p==120?34:*p==121?37:*p==122?92:*p);}",
};main(){int i,j,k,n;char*p;puts("char*b=");for(i=0;i<64;i++,i&7||puts("\""))
{i&7||putchar(34);for(n=-b[i],k=-8,j=0;j<9;j++,j%3||(k+=8))n+=b[(i+k&56)
|(i+j%3-1&7)];putchar(" #"[n==262&&b[i]==35||n==265]);}puts(",*dna[]={");for
(i=0;i<5;i++)printf("\"%s\",\n",dna[i]);for(i=0;i<5;i++,putchar(10))for(
p=dna[i];*p;++p)putchar(*p==120?34:*p==121?37:*p==122?92:*p);}

Ruby + e17 #

by why in cult

bleeding e.

Forget Kapsules. I mean Kapsules is neat and I don’t regret posting about it—absolutely not—how could I? I uphold the original decision to do so. But imagine my paleness, the powerfright, when I saw the Ruby-EFL bindings. My allegiance to enlightenment is truer.

I’ve been compiling e17 from CVS weekly. It’s lookin sly. If you want to give it a try, I’d highly suggest the Unofficial DR17 docs.

The Ruby-EFL bindings give you hooks into e’s internals. Meaning you can write little apps and widgets for e. Over the next few weeks, I’m gonna drop some Ruby scripts I’ve been using with e16 and e17.

Why I Use Debian With Ruby #

by daigo in cult

Some debian developers discussed the split of Ruby standard libraries and gave a proposal to add two new packages and change the meaning of the current ‘ruby’ package at the debian-ruby list (not archived yet) (I need to modify dependency lines in my tDiary packages). I am sure that it will soon be available and I’d like to say “Wait a minute, it is too early to leave Debian.”

I like Debian’s Ruby because Ukai-san and Yamada-san are members of its maintainers. They are super hackers of Debian and Ruby. Ukai-san is the leader of Debian.jp and the president of Japan Linux Association. Yamada-san seems to maintain Vine’s Ruby also, however, make Debian’s package at first.

See the changelog.Debian.gz at /usr/share/doc/ruby1.8 in Debian. You can find Debian’s Ruby more stable than the original. I appreciate their contribution. I cite a recent entry. Who else can do that?

ruby1.8 (1.8.2-1) unstable; urgency=high

  * akira yamada <akira@debian.org>
  - new upstream version, 1.8.2:
      - removed debian/patches/{100_cvs_updates.patch,801_syck_segv.patch,
        802_syck_segv.patch}.  they ware included 1.8.2.
      - (urgency high) fixed segv bugs:
          - Process.groups= dumps core again.  [ruby-dev:25285]
          - YAML::Syck::Parser#load dumps core.  [ruby-core:03973]
          - IO.select dumps core.  [ruby-dev:25312]
      - fixed bugs:
          - prohibit to change access mode for special IO ports  (stdin,
            stdout and stderr).  [ruby-dev:25225]
  - added debian/patches/100_cvs_updates.patch:
      - (urgency high) fixed segv bugs:
          - String#center dumps core.  [ruby-dev:25341]
          - require "openssl" dumps core.  [ruby-dev:25325]
          - Zlib memory leak.  [ruby-list:39235][ruby-dev:25309]
          - String#ljust dumps core again.  [ruby-dev:25367]
          - bmcall() causes core dump.  [ruby-dev:25366]
          - Module#autoload? dumps core.  [ruby-dev:25373]
          - OpenSSL::Netscape::SPKI#challenge= dumps core.  [ruby-dev:25359]
          - Segfault in Thread#initialize / caller  [ruby-core:04067]
      - fixed bugs:
          - webrick/httpauth bugs.
            [ruby-list:40467][ruby-list:40482][ruby-dev:25336]
          - rand uniformity  [ruby-dev:25396]

 -- akira yamada <akira@debian.org>  Fri,  7 Jan 2005 11:17:10 +0900

Kapsules 0.9.8 #

by why in cult

A couple of weeks ago, Curt Hibbs brought up Kapsules, desktop widgets for Windows, which can be scripted with Ruby. At the time, the site was down for an upgrade. And, now it’s back.

Meteorology widget in Ruby.

Looks like there are about five widgets written in Ruby, including KapMeteorology (pictured to the right.) You’ll need ActiveRuby to make use of them.

The scripting resembles a lot of other GUI libraries like FOX. A bit simpler I guess.

 # Draw forecast.
 Graphics.Font.Size = 8
 forecast_drawables.each do |part, drawable|
     if weather_image = drawable[ "icon" ]
         Graphics.DrawImage( weather_image, drawable[ "start" ], 
           40, weather_image.Width / 2, weather_image.Height / 2 )
         weather_image.Dispose
     end
     Graphics.DrawString( drawable[ "text" ],
       drawable[ "start" ], text_start_y,
       Settings.GetSettingAttribute( "widgetroot/forecast", 
                                     "width" ).to_i,
       Widget.Height - text_start_y )
 end