octos has quit [Read error: Connection reset by peer]
octos has joined #ruby
<haxx0r>
yeah, i read about this urban legend of school homework to make 100/200 throws and write down
<haxx0r>
however, variance is so big, that they could perfectly go 50x head/tail pattern straight.
<haxx0r>
saying "you guys make up numbers because you didn't have 6 in a row" sounds a bit odd to
tdy has joined #ruby
<al2o3-cr>
haxx0r: in my gambling days i've seen 6 zeros come out in a row on roulette. trust me 13 blacks numbers ain't...
<phaul>
yeah, I don't know one has to calculate the probability of 6 in a row not occurring out of 200, and then I could judge, but I don't really know how.. I remember when I heard a birthday paradox I was also shocked
sylario has quit [Quit: Connection closed for inactivity]
<haxx0r>
phaul eve if the probability is very low, it's still possible that one of the students catched it. he can't say "you've cheated" , he can only say " it's more likely that you've cheated"
<haxx0r>
al2o3-cr yaeh i've seen 4x24. that was balla. beacuse a dude had 10euro on it, left 20euro on, left 50 eur on and left maxbet 100 eur on
<phaul>
sure. but if the probability is say less than 10^10 than I would risk my life on it
<haxx0r>
then he continued to maxbet the 24 and lost all 2 hours later
<phaul>
I mean 1/(10^10) ofc
<phaul>
:D
<haxx0r>
1/ 10^10 is one out of 10 billion
<haxx0r>
we have 8b people on earth
<haxx0r>
so there is a good chance, that somebody dies, if we play this game with everybody on the planet
<haxx0r>
so i won't bet my life on it
<phaul>
yeah but most things that we do are way more dangerous
<phaul>
probably you need some include path to be add n the runtime to run the tests, or run with bundle exec or by other means
<leitz>
Hey phaul, thanks! That was it, in reverse. I'm moving the code to be modular and the "require 'planet'" referenced the old file location. Removing that line lets it work.
<leitz>
RougeR, I'm only a newbie, but one guideline I use is "longer variable names the further they are from being defined". How far is the @ex definition from its usage?
<RougeR>
leitz, its exactly the same usage. standard style for ruby is to use e/ex when rescuing exceptions
<RougeR>
im just using it to present the message in the view
<RougeR>
i think its fairly clear, but im not sure if its good practice
<RougeR>
still good point, 1 point for it, for being clear in that regards
tdy has quit [Ping timeout: 258 seconds]
schne1der has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
jinie_ has joined #ruby
codefriar has joined #ruby
kapilp has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
<leitz>
I'm working on a large, undocumented, and poorly tested code base. I appreciate all the clarity I can get. :)
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 268 seconds]
vondruch_ is now known as vondruch
yasumi2136 has joined #ruby
salerace has joined #ruby
salerace has quit [Ping timeout: 248 seconds]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yasumi2136_ has joined #ruby
grilix_ has joined #ruby
yasumi2136 has quit [Ping timeout: 245 seconds]
gigetoo has quit [Ping timeout: 258 seconds]
rafadc has quit [Read error: Connection reset by peer]
octos has quit [Remote host closed the connection]
gigetoo has joined #ruby
octos has joined #ruby
rafadc has joined #ruby
octos has quit [Ping timeout: 244 seconds]
alem0lars has joined #ruby
tdy has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
apparition has joined #ruby
zodd_ has joined #ruby
zodd_ is now known as Guest58529
tdy has quit [Read error: Connection timed out]
Guest58529 is now known as zodd
koomen has joined #ruby
haxx0r has quit [Quit: Ping timeout (120 seconds)]
<koomen>
Hi, what's a good code documentation standard to use for documenting ruby functions/methods etc? I'm seeing RDoc a lot. Also, when checking some stackoverflow issues I see that people mention that you should write your documentation for the rdoc processor (which generates HTML from your comments?) and I also see the tomdoc http://tomdoc.org but maybe someone can help me out how to properly document parameters
<koomen>
in functions in ruby
<phaul>
these days yard is at least as popular as rdoc
<adam12>
koomen: Probably my least favourite part of Ruby is docs mostly suck. Split between YARD/RDoc/Tomdoc (partly). Go with RDoc or YARD. Forget Tomdoc imho.
<phaul>
for open source you can push it to https://inch-ci.org/ and see some metrics bout your docs
<koomen>
So, what is the recommended one people prefer to use? RDoc or YARD?
<phaul>
I go with yard
<koomen>
yard seems to be nicer to me
<adam12>
If you use all it's features, it definitely outputs nicer docs.
<adam12>
It's a shame that Loren Segals's work to unify docs were kinda stonewalled.
jenrzzz has joined #ruby
Inline has joined #ruby
ffl^ has joined #ruby
<leitz>
koomen, do you have a project you're interested in joining? If so I'd recommend seeing what they use and go with that. I tend to choose the simplest/most established for my own stuff. In this case it would be rdoc.
ljarvis has quit [Ping timeout: 258 seconds]
DTZUZU has joined #ruby
marz_d`ghostman has joined #ruby
AndreYuhai has joined #ruby
zapata has joined #ruby
<marz_d`ghostman>
Aside from Heroku, what other viable good options do you deploy ruby/ror apps?
Rapture has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 248 seconds]
AJA4351 is now known as AJA4350
frojnd has joined #ruby
<frojnd>
Hi there.
vondruch_ has joined #ruby
<frojnd>
I would like to decode byte array I think it's gzipped. Which I intercepted with mitmproxy but I don't know how. Byte array looks like this: [[31,-117,8,0,0,0,0,0,0,0,-115,-111] Any ideas?
<koomen>
leitz: Ah not perse, but I always check what the project uses if I am joining in and go with that, but I have searched through repositories through github trending page but it's hard to find some properly documented code
<frojnd>
Looks like this: [31,-117,8,0,0,0,0,0,0,0,-115,-111]
<koomen>
leitz: well, code might be properly documented, but not with '@param ... ' syntax etc
<leitz>
marz_d`ghostman, I'm looking at Google App Engine, but am a newbie and just started.
<frojnd>
Any ideas?
<havenwood>
marz_d`ghostman: Google App Engine was what I was going to suggest too, but I've not used it in prod to give feedback.
ljarvis_ has joined #ruby
<havenwood>
marz_d`ghostman: Or just DO
<leitz>
havenwood, I put some Go code up on GAE and it seems okay. That said, it's a very small project and I'm even more of a beginner at Go. :)
vondruch has quit [Ping timeout: 250 seconds]
vondruch_ is now known as vondruch
SeepingN has joined #ruby
<leitz>
My current personal project is to do some work on a mini-game and make a web interface. Then put it up on GAE.
<havenwood>
frojnd: Negatives?
<havenwood>
frojnd: Are you sure those are bytes?
<AndreYuhai>
Hello there, I am trying to get all the links from a web page using mechanize. The question is when the link is something like "http://foo.com/#bar" this link is okay but when the link also has spaces like "http://foo.com/#bar qux" then it gets '#' and 'space' characters gets replaced with '%23' and '%20'. Is there any way to prevent this or should I switch to addressable gem?
jenrzzz has quit [Ping timeout: 258 seconds]
fphilipe has quit [Ping timeout: 244 seconds]
aupadhye has quit [Remote host closed the connection]
yasumi2136_ has quit [Quit: Konversation terminated!]
<havenwood>
AndreYuhai: The percent encoding is correct.
<havenwood>
AndreYuhai: "The space character is unsafe because significant spaces may disappear and insignificant spaces may be introduced when URLs are transcribed or typeset or subjected to the treatment of word-processing programs."
<havenwood>
AndreYuhai: "All unsafe characters must always be encoded within a URL."
<havenwood>
frojnd: Is that all the data you've captured?
<AndreYuhai>
havenwood: but the '#' doesn't get decoded back, right? I mean when it is space and %20 when you navigate to that link space becomes a space in the address bar again. But hashtag does not get decoded.
<havenwood>
AndreYuhai: # is unsafe too and should be encoded as well. It'll decode back to #
<havenwood>
AndreYuhai: "The character "#" is unsafe and should always be encoded because it is used in World Wide Web and in other systems to delimit a URL from a fragment/anchor identifier that might follow it."
<Guest39>
my question is... where is the data there? where is the piece of page code where the data iss retrieved/analyzed by the graphs?
<jhass>
basically the fragment shouldn't even be sent to the server, it's interpreted by client side JS in this case
<jhass>
not sure you'll have much success with mechanize here
<jhass>
might be better to reverse engineer the internal API the client JS app uses
<Guest39>
jhass sorry i did not understnd... where is the data for the plots taken ? i cannot find it in html
<jhass>
Guest39: wasn't for you, but for AndreYuhai :)
<Guest39>
ohh ok sorry jhass
<AndreYuhai>
havenwood, jhass So what I was trying to say is when I use mechanize and get the links if there is this fragment part then URI module encodes it, but I guess it shouldn't be encoded then.
<AndreYuhai>
And it only encodes when you have space too. I mean if you do not have any space then it does not encode.
<havenwood>
Guest39: The data is coming from Tableau.
<Guest39>
havenwood what's this tableau ? is it a common solution ?
<AndreYuhai>
For example if you have "...com/#section" this does not get encoded, but "...com/#section ruby" gets encoded as "23%section%20ruby"
<jhass>
AndreYuhai: and I'm saying you don't even need to solve this because it will only let you arrive at the more fundamental problem
<havenwood>
Guest39: It's one of many options. It doesn't seem open source, but I don't know. I don't know lots of details about Tableau. It's not something I've used. I dunno if there's a data visualization channel to ask in.
<AndreYuhai>
jhass: How can I fix this then? I am lost. :D
<AndreYuhai>
I mean if I don't fix it then the URL I request is wrong so I can't view that page.
<jhass>
I'm saying trying to scrape the site with mechanize most likely is a lost cause. But given there seems to be a JS client interpreting those fragments, there probably is an internal API that JS client uses which you can try to use to scrape the content
jenrzzz has joined #ruby
Guest39 has quit [Ping timeout: 246 seconds]
<jhass>
ok it looks like you can just ignore the fragment
Harlin has quit [Quit: Lost terminal]
<jhass>
where did you find a link with it?
claudiuinberlin has joined #ruby
fphilipe has quit [Ping timeout: 258 seconds]
<AndreYuhai>
jhass: Oh, that is right though. Haha, I can just ignore the fragment as you said since it doesn't really make sense anyway to have the fragment.
<AndreYuhai>
jhass: I am not really scraping the content though. I am just trying to get all the links from each page using BFS just for fun. The page is my blog page blog.andreyuhai.com
polishdub has joined #ruby
GodFather has quit [Ping timeout: 258 seconds]
<frojnd>
havenwood: yeah, that's gziped
fphilipe has joined #ruby
salerace has quit [Ping timeout: 244 seconds]
<havenwood>
frojnd: and they're signed bytes?
<havenwood>
frojnd: that's the whole payload, or just a sample?
<havenwood>
frojnd: so it's -128-127 for the bytes instead of 0-255 like we're expecting?
<frojnd>
it shoild be a json result
<frojnd>
havenwood: not this is just a part of dedoded stuff
<frojnd>
encoded*
<frojnd>
sorry
<frojnd>
I forgot I didn't paste the whole example
<frojnd>
havenwood: yeah -128-127
fphilipe has quit [Ping timeout: 244 seconds]
<havenwood>
frojnd: It's a lot clearer with the code! So what's the question?
<frojnd>
How to port that python code to ruby haha
<jhass>
then just shift it to 0-255, .pack("C*") and pass the result a gzip deflater
<frojnd>
jhass: how do I shift it?
<havenwood>
frojnd: subtract 128
<jhass>
.map {|b| b + 128 }
jeremycw has joined #ruby
<havenwood>
or add 128 in the other direction
fphilipe has joined #ruby
<havenwood>
frojnd: if that's your Python code, just use unsigned bytes from the start
<AndreYuhai>
jhass: Well, actually I just tried it. Since URI encodes even the fragment part then URI module does not recognize the fragment part afterwards haha. Even to_s returns the encoded string. I will try with addressable and see.
<frojnd>
Not my code...
<havenwood>
rgr
<havenwood>
frojnd: adding 128 is easy, at least :)
<frojnd>
Well a.map {|b| b + 128 }.pack("C*") I need to pass to the result a gzip defalter
<frojnd>
how do I do that :D
<frojnd>
One liners are the best
salerace has joined #ruby
<frojnd>
Now the resul is smth like this: => "\x9F\v\x88\x80\..."
<inky>
please write to _inky, need to exit this device now.
inky has quit [Quit: Leaving.]
<adam12>
Anybody ever seen an at_exit{} handler that checks $!? I'm using the Azure SDK and it will raise an exception but the stacktrace is basically useless. Only includes frames from itself or one of it's dependent libraries. I'd love to see the actual line that triggered it somewhere.
<adam12>
_inky: I've normally seen that where Puma is compiled with OpenSSL and it's been a broken compile. There's an environment variable you can set when installing puma that will disable the built-in SSL server.
yaewa has joined #ruby
moei has quit [Ping timeout: 248 seconds]
fphilipe has quit [Ping timeout: 268 seconds]
rippa has joined #ruby
<_inky>
hmmmm, i do it with bundler, by some config in mastodon...
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
blackmesa has joined #ruby
brool has quit [Ping timeout: 252 seconds]
jinie has quit [Ping timeout: 244 seconds]
kapilp has joined #ruby
jenrzzz has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jenrzzz has quit [Ping timeout: 245 seconds]
ricekrispie has joined #ruby
ricekrispie2 has quit [Ping timeout: 258 seconds]
marz_d`ghostman has quit [Ping timeout: 256 seconds]
yokel has quit [Remote host closed the connection]
yokel has joined #ruby
conta1 has quit [Quit: conta1]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Freshnuts has joined #ruby
octos has quit [Ping timeout: 272 seconds]
octos has joined #ruby
dbugger has joined #ruby
_inky has quit [Remote host closed the connection]
_inky has joined #ruby
_inky has quit [Remote host closed the connection]
_inky has joined #ruby
inky has joined #ruby
inky has quit [Read error: Connection reset by peer]
_inky has quit [Read error: Connection reset by peer]
inky has joined #ruby
andrzejku has joined #ruby
SeepingN has joined #ruby
inky has left #ruby ["IRC for Sailfish 0.9"]
reber has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs1 has quit [Ping timeout: 258 seconds]
matheusmoreira has quit [Ping timeout: 248 seconds]
esp32_prog has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
r29v has joined #ruby
sameerynho has quit [Ping timeout: 248 seconds]
claudiuinberlin has joined #ruby
esp32_prog has quit [Ping timeout: 245 seconds]
matheusmoreira has joined #ruby
mozzarella has quit [Ping timeout: 258 seconds]
graft has quit [Ping timeout: 248 seconds]
mozzarella has joined #ruby
andrzejku has quit [Remote host closed the connection]
schne1der has quit [Ping timeout: 272 seconds]
ellcs1 has joined #ruby
gmatutecr has joined #ruby
blackmesa has quit [Ping timeout: 272 seconds]
dbugger has quit [Ping timeout: 264 seconds]
Fr4n has joined #ruby
budonyc has joined #ruby
r29v has quit [Quit: r29v]
DTZUZU has quit [Ping timeout: 245 seconds]
DTZUZU has joined #ruby
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 248 seconds]
vondruch_ is now known as vondruch
Francisco has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fr4n has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
teardown has quit [Read error: Connection reset by peer]
teardown has joined #ruby
Freshnuts has quit [Remote host closed the connection]
Freshnuts has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Francisco has quit [Ping timeout: 272 seconds]
Mia has quit [Read error: Connection reset by peer]
niceperl has joined #ruby
GodFather has quit [Ping timeout: 248 seconds]
grilix_ has quit [Ping timeout: 272 seconds]
kapilp has quit [Quit: Connection closed for inactivity]
morozovm has joined #ruby
AJA4351 has joined #ruby
dar123 has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4351 is now known as AJA4350
ledhed2222 has joined #ruby
<ledhed2222>
howdy. i’m writing a service object that will have a long list of parameters, which i’d like to be KW args.
<ledhed2222>
i have two questions for you all!
<ledhed2222>
1) i have 8 args. 3 are required and 5 have default values. the method definition looks hideous, but i’d ideally not just use a `**args` expression because i believe that shows less intent
<ledhed2222>
2) this particular list of arguments will be shared between a static method (that initializes for you) and the initializer itself. i’d like to define the argument list in one place
<ledhed2222>
if i didn’t have any required KW args, i could neatly describe this with a hash constant. but since i have a mixture of required and not i’m not sure how to best express this
<ledhed2222>
any thoughts?
brool has joined #ruby
<adam12>
ledhed2222: Sometimes too many arguments is a smell, so keep that in consideration. Sometimes I only have a few args but it still looks narly and for that I might reach for dry-initializer.
<ledhed2222>
i agree too many args is a smell, but i’m not sure in this case how to best factor them out. i suppose i could have some struct to contain the args, but that seems silly.
<ledhed2222>
also what do you mean by a dry-initializer?
<phaul>
or think about the problem domain. probably the class is too large and there is a good way to couple a few arguments into single self contained types
morozovm has quit [Remote host closed the connection]
Mrbuck has joined #ruby
<Mrbuck>
Hi ruby still alive ?
AJA4351 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
ledhed2222 has quit [Quit: ledhed2222]
<mozzarella>
well yes
<Mrbuck>
good i want to learn ruby
<galaxie>
#RIPRuby, it's been fun..
renich has quit [Remote host closed the connection]
<Mrbuck>
4 years back when I seek help no one helped then I moved to pythin and ruby dead
cthulchu has quit [Ping timeout: 248 seconds]
bambanx has joined #ruby
renich has joined #ruby
ltd has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
morozovm has joined #ruby
hanmac has quit [Ping timeout: 268 seconds]
haxx0r has quit [Ping timeout: 272 seconds]
teardown has quit [Quit: leaving]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<galaxie>
Mrbuck: Where'd you seek help at?
morozovm has quit [Ping timeout: 248 seconds]
<Mrbuck>
galaxie: here I asked some one to write some code and no one helped
<galaxie>
Mrbuck: I doubt most people write code for random strangers that ask. Provide some code you've worked on and reasons why it's not working and someone might direct you.
<Mrbuck>
galaxie: but that time I was desperately need some one to write whole code
wald0 has joined #ruby
<Mrbuck>
I had sad days
<galaxie>
Ever tried cash? Magic sometimes.
<gbristol>
yeah lube up the code tubes with some cash
<galaxie>
If your handle is any indicator, lol
orbyt_ has joined #ruby
haxx0r has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.4]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
<Eiam>
i had sad days, oh oby
<Eiam>
oh boy
lxsameer has quit [Ping timeout: 258 seconds]
planigan has quit [Read error: Connection reset by peer]