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!
sylario has quit [Quit: Connection closed for inactivity]
rafadc_ has quit [Ping timeout: 259 seconds]
<phaul> dorian, class Foo < Bar {... is interpreted as a method call to !upcase method call Bar with a block. is that what's intended?
<phaul> I mean call method Bar
<phaul> you can inherit from expressions, so things that look like method calls will be taken as such
<dorian> maybe it would make more sense if i said the idiom was class Foo < Sequel::Model(arg) do ...
<phaul> I guess Sequel::Model is a method then..
<dorian> that method returns an anonymous class
<phaul> gotcha
<dorian> yeah and it takes a block where you tell it stuff
<phaul> ok makes sense
<dorian> yeah so i just want to stick that block in a hash with a bunch of other configuration data
<dorian> but that block is called in the context of (i think?) the resulting class
<dorian> so just trying to figure out how to massage a proc so that the context is correct
<dorian> "call this method with this proc as a block"
<dorian> i dunno if that's an instance_eval thing or if there's some other way to do it
Swyper has joined #ruby
Wolland has joined #ruby
skryking has quit [Ping timeout: 272 seconds]
wildermind has quit [Quit: Connection closed for inactivity]
Wolland has quit [Client Quit]
skryking has joined #ruby
<phaul> but whoever receives the block decides what to do with it. If they decide to class eval it so be it, if they decide to instance eval it then that
<adam12> dorian: No idiom that I know for class X do (specifically do/end), but there _is_ an idiom for returning a module that might be OK.
<adam12> dorian: So with that, you might be able to make something work by returning a class (Class.new), but I've never personally tried it. Alternatively, use the common include SomeModule.new trick.
<dorian> i just mean like, i want to cut the block out, and stick it in a hash member
<phaul> but that should just work...
<dorian> and then i want to meta-code the execution of the block
<dorian> and my problem is that the resulting proc does not get run in the right context
<adam12> dorian: You could just make a proc/lambda here?
<dorian> that's what i'm doing
<adam12> dorian: or are you already that far?
<adam12> dorian: So you're missing context somehow. Can you put together a minimal example?
<dorian> say like, i have DISPATCH = { key: -> { this_should_run_as_if_inside_a_block } }
<dorian> but then i get a MethodError
<dorian> or just plain nothing
<phaul> can you call this_should_... on an explicit receiver? not self? would it work that way?
<dorian> that's what i don't know how to formulate
<phaul> a = self; ISPATCH = { key: -> { a.this_should_run_as_if_inside_a_block } }
<dorian> ohhhh yeah no
<dorian> the thing is voodooey DSL
blerrp has joined #ruby
<dorian> that's why i want to set the execution context of the proc
renich has quit [Quit: renich]
<dorian> write the proc as if it *is* the block, feed the block to the method, don't consternate any more about it
P0rkD__ has joined #ruby
<dorian> just let me double-check something: if you call method(arg, &proc) does that do the same thing as method do # whatever's in the proc
<dorian> (because i tried that and it did nothing)
<phaul> more or less. they are semantically the same one being faster or the other
<phaul> the thing is once you hand over a block to a method, they are inc charge and can eval it whichever way they like
<dorian> that's fine
<phaul> that's including what self is
P0rkD_ has quit [Ping timeout: 256 seconds]
<dorian> yeah i want self to be exactly the self that would otherwise be in the inline block
<phaul> yeah, a = self; ISPATCH = { key: -> { a.this_should ...
<phaul> dont think there is any other way but to escape the block of actually unsing self
orbyt_ has joined #ruby
<phaul> using*
<phaul> from*
Nicmavr has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
<dorian> oneoff looks like this:
<dorian> warnlol = -> { one_to_many :token, key: :user }
<dorian> m.const_set :User, Class.new(Sequel::Model(db[:user], &warnlol))
<dorian> warnlol is never run
rafadc has joined #ruby
code_zombie has quit [Quit: Leaving]
<dorian> but the idea would be to be like DISPATCH = { User: -> { one_to_many :token, key: user } } ...
<dorian> anyway maybe it's just an idiosyncrasy of that particular thing that the proc isn't getting run?
<dorian> or am i just doing it wrong
P0rkD__ is now known as P0rkD
axsuul has quit [Ping timeout: 246 seconds]
<haxx0r> what's the best gem to listen on WSS forever?
<phaul> is Class.new needed at all?
<haxx0r> not always
<dorian> well the ad-hoc way to define these things is like class MyTable < Sequel::Model(DB[:mytable]) do # specs here...
<phaul> I mean in the line m.const_set :User, .. would just Sequel::Model(db[:user], &warnlol) work?
<phaul> it's already returning a class why create a subclass yet again?
<dorian> i dunno i'm kinda cheating around the way it was designed
<dorian> like the way it's designed is you make a static class which is a subclass of whatever the method returns
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dorian> class MyTable < Sequel::Model(DB[:my_table])
<dorian> which takes a block
<dorian> where the configuration DSL goes
<phaul> I think if m.const_set :User,Sequel::Model(db[:user]) do was running the block so should the other syntax
<dorian> ostensibly it doesn't
<phaul> maybe a works and doesn't work example gists would help to understand
<dorian> it actually doesn't matter because i just discovered that the 'self' in the block is actually the resulting class
<dorian> like just this second
<dorian> so i can write vanilla procs and pass in the class as an argument and not have to care about what context they're being executed in
<dorian> i just didn't want to do that before in case it was some magic dsl voodoo
<dorian> anyway i think the problem was i was expecting that &proc syntax to do something visible and it didn't
tdy has quit [Ping timeout: 258 seconds]
<dorian> so maybe there's a subtle difference in the semantics that causes &procs passed in lieu of blocks to get silently disappeared?
kapilp has joined #ruby
d^sh has quit [Ping timeout: 258 seconds]
d^sh has joined #ruby
<dorian> anyway that Sequel module is definitely opinionated
<dorian> i'm not entirely sure why those things are classes
orbyt_ has joined #ruby
<dorian> or rather, they need a live instance of a connection to be created
<dorian> so you're mixing class and instance
esp32_prog has joined #ruby
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
esp32_prog has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
nowhereman has joined #ruby
P0rkD has quit [Remote host closed the connection]
bambanxx has joined #ruby
P0rkD has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
bambanx has quit [Ping timeout: 246 seconds]
ozzloy_ is now known as ozzloy
ozzloy has quit [Changing host]
ozzloy has joined #ruby
a7d7p7 has joined #ruby
hackeron has joined #ruby
queip has quit [Ping timeout: 272 seconds]
a7d7p7 has quit [Remote host closed the connection]
hackeron has quit [Ping timeout: 258 seconds]
tdy has joined #ruby
queip has joined #ruby
moei has joined #ruby
doodlebug has quit [Quit: -a- Connection Timed Out]
meinside has joined #ruby
rafadc has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doodlebug has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
_dbugger has joined #ruby
jenrzzz has joined #ruby
mniip has quit [Quit: This page is intentionally left blank.]
dbugger has quit [Ping timeout: 276 seconds]
rafadc has joined #ruby
mniip has joined #ruby
codefriar has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
ltd has joined #ruby
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
P0rkD has quit [Remote host closed the connection]
P0rkD has joined #ruby
banisterfiend has joined #ruby
P0rkD is now known as p0rkd
esp32_prog has joined #ruby
graft has joined #ruby
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
AJA4350 has quit [Quit: AJA4350]
esp32_prog has quit [Ping timeout: 258 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 248 seconds]
graft has quit [Ping timeout: 268 seconds]
budonyc has quit [Quit: Leaving]
p0rkd has quit [Remote host closed the connection]
Azure|dc has joined #ruby
braincrash has quit [Quit: bye bye]
p0rkd has joined #ruby
Azure has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
braincrash has joined #ruby
hackeron has joined #ruby
LenPayne has quit [Quit: ZNC 1.7.2 - https://znc.in]
LenPayne has joined #ruby
hackeron has quit [Ping timeout: 248 seconds]
graft has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
weteamsteve has quit [Read error: Connection reset by peer]
comet23 has quit [Quit: Connection closed for inactivity]
Swyper has quit [Remote host closed the connection]
duderonomy has joined #ruby
bambanxx has quit [Quit: Leaving]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 248 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
ur5us_ has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
ur5us has quit [Read error: Connection reset by peer]
tdy has joined #ruby
sagax has quit [Quit: Konversation terminated!]
sagax has joined #ruby
graft has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
P0rkD_ has joined #ruby
p0rkd has quit [Remote host closed the connection]
P0rkD_ is now known as P0rkD
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
banisterfiend has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
dellavg_ has joined #ruby
codefriar has joined #ruby
fphilipe_ has joined #ruby
esrse has joined #ruby
jenrzzz has joined #ruby
houhoulis has quit [Remote host closed the connection]
orbyt_ has joined #ruby
Inline has quit [Quit: Leaving]
conta has joined #ruby
Azure|dc has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
laaron has quit [Remote host closed the connection]
cthulchu has joined #ruby
laaron has joined #ruby
fphilipe_ has quit [Ping timeout: 244 seconds]
Azure has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
ltd has quit [Quit: leaving]
brucebag has joined #ruby
kapilp has quit [Quit: Connection closed for inactivity]
brucebag has quit [Changing host]
brucebag has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
ur5us_ has quit [Remote host closed the connection]
hightower2 has joined #ruby
schne1der has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe_ has joined #ruby
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
m_antis has quit [Quit: m_antis]
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
esp32_prog has joined #ruby
al2o3-cr has joined #ruby
esp32_prog has quit [Ping timeout: 245 seconds]
hackeron has joined #ruby
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
hackeron has quit [Ping timeout: 248 seconds]
lxsameer has joined #ruby
haxx0r has quit [Ping timeout: 258 seconds]
schne1der has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
migalenkom_ has joined #ruby
migalenkom_ has left #ruby [#ruby]
_dbugger has quit [Remote host closed the connection]
fphilipe_ has quit [Ping timeout: 248 seconds]
_dbugger has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
TomyWork has joined #ruby
fphilipe_ has joined #ruby
nowhereman has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
salerace has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
powerbit has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
TomyWork has quit [Ping timeout: 246 seconds]
TomyWork has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
jefffrails35 has joined #ruby
P0rkD has quit [Remote host closed the connection]
P0rkD_ has joined #ruby
facest has quit [Read error: Connection reset by peer]
facest has joined #ruby
snosk8r has quit [Ping timeout: 244 seconds]
schne1der has joined #ruby
tjbp has quit [Ping timeout: 250 seconds]
tjbp has joined #ruby
tdy has quit [Ping timeout: 258 seconds]
hackeron has joined #ruby
esp32_prog has joined #ruby
kapilp has joined #ruby
jenrzzz has joined #ruby
TomyLobo2 has joined #ruby
cd has quit [Quit: cd]
TomyWork has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Read error: Connection reset by peer]
cthulchu has quit [Ping timeout: 244 seconds]
jenrzzz has joined #ruby
banisterfiend has joined #ruby
comet23 has joined #ruby
Fischmiep has joined #ruby
KeyJoo has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
P0rkD__ has joined #ruby
P0rkD_ has quit [Remote host closed the connection]
P0rkD__ is now known as P0rkD
sphenxes has joined #ruby
NL3limin4t0r_afk is now known as NL3limin4t0r
banisterfiend has joined #ruby
ur5us has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyLobo2 has quit [Remote host closed the connection]
TomyLobo2 has joined #ruby
deepreds1 has quit [Ping timeout: 248 seconds]
deepreds1 has joined #ruby
banisterfiend has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
deepreds1 has quit [Ping timeout: 248 seconds]
banisterfiend has joined #ruby
dhollin3 has joined #ruby
dhollinger has quit [Read error: Connection reset by peer]
hackeron has quit [Quit: leaving]
BlueNeXuS has joined #ruby
gigetoo has quit [Ping timeout: 272 seconds]
gigetoo has joined #ruby
grilix_ has joined #ruby
Ai9zO5AP has joined #ruby
grilix has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
BlueNeXuS|2 has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
BlueNeXuS has quit [Ping timeout: 248 seconds]
Jonopoly has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
deepreds1 has joined #ruby
m_antis has joined #ruby
Jonopoly has quit [Client Quit]
P0rkD has quit [Remote host closed the connection]
P0rkD_ has joined #ruby
Jonopoly has joined #ruby
laaron has joined #ruby
AJA4350 has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.4]
Jonopoly has joined #ruby
Jonopoly has quit [Client Quit]
esrse has quit [Ping timeout: 268 seconds]
Jonopoly has joined #ruby
Jonopoly has quit [Client Quit]
ur5us has quit []
ShalokShalom has joined #ruby
sphenxes has quit [Remote host closed the connection]
Jonopoly has joined #ruby
TomyLobo2 has quit [Ping timeout: 246 seconds]
Jonopoly has quit [Client Quit]
TomyWork has joined #ruby
RockStar_ has joined #ruby
Jonopoly has joined #ruby
Jonopoly has quit [Client Quit]
RockStar_ has quit [Remote host closed the connection]
Jonopoly has joined #ruby
conta has quit [Ping timeout: 248 seconds]
sylario has joined #ruby
Nicmavr has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
exmortus has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.4]
Jonopoly has joined #ruby
sagax has quit [Quit: Konversation terminated!]
sagax has joined #ruby
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
P0rkD__ has joined #ruby
P0rkD_ has quit [Remote host closed the connection]
comet23 has quit [Quit: Connection closed for inactivity]
doodlebug has joined #ruby
conta has joined #ruby
wildermind has joined #ruby
nowhereman has joined #ruby
gaussblurinc1 has joined #ruby
<gaussblurinc1> Hi! Could anybody advise a ruby version in 2019? I would like to use it for tools as fastlane.
ricekrispie has quit [Ping timeout: 258 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
laaron has quit [Client Quit]
laaron has joined #ruby
esp32_prog has quit [Ping timeout: 250 seconds]
RockStar_ has joined #ruby
RockStar_ has quit [Client Quit]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
haxx0r has joined #ruby
nowhereman has quit [Ping timeout: 248 seconds]
<balo> what do you mean gaussblurinc1 ? do you have any special requirement?
laaron has joined #ruby
<balo> in general, probably you are probably best off with the latest 2.6.x version of MRI https://www.ruby-lang.org/en/downloads/
sagax has quit [Quit: Konversation terminated!]
sagax has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
kapilp has quit [Quit: Connection closed for inactivity]
sagax has quit [Ping timeout: 272 seconds]
sagax has joined #ruby
code_zombie has joined #ruby
<ryouba> gaussblurinc1: ruby is not python is not python2 is not python2.7 is not python is not python3 is not python3.7 ;)
<ryouba> NL3limin4t0r: so `string.scan /regex/, '\1[\2](\3)'` should by all means yield the same 15 matches as can be seen at https://rubular.com/r/k1tkaZe0UMfDoa ? *if* i understood you correctly?
<ryouba> sorry, #scan only takes the one argument, obviously
<ryouba> oh *damn* it *does* yield 15 matches
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esp32_prog has joined #ruby
<ryouba> and .gsub works just as well
<ryouba> phaul: apologies. i must have been braindead yesterday.
esp32_prog has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> ryouba: np, happens to the best of us
Swyper has joined #ruby
schne1der has quit [Ping timeout: 250 seconds]
banisterfiend has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
esp32_prog has joined #ruby
Guest22 has joined #ruby
<Guest22> .
Guest22 has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 248 seconds]
<NL3limin4t0r> ryouba: What if your match normally would span accros multiple lines? You currently have `STDIN.read.split("\n")` and then do stuff with just one sigle line.
<NL3limin4t0r> ryouba: eg. the fourth match in the rubular link.
arahael has quit [Quit: WeeChat 2.2]
arahael1 has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
<ryouba> NL3limin4t0r: keep reading. my point yesterday, though, was that that loop construct is pretty much superfluous.
<ryouba> and ytti's counter-argument was that when a regex becomes too complex you should better take the problem apart further.
Fusl has quit [Excess Flood]
Fusl has joined #ruby
Swyper has quit [Remote host closed the connection]
RiPuk has quit [Ping timeout: 258 seconds]
octos has quit [Remote host closed the connection]
doodlebug has quit [Read error: Connection reset by peer]
octos has joined #ruby
arahael1 is now known as Arahael
doodlebug has joined #ruby
<gaussblurinc1> balo: thanks!
gaussblurinc1 has quit [Quit: Leaving.]
Arahael has quit [Quit: WeeChat 2.2]
jcalla has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> ryouba: I'll read it later. For now I'd like to say that the provided text looks like perfectly valid markdown, with some nested links.
Arahael has joined #ruby
<NL3limin4t0r> ryouba: If you'd like to remove the nesting (and preserve the outer one) the following regex will do just fine: /\[\[([^\]]*)\]\([^)]*\)\]/
<ryouba> NL3limin4t0r: the objective was to get rid of the nested links
<ryouba> NL3limin4t0r: and what i'm doing is basically like your regex but mine is less elegant
<NL3limin4t0r> ryouba: I don't capture the match the last `(text)` since that part you place back anyways, that's why its so much shorter. `text.gsub(/\[\[([^\]]*)\]\([^)]*\)\]/, '[\1]')`
<NL3limin4t0r> This looks for two `[` characters, followed by any amount of none `]` characters captured in group 1. Then matches `](`, followed by any amount of non `)` characters, followed by `)]`.
conta has quit [Ping timeout: 268 seconds]
KeyJoo has quit [Ping timeout: 258 seconds]
<ryouba> hmm
<ryouba> seems good regexes require pretty dynamic thinking
<ryouba> i do understand now :}
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
KeyJoo has joined #ruby
<ryouba> interesting, that did do *some*thing a little different ... enough for git to register each modified line in the output TOC.
jefffrails35 has quit [Ping timeout: 248 seconds]
<ryouba> so much cleaner than mine ... thank you NL3limin4t0r :)
Nicmavr has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
conta1 has joined #ruby
jefffrails35 has joined #ruby
<NL3limin4t0r> ryouba: Git(hub) doesn't always have the best change detection. When commiting haml files it sometimes marks the whole document as changed, despite adding only one line and indenting some other parts.
schneider has joined #ruby
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
zodd has joined #ruby
vondruch has left #ruby [#ruby]
zodd is now known as Guest6396
vondruch has joined #ruby
budonyc has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
cthulchu_ has joined #ruby
cthu| has joined #ruby
<ryouba> hmm i never had that before. if a line is changed, then it's changed. sometimes i'll have to go look with a hex editor but if i do i always find something.
grilix_ has quit [Ping timeout: 258 seconds]
jcalla has joined #ruby
cthulchu_ has quit [Ping timeout: 246 seconds]
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.]
P0rkD_ has joined #ruby
P0rkD__ has quit [Remote host closed the connection]
Nicmavr has joined #ruby
Guest6396 is now known as zodd_
wildermind has quit [Quit: Connection closed for inactivity]
al2o3-cr has joined #ruby
doodleb87 has joined #ruby
tdy has joined #ruby
Inline has joined #ruby
al2o3-cr has quit [Client Quit]
doodlebug has quit [Ping timeout: 258 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
al2o3-cr has joined #ruby
P0rkD_ has quit [Remote host closed the connection]
P0rkD_ has joined #ruby
laaron has joined #ruby
brendan- has quit [Quit: Textual IRC Client: www.textualapp.com]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
laaron has quit [Client Quit]
laaron has joined #ruby
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has quit [Changing host]
WhereIsMySpoon has joined #ruby
gaussblurinc1 has joined #ruby
jrafanie has joined #ruby
schneider has quit [Ping timeout: 245 seconds]
jeremycw has joined #ruby
doodleb87 has quit [Read error: Connection reset by peer]
AlHafoudh has joined #ruby
donofrio has joined #ruby
cthu| has quit [Ping timeout: 258 seconds]
cthulchu has joined #ruby
cthulchu has quit [Read error: Connection reset by peer]
TomyWork has quit [Remote host closed the connection]
cthulchu has joined #ruby
TomyWork has joined #ruby
doodleb80 has joined #ruby
codefriar has joined #ruby
brendan- has joined #ruby
grilix_ has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
galaxie has joined #ruby
doodleb80 has quit [Read error: Connection reset by peer]
rippa has joined #ruby
AlHafoudh has quit [Read error: Connection reset by peer]
conta1 has quit [Ping timeout: 258 seconds]
kapilp has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
AlHafoudh has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlHafoudh has quit [Quit: ZNC - http://znc.in]
jrafanie has joined #ruby
hightower3 has joined #ruby
hightower2 has quit [Ping timeout: 272 seconds]
d^sh_ has joined #ruby
d^sh has quit [Ping timeout: 245 seconds]
cthulchu has quit [Read error: Connection reset by peer]
P0rkD__ has joined #ruby
P0rkD_ has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 258 seconds]
octos has quit [Ping timeout: 248 seconds]
spiette_ has joined #ruby
spiette has quit [Ping timeout: 244 seconds]
graft has joined #ruby
gix has joined #ruby
tdy has joined #ruby
gaussblurinc1 has quit [Quit: Leaving.]
gaussblurinc1 has joined #ruby
Ripcode has joined #ruby
schne1der has joined #ruby
dhollin3 is now known as dhollinger
Jonopoly has quit [Quit: WeeChat 2.4]
brendan- has quit [Quit: Textual IRC Client: www.textualapp.com]
esp32_prog has quit [Ping timeout: 250 seconds]
Fusl has quit [Ping timeout: 256 seconds]
dar123 has joined #ruby
Fusl has joined #ruby
Ripcode has quit [Ping timeout: 252 seconds]
leah2 has quit [Ping timeout: 252 seconds]
RiPuk has joined #ruby
P0rkD__ is now known as P0rkD
jenrzzz has joined #ruby
ellcs has quit [Ping timeout: 272 seconds]
hiroaki has quit [Ping timeout: 268 seconds]
octos has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 246 seconds]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has joined #ruby
kyrylo has quit [Client Quit]
deepreds1 has quit [Ping timeout: 244 seconds]
kyrylo has joined #ruby
Fischmiep has quit [Quit: WeeChat 2.3]
graft has quit [Ping timeout: 245 seconds]
Guest75268 has joined #ruby
Guest75268 has quit [Quit: WeeChat 2.1]
cd has joined #ruby
hiroaki has joined #ruby
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gigetoo has quit [Ping timeout: 268 seconds]
gigetoo has joined #ruby
leah2 has joined #ruby
duderonomy has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
nowhereman has joined #ruby
sameerynho has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
nowhereman has quit [Ping timeout: 246 seconds]
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
codefriar has joined #ruby
zodd_ has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
kapilp has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 272 seconds]
tdy has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robotcars has quit [Remote host closed the connection]
robotcars has joined #ruby
ricekrispie has joined #ruby
Ltem has joined #ruby
jinie_ has joined #ruby
jinie_ has quit [Client Quit]
fphilipe_ has quit [Ping timeout: 248 seconds]
skryking has quit [Quit: WeeChat 2.4]
skryking has joined #ruby
esp32_prog has joined #ruby
esp32_prog has quit [Ping timeout: 272 seconds]
deepreds1 has joined #ruby
hiroaki has quit [Read error: Connection reset by peer]
hiroaki has joined #ruby
gaussblurinc1 has quit [Quit: Leaving.]
john_ has joined #ruby
<john_> hi
<jhass> hi
KeyJoo has quit [Quit: KeyJoo]
cthulchu has joined #ruby
dviola has quit [Quit: WeeChat 2.4]
dar123 has joined #ruby
john_ has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 248 seconds]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brucebag has left #ruby [#ruby]
naught-fowl has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
sauvin has quit [Read error: Connection reset by peer]
jefffrails35 has joined #ruby
P0rkD has quit [Remote host closed the connection]
salerace has quit [Ping timeout: 244 seconds]
tdy has joined #ruby
sezuan has quit [Ping timeout: 252 seconds]
sezuan has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
TvL2386 has quit [Ping timeout: 246 seconds]
TvL2386 has joined #ruby
gaussblurinc1 has joined #ruby
ravenousmoose has joined #ruby
reber has joined #ruby
salerace has joined #ruby
salerace has quit [Ping timeout: 272 seconds]
cd has quit [Ping timeout: 256 seconds]
chrisseaton_ has joined #ruby
polishdub has joined #ruby
codefriar has joined #ruby
jenrzzz has joined #ruby
galaxie has quit [Remote host closed the connection]
galaxie has joined #ruby
catbusters has joined #ruby
esp32_prog has joined #ruby
_dbugger has quit [Quit: Leaving]
<al2o3-cr> &>> X = Class.new; 20.times.map { X.new }; ObjectSpace.each_object(X).map(&:__id__).each_cons(2).map { |x, y| y - x }
<rubydoc> # => [180, 400, 160, 1360, 4180, 260, 780, 2720, 1040, 400, 460, 160, 400, 580, 320, 1540, 160, 80, 240] (https://carc.in/#/r/701k)
<al2o3-cr> hmm....
esp32_prog has quit [Ping timeout: 268 seconds]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ltem has quit [Quit: bbl]
<havenwood> &>> X = Class.new; 20.times.map { X.new }; ObjectSpace.each_object(X).map { |obj| obj.__id__ << 1 }.each_cons(2).map { |x, y| y - x }
<rubydoc> # => [240, 17280, 2320, 240, 480, 360, 400, 240, 240, 280, 440, 520, 1360, 280, 280, 600, 2160, 840, 840] (https://carc.in/#/r/701l)
<al2o3-cr> memory is weird.
nowhereman has joined #ruby
<jhass> nah, GCs are :P
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<al2o3-cr> i suppose
orbyt_ has joined #ruby
fphilipe_ has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
brool has joined #ruby
tsrt^ has quit []
fphilipe_ has quit [Ping timeout: 258 seconds]
cd has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
englosh has joined #ruby
<englosh> what is the reason for ruby supporting only base 36?
<englosh> and not 256 for example
claudiuinberlin has joined #ruby
<jhass> what glyphs would that use?
<englosh> isn't base 256 still in the ASCII range?
<al2o3-cr> englosh: no
<jhass> no, ASCII has 127 characters, many not visible
ShalokShalom has quit [Remote host closed the connection]
<englosh> oh so that would actually be less space-efficient then to store a number as base256
<jhass> not visible = control characters like backspace, newline, bell and so on
<jhass> what does that mean "store as base256"
<englosh> to store a number somewhere on a server for example
<englosh> as base 256 but that's not efficient as I just learned
<jhass> base256 doesn't exist afaik
<englosh> I mean you of course always want something to take up as little space as possible
<englosh> so what about base127?
<jhass> any string encoding of a number is likely less space efficient than it's binary representation
codefriar has joined #ruby
<jhass> &>> [124453423].pack("L").bytesize
<rubydoc> # => 4 (https://carc.in/#/r/701t)
<jhass> &>> 124453423.to_s(36).bytesize
<rubydoc> # => 6 (https://carc.in/#/r/701u)
<englosh> is that 124453423 encoded as base 127? in the first code?
<jhass> as a 32bit integer
<jhass> hence 4 bytes
<jhass> (32/8 = 4)
<englosh> hmm but why storing it as a 32 bit integer?
Ltem has joined #ruby
<jhass> you asked for the most space effecient method
<al2o3-cr> englosh: on a 64bit system the byte size would be 13
<jhass> what, no why would it
<jhass> &>> `uname -a`
<rubydoc> # => "" (https://carc.in/#/r/701z)
<jhass> ah I blocked it :D
<jhass> be assured it's a 64bit kernel :P
<al2o3-cr> jhass: yep, no. you're right.
<al2o3-cr> jhass: i meant characters
<jhass> still that makes no sense
<al2o3-cr> jhass: ?
<englosh> hmm I'm a bit confused. what did you mean by "any string encoding of a number is likely less space efficient than its binary representation"? the string representation of 2318312 is "1dotk" but the binrary representation is "1000110101111111101000". That's way bigger.
<jhass> no, the latter is the binary string representation, that is the binary representation as a string
<jhass> of course each of those 1 and 0s takes up 1 byte
<jhass> but what is a string? it's a sequence of codepoints, aka numbers
<jhass> &>> "10011".codepoints
<rubydoc> # => [49, 48, 48, 49, 49] (https://carc.in/#/r/7026)
<jhass> &>> "1dotk".codepoints
<rubydoc> # => [49, 100, 111, 116, 107] (https://carc.in/#/r/7028)
<al2o3-cr> &>> require 'rbconfig/sizeof'; RbConfig::LIMITS['LONG_MAX'].to_s(36).size
<rubydoc> # => 13 (https://carc.in/#/r/7029)
<jhass> now we want to store a number, why would we encode that number into a sequence of smaller numbers
<jhass> and then store those smaller numbers
<jhass> let's just store the number directly
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe_ has joined #ruby
<englosh> yes thats probably a good idea to store the number directly
<jhass> that's what you do if you don't use a string, 123 <- direct number "123" <- string
<jhass> if you need to write it to disk from ruby, use Array#pack
<jhass> &>> [2318312].pack("L")
<rubydoc> # => "\xE8_#\x00" (https://carc.in/#/r/702d)
<depesz> what is the proper way to configure gem, so that it will install to $HOME, by default, and will load from there first ?
<jhass> easiest is probbaly just export GEM_HOME="$HOME/.gems" from your shellrc
<depesz> thx
<jhass> might make your system gems unavailable, not sure
<jhass> so you might also need to readd them to GEM_PATH
<jhass> gem env is great for debugging such
<depesz> thanks a lot. works :)
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
naught-fowl has quit [Ping timeout: 256 seconds]
englosh has quit [Ping timeout: 256 seconds]
lucasb has joined #ruby
salerace has joined #ruby
<balo> depesz: do you have the same nick on github? the other day i found the postgres explain analyze stuff you made, it's priceless
jenrzzz has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
nowhereman has quit [Ping timeout: 258 seconds]
koala_man has joined #ruby
<koala_man> how do I read available data from stdin? like STDIN.read(1024) but returning whatever data's available without waiting for the buffer to fill up
<koala_man> similar to how C read(2) works
P0rkD has joined #ruby
<jhass> read_nonblock
jenrzzz has joined #ruby
grilix_ has quit [Read error: Connection reset by peer]
<koala_man> thanks! actually readpartial but yes
Ltem has quit [Remote host closed the connection]
Ltem has joined #ruby
SeepingN has joined #ruby
esp32_prog has joined #ruby
ellcs has joined #ruby
esp32_prog has quit [Ping timeout: 272 seconds]
Harlin has joined #ruby
fphilipe_ has quit [Ping timeout: 272 seconds]
catbusters has quit [Quit: Connection closed for inactivity]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n13z has joined #ruby
<al2o3-cr> koala_man: my might want to consider sysread?
<koala_man> good to know, thanks
jeremycw has quit [Ping timeout: 244 seconds]
<jhass> what's the advantage towards the mentioned methods?
<al2o3-cr> jhass: none at all.
<jhass> then why use it?
<al2o3-cr> just giving them the other alternative to read(2)
<jhass> I think that's just confusing when a solution was already found
<al2o3-cr> jhass: whoa! sorry.
<jhass> without at least mentioning tradeoffs compared to the other solutions
<al2o3-cr> jhass: they can at least read the docs for differences
niceperl has joined #ruby
<jhass> the docs here don't paint a great picture on the tradeoffs here to be honest
Ltem has quit [Quit: bye]
<jhass> esp. if you don't already have experience around the tradeoffs between buffered and non-buffered IO
<al2o3-cr> jhass: neither did van gogh's.
<jhass> good thing none of use would ever refer to van gogh's works as a reference for writing ruby code
jenrzzz has quit [Ping timeout: 272 seconds]
hightower3 has quit [Ping timeout: 268 seconds]
<al2o3-cr> they're pretty clear what each does imho.
jenrzzz has joined #ruby
bambanx has joined #ruby
<al2o3-cr> but whatever
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
galaxie has quit [Remote host closed the connection]
<depesz> balo:i do.
galaxie has joined #ruby
moei has quit [Quit: Leaving...]
sameerynho has quit [Ping timeout: 244 seconds]
schne1der has quit [Ping timeout: 248 seconds]
P0rkD has quit [Remote host closed the connection]
nowhereman has joined #ruby
octos has quit [Remote host closed the connection]
octos has joined #ruby
houhoulis has joined #ruby
reber has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 250 seconds]
Talion has joined #ruby
kapilp has joined #ruby
nowhereman has quit [Ping timeout: 258 seconds]
robotcars has left #ruby [#ruby]
haxx0r has quit [Ping timeout: 272 seconds]
polishdub has quit [Quit: leaving]
RyanMcCoskrie has joined #ruby
ellcs has quit [Ping timeout: 250 seconds]
NightMonkey_ has joined #ruby
NightMonkey has quit [Ping timeout: 252 seconds]
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
budonyc has quit [Quit: Leaving]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
niceperl has quit [Quit: Leaving...]
esp32_prog has joined #ruby
graft has quit [Ping timeout: 248 seconds]
esp32_prog has quit [Ping timeout: 258 seconds]
Exuma has joined #ruby
Exuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shansen has quit [Remote host closed the connection]
brool has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
brool has joined #ruby
salerace has quit [Ping timeout: 248 seconds]
gaussblurinc1 has quit [Quit: Leaving.]
tdy has quit [Ping timeout: 246 seconds]
GodFather has quit [Ping timeout: 258 seconds]
code_zombie has quit [Quit: Leaving]
salerace has joined #ruby
haxx0r has joined #ruby
<haxx0r> i'm generating random numbers for a roulette game with hashes we get provided as a seed.
<haxx0r> `seed = block_hash.to_i(16)
<haxx0r> i use those numbers to play roulette. i've seen, that we had 13x black in a row.
<haxx0r> i wonder iv this has something tody with Random
RyanMcCoskrie has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
houhoulis has quit [Ping timeout: 252 seconds]
<phaul> while there might be something wrong somewhere it also might not. there a natural intuition about random / cognitive bias that makes ppl think that patterns in random should occur less often. There was an article about asking ppl to coin toss, and write down the result. The sequence given by cheaters was easily recognised as they generated too short repeating sequences
orbyt_ has joined #ruby