<baweaver>
Came up with an interesting idea while musing on how Santa can scale and deliver presents, and came to an even more interesting answer: Mrs Claus does it all
DecimPrime has quit [Ping timeout: 252 seconds]
<baweaver>
She's the one behind monitoring, logging, infra, scaling, ddos(anta) mitigation, all of it. Santa just does the deliveries
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
ellcs has joined #ruby
MoritaShinobu has quit [Quit: Leaving]
dbz has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
ellcs has quit [Ping timeout: 260 seconds]
apeiros_ has quit []
za1b1tsu has joined #ruby
al2o3-cr has quit [Read error: Connection reset by peer]
za1b1tsu has quit [Ping timeout: 252 seconds]
ellcs has joined #ruby
al2o3-cr has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
ramfjord has joined #ruby
nertzy has joined #ruby
al2o3-cr has joined #ruby
ramfjord has quit [Ping timeout: 252 seconds]
DTZUZU has quit [Quit: WeeChat 1.9]
ramfjord has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
sgen has joined #ruby
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
ellcs has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 246 seconds]
ellcs has joined #ruby
nertzy has joined #ruby
za1b1tsu has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
dbz has joined #ruby
tdy has joined #ruby
Dbugger has joined #ruby
cschneid_ has joined #ruby
akem__ has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
za1b1tsu has quit [Ping timeout: 246 seconds]
akem has quit [Ping timeout: 260 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
nertzy has joined #ruby
_whitelogger has joined #ruby
dbz_ has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
twe4ked has quit [Ping timeout: 240 seconds]
dbz has quit [Ping timeout: 252 seconds]
druonysus has quit [Ping timeout: 252 seconds]
GodFather has joined #ruby
twe4ked has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
cschneid_ has quit [Ping timeout: 268 seconds]
xfbs has quit [Quit: afk]
xfbs has joined #ruby
za1b1tsu has joined #ruby
xfbs has quit [Client Quit]
za1b1tsu has quit [Ping timeout: 252 seconds]
chouhoulis has joined #ruby
apeiros_ has joined #ruby
RougeR has quit [Ping timeout: 252 seconds]
Tempesta has quit [Quit: See ya!]
GodFather has quit [Ping timeout: 240 seconds]
dbz_ has quit [Remote host closed the connection]
Tempesta has joined #ruby
dbz has joined #ruby
dbz has quit [Remote host closed the connection]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
za1b1tsu has joined #ruby
eckhardt_ has joined #ruby
Emmanuel_Chanel has quit [Read error: No route to host]
za1b1tsu has quit [Ping timeout: 244 seconds]
chouhoulis has quit [Remote host closed the connection]
nertzy has joined #ruby
Emmanuel_Chanel has joined #ruby
tdy has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
chouhoulis has joined #ruby
cschneid_ has joined #ruby
cschneid_ has quit [Read error: Connection reset by peer]
ellcs has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
Fr4n has quit [Read error: Connection reset by peer]
Fr4n has joined #ruby
za1b1tsu has joined #ruby
duderonomy has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
rprimus has joined #ruby
duderonomy has quit [Client Quit]
za1b1tsu has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
Emmanuel_Chanel has joined #ruby
za1b1tsu has quit [Ping timeout: 260 seconds]
elphe has quit [Ping timeout: 272 seconds]
cschneid_ has joined #ruby
doubledup has quit [Quit: Leaving]
conta has quit [Quit: conta]
ogotai has joined #ruby
orbyt_ has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ogotai>
folks, what am I doing wrong with regexp repetition - if my input == ", a=true, c='d'", then this works - /^([, \w]*=['\w]*)([, \w]*=['\w]*)$/.match(input) --- but this doesn't - /^([, \w]*=['\w]*){2}$/.match(input)
<ogotai>
it's exactly the same regex, second instance I'm just doing (pattern){2}, instead of (pattern)(pattern), and yet the (pattern){2} fails
<ogotai>
when I say fails, it just matches the second instance, the ", c='d'" part of the string
Eiam has quit [Ping timeout: 252 seconds]
RougeR has joined #ruby
<baweaver>
ogotai: What exactly are you trying to do?
cschneid_ has quit [Ping timeout: 240 seconds]
<baweaver>
Could you not use `input.split(/, */).map { |pair| pair.split('=') }` ?
za1b1tsu has joined #ruby
<ogotai>
baweaver: I could, but it's a much longer string with other complications, I thought I could have a nicely crafted regex to extract all I need and just iterate over match data
<baweaver>
If you can avoid complicated regex, do so.
<ogotai>
and now that it got under my skin, I'm really curious why this regex doesn't work :)
<ogotai>
I know, it became an obsession more than anything
RougeR has quit [Ping timeout: 260 seconds]
za1b1tsu has quit [Ping timeout: 272 seconds]
<baweaver>
rubular.com
<baweaver>
That helps get a visual of why something does or does not work.
<ogotai>
I'm reading that "".scan() possibly behaves in the way I want, and .match() might not...
<ogotai>
though not getting out of "".scan() the desired result either
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
<ogotai>
okay, success -- input.scan(/([, \w]*=['\w]*)/) -- just had to abandon any indication of repetition in the regex itself (i.e. the {2} thing), and use String#scan() instead of Regexp#match() - ruby can be sometimes confusing
<apeiros_>
ogotai: just replacing the second group with {2} still matches for me
<apeiros_>
but ruby's regex engine does not repeat capturing groups
<apeiros_>
so if you quantify a capturing group, you'll only get the last substring it matches
apeiros_ is now known as apeiros
<apeiros>
personally I'd prefer if it'd match as arrays (or nested arrays in case of nested quantified capturing groups)
<apeiros>
(or hashes and nested hashes/arrays in case of named capturing groups)
<ogotai>
apeiros: yep, although supposedly (?=(regex)) is backtracking and matching everything, but that didn't work for me either
<apeiros>
(?=) is a lookahead and does not consume
<apeiros>
backtracking is a different mechanism
<ogotai>
I see, well, there probably is a way to do this in match(), but seems like scan() is nicely returning all repeating matches as array, so happy with that
<apeiros>
there is no way with quantified captures. rubys regex engine simply doesn't do that.
<apeiros>
and yes, scan can be a way around that. and if scan is insufficient, there's also its bigger sibling StringScanner
<ogotai>
thanks, will look into StringScanner
Dbugger has quit [Ping timeout: 252 seconds]
ellcs has quit [Ping timeout: 240 seconds]
al2o3-cr has joined #ruby
thinkpad has quit [Ping timeout: 244 seconds]
thinkpad has joined #ruby
dbz has joined #ruby
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
dbz_ has joined #ruby
graphene has quit [Remote host closed the connection]
dbz has quit [Ping timeout: 244 seconds]
xfbs has joined #ruby
Fr4n has quit [Read error: Connection reset by peer]
Fr4n has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros__ has joined #ruby
agent_white has joined #ruby
dellavg_ has quit [Ping timeout: 244 seconds]
Vapez has joined #ruby
pabs has joined #ruby
za1b1tsu has joined #ruby
grenierm has quit [Quit: grenierm]
za1b1tsu has quit [Ping timeout: 252 seconds]
wildermind has quit [Quit: Connection closed for inactivity]
grenierm has joined #ruby
grenierm has quit [Client Quit]
doubledup has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dbz_ has quit [Remote host closed the connection]
dbz has joined #ruby
craysiii has joined #ruby
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
thinkpad has quit [Ping timeout: 268 seconds]
dbz has quit [Remote host closed the connection]
thinkpad has joined #ruby
Puffball has quit [Read error: Connection reset by peer]
Pisuke has joined #ruby
MyMind has quit [Ping timeout: 268 seconds]
grenierm has joined #ruby
Sembei has joined #ruby
Pisuke has quit [Ping timeout: 268 seconds]
dbz has joined #ruby
akem__ has quit [Ping timeout: 252 seconds]
grenierm has quit [Quit: grenierm]
Puffball has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
themsay has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.2]
tdy has quit [Quit: WeeChat 2.2]
dbz has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
<zenspider>
ogotai: you might prefer split
mroutis has joined #ruby
mroutis has quit [Remote host closed the connection]
cagomez has joined #ruby
tdy has joined #ruby
apeiros__ is now known as apeiros
za1b1tsu has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
cagomez has quit [Remote host closed the connection]
reber has quit [Remote host closed the connection]
duderonomy has joined #ruby
cagomez has joined #ruby
mroutis has joined #ruby
<mroutis>
What's a good way to read from IO (line by line) without a huge memory impact?
IanMalcolm has joined #ruby
elphe has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
0M of memory is quite amazing. it means it doesn't even start ruby 😂
<mroutis>
everyone is doing this `gets.chomp` thingy; it's more fun if you can write "efficient" and readable code
<mroutis>
I think they don't take into account the memory accumulated before running the code
<apeiros>
ok
<apeiros>
not quite sure why it says your would use 28MB. the solution looks sensible (apart from the break vs. next mistake).
<apeiros>
also not quite sure why the topmost solution uses chomp. to_i will throw away the newline anyway.
<mroutis>
indeed
za1b1tsu has joined #ruby
<apeiros>
hm, though those solutions all do stop at the first 42
<mroutis>
yes, I misread my code, apeiros ... I thought it was intended to output just `42` (the `next` solution), but it's about printing until you match the first 42 (`break` one)
<mroutis>
sorry for that one, hehe
Vapez has quit [Read error: Connection reset by peer]
za1b1tsu has quit [Ping timeout: 246 seconds]
<mroutis>
lol, I copypasted the solution with 0M and submitted it again with my account
<mroutis>
27.6M
zapata has quit [Quit: WeeChat 2.2]
<mroutis>
I don't know if they are loading more stuff than needed, or it is the base runtime memspace of ruby 2.3.3
<mroutis>
well, mystery solved, thank you a lot, apeiros, it was bugging me like crazy
Freshnuts has joined #ruby
duderonomy has joined #ruby
<apeiros>
mroutis: good to know. I guess their instrumentation was not updated along with other things.
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
xfbs has quit [Quit: afk]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]