[#400832] Need someone to do assessment - will pay $10! — "Mohammed A." <lists@...>
Hi,
[#400838] command prompt problem with windows 7 — Al Baker <lists@...>
I'm new to this, so forgive me noobishness(is that a word?) and have a
Am 02.11.2012 07:52, schrieb Al Baker:
> Are you really sure that the file `argv.rb' is in your current
[#400843] Simple question — "August Y." <lists@...>
I have just picked up ruby and am trying to teach my self. so this
[#400846] exception: can't convert nil into String — Peter Bailey <lists@...>
Hello,
You don't set the pdffile variable anywhere.
Bartosz Dziewo=C5=84ski wrote in post #1082535:
[#400858] Support for multiple Inheritance by classes — Ross Konsolebox <lists@...>
Will Ruby ever support multiple inheritance through classes instead of
I think I can say "no" with a fair amount of confidence.
unsubscrev please
Arlen Cuss wrote in post #1082618:
Even though other languages handle multiple inheritance without any
Peter Hickman wrote in post #1082748:
Well the example you gave at the head of this thread is pretty meaningless.
Peter Hickman wrote in post #1082753:
Ok then lets return to your puzzle problem. Given the first example that
Peter Hickman wrote in post #1082761:
On 4 November 2012 14:57, Ross Konsolebox <lists@ruby-forum.com> wrote:
> If you really want a Ruby-like language with multiple
[#400861] ruby -r debug -> "Emacs support available" — "listgj-ruby@..." <listgj-ruby@...>
Forgive my ignorance, but what does that "Emacs support available" message =
[#400862] unsubscrever forum, RETIRAR, DELETAR PLEASE, UNSUBSCREVER DO FORUM — sancozz@...
[#400865] why does UnboundMethod need to remember the class it was retrieved from (not merely owner)? — "Mean L." <lists@...>
class Base; def foo; end end
An unbound method can be called only after it is bound to an object
Igor Pirnovar wrote in post #1082653:
Mean L. wrote in post #1082655:
Igor Pirnovar wrote in post #1082666:
Mean L. wrote in post #1082678:
Igor Pirnovar wrote in post #1082685:
Mean L. wrote in post #1082686:
Igor Pirnovar wrote in post #1082688:
Mean L. wrote in post #1082704:
[#400873] image hexcode — Adriana Mikolaskova <lists@...>
Hello,
[#400912] Display Text as Image — Adriana Mikolaskova <lists@...>
Hello,
[#400914] login web page using mechanize — john smith <lists@...>
new to ruby, love the language. read programmatic programmers guide to
thank you. i am going to try your suggestion. is copybara a gem? i will
ok i need help with capybara. i keep finding pages with info about using
ive been trying to look up xpath and css selectors. i have my program
[#400946] Ruby under Valgrind shows a ton of memory errors -- normal? — Alex Dowad <lists@...>
Hi,
[#400985] How to merge two or more hashes in to one? — "Jermaine O." <lists@...>
Hi everyone.
Well, in this case I don't really see the advantage of using sets. The
Jan E. wrote in post #1083271:
Hi,
Jan E. wrote in post #1083135:
Jermaine O. wrote in post #1083143:
Jan E. wrote in post #1083144:
Jermaine O. wrote in post #1083159:
> The same thing can be achieved with Enumerable#inject, which is the
[#400994] putting values in one lines — Ferdous ara <lists@...>
Hi,
[#401006] Ruby Gem Dev IDE or editor? — Ziq Qwerty <lists@...>
I am making a ruby gem but I have to create a project structure and rake
[#401007] Type confusion: Java vs. Ruby — Regina George <lists@...>
Preface: this is my first day using Ruby
[#401026] Site down watir-webdriver — ajay paswan <lists@...>
Whenever a site is down it keeps on looking for it for sometime and
[#401027] Closing popups watir-webdriver — ajay paswan <lists@...>
Sometimes popup comes when a link is clicked, sometimes popup comes when
[#401028] open-uri, nokogiri and UTF-8 to US-ASCII — Panagiotis Atmatzidis <atma@...>
Hello,
If one were to examine the ruby URI docs, how would one know that there
[#401046] Need help improving this FileUtils.cp of an array of destinations — Robert Hansen <lists@...>
Hi
[#401079] Ruby script to process html — Mario Trento <lists@...>
Hi,
Or maybe you have a hint how to extract value between <td>...</td>,
[#401098] RSpec question about catching expected exception in class .new — tamouse mailing lists <tamouse.lists@...>
I have the following I'm trying to test:
[#401123] Heroku question — Kasenath Nao <lists@...>
Is Heroku for uploading my pure ruby(not rails) application and letting
[#401125] Complete newbie — "Carlos A." <lists@...>
Hey guys!
Your mac already comes with a computer programming text editor--it's
On Sat, Nov 10, 2012 at 3:32 PM, 7stud -- <lists@ruby-forum.com> wrote:
True. Why not try Gedit or maybe sublime text 2? Just a suggestion.
[#401141] Instance name of a class/object? — Carolyn Grant <lists@...>
Hi! I'm quite new to Ruby, and am quite confused about instance names.
[#401143] Trouble with http post — "Shaun A." <lists@...>
I am trying to create an http post request that sends a series of
[#401161] Convert date to string — Ferdous ara <lists@...>
Hi
Subject: Convert date to string
> You will have a Time object (do ri Time to know more), on which you
Am 11.11.2012 19:57, schrieb Ferdous ara:
On Mon, Nov 12, 2012 at 6:23 AM, <sto.mar@web.de> wrote:
Am 12.11.2012 15:45, schrieb Hassan Schroeder:
[#401173] question on watir — Raj pal <lists@...>
I am automating Idit application using Ruby, at one screen I can't feed
[#401191] Extending Array instances — Charles Hixson <charleshixsn@...>
I'm trying to figure out a good way to extend an Array, when the items
Charles Hixson wrote in post #1084111:
Brian Candler wrote:
On Mon, Nov 12, 2012 at 10:12 PM, Charles Hixson
[#401200] Efficient way for comparing records between 2 large files (16 million records) — Ruby Student <ruby.student@...>
Team,
Hello,
Robert,
[#401203] Python or RUBY? — "Radu M." <lists@...>
Hi.What do you think is easier?
[#401211] Calling Ruby from C (reverse SWIG) — Graham Menhennitt <graham@...>
TXkgQyBwcm9ncmFtIGNhbGxzIGEgdGhpcmQtcGFydHkgV2luZG93cyBETEwgdG8gcHJvdmlkZSBh
[#401245] Beginner with project in mind — Dan Dan <lists@...>
Hi, I've recently started learning ruby and have a project in mind.
[#401264] Need of ruby and Scripting language — NagaLakshmi _N <lists@...>
Hi..
We don't have to use a scripting language, but if you're a Ruby beginner, it sounds like you might have chosen to anyway!
[#401270] best method for creating a new gem in 1.9.3 land — tamouse mailing lists <tamouse.lists@...>
I'm starting to work on a new gem, a command line application.
[#401274] following along with "Beginning Ruby." — Al Baker <lists@...>
I'm having trouble following along with some of the examples in this
I tried to delete a directory that I created.
I did. I got:
[#401279] Question on exceptions — Justin Gamble <lists@...>
Hello! I have a simple bank program where I have to have an exception
What is the reason of doing the .new(...)in
Justin Gamble wrote in post #1084635:
On Fri, Nov 16, 2012 at 1:43 AM, Brian Candler <lists@ruby-forum.com> wrote:
On Fri, Nov 16, 2012 at 9:27 AM, tamouse mailing lists
On Fri, Nov 16, 2012 at 6:27 AM, Robert Klemme
[#401282] Re: creating users with LDAP — "Marcelo G." <lists@...>
You are certainly not obligated to answer any postings but I was
[#401297] why texts are jumbled using PDF-reader. — ajay paswan <lists@...>
I am using pdf-reader gem and trying to look for some content at some
[#401301] Alternatives to methods for large number of nested "ifs" — Philip Rhoades <phil@...>
People,
Philip Rhoades wrote in post #1084734:
[#401336] Advice for simple client/server application — Panagiotis Atmatzidis <atma@...>
Hello,
Subject: Advice for simple client/server application
[#401340] Cannot install heroku gem — Kunio Takamoto <lists@...>
Hi,
[#401344] adding load_path — Jia Hu <hujia06@...>
Hi all:
[#401364] Metaprogramming — "Aurimas N." <lists@...>
Hello,
Aurimas N. wrote in post #1085124:
7stud, you are being needlessly belligerent. A moment's Googling would tell you that Aurimas is not a native English speaker, and you should adjust your attitude accordingly.
[#401366] Magical 57.6 minutes in Time — Todd Benson <caduceass@...>
irb(main):80:0> RUBY_VERSION
[#401371] Missing Something — "Ron S." <lists@...>
I am an amateur programmer, and I feel I am missing something. Whenever
Thanks, Chris! I have spent time thinking about ALL of those things.
On Mon, Nov 19, 2012 at 5:27 PM, Ron S. <lists@ruby-forum.com> wrote:
[#401380] some gems not working anymore — johnny mo <lists@...>
hi,
[#401402] C Extension Shutdown GC vs Free Functions Called — Robert Buck <lists@...>
It was my assumption that during shutdown the objects would be freed
Robert Buck wrote in post #1085583:
Unsure if this really applies. Could you restate? I am not quite
[#401404] "undefined method `synchronize' for #<Mutex:0xa0f5adc>" from embedded Ruby program — Graham Menhennitt <graham@...>
I'm writing a C++ program (on Centos 5 Linux) that embeds a Ruby 1.9.3
On 21/11/2012 5:38 PM, Graham Menhennitt wrote:
Ah: prelude.rb defines Mutex#synchronize and Thread.exclusive in Ruby.
On 22/11/2012 1:09 PM, Arlen Cuss wrote:
[#401422] how to increase variable inside the while loop — Ferdous ara <lists@...>
Hi, my question might be confusing as its hard for me to make it clear,
[#401430] mysql drama! — Al Baker <lists@...>
I'm havng trouble using mysql in my example.
[#401433] Call SharePoint web services in Ruby — Baba Ghaytadkar <lists@...>
Hello Team,
On Wed, Nov 21, 2012 at 9:58 PM, Baba Ghaytadkar <lists@ruby-forum.com> wrote:
[#401434] Instance-variable-like user API — Garthy D <garthy_lmkltybr@...>
[#401438] ruby 1.9.3p237 in cygwin — botp <botpena@...>
definitely not a ruby-core dev here, so hope this is ok to post.
On 22/11/2012 19:16, botp wrote:
[#401449] CSV:mode must be 'r', 'rb', 'w', or 'wb' — ajay paswan <lists@...>
Why this code is giving error:
[#401450] Errno::ECONNREFUSED in net/ssh — Sambath Kumar Moorthy <lists@...>
Hi,
[#401451] Arrays with records as objects — Steve Tucknott <lists@...>
I am completely new to Ruby.
[#401452] Optimal number of threads in real browser testing — ajay paswan <lists@...>
Am writing a program for multithread real browser testing using ruby
[#401458] working with mysql in ruby — john smith <lists@...>
i have been trying to successfully connect ruby with mysql. there are a
I just tried reinstalling ruby, i installed the devkit. i do have vmware
На 25.11.2012 г. 20:39 ч., john smith написа:
Ivan Cenov wrote in post #1086301:
> You can put the lib\libmysql.dll available in this package to your
[#401481] declarative database schemes - automatically create migration files? — Marc Weber <marco-oweber@...>
I'm looking for something like this:
[#401490] Ruby XMLRPC OpenSSL::SSL::SSLError — Mohammed Yasin Rahman <Mohammed-Yasin.Rahman@...6.fr>
Hi,
On Fri, Nov 23, 2012 at 7:00 AM, Mohammed Yasin Rahman
On Fri, Nov 23, 2012 at 7:26 AM, Mohammed Yasin Rahman
I am using ruby 1.9.3p194 (2012-04-20 revision 35410) =
On Fri, Nov 23, 2012 at 7:50 AM, Mohammed Yasin Rahman
[#401516] I'm exploiting Ruby references — Nokan Emiro <uzleepito@...>
Hi,
On Sat, Nov 24, 2012 at 2:39 AM, Nokan Emiro <uzleepito@gmail.com> wrote:
[#401520] C Extension: Why would VALUE state appear differently during shutdown than immediately before it? — Robert Buck <lists@...>
I have a graph of objects in a C extension, and as such I maintain
For the record, if anyone else tries to write a database driver, or any
[#401529] How to create a gem which conditionally compiles/installs a C extension? — "Rocky B." <lists@...>
I have a gem that needs to compile and install a C extension on MRI
> * Figure out some way in the gem to dynamically disable compiling the
[#401565] browser.html diffrent from the page source - watir-webdriver — ajay paswan <lists@...>
Hi,
[#401567] click on link not working with ie #watir-webdriver — ajay paswan <lists@...>
Greetings,
Found this on another forum, does it help?
[#401577] Few unclosed browser — ajay paswan <lists@...>
I have the following program using watir-webdriver, I have made the code
[#401578] atomic statements in multithreading — ajay paswan <lists@...>
suppose I am working in multiple thread each thread runs following
On Mon, Nov 26, 2012 at 12:03 PM, ajay paswan <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1086457:
[#401581] Own sort method — "Artem B." <lists@...>
I have wrote my own sort method for array:
[#401597] Contribuer à Diaspora — Flaburgan <flaburgan@...>
[#401598] Algorithm for choosing object based on priority — Damjan Rems <lists@...>
Since I am not computer graduate (electro engineer as mater of fact) I
On Mon, Nov 26, 2012 at 3:23 PM, Damjan Rems <lists@ruby-forum.com> wrote:
Thanks so much. I guess I was over-complicating.
On Mon, Nov 26, 2012 at 6:10 PM, Damjan Rems <lists@ruby-forum.com> wrote:
On Mon, Nov 26, 2012 at 6:30 PM, Jes=FAs Gabriel y Gal=E1n
[#401607] Novice: Understanding instance 'variables' and methods — Steve Tucknott <lists@...>
A question - or comment - on instance variables.
[#401616] Ruby + Selenium-webdriver — "Mattias A." <lists@...>
Hi,
[#401635] error in if — Mohammed Yasin Rahman <Mohammed-Yasin.Rahman@...6.fr>
WHat's the error here?
[#401644] Getting the smallest Items of an Array — "Ismail M." <lists@...>
Hello guys,
>> def n_min(l,n) (1..n).map {a=l.min ; l=l-[a]; a } end
2012/11/29 Regis d'Aubarede <lists@ruby-forum.com>:
On Thu, Nov 29, 2012 at 12:02 PM, Regis d'Aubarede <lists@ruby-forum.com> wrote:
[#401655] gem problems(sigh) — Al Baker <lists@...>
i tried to make a gem and tried to build the spec file and this is what
[#401672] Using model methods without an object for that model — comopasta Gr <lists@...>
Hi, I'm implementing an API to create records for one type of object in
Ha, I think this one was better on the ruby on rails space of the forum.
[#401674] CGI question — Assaf Shomer <lists@...>
Ruby Beginner question.
[#401676] How to know in which class we are when inheriting — Mario Ruiz <lists@...>
Look at this code:
Hi,
Well, it is more complicated what i want to do... but doint it like you
On Wed, Nov 28, 2012 at 12:51 PM, Mario Ruiz <lists@ruby-forum.com> wrote:
Hey Robert it doesn't work for me that way, i'm using 1.8.7 and i cannot
[#401687] Multidimensional Array — "John M." <lists@...>
Hi ,
[#401688] sorting data from a file — "Ismail M." <lists@...>
Hey guys,
of course I see your point Jan E.
I haven't done any thing yet.. i just didn't know where to start.
[#401706] Newbie question: (free) on-line courses? — Ken D'Ambrosio <ken@...>
Hello, all. There's a bunch of free on-line training for Javascript,
Codecademy just added Ruby.
Some basic lessons at www.oldkingjames.org click link top of page to lesson=
[#401711] Page Objectt design with Selenium Watir-Webdriver — "Mattias A." <lists@...>
Hi,
[#401724] This is not working. — "Radu M." <lists@...>
Hi...I tried this code:
[#401730] Need advice- would like to implement a delayed-load proxy class — Gary Weaver <lists@...>
I'd like to have const_missing return a class that would do the
[#401733] Simple script not working — Prog Rammer <lists@...>
Hi,
It looks like your browser can't establish a connection. Firewall?
[#401740] Trouble with Chronic — Joel Pearson <lists@...>
I've decided to try Chronic to make it easier (hopefully) to get certain
[#401753] removing directories — Peter Bailey <lists@...>
Hello,
[#401770] An example in Exception Handling with Ruby. — "Nathan Mr." <lists@...>
Source file is attached. I'm new to this forum so I don't know if there
[#401772] Ordered Hash (v. 1.8) — Doug Jolley <lists@...>
I am running Ruby v. 1.8.7 and I have installed the orderedhash gem. I
[#401791] Ocra build error — Joel Pearson <lists@...>
I'm confused by this, I can't see any reason for Ocra to fail in
[#401807] Gem install error? — Al Baker <lists@...>
i tried to install my own gem and got this:
Re: Question on exceptions
On Sat, Nov 17, 2012 at 8:40 AM, Carlo E. Prelz <fluido@fluido.as> wrote: > Subject: Re: Question on exceptions > Date: Sat 17 Nov 12 12:47:06PM +0900 > > Quoting tamouse mailing lists (tamouse.lists@gmail.com): > >> Do you (or anyone else who'd like to chime in!) have a ... set of >> heuristics, maybe? .. that help you know when it's appropriate and >> when it's not? > I will try to describe in words the fuzzy logic I follow. > > I do not often use exceptions. In more than seven years of using Ruby, > I have probably only subclassed Exception once or twice. Well, there are other uses of exceptions than defining your own. :-) One could even go as far as to say that you use exceptions if you use code that throws exceptions - even if there is no trace of catching exceptions in your code. That makes sense from a certain perspective because you rely on the fact that the code you use will raise exceptions if errors surface. > The Ruby interpreter's usage of exceptions is mostly limited to grave > events. What exactly is a "grave event"? > I try to mimic this usage in my raising practices. Basically, > exceptions should only indicate situations that have to be debugged > out: an exception should never indicate a special, but acceptable, > case. I beg to disagree. An IO error which surfaces is usually not something you will be tackling by debugging. You might be the invoker of a script who learns that way the the file name you passed on the command line was wrong. There may also be an network error because your WLAN lost connection spuriously etc. > I come from C (I still use C). Practice in C tends to be that your > procedures return non-zero in case of errors - the non-zero value > indicates the type of error. This can be cascaded: you check the > return value, and return the same if negative, and so on. But it can > certainly escalate to awkwardness, especially if at some level your > function has to return other data. What you describe neatly shows the major disadvantages of error handling via return type checking: - It is cumbersome (you need to check a lot return values). - It has to be done manually (i.e. you can forget it). - Propagation to invokers is tedious. - The error handling code is intermixed with regular code which makes the code harder to read. Of course, in C you do not have much choices since there are no exceptions in the language. > For me, the advantage of the exception mechanism is that it has its > own, separate distribution channel. If you do not catch an exception, > the program terminates, with VERY useful debugging data: the message > of the exception, and the backtrace. Absolutely. > When I encounter an exception, the catching option is not the > preferred one. If at all possible, I try to modify the code so that > the special case either does not happen, or is specifically handled, > in a programmatic way. Often you cannot do that. For example in the IO error case mentioned above the only thing you could do would be check the file for existence and readability before opening it. But since other processes have access to the file system as well that still does not give you 100% safety that the file is still there when you are going to open it. So just opening it and handling the exception (or just propagating it up the call stack) is the simpler option because the exception may come anyway. You end up with less code and a clearer structure. And in a way you avoid redundancy (duplicate checks for existence and accessibility). > If I catch an exception, I can do so at any of the steps of the > backtrace. Often it is useful to make use of the exception-raising > logic to get out of some of the levels of the call tree. Or put it differently: often it makes sense to handle an exception remote from to where it originated. > This iterative process is part and parcel of the testing phase that > all new code has to undergo. Every situation is different. If you > really care about the healthy operation of your code, every choice > should be tuned to the specific case. The process cannot be made > automatic. Automatic coding/debugging results in mediocre programs. Right, and if it was possible at all, we would be without jobs. :-) > In all cases, I would not use the exception mechanism in the example > that the original poster makes. Rather, the BankAccount#withdraw > method would return true (or possibly the new balance of the account) > if the withdraw method was successful, and false otherwise. Ruby has a > neat syntax for catching false/nil values: > > unless(account.withdraw(sum)) > ... # alternative account.withdraw(sum) or do_something_else > The condition of insufficient funds is maybe undesirable from the > point of view of the account holder, but it is a perfectly legitimate > situation; all mechanisms that handle withdrawals should foresee and > properly manage it. Withdrawals *can* fail. It should not be an > exception-al event from the point of view of the code. Unless for example the program cannot verify itself that funds are sufficient. It is not a too uncommon scenario to rely on database functionality (constraints) to ensure a negative balance is not reached. In this case the RDBMS driver's exception is necessary to learn of the violation because even if you do the check beforehand there can still be a transaction modifying the balance between the check and the withdraw (depending on concurrency model of the RDBMS of course, in Oracle and Postgres, where reads are not blocked by writes, you would either need explicit locking or work with the exception). > This is just an effort to put into words my craft. Every other > craftsman/woman will most probably follow different ways. I think your stress of context is very important. The downside is that it takes some time and experience to feel comfortable in all situations to decide on the proper way. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/