<jdunck>
nuby here - can someone familiar w/ python point me at a thing like its timeit module?
<jdunck>
(or what do people use for micro-bencing?)
<Xeago>
Benchmark
<Xeago>
don't know the exact name or syntax, but that should help ddg-fu
xardas has quit [Ping timeout: 248 seconds]
<jdunck>
thanks
elaptics is now known as elaptics`away
hakunin has quit [Remote host closed the connection]
tylersmith has quit [Quit: tylersmith]
duosrx has quit [Ping timeout: 246 seconds]
mephux has quit [Excess Flood]
<banister`sleep>
Louth: "Salary is determined based on your qualifications and your location -- we pay market rates for your area, not for ours. If you are one of our ideal candidates, let’s talk about how to make this the perfect job for you."
<banister`sleep>
sucks if you live in india
<Louth>
haha
generalissimo has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
<Louth>
our dev team is currently in America, England and Germany
<aedornm>
That job is pretty much what I do now .. except add in embedded devices, system programming, networking, administration and IT. ... I should outsource half my job.
mephux has joined #ruby
<dorei>
banister`sleep: sucks if you live in greece too
<banister`sleep>
true
<dorei>
altough ios dev jobs are still highly paid here
sdavis has quit [Quit: sdavis]
spider-mario has quit [Read error: Connection reset by peer]
<splud>
on my devhost 1.9.2 (soon to be 2.x) , but on the embedded system 1.8.7 or something
<edelpero>
Hello there, I'm having some troubles to get pg gem running locally. I've already installed postgresql and libpq-dev as it says in various posts and I'm still getting this error http://bit.ly/15UEf7N . Can anyone help me please? by the way I'm running ubuntu 12.04
<bnagy>
curely chomp has been around since the dawn of time
<bnagy>
*surely
eka has quit [Quit: Computer has gone to sleep.]
<splud>
doing something for an embedded platform, but not all tools are current - there's script differences between 1.8.7 and newer versions.
<havenwood>
splud: you could swap out chomp for strip, or if that isn't available there are other options
<dorei>
V8Energy: i've checked your code locally at my pc and it timesout perfectly
<V8Energy>
Hmm... i wonder what's wrong
<V8Energy>
Windows?
<V8Energy>
I will try to upload it to linux box
<shevy>
splud on what RUBY_VERSION do you try it and how do you try it
<dorei>
i dont remember having problems using timeout in windows
bean has quit [Ping timeout: 240 seconds]
<V8Energy>
I don't have to use rescue Timeout::Error for it to timeout properly, do i?
thorncp has left #ruby [#ruby]
<V8Energy>
I am getting http.rb:762:in `initialize': execution expired (Timeout::Error) after about 15 seconds or so
jonahR has quit [Read error: Operation timed out]
<bnagy>
1.8.7 has String#chomp
<dorei>
V8Energy: nop, it'll throw an exception whether u rescue it or not
<havenwood>
splud: 1.8.7 does have chomp, but you can reimplement it if you're on some crazy Ruby.
<bnagy>
I am prepared to bet String has had chomp since birth, it's a perlism
Xeago has quit [Remote host closed the connection]
<V8Energy>
dorei: so then I need to rescue it? or is my code fine the way it is?
<havenwood>
bnagy: I don't know of an MRI version that is missing it, but I haven't been around long.
<bnagy>
in other words, that's not the problem
MehLaptop has quit [Remote host closed the connection]
bean has joined #ruby
hiroyuki has quit [Ping timeout: 248 seconds]
<bnagy>
if it's erroring on chomp then most likely it's because you're invoking it on a not-String
macmartine has joined #ruby
<dorei>
V8Energy: i dont know what you're looking to achive, the way it is now, when it timeouts, it sets the output to false, i dont know if that's what you're aiming at
nat_home has joined #ruby
newUser1234 has quit [Remote host closed the connection]
<V8Energy>
dorei: that's exactly what i am aiming for. but unfortunately it sets output to false only after 15+ seconds instead of 1
newUser1234 has joined #ruby
tar_ has joined #ruby
<dorei>
V8Energy: let me paste you what i've checked here
newUser1_ has joined #ruby
newUser1234 has quit [Read error: Connection reset by peer]
aleph-null has quit [Read error: Connection reset by peer]
Vert has quit [Ping timeout: 252 seconds]
douglarek is now known as douglarek_away
<splud>
but it's pulling the = out and using it as a separate assignment I get the VARNAMEvalue(newline) = and nothing as the value when I print #{key} = {$value}
<splud>
gawd, I want to be dealing with the data I need to parse. Could have done this in C or Perl, but the scripting in the web stuff is ruby...
jpfuentes2 has joined #ruby
Eerbin has quit [Ping timeout: 272 seconds]
kumavis has quit [Quit: kumavis]
q99 has quit [Quit: Computer has gone to sleep.]
rhinux has joined #ruby
zeade has joined #ruby
<bean>
maybe you should gist your code
nOStahl has quit [Quit: Going To Sleep]
heliumsocket has joined #ruby
takeru_ has joined #ruby
zeade1 has quit [Ping timeout: 245 seconds]
oposomme has quit [Quit: Leaving...]
endzyme has quit [Remote host closed the connection]
zzing has joined #ruby
zzing has left #ruby [#ruby]
ephemerian has quit [Quit: Leaving.]
apok has quit [Quit: apok]
hbpoison has quit [Ping timeout: 264 seconds]
takeru_ has quit [Ping timeout: 276 seconds]
dhruvasagar has quit [Ping timeout: 246 seconds]
mneorr has quit [Remote host closed the connection]
jrendell has quit [Quit: jrendell]
dhruvasagar has joined #ruby
chrrz has joined #ruby
philcrissman has quit [Remote host closed the connection]
io_syl has quit [Quit: Computer has gone to sleep.]
i_s has quit [Quit: i_s]
FenrirReturns has quit [Ping timeout: 245 seconds]
crackfu has joined #ruby
<splud>
beh, if I use pp, I see the hash is in fact parsed properly...
crodas has quit [Ping timeout: 276 seconds]
Voodoofish430 has quit [Quit: Leaving.]
etcetera has quit []
sn0wb1rd has joined #ruby
mneorr has joined #ruby
meoblast001 has joined #ruby
mneorr has quit [Remote host closed the connection]
jeffreybaird has quit [Quit: jeffreybaird]
heliumsocket has quit [Remote host closed the connection]
inao_ has joined #ruby
jeffreybaird has joined #ruby
jeffreybaird has quit [Client Quit]
inao has quit [Ping timeout: 264 seconds]
atyz has joined #ruby
Honeycomb has quit [Quit: Leaving.]
arya has quit [Ping timeout: 248 seconds]
jsilver has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
nOStahl has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jrendell has joined #ruby
crodas has joined #ruby
locriani has quit [Remote host closed the connection]
atyz has quit [Ping timeout: 248 seconds]
arya has joined #ruby
locriani has joined #ruby
adamjleonard has quit [Quit: Leaving...]
Guest34862 is now known as ddd
casion has left #ruby [#ruby]
Hanmac1 has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
Takehiro has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
jamesfung14 has joined #ruby
chipotle_ has joined #ruby
i_s has joined #ruby
sandGorgon has quit [Read error: Connection reset by peer]
mootpointer has quit [Quit: Exit, pursued by a bear.]
alvaro_o has quit [Quit: Ex-Chat]
sandGorgon has joined #ruby
newUser1234 has quit [Remote host closed the connection]
gyre007 has quit [Remote host closed the connection]
<bnagy>
becom33: the issue is that a computer won't answer all the host controller questions etc
zyrex has quit [Ping timeout: 245 seconds]
nomenkun has joined #ruby
<havenwood>
splud: The former better for larger files, the latter simpler for small.
<bnagy>
havenwood: ha. Yeah I always use * so I get stuck having to flatten, for some reason I never use the array of array of pairs :/
<Nom->
Anyone know if there's packaged versions of Ruby for installation onto Debian based machines? I'm chasing 1.9.3.anything that I can load onto a Ubuntu 10.04 server to run a production app, and it doesn't have external 'net access
rocket has joined #ruby
<bnagy>
Nom-: get get the tgz and ./configure make && make install
<bnagy>
*just get
<bnagy>
man my fingers hate me today
<Nom->
I don't want to stomp over the version already installed though... I was hoping to do it under rvm or rbenv
keyvan has quit [Read error: Connection reset by peer]
tommyvyo has quit [Quit:]
<johnjohn101>
aytch: tx, i'll check it out.
takeru_ has joined #ruby
<johnjohn101>
how do you like ruby 2.0?
<aytch>
I'm honestly not experienced enough to have an opinion
<aytch>
all my scripts and amateur hacks that I've tested so far work...so I'd say it's great
splud has quit [Quit: splud]
<johnjohn101>
last time i messed with ruby was ironruby 1.0.3 way back when
Ontolog has quit [Remote host closed the connection]
<johnjohn101>
looks like almost 2 years ago
gwillickers has joined #ruby
gwillickers has quit [Client Quit]
<aytch>
it's probably come a long way. Ruby development seems...really, really fast compared to most languages.
punchfacechampio has joined #ruby
takeru_ has quit [Ping timeout: 255 seconds]
johnjohn101 has quit [Quit: Leaving.]
gwillickers has joined #ruby
ocnam has joined #ruby
punchfacechampio has quit [Client Quit]
punchfacechampio has joined #ruby
cantonic has quit [Quit: cantonic]
cantonic has joined #ruby
arya has quit [Ping timeout: 248 seconds]
Rick has joined #ruby
tommyvyo has joined #ruby
Rick is now known as Guest88136
splud has joined #ruby
generalissimo has quit [Read error: Connection reset by peer]
generalissimo has joined #ruby
hadees has quit [Quit: hadees]
arya has joined #ruby
NiteRain has joined #ruby
dallasm has joined #ruby
<splud>
bnagy: where are you located? Any chance you're in the San Francisco area?
dhruvasagar has quit [Ping timeout: 256 seconds]
<splud>
I'd like to buy you a brew sometime.
chimkan_ has joined #ruby
otherj has quit []
tommyvyo has quit [Quit:]
huoxito has quit [Quit: Leaving]
hadees has joined #ruby
paulchandler has joined #ruby
decoponio has joined #ruby
ner0x has joined #ruby
paulchandler has quit [Quit: leaving]
carlyle has quit [Remote host closed the connection]
macmartine has joined #ruby
girija has joined #ruby
lancepantz_ is now known as lancepantz
havenwood has quit [Remote host closed the connection]
neurotech has joined #ruby
freakazoid0223 has quit [Ping timeout: 245 seconds]
tommyvyo has joined #ruby
mneorr has joined #ruby
lancepantz is now known as lancepantz_
<neurotech>
How can I get ruby to read an environment variable that I've set via zsh?
codezombie has joined #ruby
<neurotech>
e.g. Is this correct: password = ENV['PASSWORD']
philcrissman has quit [Remote host closed the connection]
chimkan_ has quit [Quit: chimkan_]
chimkan has joined #ruby
hakunin has joined #ruby
mneorr has quit [Ping timeout: 260 seconds]
tommyvyo has quit [Quit:]
mibitzi has joined #ruby
MrZYX is now known as MrZYX|off
Dreamer3 has quit [Remote host closed the connection]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
Dreamer3 has joined #ruby
divout has quit [Ping timeout: 255 seconds]
joofsh has quit [Remote host closed the connection]
endzyme has joined #ruby
neurotech has quit [Remote host closed the connection]
Dreamer3 has quit [Client Quit]
Dreamer3 has joined #ruby
hashmal has joined #ruby
gwillickers has quit [Quit: leaving]
Voting has quit [Ping timeout: 276 seconds]
ananthakumaran has joined #ruby
divout has joined #ruby
love_color_text has joined #ruby
sn0wb1rd has quit [Read error: Connection reset by peer]
Tricon has joined #ruby
ananthakumaran has quit [Client Quit]
linjunhalida has quit [Quit: linjunhalida]
dankest has quit [Quit: Leaving...]
tomzx_mac has joined #ruby
Guest88136 has quit [Quit: Leaving...]
sirish has joined #ruby
chimkan has quit [Quit: chimkan]
tomzx_mac_ has quit [Ping timeout: 248 seconds]
<bnagy>
splud: I seldom get to the US, sorry :) Right now I'm in Australia, but I "live" in random different countries
<bnagy>
but it was Nom-'s code that was correct, anyhow ;)
jonahR has quit [Quit: jonahR]
Mattix has quit [Read error: Connection reset by peer]
Mattix has joined #ruby
io_syl has joined #ruby
flagg0205 has joined #ruby
Adys_ has joined #ruby
lancepan- has joined #ruby
love_color_text has quit [Remote host closed the connection]
lancepan- is now known as lancepantz
bradhe_ has joined #ruby
jaimef_ has joined #ruby
virtuose has quit [Ping timeout: 276 seconds]
lancepantz_ has quit [Ping timeout: 248 seconds]
generali_ has joined #ruby
Emplitz has joined #ruby
psyprus has quit [Ping timeout: 248 seconds]
SeanTAllen has quit [Ping timeout: 248 seconds]
flagg0204 has quit [Ping timeout: 248 seconds]
brum has quit [Ping timeout: 248 seconds]
perun_ has quit [Ping timeout: 248 seconds]
ner0x has quit [Ping timeout: 248 seconds]
bradhe has quit [Ping timeout: 248 seconds]
undersc0re97 has quit [Ping timeout: 248 seconds]
psyprus has joined #ruby
ner0x has joined #ruby
Adys has quit [Ping timeout: 248 seconds]
dnyy has quit [Ping timeout: 248 seconds]
generalissimo has quit [Ping timeout: 248 seconds]
jaimef has quit [Ping timeout: 248 seconds]
heliumsocket has quit [Quit: heliumsocket]
krz has quit [Quit: krz]
sn0wb1rd has joined #ruby
dankest has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
Pandaen has quit [Remote host closed the connection]
nachtwandler has joined #ruby
perun__ has joined #ruby
Pandaen has joined #ruby
nOStahl has quit [Quit: Going To Sleep]
chrishough has joined #ruby
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
<codezombie>
Was looking for a way to get a list of hash key/value pairs based on an array of keys. Found an accepted answer on SO, however it doesn't appear to work. https://gist.github.com/gitt/5062669 Can anyone tell me why that doesn't work?
<Tricon>
codezombie: What's your expected result?
<codezombie>
Tricon: ideally, a new hash with only the allowed keys and their values.
baroquebobcat has quit [Quit: baroquebobcat]
iamjarvo has quit [Quit: Leaving.]
blahwoop has quit [Ping timeout: 255 seconds]
linjunhalida has joined #ruby
<codezombie>
inject is something I don't use very often. I suppose I could be looking at this all wrong.
<Tricon>
Inject is gonig to run that method an each value.
zeade has quit [Quit: Leaving.]
<splud>
nom provided the last bit to streamline the op, but it was the overall help. I musta blown about 2 hours dealing with that aggravating hash.
thinkclay has joined #ruby
tomzx_mac has quit [Ping timeout: 256 seconds]
elico has joined #ruby
sandGorgon has quit [Ping timeout: 264 seconds]
duosrx has joined #ruby
sandGorgon has joined #ruby
M- has joined #ruby
<Tricon>
codezombie...
<Tricon>
You want puts params.values_at(*ALLOWED_KEYS)
sandGorgon has quit [Max SendQ exceeded]
<codezombie>
Tricon: yeah, I gave that a try, however it drops the keys.
<Tricon>
BRB.
Tricon has quit [Quit: Leaving...]
dankest has quit [Quit: Leaving...]
sandGorgon has joined #ruby
duosrx has quit [Ping timeout: 245 seconds]
miso1337 has joined #ruby
<codezombie>
This does what I want: ALLOWED_KEYS.inject({}) { |k,v| k[v] = params[v]; k }
brum has joined #ruby
ner0x has quit [Quit: Leaving]
nOStahl has joined #ruby
mfcabrera has joined #ruby
nOStahl has quit [Client Quit]
a_a_g has joined #ruby
M- has quit [Quit: This computer has gone to sleep]
Tricon has joined #ruby
M- has joined #ruby
brum has quit [Ping timeout: 248 seconds]
iamjarvo has joined #ruby
Artheist has joined #ruby
<Tricon>
Ah, new hash. Forgot that part.
<Nom->
You could also do params.reject {|k,v| <some check here>}
<Hanmac>
becom33 ribusb looks not to be compatible with your ruby version
mercwithamouth has joined #ruby
averiso has joined #ruby
tjbiddle_ has joined #ruby
atyz has quit [Quit: Leaving...]
havenwood has quit [Remote host closed the connection]
<dmonjo>
so?
charles_manson_4 has joined #ruby
charles_manson_4 has quit [Client Quit]
<lewix>
I/join #rubymotion
tjbiddle has quit [Ping timeout: 264 seconds]
tjbiddle_ is now known as tjbiddle
<dmonjo>
print (my_array.reject { |x| x == 'P' })
<dmonjo>
doesnt work
Zta has joined #ruby
brianpWins has quit [Quit: brianpWins]
<dmonjo>
also Array("string") is wrong
<dallasm>
so?
<becom33>
Hanmac, Im running ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
Dreamer3 has quit [Quit: Leaving...]
Dreamer3 has joined #ruby
carlzulauf has joined #ruby
<Hanmac>
becom33 yeah ... ribusb looks after an 1.8 gem ... 1.8.7 or maybe older 1.8.6 ...
mneorr has quit [Read error: Connection timed out]
<Hanmac>
it is NOT compatible with the 1.9 C-API .. that why the compile does fail
browndawg has joined #ruby
<dmonjo>
string hello to array holw can i do it the fastest way
tagrudev has joined #ruby
mneorr has joined #ruby
<dallasm>
dmonjo: havenwood and i both gave you working examples. his and my example work on ruby versions from 1.8.5 -> 1.9.3
Mon_Ouie has quit [Ping timeout: 248 seconds]
BoomerBile has joined #ruby
<Hanmac>
dmonjo Array("string") is not wrong
<BoomerBile>
anyone here familiar with net/smtp.rb ?
<lewix>
to_a is deprecated?
atyz has joined #ruby
grzywacz has joined #ruby
<dallasm>
lewix: must be, it don't work on 1.9.3
Villadelfia has quit [Read error: Connection reset by peer]
SeySayux has quit [Read error: Connection reset by peer]
<lewix>
dallasm: apparently
chussenot has joined #ruby
<lewix>
what's the reason behind that hmm
<BoomerBile>
i've written a small script that sends an email i was using msg= <<END_OF_MESSAGE From: To: Subject: END_OF_MESSAGE but the way i'm using ruby does not allow me to do this so I changed it to msg="From: To: Subject:" the emails are being sent but they aren't going to the right place
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
<dallasm>
lewix: <%= reason %> ?
neurone-1337 has quit [Ping timeout: 276 seconds]
<Hanmac>
because String it is not an Enumerable anymore, because its ambigous
<lewix>
Hanmac: so it's only deprecated for the string class?
<dmonjo>
"hello".each_char_index { |x| array[index] = x }
icole has quit [Remote host closed the connection]
SeanTAllen has joined #ruby
jetblack has quit [Ping timeout: 244 seconds]
<thinkclay>
what is this exactly? def foo=(param) is that like a variable function or a static method?
<thinkclay>
the = sign is what i dont get
<Hanmac>
why ? why do you use _index ? i dont have told you that??
Jeaye has quit [Quit: zzzZZZzzzzz]
<Hanmac>
thinkclay: its a setter method
<Hanmac>
= is part of the method name
<thinkclay>
Hanmac, ahh cool so like the other is_a? and toupper! its just there to be more readable?!
<Hanmac>
yeah an method can have one of the ? ! = at the end
tjbiddle has quit [Ping timeout: 255 seconds]
fhd has left #ruby [#ruby]
dmiller1 has joined #ruby
<thinkclay>
awesome. Friggin love ruby more and more every day
averiso has quit [Ping timeout: 244 seconds]
fire has quit [Ping timeout: 248 seconds]
jetblack has joined #ruby
averiso has joined #ruby
francisfish has joined #ruby
miso1337 has quit [Ping timeout: 246 seconds]
<dmonjo>
print my_array1.reject { |x| x == 'P' }.to_s
joeycarmello has quit [Remote host closed the connection]
<dmonjo>
i wnt to now map that array back into a string
<dmonjo>
.to_s is wrong i think
<Hanmac>
.join
<dmonjo>
ok
<dallasm>
yes, print is like p on arrays
dnyy has joined #ruby
dallasm has quit []
dmonjo has quit [Remote host closed the connection]
dmiller1 has quit [Ping timeout: 246 seconds]
<lewix>
what's the difference between to_ary and to_a
apeiros_ has joined #ruby
<Tricon>
lewix: What's it being called on?
jetblack has quit [Ping timeout: 255 seconds]
jetblack has joined #ruby
mneorr has quit [Read error: Connection timed out]
<lewix>
Tricon: anything. Just asking out of curiosity
mneorr has joined #ruby
<lewix>
I understand that Array(foo) calls to_ary first then to_a if the former didn't work?
<Tricon>
Usually the same, but on an Array, to_ary will return itself while, if to_a is called on a subclass of Array, will convert the subclass to an array.
postmodern has joined #ruby
zmike123 has joined #ruby
<codezombie>
is it possible to have a tempfile stick around long enough for send_file? It keeps getting garbage collected before send_file can do it's thing.
VonKingsley has quit [Quit: VonKingsley]
<Tricon>
codezombie: Are you closing the handler early?
jrendell has joined #ruby
<codezombie>
Tricon: I've got a sinatra app, that calls my image processor class. This class uses minimagick to manipulate the file, and then shoot it back to the user. All I'm doing on my end is pass the image to minimagick, and then pass the returned path to send_file. I'm not explicitly closing anything.
<codezombie>
I did try explicitly creating a Tempfile, via Tempfile.new, however I had the same result that minimagick gave me. The file gets garbage collected.
<Tricon>
What's the exact error?
<codezombie>
Tricon: The file identified by body.to_path does not exist
<Tricon>
K.
fjfish has joined #ruby
zmike1234 has joined #ruby
zmike1234 has quit [Client Quit]
zmike123 has quit [Quit: Выходжу]
<codezombie>
Tricon: might be worth to note, if the image result is very small, just a few kb everything works.
<codezombie>
It's when the larger file has to be read, that causes the issue.
<Tricon>
codezombie: Ideally, you would delay job something like this, but that can be overkill for a simple app.
jpcamara has joined #ruby
gphillips has left #ruby [#ruby]
<codezombie>
Tricon: I think I've got it. I can write the file using File instead of Tempfile. And using begin/ensure make sure the file is removed after the send_file
<Nom->
Slightly off topic, but anyone know if there's a "bundle package" command that will include the binary compiled gems too? I'm wanting to deploy to a system which doesn't have build tools :)
<Tricon>
codezombie: Good call.
ocnam has quit [Quit: Tan Tan!]
mneorr has quit [Read error: Connection timed out]
vlad_starkov has joined #ruby
angusiguess has quit [Ping timeout: 260 seconds]
scruple has quit [Quit: Leaving]
mneorr has joined #ruby
bobdobbs has joined #ruby
noxoc has joined #ruby
ZT has quit [Quit: Leaving]
<codezombie>
damn, it appears that ensure runs, and deletes the file before send_file finishes.
<codezombie>
I could write a simple cron to just clean up
brum has joined #ruby
<bobdobbs>
I've been using wordpress to build small sites. I've been throwing in things like galleries, simple shops... I'm curious about ruby, Which ruby framework should I play with, that might replace wordpress for me?
Pufferfo_ has quit []
Pufferfood has joined #ruby
<nightfly>
Jekyll, Rails, etc..
chrishough has quit [Quit: chrishough]
vlad_starkov has quit [Remote host closed the connection]
<shevy>
bobdobbs raaaails
<shevy>
or you build it from scratch :D
mercwithamouth has quit [Ping timeout: 264 seconds]
brum has quit [Ping timeout: 248 seconds]
<bobdobbs>
cool. I reckon I'll play with rails tonight then :)
<puppeh>
in other words, ruby regexp is not multiline by default
pakchoi2 has quit [Read error: Connection reset by peer]
<_bart>
cool, thanks
averiso has joined #ruby
<workmad3>
_bart: in non-multiline mode, . matches everything except a newline
nari has joined #ruby
<workmad3>
_bart: in multiline, . matches everything
haxrbyte_ has joined #ruby
<workmad3>
_bart: if you know you have limits on allowable data there though, you could do [\w\s]+ or similar, which would match any word characters or any whitespace
<workmad3>
rdark: last time I checked, it didn't seem to
<rdark>
hoelzro: good to know :)
<workmad3>
rdark: it might be locale dependent
averiso has quit [Quit: Quit.]
<hoelzro>
according to that page, it's fixed
<workmad3>
rdark: I think you can use \p{Word} for that
sayan has quit [Ping timeout: 248 seconds]
<workmad3>
ah, the [[]] classes apaprently match them
krz has joined #ruby
<workmad3>
rdark: so, that [\s\w.] character class expands to '[[[:word:]][[:punct:]][[:blank:]]]' in order to allow unicode :)
gtc has joined #ruby
smokie has joined #ruby
Dreamer3 has joined #ruby
hbpoison has quit [Ping timeout: 245 seconds]
<smokie>
hey guys, can someone help me out with a ruby issue im having on ubuntu server? im trying to run redmine but its giving me this error: Redmine requires Bundler 1.0.21 (you're using 1.0.15). Please install a newer version with `gem install bundler`.
<smokie>
when i run this command it says it sucessfully installed bundler-1.3.0, but i still get the same error when running redmine
bradhe_ has quit [Ping timeout: 256 seconds]
Dreamer3 has quit [Client Quit]
seich- has quit [Ping timeout: 276 seconds]
<workmad3>
smokie: run 'gem install bundler -v "1.0.21"
<_bart>
workmad3: how do I match a single newline?
<workmad3>
_bart: $ I believe
pyrac has quit [Read error: Connection reset by peer]
<_bart>
workmad3: You then a$b should match a\nb
pyrac_ has joined #ruby
lkba has quit [Ping timeout: 246 seconds]
<_bart>
workmad3: it doesn't according to rubular
<workmad3>
_bart: ah, /a\nb/
<workmad3>
_bart: it was even more obvious than I thought :P
<smokie>
workmad3, thanks.. i ran that, i still get the same error msg
Xeago has joined #ruby
<mikecmpbll>
why is updating ruby such a monumental pain in the arse.
<mikecmpbll>
nothing seems to be able to find openssl even though i installed it.
<workmad3>
mikecmpbll: because the ruby module for it isn't compiled?
skattyadz has joined #ruby
gyre007 has joined #ruby
pandawarrior has joined #ruby
haxrbyte has joined #ruby
slainer68 has quit [Read error: Connection reset by peer]
<mikecmpbll>
well, when i installed ruby 2 from RVM it said:
slainer68 has joined #ruby
<mikecmpbll>
Compiling openssl in /Users/mike.campbell/.rvm/src/openssl-1.0.1c.
Dreamer3 has joined #ruby
becom33 has quit [Ping timeout: 248 seconds]
<mikecmpbll>
and all the rest.
Dreamer3 has quit [Remote host closed the connection]
<workmad3>
mikecmpbll: bleh, I kept getting ssl issues with installing ruby 2 on my mac until I installed openssl with homebrew
mockra has joined #ruby
<workmad3>
mikecmpbll: I've not had any success with the ruby-build attempt to updated it, don't know about the rvm attempt, but wouldn't surprise me if it's also a bit tempermental
haxrbyte_ has quit [Ping timeout: 245 seconds]
mibitzi has joined #ruby
<mikecmpbll>
i see. ok thanks, something else to try.
grzywacz has quit [Quit: :wq]
Dreamer3 has joined #ruby
Dreamer3 has quit [Remote host closed the connection]
end_guy has quit [Ping timeout: 276 seconds]
sayan has joined #ruby
lewix has quit [Remote host closed the connection]
dmiller1 has joined #ruby
khismetix has joined #ruby
<pandawarrior>
is it a code smell if i have a class that has only class methods?
samphippen has joined #ruby
<pandawarrior>
and all the variables are class variables, so no instance methods/variables at all?
mockra has quit [Ping timeout: 276 seconds]
Dreamer3 has joined #ruby
Dreamer3 has quit [Remote host closed the connection]
<Hanmac>
pandawarrior you should use a module for that
Takehiro has quit [Remote host closed the connection]
<pandawarrior>
because I need to create a number of only a particalr type
<workmad3>
pandawarrior: care to try that explanation again, but this time with a bit of sense in it? ;)
fire has joined #ruby
<pandawarrior>
:S
huoxito has joined #ruby
<Hanmac>
smokie did you try what the error message sais?
<smokie>
Hanmac, yes, i tried to run 'gem install bundler' and it says it installas 1.3 fine, then i removed it and tried to run 'gem install bundler -v "1.0.21"' like workmad3 suggested
<smokie>
it says 1 gem installed but i still get the same error
<_bart>
workmad3: why would I want to use /registration service provider:(.+)$/i over /registration service provider:(.+)/i ? (the $)
seich- has joined #ruby
<pandawarrior>
I have a Number class that is responsible for producing roman numeral numbers and a print class that prints them in a table format. the print class have only class methods and class variable in in. should i leave it as a class or turn it into a module
<Hanmac>
smokie did you use some kind of rvm? maybe its pointing to the wrong ruby?
<workmad3>
_bart: I just like to be explicit with my anchors
samphippen has quit [Ping timeout: 246 seconds]
<workmad3>
pandawarrior: ah, so your Number class should really be called RomanNumeral
<pandawarrior>
good point, yes a RomanNumeral class
<workmad3>
pandawarrior: and your Print class is a RomanNumeralPrinter, or a RomanNumeralOutput maybe
<smokie>
Hanmac, tbh i dont know.. i know 0 about ruby and the ppl in #redmine or the redmine forum are not helpful at all
thmz has joined #ruby
<pandawarrior>
workmad3: agreed
<pandawarrior>
so i can be a singleton class?
<pandawarrior>
it just seems a bit wrong
<pandawarrior>
with all those class variables....
<workmad3>
pandawarrior: right, what I'd be tempted to do is have a RomanNumeralOutput class as a normal class
<workmad3>
pandawarrior: without a load of class variables, have them as instance variables
whitedawg has joined #ruby
<workmad3>
pandawarrior: and when you create it, you pass it an IO object for that particular instance
tish has quit [Quit: Leaving.]
ph^ has joined #ruby
dr_bob has joined #ruby
hiroyuki has quit [Ping timeout: 246 seconds]
<workmad3>
pandawarrior: so it would have something like 'def initialize(io=$stdout); @io = io; end'
<pandawarrior>
ummm
<workmad3>
pandawarrior: and then instead of random 'puts' method calls, you'd do '@io.puts' etc
<pandawarrior>
intereting
<workmad3>
pandawarrior: that way you decouple your RomanNumberOutput from the exact IO object you're using, so you can instead bind to any IO object for changing the output
apod has joined #ruby
<pandawarrior>
yeah
<pandawarrior>
that makes much more sense
<pandawarrior>
to the IO just prints
Dreamer3 has quit [Quit: Leaving...]
<pandawarrior>
and the RNO class formats
<workmad3>
pandawarrior: exactly, it's a more explicit separation of responsibilities too
Dreamer3 has joined #ruby
<pandawarrior>
lovely
<workmad3>
pandawarrior: the IO class knows how to print strings to it's particular target, your RNO knows how to transform RNs into strings
verysoftoiletppr has quit []
<pandawarrior>
and all i need to do is take the puts stuff and put it into a new IO class and keep the formating logic in the original Print class, rename that to RNO and change all the vars and methods to instance ones!!!
<pandawarrior>
mwhahahahhahahaha!
ph^ has quit [Ping timeout: 245 seconds]
* pandawarrior
apologies for the evil laugh. just happy to solve a problem. :)
maligree has quit [Quit: I've had it.]
<workmad3>
pandawarrior: that's the joy of code smells ;) noticing them is the point to challenge your design assumptions and see if you can justify them
<workmad3>
pandawarrior: you don't need to create your own IO class
<workmad3>
pandawarrior: $stdout *is* an IO class
Domon has quit [Remote host closed the connection]
<workmad3>
pandawarrior: $stdout.puts "foobar" will print "foobar" to stdout ;)
browndawg has quit [Quit: Leaving.]
<pandawarrior>
ahhh okay i see, so format and the shove off to $stdout
<workmad3>
pandawarrior: there's also a StringIO class that can do similar
miso1337 has quit [Quit: afk]
<pandawarrior>
which is best to use?
<workmad3>
pandawarrior: and also File instances are IO classes and respond to puts ;)
<workmad3>
pandawarrior: as I said, your Output should take a parameter for the specific IO object to use
<workmad3>
pandawarrior: and then use @io.puts throughout your output
monkegjinni has quit [Remote host closed the connection]
<pandawarrior>
nice
<workmad3>
pandawarrior: then provide a default value in your initializer so that 'RomanNumeralOutput.new' will default to outputting to $stdout
angusiguess has joined #ruby
<pandawarrior>
oh la la
<workmad3>
pandawarrior: but you can also do 'RomanNumeralOutput.new File.open("foobar", "w") ' and instead you'll be outputting to the file 'foobar' ;)
khismetix has quit [Quit: Computer has gone to sleep.]
<pandawarrior>
my white belt is slipping, lol
freeayu has quit [Ping timeout: 248 seconds]
<pandawarrior>
okay i had to write that done but i get it
<pandawarrior>
right off to put this into codzzzzzz
tvw has joined #ruby
backjlack has quit [Read error: Connection reset by peer]
<smokie>
restarting apache2 is enough for any changes to take affect after making changes?
monkegjinni has joined #ruby
backjlack has joined #ruby
t-mart_ has joined #ruby
EMPZ has quit [Quit: Leaving]
slainer68 has quit [Remote host closed the connection]
Spooner_ has joined #ruby
backjlack_ has joined #ruby
t-mart has quit [Ping timeout: 248 seconds]
oposomme has joined #ruby
<oposomme>
hi, what is the best way to deal with multidimensionnal array as it doesn't seem to be built-in?
zmike123 has quit [Ping timeout: 256 seconds]
backjlack has quit [Ping timeout: 245 seconds]
matchaw has joined #ruby
dawkirst_ has joined #ruby
dmonjo has joined #ruby
holahola has joined #ruby
sonda has joined #ruby
holahola has quit [Remote host closed the connection]
dmonjo has quit [Client Quit]
wobblini has joined #ruby
jaygen_ has joined #ruby
jaygen has quit [Read error: Operation timed out]
spider-mario has joined #ruby
hbpoison has joined #ruby
pcboy_ has quit [Ping timeout: 244 seconds]
eka has joined #ruby
dmonjo has joined #ruby
sandGorgon has quit [Ping timeout: 245 seconds]
zmike123 has joined #ruby
Adys_ is now known as Adys
cableray has quit [Quit: cableray]
railsbros_dirk_ has joined #ruby
railsbros_dirk has quit [Ping timeout: 240 seconds]
railsbros_dirk_ is now known as railsbros_dirk
gyre007 has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
jaygen has joined #ruby
BizarreCake has joined #ruby
samphippen has joined #ruby
sirish has quit [Ping timeout: 264 seconds]
jaygen_ has quit [Read error: Operation timed out]
frihd has quit [Quit: Leaving.]
frihd has joined #ruby
frihd has quit [Client Quit]
slainer68 has joined #ruby
yshh has quit [Remote host closed the connection]
samphippen has quit [Ping timeout: 246 seconds]
takeru_ has joined #ruby
rhinux has quit [Quit: Konversation terminated!]
freeayu has joined #ruby
krz has quit [Read error: Connection reset by peer]
whitedawg has quit [Quit: Leaving.]
mockra has joined #ruby
crackfu has quit [Remote host closed the connection]
takeru_ has quit [Ping timeout: 255 seconds]
banseljaj has quit [Excess Flood]
Es0teric has quit [Quit: Computer has gone to sleep.]
dmiller1 has joined #ruby
zoonfafer has joined #ruby
samphippen has joined #ruby
greenarrow has quit [Ping timeout: 276 seconds]
greenarrow has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
banseljaj has joined #ruby
dmiller1 has quit [Ping timeout: 248 seconds]
samphippen has quit [Ping timeout: 255 seconds]
dmonjo has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
pcboy_ has joined #ruby
workmad3 has joined #ruby
verysoftoiletppr has joined #ruby
angusiguess has quit [Ping timeout: 246 seconds]
fire has quit [Ping timeout: 246 seconds]
monkegjinni has joined #ruby
greenarrow has quit [Ping timeout: 255 seconds]
monkegjinni has quit [Read error: Connection reset by peer]
<clocKwize>
Ideally I'd like to be able to do blah.x.y.z = 4 and them be openstructs all the way down, but meh.
<e-dard>
Hi suppose I have when *%w{FOO BAR ETC ETC} but it extends beyond 80 characters, is it possible to have array literals on multiple lines?
samphippen has quit [Ping timeout: 244 seconds]
gyre007 has joined #ruby
<Tricon>
e-dard: Yes.
hbpoison has quit [Ping timeout: 276 seconds]
khismetix has joined #ruby
Bry8Star has joined #ruby
<clocKwize>
e-dard: try it, " " is probably matched as "any whitespace" including new lines
<e-dard>
I'm trying it in irb but return is executing the statement :p
<Tricon>
e-dard: Doesn't do that in my irb.
<Tricon>
%w{foo bar
<Tricon>
lint}
<e-dard>
Tricon: guess I need a better REPL :p
<Tricon>
e-dard: Just using standard irb. Which Ruby version?
<clocKwize>
1.9.3-p194 :001 > %w{a b
<clocKwize>
1.9.3-p194 :002]> c}
<clocKwize>
=> ["a", "b", "c"]
<clocKwize>
works for me?
<Tricon>
Yeah.
sayan has joined #ruby
<e-dard>
wait never mind. It works
<e-dard>
\me facepalm
<apeiros_>
that's /me
gazarsgo has joined #ruby
* e-dard
face palm the facepalm
* Tricon
inception the face palm
<gazarsgo>
i'm trying to replace one part of a string with another, and replace does something completely unintuitive, what function am i actually looking for? tr only operates on single characters...
Virunga has quit [Remote host closed the connection]
dmiller1 has joined #ruby
mockra has quit [Ping timeout: 255 seconds]
kofno has joined #ruby
banister`sleep has quit [Remote host closed the connection]
yshh has joined #ruby
dmiller1 has quit [Ping timeout: 248 seconds]
daniel_- has joined #ruby
hashmal has quit [Quit: Computer has gone to sleep.]
yshh has quit [Ping timeout: 245 seconds]
<e-dard>
Is it possible with array literal of strings to have spaces in resulting output?, e.g., %w{FOO BAR 'JOINED UP'} should be ['FOO', 'BAR', 'JOINED UP'] ?
<hoelzro>
e-dard: yes
<hoelzro>
['FOO', 'BAR', 'JOINED UP']
v0n has joined #ruby
<e-dard>
hoelzro: so you really mean no?
wodKa has joined #ruby
Al___ has joined #ruby
<hoelzro>
e-dard: well, you asked for an array literal containing a string with a space in it =)
<macq>
e-dard: array of literals designed to have list of items separated by space
deadalus has quit [Changing host]
deadalus has joined #ruby
<e-dard>
macq: exactly, so the %w notation does not support any way of keeping a space in the resulting output array? Correct?
<macq>
it's like asking if you can write asm code in java
rickmasta has joined #ruby
<hoelzro>
e-dard: yes
<hoelzro>
that is correct
<wodKa>
the way I always saw it was %w is for lazy/quick prototyping and then you switch it to a real array or something later
pyrac has quit [Ping timeout: 276 seconds]
<hoelzro>
I use %w (or rather the Perl equivalent) all the time
<e-dard>
OK, understood. Thanks
<hoelzro>
prototyping or not
obs has quit [Quit: Konversation terminated!]
Al__ has quit [Ping timeout: 245 seconds]
pac1 has quit [Ping timeout: 248 seconds]
hogeo has quit [Remote host closed the connection]
Al___ has quit [Ping timeout: 264 seconds]
<wodKa>
hoelzro: guess i've never had arrays that conform to %w use :D
<wodKa>
though, I only really do web stuff, so arrays are usually for drop down boxes etc
<hoelzro>
I think that you use them more in Perl and less in Ruby because of the absence/presence of symbols
kofno has quit [Remote host closed the connection]
pskosinski has joined #ruby
Phatz0 has joined #ruby
<gazarsgo>
yeah, scope isn't automatically passed into inline_template...jalklskfgjl
<Kuifje>
maybe you can switch to cheff. *trollface*
<Kuifje>
chef*
<Phatz0>
Any good ideas how to create communications between a java application and a ruby backend? Savon (SOAP) ?
<gazarsgo>
i hear that AJAX/JSON thing is catching on
brum has quit [Ping timeout: 248 seconds]
<Phatz0>
json is ofcourse one option.
kofno has joined #ruby
monkegjinni has joined #ruby
robustus has quit [Read error: Connection reset by peer]
<csmrfx>
I hear there is this thing called HTTP
elaptics`away is now known as elaptics
Virunga has joined #ruby
nyuszika7h has quit [Quit: -yes]
pyrac has joined #ruby
miso1337 has joined #ruby
nyuszika7h has joined #ruby
berserkr has quit [Quit: Leaving.]
robustus has joined #ruby
cantonic has quit [Quit: cantonic]
V8Energy has quit [Ping timeout: 248 seconds]
IrishGringo has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
mark_locklear has joined #ruby
miso1337 has quit [Read error: Connection reset by peer]
miso1337 has joined #ruby
mikecmpbll has joined #ruby
jjbohn has joined #ruby
iamjarvo has joined #ruby
<apeiros_>
gah, can't use "history" as variable name in pry…
threesome has quit [Ping timeout: 264 seconds]
AltGrendel has joined #ruby
v0n has quit [Ping timeout: 255 seconds]
Virunga has quit [Remote host closed the connection]
Raboo has quit [Remote host closed the connection]
<Hanmac>
haha :P
monkegjinni has quit [Remote host closed the connection]
emergion has quit [Quit: Computer has gone to sleep.]
<apeiros_>
Hanmac: you're one of the contributors of pry?
<Hanmac>
noper
<apeiros_>
:/
<apeiros_>
banister & my_hearing aren't around either…
cantonic has joined #ruby
<macq>
just type <space>history
daniel_- has joined #ruby
<apeiros_>
macq: well, I just use another varname
<apeiros_>
but I think it's a bug
<apeiros_>
afaik commands should not shadow existing methods/variables
<macq>
it's not shadowed
brum has joined #ruby
<macq>
type ' history' in your pry console
brum has quit [Remote host closed the connection]
<macq>
without quotes ofc
krawchyk has joined #ruby
<apeiros_>
macq: that shows the pry history. and that's precisely what shadowing is.
<apeiros_>
ah you mean with the space
<macq>
it doesn't
<apeiros_>
yes it does. you're redefining what "shadowing" means.
arya has joined #ruby
chussenot has quit [Quit: chussenot]
<macq>
it's pry console, not irb
takeru_ has joined #ruby
niklasb has quit [Ping timeout: 246 seconds]
<apeiros_>
did I say it was irb?
adambeynon has joined #ruby
monkegjinni has joined #ruby
* Tricon
grabs popcorn
Phatz0 has quit [Quit: *code code*]
gyre008 has quit [Read error: Connection reset by peer]
* macq
doh
gyre007 has joined #ruby
<d34th4ck3r>
how can I find value of a fraction upto 10000 decimal points?
<d34th4ck3r>
for example, 103993/33102 ?
mneorr has joined #ruby
girija has joined #ruby
<apeiros_>
d34th4ck3r: project euler?
<apeiros_>
I think you can use BigDecimal
monkegjinni has quit [Remote host closed the connection]
bluOxigen has joined #ruby
ExxKA has joined #ruby
<d34th4ck3r>
apeiros_: how exactly? can you give me an example, or a link where I can read how to do this?
<apeiros_>
d34th4ck3r: I haven't done it myself, so no. I suggest reading BigDecimals docs. You can set its precision.
mockra has joined #ruby
takeru_ has quit [Ping timeout: 260 seconds]
<apeiros_>
I'd assume it's just "create nominator with a precision of >10000", "create denominator with a precision of >10000", "divide", "convert to string"
Voting has quit [Ping timeout: 244 seconds]
subbyyy has joined #ruby
Virunga has joined #ruby
slainer68 has quit [Ping timeout: 245 seconds]
mneorr has quit [Ping timeout: 264 seconds]
Al__ has joined #ruby
<d34th4ck3r>
apeiros_: I did what u said, it gave me this: "0.3141592653011902604E1"
<d34th4ck3r>
which is correct but not what i want.
Al__ has quit [Read error: Connection reset by peer]
dblack_ has joined #ruby
neurotech has quit [Remote host closed the connection]
Al__ has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
slainer68 has joined #ruby
nfk has joined #ruby
chussenot has joined #ruby
girija has quit [Ping timeout: 248 seconds]
monkegjinni has joined #ruby
AltGrendel has quit [Quit: Leaving.]
monkegjinni has quit [Remote host closed the connection]
Tricon has quit [Quit: Leaving...]
<oposomme>
I would like to use my mixin module with a log method inside and call it from the host class so I write 'extend MyMixin' and then 'self.log "bar"' but I have a NoMethodError. How do I do to use it inside the host class?
joofsh has joined #ruby
threesome has joined #ruby
<nmeum>
oposomme: include MyMixin?
<nmeum>
ähhh
<oposomme>
nmeum: it seems to work I don't understand because I thought self.log calls correctly a class method
<nmeum>
you have a module and you want to include this module in a different class?
<oposomme>
nmeum: In the host class of the mixin only
<nmeum>
aha
wargasm has quit [Read error: Connection reset by peer]
r0bgleeson has joined #ruby
<d34th4ck3r>
apeiros_: any idea?
buscon has quit [Quit: Leaving]
angusiguess has joined #ruby
<apeiros_>
not really. I'd have to investigate myself.
banister`sleep has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
sayan has quit [Read error: Connection reset by peer]
a_a_g has quit [Quit: Leaving.]
ph^ has joined #ruby
carloslopes has quit [Remote host closed the connection]
<d34th4ck3r>
apeiros_: I still can't get one thing, you said "create nominator with a precision of >10000" , how would I do that, I created a simple BigDecimal(103993) ?
<csmrfx>
d34th4ck3r: maybe you just should calc those pi decimals as arr
hiroyuki has joined #ruby
<d34th4ck3r>
csmrfx: hwo?
<d34th4ck3r>
*how
<d34th4ck3r>
maually ?
<d34th4ck3r>
*manually
daed has joined #ruby
end_guy has joined #ruby
adkron has quit [Ping timeout: 276 seconds]
runixo has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
noop has quit [Remote host closed the connection]
<csmrfx>
d34th4ck3r: well what exactly is your task at hand?
<csmrfx>
thousandth pi decimal?
<d34th4ck3r>
csmrfx: No, to print 103993/33102 upto 10^6 decimal points
samuelj has joined #ruby
philcrissman has quit [Remote host closed the connection]
<apeiros_>
csmrfx: bigdecimal should not have any troubles with 10^6 digits
theRoUS has quit [Ping timeout: 255 seconds]
Al__ has left #ruby [#ruby]
hiroyuki has quit [Ping timeout: 255 seconds]
dustint has joined #ruby
moos3 has quit [Quit: Computer has gone to sleep.]
daniel_- has quit [Ping timeout: 245 seconds]
solidoodlesuppor has joined #ruby
moos3 has joined #ruby
jpcamara has joined #ruby
<apeiros_>
d34th4ck3r: a = BigDecimal("103993")*(10**10000); b = BigDecimal("33102")*(10**10000); (a/b).to_s('f')
<apeiros_>
seems to work. I can't get BigDecimal to use N digits after the decimal point, though.
al_d has joined #ruby
pandawarrior has left #ruby [#ruby]
ebouchut has joined #ruby
zykes- has quit [Ping timeout: 245 seconds]
splud has joined #ruby
<csmrfx>
hence DecNum
d34th4ck3r has quit [Read error: Operation timed out]
d34th4ck3r has joined #ruby
xemu has joined #ruby
<apeiros_>
d34th4ck3r: a = BigDecimal("103993")*(10**10000); b = BigDecimal("33102")*(10**10000); (a/b).to_s('f')
<apeiros_>
seems to work. I can't get BigDecimal to use N digits after the decimal point, though.
atyz has joined #ruby
<macq>
a.div(b, 10**6).to_s('f')
<csmrfx>
One of the major problems with BigDecimal is that it’s not easy to control the number of significant digits of the results. While addition, subtraction and multiplication are exact (unless a limit is used), divisions will need to be passed precision explicitly or else an indeterminate number of significant digits will be lost.
<apeiros_>
csmrfx: no, hence fix the f'ing docs and/or add a usable BigDecimal#to_s
khismetix has quit [Quit: Computer has gone to sleep.]
<csmrfx>
With DecNum, Context objects are used to specify the exact number of digits to be used for all operations making the code cleaner and the results more easily predictable.
<macq>
where a = BigDecimal("103993"); b = BigDecimal("33102")
sayan has joined #ruby
<apeiros_>
macq: aha, there's the result precision hiding. thanks.
macsim has joined #ruby
<_bart>
{1=>1, 4=>2, 7=>1}
<macsim>
hi, I try using sass on ubuntu, when I launch it I got this error : Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string), how can I fix this ? thanks
<_bart>
How do I order this thing, based on the value (not the key)
Voting has joined #ruby
<apeiros_>
docs being awesome on BigDecimal#div :-/
<apeiros_>
_bart: .sort_by(&:last)
<_bart>
apeiros_: thanks, cool
<apeiros_>
returns an array. can be converted back to a Hash using Hash[]
<macq>
apeiros_: just read source code, it's not that hard...
* macq
,-)
<apeiros_>
macq: thanks, but no thanks :-p
haxrbyte_ has joined #ruby
zykes- has joined #ruby
heliumsocket has quit [Quit: heliumsocket]
jjbohn has quit [Quit: Leaving...]
haxrbyte has quit [Ping timeout: 255 seconds]
jeffreybaird has joined #ruby
<d34th4ck3r>
macq, apeiros_,csmrfx : Thanks! :)
subbyyy has quit [Quit: none 0.3.9.2]
skattyadz has quit [Quit: skattyadz]
breakingthings has joined #ruby
<apeiros_>
d34th4ck3r: and, what is it? homework? project euler?
Dreamer3 has quit [Quit: Leaving...]
haxrbyte has joined #ruby
<d34th4ck3r>
apeiros_: project euler
<d34th4ck3r>
kinda
ph^ has joined #ruby
<d34th4ck3r>
not exactly
joofsh has quit [Remote host closed the connection]
pdamer has joined #ruby
monkegjinni has joined #ruby
haxrbyte_ has quit [Ping timeout: 248 seconds]
moos3 has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby
dustint has quit [Remote host closed the connection]
binw has joined #ruby
enroxorz-work has joined #ruby
wargasm has joined #ruby
codecop has quit [Remote host closed the connection]
adamjleonard has joined #ruby
moos3 has joined #ruby
niklasb has joined #ruby
jerius has joined #ruby
yfeldblum has joined #ruby
krz has quit [Quit: krz]
EPIK has quit [Ping timeout: 255 seconds]
ananthakumaran1 has quit [Quit: Leaving.]
stopbit has joined #ruby
invisime has joined #ruby
tommyvyo has quit [Quit:]
Rollabunna has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
mockra has joined #ruby
Slivka has quit [Ping timeout: 245 seconds]
senayar has joined #ruby
daniel_- has joined #ruby
bubblehead has joined #ruby
forced_request has joined #ruby
dr_bob has quit [Quit: Leaving.]
moos3 has quit [Quit: Computer has gone to sleep.]
adkron has joined #ruby
niklasb has quit [Ping timeout: 240 seconds]
eldariof has quit [Ping timeout: 255 seconds]
tommyvyo has joined #ruby
dmiller1 has joined #ruby
mockra has quit [Ping timeout: 255 seconds]
tomzx_mac has joined #ruby
dr_bob has joined #ruby
Fabian_ has joined #ruby
blahwoop has joined #ruby
tagrudev has quit [Remote host closed the connection]
nari has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
bobdobbs has quit [Ping timeout: 276 seconds]
girija has joined #ruby
poikon has joined #ruby
jrajav has joined #ruby
<Spooner_>
#python have a strict "NO Project Euler" policy in their MOTD :D
tcstar has quit [Remote host closed the connection]
skattyadz has joined #ruby
heliumsocket has joined #ruby
wodKa has quit [Read error: Connection reset by peer]
blueOxigen has joined #ruby
Virunga has quit [Remote host closed the connection]
pyrac has quit [Read error: Connection reset by peer]
<jrajav>
Which is kind of silly
pyrac has joined #ruby
<jrajav>
You should teach people how to make good, specific questions, rather than categorically exclude them just for a choice of site
jtharris has joined #ruby
<jrajav>
Not even silly so much as plain dumb
arietis has joined #ruby
<jrajav>
They also have a bot that warns you you may be kicked, every time you say 'lol'
<Hanmac>
i recently saw an "why python is better than ruby" slideshow ... it was totally crap :P
<jrajav>
Some people should never have been given ops
<Spooner_>
shevy, We just lick the foxes, not eat the bacon.
<shevy>
ewwww ... all that fur ...
codespectator has joined #ruby
Demonen has joined #ruby
<jrajav>
Vegetarians lick foxes eh?
<Spooner_>
We can taste, but we can't swallow.
<breakingthings>
All of what you just said
<breakingthings>
gross.
<Demonen>
Hi all. I'm having issues with gitlab. Is this an appropriate channel to bother with this problem? raking gitlab:setup fails with "rake aborted!" when trying to create the admin user, like so: http://pastebin.com/siGcyq89
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<Spooner_>
Demonen, #rubyonrails ?
backjlack_ has quit [Remote host closed the connection]
Takehiro has joined #ruby
whowantstolivefo has quit [Ping timeout: 264 seconds]
Virunga has quit [Remote host closed the connection]
newUser1234 has joined #ruby
etcetera has joined #ruby
gazarsgo has quit [Quit: Page closed]
krawchyk_ has joined #ruby
DrCode has joined #ruby
<roolo>
Hi
whitedawg has joined #ruby
<roolo>
I am trying to write Accept header error reporting. Sinatra has provides route parameter for formats, but when i make a call with wrong/not privided Accept header value it jumps to not_found how can detect there, that it's caused by format?
freeayu has quit [Remote host closed the connection]
jlwestsr has joined #ruby
shadowshell has joined #ruby
girija has quit [Ping timeout: 240 seconds]
daniel_- has quit [Ping timeout: 240 seconds]
banister`sleep is now known as banisterfiend
joofsh has joined #ruby
chandlpa has joined #ruby
daniel_- has joined #ruby
`p has quit [Remote host closed the connection]
m3pow has quit [Read error: Connection reset by peer]
peregrine81 has joined #ruby
joshman_ has joined #ruby
arya has joined #ruby
`p has joined #ruby
v0n has joined #ruby
locriani has quit [Remote host closed the connection]
mafolz has quit [Remote host closed the connection]
enebo has joined #ruby
takeru has joined #ruby
aganov has quit [Quit: aganov]
robbyoconnor has quit [Max SendQ exceeded]
nomenkun has quit [Remote host closed the connection]
atmosx has joined #ruby
robbyoconnor has joined #ruby
ferdev has quit [Ping timeout: 240 seconds]
malkomalko has joined #ruby
__Big0__ has joined #ruby
geekbri_ has joined #ruby
ExxKA has quit [Quit: This computer has gone to sleep]
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
forrest has joined #ruby
ferdev has joined #ruby
gyre007 has quit [Ping timeout: 245 seconds]
takeru has quit [Ping timeout: 244 seconds]
mockra has joined #ruby
geekbri has quit [Ping timeout: 245 seconds]
locriani has joined #ruby
jjbohn has joined #ruby
zigomir has quit [Quit: zigomir]
tk_ has joined #ruby
ferdev has quit [Ping timeout: 252 seconds]
dmiller1 has quit [Ping timeout: 248 seconds]
girija has joined #ruby
mibitzi has quit [Ping timeout: 240 seconds]
slainer6_ has joined #ruby
fff has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
fff is now known as Guest53378
<Guest53378>
hi
NiteRain has quit [Ping timeout: 246 seconds]
<hoelzro>
ahoy
slainer68 has quit [Ping timeout: 245 seconds]
reset_ has joined #ruby
reset has quit [Read error: Connection reset by peer]
<lectrick>
Anyone know of a decent static code analysis tool for Ruby? I found https://github.com/simplabs/excellent but it hasn't been updated in 3 years (mostly) and the small amount of flaws it checks is laughable
<breakingthings>
lectrick: codeclimate
slainer6_ has quit [Ping timeout: 245 seconds]
<breakingthings>
code-rating as a service.
joofsh has quit [Remote host closed the connection]
Slivka has joined #ruby
sailias1 has joined #ruby
d34th4ck3r has quit [Ping timeout: 255 seconds]
<lectrick>
breakingthings: I know of it but is there any way for it to spit out more specific information than "B -> A : String class has *improved*."
<banisterfiend>
lectrick: check out zenspider's tools
<banisterfiend>
flog/flay,etc
<breakingthings>
lectrick: it includes more information than that.
<banisterfiend>
lectrick: codeclimate gives u specific information
<breakingthings>
the rating is merely an indicator that "we found something"
<breakingthings>
there's real data in the application.
<breakingthings>
take a good look at it and see.
Guest53378 has left #ruby [#ruby]
<lectrick>
ok I am impressed. But I still wish the underlying engine was OS
jonahR has joined #ruby
ferdev has joined #ruby
atmosx has quit [*.net *.split]
peregrine81 has quit [*.net *.split]
dmerrick has quit [*.net *.split]
enebo has quit [*.net *.split]
iambic has quit [*.net *.split]
ananthakumaran has quit [*.net *.split]
malkomalko has quit [*.net *.split]
timmow has quit [*.net *.split]
Whoop has quit [*.net *.split]
Rious has quit [*.net *.split]
kpwz has quit [*.net *.split]
cjk101010 has quit [*.net *.split]
soulcake has quit [*.net *.split]
alexspeller has quit [*.net *.split]
Caius has quit [*.net *.split]
witchdoc has quit [*.net *.split]
kseifried has quit [*.net *.split]
Schmidt has quit [*.net *.split]
daaaan has quit [*.net *.split]
tk_ has quit [*.net *.split]
dustint has quit [*.net *.split]
v0n has quit [*.net *.split]
sailias has quit [*.net *.split]
srid has quit [*.net *.split]
regedarek has quit [*.net *.split]
sharpobject has quit [*.net *.split]
DanKnox has quit [*.net *.split]
rolloTomasi has quit [*.net *.split]
vetsin has quit [*.net *.split]
<lectrick>
They could charge for support and a fancy UI and still give back to the community with a decent code analyzer that can run locally or as part of a build workflow
apod has quit []
tk_ has joined #ruby
sharpobject has joined #ruby
regedarek has joined #ruby
rolloTomasi has joined #ruby
dustint has joined #ruby
DanKnox has joined #ruby
srid has joined #ruby
vetsin has joined #ruby
v0n has joined #ruby
* breakingthings
shrugs
<breakingthings>
Ask brynary about it.
malkomalko has joined #ruby
peregrine81 has joined #ruby
enebo has joined #ruby
dmerrick has joined #ruby
atmosx has joined #ruby
iambic has joined #ruby
timmow has joined #ruby
cjk101010 has joined #ruby
Whoop has joined #ruby
ananthakumaran has joined #ruby
kpwz has joined #ruby
alexspeller has joined #ruby
Caius has joined #ruby
Schmidt has joined #ruby
soulcake has joined #ruby
daaaan has joined #ruby
kseifried has joined #ruby
Rious has joined #ruby
witchdoc has joined #ruby
jlwestsr has quit [Ping timeout: 264 seconds]
sailias1 is now known as sailias
daniel_- has quit [Ping timeout: 260 seconds]
bean has joined #ruby
tjbiddle has joined #ruby
codespectator has joined #ruby
amacleod has joined #ruby
alex__c2022 has joined #ruby
harumph has joined #ruby
apok has joined #ruby
bradleyprice has joined #ruby
dmiller1 has joined #ruby
postmodern has quit [Quit: Leaving]
tjbiddle has quit [Ping timeout: 252 seconds]
ffranz has quit [Quit: Leaving]
codezombie has joined #ruby
angusiguess has joined #ruby
elux has quit [Quit: Bye!]
danneu has joined #ruby
ffranz has joined #ruby
poga has joined #ruby
ged has quit [Quit: WeeChat 0.4.0]
<lectrick>
hey banisterfiend, do you know of a way to run (for example) 3 ruby tests in a row *after* loading the associated stack of code they are testing *only once*?
jeffreybaird has quit [Quit: jeffreybaird]
decoponio has quit [Quit: Leaving...]
tvw has quit [Ping timeout: 245 seconds]
<lectrick>
Also, ever run ruby with the -W switch? Specifically I wanted to know when methods were redefined but wow, there's a lot of spurious output there
<banisterfiend>
lectrick: i assume that's totally dependent on the testing library
tomzx_mac has quit [Ping timeout: 255 seconds]
gyre007 has joined #ruby
jeffreybaird has joined #ruby
<lectrick>
banisterfiend: Just using minitest... just wondering if there's something out-of-the-box that can do that
<banisterfiend>
sry, i dont use minitest, i normall use bacon :)
<banisterfiend>
and i just use the simple/standard features
<banisterfiend>
normally*
Mon_Ouie has joined #ruby
sonda has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
jlwestsr has joined #ruby
fire has quit [Quit: WeeChat 0.4.0]
<lectrick>
how's pry looking on 2.0.0? :)
monkegjinni has quit [Remote host closed the connection]
IrishGringo has quit [Ping timeout: 240 seconds]
<oz>
good
apok has quit [Quit: apok]
rickmasta has joined #ruby
<lectrick>
someone has told me "no good debuggers on 2.0" and I was suspicious
<lectrick>
TIL about bacon.
geggam_wk has joined #ruby
chrishunt has quit [Quit: ZzZzZz...]
<banisterfiend>
lectrick: who said that? well it's true that 'debugger' doesnt work that well, but it seems to be on the path to getting fixed
chrishunt has joined #ruby
jamesfung14 has joined #ruby
snearch has joined #ruby
elico has quit [Quit: elico]
monkegjinni has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
snearch has quit [Max SendQ exceeded]
<solidoodlesuppor>
OK guys. Relatively simple Ruby question: What is the best way to compare / replace with a large number of options? I want to parse a string, and each letter should be replaced by a different letter from a dictionary.
<solidoodlesuppor>
Dealing with strings here
ExxKA has joined #ruby
codezombie has quit [Quit: Leaving...]
<strtok>
are you making an options file parser ?:)
robbyoconnor has quit [Ping timeout: 256 seconds]
<solidoodlesuppor>
Erm, no. Probably didn't work that well. Basically like a simple compiler
atmosx has quit [Quit: And so the story goes…]
jeffreybaird has quit [Quit: jeffreybaird]
<solidoodlesuppor>
takes strings like asfkjdkjdafkjdhfdsakjfh and turns each letter into a command in a text file
railsbros_dirk has quit [Quit: railsbros_dirk]
jeffreybaird has joined #ruby
samphippen has quit [Read error: Connection reset by peer]
philcrissman has quit [Remote host closed the connection]
mikurubeam has quit [Ping timeout: 244 seconds]
<macq>
solidoodlesuppor: what have you tried allready?
<banisterfiend>
solidoodlesuppor: look at String#each_char
samphippen has joined #ruby
<solidoodlesuppor>
macq: Nothing. I had some kind of idea to do it with a big gnarly regex, but it seemed dumb to go about it without asking
snearch has joined #ruby
clocKwize has quit [Quit: clocKwize]
snearch has quit [Max SendQ exceeded]
aedornm has joined #ruby
tcstar has joined #ruby
snearch has joined #ruby
snearch has quit [Read error: Connection reset by peer]
rovalent has joined #ruby
<Xeago>
so, graduated — what to do now..
<amacleod>
solidoodlesuppor, you might try just having a Hash of letter->letter mappings, and only try other things if that's not fast enough.
zastern has joined #ruby
snearch has joined #ruby
pyrac has quit [Ping timeout: 264 seconds]
Kruppe has joined #ruby
<aedornm>
Xeago: College?
snearch has quit [Max SendQ exceeded]
maxme has joined #ruby
<Xeago>
yea
<Xeago>
not sure what the international term is
<amacleod>
university?
<Xeago>
bachelor of applied sciences of computer engineering now
<Xeago>
my school calls itself an university
<Xeago>
Zuyd University if you want to look it up
snearch has joined #ruby
<aedornm>
Well... graduating college in the US just means you have a pile of bills to pay that you'll probably never be able to in our wonderful economy unless you get a high paying job *right now*
<aedornm>
In other countries.. you can go to Disneyland!
<amacleod>
Some people just pop out of the end of one university and into the orifice of another.
<Xeago>
lol, I don't get to go to disneyland, but every month that I am still enrolled is about 150eur of income
<Xeago>
I could do that too amacleod, but the company where I did my final work at (that I presented/defended today at school) isn't financially stable
<Xeago>
and I am migrating to that country
<Xeago>
and don't want a permit based on a relationship with a company that is unstable
snearch has quit [Max SendQ exceeded]
<aedornm>
Time for a start-up business then!
<Xeago>
in europe?
<Xeago>
maybe
snearch has joined #ruby
sayan has quit [Quit: Leaving]
<Xeago>
tho, more interested in joining twitch, twitter, github and sorts
<Fitzsimmons>
I've got a loop iterating over a large CSV file and doing several various farily complicated things to manipulate the data and save it into a DB, but there's a massive memory leak somewhere, and I have no idea how to track it down. any suggestions? (1.9.3)
rickmasta has joined #ruby
mneorr_ has quit [Ping timeout: 245 seconds]
tk_ has quit [Quit: ばいばい]
woolite64_ has joined #ruby
woolite64__ has joined #ruby
piotr_ has quit [Ping timeout: 248 seconds]
straind has quit [Read error: Connection reset by peer]
astronaute has quit []
Chryson has joined #ruby
mockra has joined #ruby
woolite64 has quit [Ping timeout: 260 seconds]
<Hanmac>
Fitzsimmons depends how you oben the File and read it
woolite64 has joined #ruby
woolite64_ has quit [Ping timeout: 245 seconds]
woolite64__ has quit [Ping timeout: 264 seconds]
tommyvyo has quit [Quit:]
<Fitzsimmons>
Hanmac, well, maybe, but it's about 500 lines of code spread across several classes
woolite64_ has joined #ruby
newUser1234 has quit [Remote host closed the connection]
woolite64 has quit [Ping timeout: 248 seconds]
sepp2k has quit [Ping timeout: 245 seconds]
ozgura has quit [Remote host closed the connection]
anonymuse has joined #ruby
endzyme has joined #ruby
sepp2k has joined #ruby
pyrac has joined #ruby
<Hanmac>
Fitzsimmons for sample so you use File.read or File.open { } ... and how do you read the CSV? did you use the foreach method?
endzyme has quit [Read error: Connection reset by peer]
blacktulip has quit [Ping timeout: 255 seconds]
bradhe has joined #ruby
mpfundstein has quit [Remote host closed the connection]
atyz has quit [Quit: Leaving...]
etcetera has quit []
ffranz has joined #ruby
tenmilestereo has joined #ruby
`p has quit [Remote host closed the connection]
krawchyk_ has quit [Remote host closed the connection]
realDAB has quit [Quit: realDAB]
philcrissman has quit [Remote host closed the connection]
<Fitzsimmons>
Hanmac, the entire string is in RAM, but that's somewhat irrelevant because the the file might be 2 MB but we're seeing GBs of memory leakage
zoonfafer has quit [Ping timeout: 245 seconds]
girija has quit [Ping timeout: 245 seconds]
<shevy>
500 lines of code
<shevy>
spread across several classes
krawchyk has joined #ruby
joofsh has quit [Remote host closed the connection]
<shevy>
I have a class with about 2400 lines (including comments though)
<Fitzsimmons>
cool story bro
<shevy>
yeah, so I can clearly see you are overwhelmed with your 500 lines man
sn0wb1rd has quit [Quit: sn0wb1rd]
Astralum has joined #ruby
dmiller1 has quit [Ping timeout: 244 seconds]
codespectator has quit [Read error: Connection reset by peer]
<shevy>
you have not even defined how "large" large actually is for your CSV file
puppeh has quit [Remote host closed the connection]
araujo has quit [Ping timeout: 240 seconds]
ckrailo has joined #ruby
<Hanmac>
Fitzsimmons i thought that reading in steps is a better way ...
alvaro_o has joined #ruby
zeade has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
jpfuentes2 has joined #ruby
noxoc has quit [Quit: noxoc]
takeru has joined #ruby
newUser1234 has joined #ruby
etcetera has joined #ruby
Al__ has joined #ruby
Mattix has quit [Ping timeout: 246 seconds]
`p has joined #ruby
mikepack has joined #ruby
workmad3 has quit [Read error: Connection reset by peer]
<shevy>
hmm Hanmac does your $LOAD_PATH include '.' ?
statarb3 has quit [Ping timeout: 248 seconds]
Tricon has joined #ruby
dr_bob has left #ruby [#ruby]
psyprus has quit [Changing host]
psyprus has joined #ruby
jpcamara has joined #ruby
kumavis has joined #ruby
lewix has joined #ruby
lewix has quit [Changing host]
lewix has joined #ruby
brianpWins has joined #ruby
nachtwandler has joined #ruby
slainer68 has joined #ruby
Mattix has joined #ruby
mercwithamouth has joined #ruby
heliumsocket has joined #ruby
malkomalko has quit [Remote host closed the connection]
atyz has joined #ruby
<Hanmac>
shevy never :P
<shevy>
hmmmm
<Fitzsimmons>
is there any way to profile the heap on ruby 1.9?
sayan has joined #ruby
<yxhuvud>
well.
joeycarmello has joined #ruby
<yxhuvud>
you could go through Objectspace and count the different types of objects.
mahmoudimus has joined #ruby
<yxhuvud>
probably won't help a lot of there are a lot of strings though.
wreckimnaked has quit [Ping timeout: 264 seconds]
<yxhuvud>
of -> if
rickmasta has quit [Quit: Leaving...]
<yxhuvud>
you could try to divide and conquer your problem domain until you find it
ortuna has joined #ruby
noxoc has joined #ruby
testingb0t has quit [Quit: Leaving.]
mityaz has joined #ruby
__Big0__ has quit [Remote host closed the connection]
codespectator has joined #ruby
mengu has joined #ruby
tylersmith has joined #ruby
dblack__ has joined #ruby
woolite64_ has quit [Ping timeout: 256 seconds]
__Big0__ has joined #ruby
hiroyuki has joined #ruby
<havenwood>
Fitzsimmons: What are you trying to find out in particular, or just general profiling?
noxoc has quit [Quit: noxoc]
twoism has joined #ruby
daniel_- has joined #ruby
atyz has quit [Ping timeout: 244 seconds]
jerius has quit [Ping timeout: 244 seconds]
rdark has quit [Quit: leaving]
Choobie has quit [Ping timeout: 260 seconds]
Mattix has quit [Quit: Leaving]
ffranz has quit [Quit: Leaving]
etcetera has quit []
mikurubeam has joined #ruby
rickmasta has joined #ruby
fedza has quit [Read error: Connection reset by peer]
havenwood has quit [Remote host closed the connection]
etcetera has joined #ruby
ffranz has joined #ruby
fedza has joined #ruby
thone has joined #ruby
apeiros_ has joined #ruby
browndawg has quit [Quit: Leaving.]
slainer68 has quit [Read error: Connection reset by peer]
thone_ has quit [Ping timeout: 240 seconds]
slainer68 has joined #ruby
mneorr has quit [Remote host closed the connection]
malkomalko has joined #ruby
<X-Jester>
does anyone have a suggestion for monitoring a mongo database for changes besides writing a polling method?
henn1nk has joined #ruby
jerius has joined #ruby
ozgura has joined #ruby
mneorr has joined #ruby
<henn1nk>
i have the hash data. at the moment i receive the labels for my pie via data.keys. the count is saved in data.values... now i would like to add the count/data.values to the keys. how can i do this?
jrendell has joined #ruby
tommyvyo has joined #ruby
Vainoharhainen has quit [Ping timeout: 260 seconds]
Qwak has joined #ruby
banjara has joined #ruby
banjara has quit [Remote host closed the connection]
etcetera has quit []
w400z has quit []
My_Hearing has joined #ruby
pdamer has joined #ruby
samphippen has joined #ruby
carloslopes has quit [Read error: Connection reset by peer]
Chryson has quit [Read error: Operation timed out]
noxoc has quit [Ping timeout: 272 seconds]
bonhoeffer_ has quit [Quit: Leaving]
<yxhuvud>
well, I wouldn't mind if def returned the symbol name of the function
noxoc has joined #ruby
danneu has joined #ruby
<Hanmac>
okay that would be okay too
lledet has quit [Quit: lledet]
<lewix>
is mixins in ruby polymorphism
atyz has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
aedornm has quit [Quit: Leaving]
moted has quit [Remote host closed the connection]
ebobby has joined #ruby
undersc0re97 has quit [Read error: Connection reset by peer]
moted has joined #ruby
robert__ has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
philcrissman has joined #ruby
mattbl has joined #ruby
atyz has quit [Ping timeout: 272 seconds]
dmiller1 has quit [Quit: WeeChat 0.3.9.2]
<shevy>
hmm
heliumsocket has joined #ruby
Chryson has joined #ruby
marr has quit [Ping timeout: 245 seconds]
<shevy>
yxhuvud instead of other return types?
<yxhuvud>
instead of nil. I suppose a string would suffice as well
zorbyte has quit [Quit: leaving]
robert_ has quit [Ping timeout: 255 seconds]
<dblack__>
doesn't def return a method object in rubinius?
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
freakazoid0223 has quit [Read error: Connection reset by peer]
<shevy>
dunno, I couldnt even get rubinius to compile :(
jdunck has joined #ruby
jblack has joined #ruby
* dblack__
notices that rubinius on ruby-versions.net is quite old
<dblack__>
i really must maintain that stuff better
<dblack__>
anyway...
<dblack__>
rubinius-1.2.4 :001 > def x; end
<dblack__>
=> #<Rubinius::CompiledMethod x file=(irb)>
ezekielnoob_ has joined #ruby
<dblack__>
i'm not exactly sure what that object does. i can't 'call' it.
<amacleod>
Abstractly speaking, it would be kind of nice if such a thing were very much like a lambda.
jblack has quit [Client Quit]
<banisterfiend>
amacleod: how do you mean
eldariof has joined #ruby
jrendell has quit [Quit: jrendell]
Takehiro has quit [Remote host closed the connection]
<amacleod>
Well, dblack mentioned that he can't 'call' the Rubiniu::CompiledMethod object. My gut feeling is that if def has a return value, that value should be callable like a function.
monkegjinni has quit [Remote host closed the connection]
<banisterfiend>
amacleod: is there a use case for that?
<amacleod>
Maybe, maybe not.
heliumsocket has quit [Quit: heliumsocket]
<banisterfiend>
i think a CompiledMethod object is just rbx exposing its internals, it'll be a wrapper around the bytecode for that method
<banisterfiend>
you can probably call methods on it that reveal that bytecode and so on
Takehiro has joined #ruby
twoism has quit [Read error: Connection reset by peer]
<amacleod>
I could imagine it being useful for defining a dispatch table, but not eminently easier, syntactically, than just referring to methods by name.
<banisterfiend>
kind of cool you can pull source of them
<bonhoeffer>
how do i split on "\n"
noxoc has quit [Quit: noxoc]
<dblack__>
bonhoeffer: string.split(/\n/)
<dblack__>
or "\n" if you prefer
<bonhoeffer>
got it -- i needed a regex
<bonhoeffer>
so "\n" is not working for me
<amacleod>
banisterfiend, yeah, that is pretty neat.
<dblack__>
bonhoeffer: "a\nb".split("\n")
<dblack__>
=> ["a", "b"]
himsin has quit [Ping timeout: 260 seconds]
<bonhoeffer>
the regex works though
Quebert has joined #ruby
angusiguess has joined #ruby
<banisterfiend>
amacleod: though pry can do that anyway, even for methods defined in MRI ;)
breakingthings has joined #ruby
arya_ has joined #ruby
rdark has joined #ruby
<dblack__>
bonhoeffer: can you post an example of the non-working string version?
Takehiro has quit [Ping timeout: 244 seconds]
<bonhoeffer>
yes -- but i have to clean things up
arya has quit [Ping timeout: 248 seconds]
endzyme_ has quit [Remote host closed the connection]
ph^ has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
blacktul_ has quit [Remote host closed the connection]
nik_-_ has joined #ruby
nik_-_ has quit [Client Quit]
nik_-_ has joined #ruby
<lectrick>
amacleod: dblack__ dblack: I have oft wished that a "def" returned a value which was the symbol of the method name, for 2 reasons: 1) the symbol is already created in the C code that actually creates the method. 2) It would allow you to put "private" or "protected" keywords right in front of the def, which I think is kind of elegant.
<banisterfiend>
lectrick: that's kind of cool
<amacleod>
lectrick, "private" would be a method in an internal domain specific language that just operates on the resulting symbol?
<banisterfiend>
amacleod: private already exists
<lectrick>
banisterfiend: i know, but when I proposed it to the ruby-lang list, I kind of got shot down, perhaps because I was new?
<dblack__>
shevy: method lookup goes first to your singleton class, then to any modules mixed into that class; then to your original class, then to any modules mixed in; then to that class's superclass, then to its mixed-in modules…. etc.
codecop has joined #ruby
<lectrick>
I don't know if you guys can comment on feature requests like that, but would totally appreciate it if you could
<dblack__>
shevy: unless you prepend :-)
sandGorgon has joined #ruby
<shevy>
dblack__ grrrr that was the long version, now Hanmac's shorter version looks better :P
jpcamara has joined #ruby
<dblack__>
shevy: heh :-)
<shevy>
lectrick I could but I could not really comment anything useful so I better don't comment
<shevy>
I am, I am not pro, or contra this... I very rarely use protected ...
<dblack__>
shevy: we're saying the same thing in slightly different terms
<shevy>
no wait... I actually never used protected, and private only sometimes when it makes the intent clearer
<shevy>
though if someone has a good use case for protected... I am all ears
mneorr has quit [Remote host closed the connection]
<Hanmac>
shevy you can use it in an <=> method
velCzupa has quit [Remote host closed the connection]
<Hanmac>
self.value <=> other.value #where value are protected methods
<shevy>
hmm
<dblack__>
Hanmac: except…. if you prepend a module to the singleton class, those prepended methods get called before the object's singleton methods
rupee has joined #ruby
jonahR has joined #ruby
Slivka has quit [Ping timeout: 260 seconds]
<shevy>
...
* dblack__
is already dreading having to revise certain diagrams in edition 2 of the well-grounded rubyist :-)
<LiquidInsect>
haha
asobrasil has quit [Remote host closed the connection]
aleph-null has joined #ruby
a_a_g has joined #ruby
krz has quit [Quit: krz]
mpfundstein has joined #ruby
<Hanmac>
dblack__ hm maybe but not for normal instance objects like Object.new
werdnativ has joined #ruby
statarb3 has joined #ruby
mneorr has joined #ruby
IrishGringo has quit [Ping timeout: 252 seconds]
rocket has joined #ruby
ckrailo has joined #ruby
_nitti has joined #ruby
Quebert has quit [Ping timeout: 248 seconds]
shevy has quit [Ping timeout: 240 seconds]
__Big0__ has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
<dblack__>
Hanmac: any object (just about) can have modules prepended to its singleton class
<dblack__>
Hanmac: i'm not saying a lot of them do (or will), but they can :-)
__Big0__ has joined #ruby
<dblack__>
Hanmac: that's why i tend to describe the lookup chain in terms of classes and modules rather than methods
<Hanmac>
huch you are right ... and PS: an extend is "similar" to an include into singleton class ... i wonder why there is no such command for prepend
bryanjswift has quit [Quit: Computer has gone to sleep.]
<apeiros_>
does prepend also invoke something on the module?
chussenot has quit [Quit: chussenot]
<apeiros_>
i.e. like extended/included/append_features
<sam113101>
an inspection method?
nicoulaj has joined #ruby
atyz has joined #ruby
<sam113101>
prepended I think
bonhoeffer has quit [Quit: bonhoeffer]
<Hanmac>
fuck i forgot to make my feature request again ... i wanted to change the callback methods extended/included when a exception is raised inside them
horofox_ has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
Chryson has quit [Ping timeout: 272 seconds]
eldariof has quit []
squidBits has joined #ruby
tish has left #ruby [#ruby]
My_Hearing has joined #ruby
atyz has quit [Ping timeout: 256 seconds]
angusiguess has quit [Ping timeout: 256 seconds]
Takehiro has quit [Ping timeout: 260 seconds]
himsin has joined #ruby
sayan has quit [Read error: Connection reset by peer]
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
jjbohn|afk is now known as jjbohn
Qwak has quit []
<lewix>
dblack__: have you played with rubymotion
mpfundstein has quit [Remote host closed the connection]
swex has quit [Remote host closed the connection]
shevy has joined #ruby
zmanfx has joined #ruby
havenwood has joined #ruby
sgmac has joined #ruby
<dblack__>
lewix: played and used it at work (currently working on a ruby motion app for a client)
sgmac is now known as Guest5483
jblack has quit [Ping timeout: 255 seconds]
<zmanfx>
so does Ruby 2.0 play nice with clang?
<zmanfx>
or should I still build with gcc?
angusiguess has joined #ruby
<lewix>
dblack__: ok I'm off to finish your book
<lewix>
have a good day everybody
duosrx_ has joined #ruby
<dblack__>
see you lewix
<zmanfx>
I guess I'll find out
philcrissman has quit [Remote host closed the connection]
duosrx has quit [Read error: Connection reset by peer]
wrench has joined #ruby
bonhoeffer has joined #ruby
<dblack__>
zmanfx: with rvm i had to do CC=clang to get it to compile
jeffreybaird has joined #ruby
alexim has joined #ruby
<Hanmac>
hm i dont trust clang ...
<zmanfx>
dblack__: i assume that's good news for OS X users
<Hanmac>
and rubymotion is not a solution for me
t-mart_ has quit [Remote host closed the connection]
<zmanfx>
since GCC doesn't ship with Xcode anymore
nomenkun has joined #ruby
kpshek has quit []
<wrench>
I'm playing with the dashing gem for building dashboards. I understand from the examples how to feed to a number widget but I can't figure out what to feed the 'List' type widget. I would guess an array -- but can't get that to work. The example looks like its feeding a hash in the job file. Anyone know how to feed data to the 'List' widget in dashing?
<Hanmac>
zmanfx can clang build c++ code too?
jeffreybaird has quit [Client Quit]
Guest5483 has left #ruby ["Leaving"]
<dblack__>
Hanmac: yes
marr has joined #ruby
<zmanfx>
Hanmac: I'm pretty sure it's not only able to build it, but it has great C++ support
yacks has quit [Remote host closed the connection]
slainer68 has joined #ruby
<zmanfx>
but yes it must, C++ is supported with Xcode, and if they only ship clang they would have to
n1x has joined #ruby
jblack_ has joined #ruby
<zmanfx>
many iOS devs use C and C++ just because Obj-C isn't good with CoreFoundation like frameworks
<zmanfx>
and by that i mean, they use it in conjuction
<zmanfx>
conjunction
marr123 has joined #ruby
joshman_ has quit [Ping timeout: 272 seconds]
thmz has quit [Ping timeout: 248 seconds]
Jebron has joined #ruby
__Big0__ has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
robert__ is now known as robert_
joshman_ has joined #ruby
marr has quit [Ping timeout: 252 seconds]
heliumsocket has joined #ruby
rupee has quit [Quit: Leaving]
duosrx_ has quit [Remote host closed the connection]
Retistic has joined #ruby
<Hanmac>
zmanfx because my gems are i most cases C++ gems for C++ libs ... thats why i need C++
pkrnj has joined #ruby
<shevy>
C++ is hardcore
<zmanfx>
i'd say it should be fine unless your gems that use C/C++ extensions
<zmanfx>
that require
<zmanfx>
gcc to compile
<Hanmac>
hm i dont think so ... (i check if GCC is used for compile before i use something like __attribute__ ((visibility ("hidden"))))
kpshek has joined #ruby
My_Hearing is now known as Mon_Ouie
sandGorgon has quit [Read error: Connection reset by peer]
sandGorgon has joined #ruby
mityaz has quit [Quit: See ya!]
ckrailo has quit [Ping timeout: 276 seconds]
marr has joined #ruby
irichlau2 has quit [Ping timeout: 256 seconds]
aleph-null has quit [Remote host closed the connection]
m8 has joined #ruby
sgmac26 has joined #ruby
Takehiro has joined #ruby
mikeg has joined #ruby
chrishough has quit [Quit: chrishough]
sayan has joined #ruby
<robert_>
so i18n isn't compiling
sgmac26 is now known as geek
geek is now known as geek_on_the_road
ph^ has joined #ruby
<shevy>
robert_ trying to use 2.0 ? :>
<robert_>
nope :p
<robert_>
1.9 on freebsd
<shevy>
oh I see
<robert_>
I'm trying to install nokogiri there.
<robert_>
buuut no such luck.
Takehiro has quit [Ping timeout: 245 seconds]
aleph-null has joined #ruby
<csmrfx>
robert_: install a network debian inside a vm
etcetera has quit []
<csmrfx>
then in a term apt-get install ruby1.9 libnokogiri-ruby1.9
<csmrfx>
done
chrishunt has quit [Quit: ZzZzZz...]
<csmrfx>
hm, I wonder if freebsd has vbox
mneorr has quit [Read error: Connection reset by peer]
ph^ has quit [Ping timeout: 272 seconds]
punchfacechampio has quit []
punchfacechamp has joined #ruby
<robert_>
csmrfx: it's freebsd, though. I can't use linux ELF files in freebsd. the emulation is sort of busted. :p
atyz has joined #ruby
Morkel_ has joined #ruby
Morkel has quit [Ping timeout: 264 seconds]
Morkel_ is now known as Morkel
freakazoid0223 has joined #ruby
<csmrfx>
seems there is a project to port vbox to freebsd
jrendell has joined #ruby
<csmrfx>
even claims it runs
sayan has quit [Read error: Connection reset by peer]
n1x has quit [Quit: Ex-Chat]
tish has joined #ruby
Dreamer3 has joined #ruby
sandGorgon has quit [Read error: Connection reset by peer]
monkegjinni has quit [Remote host closed the connection]
Virunga has quit [Remote host closed the connection]
_nitti has quit [Remote host closed the connection]
v0n has quit [Read error: Operation timed out]
ckrailo has quit [Quit: Computer has gone to sleep.]
sailias has quit [Ping timeout: 245 seconds]
poikon_work has quit [Ping timeout: 260 seconds]
kpshek has quit []
khismetix has joined #ruby
kpshek has joined #ruby
wmoxam has quit [Ping timeout: 246 seconds]
wakingideas has joined #ruby
_nitti has joined #ruby
arya_ has quit [Ping timeout: 252 seconds]
geek_on_the_road has quit [Remote host closed the connection]
tommyvyo has quit [Quit:]
<zastern>
This is stupid but
<zastern>
why is false && false # => false
<zastern>
Isn't it true that both things are false, or something?
danneu has quit [Ping timeout: 252 seconds]
lapinferoce has quit [Quit: Konversation terminated!]
malkomalko has quit [Read error: Connection reset by peer]
V8Energy has joined #ruby
<burgestrand>
zastern: no
tvw has quit []
<burgestrand>
zastern: :)
<Morrolan>
zastern - '&&' evaluates to true if both are true, not if both are equal.
arya has joined #ruby
malkomalko has joined #ruby
<burgestrand>
zastern: false == false # => true
TheFuzzball has joined #ruby
<burgestrand>
zastern: && is a different kind of operator
<zastern>
oh ok so its just setting a sort of combined truthiness
<zastern>
or falsiness
harumph has quit [Ping timeout: 252 seconds]
<zastern>
and one false spoils the bunch
<csmrfx>
evaluates to
<Morrolan>
For example: "If it is not good weather outside (false) and I do not have an umbrella (false) I will not go outside (false)"
<csmrfx>
true
<zastern>
Morrolan: but that last one sounds like true to me
<burgestrand>
zastern: think of it as the condition between two parents.
<zastern>
its TRUE that I will not go outside
<burgestrand>
zastern: if mom says no, it does not matter what dad says, and vice-versa
<zastern>
it's false that i will go outside
love_color_text has quit [Remote host closed the connection]
<burgestrand>
zastern: if both say no it’s definitely no!
<Morrolan>
Yes, I will not win any price with that example.
<burgestrand>
zastern: but if both says yes…
<Morrolan>
Especially since it's more of an OR, come to think of it.
<zastern>
mm
<zastern>
I get it though. Thanks guys.
<Morrolan>
\o/
<burgestrand>
\o/
<zastern>
Code academy is more "this is how this works" not "this is why this works"
<burgestrand>
\o\
<zastern>
so i was a little confused
codecop has quit [Remote host closed the connection]
<burgestrand>
zastern: it’s a part of discrete mathematics (logic math), which is probably why it’s taught in a similar way
<zastern>
I wish I had taken more math
<zastern>
I'm a weirdo
<zastern>
Love computers, hate math.
<zastern>
Not a good combonation.
<amacleod>
It's never too late to take more math :-)
<elliottcable>
learn fun math, instead.
<burgestrand>
zastern: it’s pretty much the only part of math needed for basic CS that isn’t commonly taught
<elliottcable>
lambda calculus is just fucking interesting.
<elliottcable>
no numbers involved.
arya has quit [Ping timeout: 256 seconds]
<amacleod>
elliottcable, not even Church numerals?
<csmrfx>
plenty of lectures on youtube and academic earth
<csmrfx>
CS, Math, Algebra, Number theory....
NemesisD has joined #ruby
<burgestrand>
zastern: it’s usually taught by showing you the operator (&&, conjunction, ^), and a table showing you what happens when you give it different things, and you pretty much learn it by heart to use it
<amacleod>
Is there a name for the operation that is opposite of XOR? That is, if Mom and Dad agree, do it, otherwise don't?
<NemesisD>
amacleod: AND?
<burgestrand>
:p
<zastern>
burgestrand: I'm more about understanding WHY it's true or false, and evaluating in my head. Not good at memorizing tables. Better at using knowledge to figure things out.
<NemesisD>
or am i missing something
<amacleod>
I mean even if they both say no.
<csmrfx>
lel
<zastern>
Even if that is slower.
<csmrfx>
! && !
jlast has quit [Remote host closed the connection]
<eval-in>
csmrfx: Output: "/tmp/execpad-4af21b969750/source-4af21b969750:1:in `<main>': undefined local variable or method `console' for main:Object (NameError)\n" (http://eval.in/11403)
arya has joined #ruby
<burgestrand>
zastern: yeah, me too, luckily the only other real table you need is for OR (written as || in ruby, disjunction in math), which is true if either side is true, and only false if both sides are false
<tommylommykins>
having read the answer to that question
<tommylommykins>
my question is
<tommylommykins>
why would a customer want to read your unit tests?
cyberflux has joined #ruby
angusiguess has joined #ruby
Virunga has joined #ruby
mattbl has quit [Quit: Leaving]
apok has quit [Quit: apok]
chrishunt has joined #ruby
mattbl has joined #ruby
Mon_Ouie has quit [Ping timeout: 248 seconds]
<apeiros_>
tommylommykins: I guess he wrote "customer" in quotes because a customer may very well be a coder
fixl has joined #ruby
<apeiros_>
i.e., you write a lib/gem, you publish it.
breakingthings has quit []
Kruppe has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
d34th4ck3r has quit [Read error: Operation timed out]
endzyme has joined #ruby
<banisterfiend>
tommylommykins: i think it's also just personal preference, some ppl prefer the spec style. You can also use nested 'describe' blocks in the spec style to more nicely group things, i haven't figured out an equivalent to that with methods/classes
pdamer has quit [Quit: pdamer]
poga_ has quit [Remote host closed the connection]
poga has joined #ruby
sailias has quit [Quit: Leaving.]
love_color_text has quit [Remote host closed the connection]
<banisterfiend>
i also dont agree that: def test_foo; assert(bar, foo); end is significantly more terse than: it 'foo' do; bar.should == foo; end
byped has quit [Quit: byped]
wmoxam has joined #ruby
EPIK has joined #ruby
love_color_text has joined #ruby
<tommylommykins>
apeiros_: I interpreted the answer as meaning that coders should be able to read unit::testcase style, but noncoders would find minitest::spec style easier :s
<banisterfiend>
tommylommykins: that argument is more applicable to cucumber vs *, rather than spec vs test/unit
niklasb has joined #ruby
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
axl_ has quit [Quit: axl_]
nicoulaj has quit [Remote host closed the connection]
Lemtzas has quit [Ping timeout: 260 seconds]
<apeiros_>
tommylommykins: if that was indeed the meaning, then I have the same question as you
<apeiros_>
I don't think it's realistic that any non-coder reads unit tests
<apeiros_>
cucumber features maybe
<apeiros_>
but even that is probably rare
soulcake has joined #ruby
soulcake has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
hybris has joined #ruby
Quebert has quit [Ping timeout: 255 seconds]
danblack has joined #ruby
soulcake has joined #ruby
arya has quit [Read error: Connection reset by peer]
dustint has quit [Read error: Operation timed out]
arya has joined #ruby
zastern has quit [Remote host closed the connection]
solidoodlesuppor has quit [Remote host closed the connection]
bonhoeffer has quit [Quit: bonhoeffer]
thmz has joined #ruby
snugglepus has quit [Ping timeout: 272 seconds]
bradhe has quit [Ping timeout: 252 seconds]
takeru has joined #ruby
verysoftoiletppr has quit []
angusiguess has quit [Ping timeout: 260 seconds]
Pandaen_ has joined #ruby
etcetera has joined #ruby
Pandaen_ has quit [Remote host closed the connection]
j^2 has quit [Ping timeout: 248 seconds]
niklasb has quit [Ping timeout: 260 seconds]
ph^ has joined #ruby
iamjarvo has quit [Quit: Leaving.]
angusiguess has joined #ruby
takeru has quit [Ping timeout: 248 seconds]
love_color_text has quit [Remote host closed the connection]
postmodern has joined #ruby
love_color_text has joined #ruby
jjbohn has quit [Quit: Leaving...]
fir_ed has joined #ruby
<apeiros_>
hm, he actually writes "to a non-programmer" - I wouldn't ever show specs to a non-programmer. that's pretty pointless IMO (even if you make it as readable as possible)
huoxito has joined #ruby
thinkclay has quit [Quit: Leaving.]
Nisstyre-laptop has joined #ruby
d2dchat has quit [Remote host closed the connection]
jrendell has quit [Quit: jrendell]
thinkclay has joined #ruby
Voting has quit [Ping timeout: 248 seconds]
ph^ has quit [Ping timeout: 272 seconds]
arya has quit [Ping timeout: 244 seconds]
spider-mario has quit [Remote host closed the connection]
chico_chicote has joined #ruby
mneorr has joined #ruby
snugglepus has joined #ruby
geggam_wk has quit [Remote host closed the connection]
lledet has quit [Quit: lledet]
etcetera has quit []
Es0teric has quit [Quit: Nigga, im OUTIE 5000]
arya has joined #ruby
niklasb has joined #ruby
rburton- has joined #ruby
angusiguess has quit [Ping timeout: 260 seconds]
daniel_- has quit [Ping timeout: 272 seconds]
monkegjinni has quit [Ping timeout: 272 seconds]
rdark has quit [Ping timeout: 272 seconds]
spider-mario has joined #ruby
mikepack has quit [Remote host closed the connection]
Fitzsimmons has joined #ruby
Fitzsimmons has quit [Changing host]
Fitzsimmons has joined #ruby
etcetera has joined #ruby
adamjleonard has joined #ruby
jrendell has joined #ruby
bradhe has joined #ruby
Virunga has quit [Remote host closed the connection]
<snugglepus>
Does ruby have something similar to python's sys.setrecursionlimit? A setting that avoids the stack level too deep error.
zoonfafer has joined #ruby
apok has joined #ruby
<apeiros_>
out of curiosity - what does python do when that limit is hit?
reset has joined #ruby
<pnbeast>
I think I just accidentally discovered that hash elements may be addressed via array indices, e,g. x={}; #fill x somehow; x.each {|i| puts "#{i[0]} -> #{i[1]}"}. Is it safe & sane to rely on that? I can't find reference to it in the Pickaxe book, though I'm not really sure how to look.
neurotech has joined #ruby
<apeiros_>
pnbeast: .each yields key & value
<apeiros_>
you only supplied one argument, so you get [key, value]
luckyruby has joined #ruby
<apeiros_>
i.e., an array. which - of course - you can access via index
<pnbeast>
apeiros_: Yep, that's how I consider it, but those two items are in a two element array?
<apeiros_>
yes
<pnbeast>
Okay, thank you.
xardas has quit [Read error: Connection reset by peer]