apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
Indian has joined #ruby
<Shamgar> I wonder if I'm just going to have to go deeper and build my own packets.
<Shamgar> be kinda ugly...but that can't be right
<Shamgar> because I was able to make it work in php.
<Shamgar> hmmm
frishi has joined #ruby
<Spaceghostc2c> Shamgar: You're making me giggle in the worst ways.
krzkrzkrz has joined #ruby
<shadoi> Shamgar: send expects a string, not an array
Chryson has joined #ruby
<davidcelis> Or a symbol
<shadoi> or a symbol
<davidcelis> er
<davidcelis> does it?
<davidcelis> i was thinking of the wrong send
<shadoi> yeah, Socket#send needs a string
* davidcelis should read the gist before commenting
GuidovanPossum has joined #ruby
freeayu has joined #ruby
cjs226 has joined #ruby
d2dchat has joined #ruby
GuidovanPossum has joined #ruby
bawer has joined #ruby
<Shamgar> Spaceghostc2c: well at least I'm entertaining. ;-)
strife25 has joined #ruby
<Shamgar> Hmmm. 'msg' is a string
ken_barber has joined #ruby
<shadoi> you also shouldn't need a sendptr, nor need to track message length
<Shamgar> if I add a puts statement in there with msg.class it returns string
toddmorrill has joined #ruby
<Shamgar> making it harder than it has to be again i see.
jitesh_shetty has joined #ruby
SolarisBoy has quit [#ruby]
<Shamgar> the string itself can contain \r\n - even though it's not the end, that's why I thought I couldn't use the write_message method
<shadoi> also, where do you create @socket? It probably isn't a Socket class when you call send (which is probably calling Object#send)
jfelchner has joined #ruby
<Shamgar> it's not. It's an InternetMessageIO object
<shadoi> there's your problem
<shadoi> It _must_ be a Socket, or it will use Object#send
dv310p3r has joined #ruby
<Shamgar> AH....okay...I see it now
<Shamgar> That is not inheriting Socket, which is why I have to pass a valid socket as an argument.
<Shamgar> So it's expecting me to use *its* functions (like write_message) which in turn call the Socket functions
<shadoi> yeah
seanstickle has joined #ruby
<Shamgar> Hmmm. I don't remember why I started using InternetMessageIO in the first place...maybe I can strip all that out.
cbuxton has joined #ruby
marcus has joined #ruby
Sgeo_ has joined #ruby
<Shamgar> shadoi: Thank you for your help.
chovy has joined #ruby
<chovy> hi all
<chovy> i'm not sure what i'm doing wrong here....only the line with contatenation prints
<chovy> it's driving me crazy. like i'm looking at the wrong file.
kvirani has joined #ruby
<shadoi> p prints obj.inspect
PragCypher has joined #ruby
<shadoi> use puts or print
randym_ has joined #ruby
cbuxton has joined #ruby
shevy has joined #ruby
nobitanobi1 has joined #ruby
nobitanobi has joined #ruby
chson has joined #ruby
neohunter has joined #ruby
<chovy> how do i do something like this:
<chovy> if foo.bar.email?
<chovy> // do something with .email
<chovy> end
<chovy> i get an error that undefined method `email' for nil:NilClass
jankly has joined #ruby
netrealm has joined #ruby
davidcelis has joined #ruby
<chovy> i figure out why my script sucked.
iori has joined #ruby
macmartine has joined #ruby
GuidovanPossum has joined #ruby
savage- has joined #ruby
krzkrzkrz has joined #ruby
<macmartine> I have this object that isn't a hash, however I can access it's properties like a hash ( obj["id"] ). Is there a way I can do a hash merge on this with an actual hash? https://gist.github.com/2372471
<banisterfiend> macmartine: its*
<macmartine> banisterfiend: ?
<macmartine> oh, whatevs
jankly has joined #ruby
icy` has joined #ruby
icy` has joined #ruby
<samuelkadolph> macmartine: My guess would be it has a hash available in a method like data or something.
startlin1 has joined #ruby
startling has quit [#ruby]
GuidovanPossum has joined #ruby
<banisterfiend> what's hte best way to check for ruby 1.8 MRI
iamjarvo has joined #ruby
jitesh_shetty has joined #ruby
GuidovanPossum has joined #ruby
lobak has joined #ruby
blinton has joined #ruby
kevinbond has joined #ruby
<td123> banisterfiend: maybe dive into RbConfig::CONFIG
<td123> unless you want to know when you're running MRI vs non-, then I dunno
brandoncordell has joined #ruby
<neohunter> this dont work:
<neohunter> s.user.to_hash.select{ |k,v| [:screen_name, :name].include?(k) }
jankly_ has joined #ruby
sako has joined #ruby
<neohunter> but this works:
<neohunter> s.user.to_hash.select{ |k,v| ['screen_name', 'name'].include?(k) }
<banisterfiend> neohunter: becuase the keys are strings not symbols? :)
<neohunter> yeah i know, my question is to_hash always returns keys as strings?
<banisterfiend> neohunter: that's a rails not a ruby question
<banisterfiend> neohunter: #rubyonrails :)
<neohunter> sorry, im a new to ruby/rails and dont understand what is rails related yet
igotnolegs has joined #ruby
blinton has quit [#ruby]
blischalk has joined #ruby
Ontolog has joined #ruby
liluo has joined #ruby
jcromartie has joined #ruby
krzkrzkrz has joined #ruby
fivetwentysix has joined #ruby
fivetwentysix_ has joined #ruby
<axl_> what is the most elegant way in ruby to limit the length of a string to a number of characters?
<axl_> something like my_string.limit!(4)
groovehunter has joined #ruby
looopy has joined #ruby
<td123> string[0,4]
<td123> maybe?
liluo has joined #ruby
<td123> though mine isn't modifying
<axl_> i hoped that was't the most elegant way
<axl_> but thats fine , thank you
shadoi has joined #ruby
quest88 has joined #ruby
<banisterfiend> axl_: you can use slice
<axl_> yeah, looking into it
GuidovanPossum has joined #ruby
<axl_> apparently i wan't the exact opposite of slice, as much as i understand
<axl_> t
<axl_> hanky ou though
apok_ has joined #ruby
dwon has joined #ruby
<axl_> banisterfiend: td123: I ended up extending String https://gist.github.com/2372752
<axl_> thanks for your inputs
<Spaceghostc2c> axl_: WHERE IS _BRO?
<banisterfiend> axl_: probalby dont do that on a library you wish to share with other ppl though :P
<td123> axl_: meh, good enough I guess
<axl_> yeah, i won't. i like it though
<td123> axl_: sucks that you need to monkey patch it to get that functionality :/
<axl_> yeah not that i hate using the [] operator
<axl_> b
<axl_> u
<axl_> but i just like looking at this when i read my code
<axl_> it feels more ruby
<samuelkadolph> That's a rather odd method
frankaa112 has joined #ruby
nari has joined #ruby
RORgasm has joined #ruby
<samuelkadolph> Since you can just do str.slice!(4..-1)
fattastic has joined #ruby
banisterfiend has joined #ruby
<axl_> samuelkadolph: now i can just do this in my ruby code: https://gist.github.com/d258a8740c2f0119b0cf
prometheus has joined #ruby
<axl_> it looks more pretty/readable to me
carlyle has joined #ruby
<samuelkadolph> slice! looks better
stephenjudkins has joined #ruby
<axl_> this looks better to you ? : str.slice!(4..-1)
Hasufin has joined #ruby
<banisterfiend> axl_: i agree with sammy-K. And anyway the slice! syntax isn't so bad that a monkeypatch is required, IMO the threshold for a monkeypatch should be a lot higher than that
maletor has joined #ruby
mrtheshadow has joined #ruby
<Hasufin> Hi, I'm new to ruby - using ri_cal gem, having timezone issues. The website: http://ri-cal.rubyforge.org/rdoc/ has a section about default TZID.... PropertyValue::DateTime has a default_tzid..... how would you go about changing this?
<Hasufin> PropertyValue::DateTime.default_tzid("CDT") doesn't seem to work
mikeycgto has joined #ruby
mikeycgto has joined #ruby
ZachBeta has joined #ruby
workmad3 has joined #ruby
shtirlic_ has joined #ruby
niku4i has joined #ruby
dfamorato has joined #ruby
iamjarvo has joined #ruby
wefawa has joined #ruby
CheeToS has joined #ruby
lobak_ has joined #ruby
seivan has joined #ruby
wefawa has joined #ruby
MissionCritical has joined #ruby
chelbs has joined #ruby
dhruvasagar has joined #ruby
ed_hz_ has joined #ruby
senthil has joined #ruby
lorandi has joined #ruby
GuidovanPossum has joined #ruby
maskact has joined #ruby
kenperkins has joined #ruby
scwh has joined #ruby
blinton has joined #ruby
seanstickle has joined #ruby
mikepack has joined #ruby
andrewhl has joined #ruby
krusty_ar has joined #ruby
advorak has joined #ruby
uris has joined #ruby
jfelchner has joined #ruby
fbernier has joined #ruby
keymone has joined #ruby
albemuth has joined #ruby
<advorak> how can I do lines.scan(/LINE.*F\/A\n.*?--/m) ?? When I try to do non-greedy .*? and specify multi line, it seems to goto the absolute last occurrence of '--' (greedy) instead of the first occurrence ..
<advorak> actually I am thinking I might be doing this wrong
<senthil> what happens when you do "1.instance_eval { binding }"
<senthil> I get "=> #<Binding:0x007ffdc11435b8>", not sure what's happening under the covers
<banisterfiend> senthil: use instance_eval "binding" instead
<banisterfiend> otherwise u get weird bindings
krzkrzkrz has joined #ruby
jesly has joined #ruby
<jesly> hey can anybody tell me how to have dynamic routes in sinatra
<senthil> banisterfiend: wouldn't that would just return the string "binding"?
<senthil> banisterfiend: oh without the blks, gotcha
<jesly> ie, if i give localhost/some_rand_i_p it will echo the route name?
<senthil> but what does instance_eval "binding""
jankly_ has joined #ruby
<senthil> err, what does 'instance_eval "binding" ' do then?
<banisterfiend> senthil: well the issue with instance_eval is that constants are looked up lexically rather than in the receiver's context
<banisterfiend> if you use string instance_eval instead then you dont have that issue
<banisterfiend> since it's only blocks that behave that way
<advorak> of course I answered my own question, my regex was off ;-)
<advorak> (which usually happens when you expect something that the computer doesn't return)
dfamorato_ has joined #ruby
<any-key> computers are jerks, don't expect anything from them
<senthil> banisterfiend: what happens when you pass "binding" to 1.instance_eval? i'm guessing you get a binding where "self = 1" ?
fbernier has joined #ruby
otters has joined #ruby
chomp has joined #ruby
seoaqua has joined #ruby
nikhgupta has joined #ruby
inemion_ has joined #ruby
GuidovanPossum has joined #ruby
<jesly> how to do this? if i give an undefined route to sinatra, just make it print the route
<jesly> sat i give localhost:4567/hey
<jesly> where there is no get 'hey' in the rb file
<jesly> then it should print hey in browser
inemion_ has joined #ruby
ryan_dev70 has joined #ruby
joaoh82 has joined #ruby
<chomp> jesly, you can just add a rule like not_found do request.path end
RORgasm has joined #ruby
albemuth has joined #ruby
ben225 has joined #ruby
tommyvyo has joined #ruby
tewecske has joined #ruby
keymone has joined #ruby
s3rhart has joined #ruby
thundercookies has joined #ruby
mxweas_ has joined #ruby
TheIronWolf has joined #ruby
brandoncordell has joined #ruby
tewecske has joined #ruby
<banisterfiend> senthil: Yeah
zakwilson has joined #ruby
<banisterfiend> senthil: that's how pry's "cd" works :)
<banisterfiend> senthil: type show-method Pry#binding_for
andantino has joined #ruby
<senthil> banisterfiend: that's where I found it :p
<banisterfiend> senthil: and, show-method __binding__
indeterminate has joined #ruby
tewecske has joined #ruby
Pureh has joined #ruby
<Pureh> could someone help me with a really simple question
<Pureh> I am trying to patern match " 0% loss "
<Pureh> if output =~ /0% loss/
<Pureh> why does that not work
<Pureh> ?
<Pureh> anyone?
niku4i has joined #ruby
rippa has joined #ruby
blueadept has joined #ruby
<TTilus> well, it does work for me
<TTilus> ah, gone already
codezombie has joined #ruby
blueadept` has joined #ruby
adeponte has joined #ruby
winux has joined #ruby
tewecske has joined #ruby
iamjarvo has joined #ruby
td123 has joined #ruby
sirecote has joined #ruby
ghanima has joined #ruby
adamkitt_ has joined #ruby
ceej has joined #ruby
<winux> im trying to install ruby on ubuntu and i did a sudo apt-get install ruby1.9.1
<winux> but ruby -v shows a command not found
<winux> can someone tell me how i could resolve my issue?
<winux> since ruby should work after those steps :S
<seanstickle> winux: ruby1.9 -v
icyfenix has joined #ruby
<winux> seanstickle: command not found
rramsden has joined #ruby
<seanstickle> winux: find /usr/bin | grep ruby
__class__ has joined #ruby
<winux> seanstickle: /usr/bin/ruby1.9.1
<winux> guess its not pathed out
<seanstickle> There you go
<winux> seanstickle: dang i thought it would setup the bash paths for me :/
zemanel has joined #ruby
<chomp> wouldn't that imply that /usr/bin is not in your $PATH?
<banisterfiend> senthil: hey tickle
<banisterfiend> seanstickle*
<seanstickle> banisterfiend: hallo!
<seanstickle> winux: it is "pathed out"
<seanstickle> winux: you were just running the wrong command
<seanstickle> ruby1.9.1 -v
<banisterfiend> seanstickle: what's up in amerrka
<seanstickle> And it'll work fine
wefawa has quit [#ruby]
<seanstickle> banisterfiend: RESTful SOA
<seanstickle> banisterfiend: how about you?
<winux> chomp: yes and seanstickle: right
<rippa> restful sofa?
<rippa> sounds comfy
<banisterfiend> seanstickle: messing with objc async libs
<seanstickle> woo
<winux> surprised that irb doesnt come with ruby too
<seanstickle> Debian Ruby is crap
<td123> seanstickle: which part?
mxweas_ has joined #ruby
<seanstickle> All of it.
<seanstickle> :P
Hasufin has quit [#ruby]
<td123> fair enough :P
<seanstickle> gems via apt is bad news man
<td123> that's my impression is also :P
chown_ has joined #ruby
chown_ has quit [#ruby]
otters has joined #ruby
falican has joined #ruby
tewecske has joined #ruby
greenarrow has joined #ruby
keymone has joined #ruby
shruggar has joined #ruby
fbernier has joined #ruby
noyb has joined #ruby
otters has joined #ruby
ryanf_ has joined #ruby
seivan has joined #ruby
apeiros_ has joined #ruby
yxhuvud has joined #ruby
michaelmartinez has joined #ruby
rramsden has joined #ruby
tewecske has joined #ruby
maasha has joined #ruby
<maasha> I am looking for a way to create a new instance of Ruby object Foo from C?
<maasha> (Inline C - or a C extension)
kirti has joined #ruby
jankly has joined #ruby
<michaelmartinez> failed homebrew update... any takers for support (i realize this is a ruby channel, but I have no shame)
nilg has joined #ruby
<nilg> what does ||= mean in ruby? I ask here because Google isn't able to understand it, thx
alanp has joined #ruby
<ryanf> nilg: x ||= y is x = x || y (basically)
greenarrow has joined #ruby
PragCypher has joined #ruby
<apeiros_> yeah, generally, x <op>= y expands to x = x <op> y, like x += y --> x = x+y
<apeiros_> ||= and &&= are special cases, which expand to x || (x = y), though
RORgasm has joined #ruby
<apeiros_> (which works largely the same as the normal expansion, but not exactly)
<nilg> rather elegant, thanks!
tewecske has joined #ruby
quest88 has joined #ruby
loquax has joined #ruby
polysics has joined #ruby
<loquax> Please what is the latest version of Ruby On Rails 1.8.7-p358 or 1.9.3-p125 ???
<apeiros_> loquax: neither
<apeiros_> those are *ruby* versions
<apeiros_> ruby on rails is a framework, written in ruby. and the latest version of rails is 3.2.3
<loquax> ah... :)
<loquax> and the last version of ruby? 1.8.7-p358 or 1.9.3-p125 ? =)
<apeiros_> the higher number, obviously
GoBin has joined #ruby
<loquax> apeiros_: thanks... and last question lol... =) Ruby Installer for Windows come with Ruby on Rails?
<apeiros_> no idea, I stay away from turds like windows.
Pureh has joined #ruby
<Pureh> anyone around for a quick question?
<Pureh> if output =~ /nm.chomp/
<Pureh> I want to match for the value of the variable and not "nm.chomp" as a string
<Pureh> how can I do that?
<loquax> apeiros_: thank you ;)
<winux> a tad confused, why does installing irb install ruby 1.8?
<apeiros_> Pureh: string[/#{nm.chomp}/]
<winux> i already have 1.9.3 installed
amerine_ has joined #ruby
<Pureh> apeiros_ so is it output =~ string[/#{nm.chomp}/] ?
Morkel has joined #ruby
<apeiros_> Pureh: no, either `output =~ /#{nm.chomp}/`, or just `string[/#{nm.chomp}/]`
kirti has joined #ruby
<apeiros_> depending on what you want, you also need Regexp.escape
* apeiros_ gotta run
geekfactor has joined #ruby
chelbs has joined #ruby
engineerkp has joined #ruby
maveoanir has joined #ruby
ph^ has joined #ruby
ryanf_ has joined #ruby
<winux> why does installing irb install ruby 1.8? i just want it to run with 1.9.3 which i have installed.. when i install rubygems it gets hooked onto the 1.8 install as well :/
<GoBin> loquax: as far as i can see in the 7z archive, 1.9.3 comes only with rake 0.9.2.2 and rdoc 3.9.4 with windows install exe
<RubyPanther> winux: irb comes with your ruby, maybe you were trying to install a system package
Sigma00 has joined #ruby
<GoBin> winux, irb is no gem, it is a system package, and depends on ruby1.8
djdb has joined #ruby
KL-7 has joined #ruby
snip_it has joined #ruby
<winux> GoBin: why not 1.9.3?
CheeToS has joined #ruby
<winux> RubyPanther: hmm well i installed 1.9.3 then installed irb with apt-get
<RubyPanther> winux: so uninstall the one from apt-get
pjn_oz has joined #ruby
Dirkpitt has joined #ruby
x0F__ has joined #ruby
apok has joined #ruby
<winux> RubyPanther: when i greb for irb with only 1.9.1 nothing comes uo (/usr/bin)
<winux> grep
<RubyPanther> grep isn't for finding commands it is for searching for strings
<winux> RubyPanther: sorry
<winux> RubyPanther: searching through my find results
<winux> find | grep
<winux> RubyPanther: rubygems as a system package also wants to bring in 1.8
<RubyPanther> winux: you don't install that system package either!
<RubyPanther> rubygems is a part of 1.9.x, you don't install it at all anymore
<winux> RubyPanther: aha
<RubyPanther> you don't install _any_ system package with "ruby" in the name, only ones like zlib-devel openssl-devel
shruggar has joined #ruby
<winux> RubyPanther: okey i wont, now i just to find where they are
<GoBin> winux: i use rvm for dev, there is irb integrated for each ruby version
schovi has joined #ruby
ePirat|off has joined #ruby
apeiros_ has joined #ruby
<winux> GoBin: yeah i saw rvm but im gonna stick to using apt-get
<winux> for a single version
<RubyPanther> you're going to be out of date, sometimes so out of date you can't use current gems
jankly has joined #ruby
<winux> RubyPanther: yeah ill upgrade as/if needed
<winux> unless i get rvm to play for multiuser installs
<apeiros_> RubyPanther: don't forget the part about the crippled rubygems
vectorshelve has joined #ruby
<RubyPanther> I heard some guy used a system package and saw his rubygems eaten by Dwemthy's Array, but he was never heard from again so we'll never know the truth
<apeiros_> apt-get grue? :)
Advocation has joined #ruby
<vectorshelve> how can I do this -> http://pastie.org/3778774
Mohan has joined #ruby
<vectorshelve> from the iteration I need to generate methods
Mohan has joined #ruby
<apeiros_> vectorshelve: see class_eval and define_method
<apeiros_> (you only need either, not both)
zemanel has joined #ruby
PragCypher has joined #ruby
vectorshelve_ has joined #ruby
<BryanWB> how can I set variables that are global w/in a MiniTest::Unit::TestCase ? i.e. class variables that i can reuse across tests but not modify in them
<TTilus> BryanWB: what exactly are you trying to do?
r126l has joined #ruby
<BryanWB> TTilus: i have a path = "/usr/local/foo" variable that i would like to avoid typing into each test in my test case
<TTilus> BryanWB: to have tests share state smells
<BryanWB> btw this ruby 1.8
<BryanWB> not state, this is a constant
<TTilus> BryanWB: so you define a constant .. not?
<BryanWB> i guess i could, TTilus honestly didn't occur to me, still new to ruby
ewag has joined #ruby
rodasc has joined #ruby
seivan_ has joined #ruby
<TTilus> BryanWB: class FooTest < MiniTest::Unit::TestCase; PATH = "/usr/local/foo"; ...; end
bawer has joined #ruby
<BryanWB> that would be super long, guess i could do MiniTest::Unit::TestCase::MyTest::FOO = '/some/path' ; alias Mini..., short_var
iamjarvo1 has joined #ruby
iocor has joined #ruby
<vectorshelve_> Hello
<Boohbah> hi
seivan has joined #ruby
fukushim_ has joined #ruby
sirecote has joined #ruby
dhruvasagar has joined #ruby
<TTilus> EHLO localhost
seivan_ has joined #ruby
workmad3 has joined #ruby
seivan has joined #ruby
sam113101 has joined #ruby
Advocation has joined #ruby
sam113101 has joined #ruby
Gonzih has joined #ruby
sam113101 has joined #ruby
tijmencc has joined #ruby
ken_barber has joined #ruby
quest88 has joined #ruby
maasha has joined #ruby
<maasha> I want to access a Ruby hash element from Inline C. How?
<apeiros_> look at hash.c
<apeiros_> I usually go backwards from looking at the rb_define_method (they're normally at the bottom)
Eldariof-ru has joined #ruby
cezar has joined #ruby
<maasha> strangely it does not appear in README.ext ?
<apeiros_> why would they put the whole core API into README.EXT?
<apeiros_> but granted, the C part of things could be better doc'ed
<maasha> apeiros_: well, the most basic stuff should be there. push and pop of arrays. adding and accessing hashes.
akemrir has joined #ruby
pjn_oz has joined #ruby
KL-7 has joined #ruby
mdw has joined #ruby
<maasha> anyway. I am probably barking up several wrong trees here. Basically I need a C array of triples - what should be growable - so I can add to it from C, but access it from Ruby.
zemanel_ has joined #ruby
<maasha> I think I should try a more simple approach first. But then I need - in C - to create a new instance of a object Score and push on an array. The push part I know how to, but creating a new instance of Score?
Zolrath has joined #ruby
<maasha> class Score I have defined in ruby.
* maasha have been trolling docs all morning.
Mohan has joined #ruby
IPGlider has joined #ruby
trivol has joined #ruby
mtkd has joined #ruby
zakwilson has joined #ruby
mtkd has joined #ruby
mistergibson has joined #ruby
MrBar has joined #ruby
<mistergibson> Regarding Process::getrlimit("AS"): I get about 15 exabytes as the max virtual addressing space. However, I'm rather certain the OS gives me a true maximum of 2GB or 3.12GB (pae/64-bit depending) in reality. What's up with the obscenely large number that appears a delusional figure?
djdb has joined #ruby
Advocation has joined #ruby
ryanf_ has joined #ruby
tatsuya_o has joined #ruby
nikhil__ has joined #ruby
vectorshelve has joined #ruby
surfprimal has joined #ruby
LMolr has joined #ruby
arturaz has joined #ruby
seivan has joined #ruby
Advocation has joined #ruby
JohnBat26 has joined #ruby
wilmoore has joined #ruby
<shadoi> mistergibson: because that's the maximum addressable memory limit for linux
<mistergibson> shadoi: science museum flick?
netogallo has joined #ruby
RORgasm has joined #ruby
<shadoi> that's ~1 exabyte BTW
<mistergibson> shadoi: oops
<mistergibson> shadoi: thanks, the mystery unravels
lobolars has joined #ruby
LMolr_ has joined #ruby
peterhil` has joined #ruby
sohocoke has joined #ruby
BiHi has joined #ruby
iamjarvo has joined #ruby
ctp has joined #ruby
adac has joined #ruby
robbyoconnor has joined #ruby
etehtsea has joined #ruby
timonv has joined #ruby
Ammar01 has joined #ruby
iamjarvo has joined #ruby
trivol has joined #ruby
d3c has joined #ruby
sohocoke has joined #ruby
robotmay has joined #ruby
shruggar has joined #ruby
iamjarvo has joined #ruby
shruggar has joined #ruby
<bounce> yay for blog posts by people who googled together half a clue
<bounce> consider: "The man page for brk(2) warns that malloc(3) should be used instead of brk(2) or sbrk(2)."
<bounce> yes, true. why? because malloc uses brk/sbrk to allocate space to play with.
<bounce> or at least, it used to. now-a-days it'll call mmap instead, though it might fall back.
ukwiz has joined #ruby
roolo has joined #ruby
<bounce> now you know why RLIMIT_DATA is 'completely ignored'. it isn't really, it just doesn't kick in before RLIMIT_AS is exhausted through calls to mmap.
seivan has joined #ruby
<bounce> force malloc to not use mmap and you're back to brk.
moshee has joined #ruby
moshee has joined #ruby
tatsuya_o has joined #ruby
sohocoke has joined #ruby
stefanp has joined #ruby
stefanp has joined #ruby
Gonzih has joined #ruby
glosoli has joined #ruby
francisfish has joined #ruby
bawer has joined #ruby
pibako has joined #ruby
pibako has quit [#ruby]
eka has joined #ruby
workmad3 has joined #ruby
schovi has joined #ruby
keymone has joined #ruby
berserkr has joined #ruby
Sapientza has joined #ruby
kuzushi has joined #ruby
DuoSRX has joined #ruby
Mohan has joined #ruby
Mohan has joined #ruby
bier has joined #ruby
d34th4ck3r has joined #ruby
winux has joined #ruby
falena has joined #ruby
mikos has joined #ruby
ken_barber has joined #ruby
senthil has joined #ruby
seivan has joined #ruby
gtuckerkellogg has joined #ruby
ken_barber1 has joined #ruby
ken_barber1 has joined #ruby
richardlxc has joined #ruby
sohocoke has joined #ruby
mborromeo has joined #ruby
ken_barber has joined #ruby
ken_barber has joined #ruby
pcboy__ has joined #ruby
twinturbo has joined #ruby
seivan_ has joined #ruby
bob-O has joined #ruby
<bob-O> if i have x =~ /y.chomp/
<bob-O> how can I interpolate that vs taking literal string y.chomp ?
FreeDoug has joined #ruby
<lupine_85> bob-O, /#{y.chomp}/ vs. /#{Regexp::escape(y.chomp)}/ ?
<bob-O> so /#{y.chomp}/ will interpolate ?
<lupine_85> yes. if y is "foo.", then it will generate the regexp /foo./
<lupine_85> (the Regexp::escape form will generate the regexp /foo\./ )
<sgronblom> Am I the only one who thinks optparse's api is kinda crappy
<bob-O> lupine_85: ok thats what I was thinking. just wanted to verify. thanks
<lupine_85> not just you ;)
<lupine_85> we use trollop a lot at work
<Mon_Ouie> sgronblom: Check Slop, maybe you'll like that API better
ed_hz_ has joined #ruby
<sgronblom> Mon_Ouie: but not in stdlib?
<Mon_Ouie> Nope
<sgronblom> I still prefer to wrestle with crap than introduce more dependencies
<Mon_Ouie> Why? There's nothing wrong with using third party code to make your life easier
nemesit has joined #ruby
<lupine_85> trollop was written to be vendored in, as it happens
<lupine_85> although that's not always smart
xcvd has joined #ruby
dhruvasagar has joined #ruby
artm has joined #ruby
schovi has joined #ruby
<artm> what does => in 'rescue Exception => e' represents? does 'rescue' expect a hash? or is this a special syntax?
<Mon_Ouie> Special syntax to store the exception object in a local variable
xkx has joined #ruby
<artm> so there can only be one => there?
<matti> Mon_Ouie: :)
moshee has joined #ruby
<Mon_Ouie> 'alut matti ;)
moshee has joined #ruby
<Mon_Ouie> artm: Right
<artm> but there can be several exception classes before => ?
<Mon_Ouie> Well, you can use any expression before the "=>", so you could have do rescue {:some=>:hash} => e
<Mon_Ouie> And yes, you can have a list of classes separated with commas
<Mon_Ouie> rescue DangerousError, NonDangerousError => e
cha1tanya has joined #ruby
<artm> i see. thanks
mcwise has joined #ruby
PragCypher has joined #ruby
RORgasm has joined #ruby
DMKE has joined #ruby
vidaica has joined #ruby
tk___ has joined #ruby
arturaz has joined #ruby
Neil____ has joined #ruby
knopkodav has joined #ruby
DuoSRX has joined #ruby
SirFunk has joined #ruby
<xkx> i am using OpenSSL::Digest::SHA1 - how can I set digest_length?
<xkx> i want generated digests to be 256 bytes long, not 20
C0deMaver1ck has joined #ruby
<canton7> xkx, sha1 digests are always 160 bits
tvw has joined #ruby
v0n has joined #ruby
arturaz has joined #ruby
iamjarvo has joined #ruby
<canton7> sha-256 has an output of 256 bits, if that's what your after...
<xkx> canton7: ok, thx
latrommi has joined #ruby
jankly has joined #ruby
nilg has joined #ruby
bluenemo has joined #ruby
Dirkpitt has joined #ruby
punkrawkR has joined #ruby
ablemike has joined #ruby
<ablemike> anyone familiar with NetSSH gem?
knopkodav has joined #ruby
arturaz has joined #ruby
nari has joined #ruby
matti has joined #ruby
matti has joined #ruby
n1x has joined #ruby
Sigma00 has joined #ruby
Floydzy has joined #ruby
ctp has joined #ruby
Dirkpitt has joined #ruby
geekfactor has joined #ruby
mxweas_ has joined #ruby
dostoyidiot has joined #ruby
madmax_ has joined #ruby
bluenemo has joined #ruby
nilg` has joined #ruby
Asebolka has joined #ruby
<dagobah> Anyone know anything about pry?
<banisterfiend> dagobah: Yeah.
<TTilus> dagobah: why dont you just ask what you have in mind and we'll see it then
<banisterfiend> dagobah: what do u wanna know
eam has joined #ruby
Kireji has joined #ruby
<dagobah> banisterfiend: I want to know where in the code a pry instance was invoked. `whereami` returns "Error: Cannot find local context. Did you use `binding.pry`?"
<banisterfiend> dagobah: well how did u start pry, did you use binding.pry or just pry ?
<banisterfiend> dagobah: can u show me the code you used to start pry?
<dagobah> banisterfiend: Well, I'm running a test suite and it begins a pry session pry(#<Cucumber::Rails::World>)>
<banisterfiend> dagobah: can u show me the exact code
<dagobah> banisterfiend: That's what I'm trying to find :p
<banisterfiend> dagobah: no i mean, can you show me where u have the 'pry' call in your code
<banisterfiend> i want to see how you start it
<dagobah> Ahh.
<dagobah> It was being called in a step definition file (cucumber).
<dagobah> With just `pry`
<banisterfiend> dagobah: well, as the error message says :P use binding.pry there
<banisterfiend> not just 'pry' :)
<dagobah> :)
<dagobah> I'm sure there must have been a reason why I didn't use binding.pry, I have always used that..!
<banisterfiend> dagobah: hehe
<banisterfiend> dagobah: btw there is a #pry channel :)
<dagobah> banisterfiend: Excellent, sorry for the spaff.
<banisterfiend> dagobah: np
<banisterfiend> dagobah: i like to answer pry questions
mengu_ has joined #ruby
lobak has joined #ruby
ken_barber1 has joined #ruby
Squarepy has joined #ruby
mdw has joined #ruby
d34th4ck3r has joined #ruby
Squarepy has joined #ruby
SPYGAME has joined #ruby
davidcelis has joined #ruby
francisfish has joined #ruby
iocor has joined #ruby
iamjarvo has joined #ruby
dennda has joined #ruby
IPGlider has joined #ruby
timonv has joined #ruby
sinusss has joined #ruby
voodster has joined #ruby
Beoran__ has joined #ruby
schovi has joined #ruby
frishi has joined #ruby
iamjarvo has joined #ruby
fr0gprince_mac has joined #ruby
strife25 has joined #ruby
seanstickle has joined #ruby
jlebrech has joined #ruby
n1x has joined #ruby
`brendan has joined #ruby
mcwise has joined #ruby
atnight has joined #ruby
LMolr has joined #ruby
RORgasm has joined #ruby
nanderoo has joined #ruby
cjs226 has joined #ruby
yalue has joined #ruby
Haydos has joined #ruby
Tomasso has joined #ruby
PragCypher has joined #ruby
burgestrand has joined #ruby
pu22l3r has joined #ruby
jakky has joined #ruby
alem0lars has joined #ruby
crankycoder has joined #ruby
Sailias has joined #ruby
IrishGringo has joined #ruby
abstrusenick has joined #ruby
jbw has joined #ruby
fbernier has joined #ruby
Synthead has joined #ruby
chico has joined #ruby
dv_ has joined #ruby
niku4i has joined #ruby
adeponte has joined #ruby
_adeponte has joined #ruby
adeponte has joined #ruby
_adeponte has joined #ruby
adeponte has joined #ruby
iocor has joined #ruby
jakky has joined #ruby
toddmorrill has joined #ruby
adeponte has joined #ruby
adeponte has joined #ruby
iamjarvo has joined #ruby
xcvd has joined #ruby
_adeponte has joined #ruby
adeponte has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
stepnem has joined #ruby
_adeponte has joined #ruby
trivol_ has joined #ruby
carlyle has joined #ruby
adeponte has joined #ruby
_adeponte has joined #ruby
pen has joined #ruby
tommyvyo has joined #ruby
adeponte has joined #ruby
emmanuelux has joined #ruby
xcvd has joined #ruby
kvirani has joined #ruby
dv310p3r has joined #ruby
d34th4ck3r has joined #ruby
<shevy> man Unix is a mess built on a larger mess called C
<shevy> especially .h files
<gogiel> shevy: yeah. thank god ruby is not built on c
<Squarepy> ha
tommyvyo has joined #ruby
<shevy> indeed. imagine if ruby would be built on ruby
<gogiel> shevy: it's called rubinius
<mistergibson> I rather fancy ObjectiveC
<mistergibson> I love the concept
krusty_ar has joined #ruby
bbttxu has joined #ruby
bwlang has joined #ruby
jobicoppola has joined #ruby
linoj has joined #ruby
bwlang has joined #ruby
mattyoho has joined #ruby
rrichardsr3 has joined #ruby
Floydzy has joined #ruby
netrealm has joined #ruby
mcwise has joined #ruby
mcwise has joined #ruby
tommyvyo has joined #ruby
nilg` has joined #ruby
etehtsea has joined #ruby
dql has joined #ruby
Jake232 has joined #ruby
hukl has joined #ruby
geekbri has joined #ruby
JonSchuff has joined #ruby
mstratman has joined #ruby
tommyvyo has joined #ruby
dorei has joined #ruby
<dorei> hello
Divinite has joined #ruby
<dorei> is there a way to create a new object from a string? let's say i have a string "Hash", is there a way to create a hash object from it?
<Mon_Ouie> Object.const_get("Hash").new
n1x has joined #ruby
t0mmyvyo has joined #ruby
<dorei> aw, thanx Mon_Ouie :)
waxjar has joined #ruby
<banisterfiend> dorei: Mon_Ouie is a real sweetypop
heftig has joined #ruby
LBRapid has joined #ruby
fmcgeough has joined #ruby
jobicoppola has joined #ruby
<any-key> Anyone here want to write my ethics paper?
<Divinite> No.
<Divinite> :P
fmcgeough has joined #ruby
A124 has joined #ruby
A124 has quit [#ruby]
roderyk has joined #ruby
tvw has joined #ruby
Divinite has joined #ruby
GuidovanPossum has joined #ruby
dustybrains has joined #ruby
fortysixandtwo has joined #ruby
td123 has joined #ruby
jeebster has joined #ruby
uris has joined #ruby
inemion has joined #ruby
<inemion> any resources someone could point me to for showing live data in a table that updates itself without refreshing the page?
<Divinite> Yes: http://www.updlive.com/
<Divinite> :P
<inemion> heh :(
theRoUS has joined #ruby
<mcwise> Server not found
<Divinite> Oh, I'm being so mean to people.
<any-key> heh
* Divinite smacks herself in face.
xorrbit has quit [#ruby]
dv310p3r has joined #ruby
imsplitbit has joined #ruby
qos_ has joined #ruby
<any-key> mcwise: you ever write any AJAX?
<any-key> whoops
<any-key> wrong person
<any-key> inemion: you ever write any AJAX? Or use JQuery?
<mcwise> well I figured it was a joke or soemthing Divinite but I did not get the point
<any-key> 08:45 < Divinite> Oh, I'm being so mean to people.
<any-key> ^^^^^^ that was the point
<inemion> any-key: very little when developing with wordpress
<any-key> inemion: you may want to brush up on your javascript before tackling this, it can get hairy
<any-key> inemion: essentially you have some sort of API in your web app that you can pass parameters and interact with it in javascript
<any-key> it reaaaalllyyy depends on the data and how you're interacting with it and tons of other things
<inemion> any-key: appreciate the help
<inemion> I'm looking to do a sort of in house application monitoring thing
<Tasser> any-key, I wonder why it's not called AJAJ :-)
nacengineer has joined #ruby
<inemion> have ruby go through the user experience of using an application and then report back to a live console
<any-key> Tasser: haha good question
<any-key> hopefully this app is for monitoring your house and not the houses of other people :P
<inemion> any-key: lol yes sir
<inemion> It's more of a project to help me learn ruby … if it works it would help out … if not it was a learning exprience
tommyvyo has joined #ruby
RORgasm has joined #ruby
Cypher has joined #ruby
jgarvey has joined #ruby
<Tasser> inemion, there are some very nice texts about usability studies out there
<Tasser> grab one of them and read them
<inemion> Tasser: thanks. any particular ones you had in mind? or what could I google to get to one?
nemesit has joined #ruby
<Tasser> inemion, I read "don't make me think"
bwlang_ has joined #ruby
<Tasser> but as I'm more of a backend guy, I wouldn't trust myself on that topic :-)
<inemion> heh fair enough
* Divinite wakes up... What happened?
<Tasser> There was a bug in the matrix
PragCypher has joined #ruby
<Divinite> Tasser: I'll need to fix that to survive.
strife25 has joined #ruby
<Tasser> nah, it will fix itself
fivetwentysix has joined #ruby
brngardner has joined #ruby
carlyle has joined #ruby
GuidovanPossum has joined #ruby
kvirani has joined #ruby
xkx has joined #ruby
asobrasil has joined #ruby
quest88 has joined #ruby
ynon has joined #ruby
steg132 has joined #ruby
chson has joined #ruby
IPGlider has joined #ruby
kpshek has joined #ruby
bwlang has joined #ruby
mattyoho has joined #ruby
thone has joined #ruby
josefig has joined #ruby
Gesh has joined #ruby
Gesh has quit [#ruby]
Sailias has joined #ruby
steg132 has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
<rking> When I `ruby -e 'raise "asdf"'`, it says it's "in `<main>'". Is there a thing that can be accessed via :main, or is that a completely figmentary "<main>"?
<waxjar> in Ruby, code you write outside objects/classes/modules/etc and stuff, is actually running inside an object called main, iirc
lorandi has joined #ruby
<banisterfiend> rking: it's accessed via TOPLEVEL_BINDING
steg132 has joined #ruby
<rking> Hrm.
steg132 has quit [#ruby]
<rking> Cool. I didn't know about Binding objects.
<banisterfiend> rking: a Binding object is like a snapshot of a stack frame
<banisterfiend> it's a very powerful construct
dv310p3r has joined #ruby
hobodave has joined #ruby
steg132 has joined #ruby
RORgasm has joined #ruby
vaxinate has joined #ruby
axl___ has joined #ruby
ceej has joined #ruby
vectorshelve has joined #ruby
chomp has joined #ruby
steg132 has quit [#ruby]
<dorei> how can i wait for the various threads (started with Thread.new do) to finish?
niku4i has joined #ruby
steg132 has joined #ruby
PaciFisT has joined #ruby
<rking> thrd.join ?
snip_it has joined #ruby
<dorei> no idea, it's my first try with threads
Jake232 has joined #ruby
<rking> Yeah, that's it then.
frode15243 has joined #ruby
steg132 has joined #ruby
frode15243 has quit ["Leaving"]
vaxinate has joined #ruby
Indian has joined #ruby
slonimsky has joined #ruby
<jlebrech> is there a shorthand to converting a string to datetime, but if it fails make it nil?
<jlebrech> i'm using begin .. rescue .. end
<dorei> blah blah rescue nil
<dorei> maybe
<vectorshelve> jlebrech: DateTime.strptime allows you to specify the format and convert a String to a DateTime.
mrwalker has joined #ruby
notjohn has joined #ruby
<jlebrech> vectorshelve and what if an invalid string is provided?
<vectorshelve> jlebrech: something like Date.strptime("{ 2009, 4, 15 }", "{ %Y, %m, %d }")
<vectorshelve> jlebrech: rescue it
iocor has joined #ruby
knirhs has joined #ruby
Bauer has joined #ruby
mxweas_ has joined #ruby
trivol has joined #ruby
pythogorian has joined #ruby
simao has joined #ruby
bondar has joined #ruby
<pythogorian> can someone explain me why is this the case?
<pythogorian> irb(main):082:0> nil or 1
<pythogorian> => 1
<pythogorian> irb(main):083:0> x = nil or 1
<pythogorian> => 1
<pythogorian> irb(main):084:0> x
<pythogorian> => nil
<pythogorian> irb(main):085:0>
<arturaz> becaue or and || is not the same
<arturaz> (x = nil) or (1)
<pythogorian> god, i forgot about bitwise
<arturaz> x = (nil || 1)
<pythogorian> (**idiot**)
<canton7> || isn't bitwise...
<canton7> (neither is 'or')
<arturaz> they have difference precedence
<pythogorian> i didn't knew that
<pythogorian> thanks
<canton7> 'and' and 'or' are meant for flow control
snearch has joined #ruby
<canton7> (comes from perl I believe)
mattyoho has joined #ruby
<strife25> hi all - what's the best practice when it comes to the use of namespaces in gems? Should one always namespace their classes in gems? Sorry for the basic question, but google is not working in my office atm so I'm unable to rtfm :-/
mattyoho has joined #ruby
<canton7> yeah. You don't want to clutter up someone else's namespace if they decide to require your gem....
icrazyhack has joined #ruby
RubyRedGirl has quit [#ruby]
_312matt has joined #ruby
Kireji has joined #ruby
alek_b has joined #ruby
eam has joined #ruby
tommyvyo has joined #ruby
<strife25> canton7: what about having a module per subdirectory inside of a gem? e.g. if my gem is structured: foo/bar/example.rb, should the namespace be foo::bar::example.rb?
<canton7> that's then down to your application structure
<vectorshelve> Just watch the ruby chat in irc for a whole day and I swear You will learn a world of things :)
<vectorshelve> canton7: Hai dude !!
<canton7> hey
cha1tanya has joined #ruby
kevinbond has joined #ruby
richardlxc has joined #ruby
__class__ has joined #ruby
mikepack has joined #ruby
IrishGringo has joined #ruby
bbttxu has joined #ruby
oooPaul has joined #ruby
<geekbri> What is the best way to extract a substring from a string via a regular expression? EG I have the string ### P:1 start and I want to extra the substring 1. My regexp is /^#### P:(\d)/
<oooPaul> That will work for a single digit.
<oooPaul> Add a + after the d and you'll get "1 or more" digits.
<canton7> "#### P:1 start"[/^#### P:(\d+)., 1]
<oooPaul> Then you can reference $1 afterwards to see what was in that parenthesis.
_class_ has joined #ruby
<oooPaul> string =~ /^#### P:(\d+)/; puts $1
<geekbri> ah ok, so it will store the result in a global?
<oooPaul> Yeah.
<canton7> or you can use my syntax, and get at it directly, or use #match
<oooPaul> $1 will be the first parenthesis result, $2 the second, etc. Can get messy if you're nesting parenthesis...
<geekbri> ah yes I see. I used canton7's syntax suggestion. Seems to work good. I'm a bit leery that it gets stored in a global but I guess i'll cross the bridge when I get to it
headius has joined #ruby
KL-7 has joined #ruby
<lupine_85> geekbri, http://www.ruby-doc.org/core-1.8.7/Regexp.html#method-i-match if you want to avoid using $1, $2, etc
chelbs has joined #ruby
<oooPaul> Yeah, there's the more OOP way of dealing with regexes... The =~ and $1 stuff comes from a long history with Perl.
<lupine_85> I wouldn't worry about it too much, personally
n1x has joined #ruby
<geekbri> so it seems /^### P:(\d+)/.match(token)[1] will error out if there is no match, because im trying to take [1] of nil class. Is there a succinct way of saying [1] unless .nil?
lkba has joined #ruby
mxweas_ has joined #ruby
icrazyhack has joined #ruby
<burgestrand> geekbri: token is a string?
<burgestrand> geekbri: string[/regex/, 1]
<geekbri> burgestrand: token is a variable
theRoUS has joined #ruby
theRoUS has joined #ruby
<canton7> token contains a string? :P
<burgestrand> geekbri: yes and something else
<geekbri> hehe yes, token contains a string which is a digit
<geekbri> errr sorry its a string which contains a digit, which i am trying to ferret out
kevinykchan has joined #ruby
<burgestrand> geekbri: like I said, string[/regex/, match_index] will work for you
<geekbri> I ended up just storing the result in a variable and returning [1] unless variable.nil?
<burgestrand> or, not match index, group index
kenperkins has joined #ruby
albemuth has joined #ruby
<geekbri> thanks for all the help you upstanding internet citizens.
dknight has joined #ruby
Araxia_ has joined #ruby
wallerdev has joined #ruby
xcvd` has joined #ruby
92AAANK2C has joined #ruby
JonSchuff has joined #ruby
Neil____ has joined #ruby
Neil_____ has joined #ruby
Babar has joined #ruby
<Babar> Hi, what's the easiest way to test that some attribute exists before using them? Like node[:dmi][:baseboard], as sometimes it's called node[:dmi][:base_board]?
ysiad has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
<lectrick> If I have a number which is Time.now.to_i, how do I convert those seconds back to a proper Time object?
d2dchat has joined #ruby
<canton7> lectrick, Time.at ?
wilmoore has joined #ruby
sbanwart has joined #ruby
thecreators has joined #ruby
davidcelis has joined #ruby
thecreators has quit [#ruby]
MasterIdler has joined #ruby
thecreators has joined #ruby
schovi has joined #ruby
uris has joined #ruby
<lectrick> Thanks!
blueadept has joined #ruby
<Synthead> # /opt/ruby-enterprise/bin/gem update --system 1.5.3
<Synthead> /opt/ruby-enterprise/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
<Synthead> ruby 1.8.7 (2012-02-08 MBARI 8/0x6770 on patchlevel 358) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2012.02
<Synthead> Aborted
<Synthead> anyone know how to fix this?
glosoli has joined #ruby
glosoli has joined #ruby
bglusman has joined #ruby
jankly has joined #ruby
<shevy> cool
<shevy> seems as if they use their own ruby version
tobyo has joined #ruby
CannedCorn has joined #ruby
bawer has joined #ruby
<CannedCorn> hey guys, im trying to render an erb template from my own class
<CannedCorn> i've required 'erb'
Synthead has joined #ruby
<CannedCorn> but it says no method when i call ERB::erb
<davidcelis> that's because
<davidcelis> there's no method ERB::erb
martianlobster has joined #ruby
<CannedCorn> oh
roderyk has joined #ruby
<shevy> CannedCorn, what does the docu say?
iocor has joined #ruby
dknight has quit [#ruby]
<shevy> ERB.new
Babar has quit [#ruby]
<CannedCorn> whatyeah
<CannedCorn> im looking at it
<CannedCorn> what is binding though
<CannedCorn> does every object have a binding
<CannedCorn> oh snap, they do
<CannedCorn> nice
lewis_ has joined #ruby
lewix has joined #ruby
<shevy> <p>
<shevy> <% if @cost < 10 %>
<shevy> <b>Only <%= @cost %>!!!</b>
<shevy> man
moshee has joined #ruby
moshee has joined #ruby
<lewis> what does the statement ruby evaluates to an object mean
<shevy> I swear
<shevy> I will never use this syntax shit myself
nlc has joined #ruby
jfelchner has joined #ruby
<Synthead> any thoughts?
<shevy> lewis, no idea, in what context is it provided? perhaps it wants to say that (almost) everything in ruby is an object and responds to messages sent to it
<shevy> Synthead, no idea. use official ruby and latest rubygem version
<Mon_Ouie> CannedCorn: That's not really it. An "object" doesn't have a binding (except for objects like procs), but every context has its own binding
<lewis> shevy: "Every expression in Ruby evaluates to an object; and every object in Ruby has a truth value"
<shevy> lewis sounds quite bogus to me
<lewis> Mon_Ouie: weren't you in #c back in the days
<Mon_Ouie> Nope
<lewis> shevy: exactly. and it's taken from a book
<lewis> Mon_Ouie: aren't you french
joaoh82 has joined #ruby
<burgestrand> lewis: false and nil are objects, they evaluate to false
<shevy> He is! :D
<burgestrand> or, oh, I misunderstood you
<shevy> Mon_Ouie, you are getting famous
<lewis> burgestrand: I understand that - no the quoted statement
<shevy> lewis, what book is that?
<lewis> shevy: I knew I know him from somewhere
<lewis> shevy: the well grounded rubyist
<shevy> hmm
<shevy> its author knows a lot about ruby
<Mon_Ouie> The first part means any complete expression results in an object. "foo()" would call a method and return an object, "3" is an integer literal which is an object, "false" is a literal object, "if true then 3 end" is an expression too
<shevy> but otherwise, if I would not know who the author is, I'd just think "wtf!"
apeiros_ has joined #ruby
<lewis> shevy: I guess it depends on how you define the term "evaluates"
peterhil` has joined #ruby
<lewis> Mon_Ouie: what do you mean by complete expression. what's an incomplete expression
<burgestrand> lewis: "if"
<Mon_Ouie> if foo then 3
<burgestrand> :p
<lewis> burgestrand: ok. I assumed that by default an expression is complete
<shevy> you could start to write "if" then suddenly you have a heart attack
<shevy> that's an incomplete expression then :)
<shevy> rumour has it that "if" is the last word a programmer says when dying
<Mon_Ouie> I thought it was SIGSEGV
<macmartine> I have an event model, and I keep it in sync with a remote event model. There's some code to do the coversion from one format to another, and code that pushes and pulls these events. Where would you put this code?
<lewis> shevy: But then that wouldn't be proper ruby - therefore not technically an expression. I think the author assumes that too then, since he doesn't say "Every complete expression.." he says "Every expression.."
<Mon_Ouie> Well, yes, I just wanted to make it clear
<lewis> Mon_Ouie: thanks by the way.
roderyk has joined #ruby
rramsden has joined #ruby
peterhil` has joined #ruby
adeponte has joined #ruby
<lewis> when the term evaluate is used, does it always means the value returned
adamkittelson has joined #ruby
<Mon_Ouie> evaluating an expression means running the code
dkissell has joined #ruby
<Mon_Ouie> Sometimes the evaluated object is dropped and ignored, but it still exists
<shevy> lewis, I dont think evaluating anything has to do with the value returned
<shevy> "return" returns something in ruby code, or optionally the last value in a method is its return value
maletor has joined #ruby
<shevy> cat.eat :mouse
<shevy> cat.digest
<shevy> ^^^ silently digesting the mouse, not returning anything
SegFaultAX|work has joined #ruby
<shevy> return cat.digest.leftovers
<shevy> ^^^ returning what is left of the eaten mouse
<lewis> shevy: yet when the term is used it's always accompanied by an explanation of what is returned
ryannielson has joined #ruby
<davidcelis> in the context of the last statement evaluated being returned, sure
<Mon_Ouie> It shows what it evaluates too, similarly to what you'd see in a REPL
adeponte has joined #ruby
<artm> what's a gem to talk to mac os application like with apple talk but from ruby?
sako has joined #ruby
<davidcelis> talk to which mac os application
<davidcelis> all of them?
<artm> well, I would like to "find a window by name" and tell that window to rise.
<Mon_Ouie> You could try MacRuby which has access to all the Cocoa API
<davidcelis> this sounds something like the `osascript` binary
<artm> davidcelis: yes, except I want to do it from ruby
vitor-br has joined #ruby
<artm> I used to do something similar from python (talking to iTunes)
<artm> so I assumed there is a gem for that
<davidcelis> i mean, you can make system calls from ruby, but yes, i'd try looking at macruby as Mon_Ouie said
<lewis> Mon_Ouie: REPL?
nfluxx has joined #ruby
johnmilton has joined #ruby
<lewis> Mon_Ouie: what do you use macruby for by the way...
<Mon_Ouie> Read-Eval-Print-Loop
<Mon_Ouie> e.g. IRB, which comes with Ruby
<lewis> Mon_Ouie: I heard it's not compatible with iphones,ipas
jobicoppola has joined #ruby
cbuxton has joined #ruby
<artm> oh, no. MacRuby sounds like such an overkill.
<Tasser> lewis, yes, that's why those devices suck ;-)
<lewis> artm: and what did you switch from python to ruby (I don't mean to start a debate, just wondering hehe)
segora has joined #ruby
<Mon_Ouie> And I don't use MacRuby, I just know it can access any Obj-C library (well, probably they have to follow some of Cocoa's conventions for it to work)
ed_hz_ has joined #ruby
apok has joined #ruby
<artm> lewis: blocks syntax mostly :-)
<lewis> artm: so you like it better. sweet
knirhs has joined #ruby
LMolr has joined #ruby
kidoz has joined #ruby
schovi has joined #ruby
Radium has joined #ruby
maskact has joined #ruby
iori has joined #ruby
eignerchris has joined #ruby
Advocation has joined #ruby
williamcotton has joined #ruby
pen has joined #ruby
savage- has joined #ruby
<artm> lewis: it's not like I switched overnight. I used to do a lot of python because my collegues were, than I became a lone cowboy-coder and did everything in C++ and last year I've discovered ruby and it felt right.
<artm> that was "then"
<lewis> artm: what field are you in
ghanima has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
<lewis> artm: robots
<artm> well... robot is the most arbitrary part of that project.
* lewis noticed that in this channel nobody put the nickname of the person he's referring to
apok has joined #ruby
<lewis> artm: I see, sweet. It sounds fascinating
dennda has joined #ruby
<artm> lewis: yes, it is. and keeps me on the edge, because every artist wants something new and exciting :-)
kevinbond_ has joined #ruby
<lewis> artm: I wish I could join a project like that
<artm> lewis: where are you located?
<lewis> artm: toronto
* artm feels like a minor character from the Little Brother, asking that.
<lewis> lol
eam has joined #ruby
<artm> lewis: there is Augemented Reality lab in Toronto, in some school. They do "projects like that" :)
<lewis> artm: really. hmm
<artm> lewis: i think it's in University of Toronto. Can't google it though
brianpWins has joined #ruby
<artm> hmm "York University"
<artm> it's called "future cinema lab"
<artm> lewis: ^^^^ :)
ank has joined #ruby
<lewis> artm: thanks im checking it out
<artm> this gem sounds like what I was looking for: http://rubyosa.rubyforge.org/
Eiam has joined #ruby
<artm> lewis: no problem
brngardner has joined #ruby
luckyruby has joined #ruby
A_D has joined #ruby
brianpWins_ has joined #ruby
twinturbo has joined #ruby
abra has joined #ruby
maveoanir has joined #ruby
iamjarvo has joined #ruby
bbttxu has joined #ruby
ddgromit has joined #ruby
robbyoconnor has joined #ruby
Advocation has joined #ruby
bondar has joined #ruby
<artm> update: this version seems to have installed: https://github.com/pbosetti/rubyosa
<artm> "RubyOSA is a bridge that connects Ruby to the Apple Event Manager infrastructure"
Advocation has joined #ruby
jankly has joined #ruby
<A_D> Hi there...
<davidcelis> Hi
tatsuya_o has joined #ruby
jlogsdon has joined #ruby
<lewis> I don't understand why the return value of put is always nil.
<lewis> artm: thanks by the way for the link
<A_D> I'm trying to find if I can write files on my gem folder... is there any gem that do this?
<davidcelis> lewis: Just how the method was written. It's not meant to return anything, just to output to STOUT
<Mon_Ouie> Because that's what they decided. They could just as well have chosen to return the written string, the arguments, or $stdout.
rippa has joined #ruby
<lewis> davidcelis: so shouldn't it return the output to stdout
katya^ has joined #ruby
<davidcelis> lewis: It doesn't really "return" the output to stdout
<Mon_Ouie> It inserts a line in stdout, it doesn't need to return anything to have that side effect
<lewis> davidcelis: so basically the last expression of the method put return nil
<Mon_Ouie> It's actually usually implemented in C, but yes, that's what it does
<lewis> it's either implicitly return nil with the last expression or explicitly with the return keyword, right
bpgoldsb has joined #ruby
<lewis> Mon_Ouie: told you i saw you in C before
<davidcelis> Well it's written in C, so the function explicitly returns nil
rbanffy has joined #ruby
<Mon_Ouie> Knowing about C doesn't mean I hang out in C IRC channels ;)
<katya^> like it matters, it's the same shitheads in all channels
Morkel has joined #ruby
<lewis> thanks davidcelis Mon_Ouie. got it
<davidcelis> No problem
eph3meral has joined #ruby
<eph3meral> how can I get the date of "tuesday next week"
<eph3meral> 1.weeks_since will get me "friday of next week" because, for example today is friday
<eph3meral> at least where I live it's friday :)
<lewis> I thought ruby was mostly inspired by c but i was wrong
<eph3meral> lewis, perl I think
<lewis> c++
<shevy> lewis smalltalk
<lewis> python
<shevy> where do you have this information
<shevy> watching alice in wonderland?
<katya^> it's not inspired by C at all
<lewis> katya^: yup. it certainly has some similarity
<katya^> where?
<shevy> hehe katya^ says no, then lewis follows up with "yup. it certainly has some similarity"
<katya^> C-based grammars feel natural, ruby feels very unnatural
<shevy> I smell troll
<shevy> oh
<shevy> two of em
<shevy> :(
<lewis> lol
<shevy> "ruby feels very unnatural"
<lewis> shevy: fails
<katya^> that's not necessarily bad, shevy
<shevy> well, I fell for him at first but now it's ok
<katya^> it's jusy very difficult to get used to for people that are accustomed to real languages
Radar has joined #ruby
<katya^> just*
<shevy> real languages
<davidcelis> shevy: Two?
<Radar> lol katya^
<shevy> Chinese
<Radar> apeiros_: PING
<davidcelis> shevy: Oh wait, katya^ is in here
<katya^> is he following me
<shevy> davidcelis, well so far katya^ and lewis
<Radar> apeiros_: Please deal with this katya^ clown
<shevy> but katya^ is clearly the older troll
<davidcelis> shevy: Yeah he was just in #rubyonrails trolling as well.
Nisstyre has joined #ruby
<katya^> i don't troll
<lewis> shevy: it was inspired by many languages which includes python, C++,smalltalk, Perl
maletor has joined #ruby
<davidcelis> Keep telling yourself that
<katya^> just because I say something you don't want to hear, does not make me a troll
<shevy> lewis, C++ how precisely? I know of only << "operator"
<lewis> shevy: I don't know buddy. Got it from the book
<shevy> oh man
<shevy> I can no longer believe you
<shevy> the man who wrote the book you showed knows ruby very well
<lewis> shevy: I thought it was inspired mostly by c as personal opinion but I was wrong (it just the syntax looked familiar to me ..somewhat)
<shevy> katya^ I like you
<shevy> say something funny katya^
<katya^> knock knock
mcwise has joined #ruby
voodoofish430 has joined #ruby
<shevy> lewis, what syntax! you can avoid "for" in Ruby... my ruby code looks nothing at all like C... In C you require () parens and you require ; you also require #include and an int main(), and you must declare the types of all your variables
<shevy> I really have no idea where you have this funny idea that ruby looks like C
roderyk has quit [#ruby]
stephenjudkins has joined #ruby
<shevy> b1 = (double *)malloc(m*sizeof(double)); <--- is this ruby or C lewis
mrtheshadow has joined #ruby
<davidcelis> that is clearly Ruby
<davidcelis> obvious question is obvious
<shevy> lol
strife25 has joined #ruby
<shevy> katya^ can't you say something else please
<katya^> you don't need to cast the result of malloc in C, you're thinking of c++, which you still shouldn't do
shruggar has joined #ruby
<shevy> excellent!
<lewis> shevy: what are you babbling about
<lewis> shevy: I said I was wrong
<davidcelis> shevy: hahahahha
<shevy> lewis wait, katya^ is giving us wisdom right now
niku4i has joined #ruby
<shevy> it would be sad if katya^ would be banned here :(
ken_barber has joined #ruby
ken_barber has joined #ruby
greenarrow has joined #ruby
<shevy> gah, he is silent now...
<katya^> i'm a woman
<shevy> nah
<daed> hi
TheIronWolf has joined #ruby
<shevy> hi daed
<daed> how are you shevy
<shevy> fine
<shevy> rewriting my oldest project
* lewis really believes than shevy is a troll in disguise
<daed> perhaps
<katya^> it's irc, of course
<shevy> at least I don't say "Ruby was inspired by C"
<shevy> or
<lewis> shevy: here you go again
<shevy> "Ruby was inspired by Python."
<lewis> apparently you ignore when I say I was wrong..troll-like attribute
<Eiam> wouldn't it be more appropo to say ruby was inspired by Perl? =)
<shevy> you followed SO QUICKLY up after you said that about C
<shevy> yes!
<davidcelis> Eiam: Yes.
<shevy> perl is like ruby's older brother
<Eiam> shevy: older, and more fucked in the head?
<shevy> well, we have to be nice to perl
<shevy> it kinda paved the way for the other languages
shruggar has joined #ruby
<davidcelis> LEAVE PERL ALONE
<Eiam> davidcelis: I would, if it would just die
<katya^> perl is better, imo
<Eiam> and go away.
<shevy> also, they can not transition to perl 6, which is difficult for them
<shevy> katya^, perl is still in use
<davidcelis> katya^: So you finally admit to subjectivity! Most excellent
<katya^> yes
<davidcelis> It was only a matter of time.
tommyvyo has joined #ruby
<lewis> shevy: 13:32 lewis: I thought ruby was mostly inspired by c but i was wrong. then you went on and on about god knows what
<katya^> i still use it
elalande has joined #ruby
lampe2 has joined #ruby
<lampe2> hey my ruby friends :)
bbttxu has joined #ruby
IPGlider has joined #ruby
<shevy> lewis ya ya and you said you have this from a book written by dblack himself ... sure sure sure
<lewis> shevy: I meant perl,smalltalk and python. please stop talking
<shevy> python!
<lewis> 13:33 lewis: python
<lewis> 13:33 shevy: where do you have this information
<shevy> !!!
lorandi has joined #ruby
<shevy> where is the python in ruby
<davidcelis> Dynamic typing, of course!
<davidcelis> also, `def`
<davidcelis> They are practically the same language, shevy
<shevy> hmm
<shevy> you are right about the "def" part
krz has joined #ruby
<shevy> one could even say that ruby stole that from python
<lampe2> a nother round ruby vs python ... cant we just be mates?
<davidcelis> lampe2: This is actually on the influce of python on ruby
<shevy> ok
<shevy> what is better:
<davidcelis> influence*
<shevy> vim or emacs
<katya^> vim
<elalande> vim :P
<shevy> I dont like katya^ :(
<davidcelis> shevy: notepad
<shevy> well I can agree partially... but what I hate in notepad is, you dont get colour highlighting or?
<shevy> I need to concentrate more when there is only black + white
QKO has joined #ruby
<lampe2> influence....every language has some parts from other languages
<lampe2> okay maybe java not... java is bullshit all the time :P
<Eiam> sometimes languages serve as warnings to other languages as to what to NOT do
<Eiam> so their existence is important
<Eiam> like Go, and Java
<Eiam> =)
<Mon_Ouie> I'm glad Brainfuck exists
<shevy> Go exists because Google is bored
<lampe2> Eiam, so Java is very important :) it shows us like we should things not do !
Mohan has joined #ruby
Mohan has joined #ruby
<Eiam> it shows us that you can indeed put public static void int private myFunct() and people will apparently think you are serious
mdw has joined #ruby
SEJeff_work has joined #ruby
<lampe2> or you can open a streambuffer and parse it and than you cant do nothing anymore with the streambuffer you need a new one.... but you didnt close the old one .... GREAT stream...
pen has joined #ruby
shruggar has joined #ruby
<SEJeff_work> Forgive my extreme ruby noobish-ness, but graylog2 thinks it requires rdoc 3.1.1 even though I have the 3.12 rdoc gem installed
brianpWins has joined #ruby
<SEJeff_work> Is there a way I can install rdoc 3.1.1 as well? gem install rdoc --version 3.1.1 just says: ERROR: Could not find a valid gem 'rdoc' (= 3.1.1) in any repository
Radar has quit ["Textual IRC Client: http://www.textualapp.com/"]
<shevy> Eiam, well they sell software for amount of characters used ;)
kenichi has joined #ruby
<lampe2> SEJeff_work, can you update your gems? my graylog wants 3.1.2 ?
sarmiena_ has joined #ruby
<Eiam> in my experience it seems like everyone doing java is contractors
<Eiam> of the overseas type
<Eiam> so that wouldn't surprise me
<shevy> Eiam yea
<sarmiena_> just found something interesting about Array += method. turns out it does a fake mutation. totally confused me http://pastie.org/3781960
<oooPaul> There are still a lot of people using Java. Mostly in large companies, where they can afford the overhead of time and money. :)
roderyk has joined #ruby
<SEJeff_work> You know... Sometimes C++ will use java to prototype stuff
<SEJeff_work> *C++ shops
<shevy> C++ shops, so so
<Mon_Ouie> sarmiena_: That's probably because there's no such thing as a += method
<oooPaul> sarmiena_, what do you mean it does a fake mutation?
<Mon_Ouie> a += b is a syntax sugar for a = a + b
<sarmiena_> Mon_Ouie: Array docs show a +=
<oooPaul> Yeah.
<sarmiena_> ohh i see
<sarmiena_> that makes sense
<davidcelis> which is syntax sugar for array = array + other_array
<oooPaul> Right.
<sarmiena_> i was comparing it to something like string#replace
<oooPaul> Newp.
<sarmiena_> arggghhh. live and learn
<oooPaul> << will work that way, tho.
<oooPaul> If you need it to.
<sarmiena_> not that would append an array into my array
<Mon_Ouie> Array#concat
<oooPaul> Well, don't pass it an array, then. :)
<sarmiena_> Mon_Ouie: thankee!
<oooPaul> :D
<sarmiena_> oooPaul: 2 different use cases
<Mon_Ouie> Not sure what "newp" means, but yes, #replace is the method that completely changes the value of an object without creating a new one, so you can compare it to "="
<CannedCorn> how do you get rid of trailing space in erb
<sarmiena_> Mon_Ouie: newp == nope
<sarmiena_> but in a cute way
<sarmiena_> "cute"
seich has joined #ruby
mxweas_ has joined #ruby
<sarmiena_> Mon_Ouie: "=" does a reassignment of the variable (new memory location)
<oooPaul> In a kewl way. :)
baroquebobcat has joined #ruby
<sarmiena_> CannedCorn: <%- stuff %>
<oooPaul> sarmiena_, Mon_Ouie : More importantly, the + actually returns a NEW instance.
seich has joined #ruby
<sarmiena_> oooPaul: yeah that's what i got in the pastie
<Mon_Ouie> array.replace(array + other_array) would work
<sarmiena_> that's why i call object_id
<Mon_Ouie> It would surely be slower than concat, but it'd work
<oooPaul> Array#concat returns "self", but Array#+ returns a new instance.
<oooPaul> Mon_Ouie, yeah.
starburst has joined #ruby
banisterfiend has joined #ruby
<sarmiena_> oooPaul, Mon_Ouie: thanks guys. things clearer now :)
<oooPaul> It's basically the diff between, for example, "gsub" and "gsub!" -- the latter changes the content of the string, and returns 'self'. The former returns a brand new String object with the changes applied.
<lampe2> where is a good place to find co programmer ?
shruggar has joined #ruby
pcboy__ has joined #ruby
shruggar has joined #ruby
<sarmiena_> oooPaul: different from gsub because it doesn't change where the current var is pointing
<sarmiena_> *gsub doesn't
<Mon_Ouie> It's same difference as a.gsub! vs a = a.gsub though
<sarmiena_> Mon_Ouie: yessir
<oooPaul> Array#+ is to String#gsub as Array#concat is to String#gsub! (phrased as an SAT question :)
<Mon_Ouie> It always takes me a couple of minutes to parse that construction correctly
jmcphers has joined #ruby
scwh has joined #ruby
atnight has joined #ruby
kfoo_ has joined #ruby
roderyk has quit [#ruby]
dorei has joined #ruby
ben_alman has joined #ruby
soveran has joined #ruby
lucasefe has joined #ruby
strife25 has joined #ruby
blueadept has joined #ruby
hashpuppy has joined #ruby
<hashpuppy> how do i convert a Fixnum (integer) to BigDecimal?
eywu has joined #ruby
TechART has joined #ruby
tobyo has joined #ruby
TechART has quit [#ruby]
<davidcelis> BigDecminal.new(fixnum)
lampe2 has joined #ruby
Eldariof-ru has joined #ruby
IPGlider has joined #ruby
thecreators has joined #ruby
S2kx has joined #ruby
<hashpuppy> TypeError: can't convert Fixnum into String
<davidcelis> Weird
<hashpuppy> i'm on 1.8.7, though. is that why?
<davidcelis> what ver of Ruby
<davidcelis> ah
SEJeff_work has quit ["Leaving"]
BSaboia has joined #ruby
<davidcelis> .to_s your fixnum first
<davidcelis> in 1.8.7, it only accepts the number as a string for some reason
<hashpuppy> ha... ok
<hashpuppy> thanks :)
mohsin^ has joined #ruby
<mohsin^> hi there
<CannedCorn> sarmiena_ that doesn't work for me
<CannedCorn> i think its 'rails only'
jankly has joined #ruby
nahhh has joined #ruby
bawer has joined #ruby
<mohsin^> i am a beginner in ruby and need few pointers ..can you please point me to a ruby friendly editor/dev environment on mac?
DMKE has joined #ruby
<sarmiena_> CannedCorn: what's rails only?
<oooPaul> TextMate
<CannedCorn> using the -% to get rid of newlines in erb
<davidcelis> moshee: Sublime Text 2, TextMate, Chocolat
<davidcelis> er
<davidcelis> he left?
<sarmiena_> CannedCorn: oh. %-
<sarmiena_> ?
<davidcelis> mohsin^: Sublime Text 2, TextMate, Chocolat
<sarmiena_> not -%
<CannedCorn> yeah
<CannedCorn> that doesn't work
<sarmiena_> i see. maybe is rails extension on erb
<CannedCorn> yep
Radium has joined #ruby
<sarmiena_> CannedCorn: maybe you can check out their source code and it'll give you a clue on how to do it?
<mohsin^> thanks .. and how easy / difficult it is to create desktop app in ruby .. i am under the impression that it is geared towards web development
<davidcelis> mohsin^: Ruby is just a scripting language.
<sarmiena_> mohsin^: def not just for web dev
nahhh has quit [#ruby]
<davidcelis> mohsin^: You can do whatever you want with it, really
<sarmiena_> but i'd use C++ & qt or gtk for desktop UI stuffs
<davidcelis> mohsin^: If you're developing programs for Mac OS X and want to use Ruby, I'd check out MacRuby
<davidcelis> It provides a Ruby API layer to Cocoa
BSaboia__ has joined #ruby
<sarmiena_> that's neat
<mohsin^> I am going to develop a basic gui that talks to my SQL .. choosing ruby just to learn it
<Eiam> sarmiena_: i'd rather use macruby haha
<Eiam> than qt or qtk
<Eiam> =)
<sarmiena_> Eiam: but that's only for mac
<Eiam> who cares about other platforms? =)
<Eiam> (not me)
<davidcelis> Well, he did specifically mention Mac.
<sarmiena_> hahaah
<mohsin^> :) .. I only mentioned mac as my dev environment
<shevy> the ruby toolkits are fairly boring
<sarmiena_> my peers are a mix between linux & mac
<sarmiena_> that's why i'd do qt
lolsuper_ has joined #ruby
lolsuper_ has joined #ruby
<sarmiena_> but depends on your scenario i guess
<davidcelis> mohsin^: Well, you also said you want it to talk to YOUR SQL
francisfish has joined #ruby
<davidcelis> mohsin^: And if your dev environment is Mac...
<mohsin^> true .. mySQL
atnight has joined #ruby
<mohsin^> davidcelis: you were saying something?
<Eiam> mohsin^: so just write a rails app that does it
<Eiam> do your GUI in erb's
<Eiam> rails can talk to your sql DB, your GUI will be 'cross functional' since it 'll be in the web
<Eiam> and you get to do ruby
<davidcelis> Or even just a Sinatra app
<Eiam> yeha, or that
<davidcelis> Rails would probably be overkill for this
rexantony has joined #ruby
<Eiam> never used sinatra was just thinking of it as a soft routes wrapper
<Eiam> (as in you'd be forwarding sql client side generated straight into the server)
hackingoff has joined #ruby
<Eiam> (bad)
Chryson has joined #ruby
<rexantony> what is the best and updated book for programming ruby ? and for rails ?
looopy has joined #ruby
<Eiam> i liked "The ruby programming language"
<davidcelis> rexantony: Rails 3 in Action.
<davidcelis> for rails
bawer has joined #ruby
<davidcelis> rexantony: Good ruby books are The Well Grounded Rubyist, and Metaprogramming Ruby.
<Eiam> i learned more by being dumped into a rails app tho
<shevy> the best way to learn ruby is to write ruby scripts
<Eiam> than the book taught me ;)
<Eiam> ^
<davidcelis> I learned Ruby the wrong way
<davidcelis> Which was by learning Rails
<davidcelis> I ended up okay, though
<Eiam> i started off not liking ruby much, but i really like it now
<Eiam> davidcelis: haha
<shevy> hehe
<davidcelis> :)
pangur has joined #ruby
<Eiam> yeah i sort of did that, since my ruby is mostly rails
<shevy> rails dudes are rich
<davidcelis> I always hypocritically advise people to learn Ruby first though, at least the basics
<Eiam> davidcelis: practicalities are people are here because they need to DO something
<Eiam> and that something typically involves more than just scripts
<Eiam> otherwise they'd be using BASH
<Eiam> (when i need scripts, i use use bash still instead of ruby)
<pangur> chosen = fields[3]; if chosen == 1 ... p.choice = "Puppets"; end; Why does this code not work for me?
<shevy> Eiam I find shell scripts horrible to look at
<Eiam> shevy: they are
<Eiam> you get used to it =)
<shevy> pangur what value does chosen have?
<Eiam> pangur: uhm, i dunno, whats fields? whats p?
<pangur> 1,2, or 3 :)
<davidcelis> what's precious?
<shevy> then it is not 1
<Eiam> ^
<Eiam> pangur: lets start over. what are you trying to do
<shevy> perhaps chosen is nil
<pangur> It prints out for me Choice: 1 ;)
<shevy> Eiam, what I feel in bash and shell, I always feel constrained by the language
<pangur> Rather than Choice: Puppets
<katya^> what is the difference between nil and null
<shevy> katya^, please go away
<canton7> katya^, nil's a ruby concept, null exists in other languages
glosoli has joined #ruby
<davidcelis> In Ruby, null is nil.
<davidcelis> There's no null
<shevy> we are trying to help people, not troll them away katya^
<pangur> So, the value must be 1?
<shevy> pangur, if it would be 1, the code block would be entered
<shevy> thus is logically can not be 1
naz has joined #ruby
<pangur> hmph
<Eiam> pangur: call pp chosen
<Eiam> and find out what it is?
<shevy> perhaps it is "1"
<katya^> why would you call it nil when it's null everywhere else
<shevy> yeah use pp pangur
<shevy> katya^, please
<Eiam> katya^: its nil in objc ?
<lupine_85> nil != NULL
<davidcelis> nil is 25% shorter than null
<Eiam> null is an NSNull
<davidcelis> therefore, 25% better
<davidcelis> Q.E.D.
<Eiam> and nil is nil
<lupine_85> NULL.nil? would be false
<shevy> wtf is NULL
<katya^> (void *)0
<canton7> a constant ;)
<lupine_85> compiler-dependent
<katya^> typically
<lupine_85> certainly not nil, anyway
<shevy> davidcelis, what is going on here :(
<Mon_Ouie> C's NULL isn't an object, so NULL.nil? wouldn't do anything good
<davidcelis> uninitialized constant NULL
<katya^> or (uintptr_t)0 if you like
<davidcelis> the fuck are you guys talking about?
<Eiam> yeah
<Eiam> i dunno what nULL is haha irb is like 'wtf'
<Eiam> NameError: undefined local variable or method `null' for main:Object
<shevy> where from does nULL come...
<davidcelis> what is this, #c ?
<lupine_85> oh dear...
<Eiam> davidcelis: katya^ be trollin
<shevy> yeah
<katya^> i don't troll
<davidcelis> I know
<davidcelis> I am familiar with him
<Eiam> katya^: yeah, you are =)
<Eiam> davidcelis: her, apparently ?
<shevy> the troll says I am not trolling
<lupine_85> Mon_Ouie, it's so obviously a nonsense, I wonder why you think it's what I meant
<davidcelis> Eiam: Him, her, I don't care
<davidcelis> Obvious troll is obvious
<shevy> the thief shouts "catch the thief!", points at someone else, then steals a wallet
banisterfiend has joined #ruby
<Mon_Ouie> lupine_85: I'm not sure what you think I meant, in fact
<shevy> I think lupine_85 is friend of katya^
<davidcelis> >> NULL = nil #=> nil
<davidcelis> >> NULL.nil? #=> true
<davidcelis> Problem solved, bitches
<davidcelis> Now GTFO my internet
<Eiam> hahah
<shevy> cool
<shevy> now ruby has NULL
<shevy> and everyone will ask
<pangur> I do not know how to do pp chosen
<shevy> "Why does ruby have nil and NULL?"
<katya^> you're "familiar" with me? excuse me?
<Eiam> katya^: yeah, that one night
<shevy> pangur, top of your file: require 'pp'
<pangur> ah
<pangur> thanks
<davidcelis> katya^: You were in #rubyonrails earlier
<shevy> katya^, they know you from other channels like c#
<davidcelis> katya^: I do not have short-term memory loss so, yes, I remember you.
<katya^> that doesn't make you familiar with me
<lupine_85> shevy, afraid not
<rexantony> the ruby programming language is january 2008, and for you is more updated book for ruby ?
<Eiam> i just figured out how to improve my experience, ignore wooo
<Eiam> rexantony: i just mentioned one
<lupine_85> my point was simply that the value of the C constant NULL would not evaluate to nil in a Ruby context
<katya^> you don't know me or who I am, and it's going to stay that way because I have no desire to get to know you
<shevy> rexantony you could try the latest pickaxe... it is not one of the best books ever, but it is somewhat ok
<davidcelis> Glad we're understood.
<shevy> katya^ where do you live?
<davidcelis> Is there a reason you're still here, other than bitching about the language?
<davidcelis> apeiros_: Ping?
KL-7 has joined #ruby
<katya^> i'm not bitching
<shevy> indeed
<shevy> he is just trolling
<canton7> katya^, I'm familiar with some of the regulars here. That doesn't mean that I know them personally, just that I recognise them and I know whether they're helpful, etc
davidpk has joined #ruby
<davidcelis> shevy: True, my mistake. The bitching was in #rubyonrails
<shevy> katya^ never helped anyone
<katya^> that's not familiarity, thats recognition
<Eiam> now the conversation is geting weird because i only see half of it
<davidcelis> And that's why (s)he was banned
<shevy> he
<davidcelis> I try not to assume
hashpuppy has quit [#ruby]
<davidcelis> katya^: Actually, a synonym of "familiarity" is "awareness of"
<katya^> you're not aware of me
<davidcelis> So the word familiarity still works in this context.
kaneda__ has joined #ruby
<davidcelis> I am indeed aware of your existence.
<canton7> familiar (adjective): "1. commonly or generally known or seen: a familiar sight. "
<katya^> that's not the same thing
machine2 has joined #ruby
<davidcelis> English is ambiguous. Deal with it.
<katya^> aware of my existence and aware of my person are distinct concepts
<pangur> It seems that I have chosen is coming out as "1\n" :)
<canton7> heh, I'm familiar with my keyboard. Doesn't mean that I know it personally
maletor has joined #ruby
<davidcelis> pangur: Are you getting it with "gets" or something?
<canton7> Indeed, English isn't defined anywhere. Make of it what you will :)
<katya^> sure you do, you've dug your fingers into its every crevice
<pangur> yes, I am davidcelis
<katya^> you're pretty well acquainted i'd say
<davidcelis> pangur: Yeah, $stdin will capture that "enter" key as a linebreak with gets
<davidcelis> pangur: If you don't want that \n, strip all input you receive via gets
<pangur> ok thanks, davidcelis
<davidcelis> Okay, but seriously, this is #ruby, not #english. This is a pointless conversation
<Eiam> welcome to 10 minutes ago
<canton7> Yeah, I'm just procrastinating. I'll get back on topic :P
<shevy> yeah gets and chomp too ... I usually like to put in $stdin before that as well... $stdin.gets.chomp
<katya^> you're right, we should be speaking in french
nilg has joined #ruby
eeadc has joined #ruby
<shevy> can we send katya^ back to #rubyonrails please?
<katya^> they decided that they couldn't stand to hear about how poor the reference manual is
<katya^> so no
rking has joined #ruby
mxweas_ has joined #ruby
<davidcelis> shevy: Like I said, banned. For obvious reasons
stkowski has joined #ruby
<shevy> yeah but I think it would be better if he would be banned here, and could go back to #rubyonrails... :>
FACEFOX has joined #ruby
<shevy> katya^, at least go and learn ruby ok?
<katya^> maybe one day
bbttxu has joined #ruby
<davidcelis> Putting him/her on your ignore list is a mere 10 keystrokes away
<davidcelis> 11 if you include the enter key
<shevy> I never used ignore
deobald has joined #ruby
<katya^> feel free to do so, I don't care if you read my lines of text or not, personally
n3m has joined #ruby
<shevy> I like you too much katya^
c0rn has joined #ruby
axl_ has joined #ruby
madmax_ has joined #ruby
nfluxx has joined #ruby
tewecske has joined #ruby
h4mz1d has joined #ruby
headius has joined #ruby
rking_ has joined #ruby
* pangur is updating his gems
shruggar has joined #ruby
roz-monokeros has joined #ruby
headius_ has joined #ruby
timonv has joined #ruby
nuba has joined #ruby
ryannielson has quit [#ruby]
eignerchris has joined #ruby
tatsuya_o has joined #ruby
dfamorato has joined #ruby
Kyle__ has joined #ruby
<Kyle__> if you have an instance of a class, x, and you run y=x.clone, _should_ member functions run on y affect data in x?
shadoi has joined #ruby
<gogiel> kevinbond: that's a question?
<Mon_Ouie> Kyle__: No. It could though, if the copy method wasn't implemented correctly.
<Kyle__> Mon_Ouie: You need to implment a copy method for .clone?
<Kyle__> s/implment/implement/
<Mon_Ouie> There's default implementation that may or may not be enough for your purpose
noyb has joined #ruby
snip_it has joined #ruby
kvirani has joined #ruby
<Kyle__> hum. The data in question here is stored in arrays of arrays. I thought the default would be enough....
<Kyle__> When is it not enough?
<Mon_Ouie> It copies the ivars, but not the objects referenced by the ivars
<gogiel> afaik it's not enough for arrays
savage-_ has joined #ruby
kirun has joined #ruby
<Mon_Ouie> So if you're going to mutate the object referenced by an ivar, you should copy it explicitly in #initialize_copy
glosoli has quit ["Leaving"]
<Kyle__> OK. Well that explains my confusion then.
Axsuul has joined #ruby
<canton7> looks like it's enough for 1D arrays, but doesn't clone each of the sub-arrays
yelvert has joined #ruby
kvirani has joined #ruby
<canton7> am I missing something, or is it fairly easy to do something like this: http://pastie.org/3782488 ?
tatsuya_o has joined #ruby
madmax_ has joined #ruby
<lectrick> As far as caching goes, is it always better to use key based cache expiration coupled with a cache store that garbage collects the least recently accessed data?
savage-__ has joined #ruby
<canton7> actually, that would fall over on hashes
<Mon_Ouie> https://gist.github.com/2379602 here's the thing about copy
<katya^> i've decided that I've figured out that which most characterizes freenode users
<Mon_Ouie> canton7: What you are referring to is most likely Array#dup
<Kyle__> canton7: I'm using some heavily nested arrays so, yea. makes sense.
<katya^> it's like a colony inhabited entirely by Sheldon Coopers
<Mon_Ouie> Which also is a shallow copy, i.e. it copies the content of the array, but doesn't create a copy of each individual elements
<Kyle__> katya^: I think many of us prefer to think of ourselves as lenords, amys or walowitz's fiance (whos name escapes me). Depending on their persuasion.
<katya^> maybe, but I don't see it that way
<katya^> too much aspergers
<Mon_Ouie> Kyle__: Bernadette, for the record
<katya^> don't mean anyone here in particular
<katya^> (that I know of)
<Kyle__> Mon_Ouie: Thank you. My head is too deep in my code right now to remember names :)
<Kyle__> back to the code..
Squarepy has joined #ruby
dbgster has joined #ruby
<Axsuul> Is there an alternative to open-uri. I discovered that open-uri doesn't handle redirects from http -> https
d34th4ck3r has joined #ruby
d3c has joined #ruby
<canton7> Axsuul, net/http? There's also a nice-looking rest-client gem hanging around
<Mon_Ouie> One that provides a method with the same API as IO.open, I doubt — But there are plenty of HTTP(s) gems, though
<Axsuul> canton7: do you mean HTTParty?
<canton7> Axsuul, I was thinking of https://github.com/archiloque/rest-client but it might be overkill
<Axsuul> canton7: ah thanks
nanderoo has quit [#ruby]
mohsin^ has quit [#ruby]
ryan0x2_ has joined #ruby
cconstantine has joined #ruby
lampe2 has joined #ruby
mxweas_ has joined #ruby
<lampe2> hey i wanne store content like a picture with some metatages in a database is mongodb there a good choice ?
<shadoi> mongodb was MADE for metatages.
<shadoi> like, omg.
<cconstantine> hey all, I'm trying to get rvm working on ubuntu 10.11. I've got rvm installed for single-user, and I can run 'rvm'. When I go into a project with a .rvmrc I keep getting a 'Unknown ruby interpreter version: '1.9.2'.' even though I have the ruby specified in the .rvmrc installed. Any ideas?
<lampe2> cconstantine, rvm use 1.9.x . the x for the 1.9 version u want to use
ablemike has joined #ruby
nkts has joined #ruby
<cconstantine> lampe2, no dice.
<lampe2> shadoi, the thing is i wanne store the picture too in the db
<shadoi> lampe2: the best database for binary data: filesystems.
<lampe2> cconstantine, no dice ????
<cconstantine> didn't work
<ablemike> Hi all, I am using the Net::SSH library to do some actions on a remote box. I could use some advice on my architecture here.
<cconstantine> well, the 'rvm use' worked, but I'm still getting that error
<lampe2> what are you getting when you type: ruby -v ? cconstantine
<nkts> Hi, I have this problem: http://p.nkts.lt/f5b6a32b8db5ee744c28ccff95f2bb35 -- ruby is not checking gems directory for mysql2 gem. Linux distro - Fedora 16, mysql2 gem installed manualy: gem install mysql2 without any errors. Any idea?
<ablemike> We are using a gem to poll a service and want to proxy this request through Net::SSH
<cconstantine> lampe2, odd, I appear to get the right ruby version
<lampe2> shadoi, what i wanne do is make like a metadata base for every object like text,video,pic,sound etc etc
<ablemike> Is this something that feels achievable?
<davidcelis> nkts: Try require 'mysql'
<Mon_Ouie> nkts: You didn't require rubygems
<Mon_Ouie> You need to require it for gem directories to be looked up as well
<shadoi> nkts: prior to 1.9.x you have to explicitly require rubygems
<lampe2> cconstantine, when you type rvm list is there the version shown that you wanne use for the project?
<shadoi> lampe2: it's just a bad idea.
<cconstantine> lampe2, yeah
<lampe2> cconstantine, have you installed all thing in what rvm requierments says?
<cconstantine> lampe2, in fact, if I do a `cat .rvmrc` it runs successfully
<lampe2> cconstantine, cat only shows whats in the .rvmrc file ;)
<cconstantine> notice the ticks
<Mon_Ouie> I'd just echo "rvm_project_rvmrc=0" >> ~/.rvmrc, but that's just me I guess
<lampe2> shadoi, so better save a link in the file the db?
<nkts> Mon_Ouie, shadoi: thanks
<cconstantine> when I cd into a directory with an .rvmrc does rvm just run that file?
delinquentme has joined #ruby
robotmay has joined #ruby
<delinquentme> anyone off hand know which operation if faster ? "asdf/ad/s".split('/')[0] == 'asdf' VRS "asdf/ad/s"[0..3] ?
mborromeo has joined #ruby
<shadoi> lampe2: yes
BeLucid has joined #ruby
<Mon_Ouie> Probably the later as it doesn't need to iterate over the whole string to find "/" or to create an array of substrings
<Mon_Ouie> latter*
<canton7> delinquentme, use the one that's clearest and best expresses your intent
burgestrand has joined #ruby
<shadoi> lampe2: there are certain reasons why you'd make it a requirement to store them in a K/V store like HDFS or S3/Swift or Riak.
seivan has joined #ruby
GuidovanPossum has joined #ruby
maletor has joined #ruby
<cconstantine> lampe2, weird, it's definately picking the right ruby, but I'm still getting that error
<shadoi> cconstantine: what's in the .rvmrc?
<cconstantine> rvm use --create 1.9.2-p290@kairos
<lampe2> hmm
<apeiros_> davidcelis: pong
<shadoi> I can't stand using .rvmrc files, no idea.
<cconstantine> shadoi, no idea why people use them, or why you have a problem with them?
<davidcelis> apeiros_: Things seem to have quieted down, actually
<lampe2> the thing is: i wanne make something like a course object with metadata but this object only hold refernce to other objects like chapter1 and chapter one holds only the refernce to maybe text1 with metadata and picture1 with metadata and so on
<apeiros_> davidcelis: I see
<shadoi> cconstantine: no idea why it doesn't work for you.
<apeiros_> fuck, I just slept for ~4h
<lampe2> cconstantine, i use rvm but not .rvmrc :) i use for all my projects ruby 1.9.2
<Mon_Ouie> I find that making RVM switch ruby version when I cd into a directory is intrusive
<shadoi> cconstantine: though it does look like you're doing 2 things at once with that command
<Mon_Ouie> (Hence I disable that feature)
<shadoi> agreed.
<shadoi> I saw one that added something to your prompt if you aren't using the right ruby version for the project, which wasn't too intrustive.
<shadoi> But it required everyone use bash.
<apeiros_> at work, it's quite useful
<cconstantine> zsh :)
<apeiros_> (different projects running with different rubies)
<shadoi> mostly I think they're just intrusive and annoying for no good reason.
<shadoi> print out a warning in the code if it's not running with the right ruby version.
<cconstantine> so then how do you 'use' the .rvmrc if you don't have it auto-switch?
<lampe2> couchdb vs mongodb vs postgreSQL ?
<Mon_Ouie> I just ignore them, and switch ruby version if I must/want
<shadoi> lampe2: that's a very troll-y question. :)
<cconstantine> lampe2, no other information? postgres.
<lampe2> shadoi, i know...
<shevy> we need a shell that replaces zsh and bash
bglusman has joined #ruby
<shadoi> like a hole in the head
<apeiros_> oh yeah, hole in the head please. that's awesome!
<lampe2> my head hurts...
maletor has joined #ruby
iamjarvo has joined #ruby
<cconstantine> shevy: http://xkcd.com/927/
<shadoi> "yeah, but the 15th would be IN RUBY!"
<shevy> exactly
<cconstantine> *facepalm*
<lampe2> :D
<shadoi> shevy: just said it for you, I knew you were thinking it.
<cconstantine> oh wait.. #ruby channel... I mean yay ruby!
<shevy> yeah
<shevy> why would you want another shell in C?
<shadoi> yeah.. who gives a fuck about performance.
<lampe2> whats bad about zsh o0
<shevy> zsh is more complicated than bash
<mistergibson> is it C, or how it is implemented that hurts performance?
<shadoi> Shell on Rails
<lampe2> then use bash :D
<davidcelis> <3 zsh
<shevy> I think most linux users use bash
<any-key> Bash on Balls is a real web framework
<shadoi> yeah
<shevy> mistergibson dunno, ask shadoi why he thinks ruby is too slow for a shell
<lampe2> my headhurts.... i dont know which db to chose for a tree strcutre...
<shadoi> shevy: it can be fast enough
<shevy> I think what you would really need, to even remotely have any TINY chance to replace bash, would be to make a shell that would be so awesome that it would really make you... 300% more productive in it at least
ronniemlr has joined #ruby
<mistergibson> shadoi: is my understanding correct in that ruby does *not* consolidate free slots among heaps, and that heaps are *never* deallocated?
<shadoi> mistergibson: depends on the implementation, I think that's true for MRI
* apeiros_ would be happy with a shell that doesn't fail with color codes in the prompt
<shevy> something like ... pry + ruby-bash mixture ... hmm and I dont know what else...
<mistergibson> shadoi: ok ... slapping hand twitches
<apeiros_> may just be readline on OSX, though
<shadoi> shevy: yeah, pry is like 75% there.
<shadoi> I find myself staying it pry most times now and just using ".ls" and such
jankly has joined #ruby
<shevy> shadoi pry is cool, but it has no aim to replace bash... or zsh... and not even irb :(
<shevy> heeh
<cconstantine> lampe2, there are some tree dbs
<cconstantine> lampe2, look for a graph db
<cconstantine> lampe2, riak might be a good choice
<shevy> voice instructions would be nice
nu7hatch has joined #ruby
<eignerchris> lampe2: neo4j
<cconstantine> eignerchris, yeah, that's the one I was thinking
maletor has joined #ruby
<shevy> hmm
macmartine has joined #ruby
<lampe2> eignerchris, neo4j is writen in java and i hate java :D
<shevy> can you mac guys use voice instruction? like ... in textmate... you would not need to write anything, you could just speak what code you want to have
<davidcelis> dictation?
<eignerchris> shevy: i played with applescripts awhile back
<davidcelis> that would be tough for code, i think
sako has joined #ruby
<lampe2> let me read about riak :)
<eignerchris> to restart my server or run a migration
<shevy> I really have no idea, never used mac, never used voice instructions... but sometimes I am tired of hitting my keyboard with my fingers
<eignerchris> but ultimately i found the guard gem to be better for this
BeLucid has joined #ruby
<cconstantine> lampe2, yeah, riak is probably what you want then
<davidcelis> shevy: I mean I've used iOS dictation, but I can't imagine it working terribly well for writing code
<apeiros_> writing code has too many special signs, which is somewhat horrible unless your dictation software was actually aware of the language's syntax
<eignerchris> shevy: i think you could use it for keywords. "new class" that generates a new class with an initialize function stubbed out
starji has joined #ruby
<apeiros_> there's some video of somebody coding perl with dictation
<apeiros_> just horrible
Mohan has joined #ruby
Mohan has joined #ruby
<any-key> >.>
<eignerchris> shevy: but honestly typing "class\t" would be easier i'd think
<lampe2> cconstantine, github says that ripple thats a riak driver is failing to build !?
<apeiros_> it fails utterly due to all the "curly braces" etc. being inserted as text ("curly braces") instead of the sign ("{")
<eignerchris> shevy: do you use the textmate snippets at all?
<lampe2> oh theres a riak client o0
<cconstantine> lampe2, english?... you got it to work?
scwh has joined #ruby
Sailias has joined #ruby
pubis has joined #ruby
<lampe2> cconstantine, no iam looking for a riak driver for ruby
iocor has joined #ruby
<cconstantine> lampe2, so, I've never used riak :/
affix has joined #ruby
<shevy> eignerchris hmm no
<shevy> I think I'll need an editor in ruby first
<shevy> :)
<Mon_Ouie> …just to show you how easy it is… *struggles to type one line for 5 minutes*
<cconstantine> lampe2, that means the github head doens't build
<apeiros_> I think that "how easy" was sarcastic :)
<cconstantine> lampe2, the rubygems version builds for me
<eignerchris> shevy: check out the snippets. they do text expansion. you can eliminate a lot of cruft by just using those
Indian has joined #ruby
moshee has joined #ruby
andrewpthorp has joined #ruby
<eignerchris> shevy: voice recognition really isn't good enough to do what you're suggesting. and there are side effects as well...
<eignerchris> have to work in a quiet place
banisterfiend has joined #ruby
<eignerchris> forget listening to music except using earbuds. or working in a coffee shop. or pair programming
<eignerchris> you'll spend the majority of your time being frustrated with the voice recog software
looopy has joined #ruby
<shevy> eignerchris :(
<shevy> well it should filter my voice out of everything of course!
<shevy> I need to watch movies while speak-coding :P
hadees has joined #ruby
<lampe2> riak is really nice the cluster feature look great
<cconstantine> lampe2, yeah, I'm hoping to be able to use it one day
FACEFOX has joined #ruby
<shadoi> riak is awesome until you have to learn erlang.
<shadoi> then you waste a month.
FACEFOX has joined #ruby
ephemerian has joined #ruby
<shevy> hehehe
<shevy> I admire erlang for thinking outside the box
artm has joined #ruby
<shevy> but I think the syntax is really terrible
<shadoi> for basic stuff though, it's really nice.
<shadoi> store this stuff, scale the cluster, very nice.
FACEFOX has joined #ruby
dzhulk has joined #ruby
FACEFOX has joined #ruby
workmad3 has joined #ruby
FACEFOX has joined #ruby
jasdeepjaitla has joined #ruby
FACEFOX has joined #ruby
jasdeepjaitla has quit [#ruby]
williamcotton_ has joined #ruby
<any-key> wow, rbcurse segfaults in 1.9.3
<any-key> maybe it's meant for 1.9.2
ceej has joined #ruby
FACEFOX has joined #ruby
bbttxu has joined #ruby
<waxjar> can someone help me remind the shorthand for a map? (the one with the & symbol)
deobald has joined #ruby
<any-key> &:
<shevy> .map(:&)
<shevy> argh
<any-key> whoops
<shevy> one way is right the other wrong
<waxjar> thanks
<shevy> I would not know which one it is right now ;-)
<any-key> my way is right
FACEFOX has joined #ruby
<shevy> is there a way to sort a hash, based on alphabet, its keys, but in ruby version 1.8.x
<shevy> but return a hash, not array
<any-key> never use "sort" and "hash" in the same sentence ever again
<cconstantine> any-key: "I want the hashes of a set of files sorted"
<TTilus> shevy: have separate keylist, sort it, iterate it and get values from hash
* cconstantine thinks ruby's usage of the word 'hash' is wrong.
<any-key> yeah matz must have been smoking hash when he thought of it
<shevy> my hash looks like:
<QKO> what is hash being used for?
<shevy> "keyboard"=>"inputkeyboard",
<shevy> "evd"=>"inputevdev",
<cconstantine> it uses hashes internaly I bet
<TTilus> cconstantine: think about it molre carefully, it aint
savage- has joined #ruby
<shevy> makes me crazy that it is not alphabetical
<any-key> shevy: are you trolling?
<shevy> any-key no
<shevy> any-key are you trying to help?
<TTilus> i guess hes not
<any-key> shevy: hashes are unordered data structures
<TTilus> shevy: dont use core hsh if you wanna sort
<mistergibson> any-key: or move up to 1.9.2 where they are ordered
<cconstantine> any-key, hashes are functions, frequently used to implement maps (aka dicts, aka associations)
<shevy> my good old 1.8.x! :(
<mistergibson> I left 1.8.7 for many reasons
<TTilus> cook your own SortedHash or rip from somewhere
<shevy> TTilus, there is some SortedHash thingy?
<apeiros_> shevy: it's old. it was good. it no longer is. stop living in the past :-p
<any-key> cconstantine: we should just call them dictionaries
<apeiros_> TTilus: Sorted != Ordered
<shevy> apeiros_, yeah... it's getting harder and harder every day... 2 months left, then I have no other choice
<TTilus> shevy: go google, dont remember if it was in activesupport or whatnot
<any-key> you can't sort soemthing that has no order
looopy has joined #ruby
<apeiros_> sorting is a special case of ordering
<apeiros_> it's the order where every subsequent item is bigger|smaller than the previous
<TTilus> apeiros_: good point
tvw has joined #ruby
<cconstantine> wow, it's pedant land in here all of a sudden. I love it.
<shadoi> that's nothing, a real pedant would point on the differences in the algorithms and rant about bubbles vs. blah blah blah
dnyy has joined #ruby
<shadoi> point out*
<any-key> wow, rbcurse only works with 1.9.2 :(
<apeiros_> cconstantine: while I am a pedant (proudly so :-p), I don't think pointing out the difference between sorted and ordered is being pedantic
<apeiros_> naming a merely ordered structure 'sorted' is simply wrong.
jfelchner has joined #ruby
<shevy> TTilus hmm can't find something useful with google, I think I am going to create a SortedHash class
<TTilus> shevy: apeiros_ corrected, its OrderedHash
<TTilus> shadoi: shevy needed that
<shadoi> shevy: ^^
<shevy> yeah I think that is the solution, I'll just fancy up in alphabetical list
<shevy> thanks
<apeiros_> you can use h.replace(h.sort) if you need it in-place
<apeiros_> arrr
<apeiros_> +Hash[]
<any-key> &:
benyarb has joined #ruby
td123 has joined #ruby
eywu has joined #ruby
samsonjs has joined #ruby
stephenjudkins has joined #ruby
<any-key> wow, rbcurses is buggy
<any-key> this is disheartening
Helius has joined #ruby
GuidovanPossum has joined #ruby
Floydzy has joined #ruby
niku4i has joined #ruby
nerdy_ has joined #ruby
SullX has joined #ruby
tatsuya_o has joined #ruby
llyly has joined #ruby
wefawa has joined #ruby
savage- has joined #ruby
hackingoff has joined #ruby
workmad3 has joined #ruby
mborromeo has joined #ruby
RORgasm has joined #ruby
Russell^^ has joined #ruby
sroy2 has joined #ruby
survili has joined #ruby
<survili> Hi all, noob question. What does '%' do in this context? t = "some text %s."
<apeiros_> nothing. it's part of the string.
<survili> t % 'person'
<survili> I mean here in t %
<survili> what does it do ?
<apeiros_> aha. survili, t being a string, you can find the method docs under String#%
<survili> % is a method of string ?
<apeiros_> it's sprintf, with the receiver being the first arg
<apeiros_> survili: no, % is *a method*
xcvd has joined #ruby
<apeiros_> and you're calling the method on a string
<apeiros_> numeric classes implement % too, but there it's modulo
benyarb has joined #ruby
<survili> thanks guys, i found it in rdoc
heftig has joined #ruby
eph3meral has joined #ruby
lewis has joined #ruby
cjs226 has joined #ruby
d34th4ck3r has joined #ruby
krusty_ar has joined #ruby
nfluxx has joined #ruby
mxweas_ has joined #ruby
Sound has joined #ruby
looopy has joined #ruby
Sound has quit [#ruby]
siefca has joined #ruby
mborromeo has joined #ruby
williamcotton_ has joined #ruby
fayimora has joined #ruby
stephenjudkins has joined #ruby
williamcotton has joined #ruby
frishi has joined #ruby
scwh has joined #ruby
deobald has joined #ruby
gregorg has joined #ruby
gregorg has joined #ruby
wefawa has quit [#ruby]
atmosx has joined #ruby
MasterIdler_ has joined #ruby
noyb has joined #ruby
siefca has quit [#ruby]
antillas21 has joined #ruby
shajen_ has joined #ruby
_main_ has joined #ruby
manuel- has joined #ruby
cjs226 has joined #ruby
SullX has joined #ruby
Bish has joined #ruby
bawer has joined #ruby
tommyvyo has joined #ruby
y3llow_ has joined #ruby
FACEFOX has joined #ruby
_main_ has joined #ruby
Karmaon has joined #ruby
JodaZ_ has joined #ruby
dubios_ has joined #ruby
shikamaru has joined #ruby
CharlieS1 has joined #ruby
eywu1 has joined #ruby
nuba_ has joined #ruby
y3llow_ has joined #ruby
Natch has joined #ruby
frankaa112 has joined #ruby
Koshian_____ has joined #ruby
Drakx_ has joined #ruby
_musee has joined #ruby
x0F_ has joined #ruby
mfridh_ has joined #ruby
gregorg_taf has joined #ruby
cola_zero_ has joined #ruby
babinho_ has joined #ruby
examancr has joined #ruby
mmokrysz has joined #ruby
nicksmit1 has joined #ruby
qos has joined #ruby
y3llow_ has joined #ruby
jankly has joined #ruby
<any-key> are there any other ruby ncurses packages besides curses and rbcurses?
pakl_ has joined #ruby
klipeto has joined #ruby
deobald has joined #ruby
mmokrysz has quit [#ruby]
arkx_ has joined #ruby
<banisterfiend> any-key: what's wrong with rbcurses
dkr_ has joined #ruby
apeiros_ has joined #ruby
<any-key> it doesn't work
dubios has joined #ruby
<banisterfiend> any-key: what OS are you on?
<any-key> I get segfaults under 1.9.3, and under 1.9.2 it won't display text
vitorave` has joined #ruby
<any-key> banisterfiend: OS X
<banisterfiend> any-key: hmm, well it works fine for me
<any-key> could it be my version of ncurses?
<any-key> :(
<luckyruby> https://gist.github.com/2380719 Running into an issue install json gem on Solaris
makkura_ has joined #ruby
<luckyruby> sh: /opt/SUNWspro/bin/cc: not found
<any-key> banisterfiend: what version of ruby are you running?
<any-key> banisterfiend: and do you know what version of curses you're using?
nikis_ has joined #ruby
albemuth_ has joined #ruby
y3llow_ has joined #ruby
thick_mcrunfast has joined #ruby
Osek_ has joined #ruby
cjk101011 has joined #ruby
kfoo_ has joined #ruby
udk has joined #ruby
y3llow_ has joined #ruby
ziyadb has joined #ruby
froy has joined #ruby
nu7hatch has joined #ruby
ben_alman has joined #ruby
fayimora has joined #ruby
nu7hatch has quit [#ruby]
y3llow has joined #ruby
machine2 has joined #ruby
y3llow has joined #ruby
josephwilk has joined #ruby
nfluxx has joined #ruby
Caius has joined #ruby
77CAAPM16 has joined #ruby
Caius has joined #ruby
FACEFOX has joined #ruby
y3llow has joined #ruby
etank has joined #ruby
batmanian has joined #ruby
y3llow has joined #ruby
cynosure has joined #ruby
batmanian has joined #ruby
y3llow has joined #ruby
KL-7 has joined #ruby
baroquebobcat has joined #ruby
y3llow has joined #ruby
workmad3 has joined #ruby
y3llow has joined #ruby
asobrasil has quit [#ruby]
iocor has joined #ruby
snip_it has joined #ruby
y3llow has joined #ruby
y3llow has joined #ruby
kvirani has joined #ruby
albemuth has joined #ruby
london_guy has joined #ruby
lucasefe has joined #ruby
y3llow has joined #ruby
eignerchris has joined #ruby
pubis has joined #ruby
y3llow has joined #ruby
y3llow has joined #ruby
seanstickle has joined #ruby
<rking> Anyone have a working vim equalprg?
y3llow has joined #ruby
senthil has joined #ruby
<any-key> equalprg?
y3llow has joined #ruby
fixl has joined #ruby
<shevy> any-key equalprgggggggg!
<shevy> any-key, are you on github btw?
<any-key> yes
y3llow has joined #ruby
<shevy> where!
<any-key> github.com/eric-wood
albemuth has joined #ruby
y3llow has joined #ruby
hadees has joined #ruby
<shevy> cool
y3llow has joined #ruby
tatsuya_o has joined #ruby
Mohan has joined #ruby
Mohan has joined #ruby
y3llow has joined #ruby
y3llow has joined #ruby