baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.4.6: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
Swyper has joined #ruby
jenrzzz has joined #ruby
skryking has quit [Ping timeout: 252 seconds]
skryking has joined #ruby
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
<haxx0r> Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16)).rand(37)
<haxx0r> as long this is always 10, i'm happy
<phaul> - always. once. that's what taking the risk 1 out of 10^10 means
<haxx0r> 6x black in last 30 throws :>
<al2o3-cr> &>> [*1..20].shuffle random: Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16))
<rubydoc> # => [15, 19, 12, 5, 2, 8, 18, 7, 1, 3, 16, 4, 14, 6, 10, 17, 13, 9, 20, 11] (https://carc.in/#/r/7033)
<al2o3-cr> &>> [*1..20].shuffle random: Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16))
<rubydoc> # => [15, 19, 12, 5, 2, 8, 18, 7, 1, 3, 16, 4, 14, 6, 10, 17, 13, 9, 20, 11] (https://carc.in/#/r/7034)
<al2o3-cr> &>> [*1..20].shuffle random: Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16))
<rubydoc> # => [15, 19, 12, 5, 2, 8, 18, 7, 1, 3, 16, 4, 14, 6, 10, 17, 13, 9, 20, 11] (https://carc.in/#/r/7035)
<leftylink> I will regret this but
<haxx0r> i don't get that
<leftylink> &>> puts (0...45).each_with_object(rand: nil, fizzbuzz: []) { |i, o| o[:rand] = Random.new(1781773465) if i % 15 == 0; o[:fizzbuzz] << [i + 1, 'Fizz', 'Buzz', 'FizzBuzz'].sample(random: o[:rand]) }[:fizzbuzz]
<rubydoc> # => 1 (https://carc.in/#/r/7036)
<leftylink> &>> (0...45).map.with_object(rand: nil, fizzbuzz: []) { |i, o| o[:rand] = Random.new(1781773465) if i % 15 == 0; o[:fizzbuzz] << [i + 1, 'Fizz', 'Buzz', 'FizzBuzz'].sample(random: o[:rand]) }[:fizzbuzz]
<rubydoc> # => [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fizz",... check link for more (https://carc.in/#/r/7037)
<haxx0r> so the seed generation looks ok
<haxx0r> then i'm happy
<leftylink> oh, that map was useless, it should have kept being each_with_obj, just needed to get rid of the puts which put only one on every line
<leftylink> though maybe puts was better anyway
<leftylink> anyway, one gets the idea
<leftylink> should have just made it ...100 anyway, it wasn't going to all show up anyway
<al2o3-cr> leftylink: nice ;)
jenrzzz has quit [Ping timeout: 272 seconds]
<al2o3-cr> &>> [*1..20].shuffle random: Random.new(Time.now.usec + $$ + Process.ppid)
<rubydoc> stderr: playpen: application terminated abnormally with signal 31 (Bad system call) (https://carc.in/#/r/7038)
<leftylink> unfortunate
<al2o3-cr> :/
Swyper has quit [Remote host closed the connection]
<al2o3-cr> &>> [*1..20].sample random: Random.new("\x00P\x01\xC5".unpack1('N'))
<rubydoc> # => 10 (https://carc.in/#/r/703k)
SeepingN has quit [Ping timeout: 246 seconds]
P0rkD has joined #ruby
Swyper has joined #ruby
gix has quit [Ping timeout: 252 seconds]
esp32_prog has joined #ruby
chrisseaton_ has quit [Quit: Connection closed for inactivity]
brool has quit [Ping timeout: 250 seconds]
esp32_prog has quit [Ping timeout: 248 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.4]
<havenwood> &>> srand 100001815082; 1.upto(15).map { |n| [*[n]*8, *%i[fizz]*4, *%i[buzz]*2, :fizzbuzz].sample }
<rubydoc> # => [1, 2, :fizz, 4, :buzz, :fizz, 7, 8, :fizz, :buzz, 11, :fizz, 13, 14, :fizzbuzz] (https://carc.in/#/r/703q)
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
duderonomy has joined #ruby
<al2o3-cr> havenwood: hehe nice :)
<al2o3-cr> that is clever tbf
sagax has quit [Ping timeout: 245 seconds]
P0rkD has quit [Remote host closed the connection]
mniip has quit [Quit: This page is intentionally left blank.]
Eiam_ is now known as Eiam
P0rkD has joined #ruby
budonyc has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
mniip has joined #ruby
<baweaver> havenwood: You finally found the magic number
<baweaver> you madman
jenrzzz has joined #ruby
mniip has quit [Quit: This page is intentionally left blank.]
sendro has quit [Ping timeout: 258 seconds]
mniip has joined #ruby
mniip has quit [Ping timeout: 604 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Wolland has joined #ruby
budonyc has quit [Quit: Leaving]
orbyt_ has joined #ruby
orbyt_ has quit [Client Quit]
Wolland has quit [Quit: Mutter: www.mutterirc.com]
houhoulis has joined #ruby
Talion has quit [Quit: Connection closed for inactivity]
esp32_prog has joined #ruby
P0rkD has left #ruby ["Leaving"]
P0rkD has joined #ruby
P0rkD is now known as Fritessaus
aither has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
blerrp has left #ruby [#ruby]
esp32_prog has quit [Ping timeout: 258 seconds]
Fritessaus has left #ruby [#ruby]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
P0rkD has joined #ruby
P0rkD has left #ruby [#ruby]
aither has joined #ruby
dar123 has joined #ruby
braincrash has quit [Quit: bye bye]
dar123 has quit [Client Quit]
Fusl has quit [Remote host closed the connection]
braincrash has joined #ruby
Fusl has joined #ruby
haxx0r has quit [Ping timeout: 245 seconds]
kapilp has quit [Quit: Connection closed for inactivity]
graft has joined #ruby
salerace has quit [Ping timeout: 246 seconds]
fphilipe_ has joined #ruby
graft has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
Swyper has quit [Remote host closed the connection]
fphilipe_ has quit [Ping timeout: 248 seconds]
sagax has joined #ruby
salerace has joined #ruby
salerace has quit [Ping timeout: 258 seconds]
<Eiam> wait what the fuck am i reading
<Eiam> ugh brain
<Eiam> whats splat [n] supposed to do
<Eiam> irb says its not valid
<Eiam> > *[1]
<Eiam> SyntaxError: (irb):1
luminousnine has left #ruby ["Leaving"]
codefriar has joined #ruby
<leftylink> but a list can be splatted into another list
<leftylink> &>> [*[:a]]
<rubydoc> # => [:a] (https://carc.in/#/r/704j)
<leftylink> &>> [*[:a] * 5]
<rubydoc> # => [:a, :a, :a, :a, :a] (https://carc.in/#/r/704k)
orbyt_ has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
dar123 has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
haxx0r has joined #ruby
podlech has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Quit: AJA4350]
Arahael has quit [Ping timeout: 252 seconds]
arahael1 has joined #ruby
esp32_prog has joined #ruby
FancyEagle has joined #ruby
supergeek[m] has quit [Remote host closed the connection]
bastilian has quit [Remote host closed the connection]
sepp2k has quit [Remote host closed the connection]
kateskips has quit [Remote host closed the connection]
neovalis[m] has quit [Read error: Connection reset by peer]
turt2live has quit [Read error: Connection reset by peer]
FrankDW has quit [Read error: Connection reset by peer]
esp32_prog has quit [Ping timeout: 244 seconds]
coffeejunk has quit [Ping timeout: 272 seconds]
coffeejunk has joined #ruby
irdr has quit [Remote host closed the connection]
irdr has joined #ruby
bambanxx has joined #ruby
bastilian has joined #ruby
bambanx has quit [Ping timeout: 246 seconds]
FancyEagle has quit [Quit: Leaving]
dellavg_ has quit [Ping timeout: 258 seconds]
DTZUZU2 has quit [Ping timeout: 250 seconds]
mniip has joined #ruby
<al2o3-cr> havenwood: i want to see to 100
StarLord__ has joined #ruby
StarLord__ has quit [Client Quit]
houhoulis has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanxx has quit [Ping timeout: 248 seconds]
sepp2k has joined #ruby
supergeek[m] has joined #ruby
neovalis[m] has joined #ruby
turt2live has joined #ruby
kateskips has joined #ruby
hightower3 has joined #ruby
<baweaver> al2o3-cr / havenwood: original_set = (real fb set); sample_set = [nil, 'Fizz' ,'Buzz', 'FizzBuzz']; (1..).lazy.find { |i| p i; srand i; !original_set.any? { |v| v != sample_set.sample || v } }
* baweaver sits back and waits
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has joined #ruby
<baweaver> Wait. What am I doing. I have TruffleRuby!
<baweaver> and TruffleRuby has? Threading!
<baweaver> Now to see if I can kill a new MacBook with Truffle
<al2o3-cr> run them cores hot :P
laaron has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
fphilipe_ has joined #ruby
<baweaver> Regular Ruby got up to 105_916_225
laaron has joined #ruby
<baweaver> The fans are singing
deepreds1 has quit [Ping timeout: 258 seconds]
<al2o3-cr> lol :)
sauvin has joined #ruby
iMadper is now known as iMadper|AAFFFKKK
salerace has joined #ruby
DTZUZU2 has joined #ruby
deepreds1 has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
<baweaver> Waitasec though, srand is system level. We could make Rust or something do this madness instead.
salerace has quit [Ping timeout: 248 seconds]
iMadper|AAFFFKKK is now known as WhatsGoingOn
jenrzzz has joined #ruby
m_antis has quit [Quit: m_antis]
schne1der has joined #ruby
Ai9zO5AP has joined #ruby
nowhereman has joined #ruby
esp32_prog has joined #ruby
aupadhye has joined #ruby
BlueNeXuS|2 has quit [Ping timeout: 268 seconds]
esp32_prog has quit [Ping timeout: 245 seconds]
nowhereman has quit [Ping timeout: 258 seconds]
ShalokShalom has joined #ruby
schne1der has quit [Ping timeout: 268 seconds]
al2o3-cr has quit [Ping timeout: 246 seconds]
al2o3-cr has joined #ruby
<baweaver> 531_552_204, calling it a night
<baweaver> could probably make the sample set into 0 to 3 and the fizzbuzz set into that as well. Less computation
kapilp has joined #ruby
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
al2o3-cr has quit [Ping timeout: 246 seconds]
ellcs has joined #ruby
al2o3-cr has joined #ruby
fphilipe has joined #ruby
lxsameer has joined #ruby
fphilipe_ has quit [Ping timeout: 268 seconds]
TomyWork has joined #ruby
zenspider has quit [Ping timeout: 258 seconds]
zenspider has joined #ruby
giraffe has quit [Excess Flood]
haxx0r has quit [Quit: Ping timeout (120 seconds)]
giraffe has joined #ruby
cd has quit [Quit: cd]
claudiuinberlin has joined #ruby
mniip has quit [Ping timeout: 624 seconds]
ellcs has quit [Ping timeout: 250 seconds]
schne1der has joined #ruby
mniip has joined #ruby
gaussblurinc1 has joined #ruby
salerace has joined #ruby
salerace has quit [Ping timeout: 244 seconds]
salerace has joined #ruby
hightower3 has quit [Ping timeout: 272 seconds]
teclator has joined #ruby
esp32_prog has joined #ruby
cthulchu has quit [Ping timeout: 246 seconds]
octos has quit [Remote host closed the connection]
octos has joined #ruby
zapata has quit [Quit: WeeChat 2.4]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
ellcs has joined #ruby
conta has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deepreds1 has quit [Ping timeout: 244 seconds]
claudiuinberlin has joined #ruby
WhereIsMySpoon has quit [Read error: Connection reset by peer]
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has quit [Changing host]
WhereIsMySpoon has joined #ruby
uplime is now known as telnet
alem0lars has joined #ruby
alem0lars has quit [Max SendQ exceeded]
alem0lars has joined #ruby
alem0lars has quit [Ping timeout: 272 seconds]
ShalokShalom has quit [Remote host closed the connection]
Jonopoly_ has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
WhereIsMySpoon has quit [Ping timeout: 272 seconds]
WhereIsMySpoon__ has joined #ruby
podlech has quit [Quit: WeeChat 2.5-dev]
kashike has quit [Ping timeout: 252 seconds]
mikecmpbll has joined #ruby
Jonopoly_ has quit [Quit: WeeChat 2.4]
deepreds1 has joined #ruby
Jonopoly_ has joined #ruby
WhereIsMySpoon__ has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
Jonopoly_ is now known as jonopoly
jonopoly is now known as dddd
dddd is now known as Jonopoly
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Jonopoly has quit [Quit: WeeChat 2.4]
jenrzzz has quit [Ping timeout: 245 seconds]
dhollin3 has joined #ruby
Jonopoly has joined #ruby
dhollinger has quit [Ping timeout: 258 seconds]
gaussblurinc1 has quit [Quit: Leaving.]
jefffrails35 has joined #ruby
fphilipe has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
fphilipe has joined #ruby
queip has quit [Ping timeout: 258 seconds]
matheusmoreira has joined #ruby
galaxie has quit [Ping timeout: 256 seconds]
galaxie has joined #ruby
salerace has quit [Ping timeout: 246 seconds]
queip has joined #ruby
Frobozz has joined #ruby
claudiuinberlin has joined #ruby
sylario has joined #ruby
haxx0r has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
AJA4350 has joined #ruby
jenrzzz has joined #ruby
DTZUZU has quit [Ping timeout: 258 seconds]
alem0lars has joined #ruby
DTZUZU has joined #ruby
DTZUZU has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
alem0lars has quit [Ping timeout: 248 seconds]
aupadhye has joined #ruby
salerace has joined #ruby
kashike has joined #ruby
salerace has quit [Ping timeout: 258 seconds]
schne1der has quit [Ping timeout: 268 seconds]
Dysp has joined #ruby
leitz has joined #ruby
dar123 has joined #ruby
conta has quit [Quit: conta]
jenrzzz has quit [Ping timeout: 248 seconds]
GodFather has joined #ruby
dbugger has joined #ruby
kyrylo has joined #ruby
<Jonopoly> anyone used rubymotion?
<Jonopoly> tempted to give it a look
<leitz> Could use some help sorting out test data file locations. Here's the error: https://gist.github.com/LeamHall/92eaca518e63f3d01485a5b17b711185
octos has quit [Remote host closed the connection]
octos has joined #ruby
<leitz> The test data is in test/data/planets.csv, and the file is there. How do I figure out what location it's looking in?
Leopere has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
<phaul> it's dying in the require calls in tc_sm_tools. It can't find source files not test files. https://github.com/makhidkarun/free_trader/blob/make_module/lib/free_trader/sm_tools.rb#L52
<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.
<phaul> cool, np.
RougeR has joined #ruby
<RougeR> hello
<RougeR> quick question. is this bad style
<RougeR> rescue Exceptions::ElasticQueryException => @ex
<RougeR> erb :logs
wildermind has joined #ruby
<RougeR> <div class="col-md-2 col-md-offset-5 top-buffer">@ex.message</div>
<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: A space is an "unsafe" character for a URL: https://www.ietf.org/rfc/rfc1738.txt
moei has joined #ruby
salerace has joined #ruby
<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."
koomen has left #ruby ["WeeChat 2.1"]
<AndreYuhai> havenwood: But for example: 'https://avc.com/%23post-18810' This says page not found.
<havenwood> I guess we should be looking at the newer RFC: https://tools.ietf.org/html/rfc3986
<havenwood> AndreYuhai: oooooh
<AndreYuhai> havenwood: But this 'https://avc.com/#post-18810' works
fphilipe has joined #ruby
<havenwood> AndreYuhai: That's the "fragment/anchor identifier" part that other #s are escaping to avoid being accidentally mistaken for.
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
Guest39 has joined #ruby
<Guest39> hello all i was trying to create some dashboard with sinatra... anyway i was inspired by this... https://www.exploit-db.com/exploit-database-statistics
<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> which returns Base64 encoded JSON
<jhass> ah no Base64 encoded semicolon separated data
<jhass> some fields of which have JSON
<havenwood> Guest39: It's a tool people use to visualize data. I think of it as kinda enterprise or academic. https://www.tableau.com/
<havenwood> Guest39: But they're using an iframe, to serve up this Tableau data.
<Guest39> ok havenwood i wanted to build a web application with a dashboard... does it make sense to use tableau?
<Guest39> is it open source ?
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
<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?
<frojnd> Somthing like this in python
<frojnd> havenwood: that's the decoded part
<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\..."
alem0lars has quit [Ping timeout: 248 seconds]
<havenwood> frojnd: [159, 11, 136, ...
catbusters has joined #ruby
<jhass> well or the stuff from the question
<jhass> whatever works for you
<jhass> er, what deflating is compressing
<jhass> always confusing me
<jhass> so the inflate one below :D
apparition has quit [Quit: Bye]
<frojnd> thanx guys
<jhass> yw
polishdub has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 272 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinie_ has quit [Quit: ZNC 1.6.1 - http://znc.in]
brool has joined #ruby
salerace has quit [Read error: Connection reset by peer]
grilix_ has quit [Ping timeout: 250 seconds]
salerace has joined #ruby
TomyWork has quit [Remote host closed the connection]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
octos has joined #ruby
dhollin3 is now known as dhollinger
jinie has joined #ruby
deepreds1 has quit [Ping timeout: 258 seconds]
inky has joined #ruby
GodFather has joined #ruby
_inky has joined #ruby
<inky> people i have a problem: http://susepaste.org/view//31891438
jenrzzz has joined #ruby
<inky> what can i do with the segmentation fault?
<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...
<adam12> _inky: Maybe something like: env DISABLE_SSL=1 bundle pristine
<adam12> Or maybe just: env DISABLE_SSL=1 bundle pristine puma
<_inky> trying, thank you!
maryo has joined #ruby
amigraal has joined #ruby
amigraal has quit [Client Quit]
<_inky> aaa it worked! thank you!
<adam12> _inky: cheers!
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
schne1der has quit [Ping timeout: 248 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_inky has quit [Remote host closed the connection]
_inky has joined #ruby
deepreds1 has joined #ruby
cthulchu has joined #ruby
orbyt_ has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.4]
maryo has quit [Quit: Leaving]
schne1der has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
esp32_prog has quit [Ping timeout: 258 seconds]
_inky has quit [Remote host closed the connection]
_inky has joined #ruby
deepreds1 has quit [Ping timeout: 246 seconds]
brool has quit [Ping timeout: 258 seconds]
code_zombie has joined #ruby
tdy has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
claudiuinberlin has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 248 seconds]
codefriar has joined #ruby
gregf_ has quit [Ping timeout: 256 seconds]
cadeskywalker has quit [Ping timeout: 272 seconds]
codefriar has quit [Ping timeout: 272 seconds]
RougeR has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has joined #ruby
ricekrispie2 has joined #ruby
esp32_prog has joined #ruby
ricekrispie has quit [Ping timeout: 248 seconds]
duderonomy has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
cadeskywalker has joined #ruby
haxx0r has joined #ruby
esp32_prog has quit [Ping timeout: 245 seconds]
deepreds1 has joined #ruby
grilix_ has joined #ruby
gix has quit [Disconnected by services]
gix- has joined #ruby
salerace has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
zodd has quit [Ping timeout: 246 seconds]
brool has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
jenrzzz has quit [Ping timeout: 272 seconds]
jinie has joined #ruby
claudiuinberlin has joined #ruby
LtHummus has quit [Quit: ZNC 1.7.3 - https://znc.in]
LtHummus has joined #ruby
jenrzzz has joined #ruby
sameerynho has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
salerace has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 258 seconds]
octos has quit [Ping timeout: 268 seconds]
Dysp has quit [Ping timeout: 256 seconds]
sauvin has quit [Read error: Connection reset by peer]
ellcs1 has joined #ruby
jeremycw has quit [Ping timeout: 268 seconds]
wildermind has quit [Quit: Connection closed for inactivity]
dbugger has quit [Remote host closed the connection]
esp32_prog has joined #ruby
octos has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
esp32_prog has quit [Ping timeout: 258 seconds]
reber has joined #ruby
jeremycw has joined #ruby
vjacob has joined #ruby
Wolland has joined #ruby
Wolland has quit [Client Quit]
octos has quit [Remote host closed the connection]
octos has joined #ruby
conta1 has joined #ruby
kyrylo has joined #ruby
laaron- has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
GodFather has joined #ruby
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
<adam12> ledhed2222: Gotta run. Good luck.
<ledhed2222> oh nice that looks promising. ty!
yaewa has quit [Quit: Leaving...]
octos has quit [Ping timeout: 248 seconds]
renich has joined #ruby
jeremycw has quit [Ping timeout: 248 seconds]
ellcs1 has quit [Ping timeout: 258 seconds]
sylario has quit [Quit: Connection closed for inactivity]
octos has joined #ruby
Guest68 has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
Guest68 has quit [Remote host closed the connection]
niceperl has quit [Quit: Leaving...]
gmatutecr has quit [Ping timeout: 245 seconds]
graft has quit [Ping timeout: 272 seconds]
ricekrispie2 has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
ricekrispie has quit [Ping timeout: 245 seconds]
gbristol has joined #ruby
arand has quit [Ping timeout: 258 seconds]
dar123 has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has joined #ruby
jinie has joined #ruby
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]
planigan has joined #ruby
brool has quit [Ping timeout: 258 seconds]
nowhereman has joined #ruby
<Mrbuck> what
<Mrbuck> Eiam: boy ??