favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 256 seconds]
favadi has joined #ruby
dg1727 has joined #ruby
dg1727 has left #ruby [#ruby]
dionysus69 has quit [Ping timeout: 276 seconds]
ur5us has quit [Ping timeout: 240 seconds]
lucf117_ has joined #ruby
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 240 seconds]
yossarian has quit [Ping timeout: 246 seconds]
<ox1eef>
is there some method on File, Dir, anything that returns a user's home dir relative to their platform? i seem to remember something but can't think of it.
<ox1eef>
found it, i think.. Dir.home
favadi has joined #ruby
duds- has quit [Remote host closed the connection]
duds- has joined #ruby
favadi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has joined #ruby
crankharder has joined #ruby
yossarian has joined #ruby
yossarian has quit [Changing host]
yossarian has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Remote host closed the connection]
favadi has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Read error: Connection reset by peer]
Rounin has joined #ruby
oxfuxxx has joined #ruby
perrierjouet has joined #ruby
Furai has quit [Quit: WeeChat 3.5]
gr33n7001 has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
Furai has joined #ruby
oxfuxxx has quit [Ping timeout: 276 seconds]
lucf117_ has quit [Ping timeout: 276 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
favadi has quit [Read error: Connection reset by peer]
jpn has joined #ruby
jpn_ has joined #ruby
jpn has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
crankharder has joined #ruby
depesz_ is now known as depesz
crankharder has quit [Ping timeout: 246 seconds]
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #ruby
ur5us has joined #ruby
gr33n7001 has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jpn has joined #ruby
vit has joined #ruby
jpn_ has quit [Ping timeout: 256 seconds]
vit is now known as freeworld
freeworld has quit [Quit: Konversation terminated!]
vit has joined #ruby
vit is now known as freeworld
freeworld is now known as vit
vit is now known as freeworld
freeworld has quit [Client Quit]
freeworld has joined #ruby
freeworld has quit [Client Quit]
freeworld has joined #ruby
freeworld has quit [Client Quit]
freeworld has joined #ruby
dionysus69 has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 240 seconds]
wybpip[m] has joined #ruby
wybpip[m] has left #ruby [#ruby]
dionysus69 has quit [Ping timeout: 256 seconds]
tbob_ has quit [Ping timeout: 248 seconds]
crankharder has joined #ruby
tbob has joined #ruby
jpn has quit [Ping timeout: 248 seconds]
crankharder has quit [Ping timeout: 256 seconds]
libsys has quit [Ping timeout: 256 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
ftajhii has joined #ruby
gproto23 has joined #ruby
crankharder has joined #ruby
freeworld has quit [Ping timeout: 260 seconds]
John_Ivan_ has joined #ruby
<John_Ivan_>
is there a way to "puts" out to console a heredoc with ruby syntax highlighting
<John_Ivan_>
?
Sheilong has joined #ruby
<legit>
No idea, but it does sound a pretty specific use case
<legit>
sound like*
jpn has joined #ruby
AndreYuhai has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
<AndreYuhai>
Hey everyone! We've got a test case where we make a get request like this https://paste.ofcode.org/38jWjCArw5hCgpv37nHfyBk and the controllers have protect_from_forgery, however this test fails saying "InvalidCrossOriginRequest: Security warning: an embedded <script> tag on another site requested protected JavaScript. If you know what you're doing, go ahead and disable forgery protection on this action
<AndreYuhai>
to permit cross-origin JavaScript embedding....
<AndreYuhai>
"
<AndreYuhai>
Not sure how to resolve this or why and how I even get this in a test.
crankharder has quit [Ping timeout: 276 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
jpn has joined #ruby
crankharder has joined #ruby
<adam12>
John_Ivan_: Nothing built in. I'd maybe pipe to the `bat` tool, but I doubt that's what you want.
phryk has quit [Remote host closed the connection]
jpn has joined #ruby
dionysus69 has joined #ruby
sylario has joined #ruby
Tomte has joined #ruby
moo has quit [Quit: moo]
crankharder has joined #ruby
Tomte has quit [Read error: Connection reset by peer]
Tomte has joined #ruby
<John_Ivan_>
adam12, yeah, I think piping it to vim or something would work. thanks for the suggestion.
jpn has quit [Ping timeout: 276 seconds]
Tempesta has quit [Quit: See ya!]
Tempesta has joined #ruby
jpn has joined #ruby
<adam12>
It would be interesting to have built in syntax highlighting for Ruby source. I wonder if someone will build it with the improvements to pp and ripper.
Ziyan has joined #ruby
oxfuxxx has joined #ruby
some14u has joined #ruby
oxfuxxx has quit [Remote host closed the connection]
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
roadie has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
some14u has quit [Read error: Connection reset by peer]
some14u has joined #ruby
AndreYuhai has quit [Ping timeout: 256 seconds]
bit4bit has joined #ruby
bit4bit has quit [Ping timeout: 250 seconds]
moo has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
crankharder has quit [Ping timeout: 260 seconds]
crankharder has joined #ruby
AndreYuhai has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
crankharder has quit [Ping timeout: 276 seconds]
AndreYuhai has quit [Ping timeout: 250 seconds]
crankharder has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
comet23 has joined #ruby
<comet23>
what is the value of an empty return statement?
<comet23>
like just the keyword return by itself
<leah2>
nil
<leah2>
you could have found that out yourself
<comet23>
thank you
<comet23>
i tried but i don't know how to do it
<comet23>
i tried p return and got an error =/
<leah2>
>> def f; return; end; f
<leah2>
=> nil
<comet23>
oh that's mind blowing i never thought of it that way
<leah2>
or drop the return, same behavior ;)
<comet23>
i feel stupid for calling it a return value and never realizing that nil as the return value is the return value
dionysus69 has joined #ruby
* comet23
feels extremely stupid
<leah2>
dont worry :)
<adam12>
comet23: I wouldn't feel stupid about learning.
gproto23 has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
<ox1eef>
a cool thing about ruby is that practically everything returns a value, all the way from if "statements" to method definitions.
AndreYuhai has quit [Ping timeout: 246 seconds]
<adam12>
akeyless 44628 KB
<adam12>
I wonder what the largest gem documentation is now. I should look.
<adam12>
I'm guessing it's still going to be azure_mgmt_network.
<adam12>
Yep. azure_mgmt_network at 781564 KB, with intersight_client next at 566096 KB.
<adam12>
781 MB of YARD docs. Some head shaking necessary there.
duderonomy has joined #ruby
<aeris>
o/ here!
<aeris>
is there any ruby idiom to be able to linearize some recursive code like f { f { f { … f { a_block } … } ?
<adam12>
aeris: o/
<adam12>
hmmm
Tomte has quit [Read error: Connection reset by peer]
<ox1eef>
i wrote a lot of docs past few days
_ht has joined #ruby
<ox1eef>
aeris: maybe Proc#curry, or funkify by banister. github.com/banister/funkify
<aeris>
in my case i have a list of list of arguments for the f function, want to do something like (args.each { |a| f a }) &a_block
<aeris>
with the block called on the full f function stack
<ox1eef>
it looks like the functional style, have you considered partial application to solve it
<bougyman>
There has to be a better way to compute that without iterating through each reward. I suck at these types of things.
<bougyman>
leah2: ^ Any thoughts?
some14u- has joined #ruby
AndreYuhai has joined #ruby
<leah2>
erm
<bougyman>
I'm trying to remember shit from college. failing miserably.
<leah2>
is the result wrong or what?
<bougyman>
No, the result is right.
<leah2>
just slow
<bougyman>
Just trying to do it without a million loops.
<bougyman>
This is me failing at math, basically.
<leah2>
isnt this some kind of base conversion?
<bougyman>
It's the rewards for bitcoin blocks.
<bougyman>
at the end, total is the total amount of bitcoin that will be produced.
<bougyman>
I just know there's a way to replace lines 6-10 with some metamath.
AndreYuhai has quit [Ping timeout: 248 seconds]
<bougyman>
210,000 is how many blocks happen before rewards (subsidy) halves.
<leah2>
i guess it's a geometric sum or so
<bougyman>
Yup, something like that.
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
jpn has quit [Ping timeout: 256 seconds]
dionysus70 has quit [Ping timeout: 240 seconds]
jpn has joined #ruby
some14u- has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
jpn has quit [Read error: Connection reset by peer]
jpn has joined #ruby
jpn has quit [Ping timeout: 246 seconds]
Guest1344 has joined #ruby
AndreYuh1i has joined #ruby
Guest1344 has quit [Client Quit]
<leftylink>
I think thre should be a way. first is to notice that 5000000000 gets added 210000 times. then 2500000000 gets added 210000 times... basically for 210000 consecutive values of height, the value added is the same
<leftylink>
so might as well just do all 210000 iterations at once by multiplying the amount added to the total by 210000, then add 210000 to height instead of 1
<leftylink>
you'll compute the exact same answer in 1/210000th the time, which is plenty good enough
<bougyman>
Yep, did that.
<bougyman>
I mean, that was my first optimization.
<bougyman>
It's still not really leveraging "Sum of geometric sequence" which can accomplish this. Only ruby google hit on that is a code kata on codewars.
<leftylink>
it may be a little tricky though because usually the formulas involved would not truncate, like this code is doing
comet23 has quit [Quit: Client closed]
<leftylink>
so the iteration that adds 9765625 followed by 4882812 would cause a difference. the formula would want to add 4882812.5 afterward
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lucf117_ has joined #ruby
jpn has quit [Ping timeout: 248 seconds]
<leftylink>
for me I would really want to write it as a Enumerable#sum, though I believe to do that, the code structure will have to change to instead predetermine which iteration is the last (can't `break` out of a `sum`). I believe this is achievable by using init_subsidy.bit_length. however, the only reason I would do this is because it hurts me to see a reduce that's used as a sum, whereas this is not true for
<leftylink>
everyone who will see the code
<leftylink>
so there is no inherent need to do that
<leftylink>
and besides, making that change makes no difference to performance, which was the main question, so I shouldn't have brought it up since it's off-topic to the questoin
<leftylink>
hmm I could start dissecting the reasons why I say thumbs up emoji instead of saying "you're welcome" or "no problem" or "glad I could be of service" or anything reasonable, but I think that's squarely in -offtopic territory
<leftylink>
I'm actually not sure the reasons
oxfuxxx has quit [Quit: [H]EAT ROX FUCK R0X SHIT BRIX. = The Yankies M0th3Rphackers Coconut Aerospace =]
jpn has joined #ruby
comet23 has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
advorak has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
lucf117_ has quit [Quit: Leaving]
ollysmith has quit [Quit: ZNC 1.8.2+deb2+b3 - https://znc.in]