<leftylink>
so, I dunno. it works but it's just not very aesthetically pleasing
<leftylink>
like there's no rhyme or reason to the number of consecutive question marks
cloud69 has quit [Quit: Connection closed for inactivity]
Swyper has joined #ruby
bambanx has joined #ruby
bambanx has quit [Client Quit]
code_zombie has quit [Quit: Leaving]
BenDover has joined #ruby
dfucci has joined #ruby
ZeroFreak has joined #ruby
hiroaki has joined #ruby
ua has quit [Ping timeout: 265 seconds]
DaRock has quit [Ping timeout: 240 seconds]
ua has joined #ruby
weaksauce has quit [Ping timeout: 256 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ZeroFreak has quit [Remote host closed the connection]
coniptor has quit [Ping timeout: 272 seconds]
ur5us has joined #ruby
ur5us has quit [Client Quit]
DaRock has joined #ruby
coniptor has joined #ruby
royo25 has joined #ruby
royo25 has quit [Ping timeout: 240 seconds]
cloud69 has joined #ruby
vondruch has joined #ruby
tekk has quit [Ping timeout: 256 seconds]
tekk has joined #ruby
TomyWork has joined #ruby
royo25 has joined #ruby
pwnd_sfw has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
pwnd_sfw has joined #ruby
akem_ is now known as akem
akem has quit [Quit: Leaving]
<tempate>
Hello. I'm trying to use regular expressions in Ruby and it's giving me an undefined-group-option error. This is the line that's giving me trouble: pattern = Regexp.compile(/^(?P<pos1>\d+)-(?P<pos2>\d+) (?P<letter>[a-z]{1}): (?P<string>[a-z]+)$/)
akem has joined #ruby
<jhass>
First of all, passing a regex literal, //, to .compile doesn't make a whole lot of sense :) Now P indeed is not an option Ruby knows. A named group is simply (?<name>content)
<NeoThermic>
ok, so I'm trying to extend an ex-colleagues code, and my ruby experience is utterly minimal, so sorry in advanced if the questions are odd. This code has two methods, and both methods create a new Thread. I want to, from a 3rd method call the first two methods, but I need to ensure that they're done in serial (i.e method2 needs to be called after method1). Do Threads auto-resolve before the method returns, or do I need to have some form of
<NeoThermic>
locking?
jenrzzz has quit [Ping timeout: 272 seconds]
Technodrome has joined #ruby
<leftylink>
no, a thread may outlive the method that returned it. try Thread#join if wishing to wait until a thread finishes
<jhass>
NeoThermic: no. I would recommend you refactor out the actual job method1 and method2 are doing from launching a thread, so maybe add spawn_method1 which does just Thread.new { method1 }
<jhass>
then you can just have method3 be Thread.new { method1; method2; }
<NeoThermic>
hmm
<leftylink>
I yield to the sheer superiority of that suggestion to mine
<NeoThermic>
could I use join in each method to ensure they return only once the thread is done?
<NeoThermic>
I'm lothe to do major refactoring on this code, as ruby isn't a language I'm familiar with, mind. Smallest changes win :D
<leftylink>
if they should only return once the job is done, then there doesn't seem to be much point in spawning the thread at all
<jhass>
you could, if you don't break the callers with that. And if that's the case I would highly question why they launch a thread in the first place?
<jhass>
you gain nothing from a thread in ruby other than being able to continue your buisness while that's still doing its thing
<NeoThermic>
I think they thread so the rest of the code can continue working in the background
<jhass>
if you always .join, you prevent that "going on"
<NeoThermic>
yeah, hmm
banisterfiend has joined #ruby
fredolinhares has joined #ruby
<NeoThermic>
looking at their methods, they are very close to just: def methodX(args) Thread.new{...}
ellcs has joined #ruby
jenrzzz has joined #ruby
<NeoThermic>
yeah, I might just revert my progress and walk away slowly, I feel like I'm playing with fire on that :D
<NeoThermic>
thank you for the food for thought though, if I return to this code I will ensure to read up a lot more :)
jenrzzz has quit [Ping timeout: 260 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
impermanence has joined #ruby
jenrzzz has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
al2o3-cr has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
fercell has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
impermanence has quit [Quit: Connection closed]
pwl has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
drincruz has joined #ruby
tekk has quit [Ping timeout: 260 seconds]
tekk has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
vondruch has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
pwnd_sfw has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 272 seconds]
Technodrome has joined #ruby
kurko_ has joined #ruby
fercell has quit [Quit: WeeChat 2.9]
fratis has joined #ruby
jenrzzz has joined #ruby
apoc has joined #ruby
TCZ has joined #ruby
fredolinhares has quit [Read error: Connection reset by peer]
fratis has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
Technodrome has quit [Read error: Connection reset by peer]
DaRock has quit [Ping timeout: 260 seconds]
DaRock has joined #ruby
deadbee has joined #ruby
deadbee has quit [Client Quit]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deadbee has joined #ruby
jenrzzz has joined #ruby
DaRock has quit [Ping timeout: 256 seconds]
DaRock has joined #ruby
kurko_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
carbone5 has joined #ruby
jenrzzz has joined #ruby
deadbee has quit [Quit: WeeChat 2.9]
jenrzzz has quit [Ping timeout: 260 seconds]
DaRock has quit [Read error: Connection reset by peer]
Mrgoose has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
orbyt_ has joined #ruby
royo25 has quit [Quit: Bye]
carbone5 has quit [Quit: carbone5]
carbone5 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
dcunit3d has joined #ruby
ChmEarl has joined #ruby
TCZ has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
kurko_ has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 272 seconds]
carbone5 has quit [Quit: carbone5]
elcuervo has joined #ruby
carbone5 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has quit [Quit: Leaving]
cuerbot has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
carbone5 has quit [Quit: carbone5]
jenrzzz has quit [Ping timeout: 264 seconds]
pwl has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
bambanx has joined #ruby
solebox has joined #ruby
solebox has left #ruby [#ruby]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
pwl has joined #ruby
cthu| has joined #ruby
jenrzzz has joined #ruby
howdoi has joined #ruby
Eiam has joined #ruby
Eiam has quit [Client Quit]
vondruch has quit [Read error: Connection reset by peer]
Eiam has joined #ruby
akem has joined #ruby
jdeen has joined #ruby
al2o3-cr has joined #ruby
robotmay has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 246 seconds]
robotmay has joined #ruby
blackmesa has joined #ruby
bambanx has quit [Quit: Leaving]
TomyWork has quit [Remote host closed the connection]
jenrzzz has joined #ruby
titanbiscuit has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
coniptor has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jdeen has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jottr has joined #ruby
jenrzzz has joined #ruby
Rudd0 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
duckpuppy has quit [Ping timeout: 256 seconds]
duckpupp- has joined #ruby
banisterfiend has joined #ruby
jenrzzz has joined #ruby
dfucci has quit [Ping timeout: 272 seconds]
coniptor has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
<isene>
I have a string with the character 'φ' - how do I translate that to the actual character 'φ'?
<Synthead>
if I have a file open as binary for writing, how can I write a byte to it? If I do file.write(255), it seems to write the ascii "255" to the file when I want to write 0xFF
jenrzzz has quit [Ping timeout: 265 seconds]
<Synthead>
Ah, file.write(255.chr) does the trick :)