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
Jake232 has joined #ruby
hse-hoens has joined #ruby
<bikcmp> apeiros_: ick
neohunter has joined #ruby
<bikcmp> apeiros_: didn't get a highlight
<bikcmp> sorry, thanks much
neohunter has joined #ruby
<Spaceghostc2c> bikcmp: I didn't know you ruby.
<frishi> hi guys, sorry to interrupt and be off-topic, but whats the command to get help on nickserv. I cant get into #rubyonrails and need to register
<davidcelis> lol
<davidcelis> frishi: /ns help
<frishi> thanks!
<banisterfiend> davidcelis: u srs?
<davidcelis> banisterfiend: hi
<banisterfiend> davidcelis: that's just an alias on your irc client, surely
<banisterfiend> '/ns' is not going to be a built-in, esp. when many irc servers dont even have a 'nickserv'
<davidcelis> banisterfiend: /ns has worked on freenode for every client i've tried
<banisterfiend> i would have though anyway
<banisterfiend> thought*
<banisterfiend> frishi: use /msg nickserv help
<banisterfiend> if /ns doesnt work for u
<frishi> /msg nickserv help
<frishi> uh oh
<banisterfiend> lol
<zandt> frishi, to be safe, don't type that in a chat window
<frishi> thanks much though, I got in
<zandt> use the status window
<zandt> ah okay
<zandt> congrats
<frishi> got it, apologies.
<zandt> didn't want you blasting your password :P
phantomfakeBNC has joined #ruby
<bikcmp> Spaceghostc2c: i ruby?
<bikcmp> :P
<Spaceghostc2c> bikcmp: It's a verb. Do you ruby? I just rubied.
<bikcmp> sounds dirty
<Spaceghostc2c> It kind of is. Guilty pleasure.
<bikcmp> Spaceghostc2c: i ruby on occasion, but i prefer to snake a bit :P
<Spaceghostc2c> bikcmp: At least you use both. Admirable, sir.
<bikcmp> Spaceghostc2c: i use a ton of stuff
<bikcmp> most of which i hate
<bikcmp> but
<bikcmp> :P
<Spaceghostc2c> Fear is the path to the dark side. Fear leads to anger. Anger leads to hate. Hate leads to suffering.
<Spaceghostc2c> Just make sure it's not you who is suffering.
malkomalko has joined #ruby
<bikcmp> Spaceghostc2c: i actually have a neat project involving a bunch of languages
<bikcmp> pm?
<Spaceghostc2c> You're a friend, you're always welcome to query.
slackX has joined #ruby
CheeToS has joined #ruby
Guest23751 has joined #ruby
nikhgupta has joined #ruby
lkba has joined #ruby
jrhorn424 has joined #ruby
shevy has joined #ruby
hse-hoens has joined #ruby
Guest23751 has joined #ruby
KitsuneDrag0n has joined #ruby
hse-hoens has joined #ruby
ringotwo has joined #ruby
Beoran_ has joined #ruby
conor_ireland has joined #ruby
keymone has joined #ruby
jmazzi_ has joined #ruby
Guest23751 has joined #ruby
amesha has joined #ruby
hse-hoens has joined #ruby
Nathandim has joined #ruby
Guest23751 has joined #ruby
robkinyon has joined #ruby
neohunter has joined #ruby
swarley has joined #ruby
robkinyon has joined #ruby
amesha has joined #ruby
hse-hoens has joined #ruby
cobragoat has joined #ruby
cobragoat has joined #ruby
tomzx has joined #ruby
archivebot has joined #ruby
ZachBeta has joined #ruby
cobragoat has joined #ruby
baroquebobcat has joined #ruby
aef has joined #ruby
baroquebobcat has joined #ruby
Guest23751 has joined #ruby
amesha has joined #ruby
hse-hoens has joined #ruby
amesha has joined #ruby
Guest23751 has joined #ruby
<delinquentme_> if ive got a open source project which I've bundled into a gem
<delinquentme_> and I want to get system output when I hit a particular line of code
<delinquentme_> i THINK I want log = Logger.new() log.error 'HITS"
<delinquentme_> right?
<gogiel> delinquentme_: wha'ts system output? stderr?
neohunter has joined #ruby
fbernier has joined #ruby
kuzushi has joined #ruby
hse-hoens has joined #ruby
c0rn has joined #ruby
virunga has joined #ruby
phaedrix has joined #ruby
neohunter has quit ["Linkinus - http://linkinus.com"]
amesha has joined #ruby
pen has joined #ruby
jonteru has joined #ruby
Guest23751 has joined #ruby
amesha has joined #ruby
CheeToS has joined #ruby
Mchl has joined #ruby
amesha has joined #ruby
Progster has joined #ruby
zz_skinny_much has joined #ruby
sacarlson has joined #ruby
amesha has joined #ruby
hse-hoens has joined #ruby
Karmaon has joined #ruby
amesha has joined #ruby
td123 has joined #ruby
elepfont has joined #ruby
ellisdee has joined #ruby
amesha has joined #ruby
shtirlic_ has joined #ruby
goodiebo_ has joined #ruby
Asebolka has joined #ruby
dbgster has joined #ruby
igotnolegs has joined #ruby
goodieboy has joined #ruby
TakamachiNanoha has joined #ruby
DrShoggoth has joined #ruby
zakwilson has joined #ruby
bglusman has joined #ruby
Tearan_ has joined #ruby
AndChat| has joined #ruby
Spring_MT has joined #ruby
ryannielson has joined #ruby
ipoval has joined #ruby
<swarley> [9] pry(main)> Chemistry.to_formula 'SO4-3'
<swarley> => "SO₄³⁻"
Guest23751 has joined #ruby
ipoval has quit [#ruby]
superguenter has joined #ruby
sam113101 has joined #ruby
genexp has quit [#ruby]
hse-hoens has joined #ruby
baroquebobcat has joined #ruby
CannedCorn has joined #ruby
Vert has joined #ruby
daniel_hinojosa1 has joined #ruby
Guest23751 has joined #ruby
andrewhl has joined #ruby
looopy has joined #ruby
tuxaddicted has joined #ruby
bikcmp has quit [#ruby]
KillerFox has joined #ruby
andrewhl has quit [#ruby]
andrewhl has joined #ruby
Guest23751 has joined #ruby
emmanuelux has joined #ruby
CaseFlatline has joined #ruby
philcrissman has joined #ruby
dhruvasagar has joined #ruby
CannedCorn has joined #ruby
Tearan has joined #ruby
jesly has joined #ruby
radic_ has joined #ruby
gabeh has joined #ruby
Banistergalaxy has joined #ruby
yoklov has joined #ruby
gabeh has joined #ruby
Nisstyre has joined #ruby
maahes has joined #ruby
<maahes> I'm getting a strangeish error, the rvm website says 'add rvm to your path with this: PATH=$PATH:$HOME/.rvm/bin [[ -s "$HOME/.rvm/scripts/rvm]] && . "$HOME/.rvm/scripts/rvm" but I now get this weird error: string not in pwd: ../
eko has joined #ruby
eko has joined #ruby
eko has joined #ruby
<shevy> swarley what is that?
<swarley> what i pasted/
<swarley> oh it was something i made
<swarley> it was the polyatomic ion sulphate
<swarley> was the output at least
<shevy> swarley do you have that on github?
<swarley> no i dont, would you like me to add it?
<shevy> yeah
<swarley> sure thing
<shevy> cool thanks
<swarley> right now it only works for formulas
<swarley> i'll be adding equations
<swarley> and various calculations etc
<shevy> I think the only thing similar I did was a while ago calculating total sum of a molecule, in atomic mass units
<swarley> yeah i made a program to calculate molar mass in TIBasic
<swarley> lol
<shevy> what is TIBasic? a variant of Basic?
[[thufir]] has joined #ruby
gabeh has joined #ruby
<swarley> shevy, its the programming language for the TI calculators
<swarley> lol
<swarley> also
a_a_g has joined #ruby
zandt has joined #ruby
<shevy> program_information.rb:145: warning: character class has duplicated range: /(.*)-([\d\.\w]+)/
<shevy> ruby 1.9.x is odd
<swarley> what?
<swarley> lol
<shevy> it gives me a warning that I use the same regex twice
<swarley> lol
<swarley> i dont see the point of assigning a name to a simple pattern if you use it less than 4 times
<shevy> this is so much unfun to port code to 1.9.x ... :(
<swarley> :[
<shevy> base.rb:1036: warning: assigned but unused variable - stdout
<swarley> i came into 1.9.1 so i havnt had a single issue :D
<swarley> lolwut
<shevy> I wrote that because I thought to myself "Hmm one day me want to reassign the streams here"
cpruitt has joined #ruby
<swarley> lol
<swarley> they just comment it out
<swarley> then*
<shevy> and now ruby is basically telling me "Nope. Either you do something with that variable, or else I warn you."
<shevy> yeah swarley but the point is
<shevy> ruby is forcing me to rethink even when it should not matter
<shevy> and i always have warnings on in 1.8.x
<shevy> ah well
<swarley> i guess its just suggesting a way to increase efficiency?
<shevy> I dunno, I think the warnings in ruby are not really great
<swarley> since that seems to be the major goal of the dev team
banisterfiend has joined #ruby
<shevy> in case/when it is saying "duplicated when clause at line 15" but at line 15, there is nothing duplicated
<swarley> i've noticed that
<swarley> that the line numberings are off
<swarley> occasionally
<shevy> I even reported the last one, no idea if they worked on to improve it
ipoval has joined #ruby
<shevy> for me they never were correct, but the case when structure was 1250 lines long :)
blueadept has joined #ruby
<swarley> LOL
<swarley> what was its purpose?
<swarley> i dont think i've ever gotten a warning actually
<shevy> swarley it just mapped shortcuts to file locations
<shevy> for instance:
<shevy> :sitemap became 'misc/sitemap.cgi'
<swarley> oh
<swarley> it seems like a hash would be better
<shevy> :test_file to 'some/silly/long/path/test.txt'
<shevy> swarley, how do you use aliases in a hash?
<swarley> shortcut[:sitemap] == 'misc/sitemap.cgi'
<shevy> :map would also become 'misc/sitemap.cgi'
<shevy> aha and via :map?
<swarley> i guess the case when could be better
<swarley> but i would still personally use a hash
<swarley> or a struct
iamjarvo has joined #ruby
mmercer has joined #ruby
seitensei has joined #ruby
blueadept` has joined #ruby
<swarley> im so lame
<swarley> i created a stupid free mason cipher because i saw it in the davinci code
<swarley> errr
<swarley> the lost symbol
<zandt> :lost
gen0cide_ has joined #ruby
<swarley> xD
<zandt> heh
<shevy> :found
<zandt> :D
zakwilson has joined #ruby
<shevy> oh
<shevy> you are right zandt
<shevy> :D is also a symbol
<shevy> I think ruby must be one of the few programming languages where emoticons are valid code
<zandt> haha
<zandt> indeed!
<shevy> man
<shevy> I had an idea
<shevy> we could combine :D and :P with the new -> operator
<shevy> to do something useful
<shevy> I have no idea what, but still
<zandt> sounds like a plan to me
<zandt> I like your style
<banisterfiend> shevy: i have a better idea: let's hold hands and go and look at a lake
<shevy> that sounds too gay
<zandt> or not gay enough
<zandt> think about that.
<shevy> you try the gay way, i try to anime way
lewix has joined #ruby
lewix has joined #ruby
<shevy> zandt, he is just setting up a circle, dont you realize :P
<shevy> hmm :d is valid too
JodaZ has joined #ruby
<shevy> :o
<shevy> a nose!
<banisterfiend> shevy: how's things anyway
<shevy> no sad smiley is valid though
<JodaZ> i am on debian squeeze and ruby can't find the gems i installed with "gems install", anyone know how i can fix that ?
<shevy> JodaZ, debian hates ruby
rippa has joined #ruby
<JodaZ> what a coincidence, me too
<swarley> well then
<JodaZ> anyways, how do i fix that ?
<swarley> i seems like if you hate it then you should leave it alone :[
<shevy> isn't that a problem because... ;)
<JodaZ> gems end up in /var/lib/gems/1.8/gems
<swarley> JodaZ, whats the ruby version?
<shevy> debian fucks up ruby so it should be their responsibility to clean up their shit
<JodaZ> swarley, ruby 1.8.7
<swarley> why..
<zandt> 1.8 is your problem. that's in my distros as well
<swarley> you'll need to require 'rubygems'
<swarley> or
<swarley> do the better thing
<swarley> and use 1.91
<zandt> ^
<swarley> 1.9.1*
<JodaZ> any way to have that done by default for all invocations of ruby ?
<swarley> yes
<shevy> swarley, /var/lib/gems/1.8/gems is still the wrong path though
fayimora has joined #ruby
<shevy> debian insists on bending ruby
<swarley> ruby -rrubygems
<shevy> JodaZ, swarley can you two paste "gem env" output on pastie.org or somewhere else please? i want to compare curiously
fayimora has joined #ruby
<zandt> I feel left out
<shevy> zandt sorry :(
<zandt> :(
<zandt> swarley, what OS?
<shevy> I'll include you specifically next time banister and me go ... uhm... to a lake
<shevy> :>
<zandt> ha ha
<zandt> no thanks!
<shevy> hehe
<banisterfiend> shevy: can u yodel
<swarley> Linux ubuntu 3.0.0-16-generic #29-Ubuntu SMP Tue Feb 14 12:48:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
<shevy> banisterfiend no :( real yodeling ain't easy at all
<zandt> swarley, what ver of ruby is in your repo ?
<shevy> I think you need mountains for that too
<shevy> JodaZ see JodaZ everything is different in the way debian sets up ruby, if you compare the paths to my paths or to swarley's path
<shevy> hmm
<shevy> JodaZ you should however try to update rubygems version
<shevy> 1.3.7 seems very old
<shevy> when i install a .gem file, a copy will reside in directory: /usr/lib/ruby/gems/1.8/cache/
<shevy> dunno where that is on debian
<zandt> shevy, if I install from the repos (ubuntu 10.04) it'll mess up the paths too
<shevy> yeah well
<zandt> it's really nasty :>
<zandt> that's why I was trying to get info outta swarley
<shevy> my method is to tell people to kill all of debian ruby and compile ruby by yourself
<zandt> ^
<zandt> that's what I did
superguenter has joined #ruby
<shevy> but I dont understand it, there must be a way on debian to update to new ruby versions or?
<zandt> not that I'm aware of
<shevy> odd
<zandt> I suppose you could get .deb files
<zandt> but that's a dependency nightmare
<zandt> way more complex than just compiling
<shevy> really?
<shevy> I want this to work:
<shevy> apt-get ruby-1.9.3
<shevy> oh
<shevy> I forgot "install"
<shevy> apt-get install ruby-1.9.3
<zandt> if you have a repo in your list that has it, sure
<shevy> hmm that reminds me
tk___ has joined #ruby
<shevy> - INSTALLATION DIRECTORY: /var/lib/gems/1.8 JodaZ in that directory, is there a cache/ directory?
<shevy> via "gem list" you can list the locally installed gems
<JodaZ> shevy, yes
<shevy> and if you downloaded a .gem file you can install via "gem install name-of-it.gem" too, and then "gem list" should show that one
<JodaZ> yes
<shevy> that debian uses /var/lib/gems/1.8 as path, perhaps that confuses rubygems. dunno if there is a commandline to specify something else, for me everything works as is when I use the default directory /usr/lib/ruby/gems/1.8/
<JodaZ> require 'rubygems' works btw
<shevy> irb works too?
<shevy> try this, start irb. do 5+5, then press enter. then quit to leave, if that worked.
<shevy> then "gem install wirble", then "gem list", then if wirble shows up, start irb again and do 5+5 etc...
<shevy> the different should then be that you see colours
<shevy> *difference
* zandt tries that as well
<swarley> 1.9.1 requires rubygems by default and 1.8 does not
<shevy> wirble is cute
adeponte has joined #ruby
<shevy> I also use coderay for commandline colourizing ruby code
<swarley> i just use pry
<swarley> lol
<swarley> also
<shevy> cat tasks.rb | coderay -ruby
<shevy> we just need something like smalltalk squeak
<swarley> apt-get install ruby1.9.1-full
<shevy> why do they omit the - between ruby and 1.9.1 ?
<swarley> im not sure
noname has joined #ruby
<swarley> the executable is ruby1.9.1
<shevy> versioned binaries
<shevy> \o/
<zandt> they don't like the way word-word-word looks
<swarley> what sucks is
<zandt> I wish it were more complex than that
<swarley> i have gem
<zandt> but that's why
<swarley> and gem1.9.1
<shevy> lol
<shevy> yay! \o/
<swarley> no its awful
<shevy> I am sorry man but
<swarley> because if i use
<shevy> your pain delights me :)))
<swarley> ruby it uses gem
pgpkeys has joined #ruby
<zandt> if I didn't laugh I'd throw my computer out the window
<shevy> aah
<swarley> but if i specify version it wont work
<swarley> :[
<JodaZ> swarley, no colors
<shevy> but "gem" is just a symlink, right?
<shevy> pointing to gem1.9.1
<swarley> JodaZ, really just sudo apt-get install ruby1.9.1-full
<swarley> you shouldnt use 1.8 anyway
<JodaZ> don't really need it at the moment
<swarley> .
<swarley> you do
<shevy> JodaZ what is "gem list" saying?
<JodaZ> just wanted to run this one script once
<zandt> is the real instructions
<swarley> if you want to use anything recent
<JodaZ> *** LOCAL GEMS ***
<JodaZ> msgpack (0.4.6)
<JodaZ> wirble (0.1.3)
<zandt> I also had no color and googled it, now there's color
<shevy> ok, so it can find the installed wirble gem
<shevy> ah
<shevy> perhaps you would have to require wirble first in irb
<swarley> did you require rubygems
<swarley> im serious
<shevy> start irb again, do: require 'rubygems'; require 'wirble'
<swarley> get 1.9.1
<swarley> there is no reason not to
<JodaZ> shevy, no colors for that
<zandt> he may need to do the Wirble.init
<zandt> Wirble.colorize
<zandt> deal
<zandt> <---- had to
<zandt> in .irbrc
<JodaZ> yup, zandt, with that theres colors
<zandt> excellent
<zandt> I have no idea what that means, I'm sure shevy was going somewhere with this
yoklov has joined #ruby
<zandt> brb
<swarley> kk
<shevy> yeah
<swarley> he was just trying to see if it can find the gems i assume
<shevy> ok
<shevy> then we know that gems work
<swarley> its just blowing my mind
<shevy> now I kinda lost what else we have to do
<swarley> that you would choose to use 1.8
<shevy> swarley, help me out
<swarley> ruby -e "require 'rubygems'; puts require 'wirble'"
<swarley> try that
<swarley> although im assuming if irb can find it ruby can
<swarley> the thing is
<swarley> 1.9.1 doesnt require you to require 'rubygems'
<swarley> so most scripts wont have that
<swarley> which points us to
<swarley> UPDATING RUBY TO THE STANDARD
<shevy> but
<swarley> caps for emphasis
<shevy> he won't need ruby again after that one last script swarley
<shevy> it's like the common theme
<swarley> then just ruby -rubygems
<shevy> - your last job
<shevy> - your last kiss
<swarley> then just ruby -rrubygems
<swarley> *
<shevy> it's all in line
<shevy> it's making me kinda sad
<swarley> okay then just ruby -rrubygems
<swarley> thats all that can be done
<Boohbah> ruby -rubygems
<swarley> no
<swarley> -rrubygems
<swarley> thats the same as require 'rubygems' before the script
<zandt> back
<shevy> well it's the little trick
<shevy> there should be a file called ubygems.rb so -rubygems should work
<zandt> I hate to be that guy
<zandt> but swarley is right
<zandt> today it's a path problem
<zandt> tomorrow the gem you want doesn't function properly with 1.8
<shevy> he'll use ruby only once anyway :(
<swarley> :[
<zandt> :(
<shevy> JodaZ please give us some hope here... perhaps you will use ruby again in half a year?
<swarley> xD
<JodaZ> shevy, unlikely, lol
nikhil_ has joined #ruby
<zandt> what's your preferred lang? I must've missed it
<JodaZ> python currently
<shevy> python is good
<zandt> right on
<zandt> also a fan of python. don't let debian and debian based *nix evilness ruin future ruby endeavors
<shevy> some years ago i read a rant against debian by some python dev
<shevy> he wrote that debian repackages stdlib in such a way that a python dev can no longer expect things to work as they should
<zandt> I believe it. I use freebsd on my other machine, never run into the problems
<zandt> seems like it's daily on ubuntu
<Boohbah> i use arch linux and they provide an updated ruby
<zandt> updated ruby on an old release ?
<shevy> arch is good
<shevy> I have hope that one day debian will either adapt or perish
<shevy> http://distrowatch.com/ Debian 5, Arch 6
simpleharmonicmo has joined #ruby
kW_ has joined #ruby
SUICIDALcow has joined #ruby
SUICIDALcow has quit [#ruby]
bier has joined #ruby
gbgallardo has joined #ruby
Cache_Money has joined #ruby
aknewhope has joined #ruby
artm has joined #ruby
jesly has joined #ruby
ZachBeta has joined #ruby
superguenter has joined #ruby
superguenter has joined #ruby
bryricker has joined #ruby
<bryricker> Hello - is `if something == "this" || "that"` actually a problem? I always that that using the double-pipes made that okay.
<bryricker> It seems to still do it properly, just gives me a warning
<shevy> careful with warnings :P
elake has joined #ruby
ghvandoorn has joined #ruby
Karmaon has joined #ruby
<shadoi> bryricker: if something == "this" || something == "that"
<bryricker> Is there a way to do it shorter?
<Boohbah> the second is more readable, but is there actually a problem with parsing the first?
<bryricker> No - it does the logic fine, but of course I want to avoid warnings in the logs
alek_b has joined #ruby
sarmiena_ has joined #ruby
havenn has joined #ruby
x0F__ has joined #ruby
mxweas_ has joined #ruby
kelsier has joined #ruby
baroquebobcat has joined #ruby
robdodson has joined #ruby
baroquebobcat has joined #ruby
hooper has joined #ruby
swarley has joined #ruby
<robdodson> I'm trying to convert a CSV file to JSON but don't actually know wtf I'm doing :) Any insight into why this approach doesn't work and what I should do? http://pastebin.com/szJTRKPe
<Cache_Money> is /usr/share/dict/words a folder within Ruby?
<Cache_Money> I just ran this script (someone else produced) https://gist.github.com/2069501 that opens up a file on LIne 10, and it worked on my computer but I'm not sure why
shruggar has joined #ruby
<davidcelis> um, wut
<davidcelis> /usr/share/dict/words is your UNIX dictionary
<shevy> Cache_Money it is often easier to write your own code, rather than try to understand other people's code
<davidcelis> Cache_Money: dude stop fucking trying to cheat at Draw Something
<davidcelis> just play the game
<shevy> lol
<shevy> bryricker not sure for shorter ways. I tend to do this often:
<shevy> _ = something
<shevy> case _
<shevy> when 'this','that'
lewix has joined #ruby
lewix has joined #ruby
<shevy> call_some_method
<shevy> end
<shevy> and if you need it with the input you can always change this to:
<shevy> call_some_method(_)
<bryricker> shevy: I ended up doing this: %{ this that }.include? something
<bryricker> %w *
<davidcelis> bryricker: good for you
<bryricker> :)
<davidcelis> +1 to that
<shevy> yeah that is also short, I do that a lot too
robdodson has joined #ruby
<banisterfiend> davidcelis: what's up
<davidcelis> hi
<banisterfiend> davidcelis: dont u find it offensive when someone uses their real name on irc or a real photo of themselves on github? it provides a glimpse of the decaying bag of flesh behind the code, whereas all we care about is the code itself.
gianlucadv has joined #ruby
<davidcelis> ಠ_ಠ
<banisterfiend> davidcelis: especially sickening when you catch a good view of their eyes in their photographs, and you see all their 'hopes and dreams' written so stupidly on their faces
<davidcelis> you know flesh doesn't decay until it's dead, right
eldariof has joined #ruby
<banisterfiend> it's always already dying
<shevy> I think banister likes zombie movies
<davidcelis> dying != dead
<davidcelis> bro
<shevy> yeah the dying are in greater state of misery :(
<banisterfiend> davidcelis: you focusse on quite a trivial point of my fascinating monologue
<banisterfiend> :P
<davidcelis> yeah… fascinating...
tewecske has joined #ruby
<shevy> I seem to be stuck with my ruby fu
<davidcelis> shevy: GO ON……..
<shevy> as in, you know, not really learning anything *really* new anymore
<shevy> but I dont feel very wise :(
<shevy> davidcelis should I make a break with ruby for some weeks?
<banisterfiend> shevy: i can give you a difficult task to do, and if you solve it you'll probably be pretty awesome
<shevy> I dont think that works
<banisterfiend> shevy: you' learn a lot about the Method API
<shevy> I need some new dimension to think in
<banisterfiend> shevy: Yeah, the Method API opens up a new world
<banisterfiend> source_location, owner, receiver
ryan0x2 has joined #ruby
<banisterfiend> shevy: basically, write a show-class analog for pry's show-method ;)
<shevy> I only have about tricks collected worth only 20 lines of pry :(
<shevy> I am still very proud of Pry.config.prompt = proc
ap0gee has joined #ruby
<shevy> there must be some way to think and then become 20% more productive
<shevy> I need ^^^ that
selvakumaran has joined #ruby
<banisterfiend> shevy: learn the Ruby C API
<banisterfiend> that'll boost your ruby fu
<banisterfiend> well, your understanding of ruby anyway
<selvakumaran> Hi there, i am using Ruby 1.8 on opensuse, i need a help on this script http://susepaste.org/74636907
nemesit has joined #ruby
Prezioso has joined #ruby
<bryricker> Hey, I know this isn't a ruby question but I'm already logged in here and figure someone will probably know - I think I accidentally typed in "bash -v" and it seems to have flagged a "verbose" option that I don't know how to turn off - I restarted the shell and it's fine now, but what is it that I did?
cloke has joined #ruby
<davidcelis> bryricker: man bash
<davidcelis> read the man page and you will discover that you, apparently, already know exactly what you did
<bryricker> yeah I read it but I didn't see anything about turning it off
<davidcelis> you dont
<davidcelis> `bash -v` opens up a verbose bash shell
<davidcelis> just close the shell.
<bryricker> oh - I see
<bryricker> thank you
<davidcelis> command line options almost never have the ability to "turn off"
<davidcelis> you just exit the program and run it again without the option
artm has joined #ruby
EvanR has joined #ruby
selvakumaran has joined #ruby
sacarlson has joined #ruby
CheeToS has joined #ruby
twelvechairs has joined #ruby
ap0gee has joined #ruby
ukwiz has joined #ruby
shruggar has joined #ruby
<[[thufir]]> I'm trying to install this gem: https://forge.secure.at:10443/projects/ruby-net-nntp/chrome/site/doc/ only gems can't find it...? https://gist.github.com/2192219
<[[thufir]]> it's supposed to be installable: http://rubygems.org/gems/ruby-net-nntp
<Boohbah> [[thufir]]: gem install nntp
philips has joined #ruby
c0rn has joined #ruby
<[[thufir]]> that's actually a different nntp gem, let me double check.
JohnBat26 has joined #ruby
<Boohbah> [[thufir]]: ahh, so it is.
<[[thufir]]> they're both buggy. it's a conspiracy, I say!
artm has joined #ruby
<[[thufir]]> or at least, have wrong instructions.
<Boohbah> gem install ruby-net-nntp
<[[thufir]]> I'm confuzed. that's the right one, ok. now, why, or how, do you know the syntax? from the gem file directly?
johndouthat has joined #ruby
<Boohbah> well, it's in this link http://rubygems.org/gems/ruby-net-nntp
<[[thufir]]> doh. ok, yeah I see that. now, hmm. why was I having problems? what was I initially trying to do? my head's imploding. thank you, htough.
<johndouthat> Does anyone know what would cause this error after a `bundle install` ? Fetching gem metadata from https://rubygems.org/./Users/john/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault http://pastie.org/private/bdexgbc3klc1f77uvv7jq
JohnBat26 has joined #ruby
a_a_g has joined #ruby
delinquentme has joined #ruby
yxhuvud has joined #ruby
<delinquentme> hey all ! thoughts on how I might get an output for a timer ... such as
<delinquentme> 1 . . . 2 . . . 3
<[[thufir]]> am I using require correctly, for this gem: http://rubygems.org/gems/ruby-net-nntp? https://gist.github.com/2192333 I htink it's called different names in different parts of the documentation. run time error for iconv in gist.
<delinquentme> where there is a 1 second pause between each whole integer and incrementing periods
<delinquentme> on a single line !
ethd has joined #ruby
banisterfiend has joined #ruby
gokul has joined #ruby
blacktulip has joined #ruby
deadly_hcs has joined #ruby
trivol has joined #ruby
mdw has joined #ruby
<Boohbah> delinquentme: 3.times { |n| puts n; sleep 1 }
<banisterfiend> Boohbah: 3.times is exquisite, i wish i had it in objc
<Boohbah> wheee everything is an object! :)
<banisterfiend> Boohbah: oh i just mean it's nicer than: for (int i=0; i < 3; i++) ;)
<Boohbah> i agree
deadly_hcs has joined #ruby
kesor_ has joined #ruby
noyb has joined #ruby
LMolr has joined #ruby
artm has joined #ruby
shtirlic has joined #ruby
schovi has joined #ruby
Gesh has joined #ruby
dekz has joined #ruby
<dekz> is there some written/unwritten warning about using for loops to spawn threads and the related shared scope?
<[[thufir]]> ok, I'm fairly certain that I'm using the correct gem correctly: https://gist.github.com/2192333 yet am getting errors, undefined method, indicating otherwise. I've tried a few variations on what to require, and am currently looking over gem.
bsacke_ has joined #ruby
<[[thufir]]> do I have the require statement wrong, perhaps?
mdw has joined #ruby
tayy has joined #ruby
Faris has joined #ruby
sepp2k has joined #ruby
<Boohbah> [[thufir]]: yes, it seems the gem is non-functional. there is no 'server' attribute accessor or method defined in the gem
<Boohbah> [[thufir]]: s/server/host/ in the example code
<[[thufir]]> curious. I should've checked the api. thank you.
<banisterfiend> can i send private tweets?
<[[thufir]]> I copy/pasted the example code. pardon, I don't follow you. s/server/host/ mean ?
<banisterfiend> does twtitter support that/
<banisterfiend> like prvt: @baby @pig yo yo yo sup sup
<Boohbah> [[thufir]]: substitute host for server
<[[thufir]]> banisterfiend: wouldn't that defeat the purpose? it would just be SMS
<Boohbah> [[thufir]]: the example code says server when it means host
<banisterfiend> [[thufir]]: im not saying it should be the default
<banisterfiend> [[thufir]]: just from time to time i want to tweet my brother some shit and not have the world see
<banisterfiend> or my close friends
<Boohbah> [[thufir]]: look at nntp.rb in the gem
<Boohbah> [[thufir]]: oh, and get a real editor, nano is not a real editor. :)
<[[thufir]]> Boohbah: that hurts. I spent hours with disk archiver (DAR), backed up data, formatted and installed to run Netbeans as an editor, only to find out they dropped ruby support.
<bounce> meh, nano is fine if that's your thing
<[[thufir]]> eclipse? also, arcadia. or shiftedit?
<Boohbah> yeah, you can use what you like
<Boohbah> i use vim
nikhil_ has joined #ruby
<bounce> took a while before I finally got the hang of vi (nvi). before that got berated for 'not knowing vi' by someone who, er, could really only do things by cookbook and was generally clueless about how the basic services he 'maintained' worked
<banisterfiend> can someone explain to me the way that categories are used to simulate private methods?
<dekz> Can someone help explain why I'm seeing these two differences when using for loops vs a block body FOR: https://gist.github.com/627685767ca7a67eb7ad EACH: https://gist.github.com/1beb0e743fe0bd6cbbea
<banisterfiend> i remember something like: @interface Blah () how does defining prototypes inside an anonymous category make things private?
<bounce> should you want to learn vi, try "unix text editing"; it contains more than a pretty good intro to (original) vi, and you can skip the parts you're not interested in
<banisterfiend> Boohbah: can u answer my q
<bounce> (find the original as scanned pdf from o'reilly, or get the "remade" version that's a lot smaller; both are free)
<bounce> whoops, "unix text processing"
lewis1711 has joined #ruby
<lewis1711> I get that ruby isn't compiled, but is there any program that can go through ruby source code and catch *really* stupid errors like a variable not existing, or passing too many arguments?
francisfish has joined #ruby
<[[thufir]]> there's an awesome xkcd on editor wars. says it all.
<banisterfiend> lewis1711: look at laser
<lewis1711> alright, but I am getting distracted by actual ruby lasers in searching for it
<bounce> not all, but yeah. pick whatever you like.
<bounce> (ed! the standard! ed!)
<banisterfiend> lewis1711: Girl: https://github.com/michaeledgar/laser
nerdpowa has joined #ruby
<bounce> though as, say, a unix sysadmin it makes more sense to be proficient in vi, even ed, than to insist every server have a full emacs environment installed, for example
<bounce> oh look, someone ircing as root.
<lewis1711> does that bother you?
<[[thufir]]> https://gist.github.com/2192333 means that I need to use logger? or is that a problem in the gem source itself? presumably my setup.
<lewis1711> also why do people still talk about vi? are they old? do they not use vim yet?
<bounce> frankly, vim sucks so much I don't ever want to use it.
nikhil___ has joined #ruby
kremiak has joined #ruby
trivol has joined #ruby
jongleur has joined #ruby
<jongleur> Hi. Anybody who is able to help me reinstalling ruby? in debian 5 I installed ruby 1.9.3 using make/make install from source, but it now complains about missing libyaml. I should install libyaml and reinstall ruby. But how to de/reinstall ruby when it's installed using make?
<jongleur> there's no uninstall/reinstall target in the make file
<johndouthat> jongleur: just do make install again after you've installed libyaml
<lewis1711> or RVM :)
<johndouthat> or rbenv ;)
<bounce> no debian packages?
<nerdpowa> bounce: Tahnks, I didn't know rbenv :D. I have to try it ....
<nerdpowa> *thanks
<_dark> this is !ruby, but what is the amount of data received by a system in a network called? bandwidth?? but bandwidth is bits/sec
<bounce> not me that mentioned that
siefca has joined #ruby
<siefca> ehlo
LMolr has joined #ruby
nerdpowa has quit [#ruby]
<siefca> is there any way to modify values of a Hash while iterating? i've got a case where memory consumption is a priority
<johndouthat> _dark: received data? transfers
<[[thufir]]> jongleur: rvm
<bounce> "received data" sounds about right. bandwidth is capacity, not necessarily capacity used
<[[thufir]]> jongleur: /join #rvm they're really helpful. I'll give youtwo cents there, if you like.
<_dark> say like people say i exceeded my bandwidth for their internet plan
<_dark> they meant the amount of allotted transfers, but isn't bandwidth the amount of bits recieved a sec
<jongleur> [[thufir]]: thanks. give me some minutes, I try johndouthat's tip first
<johndouthat> _dark: data cap. quota
<[[thufir]]> jongleur: ok.
<bounce> (quotum is the singular)
<Boohbah> (latin is dead)
<_dark> johndouthat: ok
<bounce> (says the resident redneck)
<[[thufir]]> redneck means what? guns?
<bounce> heh no
<banisterfiend> Boohbah: woodcutter, cut down my shadow, deliver from the torment of bearing no fruit!
<lewis1711> redneck means your need a longer mullet because you're getting sunburnt
<banisterfiend> Boohbah: let me see open in my fingers, the blue rose of your womb
<[[thufir]]> lol
<lewis1711> better git growin
* Boohbah grows
<banisterfiend> Boohbah: little girls were running, chased by their braids, in a wind exploding with roses of black powder
apeiros_ has joined #ruby
<banisterfiend> Boohbah: a bolting horse always finds the sea and is swallowed in the waves!
* Boohbah appreciates literature only sometimes
<siefca> Boohbah: I'm looking for something like each_value! that would modify the values of a Hash
<bounce> next you'll be hailing oscar as your inspiration
<Boohbah> h.each_value {|value| value = new_value }
Morkel has joined #ruby
<siefca> Boohbah: there might be not enough memory left to create temporary data structure used to build new hash
<banisterfiend> Boohbah: suns of silver, waves of pearl, skies of red hot coals! hideous wrecks at the bottom of brown gulfs, where the green snakes, eaten by vermin, fall from the twisted trees with black odours!
<siefca> 1.9.3p0 :025 > a => {:a=>10, :b=>20, :c=>30}
<siefca> 1.9.3p0 :026 > a.each_value{|x| x=100} => {:a=>10, :b=>20, :c=>30}
<siefca> it doesn't modify the Hash, just iterates over values
<banisterfiend> siefca: map
<banisterfiend> wrapped by a Hash[]
<banisterfiend> siefca: or this: hash.each_with_object({}) { |(k, v), o| o[k] = function(v) }
<siefca> banisterfiend: yeah, I tried Hash[] and tried #inject but they're both create temporary data srtucture (a new Hash)
shruggar has joined #ruby
<banisterfiend> siefca: use each_with_object
visof has joined #ruby
visof has joined #ruby
mdw has joined #ruby
<lewis1711> I had this exact same problem before
<siefca> banisterfiend: it would be great to have something to iterate "externally", meaning for each index of a Hash and then modifying it in for example for loop
<lewis1711> a few weeks ago each_with_object is indeed the solution
<siefca> but {} in each_with_object creates new hash which is filled up with new data, isn't it?
<Boohbah> returns the initially given object.
<apeiros_> a = {:a=>10, :b=>20, :c=>30}; a.each { |k,v| a[k]=v*10 }; a # => {:a=>100, :b=>200, :c=>300}
wilmoore has joined #ruby
<siefca> apeiros_: it won't work in new ruby (1.9) since it modifies the collection while iterating, it generates Runtime error
<apeiros_> siefca: I ran that in 1.9
<apeiros_> you must not delete or add items
<apeiros_> changing them is fine
<siefca> i see now
<siefca> hmm
<siefca> strange
<apeiros_> class Hash; def map_values!; each { |k,v| store(k, yield(v)) }; self; end; end # h.map_values! { |v| v*10 }
<lewis1711> I wish ruby used method_name! consistently for mutating methods, not this hand-wavey "methods that do something unexpected"
<apeiros_> lewis1711: personally I'd even prefer it'd just use proper language for it
<lewis1711> huh?
<siefca> apeiros_: this example of mep_values! should be in standard library
<apeiros_> i.e. for my language, I have (the equivalent of): ary.mapped { … } and ary.map { … }
<siefca> s/mep/map/
mcwise has joined #ruby
<apeiros_> so mapped returns a new mapped array, while map maps the receiver itself
<lewis1711> wtf is wrong with just map and map!
acekiller has joined #ruby
<apeiros_> it requires more explanation, is less intuitive
<apeiros_> anyway, I'm off for lunch, huzza! :D
<lewis1711> to me it makes perfect sense
<lewis1711> used in scheme as well
<lewis1711> laters
<lewis1711> also, I *sort of* know ruby but I still don't get this dynamic typing unit testing stuff. all I do is write code with lots of run time errors and dream of a statically typed OO language at rubys high level of abstraction. should I read a book or something, since I still don;t "get it"?
<siefca> apeiros_: TY
dekroning has joined #ruby
<dekroning> how can I generate the ri documentation for all rspec gems?
jonteru has joined #ruby
Jackneill has joined #ruby
nikhil_ has joined #ruby
archivebot has joined #ruby
emmanuelux has joined #ruby
<Sp4rKy> /W 6
koud has joined #ruby
<apeiros_> lewis1711: matter of practice
<apeiros_> reading & writing code helps
<apeiros_> discussing code also helps (local usergroups, here, …)
koud has quit ["http://quassel-irc.org - Chat comfortably. Anywhere."]
Walenrod has joined #ruby
jongleur has quit [#ruby]
ChampS666 has joined #ruby
thecreators has joined #ruby
Walenrod has joined #ruby
akemrir has joined #ruby
Walenrod has quit [#ruby]
<banisterfiend> apeiros_: what do u think about mailing lists
burgestrand has joined #ruby
sacarlson has joined #ruby
bonsaiben has joined #ruby
bonsaiben has quit [#ruby]
<apeiros_> I like the idea, but I don't really use them
ben- has joined #ruby
statarb3 has joined #ruby
nemesit has joined #ruby
chanakya has joined #ruby
chanakya has joined #ruby
bonsaiben has joined #ruby
<bonsaiben> hello
<bonsaiben> is there a brave lad here willing to venture a stab at my question?
<bonsaiben> it's a little hard to google so I'd like to tap a brain directly
<bonsaiben> is there a method that returns the object calling it if the passed block returns true, otherwise nil? kind of like: [a].select {|a| a==b}.first, or: a if a==b... but i'd like to pass a block
<apeiros_> wow, he takes so much time to ask, then leaves the channel right after asking…
* sepp2k hates drive-by askers
<siefca> apeiros_: btw, I know why interpreter doesn't allow me to update vash value in iteration
<banisterfiend> sepp2k: wwhat's your opinion of objc
<apeiros_> sepp2k: yeah, me too, but with this one, I wonder whether leaving was intentional…
<siefca> apeiros_: simply the key is an array and the array was modified just before updating value
<sepp2k> banisterfiend: Never used it
<lewis1711> objective C combines the abstraction of C with the speed of smalltalk
<apeiros_> siefca: in other words: you have a different key now, which means you'd add a key
<apeiros_> siefca: don't use mutable objects as keys in hashes
<apeiros_> if you mutate a key, you must use #rehash, which is inefficient
<siefca> apeiros_: i'm fixking someone else's code, a bit messy
mdw has joined #ruby
<siefca> apeiros_: i think i'll subclass array and add some method that is called to create a hashing key
<apeiros_> those would be #hash and #eql?, and of course, both change when you change the array. subclassing won't help with that.
<siefca> apeiros_: there was something but I don't remeber now, I mean the method that is called to calculate hash
<siefca> apeiros_: #hash, yes
<apeiros_> siefca: you must implement *both*
<apeiros_> if you only do one, it'll not work correctly
<siefca> apeiros_: i know, to be comparable
<apeiros_> depending on your situation, you might consider using Hash#compare_by_identity
<siefca> that would break the logic
<siefca> i think i have to refactor the program
John_P has joined #ruby
Maxou56800 has joined #ruby
<apeiros_> if you're currently having mutating hash keys, then refactoring that sounds like a great idea
adambeynon has joined #ruby
dhruvasagar has joined #ruby
<siefca> or calculate if creating #hash and #eql would be efficient, e.g. like def hash self.reject{|x|x.nil?}.join.to_sym; end
thecreators has joined #ruby
<apeiros_> that's not a hash value
<apeiros_> should be a number
<siefca> super()
<apeiros_> you can build up on existing objects' #hash
RyanFreeman has joined #ruby
<apeiros_> um… I don't see how you combine the code you just pasted with super…
<siefca> i see
banisterfiend has joined #ruby
<siefca> refactoring it is
kesor__ has joined #ruby
<apeiros_> def hash; compact.hash; end; def eql?(other); compact.eql?(other.compact); end
<lewis1711> huh, rvm cannot find "laser" or "ruby-debug"
ap0gee has joined #ruby
<Mon_Ouie> Why would RVM know about gems? That's what the gem command-line tool is for.
Foxandxss has joined #ruby
<lewis1711> yeah, that's what I meant
<lewis1711> I just got it *through* rvm
dbgster has joined #ruby
<lewis1711> oh nm, doesn;t work on 1.9x
lewis1711 has quit [#ruby]
<banisterfiend> Mon_Ouie: mon-dogg
BruceZu has joined #ruby
fayimora has joined #ruby
nikhil_ has joined #ruby
nikhil_ has joined #ruby
bonsaiben has joined #ruby
JohnBat26|2 has joined #ruby
davidpk has joined #ruby
sbanwart has joined #ruby
banisterfiend has joined #ruby
nari has joined #ruby
fr0gprince_mac has joined #ruby
trivol has joined #ruby
ph^ has joined #ruby
banisterfiend has joined #ruby
Imapickle has joined #ruby
<Imapickle> Hey has anyone here used OpenGL 3.3 and GLSL version 150 and could give me a hand I have a thread that explains everything http://www.gamedev.net/topic/622378-working-my-way-around-opengl-33-glsl-150-problems/
liluo has joined #ruby
mengu has joined #ruby
ChampS666 has joined #ruby
lynrix has joined #ruby
iocor has joined #ruby
<lynrix> Hi guys I would like to upgrade my version of Ruby to 1.9 but I want to know why do I have to install git and rvm in order to upgrade ruby on the mac
<lynrix> what is rvm> what is git for?
<apeiros_> lynrix: you do know google, yes?
<apeiros_> I know, it's a very new invention…
<lynrix> lol I do but to be honest i wanted bette guidance by the group "pros"
<apeiros_> how about you do the 5min of mandatory research first, and then ask more specific questions?
<lynrix> i have already installed git from http://git-scm.com/ then I think I am suppose to install rvm
<lynrix> but I am still a newbi
<lynrix> and dont really get what the relation between the 3
<shevy> rvm manages your ruby
<shevy> they should sit on #rvm
<shevy> as for whether you want or should use it, that is only up to you. I dont use it.
<lynrix> so what step would you take if you use a mac and want to upgrade to a newer version of ruby?
Faris has joined #ruby
<shevy> that question would be a problem as I dont use a mac. I am on linux and compile everything from source. there are many folks on #machomebrew though who use mac + ruby specifically
<lynrix> thanks
<lynrix> thats cool will check it out
dr_bob has joined #ruby
<banisterfiend> lynrix: use rvm
trivol has joined #ruby
workmad3 has joined #ruby
freeayu has joined #ruby
celebritarian has joined #ruby
<shevy> or install linux
dql has joined #ruby
Sailias has joined #ruby
greenarrow has joined #ruby
td123 has joined #ruby
iocor has joined #ruby
Russell^^ has joined #ruby
LMolr has joined #ruby
waxjar has joined #ruby
quandrum has joined #ruby
rcearn has joined #ruby
<rcearn> Is there any way to develop iOS app in Ruby ? MacRuby or mRuby, ... ?
shtirlic has joined #ruby
quandrum has quit [#ruby]
<ukwiz> what is the latest in the 1.8 line?
<apeiros_> 1.8.7
<shevy> ukwiz my brother!
<banisterfiend> rcearn: just learn objc
<rcearn> banisterfiend: :D
<banisterfiend> rcearn: it's very rubyish
<shevy> ewww
<shevy> you mac dudes really do everything just so you can stand on mac
<shevy> *stay
lewix has joined #ruby
lewix has joined #ruby
thecreators has joined #ruby
adman65 has joined #ruby
musee has joined #ruby
ranok has joined #ruby
ranok has quit [#ruby]
bayashi__ has joined #ruby
<ukwiz> how do i get the systemwide default version of ruby to be 1.8.7 using rvm
<apeiros_> rvm use system
<apeiros_> also see rvm help
Jake232 has joined #ruby
<ukwiz> that doesn't set it systemwide though
<apeiros_> oh, misread you
<apeiros_> rvm help would have helped you, though. rvm use 1.8.7 --default
<ukwiz> ah - I had tried rvm default 1.8.7
Squarepy has joined #ruby
Squarepy has joined #ruby
<ukwiz> if I run rvm use 1.8.7 --default, then open a terminal, ruby -v still shows 1.9.2
<apeiros_> and what does `which ruby` show?
<apeiros_> (sounds to me like you haven't installed rvm properly and somehow overwritten the system ruby too… both bad things)
[[thufir]] has joined #ruby
davidpk has joined #ruby
Morpheus95 has joined #ruby
Morpheus95 has quit [#ruby]
nari has joined #ruby
fowl has joined #ruby
eldariof has joined #ruby
<ukwiz> I was advised on this channel to remove the system ruby altogether
goodieboy has joined #ruby
<fowl> why are __class__ and __main__ in here, I feel like they're mocking us.
<ukwiz> which ruby gives /usr/local/rvm/rubies/ruby-1.9.2-p290/bin/ruby
workmad3 has joined #ruby
Dreamer3 has joined #ruby
<apeiros_> ukwiz: who advised you to remove the system ruby?
<apeiros_> it's about the worst idea ever… you generally leave system ruby untouched, for apps that depend on system ruby. you override (NB: not overwrite) it by setting PATH properly (which is what rvm does)
IPGlider has joined #ruby
zakwilson has joined #ruby
king313 has joined #ruby
<fowl> hey apeiros_ do you know how to fix this: https://gist.github.com/2193725 :)
<shevy> __class__ and __main__ never said anything, I think they are bots
<fowl> silent bots are spy bots
philcrissman has joined #ruby
sdeobald has joined #ruby
<[[thufir]]> apeiros_: I don't have a system ruby, just rvm
<[[thufir]]> why is that bad? curious
<apeiros_> fowl: nope
<apeiros_> [[thufir]]: did your system ship with a ruby?
<[[thufir]]> nope
<apeiros_> then everything's fine
<fowl> apeiros_, thats cool that means i get to go in #ruby-lang and highlight zenspider a bunch of times :p
<shevy> egospider will just ban you without a word
<fowl> nah hes funny when you piss him off
<fowl> last time i could feel his rage through my screen
<[[thufir]]> lol
jankud has joined #ruby
<jankud> Hi, are there lists in Ruby ?
<fowl> ruby has arrays
<jankud> I am searching for an efficient data structure, where I can easily add an element inside
<jankud> but the order matters
<jankud> would arrays be efficient ?
<fowl> i guess it depends on how you use them
<waxjar> what kind of data/elements are we talking about?
<jankud> I need to have a list of objects, of my own type
<jankud> normally what I would do in languages like c++, I would have a table of pointers, so I would know where the data resides in the list, so that would allow fast addition
* apeiros_ wonders why the data that is stored would matter in any way…
<apeiros_> jankud: what type of operations do you perform?
<apeiros_> i.e., do you want to access the data by index?
<apeiros_> do you delete items?
trivol has joined #ruby
freeze has joined #ruby
<apeiros_> do you add at the begin/middle/end of the collection?
<apeiros_> do you delete from the begin/middle/end of the collection?
<jankud> I want to : add, delete, qucikly find an element with given "pointer"
<jankud> from anywhere in the collection
<waxjar> Hashes seem more appropriate then
<jankud> What I would normally do I would have a hash that has pointers as values
<apeiros_> jankud: what's a pointer in this context? usually a pointer would mean you already *have* the object in question… do you mean an index? (as in: a position)
akemrir has joined #ruby
<jankud> something like position, but more abstrac, like if I insert something I dont want to increment it, right ?
akemrir has joined #ruby
<jankud> as I said, it's easiest to think of it as a map with some keys, and values as pointers to the list
<banisterfiend> jankud: that sounds like nerd talk to me
<jankud> I would like to be able to add a new hash to the map, and insert it wherever I want in the list
<apeiros_> it sounds confudazzled to me
<apeiros_> jankud: for key/value store, you use a Hash
<apeiros_> insert/access/delete is O(1) there.
<jankud> ok , I know that
<apeiros_> as of 1.9, insertion order is retained
<jankud> but now I want those elements
<jankud> that I insert
<jankud> to be in certain order
<apeiros_> access by position is O(n)
<apeiros_> as said, insertion order is retained
<apeiros_> (but that requires ruby 1.9+)
<jankud> but can I put something in the middle ?
<jankud> ruby 1.9 is fine
kirun has joined #ruby
<apeiros_> not easily, no
<jankud> so is there anything that supports insertions in any place?
<banisterfiend> your mom
akemrir has joined #ruby
<banisterfiend> fowl: eazy-e ==> 5 foot 1' wrapper who sounds like a woman and died of aids
<banisterfiend> rapper*
<fowl> banisterfiend, was that an observation? wtf did i just read
liluo has joined #ruby
<banisterfiend> fowl: haha it's true actually, iirc. But i still like that track
<banisterfiend> he shut down dre + ice cube with that
flingbob has joined #ruby
akemrir has joined #ruby
akemrir has joined #ruby
gtuckerkellogg has joined #ruby
akemrir has joined #ruby
mengu has joined #ruby
akemrir has joined #ruby
bluenemo has joined #ruby
Teomari has joined #ruby
akemrir has joined #ruby
<shevy> jankud always try to keep things simple
<shevy> the problem is when you drag the C++ efficiency thinking into ruby, that just ruins everything
fr0gprince_ has joined #ruby
andremaha has joined #ruby
andremaha_ has joined #ruby
n1x has joined #ruby
dhruvasagar has joined #ruby
<shevy> ok
<shevy> does web development suck or does it suck
<fowl> noooo that new sinatra slim stuff looks pretty sexy
nikhil_ has joined #ruby
<fowl> i havent used it yet tho
Indian has joined #ruby
senthil has joined #ruby
liluo has joined #ruby
malcolmva has joined #ruby
wilmoore has joined #ruby
<banisterfiend> fowl: what's sinatra slim
<swarley> ^
<fowl> sinata + sli
dql has joined #ruby
Freelancer has joined #ruby
<fowl> banisterfiend, https://github.com/sinatra/sinatra scroll down to inline templates
<Freelancer> hi
<Freelancer> does anybody know how to use oauth2 with facebook login?
<senthil> how do i regenerate ri docs?
<senthil> Freelancer: Have you looked into omniauth?
jankud has joined #ruby
<swarley> senthil,
<swarley> rdoc -R
<swarley> you'll need to sudo
<swarley> waitwaitwait
<swarley> rdoc -r to keep the ri files to the directory
artm_wasnt_avail has joined #ruby
fbernier has joined #ruby
<swarley> rdoc -R to to put it in the system wide ri dir
threecreepio has joined #ruby
<senthil> swarley: i'll try it, thx
<Freelancer> senthil > you mean, the channel? I'll try now
<senthil> Freelancer: no, the gem
<Freelancer> senthil > yes, I tried a lot of things, but I just cannot understand how to do. My last try was using oauth2
<senthil> Freelancer: what exactly do you want to know
<swarley> are you using a facebook api gem?
<Freelancer> senthil > I would like to allow users to log in in my app using their Facebook account
<Freelancer> swarley > I don't think there's one for oauth2
<senthil> swarley: which one? i used fb_graph
<senthil> Freelancer: omniauth is what you want
ChampS666 has joined #ruby
<senthil> Freelancer: Fb uses OAuth2 and as far as I know its the only way to connect to their api
ThiefMaster has joined #ruby
<ThiefMaster> hi, is it possible to set a posix capability inside ruby code? i.e. exactly what this C code does: https://paste.aeum.net/show/64/
chovy has joined #ruby
alem0lars has joined #ruby
<shevy> ThiefMaster it may be possible, could be cumbersome ...
<Freelancer> senthil > yes but... there's a gem called "oauth2". Do you mean that the good one should be "omniauth"?
<ThiefMaster> damnit
<ThiefMaster> <- zero ruby knowledge
<swarley> what does it do..
<burgestrand> ThiefMaster: you can write a C extension that does this if necesary
<ThiefMaster> ok, too much work :)
<swarley> what
<swarley> lol
<shevy> ThiefMaster, one way would be http://www.zenspider.com/ZSS/Products/RubyInline/
<burgestrand> but as far as ready-existing solutions I don’t know
<shevy> yeah swarley
<shevy> I'd even join the words
<shevy> a classic watlol or lolwat
<alem0lars> I'm trying to spawn an external process using Open3.popen3 but it seems that the wait_thr isn't passed into the block. Here is the code snippet: http://pastebin.com/Uuj1MkGM . Is it a bug on ruby 1.9.3 Open3 class?
<senthil> swarley: last commit was 2 years ago, you sure you want that?
<senthil> Freelancer: omg...https://github.com/intridea/omniauth
<alem0lars> or am I doing something wrong?
<Freelancer> senthil > this is for OAuth. I think that Facebook needs OAuth2
alx- has joined #ruby
<swarley> senthil, not for me lol
<swarley> i have no interest in facebook
<senthil> Freelancer: i givce up
<swarley> i think what he;s saying
<swarley> is it does both
<senthil> swarley: haha
<senthil> swarley: Fb no longer allows OAuth or username/pass auth, only OAuth2
<Freelancer> apparently, yes
<swarley> wonderful
<swarley> twitter uses oauth2 doesnt it?
<senthil> swarley: did they upgrade recently?
<swarley> im not sute
<swarley> sure*
<Freelancer> But it doesn't work for me; I get a really annoying error: "TypeError at /facebook_login
<Freelancer> can't convert nil into Integer
<Freelancer> file: base.rb location: Integer line: 896"
<swarley> i dont care about twitter either
<swarley> using omniauth?
<Freelancer> I just sounds like "segmentation fault" for me
<senthil> i think they're waiting for OAuth2 spec to be finalized
<swarley> OmniAuth: Standardized Multi-Provider Authentication (build status: failing)
<swarley> soyeah
<swarley> you'll need to gem install it probably if you're going to use it
<banisterfiend> swarley: are you watching the pry project?
<swarley> im not following it literally, but yes i am watching for changes
<swarley> i'll add it to my follow list now
<banisterfiend> swarley: can you follow it ? :)
<banisterfiend> swarley: good, cos we're almost at 1K :P
goodieboy has joined #ruby
<swarley> watching
<swarley> just added
<banisterfiend> tx
<swarley> np
<swarley> its worth following anyway
artm_wasnt_avail has joined #ruby
<senthil> banisterfiend: 999
<senthil> now
<swarley> i think im going to make something like readline
<fowl> swarley, have you seen coolline?
jankud has quit [#ruby]
<swarley> yeah
<banisterfiend> senthil: haha
<swarley> i was going to aim for something like that
<banisterfiend> senthil: thanks
<fowl> swarley, coolline needs a few fixes, you should do it :)
<swarley> orly
<banisterfiend> swarley: just fix coolline :)
<banisterfiend> swarley: it was written by Mon_Ouie
goodieboy has joined #ruby
<banisterfiend> (another 15 year old)
<swarley> Mon_Ouie is a better programer than I, not sure how i could fix it
<swarley> xD
<banisterfiend> swarley: well he's the same age as you, so you should fight him for supremacy
<swarley> Lol
<swarley> will do
<swarley> i'll fork it
<swarley> what sort of issues are there?
<banisterfiend> swarley: uparrow/down arrow dont work properly
<senthil> banisterfiend: you bet
<swarley> okie dokie
<swarley> so history
<banisterfiend> history is there
<banisterfiend> it's just the up arrow key doesnt work, you can recover history with emacs bindings though, i.e ^P
<banisterfiend> and ^N
<swarley> i see
[[thufir]] has joined #ruby
<fowl> swarley, the potential is there for doing cooler things like multiline editing and real indention
akemrir has joined #ruby
pyreal has joined #ruby
<swarley> hm
<swarley> okay
sdeobald has joined #ruby
<ThiefMaster> shevy: looks good, how can i make it link the extension against a certain library?
akemrir has joined #ruby
<ThiefMaster> (i need -lcap)
Drewch has joined #ruby
<ThiefMaster> nvm
ZachBeta has joined #ruby
akemrir has joined #ruby
<shevy> ThiefMaster dunno, years ago i decided to use ruby and forget C. I am proud to have done so!
<ThiefMaster> builder.add_link_flags '-lcap'
<ThiefMaster> that did the job
<shevy> I have high hopes that one day you can forget C as well :)
<ThiefMaster> maybe, but then in favour of python :p
<ThiefMaster> WARNING: Can't find signature in "<my code>"
<ThiefMaster> any way to get rid of that?
<swarley> im not sure where to start lol
akemrir has joined #ruby
workmad3 has joined #ruby
<pyreal> how do i include a dependency in a gem spec that's only needed for Ruby 1.8.7? (i.e. JSON)
<pyreal> trying to back port a gem to support 1.8.7. using JSON from std lib for 1.9.2
dbgster has joined #ruby
<ThiefMaster> nvm, removing the #includes helped
<fowl> pyreal, stop backporting and move forward
<pyreal> heh
<fowl> if this is for some dumb company, tell them to
affix has joined #ruby
dominikh has joined #ruby
<fowl> 4 years is long enough to sit on your ass refusing to upgrade
<pyreal> no this is to ensure that my gem works for ppl still forced to use 1.8.7 for whatever reasons
tesmar has joined #ruby
<fowl> pygmael, fuck em
<pyreal> my code is very simple so this is the only thing preventing it
<senthil> pyreal: RUBY_VERSION ?
<shevy> pyreal my brother!
Mchl has joined #ruby
<shevy> long live 1.8.7, we never die, we multiply!
<pyreal> so i'd put in an if statement around the spec.add_dependency to detect RUBY_VERSION
<shevy> in the spec?
<pyreal> in the .gemspec file i mean
<senthil> pyreal: that's what I did: if RUBY_PLATFORM == 'java'
<senthil> pyreal: not sure if that's right or not
<shevy> my RUBY_VERSION is # => "1.8.7"
<pyreal> thing is I thought i came across some sample code yesterday that had detection in the add_dependency line itself, but now i can't remember where i saw it
<shevy> if RUBY_VERSION < "1.9" should work for 1.8
<pyreal> i'll give that a whirl
<senthil> pyreal: you mean with no 'if'
<senthil> ?
<pyreal> shevy: maybe that's what it was
mcwise has joined #ruby
<pyreal> my first time making a gem for anyone's use but myself, so not much practice in canonical ways to handle ruby versions :D
andrewhl has joined #ruby
<senthil> where are the String, Hash implementation stored in a ruby installation?
<shevy> pyreal I still havent made my first public gem :(
<shevy> I am so lazy
<pyreal> i made this one with my 11yo son yesterday..
Drewch has joined #ruby
<shevy> Oh i see your masterplan
<pyreal> heheh
<shevy> he becoming better at ruby than you soon eh ;)
<pyreal> he's gonna be my maintenance coder. bwahahahaha
<pyreal> plus driveway shoveler
<shevy> I think chris2 started with ruby when he was 10 (that's the guy who wrote http://rack.rubyforge.org/ dunno how old he is now ... 20 I think)
<pyreal> nice
ThiefMaster has quit [#ruby]
<pyreal> This worked: gem.add_runtime_dependency "json" if RUBY_VERSION < "1.9"
<pyreal> thanks
falena has joined #ruby
<shevy> cool
punkrawkR has joined #ruby
cha1tanya has joined #ruby
affix has joined #ruby
<Freelancer> Hello, I'm looking for somebody who could help me using OAuth2 with Facebook... I have got some examples but they don't work for me.
goodieboy has joined #ruby
<swarley> good news everyone
<swarley> the down arrow works... in theory
<fowl> what is it professor
<swarley> i need to fix the up arrow lol
<pyreal> i need to fix the backwards in the 4th dimension arrow
Faris has joined #ruby
blacktulip has joined #ruby
radic has joined #ruby
kesor_ has joined #ruby
apeiros has joined #ruby
<swarley> so i see no logical reason for the up arrow not to work
visof has joined #ruby
visof has joined #ruby
artm_wasnt_avail has joined #ruby
schaerli has joined #ruby
fayimora has joined #ruby
cha1tanya has joined #ruby
csprite has joined #ruby
phaedrix has joined #ruby
gabeh has joined #ruby
Sailias has joined #ruby
baroquebobcat has joined #ruby
rippa has joined #ruby
bsacke has joined #ruby
Guest31588 has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
Molfar has joined #ruby
<Molfar> I know that self refers to current instance, but what refers to current class (from instance method)?
t0mmyvyo has joined #ruby
<swarley> Molfar, self.class
<Molfar> thanks
<swarley> banisterfiend,
<swarley> i fixed it
<swarley> up and down work
mdw has joined #ruby
pawdro has joined #ruby
<any-key> oooh that looks kewl
B|aster has joined #ruby
<swarley> i didnt make most of it
<swarley> i just fixed it
<swarley> lol
<any-key> yay
<any-key> will I regret smearing peanut butter on a tortilla and eating it?
<swarley> depends
<swarley> but we wont know until you try
<any-key> there's just too much at stake here
<swarley> ikr
<swarley> wait
<swarley> creamy or chunky
<any-key> chunky
<any-key> duh
<swarley> hm
<swarley> i think you'll regret that
<swarley> sounds like a rocky tortilla to me
<any-key> mmmm
<swarley> i like chunky normally... but im not sure how mexicans feel about it..
<any-key> also, is there a good way to switch to a specific endian-ess in ruby?
<swarley> is there someone from mexico that can tell us?
<swarley> uhh
<any-key> like, platform-independent
<swarley> you can do
<swarley> # encoding: blah
<swarley> but i dont know other than that
<swarley> you can tell platform from
<any-key> well, I have shenanigans on my computer that are shenaniganed to a roomba, which is big endian
<swarley> RUBY_PLATFORM
Drewch has joined #ruby
LMolr has joined #ruby
fr0gprince_ has joined #ruby
bnhymn has joined #ruby
<any-key> you people should tell me if I'm doing anything stupid (besides reversing a string to switch endian-ess :| )
<swarley> lolololol
<swarley> you're programming a roomba? xD
<swarley> thats so awesome
<shevy> man
<shevy> I have no idea what any-key is doing
<any-key> kicking ass, taking names
<shevy> and somehow i feel swarley dragging things down already, so I am not needed anymore
<any-key> get back here
<swarley> lawl
<any-key> that lib only supports some of the actuator commands right now, I'm going to start work on the sensor portion soon :\
<any-key> also, peanut butter tortillas were a good idea
<swarley> i've done some work with robotics
havenn has joined #ruby
<swarley> nothing that cool though
<swarley> lol
<swarley> worked with FIRST using labview and i tried out the C++
<any-key> I need to make a video of what I've got so far...this is a small part of a senior design project ( a very small part )
<any-key> oh hey, I did FIRST as well!
<swarley> my team was rookie all star for our devision
<swarley> but our design team was so stupid
n00b4lyfe has joined #ruby
<any-key> right now I've been using the accelerometers in this watch TI makes to drive the roomba...it's kinda fun
<swarley> so our robot was piss poor
<any-key> heh
<swarley> we programmed it well
<swarley> their concepts were just... so dumb
<matti> LOL
tayy has joined #ruby
goodieboy has joined #ruby
eldariof has joined #ruby
io_syl has joined #ruby
zakwilson has joined #ruby
nemesit has joined #ruby
jgrevich has joined #ruby
waxjar has joined #ruby
Drewch has joined #ruby
gabeh has joined #ruby
sepp2k1 has joined #ruby
mcwise has joined #ruby
leekspin has joined #ruby
<leekspin> Hey, what are some good ways to parse binary data in Ruby? I stumbled upon bitstruct and bindata is there something better ? I have quite complicated format (with nesting)
<[[thufir]]> using net/telnet https://gist.github.com/2198265 how do I get output from telnet? puts ....?
mdw has joined #ruby
Guest31588 has quit ["ERC Version 5.3 (IRC client for Emacs)"]
<heftig> leekspin: String#unpack
ghvandoorn has joined #ruby
badelat has joined #ruby
bozhidar has joined #ruby
A124 has joined #ruby
fayimora has joined #ruby
A124 has joined #ruby
maletor has joined #ruby
phaedrix has joined #ruby
shtirlic has joined #ruby
schaerli has joined #ruby
CheeToS has joined #ruby
swarley has joined #ruby
burns180_ has joined #ruby
workmad3 has joined #ruby
havenn has joined #ruby
havenn_ has joined #ruby
A124 has quit [#ruby]
nfluxx has joined #ruby
fayimora has joined #ruby
trivol has joined #ruby
ooldirty has joined #ruby
eldariof has joined #ruby
yoklov has joined #ruby
acekiller has joined #ruby
sepp2k has joined #ruby
tatsuya_o has joined #ruby
waxjar has joined #ruby
zetm has joined #ruby
Morkel has joined #ruby
dv_ has joined #ruby
Molfar has joined #ruby
Molfar has quit [#ruby]
Drewch has joined #ruby
havenn has joined #ruby
conor_ireland has joined #ruby
stringoO has joined #ruby
sbanwart has joined #ruby
cha1tanya has joined #ruby
yoklov has joined #ruby
chimkan_ has quit [#ruby]
dbgster has joined #ruby
n1x has joined #ruby
otters has joined #ruby
<jonteru> hi, how do i properly nest and's and or's in an if statement?
<canton7> jonteru, 'and' and 'or' are used for flow control. You probably want '&&' and '||'
<jonteru> i sure do
AxonetBE has joined #ruby
demian`_ has joined #ruby
apok has joined #ruby
<jonteru> thx
<canton7> np :)
<jonteru> but still, how do i nest them?
<jonteru> x=1 && (z=5 || z=6)
<jonteru> i want something like that
francisfish has joined #ruby
<jonteru> and it doesn't seem to work
<canton7> '=' is assignment. '==' is used for comparison
Ontolog has joined #ruby
<canton7> that statement above will always be true. 'x=1' assignes 1 to x, and return 1, which evaluates to boolean true. Then you've got the same with 'z=5'
shruggar has joined #ruby
cuci has joined #ruby
Gesh has joined #ruby
<cuci> hi guys! I've cloned a rails app and I'm running bundle install --verbose but the CPU is at 8% and I get no output from it. It gets stuck at: Installing linecache19 (0.5.12) with native extensions
<cuci> any ideas why? does linecache take forever to install with no CPU activity or if it's something wrong how can I investigate?
<jonteru> canton7: sorry, written it in a hurry it's meant to be all ==
maletor has joined #ruby
<canton7> jonteru, hrm, then it should work. What input are you giving it, and what output are you expecting and getting?
artOfWar has joined #ruby
<davidcelis> cuci: "with native extensions" means there is some gcc action going on
<davidcelis> cuci: there is some C compiling so chances are it will take more time than the usual gem
<cuci> that much I expected I was only puzzeled by no CPU while compiling. It has finished now. Thanks!
t0mmyvyo has joined #ruby
maletor has joined #ruby
pzol has quit ["Sayonara!"]
Drewch has joined #ruby
artOfWar has joined #ruby
<jonteru> canton7: ok, i think i got it to work, thank you
kW_ has joined #ruby
Indian has joined #ruby
gabeh has joined #ruby
kah_ has joined #ruby
<kah_> hi, I've been looking at writing your own methods, why does this output say_moo 3 times instead of just defining x as a variable? http://pastie.org/3667319
S2kx has joined #ruby
newchaos has joined #ruby
sacarlson has joined #ruby
gabeh has joined #ruby
<kah_> anyone?
acekiller has joined #ruby
mxweas_ has joined #ruby
newchaos has joined #ruby
wilmoore has joined #ruby
<davidcelis> kah_: Because that's what Kernel#puts does
<davidcelis> puts outputs a string.
<davidcelis> that method isn't returning anything
<davidcelis> it's just outputting
absinthe has joined #ruby
trivol has joined #ruby
<kah_> davidcelis: yeah, so puts is put string... so it would make sense to me if instead of x = say_moo 3 I just had say_moo because then it would output what was in the method... but I don't understand why when you define x = say_moo 3 it still outputs the method
Tomasso has joined #ruby
<davidcelis> Because that's what puts does.
<davidcelis> It outputs.
<davidcelis> It does not return anything
<davidcelis> x = say_moo 3
<davidcelis> what this means does not think what you think it means
artm has joined #ruby
<davidcelis> It means assign the return value of say_moo(3) to x
<davidcelis> say_moo does not return anything; it just outputs, so x remains nil
<kah_> im completely mindfocked
<davidcelis> You might want to read a ruby book
<kah_> i am
<kah_> that's what im doing
havenn_ has joined #ruby
<kah_> im reading learn to program by chris pine
<davidcelis> In Ruby, a method will return whatever the last statement returns
<davidcelis> `puts` does not return anything. It just outputs
<davidcelis> however, if you did...
<davidcelis> def say_moo(times)
<davidcelis> 'moo' * times
<davidcelis> end
<kah_> what is the difference between return and outputs
<davidcelis> now it will actually return what you want
<davidcelis> uggghhh
ChampS666 has joined #ruby
crescendo_ has joined #ruby
<shevy> aggghhh
friskd has joined #ruby
<davidcelis> shevy: right???
<shevy> davidcelis: left!!!
<shevy> hmmm
<shevy> we could need an extended "learn to program" online book
releod has joined #ruby
statarb3 has joined #ruby
statarb3 has joined #ruby
<canton7> that was painful to read
sandGorgon has joined #ruby
sandGorgon_ has joined #ruby
neohunter has joined #ruby
Rishi_ has joined #ruby
Rishi_ has quit [#ruby]
Rishi_ has joined #ruby
Maxou56800 has joined #ruby
mdw has joined #ruby
twqla has joined #ruby
tatsuya_o has joined #ruby
groovehunter has joined #ruby
<groovehunter> tag_types.map(&:to_s).each do |tags_type|
pingfloyd has joined #ruby
<groovehunter> hi, can u explain to me what the "&" means in this context?
<fowl> groovehunter, & sends the param as a block
shtirlic has joined #ruby
artm has joined #ruby
<groovehunter> thank you!
robkinyon has joined #ruby
IrishGringo has joined #ruby
prometheus has joined #ruby
RyanFreeman has joined #ruby
RyanFreeman has quit [#ruby]
superguenter has joined #ruby
Faris has joined #ruby
neohunter has joined #ruby
cobragoat has joined #ruby
noyb has joined #ruby
wroathe has joined #ruby
<wroathe> I'm trying to come up with a clever way of doing this... I have an array of arrays that provide display values and value values for a select tag... It looks something like this
<wroathe> vals = [['Unscheduled', 'unscheduled'], ['Final', 'final']]
<wroathe> I'm trying to find a clever way of getting a subset of those arrays without using this type of notation... vals[0]
<yxhuvud> what kinda of subset?
<wroathe> Well the actual array of arrays has about 10 arrays in it
<wroathe> And I need numbers 2, 3, and 6
<apeiros> .values_at
<wroathe> Hmm... That would work. The problem is that if the nested array is modified then that code needs to be refactored.
<wroathe> This is kind of a special data structure being made by a gem we use. I'm considering hacking in a special arr[] method to allow for symbols as selectors...
<wroathe> like arr[:unscheduled]
<yxhuvud> are you certain you don't want Array#assoc?
<fowl> wroathe, your array is in a format that can be hashified
<apeiros> ary.find { |v,k| k == :unscheduled }
<fowl> Hash[yourarrayz]
<apeiros> assoc uses the first element, not the last :-/
<apeiros> oh, k == 'unscheduled' actually
<wroathe> Actually assoc might be what I want
<wroathe> Thanks
acuozzo has joined #ruby
kah_ has joined #ruby
<yxhuvud> though wroath's variant of making a hash is probably faster if you end up with a lot of values.
<apeiros> he said 10 k/v pairs, if I understood him correctly
<wroathe> Yeah. Not sure what I'm going to do. Either way it's ugly. This is for a rails form that has a select tag with two sets of options depending on whether it's in the "New" action or hte "Edit" action
<apeiros> rails select helpers--
Aristata has joined #ruby
superguenter1 has joined #ruby
<apeiros> I remember the order of label/value by telling myself "just the opposite of how you'd do it"
t0mmyvyo has joined #ruby
<wroathe> You're talking about options_for_select?
<acuozzo> Does anyone know of any Ruby tutorials similar to <http://www.fincher.org/tips/Languages/Ruby/>? I'm a rather experienced programmer and I prefer tutorials that step through the syntax and semantics via example(s).
<wroathe> acuozzo: Just buy the Programming Ruby book from Prag Prog
<wroathe> It's the way to go
<yxhuvud> wroathe: make two separate versions without any fancy magic.
<wroathe> yxhuvud: Yeah...
<acuozzo> wroathe: It's just a long list of different examples with 1-2 sentences explaining each?
<yxhuvud> might be hard if there is a third part thingie involved of coruse
<wroathe> I'll post some code. Just one second.
trivol has joined #ruby
<acuozzo> wroathe: I'm looking at the regex chapter (http://media.pragprog.com/titles/ruby3/ruby3_extract_regular_expressions.pdf) and it seems to have many paragraphs.
hooper has joined #ruby
tomzx has joined #ruby
<wroathe> acuozzo, There's a beginners section, an intermediate section, and then a complete reference guide with examples and explanations
<wroathe> The whole book is 900 pages long
<wroathe> But it's one of the best
dwon has joined #ruby
quest88 has joined #ruby
<fowl> acuozzo, if you're reading about regexes you might find this useful: http://rubular.com/
<wroathe> So one of those sets of options_for_select will be a subset of the whole
<wroathe> If you're learning about regexes alone I highly recommend playing around with http://gskinner.com/RegExr/desktop/
igotnolegs has joined #ruby
<acuozzo> Interesting. Thanks for the suggestion -- I'll look into it further. 900 pages is a lot -- are Ruby's semantics deep enough to make a book of that length necessary?
<wroathe> 500 of those pages is the reference manual. You'll almost never read an entire reference manual from start to finish.
waxjar has joined #ruby
<wroathe> The first 400 are for people who are new to the language who want some solid foundation building stuff
kalusn has joined #ruby
zakwilson has joined #ruby
<wroathe> For someone with a lot of experience programming already I'd recommend skiping the first couple chapters as they cover basic data type stuff
<fowl> wow i never read 400 pages on programming that would probably put me to sleep
<acuozzo> wroathe: I have. However, I wouldn't call it a reference manual. I've read the ISO C90 standard from start to finish several times.
<acuozzo> Damn sequence points!
<wroathe> Nerd
<wroathe> Ritalin is a hell of a drug
<acuozzo> Implementing a compiler kinda... requires it.
<fowl> when i started with ruby they recommended two books, _why's poignant guide: http://mislav.uniqpath.com/poignant-guide/ and pickaxe
<wroathe> pickaxe == Programming Ruby 1.9
<wroathe> just fyi
kW_ has joined #ruby
<wroathe> Poignant Guide is a hell of a lot of fun to read through
<wroathe> I miss why :(
<acuozzo> Jonathan Gillette?
<fowl> Todd Faruhmoan ?
acuozzo has quit [#ruby]
<wroathe> This Jonathan Gillette guy looks nothing like _why
<wroathe> (I didn't know about this before just now)
<fowl> that's a real person? I thought we were just making up names
<wroathe> Apparently people think some guy named Jonathan Gillette is _why
neohunter has quit ["Linkinus - http://linkinus.com"]
<fowl> dont they know _why was merged into 1.9 years ago
emmanuelux has joined #ruby
swarley has joined #ruby
<wroathe> merged into?
<fowl> yep
<wroathe> Ahh, I get it :P
<wroathe> That's nerdy.
<fowl> lulz
<wroathe> I was like, "How can you merge a person into a major version of a programming language?"
<wroathe> "Ahhh..."
pxjorge has joined #ruby
* waxjar still doesn't git it
superguenter has joined #ruby
<Boohbah> it's a bzr situation
tatsuya_o has joined #ruby
workmad3 has joined #ruby
goodieboy has joined #ruby
shruggar has joined #ruby
goodieboy has joined #ruby
tayy has joined #ruby
jrhorn424 has joined #ruby
yoklov has joined #ruby
neohunter has joined #ruby
timonv has joined #ruby
AxonetBE has joined #ruby
lewix has joined #ruby
lewix has joined #ruby
sam113101 has joined #ruby
dbgster has joined #ruby
Transformer has joined #ruby
affix has joined #ruby
affix has joined #ruby
<moshee> anyone here familiar with posting photos to tumblr with oauth/xauth?
<moshee> or, more generally, posting binary data over HTTP
<fowl> hey everyone, moshee is looking for a tumblr hipster
<moshee> uh
<moshee> guess not then?
<fowl> im just kidding moshee <3
<moshee> for some reason tumblr wants the binary data url-encoded
goodieboy has joined #ruby
chimkan_ has joined #ruby
<moshee> I should probably mention the problem I'm having, URI.encode is giving me a "invalid byte sequence in UTF-8" error
<moshee> ...because it's not UTF-8, it's binary data
<fowl> moshee, try String#force_encoding
<moshee> which encoding should I use
<shevy> dont you love the new encoding in ruby 1.9.x
<moshee> I have it forced to ascii 8bit right now, which someone mentioned on SO
<fowl> i want to say US-ASCII, but I'm not sure
<moshee> it's not working, apparently
<moshee> neither does us-ascii
<moshee> maybe I'll have to monkeypatch URI
<shevy> wroathe I always hated the poignant guide
<Tasser> shevy, encoding makes you care about stuff that would bite you otherwise
<shevy> Tasser, encoding never bit me in 1.8.x
zetm has joined #ruby
<shevy> only application to complain was in ruby-gtk, where Glib can be used though as in GLib.convert(string, 'utf-8', 'iso-8859-1') and vice versa
<shevy> and GLib.locale_to_utf8 and GLib.locale_from_utf8
<fowl> moshee, when I do f = IO.binread('./some.gz'); f.encoding gives 'ASCII-8BIT'
<Tasser> fowl, I hope so :-)
<alindeman> FWIW, I had the opposite experience: no encodings bite me in 1.8 all the time
<burgestrand> moshee: use CGI.escape instead
baroquebobcat has joined #ruby
<alindeman> (mostly moved to 1.9, but the few 1.8 holdouts have been painful here and there)
<moshee> OAuth::AccessToken#post uses something internally
csprite has joined #ruby
kW_ has joined #ruby
havenn has joined #ruby
wallerdev has joined #ruby
ooldirty has quit ["Ex-Chat"]
<moshee> the api gives me a helpful "error uploading photo" error
<burgestrand> moshee: is it your photo you are escaping?
<moshee> yes
<burgestrand> moshee: why?
<shevy> it is too ugly
baroquebobcat has joined #ruby
<moshee> apparently tumblr wants a url encoded binary file
<shevy> put it very far away from your eyes then you don't have to escape from it anymore
<moshee> I'm not too sure why either
KL-7 has joined #ruby
<burgestrand> moshee: odd
CrazyPickles has joined #ruby
<CrazyPickles> could someone tell me how to setup my texcords correctly http://pastebin.com/RhqAyNC5
<burgestrand> moshee: ah, they take it as a parameter, that explains it
<burgestrand> and not as the post body
<moshee> yeah
<burgestrand> CGI.escape should be it
mxweas_ has joined #ruby
<moshee> http://pastebin.com/dXsnueAH this by itself gives me that utf-8 error, and using CGI.escape gives me an API error
<moshee> I think it's escaping it twice
goodieboy has joined #ruby
<Boohbah> # encoding: utf-8
Sailias has joined #ruby
<moshee> yeah, it's there
<fowl> moshee, you dont close the file you opened
<fowl> File.read() will do this for you
<moshee> oh
<fowl> but I think you should use IO.binread
<moshee> alright, I'll try that
<moshee> didn't know about that
<fowl> thats probably not the problem here its just good to know
<moshee> yeah, still UTF-8 error
<fowl> they say to base64encode it
artm has joined #ruby
Faris has joined #ruby
Drewch has joined #ruby
<moshee> bad request again
<moshee> :(
thone has joined #ruby
<burgestrand> moshee: I don’t see you CGI.escaping in that code sample
<moshee> I had it around the File.open part
icrazyhack has joined #ruby
<moshee> saved the file on instinct after removing it
srid has joined #ruby
ziyadh has joined #ruby
relix has joined #ruby
ephemerian has joined #ruby
kesor_ has joined #ruby
nvez has joined #ruby
pkondzior has joined #ruby
v3n0m has joined #ruby
fortysixandtwo has joined #ruby
<moshee> ah, here we go, Net::HTTP::Post.new(path,headers)
superguenter has joined #ruby
<moshee> is now it's done under the hood
zetm has quit ["ERC Version 5.3 (IRC client for Emacs)"]
t0mmyvyo has joined #ruby
randym has joined #ruby
dkamioka has joined #ruby
kaichanvong has joined #ruby
pingfloyd has joined #ruby
avandendorpe has joined #ruby
BryanWB has joined #ruby
rexamophone has joined #ruby
jonteru has quit [#ruby]
relix has joined #ruby
dotemacs has joined #ruby
CombatWombat has joined #ruby
davidboy has joined #ruby
Supermans_Brothe has joined #ruby
EvanR has joined #ruby
BryanWB has joined #ruby
dekz has joined #ruby
mengu has joined #ruby
relix has joined #ruby
srid has joined #ruby
davidboy has joined #ruby
virunga has joined #ruby
<moshee> woohoo, it works now!
<moshee> had to monkeypatch OAuth::Helper.escape
andrewhl has joined #ruby
EvanR_ has joined #ruby
JC_SoCal has joined #ruby
dotemacs has joined #ruby
CombatWombat has joined #ruby
<dkamioka> moshee: dont know what you are talking about, but congrats! =)
KL-7 has joined #ruby
shtirlic_ has joined #ruby
jacktrick has joined #ruby
gabeh has quit [#ruby]
archivebot has joined #ruby
John_____ has joined #ruby
wilmoore has joined #ruby
goodieboy has joined #ruby
kalv has joined #ruby
EvanR_ has joined #ruby
QKO has joined #ruby
jcrossley3 has joined #ruby
jhowarth has joined #ruby
srid has joined #ruby
relix has joined #ruby
Aristata has joined #ruby
arnihermann has joined #ruby
fowl has joined #ruby
fowl has joined #ruby
JC_SoCal has joined #ruby
relix has joined #ruby
randym has joined #ruby
EvanR has joined #ruby
davidboy has joined #ruby
BryanWB has joined #ruby
arnihermann has joined #ruby
t0mmyvyo has joined #ruby
EvanR_ has joined #ruby
JC_SoCal has joined #ruby
atmosx has joined #ruby
rhce7320 has joined #ruby
EvanR_ has joined #ruby
Chank_ has joined #ruby
_Chank has joined #ruby
liluo has joined #ruby
EvanR_ has joined #ruby
prometheus has joined #ruby
cogweh has joined #ruby
Drewch has joined #ruby
Rishi_ has joined #ruby
keymone_ has joined #ruby
jacktrick has joined #ruby
<Veejay> http://pastie.org/3668492 <-- The fiber version is killing the other version and I'd like to understand why that is
<Veejay> If anyone knows about fibers and wants to educate me, that'd be awesome
<Veejay> (Or tell me if the benchmark is actually bad and provides bogus insight about fibers and their benefits)
<heftig> Veejay: the fiber is iterative instead of recursive
<heftig> you save on method calls.
<Veejay> So maybe pit it against an iterative version of fibonacci?
goodieboy has joined #ruby
<heftig> Veejay: no, it is already an iterative version
<heftig> the only difference is that the fiber will produce all fibonacci numbers in sequence and return them (you're skipping n-1 of them in that code)
<Veejay> Thanks a lot for the explanation
<Veejay> The iterative version is about 10 times faster than the fiber version it turns out
<burgestrand> the recursive variant will calculate the same fibonacci numbers several times
<heftig> right, that too
<Veejay> Yeah
`gregorg` has joined #ruby
<burgestrand> it’s probably even slower if you increase n :)
<Veejay> By the way, I'm not sure I get how Benchmark works
EvanR_ has joined #ruby
<Veejay> It returns its results after the 1000.times block
<Veejay> I don't really have a "report" per se
<otters> can you not catch a SystemCallError?
christopherlee has joined #ruby
<heftig> otters: sure works
<otters> RUBY_VERSION == 1.9.2
<heftig> exec doesn't return if it succeeds
<heftig> it replaces the current process
<otters> ...
<otters> balls
macgregor has joined #ruby
<heftig> (classic posix exec)
<heftig> otters: you probably want system()
<otters> I see
<macgregor> hey guys I have syntax question
<Veejay> What are the real-world application of fibers by the way. I read a blog about a dude implementing Enumerable using fibers and that was pretty cool but...
<macgregor> I forked a project that uses validates :title, presence: true
<macgregor> that type of syntax instead of :presence => true
<heftig> Veejay: continuation-passing style programming
<shadoi> Veejay: read about coroutines
<macgregor> and the app keeps crashing
<shadoi> fibers are essentially a coroutine implementation
<macgregor> I'm wonder if I'm missing something here
<Veejay> Coroutines huh?
<Veejay> Interesting
EvanR_ has joined #ruby
<heftig> there's also Enumerator.new
<Veejay> Yeah I saw that, it was interesting
<Veejay> The .next which is basically a Fiber.resume
<Veejay> But I'm having a hard time envisioning how *I* could make use of them when I grasp the concept better
<Veejay> Also, isn't that all crippled by the GIL anyway? (naive question, bear with meLD)
<heftig> Veejay: crippled?
<heftig> (btw, rubinius uses Fiber to implement Enumerator)
EvanR_ has joined #ruby
<Veejay> By naive I really mean "dumbfounded"
<Veejay> Basically I'm talking nonsense
<Veejay> hehe
<Veejay> Nah it's just that those coroutines are associated to parallel execution in my mind
<macgregor> anyone? I'm really confused
bluebie has joined #ruby
<heftig> macgregor: the crashes go away if you change the syntax?
<Veejay> macgregor: That syntax was introduced in Ruby 1.9
<Veejay> IIRC
<heftig> yes.
<Veejay> So make sure your version of ruby is recent enough
<macgregor> Veejay, interesting I'm running 1.8.7
<Veejay> There you go
<Veejay> So yeah, just replace with old syntax if you can
<Veejay> Or upgrade
EvanR_ has joined #ruby
<macgregor> kk perfect
Bonkers has joined #ruby
EvanR_ has joined #ruby
fayimora has joined #ruby
freeze has joined #ruby
EvanR_ has joined #ruby
ZachBeta has joined #ruby
MopMopperton14 has joined #ruby
goodieboy has joined #ruby
EvanR_ has joined #ruby
goodieboy has joined #ruby
goodiebo_ has joined #ruby
baroquebobcat has joined #ruby
baroquebobcat has joined #ruby
EvanR has joined #ruby
kpshek has joined #ruby
Mcilvena has joined #ruby
fayimora has joined #ruby
goodieboy has joined #ruby
Mcilvena has quit [#ruby]
EvanR has joined #ruby
ZachBeta has joined #ruby
BryanWB has joined #ruby
voodoofish has joined #ruby
EvanR has joined #ruby
cogweh has joined #ruby
cogweh has quit [#ruby]
CombatWombat has joined #ruby
CombatWombat has joined #ruby
CombatWombat has joined #ruby
axl_ has joined #ruby
fayimora has joined #ruby
<Veejay> http://jdfrens.blogspot.ca/2010/07/more-fibers-for-rails.html <--- If anyone's interested in fibers and threads and the Ruby VM and the GIL and all that good stuff, this video is extremely well done and explains things well
EvanR has joined #ruby
Faris has joined #ruby
JC_SoCal has joined #ruby
randym has joined #ruby
kapowaz has joined #ruby
ninor has joined #ruby
arnihermann has joined #ruby
jhowarth has joined #ruby
EvanR has joined #ruby
<banisterfiend> Veejay: doesnt it concern you that it all could be lies
chimkan_ has quit [#ruby]
<Boohbah> the date of the post concerns me
Drewch has joined #ruby
ziyadh has joined #ruby
jsonperl has joined #ruby
<jsonperl> in a c extension i've created, ruby is calling the free function the first time the garbage collector runs
foo-bar- has joined #ruby
<jsonperl> im unclear on how to mark the object appropriately so that the GC leaves it alone
<jsonperl> anywhere anyone can point me?
Banistergalaxy has joined #ruby
archivebot has joined #ruby
n00b4lyfe has joined #ruby
dwon has joined #ruby
Drewch has joined #ruby