Good morning. It's just after eleven o'clock. (Japan Standard Time)

ruby

ruby

Ruby is a quite useful object-oriented scripting language written by Yukihiro Matsumoto. Here are some codes written by me.

libraries

calendar

This module handles calculations about various calendars. For more information, see my calendar page.

calendar conversion page is an application program that using this package.

calendar-1.11.4r.tar.gz [ 132k] calendar-1.11.4.gem [ 124k]

date2

This is the identical class that is a ruby's standard. However, this must be the newest, basically. In addition, this package has some code about holidays and some documents.

calendar scope page is an application program that using this package.

date2-4.0.18.tar.gz [ 47k]

manual

date
Date station

date4

date4 is a derivative of date2 that is for some experiments.

Note: This library's core works fine with only ruby standard environment. But some code depend tzinfo. I recommend you to install nurat for better performance.

date4-0.1.29.tar.gz [ 66k] date4-0.1.29.gem [ 59k]

gopt

gopt is a simple wrapper of getoptlong.

gopt-0.0.1.tar.gz [ 10k] gopt-0.0.1.gem [ 4k]

nuby

Nuby is a derived version of a programing language Ruby (MRI).

Both Rational and Complex class are written in C. A new operator and some new literals are available. This is a very personal and experimental project. So some functions may not work well.

  2 / 3  #=> (2/3)

  2 // 3 #=> 0

  10r3   #=> (10/3)
  10.5c3 #=> (10+3i)
  3i     #=> (3i)

