mistym has quit [Remote host closed the connection]
diegoviola has joined #ruby-lang
Caius has joined #ruby-lang
snoopybbt has joined #ruby-lang
Caius has quit [Ping timeout: 255 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
robbyoconnor has joined #ruby-lang
robbyoconnor has quit [Client Quit]
Caius has joined #ruby-lang
pr0ton_ has quit [Quit: pr0ton_]
Blaguvest has joined #ruby-lang
[spoiler] has joined #ruby-lang
shinnya has quit [Ping timeout: 255 seconds]
mistym has joined #ruby-lang
Cakey has joined #ruby-lang
shinnya has joined #ruby-lang
earthquake has quit [Quit: earthquake]
Caius has quit [Ping timeout: 255 seconds]
Caius has joined #ruby-lang
dnewkerk-keyz has joined #ruby-lang
thomasxie has quit [Quit: Leaving.]
Cakey has quit [Ping timeout: 260 seconds]
scmx has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.3]
mistym has quit [Remote host closed the connection]
jeffs has joined #ruby-lang
snoopybbt has quit [Ping timeout: 245 seconds]
touzin has joined #ruby-lang
relix has joined #ruby-lang
jeffs has quit [Ping timeout: 255 seconds]
dm78 has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
yubrew has joined #ruby-lang
yubrew has quit [Ping timeout: 260 seconds]
faces has joined #ruby-lang
faces has quit [Client Quit]
robbyoconnor has joined #ruby-lang
Cakey has quit [Ping timeout: 272 seconds]
kyb3r_ has quit [Read error: Connection reset by peer]
kyb3r_ has joined #ruby-lang
twright has quit [Ping timeout: 244 seconds]
Cakey has joined #ruby-lang
touzin has quit [Ping timeout: 240 seconds]
relix has quit [Ping timeout: 244 seconds]
kyb3r_ has quit [Ping timeout: 252 seconds]
kyb3r_ has joined #ruby-lang
dm78 has joined #ruby-lang
ozzloy has quit [Ping timeout: 252 seconds]
ozzloy has joined #ruby-lang
relix has joined #ruby-lang
dnewkerk-keyz has quit [Quit: dnewkerk-keyz]
dm78 has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby-lang
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby-lang
Lumio has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
Lumio has quit [Client Quit]
Cakey has joined #ruby-lang
ctangent has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snsei has joined #ruby-lang
twright has joined #ruby-lang
mikecmpbll has joined #ruby-lang
jeffs has joined #ruby-lang
twright has quit [Ping timeout: 244 seconds]
Lumio has joined #ruby-lang
yubrew has joined #ruby-lang
jeffs has quit [Ping timeout: 260 seconds]
dm78 has joined #ruby-lang
mikecmpbll has quit [Quit: i've nodded off.]
yubrew has quit [Ping timeout: 260 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dm78 has quit [Ping timeout: 264 seconds]
mistym has joined #ruby-lang
ta has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
mistym has quit [Ping timeout: 244 seconds]
jg_ has quit [Ping timeout: 248 seconds]
Lewix has quit [Remote host closed the connection]
pabloh has joined #ruby-lang
WishBoy has joined #ruby-lang
twright has joined #ruby-lang
Lumio has quit [Quit: Lumio]
Lumio has joined #ruby-lang
username3842 has joined #ruby-lang
akshay_kumar has joined #ruby-lang
arBmind has joined #ruby-lang
twright has quit [Ping timeout: 244 seconds]
jarto has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
jhass|off is now known as jhass
marr has joined #ruby-lang
iconpin has joined #ruby-lang
<username3842>
Hi there. I'm just started learning ruby and decided to write a couple of console applications. I ran into some problems which i tried to google, but in vain. So could you tell me if there are methods like getch(), gotoxy() from C or other console I/O manipulation things? Thanks in advance.
tbuehlmann has joined #ruby-lang
Lumio has quit [Quit: Lumio]
<pabloh>
gotoxy() ?
<apeiros>
username3842: you'll need something like curses or ncurses for that
WishBoy has quit [Remote host closed the connection]
lolmaus has quit [Ping timeout: 272 seconds]
postmodern has joined #ruby-lang
<username3842>
apeiros: thank you, i'll try it
lolmaus has joined #ruby-lang
yubrew has joined #ruby-lang
akshay_kumar has quit [Read error: No route to host]
yubrew has quit [Ping timeout: 244 seconds]
lolmaus has quit [Remote host closed the connection]
schaerli has joined #ruby-lang
dm78 has joined #ruby-lang
Cakey has joined #ruby-lang
lolmaus has joined #ruby-lang
dm78 has quit [Ping timeout: 255 seconds]
Lumio has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
Lumio has quit [Client Quit]
<heftig>
username3842: i'd recommend the ruby-newt bindings
<heftig>
(assuming you're fine with creating a dialog-based TUI)
stardiviner has quit [Ping timeout: 272 seconds]
dm78 has joined #ruby-lang
pabloh has quit [Ping timeout: 240 seconds]
pabloh has joined #ruby-lang
dm78 has quit [Ping timeout: 264 seconds]
twright has joined #ruby-lang
ta__ has joined #ruby-lang
ta has quit [Read error: Connection reset by peer]
twright has quit [Ping timeout: 244 seconds]
iconpin has quit []
stardiviner has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
tbuehlmann has quit [Remote host closed the connection]
yubrew has joined #ruby-lang
stamina has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
jeffs has joined #ruby-lang
jeffs has quit [Ping timeout: 244 seconds]
toretore has joined #ruby-lang
Scherner has quit [Ping timeout: 260 seconds]
hakunin has quit [Ping timeout: 260 seconds]
rippa has joined #ruby-lang
pabloh has quit [Quit: Saliendo]
jg_ has joined #ruby-lang
stardiviner has quit [Ping timeout: 244 seconds]
dm78 has joined #ruby-lang
stardiviner has joined #ruby-lang
centrx has joined #ruby-lang
dm78 has quit [Ping timeout: 255 seconds]
twright has joined #ruby-lang
twright has quit [Ping timeout: 244 seconds]
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
[spoiler] has quit [Ping timeout: 264 seconds]
weems|mac has quit [Ping timeout: 244 seconds]
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #ruby-lang
symm- has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Lumio has joined #ruby-lang
red_menace has joined #ruby-lang
cored has joined #ruby-lang
cored has joined #ruby-lang
schaerli has joined #ruby-lang
Missphoenix has joined #ruby-lang
Miphix has quit [Ping timeout: 240 seconds]
<epitron>
username3842: you can require 'io/console' to use getch on stdin
<epitron>
and print ANSI codes to relocate the cursor
<epitron>
might be less painful than curses :)
schaerli has quit [Remote host closed the connection]
<apeiros>
you know, it's somehow sad if printing escape codes is less pain than using a library written for that purpose
<username3842>
lol thank you guys, but i'm stuck with other problems now. i'll let you know how it went after all and what i've decided to use later
<epitron>
np
<epitron>
good luck
hakunin has joined #ruby-lang
dm78 has joined #ruby-lang
thomasxie has joined #ruby-lang
dm78_ has joined #ruby-lang
dm78 has quit [Ping timeout: 248 seconds]
twright has joined #ruby-lang
dm78_ has quit [Ping timeout: 264 seconds]
twright has quit [Ping timeout: 244 seconds]
yubrew has joined #ruby-lang
mikecmpbll has joined #ruby-lang
yubrew has quit [Ping timeout: 248 seconds]
jxie has quit [Ping timeout: 252 seconds]
jxie has joined #ruby-lang
Atttwww has quit [Ping timeout: 252 seconds]
scmx has quit [Ping timeout: 272 seconds]
sdouglas has joined #ruby-lang
sdouglas has quit [Ping timeout: 252 seconds]
jhass is now known as jhass|off
jhass|off is now known as jhass
twright has joined #ruby-lang
chouhoulis has joined #ruby-lang
centrx has joined #ruby-lang
twright has quit [Ping timeout: 244 seconds]
username3842 has left #ruby-lang ["Leaving"]
username3842 has joined #ruby-lang
jxie has quit [Ping timeout: 260 seconds]
symm- has quit [Ping timeout: 255 seconds]
jxie has joined #ruby-lang
hakunin_ has joined #ruby-lang
hakunin has quit [Ping timeout: 244 seconds]
dm78 has joined #ruby-lang
yubrew has joined #ruby-lang
twright has joined #ruby-lang
dm78 has quit [Ping timeout: 255 seconds]
danijoo_ has quit [Quit: Leaving...]
symm- has joined #ruby-lang
yubrew has quit [Ping timeout: 252 seconds]
twright has quit [Ping timeout: 244 seconds]
marr has quit [Ping timeout: 252 seconds]
chouhoulis has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
chouhoulis has joined #ruby-lang
charliesome has joined #ruby-lang
heavyhorse has left #ruby-lang [#ruby-lang]
schaerli has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
devgiant has joined #ruby-lang
sonander has joined #ruby-lang
michd is now known as MichD
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MichD is now known as michd
DivineEntity has quit [Ping timeout: 255 seconds]
VTLob has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
heavyhorse has joined #ruby-lang
schaerli has joined #ruby-lang
schaerli has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
GryphonOwl has joined #ruby-lang
heavyhorse has quit [Ping timeout: 252 seconds]
GryphonOwl has left #ruby-lang [#ruby-lang]
mikecmpbll has quit [Quit: i've nodded off.]
certainty has quit []
certainty has joined #ruby-lang
arBmind has quit [Ping timeout: 252 seconds]
railzForDaiz has joined #ruby-lang
yfeldblum has joined #ruby-lang
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
<apeiros>
(asking over in #ruby too) Anybody know a decent profiler for plain ruby 2.1 apps?
yubrew has joined #ruby-lang
<yxhuvud>
ruby-prof has been around for a while. Is that good enough? (dunno if it supports 2.1 though I'd assume it does). There should also be some dtracing support, but I never played with that.
<apeiros>
I'm currently looking at tmm1's stackprof
<apeiros>
ruby-prof is certainly one I'll look at again too. I've used it before.
<apeiros>
sam saffron wrote memory_profiler. sounds interesting too.
yfeldblum has quit [Remote host closed the connection]
<dangerousdave>
jhass, it makes more sense to me with the ()
<dangerousdave>
jhass, ok, thanks
<matti>
jhass: ;p
<red_menace>
I was thinking more like Mail.defaults { delivery_method :smtp, { ... }} but the do/end is a little more readable
<jhass>
there are essentially two conventions for do/end vs {/}: use do end for multiline and { } for single line blocks. The other version is use { } if you care about the return value of the block (and likely want to chain things to it) and do / end if you don't
DivineEntity has joined #ruby-lang
nathanstitt has joined #ruby-lang
Mon_Ouie has quit [Quit: WeeChat 0.4.3]
dnewkerk-keyz has left #ruby-lang [#ruby-lang]
brianpWins has joined #ruby-lang
<red_menace>
jhass - I am aware of that, but he was wanting to avoid do, so I guess it depends on whether you want to go into the source and rewrite something equivalent that you like
dnewkerk has joined #ruby-lang
dnewkerk is now known as dnewkerk-keyz
dnewkerk-keyz is now known as dnewkerk
dnewkerk has left #ruby-lang [#ruby-lang]
Lewix has quit [Remote host closed the connection]
weems_ is now known as weems|mac
dnewkerk-keyz has joined #ruby-lang
snoopybbt has quit [Ping timeout: 245 seconds]
yfeldblum has joined #ruby-lang
dnewkerk-keyz is now known as dnewkerk
dnewkerk has quit [Client Quit]
yfeldblum has quit [Remote host closed the connection]
dnewkerk has joined #ruby-lang
yfeldblum has joined #ruby-lang
dnewkerk has left #ruby-lang [#ruby-lang]
symm- has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
snoopybbt has joined #ruby-lang
touzin has quit [Ping timeout: 240 seconds]
touzin has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
oste has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
touzin has quit [Ping timeout: 240 seconds]
btiefert has joined #ruby-lang
snsei has joined #ruby-lang
tekken has joined #ruby-lang
yfeldblum has joined #ruby-lang
<tekken>
hi guyz
<tekken>
anyone around?
<red_menace>
hello
<jhass>
you won't find out without asking your question ;)
yubrew has joined #ruby-lang
btiefert has quit [Read error: Connection reset by peer]
yfeldblu_ has quit [Ping timeout: 244 seconds]
<tekken>
i've been working on ruby for bout a year now..n i'm really keen on developing or collaborating on on project(basically looking for project ideas)..i'm not sure if this is the right channel bt was hoping anyone could guide me?
yfeldblum has quit [Ping timeout: 260 seconds]
<jhass>
you mean suggesting projects to contribute to / project ideas?
yubrew has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby-lang
sdouglas has joined #ruby-lang
_ht has quit [Remote host closed the connection]
<arup_r>
I am having trouble to understand the options passed with JSON.parse method.. Any help on thhis ?
<jhass>
arup_r: you'll better understand it once you come across an usecase for these options, until then just don't bother
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
<arup_r>
jhass: thanks for the example... At least I am able to see how to use it...
banister is now known as banisterfiend
<arup_r>
jhass: But the thing is I am not aware of the functionality, on right time, I wouldn't be able to think about it too...
<arup_r>
:-)
<jhass>
You saw these options, that's enough is what I'm saying
<arup_r>
jhass: In my case I always use JSON.parse to get a hash from a json string always...
zUriel_ has joined #ruby-lang
username3842 has quit [Quit: Leaving]
<arup_r>
I am not aware of the how those 2 options, help a json string to be process by JSON::parse method.. still I am not clear... what are their effect, why should we need it.. etc
<zUriel_>
I have a class Xxx that inherits from another (Sequel::Model). I'd like to use Xxx.to_json but that requires my class to inherit from Hash (and not rewriting a to_json() myself). Is it possible ?
<zUriel_>
AFAIK, multiple inheritance is not possible, but I am a ruby beginner
<jhass>
zUriel_: implement a as_json that returns a Hash iirc
MichD is now known as michd
<zUriel_>
jhass: thanks. That's what I started, but I wondered if I could do it in a more efficient way...
michd is now known as MichD
luiz_ has joined #ruby-lang
luiz_ is now known as Guest81641
arup_r1 has joined #ruby-lang
arup_r1 has left #ruby-lang [#ruby-lang]
CaptainJet has quit []
arup_r has quit [Ping timeout: 264 seconds]
Guest8963 has quit [Ping timeout: 272 seconds]
btiefert has quit [Read error: Connection reset by peer]
nathanstitt has quit [Quit: I growing sleepy]
havenwood has joined #ruby-lang
relix has joined #ruby-lang
relix has quit [Client Quit]
ruby-lang181 has joined #ruby-lang
<ruby-lang181>
hello
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<ruby-lang181>
anybody out there
<jhass>
no
ruby-lang181 has left #ruby-lang [#ruby-lang]
<red_menace>
it is all an illusion
<jhass>
he really left m(
cheeze has joined #ruby-lang
relix has joined #ruby-lang
<cheeze>
yo yo
<cheeze>
anybody out there
<jhass>
no
<cheeze>
wut up jhass
<jhass>
the sky I guess?
<cheeze>
ok
<cheeze>
are you familiar with adding authenication in a rails app?
<red_menace>
you DO know that we can see your host address, right?
<jhass>
cheeze: yes, use devise and ask in #rubyonrails
<apeiros>
host address? wassat?
<pipework>
I'm not a devise fan, but if you've never done any http authentication and you're using rails, devise is alright.
<apeiros>
red_menace: me no understand. me just simple guy.
<apeiros>
;-)
btiefert has joined #ruby-lang
relix has quit [Client Quit]
cheeze has quit [Ping timeout: 246 seconds]
yubrew has quit [Ping timeout: 272 seconds]
Blaguvest has joined #ruby-lang
relix has joined #ruby-lang
Metics has joined #ruby-lang
<Metics>
Hi
weems|mac has quit [Quit: weems|mac]
weems|mac has joined #ruby-lang
<Metics>
I'm trying to use URI::encode, and I'm facing a problem: It encoded an url even though it's already encoded. for instance a %20 would be encoded into %25%20... Do you know how to resolve this problem?
<jhass>
Metics: fully decode before you encode again
<jhass>
and iirc URI.encode is meant for the parts you want to escape, not the full URI
relix has quit [Client Quit]
<Metics>
Actually, I'm doing a mini crawler, and sometime the URL I get are encoded sometime no, which is why is thought 'i'll always encode them, just to be sure', hence the problem I had
<Metics>
thanks for the tips
relix has joined #ruby-lang
ur5us has quit [Remote host closed the connection]
relix has quit [Client Quit]
ur5us has joined #ruby-lang
ur5us has quit [Ping timeout: 248 seconds]
jxpx777 has quit [Quit: Leaving...]
mehlah_ has joined #ruby-lang
charliesome has joined #ruby-lang
mehlah has quit [Read error: Connection reset by peer]
relix has joined #ruby-lang
yfeldblum has joined #ruby-lang
sdouglas has joined #ruby-lang
Atttwww has joined #ruby-lang
nathanstitt has joined #ruby-lang
nofxx has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
ruby-lang550 has joined #ruby-lang
durnoyabsurd has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
sdouglas has quit [Remote host closed the connection]
mehlah has joined #ruby-lang
<ruby-lang550>
hi there, I am new to Ruby and have a question about symbols
<ruby-lang550>
is this an appropriate place to ask for some clarification?
mehlah_ has quit [Read error: Connection reset by peer]
<havenwood>
ruby-lang550: yup, sure is
<ruby-lang550>
awesome, thanks Havenwood
<ruby-lang550>
so, is the primary reason to use symbols vs. strings to save memory?
<jhass>
I wouldn't think about it like that
durnoyabsurd has quit [Remote host closed the connection]
<jhass>
symbols are identifiers, strings are for data
<ruby-lang550>
so when would you use a symbol vs a string?
<ruby-lang550>
I guess I'm not sure what you mean by an identifier vs for data
<toretore>
aHash[:color] = 'red'
<jhass>
most commonly as hash keys
<toretore>
:color is an identifier
<jhass>
but also where other languages use enums
<toretore>
'red' is data
weems|mac has quit [Remote host closed the connection]
<jhass>
when referring to methods, like public_send(:foo) over public_send('foo') (both work!)
<ruby-lang550>
oh okay, and so what is the advantage to using aHash[:color] = 'red' instead of aHash["color"] = 'red'
<jhass>
for once you make clear that :color is an identifier
<jhass>
as a nice side effect :color will only allocate once
<toretore>
don't worry too much about symbols, you don't have to use them
ur5us has joined #ruby-lang
<jhass>
yeah, in doubt use a string
<toretore>
use strings by default, and the cases where you might use symbols will eventually show themselves
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ruby-lang550>
oh okay, thanks
<havenwood>
ruby-lang550: Imagine you have a million people, each with a favorite color. If they each have a favorite "color" you have a million object ids, but with a :color just one object id.
shinnya has quit [Ping timeout: 260 seconds]
<toretore>
that is contrived. contrived!
<ruby-lang550>
gotcha...that makes sense to me.
<havenwood>
ruby-lang550: if you need to mutate it or need any of the methods on String, then maybe a String :P
<ruby-lang550>
but it is strange b/c when I used strings as the hash keys for patient1 and patient2 I actually saw the same object_ids when I thought I should see different ones b/c they were strings and not symbols
<toretore>
ruby-lang550: re memory: there have been cases where overuse of symbols have led to memory leaks because (traditionally) they are not garbage collected
<jhass>
ruby-lang550: the difference is that strings don't guarantee the same object id, symbols do
<ruby-lang550>
havenwood: just to clarify, are you saying if I need to utilize methods on a String, then I should use a string vs symbol ?
<ruby-lang550>
I think I'm getting closer to understanding...I appreciate your help guys!
<jhass>
I think you got enough for now, if you just continue using ruby and maybe be told to use the one over the other once or twice it'll resolve naturally. Don't worry too much for now
<ruby-lang550>
jhass: thanks! I just modified that eval.in to use symbols, and I see the object ids are the same now
yubrew has joined #ruby-lang
<ruby-lang550>
okay, thanks a lot !
dm78 has joined #ruby-lang
shinnya has joined #ruby-lang
<havenwood>
ruby-lang550: Like if you're wanting to #capitalize, #reverse, etc you want a String. Symbols are simple, have fewer methods, and aren't mutable.
<ruby-lang550>
havenwood: ah...I see what you're sayin'. Thanks again!
yubrew has quit [Ping timeout: 244 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weems|mac has joined #ruby-lang
dangerousdave has quit [Read error: Connection reset by peer]
dangerou_ has joined #ruby-lang
banister has joined #ruby-lang
dm78 has quit [Remote host closed the connection]
ecnalyr has joined #ruby-lang
ruby-lang550 has quit [Ping timeout: 246 seconds]
mistym has quit [Remote host closed the connection]
schaerli has quit [Remote host closed the connection]
schaerli has joined #ruby-lang
btiefert has quit [Quit: Leaving]
schaerli has quit [Remote host closed the connection]
schaerli has joined #ruby-lang
yfeldblum has joined #ruby-lang
heavyhor1e has quit [Read error: Connection reset by peer]
heavyhorse has joined #ruby-lang
btiefert has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
duderonomy has joined #ruby-lang
brian2 has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
zUriel_ has quit [Ping timeout: 240 seconds]
oste has quit [Quit: oste]
btiefert has quit [Quit: leaving]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brian2 has left #ruby-lang [#ruby-lang]
yubrew has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
yubrew has quit [Ping timeout: 260 seconds]
diegoviola has joined #ruby-lang
stardiviner has joined #ruby-lang
Lumio has quit [Quit: Lumio]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Caius has quit [Ping timeout: 255 seconds]
jhass is now known as jhass|off
Caius has joined #ruby-lang
brianpWins has joined #ruby-lang
jxpx777 has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
diegoviola has quit [Quit: WeeChat 0.4.3]
dangerou_ has quit [Ping timeout: 248 seconds]
jxpx777 has quit [Quit: Leaving...]
oste has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banister has joined #ruby-lang
schaerli has quit [Ping timeout: 264 seconds]
CaptainJet has joined #ruby-lang
malconis has joined #ruby-lang
malconis has joined #ruby-lang
malconis has quit [Client Quit]
malconis has joined #ruby-lang
malconis has quit [Client Quit]
malconis has joined #ruby-lang
yubrew has joined #ruby-lang
VTLob has quit [Quit: VTLob]
shinnya has quit [Ping timeout: 260 seconds]
ju has joined #ruby-lang
yubrew has quit [Ping timeout: 264 seconds]
shinnya has joined #ruby-lang
matp has joined #ruby-lang
<ju>
hello
<ju>
I didn't understand why this code is not OK
<ju>
test = Array.new(1024, Array.new(3, 0))
<ju>
test[0][0] = 1
<ju>
puts test[1][0]
<ju>
return 1 ! instead of 0 as expecte
<ju>
d
theharshest has joined #ruby-lang
<ju>
does anyone know why... ?
<red_menace>
what do you expect to happen?
<ju>
test[0][0] must be 1 and this is what happen
<ju>
but not test[1][0]
<ju>
it must be 0
<red_menace>
here is a hint - print the array after you have assigned your value
<apeiros>
ju: your array contains the same object 1024 times
<apeiros>
ju: use Array.new(1024) { Array.new(3,0) } to create different instances