<udoprog>
Hey, I'm trying to create an rbenv that I can move around (i.e. build in one place, and distribute in an archive), however I am facing two issues related to library path. 1) the build path is compiled into the ruby interpreter, 2) the gem binstubs use the absolute path of the interpreter. Has anyone found a way to work around this?
Aryasam has quit [Read error: Connection reset by peer]
drumsrgr8forn8_ has quit [Quit: Konversation terminated!]
nik_-_ has quit [Quit: nik_-_]
endash has quit [Ping timeout: 240 seconds]
iamjarvo has quit [Remote host closed the connection]
iamjarvo has joined #ruby
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
Stalkr has joined #ruby
funburn has joined #ruby
<udoprog>
To core issue is that the build server uses a non-deterministic build directory which is not suitable as a LOAD_PATH on my target machines
Aryasam has quit [Read error: Connection reset by peer]
xcv has joined #ruby
Aryasam has joined #ruby
Aryasam has quit [Read error: Connection reset by peer]
Aryasam_ has joined #ruby
danman has quit [Quit: danman]
<udoprog>
siezer: will look, thanks
Davey has quit [Quit: Computer has gone to sleep.]
julweber has quit [Remote host closed the connection]
nik_-_ has joined #ruby
kadoo has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
Stalkr has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Jdubs has quit [Remote host closed the connection]
Aryasam_ has quit [Ping timeout: 252 seconds]
asteros has quit [Quit: asteros]
axl_ has joined #ruby
zastern has quit [Ping timeout: 256 seconds]
zastern has joined #ruby
devoldmx has joined #ruby
Stalkr has quit [Ping timeout: 240 seconds]
iliketurtles has quit [Quit: zzzzz…..]
asteros has joined #ruby
tkuchiki has joined #ruby
baroquebobcat has joined #ruby
Zeeraw has joined #ruby
nik_-_ has quit [Quit: nik_-_]
DrOwl has quit [Ping timeout: 264 seconds]
Inside has joined #ruby
twoism has quit [Remote host closed the connection]
superscott[8] has quit [Quit: superscott[8]]
pwh has joined #ruby
Davey has joined #ruby
snovak has joined #ruby
fenicks has quit [Remote host closed the connection]
epta has quit [Ping timeout: 264 seconds]
Senjai has joined #ruby
Senjai has joined #ruby
iliketurtles has joined #ruby
popl has joined #ruby
popl has quit [Changing host]
popl has joined #ruby
tatsuya_o has joined #ruby
havenwood has quit [Remote host closed the connection]
dodosan has joined #ruby
snovak has quit [Ping timeout: 240 seconds]
lukec has joined #ruby
vishal has joined #ruby
dhruvasagar has joined #ruby
doritostains has quit [Quit: Leaving...]
DrOwl has joined #ruby
Aryasam has joined #ruby
lfox has joined #ruby
das3in has joined #ruby
quoin has joined #ruby
Senjai has quit [Ping timeout: 245 seconds]
lfox has quit [Client Quit]
Ivo has left #ruby ["WeeChat 0.4.1"]
<das3in>
This is probably an odd question, but is there a site that offers… tutoring of sorts for Ruby? A place besides IRC where I can just ask someone, preferably the same person questions when they (frequently) come up
platzhirsch1 has joined #ruby
<platzhirsch1>
I wish I could connect to a ruby process with pry at any point without binding.pry :|
tatsuya_o has quit [Ping timeout: 240 seconds]
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sevenseacat has joined #ruby
fijimunkii has joined #ruby
Tarential has quit [Excess Flood]
amacgregor has joined #ruby
platzhirsch1 is now known as platzhirsch
Tarential has joined #ruby
mmm has quit [Read error: Connection reset by peer]
peregrine81 has quit []
Cyrus has joined #ruby
amacgregor_ has quit [Read error: Operation timed out]
Alina-malina has quit [Read error: Connection reset by peer]
Alina-malina has joined #ruby
tabolario has joined #ruby
tabolario has quit [Client Quit]
fijimunkii has quit [Ping timeout: 240 seconds]
ADot has quit [Ping timeout: 240 seconds]
baroquebobcat has joined #ruby
tabolario has joined #ruby
mweshi has quit [Remote host closed the connection]
soheil has quit [Remote host closed the connection]
mweshi has joined #ruby
quoin has quit [Ping timeout: 260 seconds]
baroquebobcat has quit [Client Quit]
i_s has joined #ruby
faoiseamh has joined #ruby
<faoiseamh>
I have two strings that i'm sure are the same, but they must be in different encodings (chinese characters). Any way I can convert + compare them in such a way that I can tell if they are really the same?
baroquebobcat has joined #ruby
mrsolo has joined #ruby
smashwilson has quit [Quit: Leaving.]
<w33dWizard[420]>
you mean ensure their translations are the same?
Xaitec has joined #ruby
<faoiseamh>
not sure exactly what you mean by that
<faoiseamh>
the strings look identical visually
agjacome has quit [Quit: leaving]
<w33dWizard[420]>
so how are they different?
<faoiseamh>
but are not equal - they must be encoded with different unicode encodings or somethings
<w33dWizard[420]>
oh
<faoiseamh>
i'm positive they should be the same
<faoiseamh>
not sure what steps to take to determine what the differences are and how to convert them in such a way to compare
<faoiseamh>
i've tried doing various string.encode's on them
<faoiseamh>
and if i do an invalid one, ruby will tell me what it thinks the encoding is (i.e. code converter not found (GBK to gb))
<bnagy>
use inspect?
<bnagy>
if that doesn't work then use each_byte.to_a and inspect that
fuhgeddaboudit has joined #ruby
<faoiseamh>
interestingly .inspect shows "'s on either side of it
zastern has quit [Remote host closed the connection]
<das3in>
For example, I have an array of objects. I want to copy the array, and move them 2 at a time into new, dynamically created arrays until the cloned array is empty
<bnagy>
das3in: we did this yesterday
<das3in>
I know that
<das3in>
but it didn't work
Hanmac1 has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
<das3in>
the chunk method on enumerables is nice, but doesn't let me control the new arrays
<bnagy>
instead of saying 'it didn't work' try saying "I did X and expected Y but instead got Z"
mlpinit has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
jonr22 has quit [Ping timeout: 240 seconds]
<das3in>
I'm trying to build a tournament management system. And I have an array of players, and each round I need to create a number of matches based on that number of players
<das3in>
That's part of the problem, I need to dynamically create them
<bnagy>
don't do that.
<das3in>
based on the number of players
<bnagy>
it comes up every so often, it's a blind spot people have
Aryasam_ has joined #ruby
Voodoofish430 has quit [Quit: Leaving.]
<bnagy>
just use another array called matches or something, then you can get your match by matches[0] etc
rickmasta has joined #ruby
Stalkr has joined #ruby
scarolan_ has joined #ruby
Aryasam has quit [Ping timeout: 240 seconds]
cjs226 has joined #ruby
<das3in>
So create an empty array of matches, (matches = []) and then push 2 players at a time into new arrays in matches array?
<bnagy>
dynamically creating variables is basically always wrong
<das3in>
hmm I didn't know that
<bnagy>
yeah, although that would just look like matches = players.each_slice(2).to_a
Xaitec has quit [Remote host closed the connection]
scarolan has quit [Ping timeout: 264 seconds]
yourmysin has joined #ruby
<das3in>
wow that worked perfectly
<das3in>
and makes a lot more sense, thanks a lot!
<das3in>
on a purely educational level, why is dynamically created variables generally bad
Aryasam has joined #ruby
<bnagy>
cause if you know which variable you're looking for you know everything you need to find that data in a bigger collection
phantasm66 has joined #ruby
ADot has joined #ruby
Stalkr has quit [Ping timeout: 240 seconds]
ADot has quit [Max SendQ exceeded]
phantasm66 has quit [Client Quit]
Aryasam has quit [Read error: Connection reset by peer]
forced_request has quit [Ping timeout: 260 seconds]
ADot has joined #ruby
<das3in>
that makes sense. I guess the only 'benefit' to dynamically creating variables is naming convention
ADot has quit [Max SendQ exceeded]
<das3in>
thanks bnagy
ADot has joined #ruby
Domon has joined #ruby
ADot has quit [Max SendQ exceeded]
Aryasam_ has quit [Ping timeout: 264 seconds]
ADot has joined #ruby
asteros has quit [Quit: asteros]
Aryasam has joined #ruby
<bnagy>
no worries
<udoprog>
das3in: another way to think about it; if you are effectively trying to store a 'list of something', you should probably use a list
bricker`1A has quit [Remote host closed the connection]
quoin has joined #ruby
Domon has quit [Remote host closed the connection]
Domon has joined #ruby
narcan has joined #ruby
mikeric has joined #ruby
sectionme has joined #ruby
Domon__ has joined #ruby
phutchins has quit [Ping timeout: 240 seconds]
Domon has quit [Read error: Connection reset by peer]
kadoo has joined #ruby
simplyaubs has joined #ruby
ADot has quit [Ping timeout: 252 seconds]
kemist has quit [Ping timeout: 248 seconds]
helloworld has quit [Ping timeout: 245 seconds]
Aryasam has quit [Ping timeout: 264 seconds]
krz has joined #ruby
v0n has joined #ruby
sectionme has quit [Ping timeout: 245 seconds]
kadoo has quit [Client Quit]
tsykoduk is now known as zz_tsykoduk
axl_ has quit [Quit: axl_]
whunt has quit [Quit: Computer has gone to sleep.]
chrisja has quit [Quit: leaving]
dmiller__ has quit [Remote host closed the connection]
havenwood has joined #ruby
fgh has quit [Ping timeout: 252 seconds]
varfoo has joined #ruby
fuhgeddaboudit has quit [Ping timeout: 252 seconds]
das3in has quit [Quit: Leaving]
<krz>
a class extends a module. is it possible for the module to access instance variables in the class?
snovak has joined #ruby
aspires has quit [Quit: aspires]
<krz>
it wouldnt right? since the object is not an instance of the class
<bnagy>
correct
<bnagy>
you could access class instance variables though
mayorga has joined #ruby
quoin has quit [Ping timeout: 240 seconds]
mercwithamouth has quit [Ping timeout: 248 seconds]
havenwood has quit [Ping timeout: 246 seconds]
mercwithamouth has joined #ruby
devoldmx has quit [Read error: Connection reset by peer]
devoldmx3 has joined #ruby
snovak has quit [Ping timeout: 264 seconds]
<krz>
i could?
<krz>
but it would be wrong? is that what you are trying to say bnagy ?
jwicked has joined #ruby
<bnagy>
class ivar != ivar
cj3kim_ has joined #ruby
devoldmx3 has quit [Read error: Connection reset by peer]
ehc has joined #ruby
ehc has quit [Client Quit]
Es0teric has quit [Quit: Computer has gone to sleep.]
renanoronfle has joined #ruby
cjs226 has quit []
baroquebobcat has joined #ruby
adeponte has quit [Ping timeout: 240 seconds]
vpretzel has quit [Remote host closed the connection]
nanoxd has quit [Ping timeout: 252 seconds]
ce_afk is now known as cescalante
vpretzel_ has joined #ruby
vpretzel_ is now known as vpretzel
mercwithamouth has quit [Ping timeout: 264 seconds]
radic has joined #ruby
baroquebobcat has quit [Client Quit]
cj3kim_ has quit [Remote host closed the connection]
ehc has joined #ruby
nanoxd has joined #ruby
Aryasam has joined #ruby
tjad has joined #ruby
radic_ has quit [Ping timeout: 240 seconds]
cyber-criminal has joined #ruby
<cyber-criminal>
ruby is shit
<cyber-criminal>
radar nigger
benlieb has joined #ruby
rezzack has quit [Ping timeout: 252 seconds]
Mars` has joined #ruby
<sevenseacat>
mute him in one channel, he goes to another
mercwithamouth has joined #ruby
<cyber-criminal>
aha
<cyber-criminal>
bitch
b00stfr3ak has joined #ruby
b00stfr3ak has quit [Changing host]
b00stfr3ak has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
baroquebobcat has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
cyber-criminal is now known as big_a
big_a is now known as biggie
lewtds has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
diegoviola has joined #ruby
<biggie>
fackin ruby shit
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
ADot has joined #ruby
mlpinit has quit [Remote host closed the connection]
freezey has joined #ruby
mlpinit has joined #ruby
biggie has left #ruby [#ruby]
vim_shim has joined #ruby
platzhirsch has left #ruby [#ruby]
Aryasam has quit [Read error: Connection reset by peer]
Aryasam has joined #ruby
DrOwl has quit [Ping timeout: 245 seconds]
yourmysin has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
mercwithamouth has quit [Ping timeout: 253 seconds]
kizzx2 has joined #ruby
Aryasam has quit [Read error: Connection reset by peer]
iliketurtles has joined #ruby
Aryasam has joined #ruby
mweshi has quit [Quit: mweshi]
DrOwl has joined #ruby
mlpinit_ has joined #ruby
mweshi has joined #ruby
ADot has quit [Quit: Leaving.]
kvirani has joined #ruby
fridim_ has quit [Ping timeout: 240 seconds]
soheil has joined #ruby
cescalante is now known as ce_afk
mlpinit_ has quit [Remote host closed the connection]
rickmasta has quit [Quit: Leaving...]
havenwood has quit [Ping timeout: 240 seconds]
mlpinit has quit [Ping timeout: 256 seconds]
mercwithamouth has joined #ruby
nik_-_ has joined #ruby
nik_-_ has quit [Client Quit]
Jdubs has joined #ruby
mary5030 has joined #ruby
Stalkr has joined #ruby
nisstyre has joined #ruby
freezey has quit [Remote host closed the connection]
alvaro_o has quit [Quit: Ex-Chat]
Aryasam has quit [Read error: Connection reset by peer]
Aryasam_ has joined #ruby
jonr22 has joined #ruby
IceDragon has quit [Quit: Space~~~]
eka has quit [Quit: Computer has gone to sleep.]
soheil has quit [Ping timeout: 260 seconds]
ehc has quit [Quit: ehc]
ehc has joined #ruby
Stalkr has quit [Ping timeout: 260 seconds]
zeade has joined #ruby
fuhgeddaboudit has joined #ruby
i_s has quit [Remote host closed the connection]
voodoofish has quit [Quit: Leaving]
cj3kim_ has joined #ruby
Aryasam_ has quit [Read error: Connection reset by peer]
Stalkr has joined #ruby
narcan has quit [Ping timeout: 264 seconds]
niklasb has quit [Read error: Operation timed out]
roadt_ has joined #ruby
kadoo has joined #ruby
cj3kim_ has quit [Read error: Connection reset by peer]
kadoo has quit [Client Quit]
Stalkr has quit [Ping timeout: 246 seconds]
kevinykchan has joined #ruby
rickmasta has joined #ruby
aspires has joined #ruby
duracrisis has quit [Quit: Good bye!]
jonr22 has quit [Ping timeout: 248 seconds]
asteros has joined #ruby
quoin has joined #ruby
Aryasam has joined #ruby
rainbyte16 has joined #ruby
BSaboia has quit [Quit: Leaving]
simplyaubs has quit [Quit: simplyaubs]
snovak has joined #ruby
Aryasam_ has joined #ruby
Aryasam has quit [Read error: Connection reset by peer]
rainbyte16 has left #ruby [#ruby]
simplyaubs has joined #ruby
snovak has quit [Ping timeout: 260 seconds]
intuxicated has quit [Ping timeout: 252 seconds]
postmodern has quit [Quit: Leaving]
jonahR has joined #ruby
ukd1 has quit [Remote host closed the connection]
ukd1 has joined #ruby
fijimunkii has joined #ruby
choobie has left #ruby [#ruby]
quoin has quit [Ping timeout: 240 seconds]
vim_shim has quit [Ping timeout: 256 seconds]
Bira has quit [Remote host closed the connection]
jwicked has quit [Read error: Operation timed out]
ukd1 has quit [Ping timeout: 248 seconds]
huoxito has quit [Quit: Leaving]
pwh has quit []
threesome has quit [Ping timeout: 264 seconds]
Es0teric has joined #ruby
sarmiena_ has quit [Quit: sarmiena_]
serp` has joined #ruby
kadoo has joined #ruby
kvirani has quit [Remote host closed the connection]
Aryasam_ has quit [Ping timeout: 260 seconds]
pwh has joined #ruby
kvirani has joined #ruby
adeponte has joined #ruby
mercwithamouth has quit [Ping timeout: 252 seconds]
Es0teric has quit [Client Quit]
mercwithamouth has joined #ruby
dhruvasagar has quit [Ping timeout: 245 seconds]
mrsolo has quit [Quit: This computer has gone to sleep]
cj3kim_ has joined #ruby
conner has joined #ruby
Aryasam has joined #ruby
kadoo has quit [Client Quit]
benlieb has quit [Quit: benlieb]
cj3kim_ has quit [Read error: Connection reset by peer]
kvirani has quit [Ping timeout: 248 seconds]
Mars` has quit [Remote host closed the connection]
vxxr has joined #ruby
adamxlowe has joined #ruby
roadt_ has quit [Ping timeout: 245 seconds]
aspires has quit [Quit: aspires]
adamxlowe has left #ruby [#ruby]
adeponte has quit [Ping timeout: 260 seconds]
Alina-malina has quit [Ping timeout: 240 seconds]
gja has joined #ruby
havenwood has joined #ruby
brennanMKE has quit [Remote host closed the connection]
brennanMKE has joined #ruby
gja has quit [Client Quit]
zz_tsykoduk is now known as tsykoduk
ADot has joined #ruby
dcunit3d has quit [Ping timeout: 264 seconds]
mxweas has joined #ruby
renanoronfle has quit [Quit: This computer has gone to sleep]
serp` has quit [Quit: serp`]
havenwood has quit [Ping timeout: 264 seconds]
vim_shim has joined #ruby
T_T has quit [Remote host closed the connection]
ADot has quit [Ping timeout: 240 seconds]
<w33dWizard[420]>
um
<w33dWizard[420]>
can someone debug something simple for me?
gcds has quit [Ping timeout: 248 seconds]
ehc has quit [Quit: ehc]
cj3kim_ has joined #ruby
brennanMKE has quit [Remote host closed the connection]
brennanMKE has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
ixti has joined #ruby
ehc has joined #ruby
ukd1 has joined #ruby
Aryasam has quit [Ping timeout: 248 seconds]
baroquebobcat has joined #ruby
Aryasam has joined #ruby
Jdubs has quit [Remote host closed the connection]
Stalkr has joined #ruby
ce_afk is now known as cescalante
mrsolo has joined #ruby
mlpinit has joined #ruby
asteros has quit [Quit: asteros]
ukd1 has quit [Ping timeout: 240 seconds]
baroquebobcat has quit [Client Quit]
Stalkr has quit [Ping timeout: 246 seconds]
mlpinit has quit [Ping timeout: 260 seconds]
gcds has joined #ruby
Zeeraw has quit [Quit: Computer has gone to sleep.]
<krz>
When i call Foo.new, it returns the instance variables that were defined in the initialize method. how do I return a custom message instead?
<krz>
return=output
<sevenseacat>
i would presume it would return whatever your initialize method returns
dcunit3d has joined #ruby
<krz>
sevenseacat: im trying to output something similar to User.new
<krz>
i.e. => #<User id: nil, admin: false, first_name: nil
<krz>
User = AR object
<sevenseacat>
well thats just the object you're creating
mikeric has quit []
cescalante is now known as ce_afk
vxxr has quit [Quit: leaving]
<sevenseacat>
u = User.new, it returns the user instance
kemist has joined #ruby
Mars` has joined #ruby
<sevenseacat>
and it just outputs u.inspect
simplyaubs has quit [Quit: simplyaubs]
Jdubs has joined #ruby
<krz>
sevenseacat: i want the same output with my custom ruby objects. what should go in the initalizer?
tsykoduk is now known as zz_tsykoduk
<krz>
initializer*
<sevenseacat>
nothing
i_s has joined #ruby
<sevenseacat>
redefine inspect for pretty output
pwh has quit []
funburn has quit [Quit: funburn]
postmodern has joined #ruby
zz_tsykoduk is now known as tsykoduk
<krz>
ah
<krz>
thanks
kemist has quit [Ping timeout: 248 seconds]
Mars` has quit [Ping timeout: 240 seconds]
i_s has quit [Ping timeout: 246 seconds]
pwh has joined #ruby
Jdubs_ has joined #ruby
Inside has quit [Ping timeout: 260 seconds]
adeponte has joined #ruby
polaco is now known as polaco_zZz
snovak has joined #ruby
cj3kim_ has quit [Remote host closed the connection]
DanKnox is now known as DanKnox_away
doritostains has joined #ruby
Jdubs has quit [Ping timeout: 252 seconds]
brianpWins has joined #ruby
<krz>
if a class includes a module. and that module includes another module. the 2nd module sets a variable that needs to be accessed by the first module. how should i go about this?
snovak has quit [Ping timeout: 246 seconds]
Aryasam has quit [Ping timeout: 248 seconds]
Xiti has joined #ruby
ianderson has joined #ruby
kadoo has joined #ruby
quoin has joined #ruby
ukd1 has joined #ruby
mayorga has quit [Ping timeout: 256 seconds]
kadoo has quit [Client Quit]
Jdubs_ has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
Aryasam has joined #ruby
kreeves has quit [Ping timeout: 256 seconds]
Jdubs has joined #ruby
kilophoton has quit [Ping timeout: 245 seconds]
vim_shim has quit [Ping timeout: 240 seconds]
nari has joined #ruby
kizzx2 has quit [Quit: Leaving.]
funburn has joined #ruby
rezzack has joined #ruby
soba has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
Aryasam has quit [Ping timeout: 264 seconds]
<krz>
k better question. if a module sets some data. now can i make this data accessible by the class or other modules?
<krz>
what should i look into?
ukd1 has quit [Read error: Connection reset by peer]
ukd1 has joined #ruby
cj3kim_ has joined #ruby
ukd1_ has joined #ruby
quoin has quit [Ping timeout: 240 seconds]
Aryasam has joined #ruby
cj3kim_ has quit [Remote host closed the connection]
Aryasam_ has joined #ruby
Aryasam_ has quit [Read error: Connection reset by peer]
diegoviola has quit [Read error: No route to host]
<krz>
at the moment, it returns nil
codecop has joined #ruby
voidPirate has joined #ruby
<voidPirate>
so day 3 with ruby, and this language rocks!
robbyoconnor has joined #ruby
<voidPirate>
why the 'F' would anyone learn PHP, biggest mistake of my life shit
mansi has quit [Ping timeout: 256 seconds]
<jrobeson>
voidPirate, because it lets them build useful applications? or they ahve to work with php apps :)
schaerli has joined #ruby
<krz>
anyone?
snovak has joined #ruby
gja has joined #ruby
<voidPirate>
jrobeson: I suppose, I mean all the jobs around me are php dev jobs ;)
yacks has quit [Quit: Leaving]
<voidPirate>
they syntax of ruby is a bitch to learn coming from php or js
schaerli has quit [Remote host closed the connection]
<jrobeson>
hmm ? anything in particular you had a problem with?
<voidPirate>
it is so simple, so it takes some time to get used ot
dhruvasagar has quit [Read error: Connection reset by peer]
<jrobeson>
php was my first language i actually wrote a lot of stuff in.. but i had tried a few others first for random things.. so differing syntax is rarely a problem for me .. except stuff like ternary order..
dhruvasagar has joined #ruby
Mars` has quit [Remote host closed the connection]
Monie has joined #ruby
<voidPirate>
what is the difference from a hash map and an array?
<jrobeson>
that's too easy to forget if it's something that won't cause a parser error right away and you're switch back and forth a lot
Mars` has joined #ruby
<jrobeson>
voidPirate, in most popular languages other than php.. hashes and arrays are seperate
snovak has quit [Ping timeout: 240 seconds]
<voidPirate>
hashes seem very similiar to objects
<voidPirate>
the syntax atleast
<jrobeson>
try doing an associative array php style in ruby with an Array
<jrobeson>
and then as a Hash, you'll see the difference
<voidPirate>
ok, let me try
<jrobeson>
voidPirate, you should consider running through these : http://rubykoans.com/
<boeyc>
<boeyc> hello my irb is giving the following and im not sure what this means. I created a new folder test, to play around with making classes and methods.
schaerli has quit [Remote host closed the connection]
Mars` has joined #ruby
<voidPirate>
what is is giving you?
<boeyc>
1.9.3-p194 :001 > require 'dwemthy'
<boeyc>
LoadError: cannot load such file -- dwemthy
<boeyc>
from /home/boeyc/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:53:in `require'
fgh has joined #ruby
<voidPirate>
do you have the command line tools installed?
<jhn>
boeyc: is that a gem?
<boeyc>
perhaps not, no im playing with poignants guide, one of their games
<jhn>
w33dWizard[420]: the reason it's doing that is that the elements get shifted over every time you delete in place.
<bnagy>
I still prefer the lazy permutation.include? though
robbyoconnor has quit [Quit: Konversation terminated!]
<jhn>
since you delete tic, toc becomes the new element at the 0th position (tac becomes 1st, toe 2nd), but each has already seen the 0th position, so it moves on to the 1st position, which is now tac.
kadoo has joined #ruby
<jhn>
so basically you skipped toe because you shifted the elements.
apeiros has quit [Remote host closed the connection]
<jhn>
sorry, 'toc', not 'toe''
brennanMKE has quit [Remote host closed the connection]
<voidPirate>
is their a way on github to now explore repos recently created, or modified, like old times?
<Hanmac>
hm imo i would put "search.chars.to_a.permutation" outside of the loop it might be better ... but yeah i would also use include? ...
<voidPirate>
I can only find "trending" as an option
ananthakumaran has joined #ruby
Mathieu_ has joined #ruby
Monie has quit [Ping timeout: 260 seconds]
Mathieu_ is now known as Mathieu
sandelius has joined #ruby
butblack has quit [Quit: butblack]
<bnagy>
Hanmac: till unlikely to be as fast as doing it as a seive, but way more expressive :P
DaZ_ is now known as DaZ
Monie has joined #ruby
pwh has quit []
antuirno has quit [Quit: Leaving]
kemist has joined #ruby
mweshi has quit [Quit: mweshi]
diegoviola has joined #ruby
vishal_ has quit [Read error: Connection reset by peer]
vishal has joined #ruby
io_syl has quit []
amacgregor_ has joined #ruby
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sarmiena_>
yeah that looks fine to me. that works?
bartj3 has quit [Client Quit]
freerobby has quit [Ping timeout: 246 seconds]
gja has joined #ruby
bartj3 has joined #ruby
cj3kim has quit [Remote host closed the connection]
<krz>
sarmiena_: yep
<sarmiena_>
nice
jonahR has quit [Quit: jonahR]
mansi has joined #ruby
coderhs has joined #ruby
atno has joined #ruby
pellenation has joined #ruby
zz_michael_mbp is now known as michael_mbp
dhruvasagar has quit [Read error: Connection reset by peer]
<airtonix>
why does ruby have so much brackets and stuff in wierd places?
gyzmodo has joined #ruby
<airtonix>
kinda breaks the idea that it's supposed to be more humanised language and stuff
<sevenseacat>
to resolve syntax ambiguities :)
dhruvasagar has joined #ruby
wallerdev has quit [Quit: wallerdev]
<airtonix>
how?
<canton7>
it has far fewer brackets than most languages I know :P
<airtonix>
i think it creates more
<sevenseacat>
what canton7 said
tonni has joined #ruby
<sevenseacat>
airtonix: got an example?
<airtonix>
it's not the presence of brackets that is causing me confusion
<airtonix>
it's the use of them and the placement
<tobiasvl>
airtonix: why shouldn't it have brackets? what's your point here? what's a "humanised language"
<canton7>
agan, got an example?
<canton7>
*again
b00stfr3ak has quit [Ping timeout: 240 seconds]
<airtonix>
well when i say brackets, i really mean these: {}[]|:
<canton7>
it might be some really poorly-written code, who knows?
Stalkr has joined #ruby
<airtonix>
oh so most ruby projects are poorly written?
<canton7>
ruby shares those with quite a lot of languages
<sevenseacat>
i guess thats a no to the example
<canton7>
ok, so you're talking about a lot of code you've seen? cool
<sarmiena_>
can't tell if feeding troll
<airtonix>
well for example, how you write lambdas
<canton7>
I wondered if you might be looking at a particular confusing example
cj3kim has joined #ruby
<airtonix>
canton7: perhaps, because someone did show me some nice and clean ruby the other day
<canton7>
sarmiena_, I'm going to see if there's something constructive after the initial rant :P
<airtonix>
canton7: well i doubt ruby will change so probably not.
mansi has quit [Ping timeout: 256 seconds]
<krz>
hmmm doesnt seem to work in rails console though
<sarmiena_>
canton7: yeah. might be someone attempting to cross over from some other language and getting the typical brain fightback of "why do i need to learn this shit? it sucks! i like what i know"
<krz>
trying to figure out what the diff is
<canton7>
it might be an education thing? ruby's certainly not unique in its array and hash syntax, roughly
<sevenseacat>
you know theres more than one way to write lambdas, right
<tobiasvl>
airtonix: are you a troll? what's your point?
<sevenseacat>
when we want an example, we mean an actual code example
<airtonix>
tobiasvl: you'd like it to be a simple case of "i'm a troll" but no. i want to learn it, but it's just so obtuse ruby seems so different from python
jwicked has quit [Ping timeout: 252 seconds]
<tobiasvl>
it is
<sevenseacat>
well it is a different language yes
snovak has joined #ruby
<tobiasvl>
it is different from python
<popl>
ruby is different
<popl>
what's your point airtonix?
<sevenseacat>
if the syntax was the same, they wouldnt be separate languages
<airtonix>
but it seems to be different just for the sake of being different
<canton7>
but python has a ton of brackets too... about as many, I'd say
tonni has quit [Ping timeout: 248 seconds]
Macaveli has joined #ruby
<popl>
it's a fucking different language dude
<tobiasvl>
airtonix: ruby is inspired by perl
<popl>
now I'm pretty sure you're trolling
<airtonix>
canton7: again, it's not the presence of brackets, but how they are used.
<tobiasvl>
airtonix: ruby is perl-like. that's "different for the sake of being different"?
<airtonix>
tobiasvl: oh well that would explain why it's so weird
<canton7>
airtonix, the examples you posted - {}[] - are used in much the same way, most of the time
<tobiasvl>
airtonix: exactly
<canton7>
except that python uses more [] (list comprehensions) and ruby uses more {} (blocks)
<canton7>
both have roughly the same syntax for arrays and dicts/hashes
<tobiasvl>
canton7: and {} can be swapped out for do…end if the brackets are the problem
<canton7>
aye, they're normally reserved for one-line blocks
<airtonix>
i think the other thing is that "principle of least surprise" applies to ruby quite a bit... or maybe this is just rails.
<popl>
airtonix: don't you have anything better to do?
Aryasam has quit [Read error: Connection reset by peer]
<airtonix>
popl: you don't have to participate
ephemerian has joined #ruby
<tobiasvl>
canton7: yes, but not syntactically ;)
<canton7>
indeed
lewtds has joined #ruby
<tobiasvl>
airtonix: well you took over the entire channel with your weird discussion
ItSANgo__ has quit [Quit: Leaving...]
<canton7>
meh, nothing else was going on. people are obviously bored
<popl>
but you're here, blabbing in the channel. you're filling up my logs with shit. I could ignore you but then I'd have to participate to ignore you.
<canton7>
but hey, let's welcome the python guy :) he'll see the light yet
<airtonix>
canton7: i think it's more about understanding "ruby done right"
<tobiasvl>
airtonix has just discovered a 20 year old language with perl-like syntax. he doesn't like the syntax. it's not like this is surprising to any of us ;)
<airtonix>
canton7: is there a pep8 type thing for ruby?
funburn has quit [Quit: funburn]
Aryasam has joined #ruby
<airtonix>
a style guide?
<canton7>
there are a few ad-hoc ones. the github one is pretty popular
<airtonix>
yes. and I don't agree with it. why should I trust the inputs?
<canton7>
the linked article basically says "... except at the boundaries"
<canton7>
but that styleguide is just someone's opinion - don't take it as gospel
axsuul has joined #ruby
<airtonix>
understood. but it helps when there is a canonical reference
ahawkins has joined #ruby
<canton7>
like I say, the one I linked to is pretty popular
<airtonix>
ok, what about the equiv of pythons *args, **kwargs for ruby?
mrsolo has quit [Quit: This computer has gone to sleep]
dangerousdave has quit [Read error: Connection reset by peer]
<airtonix>
oh having kwargs is frowned upon in ruby?
funburn has joined #ruby
dangerousdave has joined #ruby
Macaveli has quit [Read error: Connection reset by peer]
<canton7>
*args is the same, for **kwargs we normally just use a hash (though I believe ruby 2.1 is getting proper support here?)
tonni has joined #ruby
<canton7>
so e.g. foo(foo: 'bar', one: 'two') is syntactically the same as foo({foo: 'bar', one: 'two'}), and foo can have the signature 'def foo(kwargs)'
funburn has quit [Client Quit]
<airtonix>
oh nice
leonidlm has joined #ruby
<sevenseacat>
why do people still insist on 80-character lines in 2013 (sorry, just reading style guide)
<canton7>
that does have disadvantages to "real" keyword args, which is why we're finally getting proper support :)
tatsuya_o has quit [Remote host closed the connection]
<airtonix>
sevenseacat: because not everyone has massive screens
<airtonix>
sevenseacat: and reading code in various containers makes that easier.
<canton7>
sevenseacat, the best reason I've seen is that people like to have multiple terms up on one screen
buibex has quit [Remote host closed the connection]
<canton7>
though that doesn't stop me coding to 120 chars :P
<sevenseacat>
also, i love the term SCREAMING_SNAKE_CASE
user258467 has joined #ruby
<airtonix>
canton7: see I just have a hard time wrapping my head around ruby (and rails), i'm not a computer science graduate.
<canton7>
airtonix, leave rails until you've grasped ruby - it's a whole beast untu itself
<sevenseacat>
120 sounds like a good compromise
<canton7>
*unto
<airtonix>
canton7: i hear ya
Monie has quit [Ping timeout: 256 seconds]
<canton7>
ruby itself is really nice if you give it a few days. imo blocks > list comprehensions, and have some other neat uses
<Hanmac>
canton7 hm **kwargs are already in 2.0 as i know but 2.1 get "required keyword args"
<sevenseacat>
ruby is an amazing language
<canton7>
I moved from python to ruby, so I sympathise with your viewpoint
buibex has joined #ruby
funburn has joined #ruby
<canton7>
Hanmac, gotcha. I misread the announcement :$
<airtonix>
is coffeescript inspired by ruby syntax?
<canton7>
airtonix, there we go, both *args and **kwargs
DrCode has joined #ruby
zarubin has joined #ruby
<canton7>
airtonix, maybe a bit? it's not particularly similar though
<sevenseacat>
airtonix: yes
<airtonix>
canton7: oh and what about class based mixins. with django I like to use those alot.
vpretzel has joined #ruby
<canton7>
airtonix, ruby has mixins. we use them all the freaking time
<blastDAbLast>
Hanmac, Ahhh that makes so much sense, thats for the clarification, yah my program goes buggy if i change the |x| to |x, y|, |x| just works fine ty for the tip :D
nbrosnahan has quit [Max SendQ exceeded]
kaspergrubbe has joined #ruby
<blastDAbLast>
s/thats/thanks/
nbrosnahan has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
yacks has joined #ruby
havenwood has joined #ruby
ADot has joined #ruby
leonidlm has joined #ruby
xk_id has quit [Quit:
havenwood has quit [Ping timeout: 240 seconds]
zoee has joined #ruby
rdark has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
Mars` has quit [Remote host closed the connection]
Mars` has joined #ruby
ADot has quit [Ping timeout: 248 seconds]
ewnd9 has joined #ruby
<krz>
{eval(foo) => 'bar'} better way to do this
<krz>
foo is a string
popl has quit [Quit: We must make an idol of our fear, and call it God.]
zerun0 has joined #ruby
Kar- has joined #ruby
rrichardsr3 has quit [Quit: -- I'm getting very tired --]
emergion has joined #ruby
Mars` has quit [Ping timeout: 245 seconds]
<canton7>
a string containing what?
<Hanmac>
krz obj.send(foo) or obj.public_send(foo)
quoin has joined #ruby
emergion has quit [Read error: Connection reset by peer]
ElderFain has joined #ruby
quoin_ has joined #ruby
quoin has quit [Ping timeout: 245 seconds]
jhn has quit [Ping timeout: 252 seconds]
leonidlm has quit [Ping timeout: 240 seconds]
dcunit3d has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
<workmad3>
Hanmac: that's only good if 'foo' is just an argument-less method name
dhruvasagar has joined #ruby
doritostains has quit [Quit: Leaving...]
michael_mbp is now known as zz_michael_mbp
sevenseacat has quit [Quit: Leaving.]
blackmesa has joined #ruby
<lewis_>
Hanmac: why do you use 'abcde'.chars
lewis_ is now known as Lewix
Lewix has quit [Changing host]
Lewix has joined #ruby
Guest77028 has joined #ruby
<Hanmac>
Lewix: yeah each_char would work too
freerobby has joined #ruby
Aryasam has quit [Ping timeout: 246 seconds]
TMM has joined #ruby
<Lewix>
Hanmac: I see, I didn't know chars
<TMM>
hello! I was wondering if you guys know if there was generic support for URNs in ruby or an external gem
atno has quit [Quit: Leaving]
<TMM>
due to the genericity of 'ruby' and 'urn' and 'gem' my google foo is failing me
<Hanmac>
chars and each_char was the same (both return enumerators) but chars was changed later so it returns an array ... the same is for lines, bytes, and codepoints
dangerousdave has joined #ruby
tatsuya_o has joined #ruby
Guest77028 has quit [Ping timeout: 264 seconds]
<mikecmpbll>
this is just a exercise of curiosity
antix has joined #ruby
<mikecmpbll>
i'd like to turn an unbound method to a proc
freerobby has quit [Ping timeout: 245 seconds]
antix is now known as Guest37222
<mikecmpbll>
nvm ignore me.
jibi has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
buibex has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
dcunit3d has joined #ruby
<Hanmac>
TMM hm what is "URN" ?
sarmiena_ has quit [Quit: sarmiena_]
nanoxd has joined #ruby
leonidlm has joined #ruby
snovak has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
Guest37222 has quit [Ping timeout: 245 seconds]
<mikecmpbll>
uniform resource name
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
antix_ has joined #ruby
buibex has joined #ruby
Guest64968 has joined #ruby
tjsousa has joined #ruby
dhruvasagar has joined #ruby
<Hanmac>
hm there are gems for UUID ... for "Universally unique identifier" ... isnt that similar enough?
filipe has quit [Read error: Operation timed out]
klaut has joined #ruby
snovak has quit [Ping timeout: 246 seconds]
julweber has joined #ruby
kevinykchan has joined #ruby
antix_ has quit [Ping timeout: 248 seconds]
antix_ has joined #ruby
klaas_ is now known as klaas
leonidlm has quit [Read error: Operation timed out]
dhruvasagar has quit [Read error: Connection reset by peer]
kevinykchan has quit [Client Quit]
dhruvasagar has joined #ruby
Targen_ has joined #ruby
postmodern has quit [Quit: Leaving]
Targen has quit [Ping timeout: 240 seconds]
<workmad3>
Hanmac: UUIDs are different from URNs ;)
<workmad3>
Hanmac: also, you don't need a gem for UUIDs
<Hanmac>
(i only see some uuid gems, i think that was before it was part of ruby)
<Mrdarknezz>
How do you check if a bash cmd has support for an arguement?
brennanMKE has quit [Remote host closed the connection]
antix_ has quit [Ping timeout: 260 seconds]
antix_ has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
vim_shim has quit [Ping timeout: 245 seconds]
<workmad3>
TMM: there's the ruby stdlib URI class
<workmad3>
TMM: that probably handles a lot of URN stuff (seeing as URNs are a type of URI ;) )
mengu_ has joined #ruby
<jokke>
hello
<jokke>
i'm trying to write a weechat plugin which uses drb. when i want to connect to the server (which is started by the plugin) i get the error DRb::DRbServerNotFound
mneorr_ has quit [Remote host closed the connection]
obs has joined #ruby
sandelius has joined #ruby
antix has joined #ruby
mneorr has joined #ruby
antix is now known as Guest50480
freerobby has quit [Ping timeout: 264 seconds]
mansi has quit [Ping timeout: 256 seconds]
Nahra_ has quit [Quit: Lost terminal]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gja has quit [Quit: This computer has gone to sleep]
snovak has joined #ruby
leonidlm has quit [Ping timeout: 246 seconds]
schaerli has quit [Remote host closed the connection]
Guest50480 has quit [Ping timeout: 256 seconds]
sarkie has joined #ruby
BRMatt has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
gyre007 has joined #ruby
nemesit|znc has joined #ruby
<sarkie>
Hi guys, looking for a bit of advice, I have been tasked to build a system that has certain "rules" based on a user, "if the users basket has item 123" "and the user is from uk" "and the date is xyz" then do something, I'd like to show these rules in 'english' and parse them, I have seen rules engine, nlp, others, do you think this is over kill and should just do a regex approach?
Xeago has joined #ruby
lkba has joined #ruby
mikecmpbll has joined #ruby
VTLob has joined #ruby
swingha has quit [Quit: Bye]
kaspergrubbe has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
snovak has quit [Ping timeout: 260 seconds]
<canton7>
sarkie, I'd write a little DSL, but certainly not a full-blown rules parser
<sarkie>
canton7, that's what I'm thinking and how about parsing it, just regex match a rule, and split the dsl into parts and find a rule which matches each part? "the basket has {thing}" "user is" ... ?
<sarkie>
canton7, ah, its just the item, country, date etc are defined by the user and it needs to be stored as a string somewhere. so maybe http://pastie.org/8374368 ?
<canton7>
sarkie, hmm? I'm meaning the user writes the contents of my pastie, as their way of configuring the rule
<sarkie>
canton7, ah!
schaerli has joined #ruby
<sarkie>
canton7, that may work indeed. thanks that's deffo something to think about. thanks
mengu has quit [Remote host closed the connection]
fearoffish has quit [Excess Flood]
antix_ has quit [Ping timeout: 256 seconds]
fearoffish has joined #ruby
<canton7>
sarkie, the advantage of dsls is they're dead easy to write, and syntax checking is done by the rule parser
fearoffish has quit [Excess Flood]
gja has joined #ruby
mengu has joined #ruby
fearoffish has joined #ruby
fearoffish has quit [Excess Flood]
antix_ has joined #ruby
<sarkie>
canton7, yeah, was just trying to think of the best way to write the dsl and parse it by "something"
julweber has quit [Remote host closed the connection]
<sarkie>
canton7, the user will be creating the rule on a site, then running but (thanks for the example, perfect) I kept seeing the instance_eval and didn't quite 'get it' till now, this is exactly what I need.
<canton7>
cool, obviously that approach might not be right for you, but it's food for thought
<canton7>
if it's website-based, I'd be tempted to do it entirely graphically
<canton7>
click the "Add condition" link, select the condition from a drop-down, condition options appear, fill in the right values etc
jbpros has quit [Quit: jbpros]
<sarkie>
my idea, was, the web creates the rules, using ddl, creating a string dsl 'thing' and then a RoR apps picks it up and runs the rules, it also needs to work with a js script currently using nodejs that I might replace if I can.
mengu has quit [Ping timeout: 264 seconds]
quoin_ has quit [Remote host closed the connection]
quoin has joined #ruby
antix_ has quit [Ping timeout: 264 seconds]
Stygia has joined #ruby
dhruvasagar has quit [Read error: Connection reset by peer]
<sarkie>
using http://jsonselect.org/#tryit to validate a json object if the user passes a trigger then the ruby rules engine to update something, I'd love to combine them but deffo food for thought.
ahawkins_ has joined #ruby
dhruvasagar has joined #ruby
starfox21 has joined #ruby
antix_ has joined #ruby
freerobby has joined #ruby
leonidlm has quit [Ping timeout: 240 seconds]
havenwood has joined #ruby
apeiros has joined #ruby
ahawkins has quit [Ping timeout: 252 seconds]
vishal has quit [Remote host closed the connection]
helloworld has joined #ruby
Advocation has joined #ruby
freerobby has quit [Ping timeout: 240 seconds]
Sander^work has quit [Read error: Connection timed out]
antix_ has quit [Ping timeout: 248 seconds]
havenwood has quit [Ping timeout: 240 seconds]
quoin has quit [Ping timeout: 256 seconds]
antix_ has joined #ruby
codecop has joined #ruby
dbrenaud is now known as dbRenaud
r0bgl33s0n has quit [Ping timeout: 248 seconds]
ADot has joined #ruby
quoin has joined #ruby
Macaveli has joined #ruby
Guest98448 is now known as karlfreeman
ADot has quit [Ping timeout: 240 seconds]
joonty has quit [Ping timeout: 240 seconds]
antix_ has quit [Ping timeout: 256 seconds]
funburn has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
funburn has joined #ruby
antix_ has joined #ruby
kevinykchan has joined #ruby
blackmes1 has joined #ruby
leonidlm has joined #ruby
sectionme has quit [Ping timeout: 246 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
nfk has quit [Quit: yawn]
antix_ has quit [Ping timeout: 252 seconds]
relix has joined #ruby
nari has quit [Ping timeout: 246 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
kaspergrubbe has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
julweber has joined #ruby
dhruvasagar has joined #ruby
mengu has joined #ruby
evenix_ has quit [Remote host closed the connection]
evenix has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
evenix has joined #ruby
evenix_ has joined #ruby
mengu has joined #ruby
nomenkun has joined #ruby
tonni_ has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
mengu_ has quit [Quit: This computer has gone to sleep]
antix_ has quit [Ping timeout: 240 seconds]
fijimunkii has quit [Ping timeout: 248 seconds]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
leonidlm has quit [Read error: Operation timed out]
butblack has joined #ruby
ry4nn_ has quit [Remote host closed the connection]
<tobiasvl>
if you ignore the two silly and wrong examples, what's wrong with that approach?
DrCode has joined #ruby
Bry8Star{T2 has joined #ruby
nbrosnahan has quit [Ping timeout: 240 seconds]
joonty has joined #ruby
rahulkmr1 has joined #ruby
leonidlm has joined #ruby
butblack has quit [Quit: butblack]
Domon has quit [Ping timeout: 252 seconds]
jprovazn has quit [Quit: Leaving]
<krz>
thanks tobiasvl
aagdbl has quit [Quit: Leaving.]
rahulkmr has quit [Ping timeout: 252 seconds]
decoponio has joined #ruby
buibex has quit [Remote host closed the connection]
antix_ has quit [Ping timeout: 264 seconds]
aagdbl has joined #ruby
antix_ has joined #ruby
julweber has joined #ruby
Ferr has joined #ruby
<Ferr>
Use a while-loop only to loop forever, and that means probably never. This only applies to Ruby, other
<Ferr>
languages are different
<Ferr>
. Could anyone please have a comment on this?
<apeiros>
ferr: uh, context?
<Ferr>
I'm reading a book "Learn ruby the hard way" and in the section "Rules for Loops" I found this
<apeiros>
`loop do …end` is to loop forever (and my CS prof would say that no such thing exists, that you failed to phrase the exit condition properly)
jibi has quit [Quit: .]
buibex has joined #ruby
bpgoldsb has joined #ruby
<Ferr>
I see but what I would like to know why the author prefers for-loop to while-loop
nbrosnahan has joined #ruby
<apeiros>
ferr: that's not written in what you pasted
<apeiros>
for-loop isn't even mentioned. did you leave out the relevant part?
Xeago has joined #ruby
<Ferr>
sec
vlad_starkov has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
<bpgoldsb>
I want to temporarily update my logger formatter with a prefix. My current idea is to save the original formatter, change the formatter, then reset to the original. How would I get the current formatter to save it? Or does someone else have a better idea?
<apeiros>
ferr: not inferable from that piece.
<apeiros>
generally `for` loops are frowned upon in ruby
antix_ has quit [Ping timeout: 245 seconds]
dangerousdave has joined #ruby
<canton7>
(we prefer #each, for some very good reasons)
<apeiros>
and `while` loops are a rare sight (IMO less rare in idiomatic ruby than for-loops)
KobraKao has joined #ruby
<apeiros>
I only have one good reason, but that one good reason is good enough to me :)
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
Mathieu has quit []
<apeiros>
the reason being: `for` is syntax, which is not very discoverable and not very flexible. `each` is a method, which is discoverable and flexible.
<apeiros>
(ok, 2 reasons)
<canton7>
I'd use `while` when I'm not iterating over a fixed-length collection, e.g. `while stack.count > 0`
dhruvasagar has quit [Read error: Connection reset by peer]
<apeiros>
yeah, or until input.empty?
<apeiros>
(until is while !())
<canton7>
yeah, I was trying to keep with the `while` theme
<apeiros>
I think I actually use until more often than while
<Ferr>
Ok
<Ferr>
I think I'll get it over the practise
<Ferr>
Thank you for your answers
<apeiros>
probably
<apeiros>
odd, I thought zed wrote idiomatic ruby
renanoronfle has joined #ruby
dhruvasagar has joined #ruby
<apeiros>
(zed being the author of lrthw)
leonidlm has quit [Ping timeout: 240 seconds]
<canton7>
`for` doesn't introduce a new scope, instead it mutates the loop variable. very bad when you're capturing the loop variable in a lambda or somethign
<Hanmac>
apeiros for does work with other stuff too : P
<EspenA>
running rubygems v2.1.2. trying to update but says it is latest version. Trying to install any gem: SSL certificate verify failed. Any ideas?
antix_ has joined #ruby
puppeh has left #ruby ["bb"]
nouitfvf has joined #ruby
Elhu has joined #ruby
obs has quit [Quit: Bye]
yalue has joined #ruby
mlpinit_ has joined #ruby
obs has joined #ruby
funburn has quit [Quit: funburn]
KobraKao has quit [Quit: Saindo]
antix_ has quit [Ping timeout: 240 seconds]
blackratdog has joined #ruby
eka has joined #ruby
leonidlm has quit [Read error: Operation timed out]
zoee has quit [Quit: zoee]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
mlpinit has quit [Ping timeout: 240 seconds]
ahawkins_ has quit [Quit: leaving]
ahawkins has joined #ruby
roadt_ has joined #ruby
sandelius has joined #ruby
fijimunkii has joined #ruby
IceyEC has joined #ruby
antix_ has quit [Ping timeout: 240 seconds]
ewnd9 has quit [Read error: Operation timed out]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
freerobby has joined #ruby
fijimunkii has quit [Ping timeout: 241 seconds]
dbRenaud has quit [Changing host]
dbRenaud has joined #ruby
Matriks has quit [Remote host closed the connection]
Guest64968 has quit [Ping timeout: 264 seconds]
nfk has quit [Remote host closed the connection]
zoee has joined #ruby
it_tard has joined #ruby
sectionme has quit [Ping timeout: 240 seconds]
<TwinkleHood>
Hey having trouble with threads. https://gist.github.com/kholbekj/9d902ac7a94b1a5a29fb My methods doesn't seem able to access the 'client' variable, but if i make it instance, I'm affraid it'll thread-collide.
sectionme has joined #ruby
freerobby has quit [Ping timeout: 248 seconds]
blastDAbLast has quit [Quit: Leaving]
framling_ is now known as framling
antix_ has quit [Ping timeout: 240 seconds]
levin has joined #ruby
levin is now known as Guest47789
dhruvasagar has quit [Ping timeout: 240 seconds]
ldnunes has joined #ruby
EspenA has quit [Remote host closed the connection]
<dr_bob>
The error you are seeing is the reason for the thread.
mayday_jay has joined #ruby
<jokke>
what is init...
<dr_bob>
Anything you need.
<jokke>
ok
<jokke>
hm
<jokke>
but $SAFE is already set to 1
xk_id has quit [Client Quit]
<dr_bob>
Then I probably do not understand your problem.
mklappstuhl has quit [Remote host closed the connection]
jprovazn has joined #ruby
<Hanmac>
dr_bob: his global $SAFE is to high
<jokke>
yup
<jokke>
because it's drb code
<jokke>
or rather code run in drb
Beoran_ has joined #ruby
<jokke>
that'd be quite a drawback if one couldn't read files in drb...
antix_ has quit [Ping timeout: 240 seconds]
soba has quit [Ping timeout: 260 seconds]
<Ferr>
who could advise me how to could comfortable in general? I am making a game similar to this https://gist.github.com/anonymous/6809544 but with lots of rooms and other options
<Ferr>
*code
krawchyk has joined #ruby
mlpinit has joined #ruby
leonidlm has joined #ruby
sandelius has joined #ruby
antix has joined #ruby
antix is now known as Guest77147
Beoran__ has quit [Ping timeout: 248 seconds]
Squarepy has joined #ruby
Targen_ has quit [Ping timeout: 240 seconds]
Zeeraw has joined #ruby
tkuchiki has quit [Remote host closed the connection]
sjltaylor has quit [Ping timeout: 240 seconds]
Guest77147 has quit [Ping timeout: 245 seconds]
larissa has joined #ruby
tkuchiki has joined #ruby
polaco_zZz is now known as polaco
mklappstuhl has joined #ruby
<Hanmac>
ferr: you can make Action Objects with procs for the with the code ... that would be like bear_room = Room.new(:bear); bear_room.add_action("taunt bear") {|r| r.bear_moved? ? ... : ... }
antix_ has joined #ruby
antix_ has joined #ruby
xk_id has joined #ruby
Guest65970 has quit [Ping timeout: 240 seconds]
T_T has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<Ferr>
Hanmac, what should I google for the official documentation of action objects?
<Hanmac>
ferr: there no one ... that was a silly sample ... oyu need to make it your self (with storing the procs )
yfeldblum has joined #ruby
<Ferr>
lol
<Ferr>
thank you anyways
<|Frederik>
I'm getting this syntax error in an erb file: https://paste.debian.net/49474/ Any suggestion about what could be wrong?
tkuchiki has quit [Remote host closed the connection]
antix_ has quit [Ping timeout: 240 seconds]
snovak has joined #ruby
T_T has quit [Remote host closed the connection]
nari has joined #ruby
shaunbaker has quit [Remote host closed the connection]
wmoxam has joined #ruby
<bean__>
|Frederik: i'd probably have to see the whole erb file to know
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
jerius has joined #ruby
mfilipe has left #ruby [#ruby]
peregrine81 has joined #ruby
MisutoWolf has joined #ruby
pellenation has joined #ruby
khushildep_ has joined #ruby
theRoUS has joined #ruby
MrThePlague has joined #ruby
MrThePlague has quit [Changing host]
MrThePlague has joined #ruby
leonidlm has quit [Ping timeout: 240 seconds]
khushildep has quit [Read error: Operation timed out]
khushildep_ is now known as khushildep
Lorn_ is now known as Lorn
Lorn has quit [Changing host]
Lorn has joined #ruby
<|Frederik>
bean__: I think I found it. I needed escaping some <% in that file.
<bean__>
ah
* bean__
likes chef better anyways ;)
zoee has quit [Quit: zoee]
<MisutoWolf>
Hello! I have a bit of a question I'm trying to work out. I'm pretty new to ruby, and I'm attempting to screw around with sockets and stuff.
xk_id has quit [Quit:
niklasb has joined #ruby
<MisutoWolf>
Anyway, I'm working with the Source Engine (HL2, CS, etc.) protocol, and I'm trying to figure out how to get the last 4 bytes of the response that getchallenge() gives me
<tobiasvl>
so yeah, it's an array with a string in it
nutella is now known as Guest9873
tjad has quit [Ping timeout: 240 seconds]
<MisutoWolf>
ah
kevinykchan has joined #ruby
khushildep has quit [Quit: khushildep]
<MisutoWolf>
so it returns an array with just the string...if I want to manipulate the string, i'd need to deal with like
freezey has quit [Remote host closed the connection]
<MisutoWolf>
unpack(stuff)[0]?
codecop has quit [Remote host closed the connection]
bean__ has quit [Ping timeout: 240 seconds]
<tobiasvl>
that gived you the entire string, yeah
elplatt has quit [Quit: elplatt]
<tobiasvl>
but if you just want the last four bytes you can tell that to unpack
antix_ has quit [Ping timeout: 264 seconds]
bean__ has joined #ruby
<tobiasvl>
(i think)
bean__ has quit [Client Quit]
<tobiasvl>
but yeah, you can probably do what you said, and then just index the string
khushildep has joined #ruby
xk_id has joined #ruby
<MisutoWolf>
awesome. This is really my first experience with the language, I'm sure I'll figure out this stuff over time. I have to say, I love it so far. It's pretty neat. :D
dodosan has quit [Remote host closed the connection]
<TwinkleHood>
Hey having trouble with threads. https://gist.github.com/kholbekj/9d902ac7a94b1a5a29fb My methods doesn't seem able to access the 'client' variable, but if i make it instance, I'm affraid it'll thread-collide.
antix_ has joined #ruby
<TwinkleHood>
Using Thread.current["client"] from the method definition doesn't seem to work either.
<shevy>
BlakeRG I think you could actually get away learning only a subset of ruby
<shevy>
BlakeRG but it's very much a niche to confine ruby solely to the www
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby
antix_ has quit [Ping timeout: 241 seconds]
shaunbaker has joined #ruby
shaunbaker has quit [Remote host closed the connection]
coaster has joined #ruby
<BlakeRG>
shevy: i guess it's possible, there are a ton of wordpress and drupal people in PHP land who don't know the language well but get away with a lot of things
scarolan has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<shevy>
I think ruby is more complex than php as a language though
<shevy>
so the gap may be wider
antix_ has joined #ruby
<shevy>
like ask a newcomer to rails, what is yield, what is lambda, when should he use a module, when a class, how can he mixin class methods from modules into classes, how to use hook events, how to use respond_to? and method_missing, what is caller() etc...
<shevy>
php tried to simplify things
maletor has joined #ruby
<shevy>
function FOO()
khoury has joined #ruby
<shevy>
one data structure array for hashes and arrays
GeissT has quit [Quit: MillBroChat AdIRC User]
julweber has joined #ruby
hogeo has quit [Remote host closed the connection]
<burlyscudd>
PHP is a language like scrapple is a meat
<shevy>
quote: " I don't see the point, especially for something like PHP where most of the scripts will be rather simple and in most cases written by non-programmers who want a language with a basic logical syntax that doesn't have too high a learning curve."
<shevy>
so at least someone has had the idea that the language should be simple
codezomb has joined #ruby
<shevy>
somehow, something failed someday ... :\
khoury has left #ruby [#ruby]
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
<shevy>
burlyscudd hopefully I will never accidentally eat scrapple
<workmad3>
shevy: personally, I think that PHP went too simple
buibex has quit [Ping timeout: 240 seconds]
<workmad3>
shevy: it also went pretty ugly, but that's a side-issue :)
<bean__>
$FB has "hack lang" and "hip hop vm" that does a lot of awesome stuff w/r/t type checking in php now
<bean__>
its pretty cool
seich- has quit [Ping timeout: 260 seconds]
<waxjar>
if they went for simple the std lib wouldn't be such a mess :P
sambao21 has quit [Quit: Computer has gone to sleep.]
antix_ has quit [Ping timeout: 246 seconds]
tatsuya__ has joined #ruby
<workmad3>
waxjar: don't confuse 'simple' with 'easy to use' ;)
leonidlm has joined #ruby
Aryasam has joined #ruby
hogeo has quit [Ping timeout: 252 seconds]
io_syl has joined #ruby
kpshek has joined #ruby
gemmy has quit [Ping timeout: 240 seconds]
Aryasam has quit [Read error: Connection reset by peer]
Aryasam has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
Rollabunna has joined #ruby
Matriks has joined #ruby
lkba has joined #ruby
ananthakumaran1 has joined #ruby
ananthakumaran1 has quit [Max SendQ exceeded]
geggam has joined #ruby
ananthakumaran1 has joined #ruby
ananthakumaran1 has quit [Max SendQ exceeded]
tatsuya_o has quit [Ping timeout: 245 seconds]
ananthakumaran1 has joined #ruby
ananthakumaran1 has quit [Max SendQ exceeded]
ukd1 has quit [Remote host closed the connection]
ananthakumaran1 has joined #ruby
ukd1 has joined #ruby
ananthakumaran has quit [Ping timeout: 240 seconds]
robert___ has joined #ruby
robert___ has quit [Changing host]
robert___ has joined #ruby
tkuchiki has joined #ruby
julweber has quit [Remote host closed the connection]
plotter has quit [Remote host closed the connection]
joesavage has joined #ruby
robert_ has quit [Ping timeout: 260 seconds]
nisstyre has quit [Quit: Leaving]
<joesavage>
If I use "File.open" to create a new file on my server in Ruby with user X, what permissions will the new file have? (And presumably the owner of that file will be the user running the ruby script?)
<heftig>
depends on the umask
ravster has joined #ruby
gcds has quit [Quit: gcds]
ukd1 has quit [Ping timeout: 240 seconds]
rdark has quit [Ping timeout: 240 seconds]
antix_ has quit [Ping timeout: 264 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
burlyscudd has quit [Quit: Leaving.]
intuxicated has quit [Remote host closed the connection]
kaspergrubbe has quit [Read error: Connection reset by peer]
<heftig>
by default File.open uses 0666, and a typical umask would be 0022; so the permissions would be 0666 & ~0022 = 0644
leonidlm has quit [Ping timeout: 248 seconds]
antix_ has joined #ruby
ffranz2 is now known as ffranz
barts_ has joined #ruby
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
kaspergrubbe has joined #ruby
rdark has joined #ruby
plotter has joined #ruby
ukd1 has joined #ruby
wallerdev has joined #ruby
robert___ is now known as robert_
<krz>
what does it mean when one gets: (Object doesn't support #inspect)
maletor has quit [Quit: Computer has gone to sleep.]
nari has quit [Ping timeout: 248 seconds]
<krz>
its self explanatory. but why is it happening?
bluOxigen has joined #ruby
barts_ has quit [Client Quit]
christian has joined #ruby
<workmad3>
krz: did you inherit from BasicObject for something?
<krz>
run User.new and you get (Object doesn't support #inspect)
<apeiros>
gah! PEOPLE STAAAAHP!
<apeiros>
don't abuse self.included.
<apeiros>
srsly
Soda has quit [Read error: Connection reset by peer]
<krz>
apeiros: whats the alternative? active concern?
Aryasam has quit [Read error: Connection reset by peer]
<apeiros>
proper ruby
Aryasam has joined #ruby
<apeiros>
you don't have to use callback magic. just be explicit.
mklappstuhl has quit [Ping timeout: 245 seconds]
BlakeRG has left #ruby [#ruby]
<apeiros>
just pretend self.included wouldn't exist.
havenwood has quit [Remote host closed the connection]
alex__c2022 has joined #ruby
lfox has quit [Quit: ZZZzzz…]
BSaboia has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
<krz>
apeiros: how would you extend a module from within a module without self.included?
havenwood has joined #ruby
ADot has joined #ruby
ukd1 has quit [Remote host closed the connection]
ADot has quit [Max SendQ exceeded]
Guest43556 has quit [Ping timeout: 264 seconds]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
ukd1 has joined #ruby
<apeiros>
krz: why do you think you need self.included just to do extend?
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
threesome has quit [Ping timeout: 240 seconds]
admin0 has quit [Read error: Connection reset by peer]
leonidlm has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
<krz>
apeiros: because im ignorant and out of alternatives :P
clov3r has joined #ruby
antix_ has joined #ruby
ADot has joined #ruby
maligree has quit [Quit: I've had it with you.]
antix_ has quit [Changing host]
antix_ has joined #ruby
ADot has quit [Max SendQ exceeded]
Macaveli_ has quit [Quit: Computer has gone to sleep.]
<apeiros>
krz: how about just calling extend?
hanoi has quit [Ping timeout: 241 seconds]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
user258467 has quit [Quit: Quitte]
hanoi has joined #ruby
<apeiros>
and if you really want to hold the users's hand because he can't be arsed to do an include and and extend himself, provide a method.
mrsolo has joined #ruby
siwica has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
<apeiros>
-spelink mistaakes
himsin has joined #ruby
ADot has joined #ruby
platzhirsch has joined #ruby
ADot has quit [Max SendQ exceeded]
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
<krz>
k, ill try that after i fix the issuw with the inspect
mklappstuhl has joined #ruby
<krz>
any ideas?
ADot has joined #ruby
havenwood has quit [Ping timeout: 245 seconds]
ADot has quit [Max SendQ exceeded]
obs has quit [Quit: Bye]
<platzhirsch>
Importing a 3 GB JSON file to MongoDB sucks, allocates 12 GB virtual memory and then the process gets killed. Even with streamed JSON processing.. not feasible *sigh*
krawchyk_ has quit [Remote host closed the connection]
ADot has joined #ruby
obs has joined #ruby
krawchyk has joined #ruby
baroquebobcat has joined #ruby
persand has quit [Quit: persand]
antix_ has quit [Ping timeout: 240 seconds]
Kar- has joined #ruby
intuxicated has joined #ruby
zz_tsykoduk is now known as tsykoduk
mengu has quit [Remote host closed the connection]
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nemesit|znc has quit [Ping timeout: 264 seconds]
nemesit|znc has joined #ruby
badquanta has joined #ruby
siwica has quit [Ping timeout: 264 seconds]
quoin has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bline79>
I'm trying to remove the last two characters from a variable, but am getting " can't convert Range into Integer (TypeError)" http://pastie.org/8375153
<workmad3>
Hanmac: I missed that it was .. not ... ;)
<bline79>
I got it :D Thanks again for your help guys
<bline79>
:D :D
<workmad3>
Hanmac: [0...-3] would be last 3 digits
ColKurtz has joined #ruby
julweber has joined #ruby
duggiefresh has joined #ruby
<Trudko>
Guys I am using $. to display number of line in file (part of code => http://pastie.org/8375241), sometimes it gives me some hight number like 1534 eventhough file has 4 line do I miss something obvious?
nemesit|znc has quit [Ping timeout: 248 seconds]
antix_ has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.4.1]
Monie has joined #ruby
<krz>
Hanmac: yea i think i see the issue
colonolGron has joined #ruby
<krz>
thanks for clearing that up
<Hanmac>
Trudko: i think you need __LINE__
<Hanmac>
Trudko: or do you want the line of inside the csv file?
whunt has quit [Quit: Computer has gone to sleep.]
stkowski has joined #ruby
<Trudko>
yes because I want to tell user on which line he made some mistake
zeade has joined #ruby
<Hanmac>
Trudko: try .with_index i dont know if it fixed or not ...
Nisstyre-laptop has joined #ruby
nari has quit [Ping timeout: 245 seconds]
michael_mbp is now known as zz_michael_mbp
<Trudko>
I found $INPUT_LINE_NUMBER
antix_ has quit [Ping timeout: 240 seconds]
seejohnrun has quit [Quit: leaving]
<Trudko>
seems like that might do a trick
<Hanmac>
hm i dont think that is what you want
a1ph4g33k has joined #ruby
Stygia has quit [Quit: Leaving]
<a1ph4g33k>
Good morning folks.
starfox21 has joined #ruby
conner has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
taion809 is now known as zzz_taion809
Elhu has quit [Quit: Computer has gone to sleep.]
tvw has joined #ruby
noop has joined #ruby
ItSANgo has quit [Read error: Connection reset by peer]
buibex has quit [Remote host closed the connection]
b00stfr3ak has quit [Ping timeout: 240 seconds]
supergeek has quit [Client Quit]
Es0teric has joined #ruby
ADot has joined #ruby
dhruvasagar has joined #ruby
chrisja has joined #ruby
ADot has quit [Max SendQ exceeded]
heidi has joined #ruby
b00stfr3ak has joined #ruby
iamjarvo has joined #ruby
krz has quit [Quit: krz]
ADot has joined #ruby
supergeek has joined #ruby
supergeek has quit [Max SendQ exceeded]
ADot has quit [Max SendQ exceeded]
Guest26183 has quit [Ping timeout: 245 seconds]
iliketurtles has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
reset has joined #ruby
snovak has joined #ruby
ADot has joined #ruby
ADot has quit [Max SendQ exceeded]
<sarkie_>
Hanmac, sorry we are still trying to understand that.
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
burlyscudd has joined #ruby
<platzhirsch>
so, maybe that's obvious, but for me it was not. If you plan to run your application on JRuby, plan it early :D
ADot1 has joined #ruby
ADot1 has quit [Max SendQ exceeded]
funburn has joined #ruby
ADot1 has joined #ruby
IceDragon has joined #ruby
ADot1 has quit [Max SendQ exceeded]
senayar has quit [Ping timeout: 245 seconds]
<Morrolan>
sarkie_: The answer is "yes". Those posts to which he linked you just serve to show what kind of parameterers you can use. (All at once, if you want to.)
xk_id has joined #ruby
ADot1 has joined #ruby
jaynewst_ has joined #ruby
ADot1 has quit [Max SendQ exceeded]
supergeek has joined #ruby
jaynewstrom has quit [Read error: Connection reset by peer]
<apeiros>
Guest65368: yes, but what Hanmac says remains
<Guest65368>
the class variable stuff is a little tricky in Ruby
<apeiros>
you can simply drop the class << self part
nbrosnahan has quit [Max SendQ exceeded]
verto has quit [Ping timeout: 252 seconds]
<apeiros>
Guest65368: not really, no. but it helps if you understand the idea behind it.
<Guest65368>
apeiros, that's what I try to.
nbrosnahan has joined #ruby
nbrosnahan has quit [Max SendQ exceeded]
<apeiros>
Guest65368: you should get yourself a nick…
kemist has quit [Ping timeout: 248 seconds]
<Guest65368>
apeiros, working on it.
soheil has quit [Read error: Connection timed out]
<apeiros>
Guest65368: `class << some_obj; def foo; … ; end; end` is the same as `def some_obj.foo; … ; end`
pettsson has joined #ruby
Guest65368 has quit [Quit: Verlassend]
<apeiros>
and @ivars belong to a single object (objects are "an instance" -> hence instance variables). they always belong to the object referenced by `self` in the same context.
soheil has joined #ruby
<apeiros>
within `class …; end`, self refers to the class which is opened
<Hanmac>
and the other one: def self.configure options={}; (@name ||= super.dup).merge!(options); end
Nahra has joined #ruby
Nahra has quit [Changing host]
Nahra has joined #ruby
lukec has joined #ruby
jokke has quit [Client Quit]
jokke has joined #ruby
antix_ has quit [Ping timeout: 245 seconds]
xcv has quit [Read error: Connection reset by peer]
fflush has joined #ruby
jefflyne has joined #ruby
jokke has quit [Client Quit]
cescalante is now known as ce_afk
Mars` has quit [Ping timeout: 260 seconds]
antix has joined #ruby
<apeiros>
Hanmac: super in configure?
kaspergrubbe has joined #ruby
pavilionXP has quit [Quit: dead 2 the ladies 1st...]
<Hanmac>
apeiros: ah yeah i was wrong
antix is now known as Guest20299
sambao21 has joined #ruby
BRMatt has quit [Ping timeout: 260 seconds]
buibex has joined #ruby
MTen has joined #ruby
<Hanmac>
apeiros: hm this better? def self.configure options={}; (@name ||= name.dup).merge!(options); end
<apeiros>
I think so
dangerousdave has quit [Quit: Leaving...]
khushildep has quit [Ping timeout: 245 seconds]
tatsuya_o has joined #ruby
derekv2 has joined #ruby
jaynewst_ has quit [Remote host closed the connection]
dangerousdave has joined #ruby
doritostains has joined #ruby
jaynewstrom has joined #ruby
vishal has quit [Remote host closed the connection]
kazuuu has joined #ruby
ghr has joined #ruby
pwh has quit []
DrCode has quit [Ping timeout: 240 seconds]
Guest20299 has quit [Ping timeout: 251 seconds]
<derekv2>
I need to call mehtods out of a module. I'm in irb currently, i used require, and I can do Module::Nested.public_instance_methods and see the methods, but I can't evoke one
renanoronfle has joined #ruby
<derekv2>
I get NoMethodError (Undefined)
<apeiros>
derekv2: instance methods of a module need an instance to be called on
gyre007 has quit [Remote host closed the connection]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
<apeiros>
derekv2: i.e., you either need to include the module into a class, instantiate it and call the method on that instance
<Hanmac>
derekv2 an module or a class cant call its own instance methods ... (the only exception would be the class Class and the class Module)
graft_ has joined #ruby
RichardBaker has joined #ruby
<apeiros>
derekv2: or you have an object, call extend on it with the module, and then call the method on that object
<derekv2>
ok let me see if I can figure that out
<apeiros>
it's the same as with classes. when you do `class X; def foo; …; end; end`, you can't do `X.foo` either.
<graft_>
does anyone know the complexity of array subtraction? Like [ :a, :b, :c, :d ] - [ :a, :d ]
<apeiros>
graft_: O(n)
jbynum has joined #ruby
* Hanmac
is very complex today
<graft_>
apeiros: any idea how it works?
xcv_ has quit [Remote host closed the connection]
<apeiros>
graft_: it converts them into a hash
<Hanmac>
with magic?
<apeiros>
the values being the keys in the hash
clov3r has quit [Remote host closed the connection]
<graft_>
apeiros: ok, makes sense, thanks :)
<derekv2>
I understand for classes... but I guess I was thinking that Module was like a namespace, and I was looking at examples
buibex has quit [Remote host closed the connection]
visof has quit [Read error: Connection reset by peer]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
michael_mbp is now known as zz_michael_mbp
Nogbit has quit [Ping timeout: 240 seconds]
volty has joined #ruby
snovak_ has quit [Remote host closed the connection]
soheil has joined #ruby
Xanderby has quit [Quit: Xanderby]
fflush has joined #ruby
snovak has joined #ruby
fflush has quit [Client Quit]
robbyoconnor has quit [Ping timeout: 252 seconds]
jerius has quit [Ping timeout: 248 seconds]
fflush has joined #ruby
fflush has quit [Client Quit]
sailias has quit [Quit: Leaving.]
snovak_ has joined #ruby
PragCypher has joined #ruby
synfin has quit [Read error: Operation timed out]
snovak_ has quit [Remote host closed the connection]
jokke has quit [Quit: WeeChat 0.4.1]
petey has joined #ruby
jokke has joined #ruby
fflush has joined #ruby
snovak_ has joined #ruby
fflush has quit [Changing host]
fflush has joined #ruby
codecop has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
snovak has quit [Ping timeout: 245 seconds]
mayday_jay has quit [Ping timeout: 248 seconds]
angusiguess has quit [Ping timeout: 245 seconds]
antix_ has quit [Ping timeout: 264 seconds]
snovak has joined #ruby
dhruvasagar has quit [Ping timeout: 256 seconds]
jokke has quit [Client Quit]
jokke has joined #ruby
antix_ has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
forced_request has joined #ruby
snovak_ has quit [Ping timeout: 248 seconds]
mneorr has joined #ruby
voidPirate has joined #ruby
Mars` has joined #ruby
fuhgeddaboudit has joined #ruby
sectionme has joined #ruby
snovak has quit [Ping timeout: 252 seconds]
apeiros has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 245 seconds]
reset has quit [Quit: Leaving...]
Mars` has quit [Remote host closed the connection]
apeiros has joined #ruby
Mars` has joined #ruby
antix_ has quit [Ping timeout: 248 seconds]
burlyscudd has quit [Quit: Leaving.]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Nogbit has joined #ruby
kaldrenon has quit [Remote host closed the connection]
endash has joined #ruby
Ox6abe has joined #ruby
kaldrenon has joined #ruby
freerobby has quit [Quit: Leaving.]
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
Kar- has quit [Ping timeout: 240 seconds]
sectionme has quit [Ping timeout: 252 seconds]
freerobby has joined #ruby
nemesit|znc has quit [Ping timeout: 245 seconds]
nutella_ has quit [Ping timeout: 240 seconds]
gyre007 has joined #ruby
codezomb has quit [Ping timeout: 240 seconds]
Mars` has quit [Ping timeout: 240 seconds]
sniffingcats has quit [Quit: Til rivido Idisti!]
kaldrenon has quit [Ping timeout: 264 seconds]
x1337807x has joined #ruby
funburn has quit [Read error: Connection reset by peer]
antix_ has quit [Ping timeout: 264 seconds]
axl_ has quit [Quit: axl_]
twoism has quit [Ping timeout: 240 seconds]
funburn has joined #ruby
mayday_jay has joined #ruby
<graft_>
i would find Array#bsearch so much more useful if it gave you the damn index of the element instead of the element itself
<graft_>
maybe i will file a bug
Mars` has joined #ruby
<graft_>
anyone know how to do that?
breakingthings has quit []
ldnunes has quit [Quit: Leaving]
antix_ has joined #ruby
quoin has joined #ruby
joofsh has quit [Remote host closed the connection]
<popl>
I don't think that's a bug.
elplatt has quit [Quit: elplatt]
<graft_>
feature request
joofsh has joined #ruby
jblack has quit [Quit: Lost terminal]
<Hanmac>
count the legs, if it has 6 its a bug, if it has 8 its a spider ,P
<graft_>
no, that's an insect... bug is a supercategory including both spiders and insects
mneorr has quit [Remote host closed the connection]
rainbyte16 has quit [Quit: Leaving]
<popl>
pedant harder
<popl>
there are true bugs (Hemiptera) but people don't ever really mean that
Zeeraw has joined #ruby
<canton7>
graft_, the ruby-doc examples do (0...ary.size).bsearch{ |i| ary[i] ... }, which seems like a reasonable workaround
<graft_>
also it depends on metamorphic stage, since many insects have more legs in larval stages
<graft_>
(how's that?)
Zeeraw has quit [Client Quit]
<graft_>
true bugs are also a kind of insect
headius has quit [Quit: headius]
<popl>
that's not the point of contention, though :P
<graft_>
canton7: guh, that's so obvious
Es0teric has joined #ruby
quoin has quit [Ping timeout: 245 seconds]
derekv2 has quit [Ping timeout: 250 seconds]
PragCypher has quit [Remote host closed the connection]
Es0teric has quit [Max SendQ exceeded]
joofsh has quit [Ping timeout: 246 seconds]
antix_ has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
iamjarvo has quit [Remote host closed the connection]
iamjarvo has joined #ruby
Vivekananda has quit [Remote host closed the connection]
<volty>
ary.each_with_index.bsearch ?
antix has joined #ruby
antix has quit [Changing host]
antix has joined #ruby
antix is now known as Guest83217
<Hanmac>
volty: does not work i tested it
<canton7>
yeah, Enumerable doesn't have bsearch defined on it
<volty>
... { |el, i| el > 4 }
<graft_>
you can probably do like to_enum on it to get it to work
<canton7>
the whole point of bsearch is it's on a collection which has O(1) access
jb41 has joined #ruby
gnnr has joined #ruby
<graft_>
canton7's way seems relatively inexpensive, although you do have to create an array from the range
PragCypher has joined #ruby
<Xeago>
kinda beats the point..
<volty>
ary.each_with_index.to_a.bsearch ?
Xeago has quit [Remote host closed the connection]
__main__ has quit [Read error: Connection reset by peer]
<graft_>
but mapping the array to array+index was what i was trying to avoid
<canton7>
(an enumerable is something you can iterate over, rather than something you can access at will)
interactionjaxsn has quit [Remote host closed the connection]
<canton7>
volty, you might as well not use bsearch then - you're iterating over the whole array
tonini_ has quit [Ping timeout: 248 seconds]
<canton7>
graft_, do you create an array from the range? Range has bsearch defined on it, so I assume it's clever
interactionjaxsn has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
<graft_>
hmm, maybe not
__main__ has joined #ruby
<bnagy>
_that_ would be a bug
failshell has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
<volty>
not necessarily -- depends on implementation
<volty>
i do not know how it's implemented
staafl has quit [Ping timeout: 240 seconds]
<canton7>
the only thing the methods on Enumerable know about the collection is that it defines #each. The Enumerable methods can only walk through the collection
<graft_>
looks like not
<graft_>
from my cursory reading of the source code
<volty>
i agree with graft_: in my methods dealing with lists, especially those of widgets, i always return [index, item]
Guest83217 has quit [Ping timeout: 240 seconds]
<canton7>
graft_, yeah, it does look sensible, I agree
adeponte has quit [Remote host closed the connection]
<graft_>
cool, so this seems like the way to go
<bnagy>
Range knows start and end, making an array to binary search would be nuts++ :)
<canton7>
sweet!
adeponte has joined #ruby
funburn has quit [Quit: funburn]
<bnagy>
graft_: out of interest, why do you want the index and not the element?
<shevy>
because he is a LIBRARIAN!!!
<shevy>
he has no interest for the content of the books! he just wants the index... indici!
antix_ has joined #ruby
<volty>
one can always benchmark, or monitor memory use
snovak has joined #ruby
<bnagy>
imho 'find the element matching t is the 'normal' semantic?
<bnagy>
*this
interactionjaxsn has quit [Ping timeout: 252 seconds]
nemesit|znc has joined #ruby
tvw has quit []
riceandbeans has joined #ruby
soheil has quit [Read error: Operation timed out]
<graft_>
bnagy: because sometimes i don't want the element, i want its neighbor
BlakeRG has left #ruby [#ruby]
Zeeraw has joined #ruby
<riceandbeans>
in ruby 1.9, if I make a custom class, how do I call on it
<volty>
bnagy, the world is nice because iit's all different, our world will be very poor if we, all of us, use 'normal semantics'
soheil has joined #ruby
<volty>
s/will/would/
<riceandbeans>
in ruby 1.8 I could make a file in the same directory called class.rb and have in there class Class, and then in the mail file, require Class and then var = class.new
<riceandbeans>
not in 1.9 though
<bnagy>
graft_: hm, yeah ok.
<volty>
given that 'normal semantics' has any semantical meaning
<shevy>
riceandbeans depends
<shevy>
riceandbeans a way that will work on both versions is to let ruby install things into SITE_DIR
<shevy>
then you can use plain old require
<shevy>
like how gems do, too
<riceandbeans>
I don't want ruby installing anything
<shevy>
if you dont want to install into SITE_DIR, you may have to append to $: or use require_relative
<riceandbeans>
I want this to be a small self contained thing
<shevy>
awww a shame
<bnagy>
shevy, riceandbeans this could just be a require_relative issue? no '.' in load patrh anymore etc
adeponte has quit [Ping timeout: 256 seconds]
<shevy>
I always install stuff like a project
<Hanmac>
riceandbeans: use always require_relative if possible
<riceandbeans>
if I do require_relative, will it be cross compatible with 1.8?
<shevy>
bnagy yeah probably
mlpinit has quit [Remote host closed the connection]
<shevy>
require_relative is new since 1.9.x
<Hanmac>
riceandbeans: who cares? 1.8 is dead
<riceandbeans>
Hanmac: no it's not
<shevy>
so if you use it, your code won't run on 1.8
MrThePlague has quit [Remote host closed the connection]
<shevy>
but you could make conditional requires
<riceandbeans>
Hanmac: anything running any redhat family runs 1.8 only
Ox6abe has quit [Remote host closed the connection]
<shevy>
if RUBY_VERSION < '1.8'
<shevy>
else
<shevy>
end
<Hanmac>
riceandbeans: offical 1.8 died this sommer
<bnagy>
or just require './xxx'
<shevy>
yeah try that ^^^ too riceandbeans
Ox6abe has joined #ruby
<bnagy>
or $:.unshift '.' but that's disgusting
antix_ has quit [Ping timeout: 260 seconds]
<Hanmac>
its not rubys fault when redhat does not use current software ... even ubuntu has newer ruby now
<riceandbeans>
Hanmac: I don't blame redhat
<riceandbeans>
err
<riceandbeans>
I don't blame ruby
<riceandbeans>
I blame redhat, which is a terrible company putting out terrible products
<riceandbeans>
I'm just saying, the latest redhat products have 1.8.5
<Hanmac>
oOOOO that is even WORSE!! ...
<bnagy>
dit five??
<riceandbeans>
1.9.1 won't be accepted until like 2 years from now
<bnagy>
*dot
<volty>
redhat is @ companies
<riceandbeans>
bnagy: no, dit 5
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
<graft_>
the latest redhat has 1.8.5? i can't believe that
<Hanmac>
1.8.5 i so dead ... 1.8.7 is more important ... because 1.8.7 and 1.9.3 are API compatible ... 1,8.5 is not
tommyblu` has quit [Ping timeout: 256 seconds]
vpretzel has quit [Remote host closed the connection]
<volty>
and companies need very stable software, not the last hypes
<graft_>
that's horseshit
<shevy>
hmmm
karupa64 has quit [Ping timeout: 256 seconds]
<shevy>
1.8.5 that sucks man
St_Marx has quit [Ping timeout: 240 seconds]
VTLob has quit [Quit: VTLob]
<graft_>
not keeping up with bugfixes is not the same as 'very stable software'
<shevy>
riceandbeans you should at least get latest 1.8.x
snovak has quit [Ping timeout: 248 seconds]
<graft_>
they're just conservative because it's easy, not because it's better
<shevy>
one day those distributions will all have died
senayar has joined #ruby
<shevy>
which will be a happy day for mankind
<volty>
they do the calculus -- for the customers, and for them
<shevy>
yeah
<Hanmac>
yeah ... using such "stable" software and then whining when the software does not have the latest "security patches" ...
closer has quit [Ping timeout: 256 seconds]
<shevy>
like a service company, where they have less incentive to provide the latest... even many years after
Ox6abe has quit [Ping timeout: 240 seconds]
<riceandbeans>
I retract my statement, they are on 1.8.7 now
<shevy>
yippie!
<Hanmac>
puh ... that is a tiny bit better
<volty>
you cannot have everything, especially when you have to monitor what is stable and what is not
<volty>
never mind, don't want to start a flame defending redhat, with which i have nothing to do
<shevy>
well almost latest patchset
<Hanmac>
dam i hate centos ...
niklasb has quit [Ping timeout: 245 seconds]
<graft_>
^^^^
<shevy>
volty DEBIAN FOREVER!!!
matchaw has joined #ruby
<riceandbeans>
I run debian so flame all you want
<workmad3>
WINDOWS FTW
* workmad3
hides
<volty>
i'm fine on kubunut, after gentoo
<shevy>
hmmmm
mohawkjohn has joined #ruby
<riceandbeans>
my company uses redhat crap
<shevy>
you run both debian and centos?
<bnagy>
centos kernel versioning makes me stabby
<shevy>
ah I see
aedorn has quit [Ping timeout: 260 seconds]
<riceandbeans>
shevy: I personally use debian
kaspergrubbe has joined #ruby
<riceandbeans>
shevy: I also run dragonflybsd
<Hanmac>
centos minimal system for a VM ... installing git ... but you can not run git --help because centos does not have "man" installed by default oO
<shevy>
those slices are damn confusing compared to cfdisk
matchaw_ has quit [Ping timeout: 264 seconds]
niklasb has joined #ruby
<shevy>
oh... actually I did not fail the second time there, but at external USB hdd...
<shevy>
"fdisk -l" did not work!
robert_ has quit [Excess Flood]
<shevy>
I googled and somehow found the right command, but I was fed up at that time
<riceandbeans>
shevy: you have to get used to BSD userland vs GNU userland for things too
<shevy>
:(
<riceandbeans>
sometimes the same commands have totally different flags
antix_ has quit [Ping timeout: 240 seconds]
zz_karupa64 has joined #ruby
tommyblue has joined #ruby
<shevy>
well
closer has joined #ruby
colonolGron has quit [Quit: Lost terminal]
<shevy>
one day I am gonna have one command to rule them all
<bnagy>
shevy: just buy a mac, then you can ease into it slowly :)
doritostains has joined #ruby
<shevy>
and ruby running the show
<riceandbeans>
Hanmac: I can run debian on a VM with 64MB ram happily
senayar has quit [Ping timeout: 252 seconds]
<shevy>
so many people use a mac
<shevy>
I never had one myself
ehaliewicz has joined #ruby
Jetchisel has joined #ruby
<bnagy>
it's because of that sweet sweet bsd userland, man, and ports
<bnagy>
.. ok that might not be true
<Hanmac>
shevy: mac is ... bah ... last time i searched but it seems it doesnt have a char table installed oO
robert_ has joined #ruby
<shevy>
but it has nice GUIs does it not?
antix_ has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
kaspergrubbe has quit [Read error: Operation timed out]
<bnagy>
well.. usable
<bnagy>
ie better than gnome kde or windows
<volty>
mohawkjohn: nothing's volatile till you try to access ruby side without its interface
Vivekananda has joined #ruby
elux has quit [Quit: Leaving...]
<Hanmac>
hm not so much ... it seems you cant enable the monitor blocking with an button, no you need to make it in the deep of the config in some file and then you make it with a corner activate ... but you cant do it with a button
<shevy>
on linux I like combine separate things... bluefish as editor (gtk2 based), firefox browser (gtk? I think...), kde konsole... okular as pdf viewer... libreoffice for documents... mplayer+ffmpeg mostly for audio + video stuff... I think that is about 95% of what I use
<mohawkjohn>
volty: i'm not sure i understand.
<riceandbeans>
bnagy: mac's BSD userland is an OLD userland
<Hanmac>
mohawkjohn: i dont use volatile in my C++ ext because in the most cases i hook around the GC so the C++ forces the ruby object to stay alive (i dont know if volatile can do something for me)
<riceandbeans>
also, I don't like Aque
<riceandbeans>
Aqua
<shevy>
but I wonder if it should not be "Hey, I will use KDE, I will use only KDE stuff and nothing else"... but most KDE things just suck...
superscott[8] has joined #ruby
<shevy>
and it's the same with gnome :(
<riceandbeans>
also, Mac's cost WAY too much
<bnagy>
riceandbeans: as opposed to this vibrant, new BSD all the cool kids are using?
<riceandbeans>
also, I only use Openbox
<riceandbeans>
bnagy: their userland is like 10 years old
<mohawkjohn>
Hanmac: So, having them as C++ class members accomplishes the same thing as volatile -- but what about in regular functions?
<shevy>
riceandbeans I am on xfce right now, it's not as shiny as gnome or kde but it is somewhat ok, I hope they will improve on it steadily...
matchaw_ has joined #ruby
byprdct has joined #ruby
<volty>
mohawkjohn: references are not volatile
workmad3 has quit [Ping timeout: 264 seconds]
<riceandbeans>
shevy: I used to use xfce
byprdct has quit [Max SendQ exceeded]
ace_striker has quit [Ping timeout: 250 seconds]
<riceandbeans>
but after gnome3 became more commonplace I abandoned it and went minimal
<riceandbeans>
haven't looked back since
<riceandbeans>
I'm a lot happier with openbox
<graft_>
pretty much the only thing that i am regularly unhappy with is office document stuff, like libreoffice
matchaw has quit [Ping timeout: 264 seconds]
<bnagy>
I'm on xfce too, for the virtually never that I have to use linux on the desktop
<volty>
volatile is about static stuff
<shevy>
I tried to get into minimal WMs but somehow, I settled for konsole + tabs, and after that I don't care so much whether it is a WM or a DE since I use separate non-DE specific apps mostly anyway
<graft_>
also the spreadsheet/charting stuff is meh... gnumeric is okay but pretty weak in the grand scheme of things
<shevy>
bnagy hehe cool
<bnagy>
mainly cause of the short "time to make it not completely suck"
<riceandbeans>
I don't own a windows computer
<shevy>
yeah
<shevy>
like this unity stuff
<shevy>
you probably need the right brains for it and I dont have them
<bnagy>
if I ever went back to linux (shudder) I'm sure I'd use something more minimal though :/
byprdct has joined #ruby
byprdct has quit [Max SendQ exceeded]
bean__ has quit [Quit: Computer has gone to sleep.]
<shevy>
graft_ I know that feeling, we had to use ms office, for excel .xls files, and I had troubles finding some things, especially "solver" stuff ... my charts never looked as fancy as what others who did not use libreoffice used
claymore has quit [Quit: Leaving]
<shevy>
(I was one of the few using libreoffice there)
antix_ has quit [Ping timeout: 240 seconds]
vpretzel has joined #ruby
<Hanmac>
mohawkjohn: i do this: i put the C++ object into an Ruby VALUE, then i store the VALUE in a holder object with i store in the C++ object (so that each can access each other)
<Hanmac>
then while the C++ object lives, the holder lives too and the VALUE is inside an ruby hash which is marked as global value (so the GC does not touch the hash)
<Hanmac>
when the C++ dies, it kills the holder and then the VALUE is freed from the ruby hash ... (and can be GC'd)
<shevy>
that reminds me, I need to find out whether ruby can create .xls files including formulas
byprdct has joined #ruby
<riceandbeans>
shevy: the ONLY thing libreofice can't do is VBscript from MS excel
mohawkjohn has quit [Quit: This computer has gone to sleep]
<riceandbeans>
shevy: it can
<shevy>
hmmm
<riceandbeans>
shevy: just don't hope for VBscript
<graft_>
riceandbeans: it sucks for doing presentations... i usually stick to inkscape for that
<volty>
another one, not so interested (moha...)
<volty>
s/so/enough/
antix_ has joined #ruby
bean__ has joined #ruby
AxisOfEval has joined #ruby
AxisOfEval has left #ruby [#ruby]
sikachu has quit [Quit: sikachu]
<bnagy>
riceandbeans: nobody hopes for vbscript
St_Marx has joined #ruby
SilverKey has joined #ruby
nisstyre has quit [Quit: Leaving]
bean__ has quit [Client Quit]
tabolario has joined #ruby
b00stfr3ak has quit [Ping timeout: 264 seconds]
petey has quit [Remote host closed the connection]
<riceandbeans>
shevy: do you use debian or ubuntu, talking about unity
Morrolan has quit [Ping timeout: 245 seconds]
<shevy>
riceandbeans nope
postmodern has joined #ruby
petey has joined #ruby
<shevy>
I had it installed like ... a year ago or so
xcv has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
<shevy>
but these days I really dont use much of any distribution. I am on slackware right now but I compiled about 95% of it from source with ruby scripts (not glibc though, glibc hates me... )
jonathanwallace has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mklappstuhl has joined #ruby
soheil has quit [Read error: Connection timed out]
x1337807x has joined #ruby
soheil has joined #ruby
antix_ has quit [Ping timeout: 248 seconds]
Mars` has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
MTene has joined #ruby
<shevy>
one day someone will teach me how to update glibc safely
Mars` has joined #ruby
mmitchell has quit [Ping timeout: 240 seconds]
antix_ has joined #ruby
antix_ has joined #ruby
antix_ has quit [Changing host]
mohawkjohn has joined #ruby
robbyoconnor has joined #ruby
petey has quit [Ping timeout: 240 seconds]
<mohawkjohn>
Hanmac: That seems like an expensive way to track memory.
deception has joined #ruby
<volty>
shevy: start with learning how to work in a chroot environment -> safe, you can copy, exercise, change, fix, check -> and make it final
MTen has quit [Read error: Operation timed out]
<riceandbeans>
slackware
<riceandbeans>
that's not a common one these days
rhys_ has quit [Quit: Leaving]
<riceandbeans>
so, I don't why why this isn't working...
<riceandbeans>
data_var has stuff in it
mklappstuhl has quit [Ping timeout: 252 seconds]
jonathanwallace has quit [Ping timeout: 240 seconds]
<volty>
ok, mohawkjohn: when a compiler compiles it makes some assumptions, ok? // so, when a static variable is public and the app is closed , you have to declare a static variable volatile if some external process can change its value, ok? // when the compiler compiles to an object file (.o) or lib (.so) it automatically assumes that some routine can change its value
Ox6abe has joined #ruby
<Hanmac>
mohawkjohn: there isnt any better way as far as i know ... the ruby object does need to stay alive, but i cant let it live longer than the C++ object
<riceandbeans>
do I need to chomp before I do that?
<volty>
so volatile is not necessary
<bnagy>
riceandbeans: is the result you want in matchdata[1] ?
<shevy>
hehe
<shevy>
where is the result!
kilophoton has joined #ruby
butblack has joined #ruby
<Hanmac>
mohawkjohn: there is also some kind of refcount included so that you can use the ruby object more than once ... and one dying does not kill the object as long there are other refs
mayorga has quit [Read error: Connection reset by peer]
antix_ has quit [Ping timeout: 264 seconds]
<riceandbeans>
shevy: using rubular.com I built the regex around the data and mapped the matchgroups
Spami has joined #ruby
<riceandbeans>
I know what matchgroups they are
<riceandbeans>
there are several
nemesit|znc has quit [Ping timeout: 240 seconds]
<mohawkjohn>
volty: the issue here, I think, is that the compiler optimizes out certain pass-by-values and treats them as references
Senjai has quit [Ping timeout: 264 seconds]
<riceandbeans>
but it's taking the [#] a the end and calling it a method rather than an array reference
kadoo has quit [Ping timeout: 260 seconds]
mengu has quit [Remote host closed the connection]
<volty>
though Hanmac's good (and useful) explanations &advices have nothing to to with the 'volatile' keyword
Ox6abe has quit [Ping timeout: 246 seconds]
enebo has quit [Quit: enebo]
antix_ has joined #ruby
<bnagy>
riceandbeans: match return a matchdata or nil
Davey has quit [Quit: Computer has gone to sleep.]
alekst has quit [Quit: Computer has gone to sleep.]
<volty>
the compiler can make optimizations, assuming that no other can change a value when 1) closed program 2) private static variables (no access possible)
<bnagy>
so undefined [] for nil just means you failed to match
BRMatt has joined #ruby
cody-- has quit [Quit: derp]
<graft_>
riceandbeans: use a block
<a1ph4g33k>
*yawn*
axl_ has joined #ruby
mando has quit [Remote host closed the connection]
freerobby has joined #ruby
<graft_>
i also like doing string.scan(regexp).flatten.first or some such
sea6ear has joined #ruby
<bnagy>
or use NotRegexes
nari has joined #ruby
<volty>
grouping the entire regex is not odd, especially in the phase of develpment, mandatory in the case of negative regexp
robbyoconnor has quit [Ping timeout: 252 seconds]
mrsolo has quit [Quit: This computer has gone to sleep]
<Lewix>
graft_: good tip
mengu has joined #ruby
<mohawkjohn>
volty: I think you're mistaken about why we're using volatile. But maybe I'm misunderstanding your argument.
freezey has quit [Remote host closed the connection]
adeponte has joined #ruby
<graft_>
why bother grouping the entire regex? MatchData[0] is the whole match string anyway
pwh has joined #ruby
mikepack has joined #ruby
stewart_ has joined #ruby
popl has quit [Quit: We must make an idol of our fear, and call it God.]
antix_ has quit [Ping timeout: 264 seconds]
kadoo has joined #ruby
freerobby has quit [Client Quit]
<volty>
mohawkjohn: everything is possible :)
antix_ has joined #ruby
<riceandbeans>
bnagy: you were right...it didn't match...
<riceandbeans>
somehow my regex match most lines but not the FIRST line
<riceandbeans>
wtf
Mars`_ has quit [Read error: Connection reset by peer]
<volty>
only Our Lord has very clear ideas what to match and how to group :)
Mars` has joined #ruby
<bnagy>
I don't know what you're parsing, but srsly, see if you can do it with split etc - or at least _mostly_
<bnagy>
any regexp longer than 6 chars is the first step on the road to insanity
nomenkun has quit [Remote host closed the connection]
<bnagy>
:|
emergion has joined #ruby
<riceandbeans>
parse through a postfix log and define matchgroups for all essential email parts
<riceandbeans>
works fine in rubular, but the first lock failed me
<volty>
spammer ? :)
<riceandbeans>
but I see why now
MTene has quit [Ping timeout: 248 seconds]
<riceandbeans>
I took out a line for testing that filtered for this regex line
<riceandbeans>
volty: had a spam issue, trying to scrape logs and go after the sources
<bnagy>
I urgently recommend that you refactor that to use tokenising instead
ravster has quit [Quit: Leaving.]
antix_ has quit [Ping timeout: 240 seconds]
<riceandbeans>
I urgently recommend you tell me what that means
jokke has quit [Quit: WeeChat 0.4.1]
lfox has joined #ruby
<bnagy>
:) split the bits up based on tokens not regex
jokke has joined #ruby
<riceandbeans>
what tokens?
<graft_>
yeah seems like you can just split on :
tatsuya_o has quit [Remote host closed the connection]
<riceandbeans>
I made a class for the email data
<bnagy>
like you could split on 'from' then split the email on '@', then split the domain on '.' etc
<riceandbeans>
why would I do it that way
<volty>
splitting is all the same, the way arround to get crazy all the same
garbagecollectio has quit [Ping timeout: 240 seconds]
<bnagy>
still requires some postprocessing, but each part is a lot easier to debug
<graft_>
because you don't have to write a crazy regexp
<graft_>
and it will be faster
antix_ has joined #ruby
<riceandbeans>
graft_: but that regex is fine, I took out the filter line before it, which was my fault
axl_ has quit [Quit: axl_]
quoin has quit [Ping timeout: 260 seconds]
<graft_>
it's illegible
<volty>
I'll give the recipe: go incremental, write a piece for the first, then for repetitions, the the second, then sum them etc
duggiefr_ has joined #ruby
<graft_>
therefore it is not fine
duggiefresh has quit [Remote host closed the connection]
drumsrgr8forn8 has joined #ruby
MTene has joined #ruby
zzz_taion809 is now known as taion809
<volty>
(you know you can sum the regexps?)
brockfredin has joined #ruby
<riceandbeans>
what?
Davey has joined #ruby
mrsolo has joined #ruby
<volty>
e.g /(\w+?\s+\d+)?\s+(\d{2}:\d{2}:\d{2})/ (btw, you had a dot behind the parenthesis)
brennanMKE has joined #ruby
mengu has quit [Read error: Connection reset by peer]
<volty>
match that, then add .{1, 20} (if appropriate), then go on, step by step
<bnagy>
riceandbeans: "it's a one off tool" and "nobody else will have to read it" are ok excuses, but honestly, you if you'd started with tokenising you'd probably already have it working now
<graft_>
also, inevitably, you will come back to read it later
tatsuya_o has joined #ruby
<graft_>
and be like, oh god why my eyes
kadoo has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<riceandbeans>
the dot after parenthesis was intentional, I didn't want to match it
krainboltgreene has quit []
kilophoton has quit [Ping timeout: 245 seconds]
vpretzel has quit [Remote host closed the connection]
antix_ has quit [Ping timeout: 240 seconds]
sea6ear has left #ruby ["Killed buffer"]
vpretzel has joined #ruby
<volty>
you cannot have \w+?
kadoo has joined #ruby
<graft_>
can you paste an example of this file somewhere?
baordog_ has quit [Remote host closed the connection]
<volty>
or + or ? // there should be a question mark after \w+ ?
duggiefr_ has quit [Remote host closed the connection]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Zerogrifter has joined #ruby
<volty>
yap, your question mark is wrong -- to begin with
valesk has quit [Ping timeout: 264 seconds]
Zerogrifter has quit [Max SendQ exceeded]
<volty>
i'll check though...
vpretzel has quit [Ping timeout: 240 seconds]
snovak has joined #ruby
MTen has joined #ruby
MTene has quit [Read error: Connection reset by peer]
alex__c2022 has quit [Quit: alex__c2022]
vim_shim has quit [Ping timeout: 240 seconds]
mlpinit has joined #ruby
<riceandbeans>
the question mark makes it not greedy
<volty>
can be there but cannot see the sense
<riceandbeans>
safety
xk_id has quit [Quit:
duggiefresh has quit [Ping timeout: 245 seconds]
<volty>
thanks
kreeves has joined #ruby
kreeves has quit [Changing host]
kreeves has joined #ruby
c0rn has quit [Read error: Operation timed out]
Trudko has quit [Read error: Connection reset by peer]
<voidPirate>
how do I append text to a variable? Like if I have a variable called something = "This is something" and I want to add this text to the end "some more text"
Guest91343 has quit [Ping timeout: 240 seconds]
<MrZYX>
+=
<bnagy>
<<
sambao21 has quit [Quit: Computer has gone to sleep.]
nemesit|znc has joined #ruby
<bnagy>
nooo += is bad and wrong
mlpinit has quit [Remote host closed the connection]
<voidPirate>
hmm I tried += in ruby 2 and it bitched
<voidPirate>
I will try <<
<bnagy>
well.. not on the seven deadly sins scale, but wrong :P
cnrk has joined #ruby
<MrZYX>
:P
<riceandbeans>
bnagy: it's two different things
<graft_>
riceandbeans: break this up for readability, at least, like /#{DATE} #{FILE} #{FROM}, size/
<bnagy>
voidPirate: += creates a new string, << modifies the receiver
<riceandbeans>
+= an <<
<riceandbeans>
one adds to the same object, one makes a new object from the first-
antix_ has joined #ruby
<bnagy>
which is pretty much never what you want if you're appending
<graft_>
riceandbeans: where DATE = /(\w+\s\d{2}:etc/
fgo has quit [Remote host closed the connection]
vpretzel has joined #ruby
snovak has quit [Ping timeout: 264 seconds]
<voidPirate>
oh I see, thanks for the clarification
<riceandbeans>
I feel like as a sysadmin it's my moral obligation to sit aroud reading slashdot all day
<riceandbeans>
graft_: that actually looks like a decent idea...
<riceandbeans>
the token thing sounded a bit weird
c0rn has joined #ruby
<riceandbeans>
I don't like all caps variables though...
<graft_>
your regexps are probably constants, so why not?
<riceandbeans>
true
<riceandbeans>
ok
<riceandbeans>
fine
<volty>
but += creating a new var is an implementation shortcoming // should be equivalent, for containers, to <<
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mayday_jay has quit [Ping timeout: 264 seconds]
peregrine81 has joined #ruby
<peregrine81>
how come klass = Kernel.const_get("Class"); klass == Class => true
<bnagy>
no
<peregrine81>
but not in a case statement?
jb41 has quit [Quit: leaving]
antix_ has quit [Ping timeout: 246 seconds]
doritostains has quit [Quit: Leaving...]
<bnagy>
volty: consider a="foo"; b=a then look at += and <<
<graft_>
peregrine81: like case klass; when Class?
<peregrine81>
graft_ yep
<peregrine81>
well my_sym = case klass; when Class then :symbol
<MrZYX>
peregrine81: case uses === with the argument to when on the lefthand side (important, since it's actually a method call)
<graft_>
works for me
antix_ has joined #ruby
<riceandbeans>
it's not chomping :((((((
<peregrine81>
in my case my_sym is always empty
mayday_jay has joined #ruby
<riceandbeans>
I want ONE line at a time and ruby is throwing 5 lines at it and the regex doesn't work
kay has joined #ruby
<bnagy>
lol regex
RichardBaker has quit [Quit: RichardBaker]
<peregrine81>
MrZYX anyway to get passed this? maybe .class
kay is now known as Guest27353
<graft_>
still works for me
<volty>
bnagy, so ? what has that to do with what I said?
<MrZYX>
there's no way to cheat case/when (I've tried)
<MrZYX>
peregrine81: you still need to provide us a way to reproduce your issue ;)
<peregrine81>
sigh one sec
<bnagy>
volty: it shouldn't be equivalent. It's not an implementation shortcoming.
<graft_>
peregrine81: are you const_getting something other than Class?
<graft_>
peregrine81: maybe you're comparing two different classes?
<peregrine81>
yea
niklasb has quit [Ping timeout: 240 seconds]
<volty>
bnagy: everything is opinable, but your example has nothing to do with it
<graft_>
Kernel.const_get("Blah") might not be the same as Blah
<graft_>
if, for example, you have Module::Blah, it might barf
vpretzel has quit [Remote host closed the connection]
<graft_>
in that case you would need to do Module.const_get("Blah")
<graft_>
or compare to Module::Blah
Morrolan has joined #ruby
<graft_>
err, where Module is some actual module name, not Module
<graft_>
(which is also a module name, but you get what i mean hopefully)
emergion has quit [Quit: Computer has gone to sleep.]
<bnagy>
volty: how does it not have anything to do with it? You said "<< should be equivalent to += for containers" which is wrong, and the example demonstrates why
<bnagy>
seriously, either you're a troll or just mentally retarded
<MrZYX>
woah, calm down
<graft_>
hey, bnagy, don't be mean...
<graft_>
remember: no matter where you go, there you are
<bnagy>
he has been like this in here for weeks, it's not OK anymore
<bnagy>
this is not an isolated incident
<volty>
the example didn't demonstrated anything, when you assign b to a you know that you have the reference to the same variable, when you do += you want to add to that same reference and not create another variable? So difiicult?
gyre007 has quit [Ping timeout: 264 seconds]
<MrZYX>
bnagy: sort that out with him in a query or with an OP, but don't start publicly insulting people
sepp2k has quit [Read error: Connection reset by peer]
brennanMKE has quit [Remote host closed the connection]
funburn has joined #ruby
Ox6abe has joined #ruby
nari has quit [Ping timeout: 245 seconds]
aspires has quit [Quit: aspires]
duggiefresh has quit [Ping timeout: 260 seconds]
Lewix has quit [Remote host closed the connection]
aspires has joined #ruby
Valesk_ has quit [Ping timeout: 248 seconds]
kvirani has quit [Remote host closed the connection]
<riceandbeans>
I've always hated ruby not having an incremental operator by design
<sam113101>
like i++?
kvirani has joined #ruby
<riceandbeans>
I'm sure dennis ritchie worked really hard to put that into C
<banisterfiend>
riceandbeans the primary use for that in other languages is in loops
<riceandbeans>
sam113101: yes
antix_ has quit [Ping timeout: 252 seconds]
<riceandbeans>
banisterfiend: because ruby doesn't have loops
<banisterfiend>
riceandbeans and ruby doesn't need loops most of the time
<sam113101>
i+=1 is not much longer
<banisterfiend>
riceandbeans ruby does have loops, we just don't need them really
<riceandbeans>
sam113101: I know but that's more a kludge
<volty>
you do not need that in ruby
<banisterfiend>
riceandbeans so the number of use cases i++ would be useful is very very small
mando has joined #ruby
mjc__ is now known as mjc_
Ox6abe has quit [Remote host closed the connection]
<riceandbeans>
banisterfiend: if you're tracking variable positioning in loops it can help for debugging if not used in the values themselves
<riceandbeans>
and tons of things in ruby loop
<Eiam>
I've used -= 1 time
<riceandbeans>
.each is a loop
Ox6abe has joined #ruby
<Eiam>
and its to stop an infinite loop in begin/rescue/retry
<riceandbeans>
.each is a for loop
<riceandbeans>
without an explicit incremental condition
antix_ has joined #ruby
antix_ has quit [Changing host]
antix_ has joined #ruby
<banisterfiend>
riceandbeans that's not what i meant :) i meant we have constructs like that instead of explicit for(int i = 0; i < 10; i++) type loops
mansi has quit [Read error: Connection reset by peer]
<volty>
each is a loop over a collection, it is not a 'for'
rahulkmr has quit [Quit: Leaving.]
kazuuu has quit [Remote host closed the connection]
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
mansi has joined #ruby
<riceandbeans>
array.each do | stuff | end
rahulkmr has joined #ruby
<banisterfiend>
riceandbeans outside for for(int i = 0; i < 10; i++) situations, or in while(cond) { blah; i++; } situations, i++ isn't used that often
rahulkmr has quit [Max SendQ exceeded]
niklasb has joined #ruby
St_Marx has joined #ruby
mansi has quit [Remote host closed the connection]
rahulkmr has joined #ruby
<riceandbeans>
is the same as foreach my $line (@array) { }
fgh2 has quit [Ping timeout: 248 seconds]
<riceandbeans>
in perl
rahulkmr has quit [Max SendQ exceeded]
<riceandbeans>
it's a for loop
jbrechtel has quit [Ping timeout: 260 seconds]
rahulkmr has joined #ruby
Tearan has joined #ruby
mansi has joined #ruby
<banisterfiend>
riceandbeans ok, let's not debate over what is/what is not a loop, the point is that with ruby's huge variety of internal iterators the number of cases where an i++ would be useful is really reduced
kane77 has quit [Quit: Leaving]
emmanuelux has joined #ruby
rahulkmr1 has joined #ruby
rahulkmr has quit [Read error: Connection reset by peer]
kvirani has quit [Ping timeout: 248 seconds]
rahulkmr1 has quit [Read error: Connection reset by peer]
rahulkmr has joined #ruby
<riceandbeans>
I just don't like you have to kludge it in to use it
<volty>
and, btw, with the new libraries with containers, especially boost, also c++ is abandoning for constructs
rahulkmr has quit [Max SendQ exceeded]
<volty>
(for with i++)
<riceandbeans>
I mean I know ruby was made to be monkey patched but with everything?
<banisterfiend>
riceandbeans kludge what in? can you give a specific example what the heck you're talking about?
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
<riceandbeans>
i += 1 instead of i++
<banisterfiend>
riceandbeans that's not a kludge, C supports i += 1 too
rahulkmr has joined #ruby
Ox6abe has quit [Ping timeout: 248 seconds]
rahulkmr has quit [Client Quit]
rahulkmr1 has joined #ruby
drumsrgr8forn8 has quit [Ping timeout: 240 seconds]
<MrZYX>
well the mix is that you confuse objects and variables
<volty>
i said that =, in context of String assignment, creates new objects, that's all // not that i want to be (always) right
<MrZYX>
and therefore object creation and variable assignment
vpretzel has joined #ruby
<bnagy>
what is "String assignment" ?
<MrZYX>
s ='foo'; b=s; # Two assignments, only one object created
<volty>
you hope to take me by exhausting ? :)
antix_ has joined #ruby
<MrZYX>
do you?
Rollabunna has quit [Remote host closed the connection]
<volty>
that's a point
<volty>
but, pity, a special case
<MrZYX>
not at all
fgo has joined #ruby
<volty>
very special
<MrZYX>
I guess s = :bla; b = :bla; is a special case too then
<MrZYX>
or s = 5; b = 5;
<volty>
yes, another one
<MrZYX>
or s = []; b=s;
<volty>
nothings to do with foo's
<MrZYX>
or s = Object.new; b=s;
<volty>
String context
<volty>
bye
<MrZYX>
strings are just objects in ruby too
<MrZYX>
one of the few types with literals, but just objects
<volty>
as you please :)
fbernier has quit [Read error: Connection reset by peer]
<volty>
i said what I had to say, right or wrong
Matip has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fbernier has joined #ruby
vpretzel has quit [Ping timeout: 241 seconds]
<bnagy>
it's not 'right or wrong' or 'opinion' or 'a debate'
jbrechtel has joined #ruby
<bnagy>
everything in the statement was demonstrably wrong
<volty>
there was Matrix, we were talking about his string assignments, i said that the new objects got created, and now you are bla bla bla -ing
<volty>
s/that then new/that new/
tatsuya_o has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 240 seconds]
<MrZYX>
you said = would create objects. That's plainly a false statement
<bnagy>
07:29 < volty> = creates a new object (for String and other classes) -- unless redefined
<bnagy>
1. it doesn't 2. you can't
mansi has joined #ruby
<volty>
we were talking in context of Matrix's (user) assignments of literal strings
antix_ has quit [Ping timeout: 260 seconds]
heidi has quit [Quit: Leaving.]
Cyrus has quit [Quit: Cyrus.sleep()]
<volty>
(and then you said I want to be right !!! ??? )
<bnagy>
does the context make that statement less completely wrong?
<volty>
everything has a context, bnagy, I fear that you will remain enclosed in your context for all your life
Aryasam has joined #ruby
Aryasam_ has quit [Read error: Connection reset by peer]
Matix has quit [Ping timeout: 245 seconds]
antix_ has joined #ruby
BRMatt has quit [Ping timeout: 245 seconds]
<banisterfiend>
volty u r cute when u turn aggressive
<volty>
:)
jonr22 has joined #ruby
<volty>
not aggressive, this is my "original" style
Rollabunna has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
<banisterfiend>
volty r u a dom
upd has joined #ruby
KobraKao has quit [Quit: Saindo]
<volty>
i use it rarely here because i want to be kind with people // you know, behind a screen & keyboard, you can't see the smile, the eyes etc etc - - people could get it wrongly