<elaptics>
rstrip to to get rid of trailing whitespace
<apeiros_>
no
mrsolo has quit [Quit: Leaving]
<apeiros_>
rstrip gets read of leading whitespace
<apeiros_>
gah
<apeiros_>
you're correct, lstrip gets rid of leading, rstrip of trailing
<havenn>
<-- left right -->
<elaptics>
apeiros_: no, other way round :)
<elaptics>
that's how I remember it
jfl0wers has joined #ruby
SCommette has quit [Quit: SCommette]
<apeiros_>
yes, yes, of course…
* apeiros_
probably should go to bed and let his body take care of that bottle of wine…
<waxjar>
lol
nwertman has quit [Ping timeout: 264 seconds]
<apeiros_>
company christmas dinner 0:-)
<eph3meral>
a = [ 1, -2, 5, -9, 30 ]; start = 100; b = [ 101, 99, 104, 95, 125 ]; any ideas on a map/reduce or other type of transformative technique to get from a to b?
* apeiros_
off & gn8
<apeiros_>
eph3meral: looks like homework? o0
<eph3meral>
nope
<eph3meral>
i'm faaaar too old for homework
<apeiros_>
looks like range zip + map
<seanstickle>
I don't even know what you're doing there
nmabry has quit [Quit: nmabry]
<apeiros_>
hm, can ruby do reverse range?
<eph3meral>
it's more accurately thought of as deltas = [ 1, -2, 5, -9, 30 ]; start = 100; results = [ 101, 99, 104, 95, 125 ];
<seanstickle>
Adding 100? Subtracting 101?
<apeiros_>
at least it looks like 100..95 zip/mapped with that array (sum of the values)
<eph3meral>
so the first list is a list of changes
Russell^^ has joined #ruby
<apeiros_>
ah
<seanstickle>
Makes no damn sense to me.
<eph3meral>
and the second list would be, if you start at value X, where do you get to if you go those distances
<apeiros_>
100 + 1 = 101, -2 = 99, +5 = 104
<eph3meral>
yep
<eph3meral>
exactly
<apeiros_>
memo + map
<eph3meral>
so, think like, change in temperatures
<reppard>
is this a project euler?
fumduq has joined #ruby
c0rn has quit []
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<elaptics>
oops missed the opening " on the first one
<apeiros_>
Date.iso8601('2012-12-14')
mengu has quit [Read error: Connection reset by peer]
<Solnse>
what should I use to find two letters in a string? for example, I need to find 'qu' and move it.
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
wargasm has joined #ruby
<apeiros_>
Solnse: probably gsub, but your question is too vague.
cdt has quit [Client Quit]
<Solnse>
I need to treat 'qu' as if it was one letter. moving it for a pig latin method.
<Solnse>
i'll look at the docs for gsub.
arya has joined #ruby
jaygen_ has quit [Remote host closed the connection]
art_man1 has quit [Quit: art_man1]
newfprag has joined #ruby
jaygen has joined #ruby
arya_ has quit [Ping timeout: 244 seconds]
<Solnse>
apeiros_: this is what I have so far... now trying to treat 'qu' as a single letter even if it doesn't start the word. https://gist.github.com/4289914
chrstphrhrt has quit [Quit: chrstphrhrt]
nemesit has quit [Quit: Leaving...]
timonv has quit [Remote host closed the connection]
<apeiros_>
Solnse: sorry, too much to read. got a smaller example?
<apeiros_>
and `word[0..1].include?("qu")` is equivalent to `word[0,2] == 'qu'`
<apeiros_>
(or word[0..1] == 'qu', if you insist on using ranges)
<Solnse>
well, now I don't know what the range will be... trying to determine if the word contains QU and where.
etank has joined #ruby
<apeiros_>
isn't piglatin some swiss thing? from bern I think?
<Solnse>
lol
DatumDrop has joined #ruby
<Solnse>
it's just an exercise I'm using to learn :)
<apeiros_>
"fooobar".index("ba") # => 4
<apeiros_>
that tells you whether and where
<apeiros_>
=~ also does, btw.
<Solnse>
.index ...ok, will read up on that.
<Solnse>
apeiros_: thanks
zastern has quit [Ping timeout: 245 seconds]
cakehero has joined #ruby
darthdeus has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
hackerdude has quit [Remote host closed the connection]
arya has quit [Ping timeout: 244 seconds]
baroquebobcat has joined #ruby
cakehero has quit [Client Quit]
rezzack has quit [Quit: Leaving.]
DatumDrop has quit [Ping timeout: 255 seconds]
combataircraft has quit [Quit: combataircraft]
billiam has quit [Quit: Leaving]
combataircraft has joined #ruby
newfprag has left #ruby ["Konversation terminated!"]
<swarley>
word[0...2]
<swarley>
mmm dots galore
rezzack has joined #ruby
MarcOnline has joined #ruby
<Solnse>
is it possible to use a variable in the position or an I chasing the wrong thought? position = word.index("qu")
<waxjar>
ruby doesn't know wether to do (result << word[0..pos]) + (etc) or result << (word[0..posetcetcetc)
<Solnse>
waxjar: will try that
<swarley>
Solnse; the other thing you can do instead of [0..(position - 1)] is [0...position]
<swarley>
the ... essentially does the same thing
alexspeller has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 245 seconds]
jrajav has joined #ruby
Banistergalaxy has joined #ruby
SCommette has joined #ruby
ckrailo has quit [Quit: Leaving...]
<Solnse>
using: elsif word.index("qu")as a conditional will pass true no matter what the position, right?
combataircraft has quit [Quit: combataircraft]
postmodern has joined #ruby
<waxjar>
yes. there is an #include? though
Ziioynx has joined #ruby
osvico has joined #ruby
benlieb has joined #ruby
SCommette has quit [Client Quit]
ddd has quit [Quit: Leaving.]
Chryson has joined #ruby
banisterfiend has quit [Ping timeout: 256 seconds]
daniel_- has quit [Ping timeout: 260 seconds]
slainer68 has quit [Remote host closed the connection]
Solnse1 has joined #ruby
Godd2 has joined #ruby
<Godd2>
I have a quick metaprogramming question
<Godd2>
I posted it to Reddit a couple weeks ago, but no response, so I went ahead and made a gist of it: https://gist.github.com/4290078
Solnse has quit [Ping timeout: 246 seconds]
jrist is now known as jrist-afk
jenrzzz_ has joined #ruby
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
zastern has joined #ruby
v1n has quit [Quit: WeeChat 0.3.9.2]
ndboost has joined #ruby
zastern has quit [Remote host closed the connection]
ismaelabreu has joined #ruby
pwelch has joined #ruby
pwelch has quit [Client Quit]
ipsifendus has left #ruby [#ruby]
<waxjar>
Godd2, you read wrong :) you *cannot* call a private method with an explicit receiver
mikepack has joined #ruby
SCommette has joined #ruby
<waxjar>
self. is an explicit receiver
SCommette has quit [Client Quit]
<Godd2>
then why does he call self an implicit receiver?
ismaelabreu has left #ruby [#ruby]
<Godd2>
I understand yourstatement, and thanks for clarifying, but the book is still fuzzy...
brianpWins has quit [Quit: brianpWins]
Russell^^ has quit [Quit: Russell^^]
<Godd2>
"it must be on the implicit receiver—self."
Guest8169 has quit [Quit: This computer has gone to sleep]
banisterfiend has joined #ruby
mikepack has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 252 seconds]
eka has quit [Remote host closed the connection]
<Godd2>
oh wait does he mean that there are two ways to use self?
<elaptics>
Godd2: it means that when you call private_method within the class, it's implicitly being done on self. It's just you can't use self explicitly because it's a private_method
Dan_ has joined #ruby
<Godd2>
explicitly, by typing out the 4 letters "s" "e" "l" f", and implicitly by just calling the privat emethod?
<elaptics>
yes
<waxjar>
yes
<Godd2>
ok I see now
Dan_ has quit [Client Quit]
<waxjar>
this isn't related to metaprogramming, btw :)
squidBits has quit [Quit: squidBits]
<Godd2>
if Im not mistaken, self is the current instantiation of the class, no?
<waxjar>
yes
dankest has quit [Ping timeout: 245 seconds]
<Solnse1>
I can't figure out why my else statement is not catching word that contain "qu"... could somebody look please? https://gist.github.com/4290146
hamfz_ has joined #ruby
<Godd2>
is there a difference between that definition and "the thing that made this method call"
pwelch has joined #ruby
joeycarm_ has quit [Remote host closed the connection]
ndboost has quit [Remote host closed the connection]
<Godd2>
"square".index("qu") == 1
<Solnse1>
I tried putting in a return "break" statement under the else condition, and it doesn't trigger... so I guess it's not entering that branch at all
andalf has joined #ruby
<Godd2>
"square"[0..1] == "sq"
<waxjar>
i think you have to do position + 3 the ay is now overwriting the u in qu?
burgestrand has joined #ruby
<Solnse1>
yeah I understand that... but I am not even entering that branch yet.
piotr_ has joined #ruby
elaptics is now known as elaptics`away
reppard has quit [Ping timeout: 256 seconds]
<Godd2>
so you're tyring to get the Pig Latin output rihgt?
aces1up has joined #ruby
<Solnse1>
yes
<waxjar>
Solnse1: is all you have to do replay qu with quay?
<Solnse1>
I've got all the code working, except for handling "qu" in the middle of a word
<waxjar>
*replace
freeayu has quit [Remote host closed the connection]
<Solnse1>
else#'qu' is somewhere else in the word.
<Solnse1>
position = word.index("qu")
<Solnse1>
return position
<Solnse1>
does not trigger
punkrawkR has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
jxriddle has quit [Quit: jxriddle]
chussenot has joined #ruby
chussenot has quit [Client Quit]
robotmay has quit [Remote host closed the connection]
<Solnse1>
yeah I had to take it out of the vowel/consonant checks and put it top level in the block. https://gist.github.com/4290338
<Solnse1>
it works perfectly now.
Slivka has joined #ruby
sn0wb1rd has joined #ruby
Vert has joined #ruby
woolite64 has quit []
mascool has quit [Ping timeout: 260 seconds]
billy_ran_away has quit [*.net *.split]
yacks has quit [*.net *.split]
dantesun has quit [*.net *.split]
ruzu has quit [*.net *.split]
madhatter has quit [*.net *.split]
Nykolla has quit [*.net *.split]
mikekelly has quit [*.net *.split]
inimino has quit [*.net *.split]
pcboy__ has quit [*.net *.split]
Slivka has quit [*.net *.split]
mickn has quit [*.net *.split]
mahmoudimus has quit [*.net *.split]
ryanf has quit [*.net *.split]
daniel_hinojosa has quit [*.net *.split]
rcj_ has quit [*.net *.split]
JDubs has quit [*.net *.split]
musl has quit [*.net *.split]
TTilus has quit [*.net *.split]
s4muel_ has quit [*.net *.split]
dcope has quit [*.net *.split]
ccooke has quit [*.net *.split]
strtok_ has quit [*.net *.split]
aetaric has quit [*.net *.split]
arusso has quit [*.net *.split]
GeekOnCoffee has quit [*.net *.split]
gurps_ has quit [*.net *.split]
percival_ has quit [*.net *.split]
G has quit [*.net *.split]
crazed has quit [*.net *.split]
tessi has quit [*.net *.split]
Solnse1 has quit [*.net *.split]
Guedes has quit [*.net *.split]
zeppelin has quit [*.net *.split]
Drewch_ has quit [*.net *.split]
yeban has quit [*.net *.split]
SegFaultAX has quit [*.net *.split]
Nanuq has quit [*.net *.split]
w|t has quit [*.net *.split]
jsilver has quit [*.net *.split]
alta has quit [*.net *.split]
digifiv5e has quit [*.net *.split]
libryder has quit [*.net *.split]
bjeanes has quit [*.net *.split]
seich has quit [*.net *.split]
waxjar has quit [*.net *.split]
havenn has quit [*.net *.split]
mikepack has quit [*.net *.split]
Raboo_ has quit [*.net *.split]
dmiller has quit [*.net *.split]
rramsden has quit [*.net *.split]
darthdeus has quit [*.net *.split]
alanp_ has quit [*.net *.split]
friskd has quit [*.net *.split]
lkba has quit [*.net *.split]
wf2f has quit [*.net *.split]
GeekOnCoffee_ has quit [*.net *.split]
FiveAcres has quit [*.net *.split]
companion has quit [*.net *.split]
elaptics`away has quit [*.net *.split]
arubin has quit [*.net *.split]
crazedpsyc has quit [*.net *.split]
Eiam has quit [*.net *.split]
Emmanuel_Chanel has quit [*.net *.split]
beandip has quit [*.net *.split]
Schmidt has quit [*.net *.split]
bier has quit [*.net *.split]
oGminor has quit [*.net *.split]
qubit has quit [*.net *.split]
katherinem13 has quit [*.net *.split]
Yarou has quit [*.net *.split]
pasties has quit [*.net *.split]
straind has quit [*.net *.split]
thomasfedb has quit [*.net *.split]
bricker has quit [*.net *.split]
digiwth has quit [*.net *.split]
verto|off has quit [*.net *.split]
benwoody has quit [*.net *.split]
aef has quit [*.net *.split]
weeb1e has quit [*.net *.split]
imami|afk has quit [*.net *.split]
malcolmva has quit [*.net *.split]
sn0wb1rd has quit [*.net *.split]
fumduq has quit [*.net *.split]
joast has quit [*.net *.split]
moshee has quit [*.net *.split]
haxrbyte has quit [*.net *.split]
gbchaosmaster has quit [*.net *.split]
Jasko has quit [*.net *.split]
grn_ has quit [*.net *.split]
robbyoconnor has quit [*.net *.split]
wang has quit [*.net *.split]
epochwolf has quit [*.net *.split]
greenarrow has quit [*.net *.split]
jds__ has quit [*.net *.split]
mpereira has quit [*.net *.split]
mvangala_ has quit [*.net *.split]
undyingr1ge has quit [*.net *.split]
MissionCritical has quit [*.net *.split]
rasmusth_ has quit [*.net *.split]
mosez has quit [*.net *.split]
frogstarr78 has quit [*.net *.split]
AlSquirikou has quit [*.net *.split]
mr-rich has quit [*.net *.split]
brjannc has quit [*.net *.split]
randym has quit [*.net *.split]
cbosh has quit [*.net *.split]
dash_ has quit [*.net *.split]
jalcine has quit [*.net *.split]
Elfix_113 has quit [*.net *.split]
BadLarry has quit [*.net *.split]
tonytonyjan has quit [*.net *.split]
Jelco_ has quit [*.net *.split]
virtuose has quit [*.net *.split]
tomku has quit [*.net *.split]
moted has quit [*.net *.split]
fearoffish has quit [*.net *.split]
EPIK has quit [*.net *.split]
rcs has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
ged has quit [*.net *.split]
ping-pong has quit [*.net *.split]
p4tux has quit [*.net *.split]
bedouin has quit [*.net *.split]
jmccune has quit [*.net *.split]
eval-in has quit [*.net *.split]
ichilton has quit [*.net *.split]
Blue_Ice has quit [*.net *.split]
jedediah has quit [*.net *.split]
karupanerura has quit [*.net *.split]
RubyPanther has quit [*.net *.split]
larissa has quit [*.net *.split]
mahlon has quit [*.net *.split]
robert_ has quit [*.net *.split]
idoru has quit [*.net *.split]
Guest67996 has quit [*.net *.split]
banjara has quit [*.net *.split]
jonan has quit [*.net *.split]
wallerdev has quit [*.net *.split]
m3pow has quit [*.net *.split]
gregorg has quit [*.net *.split]
chiel_ has quit [*.net *.split]
FlyingFoX has quit [*.net *.split]
Mch1 has quit [*.net *.split]
yshh has quit [*.net *.split]
drizz_ has quit [*.net *.split]
robustus has quit [*.net *.split]
wmoxam has quit [*.net *.split]
xAndy has quit [*.net *.split]
chrxn has quit [*.net *.split]
TheFuzzball has quit [*.net *.split]
babinho_ has quit [*.net *.split]
jeedey_ has quit [*.net *.split]
busybox43 has quit [*.net *.split]
TomRone has quit [*.net *.split]
oz has quit [*.net *.split]
Weazy has quit [*.net *.split]
hibariya_ has quit [*.net *.split]
queequeg1 has quit [*.net *.split]
kirotan has quit [*.net *.split]
shammancer has quit [*.net *.split]
BombStrike has quit [*.net *.split]
JStoker has quit [*.net *.split]
jrist-afk has quit [*.net *.split]
kanzure has quit [*.net *.split]
maxmanders has quit [*.net *.split]
Poapfel has quit [*.net *.split]
crankycoder has quit [*.net *.split]
rking has quit [*.net *.split]
JoeJulian has quit [*.net *.split]
kalleth has quit [*.net *.split]
_br_ has quit [*.net *.split]
canton7 has quit [*.net *.split]
mephux has quit [*.net *.split]
Guest24761 has quit [*.net *.split]
Cork has quit [*.net *.split]
bastl has quit [*.net *.split]
dedis has quit [*.net *.split]
xid has quit [*.net *.split]
nanothief has quit [*.net *.split]
mguy_ has quit [*.net *.split]
io_syl has quit [*.net *.split]
segv- has quit [*.net *.split]
nazty has quit [*.net *.split]
eph3meral has quit [*.net *.split]
ejnahc has quit [*.net *.split]
jayne has quit [*.net *.split]
hsbt has quit [*.net *.split]
hackeron_ has quit [*.net *.split]
matti has quit [*.net *.split]
yxhuvud has quit [*.net *.split]
rodasc has quit [*.net *.split]
jeekl has quit [*.net *.split]
devdazed has quit [*.net *.split]
Bry8Star has quit [*.net *.split]
SeanTAllen has quit [*.net *.split]
klaas has quit [*.net *.split]
rismoney has quit [*.net *.split]
araujo has quit [*.net *.split]
undert has quit [*.net *.split]
krisfremen has quit [*.net *.split]
xkx has quit [*.net *.split]
TheNumb has quit [*.net *.split]
pizzahead has quit [*.net *.split]
SecretAgent has quit [*.net *.split]
BBonifield has quit [*.net *.split]
epta has quit [*.net *.split]
mmercer has quit [*.net *.split]
pasv has quit [*.net *.split]
fuho has quit [*.net *.split]
klip has quit [*.net *.split]
coasterD has quit [*.net *.split]
ezra has quit [*.net *.split]
David_Miller has quit [*.net *.split]
lahwran has quit [*.net *.split]
pigoz has quit [*.net *.split]
elektronaut has quit [*.net *.split]
nw has quit [*.net *.split]
rtl has quit [*.net *.split]
hamfz_ has quit [*.net *.split]
piotr_ has quit [*.net *.split]
beilabs has quit [*.net *.split]
Chryson has quit [*.net *.split]
Ziioynx has quit [*.net *.split]
Banistergalaxy has quit [*.net *.split]
etank has quit [*.net *.split]
emmanuelux has quit [*.net *.split]
awarner has quit [*.net *.split]
SoonerBourne has quit [*.net *.split]
Targen has quit [*.net *.split]
Hanmac has quit [*.net *.split]
telling has quit [*.net *.split]
callie has quit [*.net *.split]
deadalus has quit [*.net *.split]
tjbiddle has quit [*.net *.split]
nomenkun has quit [*.net *.split]
Synthead has quit [*.net *.split]
jbw has quit [*.net *.split]
sirecote has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
swi7ch has quit [*.net *.split]
Goatbert has quit [*.net *.split]
spathi_ has quit [*.net *.split]
dreamfall has quit [*.net *.split]
yosafbridge has quit [*.net *.split]
Godd2 has quit [*.net *.split]
jaygen has quit [*.net *.split]
chord has quit [*.net *.split]
tekacs has quit [*.net *.split]
Spaceghost|cloud has quit [*.net *.split]
three18ti has quit [*.net *.split]
johnmilton has quit [*.net *.split]
rcsheets has quit [*.net *.split]
pkondzior_ has quit [*.net *.split]
joffery has quit [*.net *.split]
Paradox has quit [*.net *.split]
PhilK has quit [*.net *.split]
Y_Ichiro has quit [*.net *.split]
s14 has quit [*.net *.split]
zeroXten has quit [*.net *.split]
elspeth has quit [*.net *.split]
no_i_wont has quit [*.net *.split]
Lemtzas has quit [*.net *.split]
wunz has quit [*.net *.split]
ingvarha has quit [*.net *.split]
jasond has quit [*.net *.split]
xhoy has quit [*.net *.split]
UukGoblin has quit [*.net *.split]
verma has quit [*.net *.split]
prime has quit [*.net *.split]
stderr- has quit [*.net *.split]
Gate has quit [*.net *.split]
DarkFoxDK has quit [*.net *.split]
Guest26813 has quit [*.net *.split]
cibs has quit [*.net *.split]
zarubin has quit [*.net *.split]
io_syl has joined #ruby
beilabs has joined #ruby
Chryson has joined #ruby
hamfz_ has joined #ruby
Ziioynx has joined #ruby
tjbiddle has joined #ruby
nomenkun has joined #ruby
SoonerBourne has joined #ruby
emmanuelux has joined #ruby
etank has joined #ruby
Targen has joined #ruby
Hanmac has joined #ruby
Banistergalaxy has joined #ruby
Synthead has joined #ruby
telling has joined #ruby
callie has joined #ruby
deadalus has joined #ruby
awarner has joined #ruby
Goatbert has joined #ruby
sirecote has joined #ruby
flagg0204 has joined #ruby
yosafbridge has joined #ruby
jbw has joined #ruby
spathi_ has joined #ruby
swi7ch has joined #ruby
dreamfall has joined #ruby
ossareh has quit [Excess Flood]
io_syl has quit [Client Quit]
andalf has quit [Remote host closed the connection]
ndboost has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
jsilver has joined #ruby
headius has quit [Quit: headius]
banister_ has joined #ruby
PhilK has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
voodoofish430 has quit [Quit: Leaving.]
postmodern has quit [Quit: Leaving]
io_syl has joined #ruby
postmodern has joined #ruby
io_syl has quit [Client Quit]
kanzure_ has joined #ruby
chiel_ has joined #ruby
robustus has joined #ruby
yshh has joined #ruby
drizz_ has joined #ruby
jeedey_ has joined #ruby
chrxn has joined #ruby
jonan has joined #ruby
busybox43 has joined #ruby
FlyingFoX has joined #ruby
wmoxam has joined #ruby
wallerdev has joined #ruby
TheFuzzball has joined #ruby
xAndy has joined #ruby
babinho_ has joined #ruby
gregorg has joined #ruby
Weazy has joined #ruby
TomRone has joined #ruby
Mch1 has joined #ruby
hibariya_ has joined #ruby
oz has joined #ruby
queequeg1 has joined #ruby
kirotan has joined #ruby
kalleth has joined #ruby
Poapfel has joined #ruby
shammancer has joined #ruby
rking has joined #ruby
canton7 has joined #ruby
Guest24761 has joined #ruby
Cork has joined #ruby
_br_ has joined #ruby
mephux has joined #ruby
BombStrike has joined #ruby
xid has joined #ruby
jrist-afk has joined #ruby
kanzure has joined #ruby
maxmanders has joined #ruby
bastl has joined #ruby
dedis has joined #ruby
crankycoder has joined #ruby
JStoker has joined #ruby
zarubin has joined #ruby
cibs has joined #ruby
robert_ has joined #ruby
dedis has quit [Max SendQ exceeded]
kanzure has quit [Max SendQ exceeded]
Guest67996 has joined #ruby
karupanerura has joined #ruby
Slivka has joined #ruby
Drewch_ has joined #ruby
ccooke has joined #ruby
strtok_ has joined #ruby
aetaric has joined #ruby
dcope has joined #ruby
ryanf has joined #ruby
mahmoudimus has joined #ruby
musl has joined #ruby
rcj_ has joined #ruby
JDubs has joined #ruby
mickn has joined #ruby
TTilus has joined #ruby
s4muel_ has joined #ruby
mickn has quit [Remote host closed the connection]
dbeest has joined #ruby
<dbeest>
hi, how do I run wget via ruby?
Chryson has quit [*.net *.split]
beilabs has quit [*.net *.split]
Ziioynx has quit [*.net *.split]
hamfz_ has quit [*.net *.split]
Banistergalaxy has quit [*.net *.split]
etank has quit [*.net *.split]
SoonerBourne has quit [*.net *.split]
emmanuelux has quit [*.net *.split]
awarner has quit [*.net *.split]
Targen has quit [*.net *.split]
Hanmac has quit [*.net *.split]
nomenkun has quit [*.net *.split]
tjbiddle has quit [*.net *.split]
telling has quit [*.net *.split]
callie has quit [*.net *.split]
deadalus has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
sirecote has quit [*.net *.split]
jbw has quit [*.net *.split]
Synthead has quit [*.net *.split]
dreamfall has quit [*.net *.split]
spathi_ has quit [*.net *.split]
swi7ch has quit [*.net *.split]
yosafbridge has quit [*.net *.split]
Goatbert has quit [*.net *.split]
thmzlt has joined #ruby
<swarley>
dbeest; `wget #{args}`
io_syl has joined #ruby
Virunga has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
MissionCritical has joined #ruby
<swarley>
or system("wget #{agrs}")
dbeest has left #ruby ["Leaving"]
robert_ has quit [Ping timeout: 245 seconds]
tjbiddle has joined #ruby
larissa has joined #ruby
squidBits has joined #ruby
pcarrier has quit []
yosafbridge has joined #ruby
apok has quit [Ping timeout: 264 seconds]
blazes816 has quit [Quit: blazes816]
benlieb has joined #ruby
charlie__some has joined #ruby
UdontKnow has quit [Ping timeout: 252 seconds]
tomaw is now known as 5EXAAG5WE
fumduq has joined #ruby
sn0wb1rd has joined #ruby
haxrbyte has joined #ruby
joast has joined #ruby
moshee has joined #ruby
gbchaosmaster has joined #ruby
Jasko has joined #ruby
grn_ has joined #ruby
epochwolf has joined #ruby
jds__ has joined #ruby
wang has joined #ruby
greenarrow has joined #ruby
mvangala_ has joined #ruby
mpereira has joined #ruby
undyingr1ge has joined #ruby
rasmusth_ has joined #ruby
frogstarr78 has joined #ruby
mr-rich has joined #ruby
brjannc has joined #ruby
randym has joined #ruby
AlSquirikou has joined #ruby
Elfix_113 has joined #ruby
cbosh has joined #ruby
BadLarry has joined #ruby
mosez has joined #ruby
jalcine has joined #ruby
dash_ has joined #ruby
Jelco_ has joined #ruby
fearoffish has joined #ruby
tomku has joined #ruby
tonytonyjan has joined #ruby
moted has joined #ruby
virtuose has joined #ruby
hyperboreean has joined #ruby
ichilton has joined #ruby
Blue_Ice has joined #ruby
p4tux has joined #ruby
EPIK has joined #ruby
jmccune has joined #ruby
ping-pong has joined #ruby
rcs has joined #ruby
eval-in has joined #ruby
bedouin has joined #ruby
jedediah has joined #ruby
idoru has joined #ruby
ged has joined #ruby
RubyPanther has joined #ruby
mahlon has joined #ruby
squidBits has quit [Quit: squidBits]
JoeJulian has joined #ruby
Guest26813 has joined #ruby
prime has joined #ruby
ingvarha has joined #ruby
Y_Ichiro has joined #ruby
Paradox has joined #ruby
stderr- has joined #ruby
elspeth has joined #ruby
verma has joined #ruby
rcsheets has joined #ruby
Gate has joined #ruby
tekacs has joined #ruby
johnmilton has joined #ruby
s14 has joined #ruby
zeroXten has joined #ruby
joffery has joined #ruby
pkondzior_ has joined #ruby
UukGoblin has joined #ruby
jaygen has joined #ruby
Lemtzas has joined #ruby
wunz has joined #ruby
three18ti has joined #ruby
Spaceghost|cloud has joined #ruby
no_i_wont has joined #ruby
DarkFoxDK has joined #ruby
xhoy has joined #ruby
tomsthumb has joined #ruby
thmzlt has quit [Remote host closed the connection]
pasties has joined #ruby
robert_ has joined #ruby
charlie__some is now known as charliesome
UdontKnow has joined #ruby
Solnse1 has joined #ruby
waxjar has joined #ruby
w|t has joined #ruby
yeban has joined #ruby
arusso has joined #ruby
G has joined #ruby
GeekOnCoffee has joined #ruby
crazed has joined #ruby
bjeanes has joined #ruby
percival_ has joined #ruby
alta has joined #ruby
gurps_ has joined #ruby
Guedes has joined #ruby
Nanuq has joined #ruby
libryder has joined #ruby
tessi has joined #ruby
zeppelin has joined #ruby
digifiv5e has joined #ruby
SegFaultAX has joined #ruby
seich has joined #ruby
nkts has quit []
alexim has quit [Quit: sleep]
johnmilton has quit [Quit: Leaving]
ClumsyFairyQueen has joined #ruby
klaas has joined #ruby
undert has joined #ruby
krisfremen has joined #ruby
araujo has joined #ruby
xkx has joined #ruby
BBonifield has joined #ruby
nazty has joined #ruby
rodasc has joined #ruby
jeekl has joined #ruby
SeanTAllen has joined #ruby
nanothief has joined #ruby
Bry8Star has joined #ruby
devdazed has joined #ruby
hsbt has joined #ruby
ejnahc has joined #ruby
yxhuvud has joined #ruby
epta has joined #ruby
TheNumb has joined #ruby
eph3meral has joined #ruby
SecretAgent has joined #ruby
matti has joined #ruby
mguy_ has joined #ruby
rismoney has joined #ruby
jayne has joined #ruby
hackeron_ has joined #ruby
segv- has joined #ruby
pizzahead has joined #ruby
rtl has joined #ruby
David_Miller has joined #ruby
pasv has joined #ruby
fuho has joined #ruby
mmercer has joined #ruby
klip has joined #ruby
pigoz has joined #ruby
ezra has joined #ruby
coasterD has joined #ruby
nw has joined #ruby
lahwran has joined #ruby
elektronaut has joined #ruby
yacks has joined #ruby
Nykolla has joined #ruby
mikekelly has joined #ruby
madhatter has joined #ruby
pcboy__ has joined #ruby
inimino has joined #ruby
dantesun has joined #ruby
billy_ran_away has joined #ruby
ruzu has joined #ruby
apok has joined #ruby
freakazoid0223 has joined #ruby
beilabs has joined #ruby
ddd has joined #ruby
deadalus has joined #ruby
Targen has joined #ruby
Goatbert has joined #ruby
nomenkun has joined #ruby
sirecote has joined #ruby
Banistergalaxy has joined #ruby
awarner has joined #ruby
etank has joined #ruby
swi7ch has joined #ruby
Hanmac has joined #ruby
hamfz_ has joined #ruby
flagg0204 has joined #ruby
emmanuelux has joined #ruby
Chryson has joined #ruby
jbw has joined #ruby
telling has joined #ruby
dreamfall has joined #ruby
SoonerBourne has joined #ruby
spathi_ has joined #ruby
Synthead has joined #ruby
havenn has joined #ruby
beandip has joined #ruby
alanp_ has joined #ruby
digiwth has joined #ruby
companion has joined #ruby
katherinem13 has joined #ruby
Eiam has joined #ruby
bricker has joined #ruby
wf2f has joined #ruby
bier has joined #ruby
crazedpsyc has joined #ruby
straind has joined #ruby
rramsden has joined #ruby
thomasfedb has joined #ruby
oGminor has joined #ruby
Emmanuel_Chanel has joined #ruby
45PABH7PW has joined #ruby
Schmidt has joined #ruby
Yarou has joined #ruby
mikepack has joined #ruby
malcolmva has joined #ruby
friskd has joined #ruby
verto|off has joined #ruby
benwoody has joined #ruby
weeb1e has joined #ruby
lkba has joined #ruby
elaptics`away has joined #ruby
imami|afk has joined #ruby
Raboo_ has joined #ruby
qubit has joined #ruby
Substrate has joined #ruby
Godd2 has joined #ruby
Godd2 has quit [Changing host]
Godd2 has joined #ruby
Substrate has joined #ruby
Substrate has quit [Changing host]
aef has joined #ruby
FiveAcres has joined #ruby
ossareh has joined #ruby
5EXAAG5WE is now known as tomaw
seanstickle has quit [Quit: seanstickle]
seanstickle has joined #ruby
keppy has quit [Ping timeout: 246 seconds]
benlieb has quit [Quit: benlieb]
phipes has joined #ruby
d2dchat has joined #ruby
joeycarmello has joined #ruby
phipes has quit [Client Quit]
poga has joined #ruby
poga has quit [Remote host closed the connection]
ossareh has quit [Ping timeout: 246 seconds]
poga has joined #ruby
poga has quit [Remote host closed the connection]
joeycarmello has quit [Ping timeout: 246 seconds]
DatumDrop has joined #ruby
larissa has quit [Quit: Leaving]
ryanlecompte has quit [Remote host closed the connection]
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
hamfz_ has quit [Ping timeout: 245 seconds]
jxriddle has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
joeycarmello has joined #ruby
jeffreybaird has joined #ruby
Raboo_ has quit [Ping timeout: 244 seconds]
manizzle has quit [Ping timeout: 248 seconds]
cespare has quit [Ping timeout: 264 seconds]
Raboo has joined #ruby
benlieb has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
tommyvyo_ has joined #ruby
tommyvyo_ has quit [Changing host]
tommyvyo_ has joined #ruby
joeycarmello has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
joeycarmello has joined #ruby
friskd has quit [Quit: friskd]
Hanmac has quit [Ping timeout: 245 seconds]
d2dchat has quit [Remote host closed the connection]
geeksir has joined #ruby
tungd has joined #ruby
joeycarmello has quit [Ping timeout: 255 seconds]
himsin has joined #ruby
epwhorl has quit [Ping timeout: 256 seconds]
mikepack has quit [Remote host closed the connection]
Godd2 has quit [Quit: Page closed]
SCommette has joined #ruby
hiroyuki has joined #ruby
havenn has quit [Remote host closed the connection]
DanBoy has quit [Quit: Leaving]
havenn has joined #ruby
lolcathost has joined #ruby
pcarrier has joined #ruby
igor_ has joined #ruby
luckyruby has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
dmiller has joined #ruby
havenn has quit [Ping timeout: 264 seconds]
segv-_ has joined #ruby
invisime has quit [Quit: Leaving.]
andalf has joined #ruby
kanzure_ is now known as kanzure
segv- has quit [Ping timeout: 276 seconds]
crackfu has joined #ruby
segv-_ is now known as segv-
headius has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
eka has joined #ruby
pu22l3r has joined #ruby
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
includex has quit [Ping timeout: 265 seconds]
eka has quit [Ping timeout: 245 seconds]
bradhe has joined #ruby
includex has joined #ruby
ClumsyFairyQueen has quit [Changing host]
ClumsyFairyQueen has joined #ruby
mahmoudimus has joined #ruby
benlieb has quit [Quit: benlieb]
bradhe has quit [Ping timeout: 255 seconds]
dmiller has quit [Remote host closed the connection]
ismaelab_ has joined #ruby
emmanuelux has quit [Remote host closed the connection]
pu22l3r_ has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
IceDragon has joined #ruby
nari has joined #ruby
ismaelab_ is now known as ismaelabreu_
Shamgar has quit [Read error: No route to host]
cakehero has joined #ruby
<Solnse1>
when a block is passed into a method, how do I capture the parameters to manipulate them before the yield?
pu22l3r has quit [Ping timeout: 245 seconds]
butblack has joined #ruby
<charliesome>
Solnse1: what do you mean?
<Banistergalaxy>
Solnse1 don't get what you mean
<Solnse1>
yeah, I'm a little fuzzy on how to ask the question... I'm working on blocks... and so a method is passing a word to another method to be manipulated (reversed) and then brought back
ismaelabreu_ is now known as ismaelabreu
<Solnse1>
result = reverser do
<Solnse1>
"hello"
<Solnse1>
end
<Solnse1>
so I set up a method named reverser...
<Solnse1>
and within it I am trying to capture the hello, so I can do a "hello".reverse on it
Shamgar has joined #ruby
<Solnse1>
but I'm sure I'll need to expand on that to allow for multiple words, etc.
<Solnse1>
so how do I see the value that's being passed to the block?
pu22l3r_ has quit [Remote host closed the connection]
jonahR has joined #ruby
tungd has quit [Quit: leaving]
<Solnse1>
I get the feeling that once I understand this concept, it's going to unlock a huge part of ruby for me. But the docs and tutorials I've found aren't very clear.
pu22l3r has joined #ruby
robert_ has quit [Ping timeout: 276 seconds]
<ismaelabreu>
there are no values passed to the block. If there where it woudl be reverser do |some_param^
<ismaelabreu>
|
includex has quit [Quit: Leaving...]
Substrate has quit [Quit: Page closed]
tungd has joined #ruby
<ismaelabreu>
def reverser
epwhorl has joined #ruby
<ismaelabreu>
yield.reverse
<ismaelabreu>
end
cakehero has quit [Quit: Leaving...]
igor_ has quit [Quit: igor_]
<ismaelabreu>
Solnse1
combataircraft has joined #ruby
bigmac has joined #ruby
<Solnse1>
yeah I tried that but it's not going to work if I get sent multiple words...
<Solnse1>
I was reading, and trying to set up the block something like:
<Solnse1>
def reverser
<Solnse1>
yield
<Solnse1>
reverser { |a| a.to_s.reverse! }
<Solnse1>
end
tungd has quit [Quit: leaving]
<Solnse1>
but it doesn't work... am I right in assuming I can do processing in the brackets with the same name?
tungd has joined #ruby
quest88 has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<ismaelabreu>
I don't understand what you said
geeksir has quit [Quit: This computer has gone to sleep]
carlyle has joined #ruby
carlyle has quit [Remote host closed the connection]
geeksir has joined #ruby
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
mjolk has joined #ruby
mjolk is now known as Guest95010
squidBits has joined #ruby
hsbt is now known as hsbt_away
andalf has quit [Remote host closed the connection]
hsbt_away is now known as hsbt
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
hsbt is now known as hsbt_away
hsbt_away is now known as hsbt
hsbt is now known as hsbt_away
lolcathost has quit [Ping timeout: 264 seconds]
lolcathost has joined #ruby
ryanf has quit [Ping timeout: 255 seconds]
geeksir has quit [Quit: Leaving]
combataircraft_ has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
joeycarmello has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
g_bleezy has joined #ruby
eph3meral has left #ruby [#ruby]
otters has quit [Ping timeout: 265 seconds]
combataircraft has quit [Ping timeout: 250 seconds]
combataircraft_ is now known as combataircraft
cableray has quit [Quit: cableray]
joeycarmello has quit [Ping timeout: 246 seconds]
benlieb has joined #ruby
hsbt_away is now known as hsbt
cableray has joined #ruby
pcarrier has quit []
abstrakt has joined #ruby
g_bleezy has quit [Ping timeout: 250 seconds]
banister_ has quit [Ping timeout: 264 seconds]
tomsthumb has quit [Ping timeout: 255 seconds]
ToTo has quit [Ping timeout: 248 seconds]
yacks has quit [Ping timeout: 265 seconds]
tungd has quit [Quit: leaving]
benlieb has quit [Quit: benlieb]
generalissimo has joined #ruby
banisterfiend has joined #ruby
ewag has joined #ruby
<Solnse1>
some one please tell me why I can't call .each on self?
<abstrakt>
Solnse1: possibly because each is an instance method?
<Solnse1>
ok, but the block is being called by another method, and I'm trying to use .each on it to process each element.
Slivka has quit [Read error: Connection reset by peer]
<Solnse1>
is there another way to do it?
mockra has joined #ruby
<ozzloy>
what is the 20152 part of this ruby log header? "I, [2012-12-12T15:45:08.311077 #20152] INFO -- : "
bradhe has joined #ruby
<ozzloy>
my googling just shows a bunch of examples of writing ruby code to generate logs
squidBits has quit [Quit: whoops]
wildcard0 has quit [Ping timeout: 252 seconds]
jsilver has quit [Ping timeout: 252 seconds]
neurotech has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
radic has joined #ruby
olds22 has joined #ruby
dmiller has joined #ruby
radic_ has quit [Ping timeout: 264 seconds]
neurotech has joined #ruby
epwhorl has quit [Ping timeout: 264 seconds]
Guest95010 has quit [Quit: This computer has gone to sleep]
benlieb has joined #ruby
pu22l3r has joined #ruby
art_man1 has joined #ruby
<charliesome>
ozzloy: wild guess, but the pid?
cespare has joined #ruby
adeponte has joined #ruby
Vert has quit [Remote host closed the connection]
headius has quit [Quit: headius]
manizzle has joined #ruby
<ozzloy>
charliesome, i thought that too, but no
<ozzloy>
it doesn't even seem to be 1:1 to pid
<ozzloy>
i just tried another process writing to the same file and got the same number there
DanBoy has joined #ruby
seanstickle has quit [Quit: seanstickle]
<charliesome>
odd
<Solnse1>
can somebody please recommend a *simple* guide on blocks and passing a block to methods, using yield, etc. ?
<Solnse1>
I've wasted hours reading garbage.
poga has joined #ruby
skaczor has quit [Remote host closed the connection]
neurotech has quit [Remote host closed the connection]
<DanBoy>
pickaxe :P
<DanBoy>
Programming Ruby
<DanBoy>
best book i've read on ruby so far
jaygen_ has joined #ruby
<Solnse1>
own it.
yuruk has joined #ruby
<Solnse1>
I want something simple... simple example, not a comprehensive explanation of everything it can do and the complexities of it.
<Solnse1>
yeah I went through that an hour ago. I guess I'm just stupid.
DatumDrop has quit [Remote host closed the connection]
<Solnse1>
I need to modify the string being passed, not just yield it.
<DanBoy>
you new to coding or just ruby?
jaygen_ has quit [Ping timeout: 252 seconds]
<Solnse1>
been beating my head against the wall for 11 months now.
jaygen_ has joined #ruby
butblack has quit [Quit: butblack]
rondale_sc has quit [Quit: rondale_sc]
<DanBoy>
well sometimes just weathering through a book even if you dont get some parts is a lot better than trying to piece together things from random tutorials
adeponte has quit [Remote host closed the connection]
adeponte has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
malcolmva has quit [Ping timeout: 244 seconds]
headius has quit [Quit: headius]
huoxito has quit [Ping timeout: 245 seconds]
zigomir has joined #ruby
aetcore has joined #ruby
Synthead has quit [Quit: p33 ba115]
Shamgar has quit [Ping timeout: 255 seconds]
Shamgar has joined #ruby
SCommette has quit [Quit: SCommette]
rippa has joined #ruby
osvico has quit [Ping timeout: 248 seconds]
robustus has quit [Ping timeout: 255 seconds]
robustus has joined #ruby
kil0byte has quit [Remote host closed the connection]
Nykolla_ has joined #ruby
tjbiddle has joined #ruby
phipes has quit [Quit: phipes]
manizzle has quit [Remote host closed the connection]
hsbt is now known as hsbt_away
cirwin has joined #ruby
adeponte has quit [Remote host closed the connection]
Nykolla has quit [Ping timeout: 265 seconds]
<davidcelis>
rismoney: shit, son
<davidcelis>
that doesn't even look like ruby
<davidcelis>
is that java?
<ryanf>
looks more like .net
hamfz_ has quit [Ping timeout: 245 seconds]
raddazong has joined #ruby
hamfz_ has joined #ruby
d34th4ck3r has joined #ruby
havenn has joined #ruby
fliqqer has quit [Ping timeout: 246 seconds]
hsbt_away is now known as hsbt
browndawg has left #ruby [#ruby]
tjbiddle has quit [Quit: tjbiddle]
andrewhl has joined #ruby
freeayu has joined #ruby
NiteRain has quit [Ping timeout: 246 seconds]
jcrawford has joined #ruby
pcboy_ has joined #ruby
<jcrawford>
hello everyone, I am new to ruby and just trying to get a script i found to run. It is failing on trying to include active_support/inflector is that built into ruby or a gem i have to install?
<jcrawford>
i installed myswl with gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config but still get that api error
reppard has joined #ruby
<jcrawford>
i am on mac osx 10.7
wermel has joined #ruby
nanothief has quit [Ping timeout: 250 seconds]
JonnieCache has joined #ruby
pwpw has joined #ruby
<reppard>
good moring all
banisterfiend has quit [Remote host closed the connection]
Squarepy has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
nignaztic has joined #ruby
NiteRain has joined #ruby
hsbt_away is now known as hsbt
<reppard>
has anyone ever used the vmail gem?
rajesh_ has joined #ruby
mfridh has quit [Ping timeout: 250 seconds]
<rajesh_>
I am new to Ruby and using it in ubuntu. I am using ruby 1.9.2 by rvm and have installed mysql connector when I require it from irb it shows true but when I try to connect to databse it give me error ENOENT: No such file or directory - /tmp/mysql.sock
<rajesh_>
db = Mysql.connect("localhost", "test", "root", "pass")
lkba has quit [Ping timeout: 246 seconds]
<reppard>
maybe you could find the needed sock file and require_relative?
slainer68 has quit [Remote host closed the connection]
<reppard>
i've never messed with mysql from irb
kirun has joined #ruby
<rajesh_>
Thanks, let me try it
pwpw has quit [Quit: pwpw]
mfridh has joined #ruby
ewag has quit [Ping timeout: 244 seconds]
timonv has joined #ruby
beiter has quit [Quit: beiter]
<tungd>
rajesh_: the mysql socket in ubuntu is located at /var/run/mysqld/mysqld.sock
jslowe has joined #ruby
havenn has joined #ruby
Proshot is now known as statarb3
statarb3 has quit [Changing host]
statarb3 has joined #ruby
osvico has joined #ruby
Slivka has joined #ruby
xAndy is now known as xandy
havenn has quit [Ping timeout: 264 seconds]
banister_ has joined #ruby
<reppard>
rajesh_: any luck?
<rajesh_>
still trying :-(
<reppard>
from the command line try ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
xandy is now known as xAndy
Banistergalaxy has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby
ccooke has joined #ruby
timonv has quit [Remote host closed the connection]
foohey has quit [Quit: Quitte]
havenn has joined #ruby
foohey has joined #ruby
freeayu has quit [Remote host closed the connection]
emmanuelux has quit [Read error: Connection reset by peer]
otters has joined #ruby
fyolnish has joined #ruby
emmanuelux has joined #ruby
samphippen has joined #ruby
<rajesh_>
from the command line try ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock this actaully worked thanks but now new problem is "RuntimeError: Packets out of order: 0<> "
<rajesh_>
:-(
punkrawkR has quit [Ping timeout: 250 seconds]
tomsthumb has joined #ruby
<reppard>
rajesh_: what is the code that is making throwing that error
hoelzro|away is now known as hoelzro
<rajesh_>
1.9.2p320 :001 > require 'mysql'
<rajesh_>
=> true
<rajesh_>
1.9.2p320 :002 > db = Mysql.connect("localhost", "test", "root", "pass")
<rajesh_>
RuntimeError: Packets out of order: 0<>
hsbt is now known as hsbt_away
huoxito has joined #ruby
<rajesh_>
Mysql ver is 5.5.28 and I easly able to connect to database while using java but ruby is giving me hard time
tjbiddle has joined #ruby
<apeiros_>
sounds to me like you compiled against a different version of mysql than you're connecting to. wonder why mysql wouldn't give a better error for that.
pwpw has joined #ruby
<apeiros_>
more a guess, though
<apeiros_>
you said you're on 10.7? iirc that ships with a mysql, so if you installed a mysql yourself too, that might how you ended up with 2 different mysql versions.
answer_42 has quit [Remote host closed the connection]
<rajesh_>
If you are asking about ubuntu version then it is 12.10 and I am not facing problem when I am using java
fyolnish has quit [Remote host closed the connection]
<shadewind>
in a ruby C extension, is there any way to make MyClass.new return an instance which was created by Data_Wrap_Struct?
krisfremen has quit [Read error: Connection reset by peer]
krisfremen has joined #ruby
krisfremen has quit [Changing host]
krisfremen has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
jekotia has joined #ruby
shammancer has joined #ruby
<hoelzro>
shadewind: sure there is
<apeiros_>
Data_Wrap_Struct returns a VALUE, no? just return that VALUE
etehtsea has joined #ruby
etehtsea is now known as Guest18246
<shadewind>
oh... should I just override MyClass.new then?
<hoelzro>
exactly
<shadewind>
and that's not considered bad practice?
<shadewind>
for a C extension like this, that is
<apeiros_>
is your Wrap_Struct not constructing an instance of MyClass?
<shadewind>
it is
<shadewind>
(of course not named MyClass but you get the point)
<apeiros_>
then why should it be a bad practice?
<apeiros_>
MyClass.new returns an instance of MyClass, that's the expected behavior
<apeiros_>
don't forget MyClass.allocate
andrewhl has joined #ruby
rakunHo has joined #ruby
<shadewind>
apeiros_: what should I don't forget about allocate?
<apeiros_>
define the allocator
<apeiros_>
rb_define_alloc_func
cableray has joined #ruby
<shadewind>
apeiros_: why do I need to define it when my object is created in new?
Nisstyre has quit [Quit: Leaving]
vlad_starkov has joined #ruby
cableray has quit [Client Quit]
BSaboia has joined #ruby
cj3kim has joined #ruby
<apeiros_>
because new and allocate serve different purposes.
jfl0wers has joined #ruby
<shadewind>
so why even override new?
<apeiros_>
who said something about overriding new?
<shadewind>
isn't it better to override allocate and initialize?
<shadewind>
17:13 < shadewind> oh... should I just override MyClass.new then?
<shadewind>
17:14 < hoelzro> exactly
<hoelzro>
that's my mistake, sorry!
<hoelzro>
allocate is a much better choice
<shadewind>
right
<shadewind>
now I'm not confused anymore :)
cj3kim has quit [Client Quit]
hsbt is now known as hsbt_away
nomenkun has quit [Remote host closed the connection]
elico has joined #ruby
nomenkun has joined #ruby
DaZ has quit [Read error: Connection reset by peer]
rjmt___ has joined #ruby
io_syl has joined #ruby
lkba has joined #ruby
elico has quit [Remote host closed the connection]
pwelch has joined #ruby
vlad_starkov has quit [Ping timeout: 264 seconds]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
DaZ has joined #ruby
nari has quit [Ping timeout: 265 seconds]
stayarrr has joined #ruby
havenn has quit [Ping timeout: 250 seconds]
epwhorl has quit [Ping timeout: 252 seconds]
Xeago has quit [Remote host closed the connection]
BSaboia__ has joined #ruby
raz has joined #ruby
<raz>
one thing that has been nagging me for a while..
<raz>
is there a way to have bundler uninstall all gems from the gemfile and re-install from scratch?
<raz>
it's kind of a pain when an underlying dep changes...
sorbo_ has quit [Quit: sorbo_]
miskander has quit [Quit: miskander]
BSaboia has quit [Ping timeout: 265 seconds]
ananthakumaran has quit [Quit: Leaving.]
ebouchut has joined #ruby
vlad_starkov has joined #ruby
jobicoppola has joined #ruby
yshh has quit [Remote host closed the connection]
DaZ has quit [Ping timeout: 246 seconds]
horrror has joined #ruby
osvico has quit [Read error: Connection reset by peer]
maletor has joined #ruby
eldariof has quit []
jxriddle has joined #ruby
Adget1 has joined #ruby
headius has joined #ruby
Adget has quit [Read error: Operation timed out]
jeffreybaird has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
Neomex has quit [Quit: Neomex]
havenn has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
eldariof has joined #ruby
hsbt_away is now known as hsbt
joffery has quit [Quit: erm]
erm has joined #ruby
oGminor has quit [Quit: oGminor]
Vert has joined #ruby
dmiller has joined #ruby
eldariof has quit []
timonv has quit [Remote host closed the connection]
epwhorl has joined #ruby
BSaboia__ has quit [Quit: Fui embora]
katherinem13 is now known as katherinem13_out
eldariof has joined #ruby
erm has quit [Quit: erm]
seanstickle has joined #ruby
erm has joined #ruby
skaczor has joined #ruby
headius has quit [Quit: headius]
SCommette has joined #ruby
dmiller has quit [Remote host closed the connection]
Goles has quit [Quit: Computer has gone to sleep.]
reppard-away has joined #ruby
SCommette has quit [Client Quit]
Goles has joined #ruby
_alejandro has joined #ruby
Adget has joined #ruby
dorei has joined #ruby
seanstickle has quit [Client Quit]
mockra has joined #ruby
headius has joined #ruby
Adget1 has quit [Ping timeout: 256 seconds]
hsbt is now known as hsbt_away
<dorei>
Hello, I have a: myServer = TCPServer.open(9900).accept , if a client connects to my tcpserver, I can use myServer.puts(data) to send data. Is there a way to find out if the client has closed the connection to my server?
seanstickle has joined #ruby
atmosx has quit [Quit: WeeChat 0.4.0-dev]
pwelch has quit [Quit: pwelch]
erm has quit [Quit: erm]
axl_ has joined #ruby
erm has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
mercwithamouth has joined #ruby
butblack has quit [Quit: butblack]
centipedefarmer has joined #ruby
kidoz has joined #ruby
rjmt___ has quit [Ping timeout: 260 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
ToTo has joined #ruby
erm has quit [Ping timeout: 250 seconds]
tungd has quit [Quit: leaving]
erm has joined #ruby
nignaztic has joined #ruby
wf2f has quit [Read error: Connection reset by peer]
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
schaerli has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
jgrevich has joined #ruby
yfeldblum has joined #ruby
<yfeldblum>
is there a performance difference between using a string-valued constant and using a string literal? e.g. how does constant-lookup compare to GC?
Guest18246 is now known as etehtsea
jxriddle has quit [Read error: Connection reset by peer]
erm has quit [Quit: erm]
JohnBat26 has joined #ruby
joffery has joined #ruby
nanothief has joined #ruby
jxriddle has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
<hoelzro>
yfeldblum: a string valued constant would result in reuse of a single string object
<hoelzro>
the difference in performance would probably be negilible, though
<yfeldblum>
hoelzro, that's right, but it would also involve constant lookup
<hoelzro>
constant lookup is a simple hash table lookup
<yfeldblum>
hoelzro, the performance difference of doing it once would be negligible; but, if there is a performance difference, perhaps it would be useful to practice one over the other consistently across a codebase, and then the overall difference might be non-negligible
ebobby has joined #ruby
<hoelzro>
yfeldblum: you could always use symbol literals as well
<hoelzro>
which is probably the more proper way to do things
<yfeldblum>
hoelzro, why would that be more proper?
<hoelzro>
well, Ruby offers symbols for this sort of thing
ryanlecompte has joined #ruby
<hoelzro>
however, if you *did* use a constant, you'd have a bit of built-in error checking
nanothief has quit [Ping timeout: 265 seconds]
banisterfiend has quit [Ping timeout: 264 seconds]
<yfeldblum>
hoelzro, assume the code is tested :D
<hoelzro>
ok
<hoelzro>
I would use symbols then
<hoelzro>
no constant
<hoelzro>
but that's just me =)
<yfeldblum>
hoelzro, does :"abc-def^xyz" need to create an intermediate string each time? ie is it a symbol literal, or is it a string literal on which #to_sym is called each time?
BrokenCog has joined #ruby
nignaztic has quit [Ping timeout: 264 seconds]
<hoelzro>
it's a symbol lieral
<hoelzro>
*literal
heftig has joined #ruby
michaelmartinez has joined #ruby
<yfeldblum>
hoelzro, writing a benchmark script at the same time to test this ...
<apeiros_>
as there's neither a File::read_line nor a File#read_line
wallerdev has joined #ruby
epwhorl has quit [Quit: Leaving]
kirun_ has joined #ruby
erm has quit [Ping timeout: 240 seconds]
erm has joined #ruby
<apeiros_>
yfeldblum: to me the only unexpected result is the cache
<mark06>
apeiros_: actually, you do
<yfeldblum>
apeiros_, why is that?
<yfeldblum>
apeiros_, this is with falcon's hash patch btw
<mark06>
apeiros_: file.eof? (true for last line)
<apeiros_>
yfeldblum: the symbol table is just one big hash
DatumDrop has quit [Ping timeout: 252 seconds]
kirun has quit [Ping timeout: 260 seconds]
<yfeldblum>
apeiros_, but this is a single hash object plus a single string object, rather than a symbol table and a new string object from #to_s
maletor has quit [Quit: Computer has gone to sleep.]
<apeiros_>
yfeldblum: that shouldn't matter much to a hash
Shadow_S has joined #ruby
<apeiros_>
there should be more work involved when going through a generic hash vs. through the symbol table
u89 has quit [Remote host closed the connection]
<yfeldblum>
apeiros_, so this seems to be testing the perf of hash-lookup vs new-obj
mark06 has left #ruby [#ruby]
<apeiros_>
ah, right, the allocation of a new object might be the reason for the increased time needed
<apeiros_>
yeah, Symbol#to_s creates a new string object every time
Guest74024 has quit [Quit: This computer has gone to sleep]
workmad3 has joined #ruby
<yfeldblum>
apeiros_, not terribly sure if the GC is running ...
<yfeldblum>
how can you tell how many times the GC ran between time A and time B?
lurch_ has quit [Quit: lurch_]
<apeiros_>
you can turn GC off and see how much that affects the performance
ryanf has joined #ruby
mockra has joined #ruby
lurch_ has joined #ruby
mneorr has joined #ruby
tomsthumb has quit [Quit: Leaving.]
<yfeldblum>
apeiros_, turning off the gc makes it take a little longer ...
<apeiros_>
lol, ouch
<apeiros_>
try less iterations
<apeiros_>
(with and without gc)
<apeiros_>
also gc between the tests
<yfeldblum>
apeiros_, what i want to know is if the Symbol#to_s bench is factoring in the extra GC time required to collect the strings it creates
<yfeldblum>
apeiros_, rather than if it's increasing ruby's heap
<apeiros_>
gc is unpredictable
<yfeldblum>
apeiros_, i'm looking for a throughput number
<yfeldblum>
apeiros_, say this runs continuously for a day; we could then predict the GC will run many times
<yfeldblum>
apeiros_, i'm looking for a way to approximate that without requiring a full day
timonv has joined #ruby
tommyvyo_ has joined #ruby
browndawg has quit [Quit: Leaving.]
BigO_ has joined #ruby
PolPot_ has joined #ruby
nilg` has quit [Remote host closed the connection]
zaki[] has joined #ruby
elico has quit [Quit: elico]
zaki_ has quit [Ping timeout: 250 seconds]
axl_ has joined #ruby
ebouchut has joined #ruby
dorei has quit [Ping timeout: 264 seconds]
cpruitt has joined #ruby
<reppard-away>
.
ryanf has quit [Quit: broken pipes |||]
Adget has quit [Quit: Adget]
reppard-away is now known as reppard
<Hanmac>
GC is punctually like a german train ...
hsbt_away is now known as hsbt
timonv has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
skaczor has quit [Remote host closed the connection]
zaki[] has quit [Ping timeout: 250 seconds]
ebouchut has quit [Quit: This computer has gone to sleep]
<Hanmac>
german trains has four big problems ... sping, sommer, fall and winter
<heftig>
canada has four seasons: almost winter, winter, still winter and road construction
<Mon_Ouie>
If you make it run for long enough, GC time will be included in the times you measure
<shevy>
Hanmac lol
zaki[] has joined #ruby
chrstphrhrt has joined #ruby
BigO_ has quit [Remote host closed the connection]
PolPot_ has quit []
ebouchut has joined #ruby
banisterfiend has quit [Ping timeout: 245 seconds]
<Hanmac>
heftig they have more than fourty words for snow ... but most of them are not for child-ears
BigO_ has joined #ruby
ryanf has joined #ruby
Jackneill has joined #ruby
Jackneill is now known as Guest45363
erm has quit [Ping timeout: 246 seconds]
rezzack has joined #ruby
wallerdev has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
tommyvyo_ is now known as tommyvyo
BigO_ has quit [Ping timeout: 264 seconds]
erm has joined #ruby
arietis has quit [Read error: Connection reset by peer]
<yfeldblum>
Mon_Ouie, :D
<yfeldblum>
Mon_Ouie, tried with 100M iterations
<yfeldblum>
Mon_Ouie, similar results, just 10 times larger
arietis has joined #ruby
zaki[] has quit [Ping timeout: 250 seconds]
<BrokenCog>
yfeldblum: I don't think you can predict GC. At least, not a well implemented mechanism. Unless you run the same data set, with the same machine load, GC will be invoked at different times.
zaki[] has joined #ruby
<BrokenCog>
but, if you run large enough data sets, GC can be "factored out" for timing.
Hama has quit [Remote host closed the connection]
Slivka has joined #ruby
<yfeldblum>
BrokenCog, trying to factor *in* GC
<BrokenCog>
that's the point - with a large enough data set, you dont't need to. on small sets, then they are too small to matter and GC will skew results.
<yfeldblum>
BrokenCog, yep - that's why i ran it with a large enough data set :D
Nisstyre-laptop has joined #ruby
<BrokenCog>
what is the framework, by the way?
<yfeldblum>
BrokenCog, sorry?
<BrokenCog>
waht system's GC are you testing?
<BrokenCog>
language?
<yfeldblum>
BrokenCog, ruby-1.9.3-p327 with falcon-gc patch on ubuntu 12.04
<BrokenCog>
applicati... ah.
<BrokenCog>
versus without I take it?
darthdeus has joined #ruby
<yfeldblum>
BrokenCog, no, benching constant-lookup time vs string-literal (new-obj + gc) time
hsbt is now known as hsbt_away
<BrokenCog>
i see.
kidoz has quit [Quit: Ухожу я от вас]
haxrbyte_ has joined #ruby
<BrokenCog>
you could try disabling GC, do the runs, enable it and get a meaningful impact if GC.
workmad3 has quit [Ping timeout: 250 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
otters has quit [Ping timeout: 244 seconds]
banisterfiend has joined #ruby
<yfeldblum>
BrokenCog, tried that; it takes longer
<yfeldblum>
BrokenCog, also, i don't want to time this with the effects of GC removed; i want to time this with the effects of GC *included*
brianpWins has quit [Quit: brianpWins]
<yfeldblum>
BrokenCog, i want to know if allocating a string and then collecting it later, done millions of times, is faster or slower than ruby's constant-lookup mechanism
<BrokenCog>
you just showed the result by disabling GC and noting how much longer it took - that in effect differed collection until later.
<BrokenCog>
you could try tuning GC. set RUBY_GC_MALLOC_LIMIT RUBY_HEAP_FREE_MIN RUBY_HEAP_MIN_SLOTS
<BrokenCog>
to various values.
mercwithamouth has quit [Ping timeout: 255 seconds]
<yfeldblum>
BrokenCog, i tried that once, it took longer, and then i stopped messing with the GC in the bench script
<BrokenCog>
not surprised. it's probably quite well optimized out of the box.
alexspeller has joined #ruby
altious has quit [Ping timeout: 260 seconds]
<yfeldblum>
BrokenCog, ruby GC is ... "optimized" ... sure :D
<BrokenCog>
...
<BrokenCog>
just to understand ... your goal is to say what? that GC causes x % increase?
Shamgar has quit [Read error: Connection reset by peer]
<yfeldblum>
BrokenCog, goal is to understand, if i do `io_obj << SOME_CONSTANT`, is it higher throughput than if i do `io_obj << "the bytes i want\r\n"`, or lower throughput, doing that many times over the course of a long period of time, during which time the GC is sure to run many times?
banisterfiend has quit [Ping timeout: 264 seconds]
Marco has joined #ruby
rondale_sc has quit [Quit: rondale_sc]
<BrokenCog>
i see.
<BrokenCog>
to understand the GC impact, or the io_obj throughput?
<yfeldblum>
odd ... in jruby, constant-lookup is about as fast, but symbol-string-cache is ~50% slower, and string-literal, string-literal-in-method, and symbol-literal are all ~40% faster
<yfeldblum>
BrokenCog, to see which way has higher throughput
<yfeldblum>
BrokenCog, to see if the cost of alloc+gc is bigger or smaller than the cost of constant-lookup
<BrokenCog>
okay.
zaki_ has joined #ruby
<BrokenCog>
so, you need a way to control GC execution, and / or account for it when it runs.
zaki[] has quit [Ping timeout: 250 seconds]
abstrakt has quit [Quit: abstrakt]
<reppard>
whats the preferred method for accessing and setting an objects attributes within its class?? @attribute or self.attribute
<reppard>
minus one of those question marks
Shamgar has joined #ruby
obind has joined #ruby
nomenkun has quit [Remote host closed the connection]
<yfeldblum>
BrokenCog, i just need to be sure it's being included
haxrbyte_ has quit [Ping timeout: 245 seconds]
<BrokenCog>
try using those GC variables and shrink them to force it to run more often.
<BrokenCog>
your run time should go up, constant value on different data set sizes.
chriskk has joined #ruby
banjara has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
d34th4ck3r has joined #ruby
blacktulip has quit [Remote host closed the connection]
<Hanmac>
information, there is cool stuff that does not work with jruby, so depending on it is not a good idea
<headius>
Hanmac: like what?
SCommette has joined #ruby
<yfeldblum>
headius, yeah that's what i had suspected, but i wanted to benchmark it too
<headius>
yfeldblum: I only see one set of results…is that jruby or mri?
<headius>
GC impact from literals will obviously be a lot higher
<Hanmac>
headius: i have bindings for an 3d-engine, and an other for GUI-Programming
<yfeldblum>
headius, ruby-1.9.3-p327 with falcon-gc patch
<Hanmac>
both does not work with jruby
SCommette has quit [Client Quit]
<yfeldblum>
headius, question isn't whether literals have a alloc+collect impact; question is the comparative impact w.r.t. constant-lookup
<headius>
Hanmac: so you're saying libraries written to work only with MRI's C API
<headius>
there's also a lot of cool stuff that doesn't work on MRI, so perhaps you shouldn't depend on MRI
daniel_hinojosa has joined #ruby
hsbt_away is now known as hsbt
<yfeldblum>
headius, the real surprise is the symbol-string-cache, which is the one benchmark on which jruby performs slower than mri (jruby is equal or faster on the other ones)
<Hanmac>
headius: yeah, but my stuff is cooler
<yfeldblum>
headius, again, patched mri
nomenkun has joined #ruby
<headius>
Hanmac: too bad it only works on the least advanced of the Ruby implementations :-)
banisterfiend has joined #ruby
Squarepy has quit [Quit: Leaving]
<headius>
but hey, who needs 3D and GUI to be fast!
<headius>
</troll>
<Hanmac>
headius: 1) with the 3D i get more than 200FPS, and 2) my gems works on rubinus too, it only works not on jruby ... show me something for jruby that can do 3D like with ogre3d
<wildcard0>
jcrawford: ya mysql + ruby on the mac is a pain in the ass
vlad_starkov has quit [Ping timeout: 245 seconds]
<headius>
I'm surprised maglev gets that close to jruby's times
<jcrawford>
indeed
<headius>
it's not that good on benchmarks with user-defined ruby objects
<wildcard0>
osx is not easy to sys admin. it's non-standard and changes every minor revision
<headius>
heh, there's a reason OS X servers went away
<wildcard0>
you kinda need to know how to do all the dynamic library loading stuff to get a lot of the C modules working
<wildcard0>
ya totally
<yfeldblum>
headius, cool
<yfeldblum>
headius, why is --1.8 faster?
reppard has quit [Ping timeout: 265 seconds]
lkba has quit [Ping timeout: 248 seconds]
<headius>
m17n
<wildcard0>
i wonder if the python guys have as much of an issue with their mysql stuff on osx
<headius>
or encodings if that's not a familiar abbreviation
<yfeldblum>
headius, why would m17n affect const-lookup or symbol-string-cache?
redgetan has joined #ruby
<headius>
symbol string cache is barely faster…that's probably just noise
<headius>
the others are appending to a string
<headius>
er, well not appending, but creating
<yfeldblum>
headius, const-lookup shouldn't be creating a string though
<yfeldblum>
headius, shouldn't that be looking up a const by its symbol table id rather than by string?
<headius>
could be differing block overhead, but yeah, that's strange
shevy2 has joined #ruby
<headius>
occurs to me now we are probably not caching the coderange for literal strings in 1.9 mode and rescanning every construct
<yfeldblum>
headius, this should be lexical-lookup rather than module-lookup so it should be the faster kind, right?
<headius>
they're both the same in jruby
<headius>
I think they're the same in 1.9 too
shevy has quit [Read error: Operation timed out]
<headius>
all three major impls cache any constant lookup based on a global invalidator
rippa has quit [Ping timeout: 245 seconds]
lkba has joined #ruby
<yfeldblum>
headius, ok
<yfeldblum>
headius, that's good, so this is measuring a cached const-lookup rather than a full const-lookup?
<headius>
ys
<headius>
I don't have a way to measure full const lookup, but it's not a common case
<headius>
unless you're modifying constants like mad
wargasm has quit [Ping timeout: 260 seconds]
F1skr has quit [Quit: WeeChat 0.3.9.2]
<yfeldblum>
headius, i wasn't planning on `1_000_000.times { Object.new.extend(Kernel) ; io.write(THE_CONST) }`
<headius>
heheh
<headius>
that would certainly impact performance :)
<yfeldblum>
headius, hehe yep, the alloc+collect itself would impact performance already, nevermind the global cache invalidation
robotmay has joined #ruby
<havenn>
The question is, why doesn't CRuby support Java extensions? :P
<yfeldblum>
headius, another subject entirely - how expensive is: /#{Regexp.quote(some_input_string)/
<headius>
havenn: indeed!
<yfeldblum>
headius, vs just: Regexp.quote(some_input_string)
<headius>
well, let me count the number of objects created...
<headius>
the first case passes the output of quote through a String before creating the Regexp
<headius>
the second one just creates the String
butblack has joined #ruby
robotmay has quit [Remote host closed the connection]
<yfeldblum>
headius, well, how expensive is creating Regexp instances from interpolated literals with interpolation?
<yfeldblum>
headius, and do those Regexp instances get collected?
vlad_starkov has joined #ruby
SPYGAME has quit [Quit: Leaving]
<headius>
we do have a cache of recently-used regexp, but it's not super deep
<yfeldblum>
headius, suppose the instances are never used at all to match against a string (only Regexp#source and Regexp#options are ever called on it)
reppard has joined #ruby
<headius>
in a perfect world the intermediate Regexp would get optimized away by the JVM, but in practice that doesn't happen right now
ryanh has joined #ruby
<yfeldblum>
headius, are the regexp's compiled? are the compiled thingies kept around?
<headius>
so there's a cost for creating the Regexp and possibly recompiling it
<yfeldblum>
headius, is compiling expensive?
<headius>
the compiled things are what we cache…not super expensive, but not free
IceDragon has joined #ruby
stuartrexking has quit [Quit: Leaving...]
<headius>
yeah I'm confused now why 1.8 mode is faster for any of this
<headius>
block overhead seems like the only likely candidate
reppard has quit [Ping timeout: 265 seconds]
<headius>
yeah, seems to be it…a bare loop is about 25% faster in 1.8 mode
<yfeldblum>
headius, i suppose the use-case i'm looking at is closest to regexp-inter-string-literal-m
jgrevich_ has joined #ruby
otters has quit [Ping timeout: 265 seconds]
jgrevich has quit [Ping timeout: 260 seconds]
jgrevich_ is now known as jgrevich
<yfeldblum>
headius, not terribly sure how useful these benchmarks are
robotmay has joined #ruby
<headius>
yfeldblum: jruby will optimize away a bare regexp in most cases
<headius>
in these cases, though, it' a return value from the block so it won't go away
<headius>
it's probably valid enough
<headius>
I'll try numbers on indy in a sec
daniel_hinojosa has quit [Ping timeout: 244 seconds]
moshee has quit [Remote host closed the connection]
frem has quit [Quit: Computer has gone to sleep.]
friskd has joined #ruby
[KiSsPachYouSee] has joined #ruby
redgetan has quit [Quit: This computer has gone to sleep]
generalissimo has quit [Remote host closed the connection]
phipes has joined #ruby
pmros has joined #ruby
combataircraft has joined #ruby
<pmros>
hi!
w400z has joined #ruby
<headius>
yfeldblum: the -m versions are slow in jruby, which is a little strange
jenrzzz has joined #ruby
<lectrick>
headius: so for example, Float(some_arg) is defined on Kernel?
<headius>
yes
<lectrick>
got it. thanks
<yfeldblum>
headius, y is it strange? it's there to force it to go through a method call to force it not to be parsed once at parse-time and to be parsed each time during each iteration
<headius>
well method calls should be pretty cheap on jruby
<headius>
I guess they're about the same in all these cases
<headius>
the literal non -m case optimizes to just be a literal regexp in all impls
<yfeldblum>
headius, right
<headius>
my numbers are about like yours
<headius>
a regexp cache for stuff like this would be worthwhile
<headius>
in your code, I mean
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<yfeldblum>
headius, heh i was just benching this to see if it would be better to just keep the string and options around separately rather than creating a regexp object
rakunHo has quit [Remote host closed the connection]
<yfeldblum>
headius, these are highly variable regexps
aaronmacy has joined #ruby
<yfeldblum>
headius, and i don't want to deal with threading issues
<headius>
for what purpose?
<headius>
just curious
<yfeldblum>
headius, mongodb lets you do regexp queries, and you can either give it a regexp object or you can give it a regexp source string + a regexp options string
jenrzzz has quit [Read error: Connection reset by peer]
Solnse has joined #ruby
<headius>
mmm I see
<headius>
well an LRU cache would be worth considering at least
<headius>
er, MRU whatever
<headius>
a cache
<headius>
:)
<yfeldblum>
headius, heh :D
<headius>
the thread_safe gem has a threadsafe cache impl
<yfeldblum>
headius, really just wondering if creating the regexp object is something to avoid, which it is
<headius>
yeah
<headius>
it's not cheap
nomenkun has joined #ruby
<yfeldblum>
headius, building a threadsafe mru cache is not on my top-10 list at the moment ...
lushious has quit [Remote host closed the connection]
bwlang has left #ruby [#ruby]
io_syl has joined #ruby
hsbt is now known as hsbt_away
alexspeller has quit [Read error: Connection reset by peer]
alexspeller has joined #ruby
apok has joined #ruby
Jasko has quit [Read error: Connection reset by peer]
Jasko has joined #ruby
pettsson has quit [Remote host closed the connection]
wargasm has joined #ruby
hsbt_away is now known as hsbt
Solnse has quit [Ping timeout: 245 seconds]
rondale_sc has left #ruby [#ruby]
ltsstar has joined #ruby
rondale_sc has joined #ruby
Chryson has joined #ruby
<aces1up>
does anyone have any good guides or books on best practices for programming threaded applications, as far as making object thread safe etc? Just seem to be having a lot of problems with threaded programming.
<aces1up>
ruby specific would be nice as well.
_alejandro has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 245 seconds]
elaptics`away is now known as elaptics
d34th4ck3r has quit [Ping timeout: 255 seconds]
generalissimo has quit [Remote host closed the connection]
iosctr has joined #ruby
raz has joined #ruby
lurch_ has quit [Ping timeout: 264 seconds]
mockra_ has joined #ruby
SCommette has joined #ruby
mneorr has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
<havenn>
With 2.0.0's new GC forking is cheaper than it used to be! (Or 1.9 with --falcon patch).
nkts has quit [Excess Flood]
<yfeldblum>
nodejs is webscale!!!
<havenn>
With 2.0.0's new GC, fork is cheaper**
whowantstolivef1 has quit [Quit: have to get to bed]
nkts has joined #ruby
nkts has quit [Excess Flood]
<havenn>
Celluloid::IO versus Node.js, discuss...
nkts has joined #ruby
nkts has quit [Excess Flood]
nkts has joined #ruby
nkts has quit [Excess Flood]
<stetho>
Hi. I'm teaching myself ruby by copying examples and playing with them. I'm trying one that starts with "require 'mail'" but I get a LoadError: cannot load such file -- mail. Is there a generic mail gem or something? I tried gem install mail which installed something but didn't fix this problem. I'm on Ubuntu 12.04 with package installed everything.
nkts has joined #ruby
Targen has joined #ruby
nkts has quit [Excess Flood]
<havenn>
stetho: Is mail a file named 'mail.rb'?
<havenn>
stetho: Or a gem?
<yfeldblum>
havenn, there is a gem named "mail"
<havenn>
yfeldblum: Have you installed the gem?: gem install mail
<stetho>
There is no mention (I know that much) of creating a mail.rb beforehand in this example I'm following. That's why I'm lost as to why this doesn't work.
nkts has joined #ruby
<havenn>
stetho: Sorry, I suck at reading, you already said all that. :(
nkts has quit [Excess Flood]
<yfeldblum>
stetho, havenn, sorry that was to stetho
<stetho>
Reading is a pain.
nomenkun has joined #ruby
<havenn>
stetho: Are you in a project with a file called "Gemfile"?
jenrzzz has quit [Quit: Lost terminal]
iamjarvo has quit [Quit: Leaving.]
<stetho>
And it's no problem. I'm not new to programming but I am new to ruby. Please treat me like I know very little but know what objects are and instantiating is.
banisterfiend has quit [Ping timeout: 265 seconds]