From: Bob Cober Date: 2006-10-20T07:35:38+09:00 Subject: unsubscribe On Tuesday, October 17, 2006, at 06:00PM, wrote: >James Mccarthy wrote: >> Scott, >> >> A couple of things, probably not the cause, but you seem to have some >> of the naming conventions mixed... >> >> assuming that both files are in the same directory, it is good practice >> to not use cases in your file names, so I would code them; >> >> ----------------------------------------------------------------- >> testclass.rb >> ----------------------------------------------------------------- >> class TestClass >> def testMethod() >> return "Hello I am in TestClass" >> end >> end >> >> ----------------------------------------------------------------- >> classtester.rb >> ----------------------------------------------------------------- >> require 'testclass' >> >> ob = TestClass.new() >> puts("Testing: #{ob.testMethod()}") >> ----------------------------------------------------------------- >> >> The require is the filename without the .rb extension. > >No I used require 'testclass', and I tried running it in freeIDE, and >for some reason it actually ran, so I don't know what the deal is when I >try to run it from console, it just gives me that rubygem custom require >error. > >-- >Posted via http://www.ruby-forum.com/. > > >Hi -- > >On Wed, 18 Oct 2006, Gavin Kistner wrote: > >> From: Ajithkumar Warrier [mailto:a.varier@gmail.com] >>> I am a newbie and the answer to this might be too simple. >>> How do I improve the example below and reduce the number of passes >>> over the string? >>> >>> string = "This is an example string. The purpose is to save the >>> delimiter during split. Does this work. Great!!!." >>> >>> re = /(\.\s+)(\D)/ >>> string.gsub!(re,'\1'+'#'+'\2') >>> b = string.split('#') >>> puts b >> >> p string.scan( /\w[^.!?]+\S+/ ) >> >> #=> ["This is an example string.", "The purpose is to save the delimiter >> during split.", "Does this work.", "Great!!!."] > >Also, in 1.9, with oniguruma, you can do: > > string.split(/(?<=\.)\s+/) > >(negative lookbehind). > > >David > >-- > David A. Black | dblack@wobblini.net >Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] >DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] >[1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com >[2] http://dablog.rubypal.com | [4] http://www.rubycentral.org > > >What??? No one can help me??? > >I know this is not a very sexy topic, but I thought this was the place >to ask for help. > >I just need to learn a little bit on how to use the FreeRIDE debugger. > >I am trying to run it on Windows XP system and it just seems to hang. >SO I don't know if I am doing something wrong, or if I have to set >something up before I click on the debugger icon. > >Since there are no real docs on this, I thought I should ask for help >here. > >PLEASE help if you can, or point me to an online resource that has some >specific basic examples on how to use it. > >THANKS > >Snoopy > > >-- >Posted via http://www.ruby-forum.com/. > > >Greg Hauptmann wrote: >> ok - so just run the install executable over my existing installation >> then I >> guess? > >Just be aware that it will probably wipe out anything in your ruby >directory, including gems and anything else, last I heard. > >-Justin > > >memcache-client version 1.2.0 has been released! > > http://dev.robotcoop.com/Libraries/memcache-client > >memcache-client is a pure-ruby client to Danga's memcached. > >Changes: > >= 1.2.0 > >NOTE: This version will store keys in different places than previous >versions! Be prepared for some thrashing while memcached sorts itself >out! > >* Fixed multithreaded operations, bug 5994 and 5989. > Thanks to Blaine Cook, Erik Hetzner, Elliot Smith, Dave Myron (and > possibly others I have forgotten). >* Made memcached interoperable with other memcached libraries, bug > 4509. Thanks to anonymous. >* Added get_multi to match Perl/etc APIs > > > http://dev.robotcoop.com/Libraries/memcache-client > >-- >Eric Hodel - drbrain@segment7.net - http://blog.segment7.net >This implementation is HODEL-HASH-9600 compliant > >http://trackmap.robotcoop.com > > > > >On Wed, 18 Oct 2006 00:39:20 +0900, M. Edward (Ed) Borasky wrote: > >> Ken Bloom wrote: >>> On Tue, 17 Oct 2006 08:46:42 -0400, Paul wrote: >>> >>>> I'm exploring learning RoR, then using it for a new start project. Been >>>> reading allot of RoR comparisons to Java.... I'm not formally educated in >>>> enterprise client/server and have some Q's regarding some of what I've read. >>>> >>>> 1. Two-phase commit: The general tone I read was "if you need a two-phase >>>> commit, use Java." What is a two-phase commit? When/Why/Where would I want >>>> it? Since I lived without it so far, I think I'm OK now, but I like to plan >>>> projects with potential for future growth. If someday I did have a business >>>> case for 2-phase commit, could I do something in RoR to meet that need? >>> >>> Two phase commit is a protocol for commiting a single transaction that >>> spans multiple databases. It's supposedly difficult to do in Java too, but >>> if you need it you can look into database middleware that can coordinate >>> distributed transactions so that it appears to your rails app as >>> though you're only working with one database. >>> >>> --Ken Bloom >>> >> >> Two-phase commit is what makes transactions have the ACID properties! >> Lack of two-phase commit is a show-stopper for many database-backed >> applications, and if Rails doesn't support it somehow, I'd be extremely >> surprised. > >You're thinking of two phase locking. Two phase locking ensures ACI in a >database (whether distributed or not), by acquiring all locks in a >transaction as you query/update the objects needed (the first phase), and >by releasing them all at the same time[*] when you commit (the second phase). > >In two phase commit, the coordinator of a distributed transaction queries >all of the distributed sites and asks them whether it's safe to commit. If >any veto the commit (or miss the timeout indicating that they have >crashed), the coordinator tells all sites to roll back. Otherwise, the >coordinator tells all sites to go ahead and commit. > >--Ken >[*] the "same time" requirement technically makes this "strict two phase >locking". >-- >Ken Bloom. PhD candidate. Linguistic Cognition Laboratory. >Department of Computer Science. Illinois Institute of Technology. >http://www.iit.edu/~kbloom1/ >I've added a signing subkey to my GPG key. Please update your keyring. > > >9 digits in a string "123456789", convert to individual Fixnums >[1,2,3,4,5,6,7,8,9], or as below > >a, b, c, d, e, f, g, h, i = id.scan(/\d/).map(&:to_i) > >Simpler yet how about ["1", "2", ...]. Is scan the only direct way? > >I tried the "*" mechanism, no such luck, and tried array slicing again >no luck. TIA >-- >John Pywtorak >Cal Poly State University >ITS/ASAS >805-756-5906 > > > > >Hello all, > >As I am going through my ruby book (Trying to learn Ruby of course) on >how to use flow control, one of the exercises is to create a program >that sings "99 bottles of beer on the wall" > >I have started to create this program and I am at the point where I want >to test what I have done so far (code is not finished). When I try to >run my code, I get the following error: > >99bottles.rb:10: syntax error, unexpected tIDENTIFIER, expecting kEND >puts number + ' bottles of beer on the wall, ' number + ' bottles of >beer. Take > ^ > one down pass it around' > > >The snipet of code its referring to is: > >puts number + ' bottles of beer on the wall, ' number + ' bottles of >beer. Take one down pass it around' > >My first thought is that my spacing between the variable "number" and >the "+" sign are screwing things up but I can't seem how since to me >that clearly looks OK. > >It could also be that I just don't understand how to properly right a >variable into a string, but to me that also looks right ( I even tried >it with the .to_s and still nothing). > >Can anyone help me understand what I am doing wrong? > >-- >Posted via http://www.ruby-forum.com/. > > >