<apeiros_>
rue: yeah, telling myself the same all the time I use \p :-S
<apeiros_>
Tasser: so far I'm only aware of what asio mentioned. better lists very welcome
<rue>
That’s about the same as the onig docs themselves
<ddfreyne>
oh nice
<ddfreyne>
I did not know about \p
<rue>
Yeah, up to this point, I’ve kinda just been satisfied to know magic \p exist in the event I’d need them…but usually I manage to decompose the regexp well enough to not need
thone has quit [Ping timeout: 264 seconds]
<apeiros_>
well, I'm forced to use \p
<apeiros_>
\w in 1.9 is strictly [A-Za-z\d_], unlike in 1.8, where it was almost the same as what \p{Word} is now
zz_chrismcg is now known as chrismcg
EvilJStoker has joined #ruby-lang
<apeiros_>
(just to be clear: I like that change a lot)
srbartlett has joined #ruby-lang
d3vic3 has quit [Quit: leaving]
justinmcp has quit [Read error: Connection reset by peer]
woollyams has quit [Quit: Computer has gone to sleep.]
<lzhz>
Can't get the shorthand properties to work.
<lzhz>
[1] pry(main)> "foo".scan /\p{L}/
<lzhz>
SyntaxError: (pry):2: invalid character property name {L}: /\p{L}/
<lzhz>
\p{Alpha} works. \p{Letter} doesn't.
tofaffy has quit [Ping timeout: 246 seconds]
srbartlett has quit [Remote host closed the connection]
qwerxy has quit [Ping timeout: 244 seconds]
j342 has joined #ruby-lang
<zenspider>
apeiros_: ??? afaik \w in 1.8 is exactly what you're saying it is in 1.9
<_uR>
Hi guyz ! I'm new to Ruby and I'm trying to do my first XML parsing ever :). However, I'm currently facing a problem. My parsing works well, but then I would like to call the parsing script from another Ruby script. So here is my parsing script : http://pastie.org/4191980 (which works fine in standalone version ), and here's the calling script : http://pastie.org/4191982 . But here, the parsing script returns me that he can't find Te
<apeiros_>
and with binary encoding: [RUBY_VERSION, "hägör"[/\w+/n]] # => ["1.8.7", "h"]
qwerxy has joined #ruby-lang
<_uR>
yorickpeterse: To call the other script, I found many ways, but I just decided to do the backtick thingie (maybe the less elegant, but nevermind). And I really don't understand why it doesn't find Test.xml
<yorickpeterse>
_uR: the backticks execute it as a shell script
<_uR>
yorickpeterse: fine for me
<yorickpeterse>
If you want to execute arbitrary Ruby code you can just require() it
<_uR>
yorickpeterse: But I need a parameter
<yorickpeterse>
Ah
gsav has joined #ruby-lang
RPM has joined #ruby-lang
<_uR>
Oh I have a better error now. I modified my calling script to this : http://pastie.org/4192017 (I basically changed "#{f}" to "#{x}/#{f}" to have the path of the file), and now I have another error : http://pastie.org/4192023 . At least, he found my XML file
NeVeR_ has quit [Ping timeout: 245 seconds]
<_uR>
But I don't understand because the parsing script works in standalone version (if I call it directly with the XML file as argument)
<yorickpeterse>
_uR: Please don't use global variables
<yorickpeterse>
$variable is a global one
<yorickpeterse>
Ruby doesn't use sigils for local variables
<_uR>
yorickpeterse: You really want to know why I used some ? :D
<yorickpeterse>
No, I don't care because it's a dumb idea
<yorickpeterse>
anyway, I think I've found your issue
<devth>
what's the idiomatic way to wrap a long ruby oneliner? e.g. foo.map { ..... }.reject { ....... } etc. after 80 chars, i like to put the ".reject" on the next line, but i get warnings.
<canton7>
either end the line with a \, or leave the dot on the previous line
apeiros_ has quit [Remote host closed the connection]
<canton7>
or use the bang forms, and put one statement per line (e.g. foo.map!{ ... } \n foo.reject!{ ... } )
<devth>
k, thx.
<lianj>
nah, not a bang!
mortice has quit [Quit: leaving]
mortice has joined #ruby-lang
mistym has quit [Remote host closed the connection]
neocoin has quit [Remote host closed the connection]
neocoin has joined #ruby-lang
msaffitz has joined #ruby-lang
neocoin has quit [Ping timeout: 240 seconds]
wallerdev has joined #ruby-lang
neocoin has joined #ruby-lang
enebo has joined #ruby-lang
diegoviola has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
selvakumaran has joined #ruby-lang
msaffitz has quit [Client Quit]
tsou has quit [Quit: tzi_gt pou eisai gamwto pali]
<corecode>
is there a better construct than h = Hash.new{|h,k| h[k] = []} ?
fgomez has joined #ruby-lang
<kyrylo>
corecode, let us imagine that we live in the Wonderworld. Let's forget Ruby rules, too. Next, give us an answer on simple question: how would you make it better?
imperator has quit [Ping timeout: 244 seconds]
savage-_ has joined #ruby-lang
mrsolo has quit [Quit: This computer has gone to sleep]
savage- has quit [Read error: Operation timed out]
<corecode>
no idea, that's why i am asking
<corecode>
i find it fairly bulky
<erikh>
corecode: for arrays, no, there isn't much better
<corecode>
erikh: or any other objects that carry state
<erikh>
if it was an automatic value like a Fixnum or a Symbol you could h = Hash.new(0)
mrsolo has joined #ruby-lang
<corecode>
yeh
<erikh>
right.
<erikh>
basically anything other than a fixnum or symbol.
<corecode>
just doing a reality check here
<erikh>
hey, no problem.
<corecode>
:)
bglusman has joined #ruby-lang
<corecode>
i think in retrospect it might have been nicer to have the block return a value to be assigned to the hash field
<corecode>
instead of passing the hash and the key to the block and expecting the block to have side effects
selector has joined #ruby-lang
marcostoledo has quit [Quit: Leaving...]
rking has quit [Quit: Shutting down. To migrate servers. Because of… a leap-second bug.]
selector has left #ruby-lang ["Leaving"]
<apeiros_>
corecode: subclass hash. now you never have to do it again.
<apeiros_>
corecode: I disagree @ "it might have been nicer to have the block return a value to be assigned to the hash field"
<apeiros_>
note that the normal default value doesn't get assigned to the hash either.
sailias has joined #ruby-lang
chongyu123 has joined #ruby-lang
fgomez has quit [Quit: Lost terminal]
<corecode>
oh, right
<corecode>
good point
<corecode>
i retract my comment then
xtagon has joined #ruby-lang
qpingu has joined #ruby-lang
gianlucadv has quit [Excess Flood]
tonni has quit [Read error: Connection reset by peer]
akira989 has quit []
gianlucadv has joined #ruby-lang
akira989 has joined #ruby-lang
dalekurt has quit [Read error: Connection reset by peer]
dalekurt has joined #ruby-lang
soahccc` is now known as soahccc
anjen has joined #ruby-lang
bryancp has quit [Remote host closed the connection]
pbjorklund has joined #ruby-lang
heftig has joined #ruby-lang
pbjorklu1d has quit [Ping timeout: 248 seconds]
Austin__ has joined #ruby-lang
havenn has joined #ruby-lang
tonni has joined #ruby-lang
cirwin has joined #ruby-lang
carloslopes has joined #ruby-lang
carloslopes has quit [Client Quit]
carloslopes has joined #ruby-lang
cantonic_ has joined #ruby-lang
zmack has quit [Remote host closed the connection]
Weems has joined #ruby-lang
achiu1 has joined #ruby-lang
cantonic has quit [Ping timeout: 245 seconds]
cantonic_ is now known as cantonic
achiu1 has quit [Client Quit]
erpuds has quit [Quit: erpuds]
macmartine has joined #ruby-lang
soahccc is now known as soahccc`
banisterfiend has quit [Read error: Connection reset by peer]
anjen has quit [Quit: anjen]
bglusman has quit [Remote host closed the connection]
banisterfiend has joined #ruby-lang
imperator has joined #ruby-lang
havenn has quit [Remote host closed the connection]
rking has joined #ruby-lang
mark_locklear has quit [Quit: Leaving]
tubbo has joined #ruby-lang
fgomez has joined #ruby-lang
benanne has joined #ruby-lang
kvirani has joined #ruby-lang
musl has joined #ruby-lang
musl has quit [Client Quit]
musl has joined #ruby-lang
musl has quit [Client Quit]
musl has joined #ruby-lang
burgestrand has joined #ruby-lang
imperator has quit [Quit: Leaving]
Axsuul has joined #ruby-lang
ryanf has joined #ruby-lang
havenn has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
enebo has quit [Ping timeout: 246 seconds]
Torrieri has joined #ruby-lang
Torrieri has quit [Changing host]
Torrieri has joined #ruby-lang
gsav has quit [Ping timeout: 248 seconds]
hakunin has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
solars has joined #ruby-lang
retro|cz has joined #ruby-lang
tbuehlmann has quit []
agile has joined #ruby-lang
ttilley is now known as ttilley_off
dv310p3r has quit [Ping timeout: 246 seconds]
mimay has joined #ruby-lang
carloslopes1 has joined #ruby-lang
carloslopes has quit [Ping timeout: 264 seconds]
carloslopes1 has quit [Client Quit]
carloslopes has joined #ruby-lang
mimay has left #ruby-lang [#ruby-lang]
mimay has joined #ruby-lang
gouthamvel has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 245 seconds]
mimay has left #ruby-lang [#ruby-lang]
mimay has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
Criztian has joined #ruby-lang
pbjorklund has quit [Read error: Operation timed out]
enebo has joined #ruby-lang
pbjorklund has joined #ruby-lang
Torrieri has quit [Ping timeout: 246 seconds]
<zenspider>
corecode: one nice thing is that the block can have multiple side effects.
<zenspider>
here's my favorite impl
<zenspider>
class HashHash < Hash; def initialize; super { |h,k| h[k] = HashHash.new }; end; end
msaffitz has quit [Quit: Computer has gone to sleep.]
<zenspider>
throw in a method_missing for extra sauce... but that's bad form
VGoff is now known as VGoff_afk
Tearan has quit [Ping timeout: 250 seconds]
Tearan has joined #ruby-lang
VGoff_afk is now known as VGoff
zz_chrismcg is now known as chrismcg
pbjorklund has quit [Ping timeout: 240 seconds]
joast has quit [Ping timeout: 244 seconds]
pbjorklund has joined #ruby-lang
crackit__ has joined #ruby-lang
workmad3 has joined #ruby-lang
crackity_jones has quit [Ping timeout: 248 seconds]
crackit__ has quit [Client Quit]
<rue>
Missing method missing
crackity_jones has joined #ruby-lang
bglusman has joined #ruby-lang
Tearan_ has joined #ruby-lang
Hakon|mbp has quit [Quit: Leaving...]
Tearan has quit [Ping timeout: 244 seconds]
Tearan_ is now known as Tearan
sepp2k has quit [Ping timeout: 246 seconds]
gouthamvel has joined #ruby-lang
mimay has quit [Remote host closed the connection]
gouthamvel has quit [Ping timeout: 252 seconds]
Fullmoon has quit [Ping timeout: 246 seconds]
fbernier has quit [Ping timeout: 246 seconds]
pbjorklund has quit [Ping timeout: 264 seconds]
solars has quit [Ping timeout: 264 seconds]
pbjorklund has joined #ruby-lang
jperry2 has quit [Ping timeout: 245 seconds]
VGoff is now known as VGoff_afk
msaffitz has joined #ruby-lang
sepp2k has joined #ruby-lang
havenn has quit [Remote host closed the connection]
qwerxy has quit [Ping timeout: 244 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
scampbell has quit [Remote host closed the connection]
chrismcg is now known as zz_chrismcg
yannis has quit [Quit: yannis]
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
sailias has quit [Quit: Leaving.]
chongyu123 has quit [Quit: Leaving]
chongyu123 has joined #ruby-lang
chongyu123 has quit [Client Quit]
tonni has quit [Remote host closed the connection]
joast has joined #ruby-lang
tonni has joined #ruby-lang
yxhuvud has quit [Ping timeout: 244 seconds]
<corecode>
zenspider: right
tommyvyo has quit [Quit: Computer has gone to sleep.]
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
workmad3 has quit [Ping timeout: 264 seconds]
gsav has joined #ruby-lang
mssola has quit [Quit: Konversation terminated!]
cjs226 has quit []
toretore has quit [Quit: This computer has gone to sleep]
naz has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby-lang
someguy has joined #ruby-lang
naz has joined #ruby-lang
ryanf has quit [Quit: leaving]
<freedrull>
anyone read the latest backstage.soundcloud entry? pretty crazy stuff
tubbo is now known as tubbo`holiday
tcopp has left #ruby-lang [#ruby-lang]
s0ra_h is now known as sora_h
rking has quit [Quit: I suck: started outside of tmux.`]
rking has joined #ruby-lang
Carnage\ has quit [Remote host closed the connection]
<boobah>
freedrull: cool
badfish129 has quit [Quit: badfish129]
badfish129 has joined #ruby-lang
Carnage\ has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
mistym has quit [Remote host closed the connection]
sockmonk has quit [Ping timeout: 272 seconds]
sora_h is now known as s0ra_h
woollyams has quit [Quit: Computer has gone to sleep.]
meise has quit [Read error: No route to host]
Austin__ has quit [Quit: Leaving.]
msaffitz has quit [Quit: Computer has gone to sleep.]
enebo has quit [Quit: enebo]
workmad3 has quit [Ping timeout: 264 seconds]
apeiros_ has quit [Remote host closed the connection]
<SmoothPorcupine>
drbrain, maybe this will help: drbrain is made of bad luck, woman, and clouds. With a dash of James Bond. http://en.shindanmaker.com/219278
<erikh>
drbrain: you're being attacked by markov himself
<erikh>
(that's my guess)
coryf has quit [Remote host closed the connection]
<SmoothPorcupine>
erikh, nah I think it's either random and stored or seeded with a hash.
<SmoothPorcupine>
erikh is made of lazy, man, and desperation. With a dash of AMERICA.
enebo has joined #ruby-lang
nofxxx has joined #ruby-lang
carloslopes has quit [Quit: Leaving.]
nofxxxx has quit [Ping timeout: 265 seconds]
wmoxam has quit [Quit: leaving]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<erikh>
haha wow
kvirani has quit [Remote host closed the connection]
ilyam has joined #ruby-lang
benanne has quit [Quit: kbai]
macmartine has quit [Quit: macmartine]
sepp2k has quit [Remote host closed the connection]
Carnage\ has quit []
flowerpot has joined #ruby-lang
imperator has joined #ruby-lang
yannis has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
petercooper has joined #ruby-lang
kurko_ has quit [Quit: This computer has gone to sleep]
<zenspider>
zenspider is made of R&B, hyenas, and genius. With a dash of pervert.
<zenspider>
R&B?!? how dare they!
<zenspider>
I need a physicist
kurko_ has joined #ruby-lang
outoftime has quit [Quit: Leaving]
plusk has quit [Quit: This computer has gone to sleep]
ryanf has joined #ruby-lang
gsav has quit [Ping timeout: 244 seconds]
yannis has quit [Quit: yannis]
ruurd has quit [Quit: Leaving...]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
msaffitz has joined #ruby-lang
<rue>
Ha-ha
<imperator>
rue, hey, did you beat up that french guy that pushed your mascot yet?
s0ra_h is now known as sora_h
<rue>
I do not recall either event
devth has quit [Remote host closed the connection]