kitsunenokenja has quit [Ping timeout: 255 seconds]
mtkd has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
mson has joined #ruby
vikaton has quit [Quit: Connection closed for inactivity]
kitsunenokenja has joined #ruby
techn1cs has quit [Quit: Leaving]
CrazyEddy has quit [Remote host closed the connection]
kitsunenokenja has quit [Ping timeout: 258 seconds]
goyox86 has quit [Quit: goyox86]
cadillac_ has quit [Read error: Connection reset by peer]
leitz has quit [Quit: Nappy time]
gizmore has joined #ruby
CrazyEddy has joined #ruby
oetjenj has joined #ruby
<RickHull>
it looks like this is because calling `bar = val` without a receiver makes bar a local var. this also proves that "no explicit receiver" is not a useful rule. Foo#bar= is still inaccessible from the outside
gizmore|2 has quit [Ping timeout: 248 seconds]
armando has quit [Quit: ZNC 1.7.x-nightly-20171128-66897057 - https://znc.in]
cadillac_ has joined #ruby
milardovich has joined #ruby
<dminuoso>
its still a useful rule.
<dminuoso>
its just a bug.
<dminuoso>
seeing as I cant even launch any lldb session anymore..
<dminuoso>
I cba to debug this since it'd require a hardreboot.
milardovich has quit [Ping timeout: 240 seconds]
<RickHull>
I don't see how it's a useful rule
<RickHull>
why make a class's own methods inaccessible (i.e. when calling via self)?
faces has quit [Read error: Connection reset by peer]
<RickHull>
i think it was done this way because privacy from the outside is achieved
<RickHull>
but privacy on the inside is nonsensical
John____ has quit [Read error: Connection reset by peer]
<RickHull>
furthermore, can this even be fixed? won't `bar = val` be hard / impossible to disambiguate?
CrazyEddy has quit [Remote host closed the connection]
<RickHull>
what does the rule about no `self.bar` achieve for private methods?
<RickHull>
and why can this rule be violated in the case of private writers?
<RickHull>
it seems you fix this by dropping the rule about no `self.bar` on private methods
d^sh has quit [Ping timeout: 255 seconds]
ski7777 has quit [Ping timeout: 268 seconds]
<RickHull>
I truly don't see any upside to this rule
rivalomega has joined #ruby
d^sh has joined #ruby
ski7777 has joined #ruby
<dminuoso>
RickHull: because `privacy` has a different meaning.
<dminuoso>
This is not C++
<RickHull>
what is achieved with the "no explicit receiver" rule? what is useful about this notion of privacy?
rivalomega has quit [Ping timeout: 268 seconds]
<dminuoso>
RickHull: I give you an object foo of my own chosing.
<dminuoso>
Anything that is declared private is inaccessible for you.
vikaton has joined #ruby
<RickHull>
yes -- this is the standard notion of privacy. i can't access private methods "from the outside"
<dminuoso>
Yup.
<dminuoso>
`private` just means `not part of the exposed interface`
<RickHull>
no explicit receiver does provide this -- at the cost of making private methods inaccessible from the inside as well
<RickHull>
we know that private writer methods can violate this rule
<RickHull>
what is the harm?
<dminuoso>
well I guess it does hold true for foo= methods (or it should at leasT)
<RickHull>
if there is no harm to violating a rule, then what use is the rule?
<dminuoso>
RickHull: you cant violate it really
<dminuoso>
unless you pry it open with `send`
<RickHull>
private writer methods can be called with an explicit receiver
<RickHull>
this violates the rule about calling private methods with an explicit receiver
<dminuoso>
Yeah
<dminuoso>
Its called a bug.
<RickHull>
what is the harm in this violation?
<dminuoso>
Dont get so worked up about it =)
<dminuoso>
There is no real harm
<dminuoso>
Its just a bug.
<RickHull>
aha!
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
Or..
<dminuoso>
Perhaps its intended.
<dminuoso>
actrually
<RickHull>
so what is the use of a rule if there is no harm in violating it?
<dminuoso>
Hah
<dminuoso>
No I think it could be intended.
<dminuoso>
Think about it.
<dminuoso>
How would you call a private foo= method?
oetjenj has joined #ruby
<dminuoso>
I mean.. just think about it.
<dminuoso>
:-)
<RickHull>
did you see my gist?
<RickHull>
why are you asking this question?
<dminuoso>
Everything is fine.
oetjenj has quit [Client Quit]
<dminuoso>
RickHull: Look the point is about `public interface`
<dminuoso>
if you have the class open, there's no notion of `privacy` really
oetjenj has joined #ruby
<dminuoso>
as long as .bar= is protected from the outside, all is good.
<RickHull>
yes, thank you
<RickHull>
so the "no explicit receiver" does far too much
oetjenj has quit [Client Quit]
<RickHull>
and of course it's problematic for private writer methods
<dminuoso>
so this feels like an intended hack to make private assign methods available in the ruby model
oetjenj has joined #ruby
<dminuoso>
so its "no explicit receiver, unless its a writer method and you're inside .. [insert some smart remark about scopes and stuff]"
oetjenj has quit [Client Quit]
<RickHull>
which really means the rule about "no explicit receiver" isn't useful
<dminuoso>
its fine.
<dminuoso>
it fits 99% of all cases.
<RickHull>
private writer methods are inaccessible from the outside, without that rule
<dminuoso>
they still are.
<RickHull>
so why shouldn't all private methods be consistent?
<dminuoso>
you cant access a private assign method from the outside.
<dminuoso>
RickHull: Because you wouldnt be able to call a private bar= method.
<dminuoso>
Without changing the semantics of the language.
cadillac_ has quit [Quit: I quit]
<RickHull>
the only thing that matters for privacy is what happens from the outside
<dminuoso>
And that is perfectly preserved.
<RickHull>
within the class, there should be no notion of privacy
<dminuoso>
From outside the rule holds.
<dminuoso>
RickHull: really?
<dminuoso>
what about modules?
<dminuoso>
what about ancestors?
armando has joined #ruby
<dminuoso>
what about singleton classes?
armando has quit [Remote host closed the connection]
<RickHull>
what I mean is: within the class, what is gained by disallowing self.bar?
<RickHull>
we clearly have costs -- but no benefit
Xiti` has joined #ruby
<dminuoso>
RickHull: Im guessing its easier to just speficy it in terms of `receiver` because ruby is weird.
Xiti` has quit [Read error: Connection reset by peer]
<dminuoso>
Just look at the source code
<dminuoso>
and you will understand why
<dminuoso>
let me find a good example
<RickHull>
it doesn't have to be weird
<RickHull>
and it causes all kinds of hacks and inconsistencies
meesles has joined #ruby
<RickHull>
but yes, I think this was done "for convenience"
Xiti has quit [Ping timeout: 240 seconds]
<RickHull>
"no explicit receiver" does provide the standard notion of privacy, but it brings along a whole associated set of behaviors and implications that aren't desirable
faces has joined #ruby
<RickHull>
and as we see with private writer methods, you can still have an explicit receiver and standard privacy
<dminuoso>
in the middle of thousands of lines of undocumented code
<RickHull>
so again, I am still curious what the value of the "no explicit receiver" rule is. I am guessing there is no value and it's just "convenient"
<dminuoso>
you get these kinds of comments.
ur5us has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xiti has joined #ruby
ur5us has quit [Ping timeout: 248 seconds]
chocoelho has joined #ruby
alfiemax has joined #ruby
<RickHull>
i thought bar=(val) would be able to find the private method, but nope, still a local var
goyox86 has joined #ruby
armando has joined #ruby
cschneid_ has joined #ruby
<RickHull>
this touches on a related matter I disagree with Ruby on -- I think methods should *always* have an explicit receiver :)
<RickHull>
the ambiguity between local vars and method calls is a misfeature IMHO
alfiemax has quit [Ping timeout: 248 seconds]
<RickHull>
nearly all of my code is written this way, with explicit self receivers inside classes. but I don't use private methods very much *wink*
<RickHull>
it looks like protected methods will work for me, though
char_var[buffer] has joined #ruby
char_var[buffer] has quit [Remote host closed the connection]
<dminuoso>
04:19 RickHull | this touches on a related matter I disagree with Ruby on -- I think methods should *always* have an explicit receiver :)
<dminuoso>
heck no.
cschneid_ has quit [Ping timeout: 248 seconds]
armando has quit [Quit: ZNC 1.7.x-nightly-20171128-66897057 - https://znc.in]
char_var[buffer] has joined #ruby
<RickHull>
it makes your fingers hurt? or your eyes? or?
drowze has joined #ruby
fury has quit [Quit: Connection closed for inactivity]
goyox86 has quit [Quit: goyox86]
chocoelho has quit [Quit: chocoelho]
elphe has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
UserOO7 has joined #ruby
UserOO7 has quit [Client Quit]
jenrzzz has quit [Ping timeout: 268 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
UserOO7 has joined #ruby
ozcanesen has joined #ruby
ozcanesen has left #ruby [#ruby]
exhiled has joined #ruby
armando has joined #ruby
AJA4350 has quit [Quit: AJA4350]
UserOO7 has quit [Remote host closed the connection]
UserOO7 has joined #ruby
goyox86 has joined #ruby
milardovich has joined #ruby
Xiti has quit [Quit: Xiti]
elphe has joined #ruby
aupadhye has joined #ruby
shinnya has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
bkxd has joined #ruby
goyox86 has quit [Quit: goyox86]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has quit [Quit: Leaving]
exhiled has joined #ruby
ledestin has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
armando has quit [Quit: ZNC 1.7.x-nightly-20171128-66897057 - https://znc.in]
jenrzzz has quit [Ping timeout: 240 seconds]
Xiti has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
apparition has joined #ruby
mtkd has joined #ruby
hndk has quit [Quit: Leaving]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
faces has quit [Read error: Connection reset by peer]
zenspider has joined #ruby
exhiled has joined #ruby
zenspider has quit [Changing host]
zenspider has joined #ruby
armando has joined #ruby
milardovich has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
UserOO7 has quit [Remote host closed the connection]
UserOO7 has joined #ruby
<zenspider>
RickHull: I FINALLY got around to reviewing your PR for MT/B... I think it might be a failure in test, but my brain is fuzzy
UserOO7 has quit [Remote host closed the connection]
UserOO7 has joined #ruby
<RickHull>
Hopefully someone with a solid statistics background can chime in. But the crux for me is that the linear r2 is a relative measure, against a baseline of "constant behavior" or "the mean"
<RickHull>
i think it's more useful in a truly scattered plot
<RickHull>
sorry, there are 2 issues -- one is that linear r2 is low / zero for constant data -- not a big deal
<RickHull>
the other is that linear r2 is high for x^2 and x^3 data
<RickHull>
i think, with the current approach, assert_linear should try all fits and only pass the assertion if the best r2 is the linear one
<RickHull>
separately, i think a slightly different approach to the analysis is warranted. with x as the independent variable (aka N in big-O notation) and y as the dependent variable
milardovich has quit [Remote host closed the connection]
<RickHull>
as x goes up, we expect y to go up
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 248 seconds]
milardovich has joined #ruby
<RickHull>
possibly "constant" -- but it would never go down
exhiled has joined #ruby
cschneid_ has joined #ruby
bkxd has joined #ruby
<RickHull>
we should be able to look at the slopes between each pair of points
<RickHull>
and detect that y=x^2 and y=x^3 are nonlinear
dviola has quit [Quit: WeeChat 2.0]
<RickHull>
the linear fit r^2 does this -- but fails to reject because the r^2 is high
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<RickHull>
i believe the linear r^2 is high for y=x^3 because the linear predictor is nonetheless much better than the y=x_bar predictor
<RickHull>
for asserting linear performance, we care about linear vs exponential, not linear vs constant
<RickHull>
i need to write the test that shows "best fit" rejects linear in favor of exponential for y=x^2 or y=x^3
<zenspider>
dude... too many words
<RickHull>
which ones? ;)
<zenspider>
RickHull: wrt the 2 issues: can you actually prove it, preferably in a failing test? The tests you submitted in that PR are NOT linear data, and the tests had errors in them (eg x2 couldn't pass, as written)
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
I didn't want to do a best_fit assertion because I want the test to specifically say what the performance curve SHOULD be
<RickHull>
to be clear: assert_linear would run each fit and only pass if the best fit is in fact linear
<zenspider>
I don't think I'm coming across clearly
<zenspider>
Once test code errors are fixed... x^2 and x^3 fail just fine if given a linear domain. When given an exponential domain, they don't. This is expected and normal behavior
bkxd has quit [Ping timeout: 240 seconds]
<RickHull>
ok, let me review. my understanding is that my tests show assert_linear fails to reject x^2 and x^3
<zenspider>
let's work on understanding THOSE... because that math seems right to me...
milardovich has joined #ruby
<RickHull>
ok -- I'm going over your comments now
<zenspider>
Once we're on the same page for those two sets (exponential domain vs linear domain)... then we can talk about minitest (which calculates almost the exact same values as wolfram)
<RickHull>
I agree that the high r^2 is probably related to a small amount of data points
<zenspider>
plain r^2, not adjusted... I don't know enough stats to do adjusted, or to know if it'd help
<zenspider>
I think you're just not visualizing the space between the X values... you're making those as non-linear as the Y values, so they're actually a linear fit.
<zenspider>
sorry... s/just //
<zenspider>
I hate that word. sorry.
<RickHull>
I see what you're saying -- but I don't think it's quite right. also the range/domain terminology confuses me
<RickHull>
I know xs and ys, or independent/dependent
<zenspider>
OOPS. sorry. domain is xs, range is ys
<RickHull>
i know range/domain is standard but it's just something I never got used to using
<RickHull>
my xs are exponential. yes. isn't this analogous to the default bench_range ?
<RickHull>
that is, do something X number of times. do it once and time it. then 10x and time it
<RickHull>
then 100, then 1000. we could step through each X but it would take a lot longer
<RickHull>
if my Ys were linear -- say y = 2x
<RickHull>
(1, 2) (100, 200) (1000, 2000)
<RickHull>
so it shouldn't matter about gaps in the Xs
<zenspider>
I'll come up with visuals... sec
nf7 has joined #ruby
<RickHull>
you can feed those 3 data points and get a perfect linear correlation
<zenspider>
there's your Ys, with both your exponential Xs and my linear Xs
ur5us has joined #ruby
<zenspider>
does that graphic shed light on the R2? for you?
<RickHull>
Table 1 is problematic -- right? the data are clearly nonlinear
<RickHull>
I agree the r^2 is high -- and this is why it's a problem for asserting linear behavior
<zenspider>
non linear, but given the domain, fits closely to a linear fit...
UserOO7 has quit [Remote host closed the connection]
<RickHull>
the slope is increasing wildly
<zenspider>
no, this is why it is important to visualize your data because sometimes your experiment isn't set up well enough.
<zenspider>
no, the slope is NOT increasing wildly... it's actually very slowly increasing
<RickHull>
we know the data is literally y=x^2
<zenspider>
(the CHANGE in slope)
<RickHull>
that's like asserting O(N) behavior when you really have O(N^2)
<RickHull>
in Table 1, the slope between the first pair of points is 10
<zenspider>
because the CHANGE in slope is not increasing much, it fits to a linear slope. Compared to the linear Xs, where the CHANGE in slope is absurd, so it only fits to 60.8%.
ur5us has quit [Ping timeout: 248 seconds]
mtkd has quit [Read error: Connection reset by peer]
<RickHull>
er, the first slope is 11 I guess. 99 / 9
mtkd has joined #ruby
<RickHull>
the next slope is 9900 / 90
<zenspider>
both slopes are given in the formula
<zenspider>
1027 vs 300990... but that value doesn't matter, what matters is how the formula fits the data
<RickHull>
the slope gets 10x steeper between every pair of points
<RickHull>
just looking at table 1
<RickHull>
it's around 10, then around 100, then the final slope between the last pair of points is around 1000
<RickHull>
we can't accept an analysis that says "yup, that's linear"
<zenspider>
who's WE?
<zenspider>
you... mathmatica, apple numbers, and mathematica all agree that it fits to 99%
<zenspider>
(and me)
<RickHull>
I totally agree the r^2 is correctly calculated
<RickHull>
it's over 0.99
<zenspider>
kk. then we're on the same page there... where are we diverging, if you can point to it?
<RickHull>
it's the wrong test though
<RickHull>
we know the data are nonlinear
<RickHull>
so a test that says yup, it's linear is wrong
<RickHull>
the r^2 doesn't distinguish between y=mx and y=x^2 very well
<RickHull>
it was designed to distinguish a linear "pattern" from a scatter plot
<RickHull>
that is a cloud of points. where the r^2 is high, it's saying there is a relationship between x and y, not random
<zenspider>
I wish I could find that really awesome example of a perfect R^2, but when you visualize it, the plot is a perfect circle (therefore no fit at all)
<zenspider>
nope. man... I'm gonna have to disagree with you there.
<zenspider>
If you say assert_linear and you give it data that fits to 99%, then it fits to linear.
<zenspider>
this is the case of setting up a bad experiment
<RickHull>
the linear r^2 is measuring the error relative to x_bar predictor
<zenspider>
I do NOT agree that this is a failure in assert_<whatever>.
<RickHull>
in statistics, it helps distinguish a relationship from "no relationship"
<RickHull>
but we care about distinguishing linear from exponential
<RickHull>
if my simple example with y=x^3 fails to reject, then who knows what other real world data is failing to reject
goyox86 has joined #ruby
<zenspider>
if you care about distinguishing linear from exponential, then you need to set up yor experiment correctly (I view benchmark tests as scientific experiments more than straight up assertions in tests). You are positing a theory that something fits linearly. The data you give it DOES fit linearly. Therefore your experiment is a success. But you chose poorly for your input data. Visualizing that shows that and helps to easily corrects the
<zenspider>
experiment.
<zenspider>
This is also why benchmarks output a table of numbers in tab delimited format, so you can paste into a spreadsheet
<RickHull>
i think that part of the reporting isn't working quite right, or not for me anyway
bkxd has quit [Ping timeout: 248 seconds]
cschneid_ has quit [Remote host closed the connection]
<RickHull>
but shelve that for now :)
<zenspider>
the output?
<RickHull>
yeah, IIRC it just dumps the Ys not the Xs
<RickHull>
or maybe the other way around -- I'll take another look later
<zenspider>
ah. that might be true. Lemme poke
shinnya has quit [Ping timeout: 260 seconds]
<zenspider>
totally true. I'll fix that
<RickHull>
in the realm of CS, asserting linear perf is -- in my eyes -- asserting O(N)
<RickHull>
and anyone talking about O(N) cares greatly about distinguishing from O(N^2)
<RickHull>
so a statistical test that fails to reject O(N^2) data is maybe the wrong tool
<RickHull>
I've laid out the reasons why I believe the linear r^2 is bad for distinguishing against "higher order" relationships
<RickHull>
(if that is the right term)
rivalomega has joined #ruby
<RickHull>
it's good at distinguishing from "no relationship"
cschneid_ has joined #ruby
<RickHull>
i still think it can be salvaged -- just by running the exponential r^2 and making sure it's not higher
alfiemax has joined #ruby
yeticry_ has quit [Ping timeout: 248 seconds]
<zenspider>
That "S" in CS implies that we do science (experiments)... that includes crafting good experiments. Not sure which "it" you're referring to in "it can be salvaged".
<RickHull>
the use of linear r^2
<RickHull>
in asserting linear perf
<zenspider>
I need a test against the benchmark tests to fix the domain row not printing... but I have the fix in place already
workmad3 has joined #ruby
<RickHull>
if there is an order: random / constant -> logarithmic -> linear -> exponential -> power
<RickHull>
the linear r^2 just says hey: I'm not random / constant
<zenspider>
*sigh*... I think we're going to have to agree to disagree.
<zenspider>
I believe your test is simply bad. Just like any experiment that fails to pick good data and doesn't visualize it to see that the data was poorly picked.
<zenspider>
you have a high R^2, because you created a high R^2.
<zenspider>
and the code is working properly... and the experiment is passing because that's how it was structured.
<RickHull>
the data are literally xs = [1, 10, 100, 1000] and ys = xs.map { |x| x**3 }
<RickHull>
that's a classic case that assert_linear should reject
<zenspider>
Yes, it is. and that fits to a linear model quite well.
<RickHull>
even if the linear r^2 is high
<zenspider>
as shown, graphically, and mathematically
goyox86 has quit [Quit: goyox86]
<zenspider>
assert_linear should NOT reject it, if that's the domain you picked
exhiled has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
<RickHull>
I guess we'll have to agree to disagree. in CS we care about distinguishing linear from the higher order relationships. the statistical r^2 distinguishes from lower order relationships
exhiled has quit [Client Quit]
<RickHull>
it's just not good for detecting x^3
<RickHull>
but that's what we care about -- detecting O(N^3)
<RickHull>
the example is contrived -- but illustrative. it's a classic test case that we would not want our O(N) verifier to accept
sriehl has joined #ruby
sriehl has quit [Changing host]
sriehl has joined #ruby
<zenspider>
OK... let's say this: You say: "it's just not good for detecting x^3"... that is NOT WHAT fit_linear does. if you want to detect x^3, then set up your experiment for it and use fit_exponential. If you want to detect linear, use fit_linear. In BOTH CASES, you *must* set up your experiment correctly or GIGO
charliesome has joined #ruby
<RickHull>
well.. I don't know what my data is... I expect it it to be linear, so I assert_linear
<RickHull>
and it says yup, it's linear
<RickHull>
and only later do I go back to find my data is y=x^3
bkxd has joined #ruby
<zenspider>
no... it says "yup, it fits linear to the degree you accept for this experiment"
<RickHull>
that's another problem -- deciding up front what the r^2 threshold should be
<RickHull>
this is why I think it's much more robust to run all fits and remember the best
<RickHull>
and assert_linear only succeeds if best=linear
<zenspider>
not sure I agree with you there.
<zenspider>
that means you're saying "the shape of this shouldn't change with time" rather than saying "this should be X"
<zenspider>
and that's just too wishywashy for me
<RickHull>
no -- i'm definitely saying it should be X
<RickHull>
it should be linear
<RickHull>
and if exponential fits it better, then fail
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
<zenspider>
what you said above "I think it's much more robust to run all fits and remember the best" is "it should be X, but I don't care what X is, as long as it stays X". If it is linear initially, great... if exponential, that's great too. as long as it stays the same
<RickHull>
sorry -- I don't mean remember the best between bench runs
<zenspider>
ah. ok. gotcha
<RickHull>
I mean that my bench code has: assert_linear
SuperLag has quit [Quit: leaving]
<RickHull>
and assert_linear goes and runs all the fits
<RickHull>
and it fails if the best fit is not linear
hanmac has joined #ruby
uZiel has joined #ruby
<RickHull>
this should be much more robust for the x^3 problem and it sidesteps the need to decide an r^2 threshold
<RickHull>
and you can still keep the r^2 threshold as an additional check
<RickHull>
so even if best fit is linear but 0.65 r^2, you can fail assert_linear
<zenspider>
at that point... blech
<zenspider>
:)
<RickHull>
i want my assertions to fail :)
<zenspider>
I see that. I want you to set up good experiments. :P
<RickHull>
I got to this point by assert_linear passing on nonlinear data
<RickHull>
so...
<zenspider>
I think this definitely points to a doco failure for sure.
<zenspider>
but I'm more convinced that the math is working as intended, but it is too easy to set up bad experiments and have them pass. Not sure the best way to address that atm
<RickHull>
yes, the math is correct
<RickHull>
but I think the application of the math is flawed
<RickHull>
since we care about distinguishing linear from higher order, we should make sure that higher order fits don't fit better
<RickHull>
the linear fit on its own only distinguishes from lower order
<zenspider>
agreed.... but that's where I stop, and you think assert_X should do something about it.
<zenspider>
(agreed = application of math line)
<zenspider>
I don't know this higher order vs lower order you keep using.
<RickHull>
i think it's the wrong terminology
<RickHull>
but here's the order: random / constant -> logarithmic -> linear -> exponential -> power
<RickHull>
or maybe exponential is "steeper" than power?
<RickHull>
corresponds to O(1) O(log n) O(N) O(N^2) O(2^N)
<zenspider>
it is. I think I keep saying exponential when I mean geometric / power
<RickHull>
we'd like to maybe have O(N log N) but anyway... :)
<RickHull>
the linear r^2 calculates the relative error between a linear predictor and a constant predictor (y_bar)
<RickHull>
y_bar meaning the mean of the ys
elphe has quit [Ping timeout: 240 seconds]
<RickHull>
so it's good at distinguishing the lower order from linear
goyox86 has quit [Quit: goyox86]
<RickHull>
but not good at distinguishing the higher order from linear
<RickHull>
the error from the constant predictor (y_bar) is huge in the case of y=x^3
<RickHull>
and so it swamps the (still considerable!) error from the y=mx+b predictor
<RickHull>
the last two lines are just my understanding after looking into this -- I'd love to hear from an expert
<RickHull>
with more data points, or different X gaps, the linear r^2 probably goes down
<RickHull>
but I bet I could come up with 20 examples of at least 4 data points that linear r^2 will fail to reject
<RickHull>
where it's obvious the relationship is not linear -- it's a higher order relationship
<RickHull>
but linear r^2 just doesn't look at it that way
<RickHull>
assert_linear should be more about rejecting higher order relationships
Rob has joined #ruby
Rob is now known as Guest59039
<Guest59039>
Anybody home that would be willing to help run through a quick coding issue?
exhiled has joined #ruby
apparition has joined #ruby
faces has joined #ruby
<Guest59039>
in the situation below, what would be the proper way to phrase the if then statement?
goepsilongo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Guest59039>
I need to be able to assign the collections.mens-apparel as a general reference to whatever link.title may be
<Guest59039>
link.title can either be a collections.title or a page.title
keyjoo_ has joined #ruby
MrBismuth has quit [Read error: Connection reset by peer]
<RickHull>
eh -- I don't think this is ruby
<Guest59039>
I just generally need link title to be placed in front of collections on the assign function
MrBismuth has joined #ruby
<Guest59039>
Shopify uses liquid files which use ruby and css
<RickHull>
no clue, sorry. I've never used `for` in ruby
apparition has quit [Quit: Bye]
<Guest59039>
Using if instead of for is not an issue
<RickHull>
it is in ruby
<Guest59039>
I can use {% if %} {% assign %}
<RickHull>
dunno, I don't have time to learn a new language and explain it to you
<Guest59039>
Sighz, sorry. Didn't know that it would be that far of a stretch from ruby, seeing as, having done some basic work in ruby, it functions pretty much the same
<Guest59039>
Thanks for your time though.
Guest59039 has quit [Quit: Page closed]
<RickHull>
sorry I couldn't be more helpful -- good luck :)
vikaton has quit [Quit: Connection closed for inactivity]
Technodrome has joined #ruby
bkxd_ has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
07IAB5HXJ has joined #ruby
bkxd_ has quit [Ping timeout: 248 seconds]
bkxd has joined #ruby
elphe has quit [Ping timeout: 260 seconds]
07IAB5HXJ has quit [Quit: 07IAB5HXJ]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Remote host closed the connection]
CrazyEddy has quit [Remote host closed the connection]
cschneid_ has joined #ruby
yeticry has joined #ruby
<mozzarella>
KrzaQ: why? does it do anything special?
cdg has joined #ruby
<KrzaQ>
doesn't break pretty function chains
<mozzarella>
give me an example where it breaks a chain
alfiemax has joined #ruby
milardovich has quit []
bkxd has joined #ruby
CrazyEddy has joined #ruby
cdg_ has joined #ruby
cschneid_ has quit [Ping timeout: 268 seconds]
cdg has quit [Ping timeout: 240 seconds]
<KrzaQ>
Array multiplication was my use case. ([a,b,c].chain.chain.chain * 10).chain.chain.chain vs [a,b,c].chain.chain.chainonly.map{*64}.first.chain.chain.chain
elphe has joined #ruby
<KrzaQ>
missed a dot there, but I think it's readable anyway
alfiemax has quit [Ping timeout: 268 seconds]
cdg_ has quit [Ping timeout: 258 seconds]
cschneid_ has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 240 seconds]
<RickHull>
I still don't get what `only` does
cschneid_ has quit [Ping timeout: 248 seconds]
<RickHull>
it looks like something specific to D's version of ranges and avoiding memory allocation
<RickHull>
but uh, have you considered Range#to_a ?
<KrzaQ>
I just wondered whether I'm duplicating existing functionality
<KrzaQ>
RickHull: the way you said it implies that there are kinds of objects that already have .wrap_in_enumerable functionality. Have I misunderstood it?
<RickHull>
not that I'm aware of
<KrzaQ>
ok
<KrzaQ>
thanks
bkxd has quit [Ping timeout: 248 seconds]
<KrzaQ>
Now my aoc solution is a straight line of chains :)
<RickHull>
in general, in Ruby, you wrap something in an array by wrapping it in square brackets ;)
bkxd has joined #ruby
<KrzaQ>
but that breaks pretty chains
<RickHull>
that's the cost of having a distinction between a method receiver and its first arg
workmad3 has quit [Ping timeout: 248 seconds]
<RickHull>
e.g. why `puts 'this'` and not `'this'.puts`
<KrzaQ>
yeah
<KrzaQ>
I'm a fan of how D handles this
<RickHull>
for pretty chains, I like Elixir's |>
rippa has joined #ruby
CrazyEddy has joined #ruby
CrazyEddy has quit [Changing host]
CrazyEddy has joined #ruby
cdg has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
elphe has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 240 seconds]
goyox86 has joined #ruby
cdg has joined #ruby
vee__ has quit [Ping timeout: 255 seconds]
cdg_ has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
Mia has quit [Read error: Connection reset by peer]
al2o3-cr has joined #ruby
cdg_ has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
yeticry has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 255 seconds]
elphe has joined #ruby
cschneid_ has joined #ruby
guardianx has joined #ruby
vee__ has joined #ruby
dionysus69 has joined #ruby
goyox86 has quit [Quit: goyox86]
yeticry has joined #ruby
guardianx has quit [Ping timeout: 248 seconds]
gizmore has quit [Read error: Connection reset by peer]
<baweaver>
Not sure how I'd get it to respect that though
<baweaver>
Thought about a fluent hash syntax some time ago: Model.with(limit: {if: params[:limit]})
<baweaver>
though that can be ugly
dviola has joined #ruby
* baweaver
needs to play more
Asher has quit [Ping timeout: 248 seconds]
miskatonic has joined #ruby
apparition has joined #ruby
oetjenj has joined #ruby
marr has joined #ruby
workmad3 has joined #ruby
mjolnird has joined #ruby
ur5us has quit [Remote host closed the connection]
bkxd_ has joined #ruby
uZiel has quit [Remote host closed the connection]
clemens3 has joined #ruby
ldepandis has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
guille-moe has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
ur5us has quit [Ping timeout: 248 seconds]
mikecmpbll has joined #ruby
bkxd_ has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
dviola has quit [Quit: WeeChat 2.0]
DoubleMalt has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
DoubleMalt has quit [Client Quit]
sagax has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
uZiel has joined #ruby
mtkd has quit [Read error: Connection reset by peer]
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
aurelien has joined #ruby
JustASlacker has joined #ruby
keyjoo_ has quit [Read error: Connection reset by peer]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iamarun has joined #ruby
KeyJoo has joined #ruby
KeyJoo has quit [Remote host closed the connection]
guille-moe has quit [Ping timeout: 240 seconds]
astronavt has quit [Ping timeout: 255 seconds]
KeyJoo has joined #ruby
apparition has joined #ruby
enterprisey has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 240 seconds]
iamarun has quit [Remote host closed the connection]
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
bkxd_ has joined #ruby
guille-moe has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
nofxx__ has quit [Remote host closed the connection]
spectrum has quit [Ping timeout: 248 seconds]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
oetjenj has quit [Client Quit]
oetjenj has joined #ruby
hfp_work has quit [Quit: bye]
oetjenj has quit [Client Quit]
nadir has quit [Quit: Connection closed for inactivity]
al2o3-cr has quit [Ping timeout: 240 seconds]
hfp_work has joined #ruby
Technodrome has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
shinnya has quit [Ping timeout: 248 seconds]
exhiled has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
ski7777 has quit [Ping timeout: 248 seconds]
bkxd_ has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
al2o3-cr has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has quit [Ping timeout: 248 seconds]
Technodrome has joined #ruby
ski7777 has joined #ruby
alfiemax has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
oetjenj has joined #ruby
<TomyLobo>
with pry, is there a way to execute a .rb file either inside the pry environment or at least with the same binding?
<Papierkorb>
TomyLobo: just `load "foo.rb"` it
bkxd_ has joined #ruby
<TomyLobo>
Papierkorb, and that ensures that i can access the same locals pry can?
<Papierkorb>
If you want it to run within the same binding too, you can try`binding.eval File.read("foo.rb")`, but that may or may not do what you expect
<Papierkorb>
try it
GodFather has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
<TomyLobo>
works :)
<TomyLobo>
the binding thing
<TomyLobo>
thanks
mikecmpbll has joined #ruby
DTZUZO has joined #ruby
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
bkxd_ has quit []
despai has joined #ruby
nicoulaj has quit [Quit: quit]
enterprisey has joined #ruby
nicoulaj has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has quit [Ping timeout: 248 seconds]
vichib has quit [Ping timeout: 255 seconds]
yeticry has quit [Ping timeout: 248 seconds]
yeticry has joined #ruby
Technodrome has joined #ruby
mtkd has quit [Ping timeout: 246 seconds]
mtkd has joined #ruby
selim has quit [Ping timeout: 240 seconds]
selim has joined #ruby
shinnya has joined #ruby
csk157 has joined #ruby
jnyw has quit [Quit: WeeChat 2.0]
miskatonic has quit [Remote host closed the connection]
AJA4350 has joined #ruby
yeticry has quit [Ping timeout: 260 seconds]
yeticry has joined #ruby
guardianx has joined #ruby
csk157 has quit [Ping timeout: 248 seconds]
guille-moe has quit [Ping timeout: 248 seconds]
yeticry has quit [Ping timeout: 240 seconds]
yeticry has joined #ruby
kitsunenokenja has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yeticry has quit [Ping timeout: 255 seconds]
cpruitt has joined #ruby
yeticry has joined #ruby
workmad3 has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
cpruitt has quit [Client Quit]
yeticry has quit [Ping timeout: 248 seconds]
workmad3 has quit [Ping timeout: 255 seconds]
yeticry has joined #ruby
ur5us has joined #ruby
alfiemax has quit [Remote host closed the connection]
JustASlacker has quit [Ping timeout: 240 seconds]
guardianx has quit []
Asher has joined #ruby
c0ncealed has quit [Remote host closed the connection]
c0ncealed has joined #ruby
ur5us has quit [Ping timeout: 248 seconds]
Technodrome has joined #ruby
despai has quit [Quit: ...]
yeticry has quit [Ping timeout: 268 seconds]
goepsilongo has joined #ruby
yeticry has joined #ruby
benjen has quit [Ping timeout: 240 seconds]
benjen has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
UserOO7 has joined #ruby
UserOO7 has quit [Remote host closed the connection]
pifon has quit [Quit: Connection closed for inactivity]
DTZUZO has quit [Ping timeout: 248 seconds]
UserOO7_ has quit [Remote host closed the connection]
UserOO7 has joined #ruby
UserOO7 has quit [Remote host closed the connection]
jottr has joined #ruby
UserOO7 has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
minimalism has quit [Quit: minimalism]
UserOO7_ has joined #ruby
UserOO7 has quit [Ping timeout: 268 seconds]
drowze has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 276 seconds]
kitsunenokenja has left #ruby ["WeeChat 1.9.1"]
quobo has quit [Quit: Connection closed for inactivity]
UserOO7_ has quit [Remote host closed the connection]
vtx has joined #ruby
UserOO7 has joined #ruby
uZiel has quit [Remote host closed the connection]
uZiel has joined #ruby
workmad3 has joined #ruby
JaccoP has joined #ruby
<vtx>
hi guys. i have a configure block in my sinatra app that looks like: https://gist.github.com/anonymous/3425b88a733e84b004d03a9921a43beb so, i want to instantiate services once at startup, and then set the db on my settings. so that, every time i try to use the db, only one connection is ever created, and that connection is used by all requests. however, calling settings.db seems to call into services.db every time i try to use settings.db, which means a ne
<vtx>
connection is created for every request. how can i force settings.db to not reference the db via services?
guille-moe has quit [Ping timeout: 260 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
ur5us has joined #ruby
despai has joined #ruby
JustASlacker has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
JustASlacker has quit [Client Quit]
JustASlacker has joined #ruby
nadir has joined #ruby
pwnd_nsfw` has joined #ruby
pwnd_nsfw has quit [Ping timeout: 268 seconds]
alfiemax has quit [Remote host closed the connection]
MrSparkle has quit [Read error: Connection reset by peer]
<vtx>
guys does anyone here use mongo with ruby? my application keeps creating connections to the database instead of reusing the same connection
mtkd has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
MrSparkle has joined #ruby
mtkd has joined #ruby
vtx has quit [Quit: vtx]
UserOO7_ has joined #ruby
goepsilongo has quit [Ping timeout: 240 seconds]
def_jam has joined #ruby
eb0t has joined #ruby
mjolnird has quit [Remote host closed the connection]
eblip has quit [Ping timeout: 255 seconds]
eb0t_ has quit [Ping timeout: 240 seconds]
UserOO7 has quit [Ping timeout: 248 seconds]
despai has quit [Quit: ...]
UserOO7_ has quit [Remote host closed the connection]
elphe has joined #ruby
UserOO7 has joined #ruby
UserOO7 has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 248 seconds]
alex`` has quit [Quit: WeeChat 1.9.1]
TinkerTyper has quit [Read error: Connection reset by peer]
TinkerTyper has joined #ruby
DLSteve has joined #ruby
kapil___ has joined #ruby
dinfuehr has quit [Ping timeout: 255 seconds]
dinfuehr has joined #ruby
ledestin has joined #ruby
despai has joined #ruby
UserOO7 has joined #ruby
tomphp has joined #ruby
UserOO7 has quit [Remote host closed the connection]
UserOO7 has joined #ruby
aloy has quit [Remote host closed the connection]
aloy has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has quit [Read error: Connection reset by peer]
claudiuinberlin has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has quit [Client Quit]
CrazyEddy has quit [Remote host closed the connection]
tomphp has joined #ruby
<havenwood>
KramerC: In Ruby 2.5 you'll be able to use #yield_self like: 42.yield_self { |n| [n] }
<havenwood>
#=> [42]
<havenwood>
oops, MT
<havenwood>
KrzaQ: ^
<KrzaQ>
yeah, I linked an article about it later
<KrzaQ>
yield_self is exactly what I want, because right now I have .to_array.map{...}.first
alex`` has joined #ruby
alex`` is now known as alexherbo2
CrazyEddy has joined #ruby
alexherbo2 is now known as alex``
workmad3 has joined #ruby
Dimik has joined #ruby
dviola has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
ur5us has joined #ruby
anisha has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
rivalomega has joined #ruby
rivalomega has quit [Read error: Connection reset by peer]
rivalomega has joined #ruby
Scrooge is now known as Rudolph
ur5us has quit [Ping timeout: 240 seconds]
anisha has quit [Ping timeout: 268 seconds]
anisha has joined #ruby
CrazyEddy has joined #ruby
cdg has joined #ruby
guille-moe has joined #ruby
leah2 has quit [Ping timeout: 250 seconds]
anisha has quit [Quit: This computer has gone to sleep]
orbyt_ has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
pifon has joined #ruby
leah2 has joined #ruby
CrazyEddy has joined #ruby
techn1cs has joined #ruby
techn1cs has quit [Changing host]
techn1cs has joined #ruby
techn1cs has quit [Remote host closed the connection]
mostlybadfly has joined #ruby
UserOO7 has quit [Ping timeout: 250 seconds]
mtkd has quit [Ping timeout: 268 seconds]
mtkd has joined #ruby
csk157 has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
despai has quit [Quit: ...]
CrazyEddy has quit [Remote host closed the connection]
konsolebox has quit [Ping timeout: 255 seconds]
Technodrome has joined #ruby
CrazyEddy has joined #ruby
konsolebox has joined #ruby
AJA4350 has quit [Quit: AJA4350]
miskatonic has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
despai has joined #ruby
yeticry has quit [Ping timeout: 248 seconds]
conta has joined #ruby
enterprisey has joined #ruby
rivalomega has quit [Remote host closed the connection]
rivalomega has joined #ruby
CrazyEddy has joined #ruby
guille-moe has quit [Ping timeout: 240 seconds]
yeticry has joined #ruby
claudiuinberlin has joined #ruby
cschneid_ has quit [Remote host closed the connection]
rivalomega has quit [Ping timeout: 246 seconds]
claudiuinberlin has quit [Client Quit]
cschneid_ has joined #ruby
vtx has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
<vtx>
guys does anyone here use mongo with ruby? my application keeps creating connections to the database instead of reusing the same connection
<RickHull>
vtx: can you point to the sinatra docs that cover this? (configure blocks)
yeticry has joined #ruby
<RickHull>
is API::Services your class/module?
<RickHull>
or Sinatras? or Mongos?
<vtx>
RickHull: sorry, that’s my class
<RickHull>
you mention settings.db but I dont see it in the gist
<vtx>
so, i have API::Services as a class that contains all the code for parsing my env config, and setting up the necessary resources like loggers and in this case, a db connection
<RickHull>
can you paste the relevant sections?
<vtx>
RickHull: um okay, i’ve spent some trying moving stuff around, but it’s still not working, so i guess i’ll paste it anyway
<RickHull>
what class is the actual connection? is it a Mongo class?
<RickHull>
my gut says you are doing too much configuration stuff -- abstraction rather than working directly
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<vtx>
i’ve moved all the stuff around setting the db on the application into config.ru, so it’s completely removed from the api endpoints
PaulCapestany has quit [Read error: Connection reset by peer]
<vtx>
RickHull: i’m basing this off http://recipes.sinatrarb.com/p/databases/mongo which talks about using set to set a property on the application, which then can be access via settings
<RickHull>
does Mongo::Client really want an array of strings?
<RickHull>
apparently yes
PaulCapestany has joined #ruby
<vtx>
so, the idea is, i create a connection at startup, and that connection gets reused for every request
<vtx>
but looking at my mongo logs, every time i hit the endpoint, mongo prints out the number of connections, and that number continues to grow for every request
<RickHull>
take a step back. can you make a single page sinatra app? like without config.ru ?
<RickHull>
i notice the sinatra page has the configure block in a .rb file
<RickHull>
sorry, not single page app -- i mean a single .rb file
<RickHull>
i haven't used sinatra or rack in a while so I'm pretty rusty
<RickHull>
in other words, start small, and make sure your little prototype does what you want
<RickHull>
in terms of connection handling
<RickHull>
skip all your API::Services stuff
<RickHull>
just make a simple app that talks to mongo, send it a few requests, and watch the connections
ur5us has joined #ruby
jamesaxl has quit [Quit: WeeChat 1.9.1]
<RickHull>
also, I notice the sinatra recipe has: `set :db, client[db]` but you have: `set :db, client[db].database`
Barrt has quit [Ping timeout: 255 seconds]
selim has quit [Ping timeout: 248 seconds]
<vtx>
RickHull: yep, but that’s jsut because later on in their code, they access database before accessing their collection name
rivalomega has joined #ruby
selim has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
so -- do you think you can make a simple example that shows mongo connection reuse for multiple requests?
<vtx>
um i guess i can try, i’ve only ever set it up before with config.ru etc, but i’ll give it a go to see if it narrows down the issue
astronavt has joined #ruby
GodFather has joined #ruby
tomphp has joined #ruby
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #ruby
Technodrome has joined #ruby
Barrt has joined #ruby
guille-moe has joined #ruby
<RickHull>
i think you could probably copy/paste the sinatra recipe thing and go from there
dionysus69 has joined #ruby
<RickHull>
no need for all the CRUD stuff. just e.g. `get '/' do` and then query mongo
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
JustASlacker has quit [Ping timeout: 240 seconds]
quobo has joined #ruby
bkxd has joined #ruby
nowhere_man has quit [Ping timeout: 268 seconds]
cdg has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has joined #ruby
theRealGent has joined #ruby
tomphp has joined #ruby
workmad3 has quit [Ping timeout: 268 seconds]
milardovich has joined #ruby
goyox86_ has joined #ruby
nofxx has joined #ruby
conta has quit [Quit: conta]
cdg has joined #ruby
kitsunenokenja has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
cdg_ has joined #ruby
techn1cs has joined #ruby
techn1cs has quit [Changing host]
techn1cs has joined #ruby
cdg has quit [Ping timeout: 255 seconds]
cdg_ has quit [Ping timeout: 248 seconds]
rivalomega has quit [Remote host closed the connection]
rivalomega has joined #ruby
bkxd_ has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
workmad3 has joined #ruby
milardovich has quit [Remote host closed the connection]
rivalomega has quit [Ping timeout: 240 seconds]
JustASlacker has joined #ruby
techn1cs has quit [Ping timeout: 240 seconds]
csk157 has quit [Ping timeout: 260 seconds]
unreal has joined #ruby
petervbeck has joined #ruby
milardovich has joined #ruby
petervbeck has quit [Client Quit]
petervbeck has joined #ruby
pifon has quit [Quit: Connection closed for inactivity]
petervbeck has quit [Client Quit]
JustASlacker has quit [Ping timeout: 255 seconds]
petervbeck has joined #ruby
astronavt has quit [Remote host closed the connection]
astronavt has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
kitsunenokenja has left #ruby ["WeeChat 1.9.1"]
yeticry has quit [Ping timeout: 246 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
nofxx has quit [Quit: Leaving]
pifon has joined #ruby
<vtx>
RickHull: so, running the smaller example worked, i.e., multiple requests doesnt result in multiple connections, so i’m gonna try and change up my main app to be similar to see if it works
nofxx has joined #ruby
<RickHull>
cool! my immediate guess is something in the Services::API layer
<RickHull>
or it could be due to the way rack is structured and under what circumstances the config.ru is initialized
astronav_ has joined #ruby
astronavt has quit [Ping timeout: 276 seconds]
milardovich has quit [Remote host closed the connection]
<vtx>
RickHull: yeah, so, thinking back to it, i did the whole services api layer to enable mocking for my spec tests, i.e. because the configure block runs when the file is loaded, my expect calls weren’t able to mock the db connection
milardovich has joined #ruby
<RickHull>
yeah, testing web stuff can be tricky. I wish I had better advice here, but I wouldn't compromise or complicate your production runtime just to make testing easier
<RickHull>
though I do tend to structure my apps to make testing easier
<RickHull>
but without compromising or complicating the production scenario
<vtx>
gah, changing the endpoint i’m calling to access the db connection isn’t working
<nofxx>
personal opinion: do only integration non-mocked for views
<nofxx>
don't loose time with unit in views and controllers
<nofxx>
use chromeless/phantomjs and only happiness!
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<vtx>
is it possible to somehow find out what part of my code is causing the new connection to be created?
milardovich has quit [Ping timeout: 248 seconds]
astronav_ has quit [Remote host closed the connection]
<RickHull>
process of elimination ;)
<RickHull>
that you have a working example with reusable connections is a great start
<RickHull>
now, e.g. convert your working example to a config.ru example
<RickHull>
and see what the effect is
<RickHull>
or introduce the Services::API thing and see what the effect is
csk157 has joined #ruby
<RickHull>
poke and prod, trial and error
armando has quit [Quit: ZNC 1.7.x-nightly-20171128-66897057 - https://znc.in]
csk157 has quit [Ping timeout: 246 seconds]
conta has joined #ruby
petervbeck has quit [Quit: WeeChat 1.9.1]
<vtx>
oh i think i fixed it! just double checking
drowze has joined #ruby
petervbeck has joined #ruby
astronavt has joined #ruby
bkxd_ has quit [Ping timeout: 255 seconds]
bkxd has joined #ruby
astronavt has quit [Remote host closed the connection]
drowze has quit [Ping timeout: 246 seconds]
astronavt has joined #ruby
astronavt has quit [Remote host closed the connection]
milardovich has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
<vtx>
RickHull: thanks so much for your help! i really appreciate it! \o/
vtx has quit [Quit: vtx]
alfiemax has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
no prob, glad to help, cheers :)
claudiuinberlin has joined #ruby
astronavt has joined #ruby
andrewir1 has joined #ruby
JustASlacker has joined #ruby
rivalomega has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
elphe has joined #ruby
exhiled has joined #ruby
Barrt has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 258 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
Technodrome has joined #ruby
armando has joined #ruby
bkxd_ has joined #ruby
rivalomega has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 240 seconds]
rivalomega has joined #ruby
bkxd has joined #ruby
Barrt has joined #ruby
rivalomega has quit [Ping timeout: 240 seconds]
bkxd_ has quit [Ping timeout: 248 seconds]
yeticry has joined #ruby
milardovich has quit [Remote host closed the connection]
Xiti has quit [Ping timeout: 248 seconds]
conta has quit [Quit: conta]
Azure has joined #ruby
def_jam is now known as eblip
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pwnd_nsfw has joined #ruby
elphe has joined #ruby
chocoelho has joined #ruby
aphprentice has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 250 seconds]
chmurifree has quit [Ping timeout: 248 seconds]
chmurifree has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
chocoelho has quit [Ping timeout: 250 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaruga has joined #ruby
nogic has joined #ruby
yeticry has quit [Ping timeout: 255 seconds]
alex`` has quit [Ping timeout: 240 seconds]
jaruga has quit [Client Quit]
zanshin has quit [Ping timeout: 268 seconds]
bkxd has quit [Read error: Connection reset by peer]