[#406419] Recursion with Hash — Love U Ruby <lists@...>

h = {a: {b: {c: 23}}}

14 messages 2013/04/01

[#406465] Exclusively for Rubyists, a community on Facebook — "senthil k." <lists@...>

I was surprised to know that there is no community for Ruby Programming

12 messages 2013/04/03
[#406467] Re: Exclusively for Rubyists, a community on Facebook — Marc Heiler <lists@...> 2013/04/04

Thing is, some people do not use Facebook and never will.

[#406528] Role of bundler in creating and installing a gem — Jon Cairns <lists@...>

Hi fellow rubyists,

11 messages 2013/04/05

[#406555] How do you know what the main file in Ruby Projects is? — peteV <pete0verse@...>

Hi Ruby people,

18 messages 2013/04/05
[#406558] Re: How do you know what the main file in Ruby Projects is? — "Carlo E. Prelz" <fluido@...> 2013/04/05

Subject: How do you know what the main file in Ruby Projects is?

[#406560] Re: How do you know what the main file in Ruby Projects is? — Hans Mackowiak <lists@...> 2013/04/05

Carlo E. Prelz wrote in post #1104616:

[#406562] Re: How do you know what the main file in Ruby Projects is? — "D. Deryl Downey" <me@...> 2013/04/05

Actually its not wrong. What it does is explicitly state which ruby

[#406563] Re: How do you know what the main file in Ruby Projects is? — Matt Lawrence <matt@...> 2013/04/05

On Sat, 6 Apr 2013, D. Deryl Downey wrote:

[#406564] Re: How do you know what the main file in Ruby Projects is? — Hans Mackowiak <lists@...> 2013/04/05

Matt Lawrence wrote in post #1104625:

[#406566] Re: How do you know what the main file in Ruby Projects is? — Matt Lawrence <matt@...> 2013/04/05

On Sat, 6 Apr 2013, Hans Mackowiak wrote:

[#406570] Re: How do you know what the main file in Ruby Projects is? — Matthew Mongeau <halogenandtoast@...> 2013/04/05

I'm interested in the issue with using env, but I find you explanation a but=

[#406600] Mapping string data ptr to buffer in ffi — se gm <lists@...>

I'm trying to implement some "shared memory" in Ruby, but I'm not sure

20 messages 2013/04/08

[#406683] confusion with Struct class — Love U Ruby <lists@...>

I went to there - http://www.ruby-doc.org/core-2.0/Struct.html but the

29 messages 2013/04/11
[#406694] Re: confusion with Struct class — Love U Ruby <lists@...> 2013/04/11

Why does every time the has value getting changed,while the instance

[#406762] Why does #content method in nokogiri not printing the full text? — Love U Ruby <lists@...>

Here is the documentation: http://www.rubydoc.info/gems/nokogiri/frames

19 messages 2013/04/14
[#406764] Re: Why does #content method in nokogiri not printing the full text? — tamouse mailing lists <tamouse.lists@...> 2013/04/14

On Sun, Apr 14, 2013 at 11:19 AM, Love U Ruby <lists@ruby-forum.com> wrote:

[#406874] Input: sentence Modify: words Output: modified sentence — Philip Parker <lists@...>

I am new to Ruby. This is a programming interview question to use any

11 messages 2013/04/19

[#406912] Tap method : good or bad practice ? — Sébastien Durand <lists@...>

Hi all !

18 messages 2013/04/21

[#406936] BEGINNER -CLASS QUERY — shaik farooq <lists@...>

HEY as we know that the object conatins the instance variables that are

22 messages 2013/04/22

[#406966] copying files syntax with FileUtils.rb (grr.) — Thomas Luedeke <lists@...>

In my Ruby scripting, there is probably no greater and chronic source of

10 messages 2013/04/23

[#406969] what is the $- magic global? — Matthew Kerwin <lists@...>

I've been searching for the past hour or so, including manually stepping

13 messages 2013/04/24

[#407059] New Rexx like data structure — Peter Hickman <peterhickman386@...>

This is just something that I have been playing with for some time but I

11 messages 2013/04/29

[#407070] writing lines to a file — peteV <pete0verse@...>

I have a text file with on every line a magic card number and such info

13 messages 2013/04/29

Re: Ruby Gotchas presentation slides

From: "D. Deryl Downey" <me@...>
Date: 2013-04-01 22:41:04 UTC
List: ruby-talk #406429
Sorry about that reply. I was responding off my cell phone and it seems to
do something weird when it sends, that makes it look like email does when
its been quoted. Again, apologies for the weird looking reply.


On Mon, Apr 1, 2013 at 6:00 PM, D. Deryl Downey <me@daviddwdowney.com>wrote:

> Please keep this discussion going! I'm getting tons of value out of
> lurking this thread.
> On Apr 1, 2013 4:50 PM, "Dave Aronson" <rubytalk2dave@davearonson.com>
> wrote:
>
>> On Sun, Mar 31, 2013 at 2:36 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
>>
>> > The double vs single quotes doesn't seem like a gotcha to me.
>>
>> I was debating that one.  The rule is the same in most languages that
>> HAVE string interpolation, so yeah, it shouldn't be terribly
>> surprising.  But in most languages I've used, one or the other (single
>> vs. double) is just plain invalid (for a multi-char string), or
>> they're both equally valid, so there being a difference at all is a
>> bit of a gotcha.
>>
>> > The freezing one is good, but should be separated from the constants, as
>> > it's really just about variables. You can update the variable, but not
>> > modify the object, so you have to know which you're doing. Might also
>> > mention that it is for just that one object, so freezing an array
>> doesn't
>> > freeze the elements in the array.
>>
>> Ah, yes, I had originally intended to do something about modding the
>> references vs. the object it points to.  Forgot to split that out.
>> Array slots are of course simply a special case of that.  I'll split
>> 'em out and work on it before the next time I present it.
>>
>> > Balanced whitespace is good (better example would be `one -1`)
>>
>> Oooh, good one!
>>
>> > The parent initialize one doesn't seem legitimate to me, that's how
>> > inheritance works, why would you expect anything else?.
>>
>> IIRC, in some languages, they do automagically run parental initters
>> for you by default.  It's been so long since I've done much OO other
>> than Ruby, especially with inheritance, that I forget which does what.
>>
>> > The example for local var in the block seems too contrived. It's only
>> ever
>> > hit me when I tried to do something like `.each{ |i| sum ||= 0; sum +=
>> i }`
>> > in the loop, in which case it always gets set to zero.
>>
>> Well, yeah, they're all rather contrived!  I didn't put a high
>> priority on thinking up a realistic example, so I'll just swipe yours.
>>  :-)
>>
>> > The idea credit seems out of place, the hash block setting the value has
>> > been a common pattern for a long time.
>>
>> I figured, better to give credit too much and take up extra space,
>> than to slight someone by stealing something.  But to make you happy,
>> I won't credit your loop/closure var-value-losing example.  :-)
>>
>> > Frankly, I dislike it because it (a)
>> > sets keys on access, regardless of whether or not they will be used
>> (e.g.
>> > you could be carrying around thousands of empty arrays),
>>
>> Good point, I'll add a caveat.
>>
>> > and (b) changes
>> > behaviour of hash such that you must use #.has_key? to see if the key is
>> > set, because otherwise, the key is always set.
>>
>> True, but if you're using it for a specific purpose, there's probably
>> a more domain-relevant test.  In the case I showed, someone wanting to
>> know if someone knows any computer languages might ask if
>> langs[employee].any?.
>>
>> > I think the
>> > Array version of this is a better example,
>>
>> Also useful... but I think it's still worth pointing out this gotcha
>> with hashes too.  I'll make them separate slides, with Arrays first
>> since creating them all up front is clearer.
>>
>> > I'd maybe add lambda vs proc:
>>
>> Yeah, I thought about delving into that, but it was a bit more
>> advanced than I wanted to inflict at that point.  I was trying to keep
>> the whole talk under an hour, including Q&A, and the audience has a
>> wide range of skill levels.  Maybe I'll just save it for last, and
>> skip it if we're running short of time, or their eyes are glazing
>> over....
>>
>> > Might also add method_missing, which is evil (I don't think eval is
>> evil,
>> > but using method_missing on code that anyone else uses is sadistic)
>>
>> Eh... if used judiciously, and correctly (including a super-call if
>> not figured out), it can be OK.  And if someone is messing about with
>> method_missing, I think they're probably experienced enough not to
>> need this presentation.  :-)  But now that you mention it, the need to
>> ALSO adjust responds_to_missing, is quite a gotcha.
>>
>> > Might also add floating point number imprecision.
>>
>> That's in pretty much *any* language, so I don't really count that as
>> a *Ruby* gotcha per se.
>>
>> > Might also mention when a block gets instance evaled, but you're calling
>> > methods on your local context (e.g. a dsl you call from rspec can't
>> call a
>> > let).
>>
>> Now you're just making my head hurt!  ;-)  I think I read something on
>> that a few weeks ago, that I might be able to TL;DR-ify... or maybe it
>> was in the context of JavaScript, where issues of defining "this" are
>> critical AND common....
>>
>> > Might also add nonprinting characters,
>>
>> Not Ruby-specific enough.
>>
>> > I'd also put the most relevant ones earlier, when people will be paying
>> the
>> > most attention.
>>
>> Ordering is a bit of a tough question.  I was initially trying to put
>> the easiest stuff first, so the Ruby-newbies could get some value out
>> of it before their eyes glazed over.  :-)
>>
>> Thanks,
>> Dave
>>
>> --
>> Dave Aronson, the T. Rex of Codosaurus LLC,
>> secret-cleared freelance software developer
>> taking contracts in or near NoVa or remote.
>> See information at http://www.Codosaur.us/.
>>
>>


-- 
 [image: Your Logo]*D. Deryl **Downey**,*

 *T: * *M: * *E: *
------------------------------
[image: Facebook:] Your company Facebook link <#SafeHtmlFilter_>
[image: Twitter:] Your company Twitter link <#SafeHtmlFilter_>
[image: Google Plus:] Your company Google+ link <#SafeHtmlFilter_>

In This Thread