Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
<andrewvos> banister`sleep: Hmm. JS and PHP lately.
<andrewvos> banister`sleep: In the contract I'm in now. Previously a lot of .net.
<shevy> lianj that's how it looks afterwards. http://img210.imageshack.us/img210/2504/foopar.png as long as I don't know how to consistently avoid that, I can't switch
zzak joined #ruby-lang
<andrewvos> Gemfile.lock <-- I'm starting to think it should be left in the repo.
<andrewvos> Discuss?
lsegal joined #ruby-lang
<lianj> shevy: ruby -ryaml -e 'File.open("t.yml","wb"){|f| f.print({ "äh" => "öh" }.to_yaml) }'; cat t.yml # no ruby issue
slyphon joined #ruby-lang
looopy joined #ruby-lang
Austin__ joined #ruby-lang
<shevy> lianj yup, ruby is fine if the file is UTF-8, however in my editors (save for geany) and the terminal, the characters no longer appear as � � or �
<lianj> echo $LANG
<shevy> en_US.UTF-8
<lianj> have you tried turning it off and on again
<shevy> lianj changing $LANG? yup, no effect
<lianj> no, the machine :P
<shevy> well you wrote turning it on and off, so I wasn't sure what you meant with "off". Perhaps LANG to ''
dv310p3r joined #ruby-lang
<burgestrand> andrewvos: for projects? yes. for libraries? probably not.
amerine joined #ruby-lang
<heftig> shevy: your terminal isn't utf8
<shevy> heftig that may be a possibility. vim and bluefish load the file incorrectly though
<heftig> gvim or vim?
<shevy> vim
<heftig> :set enc?
<heftig> what does that return?
<shevy> E519: Option not supported: enc
<heftig> what.
<shevy> that's what it returns, with a nice flash red status bar
<heftig> great, your vim doesn't support encodings
<shevy> :(
<heftig> cat /sys/module/vt/parameters/default_utf8
<shevy> 0
<lianj> shevy: as i told you multiple times on other channel. dev/null your machine and free this machine from your stoneage setup.
[1]maarten joined #ruby-lang
<heftig> indeed
<shevy> lianj and this will solve all my problems as you promise?
<heftig> shevy: use a newer linux distribution.
<shevy> :(
<lianj> you hold back that move for years now :P
<lianj> not using X because youre unable to compile it in this broken setup etc ;)
<shevy> lianj I know that the move will force me to use UTF-8
<shevy> It's not as if I have to switch one component and then suddenly everything else works without a problem, I'll have to switch my work habit as well
<Austin__> dear god. How old *is* your setup?
<lianj> sounds like youre afraid of UTF-8. dont be. the point is you can't complain if youre on a years old broken setup or even expect to use it some month more
<lianj> Austin__: please, lets not go there :D
* Austin__ can't think of the last time he used a vim that didn't support encodings.
<shevy> Austin__ 5 months
<shevy> not my fault when you assume something that is incorrect
<lianj> i dont believe that :>
<shevy> lianj what editor are you using?
<lianj> vim
<lianj> shevy: uname -r
<shevy> no
<shevy> I just fixed vim
<shevy> :set enc now returns:
<shevy> "encoding=iso-8859-15"
<shevy> 3.0.4
<shevy> ok, vim works now
<shevy> back to the original problem
<shevy> lianj, if I create a file, with " al�ias: alias" and store it in some ISO* format, all is fine. When I save it in vim, like with :set fileencoding=utf-8, it is changed
<shevy> it becomes "aliöas: alias"
tomzx joined #ruby-lang
<shevy> and also in vim
<shevy> urgh
<shevy> aliases.yml: UTF-8 Unicode text
<shevy> well it works when I change to UTF-8
<lianj> shevy's personal rabbit hole
<shevy> not in vim though
<shevy> <lianj> shevy: can you show an example for your yaml issue? works fine here, dont make up excuses :P
<shevy> well, I showed you.
<shevy> your solution is to switch to UTF-8
ryanf joined #ruby-lang
<shevy> but you gave me an idea :)
ttilley joined #ruby-lang
<shevy> since the only problem are yaml files, I could keep them in UTF-8
ttilley joined #ruby-lang
<lianj> yes, but not just in vim. your whole system.
<shevy> lianj as I wrote above, the UTF-8 files work just fine on UTF-8. Just the terminal display is odd. But then again I am not using UTF-8 really
<shevy> sorry
<shevy> work fine in *geany
<lianj> using UTF-8 in 2011 it not like switching to hurd or something but you sure make sound it that way
<shevy> hurd would probably work less
looopy joined #ruby-lang
kith_ joined #ruby-lang
echoprinter joined #ruby-lang
qpingu left #ruby-lang
srbaker joined #ruby-lang
<rue> Probably
curtism joined #ruby-lang
Manhose_ joined #ruby-lang
<steveklabnik> andrewvos: i see you got your answer.
<slyphon> dammit, emacs
<slyphon> why do you have to be messier than RMS' beard?
* slyphon throws up his hands
Manhose__ joined #ruby-lang
looopy joined #ruby-lang
chessguy joined #ruby-lang
Manhose__ joined #ruby-lang
looopy joined #ruby-lang
curtism joined #ruby-lang
wyhaines joined #ruby-lang
Jade joined #ruby-lang
curtism joined #ruby-lang
Jade joined #ruby-lang
savage- joined #ruby-lang
woollyams joined #ruby-lang
<Indian> ok so this is happening
woollyams joined #ruby-lang
ecin_ joined #ruby-lang
Pip joined #ruby-lang
Chat9939 joined #ruby-lang
theconartist joined #ruby-lang
towski joined #ruby-lang
krz joined #ruby-lang
curtism joined #ruby-lang
curtism joined #ruby-lang
ryanf_ joined #ruby-lang
<erikh> odd question, but can anyone recommend a good pc scissor key keyboard?
mong8se joined #ruby-lang
curtism joined #ruby-lang
livinded joined #ruby-lang
looopy joined #ruby-lang
x0F__ joined #ruby-lang
curtism joined #ruby-lang
banister`sleep joined #ruby-lang
mong8se left #ruby-lang
curtism joined #ruby-lang
tomzx joined #ruby-lang
* Austin__ sighs.
<Austin__> I hate refactoring sometimes.
mong8se joined #ruby-lang
mong8se joined #ruby-lang
samshull joined #ruby-lang
kmeehl joined #ruby-lang
artOfWar joined #ruby-lang
udzinari joined #ruby-lang
udzinari` joined #ruby-lang
SixEcho joined #ruby-lang
kmeehl joined #ruby-lang
tomzx joined #ruby-lang
dfr|mac joined #ruby-lang
brushbox joined #ruby-lang
Austin__ left #ruby-lang
GutenLinux joined #ruby-lang
tallship joined #ruby-lang
srbaker joined #ruby-lang
perryh joined #ruby-lang
perryh joined #ruby-lang
sqbell joined #ruby-lang
ryanf joined #ruby-lang
jxie_ joined #ruby-lang
ryanf_ joined #ruby-lang
rippa joined #ruby-lang
samshull joined #ruby-lang
rbio left #ruby-lang
LanceHaig joined #ruby-lang
woollyams joined #ruby-lang
SixEcho1 joined #ruby-lang
SixEcho1 left #ruby-lang
amerine joined #ruby-lang
dr_bob joined #ruby-lang
dnjaramba_ joined #ruby-lang
rippa joined #ruby-lang
robotmay joined #ruby-lang
dnjaramba joined #ruby-lang
vesan joined #ruby-lang
yxhuvud joined #ruby-lang
<shevy> what's up
<shevy> everyone sleepy
<banister`sleep> shevy: you promised me some recordings of you speaking english
<shevy> true
* dr_bob is awake
<banister`sleep> dr_bob: i heard that pry is really awesome alternative to irb btw
* dr_bob actually hasn't used it yet.
<banister`sleep> dr_bob: i heard it brings all the boys to the yard
<dr_bob> That must be an English idiom I am not aware of. What do you mean?
<shevy> he speaks aussie slang today
<dr_bob> Oh
<banister`sleep> dr_bob: the expression is explained here http://www.youtube.com/watch?v=6AwXKJoKJz4&ob=av2n
<dr_bob> "Unfortunately this video is not available in Germany because it may contain music for which GEMA has not granted respective music rights."
<andrewvos> steveklabnik: I don't even remember the question.
<andrewvos> burgestrand: Yeah for projects I've been .gitignore'ing it
hebz0rl joined #ruby-lang
<andrewvos> burgestrand: Which becomes a nightmare when you have to constantly upgrade to support gem changes.
<shevy> yeah
<shevy> welcome to EUROPE!!!
<dr_bob> Ah, I think I got it. :-)
<andrewvos> steveklabnik: Jesus that video is fucked up.
<andrewvos> Can't believe that happens in America
cyri_ joined #ruby-lang
yawnyawn joined #ruby-lang
<aef> can anyone tell me if there is a way to check if there's something to read inside an IO object before I try to read it? i have stderr and stdout. normally i want to return whats in stdout but if there's something in stderr i want to return that instead. but if i do stderr.readline the system blocks if nohting is in it
Locke23rus joined #ruby-lang
saLOUt joined #ruby-lang
Codif joined #ruby-lang
<andrewvos> Hmmm. Anyone using octopress?
<andrewvos> I want to use it but it looks too big. Maybe just jekyll?
saLOUt_ joined #ruby-lang
dr0id joined #ruby-lang
Codif joined #ruby-lang
Codif joined #ruby-lang
frangiz joined #ruby-lang
Pupeno joined #ruby-lang
yorickpeterse joined #ruby-lang
chendo joined #ruby-lang
benanne joined #ruby-lang
virunga joined #ruby-lang
<andrewvos> Damn. If you don't want to use the default theme in octopress you're in for some hacking.
Mchl joined #ruby-lang
RomD joined #ruby-lang
<virunga> Hi, with the interpreter how can I reload a file required?
<virunga> a required file
<yxhuvud> load
<virunga> yxhuvud, and how can i flush it?
<virunga> remove it
<yorickpeterse> You can only re-evaluate it using eval(), instance_eval(), etc
<yorickpeterse> require() is a one time thing only, it doesn't reload files (for very good reasons)
<andrewvos> virunga: Why do you want to do this?
workmad3 joined #ruby-lang
virunga joined #ruby-lang
<yxhuvud> yorickpeterse: on the other hand, load do reload the file. (it doesn't flush whatever what was defined in previous runs, but it will override anything that is still defined)
<virunga> yxhuvud, the light is gone when you were writing. Can you rewrite the answer, please?
<yxhuvud> uh, you were present during both my answers.
<rue> But the lights were off
<virunga> yxhuvud, in the log i can see only my last sentence
<virunga> :)
<yxhuvud> [12:28] <yxhuvud> yorickpeterse: on the other hand, load do reload the file. (it doesn't flush whatever what was defined in previous runs, but it will override anything that is still defined)
<virunga> yxhuvud, but if i want delete/remove it?
<yxhuvud> you don't. you can evaluate stuff, not unevaluate anything.
<virunga> ok
<virunga> yxhuvud, thank you
kitallis joined #ruby-lang
Natch| joined #ruby-lang
Natch| joined #ruby-lang
looopy joined #ruby-lang
<banisterfiend> yxhuvud: well he could remove constants and methods and so on :)
<banisterfiend> but not that easy
hexo joined #ruby-lang
<yorickpeterse> path = '....'; eval(File.read(path), File.size(path)) :3
takaokouji joined #ruby-lang
dr_bob joined #ruby-lang
<andrewvos> Hmmm
<andrewvos> I'm writing a test to make sure that a method caches a file read after the first try.
<andrewvos> Thoguhts?
<andrewvos> thoughts*
<andrewvos> How would I be sure without mocking?
<manveru> isn't that the job of your OS?
<andrewvos> I could check the speed of it.
<andrewvos> manveru: I'm writing a hack onto pygmentize which is a gem that shells out to python.
<andrewvos> manveru: And python reads teh file.
<andrewvos> manveru: This is really slow so I want to cache it.
<manveru> ok
<manveru> well, you could check the object id
<andrewvos> manveru: True.
<andrewvos> manveru: What about testing that the time it takes is much less than the time it initially takes?
<dr_bob> andrewvos: how do you cache it in ruby land if python reads it? Does the Python process write it to stdout?
<andrewvos> dr_bob: There's a method call like Pygmentize.process("bleh", :javascript)
<manveru> dr_bob: yeah
<manveru> pygmentize works with stdin/stdout
<manveru> the gem is just a nicer wrapper for that
<andrewvos> manveru: Hmm
<manveru> andrewvos: well, timing it might work
<andrewvos> manveru: object_id seems ok
<manveru> as long as both ruby and pygmentize don't change much
<andrewvos> Yeah
<andrewvos> I think object_id is the better approach.
<andrewvos> Thanks, much appreciated!
<manveru> no problem
<manveru> you probably also wanna freeze the cached content
<Mon_Ouie> I would not test optimization at all
<Mon_Ouie> I would just test if the code still works after adding those
<manveru> :)
<andrewvos> manveru: Why would I need to freeze the cached content?
<andrewvos> Mon_Ouie: You make an interesting point.
<manveru> in case you forget it's cached, and you use destructive methods
<manveru> otherwise i'd .dup and return that instead
<manveru> but then your object_id spec will fail
<manveru> so you basically say ".dup" that, or everyone's in trouble
<manveru> and .freeze is the way to do that
<andrewvos> Hmm
<manveru> kinda like hash keys, if you try to mutate them, the hash would go bad
Pip joined #ruby-lang
<andrewvos> Aww hell yeah it worked.
<andrewvos> Don't you love it when a problem can be solved by writing some code?
Pip joined #ruby-lang
dragonkh joined #ruby-lang
petercooper joined #ruby-lang
<manveru> why the hell do you think i'm here? :)
jensn joined #ruby-lang
Codif joined #ruby-lang
Carnage\ joined #ruby-lang
<andrewvos> :)
<petercooper> Statistically, people are here to lurk and burn processor cycles.
<andrewvos> petercooper: We are the 1%?
<petercooper> lol
<petercooper> I don't tend to see more than 4 or 5 people talking at once, so maybe so ;-)
<andrewvos> Damnit heroku why you not be consistent with my local environment :(
<petercooper> But like the real life 1%, people drop in and out of it on here too ;-)
Dreamer3 joined #ruby-lang
* andrewvos just realises that he deleted the only working fork of pygmentize what worked on heroku :(
<petercooper> Did anyone ever come up with something like Pygments on Ruby that's... "almost" as good? :)
<andrewvos> petercooper: No
<petercooper> Stupid question I guess since so many ppl (including me) keep using Pygments ;-)
<andrewvos> petercooper: Yeah :(
<andrewvos> petercooper: You're not on heroku I guess
empity joined #ruby-lang
<petercooper> Nah, I didn't win the lottery yet
<petercooper> Need to add that to my code reading list,
<andrewvos> petercooper: It's expensive?
<dr_bob> andrewvos: regarding the test: maybe you can look at process times - if there is significant system time then chances are that the process did IO
<andrewvos> dr_bob: It's ok I just used object_id
<petercooper> andrewvos: I've put a cpl things on there for free to "play" over the years, but it strikes me as expensive once you move beyond that level.
<andrewvos> Hmmm.
<andrewvos> I have a fork with a fix, and I want to apply another fix to it. So, two pull requests that I need in one. Thoughts?
workmad3 joined #ruby-lang
<rue> What does “need in one” mean?
<andrewvos> rue: I need them both.
<rue> You can submit pull requests off different branches
dr0id joined #ruby-lang
<rue> So…apply them both?
<andrewvos> rue: Thanks
wyhaines joined #ruby-lang
shevy joined #ruby-lang
wyhaines joined #ruby-lang
toretore joined #ruby-lang
SuperTaz joined #ruby-lang
saLOUt joined #ruby-lang
sepp2k joined #ruby-lang
Spooner joined #ruby-lang
heftig joined #ruby-lang
workmad3 joined #ruby-lang
<andrewvos> alias cat=lolcat
meise joined #ruby-lang
gokulnath joined #ruby-lang
basicxman joined #ruby-lang
freedrull joined #ruby-lang
lucas joined #ruby-lang
ReinH_ joined #ruby-lang
ironcamel joined #ruby-lang
bmaland_ joined #ruby-lang
theoros_ joined #ruby-lang
_br_ joined #ruby-lang
ohsix joined #ruby-lang
pabs_ joined #ruby-lang
dhoss_ joined #ruby-lang
theoros_ joined #ruby-lang
rhizmoe_ joined #ruby-lang
t0h joined #ruby-lang
Radar_ joined #ruby-lang
rue joined #ruby-lang
korch joined #ruby-lang
Netfeed joined #ruby-lang
aef_ joined #ruby-lang
tekin joined #ruby-lang
anekos joined #ruby-lang
s0undt3ch joined #ruby-lang
dres joined #ruby-lang
RubyNewb joined #ruby-lang
zigidias joined #ruby-lang
yellow5 joined #ruby-lang
musl joined #ruby-lang
comboy joined #ruby-lang
dagobah_ joined #ruby-lang
akr_ joined #ruby-lang
takaokouji joined #ruby-lang
stepnem joined #ruby-lang
zmack joined #ruby-lang
Pip joined #ruby-lang
Ttech joined #ruby-lang
Pip joined #ruby-lang
tbuehlmann joined #ruby-lang
takaokouji joined #ruby-lang
apeiros_ joined #ruby-lang
fayimora joined #ruby-lang
Jake232 joined #ruby-lang
udzinari joined #ruby-lang
saLOUt joined #ruby-lang
looopy joined #ruby-lang
Indian joined #ruby-lang
samshull joined #ruby-lang
Codif joined #ruby-lang
kitallis joined #ruby-lang
udzinari joined #ruby-lang
La0fer joined #ruby-lang
hackeron joined #ruby-lang
<hackeron> hey, I'm confused - why does this: [[ -f parse_data.rb ]] && echo require \'parse_data.rb\' | irb -- return LoadError: cannot load such file -- parse_data.rb -- the file is definitely in the current directory :/
<lianj> irb -I.
<hackeron> this is the full error: http://pastie.org/2893099
<hackeron> lianj: no change with irb -I
<lianj> "-I."
<workmad3> hackeron: are you on ruby 1.9.2 or 1.9.3?
Indian joined #ruby-lang
<hackeron> workmad3: 1.9.3
<hackeron> lianj: it doesn't search the current path by default?
<workmad3> hackeron: yeah... the current path isn't on the load path since 1.9.2
<workmad3> it actually caused a lot of unexpected behaviour
<hackeron> workmad3: yeh, seems a big bizzare - what was the reason for the change?
<hackeron> bit*
<workmad3> hackeron: as I understand it, people were actually expecting the load path to require relative to the file they were in, rather than from the current directory
<workmad3> hackeron: so things would work as long as they were in the correct directory when they started the program... but when they switched directories, things went wrong
<workmad3> hackeron: if you actually want to require from the current directory, you can just use 'require "./whatever" ', or if you want to require relative to the file you're in, you can use 'require_relative "whatever" '
<workmad3> hackeron: basically, they just made it much more explicit as to when you are requiring from the current directory :)
<hackeron> workmad3: I guess that kind makes sense
sepp2k joined #ruby-lang
<lianj> echo 'p :bazinga; exit' > rubygems.rb; ruby -I. -e 'p :what'
<workmad3> lianj: :) although I think . used to be last on the load path, so the site rubygems would be found first
<lianj> ruby -I. -e 'p $:[0]'
<workmad3> lianj: ah, it's different if you use -I I guess
looopy joined #ruby-lang
<workmad3> lianj: also, even that is different from pre 1.9.2 ruby, when '.' was on the load path... with -I. the . is expanded and the current directory is added... with '.' on the load path, if the current directory changes then the load path is now different :)
hagabaka joined #ruby-lang
<workmad3> lianj: also... love the BBT reference :)
rippa joined #ruby-lang
slyphon joined #ruby-lang
ttilley joined #ruby-lang
saLOUt joined #ruby-lang
workmad3 joined #ruby-lang
dfr|mac joined #ruby-lang
Manhose joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
<andrewvos> man, skyrim is huge.
<rippa> andrewvos: about the size of oblivion
<oddmunds> daggerfall is huge
<rippa> and procedurally generated
<Mon_Ouie> I never figured out where I had to go in Morrowind, I was lost in all the side-quests
<rippa> I never completed main quest in TES games
<Mon_Ouie> I remember I spent some time creating potions that increased my intelligence to create better potions yet so I could get infinite bonuses
saLOUt joined #ruby-lang
looopy joined #ruby-lang
<andrewvos> haha
s0undt3ch joined #ruby-lang
saLOUt joined #ruby-lang
tomzx joined #ruby-lang
lsegal joined #ruby-lang
workmad3 joined #ruby-lang
darkf joined #ruby-lang
nuclearsandwich joined #ruby-lang
rushed joined #ruby-lang
sepp2k joined #ruby-lang
looopy joined #ruby-lang
jbwiv joined #ruby-lang
kmeehl joined #ruby-lang
echoprinter left #ruby-lang
srbaker joined #ruby-lang
me345 joined #ruby-lang
dejongge joined #ruby-lang
saLOUt joined #ruby-lang
Axsuul joined #ruby-lang
heftig joined #ruby-lang
looopy joined #ruby-lang
<infid> why does Float::RADIX say 2, and what's that constant normally used for?
<infid> seems strange that it's a constant and not a method
kmeehl joined #ruby-lang
naz joined #ruby-lang
looopy joined #ruby-lang
retro|cz joined #ruby-lang
artOfWar joined #ruby-lang
fayimora_ joined #ruby-lang
<andrewvos> Can anyone recommend a great programming talk for me to watch?
<andrewvos> Need some inspiration.
<andrewvos> Haven't coded something for weeks (other than work)
<andrewvos> I like how this readme automagically includes samples: https://github.com/ahoward/slave
looopy joined #ruby-lang
stuckinthecloud joined #ruby-lang
<andrewvos> Hmmm
<andrewvos> SRP kind of implies each class only has one public method, and perhaps multiple private methods.
Manhose joined #ruby-lang
<infid> i don't know about that
Manhose_ joined #ruby-lang
<infid> i feel like it's more that it should just be 'about' a single thing
<infid> an XMLWriter class isn't going to only have one public method, but it's all about writing xml
<andrewvos> Well, responsibility.
<andrewvos> This is a great point.
<andrewvos> But what about an xml writer that writes to a file, as opposed to one that writes to a stream. Are these two different responsibilities?
<infid> "there should never be more than one reason to change the class"
<andrewvos> infid: Are you agreeing?
<infid> so i don't really feel it's necessary to extract more classes out of it unless you're separating what changes from what stays the same
dv310p3r joined #ruby-lang
<infid> 'writer' to me means it could be polymorphically writing to different things
<infid> so it all depends how you implement it, since you don't want to repeat the same code in multiple classes
<andrewvos> This is a reason to extract out multiple classes though.
<infid> perhaps
<andrewvos> But, as always, it's hard to find a good example.
<infid> i let the tests determine that design
ivorybishop joined #ruby-lang
<andrewvos> What if we could only have one public method per class?
<manveru> what good is that for?
<andrewvos> Would it be possible to write software that did anything useful?
<manveru> you mean for instances?
<andrewvos> manveru: Theoretically.
<manveru> or class methods?
<andrewvos> No class methods. Only instance methods.
<andrewvos> And a single constructor.
<manveru> well, lambda calculus exists :)
<manveru> would be one great PITA to write in it though
<erikh> I can't think of a wordier C than that.
<erikh> I'm impressed
<manveru> FixnumPlusFixnum.new(1) + 1
<andrewvos> ahha
<erikh> MoveToNextItem.new(item).next
<andrewvos> erikh: Smoke?
<erikh> ?
<erikh> I am not
<andrewvos> Nice
<erikh> I snuck one in this morning, today was being malevolent
<andrewvos> erikh: :(
<erikh> but outside that I've done pretty well
<erikh> going from a pack and a half a day to zilch, mind you
<andrewvos> Anyway, I kind of want to mock this language up and see if it works.
<deryl> erikh: doing better than me. I lasted 4 days, then I couldn't take it anymore and had a smoke.
<andrewvos> Check this: https://gist.github.com/1380687
<erikh> eh this is day 3 technically
<erikh> and I slipped half of one in this morning, a cigar to be precise
<erikh> couldn't justify buying a whole pack for one of them, that would have been bad
<manveru> andrewvos: try doing math...
<manveru> or string manipulation
<infid> andrewvos: if you did that your class would be following SRP but not likely following OCP wouldn't it
<andrewvos> Open Closed Principle?
<andrewvos> How so?
<infid> yeah. if everything's private, how is the class open for extension
<erikh> brb
<andrewvos> Well, it's not.
<andrewvos> Open I mean.
<andrewvos> manveru: Why couldn't you do math?
<andrewvos> It's just lines of code inside the public method.
<erikh> I do some kinds of drivers that way
<erikh> but that's more a pattern than a language
melic joined #ruby-lang
<andrewvos> Interesting.
<andrewvos> What do you find when writing code likethat?
<erikh> that it's easy to pass around classes and not care about what they do
<erikh> because I can instantiate them trivially and execute them just as simply
<erikh> I believe this is called a manager in java
<andrewvos> Ahh. Now we're on to something :)
<erikh> but that's a pattern, not a language construct
<erikh> and I'm with manveru here, it'd be silly
<andrewvos> :)
<erikh> I mean you might as well write C and use structs.
<erikh> it'd be a lot faster, too.
<andrewvos> Hmm
<deryl> what gets me is I can code fine in C, but Ruby I have issues with learning (Though the Lynda.Com Ruby Essentials and the books I have are helping a lot (though i learn better from the vids))
<andrewvos> deryl: You have to write something in it to learn ;)
<deryl> andrewvos: i have
<deryl> in both languages
<infid> deryl: probably because it's a different way of thinking
<erikh> well going from C to "proper" OOP is a pretty rough transition
<erikh> yeah.
<erikh> what infid said.
<deryl> github.com/wayneeseguin/rvm-test and github.com/deryldoucette/rvm-testsuite :)
<deryl> ahh cool. then its not entirely a deficiency in my head :)
<infid> syntax and all that is easier but thinking differently is the hard part. I went from C to Java and Ruby and now trying functional languages again is warping my mind
<deryl> hehe. good then its not just a personal affliction. makes me feel a LOT better
<erikh> hrm
<erikh> deryl: have you done any C++?
<deryl> erikh: a tiny bit. not proficient by any means
<erikh> it's not the nicest language, but it'd be a nice middle ground
<infid> or javascript
<erikh> but you know the difference between struct { } and class { } right?
<deryl> yes
<erikh> in C++, not in C.
<erikh> anyhow, that might help some.
<erikh> most objects are really just fancy structs of data and function pointers.
<deryl> struct in C is the same as C++ i thought. C++ can compile any C code since its a superset i thought
<erikh> the message-passing paradigm is a little harder to get, but understanding that first would be a huge leap forward.
<deryl> erikh: its pointers that give me nightmares. especially in pointer arithmetic
<manveru> you ever tried go?
<erikh> no, struct and class in C++ are equivalent, but class declares public first and struct declares private first
<deryl> thats one part of C i *still* have severe trouble with
<infid> how would you explain message passing as simply as possible
<deryl> manveru: no.
<erikh> or maybe I have that backwards.
<infid> giving an object to a method?
<erikh> I always forget.
<deryl> erikh: ahh yeah i always forget that as well.
<manveru> infid: don't need objects for that
<manveru> infid: it's just the way objects talk to each other
<infid> but there's different ways they can talk to eachother
<infid> procedurally using return values from methods, dependency injection..
<erikh> deryl: anyhow, as someone else mentioned, keep practicing. you'll get it.
<manveru> infid: that depends on the language
saLOUt joined #ruby-lang
<infid> the harder part when learning a new language isn't learning the new way of thinking actually, it's remembering your old way of thinking simultaneously
<infid> be careful not to forget what you used to know, or it defeats the purpose of learning multiple ways of thinking
<erikh> fwiw though C++ is not just a superset, it's a changeup of several key areas, mostly related to typing
<erikh> before you get into any of the OOP stuff.
<deryl> erikh: yeah thats what I'm doing. github.com/wayneeseguin/rvm-test (also on github.com/deryldoucette) is my first truly real-world non-trivial application. considering the knowledge level you have to have in order to write a *working* debugger, I took heart when banisterfiend told me my code wasn't childish and looked fine. I always worry about that.
<manveru> yeah, some kind of spaced repetition for programming language learning would be neat
<erikh> deryl: code review is always a great way to grow.
<erikh> manveru: they have things like euler and those koans things
<infid> pair programming is a great way to learn something new
<manveru> i mean something like http://www.memrise.com/welcome/
<erikh> for some people; pairing frankly saps all my brain
<infid> i can always pick up things faster if i'm physically next to someone who knows it, than reading entire books
<erikh> I am very much an "I work alone" person, but I always like to solicit code review and other forms of collaboration
<andrewvos> Pairing!
<deryl> erikh: i was considering giving up until he told me that last night. I was really feeling like i was an idiot. that and when you start pushing out urls and saying jhey guys can you review my code you either get ignored, told to piss off, or people get *overly* critical just to piss you off like its some game. people seem to think someone trying to better themselves is somehow a threat to *them* for some reason (never could understand that line ...
<deryl> ... of reasoning).
<deryl> andrewvos: i'd love to pair. just no one to really ask.
<erikh> deryl: have you read norvig's "teach yourself programming in 10 years?
<infid> the internet is all 'social' now, shouldn't be hard
<deryl> erikh: never heard of it
<andrewvos> deryl: Don't be scared of your code. I've seen such bad code that it actually makes me feel a little pukey thinking of it.
<deryl> infid: hah you'd think. :/
<erikh> not to discourage you, but it's a good read (google it) by a prominent person and if anything, don't sweat that you're not picking things up swiftly
<infid> you could always start your own group even
<erikh> the really good programmers (and I am talking about people I respect, not myself) have been doing it for 20+ years
<deryl> andrewvos: I've already had several people turn me down because I'm not on par with them. kind of makes asking others a scary prospect
<andrewvos> deryl: Turn you down for what?
<erikh> well, hrm
<deryl> andrewvos: pairing and several for reviewing
lsegal joined #ruby-lang
<andrewvos> deryl: You work with assholes?
<erikh> this is going to sound harsh but just like you, they want to work with people who will improve them
<andrewvos> s/\?//
<erikh> try to put it into perspective.
<deryl> i don't work with anyone. I'm a disabled vet working on this from my home to keep from going friggin nuts
<infid> it's very easy to think that someone who knows a little bit more than you is a great programmer, then you surpass them and go 'holy crap they were still noobs'. Then you hang around some 10+ 'experts' who really just have the basics down and ultimately you realize that everyone is lacking far more than they'll ever be able to catch up to
<erikh> aaand like I said, keep plugging away
<infid> and that all that matters is if you're productive in a language or at least having fun
<deryl> i don't work a regular job like most of you.
<andrewvos> https://gist.github.com/1380716 <---- Ok could someone tell me why this is madness? I can't seem to find a good example...
<erikh> heh, I have a 9th grade education and I've been doing this around 20 years. please rest assured you just need to keep working at it.
<deryl> erikh: yeah i'm plugging away. just wish i could find a mentor. if I had cash to cover it, I'd take Satish's Ruby course
banisterfiend joined #ruby-lang
srbaker joined #ruby-lang
<infid> deryl: lucky you, most programming jobs stunt poeple's growth beyond a certain initial threshold
<erikh> deryl: I'll review some of your code from time to time if you want to send it my way
<deryl> infid: err?
<infid> which is why i always move from job to job
<erikh> I won't pair though, because I don't pair with anyone.
<andrewvos> infid: Yeah me too. I'm not as good as erikh though.
<infid> deryl: eventually "management" is content with you knowing just enough to get their common jobs done
<erikh> eh
<erikh> deryl: anyhow my email is erik@hollensbe.org -- just remind me who you are and where your code is, I'll take a look at it when I have time.
<erikh> well, I'll do my best.
<deryl> erikh: thats cool. I'm more concerned with making sure that my code isn't stupid (like why in the HELL did you do it that way? are you really that nuts?) etc
<erikh> sure
<erikh> I ask co-workers to do the same thing all thetime
<erikh> maybe you can review my C :PP
<deryl> hehe :) fair trade :)
<erikh> github.com/erikh/octopus !
<deryl> sec let me add you to my address book. I'm me@deryldoucette.com
<manveru> andrewvos: i still don't see how you'd implement mathematical operators
<infid> deryl: if no one ever code reviews your stuff, don't worry, you can always code review your own stuff. How? just keep reading up and writing more code, then revisit your old stuff, you will always find ways to improve old code
<andrewvos> manveru: Well they could be built in.
<deryl> erikh: github.com/deryldoucette/rvm-test and rvm-testsuite
<deryl> infid: ah good point
<andrewvos> manveru: Operators Imean
<manveru> andrewvos: and everytime i wanna make a new numeric class, i have to write stuff like MyClassPlus(a, b)!
<infid> deryl: besides, appeal to authority is a logical fallacy
<manveru> you've invented common lisp, just wrose
<manveru> *worse
<erikh> deryl: hrm. have you seen rubyspec?
<infid> i used to do that a lot, then i surpassed some of those people who were better than me at the time, only to realize they were totally misguiding me
<deryl> erikh: i've seen it mentioned but never checked it out or found out what it really is
<andrewvos> manveru: A lot of languages survive without inheriting from Numeric
<erikh> plop into #rubinius and ask about it
<erikh> evan is a pretty nice guy, and contributing to that would be an effective use of time and a GREAT way to learn
<erikh> if this is the kind of stuff you want to be doing.
<deryl> hrmm, that might not be a good idea. brixen and I do *not* get along in any fashion. but evan is a decent egg
<manveru> andrewvos: yeah, and they make me wanna strangle the guy who decided that vector1 + vector2 is not a nice way to write things
<erikh> welcome to open source. nothing personal (I'd tell this to anyone), but man up and get past it
<andrewvos> manveru: You've lost me entirely.
<infid> besides, any programmer who is certain about something today won't be in a couple years, unless he stopped growing. In some respects we're moving asymptotically toward mediocrity
<deryl> erikh: lol
<andrewvos> manveru: I think we're talking about completely different concepts.
<andrewvos> manveru: I'm not very good at explaining.
<manveru> andrewvos: probably
<erikh> I'll look over your code in a few minutes here
<rue> deryl: Evan'll be around tomorrow. Also, there's #rubyspec
<erikh> oh very cool
<infid> i had some 'guru' teach me about some intersting progamming ideas, and all it did was slow me down in the end, even when i understood exactly what he meant and saw some benefit to it, it turned out it didn't apply to every situation. So there is no subsitute for doing your own thinking
<manveru> infid: true that
<erikh> yeah. there's no replacement for a brain
<manveru> that's why we still have to write code :)
<erikh> if there was we wouldn't be here right now, ken thompson would be doing all the programming.
<infid> manveru: at least it keeps us employed :p
<deryl> erikh: he used business to try to force me out of the RVM project by getting wayne called into the office. got drnic involved and everything because I repeated info about a supported feature that was wrong, but that his own team member put out under the rubinius Issues tracker and then got ticked off when I questioned why i should take *his* word over another team member's when neither I nor the other party involved even knew who he was via ...
<deryl> ... his nick.
<deryl> really bad manuever.
<manveru> yeah, until some insane AI guy comes along and obsoletes everybody
<deryl> rue: cool, I;ll check with him tomorrow. evan is evanph on freenode right?
<erikh> deryl: eh, just try and stay out of it and move on
<erikh> evan is just 'evan' I think.
<deryl> erikh: thats what i'm trying to do :)
<rue> deryl: Just evan.
<deryl> cool. I'll hit him up tomorrow then. i'll join the rubyspec channel now though and google up a bit on what it exactly is.
<erikh> it's a test suite for ruby
<deryl> oh sort of what i'm writing for rvm? awesome! yeah that should really give me some pointers then! hey thanks!
<erikh> right, maybe you could leverage it with your rvm addons to form testing voltron or something
<deryl> heheh
<deryl> i think what really draws me to coding is that I can take ideas in my head and make them concrete, a reality. hopefully i'll get tot he point where I can express them well.
looopy joined #ruby-lang
<infid> for me coding is just making different tools
<erikh> I just have hyperactivity issues so I bang on the keyboard a lot
<infid> it's actually a fun exercise to look into all the physical tools that exist out there, well beyond hammer and nails
<infid> can inspire you with ideas for new software tools, how to improve upon existing designs
<deryl> erikh: btw, when you do review, the development and feature/* branches are where I live. I'm trying to follow git-flow nvie layout.
<deryl> infid: yeah i can see where greater exposure would help clarify your thoughts and help you refine
<infid> deryl: but if you do end up programming for a living, you're forced to write other peoples ideas, which is a lot less fun (depending on the idea), but you can still transform that creativity into how you'll implement their ieas
<deryl> i surely hope i can get to the point of programming for a living. this disability shit is for the birds. gotta do *something* to occupy my time and brainspace. ::shudder::
<infid> unfortunately, a job is a disability
<deryl> lol
<shevy> depends on the job!
<deryl> infid: no reason i can't work for myself and contract
<infid> i can't do this, i can't do that, why? because i have to work
<shevy> imagine standing in a factory assembly... and programming only at home in your spare time!
<infid> contract work is fine if you like living like a starving artist
samshull joined #ruby-lang
<deryl> infid: the military pays me shit for the VA comp as it is. any money i make would be an improvement.
<deryl> trust me
nuclearsandwich joined #ruby-lang
<infid> you'll get to see both sides of the spectrum: fighting for freedom and realizing how corporations take it right back from their employees :p
<deryl> anyways, off to look through rubyspec.org for a bit. thanks a ton guys for not just kickin me to the curb. much appreciated
<erikh> deryl: alright. I'm kind of itching to play skyrim so I might do that for a while
<erikh> I'll plop in here later, remind me please.
<deryl> i've been seeing tweets about that game. is that free or payware?
<deryl> erikh: will do.
<bougyman> what game?
<manveru> skyrim
<bougyman> skyrim is an elder scrolls thing
<bougyman> not open source
<deryl> ah
<erikh> it's about $60.
<bougyman> i just found a really fun open source rts.
<bougyman> megaglest
<bougyman> there are a lot more open source games now than I realized.
<deryl> mac version?
<bougyman> most of them fps, which I don't like so much.
<bougyman> megaglest? yeah.
<bougyman> well... i think.
<bougyman> /j #glest, they know
<bougyman> i just found it today, running it on archlinux
<bougyman> i never game, but i just decided to take a day off today
<bougyman> don't remember the last time I took a day off..
<bougyman> nothing can eat the time like football on the tv and an rts on the netbook.
<deryl> ok i got the zip coming in. will check it out
<infid> we are all tomorrows food, today
<deryl> bougyman: the only game I play these days and that very rarely is Portal 2
<bougyman> i had none, til i found megaglest today.
<bougyman> well, i played a bit of minecraft here and there.
<bougyman> but eventually lost interest in that.
<deryl> i tried minecraft. didn't like it
<bougyman> i was addicted for a while.
<deryl> :shrug: i'm difficult to please when it comes to games
<bougyman> i had to get redstone cirguits and stuff working.
<deryl> i like portal 2 because its strictly co-op
<bougyman> once i had a few, though, then there was nothing left to accomplish.
<infid> most games are harder to play than most programs are to write, it ends up feeling like it's not a break at all. unless it's some simple games like wii or kinect
<bougyman> infid: granted, but I can't just sit around and veg.
<bougyman> even with two football games in PIP I can keep an rts going.
<deryl> i like games where you have to work together. one rason i quit quake series. friggin campers and fraggers and cheat-mod users and the like all put me off gaming for a long time
<deryl> bougyman: exactly why i'm getting into coding. i *hate* just sitting there and vegging.
<infid> only 3 things rejuvenate me between sitting at a computer: sleep, exercise and se^w tv
<bougyman> deryl: well coding is work, that's what i'm avoiding today.
<infid> vegging is a proven way to revive mind, just don't overdo it, like overlseeping
<deryl> lol
<infid> i love tv and movies because i don't have to think for once. i can't even take a shower without overthinking, in fact showers are the ultimate think tank
<deryl> infid: and then some
frangiz joined #ruby-lang
<infid> hey, what you do in there is between you and the bar of soap.
<deryl> hahaha
<andrewvos> What's a good example to prove how this language I've been playing with will fail?
<infid> fail in what way
<andrewvos> Well, not be able to complete a task.
<infid> like a turing test?
srbaker joined #ruby-lang
<shevy> skyrim is a disease
<andrewvos> Like a kata
<infid> or performance wise you could write a prime number finder that goes beyond 20k numbers.
<andrewvos> infid: It's not a real language yet... I'm just messing around.
<infid> benchmark that against another language
<deryl> does it return an exit status? like if @bash.status == '1' ; puts "OOPS! Command failed!" ; end
<andrewvos> shevy: False. SkyRim is amazing.
<deryl> something like that?
<andrewvos> deryl: You talking to me?
<deryl> or am i totally way off the mark of usability? :)
<deryl> yeah
<shevy> andrewvos if it is so amazing, why aren't you playing it right now!
<andrewvos> deryl: Didn't really mean that...
<deryl> i don;t know what language you're using so just offering up random help
<andrewvos> shevy: Maybe I am!??!
<shevy> naaaaah come on... you are reading what deryl writes
<andrewvos> deryl: I'm doing something rather stupid and trying to create a language based on SRP.
<shevy> what is SRP
<andrewvos> shevy: I'm playing the game, and typing using a chopstick I am holding in my mouth.
<deryl> that was my next ?
<infid> SRP is overrated in my opinion, wives should cook AND clean
<infid> i kid
<shevy> well
<infid> they should also hold a job
<andrewvos> deryl, shevy please free to insult: https://gist.github.com/1380771
<shevy> it kinda is odd, all those techniques to manage complexity
<andrewvos> SRP is my favourite.
<shevy> what is the ()! part
Indian joined #ruby-lang
<andrewvos> shevy: It's calling the execute method.
<shevy> hmm
<shevy> and all those objects will have an .execute method right?
<andrewvos> shevy: In this theoretical language, you only have one method. Perhaps some private methods too.
<infid> andrewvos: your language is like blackbox programming
<andrewvos> One or zero methods.
<deryl> andrewvos: i don;t see an issue with that *except* for the fact that you'll end up doubling or tripling your number of classes,
<shevy> my current habit is to use .run on every class I write
<andrewvos> shevy: You are a madman :)
<shevy> well, I don't have to think what method to invoke when I want something to run :)
<andrewvos> deryl: Yup I agree.
<infid> andrewvos: iow, it's better as a testing framework than a language because it's not that flexible for programming if i can't reset state through setters then the object is always a constant
<andrewvos> shevy: You are a monster.
<shevy> oh and .reset to reset an object's internal state
<deryl> doh! irl visitor. bbl
<andrewvos> infid: Setters are the tool of the devil :)
<shevy> PANIC deryl !!!
<infid> andrewvos: there's another term for what you're doing, it's a pattern called 'Value Objects'
<andrewvos> shevy: ahhahaha
<shevy> what is a value object
<shevy> I hate all those terms :(
<andrewvos> irl visitor = PANIC
<infid> an immutable object responsible for one thing in the world that doesn't have identity
<shevy> what's ident... nevermind.
<infid> like a 'date'
<shevy> ah
<deryl> shevy: hehe. I'm not a person who likes a lot of irl company.
<deryl> ok, gotta go. just saw and figured i'd respnd.
<shevy> haha
<infid> programming is a social activity
<shevy> yes
<shevy> best done alone
<infid> you're better at socializing than you probably think
towski joined #ruby-lang
<infid> the one thing i don't like about irl is the realization that everyone only cares about themselves. they're waiting for you to shut up so they can talk, they're wondering what you're thinking of them, and so on
<infid> in that sense, you're alone even when you're with people
<shevy> sounds like the wrong people
<andrewvos> Shits getting deep in here.
<infid> unless everyone's drunk or or high or in love or some transendent emotion and all 'united as one'
<shevy> andrewvos we are very philosophical men and women here
<shevy> much more so than say #php
<andrewvos> I think you mean "woman".
<infid> phpers haven't evolved that far yet
<infid> they're still into cave drawings with curly braces
<shevy> hehe
<shevy> what andrewvos I think there are at least two girls here
<Mon_Ouie> Not sine s0phie left
<Mon_Ouie> since*
<shevy> :(
looopy joined #ruby-lang
<theconartist> i can become one if you want me to
<andrewvos> ಠ_ಠ
<shevy> theconartist nah .. that reminds me of some fish who change gender based other genders in the population
<shevy> based *upon
<infid> transgender fish?
<infid> somehow more believable than crossdessing sharks
<infid> (since they're not dressed in the first place to have anything to cross over to)
<shevy> infid sharks are almost normal except that baby sharks eat other baby sharks
<infid> i can't decide if that means baby sharks are really selfish or selfless (maybe they're letting the other shark eat them)
<infid> damn nature, you scary
ryanf joined #ruby-lang
igotnolegs joined #ruby-lang
<igotnolegs> hello
livinded joined #ruby-lang
thone joined #ruby-lang
<erikh> deryl: around?
<erikh> deryl: ok, I'm going to take a nap. general tips: don't use instance variables at your toplevel, don't include modules at your top level unless you're sure that's what you want, remove your p statements after you're done with them. we'll talk about details later.
<erikh> I'm looking at master still, just realized that. I'll look at your feature branches in a bit.
<andrewvos> Code?
burgestrand joined #ruby-lang
<erikh> deryl: the code looks fine other than that, nice and simple and a pleasant read
tomzx joined #ruby-lang
<shevy> hmm
<shevy> don't include modules at your top level?
<andrewvos> erikh: SkyRim?
ecin joined #ruby-lang
<shevy> he wrote he has to take a nap
<shevy> don't think you can play skyrim while napping!!!
<andrewvos> shevy: If only.
<andrewvos> Ok I'm attempting roman numerals conversion in my new language.... Almost impossible.
zmack joined #ruby-lang
<andrewvos> Hmmm
<andrewvos> A language is entirely useless without proper array functions.
benanne joined #ruby-lang
<shevy> hehehe
Codif joined #ruby-lang
retro|cz joined #ruby-lang
burgestrand joined #ruby-lang
looopy joined #ruby-lang
Jake232 joined #ruby-lang
tomzx joined #ruby-lang
virunga joined #ruby-lang
looopy joined #ruby-lang
<deryl> bougyman: back
<bougyman> same
<bougyman> manveru: round?
<rue> andrewvos: "SkyRim".downcase.capitalize
<andrewvos> Skyrim?
<andrewvos> rue: I suppose.
dagnachewa joined #ruby-lang
<dagnachewa> hi allk
<dagnachewa> hi all
<dagnachewa> please help I have issues updating all gems
<shevy> hmmm
<shevy> is .map(&:capitalize) really slow?
<andrewvos> shevy: I don't see why?
<andrewvos> shevy: Are you doing it a million times?
<deryl> bougyman: about 1.5/2h i've dinner with friends down the road. i'm free until then
<bougyman> andrewvos: what language?
<andrewvos> bougyman: ?
<andrewvos> bougyman: Oh yeah... https://gist.github.com/1380805
<shevy> andrewvos a moment, I am running it 1.5 million times now
skammer joined #ruby-lang
<shevy> andrewvos http://pastie.org/2894804
<shevy> :(
<shevy> and I started to like the (&:) syntax
<bougyman> andrewvos: * (format nil "~@r" 1234)
<bougyman> "MCCXXXIV"
<andrewvos> bougyman: Huh? You lost me dude.
<bougyman> andrewvos: you were talking about roman numerals earlier.
<rue> dagnachewa: If you google for "rubygems invalid date specification", you should get instructions on fixing it
<andrewvos> bougyman: Yeah, so what does that code do?
<bougyman> showing the opposite end... from impossible to built-in :)
<bougyman> it formats the integer as a roman numeral
<bougyman> common-lisp's FORMAT function is almost a language in itself.
<andrewvos> bougyman: Ohhh ok I see :)
<rue> Best sprintf specifier ever
<bougyman> kinda like LOOP
looopy joined #ruby-lang
<dagnachewa> rue, do I have to reinstall all my gems ? like it says here http://stackoverflow.com/questions/7290575/invalid-date-format-specification-in-gemspec
echoprinter joined #ruby-lang
<rue> If the steps don't resolve it, possibly
<manveru> bougyman: kinda
workmad3 joined #ruby-lang
<deryl> bougyman: brb, on phone to apple
<bougyman> nice
<deryl> trying to get MBP keyboard replaced. S key is wearing off and i just got the blasted thing in April
<deryl> but i'm on hold so if you give me skype or g+ account info i can add in the meantime
<deryl> or can submit a req for adding to circles by hitting gplus.to/deryldoucette
nuclearsandwich joined #ruby-lang
<deryl> added
jgomez joined #ruby-lang
<shevy> dagnachewa sounds like an easy task, as all gems would be available on your system already or?
<shevy> so just remove the gem dir but backup the .gem files, then iterate through that list and install them with a ruby script
<dagnachewa> shevy, is it possible to have duplicate gems like exemple : unicorn-1.1.3 and unicorn-4.1.1 ?
<lianj> gem pristine --all
<lianj> dagnachewa: sure
<dagnachewa> ok
<dagnachewa> lianj, you had the date format specification error ?
<lianj> yes
gix joined #ruby-lang
<lianj> try the pristine command. if that doesnt work do `gem install /usr/lib/ruby/gems/1.9.1/*`
<lianj> err, i mean: `gem install /usr/lib/ruby/gems/1.9.1/cache/*`
<dagnachewa> lianj, am installing the gems but I keep geting the message invalid date format specification
Kero joined #ruby-lang
robotmay joined #ruby-lang
<lianj> even after it finished?
<dagnachewa> not yet fini9shed
<deryl> ok, all done
<dagnachewa> lianj, this is the way I installed ruby https://wiki.archlinux.org/index.php/Ruby
<deryl> bougyman: the only thing that sucks about living in a summer-only tourist town away fromthe hustle and bustle, is i might have to ship the damned laptop to apple JUST to get the battery and the S key replaced.
<lianj> dagnachewa: let it finish.. then run some ruby stuff, errors gone
<bougyman> holy cow
ecin joined #ruby-lang
echoprinter left #ruby-lang
echoprinter joined #ruby-lang
srbartlett joined #ruby-lang
woollyams joined #ruby-lang
<dagnachewa> lianj, is it necessary to have multiple versions of gems ? mailer1.1.1 mailer1.2.1 etc ?
looopy joined #ruby-lang
empity joined #ruby-lang
virunga joined #ruby-lang
<virunga> Hi, can you tell me what does the operator ||= do and in what class is defined, please?
echoprinter left #ruby-lang
<heftig> it's not defined anywhere
<heftig> a ||= b does a || (a = b)
<ryanf> you could also think of it as meaning a = a || b, by analogy with stuff like +=
<virunga> for what is it used usually?
<heftig> initialization of persistent variables
<heftig> e.g. @foo ||= []
echoprinter joined #ruby-lang
<heftig> will initialize @foo with [] if it's falsey (unset)
<ryanf> also you could use it for defaults
<ryanf> my_option = opts[:my_option] || 'default_val'
<ryanf> uh haha wait
<ryanf> forgot what I was demonstrating
<ryanf> opts[:my_option] ||= 'default_val', duh
<virunga> so if a = [0, 1, 2] after a ||= [], a is still equal [0,1,2] unlike if a = nil after will be [], right?
<ryanf> yep
<virunga> ok, thank you both
<virunga> a lot
<virunga> bye
Natch| joined #ruby-lang
Swimming_Bird joined #ruby-lang
brushbox joined #ruby-lang
solars joined #ruby-lang
<andrewvos> Got the roman numeral conversion done
<andrewvos> Looks a bit shit
<erikh> rue: code review! you know you want to.
<erikh> my code is *that awesome*
banisterfiend joined #ruby-lang
looopy joined #ruby-lang
<manveru> andrewvos: numeral.starts_with?(key)
<manveru> andrewvos: numeral has only that method?
<andrewvos> manveru: I just hacked that in. I don't like it :(
<manveru> i see it also has [] and length
<andrewvos> manveru: It's a string by the way
<andrewvos> Thoughts?
<manveru> yeah
<andrewvos> I think primitives should have some built in helpers.
<manveru> as before, i think it's a waste :)
<andrewvos> Not exactly constructive :)
<manveru> well, there is little to improve about it
<hagabaka> I think the "one public method" approach is just wrong
<andrewvos> hagabaka: Why?
<manveru> you're re-inventing functional programming
<andrewvos> (And I'm genuinely curious)
<hagabaka> who says single responsibility implies it, even "kind of"?
<manveru> just with more bloat
<hagabaka> why, because as you see you can't have a working string class with just one public method
<andrewvos> hagabaka: But what if string is treated as a primitive and primitives have built in classes?
<andrewvos> s/classes/helpers/
<bougyman> andrewvos: but you aren't even saving keystrokes.
<bougyman> so how is it helping?
<bougyman> irb(main):006:0> p "#{'1.starts_with?("1")'.size} > #{'1.to_s[0,1]=="1"'.size}"
<bougyman> "19 > 16"
<hagabaka> that's just pushing away the problem
<manveru> indeed
<manveru> i hate when languages treat their own primitives better than mine
<andrewvos> manveru: All languages do?
<manveru> no
<manveru> there's special treatment when it comes to literals
<manveru> but some languages even let you change that
<shevy> hmm
<shevy> when I want to reload a ruby module, should I use load or require?
<manveru> load
<manveru> require won't require the same file twice
<hagabaka> andrewvos, even if you make string a primitive, what about all kinds of other data structures programmers might need? would they be allowed to treat their classes as primitives?
<manveru> andrewvos: did you learn lisp yet?
looopy joined #ruby-lang
<andrewvos> manveru: Not properly no.
<andrewvos> hagabaka: What do you mean by "treat their classes as primitives"?
<shevy> manveru hmm ... when I use load() though, it complains when I load the same file again ... fragen.rb:12: warning: already initialized constant N
<manveru> shevy: well, you should write your code reload-friendly then
<hagabaka> would they be allowed to have more than one operations on their data structures, as if they're "primitives", or wold they have to make a bunch of classes just for each data structure
slyphon joined #ruby-lang
<shevy> manveru lemme write up a quick test case
<manveru> shevy: not test case needed
<manveru> it's a warning, warnings aren't errors, you're simply redefining the constant
<shevy> ah
<shevy> ok so I can't get rid of it
<manveru> you could
<manveru> A = 1; A ||= 2
<hagabaka> "single responsibility" is just relative I think, ruby objects don't often follow that principle, but even if you follow it to the extreme I think a responsibility can still be multiple public methods
<shevy> if the constant is kept in the module?
<manveru> or you can undefine the constant
<shevy> yeah but that all sucks ...
<shevy> there are like 20 constants in that module, the whole point of that module is to wrap a few constants hmm
<manveru> why would you reload constants?
<shevy> manveru it's just a dataset
<andrewvos> hagabaka: Sorry I wasn't in any way implying that "this is SRP". It's just some theoretical fun I'm having taking it to extremes.
<manveru> either stuff is constant or you're using the wrong semantics
<shevy> probably but then what different way would I have to store a dataset that can change within a module?
<andrewvos> hagabaka: I do tend to push SRP a little further though even when I'm working with ruby.
<andrewvos> hagabaka: Not sure whether that's a bad thing.
hagabaka joined #ruby-lang
hagabaka joined #ruby-lang
<manveru> shevy: anything you do will cause warnings of some kind if you run in verbose mode
<shevy> hmm I usually love the verbosity :)
<shevy> manveru, do you use the -w flag in your ruby files?
<manveru> for my own stuff
<shevy> hmm hmm hmm so much to think ...
<manveru> it gets painful when i run stuff with it that people wrote that don't know about it :)
jgomez joined #ruby-lang
S2kx joined #ruby-lang
pgetto joined #ruby-lang
kmeehl joined #ruby-lang
burgestrand joined #ruby-lang
mark_locklear joined #ruby-lang
kvs joined #ruby-lang