"Once" expression which can be evaluated at most once in a runtime.

  def foo(x) (# 3 * x) end
  foo(3)  #=> 9
  foo(30) #=> 9

  class Integer; def days() self * (#24 * 60 * 60) end; end
  3.days  #=> 259200

and some methods are added.

  $ inuby -m
  inuby@main> 0.3.numerator / 0.3.denominator + 3i
  #=> 
       5404319552844595   
      -----------------+3i
      18014398509481984   

nuby-1.86.004.tar.gz [ 4.4M]

nucomp

NuComp is an alternative complex class.

This is written in C. This class is based on Ishitsuka's implementation which is written in ruby.

nucomp-0.2.1.tar.gz [ 19k]

nurat

NuRat is an alternative rational class.

This is written in C. This class is based on Ishitsuka's implementation which is written in ruby.

nurat-0.2.1.tar.gz [ 19k]

nutime

NuTime is an alternative time library.

Note: This library's core works fine with only ruby standard environment. But some code depend tzinfo.

nutime-0.0.4.tar.gz [ 23k] nutime-0.0.4.gem [ 17k]

once

This provides an way to define once method. A once method is an ordinary method, however evaluates its body at most once.

once-2.4.tar.gz [ 10k] once-2.4.gem [ 4k]

osc

This is an "OpenSound Control" module. This is an implementation of OpenSound Control that is a protocol of application-level for especially musical interest.

Examples: Controlling NI Reaktor and PD with joystick (on Windows).

Note for OS X users: See "pack and unpack broken on Tiger's Ruby" and try this.

osc-0.1.4.tar.gz [ 26k] osc-0.1.4.gem [ 20k]

some of osc's examples requires gopt

r2m

smf

This is a "Standard MIDI File" module. This module handles encoding and decoding about SMF. This package includes MML (a simple musical notation language), which is an example of application.

Examples: STT (a dialect of Masui's onomatopoeic notation Sutoton), Some stream editing (Quantize, Shuffle, Groove, Velocity compressor, etc), Morse encode, Import/Export as plain text and XML, Play with OSS drivers, play with spkr(4), Play on Windows, Export as .wav (very slow and very low-fi).

Note: Some parts of the specification were changed in 0.15. Please see manual. This module's core works fine with only ruby standard environment. But some code depend rb-gsl (1.8.0 or later). This is optional.

rb-808 page is an application program that using this package.

I've used this module in the work of the following plays.

inventio 1 c-dur bwv 772a (beta)| organ (beta)

ricercar a 6 bwv 1079/5 (alpha) fuga (2. ricercata) (alpha)

smf-0.15.12.tar.gz [ 52k] smf-0.15.12.gem [ 46k]

some of smf's examples require gopt

manual

r2l

applications

cal

cal is a cal(1) clone The day of calendar reform is selectable. ncal is also available.

 (cal -c it 10 1582)     (cal -c gb 9 1752)      (cal -mt 4 2000)

    October 1582           September 1752            April 2000
 S  M Tu  W Th  F  S     S  M Tu  W Th  F  S     M     3 10 17 24
    1  2  3  4 15 16           1  2 14 15 16    Tu     4 11 18 25
17 18 19 20 21 22 23    17 18 19 20 21 22 23     W     5 12 19 26
24 25 26 27 28 29 30    24 25 26 27 28 29 30    Th     6 13 20 27
31                                               F     7 14 21 28
                                                 S  1  8 15 22 29
                                                 S  2  9 16 23 30

cal.rb [ 4k] ncal.rb [ 4k]

dvipc

dvipc reports number of pages in the each given DVI-files. For more information, see my small programs page "dvipc".

dvipc-1.1.1.tar.gz [ 48k]

gtkcal

This is a calendar with a notebook. this requires date2.

screenshot of gtkcal

gtkcal.rb [ 10k]

luna

This is an imitation of Taroh Sasaki's luna 1.9. It has only a function which prints a moon age (It isn't so accurate--bacause it just uses epact).

$ luna
Sat May 23 03:55:34 1998
      *
   **
 **
***
***
 **
   **
      *         27.

luna.rb [ 4k]

nqt

nqt is a Nihongo Query Time.

nqt.rb [ 1k]

rar

This is a ruby version of shar. It's easy to use this. For example, you can send a rar source like this:

rar README rar.rb | mail -s 'rar source' tadf

Please type "ruby -x rar.rar" to get rar. Because rar.rar is rared rar.

rar is no relate Windows's RAR.

rar.rar [ 4k]

wc

This is a wc(1) clone.

wc.rb [ 1k]

"Just another Ruby hacker,"

'abcdefghijklmnopqrstuvwxyz'.
  tr('gqtkmevuxndyfohljsrwzciabp',
     'nyae  kcrRt,auorhh e stJub').
  display

(0..24).each{|i|$><<((278997462280352656884859620342234553147534102625031355069770>>i*8)%256).chr}

0.step(72,3){|i|$><<'J huhesartc  kRaeunrbo,yt'[i%25..i%25]}

[8,16,20,29,78,65,2,14,26,12,12,28,71,114,12,13,12,82,72,21,17,4,10,2,95].
  each_with_index{|x,i| $><<(x^'Begin landing your troops'[i]).chr}

$><<[[[['J'],[[[['u']]],[['s']]]]],[['t',[[[[' ']],'a']]]],['n'],[[['o']],[
[['t']],'h']],[[['e'],['r']]],[[[[' ']],['R']]],[[[['u']]],['b']],[[[['y'],
[' ']]]],[[['h',[[[[['a']]]],[['c']]],'k']]],[[['e']]],[[[['r']]],[[',']]]]

'Jluisptf lainpoftlhieprf lRiupbfyl ihpafclkiepr,'.gsub(/[flip]/,'flap'*0).display

('b'*0+'J'+'u'+'y'*0+'s'+'t'+' '+'v'*0+
 'a'+'n'+'o'+'p'*0+'t'+'h'+'e'+'r'+' '+
 'c'*0+'R'+'i'*0+'u'+'j'*0+'b'+'y'+' '+
 'h'+'a'*1+'c'+'k'+'e'+'r'+',').display

25.times{|i|$><<('BqSt ajmthe2 BubY HA#iep('[i]|'Heq4 `.OthER Rq`9 hackEr,'[i]).chr}

index |rss

Tadayoshi Funaba 1998-2008
last modified: 2009-06-07T18:21:28+09:00