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!
darix has joined #ruby
phaul has quit [Ping timeout: 246 seconds]
xlued has quit [Quit: The Lounge - https://thelounge.github.io]
skryking has quit [Ping timeout: 258 seconds]
xlued has joined #ruby
skryking has joined #ruby
fphilipe_ has joined #ruby
houhouli_ has joined #ruby
houhoulis has quit [Ping timeout: 272 seconds]
phaul has joined #ruby
rubydoc has joined #ruby
fphilipe_ has quit [Ping timeout: 252 seconds]
esp32_prog has joined #ruby
bambanx has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esp32_prog has quit [Ping timeout: 245 seconds]
orbyt_ has joined #ruby
DTZUZU has quit [Ping timeout: 272 seconds]
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
gix- has quit [Ping timeout: 272 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 272 seconds]
Talion has quit [Quit: Connection closed for inactivity]
tdy has joined #ruby
nfsnobody has joined #ruby
Ai9zO5AP has joined #ruby
Swyper has joined #ruby
esp32_prog has joined #ruby
fphilipe_ has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
esp32_prog has quit [Ping timeout: 245 seconds]
octos has joined #ruby
Swyper has quit [Remote host closed the connection]
nowhere_man has joined #ruby
braincrash has quit [Quit: bye bye]
nowhereman has quit [Ping timeout: 272 seconds]
braincrash has joined #ruby
nowhere_man has quit [Ping timeout: 246 seconds]
fphilipe_ has quit [Ping timeout: 258 seconds]
staticx has quit [Ping timeout: 258 seconds]
staticx has joined #ruby
staticx is now known as snosk8r
jenrzzz has joined #ruby
sagax has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
bambanx has quit [Quit: Leaving]
tdy has quit [Ping timeout: 246 seconds]
Exuma has joined #ruby
Exuma has quit [Client Quit]
esp32_prog has joined #ruby
xlued has quit [Quit: The Lounge - https://thelounge.github.io]
WhatsGoingOn is now known as iMadper
fphilipe_ has joined #ruby
xlued has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
tdy has joined #ruby
mosh has joined #ruby
QCF has joined #ruby
QCF has quit [Client Quit]
dellavg_ has quit [Ping timeout: 258 seconds]
Inline has quit [Quit: Leaving]
laaron has quit [Remote host closed the connection]
octos has quit [Remote host closed the connection]
conta has joined #ruby
laaron has joined #ruby
podlech has joined #ruby
dar123 has joined #ruby
marmotini_ has joined #ruby
_whitelogger has joined #ruby
<dar123> hey guyz, i am creating a .conf file to template.erb. what is the best way to say if ENV exists then name=abc else name=default
regedit has quit [Quit: Connection closed for inactivity]
jenrzzz has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
xco has joined #ruby
kyrylo has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
stooj has quit [Quit: ZNC 1.7.2 - https://znc.in]
stooj has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
kapilp has quit [Quit: Connection closed for inactivity]
fphilipe_ has quit [Ping timeout: 258 seconds]
houhouli_ has quit [Remote host closed the connection]
podlech has quit [Quit: WeeChat 2.5-dev]
fphilipe_ has joined #ruby
fphilipe_ has quit [Ping timeout: 250 seconds]
schne1der has joined #ruby
DTZUZU has joined #ruby
esp32_prog has joined #ruby
cd has quit [Quit: cd]
esp32_prog has quit [Ping timeout: 245 seconds]
ltd has quit [Ping timeout: 245 seconds]
sauvin has quit [Ping timeout: 268 seconds]
sauvin has joined #ruby
kapilp has joined #ruby
haxx0r has quit [Remote host closed the connection]
haxx0r has joined #ruby
marz_d`ghostman has joined #ruby
<marz_d`ghostman> Using minitest, is there a method to run a code before all tests in a test class?
aupadhye has joined #ruby
<baweaver> Here's a fun idea
salerace has quit [Ping timeout: 246 seconds]
esrse has joined #ruby
lxsameer has joined #ruby
schne1der has quit [Ping timeout: 268 seconds]
marmotini_ has quit [Quit: Leaving]
fphilipe_ has joined #ruby
Cork has joined #ruby
<skarlso> marz_d`ghostman hey, there is setup and teardown and before and after you can use. Are those what you are looking for?
dionysus69 has joined #ruby
TomyWork has joined #ruby
deepredsky has quit [Ping timeout: 258 seconds]
deepredsky has joined #ruby
nowz has quit [Ping timeout: 252 seconds]
Fusl has quit [Ping timeout: 256 seconds]
nowz has joined #ruby
schne1der has joined #ruby
Fusl has joined #ruby
deepredsky has quit [Ping timeout: 248 seconds]
fphilipe_ has quit [Read error: Connection reset by peer]
FastJack has quit [Ping timeout: 264 seconds]
fphilipe_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
ShalokShalom63 has joined #ruby
ShalokShalom63 has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 258 seconds]
ShalokShalom has quit [Remote host closed the connection]
ShalokShalom has joined #ruby
<marz_d`ghostman> skarlso: I'm looking at something like the before(:all) of rpec. Those I think run before/after every test
deepredsky has joined #ruby
<skarlso> yeah, setup does run before all tests
<skarlso> oh hang on it's deprecated
<skarlso> no, yeah
<skarlso> it does seem to run before all tests
<marz_d`ghostman> skarlso: thanks, I'll look into it. As for the after(:all), I'm currently using Minitest.after_run { } :)
stryek has quit [Quit: Connection closed for inactivity]
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
fphilipe_ has quit [Read error: Connection reset by peer]
<marz_d`ghostman> Ah, I need to run this with spec/describe
esp32_prog has joined #ruby
tdy has quit [Ping timeout: 272 seconds]
deepredsky has quit [Ping timeout: 258 seconds]
shtirlic has quit [Quit: ZNC - http://znc.in]
shtirlic has joined #ruby
claudiuinberlin has joined #ruby
DTZUZU has quit [Ping timeout: 245 seconds]
conta has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby
claudiuinberlin has quit [Ping timeout: 245 seconds]
vondruch has joined #ruby
xuyuheng has joined #ruby
Fusl has quit [Remote host closed the connection]
jenrzzz has joined #ruby
Fusl has joined #ruby
ellcs has joined #ruby
Ai9zO5AP has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
hightower2 has joined #ruby
deepredsky has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
conta has joined #ruby
jenrzzz has joined #ruby
Ai9zO5AP has joined #ruby
deepredsky has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower2 has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
deepredsky has joined #ruby
conta has quit [Read error: Connection reset by peer]
conta has joined #ruby
ShalokShalom has quit [Remote host closed the connection]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schne1der has quit [Ping timeout: 244 seconds]
DiscoM has joined #ruby
<DiscoM> Hello
banisterfiend has joined #ruby
<DiscoM> Someone is using this library ? https://github.com/aspettl/dns-zone i have some pb with the cname records, and my Ruby knowledge is to low to find the bug.
sylario has joined #ruby
ur5us has quit [Remote host closed the connection]
ljarvis__ has quit [Ping timeout: 246 seconds]
deepredsky has quit [Ping timeout: 272 seconds]
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
conta has quit [Ping timeout: 248 seconds]
ljarvis1 has joined #ruby
_axx has quit [Quit: The Lounge - https://thelounge.chat]
DTZUZU has joined #ruby
<ryouba> hi
TomyWork has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
TomyWork has joined #ruby
dbugger has joined #ruby
conta has joined #ruby
dbugger has quit [Client Quit]
dbugger has joined #ruby
TomyWork has quit [Remote host closed the connection]
TomyWork has joined #ruby
leitz has joined #ruby
<ryouba> is there a way to make a regex gsub work like in https://regex101.com/r/Vaz661/2 (i.e. with global and multiline, named capture groups, substitution based on the group names)?
deepredsky has joined #ruby
<ryouba> (trying with `lines.gsub /.../m {|match| ...}` to no avail so far)
xuyuheng has quit [Ping timeout: 258 seconds]
<ryouba> oh, even at https://rubular.com/r/WHXrCmrKPfQMAx it works just fine ... just in code i can't make it work ... it only keeps matching the occurances that have no newline in them
<ytti> personally i would go other way
<ytti> instead of doing complex regexp, i'd dos omething like this
<ytti> input.lines.each do |line|
<ytti> words = line.split
<ytti> next unless word[1][0..1] == '[['
<ytti> ...
AJA4350 has joined #ruby
<ytti> usually if you need help with regexp, then regexp was not the right solution
<ryouba> ytti: seems like trying to deal with those entries that span 2 lines would be even more complex using that approach
<ytti> in terms of readability and maintainability
<ryouba> also that regex was really easy to come up with given the existence of pages like the two i linked ... so i wouldn't classify it as a "complex" one
<ytti> ryouba, sorry, i only saw first url, and it didn't have multilines
<ryouba> huh?
<ryouba> it's the exact same text
* ryouba looks
<ytti> ryouba, aah just didn't scroll
<ytti> the view rendered in 'test string' box didn't contain multilines
<ryouba> ah
<ryouba> yeah, it's only some of the lower entries
<ytti> i think multiple is possible with that loop still
<ytti> just push result to soem array, once result is complete
<ryouba> in general it seems like useful knowledge to me to know how Rubular deals with its user input
<ryouba> wow
<ryouba> trying with your approach
<ryouba> this is becoming a complex algorithm
marz_d`ghostman has quit [Ping timeout: 256 seconds]
TomyWork has quit [Remote host closed the connection]
TomyWork has joined #ruby
reber has joined #ruby
<ytti> StringScanner may also be your friend
jinie has quit [Ping timeout: 244 seconds]
xco has quit [Ping timeout: 258 seconds]
jinie has joined #ruby
dostoyevsky has quit [Ping timeout: 244 seconds]
deepredsky has quit [Ping timeout: 246 seconds]
sagax has quit [Ping timeout: 244 seconds]
ua has quit [Ping timeout: 244 seconds]
_axx has joined #ruby
dostoyevsky has joined #ruby
ua has joined #ruby
<ryouba> ytti: it kind-of works now (https://gist.github.com/sixtyfive/e1f70533598daac01931e611790aaea7 ... except for some bug, that I'm hunting now). but it would definitely be much more elegant and easier to read if there was just a way to treat a string with newlines in it the same way that regex101.com and rubular.com do.
jenrzzz has joined #ruby
fphilipe_ has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
<ryouba> ytti: fixed all the bugs now (still https://gist.github.com/sixtyfive/e1f70533598daac01931e611790aaea7). it fulfills its purpose now, so thank you despite the differences in philosophy! :-)
deepredsky has joined #ruby
<ytti> ryouba, looks cleaner to me, but indeed, matter of opinion
pwnd_nsfw` has joined #ruby
octos has joined #ruby
<ytti> slightly related question, that pattern is something i also often do
<ytti> foo = []
<ytti> something.each { |x| foo << something(x) if sometimes }
<ytti> is there more idiomatic version? like maybe
<ytti> foo = something.map { |x| sometimes ? something(x) : nil }.compact
<ytti> or some other way to return different size enumerable
<phaul> something.select(&:sometimes)
<ytti> i thought select returns itself
pwnd_nsfw has quit [Ping timeout: 258 seconds]
<ytti> when true
<phaul> it does
<ytti> where as typically you want to mutate the return value
<ytti> so you'd rather foo = something,select(&:sometimes).map ...
<phaul> many ways to skin that cat :)
<ryouba> phaul: what about my original question ... how might rubular.com deal with its user input? i.e., a long, multiline string and a regex that (on regex101.com, i.e. in Perl lingo) would have "gm" as its options?
octos has quit [Remote host closed the connection]
<phaul> I donno. I would have thought that rubular does what the ruby regex engine does. I don't know why you are seeing discrepancy
UncleCid__ has joined #ruby
fphilipe_ has quit [Ping timeout: 252 seconds]
deepredsky has quit [Ping timeout: 245 seconds]
pwnd_nsfw` has quit [Ping timeout: 272 seconds]
deepredsky has joined #ruby
kyrylo has joined #ruby
powerbit has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
Swyper has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby-lang461 has joined #ruby
NL3limin4t0r_afk is now known as NL3limin4t0r
xuyuheng has joined #ruby
<ryouba> phaul: i don't think there's a difference. i think i don't know how to use the ruby regex engine toward that end. my attempt was basically `str.gsub /regex/m, 'subst'` and my best guess as to why it didn't work is the lack of a 'g' option.
ruby-lang461 has quit [Ping timeout: 256 seconds]
vondruch_ has joined #ruby
xuyuheng has quit [Quit: Quit: My MacBook Pro has gone to sleep. ZZZzzz?]
vondruch has quit [Ping timeout: 248 seconds]
vondruch_ is now known as vondruch
banisterfiend has joined #ruby
deepredsky has quit [Ping timeout: 268 seconds]
banisterfiend has quit [Ping timeout: 258 seconds]
fphilipe_ has joined #ruby
leitz has quit [Quit: Leaving]
<NL3limin4t0r> ryouba: Ruby regex have the Perl "m" option always enabled, in Ruby `^` and `$` alway match the start and end of an line. If you want to match the start and end of the entire string you'll have to use `\A` and `\z`. Ruby doesn't have the "g" option, depending on the usage it will automatically stop on the first match, or go through all matches.
<NL3limin4t0r> eg. text[regex] only matches ones, while text.scan(regex) matches all the posibilities.
<NL3limin4t0r> Ruby only supports the "m", "i" and "x" flags. From whom "i" and "x" are the same as in Perl while the "m" option in Ruby is equal to the "s" option in Perl.
codefriar has joined #ruby
sagax has joined #ruby
esrse has quit [Ping timeout: 258 seconds]
Nicmavr has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
wald0 has quit [Quit: Lost terminal]
salerace has joined #ruby
<haxx0r> what's best way to work with a websocket api? i would think JavaScript can do it best?
<mnemon> haxx0r: plenty of implementations for common langs
zodd has joined #ruby
<mnemon> but depends what you're doing with it
<haxx0r> all the exchanges have websocket APIs
<haxx0r> so you get real time order book
_whitelogger has joined #ruby
Talion has joined #ruby
deepredsky has joined #ruby
schne1der has joined #ruby
migalenkom has joined #ruby
reber has quit [Remote host closed the connection]
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #ruby
grilix has joined #ruby
<haxx0r> mochi
<haxx0r> i got it!
codefriar has quit [Read error: Connection reset by peer]
doodlebug has quit [Ping timeout: 248 seconds]
doodleb46 has joined #ruby
aupadhye has quit [Ping timeout: 272 seconds]
Swyper has quit [Remote host closed the connection]
<migalenkom> Hi there. I have a Texecom alarm connected to the serial port, and I am trying to read zones status page 2 of this manual.(https://drive.google.com/file/d/1Z3caY_y9wKAch7-tiZgAElWBY8uiZRxr/view?usp=sharing) I am getting some binary response but I cannot parse it correct. Could you please help me? Here is what I have already tried: https://dpaste.de/dhPD
codefriar has joined #ruby
Azure|dc has joined #ruby
wildermind has joined #ruby
Azure has quit [Ping timeout: 268 seconds]
migalenkom_ has joined #ruby
migalenkom_ has left #ruby [#ruby]
Inline has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
doodleb46 has quit [Read error: Connection reset by peer]
Fischmiep has quit [Quit: WeeChat 2.3]
doodleb4 has joined #ruby
migalenkom_ has joined #ruby
<migalenkom_> \help
doodleb4 has quit [Read error: Connection reset by peer]
<migalenkom_> #ruby-lang
migalenkom__ has joined #ruby
migalenkom__ has quit [Client Quit]
doodlebug has joined #ruby
jeremycw has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
migalenkom_ has quit [Quit: Page closed]
migalenkom_ has joined #ruby
migalenkom_ has quit [Client Quit]
migalenkom_ has joined #ruby
doodlebug has joined #ruby
migalenkom has quit [Ping timeout: 256 seconds]
cthulchu_ has joined #ruby
kapilp has quit [Quit: Connection closed for inactivity]
deepredsky has quit [Ping timeout: 272 seconds]
spiette has quit [Quit: ZNC 1.7.3 - https://znc.in]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spiette has joined #ruby
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
migalenkom_1 has joined #ruby
<adam12> migalenkom_: If you want to get assistance for your issue, my suggestion is to digest it into a smaller, reproducable issue that shows what you're expecting and what you're getting instead. Not everyone will have knowledge of Texecom or serial ports, but might be able to assist you in decoding some binary if you show expected value. ie. foobar.unpack("*U") == "hello world" or something.
deepredsky has joined #ruby
deepredsky has quit [Ping timeout: 244 seconds]
<migalenkom_1> adam12: Could you please be so kind and open second page of the pdf https://drive.google.com/file/d/1Z3caY_y9wKAch7-tiZgAElWBY8uiZRxr/view?usp=sharing
<migalenkom_1> There described expected value and request example. There should be a number of each zone status from 0 to 7
<havenwood> migalenkom_: You need permission to view that doc.
deepredsky has joined #ruby
<havenwood> migalenkom_1: 👍🏽
Ltem has joined #ruby
deepredsky has quit [Ping timeout: 244 seconds]
migalenkom_1 has quit [Quit: Leaving.]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
migalenkom_1 has joined #ruby
laaron has joined #ruby
cthu| has joined #ruby
kapilp has joined #ruby
cthulchu_ has quit [Ping timeout: 272 seconds]
TomyWork has quit [Ping timeout: 246 seconds]
Fusl has quit [Ping timeout: 256 seconds]
DiscoM has quit [Quit: Page closed]
FastJack has joined #ruby
h3ll0w0rld has joined #ruby
h3ll0w0rld has quit [Client Quit]
conta has quit [Ping timeout: 244 seconds]
ellcs has quit [Ping timeout: 258 seconds]
ljarvis1 has quit [Ping timeout: 248 seconds]
adaedra has joined #ruby
<havenwood> migalenkom_: when you write it just returns a single line with the read?
Fusl has joined #ruby
haxx0r has quit [Ping timeout: 272 seconds]
Nicmavr has joined #ruby
ljarvis has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
<havenwood> migalenkom_: It looks like you're requesting a "read zone status" for zones 9-16, based on the docs. So you're expecting 16 bytes of data, followed by 0, 13, 10?
<havenwood> or the checksum, I guess, so 10, 13, 10?
<havenwood> migalenkom_: Did "Request Access with Control Panel" return "OK"?
<migalenkom_1> havenwood: yes, Request Access returned OK.
<havenwood> migalenkom_1: And it had the checksum and ended in 13, 10?
<havenwood> migalenkom_: It makes sense why 8 zones would give you back 16 bytes, but why no trailing C/SM, 0x0D, 0x0A?
<migalenkom_1> havenwood: the response on request access is OK\r\n without checksum
<migalenkom_1> havenwood: Maybe i sent request in some incorrect way.
<migalenkom_1> havenwood: But other requests that just returns OK or ERROR works
weteamsteve has joined #ruby
deepredsky has joined #ruby
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
<migalenkom_1> here is e.g of other requests https://dpaste.de/WBwi
adaedra has quit [Quit: adaedra]
tdy has joined #ruby
<havenwood> migalenkom_1: What do you get if you query just zone 1?: "\\Z\x00\x01/"
laaron has quit [Client Quit]
<havenwood> "5C5A00012F"
laaron has joined #ruby
esp32_prog has quit [Ping timeout: 258 seconds]
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
conta1 has joined #ruby
gix has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
graft has quit [Ping timeout: 248 seconds]
ellcs has joined #ruby
<havenwood> err, I think I read that wrong and that's ^ two zones. yeah, I think I made an off-by-one error >.> "number of zones from the start zone"
<havenwood> "5C5A00002F"
<havenwood> migalenkom_1: What's the value for a single zone? "\\Z\x00\x00/"
m_antis has joined #ruby
<migalenkom_1> havenwood: https://dpaste.de/Eava,
<havenwood> migalenkom_1: So it looks like it's returning [18, 8] for each zone ¯\_(ツ)_/¯
<havenwood> Which isn't what the spec says it'll return...
<migalenkom_1> "\\Z\x00\x00/" it returns a blank string
<havenwood> migalenkom_1: Looks like it should be something like "\x00\x00\r\n" or "ERROR\r\n"
<havenwood> migalenkom_1: Is there not a zone 1 or something?
banisterfiend has joined #ruby
rippa has joined #ruby
conta1 has quit [Quit: conta1]
<migalenkom_1> havenwood: it should have: Number of wired zones (onboard) 4
sameerynho has joined #ruby
<migalenkom_1> Maximum number of wireless zones 64
<havenwood> migalenkom_1: Does the "Query Zone" command work?
esp32_prog has joined #ruby
migalenkom_1 has quit [Quit: Leaving.]
migalenkom_1 has joined #ruby
<migalenkom_1> havenwood: https://dpaste.de/TFxE
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
<havenwood> migalenkom_1: So "Entry/Exit 1" and "Zone in Partition (area) 2"? Where are the "\r\n" on these?
migalenkom_ has quit [Ping timeout: 256 seconds]
<havenwood> migalenkom_1: And what the heck is [18, 8] supposed to mean?
<havenwood> "\\Z\x00\x01/" => [18, 8]
<havenwood> ohhh
esp32_prog has quit [Ping timeout: 248 seconds]
<havenwood> it's the bit they're looking at
<havenwood> i didn't read
<havenwood> ["00010010", "00001000"]
banisterfiend has quit [Ping timeout: 248 seconds]
<havenwood> [{0=>"0", 1=>"0", 2=>"0", 3=>"1", 4=>"0", 5=>"0", 6=>"1", 7=>"0"},
<havenwood> {0=>"0", 1=>"0", 2=>"0", 3=>"0", 4=>"1", 5=>"0", 6=>"0", 7=>"0"}]
codefriar has joined #ruby
<havenwood> migalenkom_1: that's the [18, 8] you were getting back for each zone
codefriar has quit [Client Quit]
<havenwood> I dunno why no \r\n
banisterfiend has joined #ruby
<al2o3-cr> havenwood: because in the Texecom class they've got device.readline.chomp
<havenwood> al2o3-cr: ah, i shoulda read the code
<havenwood> now it makes total sense
<havenwood> al2o3-cr: thanks!
<al2o3-cr> havenwood: np
<havenwood> migalenkom_1: so those are just the LBD and HBD, check the bits
<havenwood> migalenkom_1: al2o3-cr explained the no /r/n mystery - it's chomped in the code and I wasn't thinking about it being preprocessed before us seeing it
<havenwood> migalenkom_1: {"0:Healthy/1:Alarm"=>0, "0:Tamper/1:Shorted"=>1, "Fault Present"=>0, "Failed Test"=>0, "Alarmed"=>1, "Manual ypassed"=>0, "Auto Bypassed"=>0, "Always 0"=>0}
codefriar has joined #ruby
Talion has quit [Quit: Connection closed for inactivity]
deepreds1 has joined #ruby
deepredsky has quit [Ping timeout: 268 seconds]
sagax has quit [Ping timeout: 246 seconds]
sagax has joined #ruby
sagax has quit [Client Quit]
sagax has joined #ruby
regedit has joined #ruby
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
cthulchu_ has joined #ruby
<migalenkom_1> havenwood: thanks you so much, you made my day
xagut has joined #ruby
<migalenkom_1> al2o3-cr: thanks for explaining the no /r/n mystery
cthu| has quit [Ping timeout: 258 seconds]
<al2o3-cr> migalenkom_1: np
zodd has quit [Ping timeout: 268 seconds]
migalenkom_1 has quit [Quit: Leaving.]
<xagut> I'm toying with the ruby source. I added a `.second` method to Array. My change shows up in the the `miniruby` binary build but not the `ruby` binary (Even after a clean build).
fphilipe_ has quit [Ping timeout: 248 seconds]
<xagut> idk if anybody has any pointers on why that might be :-/
comet23 has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v3.5 Beta Build (2019/05/27 UTC) 64 Bit]
Tempesta has joined #ruby
<comet23> i'm having trouble understanding what the value of power(base,exponent-1) is in the recursive call
<comet23> return base * power(base,exponent-1)
cthu| has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
cthu| has quit [Max SendQ exceeded]
cthu| has joined #ruby
cthulchu_ has quit [Ping timeout: 248 seconds]
<mozzarella> comet23: 2^5 = 2 * 2^4
wildermind has quit [Quit: Connection closed for inactivity]
rrichardsr3 has joined #ruby
deepreds1 has quit [Ping timeout: 268 seconds]
deepreds1 has joined #ruby
<phaul> comet23: http://www.pythontutor.com/visualize.html#code=def%20exp_2%28n%29%0A%20%20return%201%20if%20n.zero%3F%0A%20%202%20*%20exp_2%28n-1%29%0Aend%0A%0Aexp_2%285%29&cumulative=false&curInstr=25&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=ruby&rawInputLstJSON=%5B%5D&textReferences=false
<phaul> you can play with the forward / back buttons
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ruby[bot]> comet23: we in #ruby do not like irccloud.com, it has no syntax highlighting, distracting formatting and loads slowly for most. Please use https://gist.github.com
kyrylo has joined #ruby
<comet23> the python tutor website is giving me errors
<comet23> :(
esp32_prog has joined #ruby
<phaul> you can go to http://www.pythontutor.com/visualize.html#mode=edit select Ruby as the language and paste your code in there
<comet23> i have
<ruby[bot]> comet23: as I told you already, please use https://gist.github.com
<comet23> uh oh
<phaul> ah, yours is infinite loop. you check base being zero not exponent
<comet23> you can't make anonymous gists anymore :*(
<comet23> oh thank you
esp32_prog has quit [Ping timeout: 248 seconds]
<comet23> i still don't get it
altious2 has quit [Quit: Leaving]
rrichardsr3 has quit [Quit: He who dares .... wins.]
Ltem has quit [Quit: bbl]
<comet23> i don't get how the return value is doubling
ShalokShalom has joined #ruby
<phaul> each call was made from a call one step higher up which multiplies with 2 so it's multiplied after the return (not by that call but the call that called it
<phaul> it's hard to explain on irc. but when you return it's not doubled yet. It's going to be doubled in the caller
<comet23> i always thought my_function(n) evaluated to a single number
<comet23> do you have time? i'll send you money for explaining it
<phaul> I can try and might fail :)
<phaul> you do 5 calls all the way down to exp == 0 . f(f(f(f(f(0)))) at this point nothing is doubled and this is when the code in the innermost f hits the if condition
<phaul> it is returning 1, so now you have 4 f, with 1 bing inside the 4th. f(f(f(f(1))))
<phaul> the innermost is now in the base * f (... just finished with the evaluation of its f call, it was 1.
<phaul> so it itself returns 2 * 1. to the 3rd layer
ShalokShalom has quit [Remote host closed the connection]
dar123 has joined #ruby
<phaul> the 3rd layer receives 2 from the 4th, whil it was doing base * f(.. so it itself returns 4 (2*2)
<phaul> end so on all the way up
conta has joined #ruby
Nicmavr has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
suukim has joined #ruby
<phaul> yet another way of saying it is f(5) = f(2*f(4)) = f(2*f(2*f(3))) = f(2*f(2*f(2*f(2)))) = f(2*f(2*f(2*f(2*f(1))))) = f(2*f(2*f(2*f(2*f(2*f(0))))) = f(2*f(2*f(2*f(2*f(2*1))))) = f(2*f(2*f(2*f(2*2*1))))) = f(2*f(2*f(2*2*2*1))) = (2*f(2*2*2*2*1)) = (2*2*2*2*2*1)
<phaul> probably I messed up the number of parens here and there. but it shows what's happeneing
<phaul> ah I messed up the placement of fs on the way out. let me try with a smaller example:
octos has joined #ruby
cd has joined #ruby
<phaul> ah. it's much easier to explain this stuff on a whiteboard...
<phaul> comet23: did this help so far?
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dar123 has joined #ruby
orbyt_ has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
hackeron has joined #ruby
graft has quit [Ping timeout: 248 seconds]
<NL3limin4t0r> comet23: It may become more clear when you rewrite the function as a while loop. https://gist.github.com/3limin4t0r/6a82e042fec1a0726ab1a2898f228c8a
ravenousmoose has joined #ruby
conta has quit [Quit: conta]
<NL3limin4t0r> Keep in mind that both variants drop into an endless loop if you provide a negative exponent.
<NL3limin4t0r> &>> 2**-4
<rubydoc> # => (1/16) (https://carc.in/#/r/6zqz)
NL3limin4t0r is now known as NL3limin4t0r_afk
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
salerace has quit [Quit: salerace]
Frag has joined #ruby
Frag is now known as Frag_
altious has joined #ruby
suukim has quit [Quit: Konversation terminated!]
gix has quit [Quit: Client exiting]
laaron has quit [Remote host closed the connection]
gix has joined #ruby
laaron has joined #ruby
brool has joined #ruby
octos has quit [Read error: Connection reset by peer]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
octos has joined #ruby
brool has quit [Ping timeout: 250 seconds]
xagut has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 245 seconds]
sagax has quit [Quit: Konversation terminated!]
sagax has joined #ruby
octos has quit [Read error: Connection reset by peer]
octos has joined #ruby
Ltem has joined #ruby
jhill has quit [Ping timeout: 252 seconds]
Lewix has quit [Ping timeout: 252 seconds]
JJonah has quit [Ping timeout: 276 seconds]
kevinsjoberg has quit [Ping timeout: 252 seconds]
ec has quit [Ping timeout: 252 seconds]
chromis has quit [Ping timeout: 252 seconds]
englishm has quit [Ping timeout: 264 seconds]
manveru has quit [Ping timeout: 252 seconds]
raggi has quit [Read error: Connection reset by peer]
gajus has quit [Ping timeout: 264 seconds]
strmpnk has quit [Ping timeout: 252 seconds]
eph^ has quit []
esp32_prog has joined #ruby
yasumi2136 has joined #ruby
mjacob has joined #ruby
abaiste^ has joined #ruby
gajus has joined #ruby
esp32_prog has quit [Ping timeout: 248 seconds]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
strmpnk has joined #ruby
<mjacob> what's the most idiomatic way to have a sequence of statements and to use the result of the last statement in an expression?
<mjacob> i could have a 'if true' statement, but it's not very nice
Nicmavr has quit [Ping timeout: 245 seconds]
gajus has quit [Ping timeout: 276 seconds]
Nicmavr has joined #ruby
dar123 has joined #ruby
strmpnk has quit [Max SendQ exceeded]
chromis has joined #ruby
JJonah has joined #ruby
strmpnk has joined #ruby
raggi has joined #ruby
gajus has joined #ruby
ec has joined #ruby
fphilipe_ has joined #ruby
yasumi2136 has quit [Quit: Konversation terminated!]
manveru has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Lewix has joined #ruby
jhill has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
englishm has joined #ruby
kevinsjoberg has joined #ruby
brool has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
<jeremycw> just use a begin; end block
<jeremycw> a = begin; 'foo'; 'bar'; end
<jeremycw> a == 'bar'
esp32_prog has joined #ruby
hiroaki has joined #ruby
esp32_prog has quit [Ping timeout: 268 seconds]
ravenousmoose has quit [Read error: Connection reset by peer]
schne1der has quit [Ping timeout: 248 seconds]
ravenousmoose has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kapilp has quit [Quit: Connection closed for inactivity]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Nicmavr has quit [Ping timeout: 245 seconds]
Nicmavr has joined #ruby
Frag_ has quit []
orbyt_ has joined #ruby
octos has quit [Ping timeout: 272 seconds]
dar123 has joined #ruby
octos has joined #ruby
houhoulis has joined #ruby
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 248 seconds]
vondruch_ is now known as vondruch
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kestrel-029 has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
nowhere_man has joined #ruby
codefriar has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
grilix has quit [Ping timeout: 252 seconds]
hiroaki has quit [Ping timeout: 252 seconds]
Ltem has quit [Quit: bye]
hiroaki has joined #ruby
cthu| has quit [Ping timeout: 258 seconds]
esp32_prog has joined #ruby
code_zombie has joined #ruby
esp32_prog has quit [Ping timeout: 258 seconds]
jtdowney14 is now known as jtdowney
fphilipe_ has quit [Ping timeout: 248 seconds]
renich has joined #ruby
grilix has joined #ruby
staticx has joined #ruby
snosk8r has quit [Ping timeout: 258 seconds]
Azure|dc has quit [Remote host closed the connection]
wildermind has joined #ruby
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
tdy has joined #ruby
brool has quit [Ping timeout: 258 seconds]
staticx is now known as snosk8r
hackeron has quit [Ping timeout: 258 seconds]
hiroaki has quit [Ping timeout: 252 seconds]
jeremycw has quit [Ping timeout: 258 seconds]
sameerynho has quit [Ping timeout: 272 seconds]
tdy has quit [Ping timeout: 246 seconds]
codefriar has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
evdubs has quit [Remote host closed the connection]
evdubs has joined #ruby
cthulchu_ has joined #ruby
orbyt_ has joined #ruby
Ai9zO5AP has quit [Quit: WeeChat 2.4]
hiroaki has joined #ruby
abaiste^ has quit []
renich has quit [Ping timeout: 244 seconds]
tsrt^ has joined #ruby
FernandoB has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dar123 has joined #ruby
renich has joined #ruby
cthulchu_ has quit [Ping timeout: 258 seconds]
esp32_prog has joined #ruby
bambanx has joined #ruby
esp32_prog has quit [Ping timeout: 272 seconds]
haxx0r has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hackeron has joined #ruby
dar123 has joined #ruby
hackeron has quit [Ping timeout: 258 seconds]
dar123 has quit [Client Quit]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Azure has joined #ruby
bsdbandit has quit [Quit: leaving]
Swyper has joined #ruby
<haxx0r> XMR mooning, time to cashout boys!
bsdbandit has joined #ruby
Nicmavr has joined #ruby
Kestrel-029 has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
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.]
dorian has joined #ruby
<dorian> hey can somebody reset my brain here about calling a method with a predefined proc as if it was an inline block in the context of the caller?
P0rkD_ has joined #ruby
<dorian> i have a bunch of dsl stuff i want to stick in a dispatch table
<dorian> essentially trying to metaprogram class Foo < Bar { dsl_here }
FernandoB has quit [Remote host closed the connection]
<mjacob> jerthank you, that does exactly what i need
Swyper has quit [Remote host closed the connection]