havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.2, 2.3.5 & 2.2.8: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Guest25738> nm, dmesg shows OOm
<Guest25738> thx
cagomez has quit [Remote host closed the connection]
marxarelli is now known as marxarelli|afk
troys is now known as troys_
cagomez has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
cagomez has quit [Remote host closed the connection]
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
cagomez has joined #ruby
DTZUZO_ has quit [Ping timeout: 255 seconds]
sepp2k has quit [Read error: Connection reset by peer]
cdg_ has quit [Ping timeout: 252 seconds]
Azure has joined #ruby
ta has joined #ruby
ta has quit [Read error: Connection reset by peer]
ta has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
Guest16040 has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
alex`` has quit [Ping timeout: 240 seconds]
John__ has joined #ruby
alfiemax has joined #ruby
<haylon> Hey everyone. Reading this: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/_the_ruby_client.html I have no idea where to set the host to connect to unless its just assuming localhost:9200. However, I'm not sure where to put the host information.
DenSchub has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 246 seconds]
<haylon> The RubyDocs for it don't specify anything for object initialization: http://www.rubydoc.info/gems/elasticsearch-api/Elasticsearch/API
SeepingN has quit [Ping timeout: 240 seconds]
nicesignal has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nicesignal has joined #ruby
DenSchub has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 248 seconds]
Kug3lis has joined #ruby
goyox86 has quit [Quit: goyox86]
al2o3-cr has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
marcux has quit [Ping timeout: 240 seconds]
marxarelli|afk is now known as marxarelli
dc4 has quit [Ping timeout: 252 seconds]
marxarelli is now known as marxarelli|afk
cdg has quit [Ping timeout: 252 seconds]
charliesome has joined #ruby
Joufflu has joined #ruby
charliesome has quit [Client Quit]
jenrzzz has quit [Ping timeout: 264 seconds]
conta has joined #ruby
John__ has quit [Read error: Connection reset by peer]
conta has quit [Ping timeout: 248 seconds]
armando_ has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
alfiemax has quit [Ping timeout: 248 seconds]
jphase_ has joined #ruby
kies has quit [Ping timeout: 252 seconds]
cdg has joined #ruby
jphase has quit [Ping timeout: 252 seconds]
juggler has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
Joufflu_Fail has joined #ruby
ap4y1 has quit [Quit: WeeChat 1.9.1]
Joufflu has quit [Ping timeout: 252 seconds]
cschneid_ has joined #ruby
jphase has joined #ruby
<Iambchop> haylon: http://www.rubydoc.info/gems/elasticsearch-transport Elasticsearch::Client.new host: 'myhost:8080'
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschnei__ has joined #ruby
<haylon> So I wasn't looking at the right document. Thank you Iambchop for the link. I'll give this a whirl
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
jphase_ has quit [Ping timeout: 246 seconds]
d^sh has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Ping timeout: 252 seconds]
<haylon> emrgerd, so much easier. Thank you @lambchop
d^sh has joined #ruby
cschnei__ has quit [Ping timeout: 252 seconds]
jphase_ has joined #ruby
jphase has quit [Read error: Connection reset by peer]
oleo has quit [Read error: Connection reset by peer]
kies has joined #ruby
jphase has joined #ruby
shinnya has quit [Ping timeout: 248 seconds]
jphase_ has quit [Ping timeout: 252 seconds]
jphase_ has joined #ruby
juggler has quit [Remote host closed the connection]
jphase has quit [Ping timeout: 255 seconds]
voiceftp has quit [Ping timeout: 255 seconds]
oleo has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
live__ has joined #ruby
live__ has quit [Remote host closed the connection]
oleo has quit [Remote host closed the connection]
oleo has joined #ruby
jphase_ has quit [Ping timeout: 255 seconds]
mim1k has joined #ruby
gizmore has joined #ruby
knight33 has joined #ruby
jphase_ has joined #ruby
jphase has quit [Ping timeout: 255 seconds]
gizmore|2 has quit [Ping timeout: 248 seconds]
mim1k has quit [Ping timeout: 248 seconds]
thomasv314 has joined #ruby
__Yiota has joined #ruby
Azure has quit [Remote host closed the connection]
Azure has joined #ruby
mgorbach has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
jphase has joined #ruby
mgorbach has joined #ruby
jphase_ has quit [Ping timeout: 246 seconds]
dc4 has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
mjuszczak has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 248 seconds]
helpa has quit [Remote host closed the connection]
enterprisey has joined #ruby
mjuszczak has quit [Client Quit]
Emmanuel_Chanel has joined #ruby
mjuszczak has joined #ruby
eb0t has quit [Quit: WeeChat 1.9.1]
swirlsMD has joined #ruby
eb0t has joined #ruby
eightlimbed has joined #ruby
eb0t has quit [Client Quit]
kapil___ has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 248 seconds]
Kug3lis is now known as Kug3lis_off
mjuszczak has quit []
smelnicki has quit [Ping timeout: 246 seconds]
Radar has quit [Read error: Connection reset by peer]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
guardianx has joined #ruby
ozcanesen has joined #ruby
cagmz_ has quit [Ping timeout: 260 seconds]
dc4 has quit [Ping timeout: 248 seconds]
oleo has quit [Ping timeout: 255 seconds]
enterprisey has quit [Read error: Connection reset by peer]
enterprisey has joined #ruby
armando has joined #ruby
dc4 has joined #ruby
dviola has quit [Quit: WeeChat 1.9.1]
tastytf has joined #ruby
uZiel has joined #ruby
eightlimbed has quit [Ping timeout: 258 seconds]
annhah has joined #ruby
helpa has joined #ruby
annhah has left #ruby [#ruby]
eightlimbed has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 255 seconds]
gix has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
uneeb has joined #ruby
Radar has joined #ruby
gix has joined #ruby
apparition has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
armando has quit [Ping timeout: 252 seconds]
uneeb has quit [Remote host closed the connection]
jiuye has joined #ruby
jiuye has left #ruby ["Closing Window"]
bmurt has joined #ruby
orbyt_ has joined #ruby
eightlimbed has quit [Ping timeout: 258 seconds]
mim1k has joined #ruby
jenrzzz has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
DTZUZO_ has joined #ruby
code_zombie has quit [Quit: Leaving]
mjolnird has quit [Quit: Leaving]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
eb0t has joined #ruby
cschneid_ has joined #ruby
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Ping timeout: 258 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaruga has joined #ruby
jaruga has quit [Client Quit]
jaruga has joined #ruby
minimalism has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rajno has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
eb0t has quit [Quit: WeeChat 1.9.1]
mjolnird has joined #ruby
eb0t has joined #ruby
mim1k has joined #ruby
govg has joined #ruby
knight33 has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
swirlsMD has quit [Ping timeout: 258 seconds]
ur5us has quit [Remote host closed the connection]
cdg has joined #ruby
jenrzzz has joined #ruby
pilne has quit [Quit: Quitting!]
Freshnuts has joined #ruby
cdg has quit [Ping timeout: 252 seconds]
enterprisey has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
Emmanuel_Chanel has joined #ruby
Dimik has quit [Ping timeout: 264 seconds]
LocaMocha has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
enterprisey has joined #ruby
Guest25738 has quit [Read error: No route to host]
voiceftp has joined #ruby
armando has joined #ruby
jenu has joined #ruby
<jenu> #RubyOnRails
bkxd has joined #ruby
biox has joined #ruby
latemus has joined #ruby
jenu has quit [Quit: Page closed]
<latemus> dag. my script gets killed for using to much ram. is it the ruby way to read n lines from a file, parse, and write them to temp file so i can read in n more lines without dying of ram
<latemus> ruby obediently uses up all the memory. i think i've encountered a design error on my part. is rubyish to use a temp file?
NeverTired has joined #ruby
<biox> latemus what're you trying to do? are you reading a file into memory and trying to manipulate it?
<latemus> biox: yes, exactly. parsing log files, putting them into hashes, correlating their parts
<biox> latemus this is a repo of my various attempts to do exactly that most efficiently, maybe it'll give you some ideas https://gitlab.com/biox/more-example-scripts
<latemus> biox: thank you so much, i'm sure it will. things grow exponentially because of a nested loop
shortdudey123 has quit [Ping timeout: 255 seconds]
<latemus> i'm dumping the output of the lastb command into a file and manipulating it
<biox> latemus is this a practice in coding / is there some reason you're not using bash for this use-case? those tools are way faster at parsing log files and the like
shortdudey123 has joined #ruby
apeiros has joined #ruby
<latemus> biox: i've done this in bash so many times but it always feels so clunky. i suppose i should just refactor my bash into better functions i can reuse, but the code when written in ruby is so easy to read
Cyrus1 is now known as Cyrus
<biox> yea fair enough, i do stuff in ruby all the time that'd be better in bash because it's fun :)
Cyrus has quit [Changing host]
Cyrus has joined #ruby
<latemus> biox: haha exactly
<biox> latemus if you're parsing a log file and outputting to another file i'm wondering why you can't just parse one line at a time and then drop it to reduce memory consumptipon?
<latemus> biox: see, that is my next move, at present it just inhaled the entire log into memory, im now going to read just one line at a time, pares, and write to an output file
<latemus> i just wanted to ask if temp files are accebtible form acconding to the 'ruby way', because they remind me of using posix sh
<latemus> s/accond/accord/
<biox> tbh i have no idea. but i do know that you can use a lazy enumerator so you don't have to load the whole file into memory - you can do it on the fly discarding old data
<biox> unless you need to sort it, in which case you'll need to do some extra hackery
basket has quit [Remote host closed the connection]
<latemus> i do want to sort it. but i can just load the discard file back into memory and then sort, because it wasnt the file itself exhausting memory but the manipulation part while in memory. definitely looking up 'lazy enumerator'
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<biox> latemus sure, hope it helps! lazy enum is what you're looking for i think
DTZUZO_ has quit [Read error: Connection reset by peer]
Technodrome has joined #ruby
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
biox has quit [Quit: The Lounge - https://thelounge.github.io]
<latemus> right on. just looked it up and that may solve my problem, thanks a million :)
kapil___ has quit [Quit: Connection closed for inactivity]
<latemus> biox: ^^
postmodern has quit [Quit: Leaving]
workmad3 has joined #ruby
workmad3 has quit [Ping timeout: 258 seconds]
conta has joined #ruby
ana_ has joined #ruby
bkxd has quit [Ping timeout: 248 seconds]
bkxd has joined #ruby
guardianx has quit []
dionysus69 has joined #ruby
ozcanesen has quit [Quit: ozcanesen]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kapil___ has joined #ruby
biox has joined #ruby
kurt has joined #ruby
<kurt> I’m packing it in for the evening. But I’ve just barely got a ruby language server plugin working for atom, using the one the vscode folks use. And I mean barely. If you’re friendly with atom and docker and want to poke at it, please do: https://github.com/kwerle/ide-ruby
raynold has joined #ruby
eblip has joined #ruby
ramfjord has joined #ruby
kjhaidl has quit [Quit: Textual IRC Client: www.textualapp.com]
jphase has quit [Remote host closed the connection]
cschneid_ has joined #ruby
ta has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 252 seconds]
kurt has quit [Quit: kurt]
bkxd has quit [Ping timeout: 248 seconds]
megamos has joined #ruby
hs366 has joined #ruby
eblip has quit [Quit: WeeChat 1.9.1]
jamesaxl has quit [Ping timeout: 240 seconds]
biberu has joined #ruby
eblip has joined #ruby
mark_66 has joined #ruby
Axy has joined #ruby
Mia has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #ruby
eblip has quit [Quit: WeeChat 1.9.1]
teej has joined #ruby
alex`` has joined #ruby
bkxd has joined #ruby
megamos has quit [Ping timeout: 240 seconds]
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
sekmo has joined #ruby
jokke is now known as portwolf
portwolf has quit [Disconnected by services]
jokke has joined #ruby
jokke is now known as mac_mario
mac_mario is now known as jokke
jokke is now known as Luyin
Luyin is now known as jokke
ioggstream has joined #ruby
<ioggstream> hi@all
<havenwood> ioggstream: hi
ramfjord has quit [Ping timeout: 240 seconds]
NeverTired has quit [Quit: Connection closed for inactivity]
geigerCounter has left #ruby ["WeeChat 1.7"]
ramfjord has joined #ruby
ta has joined #ruby
Burgestrand has joined #ruby
zautomata has joined #ruby
zautomata has quit [Client Quit]
workmad3 has joined #ruby
Kug3lis_off is now known as Kug3lis
fumck is now known as fumk
megamos has joined #ruby
ur5us has joined #ruby
vondruch has joined #ruby
mikecmpbll has joined #ruby
imode has quit [Ping timeout: 264 seconds]
eblip has joined #ruby
guille-moe has joined #ruby
megamos has quit [Ping timeout: 248 seconds]
<dminuoso> havenwood!
<dminuoso> I just had an ephiany.
<havenwood> o/
<dminuoso> Jus came up with this idea: https://eval.in/883295
<dminuoso> What do you think
shinnya has joined #ruby
<dminuoso> Some hastily errors, fixed in this: https://eval.in/883306
mim1k has joined #ruby
<havenwood> dminuoso: aha - nice!
<havenwood> dminuoso: reminds me of gradual typing, at least you could use it to check the arguments provided to a method requires each method called on the arguments
<havenwood> it quacks and walks, carry on!
blackmesa has joined #ruby
<havenwood> dminuoso: hmmm, you could specify the arity as well
<matthewd> For something quite so meta, I'd really prefer extend, so it stays away from instances
jamesaxl has joined #ruby
<havenwood> dminuoso: it's not hard to check the method parameters, but it's kinda hard to decide how to notate it
bruno- has joined #ruby
<matthewd> I must admit it took me a bit to realise the thing you were demonstrating isn't actually a yay-functional weirdness -- between the example, and the style around is_symbol / is_ancestor
<matthewd> y u no `required_ancestors = @requires.grep(Module)`
Beams has joined #ruby
jamesaxl has quit [Ping timeout: 255 seconds]
jamesaxl has joined #ruby
Kug3lis is now known as Kug3lis_off
sekmo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> maybe it's just too much, but: requires(puts: {arguments: 0..Infinity})
kapil___ has quit [Quit: Connection closed for inactivity]
hahuang65 has quit [Read error: Connection reset by peer]
<havenwood> don't know the argument types, but do know how many there might be... for what that's worth - it's interesting at least
<matthewd> `requires :puts, arguments: 0..Infinity` ? (i.e., kwargs to specify detail, and they apply to all methods named in the call)
ferr has joined #ruby
<havenwood> yeah, that's nicer
megamos has joined #ruby
creat has quit [K-Lined]
_whitelogger has quit [K-Lined]
_whitelogger has joined #ruby
creat has joined #ruby
lxsameer has joined #ruby
sekmo has joined #ruby
cdg has joined #ruby
ioggstream has quit [Ping timeout: 246 seconds]
cdg has quit [Ping timeout: 252 seconds]
sanjayu has joined #ruby
sanjayu is now known as Guest88264
halt has quit [Quit: ZNC 1.6.5 - http://znc.in]
selim_ has joined #ruby
jphase has joined #ruby
halt has joined #ruby
alfiemax has quit [Remote host closed the connection]
selim has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
mjolnird has quit [Quit: Leaving]
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
jphase has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Max SendQ exceeded]
ramfjord has quit [Ping timeout: 258 seconds]
mikecmpbll has joined #ruby
zautomata has joined #ruby
jphase has joined #ruby
ramfjord has joined #ruby
jphase_ has joined #ruby
sekmo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
marr has joined #ruby
ur5us has quit [Remote host closed the connection]
jphase_ has quit [Ping timeout: 255 seconds]
nowhere_man has joined #ruby
bruno- has quit [Ping timeout: 246 seconds]
bw_ has joined #ruby
vondruch has quit [Ping timeout: 248 seconds]
marr has quit [Ping timeout: 248 seconds]
Guest56 has joined #ruby
Guest56 has quit [Client Quit]
alfiemax has quit [Remote host closed the connection]
vondruch has joined #ruby
claudiuinberlin has joined #ruby
jottr has joined #ruby
jphase has joined #ruby
nowhere_man has quit [Quit: Konversation terminated!]
nowhere_man has joined #ruby
jphase_ has joined #ruby
jphase__ has joined #ruby
jphase has quit [Ping timeout: 252 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase_ has quit [Ping timeout: 252 seconds]
jphase has joined #ruby
cdg has joined #ruby
swirlsMD has joined #ruby
jphase__ has quit [Ping timeout: 252 seconds]
megamos has quit [Ping timeout: 248 seconds]
morfin has joined #ruby
<morfin> hello
jphase has quit [Ping timeout: 252 seconds]
claudiuinberlin has joined #ruby
cdg has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 248 seconds]
swirlsMD has quit [Ping timeout: 252 seconds]
marr has joined #ruby
<morfin> i have hash of hashes like {hashrate: {pplns: 10, solo: 20, total: 30}, fee: {pplns: 1, solo: 2, total: 3}} what's simpliest way to convert this hash to array of hashes like [{metric: :hashrate, value: 10, tags: {pool: 'foo', type: :pplns}, ...} ?
ur5us has joined #ruby
sekmo has joined #ruby
<canton7> >> {hashrate: {pplns: 10, solo: 20, total: 30}, fee: {pplns: 1, solo: 2, total: 3}}.map{ |k,v| { metric: k }.merge(v) }
<ruby[bot]> canton7: # => [{:metric=>:hashrate, :pplns=>10, :solo=>20, :total=>30}, {:metric=>:fee, :pplns=>1, :solo=>2, :tota ...check link for more (https://eval.in/883346)
ramfjord has joined #ruby
<morfin> nope
<canton7> you'll need to give more details, then
<morfin> resulting hash should look like this: [{metric: :hashrate, value: 10, tags: {pool: 'foo', type: :pplns}}, ...]
<canton7> where does 'value' come from? where do the 'tags' come from?
<morfin> *array
<morfin> value is 10, 20, 30 etc
ur5us has quit [Ping timeout: 260 seconds]
<morfin> currently tag is key in inner hash
enterprisey has quit [Quit: Leaving]
LnxBil has joined #ruby
<canton7> I give up I'm afraid, I've got work to do. You need to provide even more detail -- "value is 10, 20, 30 etc" doesn't describe how to calculate 'value' given ' {pplns: 10, solo: 20, total: 30}'
<morfin> {pplns: 10, solo: 20, total: 30} values are coming from here
<morfin> type tag is key of each value =)
sekmo has quit [Quit: Textual IRC Client: www.textualapp.com]
gr33n7007h has joined #ruby
<canton7> "values"? there's only one 'value' in your example
LnxBil has quit [Client Quit]
<dminuoso> matthewd: Because Protocol has no methods on its own, it has no impact on instances down the road
<matthewd> dminuoso: True.. but now [].is_a?(Protocol)
<dminuoso> matthewd: And that .grep - hah. I actually tried .select(Module) and it didn't work :-)
<dminuoso> Ahh.
Ropeney has quit [Quit: Textual IRC Client: www.textualapp.com]
mjolnird has joined #ruby
<morfin> [{metric: :hashrate, value: 10, tags: {pool: 'foo', type: :pplns}}, {metric: :hashrate, value: 20, tags: {pool: 'foo', type: :solo}}, {metric: :hashrate, value: 30, tags: {pool: 'foo', type: :total}}, ...]
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
<canton7> right! that's useful
<canton7> you should have included that the first time around ;)
<canton7> where did 'foo' come from?
<canton7> and what happened to 'fee'?
blackmesa has quit [Ping timeout: 258 seconds]
ioggstream has joined #ruby
<morfin> it does not matter, 'foo' is pool name which is stored in class
<morfin> well, for fee same principle
* apeiros wonders how somebody responding to that question should have known that
<canton7> morfin, right, so it's effectively hard-coded? how was anyone supposed to guess that?
bruno- has joined #ruby
ana_ has quit [Remote host closed the connection]
oleo has joined #ruby
ana_ has joined #ruby
<canton7> so the basic structure is h.flat_map{ |metric,v| v.map{ |type,value| { .... } } }
<canton7> you can fill in the rest :)
tcopeland has quit [Quit: tcopeland]
gr33n7007h is now known as al2o3-cr
<morfin> wow i did not know about flat_map
<latemus> can i see an example of how to invoke a gem's ri docs? i dont know any methods it makes available
scorphus has joined #ruby
<havenwood> i'm too tired to think properly, but i spiked out ^ a rudimentary arity range check with the api matthewd suggested
lexruee has quit [Max SendQ exceeded]
lexruee has joined #ruby
<havenwood> g'night o/
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duckpupp1 has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
<apeiros> n8 havenwood
<ioggstream> I have to patch the URI module. Is it in the core ruby or in a separate repo?
nowhere_man has quit [Quit: Konversation terminated!]
nowhere_man has joined #ruby
<dminuoso> havenwood: Yeah Im working on an implementation as well
ldnunes has joined #ruby
<dminuoso> Right now Im fighting ruby because of this:
<dminuoso> >> a = ""; a.instance_eval { puts a }
<ruby[bot]> dminuoso: # => ...check link for more (https://eval.in/883382)
<dminuoso> Or maybe not
<dminuoso> Oh.
bkxd has quit [Ping timeout: 240 seconds]
pryorda has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby
tmm88 has joined #ruby
tmm88 has quit [Changing host]
tmm88 has joined #ruby
<dminuoso> havenwood: https://eval.in/883394
<dminuoso> I like that refinement.
<dminuoso> I might even create an alias_method :protocol, :extend on Module for this.
tastytf has quit [Remote host closed the connection]
tastytf has joined #ruby
Freshnuts has quit [Quit: Leaving]
raynold has quit [Quit: Connection closed for inactivity]
charliesome has quit [Ping timeout: 248 seconds]
tastytf has quit [Ping timeout: 255 seconds]
pryorda has joined #ruby
nertzy has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
andikr has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
al2o3-cr has quit [Ping timeout: 240 seconds]
roshanavand has quit [Ping timeout: 246 seconds]
duderonomy has quit [Ping timeout: 264 seconds]
jphase has joined #ruby
guille-moe has quit [Read error: Connection reset by peer]
eckhardt has joined #ruby
roshanavand has joined #ruby
guille-moe has joined #ruby
jeffreylevesque has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 248 seconds]
sepp2k has joined #ruby
tcopeland has joined #ruby
charliesome has joined #ruby
charliesome_ has joined #ruby
Psybur has joined #ruby
charliesome has quit [Ping timeout: 248 seconds]
claudiuinberlin has joined #ruby
zanoni has joined #ruby
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #ruby
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
guille-moe has quit [Remote host closed the connection]
bruno- has joined #ruby
dionysus69 has quit [Ping timeout: 252 seconds]
bruno- has quit [Read error: Connection reset by peer]
jphase has quit [Remote host closed the connection]
guille-moe has joined #ruby
adlerdias has joined #ruby
sepp2k has quit [Quit: Leaving.]
bkxd has quit [Ping timeout: 248 seconds]
blackmesa has joined #ruby
swirlsMD has joined #ruby
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby
swirlsMD has quit [Ping timeout: 258 seconds]
synthroid has joined #ruby
megamos has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guille-moe has quit [Remote host closed the connection]
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
claudiuinberlin has joined #ruby
ta has quit [Remote host closed the connection]
guille-moe has joined #ruby
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
Burgestrand has quit [Quit: Closing time!]
blackmesa has quit [Ping timeout: 246 seconds]
montyboy has joined #ruby
Silthias1 has joined #ruby
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
megamos has quit [Ping timeout: 246 seconds]
guille-moe has quit [Remote host closed the connection]
Silthias has quit [Ping timeout: 246 seconds]
jeffreylevesque has joined #ruby
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
al2o3-cr has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dwn has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has quit [Ping timeout: 248 seconds]
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
jeffreylevesque_ has joined #ruby
jeffreylevesque has quit [Ping timeout: 255 seconds]
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
claudiuinberlin has joined #ruby
bruno- has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
jrafanie has joined #ruby
ap4y has quit [Quit: WeeChat 1.9.1]
jphase has joined #ruby
thomasv314 has joined #ruby
sepp2k has quit [Quit: Leaving.]
bmurt has joined #ruby
guille-moe has joined #ruby
alnewkirk has joined #ruby
cdg has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Quit: conta]
conta has joined #ruby
sepp2k has joined #ruby
synthroid has quit [Remote host closed the connection]
chmurifree has quit [Ping timeout: 240 seconds]
conta has quit [Ping timeout: 240 seconds]
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg_ has joined #ruby
guille-moe has quit [Remote host closed the connection]
nofxx has quit [Remote host closed the connection]
pilne has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 240 seconds]
nokia3210 has joined #ruby
basket has joined #ruby
mson has joined #ruby
moei has quit [Quit: Leaving...]
chmurifree has joined #ruby
guille-moe has joined #ruby
__Yiota has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
ams__ has joined #ruby
kurt__ has joined #ruby
guille-moe has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
nokia3210 has quit []
John__ has joined #ruby
jaruga has quit [Quit: jaruga]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hs366 has quit [Quit: Leaving]
kassav_ has joined #ruby
DLSteve has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
jottr has quit [Quit: WeeChat 1.9.1]
thomasv314 has joined #ruby
bkxd has joined #ruby
claudiuinberlin has quit [Client Quit]
claudiuinberlin has joined #ruby
guille-moe has joined #ruby
synthroid has joined #ruby
ryzokuken has joined #ruby
bkxd has quit [Ping timeout: 258 seconds]
kassav__ has joined #ruby
Guest16040 has joined #ruby
lxsameer has quit [Ping timeout: 248 seconds]
<Bish> is there a every item with every item iterator?
<Bish> something like
<Bish> [1,2,3].each_with_each.map(&:itself)
cats has quit [Ping timeout: 258 seconds]
<Bish> which results in [1,1],[1,2],[1,3]...
kassav_ has quit [Ping timeout: 240 seconds]
<Bish> wait is sthat permutation?
<Bish> or rather [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
Rapture has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bish> "each with each other" sorry, cant express the idea
tvw has quit [Remote host closed the connection]
Miron has quit [Ping timeout: 264 seconds]
ldnunes has quit [Ping timeout: 240 seconds]
<Bish> each with every other?
<Bish> i guess
<matthewd> Bish: Yes, that's permutation (vs combination, which would skip [2,1], [3,1], [3,2])
<Bish> i see, was never good in taht
<Bish> it is permutation, geez
<Bish> how did i need to see that
ana_ has quit [Remote host closed the connection]
cats has joined #ruby
<Bish> how is that combination defined?
<Bish> i mean
<Bish> >> [1,2,3].combination(2)
<ruby[bot]> Bish: # => #<Enumerator: [1, 2, 3]:combination(2)> (https://eval.in/883484)
<Bish> uhh whats that sweet output
<Bish> >> [1,2,3].combination(2).map(&:itself)
<ruby[bot]> Bish: # => [[1, 2], [1, 3], [2, 3]] (https://eval.in/883485)
<Bish> i mean why isnt 2,1 a combination?
claudiuinberlin has joined #ruby
<matthewd> Bish: Because [1,2] is there
<elomatreb> It's like with sets, the order doesn't matter
<matthewd> permutation is every ordering of every combination
<Bish> >> [2,1,3].combination(2).map(&:itself)
<ruby[bot]> Bish: # => [[2, 1], [2, 3], [1, 3]] (https://eval.in/883486)
<Bish> order doesnt matter? then why is 2,1 a combination in that ?
<Bish> dont quite get it.
<Bish> matthewd: i get that, whats combination defined like?
<tobiasvl> The implementation makes no guarantees about the order in which the combinations are yielded.
<Bish> but the fuck is a combination?
<tobiasvl> (every time I google ruby docs I end up with different versions)
<matthewd> Unique subsets
cats has quit [Ping timeout: 255 seconds]
<elomatreb> *Unique subsets of length n
<matthewd> Bish: The result of combining things?
<matthewd> > a joining or merging of different parts or qualities in which the component elements are individually distinct
<Bish> so.. for n=2 that means..
<Bish> if i take every combination, swap the arrays inside the result, add these arrays to it
<Bish> i get .. permutation?
<Bish> so its permutation but [1,2] == [2,1] (for the method)?
<matthewd> Yes, because with n=2, there are two possible orders for each combination
<Bish> so its permutation but without order, i get it, great thanks
<Bish> i never understood that
<elomatreb> Think of set theory: {a,b} is the same set as {b,a}
<Bish> yeah i got it now :)
<Bish> i studied cs, but never listened in lin algebra
<Bish> (where we had this kind of stuff)
<Bish> i just didn't see the pattern
<elomatreb> I wish I could get away with not listening in maths lectures :(
ldnunes has joined #ruby
<Bish> that 2,1 is not in because 1,2 is
<Bish> elomatreb: just dropout
<Bish> who needs studying
cpruitt has joined #ruby
<elomatreb> I do like it, it's just that I have a hard time with maths so I have to concentrate to get it
kassav_ has joined #ruby
<Bish> yeah well, i liked it to, but it didnt get me anywhere to do it in uni
<matthewd> Bish: If you think of them in terms of their actual implementation: permutation is (0...size).each {|i| (0...size).each {|j| next if i == j; yield [self[i], self[j]] } }
rippa has joined #ruby
<matthewd> i.e., two nested loops both covering the whole range
dionysus69 has joined #ruby
<matthewd> While combination is: (0...size).each {|i| (i...size).each {|j| next if i == j; yield [self[i], self[j]] } }
<matthewd> i.e., the nested loop only covers the "remainder" of the outer loop in each cycle
andikr has quit [Remote host closed the connection]
knight33 has joined #ruby
<Bish> matthewd: thanks alot!
kassav__ has quit [Ping timeout: 260 seconds]
<Bish> finds.each_with_index do |h1,i1|
<Bish> finds.each_with_index do |h2,i2|
<Bish> found this code
<Bish> how stupid!
<matthewd> If it actually needs the indexes, it might be necessary ¯\_(ツ)_/¯
synthroid has quit [Remote host closed the connection]
ldnunes has quit [Ping timeout: 240 seconds]
vee__ has quit [Ping timeout: 248 seconds]
chouhoulis has joined #ruby
<Bish> shit, it might be
<Bish> but even then i could do
<Bish> .each_with_index.permutation?
<morfin> can i somehow find value(single) in hash and return it instead of array k,v ?
vtx has joined #ruby
<vtx> hi guys, has anyone here ever authenticated against an ldap server with ruby?
<elomatreb> morfin: Hash#values ?
Technodrome has joined #ruby
<morfin> ah of course
<Bish> >> {a:1,b:2,b:3}.find {|k,v| v == 3 }
<ruby[bot]> Bish: # => /tmp/execpad-d697eb517b08/source-d697eb517b08:2: warning: key :b is duplicated and overwritten on li ...check link for more (https://eval.in/883490)
<Bish> :(
<Bish> >> {a:1,b:2,c:3}.find {|k,v| v == 3 }
<ruby[bot]> Bish: # => [:c, 3] (https://eval.in/883491)
<Bish> vtx: maybe
Burgestrand has joined #ruby
<Bish> >> {a:1,b:2,c:3}.to_a.map(&:reverse).to_h
<ruby[bot]> Bish: # => {1=>:a, 2=>:b, 3=>:c} (https://eval.in/883492)
<Bish> morfin: pick your posion
Burgestrand has quit [Client Quit]
fmcgeough has joined #ruby
ldnunes has joined #ruby
megamos has joined #ruby
__Yiota has joined #ruby
vee__ has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
ferr has quit [Quit: WeeChat 1.9.1]
jrafanie has joined #ruby
<Bish> anyone have an idea how this produces that?
<Bish> @urls={[0, 0]=>{:link=>"http://gmx.de", :occurrence=>0}, [1, 14]=>{:link=>"http://gmx.de", :occurrence=>0}}>
<Bish> occurent should be 0 and 1
<Bish> occurrence*
<Bish> and yes, they are tabs in that paste, im sorry.
chouhoulis has quit [Remote host closed the connection]
kassav__ has joined #ruby
chouhoulis has joined #ruby
kassav_ has quit [Read error: Connection reset by peer]
Joufflu_Fail has quit [Quit: Leaving]
<matthewd> Bish: Perhaps inspecting the hash afterwards would be informative
kapil___ has joined #ruby
<Bish> i printed it inside the each, and its expected behaviour
<Bish> at begin: empty, then {#<MatchData "http://gmx.de">=>1}
<matthewd> And then?
<Bish> hm, looks like matches are not comparable?
<Bish> but i already tested that.. and made them to strings, didnt change a thing
thomasv314 has quit [Read error: Connection reset by peer]
<Bish> let me try again
<matthewd> They're not comparable when they're not equal, no ;)
thomasv314 has joined #ruby
<Bish> so other position ⇒ they're not equal
<Bish> ohg eez
minimalism has quit [Quit: minimalism]
<matthewd> If you only care about match[0], per the :link, then that's what you want
<matthewd> Correct. They have other methods, like the part of the string from before/after the match.
<Bish> what is the correct way to get the string .to_s?
<Bish> that was actually the first idea i had
claudiuinberlin has joined #ruby
<matthewd> Yes, to_s should be fine
<Bish> so i added .to_s, but forget at the second
alex`` has quit [Read error: No route to host]
<adaedra> 👋
swirlsMD has joined #ruby
alex`` has joined #ruby
Hexafox[I] has quit [Ping timeout: 255 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has quit [Remote host closed the connection]
polishdub has joined #ruby
troys_ is now known as troys
fullstack has quit [Ping timeout: 240 seconds]
cdg_ has quit [Remote host closed the connection]
fullstack has joined #ruby
d10n-work has joined #ruby
unreal_ has joined #ruby
cdg has joined #ruby
cdg has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 248 seconds]
cdg has joined #ruby
unreal has quit [Ping timeout: 240 seconds]
fmcgeough has quit [Ping timeout: 264 seconds]
alfiemax has joined #ruby
pilne has quit [Quit: Quitting!]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eightlimbed has joined #ruby
fmcgeough has joined #ruby
kurt__ has quit [Quit: kurt__]
__Yiota has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
apeiros has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
mark_66 has quit [Remote host closed the connection]
cagomez has joined #ruby
ozcanesen has joined #ruby
troys is now known as troys_
troys_ is now known as troys
cpruitt has quit [Quit: cpruitt]
dhollin3 is now known as dhollinger
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 240 seconds]
swirlsMD has quit [Ping timeout: 248 seconds]
chouhoul_ has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoul_ has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
synthroid has joined #ruby
dviola has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
kassav__ has quit [Quit: kassav__]
cagomez has quit [Ping timeout: 258 seconds]
zanoni has quit [Read error: Connection reset by peer]
jottr has joined #ruby
moei has joined #ruby
cdg has quit [Remote host closed the connection]
megamos has quit [Ping timeout: 252 seconds]
claudiuinberlin has joined #ruby
yaewa has joined #ruby
alfiemax has quit [Remote host closed the connection]
moei has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
alfiemax has joined #ruby
troys is now known as troys_
raynold has joined #ruby
claudiuinberlin has quit [Client Quit]
yaewa has quit [Client Quit]
cdg has joined #ruby
moei has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
mson has joined #ruby
Serpent7776 has quit [Quit: Leaving]
knight33 has joined #ruby
eightlimbed has quit [Ping timeout: 258 seconds]
cpruitt has joined #ruby
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
dc4 has quit [Ping timeout: 248 seconds]
cdg has quit [Remote host closed the connection]
uneeb has joined #ruby
uneeb has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
inbev has joined #ruby
<inbev> hi
guille-moe has quit [Ping timeout: 258 seconds]
<apeiros> hi inbev
eightlimbed has joined #ruby
fullstack has quit [Ping timeout: 246 seconds]
dinfuehr has quit [Ping timeout: 248 seconds]
<inbev> i'm new to ruby can i ask for help with exercise ?
Beams has quit [Quit: .]
fullstack has joined #ruby
dinfuehr has joined #ruby
kies has quit [Ping timeout: 240 seconds]
thinkpad has quit [Ping timeout: 248 seconds]
imode has joined #ruby
<matthewd> inbev: Sure! Just let us know how much help you want.
guille-moe has joined #ruby
<inbev> well, i paste an exercise and you will see how much
uZiel has joined #ruby
<matthewd> ?gist inbev if you want to show multiple lines of code
<ruby[bot]> inbev: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
govg has quit [Ping timeout: 252 seconds]
synthroid has quit [Remote host closed the connection]
nowhere_man has joined #ruby
govg has joined #ruby
dc4 has joined #ruby
uZiel has quit [Remote host closed the connection]
uZiel has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
govg has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
mikecmpbll has joined #ruby
orbyt_ has joined #ruby
hahuang65 has joined #ruby
podman[USC] is now known as podman
apeiros has quit [Remote host closed the connection]
cagomez has joined #ruby
stilbruch has joined #ruby
alfiemax has quit [Remote host closed the connection]
oleo has quit [Remote host closed the connection]
oleo has joined #ruby
zanoni has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
<matthewd> inbev: What's your question?
conta2 has joined #ruby
ioggstream has quit [Ping timeout: 240 seconds]
conta2 has quit [Ping timeout: 248 seconds]
oleo has quit [Remote host closed the connection]
oleo has joined #ruby
<matthewd> inbev: In channel, thanks. And that's not a question, that's an exercise. What help do you want with it?
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
apeiros has joined #ruby
guille-moe has quit [Ping timeout: 248 seconds]
Kug3lis_off is now known as Kug3lis
stilbruch has quit [Quit: WeeChat 1.9.1]
alfiemax has joined #ruby
montyboy has quit [Ping timeout: 240 seconds]
horsey99 has joined #ruby
<horsey99> .
<horsey99> how do i determine what appears in $LOAD_PATH by default for a ruby i'm installing?
fyrril has joined #ruby
gusrub has quit [Remote host closed the connection]
conta2 has joined #ruby
Guest16040 has quit [Ping timeout: 248 seconds]
tvw has joined #ruby
fullstack has quit [Ping timeout: 240 seconds]
conta2 has quit [Ping timeout: 246 seconds]
fullstack has joined #ruby
<matthewd> horsey99: I assume "ask it" is off the table?
<havenwood> that was my thought as well
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kies has joined #ruby
<havenwood> horsey99: What in particular are you interested in?
swirlsMD has joined #ruby
<havenwood> The default gems list starts looking great in 2.5: https://stdgems.org/2.5.0/
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
eightlimbed has quit [Ping timeout: 258 seconds]
jrafanie has joined #ruby
<horsey99> @havenwood i mean i have weird paths in my $LOAD_PATH and i dont understand hwo the hell they got there
<horsey99> matthewd ^
<havenwood> horsey99: Have an example weird path?
<horsey99> havenwood https://pastebin.com/4Zj3wamu
<ruby[bot]> horsey99: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/adebabf857d074705da643c6133167f7
<ruby[bot]> horsey99: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<horsey99> this one /Users/foo/.rvm/gems/ruby-2.4.2@global/gems/did_you_mean-1.1.0/lib
<horsey99> what the fuck does my .rvm/gems have to do with a freshly compiled ruby?
<havenwood> horsey99: looks normal
<havenwood> horsey99: seem my link above
<havenwood> see*
<horsey99> havenwood i'm reerring to the .rvm path
<havenwood> horsey99: are you not using RVM?
__Yiota has joined #ruby
<horsey99> no
<havenwood> I have bad news for you... you're using RVM.
<horsey99> well i am, but this is a freshly compiled ruby that i want to be completely self-contained
<havenwood> ;-P
<horsey99> but i don't want to be using rvm for THIS ruby :)
<havenwood> horsey99: rvm use system
<horsey99> havenwood well my question is, how does that .rvm path end up on the $LOAD_PATH? is there an environment variable that it's setting?
<horsey99> i just want to remove it, so this ruby is completely self contained
<matthewd> `gem env` might have a clue
<matthewd> But yes, removing it is what `rvm use system` should do
cschneid_ has quit [Read error: Connection reset by peer]
<horsey99> cool but i'm also just curious -- where is that .rvm path being added to the $LOAD_PATH? is it an environment variable? if so, how can i see exactly how it's being set?
cschneid_ has joined #ruby
<havenwood> horsey99: $GEM_HOME
<havenwood> horsey99: You could go spelunking in the RVM source code and gain some insight. But it's a deep cave, be careful.
<havenwood> horsey99: If you really want to get into RVM internals details, that's really more shell than Ruby, but I'd be happy to help in the #RVM channel.
oleo has quit [Ping timeout: 246 seconds]
<havenwood> horsey99: Suffice it to say, the env var GEM_HOME gets set.
oleo has joined #ruby
<havenwood> horsey99: To get an idea what's happening take a look at the chruby source code (RVM actually supports using chruby as the switcher via MRVM, which ships with RVM): https://github.com/postmodern/chruby/blob/master/share/chruby/chruby.sh#L33-L61
<havenwood> horsey99: Feel free to visit us in the #chruby or #rvm channels if you'd like to go into details!
<horsey99> havenwood thanks man
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gusrub has joined #ruby
gnufied has quit [Quit: Leaving]
eightlimbed has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
inbev has quit [Quit: Page closed]
kuchi has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John__ has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
guacamole has joined #ruby
kuchi has quit [Quit: WeeChat 1.9.1]
kuchi has joined #ruby
__Yiota has joined #ruby
dc4 has quit [Ping timeout: 252 seconds]
frem has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
bweston92 has quit [Quit: Connection closed for inactivity]
ledestin has joined #ruby
al2o3-cr has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
vtx has quit [Quit: vtx]
swirlsMD has quit [Ping timeout: 246 seconds]
eckhardt has joined #ruby
dc4 has joined #ruby
vee__ has quit [Ping timeout: 252 seconds]
vee__ has joined #ruby
[Butch] has joined #ruby
dcluna has quit [Ping timeout: 255 seconds]
Technodrome has joined #ruby
nofxx has joined #ruby
dcluna has joined #ruby
Kug3lis is now known as gcds
Silthias has joined #ruby
Silthias1 has quit [Ping timeout: 240 seconds]
mtkd has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
John__ has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
duckpupp1 has quit [Ping timeout: 255 seconds]
alfiemax has quit [Remote host closed the connection]
horsey99 has quit [Ping timeout: 246 seconds]
SeepingN has joined #ruby
mtkd has joined #ruby
cdg_ has joined #ruby
postmodern has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
duckpupp1 has joined #ruby
uZiel has joined #ruby
orbyt_ has quit [Read error: Connection reset by peer]
LocaMocha has quit [Ping timeout: 260 seconds]
cdg has quit [Ping timeout: 252 seconds]
synthroid has joined #ruby
cdg_ has quit [Ping timeout: 260 seconds]
<havenwood> dminuoso: got arity range nominally working with your code after coffee this morning: https://gist.github.com/havenwood/55a3399e62bc3f6ab8d27bc46d74ceb3
<havenwood> dminuoso: It seems like it'd be good to coalesce the various issues and report them together.
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> most importantly i removed all parens, waging an eternal battle against parens ;-)
charliesome has joined #ruby
vee__ has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
jottr has quit [Quit: WeeChat 1.9.1]
ta__ has joined #ruby
kuchi has quit [Quit: WeeChat 1.9.1]
kuchi has joined #ruby
ta__ has quit [Remote host closed the connection]
ta__ has joined #ruby
eightlimbed has quit [Ping timeout: 258 seconds]
ta__ has quit [Read error: Connection reset by peer]
Freshnuts has joined #ruby
ta__ has joined #ruby
claudiuinberlin has joined #ruby
dcunit3d has joined #ruby
dc4 has quit [Ping timeout: 246 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
<zanoni> Question, right now I"m doing #root_dir_scan = Dir.glob("lot of parameters") and then #root_dir_scan.each {|file| File.dirname(file)} . but is there a way to combine my second line into the glob?, so what gets written is just the dirname?
ldnunes has quit [Ping timeout: 240 seconds]
eroux has joined #ruby
<zanoni> I mean instead of the array having everything, it will just have the dirname?
vee__ has joined #ruby
Psybur has quit [Ping timeout: 248 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Psybur has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tmm88 has quit [Quit: Lost terminal]
swirlsMD has joined #ruby
selim_ has quit [Ping timeout: 264 seconds]
<nofxx> zanoni, you want only the folders/directories?
eroux has quit [Ping timeout: 240 seconds]
selim has joined #ruby
jrafanie has joined #ruby
orbyt_ has quit [Read error: Connection reset by peer]
synthroid has quit [Remote host closed the connection]
<zanoni> correct, my glob list includes various extension types but I just want the path to the file (not the files themselves) in the array
eightlimbed has joined #ruby
eightlimbed has quit [Client Quit]
eightlimbed_ has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
adlerdias has quit [Quit: adlerdias]
<havenwood> zanoni: You could use Find.find from the stdlib to build the Array you want while traversing.
ldnunes has joined #ruby
<havenwood> &ri Find.find
<elomatreb> globbing, mapping to dirnames and getting the unique values may be simpler than that though
<zanoni> yeah, i'm pretty hooked on glob :) , but i may give Find a go, it's be neater and faster then converting the array after the scan with map! and uniq!
<matthewd> You can glob with a block
<matthewd> dirs = Set.new; Dir.glob(...) { |f| dirs << File.dirname(f) }
cagomez has quit [Remote host closed the connection]
<matthewd> It'll be slower than a manual Find etc, because it'll keep iterating the contents of a directory even after it gets a match, but unless you have enormous dirs, ¯\_(ツ)_/¯
cagomez has joined #ruby
synthroid has joined #ruby
Technodrome has joined #ruby
Flabbergazta has joined #ruby
<elomatreb> `find . -type d -print0`.split "\x00"
<Flabbergazta> hi is there a ruby equivalent of python rstrip and lstrip?
<elomatreb> Uh, yes, lstrip and rstrip (on String)
<elomatreb> >> "test ".rstrip
<ruby[bot]> elomatreb: # => "test" (https://eval.in/883687)
<Flabbergazta> that only removes whitespace though?
mostlybadfly has joined #ruby
<Flabbergazta> I want soemthing like "abc///"rstrip.('/')
<Flabbergazta> returns "abc"
<elomatreb> Oh, you want a pattern. I think a method to do that is being added in 2.5? Easiest way in current Ruby is probably gsub with a regex
cagomez has quit [Ping timeout: 240 seconds]
<elomatreb> >> "abc///".gsub %r{/+\z}, ""
<ruby[bot]> elomatreb: # => "abc" (https://eval.in/883688)
cr3 has joined #ruby
<Flabbergazta> hmm ok thanks
<cr3> if I have `def foo(a, b)` and I have `args = {a: 1, b: 2}`, how can I pass args so that a=1 and b=2?
<basket> Regular sub would work fine, too, since you're anchored anyway
Dimik has joined #ruby
<matthewd> cr3: foo(args[:a], args[:b])
imode has quit [Ping timeout: 264 seconds]
<matthewd> cr3: You can't use names of positional parameters for invocation
<elomatreb> Or you could define your method with keyword params and use **
<cr3> matthewd: darn, that's what i thought from looking all over the place so thanks for the confirmation
yqt has joined #ruby
<zanoni> matthewd, sorry, i went for that one, had to remember to require 'set' :) works fine
<elomatreb> You could use foo(*args.values_at(:a, :b)) to save yourself the duplication, btw
<zanoni> I'll probably try Find as well and test performance, i have about 5 terabytes to test it on
<zanoni> lots of small files
<elomatreb> I suspect in that case the solution I wrote with shelling out to find may actually be faster
ams__ has quit [Quit: Connection closed for inactivity]
Axy has quit [Read error: Connection reset by peer]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dc2 has joined #ruby
Technodrome has joined #ruby
alfiemax has joined #ruby
dcunit3d has quit [Ping timeout: 246 seconds]
raatiniemi has joined #ruby
<zanoni> i'll try it , ty!
Guest16040 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
dc2 has quit [Ping timeout: 260 seconds]
vtx has joined #ruby
bruno- has joined #ruby
Guest16040 has quit [Quit: WeeChat 1.9.1]
dc2 has joined #ruby
synthroid has quit [Remote host closed the connection]
<Pierreb|home> im trying to do things with time in ruby. i can get current time out (t.strftime("%H:%M")) anyone know how i can check how long it is left in hours/minutes until XX:XX time for example 23:00?
raatiniemi has quit [Quit: raatiniemi]
alfiemax has quit [Remote host closed the connection]
<apeiros> Pierreb|home: that's sadly more effort than it should be. you can subtract two Time instances and get the difference in seconds
<Pierreb|home> i only care about hours and minutes
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vtx has quit [Quit: vtx]
raatiniemi has joined #ruby
troys_ is now known as troys
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freeze_ is now known as freeze
RickHull has joined #ruby
lxsameer has joined #ruby
<havenwood> >> (7260 / 60).divmod(60).join(':') # Pierreb|home
<ruby[bot]> havenwood: # => "2:1" (https://eval.in/883733)
<havenwood> Pierreb|home: It's easy to get the seconds difference, and there's not much then left to get hours and minutes.
<havenwood> Pierreb|home: (7260 sec is 2 hr and 1 min.)
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Pierreb|home> didnt think about that ill try to play around some, thanks havenwood
dc2 has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> Pierreb|home: Time.at((Time.now+7200 - Time.now)).strftime("%H:%M")
alfiemax has joined #ruby
alnewkirk has quit [Ping timeout: 240 seconds]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
cdg has joined #ruby
perniciouscaffei has joined #ruby
safetypin has joined #ruby
dc2 has joined #ruby
safetypin has quit [Client Quit]
safetypin has joined #ruby
eckhardt has joined #ruby
<Pierreb|home> thx al2o3-cr, ill play around with that. its almost correct (im looking for a fixed time like how long until 23:00)
workmad3 has joined #ruby
sepp2k has quit [Quit: Leaving.]
yqt has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<al2o3-cr> >> Time.at((Time.utc(2017,10,20,23,00,00) - Time.now)).strftime("%H:%M")
<ruby[bot]> al2o3-cr: # => "02:50" (https://eval.in/883751)
dc3 has joined #ruby
<al2o3-cr> >> Time.at((Time.utc(2017,10,20,23,00,00) - Time.now)).strftime("%H hours %M minutes")
<ruby[bot]> al2o3-cr: # => "02 hours 49 minutes" (https://eval.in/883752)
thomasv314 has joined #ruby
<al2o3-cr> or someting like that
dc2 has quit [Ping timeout: 258 seconds]
duderonomy has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
dc4 has joined #ruby
<Pierreb|home> al2o3-cr thanks
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> no probs
xixo has joined #ruby
<apeiros> al2o3-cr: Time's are not durations
dc3 has quit [Ping timeout: 240 seconds]
<apeiros> this will go awry the moment it's >24h or when you forget to use utc
eightlimbed_ has quit [Ping timeout: 258 seconds]
<apeiros> *Times
<xixo> Hi, what can it mean when I do `gem install foo`, but when I do `gem which foo` I get a "ERROR: Can't find ruby library file or shared library foo"?
[Butch] has quit [Quit: I'm out . . .]
<al2o3-cr> apeiros: shit, you're right.
nofxx has quit [Remote host closed the connection]
<al2o3-cr> i didn't think of that.
<xixo> Something wrong with the gem's gemspec perhaps?
<havenwood> xixo: which gem?
orbyt_ has joined #ruby
ldnunes has quit [Quit: Leaving]
<havenwood> xixo: it doesn't seem possible. are you using the latest RubyGems, version 2.6.14
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xixo> havenwood: yes
<havenwood> xixo: the gem isn't following conventions
<havenwood> xixo: there's no: /lib/bunq-client.rb
<havenwood> xixo: it's a flaw in the gem, it's not up to spec
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xixo> havenwood: ah I see - could you point me to a resource that'll explain how to make it according to spec?
Rapture has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xixo> Thanks havenwood
<havenwood> xixo: no prob, happy coding!
<havenwood> xixo: If the docs don't make sense I'm sure we can fill in the blanks. Feel free to ask!
<xixo> havenwood: will do! :)
Rapture has joined #ruby
[Butch] has joined #ruby
[Butch] has quit [Client Quit]
cagomez has joined #ruby
<matthewd> havenwood: http://guides.rubygems.org/name-your-gem/ says that gem is right as is
<matthewd> > rdoc-datarequire 'rdoc/data'
<havenwood> matthewd: the name is right, but the expected /lib/<name> isn't there
nofxx has joined #ruby
<havenwood> just missing a `lib/bunq-client.rb`
<havenwood> so the require fails
eightlimbed_ has joined #ruby
<matthewd> I'm saying there's nothing that says that file should exist
<havenwood> adds lib to LOAD_PATH and there's no bunq-client there
<havenwood> matthewd: oops!
<havenwood> matthewd: i guess it's shown in the dir structure in the link above
<havenwood> matthewd: but yeah, it's mandatory!
<matthewd> It's really not
<havenwood> no `lib/hola.rb`, then no `require 'hola'`
elisaado has joined #ruby
<havenwood> matthewd: well, it's mandatory if you want to require a gem by its name
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<havenwood> or you have to do some fancy workaround
<matthewd> Right. Which is not mandatory to support, and per my link, is *not* the recommended behaviour for a hyphenated name.
synthroid has joined #ruby
mson has joined #ruby
<matthewd> (That said, you could certainly argue that this gem shouldn't be hyphenated)
<havenwood> matthewd: gotcha, yeah it's not a plugin for another gem - i see what you're saying
<elisaado> Hi, what do you all think about ruby2d?
<havenwood> matthewd: yeah, in retrospect i said what i said poorly - it's really an issue of the naming and expected file not lining up
<xixo> Ok, so havenwood, matthewd, best course of action to correct it?
<havenwood> xixo: name the gem flatly, with no unnecessary nesting
<matthewd> xixo: The gem will work perfectly fine as is -- you just have to know to require the file it's providing
hahuang65 has quit [Read error: Connection reset by peer]
<akkad> so with all the new implementations of ruby, do any of them support delivery of a compiled binary of your .rb yet?
<matthewd> If you care about making it right for the sake of being right, then renaming the gem to bunq_client would be the most right option
<havenwood> xixo: require 'bunq/client'
<matthewd> akkad: There are a couple of things that can kinda package the .rb and the interpreter together in a single file
hahuang65 has joined #ruby
<havenwood> xixo: but yeah, rename it
<matthewd> akkad: There isn't going to be something that can actually compile the code, though: ruby has no compile step
<elisaado> OwO Bunq client if for the dutch bank bunq?
<xixo> ok, perhaps cleaner, thanks havenwood, matthewd
<matthewd> havenwood: xixo: Only rename it if it's your gem
<matthewd> A maintainer would not receive such a PR very well
<havenwood> akkad: There's a language called Crystal with some similarities to Ruby: https://crystal-lang.org
<matthewd> ^ also mruby
<xixo> matthewd: it's not, so I won't :)
Technodrome has joined #ruby
<havenwood> akkad: mruby actually is Ruby, and you can embed it in a C executable or in other things (like Crystal)
jeffreylevesque_ has quit [Ping timeout: 248 seconds]
<akkad> oh right. mruby, was that the embedded one matz spoke about?
<havenwood> akkad: indeed
ziggles has joined #ruby
<matthewd> mruby is closer to ruby than crystal, but I don't know that I'd call it "actually" ruby
<havenwood> http://mruby.org
<havenwood> matthewd: It complies with the ISO spec.
<havenwood> But yeah, it's not CRuby.
<havenwood> matthewd: I regretted typing that after hitting "Enter"
<ziggles> Anyone here know if the Ruby track on exercism.io covers meta-programming?
<havenwood> ziggles: Not that I've noticed, but I haven't done all the challenges.
<matthewd> havenwood: Even ignoring the... limitations of the spec, the "part" in "complying with part of the ISO standard" doesn't seem irrelevant either ;)
<akkad> mruby looks right.
<akkad> thanks
<havenwood> matthewd: touche
<akkad> le petite enfant?
<havenwood> a grandchild?
<ziggles> havenwood thanks
<havenwood> akkad: yeah, it's certainly related but is a subset
<havenwood> akkad: and there are a variety of caveats
baweaver is now known as lemur
lemur is now known as baweaver
<havenwood> matthewd: yeah, you're totally correct - I retract my statement
mtkd has quit [Ping timeout: 255 seconds]
<matthewd> elisaado: I don't. I've literally never heard of it before.
swirlsMD has quit [Ping timeout: 264 seconds]
synthroid has quit []
<elisaado> matthewd: you forgot /s
mtkd has joined #ruby
<RickHull> can anyone help me understand why bench_performance_exponential is failing here: https://gist.github.com/rickhull/4728c1383c5cd8bde3f1c637c727e8c1
<RickHull> I asked in #minitest but it's pretty quiet
<matthewd> elisaado: For a project I've never heard of, and which seems to have few users and no contributors, it seems to have an impressively well-organised presence: comprehensive readme, nice website
jeffreylevesque has joined #ruby
shwouchk has joined #ruby
<RickHull> I don't understand the failure on L28 of output.txt -- why is it calculating a fit below 0.9 ?
troys is now known as troys_
alfiemax has quit [Remote host closed the connection]
Psybur has quit [Ping timeout: 260 seconds]
jeffreylevesque has quit [Ping timeout: 252 seconds]
<matthewd> RickHull: Presumably it's calculating different times than you are
<RickHull> it prints the times on one line. they match pretty close
<RickHull> I am printing the tab separated times. minitest prints the times on one line. they basically match
<RickHull> er, i print the N \t time (table)
<matthewd> RickHull: Ah, hmm. I guess I'd be cracking open the gem, then.. find where it calls fit_exponential, and output its inputs and outputs
<RickHull> the minitest code is pretty clean at a glance. I can't imagine there is a bug, but that's what it looks like from my tests
morfin has quit []
guacamole has joined #ruby
troys_ is now known as troys
ResidentBiscuit has quit [Read error: Connection reset by peer]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
thomasv314 has joined #ruby
thomasv314 has quit [Client Quit]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thomasv314 has joined #ruby
swirlsMD has joined #ruby
safetypin has quit [Quit: Textual IRC Client: www.textualapp.com]
<matthewd> RickHull: As I said, I'd be inspecting the values going in and out of that #send
ozcanesen has quit [Quit: ozcanesen]
<RickHull> the numbers look roughly equivalent
<zenspider> hey hey
<RickHull> hey :)
<zenspider> good timing on my part?
<RickHull> i was going to ping you at some point :)
Technodrome has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> RickHull: I've spent all of 30 seconds looking at this... but I would guess that the problem is your range
<zenspider> that's usually where it bites me
<RickHull> updating the gist showing roughly the same numbers going to fit_exponential
<RickHull> ok
<zenspider> sure looks like it's pretty linear tho for your classic one. but the numbers are so small, who knows?
<RickHull> updated gist
<RickHull> output.txt shows a 0.95+ r2 when I call fit_exponential directly
<RickHull> and it should be exponential. fib(34) to fib(35) is not linear in calls or time
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<zenspider> the fit on my side is ~88%, so it could be noise, gc, all sorts of factors...
zenspider has quit [Changing host]
zenspider has joined #ruby
<RickHull> my gist shows that when I time it myself, it matches roughly when minitest times it; and the fit on my times is nearly always 0.95+
<zenspider> btw... always call b.compare! at the end of benchmark_ips... so much better output
<zenspider> dynamic(19): 761794.2 i/s
<zenspider> cache_iterative(19): 525751.8 i/s - 1.45x slower
<zenspider> cache_recursive(19): 196599.6 i/s - 3.87x slower
<RickHull> i think something is happening to the r2
<zenspider> classic(19): 2601.8 i/s - 292.80x slower
<matthewd> RickHull: What if you manually call fit_exponential with the "roughly same" numbers it's logging from the internal timing?
<RickHull> ah, cool!
<zenspider> oh, well... if you think that the math is bad... please have at it. I am not terribly sure of it myself. :)
<RickHull> matthewd: yeah, that's the next step
gnufied has joined #ruby
<zenspider> I slogged through that in a 3am coding fugue and that's what came out the other end. :)
<RickHull> heh, no worries. I'm glad to see if I can contribute something
<zenspider> holy crap. don't wrap the benchmark in a 100.times { ... } ... with your range it is now taking ~1m per column
<zenspider> actually... maybe you should. looks like the noise works itself out:
<zenspider> ..bench_classic_exponential 0.000025 0.000044 0.000472 0.005249 0.058153 0.649789 7.32531412.39279019.50161331.86966351.74029483.998243
<zenspider> .
thomasv314 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> that fits to 95%
<zenspider> matches your numbers almost exactly
<RickHull> i was getting 95% out of benchmark_performance_exponential at one point
fmcgeough has quit [Quit: fmcgeough]
jrafanie has joined #ruby
<RickHull> i'm isolating this to a simple xs,ys test case now
<zenspider> ok. 10.times { ... } also fits to 95%
<zenspider> and is much faster :)
<zenspider> bench_classic_exponential 0.000014 0.000009 0.000054 0.000523 0.005789 0.068780 0.760022 1.227706 1.965560 3.241072 5.158136 8.252714
<zenspider> that's tolerable and passes just fine
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
smelnicki has joined #ruby
<zenspider> and linear fits if you do 1000 or 10000 times
<matthewd> So the differences in the manual timing are the extra block invocation, the fact it's an instance_exec, and the use of clock_time
<matthewd> And technically the GC.start, though that's outside the timed section, so surely shouldn't influence anything
duckpuppy has joined #ruby
<matthewd> Maybe try adjusting your manual loop to use some of those?
AnoHito has quit [Read error: Connection reset by peer]
<matthewd> It sounds like the real answer is just that the numbers are close, but not close enough.. but it still seems potentially interesting to understand *why*
<RickHull> yes, the numbers yield different r2
duckpupp1 has quit [Ping timeout: 248 seconds]
<RickHull> so looks more like a timing problem now
chouhoulis has joined #ruby
<zenspider> how different? is it output vs actual calculations different? The underflow should be small tho
tcopeland has quit [Quit: tcopeland]
apeiros has quit [Remote host closed the connection]
<zenspider> (basically representation vs value)
<RickHull> with my timing numbers, I get r2 0.961 from fit_exponential
<RickHull> with minitest's timing numbers the r2 is 0.877
<RickHull> i'm now cleaning this up after removing the debug edits from minitest/benchmark.rb
mim1k has joined #ruby
Psybur has joined #ruby
mjolnird has quit [Quit: Leaving]
marr has quit [Ping timeout: 252 seconds]
<RickHull> updated, just less debug output
chouhoul_ has quit [Ping timeout: 240 seconds]
brw has joined #ruby
<RickHull> one obvious explanation is just some extra unavoidable overhead in minitest
<RickHull> at small n, maybe overwhelming?
<zenspider> RickHull: I'm multitasking a bit too much (I came onto IRC to ask my own questions in #haskell :P)... are you saying that the timing numbers are different or that the fit/R2 calculation might be wrong on my side?
chouhoulis has quit [Ping timeout: 252 seconds]
<RickHull> i think the math and the minitest lib code is fine
<zenspider> benchmarking single calls is always going to be problematic regardless of framework overhead. You should always bunch them up to average out the noise
<zenspider> 10.times { Fibonacci.classic(n) }
<zenspider> 10000.times { Fibonacci.cache_recursive(n) }
<zenspider> etc
<RickHull> yep, totally sensible
duckpuppy has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 255 seconds]
AnoHito has joined #ruby
jeffreylevesque has joined #ruby
<matthewd> I'm just intrigued which thing that the framework's doing is adding enough overhead to matter -- it's really not *that* far from the manual loop that's behaving so much "better"
<RickHull> minitest timing of fib(3) is particularly bad for the r2
<RickHull> which is not surprising
<RickHull> fib(5) is probably dipping into noise territory as well
<zenspider> matthewd: yeah. I dunno... there's all the extra overhead of the reporters and stuff... it is cleaner now that there's no real runner, but... *shrug*
<zenspider> Again, happy to have all the benchmark stuff questioned and improved
<zenspider> Maybe there should be a class const that says how many it should automatically do N.times ?
<RickHull> one problem is I'm picking my N (= 35) to keep the test time reasonable
<RickHull> just using this fib thing as a toy example
<matthewd> RickHull: I'd be interested to see what happens to the quality of your manual timing if you switched to clock_time, say
<RickHull> fib(35) is well into 99% signal territory
<RickHull> and takes a while on the CPU
<RickHull> i wouldn't want to do it say 10 times looped
haylon has quit [Changing host]
haylon has joined #ruby
<RickHull> for small n in bench_range, you could loop extra times and math it out?
<matthewd> (mostly because that's the easiest to match.. getting the instance_exec right would take more than swapping a method call)
<RickHull> but not do it for large n?
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> Use Minitest.clock_time ?
jeffreylevesque_ has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
jeffreylevesque has quit [Ping timeout: 260 seconds]
<RickHull> ooh, how about for each n in bench_range, execute in a loop up to a full second
jeffreylevesque_ is now known as jeffreylevesque
__Yiota has joined #ruby
<RickHull> and math it out on the back end
roshanavand has quit [Ping timeout: 260 seconds]
<matthewd> RickHull: That doesn't help at all
<matthewd> The timing is the overhead you're trying to overcome; to do that you have to check the time at each iteration
thomasv314 has joined #ruby
cdg_ has joined #ruby
<zenspider> I'll let you two sort it out... ping me if you need but I gotta study
<RickHull> sounds good, further discussion to #minitest :)
jphase has quit [Remote host closed the connection]
<RickHull> matthewd: #minitest? I have a new gist
cdg has quit [Ping timeout: 248 seconds]
Technodrome has joined #ruby
mochiyoda_ has joined #ruby
inoic has joined #ruby
inoic has quit [Client Quit]
Hexafox[I] has joined #ruby
eightlimbed_ has quit [Quit: Ex-Chat]
eightlimbed__ has joined #ruby
d10n-work has quit [Quit: Connection closed for inactivity]
shinnya has joined #ruby
workmad3 has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
eckhardt has joined #ruby
hahuang65 has quit [Ping timeout: 248 seconds]
Mia has quit [Read error: Connection reset by peer]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
workmad3 has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
eightlimbed__ has quit [Ping timeout: 258 seconds]
lektrik has quit [Quit: Leaving]
mtkd has quit [Ping timeout: 260 seconds]
tlaxkit has joined #ruby
mtkd has joined #ruby
selim has quit [Read error: Connection reset by peer]
selim has joined #ruby
cr3 has quit [Quit: leaving]
jenrzzz has joined #ruby
ozcanesen has joined #ruby
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
gnufied has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mjuszczak has joined #ruby
bruno- has quit [Read error: No route to host]
bruno-_ has joined #ruby
Technodrome has joined #ruby
ozcanesen has quit [Quit: ozcanesen]
polishdub has quit [Quit: leaving]
marr has joined #ruby
swirlsMD has quit [Ping timeout: 240 seconds]
xixo has quit [Ping timeout: 260 seconds]
mson has quit [Quit: Connection closed for inactivity]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
troys is now known as troys_
selim_ has joined #ruby
ozcanesen has joined #ruby
ozcanesen has quit [Client Quit]
selim has quit [Ping timeout: 252 seconds]
scatterp- has joined #ruby
<scatterp-> hi i wrote a ruby script requiring a gem it works fine when executed from xterm and also puts $load_path however when i use the system function to run IT
<scatterp-> from cpp i get a diffrent output from load_path
<scatterp-> my question is where did my environment go and how to get back to it via cpp system
latemus has quit [Ping timeout: 240 seconds]
tvw has quit [Ping timeout: 255 seconds]
fullstack has quit [Ping timeout: 246 seconds]
<zenspider> scatterp-: probably interactive shell settings vs not
<zenspider> look at what you have in ~/.profile vs ~/.bashrc (assuming) vs ~/.bash_profile, etc
kapil___ has quit [Quit: Connection closed for inactivity]
<zenspider> I have all of mine symlinked together and sort it out internally
fullstack has joined #ruby
<scatterp-> i lauch it with system "xterm -hold -e 'ruby test.rb'"
<zenspider> set PATH in front of xterm
<zenspider> if that fixes it, then address what I said above
ramfjord has quit [Ping timeout: 240 seconds]
<scatterp-> so system "set Path & xterm -hold -e 'ruby test.rb'"
ramfjord has joined #ruby
bruno-_ has quit [Ping timeout: 240 seconds]
Paraxial has quit [Remote host closed the connection]
Paraxial has joined #ruby
cdg_ has quit [Remote host closed the connection]
dc4 has quit [Ping timeout: 255 seconds]
troys_ is now known as troys
tcopeland has joined #ruby
fmcgeough has joined #ruby
<zenspider> scatterp-: no... you need to learn your shell and how to set env vars
<zenspider> scatterp-: something like: system "PATH=some:path:to:run:stuff xterm ..."
biberu has quit []
thinkpad has joined #ruby
tvw has joined #ruby
roshanavand has joined #ruby
<scatterp-> ok thx reading
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
enterprisey has joined #ruby
s3nd1v0g1us has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
<matthewd> scatterp-: system({ "PATH" => "..." }, "xterm ..")
cdg has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
eightlimbed__ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has quit [Ping timeout: 255 seconds]
cdg has quit [Ping timeout: 260 seconds]
orbyt_ has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nadir has quit [Quit: Connection closed for inactivity]
mjuszczak has quit []
Bhootrk_ has joined #ruby
Bhootrk_ has quit [Max SendQ exceeded]
jphase has joined #ruby
blackmesa has quit [Quit: WeeChat 1.9.1]
jphase has quit [Read error: Connection reset by peer]
jphase has joined #ruby
jphase has quit [Read error: Connection reset by peer]
ozcanesen has joined #ruby
jphase has joined #ruby
eightlimbed__ has quit [Ping timeout: 258 seconds]
mim1k has joined #ruby
eightlimbed__ has joined #ruby
alveric3 has joined #ruby
jphase has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
cahoots has joined #ruby
alveric2 has quit [Ping timeout: 240 seconds]
<cahoots> hi, is there any static code checker that finds things like the use of uninitialized variables? there are certainly cases where it would find false positives, e.g. where you really on method_missing, but it would be good to have a checker that assumes you're not doing that and shows you issues
mim1k has quit [Ping timeout: 252 seconds]
<RickHull> >> foo
<ruby[bot]> RickHull: # => undefined local variable or method `foo' for main:Object ...check link for more (https://eval.in/883781)
smelnicki has quit [Remote host closed the connection]
<RickHull> cahoots: what kind of uninitialized variables are you concerned about?
scatterp- has quit [Ping timeout: 260 seconds]
<cahoots> RickHull, let's say i rename a variable but i don't update all usages of it
<RickHull> hm, i guess that's not a static checker
<cahoots> ?
<cahoots> static checking of this is done in compiled languages...
_aeris_ has quit [Ping timeout: 248 seconds]
<RickHull> my example shows that ruby itself will raise a NameError for an undefined variable
ramfjord has quit [Ping timeout: 248 seconds]
<RickHull> that's about as static as it gets, I suppose
latemus has joined #ruby
<cahoots> what you're saying is, you're not aware of a static checker that does this
ramfjord has joined #ruby
<elomatreb> Because the false error rate would be impractically high, yes
jphase has joined #ruby
ozcanesen has quit [Quit: ozcanesen]
<elomatreb> This is why you normally should have tests that cover every code path in Ruby
<RickHull> it's not clear what a static checker would be, in the context of ruby. you could walk the AST maybe?
<cahoots> elomatreb, metaprogramming is pretty uncommon in one-off scripts
lxsameer has quit [Ping timeout: 258 seconds]
<elomatreb> Yes, but a static checker that knows about methods would have to know about every file in your project and all the files of the gems you use, etc
<RickHull> cahoots: can you give an example where there is an initialization error that ruby doesn't catch, that a static checker could catch?
ahrs has quit [Remote host closed the connection]
<RickHull> i showed the use of an uninitialized variable that ruby doesn't accept
<cahoots> RickHull, running a program can take a while, and may not go through every code path on every run. static tests aren't bad, but this provides another layer off checking
ramfjord has quit [Ping timeout: 248 seconds]
<elomatreb> I.e. if you just analyze every file by itself (like Rubocop does), 99% of the method calls could also be unknown variables
ahrs has joined #ruby
_aeris_ has joined #ruby
<RickHull> right, what is an example? >> foo is not an example
<RickHull> because ruby raises a NameError in this case
<cahoots> i don't think you're understanding my point RickHull
<RickHull> i'm asking for an example of your point :)
<elomatreb> RickHull: I don't think they are concerned about that, it's just that to find every occurance of that you have to run every line in a project (which is a lot of work if you don't have tests)
<cahoots> that's fair elomatreb, it may have to be more limited in scope, e.g. local variables would still be valid to check
ramfjord has joined #ruby
<RickHull> i don't think you can get more static than what ruby does at requiretime
<RickHull> and ruby raises a NameError at requiretime
<elomatreb> No, it does not. It raises an error when executing the line with the invalid variable
<RickHull> i get a NameError at requiretime
<elomatreb> if false; this_does_not_exist; end
<elomatreb> >> if false; this_does_not_exist; end
<ruby[bot]> elomatreb: # => nil (https://eval.in/883786)
<cahoots> elomatreb, dependencies can still be checked statically, it just requires the sort of complex indexing that good ides do
<RickHull> elomatreb: great example, thanks!
<RickHull> i believe this is equivalent to a #cstylemacro (M4?)
<RickHull> which would also have trouble with static analysis?
<elomatreb> RickHull: It can't know it at parse time since it might be a method call to something defined elsewhere (since even self could be changed)
duderonomy has quit [Ping timeout: 248 seconds]
<elomatreb> cahoots: Anyway, the answer is that I don't think there is a Ruby tool that does this. Rubocop is the most common static checker, but it does file-by-file analysis
ramfjord has quit [Ping timeout: 260 seconds]
marr has quit [Ping timeout: 240 seconds]
<RickHull> whatever your hypothetical static checker does, it would have to do at least what ruby does at requiretime -- agree?
ramfjord has joined #ruby
<RickHull> i.e. build up some internal representation of what the text in the source file means
nofxx has quit [Read error: No route to host]
<cahoots> yes, i agree
<cahoots> makes sense, thanks
nofxx has joined #ruby
<elomatreb> Rubocop does that, it operates on the AST. There are complete Ruby parsers written in Ruby
bruno- has joined #ruby