apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p362: http://ruby-lang.org (ruby-2.0.0-preview2) || Paste >3 lines of text on http://gist.github.com
<hell_razer> alexspeller, yeah, thnx
<alexspeller> :)
samuel02 has joined #ruby
SCommette has quit [Quit: SCommette]
Spami has quit [Quit: This computer has gone to sleep]
icole has quit [Remote host closed the connection]
andrewhl has joined #ruby
yakko_ has joined #ruby
jonathanwallace has joined #ruby
GoGoGarrett has joined #ruby
ebobby has joined #ruby
codezombie is now known as codezombie|away
gabrielrotbart has quit [Read error: Connection reset by peer]
yakko has quit [Ping timeout: 252 seconds]
gabrielrotbart has joined #ruby
kzar has quit [Read error: Connection reset by peer]
<GoGoGarrett> 2 objects created by from a single class, Car. How can I ensure that each instance has an uniq "color" property? I've tried this: https://gist.github.com/792d2ee58f903075bc0d
_nitti has joined #ruby
DatumDrop has joined #ruby
<Eiam> god, accidently checking in a variable called $DEBUG = true; was the worst mistake ever
<Eiam> so. much. whiny_nil.rb:58 spam
<alexspeller> GoGoGarrett: I don't think return false does anything
<alexspeller> (in an initaialize method)
lolcathost has joined #ruby
<GoGoGarrett> is there another way to prevent it from being initalized?
<alexspeller> You need to raise an error
<GoGoGarrett> gotcha
sj26 has quit [Quit: Rainbows!]
codezombie|away is now known as codezombie
connor_ has quit [Remote host closed the connection]
_nitti has quit [Ping timeout: 248 seconds]
connor_ has joined #ruby
chussenot has quit [Read error: Connection reset by peer]
NsOmNiAc has joined #ruby
chussenot has joined #ruby
yakko_ has quit [Read error: Connection reset by peer]
matematico has joined #ruby
AlbireoX has joined #ruby
matematico has left #ruby [#ruby]
lolcathost has quit [Ping timeout: 246 seconds]
chussenot has quit [Read error: Connection reset by peer]
chussenot has joined #ruby
andrewhl has quit [Remote host closed the connection]
<GoGoGarrett> How many classes can a ruby class directly extend? Is it 1? or can you just put tons of extend Blah; extend Foo;
esdf has quit [Remote host closed the connection]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
sailias has quit [Quit: Leaving.]
karasawa has joined #ruby
<IceDragon> You can include and extend as many times as you wish
reset has joined #ruby
ryanf has joined #ruby
<alexspeller> You can only inherit from one class
chussenot has quit [Read error: Connection reset by peer]
<alexspeller> extend is not inheritance as you may be used to
yakko has joined #ruby
chussenot has joined #ruby
<alexspeller> IceDragon is talking about ruby's module system which is not direct inheritance
<IceDragon> but you can "mix in" as many :)
<IceDragon> Its one hell of a system!
sailias has joined #ruby
connor_ has quit [Ping timeout: 265 seconds]
<IceDragon> ;x the horror of debugging it when crap goes wrong
pkrnj has quit [Quit: Computer has gone to sleep.]
<Eiam> so don't do it?
rellin has quit [Ping timeout: 255 seconds]
<Eiam> just put your extends into their own seperate module & use them there
tommyvyo has joined #ruby
<alexspeller> Eiam: you should definitely be using ruby's module system
lolcathost has joined #ruby
joofsh has quit [Remote host closed the connection]
LouisGB has quit [Ping timeout: 256 seconds]
<Eiam> alexspeller: yes, I said go make a module & put stuff in there
<alexspeller> For any non-trivial codebase you will likely be using lots of different techniques appropriate to the problem
<Eiam> instead of opening up someone elses thing and dumping junk in there
SpNg has joined #ruby
<Eiam> don't shit in someone elses code, shit in your own yard
baroquebobcat has quit [Quit: baroquebobcat]
slainer68 has quit [Remote host closed the connection]
<alexspeller> Eiam: That's not what extend, include, or inheritance to
<alexspeller> *do
<alexspeller> You may be thinking of monkeypatching, which is a different kettle of fish entirely
gyre007 has joined #ruby
karasawa has quit [Ping timeout: 265 seconds]
<Eiam> I was thinking of monkey patching, but I don't see extend much differently than monkey patching. its the same concept but applied to a specific instance
DatumDrop has quit [Ping timeout: 260 seconds]
<Eiam> is that not correct? extend is monkey patching for a specific instance ?
yaymukund has joined #ruby
<alexspeller> nope
ossareh has joined #ruby
samuel02 has quit [Remote host closed the connection]
wf2f has quit []
MattRb has quit [Quit: MattRb]
csigi has joined #ruby
<Eiam> okay, so include is monkey patching for a specific instance =)
<alexspeller> nope
<Eiam> " Include is for adding methods to an instance of a class"
<alexspeller> yes, that is not monkey patching though, that's just how ruby's module system works
philcrissman has joined #ruby
segv- has quit [Quit: segv-]
<alexspeller> You should not be worried / afraid of doing that
AndIrc___ has joined #ruby
ossareh has quit [Read error: Operation timed out]
Xeago has quit [Remote host closed the connection]
<Eiam> *shrug* if I need an object to do something and it doesn't fit into an existing model/class/module, I make a new module/object to contain that kind of functionality
mneorr has joined #ruby
<csmrfx> A simple http proxy in ruby? I need to debug http-requests from browser?
<Eiam> csmrfx: nc ?
mercwithamouth has quit [Ping timeout: 255 seconds]
<Pip> Is proc still available in Ruby?
<Eiam> to_proc
koshii has joined #ruby
csigi has left #ruby [#ruby]
yaymukund has quit [Ping timeout: 240 seconds]
miskander has joined #ruby
<alexspeller> that makes sense, but seriously, the basic usage of extend, include, and inheritance are not antipatterns, they just are different ways of using the module system
<csmrfx> Eiam: "nc"? is that a name?
<Eiam> csmrfx: netcat
wroathe has quit [Ping timeout: 256 seconds]
<Eiam> its a simple http server you can start from command line
<Eiam> it spits out exactly what it gets
emmanuelux has quit [Read error: Connection reset by peer]
<csmrfx> Hm, ok
<csmrfx> Perhaps I can build something around it
MattRb has joined #ruby
emmanuelux has joined #ruby
<csmrfx> Eiam: great idea
karupanerura has quit [Excess Flood]
philcrissman has quit [Remote host closed the connection]
<Eiam> csmrfx: I use it all the time to bounce a request against to see exactly whats going on, removes all the rest of my stack
<Eiam> charlesproxy is another great tool for the other end
NsOmNiAc has quit [Read error: Connection reset by peer]
<alexspeller> csmrfx: if you need something a bit more full-featured webrick has a built in http proxy
gyre007 has quit [Remote host closed the connection]
connor_ has joined #ruby
<Eiam> alexspeller: I dunno about saying its an anti pattern (I don't think I was saying that, and certainly enough people monkeypatch that its hard to call it an antipattern)
gurps has quit [Quit: bye]
karupanerura has joined #ruby
<Eiam> alexspeller: I just find that doing things like that add more complexity with very little value to me mentally, I prefer to keep things as simple as possible
hydrozen has joined #ruby
<Eiam> but hey, I'm a pretty shitty coder so =)
hadees has quit [Quit: hadees]
<alexspeller> Eiam, I understand and agree, yes, you don't want to be doing what you're saying
emocakes has quit [Quit: emocakes]
awarner has joined #ruby
<alexspeller> But if you think that extend is doing that, you don't understand extend; it has legitimate, non-confusing, simple uses
<alexspeller> it's just include for class-methods
<Eiam> yeah i've made it through the article
xclite has quit [Remote host closed the connection]
<Eiam> and I'm familiar with it from HTTParty because thats where i've done it
segv- has joined #ruby
segv- has quit [Client Quit]
<Eiam> i have a class that includes it exactly as demonstrated in the example
<Eiam> to me mentally, I'd rather "sublcass" httparty
<Eiam> subclass
<Eiam> than inject its code into the class. I get at a high level its the 'same thing' sort of, but i just naturally think of subclassing when i see something like that, not include
mercwithamouth has joined #ruby
<Eiam> of course, C++ was my first language, then obj-c, so I'm sure thats why =)
joshman_ has quit [Quit: Computer has gone to sleep.]
<csmrfx> Simple and simplifying is what it is *all* about
<csmrfx> nobody has time for complex
<csmrfx> value is created when you manage to abstract shitty details
<csmrfx> jmo
foohey has quit [Remote host closed the connection]
ner0x has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
gurps has joined #ruby
<alexspeller> It is about simplifying; I agree with that; however I disagree that using extend / include are not simple - this is very basic ruby and incredibly common idioms in ruby, _because_, in the right scenario, they allow you to make simpler code
<alexspeller> anyways, I gtg, laters all!
alexspeller has left #ruby ["Leaving..."]
<csmrfx> oh, so this was about modules
<csmrfx> duh, use 'em
<Eiam> csmrfx: no
<Eiam> it was about include & extend
codezombie is now known as codezombie|away
<csmrfx> Eiam: ok I see. Mixin's are ruby stylee. Inheritance, sometimes makes life hard.
SCommette has joined #ruby
<csmrfx> jmo
<Eiam> yeah, mixins. woo fuck yeah! =|
sailias has quit [Quit: Leaving.]
slainer68 has joined #ruby
slainer68 has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
chussenot has joined #ruby
miskander has quit [Quit: miskander]
pskosinski has quit [Quit: Learn Life's Little Lessons]
rovalent has quit [Quit: Linkinus - http://linkinus.com]
zeade has quit [Quit: Leaving.]
Takehiro has joined #ruby
malkomalko has joined #ruby
Moofy has left #ruby [#ruby]
DatumDrop has joined #ruby
aeontech has joined #ruby
dmiller has joined #ruby
banisterfiend has quit [Ping timeout: 256 seconds]
Guedes0 has quit [Quit: Saindo]
koshii has quit [Read error: Connection reset by peer]
brianpWins has quit [Quit: brianpWins]
guns has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
codezombie|away is now known as codezombie
codezombie has quit [Quit: Linkinus - http://linkinus.com]
malkomalko has quit [Remote host closed the connection]
banisterfiend has joined #ruby
wroathe has joined #ruby
yshh has joined #ruby
zastern has quit [Remote host closed the connection]
marr has quit [Ping timeout: 260 seconds]
ryannielson has joined #ruby
d2dchat has quit [Remote host closed the connection]
koshii has joined #ruby
piotr__ has quit [Ping timeout: 260 seconds]
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
pacbard has left #ruby [#ruby]
woolite6444 has quit []
jonathanwallace has joined #ruby
hybris has quit [Quit: hybris]
aeontech has quit [Ping timeout: 245 seconds]
hukl has quit [Quit: Leaving...]
DatumDrop has quit [Ping timeout: 246 seconds]
taoru has joined #ruby
bdnelson has joined #ruby
pu22l3r has joined #ruby
yakko has quit [Ping timeout: 256 seconds]
pu22l3r has quit [Remote host closed the connection]
aeontech has joined #ruby
aeontech has left #ruby [#ruby]
pu22l3r has joined #ruby
reset has quit [Quit: Leaving...]
mahmoudimus has joined #ruby
dmerrick has joined #ruby
gyre008 has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
bbloom has quit [Quit: Textual IRC Client: www.textualapp.com]
bbloom has joined #ruby
coasterd is now known as coasterDAME
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
bbloom has left #ruby [#ruby]
ngoldman has quit [Remote host closed the connection]
karasawa has joined #ruby
Umren|2 has quit [Ping timeout: 272 seconds]
digitalsanctum has quit [Remote host closed the connection]
digitalsanctum has joined #ruby
stevechiagozie has joined #ruby
karasawa has quit [Ping timeout: 265 seconds]
gyre007 has joined #ruby
<ryannielson> I want to develop a gem that has an executable, in development what's the best way to test it? Do I have to run gem install with the location of the executable every time?
Pip has quit [Ping timeout: 264 seconds]
digitalsanctum has quit [Ping timeout: 248 seconds]
hydrozen has quit [Quit: Textual IRC Client: www.textualapp.com]
davidokner has joined #ruby
aeontech has joined #ruby
tommyvyo has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
<davidokner> What are the ways to compile ruby to machine code for windows?
<davidokner> CRATE is one, right
mmitchell has joined #ruby
<davidokner> I read rubinious can too
ossareh has joined #ruby
kaen has joined #ruby
tommyvyo has quit [Client Quit]
DatumDrop has joined #ruby
dr_neek has joined #ruby
heftig has joined #ruby
yaymukund has joined #ruby
joofsh has joined #ruby
crazed- has joined #ruby
crazedpsyc has quit [Quit: ZNC - http://znc.in]
crazed- is now known as crazedpsyc
emmanuelux has quit [Remote host closed the connection]
lolcathost is now known as DijkstraGroupie
tommyvyo has joined #ruby
mneorr has quit [Remote host closed the connection]
Choobie has left #ruby ["End"]
jjbohn has joined #ruby
nathancahill has joined #ruby
DijkstraGroupie has quit [Ping timeout: 260 seconds]
c0rn has quit [Quit: Computer has gone to sleep.]
slainer68 has joined #ruby
ttt has joined #ruby
pskosinski has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
DatumDrop has quit [Ping timeout: 252 seconds]
rakl has quit [Quit: sleeping]
luckyruby has quit [Remote host closed the connection]
slainer68 has quit [Ping timeout: 260 seconds]
[-mX-] has joined #ruby
tjbiddle_ has joined #ruby
templaedhel has joined #ruby
connor_ has quit [Remote host closed the connection]
blazes816 has quit [Quit: blazes816]
connor_ has joined #ruby
bigmac has quit [Quit: Leaving]
fred909 has quit [Ping timeout: 240 seconds]
drago757 has quit [Quit: drago757]
[-mX-] has quit [Client Quit]
tjbiddle has quit [Ping timeout: 248 seconds]
DatumDrop has joined #ruby
drago757 has joined #ruby
carlyle has joined #ruby
tjbiddle_ has quit [Ping timeout: 255 seconds]
jpfuentes2 has joined #ruby
<shevy2> hmmm
<shevy2> I just realized something
carlyle has quit [Read error: Connection reset by peer]
<shevy2> begin/rescue works a bit like if/else
<shevy2> it seems to give me an additional layer of complexity however:
<shevy2> - in one case, I need to rescue a specific exception, such as Errno::EACCES
DatumDrop has quit [Remote host closed the connection]
<shevy2> - in the other case, I'd have to check for proper file permissions
carlyle has joined #ruby
<shevy2> my question is - why are there two ways when one way might suffice?
ryanjh has joined #ruby
connor_ has quit [Ping timeout: 248 seconds]
main has quit [Ping timeout: 240 seconds]
jjbohn has quit [Quit: Leaving...]
asteve has joined #ruby
sn0wb1rd has quit [Quit: sn0wb1rd]
jds__ has quit [Remote host closed the connection]
_huoxito has joined #ruby
h4mz1d has joined #ruby
digitalsanctum has joined #ruby
breakingthings has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
DatumDrop has joined #ruby
<ryannielson> exceptions are different than simple conditionals. Exceptions can carry up the execution path and be caught. Do some reading up on exceptions to get an idea.
jjbohn has joined #ruby
Engin has quit [Ping timeout: 252 seconds]
dr_neek has quit [Read error: Connection reset by peer]
dr_neek has joined #ruby
mengu has quit [Quit: Leaving]
maletor has quit [Quit: Computer has gone to sleep.]
<jpfuentes2> A letter to my daughter, Augusta, written in Ruby -> https://twitter.com/jpfuentes2/status/288327408325623809
rvmeier has joined #ruby
sailias has joined #ruby
s7ry93r has joined #ruby
masterkaen has joined #ruby
masterkaen has quit [Changing host]
masterkaen has joined #ruby
kaen has quit [Disconnected by services]
masterkaen is now known as kaen
Takehiro has quit [Remote host closed the connection]
szck has joined #ruby
MattRb has quit [Quit: MattRb]
chriskk has quit [Ping timeout: 255 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
jjbohn has quit [Quit: Leaving...]
chriskk has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
<JohnTeddy> How can I manipulate a letter so I add 3 to it? So a would be d, f would be i, etc.
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
mneorr has joined #ruby
gabrielrotbart has joined #ruby
punkrawkR^Home has quit [Read error: Operation timed out]
<jpfuentes2> > alphabet = ("a".."z").to_a => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
<jpfuentes2> > alphabet[alphabet.index("i") + 3] => "l"
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
jonathanwallace has joined #ruby
<breakingthings> Gentlemen, why is it that my hash arg isn't playing nice with the syntax "mymethodcall height: 1"
Hanmac1 has quit [Ping timeout: 246 seconds]
lolcathost has joined #ruby
kaen has quit [Read error: Connection reset by peer]
sn0wb1rd has joined #ruby
<waxjar> is there more on the same line breakingthings?
<dwnichols> JohnTeddy, you could use #next
havenn has quit [Read error: No route to host]
kaen has joined #ruby
<breakingthings> waxjar yes, "mymethodcall height: 1, top: (Curses.lines - 1)" is the full line
havenn has joined #ruby
sn0wb1rd has quit [Remote host closed the connection]
<Boohbah> breakingthings: use parentheses
<breakingthings> It does not appear to be happy with the space after the comma when I do that, Boohbah
<breakingthings> here
<breakingthings> let me gist it
<breakingthings> line 5 being the problem
jjbohn has joined #ruby
Monie has quit [Ping timeout: 255 seconds]
reset has joined #ruby
squidBits has quit [Quit: whoops]
<breakingthings> The error is coming from SublimeText 2, the Ruby Syntax Check on Save package, so I'm hoping it's not broken.
<waxjar> shouldn't give any problems breakingthings
templaedhel has quit [Quit: Bye!]
karasawa has joined #ruby
<jpfuentes2> breakingthings that is ruby 1.9 hash syntax. is your system ruby 1.9 ? (that's what ST2 would use for syntax checking)
<breakingthings> jpfuentes2 I believe so, though I would imagine that the package could potentially be outdated.
<breakingthings> Though, it might not know about my rbenv-managed ruby?
<waxjar> the ruby in sublime text is wonky for me too, probably uses system ruby yeah
<swarley> the bigger issue is that you're redefining initialize
digitalsanctum has quit [Remote host closed the connection]
<breakingthings> swarley?
<swarley> unless that's inside of a class of yours
<breakingthings> it is. I just didn't think it was relevant, I'm sorry. :)
nateberkopec has joined #ruby
digitalsanctum has joined #ruby
<swarley> Oh no, I should have asked
<breakingthings> no worries
xbayrockx has joined #ruby
<jpfuentes2> breakingthings you're using rbenv?
<breakingthings> jpfuentes2 yeah
<jpfuentes2> "sublimelinter_executable_map":
<jpfuentes2> {
<jpfuentes2> "ruby": "~/.rbenv/shims/ruby"
<jpfuentes2> },
<jpfuentes2> add that to your sublime user preferences
whitedawg has joined #ruby
<breakingthings> I didn't have SublimeLinter (though I just looked it up now in the manager, so I'll probably whip that up.)
<breakingthings> Thanks.
nari has joined #ruby
<waxjar> jpfuentes2, do you know how to change the ruby build uses too?
dr_neek has quit [Ping timeout: 260 seconds]
jjbohn has quit [Quit: Leaving...]
karasawa has quit [Ping timeout: 255 seconds]
cantonic has quit [Read error: Connection reset by peer]
<breakingthings> Does SublimeLinter offer any text hints when it finds an error? It's just highlighting the line at the moment…
<jpfuentes2> i don't think it does
<jpfuentes2> what were you using previously?
<waxjar> it'd be killer for just running one test file instead of all of them
<jpfuentes2> you mean the ruby used to execute a file/
cantonic has joined #ruby
<breakingthings> "Ruby Check On Save".
<jpfuentes2> waxjar you mean the ruby used to execute a file?
ossareh has quit [Ping timeout: 265 seconds]
<jpfuentes2> breakingthings is that a package ?
<breakingthings> Yeah.
<breakingthings> Just installed it to see if it was helpful
<jpfuentes2> is that the name of it?
<waxjar> yeah, cmd + b
<breakingthings> Yep.
SCommette has quit [Quit: SCommette]
joofsh has quit [Remote host closed the connection]
<breakingthings> oh thats cool waxjar
<breakingthings> thanks
mrsolo has quit [Quit: Leaving]
<breakingthings> should do that by default :p
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
<waxjar> uses system ruby though, so it's p much useless. I'm gonna google a bit :p
DatumDrop has quit [Remote host closed the connection]
<jpfuentes2> breakingthings: https://github.com/edgar/RubyCheckOnSave
<breakingthings> yeah
ryanf has quit [Read error: Connection reset by peer]
<jpfuentes2> breakingthings see the bottom?
<jpfuentes2> you need to change "ruby_check_on_save_cmd": "/Users/edgar/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
<breakingthings> oh
<breakingthings> i see.
ryanf has joined #ruby
<jpfuentes2> change it to -> "~/.rbenv/shims/ruby"
jds__ has joined #ruby
Hanmac has joined #ruby
<jpfuentes2> waxjar I'd need to know if that's a package or something built-in
platzhirsch has joined #ruby
Monie has joined #ruby
<platzhirsch> Should I care whether I create a string with str = "" or str = String.new ?
<waxjar> built in, it's under Tools
digitalsanctum has quit [Read error: Connection reset by peer]
<jpfuentes2> platzhirsch use the former
<swarley> String.new is actually slower
<platzhirsch> oh really
<swarley> In my tests at least
reset has quit [Quit: Leaving...]
<platzhirsch> heh
digitalsanctum has joined #ruby
<swarley> I think it has something to do with optimizations. Who knows. I could also just be wrong
<breakingthings> eh, neither seem to be working too wel.
<jpfuentes2> there's probably an article based on rbenv out there too
Takehiro has joined #ruby
<jpfuentes2> btw: A letter to my daughter, Augusta, written in Ruby -> https://twitter.com/jpfuentes2/status/288327408325623809
mercwithamouth has quit [Ping timeout: 255 seconds]
joofsh has joined #ruby
aeontech has quit [Quit: aeontech]
dougireton has joined #ruby
h4mz1d has quit [Ping timeout: 255 seconds]
<waxjar> ah that worked, changed cmd to ["/Users/username/.rbenv/shims/ruby", "$file"] in Ruby.sublime-build in the Ruby package
philcrissman has joined #ruby
horofox has joined #ruby
cantonic has quit [Ping timeout: 248 seconds]
jds__ has quit [Ping timeout: 252 seconds]
jekotia has quit [Read error: Connection reset by peer]
<shevy2> swarley I think the long variants are always slower... '' vs. String.new, [] vs. Array.new, {} vs. Hash.new, I think it has to do with initialize(), or something, no real idea
shevy2 is now known as shevy
jekotia has joined #ruby
heftig has quit [Quit: leaving]
Zolrath has quit [Ping timeout: 260 seconds]
Zolrath has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
BSaboia has quit [Ping timeout: 260 seconds]
karasawa has joined #ruby
dr_neek has joined #ruby
beneggett has joined #ruby
<swarley> shevy; I think it has to do with having a precompiled value versus looking up the class and calling
DatumDrop has joined #ruby
gabrielrotbart has joined #ruby
lolcathost has quit [Ping timeout: 264 seconds]
<swarley> Since the interpreter can automatically know where to go for "" but it has to preform object lookups for String.new
gyre007 has quit [Remote host closed the connection]
Monie has quit [Quit: Quit]
karasawa has quit [Ping timeout: 248 seconds]
jbw has quit [Ping timeout: 272 seconds]
pacbard has joined #ruby
rvmeier has quit [Quit: Leaving]
adkron has joined #ruby
dougireton has quit [Quit: Leaving.]
Vert has quit [Read error: Connection reset by peer]
karasawa has joined #ruby
nathancahill has quit [Quit: nathancahill]
jjbohn has joined #ruby
Virunga has quit [Remote host closed the connection]
jjbohn has quit [Client Quit]
adkron has quit [Ping timeout: 252 seconds]
heftig has joined #ruby
digitals_ has joined #ruby
lolcathost has joined #ruby
d2dchat has joined #ruby
pavilionXP has quit [Ping timeout: 240 seconds]
beneggett has quit [Quit: Computer has gone to sleep.]
coasterDAME is now known as coaster
QKO_ has joined #ruby
digitalsanctum has quit [Ping timeout: 260 seconds]
pavilionXP has joined #ruby
brianpWins has joined #ruby
jgrevich has joined #ruby
h4mz1d has joined #ruby
QKO has quit [Ping timeout: 248 seconds]
Vert has joined #ruby
cyong has joined #ruby
aeontech has joined #ruby
<breakingthings> Curses is irritating.
ryannielson has left #ruby [#ruby]
jbw has joined #ruby
joshman_ has joined #ruby
niklasb has quit [Ping timeout: 240 seconds]
medik has quit [Quit: medik]
jjbohn has joined #ruby
subbyyy has joined #ruby
alvaro_o_ has quit [Quit: Ex-Chat]
jgrevich_ has joined #ruby
jgrevich has quit [Ping timeout: 248 seconds]
jgrevich_ is now known as jgrevich
moshee has quit [Ping timeout: 264 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
danieldocki has quit [Quit: Leaving...]
jds__ has joined #ruby
nathancahill has joined #ruby
chussenot has quit [Quit: chussenot]
joshman_ has quit [Ping timeout: 256 seconds]
platzhirsch has left #ruby [#ruby]
philcrissman has quit [Remote host closed the connection]
Takehiro has quit [Ping timeout: 248 seconds]
kaen has quit [Quit: trying.]
nathancahill has quit [Client Quit]
h4mz1d has quit [Ping timeout: 260 seconds]
jlast has joined #ruby
carlyle has quit [Remote host closed the connection]
wmoxam has quit [Remote host closed the connection]
h4mz1d has joined #ruby
jmorton has quit [Quit: jmorton]
ffranz has quit [Quit: Leaving]
jds__ has quit [Ping timeout: 255 seconds]
graft has quit [Ping timeout: 276 seconds]
eka has quit [Quit: Computer has gone to sleep.]
hell_razer has quit [Ping timeout: 255 seconds]
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
johnmilton has quit [Quit: Leaving]
aeontech has quit [Quit: aeontech]
Monie has joined #ruby
digitals_ has quit [Remote host closed the connection]
digitalsanctum has joined #ruby
jjbohn is now known as jjbohn|afk
DatumDrop has quit [Remote host closed the connection]
voodoofish430 has quit [Quit: Leaving.]
horofox has quit [Quit: horofox]
clooth has quit [Quit: clooth]
niklasb has joined #ruby
hell_razer has joined #ruby
IceDragon has quit [Quit: Space~~~]
digitalsanctum has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
joshcheek has joined #ruby
gavinhughes has joined #ruby
hackerdude has quit [Remote host closed the connection]
<gavinhughes> Anyone know if there's a library similar to VCR that simply captures every external request a test suite makes and records them for future playback without all VCR's cassette naming stuff?
kaen has joined #ruby
dmerrick has quit [Quit: dmerrick]
ryannielson has joined #ruby
_nitti has joined #ruby
MattRb has joined #ruby
<jcrawford> anyone have any clue why I would be getting this error: http://pastie.org/5645808
<swarley> jcrawford; are you sure that you're setting that value to an array before hand?
<jcrawford> eh that may be why let me try something
<swarley> You may want to use ||=[] before you try to use <<
<jcrawford> thanks i was just being dumb :)
<jcrawford> hmm not sure what the ||=[] means
<jcrawford> \can you direct me to something to read about it
<waxjar> (x[..] ||= []) << y if you wanna be fancy
ejnahc has quit [Quit: leaving]
<swarley> jcrawford; It's like saying
<swarley> if (this_has_value) then nil else this_has_value = set_value end
karasawa has quit [Ping timeout: 264 seconds]
<swarley> this_object_defined ||= or_will_equal_this
drago757 has quit [Quit: drago757]
<jcrawford> swarley: ok ty for that explanation :)
<swarley> No problem
SCommette has joined #ruby
karasawa has joined #ruby
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby
mockra has quit [Remote host closed the connection]
pacbard is now known as zz_pacbard
yaymukund has quit [Ping timeout: 255 seconds]
slainer68 has joined #ruby
adkron has joined #ruby
gavinhug_ has joined #ruby
gavinhughes has quit [Quit: gavinhughes]
karasawa has quit [Ping timeout: 260 seconds]
slainer68 has quit [Ping timeout: 260 seconds]
<joshcheek> jpfuentes2: it's cute :)
niklasb has quit [Ping timeout: 246 seconds]
<jpfuentes2> thanks !
hemanth_ has quit [Read error: Connection reset by peer]
guns has quit [Quit: guns]
fumbe has joined #ruby
<d-snp> pretty jpfuentes2 :)
tommyvyo has joined #ruby
s7ry93r has left #ruby [#ruby]
<jpfuentes2> yep, that "letter" is why Ruby is so awesome
c3vin has quit [Ping timeout: 240 seconds]
tommyvyo_ has joined #ruby
rakl has joined #ruby
rakl has quit [Remote host closed the connection]
tommyvyo_ has quit [Client Quit]
yacks has joined #ruby
h4mz1d has quit [Read error: Operation timed out]
adkron has quit [Ping timeout: 240 seconds]
S1kx has joined #ruby
S1kx has joined #ruby
S1kx has quit [Changing host]
griffindy has joined #ruby
nathancahill has joined #ruby
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
h4mz1d has joined #ruby
axiak has joined #ruby
h4mz1d has quit [Read error: Operation timed out]
_nitti has quit [Remote host closed the connection]
sambio has quit []
billy_ran_away has quit [Ping timeout: 272 seconds]
ryannielson has left #ruby [#ruby]
richardr has joined #ruby
ananthakumaran has joined #ruby
pskosinski has quit [Quit: Learn Life's Little Lessons]
jonahR has quit [Quit: jonahR]
gokul has joined #ruby
joofsh has quit [Remote host closed the connection]
billy_ran_away has joined #ruby
mmitchell has quit [Remote host closed the connection]
connor_ has joined #ruby
hemanth_ has joined #ruby
griffindy has quit [Quit: Computer has gone to sleep.]
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Ping timeout: 240 seconds]
DatumDrop has joined #ruby
breakingthings has quit []
DatumDrop has quit [Ping timeout: 255 seconds]
MattRb has quit [Quit: MattRb]
dwnichols has quit [Ping timeout: 260 seconds]
jjbohn|afk is now known as jjbohn
tchebb has joined #ruby
h4mz1d has joined #ruby
dwu1 has joined #ruby
vlad_starkov has joined #ruby
cyong has quit [Quit: Leaving.]
asteve has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Ping timeout: 248 seconds]
xemu has quit [Quit: Nettalk6 - www.ntalk.de]
jameshyde has joined #ruby
drago757 has joined #ruby
radic has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
yaymukund has joined #ruby
jjbohn has quit [Quit: Leaving...]
ebobby has quit [Ping timeout: 276 seconds]
connor_ has quit [Remote host closed the connection]
connor_ has joined #ruby
radic_ has quit [Ping timeout: 276 seconds]
whitedawg has quit [Quit: Leaving.]
drago757 has quit [Client Quit]
connor_ has quit [Read error: Connection reset by peer]
connor__ has joined #ruby
beneggett has joined #ruby
MattRb has joined #ruby
mockra has joined #ruby
SCommette has quit [Quit: SCommette]
SCommette has joined #ruby
cyong has joined #ruby
a_a_g has joined #ruby
h4mz1d has quit [Ping timeout: 248 seconds]
mockra has quit [Ping timeout: 240 seconds]
connor__ has quit [Ping timeout: 255 seconds]
harushimo has quit [Quit: Leaving]
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
sailias has quit [Quit: Leaving.]
a_a_g has quit [Client Quit]
ananthakumaran1 has quit [Quit: Leaving.]
hackerdude has joined #ruby
wroathe has quit [Ping timeout: 248 seconds]
Nisstyre has quit [Remote host closed the connection]
toekutr has quit [Remote host closed the connection]
<pen_> what does this mean? Test = -> { blah blah }
toekutr has joined #ruby
whitedawg has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<heftig> pen_: it assigns a lambda (with the -> syntax) to a constant named "Test"
<pen_> it reminds me of coffeescript but I'm not so sure
<pen_> interesting
whitedawg has quit [Client Quit]
_46bit has quit [Quit: Leaving.]
<jpfuentes2> yeah, they call it stabby proc in ruby
<jpfuentes2> and glyph in CoffeeScript
maletor has joined #ruby
loser0d has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast has joined #ruby
hanjianwei has joined #ruby
loser0d has quit [Client Quit]
subbyyy has quit [Quit: none 0.3.9.2]
cyong has quit [Quit: Leaving.]
DrCode has quit [Ping timeout: 276 seconds]
ananthakumaran1 has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
DrCode has joined #ruby
yacks has quit [Ping timeout: 265 seconds]
hanjianwei has quit [Quit: hanjianwei]
icole has joined #ruby
ner0x has quit [Quit: Leaving]
jlast has quit [Remote host closed the connection]
tchebb has quit [Quit: ZNC - http://znc.in]
davidcel_ has joined #ruby
tchebb has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
davidcel_ has quit [Client Quit]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
havenn has quit [Read error: No route to host]
havenn has joined #ruby
dmiller has quit [Remote host closed the connection]
connor_ has joined #ruby
cha1tanya has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
chriskk has quit [Quit: chriskk]
vlad_starkov has joined #ruby
connor_ has quit [Remote host closed the connection]
dmiller has joined #ruby
d2dchat has quit [Remote host closed the connection]
sayan has joined #ruby
dmiller has quit [Read error: Connection reset by peer]
dmiller_ has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
katherinem13_ has joined #ruby
Gooder has joined #ruby
katherinem13 has quit [Ping timeout: 265 seconds]
katherinem13_ is now known as katherinem13
mercwithamouth has joined #ruby
elico has quit [Quit: elico]
katherinem13_ has joined #ruby
ebobby has joined #ruby
madwilliamflint has quit []
arkiver has joined #ruby
say26 has joined #ruby
ryanf_ has joined #ruby
katherinem13 has quit [Ping timeout: 264 seconds]
katherinem13_ is now known as katherinem13
<say26> When I do `a = b || c`, what method gets called by ruby on `b` to check if its false/nil?
ejnahc has joined #ruby
<jpfuentes2> b would be an expression
mneorr has quit [Remote host closed the connection]
<jpfuentes2> if it evaluates to true, then the conditional is short-circuited and ends there (a will now equal b)
<jpfuentes2> b, as an expression, will be evaluated -> if it's a method then it will be invoked, if it's a local variable then it will use its value
<say26> b is an instance of an object
<say26> basically I have a @value variable inside, if its 0, I want `b` to equal nil/false so that `a = b || 1` will result in a = 1
ebobby has quit [Ping timeout: 240 seconds]
<jpfuentes2> everything in ruby evaluates to true except for false and nil
<jpfuentes2> so if b is an instance of some object, then it evaluates to true
ryanf has quit [Ping timeout: 248 seconds]
<jpfuentes2> you should be checking b.value then
h4mz1d has joined #ruby
<say26> well the real situation is a bit more complicated, I thought there would be a shortcut
<say26> alright, will do it that way, thanks!
<jpfuentes2> a = (b.value == 0 ? 1 : b.value)
ejnahc has quit [Ping timeout: 255 seconds]
yacks has joined #ruby
dr_neek_ has joined #ruby
_hemanth_ has joined #ruby
taoru_ has joined #ruby
havenn_ has joined #ruby
yshh_ has joined #ruby
brianpWins_ has joined #ruby
dmiller has joined #ruby
awarner_ has joined #ruby
mneorr has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
ananthakumaran has joined #ruby
matchaw_ has joined #ruby
jbpros_ has joined #ruby
jds__ has joined #ruby
Skelz0r_ has joined #ruby
LiquidInsect has joined #ruby
m_3_ has joined #ruby
pcarrier_ has joined #ruby
alienven1m has joined #ruby
jesse is now known as opq
icco_ has joined #ruby
kiyoura has quit [Quit: Leaving]
Guest47288 has quit [Ping timeout: 260 seconds]
Takehiro has joined #ruby
Villadelfia_ has joined #ruby
crazed- has joined #ruby
jds__ has quit [Ping timeout: 246 seconds]
Hanmac_ has joined #ruby
arkiver has quit [*.net *.split]
havenn has quit [*.net *.split]
cha1tanya has quit [*.net *.split]
tchebb has quit [*.net *.split]
ananthakumaran1 has quit [*.net *.split]
dmiller_ has quit [*.net *.split]
hemanth_ has quit [*.net *.split]
fumbe has quit [*.net *.split]
brianpWins has quit [*.net *.split]
dr_neek has quit [*.net *.split]
_huoxito has quit [*.net *.split]
crazedpsyc has quit [*.net *.split]
pcarrier has quit [*.net *.split]
taoru has quit [*.net *.split]
awarner has quit [*.net *.split]
matchaw___ has quit [*.net *.split]
huoxito has quit [*.net *.split]
yshh has quit [*.net *.split]
Banistergalaxy has quit [*.net *.split]
yfeldblum has quit [*.net *.split]
noric has quit [*.net *.split]
icco has quit [*.net *.split]
Villadelfia has quit [*.net *.split]
mensvaga has quit [*.net *.split]
bjeanes has quit [*.net *.split]
jbpros has quit [*.net *.split]
LiquidIn1ect has quit [*.net *.split]
dreamfall has quit [*.net *.split]
m_3 has quit [*.net *.split]
Skelz0r has quit [*.net *.split]
alienvenom has quit [*.net *.split]
jbpros_ is now known as jbpros
dr_neek_ is now known as dr_neek
brianpWins_ is now known as brianpWins
pcarrier_ is now known as pcarrier
Villadelfia_ is now known as Villadelfia
crazed- is now known as crazedpsyc
MattRb has quit [Quit: MattRb]
mercwithamouth has quit [Ping timeout: 276 seconds]
freeayu has joined #ruby
sayan has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
yfeldblum has joined #ruby
mikekelly has joined #ruby
arkiver has joined #ruby
szck has quit [Quit: Leaving.]
cha1tanya has joined #ruby
aquagrunty has joined #ruby
<aquagrunty> T_T
<aquagrunty> i've nearly given up hope
tchebb has joined #ruby
fumbe has joined #ruby
huoxito has joined #ruby
bjeanes has joined #ruby
<aquagrunty> how i the hell do i connect to MS SQL using an ORM
SCommette has quit [Quit: SCommette]
dmiller has quit [Remote host closed the connection]
<havenn_> aquagrunty: tried the Sequel gem?: http://sequel.rubyforge.org
Nisstyre has joined #ruby
Nisstyre has quit [Changing host]
Nisstyre has joined #ruby
mensvaga has joined #ruby
tchebb has quit [Read error: Operation timed out]
<aquagrunty> yes, but i can't seem to figure out how to ORM'itize it
<aquagrunty> i'm building a layer on top of a legacy MS SQL database
dawkirst_ has joined #ruby
ejnahc has joined #ruby
pu22l3r has quit [Ping timeout: 260 seconds]
<aquagrunty> is sequel the most flexibe?
<aquagrunty> *flexible
gabrielrotbart has quit [Remote host closed the connection]
<aquagrunty> oh
dawkirst has quit [Quit: Leaving]
<aquagrunty> oh!
<aquagrunty> i found docs
<aquagrunty> thanks havenn :)
dawkirst_ is now known as dawkirst
<dawkirst> Hi, new to Ruby. If I want to play around with AWS, but especially S3, am I better off with fog or with something like aws-s3 or aws-sdk?
Takehiro_ has joined #ruby
kenneth has quit [Quit: kenneth]
pkrnj has joined #ruby
<Hanmac_> aquagrunty thats the payback for choosing MS products :P
freeayu_ has joined #ruby
Takehiro has quit [Ping timeout: 276 seconds]
<aquagrunty> Hanmac_: my god if i could change the choice they made years ago i would
tchebb has joined #ruby
agarie has joined #ruby
mensvaga has quit [Ping timeout: 248 seconds]
bjeanes has quit [Ping timeout: 248 seconds]
huoxito has quit [Ping timeout: 248 seconds]
fumbe has quit [Ping timeout: 248 seconds]
bjeanes has joined #ruby
huoxito has joined #ruby
browndawg has joined #ruby
agarie has quit [Remote host closed the connection]
fumbe has joined #ruby
TerabyteST has joined #ruby
<aquagrunty> our entire loyalty database is built using SQL
<aquagrunty> i've seen it
<aquagrunty> i have seen it melt the faces of many great men
<aquagrunty> those poor souls
<aquagrunty> imagine an SQL table
<aquagrunty> with over 100 columns
<aquagrunty> SQL queries that span a good 2 or 3 screens
vlad_starkov has joined #ruby
<dawkirst> Hi, new to Ruby. If I want to play around with AWS, but especially S3, am I better off with fog or with something like aws-s3 or aws-sdk? (not sure if this message was displayed earlier -- if it was, sorry)
<aquagrunty> dawkirst: any reason you need to use AWS?
ryanf_ has quit [Quit: broken pipes |||]
agarie has joined #ruby
<aquagrunty> i like this vps personally
<aquagrunty> super cheap
<aquagrunty> i pay $2 a month
<aquagrunty> dedicated VPS to use as i wish
<aquagrunty> i need an SSH tunnel? no prob
<aquagrunty> want to run a server as well? good to go
<aquagrunty> having to deal with distributed system limitations really sucks
TerabyteST has quit [Quit: terabytest]
<aquagrunty> i'm ssh'ing from my server right now actually
ryanf has joined #ruby
<aquagrunty> into a tmux screen
<aquagrunty> running irssi
huoxito has quit [Quit: Leaving]
vlad_starkov has quit [Ping timeout: 276 seconds]
<dawkirst> aquagrunty, no, not in particular. I need to store image files. Do you have any other recommendations?
mensvaga has joined #ruby
Banistergalaxy has joined #ruby
ale`` has joined #ruby
a_a_g has joined #ruby
slainer68 has joined #ruby
szck has joined #ruby
ale``` has quit [Remote host closed the connection]
agarie has quit [Remote host closed the connection]
slainer68 has quit [Read error: Operation timed out]
SCommette has joined #ruby
kenneth has joined #ruby
say26 has left #ruby [#ruby]
richardr has quit [Remote host closed the connection]
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
pen_ has quit [Remote host closed the connection]
szck has quit [Ping timeout: 264 seconds]
dmiller has joined #ruby
apeiros_ has quit [Remote host closed the connection]
Takehiro_ has quit [Remote host closed the connection]
nwertman has quit [Read error: Connection reset by peer]
jasond has left #ruby ["Killed buffer"]
dmiller has quit [Ping timeout: 240 seconds]
clocKwize has joined #ruby
dhruvasagar has joined #ruby
adeponte has joined #ruby
jsilver has joined #ruby
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
nwertman has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
jsilver has quit [Remote host closed the connection]
jsilver has joined #ruby
jsilver has quit [Client Quit]
akemrir has joined #ruby
h4mz1d has quit [Ping timeout: 255 seconds]
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
h4mz1d has joined #ruby
jds__ has joined #ruby
lolcathost has joined #ruby
beneggett has joined #ruby
TheFuzzball has joined #ruby
pkrnj has quit [Ping timeout: 265 seconds]
jds__ has quit [Ping timeout: 252 seconds]
blaxter has joined #ruby
<JohnTeddy> What is the dpkg -L blah, equivalent for a gem?
<shevy> hey
<shevy> anyone has a ruby script that turns perl code into ruby code
<shevy> or at least makes the perl spaghetti code more readable?
dwu1 has quit [Read error: Connection reset by peer]
robustus has quit [Ping timeout: 248 seconds]
<Hanmac_> JohnTeddy: gem contents <gemname>
mahmoudimus has joined #ruby
clooth has joined #ruby
agarie has joined #ruby
robustus has joined #ruby
h4mz1d has quit [Ping timeout: 256 seconds]
zommi has joined #ruby
hackerdude has quit [Remote host closed the connection]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
aloshkarev has joined #ruby
whitedawg has joined #ruby
yacks has quit [Ping timeout: 260 seconds]
Takehiro has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
athst has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
apeiros_ has joined #ruby
baroquebobcat has joined #ruby
baroquebobcat has quit [Client Quit]
adeponte has quit [Remote host closed the connection]
serhart has quit [Quit: Leaving.]
atno has quit [Read error: Connection reset by peer]
athst has quit [Remote host closed the connection]
athst has joined #ruby
rakl has joined #ruby
Elhu has joined #ruby
<Gate> shevy: isn't perl *supposed* to be unreadable?
<Gate> I thought that was the point: job security.
[Neurotic] has quit [Remote host closed the connection]
rakl is now known as gues131
yacks has joined #ruby
aganov has joined #ruby
hamed_r has joined #ruby
<aquagrunty> lol
<aquagrunty> i don't know, i kind of miss the sigil
<aquagrunty> ugly is at was
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
<aquagrunty> not really lol
<aquagrunty> ruby is awesome
<aquagrunty> a method and attribute can be called the same way?
<aquagrunty> very very cool
slainer68 has joined #ruby
aloshkarev has quit [Quit: aloshkarev]
Morkel has joined #ruby
<shevy> Gate yeah but I wanna port some perl scripts to ruby
mafolz has joined #ruby
slainer68 has quit [Ping timeout: 240 seconds]
daslicious_ has quit [Read error: Connection reset by peer]
Bry8Star has quit [Remote host closed the connection]
daslicious_ has joined #ruby
ryanf has quit [Ping timeout: 248 seconds]
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
Bry8Star has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
dmiller has joined #ruby
leehambley has joined #ruby
leehambley has left #ruby [#ruby]
jimeh has joined #ruby
heshanh has joined #ruby
zigomir has joined #ruby
icole has quit [Remote host closed the connection]
dmiller has quit [Ping timeout: 248 seconds]
Morkel has quit [Quit: Morkel]
dyrot has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
<shevy> I skipped that
<shevy> now I just look for the functionality, and rewrite from zero in ruby
<shevy> life is too short to waste staring at perl code
Elhu has quit [Quit: Computer has gone to sleep.]
filipe has joined #ruby
tonini has joined #ruby
assurbanipal has joined #ruby
henn1nk has left #ruby [#ruby]
topriddy has joined #ruby
timonv has joined #ruby
opq is now known as jesse
jameshyde has quit [Remote host closed the connection]
dr_bob has joined #ruby
jds__ has joined #ruby
TheFuzzball has quit [Quit: Computer has gone to sleep.]
<shevy> topriddy, look at the page again:
<shevy> (1) "I'm not a Ruby programmer."
<shevy> (2) "disabling comments. If you got something to say, write a blog post."
<shevy> he is a troll
<shevy> even a scared one
mneorr has joined #ruby
jds__ has quit [Ping timeout: 252 seconds]
wermel has joined #ruby
toekutr has quit [Remote host closed the connection]
<aquagrunty> yes
<aquagrunty> finally switched from web2py to sinatra
<aquagrunty> for my home server
<aquagrunty> web2py is nice, but it's killing my memory on my vps
<aquagrunty> ruby is too, but i like the syntax a bit better
jprovazn has joined #ruby
timonv has quit [Remote host closed the connection]
wermel has quit [Remote host closed the connection]
athst_ has joined #ruby
vlad_starkov has joined #ruby
<topriddy> shevy: you think? but he had other ruby posts there. basically, i'm just a new guy gaining interest in ruby though...and just been careful. i do java at work. interested in python too. weighing both. completed the shortest ruby tutoral online already
<shevy> aquagrunty \o/
freeayu_ has quit [Ping timeout: 260 seconds]
freeayu has quit [Ping timeout: 264 seconds]
freeayu has joined #ruby
freeayu_ has joined #ruby
athst has quit [Ping timeout: 265 seconds]
athst_ is now known as athst
<shevy> topriddy he seems like a pure C hacker
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
<shevy> the C hackers will forever strive for perfection of execution
tPl0ch has joined #ruby
<shevy> topriddy back when before I started with ruby, I was considering either python or ruby
main has joined #ruby
karasawa has joined #ruby
<shevy> php was too awful
<shevy> I used it for +2 years
<shevy> both python and ruby have one thing in common - they focus on fun, or happiness
<shevy> topriddy, if you have not read this interview, read it: http://www.artima.com/intv/rubyP.html
<shevy> I picked ruby over python because of that interview
Umren has joined #ruby
ryanf has joined #ruby
charliesome has joined #ruby
nemesit has joined #ruby
mneorr has quit [Ping timeout: 255 seconds]
jgrevich has quit [Quit: jgrevich]
koshii has quit [Ping timeout: 255 seconds]
topriddy has quit [Ping timeout: 252 seconds]
nathancahill has quit [Quit: nathancahill]
SCommette has quit [Quit: SCommette]
topriddy has joined #ruby
topriddy has quit [Read error: Connection reset by peer]
mockra has joined #ruby
noxoc has joined #ruby
sayan has quit [Ping timeout: 260 seconds]
chussenot has joined #ruby
coderhut has joined #ruby
topriddy has joined #ruby
topriddy has quit [Read error: Connection reset by peer]
chussenot has quit [Client Quit]
mockra has quit [Ping timeout: 276 seconds]
topriddy has joined #ruby
topriddy has quit [Read error: Connection reset by peer]
robbyoconnor has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
topriddy has joined #ruby
topriddy has quit [Read error: Connection reset by peer]
sayan has joined #ruby
topriddy has joined #ruby
topriddy has quit [Read error: Connection reset by peer]
mpfundstein has joined #ruby
timonv has joined #ruby
topriddy has joined #ruby
topriddy has quit [Client Quit]
<JoeHazzers> shevy: i bet it's a shit sensationalist interview
Takehiro has quit [Remote host closed the connection]
gavinhug_ has quit [Remote host closed the connection]
headius has quit [Quit: headius]
<Hanmac_> i picked ruby because of RPGMaker
elaptics`away is now known as elaptics
clocKwize has quit [Quit: clocKwize]
Umren has quit [Read error: Connection reset by peer]
yaymukund has quit [Remote host closed the connection]
Elhu has joined #ruby
yacks has quit [Ping timeout: 260 seconds]
megha has joined #ruby
freeayu_ has quit [Quit: No Ping reply in 180 seconds.]
Umren has joined #ruby
clocKwize has joined #ruby
freeayu_ has joined #ruby
hoelzro|away is now known as hoelzro
<Hanmac_> shevy did you know:
<hoelzro> RPGMaker uses Ruby?
<Hanmac_> >> p 4[2]
<eval-in> Hanmac_: Output: "1\n" (http://eval.in/6164)
dmiller has joined #ruby
LouisGB has joined #ruby
freeayu_ has quit [Client Quit]
<Mon_Ouie> hoelzro: Yeah. That was my first contact with Ruby and programmingg too :p
topriddy has joined #ruby
<Hanmac_> hoelzro: the newer generations XP,VX,VXAce use ruby, the older ones 2k(3) does not have scripting
freeayu_ has joined #ruby
<hoelzro> crazy, I wasn't aware of that
<topriddy> shevy: major thing i can cull from that interview is that ruby is designed to make programming fun for Matz. Matz is a standard for what programmers should expect in a language
<Hanmac_> advertising: (the maker replacement i work on will use ruby as scripting language too)
jds__ has joined #ruby
postmodern has quit [Quit: Leaving]
freeayu_ has quit [Client Quit]
robbyoconnor has quit [Read error: Connection reset by peer]
dmiller has quit [Ping timeout: 260 seconds]
freeayu_ has joined #ruby
robbyoconnor has joined #ruby
nari has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
KevinSjoberg has joined #ruby
freeayu has quit [Read error: Connection timed out]
ephemerian has joined #ruby
chriskk has joined #ruby
freeayu_ has quit [Client Quit]
blacktulip has joined #ruby
eka has joined #ruby
tomzx has joined #ruby
icole has joined #ruby
frankie_ has joined #ruby
buscon has joined #ruby
hukl has joined #ruby
brunoro has joined #ruby
freeayu has joined #ruby
brunoro has left #ruby [#ruby]
<aquagrunty> i am still strugglingi to get Sequel on ms sql
<aquagrunty> DBI works
<aquagrunty> but sequel doesn't for some reason
<Hanmac_> hm eigher there is no one interested or all have adblocker on ...
nari has joined #ruby
icole has quit [Ping timeout: 260 seconds]
wreckimnaked has joined #ruby
frankie_ has quit [Remote host closed the connection]
taoru_ has quit [Remote host closed the connection]
slainer68 has joined #ruby
cha1tanya has quit [Quit: Leaving]
emergion has joined #ruby
cha1tanya has joined #ruby
zommi has left #ruby [#ruby]
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jds__ has quit [Remote host closed the connection]
ryanf has quit [Quit: leaving]
rdark has joined #ruby
Vainoharhainen has joined #ruby
athst has quit [Quit: athst]
<shevy> topriddy as the main authority yes. but you did not understand the philosophy yet, it is to make the programmer feel happy
<shevy> topriddy you compare that with python's militant "my way or the highway, but we must be fun" philosophy
beiter has joined #ruby
marr has joined #ruby
<topriddy> shevy: like same? meanwhile, are you the same shevy guy i msg some weeks ago last yr that i was picking ruby?
freeayu has quit [Ping timeout: 265 seconds]
asteve has joined #ruby
<shevy> topriddy no idea, I have a very short term memory here :)
asteve has quit [Client Quit]
<shevy> if you don't remember, I probably won't either ;)
asteve has joined #ruby
<shevy> I call that "outsourcing of my brain functions" :P
<topriddy> lool. cool.
<topriddy> thanks.
taoru has joined #ruby
<aquagrunty> oh my
<aquagrunty> god
<aquagrunty> i found it
<aquagrunty> its working
<aquagrunty> oh my god yes :D Sequel.odbc i love you
chriskk has quit [Ping timeout: 260 seconds]
lkba has quit [Ping timeout: 260 seconds]
<shevy> everyone seems sleepy
<Hanmac_> or maybe they are at work like i am
haxrbyte has joined #ruby
Re^ has joined #ruby
Re^ has left #ruby [#ruby]
emergion has quit [Quit: Computer has gone to sleep.]
chriskk has joined #ruby
whowantstolivefo has joined #ruby
freeayu has joined #ruby
haxrbyte has quit [Ping timeout: 246 seconds]
friskd has quit [Read error: Operation timed out]
mahmoudimus has joined #ruby
grzywacz has joined #ruby
koshii has joined #ruby
berserkr has joined #ruby
horofox has joined #ruby
timonv has quit [Remote host closed the connection]
amaya_the has joined #ruby
emergion has joined #ruby
timmow has joined #ruby
gyre008 has quit [Remote host closed the connection]
<amaya_the> :)
horofox has quit [Ping timeout: 248 seconds]
arietis has joined #ruby
arturaz has joined #ruby
timonv has joined #ruby
haxrbyte has joined #ruby
haxrbyte_ has joined #ruby
zz_chrismcg is now known as chrismcg
coderhut has quit [Quit: Page closed]
nkts has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
dmiller has joined #ruby
whitedawg has quit [Quit: Leaving.]
browndawg has quit [Ping timeout: 248 seconds]
gianlucadv has quit [Read error: Connection reset by peer]
jacktrick has joined #ruby
workmad3 has joined #ruby
dmiller has quit [Ping timeout: 246 seconds]
gianlucadv has joined #ruby
tPl0ch has quit [Quit: Verlassend]
<j0sh\a> hi guys - I have created a nagios ruby script, but I only want it to alert during normal working hours. How can I do this in ruby?
<j0sh\a> Something like unless Time.utc between 9-5 ..
dbrgn_ is now known as dbrgn
macfurin has joined #ruby
includex has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
macfurin has left #ruby [#ruby]
nomenkun has joined #ruby
nomenkun_ has joined #ruby
RagingDave has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
nomenkun has quit [Ping timeout: 248 seconds]
tonini has quit [Remote host closed the connection]
Gooder has quit [Read error: Connection reset by peer]
mikekelly has joined #ruby
pcarrier has quit []
emocakes has joined #ruby
koshii has quit [Ping timeout: 255 seconds]
emergion has joined #ruby
<topriddy> how does Ruby play in the cultural neglect http://zedshaw.com/essays/curing_pythons_neglect.html
<Muz> Zed Shaw link detected. Troll likelihood: high.
chriskk has quit [Ping timeout: 276 seconds]
chriskk has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
yshh_ has quit [Remote host closed the connection]
atno has joined #ruby
havenn_ has quit [Remote host closed the connection]
<Hanmac_> ruby has nothing to neglect
havenn has joined #ruby
<topriddy> he has contributed a lot though :)
amaya_the has quit [Read error: Connection reset by peer]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
samuel02 has joined #ruby
gyre007 has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
havenn has quit [Ping timeout: 264 seconds]
danieldocki has joined #ruby
jacktrick has quit [Quit: Leaving]
mikekelly has joined #ruby
callenb has joined #ruby
topriddy has quit [Quit: Leaving.]
<emocakes> good post from zed
viuo has joined #ruby
pcarrier has joined #ruby
chussenot has joined #ruby
emergion has quit [Ping timeout: 264 seconds]
tomzx has quit [Quit: tomzx]
emergion has joined #ruby
<j0sh\a> hi guys - I have created a nagios ruby script, but I only want it to alert during normal working hours. How can I do this in ruby?
<j0sh\a> Something like unless Time.utc between 9-5 ..
stan has joined #ruby
craigp has joined #ruby
jds has joined #ruby
megha has quit [Quit: WeeChat 0.3.9.2]
viuo_ has quit [Ping timeout: 276 seconds]
dhruvasagar has quit [Quit: Lost terminal]
craigp has quit [Client Quit]
jdripper has joined #ruby
rezzack has quit [Quit: Leaving.]
dhruvasagar has joined #ruby
Xeago has joined #ruby
<Hanmac_> j0sh\a you mean Time.now.hour.between?(9,15) ?
yasu has quit [Read error: Connection reset by peer]
<stan> what's the best way to get an array of all of a particular key in a array of hashes, e.g. [{:value => 1}, {:value => 2}] to [1, 2]
yasu has joined #ruby
fjfish has joined #ruby
jds has quit [Ping timeout: 255 seconds]
<j0sh\a> Hanmac, yes something like that ...
<hoelzro> stan: map, I'd say
<hoelzro> aoh.map { |e| e[:value] }
<Hanmac_> stan hash.values
beneggett has joined #ruby
<hoelzro> >> aoh = [{:value => 1}, {:value => 2}] puts aoh.map { |e| e[:value] }
<eval-in> hoelzro: Output: "/tmp/execpad-f4ab0afa99e5/source-f4ab0afa99e5:1: syntax error, unexpected tIDENTIFIER, expecting $end\naoh = [{:value => 1}, {:value => 2}] puts aoh.map { |e| e[:value] }\n ^\n" (http://eval.in/6174)
<hoelzro> >> aoh = [{:value => 1}, {:value => 2}]; puts aoh.map { |e| e[:value] }
<eval-in> hoelzro: Output: "1\n2\n" (http://eval.in/6175)
<hoelzro> that's better.
Glacer232 has joined #ruby
francisfish has quit [Ping timeout: 272 seconds]
amaya_the has joined #ruby
clocKwize has quit [Quit: clocKwize]
sayan has quit [Read error: Connection reset by peer]
<stan> hoelzro: thanks
<hoelzro> np
io_syl has quit [Quit: Computer has gone to sleep.]
pcarrier has quit []
horofox has joined #ruby
havenn has joined #ruby
cdt has joined #ruby
clocKwize has joined #ruby
dmiller has joined #ruby
megha has joined #ruby
pcarrier has joined #ruby
kevinfagan has joined #ruby
katherinem13_ has joined #ruby
havenn has quit [Ping timeout: 248 seconds]
dmiller has quit [Ping timeout: 246 seconds]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
vlad_starkov has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
katherinem13 has quit [Ping timeout: 246 seconds]
katherinem13_ is now known as katherinem13
billy_ran_away has quit [Ping timeout: 260 seconds]
Glacer232 has quit [Quit: Textual IRC Client: www.textualapp.com]
pcarrier has quit [Ping timeout: 240 seconds]
billy_ran_away has joined #ruby
whitedawg has joined #ruby
pcarrier has joined #ruby
vlad_starkov has joined #ruby
nari has quit [Ping timeout: 245 seconds]
zarubin has quit [Ping timeout: 252 seconds]
security has joined #ruby
security is now known as fire
megha has quit [Read error: Operation timed out]
srji has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
coder_neo has joined #ruby
freeayu__ has joined #ruby
zarubin has joined #ruby
horofox has quit [Quit: horofox]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
wallerdev has quit [Quit: wallerdev]
Pip has joined #ruby
hukl has quit [Quit: Leaving...]
adamh has joined #ruby
timonv has quit [Remote host closed the connection]
zarubin has quit [Ping timeout: 264 seconds]
Beoran__ has quit [Read error: Connection reset by peer]
pencilcheck has joined #ruby
whitedawg has quit [Quit: Leaving.]
zarubin has joined #ruby
gues131 has quit [Quit: sleeping]
Beoran__ has joined #ruby
zarubin has quit [Read error: Connection reset by peer]
zarubin has joined #ruby
timonv has joined #ruby
jacktrick has joined #ruby
Umren|2 has joined #ruby
Hanmac_ has quit [Ping timeout: 245 seconds]
zarubin has quit [Read error: Connection reset by peer]
assurbanipal has quit [Remote host closed the connection]
zarubin has joined #ruby
Umren has quit [Ping timeout: 255 seconds]
havenn has joined #ruby
wallerdev has joined #ruby
fire has quit [Quit: WeeChat 0.3.9.2]
zarubin has quit [Read error: Connection reset by peer]
zarubin has joined #ruby
katherinem13 has quit [Ping timeout: 246 seconds]
wallerdev has quit [Client Quit]
karasawa has quit [Ping timeout: 276 seconds]
katherinem13 has joined #ruby
timonv has quit [Remote host closed the connection]
browndawg has joined #ruby
RagingDave has quit [Quit: Ex-Chat]
havenn has quit [Ping timeout: 276 seconds]
Virunga has joined #ruby
<gokul> Hello, when I do File.open("test", "r+") { |f| f.write "\n" } it inserts a newline at the begining but first character of the next line is deleted ( previously first line ) ? anyone know why ?
tk_ has joined #ruby
<gokul> What I want to do is to append text at the begining of a file
wreckimnaked has quit [Ping timeout: 248 seconds]
tvw has joined #ruby
billy_ran_away has quit [Ping timeout: 240 seconds]
karasawa has joined #ruby
slainer68 has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
billy_ran_away has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
katherinem13_ has joined #ruby
<csmrfx> gokul: ri File.open
danguita has joined #ruby
<banisterfiend> gokul: use "a"
<banisterfiend> oh
<banisterfiend> at the beginning
katherinem13 has quit [Ping timeout: 246 seconds]
katherinem13_ is now known as katherinem13
<banisterfiend> good luck with that, i think your best bet is to read the file into a buffer, write to the start of hte buffer, then write the buffer out back to disk
hukl has joined #ruby
pencilcheck has quit [Remote host closed the connection]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
yacks has joined #ruby
samphippen has joined #ruby
pencilcheck has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
niklasb has joined #ruby
taoru has quit [Remote host closed the connection]
fir_ed has quit [Ping timeout: 272 seconds]
timonv has joined #ruby
dmiller has joined #ruby
mercwithamouth has joined #ruby
TheFuzzball has joined #ruby
browndawg has quit [Quit: Leaving.]
agarie has quit [Remote host closed the connection]
agarie has joined #ruby
mengu has joined #ruby
kjellski has joined #ruby
browndawg has joined #ruby
dmiller has quit [Ping timeout: 264 seconds]
sie has joined #ruby
<sie> MRI still has GIL, correct?
yacks has quit [Ping timeout: 246 seconds]
<Pip> sie, What is GIL
<workmad3> sie: correct
wermel has joined #ruby
agarie has quit [Ping timeout: 240 seconds]
<sie> Pip, Hi there Pip. :] Global interpreter lock.
<sie> workmad3, What's keeping ruby from getting rid of it?
emergion has joined #ruby
<Pip> sie, How does it work?
<workmad3> sie: I don't know enough about the internals, but I think it's to do with the architecture of the MRI runtime that makes it difficult to safely remove
<sie> Pip, Does not allow complete thread parralelization, so only benefit for threads is i/o waiting. (the wording's weird but the idea should be clear)
buscon has quit [Ping timeout: 276 seconds]
freeayu has joined #ruby
<sie> I was curious exactly about the internals and the problem from ruby dev POV.
Hanmac_ has joined #ruby
<workmad3> sie: or, in better terms, the runtime only allows one thread of execution to be active at a time
megha has joined #ruby
<sie> Yea.
blaxter has quit [Quit: foo]
<Hanmac_> workmad3 what about other threads? like when i do a binding, and inside the C++ side its using its own threading system it should be "semi"-indipent from rubys threading system right?
<workmad3> Hanmac_: I don't know
<workmad3> Hanmac_: I would suspect that it would be though :)
moshee has quit [Ping timeout: 264 seconds]
<sie> Hanmac_, It is, I've tried it.
moshee has joined #ruby
moshee has joined #ruby
<sie> As long as it has nothing else to stop it from working, it will.
katherinem13_ has joined #ruby
chriskk has quit [Quit: chriskk]
katherinem13 has quit [Ping timeout: 246 seconds]
katherinem13_ is now known as katherinem13
<Hanmac_> in my bindings i reverse the calling order, so the C++ threads are the ones that call the ruby functions :P
vlad_starkov has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 248 seconds]
<clocKwize> quickly: would a class inherit an initialiser method from a module?
megha has quit [Quit: WeeChat 0.3.9.2]
<clocKwize> quicky*
Banistergalaxy has joined #ruby
<sie> Hanmac_, Do you mean if you run ruby code from two independant C threads?
<Hanmac_> clocKwize, only if in the class method calls super
<sie> s/c/native/
gokul has quit [Quit: Leaving]
larissa has joined #ruby
<clocKwize> Hanmac_: k, so assuming I don't define one, it will call the one in the module, if it exists
<clocKwize> and if I do define one, I need to call super if I want it to call the one from a module
<banisterfiend> clocKwize: of coures, module inclusion is nearly the same as class inheritance
<clocKwize> yup :)
topriddy has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
<Hanmac_> sie, i dont know .. i only know that my binded lib creates multible threads, and calls the ruby functions from Listener classes, i dont know if they only call them from one thread
haxrbyte has joined #ruby
haxrbyte_ has quit [Read error: Connection reset by peer]
<sie> Hanmac_, Anyway, if you try to run ruby code from anywhere in parallel, then one will wait for other to finish, that's it. :]
JohnBat26 has joined #ruby
thone_ has joined #ruby
bluOxigen has joined #ruby
skepti has joined #ruby
haxrbyte has quit [Ping timeout: 248 seconds]
cha1tanya has quit [Ping timeout: 248 seconds]
yacks has joined #ruby
thone has quit [Ping timeout: 265 seconds]
<aedorn> technically you can disable the GIL in MRI and see what it breaks or doesn't break
heshanh has quit [Quit: Page closed]
pencilcheck has quit [Remote host closed the connection]
cha1tanya has joined #ruby
<sie> The existence of GIL is unacceptable in my mind.
<topriddy> what is GIL? :/
<banisterfiend> sie: then use jruby
<sie> Easier said than done.
<aedorn> or Rubinius ... 2.0 seems to be shaping up pretty decently.
megha has joined #ruby
serhart has joined #ruby
<heftig> rubinius doesn't yet support /(?<foo>foo)/=~"foo";foo
<heftig> yay for obscure features
KevinSjoberg has joined #ruby
dwnichols has joined #ruby
<Hanmac_> obscure is awsome :P
malkomalko has joined #ruby
ryanjh has quit [Quit: Computer has gone to sleep.]
<JonnieCache> one does not simply remove the GIL
<hoelzro> Ruby automatically puts named captures into locals?
buscon has joined #ruby
<sie> JonnieCache, How come?
sailias has joined #ruby
carloslopes has joined #ruby
<JonnieCache> lol it was mostly a reference to that LOTR meme
<Hanmac_> hoelzro yes it does, but only if you do /regex literal with named captures/ =~ "string" , it does not work if you use an regex in a variable
BryanWB__ has joined #ruby
<sie> JonnieCache, Usually it has a basis.
hukl has quit [Quit: Leaving...]
<JonnieCache> but as i understand it, the GIL is a fundamental assumption of the interpreters architecture
roadt has joined #ruby
<sie> Or at least that's what I think :/
hotovson has joined #ruby
<sie> JonnieCache, A retarded assumption.
<JonnieCache> so to remove the GIL is to rewrite the whole thing
<hoelzro> Hanmac_: interesting
<BryanWB__> JonnieCache: no, just rewrite all the C modules
<sie> JonnieCache, Doubt it.
ffranz has joined #ruby
<JonnieCache> well if its that easy why dont you do it
<JonnieCache> you will be the toast of rubyland
<sie> Add smaller locks where state matters.
<sie> That's my question, but no one has an answer really.
<BryanWB__> anybody having trouble w/ bundle install where there is cucumber in your Gemfile?
<BryanWB__> it is hanging infinitely for me
<JonnieCache> its because its fucking hardcore computer science that will make your eyes bleed and there are very few people in the world capable of doing it, and all those people are being paid large amounts of money to do other things which takes up all their time
<Hanmac_> BryanWB__ "rewrite all the C" ... that is currenly 99.99% of that what i do for ruby :P
<heftig> zucchini are better
<BryanWB__> Hanmac_: ouch
<BryanWB__> heftig: i agree!
<aedorn> sie: well, no there is a basis.. it hasn't changed much since this: http://merbist.com/2011/10/03/about-concurrency-and-the-gil/
<sie> JonnieCache, Do not belive so.
<Hanmac_> of my 5 current working projects are 3 big C++gems and 2 are small ruby gems
<JonnieCache> python sufferes the same problem and they havent managed to fix it even with vastly more resources than the ruby community
<banisterfiend> sie: they had a branch where they removed the GIL
<Hanmac_> so in ruby as in FF, gil is important
<sie> banisterfiend, What happened to it?
dr_neek has quit [Quit: dr_neek]
katherinem13 has quit [Ping timeout: 248 seconds]
coderhut has joined #ruby
c3vin has joined #ruby
sepp2k has joined #ruby
<banisterfiend> sie: things actually ran slower without it, i dont remember why exactly. Also, it breaks C a lot of C extensions, and writing C extensinos becomes a lot harder
ffranz has quit [Quit: Leaving]
<matti> Concurrency is a lie!
<matti> Like the cake.
<JonnieCache> lol
Choclo has joined #ruby
Choclo1 has joined #ruby
Choclo has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby
<sie> banisterfiend, not much there in the post
<Hanmac_> hm my current bindings does not touch the GIL ... so i do neigher a blocking or unblocking ...
arkiver has quit [Quit: Leaving]
arkiver has joined #ruby
<mpfundstein> the conclusion of the article is funny
<banisterfiend> sie: it gives a few decent reasons: many existing C extensions would break, many C extensions would run slower, writing C extensions becomes a lot harder,
<mpfundstein> "Many ruby devs would shoot themselves in the foot if Matz would remove the GIL"
<mpfundstein> lol
<sie> banisterfiend, It doesn't say why and that's why I don't belive it.
<sie> It has statements, but no basis for them.
<sie> I understand that it's for the normal poeple, but still.
slainer68 has joined #ruby
<banisterfiend> sie: because if multiple C threads are running at the same time you have to worry about thread safety, currently that's not hte case
c3vin has quit [Ping timeout: 240 seconds]
<banisterfiend> sie: majority of C extensions at the moment know they wont execute concurrently with other ones, so they dont bother building in thread safety
<sie> Then it's shitty code.
tommyvyo has joined #ruby
<mpfundstein> no
<sie> Yes.
<mpfundstein> its the same in unix
<Hanmac_> mpfundstein like :" You shoot yourself in the foot and then have to justify it to all your friends who are still naively using Perl. "
<sie> o.O
<mpfundstein> you have strtok
<banisterfiend> sie: That's a stupid thing to say, it's YAGNI code, it's good.
<mpfundstein> for example
<mpfundstein> which is absolutely not thread safe
<banisterfiend> sie: why build in thread safety (which is hard to get right) when you dont need to?
<mpfundstein> in order to make it threadsafe they invented strtok_r
<mpfundstein> ruby is how old?
<mpfundstein> 199x
adkron has joined #ruby
<JonnieCache> sie: again, if you are in a position to dish out such criticism then surely you are in a position to fix it with ease
<banisterfiend> sie: it increases boilerplate and complexity of your code, and it's totally unnecessary when you have guarantees that it's not going to be running concurrently
megha has quit [Quit: WeeChat 0.3.9.2]
<mpfundstein> banisterfiend: well, avoid globals, make context structs, pass them through your functions, dont rely on state.. there are some rules which can make thread safety "easier"
<banisterfiend> mpfundstein: no shit, there's lots of ways to write threaded code, but when you have guarantees that your code is not going to be running in a threaded environment do you really want to bother with any of that?
<sie> My point is that ruby needs good threaded code. I think being afraid of doing threaded code is immature.
<mpfundstein> banisterfiend: word to that
<topriddy> GIL = Global Interpreter Lock. #NoThanks
<mpfundstein> sie: have you ever written a large scale multithreaded program ?
vlad_starkov has quit [Read error: Connection reset by peer]
<csmrfx> so, seleniuming
<csmrfx> what should I use to drive a browser?
<csmrfx> (with ruby)
vlad_starkov has joined #ruby
coder_neo has quit [Ping timeout: 276 seconds]
<matti> Is this another "we hate GIL" thing going?
szck has joined #ruby
<sie> mpfundstein, No, not too big.
<banisterfiend> sie: If you want a ruby implementation without a GIL, use JRuby, thousands of people do already. MRI is not likely to remove the GIL any time soon.
tommyvyo has quit [Client Quit]
megha has joined #ruby
wuzzzzaah has joined #ruby
coder_neo has joined #ruby
<mpfundstein> sie: well if you did, than you sould know about the pain :-)
<csmrfx> sie: you can start solving the problems associated with MRI GIL any time you like
<csmrfx> if you want good threaded code, how about trying jruby
<matti> csmrfx: He is trolling, is he?
<Hanmac_> sie and about bindings ... how can you write an threadsafe binding if the binded lib is not threadsafe?
akl_ has joined #ruby
<csmrfx> Sure, and I can also code *anything*
<sie> That's not the issue.
<csmrfx> topriddy: you can
<csmrfx> Can be done, but *time* is limited
<sie> trolling... ...
<sie> You can make everything thread safe.
<topriddy> can someone tell me if ruby is thread safe? can i write multithreaded apps in ruby like i would do in java?
<csmrfx> topriddy: well, I dont know if *you* can do it, but it is possible
<topriddy> and i sure hope simple case such as asynchronous activities is provided for
<csmrfx> topriddy: exactly as in java
jacktrick has quit [Quit: Leaving]
<csmrfx> (with jruby)
<topriddy> like click send email html form button, send email at background, return a email sent/processing page.
<matti> "Ruby is thread safe" -- what is wrong with this statement? ;]
<csmrfx> now go write some and report back once you have threaded code
Morkel has joined #ruby
<apeiros_> the world is thread safe!
<JonnieCache> hes not trolling its just the arrogance of youth :)
<csmrfx> my shirt is threaded
<matti> JonnieCache: Or stupidity.
wreckimnaked has joined #ruby
<JonnieCache> everyone is like that in that ~1.5year gap when they have a lot of skills but little professional experience
szck has quit [Ping timeout: 256 seconds]
<matti> JonnieCache: s/they have/they think they have/
<JonnieCache> one has to fuck up at least one big project and have their dreams crushed
danguita has quit [Ping timeout: 252 seconds]
nari has joined #ruby
jlast has joined #ruby
<matti> JonnieCache: Sadly, we have more Sparkly Developer Ninjas as of late than ever.
dmiller has joined #ruby
<sie> JonnieCache, Attacking me doesn't prove you're right.
<matti> JonnieCache: Every one is a developer nowadays. Your nerd-next-door too, probably.
<JonnieCache> i dont need to prove im right. its not a competition.
aganov has quit [Ping timeout: 276 seconds]
<matti> JonnieCache: +1
<matti> :)
<sie> ..
aganov has joined #ruby
<csmrfx> And then, we continued, on topic, about *real* problems we actually experienced with ruby solutions....
<csmrfx> ...and forgot all the imaginary ones that are of no relevance
<sie> I think it is a real problem, maybe only not as important as other ones.
<sie> We're all entitled to our own opinion. :]
<JonnieCache> but yeah sorry i was being a bit rude. didnt mean to. its just something ive seen before. i was that guy once. thinking i could automatically conquer any problem just because i could do CS stuff like write concurrent compilers
dr_bob has quit [Quit: Leaving.]
<csmrfx> sie: if you have a real proble, then you can pastie or gist your problem and the error and we can try to help you
<csmrfx> *problem
c3vin has joined #ruby
<sie> JonnieCache, I'm simply discussing. I'm not saying „I CAN DO IT!“ or that it's easy. I was wondering why and people jumped onto thinking I'm simply the new guy, which although is true, isn't revelant to the question.
foohey has joined #ruby
foohey has quit [Changing host]
foohey has joined #ruby
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
dr_bob has joined #ruby
[1]c3vin has joined #ruby
<mpfundstein> sie: that is like you discuss with someone the internals of an BMW engine without now what a sparking plug does
jlast has quit [Ping timeout: 260 seconds]
dmiller has quit [Ping timeout: 264 seconds]
RagingDave has joined #ruby
<mpfundstein> sie: i cant argue how hard it would be to implement it in ruby as i dont know the ruby src... but i know how freaking hard it is to write *good* threaded code
<mpfundstein> sie: and its not because the language requirements differ etc.. the problem is that the threaded code is incredible hard to follow and threading must be planned upfront to receive good results
c3vin has quit [Ping timeout: 240 seconds]
[1]c3vin is now known as c3vin
mercwithamouth has joined #ruby
<csmrfx> is the GIL problem actually about the underlying C libs...
wuzzzzaah has quit [Quit: wuzzzzaah]
akl_ has quit [Remote host closed the connection]
adambeynon has joined #ruby
ner0x has joined #ruby
ffranz has joined #ruby
coderhut_ has joined #ruby
nwertman_ has joined #ruby
coderhut has quit [Quit: Page closed]
<workmad3> I know the rubinius runtime has managed a lot of progress towards removing the GIL there... I remember (I think it was from a RR podcast) a discussion that I seem to recall pointing out that doing it in rubinius had very little impact on achieving the same in MRI though, because of differing architectures and general implementation
serhart has quit [Quit: Leaving.]
nwertman has quit [Ping timeout: 260 seconds]
chussenot has joined #ruby
<Hanmac_> my gems are mostly work on MRI and rubinius too
<workmad3> I don't have a massive problem with the GIL though, tbh... I find it much easier when I need concurrency to start down the multi-process route
<workmad3> bit of extra overhead for multiple ruby processes, yes, but much simpler to conceptually follow what's happening IMO
<matti> workmad3: +1
<topriddy> for an experienced java developer, wanting to play with ruby in spare time? do i have to concern myself with all these brouhahas?
<workmad3> topriddy: not really
haxrbyte has joined #ruby
<workmad3> topriddy: the GIL is just an aspect of the runtime that limits performance in threaded, CPU-bound apps running on multi-core machines
mjolk has joined #ruby
whitedawg has joined #ruby
sayan has quit [Read error: Connection reset by peer]
<workmad3> topriddy: if you're just playing in your spare time, I doubt you'll hit any real issues with it (and if you're an experienced java dev, you may want to play with jruby anyway... stays on the JVM, no GIL, and interops well with standard java libs from what I've heard)
mark_locklear has joined #ruby
<matti> workmad3: ... and has its own set of peoblems.
<matti> problems*
dr_neek has joined #ruby
<workmad3> matti: yeah :)
haxrbyte_ has joined #ruby
clocKwize has quit [Read error: Connection reset by peer]
<matti> If, before even using the language for some time you are already worried about things like GIL.
invisime has joined #ruby
<matti> I dare to say "you are doing it wrong".
KL-7 has joined #ruby
<workmad3> matti: :D
<matti> Its like fallacy of pre-mature code optimisation.
<matti> With that being said, this paranoia can extend way futher.
<matti> Like.
clocKwize has joined #ruby
<matti> I should stop sleeping knowing that my DDR memory which is unbuffered and non-ECC may cause parity errors during RAS/CAS
<matti> OMG
<matti> That is dissasterous.
hamed_r has quit [Quit: Leaving]
<matti> Lets panic now.
bluOxigen has quit [Ping timeout: 246 seconds]
jpfuentes2 has joined #ruby
<workmad3> matti: what???
* workmad3 removes all sleeps from all code running on his machine
<workmad3> must avoid parity errors!!!!
bluOxigen has joined #ruby
<matti> workmad3: No, sleep as "my sleep".
horofox_ has joined #ruby
<sie> my $sleep;?
<JonnieCache> matti: just thing about all those cosmic rays fucking up your data?
<matti> workmad3: You know, with the dreams of me being super successful surrounded by beautiful women.
<JonnieCache> oops
x0F has quit [Disconnected by services]
vlad_starkov has quit [Remote host closed the connection]
x0F_ has joined #ruby
<JonnieCache> s/thing/think
<matti> JonnieCache: OMG NO NO NO
<workmad3> matti: ah right, those things :)
<matti> JonnieCache: You fream me out.
Proshot has joined #ruby
x0F_ is now known as x0F
<matti> :<
<JonnieCache> cosmic rays apparently flip bits in computers quite regularly
<matti> Hehe
<workmad3> JonnieCache: time to wear that lead hat to block all those damn cosmic rays
<matti> workmad3: ... and government.
<matti> ;d
haxrbyte has quit [Ping timeout: 252 seconds]
<workmad3> how thick does it need to be to block gamma radiation? something like a meter thick?
<JonnieCache> that paper is pretty amazing
<workmad3> and don't forget about all those neutrinos... who knows what they're doing
dustint has joined #ruby
<matti> So, yeah.
<matti> And you worry about GIL.
<matti> Phew, little do you know...
<matti> ;d
dhruvasagar has quit [Ping timeout: 248 seconds]
Choclo1 has quit [Ping timeout: 252 seconds]
ttt has quit [Remote host closed the connection]
<sie> *Matti looks in the mirror and asks: „Mirror, mirror on the wall, who's the wisest of them all?“*
<matti> sie: I won't.
nemesit has quit [Ping timeout: 240 seconds]
<matti> sie: Mirror is not thread-safe.
<matti> ;d
bdnelson has quit [Quit: Textual IRC Client: www.textualapp.com]
<matti> sie: It is just funny.
adkron has quit [Ping timeout: 256 seconds]
<matti> sie: People discover threads, get all excited about them...
akl_ has joined #ruby
KL-7 has quit [Quit: Leaving]
NimeshNeema has joined #ruby
<matti> sie: Start using it and then go "OMG this thing is hard".
<matti> sie: Then, later they discover event-driven programming paradigm.
<matti> sie: Again, get all excited... start using it.
banisterfiend has quit [Remote host closed the connection]
<matti> sie: And again go "ZOMG this thing is also HARD cookie",
cha1tanya has quit [Quit: Leaving]
<sie> I've used threads, it's not the silver bullet, but I found a good application for them.
moshee has quit [Ping timeout: 260 seconds]
<matti> sie: The problem is, that often people confuse when to use processes, threads and what is really parallel vs concurrent.
nwertman_ has quit [Ping timeout: 276 seconds]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
<matti> sie: And as proven by many projects out there "striving for simplicity always pays off".
<Hanmac_> try brownees from the second last christmas ... this are HARD cookies :P
<sie> I know, I'm already in high school!
<workmad3> threads are basically just a way of setting up processes with uncontrolled shared memory
<sie> Hanmac_, haha
<workmad3> which we then spent decades figuring out how to add control back to the access
<matti> Hanmac_: Now that is borderline S/M ;p
Villadelfia_ has joined #ruby
megha has quit [Quit: WeeChat 0.3.9.2]
SeySayux has quit [Ping timeout: 260 seconds]
nari has quit [Ping timeout: 248 seconds]
<matti> I am just waiting for conversation about how Ruby optimises tail-recursion to happen.
<matti> :)
<matti> It will trully be the cherry on the top ;p
<matti> God, one can miss good old FUD on usenet ;p
<workmad3> :)
blueOxigen has joined #ruby
<matti> But IRC fill the gap just right.
<ner0x> How can I remove all gems and reinstall using rvm?
<matti> fills*
Villadelfia has quit [Ping timeout: 260 seconds]
<workmad3> ner0x: is this with a ruby that's already installed with rvm?
<csmrfx> So many good rubyists with time to irc it's amazing!
QKO_ has quit [Read error: Operation timed out]
<sie> ner0x, rm -rf ~/.rvm
<workmad3> csmrfx: you're assuming we're good rubyists? :)
<workmad3> sie: no
QKO has joined #ruby
<csmrfx> workmad3: I know
<workmad3> sie: if you want to do that, at least use rvm implode
<matti> csmrfx: I am not a Rubist ;p
bluOxigen has quit [Ping timeout: 276 seconds]
mikecmpbll has joined #ruby
<matti> csmrfx: I am this unique AI that lurks on the net, and happens to read IRC ;p
<sie> matti, *rubyist, I think
SeySayux has joined #ruby
<apeiros_> rubynaut
<csmrfx> rubbyers?
* apeiros_ is a rubynator
<matti> I just do Ruby Gangname style.
* matti always wanted to say that ;p
<matti> Or, whatever the correct spelling is ;p
<ner0x> workmad3: I can rvm remove and rvm reinstall? Or possibly delete an .rvm/gems/* dir?
<matti> apeiros_: Haha
<matti> apeiros_: :)
<csmrfx> Ruby tuesday...
carloslopes has quit [Remote host closed the connection]
jonathanwallace has quit [Read error: Operation timed out]
<workmad3> ner0x: you should be able to do it with 'rvm gemset empty'
<ner0x> workmad3: I'll try it.
platzhirsch has joined #ruby
<Spami> hey guys what tools/services are you using to test a website in order to make sure it's cross browser ?
<workmad3> ner0x: not sure if that'll work with the default gemset... you might need to ask in #rvm about that :)
<platzhirsch> Is there a convention for maximum column width in ruby files?
<ner0x> workmad3: I need to figure out gemsets.
blueOxigen has quit [Ping timeout: 248 seconds]
dmiller has joined #ruby
tommyvyo has joined #ruby
<workmad3> matti: Gangnam style!
<workmad3> matti: although it's now 2013... we need the new gangnam style now...
<matti> sie: I am sure that if you happen to remove GIL form Ruby this type of events may follow: millions will love you (like they did with Elvis), DHH will propose a marriage, and Google will hire you for a lot of $$$ on the spot asking whether you want to have 120 square-meter office with the view of the ocean, or prefer split-level penthouse office in NYC.
<matti> sie: Meanwhile, get cracking with normal Ruby.
<lupine> platzhirsch, 80 columns, as ever
nwertman has joined #ruby
<workmad3> matti: I suspect EY would be more likely te come up with the job offer, rather than google :)
<workmad3> matti: google is more python
<platzhirsch> lupine: thanks
carloslopes has joined #ruby
<matti> workmad3: I was just being hysterical ;p
<workmad3> matti: that's no reason to be completely crazy ;P
<ner0x> workmad3: Nope, removed rails, etc. That works.
<matti> workmad3: :S
<matti> workmad3: hehe
<lupine> if you want to be really conservative, 72 columns, but rubyists aren't known for that
<lupine> don't be surprised to occasionally come across lines hundreds of columns wide, though
<matti> lupine: We all have 27" Thunderbolt displays, dont we ;p
griffindy has joined #ruby
<workmad3> lupine: I push the boat out with SMS columns... 160 chars
bluOxigen has joined #ruby
<matti> lupine: 120 is teh gig on them ;p
<workmad3> programming maxim #80: If your screen is wider than 80 characters, your font size is too small
<lupine> these days, I make use of the extra horizontal space by tiling editors
dmiller has quit [Ping timeout: 246 seconds]
<lupine> I did consider moving my screen into its supported portrait mode
aedorn has quit [Quit: Leaving]
szck has joined #ruby
<sie> matti, Why are you telling me this?
<csmrfx> I like the vert position
<matti> sie: Voices made me ;]
sailias has quit [Quit: Leaving.]
<csmrfx> Did you know that having your windows visible, requiring only eye+head movement vs window or view increses your productivity by up to 10%
nemesit has joined #ruby
asteve has quit [Quit: Computer has gone to sleep.]
<platzhirsch> How can I wrap lines in Ruby if they succeed 80 characters? Is there a formatting rule?
<lupine> nothing universally accepted
philips_ has quit [Excess Flood]
<lupine> (I don't even come close to following all that)
<platzhirsch> lupine: thanks for pointing out :)
<platzhirsch> what a pitty, I like the idea of PEP8 for Python, Vim checks every time I save the file
CaptainKnots has joined #ruby
CaptainKnots has quit [Changing host]
CaptainKnots has joined #ruby
jonathanwallace has joined #ruby
<workmad3> platzhirsch: python very much subscribes to the idea of 'one (accepted) way to do anything and everything'
<workmad3> platzhirsch: ruby subscribes to the idea of 'one size does not fit all'
* apeiros_ still thinks 80cols rule runs counter the notion of descriptive method- & variable names
<platzhirsch> workmad3: but offering multiple alternatives at the same time
<apeiros_> platzhirsch in an 80col world would be called pltzhrsch
<apeiros_> or plhr
<workmad3> platzhirsch: a strict 80 col limit would mean a line was wrapped the moment I had 81 chars... I prefer flexibility, if I have 81 chars I may keep it on one line or split it, depending on which seems neater
<platzhirsch> apeiros_: yes, throwing many underscores into the names and writing a full sentence
zyriuse_ has joined #ruby
vlad_starkov has joined #ruby
<lupine> apeiros_, given some of the method names i've come up with in the past, the 80-col limit is helpful, I would contend
<zyriuse_> help
<lupine> it's a gentle encouragement to keep things broken up
<apeiros_> lupine, platzhirsch: I didn't say that a single name would be 80 cols
<apeiros_> but usually you have more than a single method/variable in a line, don't you?
<platzhirsch> apeiros_: absolutely
<lupine> sure, the example that immediately sprang to mind looked a bit like foo_is_bar && bar_is_baz && xyz_is_a_kind_of_nice_thing ? do_my_stuff : do_my_other_stuff
<lupine> (phew, that is > 80 cols)
<apeiros_> lupine: the difference between concise & verbose…
fuzai has joined #ruby
<workmad3> platzhirsch: think of it like this... would you rather be completely untrusted and have a rule dictated to you that you must never go over 80 cols, or would you rather be trusted and be able to go over that amount if it made sense to do so?
<lupine> I use descriptive names and in general, if I find my lines going over 80 cols, it's because there's a concept waiting to be reified
<lupine> not always true, of course
<llaskin> so I just switched from 1.8.7 to 1.9.3. In the process I had to redefine the String.is_binary_data?, however, I'm still getting an issue where something that *WAS* a string before and when printed out via puts outputed "blah" now outputs [["blah"]]. Even when I run a String#to_s on it, the value of it still remains [["blah"]]
<llaskin> any thoughts?
<apeiros_> lupine: my experience is that people tend to blindly shorten names when forced to use 80 cols. if you've better experience, good for you.
<platzhirsch> workmad3: I cannot decide that without taking programming into context, I like both. The freedom Ruby offers here and the restriction for instance Java puts on it (for example one class per file, more or less]
<apeiros_> I prefer not blindly applying measures
<fuzai> Hi i'm very new to ruby again ( i tried it years ago ) and i'm trying to install a module I pulled from a git repo and it's documentation is lacking. https://github.com/obrie/turntabler is what i'm trying to use and after i do the two command it lists and it claims it's installed the module, my test script borks as the the require for the library
<csmrfx> Dont your editors support wrapping?!
<workmad3> lupine: exactly :) while it might be generally the case, it isn't a universally true rule
mrsrikanth has joined #ruby
<fuzai> could someone explain to me what i need to do to install that module correctly?
kevinfagan has quit [Quit: Leaving...]
<csmrfx> llaskin: impossible, unless you changed .to_s
<fuzai> i'm using ubuntu 12.04.01 and ruby -v says 1.9.3
<workmad3> csmrfx: I turn it off because I hate line wrapping
<llaskin> csmrfx: but yet, it's happening.
Banistergalaxy has quit [Ping timeout: 256 seconds]
<csmrfx> llaskin: because you changed .to_s
<llaskin> sadly i can't create a "minimal working example"
<llaskin> i did NOT change to_s.
<workmad3> llaskin: if it's [["foo"]], then .to_s will produce "[[foo]]"
<csmrfx> fuzai: please pastie or gist your session and errors so people can help troubleshoot
<platzhirsch> csmrfx: it does
<apeiros_> llaskin: sounds to me like you had an array before
ananthakumaran has quit [Quit: Leaving.]
<fuzai> uno momento
<apeiros_> [["foo"]].to_s in 1.8 is "foo"
<apeiros_> in 1.9 it is "[[foo]]"
<csmrfx> >> [["foo"]].to_s
<eval-in> csmrfx: Output: "" (http://eval.in/6189)
<csmrfx> >> p [["foo"]].to_s
<eval-in> csmrfx: Output: "\"[[\\\"foo\\\"]]\"\n" (http://eval.in/6190)
<csmrfx> wow
platzhirsch has left #ruby [#ruby]
<csmrfx> Ok, ignore my comments, llaskin, I clearly havent a clue
<llaskin> apeiros_: hah, you know what...you may be right.
<workmad3> csmrfx: you're right that the value doesn't remain as [["blah"]] btw :)
<apeiros_> oh, I'm slow, workmad was once again faster than I
<workmad3> it has changed to a string
beneggett has joined #ruby
<workmad3> just the string contains the [[ ]] characters wrapping the array :)
philips_ has joined #ruby
<csmrfx> >> p [["bar"]].join
<eval-in> csmrfx: Output: "\"bar\"\n" (http://eval.in/6191)
<csmrfx> or something perhaps
ndrei has joined #ruby
<fuzai> http://pastie.org/5648178 heres my terminal log
<fuzai> i'm sure whatever the problem is it's really simple
bluOxigen has quit [Ping timeout: 264 seconds]
Fox_candy has joined #ruby
joofsh has joined #ruby
bluOxigen has joined #ruby
krawchyk has joined #ruby
<llaskin> you know what it is/was(working on it now...)? Mysql2 gem and its style of outputting isn't agreeing with me...
horofox_ has quit [Quit: horofox_]
rdark has quit [Read error: Operation timed out]
<csmrfx> fuzai does that require -line work in a file with nothing else in it?
andremaha has joined #ruby
megha has joined #ruby
<fuzai> nope same load error
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<csmrfx> well, the turntabler isn't in rubys path
<fuzai> well how do i install it correctly then?
<fuzai> i'm sorry but the documentation assumes alot
planetbomba_ has joined #ruby
huoxito has joined #ruby
solidresolve has quit [Read error: Connection reset by peer]
<fuzai> wow i think i fixed it
<fuzai> i typed bundle by itself as my user it asked me for my password to root
<fuzai> and i think it's good now
xemu has joined #ruby
<fuzai> thank you :)
thone has joined #ruby
<csmrfx> gl!
rdark has joined #ruby
dmiller has joined #ruby
thatguycraig has joined #ruby
solidresolve has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
a_a_g has quit [Quit: Leaving.]
s1n4 has joined #ruby
jrist-afk is now known as jrist
s1n4 has quit [Client Quit]
willob has joined #ruby
<llaskin> so what it boils down to is I'm using the mysql2 gem incorrectly. Can anyone provide me with a suggestion?
jerius has joined #ruby
<csmrfx> llaskin cant you just take the value out of the array
thone_ has quit [Ping timeout: 252 seconds]
<csmrfx> or join it, flatten it, whatever
<csmrfx> >> p ["bar"].to_s
<eval-in> csmrfx: Output: "\"[\\\"bar\\\"]\"\n" (http://eval.in/6192)
<topriddy> anyone willing to share sample dev environment/tools for their ruby environment on mac?
Zolrath has quit [Ping timeout: 255 seconds]
<fuzai> exit
fuzai has quit [Quit: Leaving]
megha has quit [Quit: WeeChat 0.3.9.2]
anannie has joined #ruby
dmiller has quit [Ping timeout: 248 seconds]
allsystemsarego has joined #ruby
<llaskin> going result.to_a.flatten prints out ["llaskin"]
<llaskin> so flatten.flatten?
arkiver has quit [Ping timeout: 248 seconds]
megha has joined #ruby
<anannie> I've noticed something strange; I'm trying to get an approximate square root by doing a bitwise shift to the right and for some reason this operation is slower than doing Math.sqrt... Why is that? Further why does the bitwise right operation return nil for the variable it's done on?
GoGoGarrett has joined #ruby
<ner0x> https://gist.github.com/4484000 gem install therubyracer error Any help would be appreciated. I'm assuming it's a version mismatch.
<llaskin> result.to_a.flatten.flatten doesn't work neither does result.to_a.flatten.to_s. Both result in "[\"llaskin\"]" as their output
jjbohn has joined #ruby
<apeiros_> .flatten.flatten is pointless
<apeiros_> flatten already recurses
<apeiros_> ["llaskin"].first # => "llaskin"
<apeiros_> if you have multiple, use .join
<apeiros_> but I'd clean up whatever creates that mess in the first place…
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby
digifiv5e has joined #ruby
jtharris has joined #ruby
jpfuentes2 has joined #ruby
zyriuse_ has quit [Quit: leaving]
<anannie> Here are the two identical pieces of code and for some reason, the first one will run slower, than the other. Despite the fact that bitwise operations should be faster! https://gist.github.com/4484088
miskander has joined #ruby
<llaskin> apeiros_: its the mysql gem
<llaskin> mysql2 gem that is
<llaskin> sorta out of my hands without hacking the gem...which I really don't wann do
kpshek has joined #ruby
banisterfiend has joined #ruby
<apeiros_> llaskin: I doubt that the mysql2 gem is the issue…
<Hanmac_> about unit test cases ... what about calling assert_equal in a loop ? i i use it to look if an enumerator returns the right elements at the right time?
<llaskin> apeiros_: first still outputs ["llaskin"]
<topriddy> good advised online ruby tutorial
geekbri has joined #ruby
<apeiros_> llaskin: then you're not telling the whole story.
<llaskin> i am giving you the entire code that produces this
<apeiros_> figure out what you really have
dr_bob has quit [Quit: Leaving.]
<ericwood> topriddy: read all of this: https://github.com/ruby/ruby
<topriddy> lol...that looks like the ruby code
<topriddy> trolling?
<llaskin> i dislike being accused of lying.
thone has quit [Ping timeout: 246 seconds]
<ericwood> topriddy: yes. It's been too long since I learned, I'm not sure what the best guides are now
<ericwood> so, sorry :P
<Hanmac_> topriddy its not "ruby code", its more than "rubys code" :P
megha has quit [Quit: WeeChat 0.3.9.2]
<ericwood> builds character
<Hanmac_> its more a wordpun :P
amaya_the has quit [Ping timeout: 265 seconds]
Guest25886 has joined #ruby
<llaskin> apeiros_: the value stored in the db wwhere I have llaskin of type the value table is of type varchar(1024).
breakingthings has joined #ruby
hasse has joined #ruby
<llaskin> the method I am using is identical except I changed the hostname/username/passwd
<llaskin> what else would you like of the story?
willob has quit [Quit: Leaving.]
amaya_the has joined #ruby
dr_bob has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
bluOxigen has quit [Ping timeout: 264 seconds]
<topriddy> Hanmac: ericwood: trolls arent amusing when you have a real life problem to solve.
<topriddy> ericwood: I have 2007 little book of ruby.
<llaskin> i'm definitely not trolling...just trying to get help
fuzai has joined #ruby
* Hanmac_ learned ruby without an real ruby book ....
<ericwood> topriddy: the Ruby koans are not a bad starting point, but it really depends on how much you know about it already and your previous programming experience
<Hanmac_> i dont even rememeber how i learned ruby ...
callenb has quit [Quit: Leaving.]
tchebb has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
digitalsanctum has joined #ruby
<ericwood> Hanmac_: yeah, I did a little bit of everything and wrote shitty code until it clicked, so I always have trouble answering that question :\
<topriddy> llaskin: same here. good luck.
<fuzai> http://pastie.org/5648309 could someone please explain to me what the double || on the first line means?
* ericwood maintains that his joke earlier was funny and not terribly detrimental.
<workmad3> fuzai: it's a block parameter
<llaskin> fuzai: thats going to do it for each user that is inside of client
Nisstyre-laptop has joined #ruby
<Hanmac_> fuzai its like a variable in a for loop
<fuzai> is there something I could google that would explain that more in depth?
<fuzai> oh ok
clocKwize has quit [Quit: clocKwize]
megha has joined #ruby
<fuzai> ohhhhh i think i get it now
<fuzai> thank you
clocKwize has joined #ruby
<anannie> I've googled everywhere and I can't find this on any listing
<fuzai> sorry i understand perl and php and some other things and the last time i looked at ruby was a few years ago for a brief while
<llaskin> fuzai sure, try to take a look at how blocks work in ruby. Take a look at the array.each definition or an example of how the each block works
chussenot has quit [Quit: chussenot]
<fuzai> could you give me a good link to read up?
<fuzai> i'm good at reading things :)
<anannie> fuzai: Try Zed Shaw's Learn Ruby The Hard Way
<ericwood> fuzai: blocks are pretty fundamental, maybe this may help: http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/
<ericwood> it might assume a bit much, though
<fuzai> thank you
<anannie> fuzai: I really, really recommend Zed Shaw's learn ruby the hard way, it teaches you Ruby and programming one step at a time
<fuzai> can i find it online somewhere to read?
ttt has joined #ruby
<ericwood> topriddy: people seem to like Learn Ruby the Hard Way, check that out
<fuzai> thank you so miuch
<fuzai> much
<topriddy> okay. will do. thanks all.
bluenemo has quit [Remote host closed the connection]
whitedawg has quit [Ping timeout: 240 seconds]
joshcheek has quit [Quit: joshcheek]
<anannie> This is either a bug in the language, or I don't get the implementation
katherinem13 has joined #ruby
jeffreybaird has joined #ruby
rakl has joined #ruby
CamonZ has quit [Quit: Linkinus - http://linkinus.com]
mercwithamouth has quit [Ping timeout: 252 seconds]
hotovson has quit [Remote host closed the connection]
tchebb has joined #ruby
ttt has quit [Ping timeout: 245 seconds]
<apeiros_> llaskin: as said, figure out what you really have
<workmad3> anannie: you'd need to look at the implementation of >> for a fixnum
<apeiros_> if .first is still the same as without, then you do not have an array.
Nisstyre-laptop has quit [Quit: Leaving]
<anannie> I mean the first piece of code with a bitwise shift to the right should work faster than the one that uses the internal Math.sqrt function. I keep on going through the code, I've googled everywhere and there really isn't any reason why the first implementation is slower and note that it isn't slower by a few milliseconds but by a few seconds https://gist.github.com/4484088
Fox_candy has left #ruby [#ruby]
<anannie> I have workmad3
carloslopes has quit [Remote host closed the connection]
chussenot has joined #ruby
<workmad3> anannie: because you need to keep in mind that 'num >> 1' isn't a bitshift... it's 'num.>>(1)'
megha has quit [Quit: WeeChat 0.3.9.2]
<workmad3> (a method call)
<Hanmac_> apeiros_ does you know that:
<Hanmac_> >> p 4[2]
<eval-in> Hanmac_: Output: "1\n" (http://eval.in/6193)
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<anannie> Yes, workmad3 and I've gone and studied the implementation and well surely that method call should be faster than Math.sqrt(num)
<workmad3> anannie: also, >> 1 isn't an approximate sqrt, it's dividing by 2
<apeiros_> Hanmac_: Integer#[]? yes, that's known to me
<llaskin> apeiros_: I gave you as much as I had/my level of knowledge allowed me to give you
<llaskin> not EVERYONE operates at your level dude.
<workmad3> anannie: which is quite a marked difference
willob has joined #ruby
<apeiros_> llaskin: .class isn't that hard, dude.
<anannie> workmad3: Well yes, it's dividing by two but it works out
pcarrier has quit []
<apeiros_> llaskin: providing code isn't that hard either, dude.
<llaskin> i gave you code!
<llaskin> did you even look at the damn gist?
<apeiros_> I didn't see a gist link…
callenb has joined #ruby
<anannie> for small numbers workmad3, I just need an approximate integer value
<llaskin> (9:08:00 AM) llaskin: https://gist.github.com/4484044
segv- has joined #ruby
devdazed has quit [Quit: Bye]
<workmad3> anannie: for small numbers, I doubt you'll see any real differences
<Hanmac_> llaskin: print the class of result
<llaskin> Hanmac, I got it now, thanks tho
joshman_ has joined #ruby
<apeiros_> llaskin: what's your current time?
<llaskin> it needed to be result.first.first
<llaskin> 9:41AM
<ericwood> Time.now
<llaskin> lol
<llaskin> >> Time.now
<eval-in> llaskin: Output: "" (http://eval.in/6194)
<apeiros_> llaskin: that line is not in my backlog… no idea why
<anannie> workmad3: Yup, but the code is still slower. Should I share the entire thing? I've implemented an optimised sieve of Eratosthenes
<Hanmac_> >> p Time.now
<eval-in> Hanmac_: Output: "2013-01-08 15:44:42 +0100\n" (http://eval.in/6195)
wroathe has joined #ruby
<Hanmac_> hm it seems that the server time is wrong :/
<apeiros_> llaskin: anyway, result probably is not an array.
<ericwood> I need a desk clock that just outputs the Unix time
<apeiros_> llaskin: and as I told you, you should figure out what it is, then read the docs of whatever it is.
<Hanmac_> did you guys see that? the eval-in bot is from the future :D
<llaskin> result is of type MYSQL2 element
<workmad3> anannie: also, even for small numbers dividing by 2 is a big difference compared to sqrt... for 16, you're running the loop twice as much as you need, for 25 you're running it almost 3 times...
thone has joined #ruby
<llaskin> i def spent time looking at the docs for it
<ericwood> >> p "hello?"
<eval-in> ericwood: Output: "\"hello?\"\n" (http://eval.in/6196)
<llaskin> they aren't super detailed
<ericwood> oh wow
andremaha has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
devdazed has joined #ruby
<Hanmac_> llaskin: than it may call Object.to_a with per default is [object] ... maybe
<apeiros_> llaskin: ah, no, :as => :array - you do get an array of arrays back
hasse has quit [Ping timeout: 245 seconds]
<workmad3> anannie: and I bet Math.sqrt(16) is more efficient than running 'number = number / prime and factor_list << prime if number % prime == 0' 4 times ;)
v0n has joined #ruby
<anannie> workmad3: Ah, that explains it. :)
<apeiros_> llaskin: I said ["foo"].first # => "foo"
lateau has joined #ruby
<apeiros_> but you have [["foo"]], and then of course .first gives you just ["foo"]
<llaskin> yea result.class is actually of type Mysql2::Result
<anannie> workmad3: What I was trying to implement was a series of shifts depending upon the size of the number to arrive at an approximate root.
<workmad3> anannie: yeah, once you start thinking in terms of actual numbers, it gets clearer :)
<apeiros_> if you only want one row and one field, there's probably a method on Mysql2 to do that for you
<anannie> workmad3: I should implement that first and then compare things, because it really depends upon the order of magnitude
<llaskin> not one I could find apeiros_
<anannie> sorry for the fuss workmad3
<anannie> That was a rather dumb error to make
<Hanmac_> llaskin hm if you do "as array" than its totaly normal that an array of arrays ... array of rows, while a row is a array => so an array of arrays ... that else did you expect?
nathancahill has joined #ruby
ananthakumaran has joined #ruby
<apeiros_> indeed, seems mysql2 is rather minimal in the provided functionality.
<apeiros_> oh, cross poster…
<workmad3> apeiros_: it's a db adapter... I wouldn't expect it to provide much
<apeiros_> workmad3: I'd expect it to cover the underlying client lib
<llaskin> apeiros_: yea but the mysql gem all of a sudden stopped working...don't ask me why, and i didn't want to waste time figuring out....and in 1.8.7 the prior code which was result.to_a.to_s worked.
<apeiros_> granted, mysql is a wee bit in the past, but the client lib could most certainly more than that
buscon has quit [Read error: Connection reset by peer]
thone has quit [Ping timeout: 240 seconds]
buscon has joined #ruby
<workmad3> I don't know what the client lib has... would it really have much more than how to establish connections with various options?
scruple has quit [Ping timeout: 240 seconds]
<workmad3> and converting the results into objects suitable for ruby
<Hanmac_> 1.8.7 is dead and the support will end in less than six months ... so what will you do? (and what will apple do?)
<llaskin> Hanmac exactly why I am trying to migrate to 1.9.3 NOW.
megha has joined #ruby
<shevy> LONG LIVE 1.8.7!!!
<llaskin> and thus dealing with issues.
<Pip> Will Ruby 2.0 be fabulous?
<shevy> Pip better than your mom!
beneggett has joined #ruby
callenb has left #ruby [#ruby]
Elhu has quit [Ping timeout: 252 seconds]
<Hanmac_> 2.0 will be better than 1.9.3-p362
<llaskin> but will it work well with windows
Villadelfia_ is now known as villadelfia
<shevy> the earlier ruby versions worked well with windows
<ericwood> really?
<shevy> why do you ask whether future versions would not work, that doesn't make a lot of sense
<shevy> yes
Elhu has joined #ruby
<ericwood> I remember people bitching about it, and hearing that it got better with newer versions
<llaskin> shevy cuz I've had to do some kludging to make 1.9.3 work with windows
<llaskin> or that is the ruby-debug-ide gem...
<shevy> I have had no problems with ruby on windows
vlad_starkov has quit [Remote host closed the connection]
<JonnieCache> its partly because the community has no interest in supporting windows users
jgarvey has joined #ruby
<JonnieCache> so there was always a lack of resources for them
coderhut_ has quit [Ping timeout: 245 seconds]
<JonnieCache> (when i say no interest there are obviously exceptions)
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
wroathe has quit [Ping timeout: 246 seconds]
tk_ has quit [Quit: ばいばい]
pencilcheck has joined #ruby
AndIrc___ has quit [Ping timeout: 255 seconds]
philcrissman has joined #ruby
joshcheek has joined #ruby
rdark has quit [Ping timeout: 260 seconds]
joshcheek has quit [Client Quit]
* Hanmac_ supports plattform indipent libs ... so my gems should work on the same systems as the libs doo
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
topriddy has quit [Quit: Leaving.]
phantasm66 has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
rdark has joined #ruby
Liothen has quit [Remote host closed the connection]
<banisterfiend> Hanmac_: do your gems exist or are they vaporware
<banisterfiend> :D :D :D
megha has quit [Quit: WeeChat 0.3.9.2]
breakingthings has quit []
<Hanmac_> they exist as reopsitories but they are not finish
<ericwood> My gems aren't Finnish, either
fermion has joined #ruby
miskander has quit [Quit: miskander]
* Hanmac_ thinks that my gems are faster finish than Berlins new Airport
freeayu__ has quit [Remote host closed the connection]
DatumDrop has joined #ruby
supergiantrobot has joined #ruby
larissa has quit [Quit: Leaving]
hotovson has joined #ruby
serhart has joined #ruby
x82_nicole has joined #ruby
asteve has joined #ruby
miskander has joined #ruby
dmiller has joined #ruby
pcarrier has joined #ruby
stopbit has joined #ruby
joshman_ has quit [Quit: Computer has gone to sleep.]
mrsrikanth has quit [Quit: Leaving]
<banisterfiend> Hanmac_: got a link to them?
digifiv5e has quit [Changing host]
digifiv5e has joined #ruby
carloslopes has joined #ruby
<ericwood> I'm *this* close to just telling my shell to stick "bundle exec" in front of every command :|
end_guy has joined #ruby
<apeiros_> ericwood: just alias a couple
<ericwood> I do
<ericwood> it's just the principal of the thing, ya know?
megha has joined #ruby
<apeiros_> I used a function which checks for presence of Gemfile and in case there is, uses bundle exec $@
<banisterfiend> ericwood: rvm does that by default
<ericwood> that's actually a great idea
alexspeller has joined #ruby
<rismoney> i am doing an myarray.each {|item| ..whole bunch of stuf..} and I want to create within the iterate a hash that looks like :item => somevar where item is now a symbol
<ericwood> banisterfiend: yeah but I don't trust it
dmiller has quit [Ping timeout: 240 seconds]
<banisterfiend> ericwood: it's annoying as fuck, i turned it off
_nitti has joined #ruby
<ericwood> rismoney: sounds like you want map instead of each
<banisterfiend> or each_with_object({})
<ericwood> ah, yes, that!
<banisterfiend> rismoney: where do you get the symbol from? how do u know what ot make the key ?
<ericwood> enumerable has too many neat functions to keep straight
<end_guy> I have a class that is already defined, but when that class gets used I would like it to be overriden and just return a different class altogether. Is this possible?
<rismoney> can i do a .to_sym? on item?
<alexspeller> rismoney depends what class item is
<banisterfiend> rismoney: you can try :) probably safter to go item.to_s.to_sym though
<rismoney> item is a string
<ericwood> you can do it, then
<alexspeller> oh to_sym will work no problem then
<ericwood> or .intern
DatumDrop has quit [Remote host closed the connection]
<ericwood> that one will fetch you a cup of coffee as well
<end_guy> i.e. I have class A; ...; end, and class B; ...; end. When class A is used, I want it to return/use class B. Is that possible?
mercwithamouth has joined #ruby
horofox_ has joined #ruby
<ericwood> define "is used"
<banisterfiend> end_guy: A = B
<end_guy> Ok. That did seem to work when I tried it, but it made some errors in a different part of the application I'm working on.
<banisterfiend> end_guy: class constants can be reassigned, you'll get a warning, but it will work
<end_guy> banisterfiend: Thanks :-)
AndIrc___ has joined #ruby
m_3_ has quit [Quit: leaving]
reactormonk has quit [Ping timeout: 260 seconds]
<Hanmac_> you could make a function get_right_class(*args) and return in them A or B depending on the parameters
kpshek has quit []
<apeiros_> OH: "plug & play", no, no, it's "plug & pain", wait, no, it's "plug & pay"…
AndIrc_46 has joined #ruby
AndIrc___ has quit [Read error: Connection reset by peer]
carloslopes has quit [Ping timeout: 248 seconds]
bean has joined #ruby
matschaffer has joined #ruby
Neomex has joined #ruby
m_3 has joined #ruby
reactormonk has joined #ruby
m_3 has quit [Client Quit]
<matschaffer> hi, so if I have an object. I can see it's method lookup path by saying obj.class.ancestors. But I can't do the same for class methods also check their superclass (e.g., Car.class.ancestors won't show Vehicle, but it can call Vehicle's class methods). Is there a more authoritative way to ask an object for it's method lookup chain?
kpshek has joined #ruby
AxonetBE has joined #ruby
<rismoney> whats the idiomatic way to add attrib=> value to a hash
m_3 has joined #ruby
m_3 has quit [Client Quit]
magistr has left #ruby ["Ухожу я от вас"]
mpfundstein has quit [Quit: Lost terminal]
m_3 has joined #ruby
clocKwize has quit [Quit: clocKwize]
m_3 has quit [Client Quit]
TomyLobo has joined #ruby
<apeiros_> hash[attrib] = value
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
m_3 has joined #ruby
<rismoney> ah i was trying strange forms of hash << attrib => value
SEToChan has joined #ruby
tri has joined #ruby
<apeiros_> matschaffer: Car.singleton_class.ancestors
<tri> anyone have any experience installing ror on windows
<tri> i got lib not found when installing gems
<tri> or rather rails
<tri> through gems
<matschaffer> nice. Thanks apeiros_ !
<Hanmac_> tri ruby version?
<alexspeller> tri: http://www.vagrantup.com/ ;)
NimeshNeema has quit []
<apeiros_> hm, odd… doesn't seem to work as I expected it…
<alexspeller> (Only part trolling, ruby on windows is a real pain in the ass... still...)
<tri> ruby 1.9.3p362
nathancahill has quit [Quit: nathancahill]
hukl has joined #ruby
cecino has joined #ruby
buscon has quit [Quit: Leaving]
buscon has joined #ruby
tvw has quit [Remote host closed the connection]
cecino has left #ruby [#ruby]
<Hanmac_> tri sorry that i need to tell you but its possible that 1.9.3p362 is trainted and for some unknown reason does not work well with rails and others ... you could try an a little bit older version or ask the guys at #rubyonrails
xAndy is now known as xandy
<apeiros_> ok, this is weird…
<apeiros_> class Foo; end; class Bar < Foo; end; Bar.singleton_class < Foo.singleton_class # => true
<apeiros_> Bar.singleton_class.ancestors.include?(Foo.singleton_class) # => false
<apeiros_> the true is expected, the false not…
carloslopes has joined #ruby
Todd has quit [Ping timeout: 248 seconds]
<alexspeller> Bar.singleton_class.ancestors # => [Class, Module, Object, Kernel, BasicObject]
<alexspeller> Bar.ancestors # => [Bar, Foo, Object, Kernel, BasicObject]
megha has quit [Quit: WeeChat 0.3.9.2]
_hemanth_ has quit [Read error: Connection reset by peer]
_hemanth_ has joined #ruby
digitalsanctum has quit [Remote host closed the connection]
megha has joined #ruby
<apeiros_> alexspeller: and?
ererere has joined #ruby
<apeiros_> Bar < Foo, therefore Foo is in Bar.ancestors
digitalsanctum has joined #ruby
<ererere> how would you test with rspec that a method assigns to an instance variable?
<apeiros_> but even though Bar.singleton_class < Foo.singleton_class, Foo.singleton_class is not in Bar.singleton_class' ancestors
tri has quit [Quit: Page closed]
chussenot has quit [Quit: chussenot]
blaxter has joined #ruby
aganov has quit [Remote host closed the connection]
chussenot has joined #ruby
Hanmac_ has quit [Quit: Page closed]
the_hack has joined #ruby
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
danieldocki has quit [Quit: Leaving...]
chussenot has quit [Read error: Connection reset by peer]
<matschaffer> apeiros_: bug? ;)
thone has joined #ruby
the_hack has quit [Client Quit]
<alexspeller> apeiros_ matschaffer: according to matz that's how it's supposed to work http://www.ruby-forum.com/topic/89006#172161
jonathanwallace has quit [Ping timeout: 256 seconds]
chussenot has joined #ruby
generalissimo has joined #ruby
whitedawg has joined #ruby
<apeiros_> matschaffer: no, seems intentional
<banisterfiend> apeiros_: ruby does stupid stuff with singleton classes, it skips them
<apeiros_> ah, seems you already found that
timte has joined #ruby
timte has left #ruby [#ruby]
sayan has quit [Ping timeout: 256 seconds]
<banisterfiend> apeiros_: this works though: B.singleton_class.superclass #=> A.singleton_class
joshman_ has joined #ruby
BryanWB__ has left #ruby [#ruby]
megha has quit [Quit: WeeChat 0.3.9.2]
startling has joined #ruby
<startling> I kinda know ruby but it's been a while. I know a handful of other languages well. How should I brush up?
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
<hoelzro> startling: I would find an interesting project and work on it
<startling> fair enough.
<hoelzro> if you're looking for a book to read, I highly recommend "The Ruby Programming Language"
nomenkun_ has quit [Remote host closed the connection]
flingbob has joined #ruby
<alexspeller> startling: ruby koans are good
nomenkun has joined #ruby
<startling> alexspeller: oh, cool, I'm familiar with that format.
lateau has quit [Remote host closed the connection]
G has quit [Ping timeout: 260 seconds]
flingbob has quit [Remote host closed the connection]
KevinSjoberg has joined #ruby
_nitti has quit [Remote host closed the connection]
<apeiros_> banisterfiend: stuff like that makes me want to work on my own language again…
<shevy> lol
<alexspeller> Also, learning clojure really improved my ruby
<banisterfiend> apeiros_: hehe, ruby just cant decide if it wants to hide or expose singleton classes
<Pip> alexspeller, 1 to 10, 1 means too bad, 10 means fabulous, what's your vote?
SCommette has joined #ruby
<alexspeller> vote on what, clojure?
<banisterfiend> alexspeller: interesting, in what way
<shevy> Pip what are you, a survey bot?
<Pip> alexspeller, rubykoans
nateberkopec has joined #ruby
<csmrfx> I want my own language, too. Or, drawn logic (not written isn't a language).
jekotia has joined #ruby
_nitti has joined #ruby
<rismoney> in rspec how do you do a hash should have a key and hash[key] should have a val?
<Pip> Anyone read the ruby monk?
<alexspeller> banisterfiend: it's good to have multiple ways to think about things, and clojure is a lisp which is a very functional way of doing things
<Pip> Please tell us how bad or good that material is
<alexspeller> so for example it helps you understand and use ruby's functional stuff in a more natural way, it did for me anyway
<shevy> Pip if you read it your mojo will grow by 35%
<alexspeller> You can use ruby in a very functional style and sometimes that is a very applicable to problems
startling has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<shevy> alexspeller how does functional style ruby look like?
swex_ has joined #ruby
<Pip> shevy, That's a lot
nomenkun has quit [Ping timeout: 248 seconds]
swex has quit [Ping timeout: 255 seconds]
thone_ has joined #ruby
<alexspeller> shevy: [1,2,3].map{|e| e * 2}.inject(0){|memo, value| memo + value}
<alexspeller> for example
<Pip> Is it a good habit or idea to use return statement in a method?
<banisterfiend> alexspeller: can u giev an example
<banisterfiend> alexspeller: dat nasty
<csmrfx> Pip: no need to.
<banisterfiend> alexspeller: .inject(:+) :P
<Pip> cschneid, no need to what?
<csmrfx> poor cschneid, always getting mixed in my arguments
<alexspeller> banisterfiend: yup, that's better actually
<csmrfx> Pip: methods return the value of last evaled expression
<alexspeller> banisterfiend: but essentially, what I mean by a more functional style is avoiding mutable state
thone has quit [Ping timeout: 252 seconds]
<Pip> csmrfx, What if I don't want that way?
<banisterfiend> alexspeller: how do you do that with classes/objects ?
dr_neek has quit [Quit: dr_neek]
<csmrfx> Pip: return object
<csmrfx> I mean, whatever you like
matschaffer has quit [Quit: Page closed]
<Pip> Everything is an object in Ruby, right?
arturaz has quit [Ping timeout: 276 seconds]
<csmrfx> but you can say 'my_thang' instead of 'return my_thang'
G has joined #ruby
<Pip> But return my_thang looks decent to me
<csmrfx> alexspeller: imo there is no reason to avoid mutable state in ruby
<banisterfiend> Pip: nearly everything
<csmrfx> Pip: sure, but return is 100% unnecessary there
<bean> banisterfiend: you an always Object.freeze your object, so it's not modifiable.
startling has joined #ruby
<banisterfiend> bean: yeah but i really dont think people are doing that, afaik
srji has quit [Ping timeout: 248 seconds]
<bean> not necessarily true, in a functional style you really want to avoid side effects.
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
Nisstyre has quit [Ping timeout: 260 seconds]
<Pip> is a method itself an object?
<banisterfiend> Pip: no, a method is not
jprovazn has quit [Quit: Leaving]
startling has left #ruby [#ruby]
<banisterfiend> Pip: methods are teh messages sent between objects (in a sense), but not objects themselves
<Pip> Messages should be objects
<banisterfiend> bean: cool
hell_razer has quit [Quit: Leaving]
<banisterfiend> Pip: so says "pip" on #ruby ;)
<alexspeller> ruby is awesome because you have a huge toolbox to choose from - there are sometimes when functional, non-mutable state is advantaguous and some cases where mutable is simpler
<csmrfx> >> def meth_odd; p "foo"; end; meth_odd.class
<eval-in> csmrfx: Output: "\"foo\"\n" (http://eval.in/6199)
<Pip> And the dot operator should also be an object
<csmrfx> wait what
<jpfuentes2> hah
<Pip> (.).class => OperatorClass
<jpfuentes2> trolling
eldariof has joined #ruby
ererere has quit [Quit: Page closed]
AlbireoX has quit [Remote host closed the connection]
alex__c2022 has joined #ruby
AlbireoX has joined #ruby
<Pip> I didn't know there is ; mark in Ruby
<Pip> semicolon
francisfish has joined #ruby
<Pip> What does code "define my_method; end" mean ?
<sie> Do you know python?
zommi has joined #ruby
mikecmpbll has joined #ruby
fjfish has quit [Ping timeout: 255 seconds]
<cschneid> csmrfx: ohh. This again. :)
sailias has quit [Quit: Leaving.]
buscon has quit [Read error: Connection timed out]
<waxjar> pip, just an empty method
<Pip> sie, yes, I know some python
buscon has joined #ruby
<Pip> colons are heavily used in python
<sie> Pip, same thing as in python
<sie> semicolons are the same as in python, not colons
<apeiros_> Pip: ; is the same as a newline in ruby (mostly)
AlbireoX has quit [Read error: Operation timed out]
obryan has joined #ruby
_46bit has joined #ruby
<apeiros_> you'll often see it in irc, to abbreviate code to a single line, without making it invalid
<bean> if only cuz its easier than pastbinning / gisting
mahmoudimus has joined #ruby
<Pip> jpfuentes2, Which version of Ruby do you use?
<jpfuentes2> 1.9.3
<Pip> jpfuentes2, I failed in repeating your experiment with pry
Zolrath has joined #ruby
sailias has joined #ruby
<Pip> [13] pry(main)> public_method(:my_method)
<Pip> NameError: method `my_method' for class `Object' is private
apeiros_ has quit [Remote host closed the connection]
<jpfuentes2> are you using 1.9.3 ?
<Pip> yes
<Pip> pry(main)> RUBY_VERSION
<Pip> => "1.9.3"
berserkr has quit [Ping timeout: 260 seconds]
<waxjar> did you first define it?
<Pip> yes
<Pip> def my_method; end
<Pip> => nil
<jpfuentes2> hmm interesting, rib is doing something special here
<jpfuentes2> irb*
the_hack has joined #ruby
<waxjar> ah, weird. methods defined on main in pry are private
<Pip> :O
<waxjar> if you type public first, then define it, then call public_method it works :)
<jpfuentes2> Pip this works: http://cl.ly/image/3m231n2J2J0T
d2dchat has joined #ruby
<Pip> What does 'p' mean?
<jpfuentes2> you can also just do "public :my_method"
<csmrfx> Pip: $ ri p
<Pip> I see
inokenty has joined #ruby
thone_ has quit [Ping timeout: 248 seconds]
topriddy has joined #ruby
<topriddy> first steps: http://pastebin.com/3DyCTLnf code review anybody? X_x
<topriddy> reminds me of basic days as things look really simple.
emergion has quit [Quit: Computer has gone to sleep.]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
dmiller has joined #ruby
<sie> topriddy, There's too less code to have any real flaws or criticism.
horofox_ has quit [Read error: Connection reset by peer]
<sie> IMO
horofox_ has joined #ruby
Spami has quit [Ping timeout: 255 seconds]
<bean> except like... use objects
<bean> :p
retro|cz has joined #ruby
jlast has joined #ruby
<sie> Well... yeah
breakingthings has joined #ruby
<sie> He actually is using objects. Kernel!
<topriddy> nope. mainorb :p
<sie> mainorb?
Dwarf has quit [Ping timeout: 246 seconds]
rdark has quit [Read error: Operation timed out]
nathancahill has joined #ruby
luckyruby has joined #ruby
dmiller has quit [Ping timeout: 248 seconds]
<topriddy> sie: sorry, ignore :)
<topriddy> writing same code in java though…hehe…different strokes]
yoshie902a has joined #ruby
coder_neo has quit [Ping timeout: 248 seconds]
hackerdude has joined #ruby
ds29 has joined #ruby
rdark has joined #ruby
pskosinski has joined #ruby
<ds29> hi guys. Anyone knows how to use win32/api to get the ActiveWindow
<ds29> I tried GetActiveWindow = API.new('GetActiveWindow','','L','user32')
<topriddy> sie: if i was on windows what would be the equivalent for #!/usr/env/bin
<yoshie902a> How do I insert a <span> rage into a string at a specific character location. For example. "The strong tag is in the 11th location" and I would like to insert <span> at the 11th character to get "The strong <span>tag is in the 11th location".
<ds29> and then call it but it didn't seem to work
<yoshie902a> s/rage/tag
baroquebobcat has joined #ruby
<sie> topriddy, mmm, well I don't think windows likes shebangs.
<sie> You'd simply have to associate .rb with ruby executable.
<sie> topriddy, Windows is a clusterfuck in my opinion.
<topriddy> sie: okay. thanks
xclite has joined #ruby
Karantin has joined #ruby
quest88 has joined #ruby
<topriddy> sie: you use linux then?
<sie> linux, mac, bsd
<sie> Everything but windows.
berserkr has joined #ruby
<topriddy> hehe…some work someday would throw windows on your face
<sie> Nope.
<yoshie902a> never mind. Found it. insert(11,"<span>"),, thanks!
maletor has joined #ruby
woolite64 has joined #ruby
<topriddy> sie: you just inspired a shebang tweet ^_^….backing to code
havenn has joined #ruby
<ds29> hi anyone knows about my question about the Win32API in ruby to GetActiveWindow ?
<j0sh\a> Hi guys, am running chef 10.16.2 on this box and am seeing lots of deprecation warnings on about chef 11 and node["key"] should be node.set["key"]. IS this correct?
zigomir has quit [Quit: zigomir]
<jpfuentes2> josh, you should probably check in chef or chef google group
<jpfuentes2> but that is correct
DatumDrop has joined #ruby
yoshie902a has left #ruby [#ruby]
<jpfuentes2> i think it primarily happens when using node["key"] in a recipe
thone has joined #ruby
vipaca has joined #ruby
vipaca is now known as Guest97309
timonv has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
<j0sh\a> ah shit - sorry thought was in chef channel
<j0sh\a> this window is fkin tiny! :)
miskander has quit [Quit: miskander]
thone has quit [Ping timeout: 260 seconds]
_46bit has quit [Quit: Leaving.]
mmokrysz has joined #ruby
rondale_sc has joined #ruby
<shevy> better the window and not ... something else
lateau has joined #ruby
rondale_sc has left #ruby [#ruby]
Bry8Star has quit [Ping timeout: 276 seconds]
d2dchat_ has joined #ruby
sayan has quit [Quit: Leaving]
mailo has joined #ruby
d2dchat has quit [Ping timeout: 260 seconds]
KevinSjoberg has quit [Quit: Textual IRC Client: www.textualapp.com]
the_hack has quit [Quit: Computer has gone to sleep.]
Bry8Star has joined #ruby
the_hack has joined #ruby
v0n has quit [Quit: WeeChat 0.3.9.2]
v0n has joined #ruby
adamh has quit [Quit: adamh]
supergiantrobot has quit [Quit: supergiantrobot]
kpshek has quit []
kpshek has joined #ruby
dougireton has joined #ruby
c0rn has joined #ruby
dmiller has joined #ruby
hydrozen has joined #ruby
stevechiagozie has joined #ruby
apeiros_ has joined #ruby
pcarrier has quit []
buibex has joined #ruby
<hydrozen> In Tomdoc, is it really necessary to write "Public:" in the description section? What is assumed when you do not put a prefix (public, internal, deprecated)?
Dwarf has joined #ruby
dr_neek has joined #ruby
speakingcode has quit [Remote host closed the connection]
blazes816 has joined #ruby
lateau has quit [Remote host closed the connection]
buibex has quit [Remote host closed the connection]
dr_bob has left #ruby [#ruby]
lateau has joined #ruby
srji has joined #ruby
miskander has joined #ruby
miskander has quit [Client Quit]
hoelzro is now known as hoelzro|away
JustinAiken has left #ruby [#ruby]
topriddy has quit [Ping timeout: 256 seconds]
<anannie> Is there a quick way to know how many bits a number is long?
whitedawg has quit [Quit: Leaving.]
<csmrfx> well object type is
<csmrfx> >> "100".to_s(2)
<eval-in> csmrfx: Output: "/tmp/execpad-a821471941f5/source-a821471941f5:1:in `to_s': wrong number of arguments(1 for 0) (ArgumentError)\n\tfrom /tmp/execpad-a821471941f5/source-a821471941f5:1:in `<main>'\n" (http://eval.in/6200)
<f0ster> it probably takes up a fixed amount of space because of ruby's typing, is my guess anannie. otherwise you would just convert binary
speakingcode has joined #ruby
<csmrfx> I mean:
<csmrfx> >> 33.to_s(2)
<eval-in> csmrfx: Output: "" (http://eval.in/6202)
<csmrfx> >> p 33.to_s(2)
<eval-in> csmrfx: Output: "\"100001\"\n" (http://eval.in/6203)
<anannie> f0ster: Yes, ruby returns the number of bytes... Doing number.to_s(2).split.length is just too many operations
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<csmrfx> >> puts 45633.to_s(2)
<eval-in> csmrfx: Output: "1011001001000001\n" (http://eval.in/6204)
<csmrfx> so with .to_s(2) you get the binary
<workmad3> >> p 33.to_s(2).length
<eval-in> workmad3: Output: "6\n" (http://eval.in/6205)
<csmrfx> >> puts 45633.to_s(2).length
<eval-in> csmrfx: Output: "16\n" (http://eval.in/6206)
danieldocki has joined #ruby
alex20032 has joined #ruby
<fuzai> is there a easy way to append arrays to each other?
<alex20032> Is ruby 1.9 faster than python?
<workmad3> anannie: do you want to know how many significant bits the number takes up, or how much memory is being used though?
<f0ster> alex20032: seems like a silly question
<workmad3> fuzai: ary1 + ary2
jlast_ has joined #ruby
<fuzai> ty
topriddy has joined #ruby
Xeago has quit [Remote host closed the connection]
<csmrfx> >> p [1] + ["foo"]
<eval-in> csmrfx: Output: "[1, \"foo\"]\n" (http://eval.in/6207)
nomenkun has joined #ruby
<anannie> workmad3: How many significant bits it takes up. I'm still working on that square root thing, and I'm trying to arrive at a cool guess for newton's algorithm using bit shifting, so I'm trying to figure out the number of shifts that should occur.
<anannie> workmad3: The idea is to make it faster than finding the square root precisely.
AxonetBE has quit [Quit: Leaving.]
<matti> +1 for bit wrangling.
a_a_g has joined #ruby
<f0ster> alex20032: either way if speed as the utmost imperative you wouldn't be using either
Nisstyre has joined #ruby
<JonnieCache> anannie: you're doing the carmack algorithm right?
<anannie> I know it sounds like a waste of time, but I wrote a routine that finds the first 10,001 primes in 0.332s
<anannie> JonnieCache: No that's for finding the inverse of a square root.
<anannie> I'm trying to get the entire sieve down to under .1s
jlast has quit [Ping timeout: 264 seconds]
<anannie> Preferably under .09s.
<JonnieCache> newton's algorithm is part of the carmack thing though isnt it?
<f0ster> anannie: project euler ?
<anannie> f0ster: Yup. I solved it, and I'm trying to make my solution better/faster
<f0ster> anannie: nice
rdark has quit [Ping timeout: 260 seconds]
nomenkun has quit [Ping timeout: 248 seconds]
<f0ster> anannie: you could compile something in C heh
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<anannie> f0ster: Actually I'm just starting out with coding, so I don't know X
<anannie> * C
<f0ster> Ah
<anannie> Would you like to take a look at the code I wrote?
irek has joined #ruby
breakingthings has quit []
rdark has joined #ruby
<JonnieCache> youre the second "newbie" to code here in as many weeks whos learning though project euler
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
<JonnieCache> its highly commendable
<anannie> My first idea was to divide by two until I got down to an approximate root, which I could then use. That failed for higher numbers, even though an interesting pattern did emerge.
<alex20032> Well, project euler could be a great place to learn ruby
kjellski has quit [Quit: Leaving]
dcope is now known as teafukintits
<anannie> I'm trying to teach myself math as well
nemesit has quit [Quit: Leaving...]
TerabyteST has joined #ruby
teafukintits is now known as teafuk
teafuk is now known as dcope
<JonnieCache> respect
malkomalko has quit [Remote host closed the connection]
<anannie> https://gist.github.com/4485524 <--- here's the code I wrote
<speakingcode> how can i print the fields of an object?
chussenot has quit [Remote host closed the connection]
Spaceghostc2c has quit [Excess Flood]
scriabin has joined #ruby
Neomex has quit [Ping timeout: 255 seconds]
<JonnieCache> anannie: the while loop isnt very rubyish
chussenot has joined #ruby
<anannie> JonnieCache: Actually there wasn't any other way to implement it, it needed to be incremented whenever it found a prime so...
huoxito has quit [Ping timeout: 256 seconds]
<JonnieCache> yeah was just thinking that, theres no simple functional way to express it
<JonnieCache> well, im sure there is but i cant see it just now
quest88 has quit [Quit: quest88]
<anannie> (If it is the loop I think you're talking about)
<JonnieCache> the one on line 11
<anannie> I would love it if you can teach me how to think of a better way
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<anannie> Ah I thought you were talking about the one on line 23
<anannie> How can I make it more rubyish?
[Tyrant] has joined #ruby
Neomex has joined #ruby
mafolz has quit [Quit: mafolz]
<JonnieCache> well essentially i would make some expression that defined every value to iterate over ahead of time, and call .map or something on it
pavilionXP has quit [Ping timeout: 276 seconds]
<JonnieCache> but the algorithm may preculde that
<workmad3> anannie: are you sure that getting an approximate square root will make your algorithm faster?
Guest49926 has joined #ruby
buscon has quit [Quit: Leaving]
lolcathost has joined #ruby
<workmad3> anannie: when you consider that you're calculating the square root once, but for each integer your approximation is out by, you'll be adding division
<anannie> workmad3: Well that's why I'm searching for an algorithm that helps me find it down to the first order of magnitude. I don't need decimal level precision.
xandy is now known as xAndy
<workmad3> anannie: also, you can use ary.empty? instead of ary.length == 0
<anannie> workmad3: So far I haven't found anything that's better than just using the inbuilt function.
kurioscreative has joined #ruby
topriddy has quit [Quit: topriddy]
elux has joined #ruby
alaska has joined #ruby
<anannie> workmad3: The thing is that I'm calculating the square root each time I'm doing factorisation, which is two times every 6th number
<workmad3> anannie: yes, and you'd be doing your approximation the same amount
amaya_the has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
<anannie> workmad3: Hrm, but if I'm just estimating it to the first order of magnitude then wouldn't it save several operations over the complete run-time?
<workmad3> anannie: probably not
carloslopes has quit [Remote host closed the connection]
szck has quit [Quit: Leaving.]
<anannie> Oh?
<anannie> May I ask why workmad3?
akemrir has quit [Ping timeout: 248 seconds]
dougireton has quit [Quit: Leaving.]
Virunga is now known as LennyLinux
dougireton has joined #ruby
megha has joined #ruby
<workmad3> anannie: because your loop repeats an extra (knowably useless at this point) time for the difference between your approximation and the actual square root
cha1tanya has quit [Ping timeout: 260 seconds]
<workmad3> anannie: so what you need to find out is how many loops are equivalent to a single square root
grzywacz has quit [Ping timeout: 248 seconds]
<workmad3> anannie: my suspicion is that it's probably only a couple of times around the loop
<anannie> ah but the loop isn't designed like that, the loop is designed to iterate through a list of prime numbers, so each step isn't actually linear, so if it's accurate to the first order then it should be good enough.
Dwarf has quit [Ping timeout: 246 seconds]
h4mz1d has joined #ruby
<JonnieCache> anannie: lol you claim to be "learning" code and math but youre better at it than 99% of people
_46bit has quit [Quit: Leaving.]
<workmad3> anannie: possibly
<workmad3> anannie: I'd want to see a profile of the method to see what's taking up the time there though ;)
<workmad3> anannie: if the majority of the time isn't the sqrt, then optimising that isn't going to help
<anannie> workmad3: I know that if I change one of the more fundamental operations then it would get faster, but I don't know how or which things to change.
<anannie> workmad3: Okay, how do I do that?
<anannie> several time.nows?
emocakes has quit [Quit: emocakes]
<workmad3> anannie: simplest way - get Time.now at the start of the method, then after the sqrt print out Time.now - start_time, then after the loop print out Time.now - start_time
jonathanwallace has joined #ruby
headius has joined #ruby
<anannie> JonnieCache: I actually am a complete noob. I was exposed to coding a bit earlier on, but I started seriously doing it just a few weeks ago. Same with math. I essentially dropped out of high school at some point. I scraped by, but I was terrible at it!
<workmad3> anannie: oh, you'd want to do Time.now - sqrt_time - start_time at the end
szck1 has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
<anannie> workmad3: Okay, I'll do that.
mensvaga has left #ruby [#ruby]
<workmad3> anannie: and you're interested in the numbers that are prime btw, those are the numbers that will take the most work to compute
a_a_g has joined #ruby
<workmad3> anannie: so are the ones where the loop will run the maximum number of times
<anannie> Yes workmad3
<JonnieCache> lol i guess it just shows what you can achieve when your mind isnt poisoned by industrialised education
<workmad3> anannie: :)
pskosinski has quit [Quit: Learn Life's Little Lessons]
<workmad3> anannie: and welcome to optimisation 101 - always profile, so you can optimise the bottleneck ;)
<anannie> Okay, I'll do this and get back to you workmad3. Thank you so much for teaching me!
megha has quit [Quit: WeeChat 0.3.9.2]
<fuzai> is there an easy way to test a variable against an array?
<anannie> fuzai: You should read the Array class functions
<anannie> fuzai: It'll take a while, but it will teach you far more than asking anyone else...
<workmad3> >> p [1,2,3].include?(1)
<eval-in> workmad3: Output: "true\n" (http://eval.in/6209)
filipe has quit [Remote host closed the connection]
hydrozen has quit [Quit: Computer has gone to sleep.]
<scriabin> I'm having temporary amnesia. Can anyone suggest a cleaner way to do this? https://gist.github.com/4485800
<scriabin> I feel like I'm opening and closing the file too many times
Guest97309 has quit [Quit: Leaving...]
<banisterfiend> scriabin: use File.read
maletor has joined #ruby
<banisterfiend> scriabin: https://gist.github.com/4485812
<workmad3> scriabin: if you want to keep the same file handle, you'd need to play around with the cursor
<workmad3> scriabin: which probably isn't 'cleaner' :)
<heftig> scriabin: note that reading the entire file into memory isn't scalable
ner0x has quit [Quit: Leaving]
rakl is now known as guest181
a_a_g has quit [Read error: Connection reset by peer]
fourq has joined #ruby
bluOxigen has joined #ruby
a_a_g has joined #ruby
<apeiros_> heftig: it is. you just have to scale your ram too ^^
mneorr has joined #ruby
ninegrid has quit [Ping timeout: 265 seconds]
Guest49926 has quit [Excess Flood]
llaskin has left #ruby [#ruby]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
iNerd has joined #ruby
<iNerd> Afternoon
mahmoudimus has joined #ruby
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
adeponte has joined #ruby
xAndy is now known as xandy
nathancahill has quit [Quit: nathancahill]
<heftig> i'd do something like this
<anannie> workmad3: I got a pretty interesting result. For the last 42 times the factorisation method is called, except for a single case where I guess a prime was found, the sqrt operation takes almost as much time or even greater time as the loop. For the first 10 primes, this is at parity. https://gist.github.com/4485857
iNerd is now known as Moofy
Spaceghostc2c_ has joined #ruby
<heftig> whoops, forgot the "w"
<workmad3> anannie: so that was up to 52 primes?
pskosinski has joined #ruby
wallerdev has joined #ruby
<workmad3> anannie: how about up to 100 primes?
<anannie> workmad3: No it was up to 10,001 primes
<workmad3> ah, ok
<anannie> workmad3: I knew that you would raise that point ;)
roadt has quit [Ping timeout: 256 seconds]
<workmad3> anannie: so, how big a difference was it when it was a prime found?
ds29 has quit [Ping timeout: 255 seconds]
<anannie> around an order of magnitude, here's a bump where a prime was found;
haxrbyte_ has quit [Read error: Connection reset by peer]
aasmith has joined #ruby
alex20032 has left #ruby [#ruby]
friskd has joined #ruby
<anannie> I think that a prime has been found on this line; After sqrt; 3.007e-06 ; After loop; 5.188e-06. I'll run it again so that it prints out a notification when a prime is found
<csmrfx> hm, is ruby really the best tool for this
<workmad3> sounds like a plan :)
akl_ has quit [Ping timeout: 260 seconds]
<workmad3> anannie: hmm, looking at the data, you actually have quite a few places where the sqrt was an order of magnitude faster than the loop
williamcotton has joined #ruby
<workmad3> anannie: e.g. 'After sqrt; 3.036e-06; After loop; 2.7997e-05'
itnomad has quit [Ping timeout: 265 seconds]
<anannie> Yes, workmad3. It's true for the last prime as well.
<workmad3> (line 49 and 50 of your gist)
aasmith has left #ruby [#ruby]
<anannie> But those are only a few places though, most of the times when it's being called you get around the same order of magnitude
adamh has joined #ruby
<workmad3> right, so roughly speaking, your sqrt is taking between 50% and 10% of the time of your method
<anannie> Yes, workmad3
lolcathost has quit [Ping timeout: 265 seconds]
raz has quit [Ping timeout: 265 seconds]
<workmad3> with, in the important cases (a prime being found), it taking more 10% than 50%, and you've already filtered the tests so that you're more likely to hit primes
<workmad3> now you have a baseline to check against ;)
<workmad3> although I would suspect that you'll get more speedup out of improving your loop than improving the sqrt
<anannie> I wonder if I could use fermat's theorem to speed things up even more
Spami has quit [Quit: This computer has gone to sleep]
gyre007 has quit [Ping timeout: 276 seconds]
<anannie> workmad3: Yes, you're right. I should actually implement both, an approximation algo for finding the square root and some sort of hybrid primality test that calls up a fermat's witness and tests things
Dann1 has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
<workmad3> anannie: only do one at a time though
miskander has joined #ruby
<anannie> workmad3: Okay, I'm confused regarding the algorithm for the square root, whatever implementation I have come with, has always been slower than the ruby implementation done in C
<workmad3> anannie: it seems to be the case that more time is spent in the primality test, so that would be the better place to start, IMO... try an improvement there
karasawa has quit [Quit: leaving]
mmokrysz has joined #ruby
<workmad3> anannie: not that surprising
karasawa has joined #ruby
<workmad3> anannie: you have to go through more layers in ruby compared to what the C code has to do :)
coder_neo has joined #ruby
<anannie> workmad3: Isn't there some way to cut through those layers inline?
<workmad3> anannie: no, you'd need to drop into C yoursely
<workmad3> *yourself
mrsolo has joined #ruby
raz has joined #ruby
tjbiddle has joined #ruby
ner0x has joined #ruby
tjbiddle has quit [Remote host closed the connection]
roadt has joined #ruby
timonv has joined #ruby
<workmad3> (well, there are some gems and tools that let you do things like inline C or inline assembler, iirc)
<blazes816> you could write a c extension to do the heavy stuff
<anannie> Is that possible? I've read about Python's any feature... The problem also is that I don't know C, but I should be able to do math stuff in it
<ner0x> node or libv8 for execjs?
tjbiddle has joined #ruby
<blazes816> anannie: yeah it's possible. c shouldn't be too bad for you, but there'll be some snags i'm sure
Paradox has quit [Ping timeout: 245 seconds]
lolcathost has joined #ruby
<workmad3> anannie: ruby isn't exactly the most performant language out there
<workmad3> anannie: but it is pretty easy to get to grips with :)
TerabyteST has quit [Quit: terabytest]
<anannie> blazes816: But would it also be faster? If it takes time to call up the inline C thing then wouldn't it be slower on the net?
<workmad3> anannie: so you've gotta ask yourself - do you want to spend time doing micro-optimisation on this, or do you want to try out your speedups in the math areas and keep on learning ruby?
emocakes has joined #ruby
<anannie> workmad3: Well I'm not going to go around trying to find mersenne primes with this
<blazes816> anannie: you'd have to compare your ruby version to the c version, and then profile the overhead of calling the c, and do a cost-benefit analysis
slainer68 has quit [Remote host closed the connection]
<havenn> anannie: You can rapidly implement in Ruby, then only switch the extremely performance finicky parts to C ext for best of both worlds.
noric has joined #ruby
<blazes816> idk what you're doing, but the ruby version is probably find ;)
<workmad3> anannie: after all, we're talking about 0.2s over 10001 primes here ;)
jduan1981 has joined #ruby
Paradox has joined #ruby
<workmad3> >> require 'prime'; start = Time.now; Prime.take(10001); p Time.now - start;
<eval-in> workmad3: Output: "0.157932317\n" (http://eval.in/6210)
<workmad3> anannie: and you're pretty close to the Prime class in the ruby stdlib for this :)
<workmad3> (that's 0.16s for 10001 primes)
<anannie> workmad3: True, true. I just got carried away with an assignment I gave myself. The thing is that I actually plan to implement real-time feedback loops in robots someday and well in the real world a lot of stuff can happen in .2s
<havenn> require 'prime'; start = Time.now; Prime::EratosthenesGenerator.new.take(10001); p Time.now - start;
<anannie> workmad3: Okay, I'll work on the next problem :D
<workmad3> anannie: sure, but you always need to pick your battles ;)
<havenn> anannie: Prime::EratosthenesGenerator is fast! :D
megha has joined #ruby
<workmad3> >> require 'prime'; start = Time.now; Prime::EratosthenesGenerator.new.take(10001); p Time.now - start;
<eval-in> workmad3: Output: "0.150186313\n" (http://eval.in/6211)
<workmad3> havenn: I think the eratosthenes generator is the default for Prime.take ;)
<anannie> That's just salt in the wound :-p But I am definitely proud that I could get it within an order of magnitude of the pros
<blazes816> anannie: as much as I love ruby, i love robots too much to mix the two
itnomad has joined #ruby
<havenn> workmad3: Ha, oh you're prolly right! I benched it and thought otherwise but was prolly just a matter of first-run!
<anannie> Okay, I'll start solving the next problem, thank you for your advice workmad3!
<workmad3> havenn: yeah, the erathosenes generator caches stuff
Spami has quit [Quit: This computer has gone to sleep]
<anannie> blazes816: Well I plan to learn C at the very end for the robot stuff :D
<blazes816> anannie: nice! don't forget to do a tour in ASM land at some point
szck1 has quit [Quit: Leaving.]
anachronistic has joined #ruby
<workmad3> >> require 'prime'; start = Time.now; Prime.take(10001); p "first run: #{Time.now - start}"; start = Time.now; Prime.take(10001); p "second run: #{Time.now - start}"
<eval-in> workmad3: Output: "\"first run: 0.149849203\"\n\"second run: 0.034493341\"\n" (http://eval.in/6212)
srji has quit [Ping timeout: 248 seconds]
<anannie> blazes816: I'm not sure if I'm smart enough to implement something significant using ASM land... I can't imagine how people write practical stuff in it!
<workmad3> havenn: see, 0.034s for run 2 :)
<havenn> workmad3: Yup, that is the difference I wrongly prescribed to Gen being diff. >.>
<blazes816> anannie: it takes a while, but even if you can't do anything 'practical' in it, just knowing the basics of it makes you a better programmer
<workmad3> anannie: again, it's mostly micro-optimisations, afaik
icole has joined #ruby
<workmad3> but yeah, knowing an ASM gives you an insight into code that's useful
<havenn> The high performance fork of mruby ftw? Fortran speed!
icole has quit [Remote host closed the connection]
stkowski has joined #ruby
mockra has joined #ruby
adamh has quit [Quit: adamh]
yacks has quit [Quit: Leaving]
tommyvyo has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
<anannie> blazes816: Okay, then I shall make it a point to learn that properly as well.
kenneth has quit [Quit: kenneth]
Spaceghostc2c_ is now known as Spaceghostc2c
timonv has quit [Remote host closed the connection]
xandy is now known as xAndy
<blazes816> you'll love yourself for it after the hate wears off
the_hack has quit [Quit: Computer has gone to sleep.]
moted has quit [Read error: Connection reset by peer]
<anannie> blazes816: Well isn't that true for anything hard?
moted has joined #ruby
danieldocki has quit [Quit: Linkinus - http://linkinus.com]
<blazes816> probably so
ajones has joined #ruby
includex has quit [Quit: Leaving...]
io_syl has joined #ruby
goraxe has quit [Read error: Connection reset by peer]
<anannie> Even learning Ruby is non-trivial for a complete n00b, but I'm quite glad I did. At the start it was very, very hard to think of something in Ruby terms, but now after solving things and making them, I can actually do it and it's pretty fun.
noxoc has quit [Quit: noxoc]
timonv has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
_46bit has left #ruby [#ruby]
alvaro_o has joined #ruby
goraxe has joined #ruby
the_hack has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
mrsolo has joined #ruby
zeade has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
Neomex has quit [Ping timeout: 255 seconds]
<ericwood> it's fun and good for you
rondale_sc has joined #ruby
jlast has joined #ruby
jlast_ has quit [Ping timeout: 255 seconds]
stan has quit [Ping timeout: 256 seconds]
toobulkeh has joined #ruby
shevy2 has joined #ruby
haxrbyte has joined #ruby
ashp has left #ruby [#ruby]
krawchyk has quit [Remote host closed the connection]
nkts has quit [Ping timeout: 248 seconds]
alanjc has joined #ruby
shevy has quit [Read error: Operation timed out]
roadt has quit [Ping timeout: 248 seconds]
<toobulkeh> I keep getting a TypeError on coerce when trying to sum up a Float to a Fixnum.. is this normal? - https://gist.github.com/4486297
<ericwood> on the right-hand side append ".to_f"
a_a_g has quit [Read error: Connection reset by peer]
jdripper has quit [Quit: Leaving.]
a_a_g has joined #ruby
<toobulkeh> of the initialization to 0?
<waxjar> that shouldn't give any errors, the + method on Float and Fixnum should take care of that
<ericwood> totalRAM += host.hardware.memorySize.bytes.to.gigabytes.to_f
mmitchell has joined #ruby
<waxjar> 1 + 0.1 # => 1.1
<toobulkeh> waxjar: I would think so but it doesn't
krawchyk has joined #ruby
<havenn> toobulkeh: If you start with total_ram = 0.0?
<ericwood> or do what I said since it's less elegant
<waxjar> x = 1; x += 0.1 # => 1.1
karasawa has quit [Ping timeout: 248 seconds]
<canton7> toobulkeh, what's the class of host.hardware.blah...to.gigabytes?
<toobulkeh> canton7: Float
<canton7> I'm willing to bet it isn't anything standard
<canton7> are you absolutely completel sure? prove it
<canton7> *completely
<toobulkeh> It's from the alchemist Gem
friskd has quit [Quit: friskd]
<toobulkeh> hmmm you're right :) thanks!
<toobulkeh> Alchemist::NumericConversion 0_o
<ericwood> hehehe
chussenot has quit [Quit: chussenot]
<toobulkeh> you guis so smart, makes me blush
rdark has quit [Quit: leaving]
joeycarmello has joined #ruby
cdt has quit [Quit: Ex-Chat]
icole has joined #ruby
<canton7> it's not like Float to implement #coerce badly... Raise an issue with Alchemist
h4mz1d has quit [Ping timeout: 248 seconds]
<toobulkeh> Yeah I was like.. no way
<toobulkeh> will do
the_hack has quit [Quit: Computer has gone to sleep.]
<ericwood> no, go fix it yourself :D
<canton7> issues can have code attached :P
<toobulkeh> might be designed that way
digital-ghost has joined #ruby
<toobulkeh> thank you thank you
haxrbyte has quit [Remote host closed the connection]
browndawg has quit [Quit: Leaving.]
megha has quit [Quit: WeeChat 0.3.9.2]
<canton7> looks like it returns the wrong thing entirely from #coerce :P
<digital-ghost> I'm just learning ruby and the for loop/enumerators. Can anyone explain why a for loop with a range like 1..10 will print the literal sequence, but if I use 10.times do |i| it'll be zero based?
<canton7> try not to use for loops
<canton7> (1..10).each do |i| ...
<apeiros_> digital-ghost: because 10.times is not 1..10
<digital-ghost> Right, I've been told that as well, but I'm trying to understand the alternatives and why they're to be used over for loops
clooth has quit [Quit: clooth]
<havenn> digital-ghost: We start counting from 0, so 3.times is similar to 0..2 not 1..3.
fred909 has joined #ruby
JonnieCache has quit [Read error: Connection reset by peer]
mneorr has quit [Remote host closed the connection]
<canton7> digital-ghost, #each has better scoping
<digital-ghost> I guess it's odd to me, that the other methods don't seem to start at zero.
<digital-ghost> Such as, 1.upto(10)
toobulkeh has left #ruby [#ruby]
<havenn> digital-ghost: 0.upto(9)
nomenkun has joined #ruby
nathancahill has joined #ruby
<havenn> digital-ghost: These are all Enumerators: [(0..9).each, 0.upto(9), 10.times]
<digital-ghost> Alrighty, guess I just need to wrap my head around this. When I look at the code, I just don't think of counting from 0 when I see .times
<canton7> digital-ghost, example: http://pastie.org/5649594
<havenn> digital-ghost: 0.upto(2).class #=> #<Enumerator: ...>
icole has quit [Remote host closed the connection]
<canton7> digital-ghost, most things in computer-world are 0-based
<canton7> first element of an array? 0
srji has joined #ruby
<havenn> digital-ghost: 'helloooo'[1] #=> "e"
<atmosx> digital-ghost: read "Snow crash" explains a lot more than avg knows about binary code
<digital-ghost> Thanks for the links. I was just on the Enumerator.html, it was pretty dense for me.
<atmosx> and it's fun to read if you're half a geek
chriskk has joined #ruby
ebobby has joined #ruby
<digital-ghost> Well again, thanks for the help. Gonna jump back into it.
Spami has joined #ruby
icole has joined #ruby
<ericwood> I highly recommend just skimming through all of Enumerator's documentation
<ericwood> there's a ton of methods, but if you know the gist of a lot of them it'll save you a TON of time down the road
<digital-ghost> ericwood - That's the next section for me, I'm actually reading the ruby bastards book.
<ericwood> next, read the ruby interpreter's source code for full points
<ericwood> :P
<digital-ghost> For loop section comes before enums however. So, this threw me off.
[Tyrant] has quit [Quit: [Tyrant]]
<ericwood> never use a for loop
<canton7> I have no idea why they're even in the language
<ericwood> a cruel joke by Matz
<apeiros_> canton7: because they fit well together with flip-flops
voodoofish430 has joined #ruby
alanjc has quit [Quit: ThrashIRC v2.8 sic populo comunicated]
pkrnj has joined #ruby
gyre007 has joined #ruby
miskander has quit [Quit: miskander]
wroathe has joined #ruby
Bottesque has joined #ruby
chrisja has joined #ruby
dankest has joined #ruby
kenneth has joined #ruby
nga4 has joined #ruby
Bottesque has quit [Read error: Connection reset by peer]
gyre007 has quit [Remote host closed the connection]
gyre007 has joined #ruby
jeffreybaird has quit [Read error: Connection reset by peer]
karasawa has joined #ruby
buibex has joined #ruby
the_hack has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
dougireton has quit [Quit: Leaving.]
icole has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
Hanmac_ has joined #ruby
mercwithamouth has quit [Ping timeout: 252 seconds]
elux has quit [Quit: Bye!]
mantas322 has joined #ruby
<mantas322> Hello
<mantas322> I have a general question
rismoney has quit [Ping timeout: 244 seconds]
dougireton has joined #ruby
IrishGringo_ has joined #ruby
<ericwood> we only accept non-general questions
cantonic_ has joined #ruby
<ericwood> but go ahead and tell us what it is anyways
<mantas322> Im using .net to post a json to a ruby on rails site, and it seems to be appending 'person{}' to the end of the json and erroring
<Hanmac_> then we have general answers :P
<mantas322> the directory is /people/
mercwithamouth has joined #ruby
<Hanmac_> mantas322 #rubyonrails is the channel for you
<ericwood> mantas322: you may want to check out #rubyonrails
<mantas322> im totally noob with ruby
<mantas322> oh
<mantas322> FINE >:O
<mantas322> elitists
<ericwood> #rubyoffdarailz
<ericwood> lol
<mantas322> jkjk
<Hanmac_> #rubyonmonorails
fourq has quit [Quit: Lost terminal]
cantonic_ is now known as cantonic
retro|cz has quit [Ping timeout: 248 seconds]
icole_ has joined #ruby
<Hanmac_> or #rubyonaplane (soon in your cinemas) :P
buibex has quit [Remote host closed the connection]
miskander has joined #ruby
gyre007 has quit [Ping timeout: 248 seconds]
jeffreybaird has joined #ruby
npincomplete has joined #ruby
<npincomplete> Hi all
Choclo has joined #ruby
Nahra has joined #ruby
Nahra has quit [Changing host]
Nahra has joined #ruby
brianpWins has quit [Quit: brianpWins]
mantas322 has quit [Ping timeout: 245 seconds]
jduan1981 has quit [Ping timeout: 265 seconds]
daniel_- has joined #ruby
_nitti has quit [Remote host closed the connection]
yacks has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
srji_ has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
wreckimnaked has quit [Read error: Operation timed out]
bluenemo has quit [Remote host closed the connection]
a_a_g has joined #ruby
jonathanwallace has joined #ruby
Choclo1 has joined #ruby
szck has joined #ruby
Goles has joined #ruby
cirwin has joined #ruby
srji has quit [Ping timeout: 248 seconds]
Choclo1 has quit [Read error: Connection reset by peer]
npincomplete has quit [Quit: Bye]
ShimSham has joined #ruby
Choclo has quit [Ping timeout: 248 seconds]
Choclo has joined #ruby
Choclo has quit [Read error: Connection reset by peer]
nwertman has quit [Read error: Connection reset by peer]
ShimSham has left #ruby [#ruby]
Choclo has joined #ruby
Choclo has quit [Read error: Connection reset by peer]
Guedes is now known as Guedes_out
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
jano has joined #ruby
jano has left #ruby [#ruby]
mrsolo has quit [Quit: This computer has gone to sleep]
elaptics is now known as elaptics`away
timmow has quit [Quit: is having a nap]
mrsolo has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
Choclo has joined #ruby
rippa has joined #ruby
Guest30345 has quit [Ping timeout: 252 seconds]
a_a_g has quit [Read error: Connection reset by peer]
thatguycraig has quit [Quit: Leaving.]
mikekelly has joined #ruby
a_a_g has joined #ruby
slainer68 has joined #ruby
buibex has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
DrShoggoth has joined #ruby
miskander has quit [Quit: miskander]
jlast has quit [Remote host closed the connection]
aedorn has joined #ruby
the_hack has quit [Quit: Computer has gone to sleep.]
alvaro_o_ has joined #ruby
graft_ has joined #ruby
graft_ has quit [Changing host]
graft_ has joined #ruby
the_hack has joined #ruby
slainer68 has quit [Ping timeout: 265 seconds]
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
alvaro_o has quit [Read error: Connection reset by peer]
fourq has joined #ruby
nwertman has joined #ruby
dougireton has quit [Ping timeout: 240 seconds]
a_a_g has quit [Read error: Connection reset by peer]
pavilionXP has joined #ruby
dougireton has joined #ruby
a_a_g has joined #ruby
mailo has quit [Quit: Linkinus - http://linkinus.com]
Leon64 has joined #ruby
Leon64 has left #ruby [#ruby]
hadees has joined #ruby
wroathe has quit [Ping timeout: 264 seconds]
dougireton has quit [Ping timeout: 255 seconds]
Russell^^ has joined #ruby
fbernier has quit [Read error: Connection reset by peer]
Choclo has quit [Ping timeout: 260 seconds]
jjbohn has quit [Quit: Leaving...]
a_a_g has quit [Read error: Connection reset by peer]
Russell^^ has quit [Read error: No route to host]
a_a_g has joined #ruby
chrisja has quit [Quit: leaving]
haxrbyte has joined #ruby
PoGo has joined #ruby
ossareh has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
dougireton has joined #ruby
horofox_ has quit [Read error: Connection reset by peer]
buibex has quit [Remote host closed the connection]
the_hack has quit [Quit: Computer has gone to sleep.]
LouisGB has quit [Ping timeout: 246 seconds]
horofox_ has joined #ruby
kirun has joined #ruby
<Quadlex> Good Morning erryone for whom it is morning
huoxito has joined #ruby
karasawa has quit [Ping timeout: 240 seconds]
<lolcathost> Quadlex: And nothing for those of us who live in places where it is not morning? Awww... :(
PoGo has left #ruby [#ruby]
<Quadlex> lolcathost: You've had all day to make of the day what you can... Those for whom it's morning need all the help they can get dealing
jlast has joined #ruby
<banisterfiend> waxjar: ping
brianpWins has joined #ruby
<waxjar> banisterfiend: pong
adkron has joined #ruby
<banisterfiend> waxjar: regarding your top level issues
wroathe has joined #ruby
swingha has joined #ruby
<waxjar> i didn't have any issues, but thanks that's p interesting :)
haxrbyte_ has joined #ruby
nemesit has joined #ruby
Neomex has joined #ruby
breakingthings has joined #ruby
marr has quit [Ping timeout: 255 seconds]
timonv_ has joined #ruby
haxrbyte has quit [Ping timeout: 255 seconds]
timonv has quit [Read error: Connection reset by peer]
philcrissman has quit [Remote host closed the connection]
timonv_ has quit [Remote host closed the connection]
rismoney has joined #ruby
Nisstyre has quit [Ping timeout: 248 seconds]
the_hack has joined #ruby
elico has joined #ruby
wermel has quit [Remote host closed the connection]
sepp2k1 has joined #ruby
timonv has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
jerius_ has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
zommi has quit [Quit: Leaving.]
swingha has quit [Quit: leaving]
philcrissman has joined #ruby
ChampS666 has joined #ruby
Astral has joined #ruby
jerius has quit [Ping timeout: 260 seconds]
jerius_ is now known as jerius
<Hanmac_> you could also do TOPLEVEL_BINDING.eval("self")
Astral is now known as Guest59463
haxrbyt__ has joined #ruby
haxrbyte_ has quit [Ping timeout: 255 seconds]
miskander has joined #ruby
haxrbyte has quit [Ping timeout: 240 seconds]
Maniacal has joined #ruby
baphled has joined #ruby
Xeago has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
ebouchut has joined #ruby
a_a_g has joined #ruby
Russell^^ has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
ffranz has quit [Read error: Operation timed out]
a_a_g has joined #ruby
_huoxito has joined #ruby
Mon_Ouie has quit [Quit: WeeChat 0.3.9.2]
the_hack has quit [Quit: Computer has gone to sleep.]
otters has quit [Ping timeout: 252 seconds]
kpshek has quit []
squidBits has joined #ruby
gyre007 has joined #ruby
havenn has quit [Remote host closed the connection]
huoxito has quit [Quit: Leaving]
havenn has joined #ruby
Russell^^ has quit [Read error: Connection reset by peer]
Russell^^_ has joined #ruby
stim371 has joined #ruby
theRoUS has quit [Ping timeout: 246 seconds]
rezzack has joined #ruby
Russell^^_ has quit [Read error: No route to host]
havenn has quit [Ping timeout: 252 seconds]
Hanmac_ has quit [Ping timeout: 245 seconds]
timonv has quit [Remote host closed the connection]
_huoxito is now known as huoxito
oz is now known as oz`
jlast_ has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9.2]
oz` is now known as oz
codezombie has joined #ruby
Russell^^ has joined #ruby
akl_ has joined #ruby
Russell^^ has quit [Client Quit]
williamcotton has quit [Quit: williamcotton]
Russell^^ has joined #ruby
chrismcg is now known as zz_chrismcg
Russell^^ has quit [Client Quit]
jlast has quit [Ping timeout: 256 seconds]
otters has joined #ruby
Russell^^ has joined #ruby
Russell^^ has quit [Client Quit]
jimeh has quit [Quit: Computer has gone to sleep.]
Morkel_ has joined #ruby
planetbomba_ has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
Morkel has quit [Ping timeout: 260 seconds]
Morkel_ is now known as Morkel
NsOmNiAc has joined #ruby
Russell^^ has joined #ruby
willob has quit [Quit: Leaving.]
tenmilestereo has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
nomenkun has quit [Remote host closed the connection]
a_a_g has joined #ruby
LouisGB has joined #ruby
jrist is now known as jrist-dogwalk
NsOmNiAc has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
serhart has quit [Quit: Leaving.]
rippa has quit [Ping timeout: 240 seconds]
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
dmiller has quit [Remote host closed the connection]
serhart has joined #ruby
the_jeebster has joined #ruby
dmiller has joined #ruby
Guest25886 has quit [Quit: Guest25886]
<the_jeebster> anyone know how to fetch a session_id set by an instance of dalli store?
icole_ has quit [Remote host closed the connection]
dmiller has quit [Client Quit]
a_a_g has quit [Read error: Connection reset by peer]
dmiller has joined #ruby
the_hack has joined #ruby
<csmrfx> the_jeebster: wrong channel
havenn has joined #ruby
dmiller has quit [Client Quit]
icole has joined #ruby
dmiller has joined #ruby
<the_jeebster> hmm, I figured I migh ask here since I found some docs here http://www.ruby-doc.org/gems/docs/j/jashmenn-dalli-1.0.3/ActiveSupport/Cache/DalliStore.html
<csmrfx> hm, once upon time there was #activerecord I think
<csmrfx> but perhaps #rails or #rubyonrails or #ror or similar exists
srji_ has quit [Ping timeout: 248 seconds]
<Quadlex> #rails does
a_a_g has joined #ruby
the_hack has quit [Client Quit]
Goles has quit [Quit: Computer has gone to sleep.]
<ericwood> #rawr
Dann1 has quit [Remote host closed the connection]
locriani has quit [Remote host closed the connection]
Dann1 has joined #ruby
jblack_ has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
Karantin has left #ruby [#ruby]
marr has joined #ruby
karasawa has joined #ruby
ebouchut has quit [Quit: This computer has gone to sleep]
hashpuppy has joined #ruby
<hashpuppy> what's wrong with my crummy code: http://pastie.org/private/pwsbrg7o7w66aohyvjlw
<hashpuppy> getting an error: NoMethodError: private method combine called for Proc
postmodern has joined #ruby
jblack has quit [Ping timeout: 276 seconds]
<hashpuppy> actually: this one gives 1 for 1 arguments: multisort(l, lambda {|x| x.first_name}, lambda {|x| x.last_name})
<hashpuppy> 1 for 0 arguments
dankest is now known as dankest|away
<apeiros_> hashpuppy: reduce(&:combine) is not reduce { |a,b| combine(a,b) } (which you want), but reduce { |a,b| a.combine(b) }
piotr_ has joined #ruby
<hashpuppy> thanks!
piotr_ has quit [Remote host closed the connection]
willob has joined #ruby
karasawa has quit [Ping timeout: 260 seconds]
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
Moofy has quit [Quit: Moofy]
pkrnj has quit [Quit: Computer has gone to sleep.]
digitalsanctum has quit [Remote host closed the connection]
besame has joined #ruby
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
Moofy has joined #ruby
jrist-dogwalk is now known as jrist
icole has quit [Remote host closed the connection]
nomenkun has joined #ruby
dustint has quit [Remote host closed the connection]
icole has joined #ruby
akl_ has quit [Ping timeout: 240 seconds]
besame has quit [Client Quit]
dustint has joined #ruby
dustint_ has joined #ruby
dustint_ has quit [Client Quit]
jlast_ has quit [Remote host closed the connection]
a_a_g has quit [Quit: Leaving.]
icco_ is now known as icco
jduan1981 has joined #ruby
moshee has quit [Ping timeout: 248 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
janjos has joined #ruby
invisime has left #ruby [#ruby]
slainer68 has joined #ruby
icole has quit [Remote host closed the connection]
stim371 has quit [Quit: stim371]
staafl has joined #ruby
ryanf has joined #ruby
cjs226 has joined #ruby
jromine has joined #ruby
blaxter has quit [Quit: foo]
asteve has quit [Quit: Computer has gone to sleep.]
chussenot has joined #ruby
jlast has joined #ruby
jlast has quit [Remote host closed the connection]
chussenot has quit [Client Quit]
jlast has joined #ruby
akl_ has joined #ruby
danneu has joined #ruby
graft is now known as Guest73173
graft_ is now known as graft
anachronistic has left #ruby [#ruby]
IrishGringo_ has quit [Quit: ChatZilla 0.9.89 [Firefox 17.0.1/20121128204232]]
kirun has quit [Ping timeout: 240 seconds]
fermion has quit [Quit: P]
polerin has joined #ruby
[Neurotic] has joined #ruby
inokenty has quit [Quit: Leaving.]
mahmoudimus has quit [Ping timeout: 260 seconds]
aquaranto has quit [Remote host closed the connection]
asteve has joined #ruby
<polerin> is there a way to tell a Time object which time zone you want it to use, without having to specify what the exact time you want is?
kirun has joined #ruby
<polerin> I don't want to trust the server's timezone for using Time.getlocal,
sepp2k1 has quit [Read error: Connection reset by peer]
<polerin> And I can't simply use the offset because daylight savings time.
sepp2k has joined #ruby
codezombie is now known as codezombie|away
codezombie|away is now known as codezombie
nomenkun has quit [Remote host closed the connection]
codezombie has quit [Quit: Linkinus - http://linkinus.com]
<polerin> I'm not in rails.
<jblack_> looks like the idea is you get_local the offset, then take it from utc yourself
<polerin> hm
<jblack_> You should look before you decide it's not of use
<polerin> k.
<jblack_> :P
mengu_ has joined #ruby
<polerin> I think I looked over that one a bit ago, didn't see that segment. 'pologies
mengu has quit [Read error: Connection reset by peer]
wmoxam has joined #ruby
kurioscreative has quit [Quit: kurioscreative]
<jblack_> all good. ;)
Moofy has quit [Quit: Moofy]
lolcathost has quit [Read error: Operation timed out]
<jblack_> Time.at (Time.now.utc + Time.zone_offset('EST')) for anyone that was curious.
<polerin> Oh hey, zone_offset(). nice ok thanks
<jblack_> not sure if that really solves your problem, since you still have to figure out whether ot use EST or EDT
krawchyk has quit [Remote host closed the connection]
<polerin> yeah, just actually managed to get it going .. wifi here is being interesting
<polerin> I thought EDT would respect if it is DST or not?
<jblack_> also: Time.parse(Time.now.strftime('%Y-%m-%d %I:%M:%S UTC')).to_s
<jblack_> I'd check. "date" here on my unix system says EST. A few months ago it said EDT
zz_chrismcg is now known as chrismcg
<jblack_> I'd be mildy surprised if ruby didn't imitate posix.
pearkes has joined #ruby
* polerin rubs her eyes.
srji has joined #ruby
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
pearkes has left #ruby ["Textual IRC Client: www.textualapp.com"]
<polerin> sorry, first week in ruby land. I'm a php dev, and this is one of the things that PHP does easy enough. bleh. First one like this though.
jonathanwallace has joined #ruby
dougireton has quit [Quit: Leaving.]
<shevy2> polerin you must think differently. in ruby, everything is about beautiful poetry
<Eiam> I have a gem that I built (gem build blah.gemspec) then I installed it. in a script (just a generic .rb file) i have a require 'my-gem'. when I try to execute it I get a load error (https://gist.github.com/c044b8d0cd7b9008df12) but my gem clearly has that file in its structure
nga4 has quit []
<Eiam> and if i visit that path, i can see it right there in /lib/my-gem/monkeypatch.rb
<cirwin> Eiam: my favourite mistake with making new gems is not to actually include the code in the gem
<cirwin> if you're using the `git ls-files` approach to including files, check you added them to git
<polerin> shevy2: Trust me, I'm not a fan of hackery... my fault is obsessive reusability and elegance. Sometimes to the point that it turns very bad :P
dankest|away is now known as dankest
<Eiam> cirwin: I'm sorry I don't quite understand.. I just have some files here on the system with a gemspec
<Eiam> no git involved
<cirwin> and the gemspec lists all the files correctly?
<Eiam> are you saying my gemspec is setup to not include my own gem?
<cirwin> it might not include all the files
<Eiam> files = Dir["{app,config,db,lib}/**/*"]
<Eiam> seems like that should snag it all?
<cirwin> yeah, tha tlooks right to me
wroathe has quit [Ping timeout: 256 seconds]
zastern has joined #ruby
elico has quit [Quit: elico]
stim371 has joined #ruby
<Eiam> I have <gem name>/lib/gem-name/my.rb's as the total directory structure
carloslopes has joined #ruby
dougireton has joined #ruby
<Eiam> gemspec is defined at the same level as lib
<ale``> what ruby project generator would you recommend?
<cirwin> Eiam: try running "gem specification *.gem" and see what it looks like
<cirwin> ale``: what project are you doing?
<cirwin> just a simple one shouldn't need a generator
<cirwin> if you're using rails, it comes with a generator
<Eiam> cirwin: I see it in files, files: -lib/my-gem/monkeypatch.rb
mark_locklear has quit [Remote host closed the connection]
jrist is now known as jrist-doctor
emmanuelux has joined #ruby
<ale``> cirwin: right now I'm still thinking what to work on, just looking for a recommendation :-)
dougireton has quit [Client Quit]
<Eiam> cirwin: okay so i moved my script from one location into the location of the gem that i compiled and it worked
Vainoharhainen has joined #ruby
jimeh has joined #ruby
<Eiam> which tells me the require 'my-gem/monkeypatch' is not being put relative to the gem but to my script? (even though that require is IN the gem I built)
Axsuul has quit [Remote host closed the connection]
<cirwin> ale``: would love someone to work on a pry bug :) https://github.com/pry/pry/issues/794
nemesit has quit [Ping timeout: 260 seconds]
jthomp has joined #ruby
<ale``> mhmh, pry seems interesting :-) Going to read about it first.
Vert has quit [Ping timeout: 252 seconds]
akl_ has quit [Ping timeout: 240 seconds]
<kapowaz> encounters other entries (e.g. ‘assets’) besides web or worker? Does it just ignore them?
<kapowaz> anyone here familiar with foreman able to comment on a question? I'm looking at using foreman + rerun for recompiling assets (i.e. with rake-pipeline-web-assets) and a project I'm poking around with to get an idea for it uses this, with the rerun command specified in the Procfile. Question is, what's the deal with how Heroku interprets said Procfile if it
kenneth_ has joined #ruby
kenneth has quit [Read error: Connection reset by peer]
kenneth_ is now known as kenneth
mengu_ has quit [Quit: Konversation terminated!]
danneu has quit [Ping timeout: 252 seconds]
Axsuul has joined #ruby
cantonic has quit [Quit: cantonic]
rpbertp13 has joined #ruby
wroathe has joined #ruby
horofox_ has quit [Quit: horofox_]
dougireton has joined #ruby
topriddy has joined #ruby
danneu has joined #ruby
carloslopes has quit [Read error: Connection reset by peer]
karl___ has joined #ruby
<karl___> i'm parsing XML and was using rexml/document, which is super slow for my xml files (approx 50mb each). Can anyone recommend a faster xml library to use?
horofox has joined #ruby
<ericwood> you're probably doing DOM parsing
<ericwood> try using a SAX parser instead
<cirwin> karl___: nokogiri
<cirwin> wraps libxml2
<ericwood> yes, nokogiri is the greatest, and it has DOM and SAX parsers you can use
tenmilestereo has quit [Quit: Leaving]
<karl___> thank you both
griffindy has quit [Quit: Computer has gone to sleep.]
eldariof has quit []
<ale``> cirwin: how should i trigger the line numbers with whereami? (btw, pry seems _really_ nice)
<ericwood> a DOM parser will take every node and build up a tree in memory -- this is bad for large documents
<cirwin> ale``: if you type whereami you'll see the line numbers
_alejandro has joined #ruby
<ericwood> a SAX parser issues callbacks on certain nodes and you can basically roll your own
cantonic has joined #ruby
<karl___> ericwood: cirwin: this is very helpful
<ale``> cirwin: I can only see "Inside Foo"
* ericwood remembers trying to parse his iTunes library's XML file and bringing his machine to a halt with a DOM parser :|
Neomex has quit [Quit: Neomex]
topriddy has quit [Read error: Connection reset by peer]
<banisterfiend> ale``: sry, i already fixed that bug ;)
Amnesia has joined #ruby
<Amnesia> question
the_hack has joined #ruby
<Amnesia> >> if "./hidden/.." =~ /\.\/\.{0,2}\/+\w\.{1,2}*/; puts 'hoi'; end
<eval-in> Amnesia: Output: "" (http://eval.in/6215)
<banisterfiend> ale``: plenty of others though!
<Amnesia> => nil
<cirwin> banisterfiend: should have closed the bug :p
timonv has joined #ruby
<Amnesia> how's that possible? {0,2} should be valid right?
nyuszika7h has quit [Remote host closed the connection]
Nisstyre has joined #ruby
carloslopes has joined #ruby
nyuszika7h has joined #ruby
<banisterfiend> cirwin: not yet pushed :) and just did it about 5 min ago
<banisterfiend> but i should
<banisterfiend> i will
icole has joined #ruby
Vainoharhainen has quit [Read error: Connection reset by peer]
srji has quit [Ping timeout: 248 seconds]
Vainoharhainen has joined #ruby
scriabin has quit [Quit: Page closed]
icole has quit [Remote host closed the connection]
icole has joined #ruby
cirwin has left #ruby [#ruby]
nathancahill has quit [Quit: nathancahill]
<karl___> fun fact: a nokogiri is a saw
<karl___> so i guess the imagery is that nokogiri cuts through xml
horofox has quit [Read error: No route to host]
the_hack has quit [Quit: Computer has gone to sleep.]
topriddy has joined #ruby
brandon|work has joined #ruby
<ericwood> no clue, I think tenderlove was responsible for the naming?
_nitti has joined #ruby
<havenn> ericwood: Yeah, I think so. Saw makes sense kinda. WTF XML!
<ericwood> heh
geekbri has quit [Remote host closed the connection]
horofox has joined #ruby
mahmoudimus has joined #ruby
rismoney has quit []
ryanh has joined #ruby
Amnesia has left #ruby [#ruby]
jimeh has quit [Quit: Computer has gone to sleep.]
lolcathost has joined #ruby
pcarrier has joined #ruby
Nahra has quit [Quit: leaving]
dougireton has quit [Quit: Leaving.]
topriddy_ has joined #ruby
graft has quit [Ping timeout: 252 seconds]
topriddy has quit [Ping timeout: 248 seconds]
topriddy_ is now known as topriddy
<aedorn> damn you virtualbox, why must you hate me so!?
mneorr has joined #ruby
bean has quit [Read error: Connection reset by peer]
bean has joined #ruby
<breakingthings> because the lawn.
Spooner has joined #ruby
ryanh has quit [Ping timeout: 244 seconds]
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
ryanh has joined #ruby
<Spooner> Hanmac : Anything interesting happened while I've been slacking away from #ruby? Did you even notice me not being here :D
RagingDave has quit [Quit: Ex-Chat]
<Pip> Spooner, NO
<Pip> Spooner, I noticed that Matz was never here
noxoc has joined #ruby
<Spooner> Pip What a slacker, eh?
baphled has quit [Ping timeout: 264 seconds]
<Pip> You?
c0rn has quit [Ping timeout: 265 seconds]
<Spooner> Matz. Resting on his laurels.
ChampS666 has quit [Ping timeout: 246 seconds]
<blazes816> from ruby-prof: 7.46% (20.91%) Class#new [2501 calls, 312739 total]
<blazes816> what does "total" represent?
<blazes816> i can't find anything that explains that part
<Spooner> I think the total is the total of all calls above it.
Vainoharhainen has quit [Read error: Connection reset by peer]
<blazes816> at first I thought it was total time, but it stays the same through multiple runs
<blazes816> hmm, that could be.
<billy_ran_away> Anyone know the backburner gem for beanstalkd? Why do I have to call Backburner.work for it to start processing the queue?
Vainoharhainen has joined #ruby
RagingDave has joined #ruby
tommyvyo has joined #ruby
horofox has quit [Quit: horofox]
baphled has joined #ruby
joeycarmello has quit [Remote host closed the connection]
<brandon|work> This is a long shot, but anyone have experience with running powershell scripts using Ruby?
kenneth has quit [Quit: kenneth]
timonv has quit [Remote host closed the connection]
jeffreybaird has quit [Quit: jeffreybaird]
Proshot has quit [Quit: Leaving]
timonv has joined #ruby
kenneth has joined #ruby
digitalsanctum has joined #ruby
tenmilestereo has joined #ruby
<havenn> Spooner: Matz hasn't even committed to mruby in the last 6 hours, for SHAME!!!
<havenn> :P
<Spooner> 8 hours ago? I suppose even he has to sleep, but I'd expect another commit within the next hour or so.
sailias has quit [Quit: Leaving.]
xAndy is now known as xandy
AxonetBE has joined #ruby
dmerrick has joined #ruby
hotovson has quit [Remote host closed the connection]
Vainoharhainen has quit [Ping timeout: 240 seconds]
rasbonics has joined #ruby
<havenn> Spooner: Agreed. Otherwise, LAURELS!!!!
jthomp has quit [Quit: jthomp]
rasbonics has quit [Client Quit]
timonv has quit [Ping timeout: 248 seconds]
obryan has quit [Ping timeout: 248 seconds]
<blazes816> aha! fyi Spooner it's the total of all calls 'below' it
<blazes816> which might be what you meant
rismoney has joined #ruby
<Spooner> blazes816 : Yep. It would have been what I meant if I had a ruby-prof output in front of me within the last 6 months.
cjs226 has quit []
medik has joined #ruby
baphled has quit [Ping timeout: 248 seconds]
JMcAfreak has quit [Quit: They're coming to take me away, ha-haa!]
mahmoudimus has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
Dreamer3 has joined #ruby
gabrielrotbart has joined #ruby
JMcAfreak has joined #ruby
baphled has joined #ruby
rondale_sc has quit [Quit: rondale_sc]
speakingcode has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 255 seconds]
kpwz has joined #ruby
baphled has quit [Ping timeout: 255 seconds]
<kpwz> apparently to use sass with rake-pipeline-web-filters you need compass too. Anyone able to explain why?
Morkel has quit [Quit: Morkel]
whowantstolivefo has quit [Ping timeout: 248 seconds]
grieve has joined #ruby
dmerrick has quit [Quit: dmerrick]
<jrabbit> is there a ruby function syntax for polymorphism? I want to handle a string or an array of two
mahmoudimus has joined #ruby
<Pip> Does && || work in Ruby or it uses "and" "or" ?
<havenn> Pip: They have different precedence.
rismoney has quit []
workmad3 has joined #ruby
gyre007 has quit [Ping timeout: 248 seconds]
jds has joined #ruby
<ericwood> tl;dr: use && and || rather than "and" "or"
baphled has joined #ruby
hukl has quit [Quit: Linkinus - http://linkinus.com]
dougireton has joined #ruby
<ericwood> otherwise you'll have a bad time
digital-ghost has quit [Ping timeout: 245 seconds]
grzywacz has joined #ruby
grzywacz has quit [Changing host]
grzywacz has joined #ruby
jekotia has joined #ruby
<apeiros_> jrabbit: no. doesn't make sense for a dynamically typed language anyway.
<apeiros_> it's not like ruby cared whether you pass a string or an array.
<ericwood> they're all ducks as far as it is concerned
<havenn> Pip: Both work great, but yeah use || && unless you want to memorize precedence order or you might get screwed up.
pkrnj has joined #ruby
<jrabbit> apeiros_: ah ok it just seems messy for some reason
<apeiros_> jrabbit: because it is.
<apeiros_> say what you mean.
v0n has quit [Ping timeout: 256 seconds]
<apeiros_> i.e. - create proper methods for the different use cases
<jrabbit> apeiros_: I'm trying to shoehorn all references to a resolution into a resolution object so I don't have to muck about with strings versus arrays representing the same thing
<havenn> jrabbit: paste a Gist of the code?
c0rn has joined #ruby
<apeiros_> that e.g. would be a proper solution :)
<ericwood> apeiros_: he could use one method that tests the class of the argument and reacts accordingly
<apeiros_> Resolution.string("100x200") & Resolution.new(100, 200)
<apeiros_> where Resolution.string just parses the string and invokes .new(100, 200)
<jrabbit> apeiros_: ah I see what you mean
<jrabbit> oh that makes much more sense
<ericwood> that's one way, you can make it accept both!
<apeiros_> assuming you mean that kind of resolution
<jrabbit> yeah that's what I'm refering to yeah
<ericwood> have it look at the number of args and the type and react accordingly
RagingDave has quit [Quit: Ex-Chat]
<apeiros_> ericwood: yeah, the part about "make it accept both" is IMO messy.
<jrabbit> if there isn't a "ruby way" to do that it's not ideal
<apeiros_> and that's what I meant by "say what you mean" - make explicit method. don't accept just all and everything.
karl___ has quit [Ping timeout: 245 seconds]
<ericwood> you can still have the other function, do the detection and delegate to the proper functions
<ericwood> so everyone wins
<apeiros_> jrabbit: ruby is very much about "there's more than one way to do it"
<jrabbit> sometimes I just forget what features are unique to which languages
<havenn> apeiros_: Oooh, I meant to mention: s/ruby-2.0.0-preview2/ruby-2.0.0-rc1
<ericwood> apeiros_: that's what perl's motto is...we're better than that :|
<apeiros_> havenn: topic?
<ericwood> ruby stresses convention more than most languages
<havenn> apeiros_: for Topic I mean
<jrabbit> apeiros_: I was thinking something lisp/clojure that lets you have multiple definitions based on # of arguements
<apeiros_> k
<havenn> apeiros_: :D
<jrabbit> also new v. initialize?
apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p362: http://ruby-lang.org (ruby-2.0.0-rc1) || Paste >3 lines of text on http://gist.github.com
<apeiros_> havenn: thanks!
serhart has quit [Quit: Leaving.]
<apeiros_> jrabbit: new is a class method
dankest is now known as dankest|away
<apeiros_> initialize is an instance method
<nateberkopec> any strftime wizards out there? I can't figure out why Date.strptime("2/1/12", "%-m/%-d/%y") is giving me an invalid date error
<apeiros_> jrabbit: new is basically: class Class; def new(*args, &block); obj = allocate; obj.__send__(:initialize, *args, &block); obj; end; end
<jrabbit> ah
<apeiros_> nateberkopec: what's up with the '-' there?
_nitti has quit [Remote host closed the connection]
digitalsanctum has quit [Remote host closed the connection]
<Spooner> nateberkopec : Yeah, it works fine without the -s.
havenn has quit [Remote host closed the connection]
ossareh_ has joined #ruby
havenn has joined #ruby
asdfqwer has joined #ruby
<nateberkopec> apeiros_ spooner: oh lawd, so you use "-"s to pad OUTPUT with strftime but you don't need to use them for INPUT with strptime?
<apeiros_> jrabbit: well, you can accept an arbitrary number of arguments using *: def foo(*all_args)
digitalsanctum has joined #ruby
ossareh has quit [Ping timeout: 252 seconds]
<ericwood> don't forget &arg to access blocks!
<jrabbit> apeiros_: I think this is more explicit and cleaner
<ericwood> * is the splat operatorrrrrr
<apeiros_> nateberkopec: oh, TIL %-d - didn't know about that
<ericwood> (so you can google it)
<jrabbit> obj.* is about the same as python's self.* right?
<nateberkopec> apeiros_: lol yup, also TIL that you dont need them when using strptime
<apeiros_> jrabbit: no
Alaude has joined #ruby
<apeiros_> * is the same as self.*
<jrabbit> ah ok
staafl has quit [Quit: Leaving]
<apeiros_> def foo; bar; end # --> same as def foo; self.bar; end
graft has quit [Remote host closed the connection]
freakazoid0223 has joined #ruby
graft has joined #ruby
<jrabbit> ok
<apeiros_> just beware - you can't call private methods with an explicit receiver, even if that receiver is self
<apeiros_> i.e., self.puts # !> raises
dr_neek has quit [Quit: dr_neek]
<apeiros_> puts # -> works fine
Vainoharhainen has joined #ruby
<jrabbit> I don't know what that means so I don't think I'd do it?
agarie has joined #ruby
<apeiros_> even though a plain puts is technically self.puts
<apeiros_> (no receiver = call it on self)
Kuifje has quit [Ping timeout: 264 seconds]
Alenah has joined #ruby
Alenah has quit [Excess Flood]
tenmilestereo[aw has joined #ruby
havenn has quit [Ping timeout: 255 seconds]
the_hack has joined #ruby
noxoc has quit [Quit: noxoc]
grieve has quit []
<jrabbit> apeiros_: https://gist.github.com/4488673 anything horrendous about this?
<jrabbit> well s/new/initalize
segv- has quit [Read error: Connection reset by peer]
joshman_ has quit [Ping timeout: 260 seconds]
segv-_ has joined #ruby
tenmilestereo has quit [Ping timeout: 252 seconds]
tenmilestereo[aw has quit [Client Quit]
phantasm66 has quit [Quit: *sleeeep….]
cantonic has quit [Quit: cantonic]
<apeiros_> jrabbit: should be def self.string
<apeiros_> and self.clean in that case too
tomzx has joined #ruby
<apeiros_> I'd also probably convert it to integers
Vainoharhainen has quit [Ping timeout: 245 seconds]
<jrabbit> oh that'd make sense hah
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
red|dye has joined #ruby
thone has joined #ruby
the_hack has quit [Quit: Computer has gone to sleep.]
RagingDave has joined #ruby
<jrabbit> apeiros_: removed #clean why would it be self.clean though?
<jrabbit> updated on https://gist.github.com/4488673
<apeiros_> because you can't invoke instance methods without actually having an instance ;-)
_nitti has joined #ruby
<apeiros_> oh, you call new, not initialize in line 12
cantonic has joined #ruby
<apeiros_> initialize too is an instance method - can't call it from a class method
rpbertp13 has quit [Remote host closed the connection]
<jrabbit> its changed no?
kirun has quit [Quit: Client exiting]
<apeiros_> I mean you *should* call new
<apeiros_> since you can't call initialize
bluOxigen has quit [Ping timeout: 248 seconds]
<jrabbit> ahh
nfk has joined #ruby
headius has quit [Quit: headius]
dankest|away is now known as dankest
<apeiros_> that's how I'd probably do it
<nfk> stupid scope question: i have a class and methods within this class but i can't in any way declare an object instance outside the methods (but within the class) they they all could access
<nfk> i have tried $, @ and @@
icco has quit [Quit: run away.]
<apeiros_> nfk: ¿que?
<nfk> if it matters, it's rails unit tests
<JMcAfreak> apeiros_: technically, you'd say "como"
<apeiros_> JMcAfreak: that's not faulty-tower-style then!
<apeiros_> fawlty?
<apeiros_> dang
<JMcAfreak> fawlty
<apeiros_> yeah, fawlty towers
<nfk> apeiros_, yes, i know i could just pass the object to methods but that's tedious
joeycarmello has joined #ruby
horofox has joined #ruby
_46bit has joined #ruby
<apeiros_> interesting, I didn't notice I suggested that
_46bit has left #ruby [#ruby]
icco has joined #ruby
<Spooner> apeiros_ : I think you mean Farty Towels.
ner0x has quit [Quit: Leaving]
<nfk> apeiros_, or if you meant where's the question, the questio is, how do i do that?
Nisstyre has quit [Ping timeout: 256 seconds]
<apeiros_> Spooner: nope
<nfk> get methods within a class to access an object declared within that same class
hotovson has joined #ruby
the_hack has joined #ruby
tommyvyo_ has joined #ruby
dustint has quit [Quit: Leaving]
<Spooner> nfk What do you mean by declared within the same class? Can you paste up a snippet?
jthomp has joined #ruby
<nfk> Spooner, i still haven't cleared the ownership of the code so not really, sorry
baphled has quit [Ping timeout: 240 seconds]
jthomp has quit [Client Quit]
<jrabbit> apeiros_: thanks :)
<nfk> but i suppose i can write something similar
<Spooner> That would be fine.
<nfk> user = User.new({:some => "stuff"})
<nfk> test "some test" do
_46bit has joined #ruby
_46bit has quit [Remote host closed the connection]
<nfk> assert user.valid?
<nfk> end
bigkevmcd has quit [Ping timeout: 256 seconds]
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
GoGoGarrett has quit [Remote host closed the connection]
srji has joined #ruby
thone has quit [Ping timeout: 265 seconds]
thone has joined #ruby
baphled has joined #ruby
<nfk> currently running the test seems to indicate that within the tests the object is nil
nemesit has joined #ruby
RagingDave has quit [Read error: Connection reset by peer]
RagingDave has joined #ruby
mengu has joined #ruby
breakingthings has quit []
tommyvyo_ has quit [Quit: http://thomasvendetta.com]
<Spooner> In most frameworks you'd use something like 'before do @user = ... end' to set up the object that will be used in each test. Alternatively, just make it inside the test if it isn't used multiple times.
alanp_ has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
topriddy has quit [Read error: Connection reset by peer]
<nfk> Spooner, the thing is that i would like to reuse the object instance
alanp_ has joined #ruby
srji has quit [Ping timeout: 248 seconds]
<Spooner> What test framework are you using? It is a pretty standard thing to do, so it should make it very clear how to do this.
blacktulip has quit [Remote host closed the connection]
<nfk> whatever comes with rails by default
<nfk> i know it's not rspec
<nfk> but i can't remember the name of it
Gues_____ has joined #ruby
Gues_____ is now known as RubNoob
<RubNoob> hello, has anyone used the carrierwave gem?
fermion has joined #ruby
<Gate> RubNoob: yep
_nitti has quit [Remote host closed the connection]
<RubNoob> @Gate do you have any good resources for handling relative pathing/restricted access using cancan?
alanp has quit [Read error: Operation timed out]
nari has joined #ruby
lolcathost has joined #ruby
jlast has quit [Remote host closed the connection]
phipes has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
cascalheira has joined #ruby
jgarvey has quit [Quit: Leaving]
bean has quit [Quit: Computer has gone to sleep.]
danneu has quit [Quit: WeeChat 0.3.8]
philcrissman has quit [Remote host closed the connection]
<kenneth> where does one find good rubyists to hire in sf
<kenneth> all the guys we get are python / php guys
<kenneth> i'm looking for some smart rubyists for my team :/
phipes has quit [Client Quit]
phipes has joined #ruby
c0rn has joined #ruby
carloslopes has quit [Remote host closed the connection]
<blazes816> kenneth: careers.stackoverflow.com and angelist are pretty good. my boss found me crawling through github
JMcAfreak has quit [Quit: leaving]
jerius has quit []
stopbit has quit [Quit: Leaving]
samuel02 has quit [Remote host closed the connection]
nemesit has quit [Quit: Leaving...]
nateberkopec has quit [Quit: Leaving...]
alanp_ is now known as alanp
generalissimo has quit [Remote host closed the connection]
phipes has quit [Quit: phipes]
IceDragon has joined #ruby
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
g0bl1n has quit [Read error: Connection reset by peer]
<Pip> What does << mean as a String method?
nicobrevin1 has joined #ruby
alex__c2022 has quit [Quit: alex__c2022]
asteve has quit [Quit: Computer has gone to sleep.]
fir_ed has joined #ruby
asdfqwer has quit []
AlbireoX has joined #ruby
Dann1 has quit [Ping timeout: 255 seconds]
key has joined #ruby
key has left #ruby ["..."]
<Gate> Pip: append
<Pip> ok
willob has quit [Quit: Leaving.]
beardyjay has joined #ruby
nicobrevin1 has quit [Read error: Operation timed out]
c3vin has quit [Ping timeout: 240 seconds]
pkrnj has quit [Quit: Computer has gone to sleep.]
emergion has joined #ruby
jtharris has quit [Quit: WeeChat 0.3.9.2]
havenn has joined #ruby
nicobrevin1 has joined #ruby
francisfish has quit [Remote host closed the connection]
dmerrick has joined #ruby
SCommette has quit [Quit: SCommette]
red|dye has left #ruby [#ruby]
the_hack has quit [Quit: Computer has gone to sleep.]
d2dchat_ has quit [Remote host closed the connection]
<RubNoob> does anyone know how to generate a private url for the carrierwave gem
the_hack has joined #ruby
serhart has joined #ruby
<Gate> RubNoob: sorry, didn't see your highlight. I generally use s3 for file storage so protecting the files then using timed links is pretty easy
srji has joined #ruby
johnmilton has joined #ruby
<RubNoob> @Gate I guess I'm kind of confused as to storing an upload (i.e. images) privately and then serving it using a publicly available thumbnail of some time
<RubNoob> *type
speakingcode has joined #ruby
Nisstyre has joined #ruby
<RubNoob> @Gate basically what I'm currently doing is saving the thumbnail to a publicly accessible dir, the actual image to a private dir, and wrapping the thumbnail in a link that points to the download action in a controller
<RubNoob> @Gate then, in the controller, I assess the user's privs and allow them to download if they have access
<Gate> RubNoob: makes perfect sense to me.
Targen has joined #ruby
<RubNoob> @Gate thanks, ok - but here's where I get hung up…when generating the URL for the private download URL, I'm getting a full path rather than a relative path at the root of the server URL
the_hack has quit [Client Quit]
GoGoGarrett has joined #ruby
<Gate> RubNoob: although if I were to do it, I would keep the files together, and use the controller action to decide on each file whether to downlaod it
cantonic has quit [Quit: cantonic]
<RubNoob> @Gate do I need to create a model instance method that returns the customized (relative to root path) url, or is there a built-in way to do that in carrierwave?
dankest has quit [Quit: Leaving...]
ffranz has joined #ruby
srji has quit [Client Quit]
<Gate> What method are you using to generate the URL?
sailias has joined #ruby
<nfk> is there something specific i must note when using a loop inside string? such as this puts "#{instance.errors.each do |e, m| puts "#{e}: #{m}}\n"
<Gate> nfk: yeah, puts will put to std out, I don't think that will do what you want
<nfk> if do just the inner loop, it functions as expected but within the outer "#{}" it prints the hash itself
shiftpgdn has joined #ruby
<apeiros_> nfk: #{} will insert the *return value* of the expression
<nfk> apeiros_, and return value is the hash?
<apeiros_> and the return value of obj.each {…} is always obj
<Gate> nfk: try "#{instance.errors.map do |e,m| "#{e}: #{m}"}"
<Gate> note that map instead of each
beiter has quit [Quit: beiter]
mmitchell has quit [Ping timeout: 248 seconds]
<apeiros_> just: puts instance.errors.map do |e,m| "#{e}: #{m}"}
<apeiros_> puts will join an array with newlines
nicobrevin1 has quit [Ping timeout: 246 seconds]
<Gate> nfk: try "#{instance.errors.map do |e,m| "#{e}: #{m}" end}"
<RubNoob> image_url
cantonic has joined #ruby
<RubNoob> @Gate image_url
<Gate> sorry, forgot the end
<Gate> RubNoob: cool, just a sec, gotta brush up :)
<apeiros_> just: puts instance.errors.map { |e,m| "#{e}: #{m}" } # correct syntax this time
* apeiros_ doesn't expect do/end with map…
u- has quit [Remote host closed the connection]
<Gate> RubNoob: oh, heh. Do model_instance.image.url instead
emergion has quit [Quit: Computer has gone to sleep.]
<RubNoob> @Gate yea, same path generated (from the root of my machine)
cascalheira has quit [Quit: Linkinus - http://linkinus.com]
workmad3 has quit [Ping timeout: 265 seconds]
<Gate> RubNoob: Oh, you want it relative to a page instead of relative to the server root?
<Gate> Sorry, I think I misunderstood
ner0x has joined #ruby
<RubNoob> @Gate well, for instance, I'd like to do: <a href="<%= image.url -%>" and have it generate http://<SERVER>:<PORT>/private/images/....
<RubNoob> @Gate (sorry for the inline code)
<Gate> RubNoob: no problem, I think I just realized I missed something obvious. Since the files are not publically shared, you don't want image.url. You want the path to your download controller instead
Targen has quit [Read error: Connection reset by peer]
<Gate> RubNoob: so it depends on what your controller is named, and what is in your routes file.
emocakes has quit [Quit: emocakes]
<RubNoob> @Gate, ok, I think I understand, let me tool with it a bit, thanks in advance
<nfk> Gate, apeiros_, thanks
allsystemsarego has quit [Quit: Leaving]
<Gate> RubNoob: no problem. And for some reason my client isn't highlighting @Gate, drop the @ if you need my attention :)
xsdg has quit [Ping timeout: 276 seconds]
<RubNoob> Gate got it, thanks! :)
Vainoharhainen has joined #ruby
<Gate> :)
<RubNoob> Gate worked perfectly, I think I've got it - thanks so much for your help, much appreciated!
<Gate> RubNoob: no problem. Enjoy.
apeiros_ has quit [Remote host closed the connection]
rismoney has joined #ruby
platzhirsch has joined #ruby
snafoo has quit []
jjang has joined #ruby
<platzhirsch> I want to structure my small Ruby project in a Gem fashion, in lib is my code and in bin the code gets invoked, so is the usual approach to add $LOAD_PATH << './lib' after the shebang in the bin ruby code?
<Eiam> god, EVERY time I write some code that I'm happy with for once and don't feel like a fucking mess, I start testing it and hit these stupid ass edge cases that turn code I was happy with into a mess dealing with these 20% cases
_alejandro has quit [Remote host closed the connection]
<Eiam> oh look some jackass is in the system with no dsid, or look, his dsid is his LAST NAME instead of I dunno, an id. fantastic.
<platzhirsch> Eiam: you seem very jolly
<Gate> Just oozing cheer
<Eiam> platzhirsch: I just want to be happy with my code for once, I want it to look great and just feel like I did something clean for nce
<Eiam> once
lateau has quit [Ping timeout: 260 seconds]
<platzhirsch> Eiam: I hear you, just finished some library code a while ago, that was the first time I wrapped a project up, I hope more follow soon
xsdg has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
mercwithamouth has quit [Ping timeout: 255 seconds]
rburton- has joined #ruby
baphled has quit [Ping timeout: 246 seconds]
<Gate> I know the feeling, eiam. I usually get that joy from the problems where I get to obscenely constrain my data. Like the time I wrote a "math interpreter" to do basic interpolated arithmetic
mneorr has quit [Read error: Connection reset by peer]
RagingDave has quit [Quit: Ex-Chat]
<Gate> I tested it by giving it an SAT practice test. First time I ever used unit tests, too :)
JonnieCache has joined #ruby
mercwithamouth has joined #ruby
mneorr has joined #ruby
AndIrc_46 has quit [Read error: Connection reset by peer]
maletor has joined #ruby
dankest has joined #ruby
<JonnieCache> so i hear the sky is falling
<JonnieCache> confirm/deny?
subbyyy has joined #ruby
<Eiam> so how do people handle edge cases in their code
<Eiam> do you do exceptions? if/else? do you restructure the code to treat exceptions as normal flow
Alaude has quit [Quit: Page closed]
AndIrc_76 has joined #ruby
<JonnieCache> i'm in your yaml, rooting your servers
emergion has joined #ruby
AndIrc_96 has joined #ruby
Nisstyre has quit [Ping timeout: 260 seconds]
AndIrc_76 has quit [Read error: Connection reset by peer]
nateberkopec has joined #ruby
<Gate> Eiam: probably the best advice I've seen on it in recent history is a presentation by Avdi Grimm on the subject: http://www.youtube.com/watch?feature=player_embedded&v=T8J0j2xJFgQ
TomRone has quit [Ping timeout: 260 seconds]
Takehiro has quit [Remote host closed the connection]
<Eiam> haha do they constantly second guess themselves
<Eiam> yes, YES THEY DO please tell me more avdi!
coder_neo has quit [Ping timeout: 256 seconds]
gyre008 has joined #ruby
AndIrc_96 has quit [Read error: Connection reset by peer]
AndIrc_49 has joined #ruby
fourq has quit [Quit: leaving]
Jedi_SCT1 has quit [Quit: See ya]
fourq has joined #ruby
bigkevmcd has joined #ruby
stevechiagozie has quit [Quit: Computer has gone to sleep.]
xandy is now known as xAndy
miphe has joined #ruby
TomRone has joined #ruby
carloslopes has joined #ruby
Jedi_SCT1 has joined #ruby
adkron has quit [Ping timeout: 260 seconds]
AndIrc_49 has quit [Ping timeout: 260 seconds]
ossareh_ has quit [Ping timeout: 244 seconds]
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
kiyoura has joined #ruby