jonathanmarvens has quit [Remote host closed the connection]
sdouglas has quit [Remote host closed the connection]
rahul_j has quit [Quit: rahul_j]
alexju has quit [Remote host closed the connection]
MikaAK has joined #ruby-lang
cmoneylulz has joined #ruby-lang
broconne1 has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
CaptainJet has joined #ruby-lang
Mon_Ouie has quit [Read error: Connection reset by peer]
twright has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
saarinen has quit [Quit: saarinen]
jonathanmarvens has quit [Remote host closed the connection]
Burgestrand has joined #ruby-lang
saarinen has joined #ruby-lang
<dacamp>
I maybe opening a can of worms, but why does FalseClass/TrueClass/NilClass raise an exception if you try to initialize a new instance of that (singleton) class?
<whitequark>
dacamp: well, because it's a singleton? :)
yubrew has joined #ruby-lang
<whitequark>
if you could invoke #new, it would stop being a singleton.
<yxhuvud>
not if it returned the singleton.
<whitequark>
(and in case of true/false/nil, it would break a lot of invariants inside the implementation)
<yxhuvud>
still quite pointless though
<whitequark>
yxhuvud: that's not what #new does.
bender_unit has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<whitequark>
#new returns a new instance, not an existing one.
<jhass>
one could argue they should have an #instance
<Who>
hey, I have a question
<jhass>
but then, why'd you need it
<whitequark>
... how about `true`
<Who>
MRI in case it detects a deadlock will raise an exception right?
<Who>
so its not possible to have a deadlock in MRI?
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
<Who>
where the process is hung and can’t respond to SIG TERM?
sepp2k has joined #ruby-lang
heftig has quit [Ping timeout: 272 seconds]
<jhass>
Who: MRI detects when all threads are in the blocking state and raises an exception if none of these are caused by IO
<jhass>
that does by far not prevent all cases of a deadlock
<jhass>
and there are also things like livelocks
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malconis has joined #ruby-lang
<Who>
hmm so if a process is stuck (no logs are printed) but when you send a signal to it and it responds to it, does it mean it was stuck on IO?
<jhass>
no
<jhass>
might be possible but you can't tell by that
<dacamp>
whitequark: shit I guess I need to better understand wtf a singleton class is then. I guess I was under the assumption you still had to initialize the (first and only) instance. Thanks
yubrew has quit [Ping timeout: 260 seconds]
djbkd has quit [Remote host closed the connection]
<whitequark>
dacamp: TrueClass and friends are special
<whitequark>
they're initialized by the runtime for you, and runtime doesn't need #new to exist at all
<Who>
what’s the best way to debug such cases? I have put a method to print backtrace of all on signal trap
<Who>
is there anything else I can do to help me catch it?
jsullivandigs has quit [Remote host closed the connection]
<dacamp>
whitequark: yeah I guess "doesn't need, therfore doesn't have" didn't seem very ruby to me... "doesn't need until it does" seemed more the ruby way.
<jhass>
Who: you probably could also dump the thread states. And profiling your code might give an indication where it's stuck. It's hard to give general tips for such cases though
<whitequark>
dacamp: let me elaborate. with TrueClass, the behavior you would get if you *had* #new would be extremely odd
<whitequark>
because they're special-cased inside the runtime
<whitequark>
it would basically break everything
jsullivandigs has joined #ruby-lang
<jhass>
Who: if it's not a too complex problem, trying to build a minimal reproducing example can fulfill wonders. At least you then would have something to show
<Who>
jhass: that’s the problem, it only happens on production when it’s interacting with one of our message queues and DB. Also it happens at pure random, after a week or 2-3 days etc
<Who>
I have been trying to use gdb in such cases but it segfaults in most such cases
<whitequark>
sounds like a lack of sound design... but yes, I would do trap(:QUIT)
<whitequark>
and list the threads inside
djbkd has joined #ruby-lang
<whitequark>
like java does
<dacamp>
whitequark: not sure if you'd even know, but why even make it a class then?
<whitequark>
dacamp: as opposed to having an Object instance with some singleton methods, you mean?
<whitequark>
that's actually a good question. I think it was a very early design choice that has been carried forward.
<yxhuvud>
because even more things would break if it didn't have a class
<whitequark>
I'm fairly sure Ruby had regular classes before singleton classes...
<whitequark>
there wouldn't really be any difference except lack of is_a?(TrueClass) and so on
<whitequark>
which doesn't matter
jonathanmarvens has joined #ruby-lang
<jhass>
yxhuvud: plenty of things don't. For example toplevel self and ARGF
<whitequark>
Who: yeah I'd use something like that
<yxhuvud>
jhass: generally speaking, those are not passed around the way booleans are.
<yxhuvud>
which make them less prone to inducing breakage
<jhass>
yxhuvud: what about ENV?
<Who>
jhass: thanks about the deadlock info, however about the 2nd occurence I said when signal term was heard by the main thread and it was responding to it. What other reason could be there? just few ideas might help me out here
<dacamp>
whitequark: exactly what i mean. and is_a? support wouldn't really be necessary if true/false/nil were thought of more along the lines of self rather than seperate classes
<dacamp>
anyways, thanks!
<apeiros>
dacamp: another take at it: true/false/nil are immediates
<apeiros>
that is, their value is encoded directly in the VALUE
<yxhuvud>
jhass: still not passed around a lot.
MichD is now known as michd
<apeiros>
allowing more instances would probably make it rather complex
<whitequark>
apeiros: that's what i just said -_-
<apeiros>
whitequark: ok. didn't read the full backlog :)
<jhass>
Who: does maybe the cpu go up?
<Who>
in the 2nd scenario, no it doesn’t the process is actually sleeping
Burgestrand has quit [Quit: Burgestrand]
<jhass>
sleeping or blocking?
<Who>
I remember seeing S+ while doing ps aux
<jhass>
as said, I'd really try to dump the thread states
<jhass>
oh well, looks like Thread#status doesn't differentiate between blocked/sleeping/waiting
stamina has joined #ruby-lang
Lumio has joined #ruby-lang
jsullivandigs has quit [Read error: Connection reset by peer]
<Who>
jhass: what I don’t get is, the main thread which job is to fetch few things from the DB and then pass it to threadpool (https://github.com/meh/ruby-thread) to send those messages (it’s a loop + sleep of 2 seconds) and there are muliple logs around it as well
Cakey has joined #ruby-lang
jsullivandigs has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
jsullivandigs has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
Lumio has quit [Quit: Lumio]
Cakey has quit [Ping timeout: 264 seconds]
Fushi has quit [Quit: Connection closed for inactivity]
centrx has joined #ruby-lang
chouhoul_ has joined #ruby-lang
simoz1111114 has joined #ruby-lang
chouhoulis has quit [Ping timeout: 248 seconds]
chouhoul_ has quit [Remote host closed the connection]
<karamazov>
I've got a 2d square create with some arrays within an array. Is there an efficient way to empty one of the internal arrays? I figure I could just pop n number of times but that doesn't seem eloquent
<karamazov>
*created
Who has quit [Quit: Who]
<jhass>
just assign an empty array to that row?
<jhass>
field[2] = []
<karamazov>
Ha wow. I was over complicating that.
<karamazov>
Thanks jhass
<jhass>
actually there's #clear
<jhass>
field[2].clear
relix has joined #ruby-lang
<karamazov>
Clear is perfect - don't know how I missed that one in the docs
relix has quit [Client Quit]
djbkd has quit [Ping timeout: 264 seconds]
relix has joined #ruby-lang
duderonomy has joined #ruby-lang
earthquake has joined #ruby-lang
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
alexju has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
chaos___________ has joined #ruby-lang
aero224 has joined #ruby-lang
dm78 has joined #ruby-lang
shinnya has joined #ruby-lang
djbkd has joined #ruby-lang
Lumio has joined #ruby-lang
banister has joined #ruby-lang
bantic has joined #ruby-lang
jonathanmarvens has quit [Remote host closed the connection]
schaerli has quit [Remote host closed the connection]
jonathanmarvens has joined #ruby-lang
schaerli has joined #ruby-lang
yubrew has joined #ruby-lang
postmodern has quit [Quit: Leaving]
jonathanmarvens has quit [Ping timeout: 252 seconds]
schaerli has quit [Remote host closed the connection]
schaerli has joined #ruby-lang
jonathanmarvens has joined #ruby-lang
[spoiler] has quit [Quit: Leaving]
kaiserpathos has joined #ruby-lang
_ht has quit [Remote host closed the connection]
dm78 has quit [Remote host closed the connection]
schaerli has quit [Remote host closed the connection]
yubrew has quit [Ping timeout: 255 seconds]
schaerli has joined #ruby-lang
rue has joined #ruby-lang
broconne has quit [Quit: Leaving.]
banister has quit [Read error: Connection reset by peer]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
amsi has quit [Ping timeout: 255 seconds]
dm78 has joined #ruby-lang
mistym has quit [Remote host closed the connection]
amsi has joined #ruby-lang
banister has quit [Ping timeout: 244 seconds]
hellome has quit [Ping timeout: 255 seconds]
rue has quit [Remote host closed the connection]
schaerli_ has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jsullivandigs has joined #ruby-lang
schaerli has quit [Ping timeout: 264 seconds]
CaptainJet has quit []
schaerli_ has quit [Remote host closed the connection]
clamstar has quit [Ping timeout: 255 seconds]
luiz_lha has joined #ruby-lang
zenspider has quit [Ping timeout: 255 seconds]
zenspider_ has joined #ruby-lang
amsi has quit [Ping timeout: 240 seconds]
lele has quit [Ping timeout: 252 seconds]
klaNath_ has joined #ruby-lang
scmx has joined #ruby-lang
jyunderw_ has joined #ruby-lang
klaNath has quit [Ping timeout: 255 seconds]
pabs has quit [Ping timeout: 248 seconds]
Caius has quit [Ping timeout: 255 seconds]
jyunderw_ has left #ruby-lang [#ruby-lang]
clamstar has joined #ruby-lang
mistym has joined #ruby-lang
lele has joined #ruby-lang
pabs has joined #ruby-lang
Caius has joined #ruby-lang
pabs has quit [Ping timeout: 244 seconds]
skade has joined #ruby-lang
pglombardo has joined #ruby-lang
amsi has joined #ruby-lang
skade has quit [Client Quit]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
aero224_ has joined #ruby-lang
banister has joined #ruby-lang
scmx has quit [Read error: Connection reset by peer]
EvilJStoker has quit [Ping timeout: 255 seconds]
scmx has joined #ruby-lang
kvs has quit [Ping timeout: 255 seconds]
banister has quit [Client Quit]
aero224 has quit [Read error: Connection reset by peer]
aero224__ has joined #ruby-lang
EvilJStoker has joined #ruby-lang
bender_unit has joined #ruby-lang
aero224_ has quit [Ping timeout: 244 seconds]
karamazov has quit [Remote host closed the connection]
pabs has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Client Quit]
elia has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
arooni-mobile has joined #ruby-lang
jsullivandigs has joined #ruby-lang
yubrew has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
nofxx has joined #ruby-lang
havenwood has joined #ruby-lang
cored has quit [Ping timeout: 248 seconds]
zastern has quit [Ping timeout: 255 seconds]
yubrew has quit [Ping timeout: 252 seconds]
ur5us has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
nopc0de has quit [Ping timeout: 255 seconds]
mconnolly has quit [Ping timeout: 272 seconds]
banister has quit [Client Quit]
stamina has quit [Ping timeout: 255 seconds]
nopc0de has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
scampbell has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
mistym has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
djbkd has joined #ruby-lang
kvs has joined #ruby-lang
Mellett68 has quit [Read error: Connection reset by peer]
Mellett68_ has joined #ruby-lang
shinnya has quit [Ping timeout: 244 seconds]
dik_dak has joined #ruby-lang
symm- has joined #ruby-lang
TomFreudenberg has joined #ruby-lang
pglombardo has quit []
djbkd has quit [Remote host closed the connection]
<TomFreudenberg>
Problem with TCPServer connecting from remote client
<drbrain>
the root is always going to be first, so now you only traverse the descendants once
MikaAK1 has joined #ruby-lang
redgetan has joined #ruby-lang
<drbrain>
its too bad #descend doesn't return an Enumerator
karamazov has quit [Remote host closed the connection]
MikaAK1 has quit [Quit: node-irc says goodbye]
MikaAK2 has joined #ruby-lang
MikaAK2 has quit [Client Quit]
MikaAK has joined #ruby-lang
stardiviner has joined #ruby-lang
karamazov has joined #ruby-lang
bender_unit has joined #ruby-lang
danijoo_ has quit [Remote host closed the connection]
weems has joined #ruby-lang
kalehv has quit [Remote host closed the connection]
dik_dak has quit [Quit: Leaving]
bender_unit has quit [Ping timeout: 248 seconds]
jhass is now known as jhass|off
ascarter has joined #ruby-lang
karamazov has quit []
havenwood has quit []
kalehv has joined #ruby-lang
pixelhandler has joined #ruby-lang
btiefert has quit [Read error: Connection reset by peer]
btiefert has joined #ruby-lang
cored has quit [Ping timeout: 240 seconds]
elia has quit [Quit: Computer has gone to sleep.]
<darix>
drbrain: that line is neat
cored has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
jaimef has quit [Excess Flood]
jaimef has joined #ruby-lang
zz_dlu has quit [Ping timeout: 245 seconds]
rtlong has quit [Ping timeout: 272 seconds]
naterubin has quit [Ping timeout: 245 seconds]
whyshouldthefire has joined #ruby-lang
yeltzooo has quit [Ping timeout: 245 seconds]
woollyams has joined #ruby-lang
zz_dlu has joined #ruby-lang
yeltzooo has joined #ruby-lang
naterubin has joined #ruby-lang
rtlong has joined #ruby-lang
|jemc| has quit [Ping timeout: 244 seconds]
bantic has quit [Quit: bantic]
mrunknown has joined #ruby-lang
himself_ has joined #ruby-lang
cored has quit [Ping timeout: 252 seconds]
Lewix has joined #ruby-lang
havenwood has joined #ruby-lang
<whyshouldthefire>
Hey all -- I'm trying to write a multi-line regex that grabs all lines from this gist starting with Seat 1 and ending with the last line before the line that starts *** HOLE CARDS *** : https://gist.github.com/robcole/811948c7300bbdaaabd3
kalehv has quit [Remote host closed the connection]
replay has joined #ruby-lang
<whyshouldthefire>
I tried match(/(Seat.*[^*])/m) but that seems to grab the first *** but not the second... I just want to end on the last \n line before *** starts
earthquake has quit [Quit: earthquake]
<whyshouldthefire>
same with match(/(Seat.*)\*\*\*/m) ... feel like I'm doing something dumb here, but struggling with this bit
<TomFreudenberg1>
drbrain: got all stuff run ;-) thanks
<TomFreudenberg1>
I posted the correct answer and extended example to