apeiros changed the topic of #ruby-lang to: Ruby 2.0.0-p195: http://ruby-lang.org (Ruby 1.9.3-p429) || Paste >3 lines of text on http://gist.github.com
Roujo_ has joined #ruby-lang
Roujo_ has quit [Client Quit]
<amerine> quiet day jn here today.
saarinen has left #ruby-lang [#ruby-lang]
<amerine> *in even
ghr_ has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
nathanstitt has quit [Ping timeout: 256 seconds]
nathanstitt has joined #ruby-lang
apeiros has joined #ruby-lang
tylersmith has joined #ruby-lang
ikrima has quit [Ping timeout: 252 seconds]
<drbrain> typos abound
ikrima has joined #ruby-lang
nathanstitt has quit [Ping timeout: 248 seconds]
ikrima has quit [Read error: Operation timed out]
<matti> Alive?
<matti> Ping?
<matti> ;]
vlad_starkov has joined #ruby-lang
<drbrain> matti: ?
<matti> Freenode is under DDoS.
<matti> I am having problems.
<matti> Wasn't sure if I am back or not.
<matti> Sorry
nathanstitt has joined #ruby-lang
redyellowgreen has joined #ruby-lang
arubin has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 260 seconds]
asunderland has quit [Ping timeout: 248 seconds]
ghr_ has quit [Quit: ghr_]
DEac- has quit [Ping timeout: 246 seconds]
anonymuse has quit [Remote host closed the connection]
nathanstitt has quit [Ping timeout: 256 seconds]
nathanstitt has joined #ruby-lang
<andrewvos> What? Why do people ddos weird shit all the time
mbj has quit [Ping timeout: 246 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
<drbrain> andrewvos: for the lols
redyellowgreen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DEac- has joined #ruby-lang
redyellowgreen has joined #ruby-lang
nathanstitt has quit [Ping timeout: 256 seconds]
redyellowgreen has quit [Client Quit]
znz_v has quit [Quit: kill -QUIT $$]
nathanstitt has joined #ruby-lang
znz_v has joined #ruby-lang
pskosinski has quit [Quit: pskosinski]
nathanstitt has quit [Client Quit]
pr0ton has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
zenspider has joined #ruby-lang
kstone has quit [Quit: kstone]
D9 has quit [Quit: Leaving]
sepp2k1 has quit [Remote host closed the connection]
GeissT has joined #ruby-lang
asunderland has joined #ruby-lang
thatJasonSmith has joined #ruby-lang
jacknagel__ has left #ruby-lang [#ruby-lang]
nathanstitt has joined #ruby-lang
<zenspider> minitest 5.0.1 released
Mon_Ouie has quit [Ping timeout: 264 seconds]
marr has quit [Ping timeout: 256 seconds]
bzalasky has joined #ruby-lang
nathanstitt has quit [Ping timeout: 252 seconds]
pr0ton has quit [Ping timeout: 256 seconds]
dankest has quit [Quit: Leaving...]
Xzyx987X has quit [Ping timeout: 246 seconds]
jacknagel has joined #ruby-lang
pr0ton has joined #ruby-lang
DarkBushido has quit [Ping timeout: 256 seconds]
hahuang65 has quit [Quit: Computer has gone to sleep.]
dhruvasagar has joined #ruby-lang
Domon has joined #ruby-lang
Senjai has joined #ruby-lang
Senjai has joined #ruby-lang
Senjai has quit [Changing host]
bzalasky has quit [Remote host closed the connection]
dpatel has quit [Quit: dpatel]
bzalasky has joined #ruby-lang
asunderland has quit [Ping timeout: 246 seconds]
asunderland has joined #ruby-lang
nathanstitt has joined #ruby-lang
lsegal has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
havenn_ has quit [Remote host closed the connection]
MouseTheLuckyDog has joined #ruby-lang
mootpointer has joined #ruby-lang
<MouseTheLuckyDog> When writing a C extension what does a cast to VALUE mean?
igaiga has joined #ruby-lang
dankest has joined #ruby-lang
asunderland has quit [Ping timeout: 260 seconds]
krohrbaugh has quit [Quit: Leaving.]
<drbrain> MouseTheLuckyDog: sounds dangerous
havenwood has joined #ruby-lang
<drbrain> MouseTheLuckyDog: a VALUE usually points to an object created by rb_class_new_instance, INT2FIX, LONG2NUM, Qtrue, etc.
bzalasky has quit [Remote host closed the connection]
<drbrain> so casting to VALUE would be dangerous if the value wasn't previously cast from a VALUE
r0bby has quit [Ping timeout: 256 seconds]
havenwood has quit [Remote host closed the connection]
rygood has quit [Quit: Leaving.]
Nisstyre-laptop has quit [Quit: Leaving]
wallerdev has joined #ruby-lang
Senjai has quit [Ping timeout: 256 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
rygood has joined #ruby-lang
fragamus has joined #ruby-lang
<MouseTheLuckyDog> drbrain, but what kind of type is VALUE?
banister`tv has left #ruby-lang [#ruby-lang]
banisterfiend has joined #ruby-lang
<banisterfiend> MouseTheLuckyDog: unsigned long
guns has joined #ruby-lang
havenwood has joined #ruby-lang
io_syl has joined #ruby-lang
io_syl has quit [Changing host]
io_syl has joined #ruby-lang
tenderlove has joined #ruby-lang
pr0ton has quit [Quit: pr0ton]
havenwood has quit [Remote host closed the connection]
ikrima has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
i_love_2pi has quit [Ping timeout: 245 seconds]
igaiga has quit [Remote host closed the connection]
rygood has quit [Quit: Leaving.]
ikrima has quit [Ping timeout: 264 seconds]
rygood has joined #ruby-lang
scampbell has quit [Quit: Leaving]
sailias has joined #ruby-lang
Xzyx987X has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
justinmburrous has quit [Remote host closed the connection]
justinmburrous has joined #ruby-lang
ikrima has joined #ruby-lang
asunderland has joined #ruby-lang
Kabaka has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 252 seconds]
Mon_Ouie has joined #ruby-lang
bzalasky has joined #ruby-lang
krz has joined #ruby-lang
rwilcox has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
asunderl1nd has joined #ruby-lang
asunderland has quit [Ping timeout: 256 seconds]
fitsos has joined #ruby-lang
fitsos has left #ruby-lang [#ruby-lang]
havenwood has joined #ruby-lang
mjio has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
vlad_starkov has joined #ruby-lang
r0bby has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 246 seconds]
saarinen has joined #ruby-lang
r0bby_ has joined #ruby-lang
r0bby has quit [Ping timeout: 256 seconds]
ikrima has quit [Ping timeout: 245 seconds]
Cakey has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
tsion has joined #ruby-lang
tsion has quit [Changing host]
tsion has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
chimkan has joined #ruby-lang
cofin has joined #ruby-lang
lguardiola has quit [Ping timeout: 264 seconds]
seoaqua has joined #ruby-lang
r0bby_ has quit [Excess Flood]
r0bby_ has joined #ruby-lang
priodev has quit [Ping timeout: 245 seconds]
guns has quit [Ping timeout: 252 seconds]
<rickhull> hitting something unexpected playing with minitest must_output
Nisstyre-laptop has quit [Ping timeout: 256 seconds]
<rickhull> i tried passing a regex, and i'm not getting any particular complaints about that
<rickhull> but i am getting failures: Expected /debug (0)/ Actual: ""
<rickhull> this seems misleading to me, because i'm pretty darn sure i am actually outputting something matching /debug (0)/
cofin has quit [Quit: cofin]
<rickhull> so it looks like regex is not supported, that's fine. but Actual: "" is misleading
priodev has joined #ruby-lang
crankharder has quit [Read error: Connection reset by peer]
malign is now known as dd
dd is now known as malign
asunderland has joined #ruby-lang
asunderl1nd has quit [Ping timeout: 248 seconds]
chimkan has left #ruby-lang [#ruby-lang]
seoaqua has quit [Ping timeout: 252 seconds]
sush24 has joined #ruby-lang
Swimming_Bird has quit [Ping timeout: 256 seconds]
<rickhull> am I right about the lack of regex support? if so, seems like a useful feature, no?
tomzx_mac has quit [Ping timeout: 256 seconds]
Swimming_Bird has joined #ruby-lang
r0bby_ has quit [Remote host closed the connection]
xxaM has joined #ruby-lang
krombr has joined #ruby-lang
Wardrop has joined #ruby-lang
lele` has quit [Read error: Operation timed out]
<rickhull> assert_output calls capture_io and then assert_equal. so pretty straightforward, and regex won't work
vlad_starkov has joined #ruby-lang
lele has joined #ruby-lang
<rickhull> i'm wondering if capture_io is not working correctly. i am seeing the output i expect (in the middle of the test run) and then minitest says the actual output was empty
<rickhull> v0v
vlad_starkov has quit [Ping timeout: 248 seconds]
guns has joined #ruby-lang
<rickhull> hmm, looks like PEBKAC error. restructured and it works as expected
<rickhull> er, nope. it "works" if I pass nil instead of a regex
vlad_starkov has joined #ruby-lang
<rickhull> which seems odd. nil indicates ~any output~ while "" indicates silent output
hahuang65 has joined #ruby-lang
<rickhull> specifically rdoc says: Pass in nil if you don’t care about that streams output. Pass in “” if you require it to be silent.
<rickhull> given that this is assert_output, i assume nil means not just "I don't care" where empty would be acceptable, but that ~some output~ is required
rygood has quit [Quit: Leaving.]
<rickhull> zenspider: HALP
kgrz has joined #ruby-lang
Wardrop has left #ruby-lang [#ruby-lang]
saarinen has quit [Quit: saarinen]
saarinen has joined #ruby-lang
Senjai has joined #ruby-lang
Senjai has quit [Changing host]
Senjai has joined #ruby-lang
grobb has joined #ruby-lang
crankharder has joined #ruby-lang
<crankharder> 1.9.3-p392 did exist, i'm not crazy right? why is it not here: http://ftp.ruby-lang.org/pub/ruby/
kith has quit [Read error: Connection reset by peer]
kith has joined #ruby-lang
randym_ has quit [Read error: Operation timed out]
<arubin> Because no one should install it?
randym_ has joined #ruby-lang
JpC0utur3 has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 246 seconds]
kstone has joined #ruby-lang
randym_ has quit [*.net *.split]
guns has quit [*.net *.split]
mootpointer has quit [*.net *.split]
bothra has quit [*.net *.split]
pbjorklund_ has quit [*.net *.split]
Taranis has quit [*.net *.split]
noop_ has quit [*.net *.split]
eban has quit [*.net *.split]
Guedes has quit [*.net *.split]
yxhuvud has quit [*.net *.split]
xsdg has quit [*.net *.split]
greenarrow has quit [*.net *.split]
joast has quit [*.net *.split]
meise has quit [*.net *.split]
rikai has quit [*.net *.split]
jds has quit [*.net *.split]
steez has quit [*.net *.split]
fallenhitokiri has quit [*.net *.split]
samuelkadolph has quit [*.net *.split]
tallship has quit [*.net *.split]
joschi has quit [*.net *.split]
ammar__ has quit [*.net *.split]
yibe__ has quit [*.net *.split]
sailias has quit [Quit: Leaving.]
rue_XIV has left #ruby-lang [#ruby-lang]
rue has joined #ruby-lang
<rue> injekt: Wassit?
seoaqua has joined #ruby-lang
randym_ has joined #ruby-lang
mootpointer has joined #ruby-lang
guns has joined #ruby-lang
bothra has joined #ruby-lang
Taranis has joined #ruby-lang
pbjorklund_ has joined #ruby-lang
eban has joined #ruby-lang
Guedes has joined #ruby-lang
noop_ has joined #ruby-lang
yxhuvud has joined #ruby-lang
xsdg has joined #ruby-lang
meise has joined #ruby-lang
greenarrow has joined #ruby-lang
joast has joined #ruby-lang
rikai has joined #ruby-lang
jds has joined #ruby-lang
steez has joined #ruby-lang
fallenhitokiri has joined #ruby-lang
yibe__ has joined #ruby-lang
joschi has joined #ruby-lang
ammar__ has joined #ruby-lang
samuelkadolph has joined #ruby-lang
tallship has joined #ruby-lang
kstuart has quit [Remote host closed the connection]
kstuart has joined #ruby-lang
Swimming_Bird has quit [Ping timeout: 260 seconds]
Swimming_Bird has joined #ruby-lang
guns has quit [Quit: guns]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Client Quit]
krombr has quit [Remote host closed the connection]
grobb has quit [Quit: grobb]
skinny_much has quit [Quit: ZNC - http://znc.sourceforge.net]
DomKM has quit [Quit: Leaving.]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
symm- has joined #ruby-lang
r0bby_ has joined #ruby-lang
mistym has quit [Ping timeout: 246 seconds]
skinny_much has joined #ruby-lang
arubin has quit [Quit: Textual IRC Client: www.textualapp.com]
ikrima has joined #ruby-lang
compgeek812 has joined #ruby-lang
Wardrop has joined #ruby-lang
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby-lang
breakingthings has quit [Quit: breakingthings]
rippa has joined #ruby-lang
mixandgo has joined #ruby-lang
JpC0utur3 has quit [Ping timeout: 245 seconds]
woollyams has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
woollyams has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
r0bby_ has quit [Max SendQ exceeded]
r0bby_ has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
kstone has quit [Quit: kstone]
apeiros has quit [Remote host closed the connection]
intellitech has quit [Quit: intellitech]
ikrima has quit [Quit: Computer has gone to sleep.]
tylersmith has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
symm- has quit [Quit: Leaving...]
asunderland has quit [Ping timeout: 264 seconds]
Karql has joined #ruby-lang
grobb has joined #ruby-lang
kstuart has quit [Quit: kstuart]
kstuart has joined #ruby-lang
krohrbaugh has joined #ruby-lang
malign has quit [Quit: Lost terminal]
saarinen has quit [Quit: saarinen]
krohrbaugh has quit [Read error: Operation timed out]
Cakey has quit [Ping timeout: 246 seconds]
sush24 has joined #ruby-lang
saarinen has joined #ruby-lang
Cakey has joined #ruby-lang
FlyingLeap has quit [Quit: No Ping reply in 180 seconds.]
apeiros has joined #ruby-lang
FlyingLeap has joined #ruby-lang
rolfb has joined #ruby-lang
mixandgo has quit [Quit: mixandgo]
Cakey has quit [Ping timeout: 256 seconds]
hogeo has joined #ruby-lang
benlovell has joined #ruby-lang
ebouchut has quit [Quit: This computer has gone to sleep]
ruskie has quit [Quit: ...]
rippa has quit [Ping timeout: 240 seconds]
justinmburrous has joined #ruby-lang
blacktulip has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
jxie has quit [Ping timeout: 256 seconds]
jxie has joined #ruby-lang
krohrbaugh has joined #ruby-lang
rickhull has quit [Quit: Leaving.]
compgeek812 has quit [Ping timeout: 264 seconds]
redyellowgreen has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
compgeek812 has joined #ruby-lang
<injekt> rue: whats the rational behind Nokogiri #745?
krohrbaugh has quit [Read error: Operation timed out]
<injekt> rationale*
solars has joined #ruby-lang
kstone has joined #ruby-lang
tbuehlmann has joined #ruby-lang
benlovell has quit [Read error: Operation timed out]
JohnBat26 has joined #ruby-lang
compgeek812 has quit [Ping timeout: 256 seconds]
Wardrop has quit [Quit: Wardrop]
dhruvasagar has joined #ruby-lang
<erikh> damn, rick left
Senjai has quit [Ping timeout: 256 seconds]
ruskie has joined #ruby-lang
tylersmith has joined #ruby-lang
<injekt> herp
<erikh> hi
<injekt> howdy
jsullivandigs has joined #ruby-lang
greenarrow has quit [Read error: Connection reset by peer]
greenarrow has joined #ruby-lang
schaerli has joined #ruby-lang
tylersmith has quit [Ping timeout: 248 seconds]
benlovell has joined #ruby-lang
setmeaway has joined #ruby-lang
mjio has quit []
barttenbrinke has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
compgeek812 has joined #ruby-lang
kstone has quit [Quit: kstone]
sush24 has quit [Quit: This computer has gone to sleep]
tsion has quit [Quit: Leaving]
justinmburrous has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
adambeynon has joined #ruby-lang
hidalgo has joined #ruby-lang
franckverrot_ is now known as franckverrot
mytrile has joined #ruby-lang
redyellowgreen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jxie has quit [Quit: leaving]
glebm has joined #ruby-lang
mbj has joined #ruby-lang
<apeiros> derp!
hidalgo has quit [Ping timeout: 252 seconds]
<whitequark> herp
judofyr has joined #ruby-lang
<judofyr> merp
<apeiros> why is immutability awkward in ruby?
<whitequark> basically what I need to do to make a relative update a frozen class
compgeek812 has quit [Read error: Connection reset by peer]
hidalgo has joined #ruby-lang
<erikh> herpderp
<erikh> oh
<erikh> whitequark: have you seen what I've done with palsy?
<whitequark> erikh: no
<erikh> it's probably not exactly what you need, but it achieves monads more or less by marshalling them in a sqlite db
<erikh> it's crazy, but it's what i needed for a thing
<apeiros> whitequark: hm, I think the common pattern is to mutate the data and create the new instance with the mutated data
<whitequark> erikh: that is either awesome or complete bullshit
<erikh> it works, trust me
<whitequark> apeiros: well, it's frozen.
<whitequark> def initialize; ...; freeze; end
<erikh> are you familiar with tie() from perl?
<apeiros> whitequark: that doesn't mean you can internally dup the data and transform it
<erikh> it was borne from that.
<apeiros> *can't
<erikh> everytime you write, it marshalls it.
<erikh> everytime you read, it pulls from the marshal and creates a new object.
<whitequark> apeiros: right... but I don't have a constructor which does what I want
<erikh> ergo, monads
<apeiros> whitequark: well, that's a problem then
<whitequark> erikh: no idea what perl's tie() is
<erikh> tie is a way to associate perl data structures with database access
<apeiros> with immutable classes, the constructor should be able to set all data
<erikh> perldoc -f tie (it's probably on your box if you use os x)
<erikh> well, database access is the common use case, but it's more general than that
<whitequark> linux, but yeah...
<whitequark> hm
<erikh> basically a way to redirect i/o for data structures
<erikh> palsy's very suited to my personal use case
<erikh> it's not meant to be fast.
<whitequark> I don't think this will be useful for me, or that it's related to monads in any way
<whitequark> but neat concept
<erikh> eh, monads change state by returning a new item with the mutated state
<erikh> that's exactly what this does
henrikhodne has joined #ruby-lang
<whitequark> might be
gnufied has joined #ruby-lang
<whitequark> apeiros: the point is, I don't want to allow constructing objects with invalid state with public interface
<whitequark> and ruby's initialize is indeed public interface
<whitequark> so... the alternative would be a private new_internal
<whitequark> which is just as awkward
<judofyr> erikh: what do you mean that "ruby cannot support [tie]"? can't you just implement all methods that are available on Hash/Set?
<erikh> judofyr: I get close to doing that
<judofyr> erikh: or is it really important that the Hash/Set object is the (exactly) same?
<erikh> but it's kind of a lot of work
<erikh> I support a basic set of operations and then allow a conversion
<judofyr> erikh: I guess you could share code with Rubinius
<judofyr> they kinda do the same thing
<erikh> which is good enough (again, intentional) with my purposes
<erikh> sure, yeah.
<erikh> ruby cannot support tie becuase there's no unified write for the data structures
<erikh> at least in MRI
<erikh> you can't just overload []= or something.
joast has quit [Ping timeout: 264 seconds]
krohrbaugh has quit [Read error: Operation timed out]
<erikh> or read, for that matter -- several things can perform reads, and none of them go through the same bottleneck;
<erikh> tie is that more or less in perl
<whitequark> that's better for performance
<erikh> correct, unless you provided an interface to do it which knew it was dealing with something special
<whitequark> and, given extensive use of hashes for everything, starting with keyword arguments... it matters
<erikh> :)
jsullivandigs has quit [Remote host closed the connection]
<yorickpeterse> morning
<whitequark> I personally would like to have a mixin which creates a hash-like structure
<whitequark> so you could emulate core classes
lupine has quit [Read error: Connection reset by peer]
<erikh> right, that would be a way to do it
<whitequark> though that will probably be abused and it's incomplete anyway
jsullivandigs has joined #ruby-lang
<erikh> right, the incompleteness is where my comment is borne
<whitequark> well, the incompleteness mainly stems from the fact that monkey-patches on core data structures won't be transferred
<erikh> tie is quite literally an overload for the data structure itself
<whitequark> so you cannot *actually* pass this EmulatedArray to something that expects Array
<whitequark> erikh: I don't think that is exactly good design, either
<erikh> eh, we can disagree on that
<erikh> when you need it, it's nice.
<whitequark> it breaks fundamental assumptions on data structures
<erikh> you have to explicitly tie it.
<whitequark> you think it's a hash, and it is in fact something completely different, which may not obey the hash interface *at all*
<erikh> and, like I said, common operations are bottlenecked in those cases.
<erikh> you should probably rtfm before you shit on it. :)
<whitequark> erikh: I did
dangerousbeans has joined #ruby-lang
richo has joined #ruby-lang
<erikh> your code doesn't know any better, and perl makes sure it doesn't
<ironcamel> whitequark: tied hashes do not violate the hash interface
<erikh> ^
<richo> Is String === String #=> false intended? Is there somewhere I can find the rationale behind this?
vmoravec has joined #ruby-lang
<erikh> richo: ri Class#===
<erikh> (short answer: yes)
<erikh> String == String should be true, however.
<whitequark> erikh: ok. let's check if I understand it correctly.
<whitequark> erikh: suppose you have a hash tied to a database table. you add a k-v pair to it, then remove the corresponding row externally.
<richo> It is, it's just going to make for some hilariously awkward code, and also my jaw bouncing off the floor when I saw it :)
<whitequark> will the hash still have the pair when I'd iterate it after I have removed the row?
saarinen has quit [Quit: saarinen]
<erikh> nope
<richo> thanks
<erikh> richo: np
jsullivandigs has quit [Ping timeout: 260 seconds]
<whitequark> erikh: that's what I meant.
<erikh> same with palsy, fwiw.
<ironcamel> whitequark: you want your datastruct to be out of sync?
<drbrain> richo: you aren't doing "case foo.class", are you?
<erikh> exactly, that's what I'm wondering.
<erikh> err, re whitequark
<judofyr> we need a Clippy here: "I see that you're doing `case foo.class`"
<erikh> heh
<erikh> I've done it a few times
<erikh> becuase I'm a sap
<richo> drbrain, erikh https://gist.github.com/5582441
<richo> eep
<richo> ignore is_of_type
<whitequark> ironcamel: I don't want 2 + 2 return five. I don't want to add element to a hash and see it disappear without apparent reason
<richo> it's an idea I was screwing with to get around this
<erikh> also case foo.object_id
<drbrain> every so often I write "case foo.class" then go "oops"
<whitequark> because that is not how hashes work
<erikh> whitequark: you don't see it disappear, that's the thing
elia has joined #ruby-lang
<erikh> it's i/o. like, attaching a password DB or a berkeley db
<erikh> you should expect it to be volatile.
<whitequark> sure. hash[:foo] = 1; hash[:foo] # => nil
<whitequark> looks like it disappeared.
<judofyr> like MongoDB?
<erikh> only if you cached it elsewhere
* judofyr ducks
<drbrain> richo: I would think is_of_type(String) should be just String, as that's what String#=== does
<erikh> also if you deleted it elsewhere, well
<drbrain> richo: I'm guessing type is typically a class?
<erikh> that's no different than a whoel class of concurrency problems
alessio_rocco has joined #ruby-lang
<richo> drbrain: indeed
<judofyr> richo: do this then: def is_of_type(klass) proc { |other| klass == other or klass === other } ned
<richo> judofyr: doesn't work on 1.8
<drbrain> richo: yeah, you're doing "case foo.class"
<richo> Proc#=== doesn't work that way
<drbrain> richo: why do you need to send the type?
<judofyr> richo: who cares about 1.8? :)
<ironcamel> when you tie a hash to a db, the hash becomes an interface to the db. if that's not what you want, then tie'ing is not the approach you want.
mootpointer has quit [Quit: Computer has gone to sleep.]
<richo> judofyr: I do
<richo> until OSX stops shipping it
<erikh> ironcamel: better put than me, thanks.
<drbrain> richo: that's likely to be "never"
<richo> drbrain: because cmp("object", String) reads way more sanely than cmp("object", "stringforsomereason")
<erikh> people always cringe a little at tie, until they use it
<whitequark> erikh: ironcamel: my point is that hashes have a defined interface. that interface (even if you take concurrency into account) does not imply that arbitrary code may be executed, and so on.
<whitequark> this is why I say it's a bad design.
<erikh> whitequark: hash = { }; Thread.new { hash[:foo] = 1 }; Thread.new { hash.delete(:foo) }; Thread.new { p hash[:foo] }
<erikh> what happens
<erikh> no db here
<drbrain> richo: when I see 'cmp("object", String)' I think "compare a string with a class"
<whitequark> erikh: please read my message first
<drbrain> but your method does not do that
<erikh> whitequark: yes, you're describing this problem
<richo> drbrain: cmp returns a Comparator
<erikh> this is just a classic data race
<richo> drbrain: it's a translation layer from a ruby DSL to posix shell (or vimscript.. or whatever else someone writes a backend for)
<erikh> there's nothing inherently surprising about the data disappearing by external side effect
<drbrain> richo: in that case, use an if instead of a case statement
<richo> so the compiler needs typehints about what the first arg will be at runtime, it'll nearly always be a ruby string even if it's bound to some arbitrary type
<erikh> your problem is that you're mutating a singleton in multiple processes (or threads, as the case is above)
<whitequark> erikh: "take concurrency into account" was meant as "ignore concurrency problems". that is... for example, hash lookup should be O(1).
<whitequark> this is a part of hash interface.
<erikh> no
<erikh> actually, hash lookup is best-case O(1)
<drbrain> richo: I have a feeling your interface is much too large
<richo> drbrain: that's what I'll have to do. Thanks.
rsync has quit [Ping timeout: 256 seconds]
<richo> drbrain: can you explain what you mean?
<erikh> and we're not talking about hashing algorithms
<erikh> we're talking about dictionaries.
<erikh> (they're just always called hashes in perl)
woollyams has quit [Quit: Computer has gone to sleep.]
<erikh> naive hashing (which ruby used *forever*) has a pretty painful worst-case IIRC
<richo> backends implement cmp() to do something reasonable for their platform (ie, on posix everything is a string but you need to do different things to compare string with ints in them numerically)
<erikh> the modulo->ll pattern
<drbrain> richo: maybe I used the wrong words
<whitequark> erikh: elaborate?
<drbrain> but you pass in two things, but allow one to be nil, but always prefer the latter
<erikh> fixed buckets, hash is calcuated from <magic sum> % buckets, used to find a linked list which is then search/cmp'd until key/value is found
<whitequark> ah, right, this affects lookup too
<drbrain> richo: you seem to be trying to flatten out OO-thoughts into imperative thoughts
<richo> ugh, I always forget I can't def cmp/type :/
<whitequark> erikh: you're right about best-case O(1), indeed.
<erikh> it's also a DDoS
<richo> drbrain: it's a compiler. It's not particularly OO :)
<whitequark> yeah (and in perl too)
<erikh> er, just a DoS
marr has joined #ruby-lang
<erikh> they fixed it in 5.6
<erikh> about.. a decade ago
<drbrain> richo: yeah
<whitequark> it was :)
<whitequark> fixed in ruby too
<erikh> yep
<erikh> anywho, point is, if we're going to talk about hash maps/tables as the algorithms are concerned, no, tie does not address that.
<whitequark> ok. so. what this boils down to is that perl doesn't have hash tables, it just has dictionaries, and interface guarantees for these objects are way weaker than, for example, for Ruby's Hashes
<erikh> no
<erikh> perl has very fast hash tables
mixandgo has joined #ruby-lang
<whitequark> it doesn't matter from the language point of view
<erikh> tie just backs the i/o with something else
<erikh> you could implement proper perfect hashes with tie
<erikh> and they might be faster than perl's native hashes for some data sets.
lupine has joined #ruby-lang
<drbrain> bed time
<whitequark> >could. it is not a *guarantee*. a dictionary may or may not adhere to requirements for hash tables.
noop_ has quit [Ping timeout: 264 seconds]
<erikh> drbrain: night. thanks again for tweeting!
<erikh> whitequark: I think you're missing the point here
<erikh> it's a MitM for an interface that keeps key/value storage, more or less, presented as a native data structure
<whitequark> erikh: I understand very well what it is
<erikh> you still *know* it's different
<erikh> well, whoever created it does at least.
<whitequark> ^ exactly!
<erikh> I'm not sure I'm getting the point of this
<erikh> bad code is bad code.
<richo> drbrain: https://gist.github.com/richo/5582441 , but now explodes for subclasses of any of those primitives. Is there some reasonable way to do this that I'm not seeing?
<ironcamel> whitequark: fwiw, you can determine if a hash is tied via the tied() function
<whitequark> ironcamel: I know
<ironcamel> whitequark: how do you know that?
<whitequark> ironcamel: ... I read the docs?
<whitequark> I'm not in the mood today to argue without even learning anything about the topic
mixandgo has left #ruby-lang [#ruby-lang]
<ironcamel> whitequark: you are a better man than me :)
<ironcamel> *or woman
<erikh> whitequark: relax dude, I'm not attacking you and I don't think anyone else is either.
solars has quit [Read error: Operation timed out]
<erikh> just a little surprised you picked up so much in 20 minutes :)
<whitequark> erikh: I don't think you do :)
stamina has joined #ruby-lang
<erikh> cool, man
<whitequark> erikh: ironcamel: lemme explain this another way. Features such as tie() (and, yes, concurrency with shared memory, indeed) make it much harder to reason about code fragments in isolation. so, for example, given hash[:a], hash[:b] = hash[:b], hash[:a]
<erikh> oh, I'm disagreeing with that
<whitequark> you don't exactly have a way to say what will happen even if you know that hash is a Hash.
<erikh> what I am saying is that harder doesn't necessitate the non-existence of a feature is all
<erikh> go handles this really elegantly
<whitequark> however, you could argue that in Ruby, there is same problem present: anyone could override anything on Hash, and that would be right
<erikh> surprisingly so
<ironcamel> whitequark: fwiw, i personally wouldn't tie a hash to a db. tie'ing an array to a file is common and kind of cool. each line of the file corresponds to an item in the array.
<erikh> sorry, to be clear -- go gets a lot of mileage out of a very small feature set.
<erikh> also I just learned it so it's the best thing ever for a few weeks at least. deal with it. :P
<whitequark> and this is why I said this is "bad design"... while in Ruby you can avoid monkeypatching Hash (there are other ways), in perl this is encouraged
<whitequark> and the last part
<erikh> it's not a monkeypatch, though.
<erikh> tie only works on a single object.
<ironcamel> yeah, its not global
<erikh> it associates it with a class that implements the functionality.
<whitequark> sure. I don't think you can provide this functionality in perl in any other way so that it will be convenient enough to use.
<ironcamel> really?
<erikh> err, a package.
<whitequark> ironcamel: well, if you insist on having a compatible interface, it seems that you can't, to me
<erikh> I don't think monkeypatching is really a solution here
<ironcamel> you don't think perl has a way to provide an interface to a db?
<erikh> ironcamel: I think there are some crossed wires here
<ironcamel> probably
<erikh> that's not what I heard, at least.
* whitequark sighs
<erikh> whitequark: so, a fundamental thing here is that hashes are not objects in perl in the traditional sense
<whitequark> erikh: exactly
<erikh> right. so they can actually be a hash and another "thing" at the same time.
richo has quit [Ping timeout: 256 seconds]
<erikh> same with strings and arrays, etc.
<whitequark> if you want something that quacks like a hash in perl, you have to use a hash, or it seems so, to me
<erikh> right, but in ruby this could be done with singleton classes.
<erikh> make the hash, class << hash, etc etc.
<whitequark> my point would be that in ruby, this could be done *without* singleton classes :)
<erikh> with direct monkeypatching, sure
<whitequark> with just a different class.
<erikh> but then you'd get nothing but those kinds of hashes.
<whitequark> BackedDictionary.
<erikh> oh, yes. that's what I do with Palsy.
<erikh> the problem is, having that gated interface
<erikh> delete_at vs delete, etc.
<whitequark> yea. I think that Palsy, wrt/ design, is better than tie().
<erikh> I'm not so sure about that.
<erikh> but we can agree to disagree on such subjects. :)
faces has joined #ruby-lang
<erikh> fwiw, if you want a really killer implementation, Moneta is much better and a lot more flexible.
<erikh> Palsy quite literally does exactly what I f'n want. :P
gnufied has quit [Quit: Leaving.]
bzalasky has quit [Remote host closed the connection]
face has quit [Ping timeout: 252 seconds]
<whitequark> erikh: yeah. and from what it seems to me, Moneta does not emulate a Hash
<erikh> Moneta's a carlhuda project too IIRC, so it gets a lot more eyeballs
Wardrop has joined #ruby-lang
<erikh> Moneta emulates several data structures
solars has joined #ruby-lang
<whitequark> (as in, it has several Hash-compatible methods, but it does not try to look *exactly* like a hash. And that is good)
<erikh> Oh, I use the word emulate differently
<erikh> fair play.
<whitequark> when I talked about having a mixin which you can use to emulate a Hash, I did not have your, or moneta's use case in mind
<erikh> ah ok
<whitequark> it would be suitable for mocking, for example... this kind of stuff
<erikh> I guess that's where we got confused.
<whitequark> when it's still a Hash, but you need some instrumentation in it.
<whitequark> or maybe you want to experiment with different algorithms.
<erikh> yeah, Moneta probably could make for an interesting way to do hash transaction logs
<erikh> that might be fun.
<whitequark> *not* networked io or whatever
face has joined #ruby-lang
<erikh> well integration testing these kinds of things will always be hard
<erikh> and I really hate mocks
<erikh> really, really hate mocks
<erikh> but that's a different subject
<whitequark> mocks are often abused.
<whitequark> beyond all reason
faces has quit [Ping timeout: 276 seconds]
<whitequark> perl's threads are... weird
<erikh> perl's threads suck
<erikh> there's nothing else to say.
<whitequark> the threads::shared avoids aliasing as much as it's possible
<whitequark> or so it seems
gnufied has joined #ruby-lang
<whitequark> but it's basically multivm, not a threaded vm
<ironcamel> perl threads emulate fork
<erikh> nobody uses them, and things like Coro come with so many "don't do that" rules that I'm amazed anyone puts up with it
<ironcamel> so not memory sharing by default
<whitequark> yeah
<ironcamel> yeah, they are discouraged
<ironcamel> they were originally for emulating fork() on windows machines
<ironcamel> so code you wrote that called fork() would work on platforms that did not support it, like windows
<ironcamel> then someone exposed this internal implementation and called them threads
<erikh> oh, I didn't realize they were borne from that
<erikh> so that's probably activestate wasn't it?
<ironcamel> no idea
<erikh> they did one of the first ports to windows
<whitequark> ugh, windows
<ironcamel> so are ruby fibers pretty awesome?
noop has joined #ruby-lang
<ironcamel> i always wanted to play with them
<whitequark> ironcamel: ruby threads and fibers, well, work.
<whitequark> properly.
<whitequark> threads still have the global VM lock, and thread/fiber-local variables are awkward.
<whitequark> that's about it
<erikh> I like threads in ruby
<erikh> the GIL lets you cheat on a few synchronization problems.
<judofyr> waaaaay better than "threads" in Perl
<whitequark> shared mutable state is meh everywhere
<erikh> this too
<yorickpeterse> haha threads and MRI
<whitequark> cxx, ruby, whatever
<ironcamel> are fibers the same as threads?
<erikh> it's just fine for i/o
<whitequark> ironcamel: fibers = coroutines
<erikh> err, the GIL that is
<erikh> ironcamel: you manage the scheduling
<erikh> threads == MRI manages the scheduling
<ironcamel> ah
<erikh> in short at least.
<whitequark> ironcamel: cooperative concurrency (fibers) and preemptive concurrency (threads)
<whitequark> and no parallelism on mri.
<judofyr> (slightly related to threads since it uses Thread#backtrace_locations)
<erikh> judofyr: joyent's been doing cool stuff with flame graphs and dtrance
<erikh> dtrace
<erikh> google for max bruning's blog
<erikh> that guy.. is a god
<apeiros> whitequark: huh? I don't see why allowing to set all internal state collides with prohibiting invalid state…
<judofyr> whitequark: do you know a lot about static analysis? I've recently started reading up on it (lattices)
<apeiros> (sorry for the late reply - I'm at work atm)
kgrz has quit [Ping timeout: 246 seconds]
stamina has quit [Quit: WeeChat 0.4.0]
vlad_starkov has joined #ruby-lang
dangerousbeans has quit [Quit: KTHNXBAI]
<whitequark> apeiros: actually disregard that, I screwed up with using my own interface
<whitequark> that code indeed created objects with invalid internal state.
<whitequark> judofyr: lattices?
<whitequark> ah, DFA
<judofyr> whitequark: mathy stuff: http://en.wikipedia.org/wiki/Lattice_(order)
L0rdShrek____ has joined #ruby-lang
<whitequark> yeah yeah
<whitequark> I've not used lattices in my work
schaerli has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
<judofyr> I guess http://en.wikipedia.org/wiki/Abstract_interpretation is the part of static analysis that uses lattices
fsvehla has quit [Remote host closed the connection]
<whitequark> that might be because I use SSA IR, or some other reason
vlad_starkov has quit [Ping timeout: 252 seconds]
greenarrow has quit [Ping timeout: 245 seconds]
greenarrow has joined #ruby-lang
krohrbaugh has quit [Read error: Operation timed out]
* judofyr was suddenly tempted at writing a static analyzer for Ruby
<judofyr> not that I know anything about it
thone_ has joined #ruby-lang
<judofyr> whitequark: parser opens up for many interesting experiments :)
* whitequark sighs
<judofyr> hm?
<whitequark> if ruby was done as I want, it would include a partial evaluator written in itself from the very beginning
<whitequark> this would greatly benefit practically everything.
<matti> judofyr: Is that because of you Go bug?
<judofyr> matti: what?
<matti> judofyr: Are't you learning Go?
<judofyr> matti: not now. some months ago, yes.
<matti> Ah.
<matti> Righto.
thone has quit [Ping timeout: 245 seconds]
kgrz has joined #ruby-lang
<erikh> ok, i need to pass out
* erikh waves
fsvehla has joined #ruby-lang
<ironcamel> nite erikh
noop has quit [Ping timeout: 246 seconds]
kirin` has quit [Read error: Operation timed out]
<matti> Night erikh
KM has quit [Read error: Connection reset by peer]
KM|2 has joined #ruby-lang
<andrewvos> Nyte erikh
<judofyr> natt erikh
<andrewvos> knight erikh
vlad_starkov has joined #ruby-lang
kke_ has quit [Quit: Reconnecting]
kke has joined #ruby-lang
<kke> foo = ClassName case foo when ClassName <-- this doesn't work, also foo.class seems to be "Class"
dhruvasagar has quit [Ping timeout: 248 seconds]
<yorickpeterse> wat
dhruvasagar has joined #ruby-lang
<kke> trying to case a class, not an instance
toretore has joined #ruby-lang
<yorickpeterse> Pastie your code because the above example would be caused by anything
<yorickpeterse> (or what's relevant of it)
<andrewvos> whaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<andrewvos> aaaaaaaaaaaaa
<andrewvos> t
stamina has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
tik-tak has left #ruby-lang [#ruby-lang]
<yorickpeterse> hammilton plz
<yorickpeterse> kke: and `out_class` is an actual class or an instance?
<kke> actual class
<yorickpeterse> ah, it should work if you pass the instance
<kke> i have this soap api thing that for example returns errors in the struct defined by wsdl, so in login i need to return like UserParamsOut(:status => "ERROR: Blahblah") and CompanyParamsOut(:status => "ERROR: Blahblah") etc, so i figured i just pass the class name in the login method so it returns a proper object by doing out_class.new(...)
<kke> yorickpeterse: yes, that i knew, but i'd like it to work with an actual class
<kke> not instances
<kke> out_class.class is always Class
<kke> out_class == OutClass is true but case uses === i thinks
<kke> maybe i'll just have to create the instance beforehand then
apeiros has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
gix has quit [Ping timeout: 276 seconds]
noop has joined #ruby-lang
Phoop has joined #ruby-lang
gix has joined #ruby-lang
apeiros has joined #ruby-lang
alessio_rocco has quit [Ping timeout: 256 seconds]
alessio_rocco has joined #ruby-lang
<yorickpeterse> whitequark: is it possible to get rid of that coveralls bot in parser? It's super annoying when it keeps telling the code coverage decreased by 0%
<yorickpeterse> what the hell, there's a `require "English"`?
<whitequark> yes
<whitequark> a bunch of variable aliases
<whitequark> global
<yorickpeterse> right
tmi has joined #ruby-lang
<yorickpeterse> whitequark: https://github.com/whitequark/parser/issues/31 regarding this, how crazy would it be to include comments in the AST?
<yorickpeterse> maybe not as nodes but one way or another
<yorickpeterse> it would certainly, for example, make the live of YARD easier
<yorickpeterse> * life
fosky has quit [Ping timeout: 245 seconds]
<whitequark> so which way?
<yorickpeterse> I'm not sure, but how crazy would it be to store them as nodes?
* yorickpeterse runs
<whitequark> foo.bar(#baz \n 1)
<whitequark> and where does the node (which node?) go
<yorickpeterse> that would be (foo.bar() (#baz\n) (1))
<yorickpeterse> which would be a syntax error probably
<whitequark> plus, with LALR parsing being shitty as it is, the node locations would be pretty much random in any case
<yorickpeterse> hm
<whitequark> wat
<yorickpeterse> hm
<whitequark> comments can be ANYWHERE
Squarepy has joined #ruby-lang
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
Cakey has joined #ruby-lang
machuga|away is now known as machuga
Phoop has quit [Quit: Phoop]
* andrewvos researches yorickpeterse to find the perfect insult
<andrewvos> Hey Yorick, the Netherlands is shit
<andrewvos> And uhh, you have a developed economy.
<andrewvos> Wow I want to live in the Netherlands now
<andrewvos> It's quite nice
<matti> ...
<matti> ;]
<matti> I'd want to live in Sweden.
<matti> All the girls... mmm...
<matti> ;]
<andrewvos> Heh
<andrewvos> Was just thinking that
<whitequark> matti: and all the laws
<andrewvos> That's pretty much all I think when someone says Sweden
<matti> andrewvos: :)
<matti> andrewvos: I've been there twice ;p
<matti> andrewvos: Its hard not to drool.
<matti> ;d
* matti is joking of course.
<matti> But, my girlfriend is Japanese, and I am the happiest person ever ;p
<matti> :)
<andrewvos> You sure do wink a lot matti
<matti> Is that bad?
<andrewvos> Are you having a stroke?
<injekt> lol
<matti> andrewvos: Haha
<andrewvos> :)
<injekt> you can tell when he starts misspelling stuff
<matti> Me?
<matti> ;p
<injekt> "impaired speech"
<injekt> im a bad person
* matti cries because of injekt
<yorickpeterse> andrewvos: yeah it is in a lot of ways
<matti> You go on naughty list, injekt
<injekt> I just got out of the shortest most pointless meeting ever
<yorickpeterse> also what's that lassie, .include() is a private method? haha, send() up your ass
<matti> injekt: Oh. Fairdo.
<injekt> matti: ;)
<whitequark> yorickpeterse: alias send public_send
<whitequark> is how it should be.
<yorickpeterse> public_send is for scrubs
<whitequark> and maaaaaybe alias private_send send
<yorickpeterse> http://pastie.org/private/myqacnls95tgxlhzoubi3g only god can help me now
tbuehlmann has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
<whitequark> interesting
<whitequark> or, maybe, not
Phoop has joined #ruby-lang
swav has joined #ruby-lang
schaerli has joined #ruby-lang
sush24 has joined #ruby-lang
sush24 has quit [Ping timeout: 264 seconds]
Guest61475 has joined #ruby-lang
Domon has quit [Remote host closed the connection]
benlovell has quit [Ping timeout: 252 seconds]
pskosinski has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
Cakey has quit [Ping timeout: 256 seconds]
blacktul_ has joined #ruby-lang
sail has joined #ruby-lang
Guest61475 has quit [Quit: Ex-Chat]
krz has quit [Quit: krz]
GarethAdams has joined #ruby-lang
blacktulip has quit [Ping timeout: 256 seconds]
postmodern has quit [Quit: Leaving]
barttenbrinke has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
r0bby_ has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 248 seconds]
swygue has joined #ruby-lang
krohrbaugh has quit [Read error: Operation timed out]
dhruvasagar has joined #ruby-lang
workmad3 has joined #ruby-lang
fsvehla has joined #ruby-lang
<whitequark> let's deprecate mri c api
barttenbrinke has joined #ruby-lang
dustint has joined #ruby-lang
GarethAdams has quit [Read error: Connection reset by peer]
GarethAdams has joined #ruby-lang
GarethAdams has quit [Client Quit]
sail has quit [Remote host closed the connection]
dustint has quit [Client Quit]
dustint has joined #ruby-lang
kgrz has quit [Ping timeout: 264 seconds]
<yorickpeterse> lets deprecate MRI
dustint has quit [Client Quit]
dustint has joined #ruby-lang
<erikh> hello again ruby friends
<erikh> I couldn't sleep, so I banged out part 2
<erikh> any review comments would be great.
<erikh> I'll proofread it in the am and ship it then
<yorickpeterse> haha wtf Ruby
<yorickpeterse> Foo::Bar.const_get(:User) # => returns ::User basically
<yorickpeterse> Foo::Bar::User # => returns the Foo::Bar::User module
<yorickpeterse> ah right, second param to false fixes it
<erikh> it works from the current scope
<erikh> module Foo::Bar; const_get(:User); end
<yorickpeterse> I expected it to prioritize Foo::Bar::User over ::User
<erikh> or use an inject pattern
<erikh> "Foo::Bar::User".split(/::/).inject(Object) { |x,y| x.const_get(y) }
<yorickpeterse> wat
<erikh> try it
elia has quit [Ping timeout: 260 seconds]
<erikh> >> module Foo; module Bar; module User; end; end; end; "Foo::Bar::User".split(/::/).inject(Object) { |x,y| x.const_get(y) }
<eval-in> erikh => Foo::Bar::User (http://eval.in/30316)
<erikh> if you have a string that way, e.g., Class#name
<erikh> you can do stupid shit like that all day.
<erikh> I use it in a plugin system myself
<judofyr> yorickpeterse: Foo::Bar.const_get(:User) returns Foo::Bar::User here (even if ::User exists)
<erikh> so you can import files and then associate them with classes
<yorickpeterse> >> C = 10; module A; module B; C = 20; end; end; A::B.const_get(:C)
<eval-in> yorickpeterse => 20 (http://eval.in/30317)
<yorickpeterse> hm
<yorickpeterse> then wtf
<yorickpeterse> probably Rails or something
<erikh> anyhow, if anyone has time to review that blog post and offer comments, I'd really appreciate it
<erikh> ttfn
<yorickpeterse> what's it about?
benlovell has joined #ruby-lang
<injekt> ur momz
<judofyr> erikh: I'll read it later
<yorickpeterse> hurrhurr
machuga is now known as machuga|away
machuga|away is now known as machuga
s1n4 has joined #ruby-lang
s1n4 has quit [Changing host]
s1n4 has joined #ruby-lang
thebastl has joined #ruby-lang
s1n4 has left #ruby-lang [#ruby-lang]
dtrump has joined #ruby-lang
bastetmilo has quit [Ping timeout: 245 seconds]
apeiros has quit [Remote host closed the connection]
dRbiG has quit [Ping timeout: 264 seconds]
kgrz has joined #ruby-lang
dtrump has quit [Ping timeout: 248 seconds]
kgrz has quit [Ping timeout: 246 seconds]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
swygue has quit [Ping timeout: 256 seconds]
intellitech has joined #ruby-lang
intellitech has quit [Changing host]
intellitech has joined #ruby-lang
apeiros has joined #ruby-lang
hogeo has quit [Remote host closed the connection]
<zzak> my momz?!
<injekt> zzak: no urs
<zzak> no mine!
krohrbaugh has joined #ruby-lang
<whitequark> erikh: there's also rubygems-bundler
<whitequark> basically automatic bundle exec
<whitequark> it works really well.
jxpx777 has quit [Quit: Leaving...]
<whitequark> also a good article.
krohrbaugh has quit [Read error: Operation timed out]
alessio_rocco has quit [Ping timeout: 252 seconds]
alessio_rocco has joined #ruby-lang
mytrile has joined #ruby-lang
seoaqua has quit [Quit: 离开]
tbuehlmann has joined #ruby-lang
charliesome has joined #ruby-lang
mucker has joined #ruby-lang
<injekt> yay debugging libxml
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
pipework has joined #ruby-lang
jxpx777 has joined #ruby-lang
GeissT_ has joined #ruby-lang
<whitequark> what do you say there is no digest/sha256
<yorickpeterse> digest/sha2
<whitequark> oh right
<whitequark> thanks
carloslopes has joined #ruby-lang
GeissT has quit [Ping timeout: 252 seconds]
dustint has quit [Remote host closed the connection]
redyellowgreen has joined #ruby-lang
dustint has joined #ruby-lang
mistym has quit [Remote host closed the connection]
swygue has joined #ruby-lang
yalue has joined #ruby-lang
jxpx777 has quit [Read error: Connection reset by peer]
jxpx777 has joined #ruby-lang
kirin` has joined #ruby-lang
breakingthings has joined #ruby-lang
jvrmaia has joined #ruby-lang
joast has joined #ruby-lang
Phoop has quit [Quit: Phoop]
workmad3 has quit [Ping timeout: 256 seconds]
schaerli has quit [Remote host closed the connection]
swygue has quit [Ping timeout: 260 seconds]
<ericwood> whitequark: you're extra rant-y on twitter today
<ericwood> ;)
tomzx_mac has joined #ruby-lang
<whitequark> har har
<ericwood> drumroll, please
<ericwood> time to see if google decided to rank my work back where it was before the sneaky 500s started showing up!
<ericwood> nope, it's still fucked.
<whitequark> link
tomzx_mac has quit [Remote host closed the connection]
GeissT_ has quit [Ping timeout: 256 seconds]
<ericwood> it won't make sense to y'all
wmoxam has joined #ruby-lang
<ericwood> and I'm rewriting it so I'm self-conscious about my code!
GeissT has joined #ruby-lang
tomzx_mac has joined #ruby-lang
<ericwood> but here's a synopsis of my epic fuckup: we have a separate google-friendly version of the page (a directory of IT service providers)
<ericwood> I wrote that very early in the process
<ericwood> things changed, I forgot about it
rolfb has quit [Quit: Linkinus - http://linkinus.com]
<ericwood> a few weeks later we realize that it never worked, and the googlebot just gets 500s
<ericwood> we used to be on the first page for this search, now we're nowhere :'(
<ericwood> tl;dr good morning everyone, today is going to suck
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
alessio_rocco has quit [Ping timeout: 276 seconds]
alessio_rocco has joined #ruby-lang
fsvehla has quit [Ping timeout: 248 seconds]
alessio_rocco has quit [Client Quit]
nivanson has joined #ruby-lang
<injekt> dbussink: weird build runs green now, will merge later
Silex has quit [Ping timeout: 252 seconds]
kgrz has joined #ruby-lang
nivanson_ has quit [Ping timeout: 276 seconds]
schaerli has joined #ruby-lang
<injekt> eh, or just right now
kevinfagan has quit [Max SendQ exceeded]
<dbussink> injekt: cool :)
kevinfagan has joined #ruby-lang
sailias has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
Silex has joined #ruby-lang
rwilcox has joined #ruby-lang
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
tbuehlmann has quit [Ping timeout: 248 seconds]
tmi has quit [Quit: tmi]
schaerli has joined #ruby-lang
enebo has joined #ruby-lang
alessio_rocco has joined #ruby-lang
adambeynon has joined #ruby-lang
krombr has joined #ruby-lang
nathanstitt has joined #ruby-lang
sailias has quit [Quit: Leaving.]
sailias has joined #ruby-lang
jxpx777 has quit [Quit: Leaving...]
GeissT has quit [Quit: MillBroChat AdIRC User]
<whitequark> lolrails, why is read_attribute public but write_attribute private
mistym has quit [Remote host closed the connection]
<injekt> thats silly they should both be private
lguardiola has joined #ruby-lang
alessio_rocco has quit [Quit: Lost terminal]
<ericwood> why is it that people who ask questions in IRC channels always use really really weird english?
dRbiG has joined #ruby-lang
<ericwood> obviously they aren't native speakers
<injekt> trying to find the weird english in that question
<ericwood> not your question
<ericwood> sorry, it's off-topic
<injekt> i meant your question :P
<ericwood> #javascript is just being weird
<ericwood> ha
<injekt> s/#//
barttenbrinke has quit [Remote host closed the connection]
<yorickpeterse> > Javascript
<yorickpeterse> well there's your problem
<ericwood> heh
<ericwood> a lot of questions are things like "how element hovver why no work?!"
<ericwood> but there's enough serious discussion that I stick around...
tomzx_mac has quit [Ping timeout: 256 seconds]
<yorickpeterse> Hm, I wonder if I should use that as my go-to troll channel
<gnufied> what will it channel?
tomzx_mac has joined #ruby-lang
<yorickpeterse> I think you accidently a sentence there
<ericwood> lol
<injekt> each_with_object is 1.9.1+ right? or 1.9.2?
<injekt> dont have anything lower than 2.0 on this box
dhruvasagar has quit [Ping timeout: 252 seconds]
KM|2 has quit [Read error: Connection reset by peer]
KM has joined #ruby-lang
Akkard_ has joined #ruby-lang
Akkard_ has quit [Read error: Connection reset by peer]
carloslopes has quit [Remote host closed the connection]
agile has quit [Quit: Ex-Chat]
io_syl has quit [Quit: Computer has gone to sleep.]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<gnufied> injekt: it is 1.9.1+
<injekt> gnufied: thanks
tomzx_mac has quit [Ping timeout: 252 seconds]
<gnufied> (verified it via ruby, I didn't remember either)
bzalasky has joined #ruby-lang
krombr has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
grobb has quit [Quit: grobb]
ged has joined #ruby-lang
singpolyma has quit [Remote host closed the connection]
singpolyma has joined #ruby-lang
tomzx_mac has joined #ruby-lang
krohrbaugh has joined #ruby-lang
krombr has joined #ruby-lang
workmad3 has joined #ruby-lang
<injekt> :)
glebm has quit [Ping timeout: 256 seconds]
krohrbaugh has quit [Ping timeout: 252 seconds]
glebm has joined #ruby-lang
<injekt> now 1.8 is going to be EOL I wonder if the core team will have problems with 1.9 syntax going into stdlib
bzalasky has joined #ruby-lang
headius has joined #ruby-lang
<zzak> depends on the lib
<injekt> zzak: why?
<zzak> some maintainers will still support 1.8, i imagine because their company does or whatever
<injekt> heh
<injekt> I guess
<zzak> im sure others will welcome the change
hidalgo has quit [Ping timeout: 264 seconds]
<zzak> it doesnt hurt to ask, and have a patch handy
<injekt> yeah :)
jxie has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
alessio_rocco has joined #ruby-lang
<zzak> youd be surprised, i think tdiary was already using ruby 2.0 in production
JpC0utur3 has joined #ruby-lang
<matti> Few companies are.
<matti> I think that even github is getting there slowly.
<eam> is redhat moving to ruby 2.x in rhel7?
<injekt> heh I moved all our company stuff to 2.0 on release day
<eam> osx still ships 1.8
Senjai has joined #ruby-lang
Senjai has joined #ruby-lang
Senjai has quit [Changing host]
davi_____ has joined #ruby-lang
davi_____ has quit [Remote host closed the connection]
<eam> looks like FC18 jumps up to 1.9.3
<eam> 2015 for 2.x on rhel/centos then
thebastl has quit [Ping timeout: 248 seconds]
mistym has quit [Remote host closed the connection]
<darix> eam: i doubt rh will switch ruby within the life cycle of the currently released rhel branches
<darix> nor will suse for sles 10/11 probably
<darix> so 1.8 will live at least as long as those
<ericwood> long live 1.8!
blacktul_ has quit [Remote host closed the connection]
DomKM has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
vlad_starkov has joined #ruby-lang
asunderland has joined #ruby-lang
glebm has quit [Ping timeout: 252 seconds]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
swygue has joined #ruby-lang
justinmburrous has joined #ruby-lang
agile has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 252 seconds]
noop has quit [Ping timeout: 248 seconds]
ykk` has joined #ruby-lang
<yorickpeterse> injekt: why are you watching Youtube videos and not doing wokr?
<yorickpeterse> * work
<yorickpeterse> get back to work slacker
<injekt> yorickpeterse: BRO
<injekt> yorickpeterse: im on a break
<yorickpeterse> suuuure
glebm has joined #ruby-lang
<eam> darix: yes, that's why I said rhel7, as it's based on FC18 which uses 1.9.3 -- and 2015 for 2.0, which would be rhel8
<eam> those are the upcoming major revisions
<yorickpeterse> isn't CentOS still on some stone-age old version of Ruby?
swygue has quit [Ping timeout: 252 seconds]
<eam> centos is just a recompiled rhel, with trademarks removed
<yorickpeterse> hm, 1.8.7 apparently
<eam> centos6 aka rhel6 is on 1.8.7
alessio_rocco has quit [Ping timeout: 248 seconds]
<eam> most distros that have an enterprise lifecycle will be on 1.8.7
<wnd> ruby needs a compiler (that procudes native code), then there'd always be a valid reason for slacking off
<yorickpeterse> we already have one
alessio_rocco has joined #ruby-lang
<yorickpeterse> Rails bootup times
<whitequark> wnd: doesn't make any sense
<yorickpeterse> whitequark: xkcd
<ericwood> jRuby gives me a million reasons to slack off
<whitequark> wnd: I know
<ericwood> change rails route --> restart server --> wait for the JVM to catch up
<whitequark> err yorickpeterse
<ericwood> rinse, repeat, throw monitor through window
<yorickpeterse> Anger Driven Development
<yorickpeterse> Given Shit Takes Too Long To Start Up
<yorickpeterse> Throw My Monitor Out Of The Window
<eam> wnd: require 'compiling' => compiling.rb: sleep 600 + rand(300)
<ericwood> sometimes throwing just one monitor isn't enough, so I take my coworker's monitors and throw them as well
gnufied has joined #ruby-lang
<wnd> well, at work we do have badly written rspec set that takes roughly 20 minutes to run
<yorickpeterse> wat
<ericwood> heh, our test suite also takes forevarrrr
<yorickpeterse> I managed to get ours down from 7 to around 3 minutes
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<yorickpeterse> but it tests fuck all
<wnd> gazillion tests that expect real, live postgres through sequel
<eam> I had one that took half a week - it was a packaging system
<ericwood> sheeiiiiit
<eam> lots of fetching, extracting, and iterating over huge trees of files
<wnd> luckily it's fine with empty db on localhost, but unfortunately it doesn't clean up its trash and consequently may fail because of the garbage that was left behind
jsullivandigs has joined #ruby-lang
<yorickpeterse> wnd: we use DatabaseCleaner for that
<yorickpeterse> which is slow as balls though, so we only use it during boot
<wnd> I think we used that at some point, but ditched it as it didn't clean up everything. I don't know the details, that was before I started here.
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
<wnd> still have bits and pieces in helper files, DatabaseCleaner.logger = Logger.new("DatabaseCleaner.log")
alessio_rocco has quit [Ping timeout: 248 seconds]
<wnd> umm, actually, it's still there, but only used for mongo
justinmburrous has quit [Remote host closed the connection]
<yorickpeterse> heh
<wnd> and a commetn says "db cleaner won't work with sequel, but s transaction rolled backaround each example"
<yorickpeterse> in our two main apps we used it for every. fucking. expectation
<yorickpeterse> I managed to get rid of it in about 80% of the cases
alessio_rocco has joined #ruby-lang
<whitequark> >mongo
<whitequark> you can end here
<yorickpeterse> and in this new project I just use the models that are actually used (Foo.destroy_all, etc), unless there's actually a lot of different tables being used
<yorickpeterse> whitequark: it serves a purpose, get over it
benlovell has quit [Ping timeout: 248 seconds]
<whitequark> yorickpeterse: doesn't
<wnd> mongo seems to work reasonably well as data storage for metrics
ykk` has quit [Quit: ykk`]
<yorickpeterse> whitequark: seems to work pretty well for our 120GB of data
<yorickpeterse> if it's not more by now
<whitequark> pull the plug out of your server, watch
benlovell has joined #ruby-lang
panpainter has joined #ruby-lang
<yorickpeterse> whitequark: actually that won't do a thing
<wnd> I don't pretend that I like mongo but it's not like I have a choice
<yorickpeterse> we don't use sharding so about 80% of all the bullshit doesn't really affect us
<yorickpeterse> That's not to say it wasn't trouble getting here from what I've heard
schaerli has quit [Remote host closed the connection]
jvrmaia has quit [Remote host closed the connection]
solars has quit [Ping timeout: 276 seconds]
<yorickpeterse> whitequark: and no offense but have you actually used Mongo? I'm seeing way too many people hate on it while never having used it for more than their DIY blag
jvrmaia has joined #ruby-lang
<yorickpeterse> which is a stupid use case for mongo
asunderl1nd has joined #ruby-lang
asunderland has quit [Ping timeout: 248 seconds]
<judofyr> btw, anyone knows how Facebook scales their MySQL? I've heard a lot about Memcached at Facebook, but not MySQL…
<apeiros> I thought facebook used cassandra?
<judofyr> they used cassandra for the messaging system
<whitequark> yorickpeterse: I'm not anti-nosql. nosql has its use cases... has them for last forty years or maybe more
<whitequark> I don't like one fucking dumb database
<judofyr> whitequark: "Facebook used Cassandra to power Inbox Search, with over 200 nodes deployed.[2] This was abandoned in late 2010 when they built Facebook Messaging platform on HBase.[3]"
<whitequark> judofyr: ok
<judofyr> oops
<judofyr> apeiros: "Facebook used Cassandra to power Inbox Search, with over 200 nodes deployed.[2] This was abandoned in late 2010 when they built Facebook Messaging platform on HBase.[3]"
Criztian has joined #ruby-lang
krohrbaugh has joined #ruby-lang
jvrmaia has quit [Ping timeout: 245 seconds]
<apeiros> aha
asunderland has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
hramrach_ has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
asunderl1nd has quit [Ping timeout: 252 seconds]
justinmburrous has joined #ruby-lang
<yorickpeterse> whitequark: personal opinions and what not are fine, I however don't like it when people start bitching about something they may haven't even used yet
<yorickpeterse> From a technical point there's a lot of stupid shit in Mongo (e.g. the safe writing bullshit, locks everywhere, etc) but so far here it hasn't really looked like the pile of shit people make of it
<yorickpeterse> having said that, when you start using Mongoid to fake joins and what not it does become weird to say the least
benlovell has quit [Ping timeout: 260 seconds]
Squarepy has quit [Quit: Leaving]
JpC0utur3 has quit [Ping timeout: 252 seconds]
<yorickpeterse> but I suppose I should stop reading HN. The moment you mention Mongo it turns into one massive circlejerk about how bad mongo is compared to <insert database not a single nerd uses>
<yorickpeterse> "WELL I THINK YOU SHOULD USE DERPINADB BECAUSE WE USE IT FOR OUR BIG DATA HADOOP STORAGE CLUSTER MEMCACHED BASECAMP"
<yorickpeterse> Ok I'm done
<judofyr> DerpinaDB is pretty nice though
<andrewvos> Seems silly to use cassandra in ruby because the gems for it aren't very mature.
<andrewvos> The only option really is Mongo, because of its widespread use
djwonk has joined #ruby-lang
<zzak> key to happiness: dont read hn, or youtube comments
* andrewvos has left the conversation...
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
tbuehlmann has joined #ruby-lang
dankest has quit [Quit: Leaving...]
vlad_starkov has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
<yorickpeterse> in unrelated news, Rails engifying stuff is a fucking pain in the royal ass
<yorickpeterse> retarded dependencies everywhere
<yorickpeterse> And this app has a dir called "app/enums" with a bunch of classes in them. Not a single class has any methods or whatsoever
andre____ has joined #ruby-lang
andre____ has quit [Remote host closed the connection]
<yorickpeterse> srsly
<andrewvos> orly?
andre____ has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
<yorickpeterse> yarly
<yorickpeterse> Today is "Yorick rages on code day", in other words it's a normal day
<andrewvos> orly?
bothra has quit [Ping timeout: 264 seconds]
<yorickpeterse> get out hammilton
vlad_starkov has quit [Ping timeout: 252 seconds]
havenwood has joined #ruby-lang
andre____ is now known as andrewhl
bothra has joined #ruby-lang
asunderl1nd has joined #ruby-lang
andrewhl has quit [Remote host closed the connection]
<andrewvos> orly?
<eam> no one wants to hear that mysql is generally the best choice
asunderland has quit [Ping timeout: 241 seconds]
<andrewvos> Umm, it isn't?
<eam> see?
<andrewvos> Wait no you won't getme!
<yorickpeterse> ugh, you mean that database with a proper type validation system?
<eam> andrewvos: :) yorickpeterse: right, it's real gross and has warts -- totally valid for everyone to hate it
<yorickpeterse> or the one with an equally broken set of different table storage mechanisms, including BLACKHOLE (who the hell would use that anyway)?
<eam> but it has absolutely the best HA and replication story
<eam> and at scale that's what matters most
<yorickpeterse> I'd rather have a somewhat saner database
<yorickpeterse> one that can scale equally well
<eam> yorickpeterse: me too
<yorickpeterse> e.g. Postgres
<eam> postgres doesn't
<yorickpeterse> pretty sure a lot of people disagree with that
<yorickpeterse> well except for Dribble
<yorickpeterse> lol
<eam> it's missing key features (or has gotten them super recently) like chained replication. And when you look at the operations necessary to perform failover, generally they involve loss of redundancy
<eam> yorickpeterse: postgres is my favorite for dev on my laptop
<eam> but I'll port my stuff to an ugly database like mysql to get top quality replication and operability before I hit production
wallerdev has quit [Quit: wallerdev]
<yorickpeterse> I have only limited experience with Pg replication so I can't comment too much on it
<eam> yorickpeterse: from a developer standpoint, pg wins hands down by a mile
dhruvasagar has joined #ruby-lang
scottschecter has quit [Quit: WeeChat 0.4.0]
<eam> but mysql scales
<yorickpeterse> the fact that is has proper type validation itself is already a win
<yorickpeterse> hm, I wonder if I can migrate our MongoDB (at least one collection) to Pg and see how it handles it
<eam> imo a sharded sql is a more stable platform than most nosql up-and-comers
alessio_rocco has quit [Ping timeout: 256 seconds]
alessio_rocco has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 248 seconds]
<yorickpeterse> home tiem, taters
swav has quit [Remote host closed the connection]
<whitequark> "piece of rails"
rwilcox has quit [Quit: Computer has gone to sleep.]
swav has joined #ruby-lang
headius has quit [Ping timeout: 246 seconds]
<injekt> shambles
sush24 has joined #ruby-lang
swav has quit [Remote host closed the connection]
<ericwood> uh oh, are we going down the "rails is a ghetto" path again?
workmad3 has quit [Ping timeout: 264 seconds]
dankest has joined #ruby-lang
machuga is now known as machuga|away
<whitequark> also linux is shit (actually it's either just bad SSD or me misconfiguring the kernel, but any amount of IO is totally killing the system)
<whitequark> probably the latter.
<whitequark> ericwood: no. I hate all web development without exception.
<ericwood> heh
<ericwood> I just hate computers in general
thebastl has joined #ruby-lang
* whitequark shrugs
<whitequark> it's about interfaces, those who design them and those who fix them
thebastl has quit [Remote host closed the connection]
<whitequark> and those who use them.
glebm has quit [Quit: Computer has gone to sleep.]
elia has joined #ruby-lang
dhruvasagar has joined #ruby-lang
jvrmaia has joined #ruby-lang
<whitequark> argh, they renamed `spring c` to `spring rails c`
<whitequark> my fucking fingers
io_syl has joined #ruby-lang
pskosinski has quit [Remote host closed the connection]
<apeiros> alias
<ericwood> truth
* apeiros doesn't even want to type `rails c`
<apeiros> I just type rc
<ericwood> so lazy
<whitequark> wat the fuck, why did some random method suddenly return a random V8 class
pskosinski has joined #ruby-lang
<whitequark> it's not even from a Cext
intellitech has quit [Ping timeout: 256 seconds]
headius has joined #ruby-lang
<whitequark> is there a unix utility for checking your own sanity
<whitequark> brck?
<whitequark> oh, right, it's just a global monkeypatch, nevermind.
tenderlove has joined #ruby-lang
asunderl1nd has quit [Remote host closed the connection]
Nisstyre-laptop has joined #ruby-lang
headius has quit [Ping timeout: 256 seconds]
schaerli has joined #ruby-lang
scottschecter has joined #ruby-lang
<darix> eam: even if rhel7 is shipping with 1.9.3 .... do you know how long rhel 5 and 6 will still be around after that. ;)
<darix> if i recall correctly they just went to 10 or more years for the full time
dhruvasagar has quit [Ping timeout: 252 seconds]
malev has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
<eam> darix: yeah, they will be
judofyr has quit [Remote host closed the connection]
ryez has joined #ruby-lang
<eam> long lifecycles make dynamic platforms like ruby quite frustrating :)
alessio_rocco has quit [Quit: Lost terminal]
justinmburrous has joined #ruby-lang
djwonk has quit [Quit: djwonk]
swav has joined #ruby-lang
vlad_sta_ has quit [Remote host closed the connection]
swav has quit [Remote host closed the connection]
<darix> eam: well in the 7-10+years of an enterprise distro ...even slower platforms develop a lot
ryez has quit [Ping timeout: 256 seconds]
pskosinski has quit [Ping timeout: 256 seconds]
<eam> darix: kinda. I supported a 15 year swath of perl platforms for a while -- near complete backwards compatibility
elia has quit [Ping timeout: 276 seconds]
<eam> C - same story
<eam> I'm not saying it's bad, it's just difficult
dbussink has quit [Ping timeout: 264 seconds]
<eam> python also breaks things
<ericwood> I break things
sindork has quit [Ping timeout: 252 seconds]
brixen has quit [Ping timeout: 264 seconds]
pskosinski has joined #ruby-lang
glebm has joined #ruby-lang
rippa has joined #ruby-lang
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Client Quit]
cofin has joined #ruby-lang
krohrbaugh has joined #ruby-lang
benlovell has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
sindork has joined #ruby-lang
adambeynon has quit [Quit: Computer has gone to sleep.]
brixen has joined #ruby-lang
dpatel has joined #ruby-lang
headius has joined #ruby-lang
dbussink has joined #ruby-lang
jvrmaia has quit [Ping timeout: 245 seconds]
<yorickpeterse> whitequark: fsck self
kstone has joined #ruby-lang
jvrmaia has joined #ruby-lang
hashkey has joined #ruby-lang
<yorickpeterse> also I'm on a train
<yorickpeterse> and the wifi is terrible
tylersmith has joined #ruby-lang
<yorickpeterse> first world problems
<whitequark> no wifi on trains here
<whitequark> even when they claim that it is, the network is there but uplink is missing
<yorickpeterse> mine is routed through germany it seems
<yorickpeterse> NL -> bunch of local IPs that make no sense -> Germany -> the internet
<yorickpeterse> aaand station is up, brb
schaerli has quit [Remote host closed the connection]
LinkedoT has joined #ruby-lang
robbyoconnor has joined #ruby-lang
dhruvasagar has quit [Read error: Operation timed out]
brianpWins has joined #ruby-lang
swav has joined #ruby-lang
swav has quit [Remote host closed the connection]
rwilcox has joined #ruby-lang
mytrile_ has joined #ruby-lang
kgrz has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 245 seconds]
LinkedoT has quit [Quit: This computer has gone to sleep]
ebouchut has joined #ruby-lang
jxpx777 has joined #ruby-lang
Sarcophabus has joined #ruby-lang
<dbussink> yorickpeterse: it's t-mobile, not too surprised it goes through germany at some point :)
ikrima has joined #ruby-lang
krombr has quit [Quit: krombr]
malev has quit [Remote host closed the connection]
<spike|spiegel> that's better than going to japan and crossing pacific to reach US East
mrsolo has joined #ruby-lang
jxpx777 has quit [Ping timeout: 256 seconds]
JpC0utur3 has joined #ruby-lang
blacktulip has joined #ruby-lang
LinkedoT has joined #ruby-lang
amerine has quit [Quit: Textual IRC Client: www.textualapp.com]
amerine has joined #ruby-lang
swav has joined #ruby-lang
kstone has quit [Quit: kstone]
apeiros has joined #ruby-lang
benlovell has quit [Ping timeout: 240 seconds]
ryez has joined #ruby-lang
kstone has joined #ruby-lang
dhruvasagar has joined #ruby-lang
mouse_ has joined #ruby-lang
jxpx777 has joined #ruby-lang
MouseTheLuckyDog has quit [Ping timeout: 248 seconds]
mouse_ has quit [Ping timeout: 240 seconds]
swav has quit [Remote host closed the connection]
pr0ton has joined #ruby-lang
Sarcophabus has quit [Ping timeout: 245 seconds]
justinmburrous has quit [Remote host closed the connection]
pr0ton has quit [Quit: pr0ton]
ryez has quit [Quit: Page closed]
pr0ton has joined #ruby-lang
JpC0utur3 has quit [Ping timeout: 248 seconds]
headius has quit [Ping timeout: 252 seconds]
mouse_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
kstone has quit [Quit: kstone]
vlad_starkov has quit [Remote host closed the connection]
<yorickpeterse> dbussink: well yeah, but it's kinda weird at the same time
kstone has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 246 seconds]
ebouchut has quit [Quit: This computer has gone to sleep]
headius has joined #ruby-lang
gr4yscale has joined #ruby-lang
swygue has joined #ruby-lang
krombr has joined #ruby-lang
mbj has quit [Quit: leaving]
eLobato has joined #ruby-lang
vlad_starkov has joined #ruby-lang
saarinen has joined #ruby-lang
eLobato has left #ruby-lang [#ruby-lang]
djwonk has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
machuga|away is now known as machuga
swygue has quit [Ping timeout: 252 seconds]
LinkedoT has quit [Ping timeout: 246 seconds]
kgrz has joined #ruby-lang
benlovell has joined #ruby-lang
postmodern has joined #ruby-lang
postmodern has quit [Changing host]
postmodern has joined #ruby-lang
headius has quit [Ping timeout: 248 seconds]
chrishunt has quit [Quit: ZzZzZz...]
forrest has joined #ruby-lang
kgrz has quit [Ping timeout: 260 seconds]
mytrile_ has quit [Remote host closed the connection]
forrest has quit [Quit: Leaving]
krombr has quit [Quit: krombr]
kstone has quit [Quit: kstone]
<yorickpeterse> <3 bitching about JS
benlovell has quit [Ping timeout: 245 seconds]
<whitequark> <3 retweeting that
<yorickpeterse> heh
<whitequark> -EOUTOFHATE
<whitequark> no, not like that
<whitequark> -ENOHATE
mbj has joined #ruby-lang
<whitequark> why exactly does Pathname contain executable? and executable_real?..
kstone has joined #ruby-lang
<bougyman> Pathname includes many of the std FileTest stuff.
<whitequark> well, then, extend my question by transitivity
<bougyman> As to the why? They're handy, to me. Maybe they did it for me.
<whitequark> why the hell do you need a _real? version?!
<whitequark> executable_imaginary?
<bougyman> executable_kinda?
<yorickpeterse> matz really should've been called Watsumoto
<yorickpeterse> get it?
kuja has quit [Ping timeout: 252 seconds]
<yorickpeterse> get it?
* yorickpeterse laughed way too hard about that joke
* whitequark giggles
outoftime has joined #ruby-lang
kuja has joined #ruby-lang
solars has joined #ruby-lang
LinkedoT has joined #ruby-lang
LinkedoT has quit [Client Quit]
LinkedoT has joined #ruby-lang
grobb has joined #ruby-lang
swav has joined #ruby-lang
swav has quit [Remote host closed the connection]
<injekt> blawggg
<erikh> berlg
gnufied has quit [Quit: Leaving.]
swav has joined #ruby-lang
<yorickpeterse> huh, still running RubyGems 1.8
<yorickpeterse> reckon I'd update that to 2.0
<whitequark> erikh: hey hey, mention rubygems-bundler at least
<erikh> eh
<whitequark> it's much better than bundle exec all the shit
<erikh> I disagree? you can mention it the comments if you want.
<whitequark> ok
sailias has quit [Quit: Leaving.]
sailias has joined #ruby-lang
dhruvasagar has joined #ruby-lang
athaeryn has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
<athaeryn> Why might "Dir.methods.include? 'exist?'" return false? I'm running 2.0.0-p0.
<whitequark> :exist?
<yorickpeterse> athaeryn: because .methods returns an array of symbols, not strings
<athaeryn> yorickpeterse: Hm. It returns true for other things though.
<athaeryn> Also changing it to "include? :exist?" still returns false.
jxpx777 has quit [Remote host closed the connection]
<whitequark> >> Dir.methods.include? :exist?
<eval-in> whitequark => true (http://eval.in/30438)
ozzloy has quit [Quit: leaving]
<whitequark> ...
countdigi has quit [Ping timeout: 252 seconds]
swav has quit [Remote host closed the connection]
<athaeryn> What's weird is that it returns true in irb, but not from a script..
<injekt> lies
benlovell has joined #ruby-lang
countdigi has joined #ruby-lang
<athaeryn> Is #!/usr/bin/env ruby not the same version as irb?
<whitequark> athaeryn: eval-in does not require irb
krohrbaugh has quit [Quit: Leaving.]
<injekt> 18>> Dir.methods.include? :exist?
<eval-in> injekt => false (http://eval.in/30439)
brianpWins has quit [Quit: brianpWins]
<erikh> injekt: File.directory?
<injekt> erikh: prolly ya, I've always used that myself anyway
<injekt> only really ever used Dir for globbing and chdir
<injekt> athaeryn: maybe irb is using ruby 1.9 and you're using ruby 1.8 to run your script
<zzak> >> Dir.methods.collect(&:class).uniq
<eval-in> zzak => [Symbol] (http://eval.in/30440)
<zzak> >> RUBY_VERSION
<eval-in> zzak => "2.0.0" (http://eval.in/30441)
<zzak> >> RUBY_DESCRIPTION
<eval-in> zzak => "ruby 2.0.0p0 (2013-02-24 revision 39474) [i686-linux]" (http://eval.in/30442)
<athaeryn> injekt: I know irb is on 2.0.0-p0, it says that in the prompt. Looks like the script is running on 1.8.7 after all...
<injekt> athaeryn: do RUBY_VERSION in your script
<athaeryn> injekt: Yeah, I just tried that a minute ago and got 1.8.7..
<injekt> 18>> Dir.methods.collect(&:class)[0]
<eval-in> injekt => String (http://eval.in/30443)
<injekt> oh
<injekt> heh
<injekt> 18>> Dir.methods.include? "exist?"
<eval-in> injekt => false (http://eval.in/30444)
<injekt> oh good
<injekt> athaeryn: use File.directory?
<mistym> 18>> RUBY_PLATFORM
<eval-in> mistym => "i686-linux" (http://eval.in/30445)
<zzak> 18>> RUBY_DESCRIPTION
<eval-in> zzak => "ruby 1.8.7 (2012-06-29 patchlevel 370) [i686-linux]" (http://eval.in/30446)
<mistym> 10>>RUBY_DESCRIPTION
<eval-in> mistym => /tmp/execpad-8fa404572d40/source-8fa404572d40:2: NameError: Uninitialized constant RUBY_DESCRIPTION (http://eval.in/30447)
<athaeryn> injekt: Yeah, but now I'm curious how to change a script to run on a specific version..
<injekt> athaeryn: change where `ruby` points to
<zzak> athaeryn: use --program-prefix when building ruby
<zzak> --program-suffix rather
<athaeryn> I'm using RVM, I thought it handled that..
<injekt> rvm doesn't even handle itself
<zzak> then change your rvm, like: rvm use 1.8
<zzak> before running your script
<injekt> rvm use 2.0 --default
Nisstyre-laptop has quit [Quit: Leaving]
<athaeryn> zzak: The only rubies I have installed are 2.0 with RVM and OS X system 1.8.7.
<zzak> so use osx ruby in your shebang
<athaeryn> So obviously RVM is not being consulted on this at all..
<athaeryn> zzak: ?
<zzak> #!/usr/bin/ruby
<zzak> instead of #!/usr/bin/env ruby
sush24 has quit [Quit: This computer has gone to sleep]
<zzak> or whereever osx puts ruby
<zzak> rvm system && which ruby
hidalgo has joined #ruby-lang
<athaeryn> zzak: but why doens't #!/usr/bin/env ruby use the rvm version?
<zzak> or maybe its: rvm system && whereis ruby
workmad3 has quit [Ping timeout: 248 seconds]
<zzak> it should use your environment
<injekt> you could join #rvm and ask them if you need rvm assistance
countdigi has quit [Ping timeout: 260 seconds]
<injekt> unfortunately it's so complex it needs its own irc channel
<athaeryn> injekt: lol
<zzak> sounds like maybe rvm is missing from your PATH
ebouchut has joined #ruby-lang
countdigi has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
megha has joined #ruby-lang
kstone has quit [Quit: kstone]
<athaeryn> zzak: well ~/.rvm/bin is in my path, but it's after some other things...
grobb has quit [Quit: grobb]
<zzak> athaeryn: try asking on #rvm, theyre super helpful
brianpWins has joined #ruby-lang
enebo has quit [Quit: enebo]
<athaeryn> zzak: I'll do that, thanks.
<zzak> gl!
dhruvasa1ar has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 256 seconds]
dhruvasa1ar is now known as dhruvasagar
swav has joined #ruby-lang
swav has quit [Remote host closed the connection]
kstone has joined #ruby-lang
geopet has joined #ruby-lang
headius has joined #ruby-lang
<whitequark> erm
<whitequark> tabs
<yorickpeterse> ...and I think it uses Marshal to measure memory
<yorickpeterse> which is like, the dumbest fucking thing ever
<whitequark> wait what
<andrewvos> whitequark: <3
barttenbrinke has joined #ruby-lang
<yorickpeterse> ugh, seems I actually *have* to write a /proc parser to get this info (without having to shell out)
apeiros has quit [Remote host closed the connection]
pr0ton has quit [Quit: pr0ton]
apeiros has joined #ruby-lang
<andrewvos> force GC all the things
<athaeryn> zzak: just had to upgrade rvm. :P
<andrewvos> whitequark: did you just tell me to rtfm
hidalgo has quit [Ping timeout: 245 seconds]
WillMarshall has joined #ruby-lang
WillMarshall has quit [Client Quit]
<eam> https://gist.github.com/eam/5586648 on 1.8.7 the "a += b" method appears to eat memory unbounded -- gigs of it -- as n is increased
Nisstyre-laptop has joined #ruby-lang
<andrewvos> Gigs? Looks like mbs
<apeiros> s/join/concat/
krohrbaugh has joined #ruby-lang
<eam> gigs - should be megs. If I explicitly gc each loop it's ok
<eam> it can't even complete when n > 100k
<apeiros> and might want to add Array#concat to the bench (assuming you're looking for the fastest)
<whitequark> andrewvos: yes
<eam> apeiros: agree. I'm sidetracked now looking at why the gc is so bad in this case
<andrewvos> whitequark: okay ):
<eam> I know a += b will necessarily be less efficient, but I didn't expect it to (apparently) leak every object
<apeiros> gc never was one of the strong sides of ruby. afaik it got better in 1.9, and in 2.0 again
<apeiros> but I'd not bet on it being great
<apeiros> jruby should fare much better in that regard
<eam> yeah
<andrewvos> Well you're creating a new variable every time aren't you?
<eam> yes
melter__ has quit [Quit: Client exiting]
<apeiros> s/variable/object/ ;-)
<apeiros> </nitpick>
<eam> I expect a += b to be slower -- but I didn't expect it to eat gigs of ram and fail entirely
athaeryn has quit [Read error: Connection reset by peer]
melter has joined #ruby-lang
<eam> it will complete with an explicit gc call
<eam> slower, of course
<eam> n = 20k on my system will just barely be able to run with 2G ram
<eam> 100k dives into swap and has no hope
<whitequark> eam: -Xmx1G
<yorickpeterse> eam: the reason is easy to explain
<yorickpeterse> you're explicitly creating a memory leak
<yorickpeterse> 20k times you create an ever growing array
<andrewvos> I set my hand on fire why is it hurting now
<yorickpeterse> but you create a new one every time instead of just pushing stuff to it
glebm has joined #ruby-lang
<yorickpeterse> it's like saying "why does malloc(sizeof(Universe)) crash?"
<andrewvos> To be fair that would have caught me out big time. Seems very strange.
<yorickpeterse> hold on
S1kx has quit [Quit: Leaving]
* andrewvos holds on
<yorickpeterse> so for each version lets suffix the variable "a" with a number
<yorickpeterse> a1 is [1,2,3,4,5,6,7]
<yorickpeterse> you then create a1 by basically doing a1 + [8,9,10,11,12,13] which results in `a2 = [1,2,3,4,5,6,7,8,9,10,11,12,13]`
havenwood has quit [Remote host closed the connection]
krohrbaugh has quit [Ping timeout: 248 seconds]
<yorickpeterse> then you do `a3 = [1,2,3,4,5,6,7,8,9,10,11,12,13] + [8,9,10,11,12,13]` and keep repeating that
<andrewvos> So it is recursive?
<yorickpeterse> You'll end up with an array with 120007 items, but said to get there you had to create 20k + 1 (the initial one)
<yorickpeterse> `a += b` really translates to `a = a + b`
<yorickpeterse> unless Array overrides it but I don' think that's the case
<yorickpeterse> hm, you can't evne define that as a method
<yorickpeterse> Do note that this is based on my knowledge, I may be completely wrong
<yorickpeterse> tl;dr don't use += in a loop
<yorickpeterse> at least not for complex data structures
<apeiros> a += b # with a and b being Arrays creates a new array. `a` references a new object after +=. the old object is no longer referenced and hence free for collection.
<apeiros> that's not a memory leak.
<apeiros> if ruby leaks that memory, then it's a bug.
<erikh> you need to hit a GC boundary more or less
<yorickpeterse> you still create the objects for which you need to initially allocate memory
<yorickpeterse> remember that `a` is constantly growing
<apeiros> for which ruby allocates memory. and which memory ruby is supposed to free.
chrishunt has joined #ruby-lang
<yorickpeterse> Ruby never gives memory back to the OS
<apeiros> yes. but it is growing within bounds far below those gigabytes
<yorickpeterse> oh I'm not sure about the actual size, I haven't ran it yet
<yorickpeterse> hm, only seems to allocate around 20MB for me
<yorickpeterse> end memory usage is ~19.5 MB
<yorickpeterse> also, Benchmark.bmbm all the way
<yorickpeterse> Aaaaand Array#concat is faster than +=
<rue> injekt: Oh, hm, I wish I remembered…
<rue> For reporting maybe?
<injekt> rue: reporting what?
workmad3 has joined #ruby-lang
kstone has quit [Quit: kstone]
kstone has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
<eam> 12:40 < yorickpeterse> you're explicitly creating a memory leak
<eam> all three benchmarks construct the same sized array
mucker has quit [Read error: Connection reset by peer]
<eam> a += b creates an additional copy of the array each loop, and if ruby properly gc's it won't ever grow significantly large
<yorickpeterse> #push and += are fundamentally different though
<eam> yes I know
<yorickpeterse> but the memory increase doesn't seem to be problematic so I think something else is wrong
<eam> I expected a += b to be much slower
ikrima has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<eam> but the growth is factorial
dhruvasagar has quit [Ping timeout: 256 seconds]
<eam> because it seems to never gc
yalue has quit [Quit: Leaving]
<eam> yorickpeterse: if I explicitly call gc, it runs ok (slow, as expected, but same general order of memory as the other methods)
<yorickpeterse> what ruby version?
<eam> 1.8.7 (I know, I know)
<yorickpeterse> well there's your problem
<yorickpeterse> 1.8 GC is shit
<eam> evidently =/
<apeiros> that has been established already :)
pr0ton has joined #ruby-lang
hahuang65 has joined #ruby-lang
<eam> I am surprised at the size of the suckitude -- I didn't expect to grab gigs of small objects before it kicked in
mucker has joined #ruby-lang
<yxhuvud> it would probably be better if you put the code in a method and called that many times instead
hidalgo has joined #ruby-lang
<eam> yxhuvud: you mean better for the gc?
<yxhuvud> yes
<eam> interesting - why?
enebo has joined #ruby-lang
<rue> injekt: I can’t remember exactly what the symptom was, but basically the way the code works (worked?) is that if you don’t pass in the URL, it’ll use the stream’s #path, which is a tempfile
<injekt> rue: what does it use that for, though? can i reproduce this?
barttenbrinke has quit [Remote host closed the connection]
ebouchut has quit [Quit: This computer has gone to sleep]
<yxhuvud> dunno.
<yorickpeterse> eam: introduces a change of scope, which triggers the gc
<eam> yeah, it's good advice - it runs perfectly with: { a = 1,2,3,4,5,6,7; n.times do; foo(a, b); end } and def foo(a, b); a += b; return a; end
<eam> a mere 2x as slow
<eam> same O()
<yxhuvud> that .. doesn't modify a though.
<eam> ... oh right
<eam> whoop, still real slow
<eam> RSZ = 1028M+, sigh
<eam> a = foo()
barttenbrinke has joined #ruby-lang
<eam> well, sounds like the correct answer is to assume 1.8.7 just doesn't g
<eam> gc
krohrbaugh has joined #ruby-lang
lsegal has joined #ruby-lang
adambeynon has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
sailias has quit [Ping timeout: 252 seconds]
weems has joined #ruby-lang
krohrbaugh has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
Nisstyre-laptop has quit [Quit: Leaving]
swav has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
swav has quit [Ping timeout: 245 seconds]
tenderlove has joined #ruby-lang
justinmburrous has joined #ruby-lang
Fretta has joined #ruby-lang
bryanl has quit [Ping timeout: 245 seconds]
jvrmaia has quit [Remote host closed the connection]
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
mucker has quit [Quit: leaving]
<yorickpeterse> whitequark: https://github.com/whitequark/parser/issues/33 lolol
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<whitequark> Siiiiiigh
benlovell has quit [Ping timeout: 264 seconds]
rippa has quit [Ping timeout: 240 seconds]
Fretta has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
hahuang65 has quit [Quit: Computer has gone to sleep.]
kstone has quit [Quit: kstone]
headius has quit [Ping timeout: 276 seconds]
<yorickpeterse> haha
<ericwood> fix it!
<yorickpeterse> I'd fix that myself if I had the slightest idea of what's going on
benlovell has joined #ruby-lang
redyellowgreen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<rue> injekt: I really don’t remember.
hahuang65 has joined #ruby-lang
wmoxam has quit [Ping timeout: 248 seconds]
redyellowgreen has joined #ruby-lang
symm- has joined #ruby-lang
robbyoconnor has quit [Max SendQ exceeded]
robbyoconnor has joined #ruby-lang
Bwild_ has quit [Quit: leaving]
Bwild has joined #ruby-lang
<yorickpeterse> noticed it
<whitequark> actually still not good enough
<whitequark> why is that [:=] is quantified as {0,1}?..
<whitequark> seems to be incorrect
<whitequark> #32 is really bad though :/
<whitequark> >> Output /f/
<eval-in> whitequark => /tmp/execpad-f2419a5bb52c/source-f2419a5bb52c:2:in `<main>': undefined method `Output' for main:Object (NoMethodError) (http://eval.in/30454)
<whitequark> function
<whitequark> >> Output/f/1
<eval-in> whitequark => /tmp/execpad-bd59558cb3b3/source-bd59558cb3b3:2:in `<main>': uninitialized constant Output (NameError) (http://eval.in/30455)
<whitequark> division
<yorickpeterse> wat
<whitequark> >> Output/ f/1
<eval-in> whitequark => /tmp/execpad-1857dcdf7250/source-1857dcdf7250:2:in `<main>': uninitialized constant Output (NameError) (http://eval.in/30457)
<whitequark> division
<whitequark> >> Output / f /u
<eval-in> whitequark => /tmp/execpad-6487dd7c673d/source-6487dd7c673d:2: syntax error, unexpected tREGEXP_BEG, expecting keyword_do or '{' or '(' ... (http://eval.in/30458)
<whitequark> lolwat
<andrewvos> wow
<andrewvos> Is u valid?
<yorickpeterse> probably treats it as (Output / f) (/u)
<whitequark> yorickpeterse: no, tREGEXP_BEG
<whitequark> >> Output / f /
<eval-in> whitequark => /tmp/execpad-3f93ebbf82ec/source-3f93ebbf82ec:3: syntax error, unexpected keyword_end (http://eval.in/30459)
<yorickpeterse> ah
<whitequark> what the fuck does that even mean
<andrewvos> Whoa
<whitequark> yorickpeterse: oh, you're probably right
<whitequark> lemme verify
<andrewvos> Thaat is vald regex
<yorickpeterse> RUBY!
<andrewvos> valid
<yorickpeterse> >> a = / hahawtf /
<eval-in> yorickpeterse => / hahawtf / (http://eval.in/30460)
<andrewvos> Should call a function?
<yorickpeterse> >> Output (/ hahawtf /)
<eval-in> yorickpeterse => /tmp/execpad-9d6978722542/source-9d6978722542:2:in `<main>': undefined method `Output' for main:Object (NoMethodError) (http://eval.in/30461)
<whitequark> yorickpeterse: wat? that's a different parser state
<whitequark> expr_arg in my case, expr_beg in your case
<yorickpeterse> I know
swav has joined #ruby-lang
<whitequark> >> Output / foo /bar/
<eval-in> whitequark => /tmp/execpad-24eba5955dbd/source-24eba5955dbd:2: syntax error, unexpected tREGEXP_BEG, expecting keyword_do or '{' or '(' ... (http://eval.in/30463)
<whitequark> man I have no idea when it interprets stuff as regexp and when not
<whitequark> time to consult the ISO std!
<yorickpeterse> I wouldn't be surprised if it doesn't mention it
<whitequark> it does, of course
tenderlo_ has joined #ruby-lang
<whitequark> argh
<yorickpeterse> I should get a hard cover copy and use it as weapon. Whenever somebody makes a comment about why something works weird I'll just smack them in the face with it
<yorickpeterse> while yelling "BECAUSE RUBY, THAT'S WHY!"
tenderlove has quit [Ping timeout: 252 seconds]
Swimming_Bird has joined #ruby-lang
headius has joined #ruby-lang
cordax has joined #ruby-lang
retro|cz has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 245 seconds]
Asher has quit [Read error: Connection reset by peer]
retro|cz has joined #ruby-lang
<apeiros> aaaahaha, that'd be awesome yorickpeterse
Asher has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
athaeryn has joined #ruby-lang
JpC0utur3 has joined #ruby-lang
machuga is now known as machuga|away
hidalgo has quit [Ping timeout: 245 seconds]
pipework has quit [Remote host closed the connection]
ironcamel has quit [Quit: leaving]
rickhull has joined #ruby-lang
hidalgo has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
<ericwood> ruby!
<ericwood> <3
kstone has joined #ruby-lang
cordax has quit [Quit: Computer has gone to sleep.]
<athaeryn> Hey, I'd appreciate some feedback on this tool I wrote: https://github.com/athaeryn/leaf
ironcamel has joined #ruby-lang
krohrbaugh has joined #ruby-lang
JpC0utur3 has quit [Ping timeout: 240 seconds]
dustint has quit [Ping timeout: 248 seconds]
<whitequark> yorickpeterse: actually
<whitequark> you were right
<whitequark> there isn't a fucking word in the standard related to expr_arg.
<whitequark> well, more precisely, there is a sentence about parsing of x -2 and x-2, but it's far from explaining all the weirdness. and that's about it.
workmad3 has quit [Ping timeout: 260 seconds]
nathanstitt has quit [Quit: I growing sleepy]
<apeiros> athaeryn: nice idea
<apeiros> not sure I like the aliasing, though
<athaeryn> apeiros: what would you recommend?
<apeiros> I have no idea. If I had one, I'd tell you :-/
<athaeryn> apeiros: haha
symm- has quit [Read error: Connection reset by peer]
<apeiros> I'd say `find` and `locate` are inadequate for this
<athaeryn> I would have made it a gem but there's already one named leaf. :P
<athaeryn> apeiros: what don't you like about the aliasing?
<apeiros> no rationale. hence 'not sure'
<apeiros> just feels wrong
<athaeryn> Hmm... You could always just move things into your path somewhere, if you don't want to symlink.
<athaeryn> I just habitually symlink things into ~/bin
<athaeryn> apeiros: I'll admit that the whole set up is a little hacky, though.
<apeiros> hu?
<apeiros> not talking about symlinking
<apeiros> I talk about the `alias git=leaf-collector`
<athaeryn> apeiros: ah...
<drbrain> Marshal has three ways to represent 0
<drbrain> well, more
<athaeryn> Some people calls symlinks aliases, and sometimes interchangeably, so I wasn't sure. :)P
<apeiros> drbrain: identity crisis? I assume it's related to Bignum 0, -0 etc.?
* athaeryn should ask instead of assuming next time
<drbrain> apeiros: no, it's a hole in the encoding
pskosinski_ has joined #ruby-lang
pskosinski has quit [Remote host closed the connection]
Senjai has quit [Ping timeout: 245 seconds]
pskosinski_ is now known as pskosinski
<drbrain> an integer is stored in a compressed form with two bits used to indicate the number of bytes the number uses up
<drbrain> specifically, a C long
breakingthings has quit [Quit: breakingthings]
<drbrain> so you end up with the equivalent of "positive 0" and "negative 0" and plain 0
<drbrain> (the latter as "\x00")
<andrewvos> How is positive 0 differrent from negative 0?
krohrbaugh1 has joined #ruby-lang
krohrbaugh1 has quit [Client Quit]
<apeiros> one is good for you, the other isn't!
<apeiros> one cheers you up, the other pulls you down!
<drbrain> andrewvos: it's just one of three ways the compression plays out for a single-byte compressed integer
<apeiros> it might also have to do with limes
crudson has joined #ruby-lang
<apeiros> that's the latin limes, not the fruit
JpC0utur3 has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
<andrewvos> hahaha
krohrbaugh1 has joined #ruby-lang
enebo has quit [Quit: enebo]
<whitequark> wait
krohrbaugh has quit [Ping timeout: 246 seconds]
<whitequark> how is "plain 0" different from "positive 0"?!
<athaeryn> whitequark: it's the beards.
<whitequark> what the hell
<drbrain> whitequark: the three possible ways 0 can be represented are: "\x04\x08i\x00", "\x04\x08\x05", "\x04\x08\xfb"
* whitequark sighs
<drbrain> oops, I forgot to add an i in for the last two
<whitequark> drbrain: does it deserialize to three non-equal? bignums?
<drbrain> they all decode to a ruby 0
<drbrain> whitequark: they all decode to the Fixnum 0
<whitequark> drbrain: oh I see... then it's just non-canonical encodings
<drbrain> yeah
<whitequark> not as bad as I thought
<eam> long doesn't have positive and negative zero -- float does though
Markvilla has joined #ruby-lang
<drbrain> ruby will never generate anything but i\x00 for the Fixnum 0
<whitequark> eam: I thought it was about bignum
<eam> I saw C long, maybe I misunderstood
mistym has quit [Remote host closed the connection]
<drbrain> whitequark: I think the largest bignum Marshal can store is 4GB long
<athaeryn> apeiros: yeah, I can't think of a good alternative to aliasing. You could maybe alias it to glit or something, and then use that in place of git, but that would be really annoying and not practical. :/
<whitequark> drbrain: that is quite a bit of digits. :D
<drbrain> yeah
JpC0utur3 has quit [Ping timeout: 264 seconds]
<apeiros> athaeryn: well, in my case I'd just realias all my existing git related aliases, I guess
<athaeryn> apeiros: why would you need to do that?
fosky has joined #ruby-lang
<apeiros> leave git untouched, unaliased
<apeiros> not need, but prefer.
<whitequark> aliae
<whitequark> are coming
<athaeryn> apeiros: Well, yeah, I guess if it bothers you to alias git. :)P
elia has joined #ruby-lang
tenderlo_ has quit [Ping timeout: 245 seconds]
tenderlove has joined #ruby-lang
lupine has quit [Read error: Connection reset by peer]
lupine has joined #ruby-lang
mbj has quit [Quit: leaving]
mbj has joined #ruby-lang
Swimming_Bird has quit [Quit: Computer has gone to sleep.]
headius has quit [Quit: headius]
justinmburrous has joined #ruby-lang
headius has joined #ruby-lang
redyellowgreen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
athaeryn has quit [Remote host closed the connection]
lguardiola has quit [Remote host closed the connection]
outoftime has quit [Quit: outoftime]
swav has quit [Remote host closed the connection]
sailias has joined #ruby-lang
wallerdev has joined #ruby-lang
djwonk has quit [Quit: djwonk]
stamina has quit [Read error: Operation timed out]
sailias has quit [Quit: Leaving.]
benlovell has quit [Ping timeout: 248 seconds]
henrikhodne has quit [Quit: Computer has gone to sleep.]
emptyflask has joined #ruby-lang
emptyflask has quit [Remote host closed the connection]
solars has quit [Ping timeout: 256 seconds]
mbj has quit [Ping timeout: 248 seconds]
mbj has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
nighthwk1 has joined #ruby-lang
nighthwk1 has quit [Remote host closed the connection]
headius has quit [Quit: headius]
mbj has quit [Ping timeout: 252 seconds]
breakingthings has joined #ruby-lang
aleo_ has quit [Ping timeout: 252 seconds]
redyellowgreen has joined #ruby-lang
io_syl has quit [Ping timeout: 245 seconds]
benlovell has joined #ruby-lang
woollyams has joined #ruby-lang
S1kx has quit [Quit: Leaving]
nathanstitt has joined #ruby-lang
havenwood has joined #ruby-lang
rsync has joined #ruby-lang
cwd1 has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
benlovell has quit [Ping timeout: 248 seconds]
retro|cz has quit [Ping timeout: 260 seconds]
DomKM has quit [Quit: Leaving.]
tbuehlmann has quit [Remote host closed the connection]
krohrbaugh1 has quit [Quit: Leaving.]
krohrbaugh has joined #ruby-lang
machuga|away is now known as machuga
geopet has quit [Quit: geopet]
hashkey has quit []
Nisstyre-laptop has quit [Ping timeout: 245 seconds]
aleo has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
idkazuma has joined #ruby-lang
saarinen has quit [Quit: saarinen]
nvick has joined #ruby-lang
nvick has quit [Client Quit]
nvick has joined #ruby-lang
swav has joined #ruby-lang
DomKM has joined #ruby-lang
t0h has quit [Ping timeout: 252 seconds]
swav has quit [Ping timeout: 245 seconds]
pbjorklund_ has quit [Ping timeout: 264 seconds]
t0h has joined #ruby-lang
nvick has quit [Quit: nvick]
natevick has joined #ruby-lang
cwd1 has quit [Remote host closed the connection]
pipework has joined #ruby-lang
robbyoconnor has joined #ruby-lang
cofin has quit [Quit: cofin]
natevick has left #ruby-lang [#ruby-lang]
natevick has joined #ruby-lang
pbjorklund has joined #ruby-lang