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…]
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]
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?
<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
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>
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)
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]
<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..
<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:
<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…]
<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?
<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?
<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
<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.
<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]
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…]
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>
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