[#396091] Crystal Report Integration in ROR — rohini kambde <lists@...>
Can anyone please tell me in detail about how to integrate crystal
Hello Rohini,
[#396107] rvm - how to run a ruby script via crontab? — Wybo Dekker <wybo@...4all.nl>
I have, for the first time, installed ruby using rvm.
On 06/03/2012 12:57 AM, Wybo Dekker wrote:
[#396126] Read from several .txt files by a pattern and write the matched lines to a new file — Robert Hansen <lists@...>
Just to be said. I am new to ruby.
$files = Array.new
[#396136] appropriate use of constants — roob roob <lists@...>
I am making a program that will get settings from a config file. I am
[#396148] Facebook Group — Moses Aronov <mosesaro@...>
There is a facebook group that was recently created so we could all communicate with other fellow developers
On Wed, Jun 06, 2012 at 01:55:48AM +0900, Moses Aronov wrote:
On Wed, Jun 6, 2012 at 3:45 PM, Chad Perrin <code@apotheon.net> wrote:
On Wed, Jun 6, 2012 at 3:40 PM, Henry Maddocks <hmaddocks@me.com> wrote:
[#396152] Deadlock in large vm_xmalloc while doing backtrace — Bill Paulson <lists@...>
I work on a fairly large Ruby application that runs as a daemon,
[#396153] XML::Parser, keeping file open — Grant Schoep <lists@...>
Using:
[#396154] celluloid-io performance — Alexander Koch <lists@...>
Hi,
[#396158] Net::SFTP hangs when downloading a file. — Tim Uckun <timuckun@...>
I have some code which attempts to download some data from an sftp
[#396161] convert delphi codes to ruby — RR TT <lists@...>
Hello, I have some sample delphi codes which I want to convert to Ruby
On Wed, Jun 6, 2012 at 9:09 AM, RR TT <lists@ruby-forum.com> wrote:
[#396166] Ruby script running standalone on vserver — Michael Dutchman <lists@...>
Hello guys!
On Wed, Jun 6, 2012 at 10:54 AM, Michael Dutchman <lists@ruby-forum.com> wrote:
If the script needs to be run periodically (once a day or hour or
On Wed, Jun 6, 2012 at 11:17 AM, Peter Hickman
[#396172] Magic comments justification — "Raphael B." <lists@...>
Hi,
The encoding has to be set *before the file is even parsed*. So
Bartosz Dziewoński wrote in post #1063320:
2012/6/6 Raphael B. <lists@ruby-forum.com>:
[#396186] Inexplicable Argument Error — Doug Jolley <lists@...>
I am encountering a very strange argument error. I simplified my code
2012/6/6 Doug Jolley <lists@ruby-forum.com>:
> Methods ending with = can usually
[#396192] Getting runtime error while using Tk.restart — Aakash Dev <lists@...>
Hi All,
[#396197] string character count — ideal one <lists@...>
Hi,
[#396203] "Create a rock paper scissors program in ruby WITHOUT using conditionals" — "David D." <lists@...>
I'm in an introductory software development class, and my homework is to
[#396229] Thread#kill is not rescued by "rescue Exception" — Iñaki Baz Castillo <ibc@...>
Hi, let me show this easy code:
On Thu, Jun 7, 2012 at 4:12 AM, Iki Baz Castillo <ibc@aliax.net> wrote:
2012/6/13 Tony Arcieri <tony.arcieri@gmail.com>:
2012/6/7 I単aki Baz Castillo <ibc@aliax.net>:
2012/6/7 Iñaki Baz Castillo <ibc@aliax.net>:
2012/6/7 Iñaki Baz Castillo <ibc@aliax.net>:
[#396246] Best way to partition a string — "cyber c." <lists@...>
Hi,
2012/6/7 cyber c. <lists@ruby-forum.com>:
[#396248] First post - need projects to practice — Andrew Barrymore <lists@...>
Hello there!
[#396259] about using drb to read data — "dongcan z." <lists@...>
In my codes , I use drb to read data from a pipe. I want to read the
On Fri, Jun 8, 2012 at 5:15 AM, dongcan z. <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1063691:
[#396276] Cannot run a ruby 1.8.7 web-app with ruby 1.9.3 — Ruby Ruby <lists@...>
hi
On Fri, Jun 8, 2012 at 2:41 PM, Ruby Ruby <lists@ruby-forum.com> wrote:
Robert Klemme wrote in post #1063702:
[#396287] Problem with storing timestamp as datetime object — "cyber c." <lists@...>
Hi,
[#396296] Ruby API sub and gsub error? — "Daniel B." <lists@...>
So I am looking at the Ruby API for sub and gsub.
[#396312] Class variables and self — Mike Glaz <lists@...>
I'm currently reading The Well-Grounded Rubyist. In the section about
[#396322] Accessing Variables from Within a Module — Doug Jolley <lists@...>
I have the following Ruby script:
Hi,
> What are you trying
Doug Jolley wrote in post #1063908:
> From the description I'm guessing you want to use the module as a mixin
[#396333] Is "a,b=c,d" atomic? or do I need a Mutex? — Iñaki Baz Castillo <ibc@...>
Hi, I have two methods that could be called by different threads and
2012/6/10 Iñaki Baz Castillo <ibc@aliax.net>:
It is atomic on MRI. It may or may not be on other interpreters, if
2012/6/10 Bartosz Dziewoナгki <matma.rex@gmail.com>:
On Sun, Jun 10, 2012 at 7:52 PM, Iテアaki Baz Castillo <ibc@aliax.net> wrote:
2012/6/11 Robert Klemme <shortcutter@googlemail.com>:
[#396341] OpenSSL: Determining initialization vector (IV) created using OpenSSL::Cipher::Cipher#pkcs5_keyivgen with one argument — T P <tty0pts@...>
Hi,
[#396354] cgi class prints garbage in HTML output — Ruby Ruby <lists@...>
Hi everybody
[#396357] ffi - Popping image on top of the screen — "Damián M. González" <lists@...>
Ey guys, how are you? I`m developing an application in Ruby, using
[#396360] Chris Pine "Learning Programming" Question — Michael Sung <lists@...>
I'm still going through Chris Pine's book on Ruby programming and came
[#396373] Why should I learn ruby? — Kasper Steensig <lists@...>
I have wondered whether I should learn ruby or python hence they are
On Mon, Jun 11, 2012 at 12:17 PM, Kasper Steensig <lists@ruby-forum.com>wrote:
On Wed, Jun 13, 2012 at 12:18:32PM +0900, Josh Cheek wrote:
[#396412] How can i get the value from a simple html form using ruby? — gmspro gmspro <lists@...>
It's running ~/public_html/runwebrick.rb=>
[#396418] Problem with reg exp — "cyber c." <lists@...>
Hi,
[#396422] require_relative? why didn't we "relative do" — Intransition <transfire@...>
I wonder if it would been better if we had gone another route with the
[#396430] Unsubscribe me — Mondini David <mondinid@...>
Unsubscribe me from this list, please.
[#396436] string.chars.to_a question — Michael Sung <lists@...>
Hello,
[#396441] How to edit particular element value from list of xml elements using ruby — Lucky Nl <lists@...>
Hi friends,
Hi,
[#396458] is there a C function for creating a instance of a given class by passing N arguments? — Iñaki Baz Castillo <ibc@...>
Hi, sure I miss something in the Ruby MRI C API, but I don't find a
[#396469] Calling methods, getting string and adding them — Michael Sung <lists@...>
I was wondering why this is not being accepted? I get an error stating
On 14/06/12 08:48, Michael Sung wrote:
On Thu, 2012-06-14 at 05:54 +0900, Sam Duncan wrote:
[#396479] sort of rational numbers — Dan Connelly <lists@...>
I was a bit surprised when I ran the following
[#396490] Simple method & array question — Michael Sung <lists@...>
Hi,
[#396503] Syntax Highlighter — Intransition <transfire@...>
Would you agree that Ruby shouldn't lack for a syntax highlighting library
[#396517] Parsing xml dict files — "cyber c." <lists@...>
Hi,
[#396534] File.delete()-Permission denied error in windows — Periyasamy Ramachandiran <lists@...>
All,
[#396562] Help using optionparser — "cyber c." <lists@...>
Hi,
[#396576] method parameters — "Zhomart M." <lists@...>
Hello,
[#396589] Unsubcripe — Suresh Rajkumar <sureshrajchennai@...>
Unsubcipe my mail address from the group.
Hello,
Because you people are dumb.
And if you do so you will find that it does not work.
[#396606] TO MR Bartosz Dziewoナгki - WHO'S DUMB — Cathy Alomari <cathy1428@...>
*On Jun 18, 2012, at 7:59 AM, Bartosz Dziewoナгki wrote:
On Mon, Jun 18, 2012 at 2:30 PM, Cathy Alomari <cathy1428@gmail.com> wrote:
Bet you're still here.
I'm here to help you fix your Ruby issues, not your life issues. I'm
@bartosz -
On Tue, Jun 19, 2012 at 03:30:46AM +0900, Cathy Alomari wrote:
[#396615] Symbols and Strings... — Hal Fulton <rubyhacker@...>
Hello, all...
On Jun 18, 2012, at 15:09, Hal Fulton wrote:
On Tue, Jun 19, 2012 at 12:31 AM, Eric Hodel <drbrain@segment7.net> wrote:
Personally, I don't have a problem with "reducing the contract"
On Tue, Jun 19, 2012 at 5:17 PM, Hal Fulton <rubyhacker@gmail.com> wrote:
> > Freezing an object also reduces its contract.
On Tue, Jun 19, 2012 at 10:12 PM, Hal Fulton <rubyhacker@gmail.com> wrote:
2012/6/20 Henry Maddocks <hmaddocks@me.com>:
On 06/20/2012 03:58 PM, Henry Maddocks wrote:
On Wed, Jun 20, 2012 at 5:06 PM, Jeremy Bopp <jeremy@bopp.net> wrote:
[#396616] Re: Unsubcribe — Tim O'Brien <timobrien@...>
Bartpscz can kiss my ass ! I too was sent the confirmation, but I am still getting these e-mails.
[#396627] Does ERB have recursive template support? — Todd Wei <lists@...>
I want to use ERB template library to do some code generation. It
On Tue, Jun 19, 2012 at 5:26 AM, Todd Wei <lists@ruby-forum.com> wrote:
I am currently using ERB for code generation. I implemented this using a xml
Robert Klemme wrote in post #1065085:
On Wed, Jun 20, 2012 at 3:22 AM, Todd Wei <lists@ruby-forum.com> wrote:
[#396649] Looking for a better way to add a method to a core class than monkey patching — Iain Barnett <iainspeed@...>
Hi all,
Please do not monkey patch core libraries in gems, unless the *purpose* of
On Wed, Jun 20, 2012 at 3:51 AM, Henry Maddocks <hmaddocks@me.com> wrote:
Ok, sorry to be the cause of confusion and/or consternation!
Am 20.06.2012 02:23, schrieb Avdi Grimm:
> Here an example method that I use from time to time:
[#396652] Access array data - problem — Rasmus Sorensen <lists@...>
hi!
[#396664] Sinatra and Shotgun error — Robert Ahlberg <lists@...>
Hi while running Sinatra I do get output from the webrick server running
[#396685] Benchmark obsession? — "Jan E." <lists@...>
Hi,
On Jun 20, 2012 5:57 PM, "Ryan Davis" <ryand-ruby@zenspider.com> wrote:
[#396686] Ruby vs Python vs Java bytecode concept — gmspro gmspro <lists@...>
Hi,
Daniel Hernandez писал 20.06.2012 20:03:
[#396705] Array index confusion — "John R." <lists@...>
I cannot find an answer to this, and perhaps the answer is that "it is
See this post for an explanation: http://www.ruby-forum.com/topic/1393096#990065
[#396737] New to Ruby - Scope Question — Emeka Patrick <lists@...>
x = 10
[#396751] simple_gui_creator 0.1.3 released — Roger Pack <lists@...>
Hello all. I would like to wish happy birthday to my simple_gui_creator
[#396761] How to debug ruby source code using gdb?, can't print array content — gmspro gmspro <lists@...>
I tried something like this in array.c
Ruby has GDB helpers. Take a look at https://github.com/ruby/ruby/blob/trunk/.gdbinit
Alex Newone wrote in post #1065644:
[#396775] Reading only certain rows of data from a text file — Jason Peterson <lists@...>
Hi Everyone,
[#396794] Stripping symbol character from hash turned to array — Emeka Patrick <lists@...>
Hi, new to programming and Ruby and trying to work through some problems
[#396805] Enumerable#unassociate — Intransition <transfire@...>
Have a look:
On Mon, Jun 25, 2012 at 1:35 AM, Intransition <transfire@gmail.com> wrote:
On Monday, June 25, 2012 2:38:48 AM UTC-4, Robert Klemme wrote:
[#396807] have_func() does not find a func in the given .h file — Iñaki Baz Castillo <ibc@...>
Hi, in my extconf.rb I check some Ruby functions (since I'm trying
[#396815] Array#sample is Set#sample and not Array#sample ! — Michel Demazure <lists@...>
Arrays are ordered, sets are not. Sampling an array should give random
On Mon, Jun 25, 2012 at 4:53 PM, Michel Demazure <lists@ruby-forum.com> wrote:
[#396834] Neworking side of ruby — smoothed atol412 <lists@...>
Hello all,
[#396839] working with two arrays — skolo pen <lists@...>
What method could I use to do the following:
[#396854] rake db: create not working — Sakchhi Srivastava <lists@...>
I am trying to use a RoR project. I went through the installation steps.
[#396867] Match part of the calculated value — ideal one <lists@...>
Hi,
[#396877] CSV.open problem, help please — Kaye Ng <lists@...>
This code doesn't seem to work
On 06/27/2012 06:14 PM, Kaye Ng wrote:
Try "rb" instead or "r"
Ryan Davis wrote in post #1066268:
Windoze new lines are stupid. Read up on the "b" file mode to see what it does.
Ryan Davis wrote in post #1066299:
Ryan Davis wrote in post #1066410:
2012/6/27 Jan E. <lists@ruby-forum.com>:
[#396883] help for a little regexp — Quentin R-G <lists@...>
Hi everyone,
[#396892] how about adding method hook — salamond <jarodzz@...>
Hi, guys.
[#396896] Copying text from MS Word and wrapping in HTML - help please — Adam Holloway <lists@...>
Hi,
[#396914] Is this good code — masta Blasta <lists@...>
I'm digging through some older code in my application and i stumbled on
[#396920] Audio based Instructions (via Ruby and Linux)? — Marc Heiler <lists@...>
Hi.
[#396924] should $1 propagate through method calls? — Roger Pack <lists@...>
Hello all.
[#396948] Slide Show (S9) 1.2.1 Update - Quick Starter Templates, Takahashi, etc. — Gerald Bauer <gerald.bauer@...>
Hello,
[#396950] Is this the correct use of rand? — Emeka Patrick <lists@...>
In the example below why was it necessary to put (max+1)? Couldn't that
On Thu, Jun 28, 2012 at 9:44 AM, Emeka Patrick <lists@ruby-forum.com> wrote:
On Thu, Jun 28, 2012 at 11:05 AM, Robert Klemme
[#396959] Confusion about aliasing eql? and == — Jeff Storey <lists@...>
I'm new to ruby and have some confusion about the eql? and == methods. I
[#396960] Asynchronous IO — F1 dreamer <lists@...>
I have found quite a bit on the web regarding asynchronous IO, but
[#396966] Interactions between 'new' and 'initialize' ? — Cees Zeelenberg <lists@...>
In JRuby, I am extending an existing Java Class with a Ruby initialising
I redefined 'new' for Parent, not for Child, so I expected the 'new' for
On Thu, Jun 28, 2012 at 5:30 PM, Cees Zeelenberg <lists@ruby-forum.com> wrote:
[#396975] stack level too deep for quicksort code — bei zhao <lists@...>
Hi, below is my quicksort implementation in ruby(using the first element
By the way, this low level element swapping isn't necessary in Ruby. The
On 06/29/2012 11:28 AM, Jan E. wrote:
[#396996] Accessor Methods with a Twist — Doug Jolley <lists@...>
I am surprised that the code shown below returns, 'Doug'. I would
On 06/29/2012 08:33 AM, Doug Jolley wrote:
Oh. I see. My knee-jerk reaction from reading the responses was, "Why
Hi,
Thanks, Jan, so much for that *VERY* thorough response.
Doug Jolley wrote in post #1066813:
Thanks again for another very thorough response.
[#397000] Ruby pty and expect — "Tim L." <lists@...>
I'm trying to write a program that will log into a list of ip's and run
[#397001] ruby performance — anaray anaray <lists@...>
Hi,
maybe try jruby in --server mode?
The MRI is, unfortunately, slow as balls, and there's not much you can
Bartosz Dziewoナгki wrote in post #1066673:
2012/6/29 Hans Mackowiak <lists@ruby-forum.com>:
2012/6/29 Hans Mackowiak <lists@ruby-forum.com>:
Bartosz Dziewoński wrote in post #1066681:
2012/7/1 Andreas S. <lists@ruby-forum.com>:
On Sun, Jul 1, 2012 at 1:42 PM, Bartosz Dziewoナгki <matma.rex@gmail.com> wrote:
Here's my contribution:
2012/7/2 Dan Connelly <lists@ruby-forum.com>:
I should provide version numbers... the RHEL on work machines is pretty
On Tue, Jul 3, 2012 at 8:06 AM, Dan Connelly <lists@ruby-forum.com> wrote:
Enumerable#every, the Functor and Ruby support for HOM
Have you heard of `Enumerable#every`? It lets you apply a method call to
all elements of an enumerable. Check it out...
[1,2,3].every + 3 #=> [4,5,6]
[1,2,3].every * 3 #=> [3,6,9]
words = ["hello", "world"]
words.every.upcase!
words #=> ["HELLO", "WORLD"]
Essentially every is a convenient and nicely readable "fluent notation"
alternative to using a map/collect block.
Now you might be wondering how this bit of magic is achieved? Here is the
definition.
module Enumerable
def every
Functor.new do |op,*args|
map{ |a| a.send(op,*args) }
end
end
end
As you can see it works via something called a "Functor". Generally
speaking, a "functor" is simply an object that encapsulates a function. In
this case I have used the term as a concise reference to a specialized form
of such to achieve <a href="
http://en.wikipedia.org/wiki/Higher_order_message">Higher Order
Messaging</a>. The basic definition of this class is:
class Functor
def initialize(&function)
@function = function
end
def method_missing(op, *args, &blk)
@function.call(op, *args, &blk)
end
end
This Functor class can be used in many many ways. Enumerable#every is just
one of many examples. In fact, Ruby's own Enumerator class is actually just
a highly specialized type of Functor.
As useful as a Functor can be, it does however have two downsides. First it
depends on #method_missing. This means public Object methods
can interfere with its usefulness. This can be worked around by making
Functor a subclass of BasicObject. Though a few public methods remain, this
is good enough for all practical purposes. A more problematic issue is the
fact that it requires the creation of an indeterminate object every time
the a method using a Functor is called. This is pretty inefficient, slows
things down and requires us to be memory conscious. Caching can be used in
some cases, but rarely is it an ideal fix.
Recently I came up with an idea that would allow these issues to be
circumvented entirely. I realized that since this is a higher order
*message*, then really it would be best handled as a messaging issue
--hence via the definition of a "higher order method". In other words if
Ruby had built-in support for the concept, the intermediate object would
not be necessary and consequently interfering public methods would not
exist. To facilitate this, I came up with a potential notation. Here's how
it would be used to define Enumerable#every:
module Enumerable
def every => op, *args
map{ |a| a.send(op,*args) }
end
end
(Hmm... as I typed this it occurs to me that maybe `=>` would be more
intuitive if it pointed the other way using `<=`.) Regardless of the actual
notation used, the idea is to allow Ruby to handle higher-order-messages
internally as a special type of method.
For reference here are a few other examples of using Functor:
*
https://github.com/rubyworks/facets/blob/master/lib/core/facets/string/file.rb
*
https://github.com/rubyworks/facets/blob/master/lib/core/facets/kernel/ergo.rb
*
https://github.com/rubyworks/facets/blob/master/lib/core/facets/kernel/not.rb
P.S. There is also a functor gem out there, but it is not the Functor as
defined above. The functor gem came along well after the one described here
(which is included with Ruby Facets). The gems's implementation is
basically a kind of struct that supports multiple dispatch capabilities.
The above is much more generic and actually can even be used to create the
functor gem's more specialized kind with just a bit of extra code.