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
Guest70176 has quit [Ping timeout: 248 seconds]
Rouge has quit [Ping timeout: 240 seconds]
tcopeland has joined #ruby
Roa has joined #ruby
GodFather has quit [Remote host closed the connection]
GodFather has joined #ruby
Rouge has joined #ruby
alveric1 has joined #ruby
milardovich has joined #ruby
workmad3 has joined #ruby
<jaequery> /join #sequel
jaequery has quit [Quit: Textual IRC Client: www.textualapp.com]
alveric has quit [Ping timeout: 255 seconds]
jaequery has joined #ruby
hutch34_ has joined #ruby
AxelAlex has quit [Quit: AxelAlex]
workmad3 has quit [Ping timeout: 248 seconds]
hutch34_ has quit [Client Quit]
Psybur has joined #ruby
Psybur has quit [Ping timeout: 248 seconds]
Rouge has quit [Ping timeout: 248 seconds]
marr has quit [Ping timeout: 248 seconds]
marxarelli|afk is now known as marxarelli
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maum has joined #ruby
[DO] has joined #ruby
confilioblan has joined #ruby
hinbody has quit [Read error: Connection reset by peer]
Technodrome has joined #ruby
<confilioblan> I'm getting confused by this conversion from decimal to hex to byte to hex. It seems like it unpacks 1 with big nibble first by it unpacks 33 with little nibble first https://paste.ofcode.org/ruPhk7Eade6KeV7pY3uCkz
<confilioblan> any ideas?
[DO] has quit [Ping timeout: 268 seconds]
enterprisey has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Read error: Connection reset by peer]
dviola has quit [Quit: WeeChat 1.9.1]
milardovich has joined #ruby
muzik has joined #ruby
MrBusiness has joined #ruby
charliesome has joined #ruby
confilioblan has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 260 seconds]
muzik has quit [Quit: Going offline, see ya! (www.adiirc.com)]
mikecmpbll has quit [Quit: inabit. zz.]
plexigras has quit [Ping timeout: 248 seconds]
cdg has joined #ruby
plexigras has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guardianx has joined #ruby
jaequery has joined #ruby
elphe has joined #ruby
cdg has quit [Ping timeout: 258 seconds]
jxv has joined #ruby
orbyt_ has joined #ruby
Ouchy has quit [Ping timeout: 240 seconds]
leitz has quit [Quit: Nappy time]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
exhiled has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ResidentBiscuit has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jxv has quit [Quit: Textual IRC Client: www.textualapp.com]
Psybur has joined #ruby
Cohedrin has joined #ruby
Technodrome has joined #ruby
Psybur has quit [Ping timeout: 240 seconds]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
charliesome has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has joined #ruby
jaequery has joined #ruby
cloaked1 has quit [Quit: Leaving]
hinbody has joined #ruby
cschneid_ has joined #ruby
Guest70176 has joined #ruby
s-taka has joined #ruby
troys is now known as troys_
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quobo has quit [Quit: Connection closed for inactivity]
s-taka has left #ruby [#ruby]
millz has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
cschneid_ has quit [Ping timeout: 240 seconds]
mjolnird has quit [Remote host closed the connection]
lexruee has quit [Ping timeout: 240 seconds]
Guest70176 has quit [Ping timeout: 248 seconds]
segy_ has joined #ruby
nachoman has quit []
uZiel has quit [Ping timeout: 248 seconds]
<mcr1> @confilioblan is it trying to demonstrate a bug?
lexruee has joined #ruby
segy has quit [Ping timeout: 240 seconds]
<mcr1> to_s(16) converts to a string with a particular base.
segy_ is now known as segy
Chch has joined #ruby
daChch has joined #ruby
cdg has joined #ruby
michael1 has joined #ruby
workmad3 has joined #ruby
Chch has quit [Client Quit]
daChch has quit [Client Quit]
milardovich has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
michael3 has quit [Ping timeout: 260 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Read error: Connection reset by peer]
rhyselsmore has quit [Ping timeout: 240 seconds]
sylario has quit [Quit: Connection closed for inactivity]
Cohedrin has joined #ruby
xlegoman has joined #ruby
Psybur has joined #ruby
bdnelson has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cohedrin has quit [Read error: Connection reset by peer]
Psybur has quit [Ping timeout: 260 seconds]
bdnelson has quit [Quit: WeeChat 1.9.1]
zanoni has quit [Ping timeout: 260 seconds]
Cohedrin has joined #ruby
Puffball has quit [Remote host closed the connection]
jaequery has joined #ruby
bdnelson has joined #ruby
d^sh has quit [Ping timeout: 250 seconds]
d^sh has joined #ruby
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ashkitten has joined #ruby
bdnelson has left #ruby [#ruby]
cdg has quit [Remote host closed the connection]
bmurt has joined #ruby
ResidentBiscuit has quit []
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
gizmore has joined #ruby
millz has quit []
c0ncealed has quit [Remote host closed the connection]
ogres has joined #ruby
gizmore|2 has quit [Ping timeout: 268 seconds]
c0ncealed has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BrianOn99 has joined #ruby
zapata has quit [Read error: Connection reset by peer]
zapata_ has joined #ruby
safetypin has joined #ruby
Guest70176 has joined #ruby
milardovich has joined #ruby
Guest70176 has quit [Ping timeout: 248 seconds]
jaequery has joined #ruby
marxarelli has quit [Quit: Textual IRC Client: www.textualapp.com]
milardovich has quit [Remote host closed the connection]
mson has quit [Quit: Connection closed for inactivity]
milardovich has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
milardovich has quit [Ping timeout: 248 seconds]
cschneid_ has joined #ruby
Cohedrin has joined #ruby
Psybur has joined #ruby
uZiel has joined #ruby
Puffball has joined #ruby
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
Liothen has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
pilne has quit [Quit: Quitting!]
Psybur has quit [Ping timeout: 255 seconds]
Puffball has quit [Ping timeout: 248 seconds]
Puffball has joined #ruby
lembron has left #ruby [#ruby]
jordanm has quit [Ping timeout: 240 seconds]
Eletious has joined #ruby
troys_ is now known as troys
milardovich has joined #ruby
neachdainn has joined #ruby
<neachdainn> Hey all. Pathname is giving me wrong relative paths... Can anyone see what I'm doing wrong? https://pastebin.mozilla.org/9073291
exhiled has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
Technodrome has joined #ruby
mson has joined #ruby
meadmoon has joined #ruby
milardovich has joined #ruby
meadmoon is now known as heathenmoon
heathenmoon is now known as meadmoon
meadmoon is now known as postlarval
postlarval is now known as meadmoon
xlegoman has quit [Ping timeout: 255 seconds]
dennisvennink has quit [Ping timeout: 248 seconds]
milardovich has quit [Ping timeout: 258 seconds]
meadmoon has quit [Quit: I am functioning within established parameters.]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
troys is now known as troys_
Psybur has joined #ruby
jamesaxl has joined #ruby
govg has joined #ruby
Psybur has quit [Ping timeout: 268 seconds]
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
eckhardt has joined #ruby
plexigras has quit [Ping timeout: 260 seconds]
cschneid_ has quit [Ping timeout: 258 seconds]
armando has quit [Ping timeout: 240 seconds]
greengriminal has joined #ruby
elphe has quit [Ping timeout: 248 seconds]
<greengriminal> Hey all, quick question is there a weird ruby-ism here: https://gist.github.com/davidpatters0n/2584206473cf2196a8a82f1579022e52
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lytol has quit [Remote host closed the connection]
<greengriminal> it seems as though the method `defined?` doesn't correctly evaluate if you dynamically fetch the ivar via #instance_variable_get
ashkitten has left #ruby ["User left"]
elphe has joined #ruby
LocaMocha has joined #ruby
cschneid_ has joined #ruby
jameser has joined #ruby
armando has joined #ruby
bambanx has joined #ruby
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
jordanm has joined #ruby
safetypin has quit [Quit: ZZZzzz…]
exhiled has joined #ruby
Guest70176 has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest70176 has quit [Ping timeout: 248 seconds]
ogres has quit [Quit: Connection closed for inactivity]
bambanx has quit [Quit: Leaving]
uZiel has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Remote host closed the connection]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Psybur has joined #ruby
ramortegui has quit [Quit: This computer has gone to sleep]
uZiel has joined #ruby
iiiiiiaaaatttt has joined #ruby
<iiiiiiaaaatttt> woo
iiiiiiaaaatttt has quit [Client Quit]
ramfjord has joined #ruby
Psybur has quit [Ping timeout: 240 seconds]
n305oul93 has quit [Ping timeout: 250 seconds]
cschneid_ has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
JsilverT has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
exhiled has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
BTRE has quit [Remote host closed the connection]
cschneid_ has joined #ruby
guardianx has quit [Read error: Connection reset by peer]
BTRE has joined #ruby
k3rn31_ has joined #ruby
chouhoulis has quit [Ping timeout: 255 seconds]
exhiled has quit [Client Quit]
iamarun has joined #ruby
<greengriminal> I see
<greengriminal> Thanks for that.
<greengriminal> interesting.
<apeiros> and since the method instance_variable_get exists, the expression *is* defined :)
<apeiros> and defined?( instance_variable_get(:@ivar)) tests whether that *expression* is defined, not whether @ivar is defined.
<apeiros> greengriminal: defined? is not a method
<apeiros> in general you don't want defined? in production code.
milardovich has joined #ruby
<greengriminal> agreed, I didn't end up using it in the end
milardovich has quit [Ping timeout: 255 seconds]
phate408 has joined #ruby
phate408 has quit [Remote host closed the connection]
<apeiros> I think the only place I ever left a defined? in prod was a module where I did `super if defined?(super)`, and that mostly because the alternative way of testing whether current self responds to super is rather annoyingly complex
aroaminggeek has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Remote host closed the connection]
[DO] has joined #ruby
oleo has quit [Quit: Leaving]
neachdainn has quit [Quit: WeeChat 1.9.1]
Technodrome has joined #ruby
Dimik has joined #ruby
minimalism has joined #ruby
dinfuehr has quit [Ping timeout: 248 seconds]
charliesome has joined #ruby
dinfuehr has joined #ruby
Guest70176 has joined #ruby
apeiros has quit [Remote host closed the connection]
ShekharReddy has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
troys_ is now known as troys
Guest70176 has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
divoxx has quit [Quit: = "I'm done"]
ledestin has joined #ruby
workmad3 has quit [Ping timeout: 258 seconds]
BrianOn99 has quit [Ping timeout: 248 seconds]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
Psybur has joined #ruby
mson has joined #ruby
AnoHito_ has joined #ruby
Tempesta_ has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
p0p0pr37_ has joined #ruby
p0p0pr37_ has quit [Changing host]
p0p0pr37_ has joined #ruby
Illianthe2 has joined #ruby
sentor has quit [Read error: Connection reset by peer]
Mia has quit [Read error: Connection reset by peer]
Tempesta has quit [Read error: Connection reset by peer]
MrSparkle has quit [Read error: Connection reset by peer]
Illianthe has quit [Read error: Connection reset by peer]
[DO] has quit [Read error: Connection reset by peer]
p0p0pr37 has quit [Read error: Connection reset by peer]
sentor has joined #ruby
p0p0pr37_ is now known as p0p0pr37
jtdoncas has joined #ruby
BioSpider has joined #ruby
nahra has quit [Remote host closed the connection]
LBRapid has quit [Ping timeout: 240 seconds]
nahra has joined #ruby
Psybur has quit [Ping timeout: 240 seconds]
AnoHito has quit [Ping timeout: 248 seconds]
LBRapid has joined #ruby
LBRapid is now known as Guest32854
MrSparkle has joined #ruby
BrianOn99 has joined #ruby
aupadhye has joined #ruby
Tempesta_ is now known as Tempesta
Tempesta has quit [Changing host]
Tempesta has joined #ruby
Cohedrin has joined #ruby
Algebr has joined #ruby
<Algebr> A library I am using needs to do a require 'json'. This lib apparenlty has a pure implemention called json_pure. How can I write my Gemfile so that json_pure is the one that will be used whenever there is a require 'json'
milardovich has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
milardovich has quit [Ping timeout: 268 seconds]
apeiros has joined #ruby
kculpis has quit [Read error: Connection reset by peer]
JsilverT has quit [Quit: WeeChat 2.0-dev]
morfin has joined #ruby
<morfin> hello
<morfin> how can i reload code in pry?
uZiel has quit [Ping timeout: 248 seconds]
<apeiros> morfin: it depends
<apeiros> are you in a rails console? is the code from a file? is the code in ruby or native?
<baweaver> Gemfile, require aliases
<baweaver> gem 'json_pure', require: 'json'
elphe has quit [Quit: leaving]
sentor` has joined #ruby
<morfin> reload-code seems to be working
<morfin> i am in console - just running pry to run code directly
oetjenj has joined #ruby
hanmac has quit [Ping timeout: 255 seconds]
sentor has quit [Ping timeout: 248 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
<Algebr> baweaver: require aliases isn't running, getting an exception
jtdoncas has quit [Ping timeout: 240 seconds]
<Algebr> oh, i think this will work for me: gem 'json_pure', '2.1.0', require: 'json'
<Algebr>
kryptoz has joined #ruby
InfinityFye has joined #ruby
sentor`` has joined #ruby
<morfin> or not...
quobo has joined #ruby
troys has quit [Quit: Bye]
aroaminggeek has quit [Quit: Textual IRC Client: www.textualapp.com]
sentor` has quit [Ping timeout: 268 seconds]
uZiel has joined #ruby
hanmac has joined #ruby
Psybur has joined #ruby
snickers has joined #ruby
uptime has quit [Ping timeout: 240 seconds]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Psybur has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
nowhere_man has quit [Remote host closed the connection]
userser has joined #ruby
uptime has joined #ruby
ur5us has quit [Remote host closed the connection]
conta has joined #ruby
ur5us has joined #ruby
nowhere_man has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
reber has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
exhiled has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
harfangk has quit [Ping timeout: 248 seconds]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drowze has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andikr has joined #ruby
ramfjord has joined #ruby
milardovich has joined #ruby
dionysus69 has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
milardovich has quit [Ping timeout: 248 seconds]
TinkerTyper has quit [Ping timeout: 268 seconds]
ta_ has quit [Client Quit]
TinkerTyper has joined #ruby
gnufied has quit [Ping timeout: 255 seconds]
gnufied has joined #ruby
jameser has quit [Max SendQ exceeded]
Algebr has quit [Remote host closed the connection]
Algebr has joined #ruby
jameser has joined #ruby
TomyWork has joined #ruby
Algebr has quit [Remote host closed the connection]
ta_ has joined #ruby
Guest70176 has joined #ruby
Guest70176 has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
aufi has joined #ruby
Psybur has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
lexruee has quit [Ping timeout: 268 seconds]
lexruee has joined #ruby
Burgestrand has joined #ruby
Immune has quit [Ping timeout: 248 seconds]
Psybur has quit [Ping timeout: 240 seconds]
mark_66 has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
claudiuinberlin has joined #ruby
milardovich has joined #ruby
Dimik has quit [Ping timeout: 268 seconds]
milardovich has quit [Ping timeout: 255 seconds]
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
userser has quit [Quit: Leaving]
gone_haywire has joined #ruby
mtkd has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
drowze has joined #ruby
Cohedrin has joined #ruby
tomphp has joined #ruby
GotHyper has joined #ruby
GotHyper has quit [Remote host closed the connection]
<Bish> fellow rubyist
<Bish> i need your help
<Bish> i have a piece of code, which i like, but it's performances is horrible
<Bish> its*
<Bish> this is my own "cronjob" implementation/scheduler
<Bish> i have "recurring events" that happen every X seconds
<Bish> but if a job that needs 30 seconds, is executed every 60 seconds.. it will effectively wait 90 seconds
<Bish> this works well, but as i said, it's horrible
morfin has quit []
<Bish> ream in this context. is a customer, and i want each "cronjob" to be executed for every customer
maum has quit [Remote host closed the connection]
michael1 has quit [Ping timeout: 240 seconds]
mjolnird has joined #ruby
<apeiros> Bish: it'd be nice to use .rb with your gists so we get syntax highlights
BrianOn99 has left #ruby [#ruby]
mikecmpbll has joined #ruby
<Bish> will do
<apeiros> `return proc do` I don't think that even works…
<Bish> it does
<apeiros> oh wow indeed. must be because return is syntax and not a method.
<Bish> as i said, this works wlel, but the performance is ugly
nowhere_man has quit [Ping timeout: 240 seconds]
<Bish> with 200 customers, this is 100% and all jobs "come to late"
<apeiros> foo proc do … end # << this would not work, the do/end block belongs to foo
milardovich has joined #ruby
<apeiros> and how did you identify get_work as the cause of the perf issue?
<Bish> uhm, the "recurring events" are all IO-only
<Bish> they basicially just retrieve and send selects to a database
<Bish> queries* that is
<Bish> i specificially did it that way, because that way i hoped GIL won't fuck me over
<apeiros> so you guessed/assumed it's get_work which is slow?
<Bish> yes
<Bish> i didn't profile it or similiar
<apeiros> pro-tip: instead of deleting a gist, you can update it. gists are full git repos.
GotHyper has joined #ruby
<Bish> thanks
<apeiros> I suggest you measure. and when you're sure it is indeed get_work, measure individual parts of it. figure out which part is the slow part.
<Bish> okay, i will try, kind of hard thing to do, because i don't want this to do this on production
Hobbyboy has quit [Ping timeout: 252 seconds]
<apeiros> then your first step is to get a reasonable lab together
<Bish> i always assumumed it has to be this, because the CPU is at 100% and none of the jobs does something cpu heavy
<apeiros> otherwise you'll just shoot in the blue
milardovich has quit [Ping timeout: 260 seconds]
Guest70176 has joined #ruby
<mikecmpbll> but shooting in the blue is fun
<apeiros> sure. if you want entertainment, go for it. if you want work done however…
dennisvennink has joined #ruby
guille-moe has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mikecmpbll> 🙄
Guest70176 has quit [Ping timeout: 268 seconds]
<apeiros> work must not be fun! where'd we get with that!!!1!
Hobbyboy has joined #ruby
<Bish> how does one actually profile ruby
<apeiros> profiler comes with ruby but is slow, ruby-prof is a gem which is a lot faster, and there's Benchmark
<apeiros> profiler slows down your code by about factor 100 (not kidding, last tested around ruby 2.0 iirc)
<apeiros> ruby-prof slows it down by about factor 2-3
mim1k has joined #ruby
<Bish> well, i assume i wont have it do do for long
<apeiros> Benchmark mostly incurs the overhead of a method call. you can use it to get CPU time a piece of code spent
sylario has joined #ruby
<Bish> does ruby-prof have any drawbacks?
<apeiros> it's a native ext. other than that, none I knew of
<apeiros> oh, and with newer rubies, there's a lot of built-in instrumentation you can also use. look for "Trace" in the docs. TracePoint iirc.
<Bish> and how would i go with that? run it on everything and i will be able tor ead something out of the report?
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
mim1k_ is now known as mim1k
<apeiros> one way to use it is to run it on the section you assume to be the bottleneck
<Bish> apeiros: so what is better now, ruby native stuff? or something like ruby-prof
<Bish> i have 2.4.2 rubies
<apeiros> I'm afraid, there are no silverbullet answers. I usually use tiny `bench` methods based on Benchmark to verify I'm correct about where a bottleneck is
Psybur has joined #ruby
<Bish> well i am not sure about anything here :D it might even be normal
<apeiros> beyond that, it's been a while I actually needed ruby-prof to figure what's exactly going on as I have a usably good grasp of what takes about how much time in ruby (even though that shifts with versions)
<apeiros> it's as with all problems: divide and conquer
ana__ has joined #ruby
<apeiros> measure large sections first to identify in which area the problem really happens. then narrow down.
<Bish> when i strace the process it does a lot of futex
<Bish> could that mean checking the mutex that often is expensive?
<apeiros> "that often"? anything you do often enough is expensive. and yes, a mutex does have a good bit of overhead.
AlHafoudh has quit [Ping timeout: 252 seconds]
Guest66084 has quit [Ping timeout: 252 seconds]
IceDragon has joined #ruby
IceDragon is now known as Guest29916
<Burgestrand> perftools.rb is fairly useful too, it can show you a call graph with percentages of where time is being spent
nowhere_man has joined #ruby
AlHafoudh has joined #ruby
nowhere_man has quit [Client Quit]
nowhere_man has joined #ruby
Psybur has quit [Ping timeout: 255 seconds]
<Bish> installing this and that
<Bish> man docker is useful
bronson has quit [Read error: Connection reset by peer]
bronson has joined #ruby
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
<Bish> > Makefile:242: recipe for target 'perftools.o' failed
milardovich has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
jaruga has joined #ruby
marr has joined #ruby
larcara has joined #ruby
dinfuehr has quit [Ping timeout: 258 seconds]
dinfuehr has joined #ruby
ramfjord has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
ta_ has quit [Remote host closed the connection]
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
ta_ has joined #ruby
ur5us has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 240 seconds]
<Bish> hahaaa im profiling
<Bish> whoo~
<Bish> man ruby is slow
<Bish> i hate it
<apeiros> dunno, haven't had too many places where it was too slow
<Bish> what did u do when it was?
<apeiros> use C
Cohedrin has joined #ruby
<Bish> as in c extension?
<apeiros> mainly happened with project euler, though. not at work :D
Cohedrin has quit [Client Quit]
<apeiros> in that case, actually C as in C, not as in native ext
<Bish> i c
luminor has joined #ruby
<apeiros> but yes, I have written native extensions too
<Bish> hehe.
<apeiros> one I remember was for generating statistics where I built an ext to intersect integer arrays very fast
<Bish> i will leave the profiling running for a bit and post it
<Bish> i think mutex is pretty expensive,yes
drowze has quit [Ping timeout: 240 seconds]
<Bish> so rubys limit is having 200 "user land threads" in form of procs?
<Bish> man that sucks.
TomyWork has quit [Remote host closed the connection]
TomyWork has joined #ruby
luminor_ has joined #ruby
luminor has quit [Ping timeout: 240 seconds]
hs366 has joined #ruby
lukeyb has joined #ruby
charliesome has joined #ruby
mim1k_ is now known as mim1k
* Bish just removes the locks and lets the gil work its magic
<apeiros> huh? procs have nothing to do with threads
<apeiros> how do you get that idea?
<Bish> well, what i wrote there is some sort of user land scheduler without interruption
<Bish> so in this case, they do
<Bish> thats what i meant
<apeiros> well, it's still a weird assertion. and untangled from procs, no ruby does not have a limit of 200 threads.
<Bish> thats why i wrote user land threads
<Bish> ruby does not have a limit at all if you run it on a infinitely fast computer
<apeiros> though you may want to rethink your design. that many threads don't work well in any language using posix threads underneath.
<Bish> more specific: ruby does not seem to be able to have poorly written user land threads running in quantaties > 200
<Bish> apeiros: i am not talking about ruby's threads
<apeiros> then you're not being very clear.
<Bish> > what i wrote there is some sort of user land scheduler without interruption
dennisvennink has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> and bad code is not a language problem…
<Bish> thats very clear
<apeiros> ok, look: there's zero problem writing code which has thousands of threads in ruby.
<Bish> well, i've done this in other languages, but they're all native
<apeiros> so I pose if you have a problem, it's your code, not ruby.
<apeiros> also using thousands of threads is rarely a good design in any language.
<Bish> well, one could say it's mri though
<Bish> apeiros: again, i am not talking about kernel threads
<apeiros> neither did I.
<Bish> well kernel-managed threads.
Guest70176 has joined #ruby
workmad3 has joined #ruby
lukeyb has quit [Quit: Textual IRC Client: www.textualapp.com]
Serpent7776 has joined #ruby
ur5us has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
Guest70176 has quit [Ping timeout: 255 seconds]
nadir has quit []
Psybur has joined #ruby
JsilverT has joined #ruby
Palando has quit [Remote host closed the connection]
Psybur has quit [Ping timeout: 248 seconds]
kryptoz has quit [Remote host closed the connection]
<Bish> weird, it seems to run better with profiling on
jeanlinux has joined #ruby
uZiel has quit [Remote host closed the connection]
<Bish> yeah the mutex call seems to be the bottleneck
zautomata has quit [Ping timeout: 240 seconds]
<Bish> it's double the time it is sleeping which would be 8 * 32 * 60, that it waits before the first job in total
<apeiros> an unconstested mutex call takes 0.000178ms on my machine…
<apeiros> pondering on how to bench contested mutex calls
<Bish> i will try to reduce the amount it's called
<apeiros> (difficulty lies mainly in how to not count the time the threads spend blocking)
zautomata has joined #ruby
milardovich has joined #ruby
ldepandis has joined #ruby
<Bish> it's getting called 2+<amount_of_jobs> times per get_work
<Bish> i could reduce it to 2 times, i think
luminor_ has quit []
<apeiros> how many jobs do you have?
luminor has joined #ruby
<Bish> it depends on how much time has passed, maxmimum of 20 maybe?
<apeiros> then I'm pretty sure your mutex is not the issue.
<Bish> :(
DenSchub has quit [Quit: This should never happen.]
<apeiros> in a very contested mutex (10k threads, 10k calls to Mutex#synchronize), the mutex added 10ms CPU time
milardovich has quit [Ping timeout: 248 seconds]
<apeiros> so ~1µs per synchronize call. I got a feeling like that should *not* be a problem with 20 jobs.
<apeiros> I'll restate that I believe you've got a problem with your code, not with ruby.
aupadhye has quit [Ping timeout: 260 seconds]
<Bish> well. it's 20 jobs per customer
<Bish> which is 215 ish, right now
<apeiros> *eyeroll*
<apeiros> > how many jobs do you have?
<apeiros> so you really meant ~4000?
<Bish> yes.
uZiel has joined #ruby
<apeiros> well, so ~4002 x 1µs is still ~4ms
<apeiros> still doubt that that's your issue.
* apeiros afk, lunch
<Bish> i reduced the amount either way.. so i will seen soon
aupadhye has joined #ruby
<apeiros> you may want to check how long the mutex is held, though and whether you made the mutex calls atomic enough. i.e. only over actually shared resources.
<Bish> that's what i meant when saying the mutex call is the problem
<Bish> not the call itself
<Bish> wondering why it would make the cpu go through the roof though
<apeiros> i.e. line 2-20 are suspicious and seem to cover non-shared code
<Bish> thanks, yeah i will look into that
<apeiros> anyway, off now
<Bish> i think you're german right?
<Bish> guten
luminor_ has joined #ruby
<Bish> don't know an english term for that :D
luminor has quit [Ping timeout: 240 seconds]
ldnunes has joined #ruby
DenSchub has joined #ruby
vee__ has quit [Ping timeout: 248 seconds]
<Bish> Lock held for 0.049691908 seconds
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vee__ has joined #ruby
zanoni has joined #ruby
larcara has quit [Remote host closed the connection]
<Bish> why the ferk isn't a locking hash not part of standard ruby
larcara has joined #ruby
ferr has joined #ruby
ferr has left #ruby [#ruby]
ldepandis has quit [Ping timeout: 240 seconds]
larcara has quit [Ping timeout: 248 seconds]
drowze has joined #ruby
hfp_work has quit [Quit: bye]
leitz has joined #ruby
<leitz> Are there lightweight, and possibly less complex, web frameworks that integrate with MOngoDB? I looked at Hanami but it only seems to support SQLish DBs. Not sure I'm ready for RoR.
<Bish> leitz: roda all the way
<Bish> not what u search.. i think, though
hfp_work has joined #ruby
banisterfiend has joined #ruby
<Bish> give it a try, i actually dont know webframeworks that are inbetween those 2
<Bish> but this one is certainly lightweight
<apeiros> Bish: I speak german and I'm swiss
<Bish> that is a lie, i sometimes watch your news, with subtitles :p
<Bish> leitz: why mongodb?
<leitz> Bish, I'm wrapping up a class in it. :P
<leitz> Sorry, on-line learning class, not a code class.
<Bish> i see :)
<leitz> Would like to use it in my next project to push myself to continue to learn. From a performance or scale perspective, it makes little difference. The app is a toy.
milardovich has joined #ruby
<leitz> Actually, both apps are toys, mildly related.
<apeiros> Bish: an quick and dirty test seems to suggest that even a contested mutex (10k threads) takes a negligible amount of time (less than 0.1% of the total time it took to execute 10k threads each adding 1 to a variable)
<apeiros> whoops
<apeiros> copy paste failure
<Bish> i've done alot of research on ruby on threads
<Bish> i hate it.
<Bish> i know all there is, but thanks
drowze has quit [Ping timeout: 240 seconds]
<apeiros> having concurrent-ruby in stdlib would make a lot of sense IMO. but well :)
<Bish> has some crazy dude actually ported ruby to a postgres language
<Bish> oh lol.. someone did
milardovich has quit [Ping timeout: 248 seconds]
<Bish> > Emacs Lisper
<Bish> that explains alot
Psybur has joined #ruby
larcara has joined #ruby
rabajaj has joined #ruby
Psybur has quit [Ping timeout: 240 seconds]
drowze has joined #ruby
luminor_ has quit [Ping timeout: 260 seconds]
enterprisey has quit [Read error: Connection reset by peer]
Mortomes|Work has joined #ruby
milardovich has joined #ruby
hs367 has joined #ruby
ap4y has quit [Quit: WeeChat 1.9.1]
milardovich has quit [Ping timeout: 252 seconds]
hs366 has quit [Ping timeout: 240 seconds]
luminor has joined #ruby
_hs366 has joined #ruby
hs367 has quit [Ping timeout: 255 seconds]
d^sh has quit [Ping timeout: 248 seconds]
luminor has quit []
ramfjord has joined #ruby
luminor has joined #ruby
d^sh has joined #ruby
enterprisey has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
jameser has joined #ruby
bweston92 has joined #ruby
iamarun has quit [Remote host closed the connection]
aupadhye has quit [Ping timeout: 260 seconds]
ramfjord has quit [Ping timeout: 260 seconds]
tcopeland has quit [Quit: tcopeland]
Guest70176 has joined #ruby
aupadhye has joined #ruby
jameser has quit [Ping timeout: 260 seconds]
luminor has quit [Ping timeout: 268 seconds]
dviola has joined #ruby
thinkpad has joined #ruby
Guest70176 has quit [Ping timeout: 258 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sspreitz has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
yeticry has quit [Ping timeout: 240 seconds]
jtdoncas has joined #ruby
banisterfiend has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
jtdoncas has quit [Ping timeout: 255 seconds]
lunarkitty7 has quit [Ping timeout: 258 seconds]
yeticry has joined #ruby
workmad3 has joined #ruby
drowze has quit [Ping timeout: 255 seconds]
_merlim_ has joined #ruby
sspreitz has joined #ruby
<_merlim_> In edbian, I just installed ruby-full (version 2.1 i guess). Now when I apt-get install rubygems, I see it wants to install ruby 1.8 Is this correct?
<apeiros> ruby 1.9+ includes rubygems
<apeiros> iow, don't apt-get install rubygems. it's not for newer rubies.
lunarkitty7 has joined #ruby
drowze has joined #ruby
yeticry has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
yeticry has joined #ruby
_aeris_ has quit [Remote host closed the connection]
Psybur has joined #ruby
<_merlim_> i see
<Bish> oh that guy died.
<Bish> :(
drowze has quit [Ping timeout: 240 seconds]
_merlim_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
_aeris_ has joined #ruby
Psybur has quit [Ping timeout: 268 seconds]
milardovich has joined #ruby
rabajaj has quit [Quit: Leaving]
guille-moe has quit [Ping timeout: 268 seconds]
<Bish> apeiros: well, it works pretty well after reducing the lock-count
<Bish> it sleeps now, that never happened before
biberu has joined #ruby
<Bish> nevermind i think it deadlocked
<Bish> lol.
profetes has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
milardovich has quit [Ping timeout: 264 seconds]
kryptoz has joined #ruby
dn` has quit [Read error: Connection reset by peer]
uZiel has quit [Ping timeout: 248 seconds]
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
aScottishBoat has joined #ruby
nadir has joined #ruby
jameser has joined #ruby
osvimer_ has joined #ruby
milardovich has joined #ruby
shinnya has joined #ruby
larcara_ has joined #ruby
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
Guest70176 has joined #ruby
larcara has quit [Ping timeout: 240 seconds]
tcopeland has joined #ruby
truenito has joined #ruby
dstrunk has joined #ruby
larcara_ has quit [Ping timeout: 268 seconds]
jameser has joined #ruby
kryptoz has quit [Remote host closed the connection]
Guest70176 has quit [Ping timeout: 268 seconds]
VladGh_ has quit [Remote host closed the connection]
yeticry has quit [Ping timeout: 255 seconds]
osvimer_ has quit [Quit: leaving]
drowze has joined #ruby
VladGh has joined #ruby
<Bish> apeiros: how would you solve my problem?
sepp2k has joined #ruby
<apeiros> in your place? probably by using an existing scheduler.
<Bish> is there something that does that? execute block for every 60 seconds, but dont overlap?
<Bish> what feature of concurrent ruby would that be?
cosimo_ has quit [Read error: Connection reset by peer]
yeticry has joined #ruby
apparition has joined #ruby
<apeiros> don't overlap? you mean assuming the block takes less than 60s to execute?
<apeiros> or how do you ensure no overlap?
<Bish> next_time_execution = time_execution_took + 60s
cosimo_ has joined #ruby
<apeiros> so you don't mean every 60s, you mean with a gap of 60s
<Bish> uhm, yes
<Bish> sorry
<Bish> and i need those grouped per customer :( to optimize for database connections
<apeiros> it's fine. I understand this is difficult to express.
<apeiros> where do your threads come into play?
<apeiros> I ask because if it's all sequential, you don't need a mutex
<Bish> at the end of the script there is just (0..8).to_a.map { Thread.new { get_work } }
<Bish> it's not sequential
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Burgestrand> Bish what's the data type of @@realms?
<Bish> Burgestrand: it's a model, each customer as a a "realm"
<Bish> has*
nowhere_man has quit [Ping timeout: 268 seconds]
milardov_ has joined #ruby
<Burgestrand> Bish ah, alright, so you have your own implementation of #sample?
<Bish> no. it's an array of realms
<Bish> Enumerable rather
<Burgestrand> Bish so it's not a model, and Enumerable doesn't have sample so Array is fine :)
kryptoz has joined #ruby
<Bish> sorry, again :D
<Burgestrand> Bish how many realms do you have as an order of magnitude? tens? hundreds? more?
<Bish> it's 200 now, we're planning on 1000 by march
<Bish> otherwise the company dies, i guess
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Ping timeout: 255 seconds]
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bish> that's why i am having my thoughts, this wont handle 1000
<Bish> I(very_often) am 90.072294026 too late
<Bish> that job is supposed to run every 60 seconds
<Bish> and is 90 seconds too late :D
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
drowze has quit [Ping timeout: 260 seconds]
<Burgestrand> I was trying to understand the execution here, but I think I'll give up it'll take too long and I'm at work ;)
<apeiros> so you have about ~20 jobs per customer. you have a growing number of customers (200 now, 1000 planned, potentially more later). those 20 jobs should be executed as fast as possible, then a break of 60s until next execution of all 20 jobs. the 60s break is per customer. does that fit?
yeticry has quit [Ping timeout: 248 seconds]
<Bish> 100% correct
<Bish> but i have jobs with different intervals
<apeiros> and all those jobs need access to a limited resource (database connections in your case)?
<Bish> very_often ⇔ 60s, often ⇔ 300s, hourly, daily
<Bish> well i even think i can forget about the database connection thing
safetypin has joined #ruby
<Bish> i did that because i thought it is clever because the database connection will be killed, after each job
<Burgestrand> I recall there being a in-process job scheduler that used hitimes (as opposed to a background worker)
<apeiros> the design pattern with such problems is you usually pool the limited resource and organize your work around that
<Burgestrand> Trying to find it but I can't remember it's name…
Psybur has joined #ruby
dstrunk has joined #ruby
dstrunk has quit [Client Quit]
<apeiros> do the jobs themselves vary? or are they the same for all customers just with different parametrization? i.e. they all take about the same time to run?
<Bish> no they don't vary
<Bish> they do not take the same time to run though, it depends on how much data the customer has
<apeiros> what min/max are we talking about?
<Bish> same job could be 3-160s is the max i thought
<Bish> i saw*
<apeiros> (fair warning, lunch break is over so my message may be rather infrequent)
[Butch] has quit [Ping timeout: 268 seconds]
<Bish> all cool, im very grateful either way
<apeiros> so extreme case: 160s job execution, 60s gap time, 160s job exe, 60s gap time, … for a single customer could be a pattern?
safetypin has quit [Client Quit]
yeticry has joined #ruby
[Butch] has joined #ruby
<Burgestrand> I'm also very curious now, it's fun to follow this 20 questions of requirements :D
plexigras has joined #ruby
Psybur has quit [Ping timeout: 248 seconds]
<Bish> apeiros: yes
Barrt has quit [Ping timeout: 268 seconds]
Puffball_ has joined #ruby
<Bish> for another customer that 160s could be 2s likewise
[Butch] has quit [Ping timeout: 240 seconds]
Barrt has joined #ruby
<apeiros> and a job would be considered "late" if it the gap time exceeds the scheduled 60s? i.e. if the gap time "happens" to be 80s, the job is considered 20s late?
banisterfiend has quit [Changing host]
banisterfiend has joined #ruby
JsilverT has quit [Ping timeout: 240 seconds]
Puffball has quit [Ping timeout: 248 seconds]
<Burgestrand> I think I was thinking of rufus-scheduler, regarding my gem that I couldn't find, but I'm not entirely sure
<Bish> apeiros: i personally think so, but right now there are no jobs that HAVE to run
<Bish> it's something like "update that reporting"
<Bish> none will notice if the reporting is 20 seconds old
<apeiros> ok, but that's what you labeled as "jobs being late" above?
bmurt has joined #ruby
davic has quit [Remote host closed the connection]
[Butch] has joined #ruby
<Bish> it's just so i can actually see that my scheduler fucks up
milardov_ has quit [Remote host closed the connection]
<Bish> without prints, how would've noticed that it's not working optimal
milardovich has joined #ruby
<apeiros> ok
<Bish> would i have noticed
<Bish> so there is no real "being late", but in future there might be time cirtical jobs
milardovich has quit [Remote host closed the connection]
<Bish> but actually, they're just cronjobs which i don't want to stall
<Bish> if a job takes 61s and is executed every 60s.. i don't want this to be happening to me
<Bish> reminds me too much of times when i was 11 and dreaming of becoming a php web developer
<apeiros> well, the two strategies there are either yours (using gaps instead of having a fixed interval for the start time), or skipping runs (last one still running? skip this run)
<apeiros> but both only care about a single job. when you have multiple jobs, they still can starve your resources.
<banisterfiend> anyone here know about code signing on osx?
milardovich has joined #ruby
<apeiros> so one main question with regards to the "best" design is: do you think your resources (CPU power, IO bandwidth, …) should be easily capable of coping with the demand of your jobs, or do you have to design with starved resources in mind?
<apeiros> 1st variant you'll want to design to run things on time
<apeiros> 2nd variant you'll want to design to run things as soon as possible and as fairly distributed among your customers as possible
larcara has joined #ruby
<apeiros> 2nd variant can actually still be a choice even if you have resources to spare (i.e. "the fresher the reports, the happier the customers", so while every 60s would be good, running them even faster would be better)
Mortomes|Work has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
BioSpider has quit [Ping timeout: 248 seconds]
Ouchy has joined #ruby
Ouchy has quit [Changing host]
Ouchy has joined #ruby
fusta has joined #ruby
Ouchy`w has joined #ruby
Ouchy`w has quit [Client Quit]
davic has joined #ruby
davic has quit [Remote host closed the connection]
<apeiros> 2nd variant is mostly a priority queue where the rarer the job, the higher its priority, and you re-enqueue a job after it has been done. and a worker-pool processes the work. you log the delay+starttime+endtime+duration for each processed job and use analytics to figure whether you have to add resources.
milardovich has quit [Remote host closed the connection]
davic has joined #ruby
<Bish> i like the skipping runs approach
<Bish> seems simple
Barrt has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 268 seconds]
jameser has joined #ruby
<apeiros> fun, I actually prefer gapping. mostly because with ^ implementation, it's relatively simple.
<apeiros> and it makes gapping completely optional.
aupadhye has quit [Quit: Leaving]
<apeiros> ah right, and with ^ impl, you'd measure throughput, not lateness. which seems to fit better with what you describe too.
larcara has quit [Remote host closed the connection]
gheegh has joined #ruby
SirOliver has joined #ruby
<gheegh> Hey, does anyone know if Net::HTTP supports HTTP2?
<gheegh> I'm running into a problem with Webmock not being able to parse a downloaded file with CURL, and they all seem to be HTTP/2 responses..
davic has quit [Quit: ZNC - http://znc.in]
larcara has joined #ruby
SirOliver has quit [Client Quit]
davic has joined #ruby
<Bish> apeiros: so how would i go with that, take the concurrent api and just try to implement things you said ?
SirOliver has joined #ruby
Burgestrand has quit [Quit: Closing time!]
milardovich has joined #ruby
drowze has joined #ruby
milardovich has quit [Remote host closed the connection]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
fusta has quit [Ping timeout: 250 seconds]
mtkd has quit [Ping timeout: 250 seconds]
Barrt has joined #ruby
rfoust has joined #ruby
JsilverT has joined #ruby
mikecmpb_ has joined #ruby
mtkd has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Ping timeout: 240 seconds]
najam has joined #ruby
banisterfiend has quit [Ping timeout: 248 seconds]
ramortegui has joined #ruby
najam has left #ruby [#ruby]
jonr22 has joined #ruby
cdg has joined #ruby
shinnya has quit [Ping timeout: 268 seconds]
snickers has quit [Ping timeout: 268 seconds]
Burgestrand has joined #ruby
morfin has joined #ruby
<morfin> hello
Puffball_ has quit [Ping timeout: 268 seconds]
<morfin> how do i break out of loop from inside of function called in loop?
kanobt61_ has joined #ruby
workmad3 has joined #ruby
<Bish> morfin: if you can, use return/next
<Bish> otheriwse
<Bish> throw and catch
jameser has joined #ruby
cdg has quit [Ping timeout: 255 seconds]
jonr22 has quit [Ping timeout: 240 seconds]
guille-moe has joined #ruby
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
<Bish> >> lobal = nil;catch(:mr_gorbatschow_turn_down_this_wall) { (0..10).to_a.each { |a| (0..10).to_a.each { |b| global = [a,b];throw(:mr_gorbatschow_turn_down_this_wall) if a == 3 } } };global
catbusters has joined #ruby
<Bish> >> lobal = nil;catch(:mr_gorbatschow_turn_down_this_wall) { (0..10).to_a.each { |a| (0..10).to_a.each { |b| global = [a,b];throw(:mr_gorbatschow_turn_down_this_wall) if a == 3 } } };global
<ruby[bot]> Bish: # => undefined local variable or method `global' for main:Object ...check link for more (https://eval.in/904477)
<Bish> gnh
govg has quit [Ping timeout: 260 seconds]
<Bish> >> global = nil;catch(:mr_gorbatschow_turn_down_this_wall) { (0..10).to_a.each { |a| (0..10).to_a.each { |b| global = [a,b];throw(:mr_gorbatschow_turn_down_this_wall) if a == 3 } } };global
<ruby[bot]> Bish: # => [3, 0] (https://eval.in/904478)
workmad3 has quit [Ping timeout: 258 seconds]
<Bish> morfin: keep in mind, this should be the last thing you do
<morfin> yes i remember)
<Bish> haha, youre russian, that makes my example so much more funny
Psybur has joined #ruby
rikkipitt has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk has joined #ruby
drowze has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
tomphp has quit [Client Quit]
Barrt has quit [Ping timeout: 240 seconds]
Psybur has quit [Ping timeout: 248 seconds]
larcara has quit [Remote host closed the connection]
jameser has joined #ruby
polishdub has joined #ruby
tlaxkit has joined #ruby
DLSteve_ has joined #ruby
oleo has joined #ruby
mson has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has joined #ruby
Rouge has joined #ruby
<apeiros> Bish: some old code slightly reshaped: https://gist.github.com/apeiros/0478ccf738f3df9018c35b33ddce4118
<apeiros> in this example, all jobs are executed as fast as possible
milardovich has joined #ruby
jameser has joined #ruby
<apeiros> the difficulty would be in how to reshape this so it serves your case with multiple priorities (the "once a minute, once an hour, daily" part)
<apeiros> the way I'd deal with that depends heavily on how many priorities there are, and what expectations the system should fulfill
Barrt has joined #ruby
cdg has joined #ruby
ramfjord has joined #ruby
jameser has quit [Client Quit]
mim1k_ has quit [Ping timeout: 248 seconds]
greengriminal has joined #ruby
milardov_ has joined #ruby
tomphp has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 268 seconds]
michael1 has joined #ruby
Burgestrand has quit [Quit: Closing time!]
tomphp has quit [Client Quit]
mostlybadfly has quit [Quit: Connection closed for inactivity]
jameser has joined #ruby
foooobear has joined #ruby
Barrt has quit [Ping timeout: 268 seconds]
Burgestrand has joined #ruby
soahccc has quit [Ping timeout: 246 seconds]
Guest70176 has joined #ruby
tomphp has joined #ruby
mim1k has joined #ruby
tomphp has quit [Client Quit]
foooobear has quit [Quit: (null)]
hs367 has joined #ruby
soahccc has joined #ruby
_hs366 has quit [Read error: Connection reset by peer]
oleo has quit [Quit: Leaving]
_hs366 has joined #ruby
synthroid has joined #ruby
Guest70176 has quit [Ping timeout: 255 seconds]
jeanlinux has quit []
daemonwrangler has quit [Quit: ZNC 1.6.3+deb1+jessie0 - http://znc.in]
daemonwrangler has joined #ruby
uZiel has joined #ruby
hs367 has quit [Ping timeout: 240 seconds]
oleo has joined #ruby
milardov_ has quit [Remote host closed the connection]
safetypin has joined #ruby
milardovich has joined #ruby
Barrt has joined #ruby
digitalowl has quit [Quit: leaving]
hs367 has joined #ruby
_hs366 has quit [Read error: Connection reset by peer]
_hs366 has joined #ruby
truenito has quit [Ping timeout: 240 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
daemonwrangler has quit [Read error: Connection reset by peer]
milardovich has quit [Ping timeout: 268 seconds]
daemonwrangler has joined #ruby
Ouchy`w has joined #ruby
Ouchy`w has quit [Client Quit]
hs367 has quit [Ping timeout: 240 seconds]
michael1 has quit [Ping timeout: 260 seconds]
Ouchy has quit [Ping timeout: 248 seconds]
herbmillerjr has joined #ruby
jameser has joined #ruby
jameser has quit [Client Quit]
michael1 has joined #ruby
Technodrome has joined #ruby
Guest70176 has joined #ruby
Rapture has joined #ruby
banisterfiend has joined #ruby
mark_66 has quit [Remote host closed the connection]
Psybur has joined #ruby
Guest70176 has quit [Ping timeout: 248 seconds]
banisterfiend has joined #ruby
banisterfiend has quit [Changing host]
Psybur has quit [Ping timeout: 240 seconds]
rippa has joined #ruby
cschneid_ has joined #ruby
SirOliver has quit [Remote host closed the connection]
SirOliver has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]
drowze has joined #ruby
mikecmpbll has joined #ruby
dionysus69 has quit [Ping timeout: 258 seconds]
chmurifree has quit [Ping timeout: 260 seconds]
mikecmpb_ has quit [Ping timeout: 258 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snickers has joined #ruby
bweston92 has quit [Quit: Connection closed for inactivity]
rikkipitt has quit [Remote host closed the connection]
apparition has quit [Quit: Bye]
chmurifree has joined #ruby
milardovich has joined #ruby
kculpis has joined #ruby
rikkipitt has joined #ruby
notmyrealname has joined #ruby
rikkipit_ has joined #ruby
<notmyrealname> Hi! Does anyone know how to format a string so it looks like a heading when printed? I've searched around a bit and couldn't find anything. I'm welcome to any help.
greengriminal has joined #ruby
<Burgestrand> notmyrealname When printed where?
<Burgestrand> notmyrealname What kind of heading? Compass heading? Website heading? Terminal heading? A be-heading?
<apeiros> how does a heading look like?
milardovich has quit [Ping timeout: 268 seconds]
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rikkipitt has quit [Ping timeout: 255 seconds]
<Burgestrand> Up is a heading!
<notmyrealname> Burgestrand: Real simple. I'm just making a terminal application and I want it to print it's name to the terminal.
<notmyrealname> Burgestrand: Big old heading. :)
<Burgestrand> notmyrealname I'm not that old, so I'm not sure what you mean by big old heading; at least my terminal all characters are all the same size so there's not much for room for big there either. Are you talking about boldening the text, maybe?
<havenwood> system 'banner notmyrealname'
<Burgestrand> havenwood Oh wow, that is big for sure!
kickr has joined #ruby
<Burgestrand> Dang it's so large, and vertical, didn't expect that… and a default width of 132 instead of 80, that was a bit surprising.
<Burgestrand> notmyrealname Here's a chunk of terminal escape sequences that I found by Googling, perhaps a few of those are to your liking: https://gist.github.com/lnznt/2663516
<apeiros> lol, til `banner`. interesting.
aef has joined #ruby
<notmyrealname> Burgestrand: I just realized that to do that you can use asic art.
<Burgestrand> notmyrealname \o/
<apeiros> but banner only prints 90° rotated?
<Burgestrand> I was a bit surprised by that too
jaequery has joined #ruby
<havenwood> apeiros: on Linux it's horizontal, on BSD vertical ¯\_(ツ)_/¯
<apeiros> because reasons. I love it.
<notmyrealname> Burgestrand: Thanks for the gist. I think banner is a little too ostentatious if you catch my drift.
iamarun has joined #ruby
<Burgestrand> notmyrealname Yeah I catch your heading!
<Burgestrand> Anyhow, gotta split, glhf!
<notmyrealname> Ruby irc is just too cool.
<ule> Hey guys.. Is there a different way of doing this:
<ule> Object.const_get(klass).send('new', foo, bar)
<ule> Not sure how bad this looks like
<ule> or if it's ok
<havenwood> ule: you could use #public_send
SirOliver has quit [Quit: ZZZzzz…]
<apeiros> and :new
<ule> let me read about that
notmyrealname has quit [Quit: Page closed]
<apeiros> though I presume that's an example
<ule> apeiros: ohh symbols.. awesome
guille-moe has quit [Ping timeout: 248 seconds]
<apeiros> because if it's static, just do .new(…)
<ule> apeiros: actually not.. :P
<ule> I can make it static
<apeiros> well, then Object.const_get(name).new(…)
<ule> ohhh got it
<apeiros> public_send only if you need to identify the method via variable. send only if you need to call a private method (bad, don't unless you know what you do :-p)
* apeiros afk, laters!
sammi` has joined #ruby
<ule> awesome thanks guys!
apeiros has quit []
ana__ has quit [Quit: Leaving]
larcara has joined #ruby
Burgestrand has quit [Quit: Closing time!]
synthroid has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: inabit. zz.]
aufi has quit [Ping timeout: 248 seconds]
cognoscente has joined #ruby
mikecmpbll has joined #ruby
snickers has joined #ruby
mostlybadfly has joined #ruby
Rouge has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
krawchyk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troys has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
Guest70176 has joined #ruby
mikkelsen has joined #ruby
kryptoz has quit [Remote host closed the connection]
aScottishBoat has quit [Read error: Connection reset by peer]
aufi has joined #ruby
impermanence has joined #ruby
Psybur has joined #ruby
<impermanence> I have an issue on one of my agents that is apparently being caused by my master caching "stuff"
<impermanence> where are these caches typically and can I just delete them?
<impermanence> If not how do I restart a master?
<impermanence> 3.8.7
SirOliver has joined #ruby
Guest70176 has quit [Ping timeout: 248 seconds]
krawchyk has joined #ruby
conta has quit [Ping timeout: 240 seconds]
nofxx has quit [Remote host closed the connection]
mcr1 has quit [Ping timeout: 255 seconds]
nofxx has joined #ruby
Psybur has quit [Ping timeout: 255 seconds]
milardovich has joined #ruby
michael1 has quit [Ping timeout: 240 seconds]
nofxx_ has joined #ruby
Technodrome has joined #ruby
nofxx has quit [Read error: Connection reset by peer]
<gizmore> impermanence: maybe this is not ruby lang related, but rails or something? try #RubyOnRails then
thinkpad has quit [Ping timeout: 248 seconds]
dn` has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
mikkelsen is now known as aScottishBoat
[Butch] has quit [Ping timeout: 252 seconds]
aScottishBoat has quit [Remote host closed the connection]
orbyt_ has joined #ruby
aScottishBoat has joined #ruby
aScottishBoat has quit [Remote host closed the connection]
milardovich has joined #ruby
dviola has quit [Quit: WeeChat 1.9.1]
nadir has quit [Quit: Connection closed for inactivity]
aufi has quit [Quit: Leaving]
stokachu has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
synthroid has joined #ruby
FahmeF has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aScottishBoat has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has joined #ruby
bmurt has joined #ruby
moei has quit [Quit: Leaving...]
ta_ has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
rikkipit_ has quit [Ping timeout: 268 seconds]
aroaminggeek has joined #ruby
jaruga has quit [Quit: jaruga]
jaruga has joined #ruby
krawchyk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raynold has joined #ruby
fusta has joined #ruby
zautomata has quit [Ping timeout: 240 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
dinfuehr has joined #ruby
zautomata has joined #ruby
milardov_ has joined #ruby
jaruga has quit [Ping timeout: 248 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
troys is now known as troys_
milardovich has quit [Ping timeout: 246 seconds]
dionysus69 has joined #ruby
mikkelsen has joined #ruby
eksi_ has joined #ruby
zautomata has quit [Ping timeout: 268 seconds]
uptime has quit [Ping timeout: 264 seconds]
fusta has quit [Ping timeout: 258 seconds]
ldepandis has joined #ruby
eksi_ is now known as fusta
Rouge has joined #ruby
aScottishBoat has quit [Ping timeout: 246 seconds]
tlaxkit has quit [Quit: ¡Adiós!]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
Psybur has joined #ruby
ta_ has joined #ruby
Serpent7776 has quit [Quit: Leaving]
Nitrodist has left #ruby [#ruby]
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
aroaminggeek has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SirOliver has quit [Quit: ZZZzzz…]
orbyt_ has joined #ruby
iamarun has quit [Remote host closed the connection]
uptime has joined #ruby
Psybur has quit [Ping timeout: 248 seconds]
konsolebox has quit [Ping timeout: 248 seconds]
andikr has quit [Remote host closed the connection]
fusta has quit [Ping timeout: 250 seconds]
rippa has quit [Read error: Connection reset by peer]
nogic has joined #ruby
konsolebox has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
selim has quit [Ping timeout: 264 seconds]
rippa has joined #ruby
troys_ is now known as troys
InfinityFye has quit [Quit: Leaving]
selim has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
michael1 has joined #ruby
zautomata has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
ldepandis has quit [Ping timeout: 268 seconds]
milardov_ has quit [Remote host closed the connection]
cognoscente_ has joined #ruby
mikkelsen has quit [Remote host closed the connection]
cognoscente has quit [Ping timeout: 258 seconds]
mikkelsen has joined #ruby
br0d1n has joined #ruby
Rouge has quit [Ping timeout: 255 seconds]
michael1 has quit [Ping timeout: 248 seconds]
konsolebox_ has joined #ruby
konsolebox has quit [Ping timeout: 255 seconds]
chouhoulis has joined #ruby
FahmeF has quit [Ping timeout: 240 seconds]
FahmeF has joined #ruby
claudiuinberlin has joined #ruby
hahuang65 has joined #ruby
brixen has quit [Ping timeout: 260 seconds]
exhiled has joined #ruby
jtdoncas has joined #ruby
apeiros_ has joined #ruby
eckhardt has joined #ruby
krawchyk has joined #ruby
cdg has joined #ruby
mikkelsen has quit [Read error: Connection reset by peer]
brixen has joined #ruby
FahmeF has quit [Remote host closed the connection]
mcr1 has joined #ruby
milardovich has joined #ruby
larcara has quit [Remote host closed the connection]
guille-moe has joined #ruby
benjen has quit [Ping timeout: 240 seconds]
benjen has joined #ruby
JsilverT is now known as silvermine
workmad3 has joined #ruby
enterprisey has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
aroaminggeek has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
Guest70176 has joined #ruby
dcluna has quit [Ping timeout: 248 seconds]
Psybur has joined #ruby
PaulCapestany has quit [Quit: .]
dcluna has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
larcara has joined #ruby
al2o3-cr has joined #ruby
PaulCapestany has joined #ruby
eckhardt_ has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta2 has joined #ruby
truenito has joined #ruby
Guest70176 has quit [Ping timeout: 260 seconds]
ta_ has quit [Ping timeout: 260 seconds]
silvermine has quit [Quit: WeeChat 2.0-dev]
silvermine has joined #ruby
Psybur has quit [Ping timeout: 248 seconds]
eckhardt has quit [Ping timeout: 260 seconds]
conta2 has quit [Ping timeout: 252 seconds]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
gr33n7007h has joined #ruby
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
impermanence has quit [Ping timeout: 248 seconds]
al2o3-cr has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby
ta_ has joined #ruby
exhiled has joined #ruby
moei has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
milardov_ has joined #ruby
jtdoncas has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
aroaminggeek has left #ruby ["Textual IRC Client: www.textualapp.com"]
radanisk has joined #ruby
zacts has quit [Quit: WeeChat 1.4]
milardov_ has quit [Remote host closed the connection]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
radanisk has quit [Client Quit]
radanisk has joined #ruby
yaewa has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moei has quit [Ping timeout: 240 seconds]
dviola has quit [Quit: WeeChat 1.9.1]
Rapture has joined #ruby
yaewa has quit [Client Quit]
gr33n7007h is now known as al2o3-cr
nadir has joined #ruby
br0d1n has quit [Quit: Leaving]
ldnunes has quit [Ping timeout: 260 seconds]
d10n-work has joined #ruby
MrBusiness has quit [Ping timeout: 240 seconds]
zacts has joined #ruby
ta_ has quit [Ping timeout: 248 seconds]
synthroid has quit [Remote host closed the connection]
moei has joined #ruby
apeiros_ has quit [Remote host closed the connection]
zautomata has quit [Ping timeout: 255 seconds]
jackjackdripper has joined #ruby
kapil___ has joined #ruby
apeiros_ has joined #ruby
Technodrome has joined #ruby
ta_ has joined #ruby
enterprisey has quit [Remote host closed the connection]
moei has quit [Client Quit]
nirix has quit [Ping timeout: 255 seconds]
milardovich has joined #ruby
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
nirix has joined #ruby
ur5us has joined #ruby
nofxx_ has quit [Remote host closed the connection]
ldnunes has joined #ruby
nofxx_ has joined #ruby
ixti has joined #ruby
muelleme has joined #ruby
exhiled has joined #ruby
Rouge has joined #ruby
Cohedrin has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
guille-moe has quit [Ping timeout: 268 seconds]
larcara has quit [Remote host closed the connection]
Rouge has quit [Remote host closed the connection]
Psybur has joined #ruby
Rouge has joined #ruby
Guest70176 has joined #ruby
zautomata has joined #ruby
milardov_ has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardov_ has quit [Remote host closed the connection]
greengriminal has quit [Quit: This computer has gone to sleep]
Guest70176 has quit [Ping timeout: 250 seconds]
milardovich has quit [Ping timeout: 260 seconds]
Psybur has quit [Ping timeout: 240 seconds]
graft has joined #ruby
Dimik has joined #ruby
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<graft> okay, i'm having some issues with zero division
<graft> >> 0.0 == -0.0
<ruby[bot]> graft: # => true (https://eval.in/904687)
michael1 has joined #ruby
<graft> >> 1.0/0.0 == 1.0/-0.0
<ruby[bot]> graft: # => false (https://eval.in/904688)
<graft> ????
<graft> also, this:
<graft> >> 1/0
<ruby[bot]> graft: # => divided by 0 (ZeroDivisionError) ...check link for more (https://eval.in/904689)
snickers has joined #ruby
<graft> clearly 1/0.0 == Infinity is wrong, just mathematically - is there a way i can make this raise ZeroDivisionError instead of returning Infinity?
<RickHull> ?float
<ruby[bot]> Your numbers don't add up? You get "weird" results? read http://floating-point-gui.de/
ta_ has quit [Remote host closed the connection]
Ltem has joined #ruby
ta_ has joined #ruby
<graft> this doesn't seem to have anything to do with floating point arithmetic... it's just a definition issue
<RickHull> 1/0 #=> ZeroDivisionError is expected
<graft> i agree, that's the correct behavior
<RickHull> the rest of your examples have to do with floating point imprecision
<graft> that's not possible, if 0.0 == -0.0
ramfjord has joined #ruby
oetjenj has joined #ruby
<graft> it's not calculating Infinity for 1/0.0 using floating point arithmetic
Immune has joined #ruby
<RickHull> I don't know any background on Infinity here -- but that is the limit as y approaches 0
oetjenj_ has joined #ruby
<graft> y = 1/x approaches Infinity as x => 0 and -Infinity as x => -0
<graft> it is undefined at x == 0
Technodrome has joined #ruby
<RickHull> 0.0 is not the same as 0
<RickHull> 0.0 approximates 0
<graft> >> 0.0 == 0
<ruby[bot]> graft: # => true (https://eval.in/904697)
<RickHull> yep, in some cases you get == to return true
synthroid has joined #ruby
<RickHull> >> [0.1 + 0.2 == 0.3, 0.1 + 0.1 == 0.2]
moei has joined #ruby
<ruby[bot]> RickHull: # => [false, true] (https://eval.in/904698)
hays has joined #ruby
<graft> this is not a Float issue, 0 is 0
<RickHull> 0.0 is a float; 0 is an int
oetjenj has quit [Ping timeout: 264 seconds]
<graft> they are both unambiguously zero, not floating-point approximations
<graft> even in C, a 0 float is 0, all of the bits are 0
<ramfjord> I belive that the way floating point arithmetic works, any number / 0.0 is Infininity instead of "undefined" as it would be in a mathematical sense, but most languages will throw an error when you try to divide by 0
<ramfjord> and 0.0 is a special case float: all 0's
<ramfjord> so it should be more reliable to check 0.0 == 0 vs other floating point comparisons, though it's a strange case where you would reliably get exactly 0
<ramfjord> won't 0 be cast to a float since it's used in an expression with a float?
<ramfjord> >> [ 1.1 / 1, 1 / 1.1 ]
<ruby[bot]> ramfjord: # => [1.1, 0.9090909090909091] (https://eval.in/904702)
<havenwood> >> class Integer; def / n; return Float::NAN if n.instance_of?(Float) && n.zero?; div n end end; 1 / 0.0 # graft
<ruby[bot]> havenwood: # => Infinity (https://eval.in/904703)
jackjackdripper has joined #ruby
<havenwood> On 2.4: NaN
<havenwood> >> class Fixnum; def / n; return Float::NAN if n.instance_of?(Float) && n.zero?; div n end end; 1 / 0.0
<ruby[bot]> havenwood: # => NaN (https://eval.in/904704)
<ramfjord> >> Float.ancestors & Fixnum.ancestors
<ruby[bot]> ramfjord: # => [Numeric, Comparable, Object, Kernel, BasicObject] (https://eval.in/904705)
<ramfjord> maybe Numeric?
muelleme has quit [Ping timeout: 250 seconds]
<havenwood> ramfjord: I forgot the bot wasn't 2.4.
<havenwood> ramfjord: With Fixnum and Bignum unified to Integer in 2.4 Integer is the place to redefine. But on < 2.4 Integer is lower in the method chain than Fixnum.
<graft> i'm on 2.2.2
workmad3 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Remote host closed the connection]
<ramfjord> havenwood: I was suggesting Numeric as a common ancestor between Float and Fixnum/Integer, since otherwise (1.0 / 0.0) may have different behavior than (1 / 0.0)... But either way monkey patching division on these classes seems like madness
<havenwood> ramfjord: Ah, right. Yeah - it's the common ancestor but the method would never get called.
greengriminal has joined #ruby
<havenwood> Since Float, Integer, Rational, etc all define #/.
apeiros_ has quit [Remote host closed the connection]
synthroi_ has joined #ruby
VeryBewitching has joined #ruby
<ramfjord> because it's defined on the subclass... right. But would there also be some weird casting logic here? In (1 / 1.1) clearly the "1" is cast to Float before the operation?
<ramfjord> >> class Float ; def / n ; return Float::NAN if n.zero?; div n end end; 1 / 0.0
<ruby[bot]> ramfjord: # => Infinity (https://eval.in/904708)
<ramfjord> hrm... apparently not
<RickHull> ramfjord: a float in any portion of an arithmetic expression tends to "cast" the result to float
<RickHull> not sure on how the internal mechanics work
synthroid has quit [Ping timeout: 258 seconds]
<RickHull> >> Rational(1, 0.0)
<ruby[bot]> RickHull: # => divided by 0 (ZeroDivisionError) ...check link for more (https://eval.in/904711)
<ramfjord> >> 1 / 0
<ruby[bot]> ramfjord: # => divided by 0 (ZeroDivisionError) ...check link for more (https://eval.in/904713)
<ramfjord> pretty inconsistent eh
<ramfjord> but there's no Int::Infinity
<RickHull> Rational tries to keep everything to integer domains -- so the ZDE is reasonably sensible for 1/0.0
<ramfjord> >> (1 / 0.0) - (1 / 0.0)
<ruby[bot]> ramfjord: # => NaN (https://eval.in/904714)
<ramfjord> that's nice
<ramfjord> Yeah, I don't understand why rational types aren't more prevalent for precise computation
oetjenj_ has quit [Ping timeout: 258 seconds]
<RickHull> as with most things -- because they don't have a good literal representation
<RickHull> it's easy to write: price = 4.99
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yaewa has joined #ruby
<RickHull> less so: price = Rational(499,100)
<ramfjord> at least not a typable one - with a pen it's pretty easy to represent a fraction
michael1 has quit [Ping timeout: 248 seconds]
<RickHull> right -- I just mean in terms of mindshare and prevalence in blog posts and tutorials
<RickHull> String, Array, Hash, Float -- these have simple and common literal representations
<RickHull> and they tend to get used even when something clunkier-looking works better
<ramfjord> Alright, I've got it boys! Monkeypatch Float initialization to check if more than two digits of precision were provided, and convert to rational if not
devchild has joined #ruby
moei has quit [Ping timeout: 240 seconds]
yaewa has quit [Client Quit]
mson has quit [Quit: Connection closed for inactivity]
Oclair has joined #ruby
<RickHull> what could possibly go wrong?!
moei has joined #ruby
Chew has quit [Quit: Updating details, brb]
Chew has joined #ruby
jackjackdripper1 has joined #ruby
truenito has quit [Ping timeout: 260 seconds]
bmurt has joined #ruby
jackjackdripper has quit [Ping timeout: 258 seconds]
<RickHull> ramfjord: BigDecimal is also handy for precise decimal representation
hays has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 240 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
hays has joined #ruby
exhiled has joined #ruby
ldnunes has quit [Quit: Leaving]
troys is now known as troys_
GBrawl has joined #ruby
oetjenj has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Ping timeout: 240 seconds]
Psybur has joined #ruby
hays has quit [Remote host closed the connection]
greengriminal has joined #ruby
GBrawl has quit [Client Quit]
ixti has quit [Quit: WeeChat 1.9.1]
Guest70176 has joined #ruby
graft has quit [Ping timeout: 248 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Psybur has quit [Ping timeout: 240 seconds]
Oclair has quit [Quit: Bye Bye]
Guest70176 has quit [Ping timeout: 240 seconds]
troys_ is now known as troys
apeiros_ has joined #ruby
larcara has joined #ruby
orbyt_ has joined #ruby
Oclair has joined #ruby
apeiros_ has quit [Ping timeout: 240 seconds]
apeiros_ has joined #ruby
truenito has joined #ruby
ap4y has joined #ruby
truenito has quit [Ping timeout: 248 seconds]
mim1k has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
morfin has quit []
mim1k has quit [Ping timeout: 248 seconds]
prutheus has joined #ruby
<prutheus> Hello guys! Me again :D
<prutheus> I am working with selenium at the moment. Have a webpage where some url's are listed. I want to open them in another tab to get data from there. My problem is: when I let the driver change his tabs via https://bpaste.net/show/4414f02ec6c1 the window gains focus so I can't work on my pc anymore while the bot is running.
<prutheus> how could I change this?
apeiros_ is now known as apeiros
Technodrome has joined #ruby
muelleme has joined #ruby
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
cognoscente_ has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
theillusioneer has quit [Ping timeout: 255 seconds]
troys is now known as troys_
radanisk has quit [Remote host closed the connection]
radanisk has joined #ruby
radanisk has quit [Remote host closed the connection]
radanisk has joined #ruby
radanisk has quit [Remote host closed the connection]
radanisk has joined #ruby
radanisk has quit [Remote host closed the connection]
Arney has joined #ruby
<RickHull> prutheus: not really a Ruby question, but... probably you want to run your selenium tests in an isolated environment
<RickHull> like a dedicated VM without mouse pointer integration
cognoscente has joined #ruby
<RickHull> otherwise -- I expect the selenium docs have some insight for handling this. if you are going to just run it on your dev desktop, you may need to stop trying to use it for other work while tests are running
dviola has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #ruby
greengriminal has quit [Remote host closed the connection]
<prutheus> hm :/
greengriminal has joined #ruby
deepredsky has joined #ruby
<prutheus> I hoped I can somehow prohibit it
cschneid_ has quit [Remote host closed the connection]
<RickHull> via isolation. without knowing selenium specifics, one way to isolate desktop interaction is to use a VM
<prutheus> yeah VM would be a great opportunity
devchild has quit []
DLSteve_ has joined #ruby
enterprisey has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reber has quit [Quit: Leaving]
tomphp has joined #ruby
milardovich has joined #ruby
Psybur has joined #ruby
<plexigras> how can i do ['some','array'].inject(0) { ... } and get the index inside the block?
<dminuoso> plexigras: Yes.
<plexigras> how?
<baweaver> &ri Enumerable#with_index
<`derpy> No results
<dminuoso> plexigras: Use the fact that if you do not supply a block, that you get an enumerator back.
<baweaver> &ri Enumerator#with_index
<RickHull> inject(0).with_index ?
<plexigras> ok thanks
milardovich has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
<dminuoso> baweaver: Oh man. This is going to suck :(
<dminuoso> Ive just "enhanced" the entirety of Enumerable to.. autocurry.
Guest70176 has joined #ruby
<baweaver> Magic?
<dminuoso> Guess I need some addIndex function now.
<dminuoso> Yes!
<dminuoso> No you can do things like a = coll.select;
<baweaver> (I have an entire army of reaction Lemurs now, 70+ of them)
<dminuoso> or coll.filter(eq('foo'))
<dminuoso> baweaver: Haha neice.
<dminuoso> baweaver: My next trick is to properly patch proc[] to be able to pass 3 arguments to a lambda having an arity of 2.
<dminuoso> *Proc#[] and Proc#call that is
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> (So that it applies 2, and recursively applies the remaining to the returned curried lambdas)
Psybur has quit [Ping timeout: 248 seconds]
<dminuoso> Just so I can program like Haskell in Ruby.
jackjackdripper1 has quit [Quit: Leaving.]
biberu has quit []
jackjackdripper has joined #ruby
Guest70176 has quit [Ping timeout: 248 seconds]
jackjackdripper has quit [Client Quit]
prutheus has quit [Quit: Page closed]
nogic has quit [Quit: Textual IRC Client: www.textualapp.com]
<plexigras> how do i use with_index i cant get it to work
jamesaxl has quit [Quit: WeeChat 1.9.1]
<RickHull> plexigras: hm, me too
<RickHull> >> [1,2,3].inject(0) # gives me an enumerator?
<ruby[bot]> RickHull: # => 0 is not a symbol nor a string (TypeError) ...check link for more (https://eval.in/904755)
<baweaver> >> %w(some text).each_with_index.reduce(0) {|a,(w,i)| p a, w, i; a + i }
<ruby[bot]> baweaver: # => 0 ...check link for more (https://eval.in/904756)
<baweaver> shenanigans
<baweaver> anyways, that works
<baweaver> see the eval.in link for what all it did
<RickHull> how come i can't get an enumerator from #inject(0) ?
synthroid has joined #ruby
<baweaver> I'd have to look at it, but reduce does odd things in general
kitsunenokenja has joined #ruby
<baweaver> &ri Enumerable#reduce
<RickHull> er yeah I mean reduce :)
<baweaver> reduce(sym) → obj
<baweaver> that basically
ap4y has quit [Quit: WeeChat 1.9.1]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> is each.with_index now more "canonical" than each_with_index ?
<plexigras> i dont understand how do i do this?
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver> Look at the code above
cdg has joined #ruby
ap4y has joined #ruby
synthroi_ has quit [Ping timeout: 248 seconds]
<plexigras> so i need to do each_with_index.reduce?
<baweaver> give it a try
<RickHull> >> [1,2,3].each.with_index.reduce(0) { |memo, (obj, idx)| memo + obj * idx }
<ruby[bot]> RickHull: # => 8 (https://eval.in/904757)
<plexigras> thanks
<RickHull> >> [:sleeping, :unconscious, :snoozing].each_sniff_windex { |obj, salts| obj.woke(salts) }
<ruby[bot]> RickHull: # => undefined method `each_sniff_windex' for [:sleeping, :unconscious, :snoozing]:Array ...check link for more (https://eval.in/904758)
<RickHull> darn
deepredsky has quit [Quit: WeeChat 1.9.1]
dionysus69 has quit [Ping timeout: 258 seconds]
mson has joined #ruby
VeryBewitching has quit [Quit: Konversation terminated!]
radanisk has joined #ruby
eckhardt has joined #ruby
synthroid has quit []
minimalism has quit [Quit: minimalism]
ramfjord has quit [Ping timeout: 240 seconds]
graft has joined #ruby
br0d1n has joined #ruby
ramfjord has joined #ruby
greengriminal has quit [Quit: Leaving]
cognoscente has quit [Quit: leaving]
FahmeF has joined #ruby
larcara has quit []
lytol has joined #ruby
eightlimbed has joined #ruby
Zamyatin has joined #ruby
FahmeF has quit [Ping timeout: 260 seconds]
lagweezle has joined #ruby
lagweezle has left #ruby [#ruby]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
muelleme has quit [Ping timeout: 248 seconds]
uZiel has quit [Ping timeout: 248 seconds]
Zamyatin has quit [Quit: Knocking out. Peace y'all...]
Zamyatin has joined #ruby
Zamyatin has quit [Client Quit]
hahuang65 has quit [Ping timeout: 246 seconds]
Zamyatin has joined #ruby
rikkipitt has joined #ruby
cschneid_ has joined #ruby
cdg has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 255 seconds]
Psybur has joined #ruby
Ltem has quit [Quit: Leaving]
David_H__ has joined #ruby
enterprisey has quit [Remote host closed the connection]
charliesome has joined #ruby
<leitz> Any idea if the pickaxe book will get an update?
Guest70176 has joined #ruby
David_H_Smith has quit [Ping timeout: 260 seconds]
Psybur has quit [Ping timeout: 248 seconds]
Guest70176 has quit [Ping timeout: 260 seconds]
milardovich has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver> Not sure it will
<baweaver> What are you looking to learn?'
<baweaver> Also see the channel topic, I left a book list up there :)
lytol has quit [Remote host closed the connection]
gone_haywire has quit [Remote host closed the connection]
<baweaver> leitz ^
<leitz> baweaver, I'm watching a MongoDB class video. :P
<leitz> I am looking to prepare for the Certification exam. No real reason except to push myself to learn more. Ruby is the first language that made me want to read the refernece docs.
<leitz> Not sure if there's a way to pull paper from the core docs.
<miah> pull paper?
drewmcmillan has joined #ruby
cdg has joined #ruby
<leitz> miah, I prefer to read physical books vice web pages.
<miah> ok im still confused. do you mean, is there a way to print out the core docs or?
cdg has quit [Ping timeout: 250 seconds]
eightlimbed has quit [Remote host closed the connection]
safetypin has quit [Quit: ZZZzzz…]
jaequery has joined #ruby
radanisk has quit [Remote host closed the connection]
apeiros has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
troys_ is now known as troys
exhiled has joined #ruby
krawchyk has quit [Quit: Textual IRC Client: www.textualapp.com]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
Arney has quit [Quit: leaving]
<leitz> miah, that's the question. Is there a way to pull the core docs into one huge pdf and take it to the store for printing.
<baweaver> leitz: I'd just get a copy of "The Ruby Way"
MrBusiness has joined #ruby
<baweaver> It approaches that level of tome
<miah> yup
<leitz> baweaver, have I mentioned that I have sevearl books? :P
<leitz> More books than brain cells, really.
<baweaver> Branching out?
<baweaver> I could never leaf a good book alone
<miah> i used to carry a copy of the Ruby Pocket Reference, it has most of those little questions.. but nowadays Dash does a good job of letting me carry the documentation with me
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<baweaver> I use Dash as well, though for the most part I have things on-memory for common functions
* leitz falls short on puns today.
<sylario> Ok what's the point of this line :$auth_header = '{"Username": "%s", "Password": "%s", "IntegratorKey": "%s"}' %[$username, $password, $integrator_key]
<baweaver> Though I can never remember Net::HTTP
<baweaver> other than being broken?
<baweaver> It's using an alternate string interpolation method
<sylario> I don't really understand %[] and %s but I guess It put values in the array?
<baweaver> with global variables which is odd
<baweaver> let me see if I can find that, one sec
<sylario> it's in a rspec of a non rails gem
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
emilford has joined #ruby
<miah> guh i swear this test passed yesterday and now everything is failing :(
<baweaver> It's kinda silly honestly, I've not seen that in the wild except for a few edge cases.
workmad3 has quit [Ping timeout: 264 seconds]
<baweaver> miah: Have you tried turning it off and on again?
<baweaver> Joking aside, is it time sensitive at all, data bound, or anything else that's not stubbed?
<baweaver> I swear I always forget 1-2 of those danged things
<miah> its not. im probably doing something silly and just not noticing yet =)
rikkipitt has quit [Remote host closed the connection]
GodFather has quit [Read error: Connection reset by peer]
<sylario> login password is in the code, but hey, not my repo, public repo : https://github.com/docusign/docusign-ruby-client/blob/master/tests/spec/unit_tests_spec.rb#L115
<baweaver> Flaky tests are the best
rikkipitt has joined #ruby
GodFather has joined #ruby
<baweaver> sylario: mixed indentation D:
tcopeland has quit [Quit: tcopeland]
ElDoggo has joined #ruby
<baweaver> I may go fix this later, that's bothersome
<baweaver> Actually, no, I will fix it.
<sylario> baweaver: so it's someone taking extra step for giggles ?
tenderlove has quit [Ping timeout: 248 seconds]
<baweaver> More like someone who doesn't know Ruby well is writing it
<baweaver> which isn't a bad thing but leads to some odd code
<baweaver> looks like a Perl programmer
<sylario> I guess, they just released the ruby gem
<sylario> thx baweaver
br0d1n has quit [Quit: Leaving]
<mikecmpbll> it's not that common to see that for straight string interpolation but you do see it
<baweaver> Someone already tried
rikkipitt has quit [Ping timeout: 248 seconds]
graft has quit [Ping timeout: 240 seconds]
<sylario> let's just say it's raw code
ledestin has joined #ruby
<mikecmpbll> were tabs always that huge on github
thinkpad has joined #ruby
<RickHull> sylario: the %s is a "format string" as in printf / sprintf
<mikecmpbll> 8 spaces, hmpf
<sylario> RickHull: I was mainly worried I was missing some strange trick
GodFather has quit [Ping timeout: 260 seconds]
<mikecmpbll> Kernel#format
<RickHull> and where you you `%[foo, bar, baz]`, it's more typically written with a space: `% [foo, bar, baz]`
<RickHull> and yes, it is a special syntax instead of calling Kernel#format, which is preferred in ruby
<RickHull> >> "%s is %s" % [:foo, :bar]
<ruby[bot]> RickHull: # => "foo is bar" (https://eval.in/904763)
<RickHull> >> format("%s is %s", :foo, :bar)
<ruby[bot]> RickHull: # => "foo is bar" (https://eval.in/904764)
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<RickHull> the former, with % and [] matches the default way to inject a variable into a string in Python
GodFather has joined #ruby
jaequery has joined #ruby
<mikecmpbll> >> "%s is %s" % %w%foo bar%
<ruby[bot]> mikecmpbll: # => "foo is bar" (https://eval.in/904765)
<mikecmpbll> how many percent symbols can i cram into it!!
<mikecmpbll> take a bow, ruby
<mikecmpbll> >> %%s is %s% % %w%foo bar%
<ruby[bot]> mikecmpbll: # => /tmp/execpad-fca8d5284cc8/source-fca8d5284cc8:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/904766)
<mikecmpbll> derp
<sylario> Damn i missed the hash is in fact a string
<sylario> Ok, now i kinda get it
milardov_ has joined #ruby
<sylario> It's already the header string
<mikecmpbll> >> %Q\%s is \%s% % %w%foo bar%
<ruby[bot]> mikecmpbll: # => /tmp/execpad-be915d2ea6eb/source-be915d2ea6eb:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/904767)
<sylario> pfffrrrrt
<mikecmpbll> >> %Q%\%s is \%s% % %w%foo bar%
<ruby[bot]> mikecmpbll: # => "foo is bar" (https://eval.in/904768)
<RickHull> sylario: % gets used as the mod operator, the string format syntax, but the main use is for special delimeters
<mikecmpbll> that's the best thing i've ever done.
<RickHull> >> %w{words are here and will be parsed into an array}
<ruby[bot]> RickHull: # => ["words", "are", "here", "and", "will", "be", "parsed", "into", "an", "array"] (https://eval.in/904769)
k3rn31_ has quit [Ping timeout: 248 seconds]
<RickHull> that is, percent-double-u followed by () [] or {}
<mikecmpbll> or any other character
<RickHull> >> %w(more words)
<ruby[bot]> RickHull: # => ["more", "words"] (https://eval.in/904770)
milardovich has quit [Ping timeout: 248 seconds]
<mikecmpbll> not any, but yeh
* leitz heads back to class. Almost done!
<RickHull> yeah, i'm giving more of a "best practices" rather than "what will the language possibly allow"
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull> i.e. "stuff you may see commonly and not want to barf over"
<mikecmpbll> worst practices are more fun :D
<RickHull> not for newbies ;)
<mikecmpbll> pah.
jackjackdripper has joined #ruby
<sylario> the %w is often used in config stuff
hahuang65 has joined #ruby
<sylario> If you want to save a few chars
polishdub has quit [Quit: leaving]
<RickHull> my emacs autoindent doesn't play very nicely with it
ElDoggo has quit [Remote host closed the connection]
ElDoggo has joined #ruby
Psybur has joined #ruby
milardov_ has quit [Remote host closed the connection]
ElDoggo has quit [Remote host closed the connection]
ElDoggo has joined #ruby
milardovich has joined #ruby
bmurt has joined #ruby
zapata_ is now known as zapata
milardovich has quit [Ping timeout: 258 seconds]
Psybur has quit [Ping timeout: 258 seconds]
Guest70176 has joined #ruby
ElDoggo has quit [Remote host closed the connection]
silvermine has quit [Ping timeout: 258 seconds]
ElDoggo has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElDoggo has quit [Remote host closed the connection]
Guest70176 has quit [Ping timeout: 248 seconds]
ElDoggo has joined #ruby
ElDoggo has quit [Client Quit]
nginxxx has joined #ruby
jameser has joined #ruby
naprimer3 has joined #ruby
<nginxxx> Hey i need help. I have wrote a Ruby Resolver. But I want to expand it with ASN. https://gist.github.com/anonymous/87d279ad01eb2e9bffde31033026ff92
jtdoncas has joined #ruby
<weaksauce> so i installed did_you_mean gem and now nothing works when i type gem or ruby... the did you mean gem errors out
<weaksauce> is there a way to uninstall it manually?
astronav_ has joined #ruby
<miah> gem uninstall did_you_mean
kapil___ has quit [Quit: Connection closed for inactivity]
<weaksauce> yeah, it fails because gem is broken by that
<miah> start there, if it errors, can you paste output somewhere and share it?
<weaksauce> sure
zotruu has joined #ruby
<miah> gist is preferred, link in topic.
zotruu has quit [Client Quit]
Zamyatin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
naprimer2 has quit [Ping timeout: 268 seconds]
jaequery has joined #ruby
astronav_ has quit [Remote host closed the connection]
<weaksauce> Ignoring did_you_mean-0.9.8 because its extensions are not built. Try: gem pristine did_you_mean --version 0.9.8
Technodrome has joined #ruby
<weaksauce> i ran a script to batch update a bunch of gems to pristine because i upgraded to high sierra and did you mean broke ruby and gem
<weaksauce> and a bunch of other ones but that is the one that broke it.
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jtdoncas has quit [Ping timeout: 268 seconds]
David_H__ has quit [Remote host closed the connection]
David_H_Smith has joined #ruby
selim has quit [Ping timeout: 248 seconds]
<RickHull> weaksauce: what do you get for `which gem` ?
<RickHull> you can make sure to execute the correct gem by providing the full path to it
<weaksauce> RickHull /usr/bin/gem
<RickHull> weaksauce: try `/usr/bin/gem env`
<weaksauce> so ruby and gem both have the same exact error
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<weaksauce> RickHull same exact error. gem by itself errors. ruby by itself errors. irb errors. and they are all identical
selim has joined #ruby
<miah> ya, so. your gems are at least in ~/.gem which is safe to remove in its entirety, and thats probably where i'd start
<RickHull> weaksauce: please paste the error
<miah> since you're using system ruby and you updated your system you likely have a bunch of stuff compiled against the old libs
<RickHull> use e.g. gist.github.com
<miah> RickHull: they did, see gist above
<RickHull> doh thx
<weaksauce> i'll try deleting that gem first and then go from there.
<miah> sure
<miah> i use bundler to create .gem directories per project, so i run into similar issues all the time but more localized and with less worry about rm'ing the whole thing and starting fresh =)
<weaksauce> deleting that folder worked.
Guest70176 has joined #ruby
<weaksauce> i use bundler too but for a few system gems that I like to have around
<miah> ya
<miah> in this case it looks like you're using a global .gem directory though
<RickHull> nginxxx: if `Net` is not defined, then probably you need to require the correct libs
<miah> with bundler you can pass --path to create a standalone gem directory
<RickHull> e.g. require 'net/http'
<nginxxx> its fine but have another problem
<nginxxx> Btw
<nginxxx> my resolver works now
<miah> now back to figuring out why my code is fubar :P
<weaksauce> thanks for the help
<nginxxx> But its hard to add ipinfo api :( i dont know how to do... but i am on the right way
<nginxxx> can you look into it and help me to finish it
<RickHull> nginxxx: are you using irb? that is the quickest way to learn, by trial and error
<nginxxx> I get error yes
<nginxxx> But they arent sooo helpful
<RickHull> ha, welcome to the club :)
<nginxxx> Help me to finish it :D
<nginxxx> pls
selim has quit [Ping timeout: 260 seconds]
selim has joined #ruby
<RickHull> L3 does nothing, you can remove it
jtdoncas has joined #ruby
<nginxxx> C:/Users/RBN/Documents/phishing_catcher-master/Resolver.rb:10:in `+': no implici t conversion of nil into String (TypeError)
<nginxxx> What l3?
<RickHull> L3 means "line 3"
<RickHull> (line 3 of the code you pasted)
<nginxxx> No this is not the problem.
<nginxxx> I can resolve ipv4 address
<nginxxx> which is good so
<nginxxx> I need help starting at line with target =
<RickHull> i don't know what your problem is -- I'm just telling you facts about your code :)
<RickHull> step 1: remove meaningless code
Guest70176 has quit [Ping timeout: 248 seconds]
<weaksauce> nginxxx use string interpolation over concatenation to prevent these errors
<nginxxx> C:\Users\RBN\Documents\phishing_catcher-master>Resolver.rb Address: google.com [#<Resolv::IPv4 172.217.17.142>] C:/Users/RBN/Documents/phishing_catcher-master/Resolver.rb:10:in `+': no implici t conversion of nil into String (TypeError) from C:/Users/RBN/Documents/phishing_catcher-master/Resolver.rb:10:in `b lock in <main>' from C:/Ruby24-x64/lib/ruby/2.4.0/resolv.rb:303:in `open' from C:/Users/RBN/Documents/phi
<RickHull> that makes "step 2: fix the problem" easier
<weaksauce> doesn't change the fact that it's nill but it won't kill your running code
<nginxxx> can you show me a example of this string interpolation
<weaksauce> nil*
<weaksauce> puts "hostname #{JSON['hostname']}"
<nginxxx> okay
<nginxxx> but the problem is
<weaksauce> everything inside #{} gets interpolated by the ruby runtime and put into it
<nginxxx> it doesnt know the ip to resolve
<nginxxx> idk
Xiti has quit [Read error: Connection reset by peer]
<nginxxx> ipinfo.io is not a hostname resolver
<nginxxx> but when i have the ipv4 i can resolve the ASN
<nginxxx> you understand :D
jtdoncas has quit [Ping timeout: 260 seconds]
<RickHull> nginxxx: I don't see a need for global variables here
<weaksauce> your formatting could use a bit of work though. the flow of the code doesn't match the indentation
<RickHull> and if there is a need, then you should reconsider the design
<nginxxx> okay
<RickHull> i would make address a local var: `address`
<RickHull> drop L3
<RickHull> and swap L4 and L5
<RickHull> why print it out before it gets a value?
Xiti has joined #ruby
<nginxxx> after i had swap i cant run
Oclair has quit [Quit: Bye Bye]
<RickHull> L6 defines a block. everything inside the block should be indented 2 spaces
<RickHull> e.g. L7 should begin with 2 spaces