cj3kim has quit [Remote host closed the connection]
_maes_ has joined #ruby
lemonsparrow has quit [Ping timeout: 250 seconds]
rezzack has joined #ruby
arya__ has joined #ruby
sambao21 has joined #ruby
wmoxam has joined #ruby
reset has joined #ruby
devoldmx has joined #ruby
jmimi has joined #ruby
tobyo1 has quit [Ping timeout: 246 seconds]
jaimef has quit [Excess Flood]
krainboltgreene has quit [Ping timeout: 256 seconds]
ssvo has quit [Ping timeout: 240 seconds]
tricon_ has quit [Quit: Leaving...]
inimit has quit [Quit: inimit]
havenwood has quit [Remote host closed the connection]
BSaboia has joined #ruby
jaimef has joined #ruby
tjbiddle_ has joined #ruby
superscott[8] has quit [Quit: superscott[8]]
fmcgeough has joined #ruby
wmoxam has quit [Ping timeout: 276 seconds]
Zeeraw has quit [Quit: Computer has gone to sleep.]
zenergi has joined #ruby
tjbiddle has quit [Ping timeout: 246 seconds]
tjbiddle_ is now known as tjbiddle
Neomex has quit [Quit: Neomex]
Thoughtworker has joined #ruby
Thoughtworker has quit [Client Quit]
joe_the_engineer has joined #ruby
mikeg has quit [Remote host closed the connection]
Tricon has joined #ruby
marcgg has quit [Ping timeout: 260 seconds]
blitz has quit [Quit: This computer has gone to sleep]
Hanmac1 has joined #ruby
marcgg has joined #ruby
Guest6747 is now known as banghouse
jaimef has quit [Excess Flood]
hogeo has joined #ruby
wmoxam has joined #ruby
marr has quit [Ping timeout: 240 seconds]
wsterling has joined #ruby
Yakko has joined #ruby
arya__ has quit [Ping timeout: 248 seconds]
arya_ has joined #ruby
bigoldrock has quit [Ping timeout: 240 seconds]
Hanmac1 has quit [Ping timeout: 268 seconds]
gildo has quit [Ping timeout: 246 seconds]
goldfax has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
DonRichie has quit [Ping timeout: 260 seconds]
goldfax has left #ruby [#ruby]
wsterling has quit [Ping timeout: 276 seconds]
jaimef has joined #ruby
DonRichie has joined #ruby
jonathanwallace has joined #ruby
niklasb has quit [Ping timeout: 276 seconds]
jonkri has quit [Quit: jonkri]
rsahae has quit [Quit: rsahae]
NiteRain has joined #ruby
rsahae has joined #ruby
mansi has joined #ruby
smathieu has quit [Remote host closed the connection]
tkuchiki has joined #ruby
GeissT has joined #ruby
adeponte has quit [Remote host closed the connection]
ravster has quit [Quit: Leaving.]
dennisz has quit [Quit: dennisz]
smathieu has joined #ruby
shosti has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.4.0]
iliketurtles has quit [Quit: zzzzz…..]
asgardBSD has quit [Read error: Connection reset by peer]
michaeldeol has quit [Remote host closed the connection]
zomgbie has joined #ruby
sailias has joined #ruby
centr0 has quit [Quit: centr0]
asgardBSD has joined #ruby
robert_ has joined #ruby
hamakn has joined #ruby
bricker has quit [Ping timeout: 264 seconds]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
zomgbie has quit [Ping timeout: 268 seconds]
thepumpkin has quit [Remote host closed the connection]
thepumpkin has joined #ruby
emergion has joined #ruby
ultimoo has quit [Ping timeout: 264 seconds]
johnnyfuchs has quit [Remote host closed the connection]
emergion has quit [Max SendQ exceeded]
blitz has joined #ruby
poikon has quit [Read error: Operation timed out]
saarinen has quit [Quit: saarinen]
kofno has joined #ruby
tommyvyo has quit [Quit:]
pitzips has quit [Ping timeout: 256 seconds]
jaimef has quit [Excess Flood]
tacos1de has quit [Remote host closed the connection]
jrendell has quit [Quit: jrendell]
optimusprimem has quit [Excess Flood]
tacos1de has joined #ruby
shosti has quit [Remote host closed the connection]
djbkd has quit [Quit: Leaving]
joe_the_engineer has quit [Quit: leaving]
jaimef has joined #ruby
optimusprimem has joined #ruby
popl has joined #ruby
atyz has quit [Quit: Leaving...]
Yakko_ has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
Yakko has quit [Ping timeout: 248 seconds]
michaeldeol has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
wallerdev has joined #ruby
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pipework has joined #ruby
tricon_ has joined #ruby
jaimef has quit [Quit: Emacs must have died]
alvaro_o has joined #ruby
jaimef has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
Tricon has quit [Ping timeout: 246 seconds]
henn has joined #ruby
nari has quit [Ping timeout: 240 seconds]
reset has quit [Quit: Leaving...]
Davey has joined #ruby
Spooner has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 248 seconds]
lindenle has quit [Quit: This computer has gone to sleep]
EPIK has joined #ruby
atyz has joined #ruby
<robert_>
is there anyone who has had any luck connecting an XMPP library to Google Talk in the last three months? I can't seem to make it happen. :/
Deele has quit [Ping timeout: 240 seconds]
Underhill has joined #ruby
Hoyt has joined #ruby
<Hoyt>
Hi Why doesn't it work: print #{var}
<Hoyt>
Quote works
<r0bgleeson>
Hoyt: #{} is for string interpolation, it doesn't work outside strings, it doesn't look like you need it either, simply print var
<Hoyt>
Ah thanks
inimit has joined #ruby
vlad_starkov has joined #ruby
inimit has quit [Client Quit]
renderful has joined #ruby
Godd2 has quit [Quit: Page closed]
pipework is now known as combatwombat
asgardBSD has quit [Ping timeout: 276 seconds]
combatwombat is now known as Guest14949
Hanmac1 has joined #ruby
Guest14949 is now known as pipework
mansi has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 246 seconds]
MrZYX is now known as MrZYX|off
ILoveYou has joined #ruby
ner0x has joined #ruby
kofno has quit [Remote host closed the connection]
Hanmac1 has quit [Ping timeout: 248 seconds]
<bnagy>
MORNING!
arya_ has joined #ruby
ILoveYou[ has quit [Ping timeout: 245 seconds]
MrZYX|off is now known as MrZYX
<popl>
hi bnagy
niklasb has joined #ruby
nari has joined #ruby
<bnagy>
how is it friday already
<popl>
fml
i_s has quit [Remote host closed the connection]
Davey has quit [Quit: Computer has gone to sleep.]
BSaboia has quit [Ping timeout: 246 seconds]
Voodoofish430 has quit [Quit: Leaving.]
iliketurtles has joined #ruby
graft is now known as Guest1013
brianpWins has quit [Quit: brianpWins]
fridim__ has joined #ruby
lebek has joined #ruby
arya_ has quit [Ping timeout: 248 seconds]
mercwithamouth has joined #ruby
JZTech101 has quit [Ping timeout: 240 seconds]
johnkary has joined #ruby
danshultz has joined #ruby
smathieu has quit [Remote host closed the connection]
rsahae has quit [Ping timeout: 240 seconds]
wmoxam has quit [Ping timeout: 246 seconds]
rodacato has joined #ruby
zomgbie has joined #ruby
skyjumper has quit [Quit: ...]
fmcgeough has quit [Quit: fmcgeough]
tatsuya_o has joined #ruby
Davey has joined #ruby
zeromodu_ has joined #ruby
zeromodulus has quit [Read error: Connection reset by peer]
smathieu has joined #ruby
v0n has joined #ruby
smathieu has quit [Remote host closed the connection]
sleetdrop has joined #ruby
stairmast0r has joined #ruby
<stairmast0r>
why do i want to move from PHP to ruby?
adeponte has joined #ruby
krainboltgreene has joined #ruby
<popl>
stairmast0r: we don't know the answer to that question.
<r0bgleeson>
stairmast0r: impossible to answer
<popl>
at least I don't
renderful has quit [Remote host closed the connection]
<popl>
stairmast0r: blanket questions like that rarely produce fruitful answers. perhaps you should determine what you are looking to accomplish and then select the best language for the task.
serp` has joined #ruby
tatsuya_o has quit [Ping timeout: 260 seconds]
zomgbie has quit [Ping timeout: 260 seconds]
<stairmast0r>
popl: i can't manage that many languages at present
Domon has joined #ruby
<popl>
How many is that many?
<stairmast0r>
so i wanted to pick one that i can comfortably use in most places
<popl>
Most places?
<popl>
What places?
<stairmast0r>
i should stop talking
<popl>
Or you could finish the conversation you initiated.
<popl>
It's up to you. :P
tommyvyo has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
<stairmast0r>
i shouldn't have started it but..
adeponte has joined #ruby
<stairmast0r>
i was trying to build a website that manages some stuff based around SQL
skyjumper has joined #ruby
skyjumper has quit [Client Quit]
stkowski has quit [Quit: stkowski]
<bnagy>
everybody should move from PHP to something else
<stairmast0r>
that's what i'm trying to do
<stairmast0r>
and i wanted to pick a language that can be a fairly general replacement for PHP
<stairmast0r>
as well as one moderately comprehensible by a C-family programmer
louism2_ has quit [Quit: This computer has gone to sleep]
Hoyt has quit [Quit: WeeChat 0.4.1]
<bnagy>
I'm not sure how much I agree that PHP is a general language in the first place
ILoveYou[ has joined #ruby
<bnagy>
but lots of people do web crap in ruby, if you like that kind of thing
zenergi has quit [Ping timeout: 276 seconds]
<stairmast0r>
yes, for the most art
<stairmast0r>
part
<stairmast0r>
i'd use C++ if i could, though...
chrisy2k has joined #ruby
<bnagy>
... ew.
chrisy2k has quit [Client Quit]
adeponte has quit [Remote host closed the connection]
<stairmast0r>
:/
<stairmast0r>
it's what i know
nfk has quit [Remote host closed the connection]
ILoveYou has quit [Ping timeout: 246 seconds]
<tricon_>
I <3 C/C++.
tricon_ is now known as Tricon
tkuchiki has quit [Ping timeout: 268 seconds]
Underhill has quit [Remote host closed the connection]
freakazoid0223 has quit [Remote host closed the connection]
<lurid>
:-)
deadalus has joined #ruby
tkuchiki_ has joined #ruby
arya_ has quit [Client Quit]
stkowski has joined #ruby
tkuchik__ has joined #ruby
tkuchiki has quit [Read error: Connection reset by peer]
v0n has quit [Ping timeout: 240 seconds]
kofno has joined #ruby
serp` has quit [Quit: serp`]
tkuchik__ has quit [Remote host closed the connection]
smathieu has quit [Ping timeout: 276 seconds]
<bnagy>
that gem displeases me
tkuchiki has joined #ruby
vikhyat has joined #ruby
<bnagy>
greatly
tkuchiki_ has quit [Ping timeout: 246 seconds]
Hanmac has joined #ruby
Fire-Dragon-DoL has joined #ruby
Notte has quit [Remote host closed the connection]
<iliketurtles>
can someone help me formulate a simple function to run on a string that converts character frequency (percentage) to a Vector object in ruby?
Fuzai has quit [Remote host closed the connection]
<bnagy>
>> "this <is> a <test><string>".split(/(<.*?>)/)
<bnagy>
if you want to just get a 'rough feel' you can do index of coincidence
<bnagy>
but it takes more text to really work
eka has quit [Quit: Computer has gone to sleep.]
<iliketurtles>
bnagy: i'm working on very short strings
<iliketurtles>
no more than ~75 characters
Anarch has quit [Ping timeout: 240 seconds]
sethetter has quit [Ping timeout: 246 seconds]
<bnagy>
yeah I'd try a straight diff then
<iliketurtles>
bnagy: how so?
<bnagy>
cause you can ignore tokens that are missing in one input
ssvo has quit [Ping timeout: 256 seconds]
<iliketurtles>
bnagy: that's your example above? observed.each?
dhruvasagar has joined #ruby
<bnagy>
yeah you'd need to jazz it up a little bit
cha1tanya has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
krz has joined #ruby
<bnagy>
I'm doing the matasano stuff at the moment, but in Go, so I don't have an exact ruby example
<iliketurtles>
bnagy: ah nice, so you know where im coming from with this
mantas322 has quit [Quit: Page closed]
ixti has quit [Quit: WeeChat 0.4.1]
<bnagy>
I'd be interested to know if your approach works though
<iliketurtles>
my mentor suggested it would
haxrbyte has joined #ruby
<iliketurtles>
how far along are you?
<bnagy>
but unless I am having math-fail vectors are going to be order sensitive
<iliketurtles>
what do you mean
<bnagy>
most way through set 2
<bnagy>
well [2,3] is not the same as [3,2]
<iliketurtles>
right, but would that really matter?
<bnagy>
so if that were the whole freq map of characters, it wouldn't make sense to compare them unless they were sorted, no?
zomgbie has joined #ruby
<iliketurtles>
true
<bnagy>
or does it just use inner product?
haxrbyte_ has quit [Read error: Connection reset by peer]
clintnewsom has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
tkuchiki_ has quit [Remote host closed the connection]
danshultz has quit [Remote host closed the connection]
<iliketurtles>
im not sure
<iliketurtles>
im confused about my approach now
<bnagy>
:D
<bnagy>
that's what we're here for!
<iliketurtles>
heh
<iliketurtles>
so you did it with a hash?
<bnagy>
now that I'm reading this again I think you might be right, but I definitely think it's going through the woods
Anarch has joined #ruby
<bnagy>
imho write up a simple normalised diff first, there are still plenty of gotchas with that
<iliketurtles>
right about what?
<bnagy>
right about not having to sort
GeissT has quit [Ping timeout: 276 seconds]
tkuchiki has joined #ruby
<iliketurtles>
i dont know why i would have to sort; couldnt i just iterate through a string; first time, count all "a" instances, and add it as the first entry in the vector ie. Vector[#ofA, #ofB] etc
TomRone has joined #ruby
<bnagy>
yeah but that's sorting
<iliketurtles>
=]
<iliketurtles>
touché
<bnagy>
like you get an ordered vector at the end
<iliketurtles>
correct
<iliketurtles>
i thought you meant sorting after the fact, which would be impossibruuuu with a vector
<bnagy>
no you'd have to sort the hash and then just take the values in that order
<bnagy>
hsh.sort.map &:last
zomgbie has quit [Ping timeout: 260 seconds]
<iliketurtles>
oh
<iliketurtles>
wait
<iliketurtles>
are you saying do a hash so you only have to iterate over string once
<iliketurtles>
and then convert it into a vector?
<bnagy>
yeah among other reasons
ssvo has joined #ruby
<bnagy>
you can easily do both
<iliketurtles>
or just deal with hash exclusively
<bnagy>
so step 1 - build a hash of normalised value
<iliketurtles>
normalized value meaning just each letter as a key?
<bnagy>
'e' => 12.4 or whatever
<iliketurtles>
sure
<bnagy>
as a %
<iliketurtles>
yes
<bnagy>
or |0,1| either way
<iliketurtles>
got u
<bnagy>
once you've done that you can use either or both of the comparisons we just talked about
<bnagy>
fairly trivially
<iliketurtles>
so one approach is, step 2 convert the hash to vector, step 3 use cosine difference
<bnagy>
yep
<iliketurtles>
another approach, observed.each {|k,v| diff += Math.abs(v - template[k]}
<bnagy>
yep
<iliketurtles>
word
Kruppe has quit [Quit: rcirc on GNU Emacs 24.3.1]
dhruvasagar has quit [Ping timeout: 246 seconds]
artemeff has joined #ruby
joe_the_engineer has joined #ruby
<iliketurtles>
bnagy: so if i took the observed.each approach, I'd build up another hash of the difference of each character
<iliketurtles>
and I'd be looking for the one where the sum of all difference was closest to 0?
<bnagy>
no you'll just get a single scalar at the end
Yakko_ has quit [Ping timeout: 276 seconds]
<iliketurtles>
OH. diff +=
<iliketurtles>
didnt see that lol
<bnagy>
like a perfect match would, yes, have a diff of 0
<iliketurtles>
hmmmm i feel like thats easier
<bnagy>
oh it's WAY easier
<bnagy>
I just don't know if it's better :)
alvaro_o has quit [Quit: Ex-Chat]
<bnagy>
it's 2 lines max, if I wanted to golf it
<iliketurtles>
bnagy: me gusta
<iliketurtles>
sorry im ritarded today
twoism has quit [Remote host closed the connection]
rodacato has quit [Remote host closed the connection]
kofno has quit [Remote host closed the connection]
braincrash has joined #ruby
clintnewsom has quit [Quit: clintnewsom]
braincra- has quit [Read error: Operation timed out]
havenwood has joined #ruby
clintnewsom has joined #ruby
AntelopeSalad has quit [Ping timeout: 256 seconds]
arya_ has joined #ruby
monkegji_ has quit [Ping timeout: 240 seconds]
haxrbyte has quit [Remote host closed the connection]
clintnewsom has quit [Client Quit]
haxrbyte has joined #ruby
ulius has quit [Quit: Page closed]
joe_the_engineer has quit [Quit: leaving]
nkts_ has quit [Read error: Connection reset by peer]
nkts has joined #ruby
adeponte has joined #ruby
marcdel has joined #ruby
cyong has joined #ruby
robscomputer has quit [Remote host closed the connection]
adeponte has quit [Ping timeout: 260 seconds]
robscomputer has joined #ruby
mad has left #ruby [#ruby]
arya_ has quit [Ping timeout: 248 seconds]
ssvo has quit [Ping timeout: 240 seconds]
vikhyat_ has joined #ruby
welandB has joined #ruby
smathieu has joined #ruby
vikhyat has quit [Ping timeout: 260 seconds]
jonahR_ has joined #ruby
<welandB>
If I have a custom object stored as a hash value, how do I return one of that object's variables by default when I reference the object? For instance, if an Engine object is the value of corvette["engine"], how do I get it to return "V8"?
robscomputer has quit [Ping timeout: 240 seconds]
arya_ has joined #ruby
marcgg has quit [Ping timeout: 276 seconds]
smathieu has quit [Ping timeout: 240 seconds]
jonahR_ is now known as jonahR
jonahR has quit [Ping timeout: 264 seconds]
Goopyo has quit [Quit: Goopyo]
marcgg has joined #ruby
<bnagy>
use the block form for your Hash
kofno has joined #ruby
kofno has quit [Remote host closed the connection]
Hanmac has joined #ruby
louism2__ has quit [Quit: This computer has gone to sleep]
<bnagy>
oh, ew that will only work as the default
<bnagy>
might need to Delegate
<bnagy>
or, like, just store the thing you want to retrieve :)
mmitchell has quit [Remote host closed the connection]
<welandB>
There's no way to set a default variable as what is returned when the object is simply called?
rickruby has joined #ruby
<bnagy>
no, if it exists you'll get it
Hanmac has quit [Read error: Operation timed out]
<bnagy>
if it doesn't exist you can play around a lot
<welandB>
So the best I could do would be to override to_s in the called class for when I call it from puts?
<bnagy>
seems unlikely
kofno has joined #ruby
<welandB>
E.g. - puts "Engine: #{corvette["engine"]}" would called the Engine.to_s, right?
r0bby has quit [Read error: No route to host]
Meatant has quit [Quit: yis]
<bnagy>
I don't see what's wrong with corvette['engine'].engine_name
artemeff has quit [Remote host closed the connection]
<welandB>
Me neither but I'm trying to build flexibility from the ground-up.
<Quadlex>
Have you tried yoga?
<bnagy>
ok well what you're saying is the opposite of that
<welandB>
I mean I want to still be able to access instance variables via an accessor method but return one by default if only the object itself is called.
mary5030 has joined #ruby
swordsmanz has quit [Ping timeout: 268 seconds]
fomatin has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
serp` has joined #ruby
<welandB>
So corvette['engine'].volume would return... the volume. But corvette['engine'].name and corvtett['engine'] would both return the name.
lindenle has joined #ruby
<bnagy>
no, you can't do that
<welandB>
Snap.
flaccid has joined #ruby
<bnagy>
but that's different to making "#{corvette['engine']}" print "V8"
<welandB>
Yes, that's just overriding to_s, isn't it?
adeponte has joined #ruby
<bnagy>
that's just overriding inspect output
<welandB>
Ohhhhh.
<welandB>
Ok.
<welandB>
I'll look into that.
<welandB>
Thanks bnagy.
io_syl has quit [Ping timeout: 268 seconds]
<bnagy>
it's still imho a bad idea btw :P
robbyoconnor has joined #ruby
<welandB>
Why's that?
<bnagy>
actually I think I'm just crazy.. I think it _is_ to_s :P
<bnagy>
>> class Foo;def to_s;"foo";end;end; "#{Foo.new}"
mahmoudimus has quit [Quit: Computer has gone to sleep.]
siera08 has quit [Ping timeout: 268 seconds]
smathieu has joined #ruby
fomatin has quit [Ping timeout: 246 seconds]
robscomputer has quit [Ping timeout: 268 seconds]
DanKnox is now known as DanKnox_away
renderful has joined #ruby
smathieu has quit [Ping timeout: 268 seconds]
_veer has joined #ruby
ILoveYou[ has joined #ruby
kofno has joined #ruby
renderful has quit [Remote host closed the connection]
Hanmac has joined #ruby
renderful has joined #ruby
AndChat-143129 has quit [Quit: Bye]
huoxito has quit [Quit: Leaving]
browndawg has joined #ruby
lindenle has quit [Quit: This computer has gone to sleep]
ILoveYou has quit [Ping timeout: 256 seconds]
serp` has quit [Quit: serp`]
atyz has quit [Quit: Leaving...]
rezzack has quit [Quit: Leaving.]
lindenle has joined #ruby
pipework has quit [Remote host closed the connection]
Hanmac has quit [Ping timeout: 264 seconds]
tomzx_mac has quit [Read error: Operation timed out]
kofno has quit [Ping timeout: 264 seconds]
mary5030 has quit [Read error: Connection reset by peer]
passcod has quit [Ping timeout: 256 seconds]
rismoney has quit [Remote host closed the connection]
gstamp has quit [Ping timeout: 256 seconds]
flaccid has quit [Ping timeout: 256 seconds]
cibs has quit [Ping timeout: 256 seconds]
rismoney has joined #ruby
DonRichie has quit [Quit: Verlassend]
flaccid has joined #ruby
flaccid has quit [Changing host]
flaccid has joined #ruby
ehaliewicz has joined #ruby
lebek has joined #ruby
gstamp has joined #ruby
passcod has joined #ruby
krainboltgreene has quit [Ping timeout: 264 seconds]
cmarques has quit [Ping timeout: 264 seconds]
mmitchell has joined #ruby
jalcine has quit [Excess Flood]
xaxxon has joined #ruby
lebek has quit [Client Quit]
dhruvasagar has joined #ruby
<xaxxon>
how do you do a non-blocking socket write in ruby? I see accept_nonblock, read_nonblock, but not how to write. Does write just always return 0 immediately if it can't write? that deosn't seem right but i can't find anything one way or another.
tonini has joined #ruby
cibs has joined #ruby
tonini has quit [Remote host closed the connection]
obs has quit [Quit: Konversation terminated!]
<bnagy>
can't you set the whole socket to nonblock?
<bnagy>
the rescue E_WOULDBLOCK?
mmitchell has quit [Ping timeout: 240 seconds]
sleetdrop has quit [Quit: Computer has gone to sleep.]
<bnagy>
I always thread so I'm just guessing
darth_chatri has joined #ruby
<xaxxon>
yeah, that doesn't seem to be the "ruby way to do it"...
<bnagy>
sorry, which?
<xaxxon>
and I'd rather not use the thin wrappers around the C system calls if I can avoid it..
<bnagy>
that's what Socket is
<xaxxon>
well, there is an "accept_nonblock" and a "read_nonblock"
fredjean has joined #ruby
<xaxxon>
how do you set a socket to nonblocking? I'm not seeing anything obvious
ukd1_ has joined #ruby
ukd1_ has quit [Remote host closed the connection]
<xaxxon>
I think you can use the fcntl stuff to do it, but it seems like that shouldn't be the best approach
<bnagy>
connect_nonblock, by the looks, or you could setsockopts
<xaxxon>
this is for an accepted socket on the server
<xaxxon>
no the client socket
<xaxxon>
*not
wallerdev has quit [Quit: wallerdev]
atyz has joined #ruby
zomgbie has joined #ruby
<xaxxon>
it's just weird that there is accept and read variations with nonblock, but not write. I could just call read_nonblock and let it fail.. apparently that sets it nonblocking.. but that seems sily as well
<bnagy>
honestly, though, I think most people use threads or select
<xaxxon>
I am using select, but I'm not sure that's sufficient
lemonsparrow has joined #ruby
<xaxxon>
it's not clear to me exactly what is responsible for causing socket writes to block and if it's a shared resource across all sockets.. or IP or TCP sockets
fredjean has quit [Quit: Computer has gone to sleep.]
eldariof has quit [Ping timeout: 264 seconds]
<xaxxon>
and if smoething else can fill it up after select has returned a socket as being writeable
sayan has quit [Ping timeout: 264 seconds]
adeponte has quit [Remote host closed the connection]
<xaxxon>
so I prefer to have it be nonblocking regardless. and since you have to handle partial (non-zero but not the full requested write) writes anyhow, there's actually no downside
sodacrunch has joined #ruby
blandflakes has quit [Quit: Leaving]
sambao21 has quit [Quit: Computer has gone to sleep.]
<sodacrunch>
if you are on Ubuntu, and you have Ruby 1.9 installed and you want 2.0, can you apt-get update ruby, or remove ruby and then specifically install 2.0?
<xaxxon>
I use rvm...
djbkd has joined #ruby
<sodacrunch>
xaxxon: all that would require is "rvm install 2.0.0" correct?
<xaxxon>
bnagy, I'm retarded. there is a write_nonblock.. I was using a hash (of sockets) instead of a socket and that's what was giving me the no-method error
<xaxxon>
it's on basicsocket.. I did a socket.public_methods.sort.inspect and saw it.. so I got confused..
<bnagy>
xaxxon: yeah I saw a sendmsg_nonblock in BasicSocket
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<darth_chatri>
i have seen many newbies run the first command on the rvm installation page and mess things up
<darth_chatri>
I think "curl -L https://get.rvm.io | bash -s stable" should be at the top of the list there
<xaxxon>
bnagy, yeah, sendmsg is a pain to use with tcp..
<xaxxon>
I think you can, but it's annoying
<bnagy>
curl | bash should not be on any list anywhere
<bnagy>
it makes me stabby
<darth_chatri>
is there a better way for a newbie?
djbkd has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby
<bnagy>
xaxxon: it's pretty unusual to be messing with sockets directly, though, there are a ton of higher level gems
<bnagy>
but who knows what you're doing
brianpWins has quit [Client Quit]
bluOxigen has joined #ruby
bluOxigen has quit [Changing host]
bluOxigen has joined #ruby
<xaxxon>
bnagy, oh I know. I'm pretending it's homework :)
mahmoudimus has joined #ruby
marcdel has joined #ruby
djbkd has joined #ruby
EPIK has quit [Ping timeout: 264 seconds]
lebek has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
adeponte has joined #ruby
djbkd has quit [Client Quit]
djbkd has joined #ruby
sayan has joined #ruby
BizarreCake has joined #ruby
adeponte has quit [Remote host closed the connection]
cyong has quit [Quit: Leaving.]
michaeldeol has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 248 seconds]
sleetdrop has joined #ruby
tommyvyo has quit [Quit:]
ffio has quit [Quit: WeeChat 0.4.1]
ffio has joined #ruby
ntus1017 has quit [Remote host closed the connection]
ayaz has joined #ruby
browndawg has left #ruby [#ruby]
noyb has joined #ruby
mercwithamouth has quit [Ping timeout: 240 seconds]
arya_ has joined #ruby
<flaccid>
if you do say require "foo/bar" and in this file, there is a class within a module, can i not declare a def initialize ?
<flaccid>
it doesn't seem to get run when i require it
cj3kim has joined #ruby
<bnagy>
wat?
wsterling has quit [Remote host closed the connection]
<bnagy>
foo/bar is the file bar.rb in the directory foo
<flaccid>
yeah i don't really make sense
<bnagy>
if that's like module Bar class Baz you still have to refer to it as Bar::Baz.new
<flaccid>
yeah i am requiring bar.rb which has a module in it
smathieu has joined #ruby
<flaccid>
ok create an instance of Baz to initialize
<bnagy>
unless you include Bar in toplevel which is not normally recommended
johnnyfuchs has joined #ruby
johnnyfuchs has quit [Remote host closed the connection]
zomgbie has joined #ruby
ayaz has quit [Read error: Connection reset by peer]
lindenle has quit [Quit: This computer has gone to sleep]
tjbiddle has quit [Quit: tjbiddle]
bertolo has quit [Read error: Connection reset by peer]
<flaccid>
ok so i can do settings = Forklift::Config.new so my main program can have the dynamically created settings
<bnagy>
whatever you say, dude
zz_michael_mbp is now known as michael_mbp
smathieu has quit [Ping timeout: 268 seconds]
b0oh has joined #ruby
corehook has joined #ruby
rshetty has joined #ruby
<flaccid>
bnagy: i'm learning :)
<flaccid>
making something with methadone..
13WAATBRW has joined #ruby
E23 has joined #ruby
E23 has left #ruby [#ruby]
E23 has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
michael_mbp is now known as zz_michael_mbp
<bnagy>
mmm methadone
zz_michael_mbp is now known as michael_mbp
JohnBat26 has joined #ruby
<flaccid>
bnagy: are you familiar with it?
mary5030 has joined #ruby
13WAATBRW has quit [Ping timeout: 260 seconds]
zomgbie has quit [Ping timeout: 256 seconds]
MrZYX is now known as MrZYX|off
<bnagy>
nah when I quite heroin I just went cold turkey
ntus1017 has joined #ruby
<flaccid>
i see
tagrudev has joined #ruby
<cj3kim>
bnagy: holy crap. what made you start?
himsin has joined #ruby
<bnagy>
PHP
robscomputer has joined #ruby
wesside has joined #ruby
robscomputer_ has joined #ruby
dankest has quit [Quit: dankest]
b0oh has quit [Quit: Leaving.]
rshetty has quit [Quit: Adios]
wesside has quit [Client Quit]
ner0x has quit [Quit: Leaving]
samuel02 has joined #ruby
robscomputer has quit [Ping timeout: 264 seconds]
mary5030 has quit [Remote host closed the connection]
wesside has joined #ruby
<flaccid>
hehe
wesside has quit [Client Quit]
sayan has quit [Read error: Connection reset by peer]
jprovazn has joined #ruby
kevinykchan has joined #ruby
julian-delphiki has joined #ruby
<stairmast0r>
flaccid: dick
michael_mbp is now known as zz_michael_mbp
poga has joined #ruby
flaccid has quit [Read error: Connection reset by peer]
poga has quit [Remote host closed the connection]
Kar- has joined #ruby
<xaxxon>
I need a buffer where I can treat it like an arbitrary data "queue".. where I can read the oldest N bytes and push on M bytes .. I don't think StringIO does what I want, but am open to being wrong
<xaxxon>
anyone know of any builtins that do this type of thing?
maxfilipovich has joined #ruby
fredjean has joined #ruby
bean has quit [Ping timeout: 264 seconds]
<xaxxon>
I guess a string might work.. but am not sure about how inefficient that is
marsLantern has quit [Remote host closed the connection]
welandC has joined #ruby
atmosx has joined #ruby
<xaxxon>
so.. how to remove the first N bytes from a string?
ananthakumaran has joined #ruby
nitish has joined #ruby
welandB has quit [Ping timeout: 240 seconds]
lethjakman has joined #ruby
<xaxxon>
preferably without creating a full copy of the remaining bytes.. :\
jwang has joined #ruby
atno has quit [Remote host closed the connection]
<lethjakman>
hey, I have this code here that is violating a unique key (as I want it to) but how do I catch this gracefully?
<lethjakman>
I don't want it to error out, I want it to just give me a statement saying it's violated
<lethjakman>
er a string or a true/false or something
v0n has joined #ruby
<lethjakman>
sorry, did those send? my internet shut off
zomgbie has joined #ruby
flaccid has joined #ruby
browndawg has joined #ruby
<xaxxon>
what does "violating a unique key" mean?
<xaxxon>
is this a rails question?
<bnagy>
xaxxon: Queue?
<xaxxon>
bnagy, I need to read stuff off in arbitrary chunks, though.. not just how it was added.
sodacrunch has quit [Ping timeout: 250 seconds]
<xaxxon>
if I add 4 bytes, then 9 bytes, I then want to pull off 8 bytes
<xaxxon>
and have 5 bytes left
<xaxxon>
blah.. it's low size and infrquently used, so it doesn't matter if it's efficient
havenwood has quit [Remote host closed the connection]
<bnagy>
push em byte by byte? :P
havenwood has joined #ruby
<bnagy>
streaming network-based readers are irritating
arya_ has quit [Ping timeout: 248 seconds]
himsin has quit [Quit: himsin]
wesside has joined #ruby
rezzack has joined #ruby
himsin has joined #ruby
<lethjakman>
xaxxon: it's an active record question. I couldn't get any help there though.
ntus1017 has quit [Remote host closed the connection]
<lethjakman>
I have a table that's a has_and_belongs_to_many and I put a unique constraint on it, but when I try to insert two of the same values it errors out rather than being caught.
havenwood has quit [Ping timeout: 256 seconds]
arya_ has joined #ruby
<atmosx>
anyone has experience with any kind of eshops?
<bnagy>
xaxxon: I think in general you can just suck strings from the Queue and then keep a buffer in the reassembler
zomgbie has quit [Ping timeout: 264 seconds]
<bnagy>
but re your question, str.slice! 0, n
adeponte has joined #ruby
agjacome has joined #ruby
thepumpk_ has quit [Remote host closed the connection]
Opettaja has quit [Remote host closed the connection]
thepumpkin has joined #ruby
michaeldeol has joined #ruby
smathieu has joined #ruby
b0oh has joined #ruby
michaeldeol has quit [Ping timeout: 264 seconds]
lethjakman has quit [Ping timeout: 268 seconds]
smathieu has quit [Ping timeout: 276 seconds]
adeponte has quit [Ping timeout: 276 seconds]
browndawg1 has joined #ruby
b0oh has left #ruby [#ruby]
<oceanbreeze>
Sup guys, someone already got the new Ruby 2.0 pickaxe book?
Hanmac2 has joined #ruby
hamakn has quit [Read error: Connection reset by peer]
<flaccid>
hmm anyone know how to make an option not require an argument in methadone?
hamakn has joined #ruby
<oceanbreeze>
PHP > RUBY
DanKnox_away is now known as DanKnox
atmosx has quit [Ping timeout: 260 seconds]
browndawg has quit [Ping timeout: 276 seconds]
senayar has joined #ruby
wsterling has joined #ruby
dagobah has joined #ruby
tomgrim has joined #ruby
thepumpk_ has joined #ruby
aganov has joined #ruby
Shirakawasuna has joined #ruby
Hanmac2 has quit [Ping timeout: 264 seconds]
apeiros has joined #ruby
dash_ has joined #ruby
ntus1017 has joined #ruby
v0n has quit [Ping timeout: 260 seconds]
Davey has quit [Quit: Computer has gone to sleep.]
echevemaster has quit [Quit: Leaving]
krisfremen-home has quit [Ping timeout: 268 seconds]
wsterling has quit [Ping timeout: 248 seconds]
thepumpkin has quit [Ping timeout: 276 seconds]
bobbyz has quit [Ping timeout: 246 seconds]
zomgbie has joined #ruby
atno has joined #ruby
tkuchiki_ has joined #ruby
sayan has joined #ruby
pranny has joined #ruby
AlHafoudh has joined #ruby
cantonic has quit [Ping timeout: 264 seconds]
cantonic has joined #ruby
chriskk has quit [Quit: chriskk]
<flaccid>
with OptionsParser, how do i define an option that does not require an argument?
tkuchiki has quit [Ping timeout: 248 seconds]
bobbyz has joined #ruby
KevinSjoberg has joined #ruby
goodgame has joined #ruby
djbkd has quit [Remote host closed the connection]
noyb has quit [Ping timeout: 276 seconds]
<flaccid>
hmm it works. some kind of voodoo heh
JohnBat26|2 has joined #ruby
JohnBat26|3 has joined #ruby
trepidaciousMBR has joined #ruby
i_s has quit [Quit: i_s]
tomgrim has quit [Ping timeout: 260 seconds]
timonv has joined #ruby
JohnBat26 has quit [Ping timeout: 264 seconds]
teddyp1cker has joined #ruby
senayar has quit [Remote host closed the connection]
JohnBat26|2 has quit [Ping timeout: 240 seconds]
krisfremen-home has joined #ruby
xaxxon has quit [Quit: This computer has gone to sleep]
jbpros has joined #ruby
Achalov40-ru has joined #ruby
io_syl_ has joined #ruby
io_syl_ has quit [Changing host]
io_syl_ has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
Hanmac has joined #ruby
gstamp has quit [Quit: Computer has gone to sleep.]
sleetdrop has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby
codecop has joined #ruby
Zeeraw has joined #ruby
pedestrian has joined #ruby
threesome has joined #ruby
E23 has quit []
ntus1017 has quit [Ping timeout: 268 seconds]
senayar has joined #ruby
dankest has joined #ruby
robscomputer_ has quit [Ping timeout: 268 seconds]
iliketurtles has joined #ruby
iliketurtles has quit [Max SendQ exceeded]
u- has joined #ruby
iliketurtles has joined #ruby
renderful has quit [Remote host closed the connection]
<Mon_Ouie>
Yeah, a kernel is probably not the easiest kind of software to write regression tests for
<jlebrech>
a compiler checks the syntax and sanity, also the kernel needs to run on real hardware directly.
smathieu has joined #ruby
vlad_starkov has joined #ruby
popl has quit [Quit: We must make an idol of our fear, and call it God.]
vlad_starkov has quit [Remote host closed the connection]
sqd_ has quit [Quit: sqd_]
<diegoviola>
i ask because it seems like a lot of people take unit tests for granted, especially in communities like ruby, perl, python, etc, and i'm trying to learn about BDD/TDD now, so...
fgo has joined #ruby
<diegoviola>
i was just being curious
<seriously_random>
linus is a smart guy, what smart guys say can sometimes be interpreted in many ways
<seriously_random>
actually, what idiot says can be interpreted in many ways also
smathieu has quit [Ping timeout: 248 seconds]
gnagno_ has quit [Ping timeout: 240 seconds]
gnagno_ has joined #ruby
<diegoviola>
sure
Spami has joined #ruby
<jlebrech>
in C testing is more gear towards compilation of example code
<jlebrech>
if you miss out an edge case hopefully compilation should also cover any other issues.
<jlebrech>
also C chucks out all the unused code in compilation, so having tests USE that code will prevent optimization
alex_io has joined #ruby
Anarch has quit [Ping timeout: 276 seconds]
cha1tanya has joined #ruby
ah9 has quit [Quit: leaving]
Shirakawasuna has quit [Ping timeout: 240 seconds]
<diegoviola>
sounds right
<diegoviola>
thanks
darth_chatri has quit [Quit: Leaving.]
rdark has quit [Ping timeout: 264 seconds]
Kar- has quit [Remote host closed the connection]
rdark has joined #ruby
Astralum has joined #ruby
KevinSjoberg has quit [Ping timeout: 260 seconds]
bluOxigen has quit [Ping timeout: 256 seconds]
KillerFox has quit [Ping timeout: 248 seconds]
apeiros_ has quit [Ping timeout: 256 seconds]
KillerFox has joined #ruby
cha1tanya has quit [Read error: Connection reset by peer]
b0oh has joined #ruby
cha1tanya has joined #ruby
nomenkun has joined #ruby
Hanmac2 has quit [Quit: Leaving.]
nitish has quit [Remote host closed the connection]
nomenkun has quit [Remote host closed the connection]
nomenkun has joined #ruby
<jlebrech>
is returning truthiness a thing in ruby?
<jlebrech>
sound like a pain to create a custom class to just say "yep it failed"
<heftig>
huh?
<hoelzro>
if you want to return a boolean, I would jsut 'return it.worked?'
<hoelzro>
or better yet:
<hoelzro>
'it.worked?' as the last line
bluOxigen has joined #ruby
<hoelzro>
(assuming you're not breaking out early)
<heftig>
!!it.worked?
<jlebrech>
i don't have an it object
<jlebrech>
that's a example
<heftig>
jlebrech: i'm still missing context here
<sevenseacat>
lol
<hoelzro>
I'm just saying that 'if cond return true else return false end' is a waste of typing =)
<sevenseacat>
'heres some example code' 'yep thats good' 'but its just an example'
<jlebrech>
it's not an example of my code
<jlebrech>
just explaining what i meant by returning something
browndawg has quit [Ping timeout: 248 seconds]
<sevenseacat>
we know what it means to return something. we're programmers.
<jlebrech>
that's good to know
<tobiasvl>
jlebrech: what exactly are you wondering? :) yes, returning truthiness is a thing in ruby, you don't have to convert the truthiness to an explicit `true` value if the method name has a ? tacked onto the end, then ruby programmers will know that the return value is truthy
<tobiasvl>
or falsy
<tobiasvl>
that's the idiom
<heftig>
though it should return a boolean, and not 3 or nil
<heftig>
even if those have truth value
browndawg has joined #ruby
<jlebrech>
so if a method called "do_awesome_action" returned false, you would assume that something didn't work?
joshu has joined #ruby
<heftig>
sure, if that's part of the protocol
<tobiasvl>
heftig: okay, really? because that's literally the opposite thing of what i said so i guess i was wrong then
mklappstuhl has joined #ruby
trepidaciousMBR has joined #ruby
<sevenseacat>
lolway
BizarreCake has quit [Read error: Connection reset by peer]
himsin has quit [Quit: himsin]
<sevenseacat>
a ? method should return true or false.
<jlebrech>
because i have returning 1 or 0 drilled into my head from C
<DaniG2k>
basically, its a dumb setup but I'm trying to get it to crawl a single domain
kofno has joined #ruby
<DaniG2k>
all the methods work except for the crawl method
<DaniG2k>
which i'm trying to implement recursively
<DaniG2k>
right now it's just printing to stdout "visiting' + the name of the url its going into
<DaniG2k>
and pulls out links form there (of the same domain)
<DaniG2k>
and goes into those
<DaniG2k>
however, it seems to not crawl a whole lot of links
<DaniG2k>
like for the bbc it will stop after a few seconds
poikon has joined #ruby
<DaniG2k>
for some reason the recursion part isnt returning a new set of links to crawl
BSaboia has joined #ruby
<zendeavor>
cut the problem description down to a one-liner
<DaniG2k>
ok
KillerFox has quit [Read error: Connection reset by peer]
<clocKwize>
its fine.
<DaniG2k>
what's wrong with the self.crawl(next_url) line? it seems to not perform the recursion correctly and instead, I feel like it's only crawling the seed, getting those links and crawling those pages
<clocKwize>
why don't you put some puts statements in to see how much it does
<DaniG2k>
btw this isn't an important project or anything I'm just coding for fun
<clocKwize>
and where it stops
<zendeavor>
"right now what it's doing..." can all be derived from the code; you need to state your intention and desire instead. for future reference, being concise is ultimately more helpful for both the reader and yourself (you may work out the solution as you try to eliminate the cruft from the problem)
whowantstolivefo has joined #ruby
agjacome has quit [Quit: leaving]
<zendeavor>
lucky for you clocKwize is a nice guy =]
<clocKwize>
I can't see any particular problem with the code, but I'm not running it or debugging it, just looking :)
hogeo has quit [Remote host closed the connection]
<clocKwize>
yeah, I don't want to though, I'm going to give you idea of how to fix it and let you work it, that way, you'll know for next time, instead of me just saying change this to that
<DaniG2k>
the puts visited part is what shows me that its not visiting many pages
<DaniG2k>
ok
<DaniG2k>
clocKwize: are you a long-time ruby programmer?
<clocKwize>
also, I'm working :)
<clocKwize>
yeah
<DaniG2k>
me too, "working" hehe
<DaniG2k>
ah nice
<DaniG2k>
clocKwize: does the code totally suck or is it decent thus far?
<DaniG2k>
I'm kind of a n00b programmer
<clocKwize>
well, it will never scale
<DaniG2k>
of course
<DaniG2k>
im not even trying to handle a billion things
mklappstuhl has quit [Remote host closed the connection]
<clocKwize>
DaniG2k: no i mean, if you want to scrape lots of stuff, it'll explode and be very slow :)
KevinSjoberg has joined #ruby
<DaniG2k>
clocKwize: because of the recursion?
<clocKwize>
yes, and it'll only ever do 1 at a time
renderful has joined #ruby
<clocKwize>
I'd use rescue, have a job that opens a url, gets the links and adds them to the queue. then you can add a job to the queue like scrape:http://www.bbc.co.uk
<clocKwize>
and you'll get a big big queue of jobs
<clocKwize>
and you can start as many worker processes as you like
<DaniG2k>
hmm
<clocKwize>
to process them
<zendeavor>
mmmm scale
<DaniG2k>
not sure how to do that to be honest
<clocKwize>
that will fall down quickly too, unless you stop somewhere :)
<clocKwize>
your thing is fine, just to scrape 1 level of urls
<DaniG2k>
how does google do it??? *amazed*
<clocKwize>
or something
<clocKwize>
DaniG2k: google is probably 100x more complex than what I said
zomgbie has quit [Read error: Connection reset by peer]
<DaniG2k>
for sure
<zendeavor>
DaniG2k: don't worry about it; if you are just practicing then this would be premature optimization especially since it's over your head
<clocKwize>
yes, I agree, your code is ok, for a small scrape where it will stop soon
zomgbie has joined #ruby
danshultz has quit [Remote host closed the connection]
<_br_>
Interesting question. How do different services such as Google Maps and others actually come up with a mapping from Addresses to Geographic Coordinates (long/lat)? Are there databases for that?
jonkri has joined #ruby
<DaniG2k>
hmm that is an interesting question
<DaniG2k>
never thought about it
danshultz has joined #ruby
<DaniG2k>
the coordinates must reprenent a place on the google map visual interface
<DaniG2k>
and that map must overlap with address names
<DaniG2k>
if the points are on a certain street
<DaniG2k>
thats the address
b0oh has quit [Quit: Leaving.]
<senayar>
they have database to map lat and long
<DaniG2k>
everyone might be using the same convention for geolocation points
allsystemsarego has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: Computer has gone to sleep.]
BrianJ has joined #ruby
devoldmx has quit [Ping timeout: 268 seconds]
<_br_>
Interesting, thanks
realDAB has quit [Quit: realDAB]
dEPy has joined #ruby
krainboltgreene has joined #ruby
maxfilipovich has joined #ruby
realDAB has joined #ruby
seriously_random has quit [Quit: Leaving]
Beoran__ has joined #ruby
yshh has quit [Remote host closed the connection]
madd has joined #ruby
<madd>
hello
<madd>
if hostname.match(/^[i|bg|cz|de|hr|pl|ro|sk]p/) <--- this works not as i expected. I like to filter hostnames starts with ip... bgp... czp... any hints?
enebo has joined #ruby
<DaniG2k>
hostnames.start_with?
<DaniG2k>
and then pass your regex
<DaniG2k>
I think you can do that
<madd>
thx, I will try
krainboltgreene has quit [Ping timeout: 256 seconds]
Beoran_ has quit [Ping timeout: 240 seconds]
<DaniG2k>
hmm actually i dont think it works with regex
<DaniG2k>
madd: all you need to do is
<DaniG2k>
names =~ /^patterns here/
<DaniG2k>
that will return the position where it matches or nil
enebo has quit [Client Quit]
TIJ has joined #ruby
<bnagy>
madd: match returns a weird thing ( matchgroup )
gnagno__ has quit [Ping timeout: 240 seconds]
<DaniG2k>
indeed
<bnagy>
just =~ is what you want
devoldmx has joined #ruby
<DaniG2k>
and you will have to convert that to string or something
<bnagy>
cause even an empty matchgroup will be truthy
yacks has joined #ruby
<bnagy>
... wait no it doesn't
threesome has joined #ruby
carloslopes has joined #ruby
cantonic has quit [Quit: cantonic]
devoldmx3 has quit [Ping timeout: 260 seconds]
<bnagy>
your problem must be somewhere else
alex_io has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
stairmast0r has quit [Ping timeout: 240 seconds]
devoldmx3 has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
gyre007 has quit [Remote host closed the connection]
sambao21 has joined #ruby
jp- has joined #ruby
pipework has joined #ruby
pipework has quit [Remote host closed the connection]
<madd>
bnagy: DaniG2k: =~ works fine if hostname is ip... ia... but not with dep... ||||| hostname =~ /^[i|bg|cz|de|hr|pl|ro|sk]p/
nobitanobi has quit [Remote host closed the connection]
<DaniG2k>
yup
<DaniG2k>
(a|b) means a or b
<madd>
oh rubular is pretty cool. i didn't know that
<madd>
thx
zets has quit [Ping timeout: 246 seconds]
<DaniG2k>
rubular is sweet
bluOxigen has quit [Read error: Connection reset by peer]
<DaniG2k>
np
bluOxigen has joined #ruby
apeiros_ has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
mklappstuhl has joined #ruby
krainboltgreene has joined #ruby
FishermansEnemy has quit [Ping timeout: 276 seconds]
devoldmx3 has quit [Ping timeout: 256 seconds]
ntus1017 has quit [Remote host closed the connection]
Kar- has joined #ruby
wmoxam has joined #ruby
choobie has joined #ruby
gildo has quit [Ping timeout: 246 seconds]
dash_ has joined #ruby
rshetty has joined #ruby
blueOxigen has joined #ruby
vikhyat has joined #ruby
devoldmx has joined #ruby
wallerdev has joined #ruby
bluOxigen has quit [Ping timeout: 240 seconds]
atyz has quit [Quit: Leaving...]
Kruppe has joined #ruby
madd has left #ruby [#ruby]
patronus_ has joined #ruby
atno has joined #ruby
emergion has joined #ruby
mikecmpbll has joined #ruby
avril14th has quit [Ping timeout: 246 seconds]
TIJ has quit [Quit: Konversation terminated!]
patronus has quit [Ping timeout: 246 seconds]
TIJ has joined #ruby
JZTech101 has joined #ruby
emergion has quit [Client Quit]
rickruby has quit [Remote host closed the connection]
gildo has joined #ruby
avril14th has joined #ruby
gnagno__ has joined #ruby
hogeo has joined #ruby
renderful has quit [Remote host closed the connection]
michael_mbp is now known as zz_michael_mbp
DaniG2k has quit [Quit: Leaving.]
gildo has quit [Read error: Operation timed out]
shaunbaker has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
splittingred has joined #ruby
danshultz has joined #ruby
hogeo has quit [Remote host closed the connection]
norm has joined #ruby
realDAB has quit [Quit: realDAB]
fmcgeough has joined #ruby
<norm>
i'm dealing with a segfault (https://gist.github.com/normelton/6032741). i figure it's coming either from ruby itself, or the mysql2 library, which includes a native extension
fernandoaleman has joined #ruby
<norm>
but am not sure how to tell based on the stacktrace
ldnunes has joined #ruby
wmoxam has quit [Ping timeout: 246 seconds]
<norm>
i was expecting to see a reference to mysql2
<norm>
any ideas?
Kruppe has quit [Read error: Operation timed out]
londerson has joined #ruby
blaxter_ has joined #ruby
Nisstyre-laptop has joined #ruby
jonkri has quit [Ping timeout: 246 seconds]
dash_ has quit [Quit: Time to beer :)]
Nisstyre-laptop has quit [Client Quit]
noname001 has quit [Read error: Connection reset by peer]
clintnewsom has joined #ruby
<bnagy>
you snipped the C backtrace?
noname001 has joined #ruby
jibi has joined #ruby
huoxito has joined #ruby
phantummm has quit [Quit: phantummm]
aaronmcadam has quit [Ping timeout: 248 seconds]
realDAB has joined #ruby
jerius has joined #ruby
phantummm has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
phantummm has quit [Client Quit]
aaronmcadam has joined #ruby
jorge has joined #ruby
emergion has joined #ruby
kevinykchan has quit [Quit: Computer has gone to sleep.]
jalcine has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
asteve has joined #ruby
atyz has joined #ruby
tobyo1 has joined #ruby
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
gildo has joined #ruby
<norm>
bnagy: let me see if i didn't grab all of it
rshetty has quit [Quit: Sleeping]
<norm>
mmm those logs are gone
<norm>
oh wait, looking in the wrong place
pr0ggie has joined #ruby
mantas322 has joined #ruby
<mantas322>
Hi guys
tommyvyo has joined #ruby
<mantas322>
I need to create this textfile
<mantas322>
but it needs a certain structure
<mantas322>
right aligned to a column
wallerdev has quit [Quit: wallerdev]
gnagno__ has quit [Read error: Connection reset by peer]
<mantas322>
for example If I need to write 1 it was to be " 1" or 10 " 10"
gnagno__ has joined #ruby
<mantas322>
100 = "100"
<mantas322>
whats a clean way to pad spaces uniformly
<bnagy>
mantas322: welcome to.. The documentation! YAY!
<mantas322>
you again.
<mantas322>
thats your answer for everything.
yshh has joined #ruby
jonkri has joined #ruby
<norm>
mantas322: convert the integer to a string first, then rjust
<bnagy>
mantas322: yeah actually I help everyone that appears not to just be a lazy ass
blueOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
<mantas322>
oooOOOoOOOO.
<mantas322>
tough guy.
<zendeavor>
don't start crying
<mantas322>
yeah bnagy, dont cry
<bnagy>
;.;
csdc has quit [Ping timeout: 264 seconds]
<zendeavor>
you're operating on String objects, so use String methods; shockingly they are well documented and you can ascertain for yourself how to justify your output
gnagno__ has quit [Read error: Connection reset by peer]
pr0ggie has quit [Ping timeout: 240 seconds]
Liothen has quit [Quit: System of a down……]
gnagno__ has joined #ruby
<zendeavor>
or you can come here and test your luck to see how many times someone will post an lmgtfy link before you get the picture.
fernandoaleman has quit [Quit: Leaving.]
angusiguess has joined #ruby
nezumi has joined #ruby
fernandoaleman has joined #ruby
yshh has quit [Ping timeout: 276 seconds]
<mantas322>
so for, no one.
passcod has left #ruby ["Leaving"]
<mantas322>
far*
<zendeavor>
plonk
Neomex has joined #ruby
sailias has joined #ruby
angusigu1ss has quit [Ping timeout: 240 seconds]
<bnagy>
zendeavor: are you 40+ years old?
<zendeavor>
nosir.
<bnagy>
ok. I didn't know people still said that
<zendeavor>
it's the best
<zendeavor>
the sound a name makes when it hits a kill file
<zendeavor>
(we don't have kill files anymore)
<mantas322>
sounds to me like something a pretentious wine connoisseur
<mantas322>
would say
<bnagy>
we do not have killfiles :)
<bnagy>
nor usenet
<bnagy>
nor uucp
* bnagy
weeps
<zendeavor>
stop your blubbering
<bnagy>
well I guess there's still usenet, if you like kiddie porn and movies
<zendeavor>
i've never been.
pranny has quit [Quit: Leaving.]
devoldmx3 has joined #ruby
noop has quit [Ping timeout: 268 seconds]
Neomex has quit [Client Quit]
Neomex has joined #ruby
arya_ has quit [Ping timeout: 260 seconds]
<zendeavor>
i heard it used to be cool before AOL
kofno has quit [Remote host closed the connection]
<bnagy>
yeah, also before the WWW
kofno has joined #ruby
<bnagy>
god I am old :(
tommyvyo has quit [Quit:]
TheBlackMan_ has joined #ruby
devoldmx has quit [Ping timeout: 264 seconds]
kevinykchan has joined #ruby
Fire-Dragon-DoL has joined #ruby
<zendeavor>
it's okay
<zendeavor>
i won't tell you how young i am
<zendeavor>
i identify with the greybeards anyway <3
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
Nanuq has quit [Ping timeout: 245 seconds]
b0oh has joined #ruby
mattsgarrison_ has quit [Remote host closed the connection]
TheBlackMan has quit [Ping timeout: 246 seconds]
TheBlackMan_ is now known as TheBlackMan
karl___ has quit [Ping timeout: 250 seconds]
mattsgarrison_ has joined #ruby
wmoxam has joined #ruby
dhruvasagar has joined #ruby
sayan has joined #ruby
nitish has joined #ruby
Nanuq has joined #ruby
<mantas322>
Thank you norm
sambao21 has quit [Quit: Computer has gone to sleep.]
<mantas322>
you were helpful
<joshu>
is there any difference between doing JSON.dump ({"users" => [{"user" => "test", "status"=>"offline"},{"user"=>"test2", "status"=>"online"}]})
jchysk has quit [Ping timeout: 256 seconds]
<mantas322>
zendeavor, you werent helpful at all.
<joshu>
or this return {"users" => [{"user" => "test", "status"=>"offline"},{"user"=>"test2", "status"=>"online"}]}.to_json
jchysk has joined #ruby
<bnagy>
joshu: this is the kind of thing you can test in irb
gnagno__ has quit [Ping timeout: 240 seconds]
<bnagy>
but hopefully not
<bnagy>
unless the return is important for control flow
asobrasil has joined #ruby
<bnagy>
like if it's in the middle of a method etc
<joshu>
bnagy I should have said they both work, just which is preferred way of doing it
b0oh has quit [Ping timeout: 246 seconds]
randomperson3089 has joined #ruby
<bnagy>
*shrug*
<bnagy>
explicit return when not needed isn't idiomatic
<bnagy>
other than that, either I guess?
<randomperson3089>
Hello. I am not a coder, I just run stuff... Can I make BDB work with Ruby on Windows?
p0wn3d has joined #ruby
<joshu>
ok bnagy thanks
<bnagy>
randomperson3089: not without divine intervention
mantas322 has left #ruby [#ruby]
<randomperson3089>
Damn.
<randomperson3089>
What DB would work best?
<randomperson3089>
I mean, I have ruby program where I can choose
<randomperson3089>
I'd like to choose something that would work on Windows
<randomperson3089>
moment, i'll check.. someone proposed me using tokiocabinet, but no idea how to install it, especially since I don't want to compile anything...
<randomperson3089>
I hate compiling on windows D:
<bnagy>
assuming there's no way at all you could run a postgres DB on a different box and access it over network
<bnagy>
I wouldn't use tokyocabinet
tvw has quit []
<bnagy>
it's deprecated now anyway
gyre007 has joined #ruby
<bnagy>
kyotocabinet is still being developed and it's great, but I don't know about windows impls
wallerdev has joined #ruby
baordog has joined #ruby
jlast has joined #ruby
arya_ has joined #ruby
<mjc_>
postgres runs on windows
<bnagy>
there's a good jruby / java wrapper for it
<bnagy>
(KC)
realDAB has quit [Quit: realDAB]
RubNoob has joined #ruby
viszu has joined #ruby
<randomperson3089>
oh no
<randomperson3089>
those are only two options
<bnagy>
randomperson3089: is it a trivial DB or will it be big?
<randomperson3089>
bdb and tokyocabinet
<randomperson3089>
trivial
<bnagy>
cause there's pstore
<randomperson3089>
it's a small irc bot
<bnagy>
which is in stdlib
noop has joined #ruby
<randomperson3089>
more for fun than serious
tatsuya__ has joined #ruby
gyre007 has quit [Ping timeout: 246 seconds]
<mjc_>
sqlite is pretty good for trivial stuff
tommyvyo has joined #ruby
realDAB has joined #ruby
<randomperson3089>
as I said, I finally found out tc is the only other option D:
kobain has joined #ruby
<bnagy>
uh.. why? but yeah then go pstore
axeman- has quit [Remote host closed the connection]
<rndstr>
gem wants to put it in /usr/lib/ruby/gems/2.0.0/build_info/rake-10.1.0.info but no permission after I entered the password. when I do `sudo gem install rake` it installs it into /root/.gem/ which means rails won't find it when I'm doing `bundle install` as user
NiteRain has quit [Ping timeout: 264 seconds]
<rndstr>
@mjc_ archlinux
blaxter_ is now known as blaxter
senayar has quit [Remote host closed the connection]
<hoelzro>
DaniG2k: for getting ideas, or submitting?
enebo has joined #ruby
<bnagy>
rndstr: if you're doing anything as a user, do it all as the user
<DaniG2k>
hoelzro: for getting
<mjc_>
rndstr: use rvm to install it and you'll be fine
<hoelzro>
heh
<hoelzro>
I've been meaning to create something like that for a long time
<rndstr>
bnagy: I want to but `bundle install` wants to install rake to /usr/lib/ruby/gems...
<hoelzro>
but not just for software
<hoelzro>
DaniG2k: I can give you some ideas if you want =)
<DaniG2k>
a software idea pool
<DaniG2k>
im a shitty programmer but
<DaniG2k>
i'd like to start small
<DaniG2k>
and build something cool eventually
<hoelzro>
you should build such a site =)
D4T has joined #ruby
<bnagy>
rndstr: I can't speak for the insanity of anything related to rails
moshee has joined #ruby
<hoelzro>
honestly, the thing that's been getting in my way the most is the lack of a good name
<DaniG2k>
hoelzro: that would be cool
RubNoob has joined #ruby
theRoUS has joined #ruby
shaunbaker has quit [Remote host closed the connection]
<bnagy>
hoelzro: grindrb
<DaniG2k>
hoelzro: start with something like "Project Z" and then name it whatever when you're done
<gnagno__>
bnagy, I would like my method to be a kernel method
<hoelzro>
grindrb?
<bnagy>
gnagno__: that makes zero sense
<hoelzro>
what's that mean?
<bnagy>
hoelzro: uh.. ok it's not funny if you don't know what grindr is
<hoelzro>
heh
wmoxam has joined #ruby
zz_michael_mbp is now known as michael_mbp
burlyscudd has joined #ruby
MrThePlague has joined #ruby
MrThePlague has joined #ruby
MrThePlague has quit [Changing host]
buzzybron has quit [Ping timeout: 240 seconds]
apeiros has joined #ruby
<bnagy>
ok sleepytime
dash_ has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
DeanH has joined #ruby
mary5030 has joined #ruby
tagrudev has quit [Remote host closed the connection]
tomzx_mac has quit [Read error: Operation timed out]
fernandoaleman has quit [Quit: Leaving.]
jprovazn is now known as jprovazn_afk
pothibo has joined #ruby
akemrir has quit [Quit: WeeChat 0.4.1]
PigDude has quit [Remote host closed the connection]
allaire has joined #ruby
jonkri has quit [Ping timeout: 246 seconds]
dash_ has quit [Quit: Time to beer :)]
denver has joined #ruby
TheBay has joined #ruby
TheBay is now known as Mathias__
noop has quit [Remote host closed the connection]
v0n has quit [Read error: Operation timed out]
workmad3 has quit [Ping timeout: 260 seconds]
denver has quit [Remote host closed the connection]
asteve has quit [Ping timeout: 264 seconds]
Mathias__ is now known as TheBay
dash_ has joined #ruby
ixti has joined #ruby
asteve has joined #ruby
sleetdrop has joined #ruby
sleetdrop has quit [Max SendQ exceeded]
trepidaciousMBR has quit [Read error: Operation timed out]
alex__c2022 has joined #ruby
sleetdrop has joined #ruby
tkuchiki has joined #ruby
dash_ has quit [Client Quit]
ffranz has joined #ruby
blackmesa has joined #ruby
Silent__ has quit [Ping timeout: 256 seconds]
KevinSjoberg has quit [Ping timeout: 240 seconds]
wald0 has quit [Quit: Lost terminal]
BizarreCake has joined #ruby
moshee has quit [Ping timeout: 256 seconds]
denver has joined #ruby
pothibo has quit [Ping timeout: 268 seconds]
realDAB has quit [Quit: realDAB]
pothibo has joined #ruby
realDAB has joined #ruby
KevinSjoberg has joined #ruby
finges has joined #ruby
lkba has joined #ruby
<Godd2>
Is rubygems.org unpingable for anyone else?
michael_mbp is now known as zz_michael_mbp
jibi has quit [Read error: Connection reset by peer]
<robert_>
Godd2: I just pulled it up via http.
<Godd2>
Yea me too, but ping keeps timing out
echevemaster has joined #ruby
echevemaster has quit [Changing host]
echevemaster has joined #ruby
<robert_>
it's their firewall probably.
JZTech101 has quit [Quit: Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC]
<robert_>
Godd2: a company I'm involved with maintaining IT support for also filters ICMP, so yeah.
<zendeavor>
dropping icmp
<robert_>
indeed.
<robert_>
it's not uncommon to do that.
<Godd2>
ah ok
<zendeavor>
no ping ddos attacks!
<robert_>
indeed
<zendeavor>
indeed.
JZTech101 has joined #ruby
<Godd2>
But I'll only send 32 bytes of data, I promise!
<Godd2>
;)
gnagno__ has quit [Ping timeout: 240 seconds]
<robert_>
so I'm looking to break DATA up into named sections like '@@ section_name' sort of how tilt does. anyone have any good methods for doing that? :p
<Lewix>
if ( foo | blah | gah ) ; end . Am I right that gah is never executed if foo or blah is true
Assurbanipal has quit [Quit: Leaving]
ExxKA has joined #ruby
deanclkclk has joined #ruby
Evixion has quit [Read error: Connection reset by peer]
lethjakm1 is now known as lethjakman
<deanclkclk>
folks..need some help
dash_ has joined #ruby
<deanclkclk>
setting up rubyonrails on my machine
<deanclkclk>
I just got to the point of installing rvm
<deanclkclk>
but, could I tell rvm to install the latest version of full ruby?
<deanclkclk>
with dev?
<deanclkclk>
running on ubuntu
lindenle has joined #ruby
bigoldrock has joined #ruby
<Lewix>
I have a similar expression in rails but i can't seem to figure why 'gah' is executed and return an error, even if there is an error it shouldn't parse it . right?
shouya1 has joined #ruby
<Lewix>
deanclkclk: rvm install
<deanclkclk>
and it will install the latest version of ruby?
<deanclkclk>
full?
ckrailo has quit [Read error: Connection reset by peer]
<Lewix>
deanclkclk: rvm install 2.0
<deanclkclk>
possible to check cache of what the latest version is?
<deanclkclk>
@ Lewix
shouya has quit [Ping timeout: 246 seconds]
<canton7>
Lewix, is that | or || ?
ckrailo has joined #ruby
<Lewix>
canton7: ||
Evixion has joined #ruby
<deanclkclk>
meaning probably checking the rvm cache or repository or something
<deanclkclk>
is that possible/
<Lewix>
deanclkclk: rvm list
burlyscudd has joined #ruby
wsterling has joined #ruby
<Lewix>
deanclkclk: you'll have the list of the current ruby versions installed
<Lewix>
I have a similar expression in rails but i can't seem to figure why 'gah' is executed and return an error, even if there is an error it shouldn't parse it . right?
<Lewix>
and in my expression it's not a syntax error
burlyscudd has quit [Read error: Connection reset by peer]
rhys has joined #ruby
<waxjar>
the "thingy" on the left hand side evaluates to nil or false then. can you show some code?
<Lewix>
if (current_user.nil? || !current_user.admin || current_user.ordered(@book))
dankest has joined #ruby
<Lewix>
so current_user.ordered is executed
<Lewix>
when it shouldn't
<krz>
whats the difference between ruby 2.0.0p0 and 2.0.0p195?
<waxjar>
bugfixes, probably krz
<zendeavor>
patchlevel
<terrellt>
Lewix: Nooo way.
<Lewix>
waxjar: it returns an sql error
<krz>
waxjar: so 195 is updated, compare to p0 waxjar ?
<krz>
compared*
<zendeavor>
it's the patchlevel
RichardBaker has quit [Quit: RichardBaker]
<krz>
well which is more updated?
<krz>
195 i would assume?
<waxjar>
Lewix: both current_user.nil? and !current_user.admin return false or nil then
cupakromer has joined #ruby
<zendeavor>
krz: what do you think, patchlevel 0 or patchlevel 195
michaeldeol has joined #ruby
<krz>
zendeavor: 0?
<Lewix>
waxjar: I checked. they're both true but ill check again for the hundredth time
* zendeavor
brain hemorrhage
g0bl1n has joined #ruby
<krz>
0 looks cooler
sayan has quit [Ping timeout: 260 seconds]
<zendeavor>
use it then
io_syl_ has quit [Quit: Computer has gone to sleep.]
<krz>
nah ill wait for 1
<krz>
i changed my mind. 1 is cooler
byprdct has joined #ruby
michaeldeol has quit [Remote host closed the connection]
Appineer has joined #ruby
Appineer has left #ruby [#ruby]
<rndstr>
how do I install a gem systemwide?
burlyscudd has joined #ruby
justsee has quit [Ping timeout: 240 seconds]
tjbiddle has joined #ruby
tommyvyo has quit [Quit:]
moshee has joined #ruby
gsorbier has joined #ruby
madison_ has joined #ruby
<heftig>
rndstr: what provides your ruby?
<rndstr>
hmm, i just decided to try rvm
<rndstr>
but pacman @archlinux
Spami has joined #ruby
Spami has joined #ruby
<heftig>
rndstr: sudo gem --no-user-install
Banistertab has quit [Ping timeout: 264 seconds]
ssvo has joined #ruby
michaeldeol has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
<robert_>
For some reason, I'm unable to parse @@ header from my DATA section.. anyone have any ideas? :/ http://codepad.org/onEsvn1F
_veer has joined #ruby
awarner_ has joined #ruby
grillermo has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
workmad3 has joined #ruby
asteve has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hakunin has joined #ruby
Vivekananda has joined #ruby
awarner has quit [Ping timeout: 248 seconds]
DrCode has quit [Ping timeout: 240 seconds]
asteve has joined #ruby
asteve has joined #ruby
asteve has quit [Changing host]
ukd1 has joined #ruby
jibi has joined #ruby
alex__c2022 has quit [Quit: alex__c2022]
Ry0_ has joined #ruby
sleetdrop has joined #ruby
Fire-Dragon-DoL has joined #ruby
realDAB has quit [Quit: realDAB]
peret has quit [Ping timeout: 264 seconds]
interactionjaxsn has joined #ruby
<iliketurtles>
bnagy: i ended up going with the cosine similarity solution btw
workmad3 has quit [Ping timeout: 246 seconds]
apt-get_install has quit [Read error: Connection reset by peer]
thenj has joined #ruby
viszu1 has quit [Quit: Leaving.]
vikhyat has quit [Remote host closed the connection]
brunoro has joined #ruby
apt-get_install has joined #ruby
asteve has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<thenj>
what is a good way to loop through a list of ip addresses, ssh command, and evaluate the result of the command?
<thenj>
should i use something like Net::SSH ?
brennanMKE has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
digitalcake has quit [Quit: Leaving.]
dsabanin has quit [Quit: Leaving...]
mocfive_ has joined #ruby
DrCode has joined #ruby
erry has quit [Read error: Connection reset by peer]
ukd1_ has joined #ruby
Spami has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
mocfive_ has quit [Client Quit]
erry_ has joined #ruby
fernandoaleman has joined #ruby
_reset has joined #ruby
reset has quit [Read error: Connection reset by peer]
mocfive has joined #ruby
smathieu has quit [Ping timeout: 276 seconds]
jorge__ has joined #ruby
vikhyat has joined #ruby
wmoxam has quit [Quit: Lost terminal]
cupakromer has left #ruby [#ruby]
ukd1 has quit [Ping timeout: 268 seconds]
erry_ is now known as erry
ukd1_ has quit [Ping timeout: 276 seconds]
geoffw8_ has joined #ruby
louism2_ has quit [Quit: This computer has gone to sleep]
yacks has quit [Quit: Leaving]
corehook has joined #ruby
jsatk has joined #ruby
louism2__ has joined #ruby
wmoxam has joined #ruby
jorge__ has quit [Ping timeout: 276 seconds]
dsabanin has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
<atmosx>
anyone knows how to filter by date range in sequel?
alvaro_o has joined #ruby
nitish has quit [Remote host closed the connection]
RichardBaker has joined #ruby
Fire-Dragon-DoL has quit [Quit: Leaving.]
gildo has quit [Ping timeout: 240 seconds]
carloslopes has joined #ruby
corehook has quit [Ping timeout: 246 seconds]
petru has quit [Ping timeout: 264 seconds]
yacks has joined #ruby
sleetdrop has quit [Quit: Computer has gone to sleep.]
<thenj>
hmm. its quiet in here
RichardBaker has quit [Ping timeout: 240 seconds]
brunoro has quit [Ping timeout: 268 seconds]
maxmanders has joined #ruby
dhruvasagar has joined #ruby
swordsmanz has joined #ruby
romdi` has joined #ruby
chriskk has joined #ruby
atno has joined #ruby
mantle has joined #ruby
jonahR has joined #ruby
echevemaster has quit [Quit: Leaving]
wald0 has joined #ruby
<wald0>
im trying to decide to use (to learn first) ruby or not for dev some apps, but i would like to know what happens when some lib or ruby updates to a newer version, about maintaining, is there a way to know that my app stills fully compatible or that i need to update/adapt my code ? is there any facility for this?
<Kelet>
wald0, It depends what they change. Usually some effort is made to retain compatibility. Sometimes there are breakages.
ephemerian has left #ruby [#ruby]
<Kelet>
Ruby generally doesn't have too many breakages but as for libraries, it depends on the person or group developing them.
<tobin>
Can someone advise me the best way to write a function. I'm writing a helper function, in python i'd do something like def helper(name, value = None).
cj3kim has joined #ruby
lebek has joined #ruby
<tobin>
that doesn't seem to be common in ruby, trying to find the best way, or what to google for
icecandy has quit [Remote host closed the connection]
colonolGron has joined #ruby
<Kelet>
tobin, I'm not sure if I understand but why don't you just nest the function?
<Eiam>
yeah..
<tobin>
Is it better to do something like value || nil within the function, rather than defining the argument in def()
<Eiam>
i just write the function inside the function
<tobin>
Kelet: because I'm new to ruby, and used to python :D
<Eiam>
oh
<Eiam>
tobin: I define default arguments in the method def ..
<Kelet>
tobin, I see functions in functions a fair bit, not sure if it's the most common idiom for helper functions in Ruby but it's what I use.
<tobin>
I'm not talking about nesting, just basically writing a helper function. IE to manage a service. I check the value of the keyword arguments.
Ry0_ has quit [Remote host closed the connection]
rodacato has quit [Remote host closed the connection]
athaeryn has joined #ruby
Nilium has joined #ruby
athaeryn has left #ruby [#ruby]
Hobogrammer has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
ner0x has quit [Ping timeout: 260 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
<thenj>
where are there 2 ruby channels? #ruby and #ruby-lang ?
<thenj>
#ruby-lang is the official channel. why does this one exist:
niklasb has quit [Read error: Operation timed out]
devoldmx3 has joined #ruby
clintnewsom_ has joined #ruby
clintnewsom has quit [Ping timeout: 268 seconds]
clintnewsom_ is now known as clintnewsom
ner0x has joined #ruby
carloslopes has quit [Remote host closed the connection]
Trudko has joined #ruby
devoldmx has quit [Ping timeout: 240 seconds]
<atmosx>
thenj: so you can ask this question and get no decent answer.
<atmosx>
thenj: it's a hoax
<Trudko>
guys I have decimal number and i want to remove decimal party only if there is zero at the end so 4.0 will become 4 but 4.5 will stay the same
<thenj>
atmosx: thats crazy!
<wald0>
Kelet: basically, is there a way to know that my code can have a breakage than waiting for a possible report from an user ?
BizarreCake has quit [Ping timeout: 246 seconds]
<atmosx>
Trudko: to_i will make the float integer
<atmosx>
an if/else/unless of ?: will do the rest
<Kelet>
wald0, First and foremost, before you upgrade a library or Ruby version, check the changelog and they will usually list breakages if there are any, very boldly
carloslopes has joined #ruby
<matled>
Trudko: use "%f" and strip of the trailing /[.]?0+\z/
<Kelet>
wald0, But there are many test-writing frameworks, and a good set of tests should catch that type of stuff.
<thenj>
whats a good way to evaluate the output of a command like 'ssh hostname df | grep /partition' ?
<Trudko>
atmosx: to_i will make 4.1 -> 4 which is something I dont want
twoism has quit [Remote host closed the connection]
<matled>
thenj: that would probably be the easiest to detect all kind of low level errors. if you don't care that much using "ssh host df" could be fine too..
Kelet has quit [Read error: Connection reset by peer]
Kelet has joined #ruby
huoxito has quit [Quit: Leaving]
xardas has quit [Read error: Connection reset by peer]
<Nilium>
>> [1,2,3,4].repeated_permutation(2).to_a.map { |a, b| a + b }.uniq!
<mantas322>
I'm seeing if I can use .pop or .shift to improve this
<Nilium>
Actually, why do I have to_a in there..
<Nilium>
Oh right, IRB testing.
<Nilium>
Anyway, Enumerable and Array are a hell of a drug.
clintnewsom has quit [Client Quit]
<mantas322>
holy cow
<mantas322>
puts [1,2,3].repeated_permutation(2).to_a.map { |a, b| a + b }.uniq!
cj3kim has quit [Remote host closed the connection]
<mantas322>
thats genius Nilium
<Nilium>
You should remove the to_a from that.
<mantas322>
thank you
<Nilium>
It's useless.
smathieu has quit [Remote host closed the connection]
<mantas322>
wow
iliketurtles has quit [Quit: zzzzz…..]
<mantas322>
1 more mini question
clintnewsom has joined #ruby
<Nilium>
Just keep in mind that for really large arrays, that might be somewhat expensive. That said, unless you need to do it many times in a 16ms window where you've got a lot of other expensive things to do, you're probably fine.
<robert_>
For some reason, I'm unable to parse @@ header from my DATA section.. anyone have any ideas? :/ http://codepad.org/onEsvn1F
<mantas322>
can I chain in a max limit into this [1,2,3].repeated_permutation(2).map { |a, b| a + b }.uniq!
TheNotary has joined #ruby
<mantas322>
<6
vikhyat has quit [Remote host closed the connection]
* Eiam
looks up repeated_permutation
clintnewsom has quit [Client Quit]
<Nilium>
Array#repeated_permutation, if that helps
<mantas322>
this is great, thank you.
<Nilium>
As for the clamping thing, you could just select for it.
<Eiam>
Nilium: thats pretty sick =)
g0bl1n has quit [Ping timeout: 240 seconds]
<Nilium>
You kind of have to wonder how often a repeated permutation came up for someone to add it to Array
iliketurtles has joined #ruby
n_blownapart has joined #ruby
g0bl1n has joined #ruby
intuxicated has quit [Quit: Leaving]
wu_lmao has quit [Ping timeout: 268 seconds]
cha1tanya has quit [Quit: cha1tanya]
TIJ has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
michael_mbp is now known as zz_michael_mbp
brunoro has joined #ruby
zz_michael_mbp is now known as michael_mbp
huoxito has joined #ruby
arya_ has quit []
LucidDreamZzZz has quit [Remote host closed the connection]
<wald0>
im reading the pick's axe book, but i dont like it so much, it lacks some examples and better ways to explain pieces of code, is there any suggested better one ?
<wald0>
book, i mean
gustavn has joined #ruby
arya_ has joined #ruby
_reset has quit [Quit: Leaving...]
jimi_ has joined #ruby
LucidDreamZzZz has joined #ruby
<n_blownapart>
I really liked the Well Grounder Rubyist wald0 (david black)
<Nilium>
The only book I've read is why's, and that was more out of curiosity after already learning Ruby
<n_blownapart>
Well - *Grounded
<Nilium>
Granted I'm not sure what skill level pick's axe is for.
sunsh1ne is now known as invsblduck
invsblduck has quit [Changing host]
invsblduck has joined #ruby
michaeldeol has quit [Remote host closed the connection]
<n_blownapart>
Nilium: wald0 try well grounded rubyist 1.9.1
sqd_ has quit [Quit: sqd_]
Tricon has joined #ruby
<Nilium>
Is it aimed at people using Rails?
<mantas322>
okay, thanks again Nilium. bye
brunoro has quit [Ping timeout: 246 seconds]
mantas322 has left #ruby [#ruby]
g0bl1n has quit [Ping timeout: 240 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
<goleldar>
what do you guys think of scala
<sam113101_>
what do YOU think of it?
<goleldar>
i dont know too much about it other than it is a supposedly employs the best of ruby and java and twitter seems to be embracing it
<goleldar>
indeed doesn't show many results for scala so i am guessing it is still gaining traction
devoldmx has joined #ruby
louism2__ has quit [Quit: Leaving]
bondar has joined #ruby
bondar has quit [Excess Flood]
bondar has joined #ruby
bondar has quit [Excess Flood]
<Nilium>
My policy is it's JVM, so screw it.
<n_blownapart>
Nilium: Manning Publishers publish it: they also have a book out on rails 4 by Yehuda Katz that is in digital format only but was highly recommended by sanFrancisco meetup group for rails.
<Nilium>
← Not a rails person.
sambao21 has quit [Quit: Computer has gone to sleep.]
devoldmx3 has quit [Ping timeout: 240 seconds]
ColKurtz has joined #ruby
<Nilium>
My only interest in Rails is whether it's consumed Ruby's image to the point that people can't disassociate the two.
<n_blownapart>
sorry Nilium thought you were asking
bondar has joined #ruby
michaeldeol has joined #ruby
<Nilium>
I don't think it has, yet.
bondar has quit [Excess Flood]
bondar has joined #ruby
bondar has quit [Excess Flood]
<Eiam>
Nilium: hey I don't use rails either =)
<Eiam>
but rails is what brought me to ruby first soo..
bondar has joined #ruby
bondar has quit [Client Quit]
* Nilium
high-fives Eiam
<n_blownapart>
Nilium: I'm beginning programming I liked the manning book WGR by david black wald0 ^^
<Eiam>
I have one app still being served off rails but its vestigial, I use sinatra/padrino now
<Nilium>
OpenGL brought me to years ago
radic_ has quit [Quit: Verlassend]
<Nilium>
*to Ruby
<Nilium>
And lately I've been trying to make Ruby and OpenGL play nice together again.
radic has joined #ruby
Neomex has joined #ruby
ewag has quit [Remote host closed the connection]
<Eiam>
rails is "too much" for me. that you can have some tutorial video for "setup a blog in 5 minutes using rails! with auth and users and all this cool stuff!" should indicate just how MUCH of a bag you get when you use rails
<Eiam>
for some people thats great and I can totally see the advantages there.
<Nilium>
I think it's probably useful but I just have no interest in web dev stuff.
mocfive has quit [Remote host closed the connection]
Neomex has quit [Client Quit]
<Nilium>
It's quite possibly the most boring subject I can think of.
<Nilium>
For me, that is, it's perfectly fine if other people love it.
<Eiam>
Nilium: yeah.. I too hate web dev, but I'm forced to do it so, oh well
<Eiam>
if I could write ruby in the browser, I would
<Nilium>
Though I will still take constant jabs at web developers for their silliness.
<thenj>
reparations
<thenj>
for slavery
<Nilium>
It'd be nice if JS was replaced with Ruby.
<Nilium>
Would probably be slower and such, but nice.
<C0deMaver1ck>
try Dart maybe?
<C0deMaver1ck>
still JavaScriptish
<Eiam>
because it has not had rooms full of PhD's micro optimizing the shit out of it
<C0deMaver1ck>
but nicer
<mjc_>
Nilium: decaf
<Nilium>
Though if you got Google behind optimizing the hell out of Ruby, performance would probably improve a hell of a lot
<ChristianS>
dart is ugly imho, hardly better than js (if at all)
<C0deMaver1ck>
now that's cool
<Nilium>
I could dig this for writing tools
<C0deMaver1ck>
somebody needs to spin off a fork of Chromium with decaf as the engine
<mjc_>
it's a heavily modified browser and only works on OSX
<Nilium>
I wonder how in sync it is with Webkit
bondar has joined #ruby
<Tricon>
I like Go as well.
bondar has quit [Excess Flood]
timonv has joined #ruby
kevinykchan has quit [Quit: Computer has gone to sleep.]
teddyp1cker has quit [Read error: Connection reset by peer]
<Tricon>
PNaCL is where I hope everything heads.
<ChristianS>
go is badly designed (no exceptions is worst), google sucks at language design
teddyp1cker has joined #ruby
<C0deMaver1ck>
no exceptions?
<C0deMaver1ck>
wtf
<Tricon>
C/C++/Obj-C/Ruby are my langs of choice these days, though.
timonv has quit [Read error: No route to host]
<Tricon>
I wish JS would die a fiery death.
<ChristianS>
C0deMaver1ck: makes for a realy c-ish workflow
sayan has joined #ruby
* Nilium
high-fives Tricon for having his same favorite languages.
* Tricon
high-fives Nilium back: BROGRAMMERS!
* Nilium
washes his hand of Tricon's sin.
<Tricon>
Haha.
<Nilium>
So, yeah, nevermind, burn the witch.
<Tricon>
You traitor!
<C0deMaver1ck>
I read a tweet said something along the lines of "Need a totem, to determine what is real and what is a dream. I'm so deep in nested callbacks"
<wald0>
n_blownapart: you think that this "well grounded" is a better option than the pick's axe?
<Nilium>
I worry that some people do actually take the brogrammer thing seriously.
<Nilium>
Because some people do.
<Tricon>
C0deMaver1ck: That is great.
<Nilium>
And it scares the hell out of me.
bondar has joined #ruby
sambao21 has joined #ruby
<Tricon>
Nilium: I have never met an actual brogrammer.
<Nilium>
At any rate, it's fun that I can now use Ruby for game dev, sort of.
<Nilium>
Again.
<n_blownapart>
to begin ruby yes but I'm a beginner to programming. just get two or three books. david black writes *very* well
<Nilium>
Worked eons ago in 1.8.7 and then sort of died in 1.9.x and now I gots it working again so coolbeans.
<Nilium>
I should eat something.
<n_blownapart>
wald0: ^^
<RubyPanther>
In the case of Ruby, we have multiple (unrestricted, even!) return types, and yet we also have exceptions. So we're free to abuse both styles.
flaccid has quit [Ping timeout: 256 seconds]
<C0deMaver1ck>
we
<Nilium>
I wonder if decaf works with gems at all
<C0deMaver1ck>
we're also free to monkey patch too :p
michael_mbp is now known as zz_michael_mbp
bondar has joined #ruby
<RubyPanther>
yeah, lots of people hire monkeys to eat the exception, and return an error object instead.
bondar has quit [Excess Flood]
* C0deMaver1ck
patches Array.length
burz has joined #ruby
mikewintermute has joined #ruby
<Tricon>
Anyone that begins an attack on a language because of the patterns _available_ has already missed the point: It's how you use them that matters. It is not evil because they do or do not exist.
<C0deMaver1ck>
except PHP
wolcanus has quit [Remote host closed the connection]
<Nilium>
Or Perl.
<C0deMaver1ck>
always hate PHP based on the patterns
<Nilium>
Always hate Perl for barewords.
jeffreylevesque has joined #ruby
<Tricon>
PHP is poorly designed, that's true; but it's also evil because of the community.
<Nilium>
Even though you can do barewords in Ruby.
<Nilium>
Just.. not without a lot of evil.
<C0deMaver1ck>
the community is mostly blind to it's own evil though
<Nilium>
Or a little evil.
<RubyPanther>
And if catching all exceptions and passing error objects to the front end instead is sooooo good, as nearly all Ruby code does that is considered quality... it makes me wonder if we love exceptions as much as we claim to, or if they are just part of our unix heritage, one of our legacy patterns
<C0deMaver1ck>
I got into programming by learning PHP when I was 15
<C0deMaver1ck>
when I figured out it was crappy, I moved on
<Kelet>
Nilium, What do you use for game dev?
<Nilium>
Kelet: Primarily C++.
<C0deMaver1ck>
rubygame gem maybe?
<RubyPanther>
it seems go actually skips ahead and forces doing things in a way that is actually quite close to what Rubyists end up with, even if we have exceptions under the hood
samuel02 has joined #ruby
<Nilium>
For Ruby game dev stuff, I use opengl-core, snow-math, and glfw3.
<C0deMaver1ck>
ouu fun stuff
<Nilium>
All of which I wrote. Because I can.
ntus1017 has quit [Remote host closed the connection]
S0da has quit [Ping timeout: 248 seconds]
<Nilium>
Footnote on GLFW3: I wrote the bindings, not GLFW 3 itself.
<Kelet>
It's too bad there's really no high-level framework like pygame for ruby that can work on 2.0.0/is regularly updated AFAIK
<Tricon>
That's rad.
bondar has joined #ruby
bondar has quit [Excess Flood]
<Tricon>
Honestly, I don't want a game in a language that does not allow me to manage memory.
<wald0>
Nilium: do you know any exmaple of ruby game ? i would like to see how it plays a game made on ruby
<Nilium>
Tricon: Incidentally, I also wrote a gem that lets you manage memory.
clintnewsom has joined #ruby
<Nilium>
Because I'm horribly evil.
<Tricon>
I would love it if I could disable Ruby's GC and do mallocs (YES, I know this is a huge oversimplification and would require MAJOR changes and different idioms).
<Nilium>
Now that would be harder to do.
<Tricon>
Yes.
<C0deMaver1ck>
Nilium: so you're writing C with Ruby syntax? :p
<Nilium>
You could probably implement it using reference counting, though.
<C0deMaver1ck>
managing memory and everything else
<Nilium>
C0deMaver1ck: I only use the memory stuff for C interop, really.
<RubyPanther>
Tricon: That is what the C API is for, and yes, you can manage your own memory
<Kelet>
It's not Ruby, but you can do mallocs and get extremely fast performance with http://crystal-lang.org/ which is almost Ruby (although not exactly in stable yet)
whowantstolivefo has quit [Quit: quit]
<Kelet>
Seems interesting though
<RubyPanther>
You can also disable GC but that is almost always the wrong thing to do
<Tricon>
I love that all of these languages are popping up. I'm all about embracing the best tool for the job.
<Tricon>
RubyPanther: Yeah, I know you can change the GC time and even turn it off.
reset has joined #ruby
<Nilium>
In general, GC and such isn't really going to be the bottleneck for Ruby performance
<mjc_>
depends on how much free RAM you have
<Tricon>
mjc_: Exactly.
<RubyPanther>
It is very rare that the language used has anything to do with what the "best tool" for a job is, except where "best" includes personal fluency
<Tricon>
But Nilium's right in that it isn't the _core_ problem.
<Nilium>
Math in Ruby, for example, is enormously slow.
<Tricon>
RubyPanther: I agree with that sentiment as well; though I wouldn't use the same language for everything, even if I were completely fluent in it.
<RubyPanther>
Math in Ruby is not slow.
<Nilium>
Compared to C, that is.
ehaliewicz has joined #ruby
wolcanus has joined #ruby
<wald0>
is there any "reference of ruby" that covers the language, syntax, etc... but without going deep in a manual of hundreds of pages ? something summarized in let's say 10-20 pages
<RubyPanther>
I made a gem that wraps IBM's implementation of IEEE dec_number, and it is somewhat slower than using Ruby's BigDecimal. And cut all the corners I could.
<Nilium>
RubyPanther: Multiplying 4x4 matrices in Ruby is about 7x slower than multiplying them in C for me. That's significant enough for me.
<Nilium>
Granted, I'm using floats, not BigDecimal and such.
<RubyPanther>
wald0: yeah, the "pickaxe" book does that first, and goes into detail in later chapters.
awarner_ has joined #ruby
<wald0>
RubyPanther: i already readed that "ruby.new" chapter, but it looked a bit basic to me
<RubyPanther>
multiplying matrices in a high level language layer is silly. IMO the "Ruby way" to do that is in C with a Ruby interface.
<Nilium>
Which is what I did. Because doing it in Ruby is very slow.
<RubyPanther>
Right, so doing it in Ruby is the _same_speed_ as C.
<Tricon>
...
BRMatt has quit [Ping timeout: 268 seconds]
<RubyPanther>
Just like, most of Ruby is... C.
AndChat| has quit [Ping timeout: 246 seconds]
Squarepy has quit [Quit: Leaving]
<Nilium>
I think you're missing the point of what I'm saying there. I'm not saying you can't do it fast while still using Ruby, because you can obviously drop down to C.
<Nilium>
The point is that a pure ruby implementation of a 4x4 matrix multiplication is slow.
<RubyPanther>
You're missing that I'm saying that using Ruby via the C API _is_still_Ruby_
<Nilium>
No, I get that, but you're arguing something away from the point
<RubyPanther>
half the gems I install are written in C, they're certainly Ruby gems, not C libs.
baroquebobcat has quit [Quit: baroquebobcat]
chriskk has quit [Remote host closed the connection]
<RubyPanther>
It is tight loops and object creation that Ruby is slow at, not math. Most of the math is _already_ written in C. However slow Ruby is at the math, blame C.
<Nilium>
My guess is that the performance of math in ruby is mostly due to function calls and such.
maxfilipovich has quit [Ping timeout: 260 seconds]
<Nilium>
That said, I've not looked at MRI's source, so I can't say with any certainty what exactly the performance issue is there.
n_blownapart has quit [Remote host closed the connection]
S0da has joined #ruby
<RubyPanther>
But Ruby _isn't_ slow at math! You describe tight loops with lots of temp values, the math can be instant and the total operation can still be slow.
jorge__ has joined #ruby
MrPoT4tO has quit [Remote host closed the connection]
devoldmx has quit [Read error: Connection reset by peer]
havenwood has quit [Remote host closed the connection]
<Nilium>
Ok, Ruby isn't slow at math, but the way the primitive types are implemented leads to slow math. Would that be more accurate for you?
havenwood has joined #ruby
finges has quit [Quit: WeeChat 0.4.1]
<wald0>
how good is the book "ruby best practices" ?
devoldmx has joined #ruby
finges has joined #ruby
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RubyPanther>
No, because in the end we don't have slow math. Nothing leads to it because it is not the case. We do have slow object creation and a lot of error checking.
rodacato has joined #ruby
<Nilium>
Ok, so let's say you do float * float in Ruby. Is that the same speed as float * float in C?
<Nilium>
If you say yes, you're wrong.
jorge__ has quit [Ping timeout: 256 seconds]
dsabanin has quit [Quit: Leaving...]
<Nilium>
And let's not get hung up on the "well it's implemented in C" thing 'cause I think that's missing the point.
rodacato has quit [Remote host closed the connection]
<Nilium>
If f * f is slow because of object creation and so on, then Ruby math is slow. That's my point.
havenwood has quit [Read error: Connection reset by peer]
halogenandtoast has joined #ruby
<halogenandtoast>
So probably an odd question, but what's something someone would like a book written about in the domain of ruby that doesn't currently exist?
<Nilium>
If you want to argue that the issue isn't math is slow but that the things math leads to is slow, then I think we both agree on where the performance goes and only disagree on whether it means math is slow
<RubyPanther>
No, if you have a bottleneck in object creation and you're blaming slow math, that is just you making a mistake and blaming the wrong thing.
<Nilium>
I'm not blaming slow math, I'm saying math is slow because X.
vlad_starkov has joined #ruby
<RubyPanther>
It is like saying that Ruby is slow at controlling rockets, based on writing a rocket control program in Ruby and having a bottleneck in object creation.
<Nilium>
I think we're just misunderstanding each other here.
<interactionjaxsn>
halogenandtoast: writing dsl's or is there a book already for that?
dash_ has joined #ruby
sqd_ has joined #ruby
seich- has quit [Ping timeout: 240 seconds]
cj3kim has joined #ruby
<halogenandtoast>
interactionjaxsn: probably metaprogramming ruby covers a bit of that.
TheNotary has quit [Ping timeout: 246 seconds]
bradhe has joined #ruby
<halogenandtoast>
But it might be worth exploring further.
<halogenandtoast>
Although I once gave a lightning talk that using metaprogramming in ruby does not mean you've written a dsl
apeiros has quit [Remote host closed the connection]
tonini has quit [Remote host closed the connection]
tonini has joined #ruby
jsteiner has left #ruby [#ruby]
sailias has quit [Quit: Leaving.]
S0da has quit [Remote host closed the connection]
<RubyPanther>
all the DSLs that are clearly DSLs and are without dispute are the external ones... the internal ones are just a subset of API, and are DSLs only if people call them that
Davey has joined #ruby
reset has quit [Quit: Leaving...]
thibauts has quit [Ping timeout: 248 seconds]
axeman- has quit [Remote host closed the connection]
<halogenandtoast>
RubyPanther: Here's a talk I did along time ago
<RubyPanther>
Uncle Bob spends 2 minutes in the middle distracted playing with the laser pointers... if he didn't have interesting stuff to say his talk would suck instead of being great lol
danshultz has quit [Remote host closed the connection]
locriani has quit [Ping timeout: 240 seconds]
wmoxam has quit [Quit: leaving]
p0wn3d has quit [Remote host closed the connection]
reset has joined #ruby
ukd1 has quit [Remote host closed the connection]
ukd1 has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
cantonic has joined #ruby
dsabanin has quit [Ping timeout: 268 seconds]
paskotyy has joined #ruby
baroquebobcat has joined #ruby
baroquebobcat has quit [Client Quit]
viszu has joined #ruby
sayan has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
TheBay has joined #ruby
interactionjaxsn has joined #ruby
TheBay is now known as Mathias__
krisfremen-home has quit [Read error: Connection reset by peer]
sambao21 has joined #ruby
ldnunes has quit [Quit: Leaving]
krz has joined #ruby
interactionjaxsn has quit [Ping timeout: 240 seconds]
mikewintermute has quit [Quit: mikewintermute]
<sn0wb1rdz>
Is it possible get live code update inside a IRB session?
digitalcake has joined #ruby
<mjc_>
sn0wb1rdz: pry can do that, not sure about irb
<sn0wb1rdz>
mjc_ I'll give that a shot
jp- has quit [Quit: OK, I believe you… but my tommy gun don't]
jonahR has quit [Quit: jonahR]
Kar- has quit [Remote host closed the connection]
BRMatt has joined #ruby
<mjc_>
sn0wb1rdz: pry also has a ton of other great features, highly recommended
krisfremen-home has joined #ruby
<sn0wb1rdz>
mjc_ I use IRB on a regular basis. If pry has more features, I think it is time to switch
burlyscudd has joined #ruby
alem0lars has quit [Quit: Leaving]
RORgasm_ has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
RORgasm has joined #ruby
<RubyPanther>
halogenandtoast: love it! lol
<halogenandtoast>
RubyPanther: ha thanks.
dsabanin has joined #ruby
<londerson>
Hello guys i need know how i can create an Rack app, without config.ru file
burlyscudd has quit [Client Quit]
<londerson>
any idea?
BlakeRG has joined #ruby
gustavn has quit [Read error: Connection reset by peer]
mocfive_ has joined #ruby
xcv has joined #ruby
morf_ has joined #ruby
cads has joined #ruby
postmodern has joined #ruby
Nisstyre has joined #ruby
sayan has quit [Read error: Connection reset by peer]
<mjc_>
londerson: why would you need that?
blueOxigen has joined #ruby
Columcille has quit [Ping timeout: 245 seconds]
<mjc_>
londerson: don't private message me, people here might benefit
<londerson>
ok
<londerson>
and i see another codes, and frameworks, the guys don use config.ru in your projects
lebek has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
teddyp1cker has quit [Remote host closed the connection]
asobrasil has left #ruby [#ruby]
<mjc_>
that doesn't sound like a reason why you'd need that, though
<londerson>
he use something like Rack::Request and Rack::Response
<londerson>
well guys for knowledge only
Davey has quit [Quit: Computer has gone to sleep.]
hammond has quit [Read error: Operation timed out]
Villadelfia has quit [Ping timeout: 240 seconds]
hammond has joined #ruby
`p has joined #ruby
<londerson>
tanx
Squarepy has joined #ruby
kirun has quit [Quit: Client exiting]
maxmanders has joined #ruby
trepidaciousMBR has quit [Quit: trepidaciousMBR]
krz has quit [Quit: krz]
Dekade has joined #ruby
cpruitt has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
jorge__ has quit [Ping timeout: 256 seconds]
Xeago has joined #ruby
beingjohnm has joined #ruby
ravster has joined #ruby
Villadelfia has joined #ruby
grainol has quit [Ping timeout: 248 seconds]
blueOxigen has joined #ruby
Dekade has quit [Read error: Connection reset by peer]
kofno has quit [Remote host closed the connection]
zacts has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
justsee has joined #ruby
justsee has joined #ruby
justsee has quit [Changing host]
cj3kim has quit [Read error: Connection reset by peer]
mikewintermute has joined #ruby
cj3kim has joined #ruby
Meatant has joined #ruby
bluOxigen has quit [Ping timeout: 276 seconds]
locriani has joined #ruby
jerius has quit [Quit: jerius]
bluOxigen has joined #ruby
digitalcake has quit [Quit: Leaving.]
digitalcake has joined #ruby
BillCriswell has quit [Remote host closed the connection]
mocfive_ has quit [Remote host closed the connection]
saarinen has joined #ruby
Ripp__ has quit [Quit: This computer has gone to sleep]
sepp2k has quit [Quit: Leaving.]
blueOxigen has quit [Ping timeout: 276 seconds]
TheNotary has quit [Quit: Leaving]
atyz has quit [Quit: Leaving...]
dsabanin has quit [Quit: Leaving...]
tonini has quit [Remote host closed the connection]
iliketurtles has quit [Quit: zzzzz…..]
skaczor has quit [Ping timeout: 245 seconds]
<beingjohnm>
anybody have any experience with the Asana gem?
<beingjohnm>
I've got a total newbie question
iliketurtles has joined #ruby
rgfx has joined #ruby
spider-mario has quit [Read error: Connection reset by peer]
<rgfx>
Hello, does localtunnel work?
<rgfx>
I did the setup right, but it never connects, just wondering if its down, or any suggestion of what I could do, or new services to try.
orangerobot has joined #ruby
<orangerobot>
i'm trying to include a module so that i don't need to type in the full module path every time i use a method, but I keep getting "uninitialized constant Selenium::Client" even though I have required the needed gem
mikewintermute has quit [Quit: mikewintermute]
v0n has quit [Ping timeout: 246 seconds]
<orangerobot>
and i'm pretty sure that Selenium::Client::Idiomatic is a module
dash_ has quit [Quit: Time to beer :)]
<orangerobot>
am i missing something obvious here? this is how I've included it: include Selenium::Client::Idiomatic
<Mon_Ouie>
Are you sure you want to keep a list of all instances? It smells bad design and will prevent any instance from EVER being garbage collected
<alainus>
say I want to make a small application, really small. That opens a server, and responds to a particular request. I find rails much too large for this. What's an alternative
<alainus>
?
<zeroXten>
i'm playing with writing a DSL to get my head around ruby meta programming
<zeroXten>
having all instances loaded is pretty much to be expected
<Nilium>
alainus: Sinatra maybe? (not sure haven't used it myself), zeromq, other thingies
reset has joined #ruby
cj3kim has quit [Read error: Connection reset by peer]
fernandoaleman has quit [Quit: Leaving.]
mneorr has quit [Remote host closed the connection]
cj3kim has joined #ruby
renderful has joined #ruby
BlakeRG has quit [Quit: BlakeRG]
mneorr has joined #ruby
havenwood has joined #ruby
jimi_ has left #ruby ["Leaving"]
<zeroXten>
and I can't move the list into a class because i'd lose @@instances
locriani has quit [Remote host closed the connection]
locriani has joined #ruby
paskotyy has quit []
huoxito has quit [Quit: Leaving]
romdi`` has joined #ruby
bradhe has joined #ruby
mneorr has quit [Ping timeout: 248 seconds]
renderful has quit [Ping timeout: 276 seconds]
enebo has quit [Quit: enebo]
<Eiam>
alainus: netcat? =)
<Eiam>
alainus: otherwise, sinatra =) I run sinatra instances out of a single file quite regularly.
<Eiam>
one or two routes, maybe a class maybe not, done.
<alainus>
great, thanks
<Eiam>
netcat == nc on OS X
<Eiam>
NAME
<Eiam>
nc -- arbitrary TCP and UDP connections and listens
romdi` has quit [Ping timeout: 276 seconds]
hakunin has quit [Remote host closed the connection]
thepumpkin has quit [Remote host closed the connection]
ffranz has joined #ruby
hakunin has joined #ruby
lindenle has joined #ruby
TheRealPygo is now known as pygospa
atno has quit [Remote host closed the connection]
rodacato has quit [Remote host closed the connection]
bradhe has quit [Ping timeout: 248 seconds]
tobyo1 has quit [Ping timeout: 240 seconds]
reset has quit [Quit: Leaving...]
rodacato has joined #ruby
brunoro has joined #ruby
hakunin has quit [Ping timeout: 256 seconds]
jorge_ has joined #ruby
reset has joined #ruby
Krajsnick has joined #ruby
s00pcan has joined #ruby
rien has joined #ruby
<rien>
folks, what is wrong here, I run gem install bundler, it installs fine, but it doesn't get me the executable bundle
<rien>
I've googled to no end, no one has this issue
bradhe has joined #ruby
<DylanJ>
rien: are you using rvm, rbenv, ruby from your distro(linux), ruby from brew/macports ( is that a thing? )
bradhe has quit [Remote host closed the connection]
<beingjohnm>
rien: I'm a complete newbie but when you run 'which bundle' what does it show?
<DylanJ>
probably "not found"
bradhe has joined #ruby
<atmosx>
which
terrellt has quit [Ping timeout: 256 seconds]
<atmosx>
bundle
rodacato has quit [Ping timeout: 240 seconds]
dankest has quit [Read error: Connection reset by peer]
<rien>
they're installed in the system but right now I'm installing ruby 2 manually at /opt/ruby2
wsterling has quit [Remote host closed the connection]
<rien>
which gem, which ruby, all return the right one from /opt/ruby2/bin
dEPy has quit [Remote host closed the connection]
<DylanJ>
remove the rvm stuff in your .bashrc
<rien>
I can't find the bundle executable for the life of me, but weirdly when I do gem uninstall bundler, it says "do you want to remove the executable as well?" but the f$Kcer doesn't tell me where that is
<rien>
I think it's hallucinating
<rien>
DylanJ: will try
cj3kim has quit [Remote host closed the connection]
<Eiam>
atmosx: what is that old?
<Eiam>
i thought i just installed this ruby like.. 4 days ago or something
Liothen has joined #ruby
<DylanJ>
247 is the latest
bradhe has quit [Remote host closed the connection]
<Eiam>
rien: okay, well if its installed in /opt/ruby you probably don't have it in your path
<Eiam>
rien: look at echo $PATH and see if /opt/ is in your path
<Eiam>
also use brew macports sucks =)
mary5030 has quit [Ping timeout: 268 seconds]
bradhe has joined #ruby
<DylanJ>
i dont use either.
* DylanJ
runs linux like a real person
<rien>
DylanJ: no go, "/usr/bin/which: no bundle in (/opt/ruby2/bin/... ".
<Eiam>
okay dysfunctional person got it.
cj3kim has joined #ruby
<rien>
Eiam: I have it in my path :)
<DylanJ>
:>
<rien>
Eiam: I've installed ruby 2 on tens of machines
<rien>
never had this weird problem where the bundler gem installs without errors but doesn't bring the executable
<Eiam>
rien: linux has apt and other package managers anyway so the jab was irrelevant =p
cpruitt has quit [Quit: cpruitt]
kofno has joined #ruby
<DylanJ>
you should really never install ruby from a package manager
<DylanJ>
it's usually out of date and weird.
maycon has joined #ruby
maycon has joined #ruby
maycon has quit [Changing host]
<Eiam>
DylanJ: dvm downloads & installs it for you..
<Eiam>
rvm
<rien>
DylanJ: trust me I'm the one who convinced everyone here to uninstall this rvm virus from all our machines
<DylanJ>
yeah
<DylanJ>
i use rvm
<Eiam>
DylanJ: its not pre-packaged usually...
ChristianS has quit [Excess Flood]
<Eiam>
rien: eh, okay, I have run into one problem with RVM
<Eiam>
where it was breaking passenger
ChristianS has joined #ruby
<Eiam>
beyond that, no complaints.
<rien>
well the thing is, instead of using rvm or any other system, I simply install my rubies at different /opt/ folders
<rien>
it's so simple
<rien>
then it just works and I don't have to deal with yet another program
<DylanJ>
rien:
<rien>
just pass --prefix=/opt/something when you do ./configure when you're compiling a ruby
<Eiam>
except for how its not working right now
<rien>
Eiam: but it worked on 16 machines before that :)
<DylanJ>
see if there's a /opt/ruby/gems/bin or something similar
<DylanJ>
and add that to your PATH
Davey has quit [Quit: Computer has gone to sleep.]
<havenwood>
I think ruby-install with chruby is a nice balance of light and functional.
<rien>
DylanJ: ok will do (there is)
rypervenche has joined #ruby
<rypervenche>
Is it a better idea to install ruby gems from my distro's package manager or by using the gem command? And also, is it possible to remove any gem-installed packages easily? For example, all of them in one fell swoop?
<rypervenche>
havenwood: All right. I suppose I would do "gem uninstall GEMNAME" to get rid of it?
<Kelet>
On arch linux most of the packages for installing gems actually use gem internally but they pass options that are somewhat important
<havenwood>
rypervenche: In the upcoming 2.1.0 version of RubyGems there is a new `gem uninstall --all`, but right now `gem uninstall GEMNAME` yeah,.
r0bby is now known as robbyoconnor
<Kelet>
For example, Nokogiri is by default built against some old version of libXML and on any modern distro you should pass --use-system-libs or something (cant remember exactly), the package does this for you.
<havenwood>
rypervenche: You can clear all your gems with a ruthless: rm -rf $GEM_HOME
<havenwood>
rypervenche: Which would delete build_info/, which isn't a preferred thing to do
jibi has quit [Quit: .]
devoldmx3 has quit [Ping timeout: 246 seconds]
lindenle has quit [Quit: This computer has gone to sleep]
Mathias__ has quit [Remote host closed the connection]
brunoro has joined #ruby
<beingjohnm>
my stupid question: I have the following and need to get the values of the "name" field. How do I do that?
digitalcake has quit [Read error: Connection reset by peer]
digitalcake has joined #ruby
reset has quit [Quit: Leaving...]
cads has quit [Ping timeout: 248 seconds]
<Mathias__>
how to run .rb files with SublimeText 2 ?
<otherj>
why would you try to run it from ST2? run it from a shell
<Mathias__>
k
r4nd0m1 has quit []
danbeck has quit [Quit: danbeck]
baroquebobcat has joined #ruby
<Spooner>
beingjohnm, skip irb and use pry instead ;)
<Eiam>
^ use pry
<Eiam>
Im bitter about learning irb first
<Nilium>
Hm, didn't know about Pry. Neat.
<beingjohnm>
I'll have to check that out
<Eiam>
beingjohnm: data.map{|x| x["name"]}
<beingjohnm>
Ruby seems to be pretty nice. Getting more done quicker than the other languages I know.
<Eiam>
ruby is f'ing awesome
<Mathias__>
yep Ruby Rocks!
<beingjohnm>
Eiam: I'll read up on map
<Eiam>
beingjohnm: you should read up on Array & Enumerable
<Eiam>
as those seem to be my largest two working sets of Ruby objects =p
<beingjohnm>
Eiam: yeah. I should. I was thinking I was being returned a json object and that wasn't helping my issue.
<Eiam>
beingjohnm: it tells you the object being returned
<Eiam>
<Asana::Workspace
<Eiam>
with an instance variable @attributes
<Eiam>
thats a hash with some values
TIJ has quit [Quit: Konversation terminated!]
<Eiam>
oh whoops my map command won't work, ha
m8 has quit [Quit: Sto andando via]
TIJ has joined #ruby
<Eiam>
whatever its close enough you can figure it out =)
osvico has joined #ruby
<Eiam>
beingjohnm: rather, an array of Asana objects =)
<beingjohnm>
ahh
Ripp__ has quit [Quit: This computer has gone to sleep]
<beingjohnm>
my mind wasn't one level off
<beingjohnm>
er, was one level off
<Eiam>
well, thinking of a hash as being == json isn't quite safe
<brotatos>
The ! operator is actually a function call in ruby. But is it also a function call in other languages like C or php as well?
<DylanJ>
brotatos: in C it's an operator AFAIK
<Xeago>
brotatos: not entirely sure, in most languages it is an operator
<Xeago>
it depends on the language if you can define behavior for operators
<Xeago>
(in C# you can for example)
platoscave has joined #ruby
<Xeago>
I think in C it has a pre-defined behavior, either spec or compiler
trepidaciousMBR has joined #ruby
reset has joined #ruby
<beingjohnm>
IRC is pretty awesome too. Love that there are people that are willing to help me.
<Mathias__>
sure
maycon has quit [Quit: Saindo]
JZTech101 has quit [Quit: Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC]
<Eiam>
beingjohnm: for one, in javascript you cannot access an object using dot notation if its key is a number or begins with a space. so {1=>2} is valid ruby. if you to_json that you'll get {"1":2}
<Nilium>
There's no operator overloading in C. C++, on the other hand, allows overloading for a specific set of operators.
<Eiam>
beingjohnm: so, hash != json
mmitchell has quit [Remote host closed the connection]
<Nilium>
Ruby also forbids a few operators from being overloaded as well, last I checked.
<Eiam>
Nilium: not all operators..
<Nilium>
That's why I said a few.
<Eiam>
Nilium: you cannot however overload the = operator, which is a bummer
<Eiam>
Nilium: oh, missed that part =)
vlad_starkov has quit [Ping timeout: 240 seconds]
<Eiam>
I forgot why I was trying to overload = a few weeks ago, but I was sad to learn it cannot be done
<Nilium>
E.g., you can overload ==, but I believe you can't overload !=
<beingjohnm>
Eiam: the conversation is starting to drift over my head but I've got the knowledge that I require at this moment. THanks
<Nilium>
Probably because it just piggy-backs off of ==
<Eiam>
Nilium: != being !(==) probably?
codecop has quit [Remote host closed the connection]
<Nilium>
I'm guessing. I can't say for sure since I don't know how it's implemented.
<Nilium>
The annoying thing is that you can't overload stuff like += and -= and so on.
<brotatos>
Is there an easy way to grab the input from a system call? like system('vim') and then grab the input that the user enters as an entire string?
weeb1e_ has quit [Ping timeout: 248 seconds]
<Nilium>
Maybe if you somehow intercepted it before it was provided to the process?
<Nilium>
Otherwise, probably not.
<brotatos>
I want to set it up a la `git commit`. I want to prompt the user to enter a message where they will do so in vim and then do whatever with the message.
mengu has joined #ruby
weeb1e has joined #ruby
jsatk has quit [Remote host closed the connection]
thenj has quit [Quit: Page closed]
skaczor has joined #ruby
vlad_starkov has joined #ruby
<Nilium>
So create a temp file, let them modify it, then do what you need to with the contents of the temp file.
<Nilium>
Or is there a way to guarantee whatever program you pass it to will write the end result to stdout?
<Nilium>
Temp file's probably easier anyway. Just destroy it when you're done.
v0n has joined #ruby
<Nilium>
That way if something crashes internally, the temp file's still there and you can let the user resume and verify it's correct before proceeding.
EPIK has quit [Ping timeout: 240 seconds]
<brotatos>
Nilium: but there's still stuff i want to do after they edit the file. How would the script wait for them to make a change to the file?
pipework has quit [Remote host closed the connection]
platoscave has quit [Ping timeout: 240 seconds]
<brotatos>
system("vim /tmp/file").... and then do some stuff with it
<Nilium>
Have it wait on the process.
cj3kim has quit [Read error: Connection reset by peer]
jorge_ has joined #ruby
ilyam has joined #ruby
<Nilium>
You should probably look at the Process module, FYI.