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!
<leftylink> "I see you walking by every day" ?
<leftylink> sorry, that's just the first thing that comes to mind if someone just says "boy" in one sentence with no other context
graft has quit [Ping timeout: 272 seconds]
skryking has quit [Ping timeout: 258 seconds]
skryking has joined #ruby
planigan has quit [Read error: Connection reset by peer]
leitz has quit [Quit: Leaving]
planigan has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 272 seconds]
Vingador has joined #ruby
weteamsteve has joined #ruby
codefriar has joined #ruby
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
renich has quit [Remote host closed the connection]
codefriar has quit [Ping timeout: 246 seconds]
Mrbuck has quit [Remote host closed the connection]
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
renich has joined #ruby
code_zombie has quit [Quit: Leaving]
morozovm has joined #ruby
graft has quit [Ping timeout: 246 seconds]
morozovm has quit [Ping timeout: 258 seconds]
evdubs has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
evdubs has joined #ruby
leftylink has quit [Ping timeout: 244 seconds]
leftylink has joined #ruby
ellcs1 has joined #ruby
planigan has quit [Ping timeout: 245 seconds]
brool has joined #ruby
planigan has joined #ruby
renich has quit [Remote host closed the connection]
codefriar has joined #ruby
codefriar has quit [Remote host closed the connection]
cd has joined #ruby
renich has joined #ruby
<haxx0r> winners = {}; 0.upto(36){|i| winners[i]=[]}
<haxx0r> how to optimize that ?
CrazyEddy has quit [Remote host closed the connection]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 248 seconds]
AJA4351 is now known as AJA4350
orbyt_ has joined #ruby
ellcs1 has quit [Ping timeout: 250 seconds]
renich has quit [Remote host closed the connection]
renich has joined #ruby
houhoulis has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
<havenwood> haxx0r: 37.times.to_h { |n| [n, []] }
<haxx0r> lovely. thanks
<havenwood> haxx0r: Another way that'll work in older Rubies, without the block form of #to_h: Array.new(37) { |n| [n, []] }.to_h
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
<haxx0r> ah, that's the way i learned back in the days. couldnt remember.
<havenwood> &>> 37.times.to_h { |n| [n, []] }
<rubydoc> # => {0=>[], 1=>[], 2=>[], 3=>[], 4=>[], 5=>[], 6=>[], 7=>[], 8=>[], 9=>[], 10=>[], 11=>[], 12=>[], 13=>[],... check link for more (https://carc.in/#/r/70bp)
morozovm has joined #ruby
budonyc has quit [Quit: Leaving]
graft has quit [Ping timeout: 248 seconds]
morozovm has quit [Ping timeout: 272 seconds]
arand has joined #ruby
DTZUZU has quit [Ping timeout: 246 seconds]
teardown has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 244 seconds]
Vingador has quit [Remote host closed the connection]
ffl^ has quit []
shah^ has joined #ruby
morozovm has joined #ruby
siasmj has joined #ruby
<baweaver> haxx0r / havenwood: Why a Hash though?
<haxx0r> because roulette
<baweaver> &>> Array.new(37) { [] }
<rubydoc> # => [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [],... check link for more (https://carc.in/#/r/70cg)
<baweaver> Array would be less overhead, and indexes are free
<haxx0r> actually smart
<haxx0r> because i need 0-36, which is the index.
<baweaver> That, and arrays would be inefficient for this
<baweaver> Sets would be better for each subgroup
<baweaver> Also do you count 00 in there?
<haxx0r> where is 00/
<haxx0r> ?
<haxx0r> americans... always doing their own shit. lol :)
<haxx0r> no 00 for me
<haxx0r> american roulette actually bigger edge for the house
braincrash has quit [Quit: bye bye]
bambanx has quit [Quit: Leaving]
<haxx0r> american roulette is a total scam, would never play. 1/35 payout for 1/37 chance vs european 1/35 pay for 1/36...
<haxx0r> and for red/black it's insane
<haxx0r> the edge on european tables are 2.7%, while american roulette is 5.26%. who the heck plays on american tables?
brool has quit [Ping timeout: 248 seconds]
haxx0r88 has joined #ruby
braincrash has joined #ruby
haxx0r has quit [Ping timeout: 245 seconds]
<Eiam> everyone in las vegas?
wald0 has quit [Quit: Lost terminal]
AJA4350 has quit [Quit: AJA4350]
<haxx0r88> guess what, there is european roulette in vegas and atlantic city
morozovm has quit [Remote host closed the connection]
morozovm has joined #ruby
morozovm has quit [Remote host closed the connection]
morozovm has joined #ruby
morozovm has quit [Remote host closed the connection]
morozovm has joined #ruby
morozovm has quit [Remote host closed the connection]
morozovm has joined #ruby
<Eiam> shows how much I gamble
<Eiam> (never)
morozovm has quit [Remote host closed the connection]
morozovm has joined #ruby
morozovm has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has joined #ruby
gix- has quit [Ping timeout: 258 seconds]
<baweaver> Na, SF. We tend to gamble on the stock market along with our friends in NYC
jenrzzz has joined #ruby
esp32_prog has joined #ruby
tdy has joined #ruby
esp32_prog has quit [Ping timeout: 272 seconds]
_whitelogger has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
haxx0r88 has quit [Quit: Ping timeout (120 seconds)]
jenrzzz has joined #ruby
nowhere_man has joined #ruby
nowhereman has quit [Ping timeout: 258 seconds]
houhoulis has quit [Remote host closed the connection]
weteamsteve has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
kyrylo has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
Freshnuts has quit [Read error: Connection reset by peer]
Freshnuts has joined #ruby
vondruch has quit [Quit: vondruch]
<m17> I am trying got mimic bash shell at /bin/sh using ruby I.e create a PTY in ruby and display the shell. I am able to write and read and write to the Pty but can't do it in realtime, plus not able to get the output of the terminal until I write into it.
esp32_prog has joined #ruby
<m17> What am I missing here?
blackmesa has joined #ruby
esp32_prog has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
blackmesa has quit [Ping timeout: 258 seconds]
Ai9zO5AP has joined #ruby
haxx0r has joined #ruby
vondruch has joined #ruby
vondruch has quit [Client Quit]
schne1der has joined #ruby
vondruch has joined #ruby
<haxx0r> is there a function to find the next 10ths number for an integer? for 102 it's 110, for 109 it's 110 ?
<haxx0r> weired to describe
<haxx0r> current = $redis.get("last_block").to_i
<haxx0r> this is working, but kinda ugly.
sauvin has joined #ruby
schne1der has quit [Ping timeout: 272 seconds]
<baweaver> haxx0r: Round up to the nearest 10?
<baweaver> &>> def ceil_10(n) (n / 10r).ceil * 10 end; [102, 109, 111].map(&method(:ceil_10))
<rubydoc> # => [110, 110, 120] (https://carc.in/#/r/70dn)
<baweaver> haxx0r: ^
<haxx0r> i shoud patch ruby core quick . useful method
<baweaver> r is rational, and basically just used to avoid float
<haxx0r> same for ceil_100, ceil_1000
<baweaver> Ever seen closures?
blackmesa has joined #ruby
<baweaver> &>> def ceil_n(n) -> v { ( v / Rational(n) ).ceil * n } end; [10, 100, 1000].map { |n| [1, 124, 1235, 152, 126456].map(&ceil_n(n)) }
<rubydoc> # => [[10, 130, 1240, 160, 126460], [100, 200, 1300, 200, 126500], [1000, 1000, 2000, 1000, 127000]] (https://carc.in/#/r/70do)
<baweaver> Closures are a bit easier to understand with addition though
<baweaver> They're functions which return functions, and those returned functions remember the context they were created in
<baweaver> &>> adds = -> a { -> b { a + b } }; (1..5).map(&adds[5])
<rubydoc> # => [6, 7, 8, 9, 10] (https://carc.in/#/r/70dp)
<baweaver> haxx0r ^
<haxx0r> you should make a pullrequest for ruby core
<baweaver> Na, they'd probably not see much of a need for it.
<haxx0r> they are closed minded people then
<baweaver> Not sure that's really an accurate description
<haxx0r> i can ceil for every decimal but not for integers. fail
<baweaver> That function can be made in a few minutes, or put into a gem easily enough
blackmesa has quit [Client Quit]
alem0lars has joined #ruby
haxx0r has quit [Remote host closed the connection]
aupadhye has joined #ruby
schne1der has joined #ruby
reber has joined #ruby
lxsameer has joined #ruby
esp32_prog has joined #ruby
ellcs1 has joined #ruby
esp32_prog has quit [Ping timeout: 272 seconds]
claudiuinberlin has joined #ruby
morozovm has joined #ruby
esp32_prog has joined #ruby
morozovm has quit [Ping timeout: 258 seconds]
haxx0r has joined #ruby
blackmesa has joined #ruby
reber has quit [Read error: Connection timed out]
reber has joined #ruby
matheusmoreira has quit [Ping timeout: 248 seconds]
conta has joined #ruby
matheusmoreira has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
mikecmpbll has joined #ruby
blackmesa has quit [Read error: Connection reset by peer]
blackmesa1 has joined #ruby
Jonopoly has joined #ruby
salerace has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
dbugger has joined #ruby
ellcs1 has quit [Ping timeout: 264 seconds]
ricekrispie has joined #ruby
ricekrispie2 has quit [Ping timeout: 244 seconds]
conta has quit [Remote host closed the connection]
conta has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
blackmesa1 has quit [Ping timeout: 250 seconds]
morozovm has joined #ruby
blackmesa1 has joined #ruby
morozovm has quit [Ping timeout: 246 seconds]
blackmesa1 has quit [Ping timeout: 248 seconds]
FernandoB has joined #ruby
ShalokShalom has joined #ruby
ShalokShalom has left #ruby [#ruby]
yqt has joined #ruby
morozovm has joined #ruby
AJA4350 has joined #ruby
alem0lars has quit [Remote host closed the connection]
matheusmoreira has quit [Ping timeout: 258 seconds]
matheusmoreira has joined #ruby
jefffrails35 has joined #ruby
FernandoB has quit [Remote host closed the connection]
frojnd has left #ruby ["WeeChat 1.6"]
renich has quit [Ping timeout: 245 seconds]
ravenousmoose has joined #ruby
esp32_prog has joined #ruby
jefffrails35 has quit [Ping timeout: 272 seconds]
esp32_prog has quit [Ping timeout: 244 seconds]
hanmac has joined #ruby
tdy has quit [Ping timeout: 248 seconds]
Freshnuts has quit [Quit: Leaving]
Ltem has joined #ruby
CrazyEddy has joined #ruby
morozovm has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
claudiuinberlin has quit [Ping timeout: 258 seconds]
blackmesa1 has joined #ruby
Swyper has joined #ruby
cd has quit [Quit: cd]
blackmesa1 has quit [Ping timeout: 252 seconds]
shortCircuit__ has joined #ruby
<shortCircuit__> hi
<al2o3-cr> o/
<shortCircuit__> Is there a way to create a httpresponse object with nil body and 503 status code
<shortCircuit__> Net::HTTPResponse.new("1.1", 503, "hello").body this doesn't work. says `undefined method `closed?' for nil:NilClass`
jenrzzz has joined #ruby
envex has quit [Remote host closed the connection]
envex has joined #ruby
<phaul> shortCircuit__: what are you trying to achieve? this sounds like xy problem
<phaul> HTTPResponse is given to you by the library, not something that you create...
arahael1 is now known as Arahael
<phaul> note the " #:nodoc: internal use only " at the documentation
<shortCircuit__> phaul the problem is a little deep. I have to introduce hystrix in an existing rails project. The project uses faraday as an http client. So I wrote a middleware that wraps the faraday's http call (@app.call env). The problem is if the request fails, and it goes to fallback, I can't just return false, I need to return a, say, mock http response object that has success? and status, body etc
<shortCircuit__> so that the whole thing is backward compatible
Swyper has quit [Remote host closed the connection]
blackmesa1 has joined #ruby
leitz has joined #ruby
<phaul> does it work if you set body to '' ? r = Net::HTTPResponse.new("1.1", 503, "hello") ; r.body = ''; r
<phaul> &>> require 'net/http' ; r = Net::HTTPResponse.new("1.1", 503, "hello") ; r.body = ''; r.body
<rubydoc> stderr: /usr/lib/ruby/2.6.0/net/http/response.rb:333:in `stream_check': undefined method `closed?' for nil:NilClass (NoMethodError) (https://carc.in/#/r/70eh)
<phaul> apparently not
<al2o3-cr> the problem is body calls read_body which calls stream_check which checks @socket.closed?
<al2o3-cr> which obviously @socket is nil at this time.
morozovm has joined #ruby
<phaul> fake = Object.new; def fake.closed? false; end; r.instance_variable_set(:@socket, fake)
* phaul sigh
<phaul> :)
<al2o3-cr> :P
morozovm has quit [Ping timeout: 258 seconds]
FastJack has quit [Ping timeout: 264 seconds]
shortCircuit__ has quit [Ping timeout: 248 seconds]
<phaul> &>> require 'net/http' ; r = Net::HTTPResponse.new("1.1", 503, "hello"); fake = Object.new; def fake.closed?; false; end; r.instance_variable_set(:@socket, fake); r.body
<rubydoc> # => nil (https://carc.in/#/r/70ei)
<phaul> just when they left
<al2o3-cr> just too late :(
<al2o3-cr> phaul: they might be back as they ping out
<al2o3-cr> pinged timed out
haxx0r has quit [Quit: Ping timeout (120 seconds)]
<al2o3-cr> &>> require 'net/http'; Net::HTTPResponse.new("1.1", 503, "").then { |r| r.instance_variable_set(:@socket, def closed?() false end); [r.http_version, r.code, r.body] }
<rubydoc> stderr: /usr/lib/ruby/2.6.0/net/http/response.rb:333:in `stream_check': private method `closed?' called for... check link for more (https://carc.in/#/r/70ej)
<al2o3-cr> ah, oh well.
haxx0r has joined #ruby
<phaul> but you are setting socket to be the sym :closed? or am I reading that wrong
FastJack has joined #ruby
<al2o3-cr> phaul: i tested in irb
<phaul> but def returns :closed?
<al2o3-cr> phaul: hows that working in pry
<phaul> let me try here...
<al2o3-cr> i'm confused
<phaul> me too
<phaul> it works here too
<al2o3-cr> weird hey
<phaul> but we also defined an instance method closed? on HTTPResponse, maybe that's something to do with it
<al2o3-cr> hmm, i'm not sure why that should work now
<al2o3-cr> i thinks it's to do with bindings
<phaul> I said that wrong. we defined closed? on whatever the self was there. but not HTTPResponse
<al2o3-cr> but i could be wrong
conta has quit [Quit: conta]
<al2o3-cr> phaul: start pry with: pry -c TOPLEVEL_BINDING
<al2o3-cr> then try, same errror
<al2o3-cr> *error
<phaul> ah.
<leitz> Can I get some advice on figuring out where the circular load issue is? I'm making this modular and still figuring it out. https://gist.github.com/LeamHall/4cf785ed2ffcb51445d07120297397b8#file-circular_loads-error-txt-L2-L17
blackmesa1 has quit [Ping timeout: 248 seconds]
haxx0r has quit [Quit: Ping timeout (120 seconds)]
esp32_prog has joined #ruby
haxx0r has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
Ekho has quit [Quit: An alternate universe was just created where I didn't leave. But here, I left you. I'm sorry.]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
yqt has quit [Ping timeout: 244 seconds]
<leftylink> but it seems to me that the error messages already list the files that are circularly requiring one another
<leftylink> were the messages inaccurage for some reason?
<leftylink> so that seems like a good place to look
Ekho has joined #ruby
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
jenrzzz has joined #ruby
matheusmoreira has quit [Ping timeout: 246 seconds]
<leitz> leftylink, thanks! It took me a bit to figure out, I've slowed down on drinking coffee... There were some "require" statements that should have been removed. They are gone and the circular requires went with them.
quarters has quit [Ping timeout: 252 seconds]
clandmeter has joined #ruby
matheusmoreira has joined #ruby
quarters has joined #ruby
morozovm has joined #ruby
tweeaks is now known as tweaks
morozovm has quit [Ping timeout: 258 seconds]
quarters has quit [Ping timeout: 252 seconds]
apparition has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
karayan has joined #ruby
quarters has joined #ruby
matheusmoreira has quit [Ping timeout: 248 seconds]
jinie has joined #ruby
matheusmoreira has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
cthulchu_ has joined #ruby
quarters has quit [Ping timeout: 252 seconds]
quarters has joined #ruby
schne1der has quit [Ping timeout: 244 seconds]
Emmanuel_Chanel has quit [Read error: No route to host]
Emmanuel_Chanel has joined #ruby
arup_r has joined #ruby
conta has joined #ruby
apg has joined #ruby
cthu| has joined #ruby
jenrzzz has joined #ruby
codefriar has joined #ruby
cthulchu_ has quit [Ping timeout: 272 seconds]
kapilp has joined #ruby
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grilix_ has joined #ruby
vondruch has quit [Quit: vondruch]
esp32_prog has joined #ruby
ljarvis_ is now known as ljarvis
code_zombie has joined #ruby
gmatutecr has joined #ruby
esp32_prog has quit [Ping timeout: 246 seconds]
morozovm has joined #ruby
arup_r has quit []
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
morozovm has quit [Ping timeout: 272 seconds]
aupadhye has quit [Quit: Leaving]
ravenousmoose has joined #ruby
mostlybadfly has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
ByronJohnson has quit [Remote host closed the connection]
jeremycw has joined #ruby
Harlin has joined #ruby
<Harlin> ls
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has joined #ruby
Esa_ has joined #ruby
<adam12> . .. lost+found
<phaul> cd lost+found
ravenousmoose has joined #ruby
GodFather has joined #ruby
codefriar has joined #ruby
codefriar has quit [Client Quit]
ledhed2222 has joined #ruby
shortCircuit__ has joined #ruby
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
shortCircuit__ has quit [Ping timeout: 246 seconds]
SCHAPiE has quit [Quit: ZNC - https://znc.in]
jenrzzz has joined #ruby
polishdub has joined #ruby
SCHAPiE has joined #ruby
ledhed2222 has quit [Quit: ledhed2222]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
<al2o3-cr> Any ideas how to pass a struct by value using fiddle?
octos has quit [Ping timeout: 268 seconds]
Sina has quit [Quit: Connection closed for inactivity]
morozovm has joined #ruby
morozovm has quit [Ping timeout: 245 seconds]
* al2o3-cr is pulling s hair out
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
codefriar has joined #ruby
codefriar has quit [Client Quit]
ledhed2222 has joined #ruby
ledhed2222 has quit [Client Quit]
shortCircuit__ has joined #ruby
esp32_prog has joined #ruby
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
ricekrispie2 has joined #ruby
esp32_prog has quit [Ping timeout: 258 seconds]
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
ricekrispie has quit [Ping timeout: 245 seconds]
<shortCircuit__> there should have been a ruby implementation of hystrix
<shortCircuit__> :(
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> hi shortCircuit__ , I think you missed this : https://freenode.irclog.whitequark.org/ruby/2019-05-30#24694746;
<shortCircuit__> o.. superthanks
jenrzzz has quit [Ping timeout: 248 seconds]
<shortCircuit__> cool.
<phaul> yw
<shortCircuit__> After doing all this, end of day, after sending PR, I realized there is no easy way to see a dashboard :D
orbyt_ has joined #ruby
brandoncc has joined #ruby
camilasan has joined #ruby
gigetoo has quit [Ping timeout: 244 seconds]
gigetoo has joined #ruby
apparition has quit [Quit: Bye]
Jonopoly has quit [Quit: WeeChat 2.4]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ngw has joined #ruby
<ngw> hi *
<phaul> hello ngw
<ngw> how would you refactor this puddle of filth? https://gist.github.com/ngw/2773fa496dd5de57b36e5d3d5f95f77e
<ngw> I'm under the impression there's a better way to do that
<adam12> ngw: To start, I'd use the Hash.new default value feature.
nowhereman has joined #ruby
<ngw> where exactly @adam12?
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ngw> @result is an instance var I initialize as empty hash in the initializer
jenrzzz has joined #ruby
<havenwood> @result.dig(page_url, ip)&.+= 1
nowhere_man has quit [Ping timeout: 258 seconds]
<phaul> I would think about making [url, ip] the key of a single layer hash..
morozovm has joined #ruby
<phaul> if they always go together...
<adam12> bbiaf. lunch.
<ngw> not sure I understand `Hash.new { |h, key| h[key] = Hash.new(0) }`, what would be in h and key?
octos has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
cow[moo] has joined #ruby
<ngw> MAGIC! adam12 thanks!
<ngw> my understanding is that it says whatever is in [whatever][whatever] is 0, is this correct?
<ngw> didn't know I could do that
<ngw> thanks!
freddykiks has joined #ruby
rippa has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
<phaul> ngw, is there a good reason why you need two layers of hash? (going back to what I suggested). if you can make that move of removing the extra layer that would simplify the code everywhere
<ngw> well because I need to know page_url AND ip
<phaul> yeah. a hash that maps pairs of page_url and ip to count
<ngw> the final hash looks like {page_url => { ip1 => 3 visits, ip2 => 1 visit}}
<phaul> or { [page_url, ip1] => 3 visits, [page_url ip2] => 1 visit }
<ngw> I'm parsing a file that is lines of "url ip"
<ngw> oh I see what you mean
<phaul> this has disadvantages too, for instance queries like is page_url hit cannot be easily queried any more. but querying with both url and ip is ok. depends on how you use the hash
houhoulis has joined #ruby
<matheusmoreira> havenwood: `&.+= 1` what does this mean exactly?
mkaito has quit [Quit: ZNC 1.7.2 - https://znc.in]
duderonomy has joined #ruby
mkaito has joined #ruby
mkaito has quit [Changing host]
mkaito has joined #ruby
<havenwood> matheusmoreira: it's actually a pre-coffee mistake, since += isn't a method. it does work like:
<havenwood> &>> foo = 42; foo&.+(1)
<rubydoc> # => 43 (https://carc.in/#/r/70g9)
jenrzzz has quit [Ping timeout: 272 seconds]
<havenwood> matheusmoreira: The &. is the lonely person operator. If `foo` is `nil`, it'll just return `nil` instead of calling the `:+` method.
<havenwood> &>> foo = nil; foo&.+(1)
<rubydoc> # => nil (https://carc.in/#/r/70ga)
<matheusmoreira> &.+ == .method(:+) ?
<rubydoc> parser error at position 0 around `.'
<matheusmoreira> I guess I'm still stuck in ruby 1.9.2
<matheusmoreira> nice feature
<havenwood> matheusmoreira: `foo + 1` is syntactic sugar for `foo.+(1)`
<matheusmoreira> indeed.
<matheusmoreira> &. is analogous to the same syntax?
<rubydoc> parser error at position 0 around `.'
<matheusmoreira> but with safer nil handling
<matheusmoreira> I see
<matheusmoreira> thanks
octos has quit [Ping timeout: 268 seconds]
<havenwood> matheusmoreira: yup, exactly
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
dviola has joined #ruby
octos has joined #ruby
al2o3-cr has joined #ruby
voodoofish430 has quit [Ping timeout: 258 seconds]
conta has quit [Quit: conta]
lucasb has joined #ruby
tdy has joined #ruby
mkaito has quit [Quit: ZNC 1.7.2 - https://znc.in]
esp32_prog has joined #ruby
houhouli_ has joined #ruby
jenrzzz has joined #ruby
houhoulis has quit [Ping timeout: 248 seconds]
jeremycw has quit [Ping timeout: 258 seconds]
esp32_prog has quit [Ping timeout: 268 seconds]
mkaito has joined #ruby
mkaito has quit [Changing host]
mkaito has joined #ruby
cd has joined #ruby
mkaito has quit [Client Quit]
bairyn has joined #ruby
ngw has quit [Ping timeout: 272 seconds]
ngw has joined #ruby
ngw has quit [Ping timeout: 272 seconds]
lxsameer has quit [Quit: out]
mkaito has joined #ruby
mkaito has quit [Changing host]
mkaito has joined #ruby
ngw has joined #ruby
jeremycw has joined #ruby
havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.7.0-preview1: 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!
ngw has quit [Ping timeout: 258 seconds]
jeremycw has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
<al2o3-cr> havenwood: you beat baweaver to it again :P
x0f has quit [Ping timeout: 245 seconds]
x0f has joined #ruby
Xogium has joined #ruby
Xogium has left #ruby ["leaving channel"]
SeepingN has joined #ruby
ngw has joined #ruby
ngw has quit [Ping timeout: 272 seconds]
ngw has joined #ruby
houhouli_ has quit [Remote host closed the connection]
Iarfen has joined #ruby
jeremycw has joined #ruby
Ltem has quit [Quit: bbl]
ngw has quit [Ping timeout: 246 seconds]
ngw has joined #ruby
freddykiks has quit [Remote host closed the connection]
ngw has quit [Ping timeout: 268 seconds]
matti has quit [Quit: Oh dear ...]
grilix_ has quit [Quit: Ooops]
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
Cthulu201 has quit [Remote host closed the connection]
Cthulu201 has joined #ruby
ngw has joined #ruby
ngw has quit [Ping timeout: 258 seconds]
apg has quit [Ping timeout: 258 seconds]
apg has joined #ruby
apg has joined #ruby
apg has quit [Changing host]
jenrzzz has joined #ruby
mkaito has quit [Quit: ZNC 1.7.2 - https://znc.in]
reber has quit [Remote host closed the connection]
mkaito has joined #ruby
mkaito has quit [Changing host]
mkaito has joined #ruby
plujon has joined #ruby
esp32_prog has joined #ruby
Mrgoose has joined #ruby
esp32_prog has quit [Ping timeout: 258 seconds]
<Mrgoose> Hi, Im using grpc with ruby and trying to figure out how to create the server with a unix domain socket. Anyone have any knowledge of that?
ngw has joined #ruby
Ltem has joined #ruby
ngw has quit [Ping timeout: 258 seconds]
FrankDW has joined #ruby
FrankDW has quit [Changing host]
FrankDW has joined #ruby
blackmesa1 has joined #ruby
jeremycw has quit [Ping timeout: 258 seconds]
mikecmpbll has joined #ruby
ngw has joined #ruby
morozovm has quit [Remote host closed the connection]
ngw has quit [Ping timeout: 272 seconds]
mkaito has quit [Quit: ZNC 1.7.2 - https://znc.in]
dbugger has quit [Remote host closed the connection]
mkaito has joined #ruby
mkaito has joined #ruby
mkaito has quit [Changing host]
salerace has joined #ruby
ngw has joined #ruby
orbyt_ has joined #ruby
ngw has quit [Ping timeout: 246 seconds]
BH23 has joined #ruby
_joes_ has joined #ruby
jeremycw has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.4]
BH23 has quit [Remote host closed the connection]
blackmesa1 has quit [Quit: WeeChat 2.4]
ngw has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dviola has quit [Quit: WeeChat 2.4]
ngw has quit [Ping timeout: 272 seconds]
schne1der has quit [Ping timeout: 272 seconds]
octos has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
FrankDW has quit [Read error: Connection reset by peer]
FrankDW has joined #ruby
FrankDW has quit [Read error: Connection reset by peer]
FrankDW2 has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 258 seconds]
edwardly has quit [Ping timeout: 258 seconds]
ngw has joined #ruby
jenrzzz has joined #ruby
morozovm has joined #ruby
Ai9zO5AP has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
ngw has quit [Ping timeout: 272 seconds]
morozovm has quit [Ping timeout: 248 seconds]
octos has joined #ruby
telnet is now known as uplime
ur5us has joined #ruby
cliluw has quit [Ping timeout: 245 seconds]
cliluw has joined #ruby
ngw has joined #ruby
_joes_ has quit [Quit: _joes_]
ngw has quit [Ping timeout: 246 seconds]
teeigeryuh has joined #ruby
<teeigeryuh> and so i wake up on the morning and i step outside
<teeigeryuh> anjd i take a deep breath
<teeigeryuh> and i get real high
<teeigeryuh> and i scream from the top of my lungs
<teeigeryuh> WHAT'S GOING ON?
axsuul has joined #ruby
<teeigeryuh> wait wrong server
jenrzzz has joined #ruby
<SeepingN> I said hey
ngw has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ngw has quit [Ping timeout: 272 seconds]
catbusters has joined #ruby
cthu| has quit [Ping timeout: 248 seconds]
esp32_prog has joined #ruby
cliluw has quit [Ping timeout: 268 seconds]
cliluw has joined #ruby
octos has quit [Remote host closed the connection]
<graft> Mrgoose: you can require 'socket' and use TCPSocket#open
esp32_prog has quit [Ping timeout: 258 seconds]
jcalla has quit [Ping timeout: 246 seconds]
octos has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
kyrylo has joined #ruby
ngw has joined #ruby
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
kyrylo has quit [Client Quit]
reber has joined #ruby
ngw has quit [Ping timeout: 258 seconds]
cliluw has quit [Ping timeout: 245 seconds]
cliluw has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
reber has quit [Remote host closed the connection]
morozovm has joined #ruby
morozovm has quit [Remote host closed the connection]
morozovm has joined #ruby
ngw has joined #ruby
cliluw has quit [Ping timeout: 268 seconds]
cliluw has joined #ruby
ngw has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
shortCircuit__ has quit [Ping timeout: 272 seconds]
pebble2016 has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
Phil0s0rapt0r has joined #ruby
sameerynho has joined #ruby
Iarfen has quit [Remote host closed the connection]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
graft has quit [Ping timeout: 245 seconds]
jeremycw has quit [Ping timeout: 248 seconds]
Ltem has quit [Quit: bye]
morozovm has quit [Remote host closed the connection]
<leftylink> ... well we are quickly getting into #ruby-offtopic category but in response to the above comments about screaming, I submit http://www.poorlydrawnlines.com/comic/goat/
i9zO5AP has joined #ruby
Ai9zO5AP has quit [Ping timeout: 272 seconds]
code_zombie has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 248 seconds]
<phaul> &fake Movies::BackToTheFuture.quote
<rubydoc> Next saturday night we're sending you back to the future!
wald0 has joined #ruby
jenrzzz has joined #ruby
<al2o3-cr> Anthony Joshua v Andy Ruiz Jr what a shit fight that's gonna be
SCHAPiE has quit [Ping timeout: 258 seconds]
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
morozovm has joined #ruby
jinie has joined #ruby
SCHAPiE has joined #ruby
jinie has quit [Client Quit]
polishdub has quit [Quit: leaving]
rafadc has quit [Ping timeout: 244 seconds]
jinie has joined #ruby
rafadc has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
morozovm has quit []
jenrzzz has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 245 seconds]
shah^ has quit []
vs^ has joined #ruby
Phil0s0rapt0r has quit [Remote host closed the connection]
graft has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
brool has joined #ruby
i9zO5AP has quit [Quit: WeeChat 2.4]
_whitelogger has joined #ruby
cloaked1 has joined #ruby
cloaked1 has quit [Changing host]
cloaked1 has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
catbusters has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
sameerynho has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
budonyc has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weteamsteve has joined #ruby
budonyc has quit [Client Quit]
troulouliou_div2 has joined #ruby
gix has quit [Ping timeout: 246 seconds]
_whitelogger has joined #ruby
cliluw has quit [Ping timeout: 268 seconds]