yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
lolmaus has quit [Ping timeout: 264 seconds]
wallerdev has quit [Quit: wallerdev]
stamina has quit [Ping timeout: 272 seconds]
enebo has quit [Quit: enebo]
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 252 seconds]
tectonic has quit []
Jam_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nathanstitt has joined #ruby-lang
dm78 has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
weems|mac has joined #ruby-lang
lolmaus has joined #ruby-lang
aemeredith has joined #ruby-lang
vintik has quit [Remote host closed the connection]
iamcalledrob has joined #ruby-lang
iamcalledrob has quit [Ping timeout: 272 seconds]
breezy_ has quit [Remote host closed the connection]
vintik has joined #ruby-lang
simoz1111115 has joined #ruby-lang
tplpnm has joined #ruby-lang
Miphix has joined #ruby-lang
stardiviner has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
brianpWins has joined #ruby-lang
cored has quit [Ping timeout: 272 seconds]
stardiviner has quit [Ping timeout: 248 seconds]
yubrew has joined #ruby-lang
sarkyniin has quit [Quit: Quitte]
yubrew has quit [Ping timeout: 255 seconds]
stardiviner has joined #ruby-lang
vintik has quit [Remote host closed the connection]
breezy_ has joined #ruby-lang
dm78 has quit [Remote host closed the connection]
aemeredith has quit [Remote host closed the connection]
aemeredith has joined #ruby-lang
aemeredith has quit [Ping timeout: 252 seconds]
iamcalledrob has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
vintik has joined #ruby-lang
iamcalledrob has quit [Ping timeout: 264 seconds]
mistym has quit [Ping timeout: 264 seconds]
postmodern has joined #ruby-lang
mistym has joined #ruby-lang
tplpnm has quit []
wallerdev has joined #ruby-lang
miqui_ has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
vintik has quit [Remote host closed the connection]
charliesome has quit [Ping timeout: 260 seconds]
Lewix has joined #ruby-lang
aemeredith has joined #ruby-lang
stardiviner has quit [Ping timeout: 264 seconds]
yubrew has joined #ruby-lang
charliesome has joined #ruby-lang
aemeredith has quit [Read error: Connection reset by peer]
gix- has quit [Ping timeout: 272 seconds]
dm78 has joined #ruby-lang
aemeredi_ has joined #ruby-lang
yubrew has quit [Ping timeout: 248 seconds]
gix has joined #ruby-lang
breezy_ has quit [Remote host closed the connection]
matled has quit [Remote host closed the connection]
breezy_ has joined #ruby-lang
Atttwww has joined #ruby-lang
aemeredi_ has quit [Ping timeout: 264 seconds]
breezy_ has quit [Ping timeout: 272 seconds]
red_menace has quit [Quit: peer reset by connection]
ta_ has joined #ruby-lang
ta has quit [Read error: Connection reset by peer]
yfeldblum has quit [Ping timeout: 264 seconds]
mistym_ has joined #ruby-lang
yfeldblum has joined #ruby-lang
mistym has quit [Ping timeout: 255 seconds]
thomasxie has joined #ruby-lang
breezy_ has joined #ruby-lang
mistym_ has quit [Remote host closed the connection]
hinbody has quit [Read error: Connection reset by peer]
Lewix has quit [Remote host closed the connection]
iamcalledrob has joined #ruby-lang
pr0ton_ has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
dm78 has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
tectonic has joined #ruby-lang
iamcalledrob has quit [Ping timeout: 248 seconds]
thomasxie has quit [Remote host closed the connection]
MikaAK has joined #ruby-lang
arup_r has joined #ruby-lang
yubrew has joined #ruby-lang
diegoviola has joined #ruby-lang
aemeredith has joined #ruby-lang
bender_unit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aemeredith has quit [Read error: Connection reset by peer]
aemeredi_ has joined #ruby-lang
stardiviner has joined #ruby-lang
yubrew has quit [Ping timeout: 260 seconds]
aero224 has joined #ruby-lang
shinnya has quit [Ping timeout: 255 seconds]
iamcalledrob has joined #ruby-lang
aemeredi_ has quit [Ping timeout: 240 seconds]
dm78 has joined #ruby-lang
mistym has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
<arup_r>
What is the difference between Enumerator and Enumerable ?
dm78 has quit [Remote host closed the connection]
aemeredith has joined #ruby-lang
<wmoxam>
arup_r: Enumerables can be Enumerated
<wmoxam>
ie: an array is an Enumerable
weems|mac has joined #ruby-lang
<arup_r>
wmoxam: that actually made me confused... -(
<wmoxam>
[1, 2, 3] # Enumerable
<wmoxam>
[1, 2, 3].each # Enumerator
<wmoxam>
the Enumerator is the class used to Enumerate the Enumerable
<wmoxam>
clear? ;)
MikaAK has quit [Ping timeout: 264 seconds]
<arup_r>
No... your last line is more confusing for me :-) I don't understand why we need the Enumerator class although, while we have Enumerable ... :-)
oste has left #ruby-lang [#ruby-lang]
<wmoxam>
arup_r: when a class is Enumerable, it means that it defines an interface that allows it to act as such
<wmoxam>
arup_r: ie: for your class to be Enumerable it needs to define a method called 'each'
breezy_ has quit [Remote host closed the connection]
<wmoxam>
arup_r: and Enumerable will define some extra methods such as all?, any? etc
Cakey has quit [Ping timeout: 240 seconds]
<wmoxam>
arup_r: Enumerators are classes that can iterate over Enumerables
Lewix has joined #ruby-lang
Cakey has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
<arup_r>
before iterating, it have to convert the enumerable to enumerator..
<arup_r>
I read it.. most methods I used to like.. with_object..next but I have some definition problems...
breezy_ has joined #ruby-lang
<arup_r>
As you said, Enumerable class must need to implement #each first.. It means, to iterate, all enumerable objects, first must need to convert them to Enumerator object.
araujo has quit [Quit: Leaving]
aemeredith has quit [Ping timeout: 240 seconds]
<godd2>
arup_r how comfortable are you with the difference between a module and a class?
breezy_ has quit [Remote host closed the connection]
<arup_r>
ahh.. Only thing, I know I can instantiate the class, but not the module..
breezy_ has joined #ruby-lang
<arup_r>
godd2: Is there any more difference? Would you tell me ?
<godd2>
that's the biggest difference yes
havenwood has joined #ruby-lang
<godd2>
Enumerable is a module, and Enumerator is a class
<godd2>
so that should tell you a lot out the the box. Enumerable is a set of behaviors and functionality you'd want to add to a class. The Enumerator class is something you get objects from itself.
<arup_r>
I will be online after 30 mins.. I have many more questions on this.. Thanks to you godd2 and wmoxam
ta has joined #ruby-lang
ta_ has quit [Read error: Connection reset by peer]
earthquake has joined #ruby-lang
yubrew has joined #ruby-lang
arup_r has quit [Ping timeout: 260 seconds]
yubrew has quit [Ping timeout: 248 seconds]
pr0ton_ has quit [Quit: pr0ton_]
aemeredith has joined #ruby-lang
aemeredith has quit [Read error: Connection reset by peer]
aemeredith has joined #ruby-lang
shevy has left #ruby-lang ["I'll be back ... maybe"]
shevy has joined #ruby-lang
aemeredith has quit [Ping timeout: 240 seconds]
touzin has joined #ruby-lang
Cakey has quit [Ping timeout: 255 seconds]
aemeredith has joined #ruby-lang
saarinen has joined #ruby-lang
Mon_Ouie has quit [Quit: WeeChat 0.4.3]
theharshest has quit [Quit: This computer has gone to sleep]
aemeredith has quit [Ping timeout: 255 seconds]
robbyoconnor has quit [Max SendQ exceeded]
robbyoconnor has joined #ruby-lang
robbyoconnor has quit [Changing host]
robbyoconnor has joined #ruby-lang
theharshest has joined #ruby-lang
touzin has quit [Ping timeout: 240 seconds]
CaptainJet has quit []
shevy has left #ruby-lang ["I'll be back ... maybe"]
stardiviner has quit [Ping timeout: 255 seconds]
mehlah has quit [Quit: Leaving...]
djbkd_ has joined #ruby-lang
crankharder has quit [Ping timeout: 240 seconds]
weems|mac has quit [Quit: weems|mac]
yubrew has joined #ruby-lang
simoz1111115 has quit [Ping timeout: 272 seconds]
dm78 has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
dm78 has quit [Ping timeout: 264 seconds]
saarinen has quit [Quit: saarinen]
snsei has quit [Remote host closed the connection]
ta has quit [Read error: Connection reset by peer]
ta_ has joined #ruby-lang
dm78 has joined #ruby-lang
bender_unit has joined #ruby-lang
aemeredith has joined #ruby-lang
aemeredi_ has joined #ruby-lang
aemeredith has quit [Read error: Connection reset by peer]
hinbody has joined #ruby-lang
arup_r has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
relix has joined #ruby-lang
aemeredi_ has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 260 seconds]
<arup_r>
Does Enumerable module creates first Enumerator object, before invoking any Enumerable methods like all? , any? etc ?
<drbrain>
arup_r: no
<drbrain>
it just calls #each
[spoiler] has joined #ruby-lang
heftig has quit [Quit: Quitting]
<arup_r>
Enumerable is a module, without creating object, how would it call those methods like all? , an?
theharshest has quit [Quit: This computer has gone to sleep]
<arup_r>
* any?
<drbrain>
it is part of the ancestors list so it is part of your object
<drbrain>
they live on your object
<arup_r>
goes above my head..
<arup_r>
:(
<drbrain>
like object_id lives on your object via Kernel
newv has joined #ruby-lang
<newv>
hello
schaerli has quit [Ping timeout: 272 seconds]
<newv>
anyone here
kyb3r_ has joined #ruby-lang
<drbrain>
arup_r
iamcalledrob has quit [Quit: Computer has gone to sleep.]
<arup_r>
drbrain: Yes I am here
<drbrain>
include makes the module's methods part of your object
yubrew has joined #ruby-lang
<pipework>
drbrain: Doesn't extend do that? include for the instance_methods of the class of the object?
<drbrain>
(learning a new keyboard)
havenwood has quit [Remote host closed the connection]
iamcalledrob has joined #ruby-lang
<pipework>
Whatcha clackin' on?
havenwood has joined #ruby-lang
<arup_r>
Enumerator is like a regular class like Array, Hash right ? Which includes Enumerable module..
<drbrain>
pipework: I left out the class part on purpose
<pipework>
oh1
apeiros has quit [Remote host closed the connection]
<arup_r>
drbrain: Why Enumerator again implements #each_with_object, while Enumerable already has it ?
<drbrain>
how do you meab
<newv>
can anyone help me with an error
<drbrain>
mean?
<newv>
dumb question but i am lost
yubrew has quit [Ping timeout: 248 seconds]
<arup_r>
newv: give a Gist link
iamcalledrob has quit [Ping timeout: 252 seconds]
<drbrain>
oh, I see, hrm
havenwood has quit [Ping timeout: 264 seconds]
Guest63955 has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 264 seconds]
breezy_ has quit [Remote host closed the connection]
<drbrain>
it seems to be an optimization
<drbrain>
ap
<drbrain>
arup_r: ↑
newv has quit [Ping timeout: 246 seconds]
breezy_ has joined #ruby-lang
rahul_j has joined #ruby-lang
<arup_r>
Array, Range, Hash all using Enumerable#each_with_object.. How Enumerator is special, which makes it possible to give them their own #each_with_object ?
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
<pipework>
arup_r: I think an important question is 'what does it do differently'.
<drbrain>
Enumerator is a class so it can have different behavior that overrides Enumerable
<pipework>
So you might answer 'why' more easily.
breezy_ has quit [Ping timeout: 272 seconds]
snsei has joined #ruby-lang
symm- has joined #ruby-lang
<arup_r>
pipework: Yes,, but really don't know what does it do differently, that caused to implement a separate method for them ?
breezy_ has joined #ruby-lang
<pipework>
arup_r: Have you read the source code to it?
<drbrain>
my reading says it is an optimization
<arup_r>
I am blind in C :-)
<pipework>
drbrain is the most literate guy here, iirc.
<drbrain>
unless there's a lurker
<arup_r>
Could you please give a piece of Ruby code which is equivalent to C, to understand "what does it do differently" ...
<pipework>
arup_r: From what señor brain said, it just looks like an optimization. I'd probably not spend too much time thinking about it and fretting. Is there any reason it's so important to you right now?
<drbrain>
there isn't equivalent ruby code since the optimization has to do with how arguments are passed
<pipework>
Curiosity is an acceptable answer.
<drbrain>
… passed on the C side
<drbrain>
this keyboard is great!
<godd2>
mechanical?
diegoviola has quit [Quit: WeeChat 0.4.3]
<pipework>
drbrain: What's the biggest improvement? I'm sure you were typing on something comparable to the blues before.
<drbrain>
cherry MX blue with black for the modifiers
<drbrain>
the layout is awesome
<pipework>
Seems to have keys at varying heights, or is that me not seeing things correctly?
<godd2>
ah nice. I have one with browns. great for my typing speed
<drbrain>
it only has 40 keys so there isn't extra stuff unbalancing it on my lap
<drbrain>
yep, the rows are arched in the shape of your fingertips
<drbrain>
this makes it a little difficult to reach the low-row pinky keys at first, but I'll get used to it
<drbrain>
I also built it from a kit
<pipework>
drbrain: you're an emactopod, aren't you?
<drbrain>
no, vim
<drbrain>
and dvorak
ta_ has quit [Read error: Connection reset by peer]
<drbrain>
typing plain English is starting to reinforce where the keys are, typing the punctuation that requires a layer-switch will take a while to get used to
ta has joined #ruby-lang
<godd2>
I tried to get into dvorak but I had to keep switching back for starcraft
<drbrain>
haha
<godd2>
10fastfingers.com will give you 1-minute typing tests for simple words and keep track of your progress over time
djbkd_ has quit [Remote host closed the connection]
ta_ has joined #ruby-lang
ta has quit [Read error: Connection reset by peer]
<arup_r>
"Hello, world!".to_enum(:scan).each(/\w+/).to_a is this code same as "Hello, world!".scan(/\w+/) ?
snsei has quit [Remote host closed the connection]
snsei has joined #ruby-lang
iamcalledrob has joined #ruby-lang
ta has joined #ruby-lang
<godd2>
try passing the regex as a second argument to the to_enum
<arup_r>
Question is not proper .. leave it.. I need to think on it.
<apeiros>
if you want to go full monkey, read up on IEEE 754 floats
matp has joined #ruby-lang
felipe has quit [Ping timeout: 252 seconds]
<arup_r>
No I don't want to go full monkey :-)
Miphix has quit [Ping timeout: 252 seconds]
<arup_r>
floating point is irritating
harshp_ has quit [Read error: Connection reset by peer]
harshp_ has joined #ruby-lang
_whitelogger_ has joined #ruby-lang
justinweiss_ has joined #ruby-lang
dacamp_ has joined #ruby-lang
znz_jp has quit [Ping timeout: 252 seconds]
joelmheim_ has joined #ruby-lang
nomadicoder has joined #ruby-lang
adambeynon has joined #ruby-lang
zzak__ has joined #ruby-lang
maloik_ has joined #ruby-lang
Abuh has joined #ruby-lang
jlpeters has joined #ruby-lang
pipework has quit [Ping timeout: 245 seconds]
kylo has quit [Ping timeout: 245 seconds]
shennyg_ has quit [Ping timeout: 245 seconds]
llakey has quit [Ping timeout: 245 seconds]
yugui_zzz has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Ping timeout: 245 seconds]
snoopybbt has quit [Ping timeout: 245 seconds]
go|dfish has quit [Ping timeout: 245 seconds]
joast has quit [Ping timeout: 245 seconds]
gregf_ has quit [Ping timeout: 245 seconds]
thang has quit [Ping timeout: 245 seconds]
Abuh_ has quit [Ping timeout: 245 seconds]
maloik has quit [Ping timeout: 245 seconds]
dacamp has quit [Ping timeout: 245 seconds]
pipecloud is now known as pipework
shennyg__ has quit [Changing host]
shennyg__ has joined #ruby-lang
ramblinpeck has quit [Changing host]
ramblinpeck has joined #ruby-lang
vlad_sta- has joined #ruby-lang
justinweiss_ has quit [Changing host]
justinweiss_ has joined #ruby-lang
joelmheim_ has quit [Changing host]
joelmheim_ has joined #ruby-lang
nomadicoder has quit [Changing host]
nomadicoder has joined #ruby-lang
adambeynon has quit [Changing host]
adambeynon has joined #ruby-lang
zzak__ has quit [Changing host]
zzak__ has joined #ruby-lang
jlpeters has quit [Changing host]
jlpeters has joined #ruby-lang
llakey has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
K3dare has joined #ruby-lang
canton7 has joined #ruby-lang
seanhagen has joined #ruby-lang
ToaNii has joined #ruby-lang
go|dfish has joined #ruby-lang
snoopybbt has joined #ruby-lang
nisstyre has joined #ruby-lang
yugui_zzz has joined #ruby-lang
kylo has joined #ruby-lang
znz_jp has joined #ruby-lang
jgpawletko has joined #ruby-lang
ggherdov has joined #ruby-lang
bin7me has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeffs has joined #ruby-lang
scmx has joined #ruby-lang
syedasad has joined #ruby-lang
cnivolle has joined #ruby-lang
knu has quit [Ping timeout: 260 seconds]
<yorickpeterse>
Nothing wrong with floating points
twright has joined #ruby-lang
<yorickpeterse>
except that one time little Billy used it for financing
<yorickpeterse>
then wondered how the company lost a few thousand bucks over a year time
<apeiros>
nothing wrong with floats indeed.
<apeiros>
lots wrong with ignorant programmers :-/
<yorickpeterse>
wots a rational
<dorei>
ignorant programmers are cheaper though :p
<yorickpeterse>
Surely 100.0/3 always returns the same amount of decimals
snsei has joined #ruby-lang
<yorickpeterse>
dorei: pretty such losing customers is not worth one extra ignorant programmer
<yorickpeterse>
Didn't Magic the gathering online exchange also use floats for storing bitcoin amounts?
mconnolly has quit [Quit: mconnolly]
mconnolly has joined #ruby-lang
twright has quit [Ping timeout: 240 seconds]
mconnolly has quit [Client Quit]
mconnolly has joined #ruby-lang
<yorickpeterse>
(mtgox)
<epitron>
i think dorei was being ironical
DivineEntity has quit [Quit: leaving]
twright has joined #ruby-lang
<yorickpeterse>
no way
mconnolly has quit [Client Quit]
mconnolly has joined #ruby-lang
AllMyCircuits has joined #ruby-lang
twright has quit [Ping timeout: 240 seconds]
weems|mac has joined #ruby-lang
Calculon has joined #ruby-lang
shinnya has joined #ruby-lang
snoopybbt has quit [Ping timeout: 245 seconds]
iamcalledrob has joined #ruby-lang
cnivolle has left #ruby-lang [#ruby-lang]
AllMyCircuits has quit [Quit: Leaving]
yubrew has joined #ruby-lang
charliesome has joined #ruby-lang
scmx has quit [Ping timeout: 272 seconds]
malconis has joined #ruby-lang
<arup_r>
When should I think OpenStruct to use or the Struct ?
syedasad has quit []
<epitron>
Struct is when you know what fields you want
<epitron>
OpenStruct is when you don't
mconnolly has quit [Quit: mconnolly]
mconnolly has joined #ruby-lang
arup_r has quit [Remote host closed the connection]
AllMyCircuits has joined #ruby-lang
joast has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
miqui has joined #ruby-lang
Calculon has quit [Quit: Leaving]
AllMyCircuits has quit [Client Quit]
AllMyCircuits has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Ping timeout: 252 seconds]
arup_r has joined #ruby-lang
<arup_r>
epitron: okay
<epitron>
arup_r: also, OpenStruct can be initialized with a hash
<epitron>
Struct fields have to be passed in order as arguments to "new"
alexju has joined #ruby-lang
<arup_r>
ok
yfeldblum has joined #ruby-lang
[spoiler] has quit [Read error: Connection reset by peer]
yfeldblu_ has joined #ruby-lang
iamcalledrob has quit [Quit: Computer has gone to sleep.]
yfeldblum has quit [Ping timeout: 240 seconds]
yfeldblu_ has quit [Ping timeout: 252 seconds]
AncientAmateur has joined #ruby-lang
Ptm has joined #ruby-lang
Ptm is now known as Guest62059
workmad3 has joined #ruby-lang
<Guest62059>
if I may ask a somewhat noobish question: what is the proper name for a .rb file? I figure it isn't "module" because a module is a construct defined with the module keyword.
bin7me has quit [Quit: Leaving]
chouhoulis has joined #ruby-lang
<wnd>
is there something wrong with "a file"?
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby-lang
<Guest62059>
well, no
<Guest62059>
but I'm having trouble getting info on how the heck .new can be invoked on an .rb file
<Guest62059>
I figured Google will start giving the answers I need once I get the proper name for '.rb file'
<Guest62059>
if there is one.
<apeiros>
you can't invoke .new on a file
twright has joined #ruby-lang
<wnd>
I'm not sure if I'm following, but I'd say you invoke #new on a class
<wnd>
sorry, ::new
<apeiros>
you can `require "file"` which will read and execute the code in a file
<apeiros>
and if that code defines a class, you can invoke .new on that class.
<Guest62059>
hm, all that I get, so I suppose this code I'm dissecting is decidedly weird
<Guest62059>
funny thing is it runs
elia has joined #ruby-lang
<Guest62059>
I'm learning Ruby in the process of dissecting an automatic assessment system
andrewhl has joined #ruby-lang
<Guest62059>
the weird example is written thus: daemon.rb has "require 'marker.rb'". marker.rb defines no classes; it's the main entry point with a #! line and all. Just a few lines lower in daemon.rb I read this:
<Guest62059>
marker = Marker.new
<maloik_>
you're probably better off putting the code in a gist
<maloik_>
perhaps with some comments in the code for your questions
<Guest62059>
can't do that, it's not my code and it's proprietary :/
nathanstitt has joined #ruby-lang
<apeiros>
Guest62059: a) marker.rb has further requires which define Marker, b) you're looking at the wrong marker.rb file
<Guest62059>
the thing that really confuses me is that there is no class Marker in the entire source
<apeiros>
usually a project will have a "lib" dir. grep that dir for "class Marker"
<Guest62059>
that's exactly what I did
twright has quit [Ping timeout: 264 seconds]
<apeiros>
then it might come from a dependency
<Guest62059>
no results whatsoever
tbuehlmann has quit [Quit: Leaving]
<apeiros>
alternatively it might be dynamically defined
AncientAmateur has quit [Remote host closed the connection]
MikaAK1 has joined #ruby-lang
mistym has quit [Remote host closed the connection]
frankjpinto_ has quit [Ping timeout: 264 seconds]
havenn has joined #ruby-lang
<workmad3>
arup_r: because you chained the call 'foo.bar.baz' not 'foo.baz.bar'
MikaAK1 has quit [Quit: node-irc says goodbye]
MikaAK2 has joined #ruby-lang
mykoweb has quit [Remote host closed the connection]
snoopybbt has joined #ruby-lang
<arup_r>
OOppss So silly question I asked.. I was seeing actually something different and reading this, which made me confused.. Sorry for asking this silly question.
RobertBirnie has joined #ruby-lang
<workmad3>
arup_r: it's ok... it's not a particularly clear example :)
<workmad3>
arup_r: took me 3 reads to spot that they changed the order ;)
<arup_r>
workmad3: Thanks for supporting me .. ;)
havenwood has quit [Quit: Leaving...]
andrewhl has quit [Quit: andrewhl]
scmx has joined #ruby-lang
RobertBi_ has joined #ruby-lang
RobertBirnie has quit [Ping timeout: 272 seconds]
MikaAK has joined #ruby-lang
MikaAK has quit [Client Quit]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tbuehlmann has joined #ruby-lang
snoopybbt has quit [Ping timeout: 245 seconds]
skade has quit [Read error: Connection reset by peer]
dernise has quit [Read error: Connection reset by peer]
skade_ has joined #ruby-lang
mistym has joined #ruby-lang
RobertBi_ has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 264 seconds]
andrewhl has joined #ruby-lang
RobertBirnie has joined #ruby-lang
relix has joined #ruby-lang
yfeldblum has joined #ruby-lang
wallerdev has joined #ruby-lang
mikecmpbll has quit [Ping timeout: 264 seconds]
wallerdev has quit [Client Quit]
pabloh has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 264 seconds]
djbkd has joined #ruby-lang
rahul_j has joined #ruby-lang
scampbell has joined #ruby-lang
schlubbi has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mikecmpbll has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AncientAmateur has joined #ruby-lang
scmx has quit [Ping timeout: 260 seconds]
dangerousdave has joined #ruby-lang
Squarepy has quit [Quit: Leaving]
dangerou_ has quit [Ping timeout: 264 seconds]
AncientAmateur has quit [Ping timeout: 272 seconds]
schaerli has joined #ruby-lang
jhass|off is now known as jhass
jaimef has quit [Excess Flood]
Lumio has joined #ruby-lang
jaimef has joined #ruby-lang
AllMyCircuits has quit [Ping timeout: 260 seconds]
saarinen has joined #ruby-lang
saarinen has quit [Client Quit]
bantic has quit [Quit: bantic]
saarinen has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
mnngfltg has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 272 seconds]
wallerdev has joined #ruby-lang
AncientAmateur has joined #ruby-lang
iamcalledrob has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
iamcalledrob has quit [Client Quit]
akshay_kumar has joined #ruby-lang
frankjpinto__ has quit [Ping timeout: 264 seconds]
dsferreira has joined #ruby-lang
banister has joined #ruby-lang
mehlah has quit [Quit: Leaving...]
x0f has quit [Ping timeout: 260 seconds]
banister_ has joined #ruby-lang
knu has quit [Ping timeout: 260 seconds]
solars has joined #ruby-lang
banister has quit [Ping timeout: 264 seconds]
karamazov has joined #ruby-lang
x0f has joined #ruby-lang
pablo_ has joined #ruby-lang
<pablo_>
hello
<pablo_>
can anyone tell me if (x = true if y.nil?) is equivalent to (x = y.nil?)
<workmad3>
pablo_: yes
<pablo_>
thanks :)
<Mon_Ouie>
Not entirely since the first one results in x being nil rather than false when y is not nil
__butch__ has joined #ruby-lang
<workmad3>
ah yeah... probably equivalent enough though :)
<apeiros>
pablo_: no. with the former, x will retain the original value if y is not nil. (or be nil if it had no previous value)
<apeiros>
>> y = "notnil"; x = true; x = true if y.nil?; x
<arup_r>
I know except those.. for more practices... It is very tough concept..
andrewhl has joined #ruby-lang
<yorickpeterse>
well just asking for any type of example isn't going to help much. Experimenting with fibers yourself is most likely going to help a lot more.
yfeldblu_ has joined #ruby-lang
yfeldblu_ has quit [Read error: Connection reset by peer]
yfeldblu_ has joined #ruby-lang
pixelhandler has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
<epitron>
arup_r: python's generators are basically the same thing, but easier to understand
rahul_j has quit [Quit: rahul_j]
<epitron>
you could read up on how those work, then use that as a foundation for learning Fiber
<arup_r>
I never read Python
MichD is now known as michd
Mon_Ouie has joined #ruby-lang
<epitron>
actually, sorry.. python generators are more like enumerables
<epitron>
err, Enumerators
<epitron>
actually, they're like a combination of the two :)
<epitron>
they're pretty sweet, imo
solars has joined #ruby-lang
postmodern has joined #ruby-lang
stamina has quit [Ping timeout: 255 seconds]
yfeldblu_ has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
<arup_r>
This Fiber is giving me too much pains... I am some one who started programming at the age of 22.. Now I am 24.. It is too late.. :(
<dorei>
arup_r: it could have been worse, u could have started programming with cobol or java :p
<arup_r>
I am not telling Ruby is bad.... It is awesome.. I am talking about my inefficiency and weak understanding about programming
<yorickpeterse>
arup_r: if you're starting out there's no need to learn about fibers
<yorickpeterse>
arup_r: they're not that useful anyway
<yorickpeterse>
arup_r: learn regular Ruby first, then worry about fibers, threads, etc
miqui has quit [Remote host closed the connection]
mistym has quit [Ping timeout: 272 seconds]
<arup_r>
I read regular Ruby and code too.. But wanted to move to something new like this.. So.. Trying to understand.. As many as example I would be able to see, will be helpful for me to understands this concept.
tbuehlmann has quit [Remote host closed the connection]
DEac-_ has quit [Read error: No route to host]
dwknoxy has joined #ruby-lang
DEac- has joined #ruby-lang
pablo_ has quit [Ping timeout: 246 seconds]
miqui has joined #ruby-lang
charliesome has joined #ruby-lang
wallerdev_ has joined #ruby-lang
ericwood has quit [Quit: Changing server]
wallerdev has quit [Ping timeout: 260 seconds]
wallerdev_ is now known as wallerdev
lolmaus_ has joined #ruby-lang
ericwood has joined #ruby-lang
<godd2>
arup_r you'd benefit more from going through all the Array isntance methods and working on memorizing them with flash cards then you would learning about Fibers
lolmaus has quit [Ping timeout: 255 seconds]
<arup_r>
why monkey patching is considered as bad practices to core Ruby class... But I saw Rails did that in lot of places.
<arup_r>
godd2: **with flash cards** means ?
banister has joined #ruby-lang
MikaAK2 has quit [Ping timeout: 252 seconds]
wallerdev_ has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
<godd2>
I just mean quiz yourself what each method does
matled has joined #ruby-lang
sheperson has joined #ruby-lang
wallerdev has quit [Ping timeout: 272 seconds]
wallerdev_ is now known as wallerdev
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
bantic has joined #ruby-lang
djbkd has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby-lang
wallerdev has quit [Client Quit]
havenn has quit []
AncientAmateur has quit [Remote host closed the connection]
touzin has quit [Ping timeout: 240 seconds]
mistym__ has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
<Mon_Ouie>
It looks to me like you want to use Enumerable#all?
<Mon_Ouie>
No need to construct the complete array of booleans, as soon as you find one element for which the condition is false you know the result is false.
<ruby-lang694>
Mon_Ouie: Ah! Very true I knew I was doing something really stupid. Thanks
bantic has quit [Ping timeout: 240 seconds]
<apeiros>
he doesn't really use booleans either
wallerdev has quit [Quit: wallerdev]
<ruby-lang694>
apeiros: Yeah... I know lol. I just kept looking at that method and thinking I was doing something silly but I couldn't see it. I'm glad you guys were able to look at it.
BucOder has joined #ruby-lang
bantic has joined #ruby-lang
AncientAmateur has quit [Remote host closed the connection]