[#144157] Interesting discovery... — Austin Ziegler <halostatue@...>
I had a user report a slowdown in PDF::Writer. I'm pretty certain I
On Wed, 1 Jun 2005, Austin Ziegler wrote:
On 5/31/05, Ara.T.Howard <Ara.T.Howard@noaa.gov> wrote:
On Wed, 1 Jun 2005, Austin Ziegler wrote:
Ara.T.Howard@noaa.gov wrote:
[#144158] tk image problem — Charles Hixson <charleshixsn@...>
When I attempt to read in xpm files created by the Gimp, I get
[#144164] TinyUrl class — "Vincent Foley" <vfoley@...>
Hi everyone,
Vincent Foley wrote:
[#144186] Re: array of object insert polices — "Pe, Botp" <botp@...>
dave [mailto:dave.m@email.it] wrote:
dave wrote:
dave wrote:
[#144206] Implementing a Read-Only array — Gavin Kistner <gavin@...>
Right up front, let me say that I realize that I can't prevent
Gavin Kistner wrote:
[#144208] OT: Looking for embeddable WYSIWYG HTML editor — "delirious" <Simon.Vandemoortele@...>
Dear all,
"delirious" <Simon.Vandemoortele@gmail.com> inquired:
[#144223] Document identification — "M. Eteum" <meteum@...>
Dear Ruby Guru:
[#144224] Method Chaining Issues — "aartist" <aartist@...>
try this:
This is a FAQ, though no page on the RubyGarden wiki seems to address
Phrogz wrote:
On 6/2/05, Nikolai Weibull
Gyoung-Yoon Noh wrote:
Phrogz wrote:
Sam Goldman wrote:
>> Some people think that "bang" methods shouldn't exist at all!
[#144230] ternary operator confusion — Belorion <belorion@...>
I don't know if this is "improper" use of the ternary operator, but I
true ? a.push(1) : a.push(2)
On Thu, Jun 02, 2005 at 01:40:23AM +0900, Phrogz wrote:
--- "Marcel Molina Jr." <marcel@vernix.org> wrote:
On 6/1/05, Eric Mahurin <eric_mahurin@yahoo.com> wrote:
On Jun 1, 2005, at 3:47 PM, Austin Ziegler wrote:
[#144253] Installing ruby on rails locally — "g_u_s" <gus_literatura@...>
Hi, everyone, I want to know how I do to install ruby on rails locally,
[#144274] help, I can't compile an extension on windows — Lionel Thiry <lthiryidontwantspam@...>
Hello!
Lionel Thiry wrote:
Daniel Berger a 馗rit :
[#144275] The WIPO Intellectual Property Forum - defend your right to Ruby. — John Carter <reNfOacStPoArMedE@...>
Here is an opportunity to fight the new Imperialism.
[#144290] librend 0.0.1 — Ilmari Heikkinen <kig@...>
Here's something I've been hacking on for the past two months, an OpenGL
[#144310] internal iterators in ruby — Navya Amerineni <navyaamerineni@...>
Hi,
[#144350] How to use open uri or net/http class — sujeet kumar <sujeetkr@...>
Hi
[#144362] Google Summer of Code: status of Ruby Central — "David A. Black" <dblack@...>
Hi --
[#144379] Ruby equiv of Perltidy? — <RubyLANG@...>
Hello All,
[#144390] requiring files — Joe Van Dyk <joevandyk@...>
Hi,
[#144405] Nuby problem w/CSV, tab-delimited files & embedded double-quotes — rpardee@...
Hey All,
[#144436] Google Summer of Code update — "David A. Black" <dblack@...>
Hi --
[#144444] Re: internal iterators in ruby — "Geert Fannes" <Geert.Fannes@...>
So, if I understand well, the problem with iterating over different
[#144448] AllInOneRuby 0.2.3 — Erik Veenstra <pan@...>
[#144452] Whiteout (#34) — Ruby Quiz <james@...>
The three rules of Ruby Quiz:
> 3. When "whiteout" is required, the original code must be executed with
[#144453] RubyScript2Exe and GUI toolkits — Erik Veenstra <pan@...>
[#144458] Failure: test_verify(OpenSSL::TestX509Store) — "James B. Byrne" <ByrneJB@...>
I built ruby-1.8.2 stable from source (ruby-lang.org) on a CentOS4
[#144465] newby question on validation — Matteo Corti <corti@...>
Hi,
[#144468] erb/apache problem — "HAL 9000" <hal9000@...>
Hi, all. Posting from work via Google.
On Sat, Jun 04, 2005 at 01:50:24AM +0900, HAL 9000 wrote:
[#144480] method_missing and assignment — Patrick Gundlach <clr5.10.randomuser@...>
Hi,
[#144487] Building a business case for Ruby — Joe Van Dyk <joevandyk@...>
Hi,
On Friday 03 June 2005 16:33, Joe Van Dyk wrote:
You could, er, load ruby as a python extension...
[#144494] Teaching Ruby — Joe Van Dyk <joevandyk@...>
Somewhat related to the other thread I just started. In order to get
[#144535] ruby-dev summary 26128-26222 — Minero Aoki <aamine@...>
Hi all,
[#144557] Calling a procedure with dinamyc name — Marcelo Paniagua <paniagua@...>
Hi there!
[#144565] RDoc: bug or limitation? — "Vincent Foley" <vfoley@...>
I think I found a bug in RDoc, although this could be a limitation, I'm
[#144579] Package, a future replacement for setup.rb and mkmf.rb — Christian Neukirchen <chneukirchen@...>
* Christian Neukirchen <chneukirchen@gmail.com> [2005-06-05 07:59:15 +0900]:
Jim Freeze <jim@freeze.org> writes:
On 6/4/05, Christian Neukirchen <chneukirchen@gmail.com> wrote:
Austin Ziegler <halostatue@gmail.com> writes:
Christian Neukirchen ha scritto:
gabriele renzi <surrender_it@remove-yahoo.it> writes:
Christian Neukirchen ha scritto:
[#144610] Creating objects from strings. — Bill <ruby@...>
Hi,
Bill wrote:
[#144614] unbinding a Proc? — Eric Mahurin <eric_mahurin@...>
This is mostly a curiosity thing...
[#144658] Rails/ActiveRecord Nuby question. — Harold Hausman <hhausman@...>
I am kindof assuming that this is something of a newbie question as
[#144666] A Ruby script to add email disclaimers — Johann Spies <jspies@...>
A few years after my first contact with ruby (and not using it) I am
[#144672] newbie read.scan (?) question — "Bruce D'Arcus" <bdarcus.lists@...>
Hi,
article is a stream and you try to read it twice, this doesn't work like
One followup.
Hi,
[#144682] How to call a class method when (i.e. in the moment of) inheriting from a class/defining a descendant? — Thomas <sanobast-2005a@...>
Hi,
[#144691] making a duck — Eric Mahurin <eric_mahurin@...>
Regarding duck-typing... Is there an easy way make a "duck"?
Eric Mahurin ha scritto:
Eric Mahurin wrote:
Hi,
--- nobu.nokada@softhome.net wrote:
Hi,
Eric Mahurin wrote:
[#144694] A little Quiz — "Dominik Bathon" <dbatml@...>
First of all, this is no attempt to rival with James' nice Ruby Quiz ;-)
[#144706] 'gets' has been hijacked — Pete Elmore <pete@...>
I was working with a simple script, that unexpectedly broke. The
[#144723] Stats comp.lang.ruby (last 7 days) — Balwinder Singh Dheeman <bsd.SANSPAM@...>
Stats comp.lang.ruby (last 7 days)
[#144724] Saving YAML data — Nigel Wilkinson <nigel@...>
Hi
[#144735] Re: Help getting RMagick working — Timothy Hunter <cyclists@...>
pjhyett@gmail.com wrote:
[#144742] Could Ruby-doc be better? -- Proposal for a better system. — Andrew Thompson <vagabond@...>
<Sorry for the crosspost, but I thought I might as well try to reach as
Andrew Thompson wrote:
So, basically the consensus is that Rdoc is in need of some work,
[#144782] DRb Method_mising respond_to? — "curtis.schofield@..." <curtis.schofield@...>
[#144816] Ruby version ot TEA (Tiny Encryption Alogrithm)? — James Britt <james_b@...>
Does anyone know of a pure-Ruby lib that implements the Tiny Encryption
[#144837] I cannot get rescue to work — Xeno Campanoli <xeno@...>
The example on page 108 of pickaxe gives me the following syntax error, for
[#144853] Test-Driven Development in GUIs — Joe Van Dyk <joevandyk@...>
Hi,
On 6/7/05, Joe Van Dyk <joevandyk@gmail.com> wrote:
[#144867] ruby-wish@ruby-lang.org mailing list — dave <dave.m@...>
Austin Ziegler wrote:
On 6/8/05, dave <dave.m@email.it> wrote:
On Jun 8, 2005, at 8:25 AM, Austin Ziegler wrote:
On 6/8/05, dave <dave.m@email.it> wrote:
On Thu, Jun 09, 2005 at 05:30:13AM +0900, dave wrote:
[#144876] Memory leak? — Nathan Smith <nsmith5@...>
Hello,
[#144879] StringMatrix — Gavin Kistner <gavin@...>
(This isn't a library I plan on maintaining, but ANN felt like the
[#144890] RubyStuff: The Ruby Shop for Ruby Programmers — James Britt <james_b@...>
Announcing the formal grand opening of Ruby Stuff: The Ruby Shop for
On Thu, Jun 09, 2005 at 12:50:52AM +0900, James Britt wrote:
Michal 'hramrach' Suchanek wrote:
Hal Fulton wrote:
Hey James,
I know CafePress is easy, but the shirts look generic, the quality is
On 6/8/05, James Britt <james_b@neurogami.com> wrote:
[#144923] Newb math question — brian <brian@...>
Can someone tell me why this code:
[#144956] Whiteout (#34) — Ruby Quiz <james@...>
Does this library have any practical value? Probably not. It's been suggested
[#144966] python/ruby benchmark. — "\"</script>" <groleo@...>
I took a look at
"</script> ha scritto:
Hello gabriele,
Java is an order of magnitude faster than Ruby. The development of a
Hello Kent,
Lothar Scholz said:
On 6/10/05, Ryan Leavengood <mrcode@netrox.net> wrote:
Gavri Fernandez said:
On Fri, 10 Jun 2005, Ryan Leavengood wrote:
As Gabriele mentionned, they implement a lot of stuff that is done in C
Vincent Foley wrote:
On 6/10/05, Isaac Gouy <igouy@yahoo.com> wrote:
On Jun 10, 2005, at 1:02 PM, Austin Ziegler wrote:
I've run through this thread and i am finally writting this because i am in a way astonished.
In article <9e7db91105061106485b68d629@mail.gmail.com>,
Phil Tomson wrote:
On 6/12/05, Steven Jenkins <steven.jenkins@ieee.org> wrote:
#: the mind was *winged* after Austin Ziegler said on 6/12/2005 5:53 PM :#
Austin Ziegler wrote:
On 6/12/05, Steven Jenkins <steven.jenkins@ieee.org> wrote:
Austin Ziegler wrote:
On 6/12/05, Steven Jenkins <steven.jenkins@ieee.org> wrote:
Austin Ziegler wrote:
In this essay I'm going to attempt, one final time, to demonstrate
On Wed, Jun 15, 2005 at 01:55:58PM +0900, Steven Jenkins wrote:
On 6/15/05, Ralph PJPizza Siegler <pjpizza@rsiegler.org> wrote:
[#144973] How to take password from user — sujeet kumar <sujeetkr@...>
Hi
On Jun 9, 2005, at 11:19 AM, sujeet kumar wrote:
On Fri, 10 Jun 2005, James Edward Gray II wrote:
[#144985] Getting a method object directly from a module — "Daniel Berger" <djberg96@...>
Hi all,
[#144991] http://sciruby.codeforpeople.com/ — "Ara.T.Howard" <Ara.T.Howard@...>
[#145000] RDoc —
Hi, I have a question. When I compiled ruby-1.8.2
On 09 Jun 2005, at 13:55, Jesffffas Antonio Sfffe1nchez A. wrote:
But for example it run rdoc --op -html-docs inside
Xeno Campanoli <xeno@eskimo.com> writes:
a slow loris with poison elbows wrote:
[#145011] gnu readline ruby vs. perl — Wybo Dekker <wybo@...>
I'm translating a Perl script into Ruby, but can't reproduce a readline
Hi,
Quoting nobuyoshi nakada <nobuyoshi.nakada@ge.com>:
[#145026] Re: [Rails] Ajax on Rails — Curt Hibbs <curt@...>
Robby Russell wrote:
> http://rubyurl.com/OddwR
Also dead:
On 6/10/05, Douglas Livingstone <rampant@gmail.com> wrote:
Could you replace it with a 404 page then? Atleast it won't look like
[#145031] framework of Ruby/Tk + VNC — Hidetoshi NAGAI <nagai@...>
Hi,
[#145032] newbieQ: new array from old array w regex — "Charles L. Snyder" <csnyder1@...>
Hi,
[#145045] Re: howto write rtf directly? — Nuralanur@...
Dear Thomas and Brian,
[#145049] duck-typing allows deeper polymorphism — Eric Mahurin <eric_mahurin@...>
I've seen many posts on what duck-typing is, that Ruby doesn't
On Fri, 10 Jun 2005, Eric Mahurin wrote:
[#145053] Chess Variants (I) (#35) — Ruby Quiz <james@...>
The three rules of Ruby Quiz:
On Jun 10, 2005, at 7:07 AM, Ruby Quiz wrote:
[#145079] Ruby/LDAP on Windows — "gregarican" <greg.kujawa@...>
Here is a message I sent to the maintainer of this particular project.
[#145085] Is there a Ruby equivilant to Python's exec_file? — Wayne Pierce <shalofin@...>
I'm working on a white-box security auditing framework, which is
[#145125] Regex help — Ezra Zygmuntowicz <ezra@...>
Hey there list
[#145132] Please help me get "Ajax on Rails" Slashdotted — Curt Hibbs <curt@...>
To those of you who've read my "Ajax on Rails" article at:
[#145135] blocks, scope/context confusion — "Corey" <corey_s@...>
Hi,
[#145146] (newb) installing rails — "luke" <lduncalfe@...>
[#145166] Only if the object exists — Gavin Kistner <gavin@...>
If I write code like this:
[#145175] how to extract url's from html source of google search result — sujeet kumar <sujeetkr@...>
hi
[#145177] Behavior of $* in String subclasses — Jamis Buck <jamis@37signals.com>
Here's an interesting snafu I ran into today:
[#145181] Regular expression problem — sujeet kumar <sujeetkr@...>
hi
[#145221] gem can't install rails? — Robo <robo@...>
I had a real old version of Rails, so I wanted to upgrade it.
[#145238] finding Hash subsets based on key value — "ee" <erik.eide@...>
Hi
James Edward Gray II <james@grayproductions.net> wrote:
....gonna launch a computerized weather balloon, of couse!
mark wrote:
[#145263] Re: python/ruby benchmark(don't shoot the messenger) — Nuralanur@...
Hello,
[#145264] [ANN] BoilerPlate 0.1.0 -- An application skeleton for Ruby on Rails — Michael Schuerig <michael@...>
[#145285] encryption using ruby? — "Nick Hayworth" <chipped_up@...>
Hi all
[#145288] ruby module for subversion? — Steve Kelem <s_kelem@...>
Is there a module for ruby that will give access to subversion functions?
[#145291] Chip Multi-threading and the future — Stephen Kellett <snail@...>
Hi Folks,
[#145302] Re: python/ruby benchmark(don't shoot the messenger) — Nuralanur@...
Tanner Burson wrote:
[#145304] PDF::Writer 1.0 (version 1.0.1) — Austin Ziegler <halostatue@...>
= PDF::Writer
On 6/13/05, Austin Ziegler <halostatue@gmail.com> wrote:
No love from PDF::Writer on Mac OS X 10.4.1. I hope to get this fixed
On 6/14/05, Jason Foreman <threeve.org@gmail.com> wrote:
On Jun 14, 2005, at 5:11 PM, Austin Ziegler wrote:
On 6/14/05, Jamis Buck <jamis@37signals.com> wrote:
On 6/14/05, Austin Ziegler <halostatue@gmail.com> wrote:
On Jun 14, 2005, at 9:06 PM, Jason Foreman wrote:
Jamis Buck <jamis@37signals.com> writes:
[#145306] Book: Agile Web Development with Rails — Stephen Kellett <snail@...>
Hi Folks,
[#145325] Speed concerns, rudeness, and narrow-minded excuses — Matt Pattison <matchbo@...>
I've been a little ashamed to be a part of the Ruby community reading
Matt Pattison wrote:
[#145339] survey: what editor do you use to hack ruby? — Lowell Kirsh <lkirsh@...>
I've been having a tough time getting emacs set up properly with ruby
2005/6/14, Lowell Kirsh <lkirsh@cs.ubc.ca>:
As a follow-up on the other people mentioning (g)vim: I think it should
Lowell Kirsh wrote:
On Jun 15, 2005, at 8:25 AM, Nikolai Weibull wrote:
James Edward Gray II <james@grayproductions.net> writes:
[#145372] vim question — "jeem" <jeem.hughes@...>
The survey thread reminded me that I wanted to ask this:
[#145373] Deploying on Textdrive — Bruno Bornsztein <bruno.bornsztein@...>
I've got an application working nicely on my localhost, and I'm
[#145390] Ruby and recursion (Ackermann benchmark) — ptkwt@... (Phil Tomson)
On 6/14/05, Phil Tomson <ptkwt@aracnet.com> wrote:
Austin Ziegler <halostatue@gmail.com> writes:
Christian Neukirchen <chneukirchen@gmail.com> writes:
[#145429] PDF::Writer Angle Issues — Austin Ziegler <halostatue@...>
Well, things have just gotten ... interesting. In response to a
On Wed, 15 Jun 2005, Austin Ziegler wrote:
[#145434] Limiting the CPU time of program started via SYSTEM() — Garance A Drosehn <drosihn@...>
Let's say I have a ruby script which calls system() to run some
[#145456] Problem to make Xtemplate parse my XHTML — "simonced" <simonced@...>
hi everyone,
I'll look better to Amrita documentation.
[#145465] code optimpization: delete_if, each, send. — dave <dave.m@...>
[#145487] Chess Variants (I) (#35) — Jim Menard <jimm@...>
My hacked-together solution, based on Bangkok (http://bangkok.rubyforge.org),
On Jun 15, 2005, at 8:54 AM, Jim Menard wrote:
James Edward Gray II wrote:
[#145531] Article on Ruby/Rails — Tom Copeland <tom@...>
Hi all -
[#145537] Regex help — Ezra Zygmuntowicz <ezra@...>
Hello list!
[#145546] Funniest Thing Evar! — Nikolai Weibull <mailing-lists.ruby-talk@...>
% python
[#145551] ruby openssl ? — "Bill Kelly" <billk@...>
Hi,
[#145574] stubborn program using readline — Wybo Dekker <wybo@...>
Hi,
On 6/16/05, Wybo Dekker <wybo@servalys.nl> wrote:
[#145575] OpenVMS woes — Renald Buter <buter@...>
Hello,
[#145582] Chess Variants (I) (#35) — Ruby Quiz <james@...>
As Gavin Kistner pointed out, this quiz was too much work. There's nothing that
[#145586] How to make a browser in Ruby Tk — sujeet kumar <sujeetkr@...>
Hi
From: sujeet kumar <sujeetkr@gmail.com>
When I run Ruby's source archive ("ext/tk/sample/tkextlib/tkHTML/hv.rb").
From: sujeet kumar <sujeetkr@gmail.com>
Hi,
From: sujeet kumar <sujeetkr@gmail.com>
Hi
From: sujeet kumar <sujeetkr@gmail.com>
Hi,
[#145603] Good Ruby Cross-platform GUI toolkit — jhouchin@... (Jimmie Houchin)
I've seen this pop up a couple of times while reading c.l.r.
[#145607] hash of hashes by default — Belorion <belorion@...>
I want a Hash of Hashes. Furthermore, I want it so that if a key for
[#145624] Backing up files and database better in Ant or Ruby? — "vike84" <mhust6@...>
I am looking to write some basic scripts to back-up various files and
[#145636] Super-scalar Optimizations — "Phrogz" <gavin@...>
I was looking over the shoulder of a C++ coworker yesterday, when he
Devin Mullins wrote:
On Jun 17, 2005, at 6:40 AM, Robert Klemme wrote:
[#145652] LinuxTag 2005 — Tanaka Akira <akr@...17n.org>
I'll go to LinuxTag 2005 next week.
[#145670] Nitro + Og 0.19.0: Og reloaded part2! — "George Moschovitis" <george.moschovitis@...>
Hello everyone,
On Fri, 17 Jun 2005, George Moschovitis wrote:
> > experimental In-Memory/Filesystem adapter.
[#145677] Truth maintenance system in Ruby — "itsme213" <itsme213@...>
Anyone know of any kind of truth-maintenance system implemented in Ruby (or,
Sorry, I should have elaborated. It is an AI/logic/rule-based system that
On Jun 17, 2005, at 11:20 AM, itsme213 wrote:
[#145683] Multitasking server? — mrt@...
Disclaimer: Ruby newbie here.
mrt@thomaszone.com wrote:
[#145684] ruby-vim line number — tsuraan <tsuraan@...>
This might be more appropriate on a vim list, but I'll give it a go here...
[#145704] Simple Check Box Question — "Matt Koidin" <mkoidin@...>
I'm new to ruby and rails and I have a simple question that is driving
It's the third parameter to the call you're making, a boolean. False is
I tried that and it doesn't work (again, I might be misinterpreting the
I solved the problem --
[#145718] gemserver for rubyforge projects — Eric Mahurin <eric_mahurin@...>
Anybody else think it would be nice if we had a gemserver
[#145720] Frameless RDoc template ('technology preview') — ES <ruby-ml@...>
Hi!
On 17 Jun 2005, at 12:59, ES wrote:
ES wrote:
On Saturday 18 June 2005 00:28, John W. Long wrote:
Ben Giddings wrote:
[#145730] What's the correspond method of PERL's DESTROY in ruby — "Yi Zhang" <yzhang@...>
Hello
[#145733] Confusion about gems and non-gems working together. — Lloyd Zusman <ljz@...>
Ever since I started installing packages via the gems mechanism, I have
[#145737] Why do arrays work this way? — Nigel Wilkinson <nigel@...>
Hi folks
[#145764] ruby on rails problem — "Ken Fettig" <kenfettig@...>
Hello, I have a Ruby on Rails question. I have used a layout in a
[#145779] Newbe questions... — "Chuck Brotman" <brotman@...>
In Ruby Is there a prefered (or otherwise elegant) way to do an inner &
[#145787] Syntax 1.0.0 — Jamis Buck <jamis@37signals.com>
INTRODUCING SYNTAX 1.0! IT'S EXPLOSIVE! IT'LL MAKE A REAL PROGRAMMER
[#145790] GC.disable not working? — Eric Mahurin <eric_mahurin@...>
From what I can tell, GC.disable doesn't work. I'm wanting to
Hi,
>>>>> "E" == Eric Mahurin <eric_mahurin@yahoo.com> writes:
Hello all,
dave wrote:
[#145823] Anybody using Ruby 1.6.x? — Timothy Hunter <cyclists@...>
With Ruby 1.8.3 on the horizon, should I continue to support building
[#145830] preventing instantiation — "R. Mark Volkmann" <mark@...>
What is the recommended way in Ruby to prevent other classes from creating
On 6/19/05, R. Mark Volkmann <mark@ociweb.com> wrote:
Quoting Gavri Fernandez <gavri.fernandez@gmail.com>:
R. Mark Volkmann wrote:
[#145846] irb without history? — Daniel Sche <uval@...>
Hello NG,
Take a look at:
well, I dont want to maintain history through the sessions
[#145862] trouble with sqlite-ruby — Lowell Kirsh <lkirsh@...>
I'm having trouble getting bind parameters to work. I'm getting errors
[#145870] Iterate with condition — G畸or SEBESTYノN <segabor@...>
Hi,
[#145879] x==1 vs 1==x — Gavin Kistner <gavin@...>
I'm against _premature_ optimization in theory, but believe that a
>>>>> "G" == Gavin Kistner <gavin@refinery.com> writes:
On Jun 20, 2005, at 7:23 AM, ts wrote:
On 6/20/05, Gavin Kistner <gavin@refinery.com> wrote:
Jason Foreman wrote:
[#145911] ruby9i dead? — rubyhacker@...
Is Ruby9i still an active project? I sent email to the owner
[#145941] Congrats to why_ — James Britt <james_b@...>
I don't recall seeing this mentioned here before, and I just read a post
[#145943] Chess Variants (II) (#36) — James Edward Gray II <james@...>
I don't want to spoil all the fun, in case anyone is still attempting
James Edward Gray II wrote:
On Jun 20, 2005, at 3:56 PM, Jim Menard wrote:
James Edward Gray II wrote:
Jim Van Fleet wrote:
On Jun 20, 2005, at 6:14 PM, Glenn Parker wrote:
[#145977] Ruby/REXML vs XSLT — John Carter <john.carter@...>
I'm just looking at 5000 lines of the gnarliest XSLT that generates
[#145987] Confusing code behavior in Rails — "szymon.rozga" <szymon.rozga@...>
I have a class in /project_dir/lib called Failure. Failure has one
[#145994] RMagick and RubyGems — Robert Mannl <ro@...>
Hi!
[#146003] Ruby and Java — Wayne Pierce <shalofin@...>
I have a vendor product with Java APIs that I need to write against
[#146023] HTML parsing as good as Perls. — TLOlczyk <olczyk2002@...>
First let me be very clear. I hate the language that Larry "should be
[#146038] 1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds — Michael Tan <mtan1232000@...>
Just new to Ruby since last week, running my same functional program on the windows XP(Pentium M1.5G), the Ruby version is 10 times slower than the Java version. The program is to find the prime numbers like 2, 3,5, 7, 11, 13... Are there setup issues? or it is normal?
Michael Tan wrote:
* Florian Frank <flori@nixe.ping.de> [2005-06-22 05:40:14 +0900]:
Jim Freeze said:
Ryan Leavengood wrote:
Glenn Parker said:
Ryan Leavengood wrote:
On 6/21/05, Glenn Parker <glenn.parker@comcast.net> wrote:
Florian Frank wrote:
Hey,
Keith Fahlgren wrote:
On Wed, 22 Jun 2005, Michael Tan wrote:
How about using a better algorithm than Eratosthenes sieve invented
Here's a version that skips even numbers:
[#146040] tk canvas question — Joe Van Dyk <joevandyk@...>
Hi,
On 6/21/05, Joe Van Dyk <joevandyk@gmail.com> wrote:
On 6/21/05, Joe Van Dyk <joevandyk@gmail.com> wrote:
From: Joe Van Dyk <joevandyk@gmail.com>
[#146064] rubyscript2exe — Joe Van Dyk <joevandyk@...>
Hi,
Joe Van Dyk said:
[#146074] Histogram-type Data — "Charles L. Snyder" <csnyder1@...>
Hi,
[#146087] Runtime vs Development — gwtmp01@...
On Wed, 2005-06-22 at 12:06 +0900, gwtmp01@mac.com wrote:
Matthew Berg said:
[#146123] traits-0.3.0 — "Ara.T.Howard" <Ara.T.Howard@...>
On Wed, Jun 22, 2005 at 09:18:13PM +0900, Ara.T.Howard wrote:
[#146143] How I can find out on which platform I am running (32/64 bits)? — "Joachim Just" <joachim.just@...>
[#146144] Newbee: recursively converting LF to CRLF and vice versa — Elliott <e.hmlhml@...>
Hello,
[#146169] spidering a website to build a sitemap — Bill Guindon <agorilla@...>
I need to spider a site and build a sitemap for it. I've looked
Bill Guindon said:
I have a site mapping tool I'm working on which does not yet read
i noticed webfetcher in RPAbase, haven't had a chance to play with it:
On 6/29/05, Gene Tani <gene.tani@gmail.com> wrote:
I was looking for somehting to trap 404-type errors, kind of like
[#146178] traits-0.4.0 - the coffee release — "Ara.T.Howard" <Ara.T.Howard@...>
Ara.T.Howard wrote:
On Thu, 23 Jun 2005, James Britt wrote:
On Thu, Jun 23, 2005 at 08:31:35AM +0900, Ara.T.Howard wrote:
Hello,
btw,
On Thu, 23 Jun 2005, George Moschovitis wrote:
[#146206] PostgreSQL Inserted OID — nexus <nexus@...>
Does anyone know how to get the inserted OID following an insert
[#146233] RMagick on Win — pavel.s.sokolov@...
Hi
[#146243] Packaging dillema — Joe Van Dyk <joevandyk@...>
Hi,
[#146248] Dead gateway detection — balcer <balcersk@...>
Is there some way to detect if gateway is dead?
[#146257] /dev/tty in windows — Wybo Dekker <wybo@...>
under linux I use
[#146263] Eclipse Weird Console Error — "Seago" <seagoj@...>
I'm not sure if anyone else is experiencing this. It's pretty much the
[#146296] ICFP 2005 Programming Contest — "Ryan Leavengood" <mrcode@...>
http://icfpc.plt-scheme.org/index.html
[#146325] REXML libraries and parsing issues — BA <lists@...>
First off, let me say right up front that I am a newbie wrt Ruby.
BA wrote:
[#146326] freeride debugger issue — "Chuck Brotman" <brotman@...>
I've been trying out Freeride and when I try to run my program using the
[#146327] Problems with Typo — Hal Fulton <hal9000@...>
Hi, all...
[#146328] string to Class object — "R. Mark Volkmann" <mark@...>
How can I create a Class object from a String that contains the name of a class?
On 6/23/05, R. Mark Volkmann <mark@ociweb.com> wrote:
Austin Ziegler wrote:
[#146349] FixedPt-0.0.1 — ptkwt@... (Phil Tomson)
[#146364] FastCGI: handling the caching of ruby scripts. — Jonas Hartmann <Mail@...>
FastCGIs idea of caching scripts on first startup is a great thing but:
[#146379] FSDB, Apache, FastCGI - ERROR: FSDB::Database::DirIsImmutableError — Jonas Hartmann <Mail@...>
when I run a script [1] from the command line, it works. it asks for
[#146380] Application-0.6.0 — Jim Freeze <jim@...>
CommandLine - Application and OptionParser
Great work, Jim! Looks like very quick way to get started on
* Eric Mahurin <eric_mahurin@yahoo.com> [2005-06-25 04:41:16 +0900]:
On Friday 24 June 2005 04:04 pm, Jim Freeze wrote:
Jim Freeze <jim@freeze.org> wrote:
* Levin Alexander <levin@grundeis.net> [2005-06-25 13:53:17 +0900]:
[#146391] ASP.NET vs Ruby on Rails — Stephen Kellett <snail@...>
HI Folks,
Hi Stephen,
Having written tens of thousands of lines of code in ASP.NET for
On 6/28/05, xmlblog@gmail.com <xmlblog@gmail.com> wrote:
[#146418] launching process and keeping track of pid — Joe Van Dyk <joevandyk@...>
Hi,
[#146419] Best way to parse/update HTML file? — "Bucco" <buc2@...>
Sorry for the newbie question. I am trying to find the best metod for
Bucco wrote:
[#146421] Text::Format 1.0.0 — Austin Ziegler <halostatue@...>
I am pleased to finally announce the release of Text::Format 1.0.0.
[#146425] speeding up Process.detach frequency — Joe Van Dyk <joevandyk@...>
Is there any way to speed up Process.detach? The ri documentation for
Hi,
Hi,
[#146437] optparse bug? — Joel VanderWerf <vjoel@...>
Hi,
[#146444] Defining a method vs aliasing it — leon breedt <bitserf@...>
Hi,
[#146452] Hash hidden in hash with default object — "Marcel Molina Jr." <marcel@...>
I observed this odd behavior when setting a hash to have as its default
[#146474] RubyGems Issue — Patrick Fernie <patrick.fernie@...>
Hi list,
[#146483] I saw the beauty of Ruby Re: 1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds — Michael Tan <mtan1232000@...>
Michael Tan wrote:
On 6/25/05, Florian Frank <flori@nixe.ping.de> wrote:
Joe Van Dyk wrote:
I think this shows the speed of my computer more than anything else:
For comparison, the port of your code to (less than elegant) C#.
Brad Wilson wrote:
On 6/26/05, Florian Gro<florgro@gmail.com> wrote:
My algorithmic ramblings gone unheard ... for performance language
[#146491] What do you want to see in a Sparklines Library? — Daniel Nugent <nugend@...>
This is sort of an interest gauging/feature request poll.
See what's already been done before you get too far.
Yup, seen the stuff on RedHanded, I was planning on writing a little
One thing that would make sparklines a lot more universally accessible to=
I'm doing that right now actually, I just want to add the ability to
Well... what does it do right now?
[#146508] RubyNuby Q: Howto Ri — Meino Christian Cramer <Meino.Cramer@...>
Hi,
[#146518] grouping/sorting [newbie question] — bdarcus@...
I'm trying to do something fairly simple that I understand how to do in
bdarcus@gmail.com wrote:
[#146535] newbie scope question — "Charles L. Snyder" <csnyder1@...>
Hi,
[#146536] Error using Net::SSH — "Amit Chitre" <amitchitre@...>
>From WinXP, I'm trying (for the first time) to connect to remote
On Jun 26, 2005, at 4:20 PM, Amit Chitre wrote:
[#146554] Caching eval() for reuse to gain performance ? — "Neville Burnell" <Neville.Burnell@...>
Hi,
[#146560] PDF::Writer Boggles — Brian McCallister <brianm@...>
Neither Austin nor myself has been able to diagnose this one.
[#146562] RCM - A Ruby Configuration Management System — Michael Neumann <mneumann@...>
Hi all,
Hi Everyone,
Zed A. Shaw wrote:
On Wed, 2005-06-29 at 05:42 +0900, Michael Neumann wrote:
Zed A. Shaw wrote:
[#146568] pythonchallenge level5 and pickle — Michael Tan <mtan1232000@...>
hi,what is Ruby's equivalent module of the Python
[#146569] Ruby 1.8.3 preview1 Build Error on AIX 5.2 — "Philippe Lucas" <philippe.lucas@...>
Hello,
[#146573] redirecting STDOUT — Joe Van Dyk <joevandyk@...>
Why doesn't this work?
[#146580] Adding a header to a SOAP request — David Teare <dteare@...>
Hi all,
[#146617] bit/byte operations — Meino Christian Cramer <Meino.Cramer@...>
Hi,
[#146630] yield does not take a block — Daniel Brockman <daniel@...>
Under ruby 1.9.0 (2005-06-23) [i386-linux], irb 0.9.5(05/04/13),
Yukihiro Matsumoto <matz@ruby-lang.org> writes:
Hi,
Eric Mahurin said:
* Ryan Leavengood <mrcode@netrox.net> [2005-06-29 05:49:45 +0900]:
In article <20050628215637.45029.qmail@web41129.mail.yahoo.com>, Eric
--- Jeremy Henty <jeremy@chaos.org.uk> wrote:
Eric Mahurin wrote:
Eric Mahurin wrote:
Eric Mahurin wrote:
[#146647] Problem in binding IWidget combobox to event — "Markus Liebelt" <markus.liebelt@...>
Hello all together,
[#146648] Ask for help about Regexp — Eric Luo <eric.wenbl@...>
Hi ,
[#146673] mkmf and oracle problem - not detecting header files — Daniel Berger <Daniel.Berger@...>
Hi all,
Have you set your ORACLE_HOME environment variable to the directory
[#146676] Rails: Seeing Apache Page instead of the Congratulations Page — "Jenjhiz" <jenjhiz@...>
Hello,
[#146677] SciTE — Jonas Galvez <jonasgalvez@...>
Can anyone share or point me to a decent syntax highlighting file for
[#146700] Anything in new Eclipse for Rubyists? — "jfry" <jeff.fry@...>
Hey there, I know that a number of folks on the list use Eclipse as
I tried multiple times to install the ruby plugin for eclipse 3.1. It's
Nope! I couldn't get it to work either...
On Tue, 28 Jun 2005 19:36:25 -0400, Amarison wrote:
JZ wrote:
[#146709] running unit tests in graphical mode — Joe Van Dyk <joevandyk@...>
Hi,
Joe Van Dyk ha scritto:
On 6/29/05, gabriele renzi <surrender_it@remove-yahoo.it> wrote:
Quoting Joe Van Dyk <joevandyk@gmail.com>:
[#146731] Qt 4.0 ruby bindings? — Ezra Zygmuntowicz <ezra@...>
I just noticed that Qt 4.0 has been released. http://
[#146745] heretix-user ML? — jm <jeffm@...>
Is the mailing list currently operational?
[#146751] Smart(er) platform detection — Matt Mower <matt.mower@...>
Hi folks,
[#146761] Re: Smart(er) platform detection — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
[#146766] regex and gsub quest — "Charles L. Snyder" <csnyder1@...>
Hi
[#146773] Programmers Contest: Fit pictures on a page — hicinbothem@...
GLOSSY: The Summer Programmer Of The Month Contest is underway!
On Wednesday 29 June 2005 10:30 am, hicinbothem@ems.att.com wrote:
marcus baker wrote:
Karl, I think you are (incorrectly) assuming that all the pictures have
[#146776] Patch to delegate.rb — christophe.poucet@...
Hello,
[#146791] Agile Development with Ruby on Rails — "Jenjhiz" <jenjhiz@...>
Hello,
On 6/29/05, Jenjhiz <jenjhiz@yahoo.com> wrote:
Joe Van Dyk wrote:
[#146815] shift vs. slice!(0) and others — Eric Mahurin <eric_mahurin@...>
I just did some benchmarking of various ways to insert/delete
Eric Mahurin wrote:
Nikolai Weibull wrote:
[#146820] Tk text widget and tk_textCut — Nigel Wilkinson <nigel@...>
Hi folks
[#146854] Can you use Erb outside of Apache? — "Kyle Heon" <kheon@...>
I hope this doesn't sound like an odd question but as I'm learning Ruby I'm
Nevermind. I figured it out.
[#146885] code coverage tools — Pierre Gambarotto <pierre.gambarotto@...>
I want to know if my unit tests are really testing all of my code.
[#146892] win32ole object creation failure — "Axel" <anieden@...>
Hello, Rubyists!
[#146897] Time.parse unavailable — Karol Hosiawa <hosiawak@...>
Hello,
[#146920] debugger issue — pat eyler <pat.eyler@...>
I'm running into an unexpected issue with the debugger, and I'm hoping someone
[#146929] Escape sequences for unicode chars? — Michael Schuerig <michael@...>
[#146933] Rails day results are in — Carl Woodward <cjwoodward@...>
Hi everyone,
[#146934] stupid TCP — Joe Van Dyk <joevandyk@...>
require 'socket'
MiniQuiz : Renesting Nodes (OWLScratch)
return unless bored? #MiniQuiz = do my 'work' for me.
I'm writing a library (OWLScratch) for converting wiki markup into
HTML. (The OWL part of the name is because it's derived from the
markup used by OpenWiki, hence "OpenWiki Language"; the Scratch is
because it's my own half-implemented flavor.)
It's not nearly ready yet, but the core concepts are working. So far,
it tokenizes the document into a series of hierarchically-nested
nodes. If I wanted XML, I could make up my own schema and be done.
But I want HTML.
In OWLScratch, the following represents a nested list:
* List item 1
* List item 2
* List item 2.1
* List item 2.2
* List item 3
* List item 3.1
* List item 3.1.1
Right now, that tokenizes into one node per line:
<bullet level="1">List item 1</bullet>
<bullet level="1">List item 2</bullet>
<bullet level="2">List item 2.1</bullet>
<bullet level="2">List item 2.2</bullet>
<bullet level="1">List item 3</bullet>
<bullet level="2">List item 3.1</bullet>
<bullet level="3">List item 3.1.1</bullet>
The challenge is that I need to be able to spin through the list and
(should be possible in one pass) properly nest those as the HTML
requires:
<ul> <-- new node!
<li>List item 1</li>
<li>List item 2
<ul> <-- new node, child of list item 2!
<li>List item 2.1</li>
<li>List item 2.2</li>
</ul> <-- closed because the next item is a lower level
<li>List item 3
<ul> <-- holy crap, it happened again!
<li>List item 3.1
<ul> <-- when will the madness end?
<li>List item 3.2</li>
</ul>
</li>
</ul>
</li>
</ul>
I know this should be not-hard, but I just played a full game of
Ultimate Frisbee, and I thought this might appeal to someone else.
The full library (so far, v0.0.1 or so) is attached, but I can (and
probably will have to) extend the Tag class to support DOM-like
properties such as previous_sibling and next_sibling. And make
reparenting a node properly remove it from the previous parent's
@child_nodes collection.
I'll speak more about OWLScratch in a few days, when I hope to have
it ready for a really preliminary release.
Oh, for extra credit - think about nested list types, as seen here:
http://openwiki.com/ow.asp?HelpOnFormatting#h9
(My lists do not (currently) allow content of a single item to be
manually wrapped onto multiple lines.)
Attachments (1)
require 'strscan'
#todo - override html conversion per factory
#todo - pass after scanning to properly reparent lists.
#todo - but I also like the name OWLScribble...no bird-tie in, but more fun
class OWLScratch
class TagFactory
def self.by_type
@by_type ||= {}
end
attr_reader :tag_name, :open_match, :close_match, :open_requires_bol, :close_requires_bol, :autoclose, :type, :allowed_type
def initialize( tag_name, options={} )
@tag_name = tag_name
[ :open_match, :close_match,
:open_requires_bol, :close_requires_bol,
:allowed_type, :autoclose,
:text, :attrs, :setup, :type ].each{ |k|
self.instance_variable_set( :"@#{k}", options[ k ] )
}
( self.class.by_type[ @type ] ||= [] ) << self if @type
end
def match( ss )
return nil unless ( !@open_requires_bol || ss.bol? ) && ss.scan( @open_match )
tag = Tag.new( @tag_name, self )
@setup.call( tag, ss ) if @setup
tag
end
end
class Tag
attr_accessor :tag_name, :child_nodes, :attrs, :parent_node
def initialize( tag_name, owning_factory )
@tag_name = tag_name
@owning_factory = owning_factory
@child_nodes = [ ]
@attrs = { }
end
def type
@owning_factory.type
end
def close_match
@owning_factory.close_match
end
def close_requires_bol?
@owning_factory.close_requires_bol
end
def autoclose?
@owning_factory.autoclose
end
def allowed_type
@owning_factory.allowed_type
end
def append_child( node )
puts "#{self.inspect}.append_child( #{node.inspect} )" if $DEBUG
@child_nodes << node
node.parent_node = self
node
end
def << ( str )
last_child = @child_nodes.last
if TextNode === last_child
last_child << str
else
append_child( TextNode.new( str ) )
end
end
def to_html
out = "<#{@tag_name}"
@attrs.each{ |k,v| out << " #{k}=\"#{v.to_s.gsub( '""', '"' )}\"" }
if @child_nodes.empty?
out << ' />'
else
out << '>'
@child_nodes.each{ |node|
out << node.to_html
}
out << "</#{@tag_name}>"
end
out << "\n" unless @owning_factory.type == :inline || @owning_factory.type == :td
out
end
def inspect
"<#{@tag_name}:#{@type}:#{@allowed_type}>"
end
end
class TextNode
attr_accessor :parent_node
def initialize( node_value='' )
@node_value = node_value
end
def << ( str )
@node_value << str
end
def inspect
"<TextNode '#{@node_value}'>"
end
def to_html
@node_value.htmlsafe!
end
end
TagFactory.new( :wiki_command,
:type => :block,
:open_match => /##(TableOfContents|DEPRECATED|BALETED|IncludePage\(\s*(.+)\s*\))##/, :open_requires_bol => true,
:setup => lambda{ |tag, ss|
tag.attrs[ :do ] = ss[1][ /[a-z]+/i ]
tag.attrs[ :param ] = ss[2] if ss[2]
},
:autoclose => true
)
TagFactory.new( :heading,
:type => :block,
:open_match => /(={1,6}) +(.+) +\1[ \t]*\n/, :open_requires_bol => true,
:setup => lambda{ |tag, ss|
tag.attrs[ :level ] = ss[1].length
tag << ss[2]
},
:autoclose => true
)
TagFactory.new( :hr,
:type => :block,
:open_match => /-{4,} *\n/, :open_requires_bol => true,
:autoclose => true
)
TagFactory.new( :bullet,
:type => :block,
:open_match => /(( )+) ?\* /, :open_requires_bol => true,
:close_match => /\n/,
:setup => lambda{ |tag, ss| tag.attrs[ :level ] = ss[ 1 ].length / 2 },
:allowed_type => :inline
)
TagFactory.new( :numberlist,
:type => :block,
:open_match => /(( )+) ?\d+\. /, :open_requires_bol => true,
:close_match => /\n/,
:setup => lambda{ |tag,ss| tag.attrs[ :level ] = ss[1].length / 2 },
:allowed_type => :inline
)
TagFactory.new( :alphalist,
:type => :block,
:open_match => /(( )+) ?[a-z]\. /, :open_requires_bol => true,
:close_match => /\n/,
:setup => lambda{ |tag,ss| tag.attrs[ :level ] = ss[1].length / 2 },
:allowed_type => :inline
)
TagFactory.new( :dl,
:type => :block,
:open_match => /(?=( |\t)+; .+ : )/, :open_requires_bol => true,
:close_match => /(?!( |\t)+; .+ : )/, :close_requires_bol => true,
:allowed_type => :deflist
)
TagFactory.new( :pre,
:type => :block,
:open_match => /^([ \t]*)\{\{\{\n(.+?)\n\1\}\}\}\n/m, :open_requires_bol => true,
:close_match => /\n/,
:setup => lambda{ |tag,ss| tag << ss[2].gsub( /^#{ss[1]}/, '' ) },
:autoclose => true
)
TagFactory.new( :table,
:type => :block,
:open_match => /(?=\|\|)/, :open_requires_bol => true,
:close_match => /(?=[^|])/, :close_requires_bol => true,
:allowed_type => :table
)
TagFactory.new( :p,
:type => :block,
:open_match => /(( )+) ?: /, :open_requires_bol => true,
:close_match => /\n/,
:setup => lambda{ |tag,ss| tag.attrs[ :indent ] = ss[1].length / 2 },
:allowed_type => :inline
)
# The paragraph is the catch-all for blocks;
# it must appear after all other block factories
TagFactory.new( :p,
:type => :block,
:open_match => /(?=\S)/, :open_requires_bol => true,
:close_match => /\n\n/,
:allowed_type => :inline
)
TagFactory.new( :tr,
:type => :table,
:open_match => /(?=\|\|)/, :open_requires_bol => true,
:close_match => /\|\|[ \t]*\n/,
:allowed_type => :td
)
TagFactory.new( :td,
:type => :td,
:open_match => /((?:\|\|)+)\s*/,
:close_match => /(?=\s*\|\|)/,
:setup => lambda{ |tag,ss|
colspan = ss[1].length / 2
tag.attrs[ :colspan ] = colspan unless colspan < 2
},
:allowed_type => :inline
)
TagFactory.new( :dt,
:type => :deflist,
:open_match => /( |\t)+; /, :open_requires_bol => true,
:close_match => / : /,
:allowed_type => :inline
)
TagFactory.new( :dd,
:type => :deflist,
:open_match => /(?=.)/,
:close_match => /\n/,
:allowed_type => :inline
)
TagFactory.new( :b,
:type => :inline,
:open_match => /\*\*/, :close_match => /\*\*/,
:allowed_type => :inline
)
TagFactory.new( :i,
:type => :inline,
:open_match => /\/\//, :close_match => /\/\//,
:allowed_type => :inline
)
TagFactory.new( :strike,
:type => :inline,
:open_match => /--/, :close_match => /--/,
:allowed_type => :inline
)
TagFactory.new( :sup,
:type => :inline,
:open_match => /\^\^/, :close_match => /\^\^/,
:allowed_type => :inline
)
TagFactory.new( :sub,
:type => :inline,
:open_match => /__/, :close_match => /__/,
:allowed_type => :inline
)
TagFactory.new( :tt,
:type => :inline,
:open_match => /@@([^\n]+?)@@/,
:setup => lambda{ |tag,ss| tag << ss[1] },
:autoclose => true
)
TagFactory.new( :tt,
:type => :inline,
:open_match => /\{\{\{([^\n]+?)\}\}\}/,
:setup => lambda{ |tag,ss| tag << ss[1] },
:autoclose => true
)
TagFactory.new( :todo,
:type => :inline,
:open_match => /!!([a-z].+?)!!/i,
:setup => lambda{ |tag,ss| tag << ss[1] },
:autoclose => true
)
TagFactory.new( :a,
:type => :inline,
:open_match => /(?:HTTP|FTP|HTTPS):\/\/\S+/,
:setup => lambda{ |tag,ss|
tag.attrs[ :href ] = ss[0]
tag << ss[0]
},
:autoclose => true
)
TagFactory.new( :a,
:type => :inline,
:open_match => /\[((?:HTTP|FTP|HTTPS):\/\/\S+) ([^\]]+)\]/,
:setup => lambda{ |tag,ss|
tag.attrs[ :href ] = ss[1]
tag << ss[2]
},
:autoclose => true
)
TagFactory.new( :wiki_link,
:type => :inline,
:open_match => /[A-Z]{2,}[a-z][a-zA-Z]*|[A-Z][a-z]+[A-Z][a-zA-Z]*/,
:setup => lambda{ |tag,ss|
tag.attrs[ :page ] = ss[0]
tag << ss[0].dewikiword
},
:autoclose => true
)
TagFactory.new( :wiki_link,
:type => :inline,
:open_match => /\[\[([^\]\n]{2,}?)\]\]/,
:setup => lambda{ |tag,ss|
tag.attrs[ :page ] = ss[0]
tag << ss[0]
},
:autoclose => true
)
TagFactory.new( :wiki_link,
:type => :inline,
:open_match => /\[([A-Z]{2,}[a-z][a-zA-Z]*|[A-Z][a-z]+[A-Z][a-zA-Z]*) ([^\]]+)\]/,
:setup => lambda{ |tag,ss|
tag.attrs[ :page ] = ss[1]
tag << ss[2]
},
:autoclose => true
)
def initialize( owl_string )
@ss = StringScanner.new( owl_string )
@root = Tag.new( :root, TagFactory.new( :root, :type => :root, :allowed_type => :block ) )
@current = @root
#todo - preparse de-html of invalid tags
while !@ss.eos?
puts "Step with @current = #{@current.inspect} : #{(@ss.peek(20)+'...').inspect}" if $DEBUG
# Keep popping off the current tag until we get to the root,
# as long as the end criteria is met
while ( @current != @root ) && (!@current.close_requires_bol? || @ss.bol?) && @ss.scan( @current.close_match )
@current = @current.parent_node || @root
end
# No point in continuing if closing out tags consumed the rest of the string
break if @ss.eos?
# Look for a tag to open
tag = nil
TagFactory.by_type[ @current.allowed_type ].each{ |factory|
if tag = factory.match( @ss )
@current.append_child( tag )
@current = tag unless tag.autoclose?
break
end
}
next if tag #found one, start over
# Couldn't find a valid tag at this spot
# so we need to eat some characters
if @ss.scan( /~([A-Z]{2,}[a-z][a-zA-Z]*|[A-Z][a-z]+[A-Z][a-zA-Z]*|\[\[([^\]\n]{2,}?)\]\]|\[(?:[A-Z]{2,}[a-z][a-zA-Z]*|[A-Z][a-z]+[A-Z][a-zA-Z]*) [^\]]+\])/ )
# Shove negated links directly as text
consumed = @ss[1]
else
# Man, it would be nice if I could do a lookahead here
# and consume more than a few characters at a time!
#Hopefully no opening or closing tags are based on letters or changes in tab/spaces;
#if that's not true, the next line must be foregone in favor of the (slow)
#one-char-at-a-time consumption
consumed = @ss.scan( /[a-z \t]+|./m )
#consumed = @ss.scan( /[a-z]+|[ \t]+|./m )
#consumed = @ss.getch
end
@current << consumed if @current.allowed_type == :inline
end
end
def to_s
out = ''
@root.child_nodes.each{ |el|
out << el.to_html
}
out
end
end
class String
def htmlsafe
self.dup.htmlsafe!
end
def htmlsafe!
self.gsub!( /&/, '&' )
self.gsub!( /</, '<' )
self.gsub!( />/, '>' )
self
end
def dewikiword
self.gsub( /([a-z])([A-Z])/, '\\1 \\2' )
end
end
if __FILE__ == $0
str = <<ENDTEXT
##TableOfContents##
= Welcome to the OWLScribble =
//An introduction to the markup.//
== What is OWLScribble? ==
~OWLScribble is a wiki markup language //based on// the markup used by [HTTP://www.openwiki.org/ OpenWiki]. It was designed for use with the ~SewWiki project by GavinKistner.
== Supported Markup ==
=== Basic Inline Styling ===
{{{
This text **is bold**, this //is italic//, and --this has been struck--.
This is a @@code reference@@, as is {{{this text}}}.
A double-exclamation point is a special 'todo' item. !!Add more examples!!
You can also ^^superscript^^ and __subscript__ text, like H__2__O or e^^pi*i^^.
}}}
This text **is bold**, this //is italic//, and --this has been striked--.
This is a @@code reference@@, as is {{{this text}}}.
A double-exclamation point is a special 'todo' item. !!Add more examples!!
You can also ^^superscript^^ and __subscript__ text, like H__2__O or e^^pi*i^^.
* //Unlike ~OpenWiki, you are not allowed to underline text. Sorry, but underlining is reserved for links in hyperlinked documents.//
=== Headings ===
{{{
= Heading Level 1 =
== Heading Level 2 ==
=== Heading Level 3 ===
==== Heading Level 4 ====
===== Heading Level 5 =====
====== Heading Level 6 ======
}}}
Headings must begin at the start of the line. Markup inside headings is ignored. (So, for example, {{{== My //Sweet// Heading ==}}} will show the {{{//}}} characters in the output.)
=== Linking ===
!!Put content here!!
=== Lists ===
==== Bulleted Lists ====
{{{
1 2 3 4
1234567890123456789012345678901234567890
* Bulleted lists must have **two** spaces per indent level.
* **A space** must appear after the asterisk.
* They may be nested to an arbitrary depth.
}}}
* Bulleted lists must have **two** spaces per indent level.
* **A space** must appear after the asterisk.
* They may be nested to an arbitrary depth.
==== Numbered Lists ====
{{{
1 2 3 4
1234567890123456789012345678901234567890
1. Numbered lists must have **two** spaces per indent level.
1. The actual number doesn't matter
3. But the period after the number does.
1. As well as the space after the period.
1. All lists types can be nested.
}}}
1. Numbered lists must have **two** spaces per indent level.
1. The actual number doesn't matter
3. But the period after the number does.
1. As well as the space after the period.
1. All lists types can be nested.
==== Letter Lists ====
!!Put content here!!
==== Definition Lists ====
!!Put content here!!
* !!Note no nesting!!
==== Mixing Lists ====
!!Put content here!!
=== Tables ===
|| **Age** || **Sex** || **Weight** ||
|| 32 || M || 180 ||
|| 30 || F || 150 ||
|||| average || 165 ||
== Processing Directives ==
!!Put content here!!
##IncludePage(ProcessingDirectives)##
== Miscellaneous ==
HTML entities are not needed (and do not work) inside OWLScribble; you can type {{{"this & that"}}} and it will produce the HTML {{{this & that}}}, displaying as "this & that". Typing {{{&}}} will actually show "&".
Finally, we end with a few big paragraph blocks with no styling in them at all, for speed testing purposes:
: Dry dog food is far better than canned! It is more economical, takes up less space, and is generally better tasting. With reconstituted dried milk (and sugar if you like) most dry food tastes not too different from dry breakfast cereal. A hundred pound sack of dry dog food contains as many calories as a ton of fresh potatoes. The dog food also contains protein, vitamins, etc., that the potatoes do not.
: Our understanding of the rubber bag has led us to an effective tool that accurately indicates whether too much, too little, or just the right amount of food is going in. In the last chapter you've learned how to work that tool, integrating it into your daily and monthly routine so the information it yields can guide your eating.
: All the information in the world, however, doesn't change a thing until somebody takes action based upon it. In losing weight, "somebody" is your body. Now we'll turn to planning meals to control the calories that go in. Analysis of the trend based on daily weight measurements is the key engineering trick to weight control. Meal planning for predictable calorie intake is the central management tool which closes the circle and achieves control over weight.
: The goal of meal planning is a predictable and reliable daily calorie intake. We can't really wear an eat watch to tell us when to stop eating, but we can accomplish the same objective with a little paperwork in advance. By planning meals then sticking to the plan, you're not only guaranteed to achieve your goal, you eliminate the uncertainty about meals and the need for on-the-fly judgements about what, when, and how much to eat that are a prime contributor to weight gain in people living stressful, chaotic lives.
: Planning meals in advance may seem foreign; an act that stamps out some of the precious spontaneity that makes life enjoyable. I think you'll see the reality isn't that bad, but first consider why planning meals is worth discussing at all. Eating is important; it's one of very few things in life that isn't optional. If you don't eat, you die. If you eat too much for too long, you die. You wouldn't consider for a moment investing in a company that had no budgets, where everybody said, "We just spend whatever we feel like from day to day, and hope it will all work out in the long run." Not only would such a business be prone to bankruptcy, its managers would have no way of knowing where the money was going; there'd be no way to measure actual performance against goals to discover where problems lay. No, only a fool would risk his money on such a venture.
: Yet by trying to "wing it" with regard to what you eat, to balance your long term calorie intake meal by meal, making every decision on the spur of the moment, you're placing something even more precious than your money, your own health, in the hands of a process you know inevitably leads to serious trouble.
: You encounter, in business, the rare exceptions: managers who can run a small to medium sized business without a budget or a plan. They are "naturals," endowed either with a talent for assimilating vast quantities of detail and extracting the meaning within, or else with a sixth sense for emerging problems and an instinct for solving them. These rare individuals, born with a "sense for business," are the managerial equivalent of people with a built-in eat watch like Skinny Sam. They can get along without the help of the numbers and calculations the rest of us need to steer a steady course.
: So it is with weight control. Just because some people manage without planning their meals doesn't mean it'll work for you or me. We must, like most managers in business, supplement our unreliable instincts with numbers that chart our goal and guide us there.
: In business, a budget collapses a huge amount of de- tail, the individual transactions, into a small collection of numbers: how much money is allocated to various general purposes. In planning meals, all the multitude of foods and the infinite variety of meals are similarly reduced to a single number: calories per day. To plan meals, it's essential to know how many calories per day you're trying to eat. Where does that number come from?
: As you gain more and more experience monitoring and controlling your weight, you'll collect enough information to know precisely how many calories your own body needs per day. Until then, you can start with guidelines for people about like you. Based on your height, frame size, and sex look up the calories burned per day in the tables on pages 36 and 37. Pick a number in the middle of the range given. For example, Dietin' Doris, five foot four in her bare feet with an average build, would start with a calorie target of 1770. (The range in the table runs from 1574 to 1967, and the average of these numbers is (1574 + 1967) 2 = 1770.)
: This target assumes Doris' goal is maintaining her present weight. If she wants to lose or gain weight, it must be adjusted based on the daily calorie shortfall or excess she intends. To lose weight at the rate of one pound per week, Doris should eat 500 fewer calories per day than she burns. (Thus, over a week she'll end up 3500 calories shy and hence burn off 3500 calories of fat: one pound.)
: Subtracting the calorie cutback, 500, from the number she burns gives the number she can eat per day. Her calorie target is thus 1770 500 = 1270 calories per day.
ENDTEXT
#$DEBUG = true
require 'benchmark'
parser, out = nil
Benchmark.bm( 10 ){ |x|
x.report( "Node Tree" ){
parser = OWLScratch.new( str )
}
x.report( "To HTML" ) {
out = parser.to_s
}
}
puts out
end