« Back to channel list

#ruby - 29 May 2019

« Back 1 day Forward 1 day »
[00:02:53] Swyper: has joined #ruby
[00:04:34] phaul: http://niquette.com/puzzles/randoms.htm
[00:07:46] jenrzzz: has joined #ruby
[00:10:59] skryking: has joined #ruby
[00:11:42] octos: has joined #ruby
[00:12:28] haxx0r: yeah, i read about this urban legend of school homework to make 100/200 throws and write down
[00:12:47] haxx0r: however, variance is so big, that they could perfectly go 50x head/tail pattern straight.
[00:13:08] haxx0r: saying "you guys make up numbers because you didn't have 6 in a row" sounds a bit odd to
[00:16:59] tdy: has joined #ruby
[00:17:51] 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...
[00:18:11] 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
[00:19:12] 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"
[00:19:44] 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
[00:19:56] phaul: sure. but if the probability is say less than 10^10 than I would risk my life on it
[00:19:58] haxx0r: then he continued to maxbet the 24 and lost all 2 hours later
[00:20:17] phaul: I mean 1/(10^10) ofc
[00:20:31] haxx0r: 1/ 10^10 is one out of 10 billion
[00:20:43] haxx0r: we have 8b people on earth
[00:21:00] haxx0r: so there is a good chance, that somebody dies, if we play this game with everybody on the planet
[00:21:54] haxx0r: so i won't bet my life on it
[00:22:25] phaul: yeah but most things that we do are way more dangerous
[00:23:09] haxx0r: Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16)).rand(37)
[00:23:44] haxx0r: as long this is always 10, i'm happy
[00:26:18] phaul: - always. once. that's what taking the risk 1 out of 10^10 means
[00:26:52] haxx0r: 6x black in last 30 throws :>
[00:26:54] al2o3-cr: &>> [*1..20].shuffle random: Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16))
[00:26:58] 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)
[00:27:01] al2o3-cr: &>> [*1..20].shuffle random: Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16))
[00:27:02] 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)
[00:27:04] al2o3-cr: &>> [*1..20].shuffle random: Random.new("01a111ba362fc3340608d8f33a9838e7449be319".to_i(16))
[00:27:05] 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)
[00:27:27] leftylink: I will regret this but
[00:27:28] haxx0r: i don't get that
[00:27:51] 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]
[00:27:52] rubydoc: # => 1 (https://carc.in/#/r/7036)
[00:28:05] 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]
[00:28:05] 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)
[00:28:43] haxx0r: so the seed generation looks ok
[00:28:45] haxx0r: then i'm happy
[00:28:57] 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
[00:29:23] leftylink: though maybe puts was better anyway
[00:29:30] leftylink: anyway, one gets the idea
[00:29:59] leftylink: should have just made it ...100 anyway, it wasn't going to all show up anyway
[00:30:43] al2o3-cr: leftylink: nice ;)
[00:37:59] al2o3-cr: &>> [*1..20].shuffle random: Random.new(Time.now.usec + $$ + Process.ppid)
[00:38:00] rubydoc: stderr: playpen: application terminated abnormally with signal 31 (Bad system call) (https://carc.in/#/r/7038)
[00:39:23] leftylink: unfortunate
[00:45:24] al2o3-cr: &>> [*1..20].sample random: Random.new("\x00P\x01\xC5".unpack1('N'))
[00:45:26] rubydoc: # => 10 (https://carc.in/#/r/703k)
[00:48:13] P0rkD: has joined #ruby
[00:50:56] Swyper: has joined #ruby
[00:56:52] esp32_prog: has joined #ruby
[01:16:26] jenrzzz: has joined #ruby
[01:23:15] havenwood: &>> srand 100001815082; 1.upto(15).map { |n| [*[n]*8, *%i[fizz]*4, *%i[buzz]*2, :fizzbuzz].sample }
[01:23:16] rubydoc: # => [1, 2, :fizz, 4, :buzz, :fizz, 7, 8, :fizz, :buzz, 11, :fizz, 13, 14, :fizzbuzz] (https://carc.in/#/r/703q)
[01:34:47] orbyt_: has joined #ruby
[01:36:00] duderonomy: has joined #ruby
[01:36:31] al2o3-cr: havenwood: hehe nice :)
[01:37:55] al2o3-cr: that is clever tbf
[01:45:36] P0rkD: has joined #ruby
[01:46:54] budonyc: has joined #ruby
[01:51:09] mniip: has joined #ruby
[01:59:45] baweaver: havenwood: You finally found the magic number
[02:02:46] jenrzzz: has joined #ruby
[02:11:08] mniip: has joined #ruby
[02:26:27] Wolland: has joined #ruby
[02:31:18] orbyt_: has joined #ruby
[02:40:58] houhoulis: has joined #ruby
[02:45:03] esp32_prog: has joined #ruby
[02:45:04] P0rkD: has left #ruby: ("Leaving")
[02:47:49] P0rkD: has joined #ruby
[02:49:30] jenrzzz: has joined #ruby
[02:49:45] blerrp: has left #ruby: ()
[02:51:05] Fritessaus: has left #ruby: ()
[02:53:42] laaron: has joined #ruby
[02:54:31] P0rkD: has joined #ruby
[02:56:19] P0rkD: has left #ruby: ()
[03:03:04] aither: has joined #ruby
[03:04:30] dar123: has joined #ruby
[03:09:26] braincrash: has joined #ruby
[03:10:09] Fusl: has joined #ruby
[03:14:55] graft: has joined #ruby
[03:26:15] fphilipe_: has joined #ruby
[03:27:50] jenrzzz: has joined #ruby
[03:38:12] sagax: has joined #ruby
[03:46:39] salerace: has joined #ruby
[03:51:39] Eiam: wait what the fuck am i reading
[03:51:57] Eiam: ugh brain
[03:54:44] Eiam: whats splat [n] supposed to do
[03:54:48] Eiam: irb says its not valid
[03:55:02] Eiam: SyntaxError: (irb):1
[03:55:06] luminousnine: has left #ruby: ("Leaving")
[03:55:06] codefriar: has joined #ruby
[04:02:12] leftylink: but a list can be splatted into another list
[04:02:22] leftylink: &>> [*[:a]]
[04:02:24] rubydoc: # => [:a] (https://carc.in/#/r/704j)
[04:02:46] leftylink: &>> [*[:a] * 5]
[04:02:47] rubydoc: # => [:a, :a, :a, :a, :a] (https://carc.in/#/r/704k)
[04:04:16] orbyt_: has joined #ruby
[04:07:08] laaron: has joined #ruby
[04:09:37] laaron: has joined #ruby
[04:14:05] dar123: has joined #ruby
[04:21:29] octos: has joined #ruby
[04:21:53] haxx0r: has joined #ruby
[04:23:11] podlech: has joined #ruby
[04:32:10] arahael1: has joined #ruby
[04:33:25] esp32_prog: has joined #ruby
[04:35:50] FancyEagle: has joined #ruby
[04:40:02] coffeejunk: has joined #ruby
[04:41:42] irdr: has joined #ruby
[04:44:02] bambanxx: has joined #ruby
[04:45:13] bastilian: has joined #ruby
[05:01:51] mniip: has joined #ruby
[05:02:33] al2o3-cr: havenwood: i want to see to 100
[05:04:23] StarLord__: has joined #ruby
[05:13:58] sepp2k: has joined #ruby
[05:13:58] neovalis[m]: has joined #ruby
[05:13:58] supergeek[m]: has joined #ruby
[05:13:58] turt2live: has joined #ruby
[05:14:07] kateskips: has joined #ruby
[05:17:39] hightower3: has joined #ruby
[05:22:02] 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 } }
[05:22:09] baweaver: ACTION sits back and waits
[05:24:59] kyrylo: has joined #ruby
[05:25:18] baweaver: Wait. What am I doing. I have TruffleRuby!
[05:26:51] baweaver: and TruffleRuby has? Threading!
[05:27:04] baweaver: Now to see if I can kill a new MacBook with Truffle
[05:28:58] al2o3-cr: run them cores hot :P
[05:35:38] fphilipe_: has joined #ruby
[05:35:45] baweaver: Regular Ruby got up to 105_916_225
[05:37:11] laaron: has joined #ruby
[05:38:37] baweaver: The fans are singing
[05:46:17] sauvin: has joined #ruby
[05:48:29] salerace: has joined #ruby
[05:48:59] DTZUZU2: has joined #ruby
[05:51:01] deepreds1: has joined #ruby
[05:53:02] baweaver: Waitasec though, srand is system level. We could make Rust or something do this madness instead.
[06:00:11] jenrzzz: has joined #ruby
[06:17:05] schne1der: has joined #ruby
[06:18:10] Ai9zO5AP: has joined #ruby
[06:20:30] nowhereman: has joined #ruby
[06:21:36] esp32_prog: has joined #ruby
[06:22:22] aupadhye: has joined #ruby
[06:33:17] ShalokShalom: has joined #ruby
[06:37:54] al2o3-cr: has joined #ruby
[06:42:01] baweaver: 531_552_204, calling it a night
[06:43:45] baweaver: could probably make the sample set into 0 to 3 and the fizzbuzz set into that as well. Less computation
[06:45:45] kapilp: has joined #ruby
[06:46:59] ellcs: has joined #ruby
[06:47:53] ellcs: has joined #ruby
[06:48:38] ellcs: has joined #ruby
[06:49:34] al2o3-cr: has joined #ruby
[06:54:24] fphilipe: has joined #ruby
[06:55:11] lxsameer: has joined #ruby
[07:00:41] TomyWork: has joined #ruby
[07:03:02] zenspider: has joined #ruby
[07:04:10] giraffe: has joined #ruby
[07:05:23] claudiuinberlin: has joined #ruby
[07:10:03] schne1der: has joined #ruby
[07:10:20] mniip: has joined #ruby
[07:15:21] gaussblurinc1: has joined #ruby
[07:18:47] salerace: has joined #ruby
[07:32:37] salerace: has joined #ruby
[07:35:35] teclator: has joined #ruby
[07:45:19] esp32_prog: has joined #ruby
[07:51:28] octos: has joined #ruby
[07:55:59] laaron: has joined #ruby
[07:57:09] ellcs: has joined #ruby
[08:03:29] conta: has joined #ruby
[08:09:23] claudiuinberlin: has joined #ruby
[08:10:59] WhereIsMySpoon: has joined #ruby
[08:10:59] WhereIsMySpoon: has joined #ruby
[08:17:27] alem0lars: has joined #ruby
[08:18:11] alem0lars: has joined #ruby
[08:28:07] Jonopoly_: has joined #ruby
[08:29:50] WhereIsMySpoon__: has joined #ruby
[08:39:13] mikecmpbll: has joined #ruby
[08:43:06] deepreds1: has joined #ruby
[08:45:41] Jonopoly_: has joined #ruby
[08:57:02] WhereIsMySpoon__: has left #ruby: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[09:01:14] dhollin3: has joined #ruby
[09:02:17] Jonopoly: has joined #ruby
[09:07:03] jefffrails35: has joined #ruby
[09:09:22] jenrzzz: has joined #ruby
[09:09:43] fphilipe: has joined #ruby
[09:16:11] matheusmoreira: has joined #ruby
[09:23:24] galaxie: has joined #ruby
[09:27:14] queip: has joined #ruby
[09:28:44] Frobozz: has joined #ruby
[09:29:01] claudiuinberlin: has joined #ruby
[09:29:58] Sylario: has joined #ruby
[09:30:49] haxx0r: has joined #ruby
[09:40:39] Mia: has joined #ruby
[09:40:39] Mia: has joined #ruby
[09:41:42] AJA4350: has joined #ruby
[09:44:53] jenrzzz: has joined #ruby
[09:57:39] alem0lars: has joined #ruby
[09:58:10] dtzuzu: has joined #ruby
[10:22:45] jenrzzz: has joined #ruby
[10:32:07] aupadhye: has joined #ruby
[10:38:55] salerace: has joined #ruby
[10:42:14] kashike: has joined #ruby
[10:45:45] Dysp: has joined #ruby
[10:46:47] leitz: has joined #ruby
[10:53:47] dar123: has joined #ruby
[10:59:36] GodFather: has joined #ruby
[11:01:26] Dbugger: has joined #ruby
[11:15:48] kyrylo: has joined #ruby
[11:18:11] Jonopoly: anyone used rubymotion?
[11:18:16] Jonopoly: tempted to give it a look
[11:19:17] leitz: Could use some help sorting out test data file locations. Here's the error: https://gist.github.com/LeamHall/92eaca518e63f3d01485a5b17b711185
[11:20:23] leitz: The line 9 error comes from: https://github.com/makhidkarun/free_trader/blob/make_module/test/tc_sm_tools.rb#L19-L27
[11:20:59] leitz: Which references: https://github.com/makhidkarun/free_trader/blob/make_module/lib/free_trader/sm_tools.rb#L51-L61
[11:21:29] octos: has joined #ruby
[11:21:47] 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?
[11:24:49] jenrzzz: has joined #ruby
[11:26:24] 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
[11:27:31] 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
[11:31:10] 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.
[11:31:52] phaul: cool, np.
[11:44:45] RougeR: has joined #ruby
[11:44:59] RougeR: quick question. is this bad style
[11:45:17] RougeR: rescue Exceptions::ElasticQueryException => @ex
[11:45:19] RougeR: erb :logs
[11:45:22] wildermind: has joined #ruby
[11:46:05] RougeR: <div class="col-md-2 col-md-offset-5 top-buffer">@ex.message</div>
[11:55:26] 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?
[11:56:46] RougeR: leitz, its exactly the same usage. standard style for ruby is to use e/ex when rescuing exceptions
[11:57:01] RougeR: im just using it to present the message in the view
[11:57:14] RougeR: i think its fairly clear, but im not sure if its good practice
[11:57:37] RougeR: still good point, 1 point for it, for being clear in that regards
[11:57:41] schne1der: has joined #ruby
[12:00:57] jinie_: has joined #ruby
[12:25:36] codefriar: has joined #ruby
[12:31:20] jenrzzz: has joined #ruby
[12:32:23] leitz: I'm working on a large, undocumented, and poorly tested code base. I appreciate all the clarity I can get. :)
[12:33:58] vondruch_: has joined #ruby
[12:40:20] yasumi2136: has joined #ruby
[12:41:04] salerace: has joined #ruby
[12:46:47] yasumi2136_: has joined #ruby
[12:49:13] grilix_: has joined #ruby
[12:51:25] gigetoo: has joined #ruby
[12:51:28] octos: has joined #ruby
[12:51:31] rafadc: has joined #ruby
[13:02:29] alem0lars: has joined #ruby
[13:04:08] tdy: has joined #ruby
[13:06:05] vondruch: has joined #ruby
[13:07:51] apparition: has joined #ruby
[13:12:21] Zoddo: has joined #ruby
[13:22:26] koomen: has joined #ruby
[13:24:33] 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
[13:24:35] koomen: in functions in ruby
[13:25:46] phaul: these days yard is at least as popular as rdoc
[13:26:00] 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.
[13:27:32] phaul: for open source you can push it to https://inch-ci.org/ and see some metrics bout your docs
[13:28:24] koomen: So, what is the recommended one people prefer to use? RDoc or YARD?
[13:29:28] phaul: I go with yard
[13:31:12] koomen: yard seems to be nicer to me
[13:31:25] adam12: If you use all it's features, it definitely outputs nicer docs.
[13:31:56] adam12: It's a shame that Loren Segals's work to unify docs were kinda stonewalled.
[13:33:32] jenrzzz: has joined #ruby
[13:37:53] Inline: has joined #ruby
[13:42:33] ffl^: has joined #ruby
[13:45:18] 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.
[13:46:50] dtzuzu: has joined #ruby
[13:49:35] marz_d`ghostman: has joined #ruby
[13:50:32] AndreYuhai: has joined #ruby
[13:52:26] zapata: has joined #ruby
[13:54:05] marz_d`ghostman: Aside from Heroku, what other viable good options do you deploy ruby/ror apps?
[13:54:20] Rapture: has joined #ruby
[13:59:41] AJA4351: has joined #ruby
[14:01:06] frojnd: has joined #ruby
[14:01:10] frojnd: Hi there.
[14:01:16] vondruch_: has joined #ruby
[14:01:52] 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?
[14:01:56] 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
[14:02:09] frojnd: Looks like this: [31,-117,8,0,0,0,0,0,0,0,-115,-111]
[14:02:15] koomen: leitz: well, code might be properly documented, but not with '@param ... ' syntax etc
[14:02:55] leitz: marz_d`ghostman, I'm looking at Google App Engine, but am a newbie and just started.
[14:02:59] frojnd: Any ideas?
[14:03:19] 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.
[14:03:24] ljarvis_: has joined #ruby
[14:03:36] havenwood: marz_d`ghostman: Or just DO
[14:04:32] 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. :)
[14:05:08] SeepingN: has joined #ruby
[14:05:27] 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.
[14:05:35] havenwood: frojnd: Negatives?
[14:05:58] havenwood: frojnd: Are you sure those are bytes?
[14:07:29] 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?
[14:14:15] havenwood: AndreYuhai: A space is an "unsafe" character for a URL: https://www.ietf.org/rfc/rfc1738.txt
[14:14:15] moei: has joined #ruby
[14:14:23] salerace: has joined #ruby
[14:14:32] havenwood: AndreYuhai: The percent encoding is correct.
[14:15:05] 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."
[14:15:15] havenwood: AndreYuhai: "All unsafe characters must always be encoded within a URL."
[14:16:07] havenwood: frojnd: Is that all the data you've captured?
[14:17:32] 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.
[14:18:25] havenwood: AndreYuhai: # is unsafe too and should be encoded as well. It'll decode back to #
[14:18:54] 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."
[14:19:05] koomen: has left #ruby: ("WeeChat 2.1")
[14:22:08] AndreYuhai: havenwood: But for example: 'https://avc.com/%23post-18810' This says page not found.
[14:22:12] havenwood: I guess we should be looking at the newer RFC: https://tools.ietf.org/html/rfc3986
[14:22:30] havenwood: AndreYuhai: oooooh
[14:22:31] AndreYuhai: havenwood: But this 'https://avc.com/#post-18810' works
[14:24:36] fphilipe: has joined #ruby
[14:25:50] havenwood: AndreYuhai: That's the "fragment/anchor identifier" part that other #s are escaping to avoid being accidentally mistaken for.
[14:27:00] iNs: has joined #ruby
[14:28:42] havenwood: AndreYuhai: https://tools.ietf.org/html/rfc3986#section-3.5
[14:28:59] Guest39: has joined #ruby
[14:29:20] 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
[14:29:26] 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?
[14:29:29] jhass: basically the fragment shouldn't even be sent to the server, it's interpreted by client side JS in this case
[14:29:38] jhass: not sure you'll have much success with mechanize here
[14:29:58] jhass: might be better to reverse engineer the internal API the client JS app uses
[14:30:03] Guest39: jhass sorry i did not understnd... where is the data for the plots taken ? i cannot find it in html
[14:30:14] jhass: Guest39: wasn't for you, but for AndreYuhai :)
[14:30:28] Guest39: ohh ok sorry jhass
[14:32:08] 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.
[14:32:37] AndreYuhai: And it only encodes when you have space too. I mean if you do not have any space then it does not encode.
[14:32:44] havenwood: Guest39: The data is coming from Tableau.
[14:33:09] Guest39: havenwood what's this tableau ? is it a common solution ?
[14:33:29] AndreYuhai: For example if you have "...com/#section" this does not get encoded, but "...com/#section ruby" gets encoded as "23%section%20ruby"
[14:33:33] jhass: specifically the post request to https://public.tableau.com/vizql/w/EDB-1/v/AllEntries/bootstrapSession/sessions/467792DBF519404690515526E6987DCF-0:0
[14:33:47] jhass: which returns Base64 encoded JSON
[14:34:09] jhass: ah no Base64 encoded semicolon separated data
[14:34:18] jhass: some fields of which have JSON
[14:34:24] havenwood: Guest39: It's a tool people use to visualize data. I think of it as kinda enterprise or academic. https://www.tableau.com/
[14:34:58] havenwood: Guest39: But they're using an iframe, to serve up this Tableau data.
[14:35:32] Guest39: ok havenwood i wanted to build a web application with a dashboard... does it make sense to use tableau?
[14:35:36] Guest39: is it open source ?
[14:38:27] 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
[14:39:47] 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.
[14:39:58] AndreYuhai: jhass: How can I fix this then? I am lost. :D
[14:40:36] AndreYuhai: I mean if I don't fix it then the URL I request is wrong so I can't view that page.
[14:40:56] 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
[14:41:42] jenrzzz: has joined #ruby
[14:44:41] jhass: ok it looks like you can just ignore the fragment
[14:44:46] jhass: where did you find a link with it?
[14:46:18] claudiuinberlin: has joined #ruby
[14:49:08] 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.
[14:50:39] 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
[14:51:25] polishdub: has joined #ruby
[14:53:52] frojnd: havenwood: yeah, that's gziped
[14:54:12] fphilipe: has joined #ruby
[14:55:41] havenwood: frojnd: and they're signed bytes?
[14:55:54] havenwood: frojnd: that's the whole payload, or just a sample?
[14:56:31] frojnd: https://repl.it/repls/LiquidInexperiencedAdware
[14:56:39] frojnd: Somthing like this in python
[14:56:53] frojnd: havenwood: that's the decoded part
[14:56:55] havenwood: frojnd: so it's -128-127 for the bytes instead of 0-255 like we're expecting?
[14:56:59] frojnd: it shoild be a json result
[14:57:12] frojnd: havenwood: not this is just a part of dedoded stuff
[14:57:26] frojnd: I forgot I didn't paste the whole example
[14:58:16] frojnd: havenwood: yeah -128-127
[14:58:54] havenwood: frojnd: It's a lot clearer with the code! So what's the question?
[14:59:05] frojnd: How to port that python code to ruby haha
[14:59:08] jhass: then just shift it to 0-255, .pack("C*") and pass the result a gzip deflater
[14:59:26] frojnd: jhass: how do I shift it?
[14:59:43] havenwood: frojnd: subtract 128
[14:59:44] jhass: .map {|b| b + 128 }
[14:59:54] jeremycw: has joined #ruby
[14:59:57] havenwood: or add 128 in the other direction
[14:59:59] fphilipe: has joined #ruby
[15:00:21] havenwood: frojnd: if that's your Python code, just use unsigned bytes from the start
[15:01:11] 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.
[15:01:14] frojnd: Not my code...
[15:01:37] havenwood: frojnd: adding 128 is easy, at least :)
[15:03:25] frojnd: Well a.map {|b| b + 128 }.pack("C*") I need to pass to the result a gzip defalter
[15:03:31] frojnd: how do I do that :D
[15:03:36] frojnd: One liners are the best
[15:03:37] salerace: has joined #ruby
[15:04:20] frojnd: Now the resul is smth like this: => "\x9F\v\x88\x80\..."
[15:04:52] havenwood: frojnd: [159, 11, 136, ...
[15:05:47] catbusters: has joined #ruby
[15:06:08] jhass: https://stackoverflow.com/a/1366187/2199687
[15:06:27] jhass: well or the stuff from the question
[15:06:33] jhass: whatever works for you
[15:06:55] havenwood: http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html
[15:07:05] jhass: er, what deflating is compressing
[15:07:08] jhass: always confusing me
[15:07:14] jhass: so the inflate one below :D
[15:10:41] frojnd: thanx guys
[15:29:05] brool: has joined #ruby
[15:32:20] salerace: has joined #ruby
[15:35:50] octos: has joined #ruby
[15:41:25] jinie: has joined #ruby
[15:43:13] inky: has joined #ruby
[15:44:12] GodFather: has joined #ruby
[15:44:39] vinky: has joined #ruby
[15:45:05] inky: people i have a problem: http://susepaste.org/view//31891438
[15:47:07] jenrzzz: has joined #ruby
[15:47:11] inky: what can i do with the segmentation fault?
[15:47:14] inky: please write to _inky, need to exit this device now.
[15:48:37] 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.
[15:50:05] 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.
[15:50:35] yaewa: has joined #ruby
[15:53:05] rippa: has joined #ruby
[15:53:58] vinky: hmmmm, i do it with bundler, by some config in mastodon...
[15:54:41] adam12: _inky: Maybe something like: env DISABLE_SSL=1 bundle pristine
[15:55:39] adam12: Or maybe just: env DISABLE_SSL=1 bundle pristine puma
[15:55:56] vinky: trying, thank you!
[15:55:57] maryo: has joined #ruby
[15:57:17] amigraal: has joined #ruby
[15:59:12] vinky: aaa it worked! thank you!
[15:59:19] adam12: _inky: cheers!
[16:02:23] duderonomy: has joined #ruby
[16:08:57] vinky: has joined #ruby
[16:09:33] deepreds1: has joined #ruby
[16:11:06] cthulchu: has joined #ruby
[16:11:44] orbyt_: has joined #ruby
[16:20:13] schne1der: has joined #ruby
[16:27:09] vinky: has joined #ruby
[16:31:36] code_zombie: has joined #ruby
[16:32:20] tdy: has joined #ruby
[16:34:32] claudiuinberlin: has joined #ruby
[16:40:40] codefriar: has joined #ruby
[16:48:10] jenrzzz: has joined #ruby
[16:53:12] gix: has joined #ruby
[16:53:16] ricekrispie2: has joined #ruby
[16:54:29] esp32_prog: has joined #ruby
[16:55:56] duderonomy: has joined #ruby
[16:57:24] laaron: has joined #ruby
[16:57:37] cadeskywalker: has joined #ruby
[16:57:42] haxx0r: has joined #ruby
[17:03:23] deepreds1: has joined #ruby
[17:13:26] grilix_: has joined #ruby
[17:19:07] gix-: has joined #ruby
[17:23:52] jenrzzz: has joined #ruby
[17:25:38] brool: has joined #ruby
[17:28:59] jinie: has joined #ruby
[17:29:06] claudiuinberlin: has joined #ruby
[17:37:05] LtHummus: has joined #ruby
[17:39:21] jenrzzz: has joined #ruby
[17:40:01] sameerynho: has joined #ruby
[17:46:04] salerace: has joined #ruby
[17:47:48] esp32_prog: has joined #ruby
[18:33:42] ellcs1: has joined #ruby
[18:48:11] esp32_prog: has joined #ruby
[18:48:49] octos: has joined #ruby
[18:53:28] reber: has joined #ruby
[18:57:15] jeremycw: has joined #ruby
[19:03:22] vjacob: has joined #ruby
[19:04:21] Wolland: has joined #ruby
[19:07:48] octos: has joined #ruby
[19:08:52] conta1: has joined #ruby
[19:12:31] kyrylo: has joined #ruby
[19:16:25] laaron-: has joined #ruby
[19:29:01] GodFather: has joined #ruby
[19:31:12] graft: has joined #ruby
[19:31:12] graft: has joined #ruby
[19:34:03] blackmesa: has joined #ruby
[19:38:37] kapilp: has joined #ruby
[19:41:19] jenrzzz: has joined #ruby
[19:48:05] ricekrispie: has joined #ruby
[20:00:32] yokel: has joined #ruby
[20:07:01] Freshnuts: has joined #ruby
[20:12:19] octos: has joined #ruby
[20:14:32] Dbugger: has joined #ruby
[20:15:39] vinky: has joined #ruby
[20:20:02] vinky: has joined #ruby
[20:21:14] inky: has joined #ruby
[20:22:00] inky: has joined #ruby
[20:30:43] andrzejku: has joined #ruby
[20:30:43] SeepingN: has joined #ruby
[20:31:20] inky: has left #ruby: ("IRC for Sailfish 0.9")
[20:36:31] esp32_prog: has joined #ruby
[20:37:08] octos: has joined #ruby
[20:39:20] r29v: has joined #ruby
[20:40:24] claudiuinberlin: has joined #ruby
[20:41:30] matheusmoreira: has joined #ruby
[20:42:43] mozzarella: has joined #ruby
[20:45:52] ellcs1: has joined #ruby
[20:50:33] gmatutecr: has joined #ruby
[20:53:51] Fr4n: has joined #ruby
[20:56:20] budonyc: has joined #ruby
[20:59:38] dtzuzu: has joined #ruby
[21:00:33] vondruch_: has joined #ruby
[21:07:19] francisco: has joined #ruby
[21:12:37] jenrzzz: has joined #ruby
[21:16:28] teardown: has joined #ruby
[21:17:43] Freshnuts: has joined #ruby
[21:28:48] niceperl: has joined #ruby
[21:48:53] morozovm: has joined #ruby
[21:54:41] AJA4351: has joined #ruby
[21:54:59] dar123: has joined #ruby
[21:56:00] ledhed2222: has joined #ruby
[21:56:43] ledhed2222: howdy. i’m writing a service object that will have a long list of parameters, which i’d like to be KW args.
[21:56:53] ledhed2222: i have two questions for you all!
[21:57:47] 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
[21:58:18] 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
[21:59:02] 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
[21:59:05] ledhed2222: any thoughts?
[21:59:43] brool: has joined #ruby
[22:00:06] 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.
[22:01:02] 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.
[22:01:08] ledhed2222: also what do you mean by a dry-initializer?
[22:01:11] 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
[22:01:30] adam12: ledhed2222: https://dry-rb.org/gems/dry-initializer/
[22:01:35] adam12: ledhed2222: Gotta run. Good luck.
[22:02:05] ledhed2222: oh nice that looks promising. ty!
[22:05:37] Renich: has joined #ruby
[22:15:10] octos: has joined #ruby
[22:16:25] Guest68: has joined #ruby
[22:20:20] jenrzzz: has joined #ruby
[22:20:22] graft: has joined #ruby
[22:20:22] graft: has joined #ruby
[22:24:43] esp32_prog: has joined #ruby
[22:36:06] ricekrispie2: has joined #ruby
[22:40:13] gbristol: has joined #ruby
[22:50:29] orbyt_: has joined #ruby
[22:53:16] jinie: has joined #ruby
[23:01:06] Mrbuck: has joined #ruby
[23:01:21] Mrbuck: Hi ruby still alive ?
[23:02:08] AJA4351: has joined #ruby
[23:14:36] Mrbuck: good i want to learn ruby
[23:15:10] galaxie: #RIPRuby, it's been fun..
[23:16:06] Mrbuck: 4 years back when I seek help no one helped then I moved to pythin and ruby dead
[23:20:18] bambanx: has joined #ruby
[23:21:35] Renich: has joined #ruby
[23:23:51] ltd: has joined #ruby
[23:26:31] graft: has joined #ruby
[23:26:40] graft: has joined #ruby
[23:29:45] morozovm: has joined #ruby
[23:34:13] galaxie: Mrbuck: Where'd you seek help at?
[23:37:47] Mrbuck: galaxie: here I asked some one to write some code and no one helped
[23:38:35] 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.
[23:39:22] Mrbuck: galaxie: but that time I was desperately need some one to write whole code
[23:39:26] wald0: has joined #ruby
[23:39:48] Mrbuck: I had sad days
[23:42:19] galaxie: Ever tried cash? Magic sometimes.
[23:42:19] gbristol: yeah lube up the code tubes with some cash
[23:43:21] galaxie: If your handle is any indicator, lol
[23:43:56] orbyt_: has joined #ruby
[23:45:00] haxx0r: has joined #ruby
[23:47:04] helpa: has joined #ruby
[23:47:57] Eiam: i had sad days, oh oby
[23:49:43] planigan: has joined #ruby
[23:56:37] nowhereman: has joined #ruby
[23:57:18] Mrbuck: Eiam: boy ??