[#392923] ruby executable on ubuntu — mark kirby <markkirby80@...>
Hi
mark kirby wrote in post #1043353:
On 02/06/2012 09:59 AM, Adam Ms. wrote:
Jeremy Bopp wrote in post #1044360:
[#392950] Compile 1.9.3 on cygwin — Robert Klemme <shortcutter@...>
Hi,
[#392962] process_shared -- Python's multiprocessing for Ruby — Roger Pack <rogerpack2005@...>
Hello all.
On Wed, Feb 1, 2012 at 11:49 AM, Roger Pack <rogerpack2005@gmail.com> wrote:
[#392967] How to add javascript in a partials — "basha c." <cooolbasha@...>
Hi,
[#392979] Starting a process and specifying its parent — Victor Blaga <vic.blaga@...>
Hi,
[#392999] Reading specific columns on a text file — Cassio Godinho <cassiopgodinho@...>
Hello everyone.
[#393012] Basic Ruby performance — Dmitry Nikiforov <dniq@...>
Hello all!
Here's another example with significantly bigger performance difference:
On Fri, Feb 3, 2012 at 12:20 AM, Ryan Davis <ryand-ruby@zenspider.com>wrote:
On Thu, Feb 2, 2012 at 7:01 PM, Ryan Davis <ryand-ruby@zenspider.com> wrote:
Ryan Davis wrote in post #1043813:
On 02/02/2012 08:21 PM, Dmitry Nikiforov wrote:
Ryan Davis wrote in post #1043801:
On Fri, Feb 3, 2012 at 6:20 AM, Dmitry Nikiforov <dniq@dniq-online.com> wro=
Tried rubinius and jruby. Rubinius so far is the fastest one, but still
[#393050] Choosing target network for UDP broadcast — Ivo Wever <wever@...>
If I send a UDP packet containing 'foo' like this:
[#393076] Problem migrating to Ruby 1.9.2 — Patrick Bayford <pbayford@...>
Some assistance please - I have a Ruby project, which I started in Ruby
On Fri, Feb 3, 2012 at 11:02 PM, Patrick Bayford <pbayford@talktalk.net> wrote:
[#393083] Inheritance in other notation — luk malcik <aport99@...>
Hi everybody! I've got a problem with ingeritance. If there is a
On Sat, Feb 4, 2012 at 2:14 AM, Jeremy Bopp <jeremy@bopp.net> wrote:
[#393085] 4 random numbers take highest 3 and add them together. — h4y4shi 13bladex <serpentinexcubed@...>
I want to get 4 random numbers. The numbers will be between 1-6. I want
[#393086] libv8 problem — Phil Dobbin <phildobbin@...>
-----BEGIN PGP SIGNED MESSAGE-----
[#393096] Encoding error — Guillaume Ebuprofen <guillaume.dorchies@...>
Hello,
[#393115] Hooking a function to run in IRB context (but only in IRB context)? — Marc Heiler <shevegen@...>
Hi.
[#393124] Simple even and odd number loop in Ruby — Viera Tarcova <faithfromslovakia@...>
Hello guys, I am trying to develop a simple loop in Ruby. You need to
[#393128] inheritance one more time — luk malcik <aport99@...>
Hi, similar topic was here but still I can't do that. This is my code:
[#393131] Error with splat params in method definition — Jones Lee <joneslee85@...>
I'd like to ask why having:
[#393161] formal argument cannot be a constant — Hasmukh Patel <tohasmukh@...>
def display_method(NM)
[#393164] Using _ like in Scala? — Marc Heiler <shevegen@...>
fruits = %w( apple banana orange )
On Mon, Feb 6, 2012 at 10:54 AM, Marc Heiler <shevegen@linuxmail.org> wrote:
On Mon, Feb 6, 2012 at 7:21 PM, Tony Arcieri <tony.arcieri@gmail.com> wrote:
On Mon, Feb 6, 2012 at 5:56 PM, Eric Christopherson <
On Mon, Feb 6, 2012 at 9:07 PM, Tony Arcieri <tony.arcieri@gmail.com> wrote:
On Tue, Feb 7, 2012 at 6:56 AM, Kevin <darkintent@gmail.com> wrote:
On Tue, Feb 7, 2012 at 4:47 AM, Robert Klemme <shortcutter@googlemail.com>wrote:
On Tue, Feb 7, 2012 at 1:00 PM, Josh Cheek <josh.cheek@gmail.com> wrote:
On Tue, Feb 7, 2012 at 9:15 AM, Robert Klemme <shortcutter@googlemail.com>wrote:
On Wed, Feb 8, 2012 at 3:43 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
On Wed, Feb 8, 2012 at 5:58 AM, Robert Klemme <shortcutter@googlemail.com>wrote:
On Wed, Feb 8, 2012 at 4:30 PM, Josh Cheek <josh.cheek@gmail.com> wrote:
On Wed, Feb 8, 2012 at 9:57 AM, Robert Klemme <shortcutter@googlemail.com>wrote:
On Thu, Feb 9, 2012 at 1:39 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
[#393170] Make a file read-only? — Intransition <transfire@...>
Hi, I can make a file writeable easy enough,
[#393174] NOT executing if statement — Hasmukh Patel <tohasmukh@...>
#!/usr/bin/ruby
[#393181] Tork 18.0.0 — "Suraj N. Kurapati" <sunaku@...>
Tork - Test with fork - https://github.com/sunaku/tork#readme
You have faster major version release cycle than Chrome...
Am 06.02.2012 22:07, schrieb Bartosz Dziewoナгki:
Marvin G=C3=BClker wrote in post #1044440:
On Tue, Feb 7, 2012 at 02:36, Suraj Kurapati <sunaku@gmail.com> wrote:
On Tue, Feb 7, 2012 at 10:11, Ryan Davis <ryand-ruby@zenspider.com> wrote:
Whoops, sorry for the late response folks. (Although I enabled
[#393184] net-http-persistent 2.4.1 Released — Eric Hodel <drbrain@...7.net>
net-http-persistent version 2.4.1 has been released!
Just thought I'd say thanks for this awesome library.
[#393221] DCI v0.1.0 released — transfire@...
DCI 0.1.0 has been released.
[#393227] A better way? — Dave Castellano <dcastellano1@...>
Hi,
[#393231] Appending to an Array — Anthony Simonelli <asimonelli01@...>
I am querying a database using DBI and ODBC. After I run the execute, I
[#393268] A better way implement "it" the ruby way — Bravo Man <thebravoman@...>
Hi,
[#393269] Require bug confirmation: possible 'times' method error — Tom Clarke <tarclarke@...>
Hi all,
I think you're seeing expected behavior here.
Hi Randy,
[#393318] Difference between reurn and "not return" — Ralph Shnelvar <ralphs@...32.com>
Why is this syntactically value
[#393323] Introducing Schizo, A DCI gem — "Christopher J. B." <cjbottaro@...>
Schizo - DCI (data, context and interaction) for Ruby / Rails /
[#393325] While calling module, throwing error — Hasmukh Patel <tohasmukh@...>
Mymodule.rb
[#393339] RubyGems Sporadic Weirdness — Steve Johnston <steve.r.johnston@...>
I've been chasing my tail on this problem for a couple days now and its
[#393347] Symbol garbage collection — Dido Sevilla <dido.sevilla@...>
I've always wondered why Ruby didn't do garbage collection of symbols,
On Fri, Feb 10, 2012 at 8:28 AM, Dido Sevilla <dido.sevilla@gmail.com> wrote:
On Fri, Feb 10, 2012 at 11:07 AM, Robert Klemme
2012/2/10 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan@gmail.com>:
On Fri, Feb 10, 2012 at 1:48 PM, Robert Klemme
Hi,
Hi,
Symbols currently have the nice property of being guaranteed (at least
[#393353] How does && work in ruby — Phil Carter <pcarter42@...>
Hi there,
[#393372] How do I save a Net::BER::BerIdentifiedString as a binary file? — Edward Stembler <ejstembler@...>
Anyone know how to save a Net::BER::BerIdentifiedString as a binary
[#393374] Return First Value that Passes — Jonah Jameson <justindallas@...>
Hello Everyone,
[#393380] @@@@@@@@@@@ Louisville vs West Virginia live free Top 25 NCAA Basketball Watch Online HD on Pc — shil shilbari <shilbari5@...>
Watch Louisville vs West Virginia live free Top 25 NCAA Basketball
On Sat, Feb 11, 2012 at 5:22 AM, shil shilbari <shilbari5@yahoo.com> wrote:
[#393394] wATCH Ortiz vs Berto live stream HBO Boxing 11 Feb 2012 — modumaloti modumaloti <modumaloti69@...>
When Victor Ortiz and Andre Berto faced off the first time the entire
[#393402] Who Administrates this list and how can the community help save this list from the noise. — andrew mcelroy <sophrinix@...>
It is very clear that this list has been under a incredibly heavy
+1
Good luck, I doubt anyone is paying attention. I have seen numerous
On Sat, Feb 11, 2012 at 1:12 PM, Cathy Alomari <cathy1428@gmail.com> wrote:
On Sat, Feb 11, 2012 at 10:48 AM, Darryl L. Pierce <mcpierce@gmail.com>wrote:
2012/2/13 Cathy Alomari <cathy1428@gmail.com>:
> Have you tried mailing ruby-talk-ctl@ruby-lang.org (mailto:ruby-talk-ctl@ruby-lang.org) with "unsubscribe"
On Mon, Feb 13, 2012 at 1:26 AM, Rimantas Liubertas <rimantas@gmail.com>wrote:
On Tue, Feb 14, 2012 at 2:19 AM, Cathy Alomari <cathy1428@gmail.com> wrote:
On Sun, Feb 12, 2012 at 10:28 AM, Ryan Davis <ryand-ruby@zenspider.com>wrote:
[#393412] the ruby syntax — maven apache <apachemaven0@...>
Hi:
When a hash is the last argument to a method, you can skip its open-
2012/2/12 Bartosz Dziewo=C5=84ski <matma.rex@gmail.com>
On Sun, Feb 12, 2012 at 10:49 PM, maven apache <apachemaven0@gmail.com> wro=
On Mon, Feb 13, 2012 at 5:19 AM, Saji Hameed <saji@u-aizu.ac.jp> wrote:
2012/2/13 Josh Cheek <josh.cheek@gmail.com>
On Mon, Feb 13, 2012 at 1:10 PM, maven apache <apachemaven0@gmail.com> wrot=
as a new syntax, i would tend to think that rubydoc (which is derived
[#393451] autotest-rails 4.1.2 Released — Ryan Davis <ryand-ruby@...>
autotest-rails version 4.1.2 has been released!
Unsubscribe
[#393465] Why GIL is not released on ruby/dl external function call. — Grigory Petrov <grigory.v.p@...>
Hello.
On Tue, Feb 14, 2012 at 2:11 PM, Grigory Petrov <grigory.v.p@gmail.com> wro=
[#393485] Any parser *for* regular expressions? — Brian Candler <b.candler@...>
Is there some existing code (preferably ruby) which can take a regular
[#393499] Factorial — Junayeed Ahnaf Nirjhor <zombiegenerator@...>
Hello,
[#393514] How to shutdown Ruby XMLRPC server? — Grigory Petrov <grigory.v.p@...>
Hello. I'm testing Ruby XMLRPC support right now. All works fine,
[#393524] darkfish rdoc sees no rdoc — Wybo Dekker <wybo@...4all.nl>
Hi, I have trouble with rdoc. I run ruby 1.9.2p290 and I installed
[#393533] 1.9.2 syntax issues — Hal Fulton <rubyhacker@...>
I admit I still use 1.8.x more often than 1.9.x -- and I keep running across
[#393535] How are closures implemented? — Ralph Shnelvar <ralphs@...32.com>
I'm one of those people who needs to see/understand a typical implementation of something before I can grok how it works.
[#393536] Metaprograming question about initialize — Ralph Shnelvar <ralphs@...32.com>
How many times have we seen this:
You can use the Struct class, which implements exactly this.
[#393546] Difference between 1.9.2 and 1.9.3 — James French <James.French@...>
module A <- line 1
On Mon, Feb 20, 2012 at 12:25, James French
That's because super with parentheses passes the same args your method
On Tue, Feb 21, 2012 at 9:40 AM, Bartosz Dziewo=C5=84ski <matma.rex@gmail.c=
DQoNCkZyb206IHBldGVyLnZhbmRlbmFiZWVsZS5iZUBnbWFpbC5jb20gW21haWx0bzpwZXRlci52
On Tue, Feb 21, 2012 at 11:44 AM, James French
DQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBSb2JlcnQgS2xlbW1lIFttYWls
[#393548] Accessing a local variable through a symbol — Ralph Shnelvar <ralphs@...32.com>
Let's say I have
On Mon, Feb 20, 2012 at 3:27 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:
Darryl,
On Mon, Feb 20, 2012 at 3:49 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:
Darryl,
[#393574] Net::IMAP::ResponseParseError — Petite Abeille <petite.abeille@...>
Hello,
[#393587] cheered to soon...... enumerable woos — Catsquotl <Catsquotl@...>
hi,
Firstly, post a complete small program which demonstrates your problem -
class Acupunt
[#393595] DNS Spoofing? — "Thomas A. Moulton" <tom@...>
Has the IP for rubyforge.org changed in the past 12-24 hours?
[#393607] minitest-excludes 1.0.1 Released — Ryan Davis <ryand-ruby@...>
minitest-excludes version 1.0.1 has been released!
[#393609] Accessing a web page and looking for a file and downloading if found — Ruby Student <ruby.student@...>
Hi Team,
Great. I'll give it a try.
[#393625] Failing to install mechanize — Ruby Student <ruby.student@...>
Hello Team,
Hi,
OK, I got rvm installed. It also looks like it installed ruby.
[#393671] Rubymoticons — Dave Aronson <rubytalk2dave@...>
I was demonstrating injection of a symbol, and noticed a familiar
On Tue, Feb 28, 2012 at 10:03 AM, Dave Aronson <
2012/2/29 Kendall Gifford <zettabyte@gmail.com>:
2012/2/29 Bartosz Dziewo=C5=84ski <matma.rex@gmail.com>:
On Wed, Feb 29, 2012 at 1:51 PM, Dave Aronson
2012/2/29 Eric Christopherson <echristopherson@gmail.com>:
2012/2/29 Bartosz Dziewo=C5=84ski <matma.rex@gmail.com>:
[#393675] Re: Script RC on Windows — Kenichi Kamiya <kachick1@...>
Hi George,
On Tue, Feb 28, 2012 at 8:58 PM, Kenichi Kamiya <kachick1@gmail.com> wrote:
Re: Error with splat params in method definition
On Mon, Feb 6, 2012 at 5:20 AM, Jeremy Bopp <jeremy@bopp.net> wrote:
> On 02/05/2012 07:19 PM, Jones Lee wrote:
>> I'd like to ask why having:
>>
>> ```
>> def my_method(*param1, param2 =3D "default"); end
>> ```
>>
>> returns
>>
>> ```
>> SyntaxError: (irb):15: syntax error, unexpected '=3D', expecting ')'
>> ```
This cannot reliably be evaluated because there is an ambiguity. Will
my_method(1) invoke with param1 =3D [] and param2 =3D 1 or with param1 =3D
[1] and param2 =3D "default"? No machine can decide this.
>> My workaround is explicitly wrap param in brackets like this:
>>
>> ```
>> def my_method((*param1), param2 =3D "default"); end
>> ```
>
> Have you tried calling your method with the workaround with exactly 0 or
> more than 2 arguments? =A0I think you'll find that your workaround doesn'=
t
> really work around anything aside from the syntax error.
>
> Now, I could be wrong about the details, and I believe there are some
> subtle changes coming soon with respect to parameter handling for
> methods, but I'll see if I can clarify what is going on. =A0Ruby attempts
> to associate method parameters as follows:
>
> 1) Assign the first parameters given in the method call to all the
> positional parameters that do not have defaults defined and report an
> error if there are not enough given parameters to do this.
> 2) If there are still more given parameters, assign those to the
> positional parameters that would otherwise have defaults set.
> 3) Assign any remaining parameters that are NOT key-value definitions
> for a hash to the splat parameter.
> 4) Assign the key-value hash definitions to the final parameter as a
> single hash.
Not sure whether the order between 3 and 4 is correct or even matters.
But that looks like a pretty good description of what's going on -
apart from the fact that splash can occur anywhere and hence step one
does not only eat leading parameters.
> These rules require that method definitions first specify positional
> parameters without defaults, followed by positional parameters with
> defaults, followed by the splat parameter, followed by a single
> parameter that will receive the hash parameters.
It's not exactly correct any more with 1.9.*: you can have the splat
in other places than the last position:
irb(main):007:0> def f(a,*b,c) p a,b,c end
=3D> nil
irb(main):008:0> f 1
ArgumentError: wrong number of arguments (1 for 2)
from (irb):7:in `f'
from (irb):8
from /opt/bin/irb19:12:in `<main>'
irb(main):009:0> f 1, 2
1
[]
2
=3D> [1, [], 2]
irb(main):010:0> f 1, 2, 3
1
[2]
3
=3D> [1, [2], 3]
irb(main):011:0> f 1, 2, 3, 4
1
[2, 3]
4
=3D> [1, [2, 3], 4]
> I'm sure that I'm going to get all sorts of corrections about the above,
> but that's the gist as I understand things at least.
You are correct in that there _are_ limitations.
> It appears that you would like to instead specify your positional
> parameters (param2) after your splat parameter (param1). =A0I don't
> believe Ruby yet has any facility to handle that in the language,
It can do it but not with defaults:
irb(main):012:0> def f(*a, b, c) p a, b, c end
=3D> nil
irb(main):013:0> f 1
ArgumentError: wrong number of arguments (1 for 2)
from (irb):12:in `f'
from (irb):13
from /opt/bin/irb19:12:in `<main>'
irb(main):014:0> f 1,2
[]
1
2
=3D> [[], 1, 2]
irb(main):015:0> f 1,2,3
[1]
2
3
=3D> [[1], 2, 3]
irb(main):016:0> f 1,2,3,4
[1, 2]
3
4
=3D> [[1, 2], 3, 4]
> but you can emulate it:
>
> def my_method(*params)
> =A0param1 =3D params
> =A0param2 =3D params.size > 1 ? params.pop : "default"
> =A0...
> end
Yeah, but who wants to read such code? That will be a heck of a
difficult thing to debug. I'd rather stick with standard features
because they also allow for automated error checking and reporting.
Kind regards
robert
--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/