fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
rakl has quit [Quit: sleeping]
<blazes816> what do you mean reference?
Jake232 has joined #ruby
<bperry> I am assuming use this string to access the object'
<ablew_> bperry: yes
<bperry> ablew_: perhaps you should store these in a hash
<ablew_> sorry, vocab isn't very good this time of day
<bperry> and use the string as the key
joofsh has joined #ruby
<bperry> and then the value is th eobject
<ablew_> i was doing that before, but this is a heavily threaded application so i couldn't take the hit on mutex
<bperry> ah
<bperry> use C :)
<ablew_> doh!
pdtpatrick has quit [Quit: pdtpatrick]
<ablew_> :P
atmosx has quit [Quit: WeeChat 0.3.8]
Agis__ has quit [Quit: Agis__]
_nitti has quit [Ping timeout: 246 seconds]
bradhe has joined #ruby
<bperry> (you can write ruby gems in C fwiw)
<bperry> it is easy enough
<ablew_> heh, trying to avoid that
verto is now known as verto|off
<bperry> meh it isn't voodoo, it is useful, I am not sure why so many peopl are against
rakl has joined #ruby
<ablew_> this is a queue consumer that does analysis and then pushes stuff into graphite. it's built to support N worker threads to do the processing
<ablew_> for me it's just scope creep
lggr has quit [Ping timeout: 260 seconds]
Tearan has quit [Quit: Sleepy Badger....]
<bperry> ah
<ablew_> i want to get this thing working and then move on to other stuff
dkastner has quit [Quit: dkastner]
duracrisis_ has joined #ruby
recycle has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
fortysixandtwo has joined #ruby
lggr has joined #ruby
DaniG2k has joined #ruby
hsbt_away is now known as hsbt
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<DaniG2k> guys I am writing a pretty bare class in ruby now (I'm a total n00b so bear with) and i'm wondering how can I define a method that returns true if the object is from that same class?
<DaniG2k> say the class is IceCream
lggr has quit [Ping timeout: 240 seconds]
<DaniG2k> and I want to write a method that returns true if the object is of class IceCream
duracrisis_ has quit [Changing host]
duracrisis_ has joined #ruby
baroquebobcat has joined #ruby
starship has quit [Killed (adams.freenode.net (Nickname regained by services))]
duracrisis_ is now known as starship
recycle has quit [Ping timeout: 246 seconds]
Guest36719 has joined #ruby
<Vinz_> objet.class would give you the object class i think
<Vinz_> DaniG2k
robbyoconnor has joined #ruby
baroquebobcat has quit [Client Quit]
samphippen has quit [Quit: Computer has gone to sleep.]
<DaniG2k> Vinz_: I know but, I am writing the class now and I'm wondering how I can write a def so that it returns true if object.class == the class that def is in
falieson_ has left #ruby [#ruby]
<DaniG2k> for instance
<DaniG2k> class Apple
<DaniG2k> sorry
<DaniG2k> class Fruit
lggr has joined #ruby
<DaniG2k> and inside that
<DaniG2k> def apple
<DaniG2k> it has to return true if its a fruit object
punkrawkR has quit [Read error: Connection reset by peer]
nwertman has quit [Quit: nwertman]
reuf has joined #ruby
<Vinz_> Maybe this
<DaniG2k> Vinz_: yea something like that, thanks
<Vinz_> ;)
<DaniG2k> Vinz_: but is the .name necessary?
Tearan has joined #ruby
<DaniG2k> Vinz_: or can I just use self.class ?
<Vinz_> Hm,
<Vinz_> I don't know
<Vinz_> But .name returns a string
<DaniG2k> ok
BSaboia__ has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
kiyoura has joined #ruby
DaniG2k has quit [Quit: leaving]
swarley has joined #ruby
SegFaultAX|work has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
jwallace has joined #ruby
xbayrockx has quit [Ping timeout: 255 seconds]
<jwallace> after calling `GC.start`, should I expect a ruby process to release some ram?
xbayrockx has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
<jwallace> because i can see that it is freeing objects (ObjectSpace.count_objects), but it is not releasing ram
brianpWins has quit [Quit: brianpWins]
pskosinski has quit [Ping timeout: 244 seconds]
guns has joined #ruby
<swarley> If its anything like java I doubt it
<swarley> In java you can suggest that ram be freed, but not actually force it
robbyoconnor has quit [Ping timeout: 260 seconds]
<jwallace> hmm ok
macmartine has joined #ruby
<jwallace> i have an eventmachine process that in 30 days racked up 19GB in swap
<swarley> Banister fiend has a gem to force freeing of objects though
<swarley> I think
<jwallace> swarley: https://github.com/banister/free ?
rakl has quit [Quit: gone]
<swarley> Ah yes
<swarley> I think that could e potentially dangerous though
<swarley> Be*
SegFaultAX|work has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<jwallace> swarley: yeah it sounds a bit aggressive
bradleyprice has joined #ruby
rabidpraxis has joined #ruby
<swarley> Maybe you need to just reevaluate the loop and see what memory modifications you can make
lggr has joined #ruby
<jwallace> the even loop starts an EM::Connection server, which acts as a simple proxy (fires off a request, and sends the content to the original request) - because we are behind a version of nginx that doesn't support http 1.1 proxying, we can't stream the response
kenneth has joined #ruby
<kenneth> hey there, i was wondering, can a block have a variable arity
<kenneth> like, can i do do |something, *more| …
<blazes816> yep
<jwallace> kenneth: i think in 1.9 you can
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
<swarley> By airity do you mean argument count?
<blazes816> lol
<blazes816> that's what arity means swarley
<swarley> def test_a(&block); block.arity; end
<blazes816> it's a fancy academic word
<bperry> arity is a math term
BMF has joined #ruby
<bperry> though it can be an english term as well
<bperry> verbal I suppose
<swarley> Oh variable arity
<swarley> Yes
<bperry> the amount of nouns a verb requires to make sense
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
<blazes816> i've never heard that; that's interesting
pydave6357 has joined #ruby
<bperry> I think the correct verbal term is valency
<bperry> but you can get by calling it the arity of the verb
baroquebobcat has joined #ruby
<blazes816> yeah, found that on wikipedia
<bperry> heh
<bperry> yay wikipedia
<blazes816> linked from the arty article
<bperry> heh
<blazes816> yeah, i'm a master of linguistics now that i know what valency is
ngoldman has quit [Remote host closed the connection]
bricker has quit [Ping timeout: 244 seconds]
recycle has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
robbyoconnor has joined #ruby
ngoldman has joined #ruby
ncr100 has joined #ruby
ngoldman has quit [Remote host closed the connection]
JonnieCache|work has joined #ruby
lggr has joined #ruby
syamajala has joined #ruby
diverdude has quit [Ping timeout: 248 seconds]
Kovensky has joined #ruby
recycle has quit [Ping timeout: 244 seconds]
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
jimeh2 has quit [Ping timeout: 244 seconds]
<Kovensky> any suggestions on what I might use to write an IRC bot? =p
GoGoGarrett has quit [Remote host closed the connection]
<Kovensky> http://cinchrb.org has been down for quite some time :(
<bperry> dude irc is super easy
<bperry> probably the easiest protocol you could implement
<Kovensky> well yes, but why reinvent the wheel (again)
<bperry> because it is fun and you learn things
* Kovensky has implemented IRC before, but in perl ._.
jeeky has quit [Remote host closed the connection]
<bperry> then it should be cake for you :)
baroquebobcat has quit [Quit: baroquebobcat]
<Kovensky> but but
<Kovensky> :lazy:
<bperry> laziness, impatience, and hubris are great charactersistics of programmers, per larry wall
<Kovensky> yep
<Kovensky> programmers are the ultimate lazy people
* xiphiasx_ ^5
<Kovensky> they're so lazy they make programs that do stuff for them so they can be lazier
eignerch_ has quit [Remote host closed the connection]
baroquebobcat has joined #ruby
luckyruby has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 255 seconds]
luckyruby has joined #ruby
quazimodo has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 252 seconds]
gccostabr has joined #ruby
JonnieCache|work has quit [Ping timeout: 260 seconds]
elico has joined #ruby
swarley has quit [Remote host closed the connection]
nat2610 has quit [Quit: Leaving.]
yshh has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
lggr has joined #ruby
ismaelga has joined #ruby
hesco1 has left #ruby [#ruby]
xyon has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
_nitti has joined #ruby
ianbrandt has quit [Quit: ianbrandt]
paydro has quit [Remote host closed the connection]
cbuxton has quit [Quit: Leaving.]
stephenjudkins has quit [Quit: stephenjudkins]
jwallace has quit [Quit: Leaving.]
Jellyg00se has joined #ruby
SegFaultAX|work has quit [Ping timeout: 260 seconds]
mengu has quit [Remote host closed the connection]
My_Hearing is now known as Mon_Ouie
_nitti has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
wuiqed has joined #ruby
aantix has quit [Ping timeout: 246 seconds]
binary3D has joined #ruby
shadoi has quit [Quit: Leaving.]
darule has quit [Ping timeout: 255 seconds]
robbyoconnor has quit [Read error: Connection reset by peer]
lggr has joined #ruby
Tearan has quit [Quit: Sleepy Badger....]
robbyoconnor has joined #ruby
t0rc has quit [Quit: WeeChat 0.3.9]
baroquebobcat has quit [Quit: baroquebobcat]
JoshWines has joined #ruby
ismaelga has quit [Ping timeout: 260 seconds]
notVert has joined #ruby
c0rn_ has joined #ruby
KindTwo has quit [Changing host]
KindTwo has joined #ruby
KindTwo is now known as KindOne
ismaelga has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
ereslibre has joined #ruby
bigmcq77 has quit [Quit: Computer has gone to sleep.]
bradhe has joined #ruby
ismaelga has quit [Remote host closed the connection]
carlyle has joined #ruby
lggr has joined #ruby
davidcelis has joined #ruby
SegFaultAX|work has joined #ruby
tmttt has joined #ruby
jcaudle has joined #ruby
blazes816 has quit [Quit: blazes816]
Forevernade has quit [Remote host closed the connection]
mxweas has quit [Quit: Computer has gone to sleep.]
manizzle has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
ewag has quit [Ping timeout: 255 seconds]
mrsolo has quit [Quit: Leaving]
SegFaultAX|work has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 256 seconds]
bigmcq77 has joined #ruby
JoshWines has quit [Ping timeout: 246 seconds]
seanstickle has joined #ruby
josh^ has quit [Ping timeout: 246 seconds]
oldB has joined #ruby
bradleyprice has quit [Remote host closed the connection]
xyon has left #ruby ["WeeChat 0.3.8"]
guns has quit [Read error: Connection reset by peer]
lggr has joined #ruby
ereslibre has quit [Ping timeout: 260 seconds]
josh^ has joined #ruby
dmiller has joined #ruby
JoshWines has joined #ruby
Synthead has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
Jake232 has quit [Quit: Computer has gone to sleep.]
falieson_ has joined #ruby
bricker has joined #ruby
Targen has quit [Ping timeout: 246 seconds]
Chryson has joined #ruby
c0rn_ has joined #ruby
<falieson_> http://pastie.org/4905707 using datamappper. Line 87 never happens
lggr has quit [Ping timeout: 252 seconds]
soulisson has quit [Ping timeout: 246 seconds]
falieson has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.9]
linoj has joined #ruby
falieson_ has quit [Quit: falieson_]
lggr has joined #ruby
soulisson has joined #ruby
deryl has quit [Quit: Leaving.]
ismaelga has joined #ruby
<falieson> Im still here BTW
voodoofish430 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 248 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
chrishunt has quit [Ping timeout: 260 seconds]
<Kovensky> speaking of datamapper; is there an easy way to implement expiration in it? (for use as a cache)
mahmoudimus has joined #ruby
lggr has joined #ruby
icole has quit [Remote host closed the connection]
pydave6357 has quit [Ping timeout: 240 seconds]
slicslak has quit [Ping timeout: 246 seconds]
poindontcare has joined #ruby
<poindontcare> quick question how do ensure that present directory is always on the load path so i can require files in in
<poindontcare> *it
<Kovensky> in perl you could do `use '..';`, but that's relative to the CWD instead of relative to script
<Kovensky> err, `use lib '..';`
<poindontcare> yeah i need it to be CWD relative
<Kovensky> isn't that kinda bad
<poindontcare> oh this is for irb work
lggr has quit [Ping timeout: 240 seconds]
Banistergalaxy has quit [Ping timeout: 255 seconds]
<Kovensky> `irb -I..` ? :>
mahmoudimus has quit [Quit: Computer has gone to sleep.]
falieson has quit [Ping timeout: 246 seconds]
bradleyprice has joined #ruby
gmci has quit [Ping timeout: 260 seconds]
<poindontcare> Kovensky: ah I guess i can create an alias thanks
oldB has quit [Quit: oldB]
apok has quit [Ping timeout: 244 seconds]
<poindontcare> another question for a files in my tree is require_relative preferred over require ?
brian-_ has quit [Ping timeout: 240 seconds]
<Kovensky> poindontcare: seems you can export RUBYLIB to a certain path
<Kovensky> but yeah, the envvar wouldn't really do what you want
brian- has joined #ruby
lggr has joined #ruby
falieson has joined #ruby
<poindontcare> Kovensky: yup thanks
Hanmac1 has joined #ruby
AndChat|159600 has joined #ruby
JoshWines has quit [Ping timeout: 246 seconds]
josh^ has quit [Ping timeout: 246 seconds]
alvaro_o has quit [Quit: Ex-Chat]
wuiqed has quit [Quit: Leaving]
AndChat|159600 has quit [Client Quit]
Hanmac has quit [Ping timeout: 256 seconds]
icole_ has joined #ruby
mmitchell has joined #ruby
josh^ has joined #ruby
falieson has quit [Ping timeout: 246 seconds]
_nitti has joined #ruby
icole__ has joined #ruby
JoshWines has joined #ruby
<bnagy> poindontcare: yes, require_relative is the preferred solution
dagobah has quit [Read error: Operation timed out]
lggr has quit [Ping timeout: 246 seconds]
<bnagy> some people push '.' onto the load path, but it kind of defeats the purpose of taking it out in the first place
ZubKonst has joined #ruby
ncr100 has quit [Ping timeout: 246 seconds]
Ruler_Of_Heaven_ has quit [Ping timeout: 246 seconds]
dagobah has joined #ruby
icole_ has quit [Ping timeout: 256 seconds]
ZubKonst_ has quit [Ping timeout: 252 seconds]
pipopopo has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
Axsuul has quit [Ping timeout: 240 seconds]
shadoi has joined #ruby
ebragaparah has quit [Remote host closed the connection]
FifthWall has joined #ruby
quazimodo has joined #ruby
ebragaparah has joined #ruby
dpk has joined #ruby
puff has joined #ruby
<puff> Would it be reasonable to say that block/yield basically lets you define an anonymous function (i.e. the block) which is passed to some other function as an implicit variable (i.e. not as a parameter in the function call) and invoked via yield?
mikepack has quit [Remote host closed the connection]
icole__ has quit [Read error: Connection reset by peer]
stephenjudkins has joined #ruby
nari has joined #ruby
<heftig> puff: pretty much
<puff> Okay... not disparaging it, but I guess I'm still missing what makes it so groovy.
reuf has quit [Quit: Leaving]
<puff> E.g. my reflex would be to prefer the more explicit approach.
m3pow has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0.1/20120907231657]]
Kuhni has quit [Quit: ?????]
<seanstickle> puff: then by all means do so
berserkr has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 248 seconds]
gmci has joined #ruby
gmci is now known as Guest32153
eignerchris has joined #ruby
eignerchris has quit [Remote host closed the connection]
Chryson has quit [Quit: Leaving]
hgf has joined #ruby
ekristen has quit [Quit: ekristen]
lggr has joined #ruby
<puff> seanstickle: It's not an argument, I'm just trying to see the advantages of the conventional approach.
soulisson has quit [Quit: Quitte]
soulisson has joined #ruby
wpaulson has joined #ruby
<bnagy> just read some idiomatic code
<bnagy> #each #map etc
awarner has quit [Remote host closed the connection]
<bnagy> done right you get code that's easy to read because it's all in one place and easy to chain together
<puff> Gotcha...
havenn has joined #ruby
<soulisson> when a method calls an another method of the same object is it considered a message passing from the object to itself ?
icole has joined #ruby
<puff> So could you say it basically replaces (for example) java-style iterators with a more fundamental concept that can be used to easily implement such iterators, as well as other useful things?
<bnagy> well lots of the ways they're used are 'internal' iterators, but they'll work as external ones as well
<bnagy> most of the Enumerable methods will return an Enumerator if you don't give it a block
robertotauille has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Guest32153 has quit [Ping timeout: 260 seconds]
<bnagy> there are also Fibers for 'purer' continuatiojns, but that's getting a bit off track
deadalus has joined #ruby
<bnagy> soulisson: I wouldn't consider it that way, no
<bnagy> not without seeing some evidence of what would be a very weird design
<bnagy> like you could have an object that handled a couple of threads / processes and allowed them to talk using LPC
<bnagy> but a standard method call, no, it's not
lggr has joined #ruby
dmiller has quit [Remote host closed the connection]
<soulisson> bnagy, so the message passing paradigm is only valid for different objects trying to interact with each other, if i understand correctly ?
kiyoura has quit [Quit: Leaving]
chimkan has joined #ruby
mahmoudimus has joined #ruby
<waxjar> is a method not an object as well?
<bnagy> actually LPC is a crap example
gmci_ has joined #ruby
<bnagy> I meant something like 0mq inproc transport but that wouldn't have been obvious
<bnagy> point is that 'calling a method' even on _another_ object is not message passing
<bnagy> all stuff like LPC/RPC/DRb/SOAP etc are not message passing, they're [RL]PC
<bnagy> waxjar: yeah it is, but that's irrelevant
robbyoconnor has quit [Quit: Konversation terminated!]
<bnagy> so which you could somehow contrive to implement an Actor model within one object, it would be weird and possibly dumb
notVert has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 240 seconds]
ianblenke1 has joined #ruby
deadalus has quit [Quit: Leaving]
chendo_ has quit [Ping timeout: 240 seconds]
gmci_ has quit [Ping timeout: 260 seconds]
SJrX has joined #ruby
chendo_ has joined #ruby
reset has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
gmci_ has joined #ruby
ryanf has quit [Ping timeout: 240 seconds]
falieson has joined #ruby
havenn has quit [Remote host closed the connection]
gccostabr has quit [Remote host closed the connection]
havenn has joined #ruby
codebrah has joined #ruby
<codebrah> sup rubybrahs
tmttt is now known as roadt
Cache_Money1 has joined #ruby
binary3D has quit [Ping timeout: 246 seconds]
jaylevitt has quit [Quit: jaylevitt]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<falieson> lol
<codebrah> i ben doin embedded C all day, im gonnaa learn som Ruby
<codebrah> ttyl
codebrah has quit [Client Quit]
lggr has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Ping timeout: 248 seconds]
dmiller has joined #ruby
lggr has joined #ruby
jer1ko_away is now known as jer1ko
Dreamer3 has joined #ruby
Cache_Money1 is now known as binary3d
<soulisson> bnagy, sorry about my earlier question it was vague, i was talking about message passing in the context of core oo principles
ttt has joined #ruby
binary3d has quit [Quit: Leaving]
<bnagy> soulisson: yeah, so was I
<bnagy> calling a method is not message passing
elux has joined #ruby
illogically_soun has joined #ruby
illogically_soun is now known as IllogicallySound
seanstickle has quit [Quit: seanstickle]
<IllogicallySound> I'm using Nokogiri. An invalid url returns a 404 and stops my script from running. What do I need to do to have the script move on to the next url?
<soulisson> ok, but if i quote the PixAxe Book : "The answer has to do with the way Ruby determines which method should be called when you send a message to an object"
Banistergalaxy has joined #ruby
<bnagy> soulisson: I'm not really interested in debating with random quotes taken out of context from a old book
<bnagy> IllogicallySound: rescue that exception
lggr has quit [Ping timeout: 246 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
tommyvyo has joined #ruby
cbuxton has joined #ruby
Banistergalaxy has quit [Ping timeout: 246 seconds]
F1skr has quit [Quit: WeeChat 0.3.9]
lggr has joined #ruby
parzorep has quit [Quit: parzorep]
soulisson has left #ruby ["Quitte"]
maletor has quit [Quit: Computer has gone to sleep.]
_nitti has joined #ruby
IllogicallySound has quit [Quit: Leaving]
lggr has quit [Ping timeout: 245 seconds]
nick_h has quit [Ping timeout: 240 seconds]
awarner has joined #ruby
gmci_ has quit [Ping timeout: 246 seconds]
_nitti has quit [Ping timeout: 260 seconds]
gmci has joined #ruby
minijupe has joined #ruby
lggr has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
cburyta_ has quit [Remote host closed the connection]
WanderingGlitch has quit [Ping timeout: 256 seconds]
<waxjar> couldn't you call calling a method message passing though? you send the object a message to "get me this, with these arguments". the name of the method becomes the message. that's how i always understood it, at least. i'm no CS student tho.
soulisson has joined #ruby
<bnagy> you could, but it would be wrong, because the term has a specific meaning
linoj has quit [Quit: linoj]
<bnagy> like you could call it 'computer prayers' cause like, you ask the receiver for something
<waxjar> a term can have more meanings than one.
Elico1 has joined #ruby
nick_h has joined #ruby
<waxjar> i'm just a bit puzzled because in most intros to ruby the message passing aspect of it is pointed out
<bnagy> waxjar: commonly understood terms and principles are COMMON as in the same everywhere
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<bnagy> using them wrong is not 'a point of view' it's 'wrong'
<bnagy> that quote uses 'message' in the informal, teaching people who can't code to code, sense
<waxjar> i see. i'm not trying to argue with you, i genuinely don't know :)
apok has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
c0rn_ has joined #ruby
cableray has quit [Quit: cableray]
awarner has quit [Remote host closed the connection]
ismaelga has quit [Remote host closed the connection]
rvandervort has joined #ruby
lggr has joined #ruby
Axsuul has joined #ruby
* rvandervort looks around.
rvandervort has quit [Client Quit]
WanderingGlitch has joined #ruby
WanderingGlitch has quit [Changing host]
WanderingGlitch has joined #ruby
Bosox20051 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
cbuxton has quit [Ping timeout: 240 seconds]
Bosma has joined #ruby
hgf has quit [Quit: hgf]
bradleyprice has quit [Remote host closed the connection]
joofsh has quit [Quit: Leaving]
lggr has joined #ruby
cbuxton has joined #ruby
<RubyPanther> and in the C api a Ruby method look like rb_funcall( receiver, class, rb_intern("method_aka_message_name"), n_args, arg_n, ... )
cableray has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
syamajala has quit [Remote host closed the connection]
robertotauille has quit [Quit: Leaving...]
maletor has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
icole has quit [Remote host closed the connection]
<falieson> http://pastie.org/4906067 Line59 is never executed
lggr has quit [Ping timeout: 240 seconds]
ryanf has joined #ruby
<falieson> I've been looking at this for hours, I can't see where its going wrong
cableray has quit [Quit: cableray]
dpk has quit [Quit: Asleep at the keyboard.]
<bnagy> guess policy is nil
<falieson> I have at least one Democratic,Positive,Economy in the resources table
ryanlecompte has joined #ruby
<bnagy> which of the puts statements you commented out is wrong?
lggr has joined #ruby
<falieson> one of my puts statements is wrong
<falieson> ?
<bnagy> also, testing nil? looks really weird, everyone just does if blah
raul782 has joined #ruby
<bnagy> if you uncomment those puts statements it should tell you where you have a nil in an unexpected place
ryanf has quit [Ping timeout: 245 seconds]
gmci has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby
<bnagy> wait this code is weird
<falieson> maybe I did something weird somewhere?
icole has joined #ruby
gmci has joined #ruby
iori has joined #ruby
<bnagy> ugh this is not how I would structure it at ALL :/
<falieson> haha
<bnagy> but web people seem to love these deeply nested hashes
<falieson> I've talked to 5 people, they all have had different ways of doing it
mmitchell has quit [Remote host closed the connection]
<bnagy> anyway, re-enable those puts statements, find out what's nil
sent-hil has joined #ruby
Bosma has quit [Ping timeout: 260 seconds]
<bnagy> it could also be that your line is being executed, stick a puts 'got here' above it
davidcelis has quit [Quit: K-Lined.]
ndboost has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
joeycarm_ has quit [Remote host closed the connection]
<swarles> i should make a debugging framework
<falieson> => ruby ./stats_update.rb |grep Got
<swarles> and all it does
<falieson> 0 results
mohits has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
<swarles> is randomly inject puts __FILE__ + ":" + __LINE__
tommyvyo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<swarles> randomly through your code
<swarles> like you would do if you were furiously debugging something awful that you just cant find
<rking> swarles: Why not set_trace_func ?
<swarles> "ITS BROKEN, WE NEED MORE PUTS. MORE PUTS I TELL YOU"
<swarles> because thats too main stream
<rking> Ahh. =)
<swarles> i want to break your code while i help you fix it
<falieson> bnagy: mmm, so my policy is never being matched properly
<falieson> for id=300 policy = "General/Other" but the puts has it set to 0
lggr has joined #ruby
<bnagy> falieson: oh, maybe try sentiment[item.policy]
<bnagy> on 53
<falieson> bnagy: that was probably it
<falieson> lots of Got Heres!
<falieson> yay it worked
<bnagy> so today we learned - deeply nested hashes are stupid data structures
<falieson> been trying to get this to work since yesterday morning
<bnagy> and puts debugging is teh awesomez
<falieson> well not this code, but trying to solve this problem
jer1ko is now known as jer1ko_away
JonnieCache|work has joined #ruby
<falieson> man, I completely agree
<bnagy> I would have just keyed a hash by party.product sentiment, policy
<falieson> I really liked where chrxn (offline now) was going with it last night
<falieson> but I didn't understand association well enough to do it his way
<bnagy> cause you have few enough that it's doable, and makes it super simple
<falieson> well, I'm going to be doing a few thousand a day
_nitti has joined #ruby
icole has quit [Remote host closed the connection]
<falieson> or, few enough permutations?
apok has quit [Ping timeout: 260 seconds]
<bnagy> yes
<falieson> haha, yeah
<bnagy> 2 x 3 x what? 10, 12?
<falieson> yeah, something like that
JonnieCache has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 255 seconds]
<bnagy> then you could do like results.select {|r| r.last(2)==[:terrorism, :neutral]}.inject(:+)
<bnagy> but woteva
Averna has joined #ruby
ledao has joined #ruby
jcaudle has left #ruby [#ruby]
iamjarvo has joined #ruby
Forevernade has joined #ruby
wedtm is now known as wedtm|away
elux has quit [Quit: Bye!]
_nitti has quit [Ping timeout: 256 seconds]
jcaudle has joined #ruby
jcaudle has quit [Client Quit]
lggr has joined #ruby
JonnieCache|work has quit [Ping timeout: 246 seconds]
cburyta has joined #ruby
gmci has quit [Ping timeout: 255 seconds]
rabidpraxis has quit [Remote host closed the connection]
rippa has joined #ruby
<bnagy> actually you could just have results=Hash.new {|h,k| h[k]=0} then build it as you go
<bnagy> because it wouldn't be nested anymore
BMF has quit [Remote host closed the connection]
<bnagy> so each result you just do results[ i.party, i.policy, i.sentiment]+=1
gmci has joined #ruby
<bnagy> then at the end you can get results[['GOP', 'Same Sex Marriage', 'Positive'] => 0
sent-hil has quit [Remote host closed the connection]
<falieson> nice
<falieson> heh
falieson has left #ruby [#ruby]
cburyta has quit [Ping timeout: 256 seconds]
falieson has joined #ruby
<falieson> whoops, closed wrong window
lggr has quit [Ping timeout: 244 seconds]
<falieson> ok, so now I have a table with the summary of each one
<falieson> best way to visualize the data? excel db connect or figure out some web thing?
<bnagy> nfi
<falieson> lol meneither
<falieson> my boss gave me some grief this evening for taking so long to write it all up in ruby when I could have just used excel
<bnagy> that's probably what I would have done, tbh
<bnagy> if the goal is to produce a visualisation anyway
davidcelis has joined #ruby
<falieson> I don't have all the data yet though
lggr has joined #ruby
ananthakumaran has joined #ruby
ianblenke1 has quit [Quit: Leaving.]
<falieson> hell, I only have 5% of the data
<falieson> and that's for up to friday
<falieson> haven't run an update yet
<falieson> and now I can just run updates with a cron
<bnagy> anyway, visualisation should be driven by what you're interested in, no by the data
<bnagy> as a principle
<falieson> that's true
uris has quit [Quit: Lost terminal]
<falieson> I'm not sure what's interesting about the data yet though
<falieson> heh
<bnagy> like you could scatterplot rep dem / pos neg neut per topic
<bnagy> and it would 'work'
<bnagy> but I doubt it contains anything 'informative'
<bnagy> basically it's about the questions you think people are posing
ryanf has joined #ruby
<bnagy> 'what percentage of democrats are in favour of gun control' etc
<falieson> I don't think anyone is really expecting twitter to provide informative information… not anyone with two brain cells at least
<falieson> obis its going to be wicked skewed towards dems
<falieson> *obviously
<bnagy> cause they know how to work computers?
<falieson> and are on twitter
<bnagy> because they're not 65 year old farmers?
<bnagy> I don't know much about US politics, I'm just guessin
<falieson> 18-35 is majority of twitter users, and that same is 80% independent/democrat
olrrai has quit [Quit: Saliendo]
<falieson> and yeah, not 65yo beat and pumpkin farmers
<bnagy> I'd like to know what tweeting repubs feel about issues vs mainstream repubs
<falieson> yeah, i think that the data is going to be interesting in an anecdotal way
<falieson> especially with plots over time
<falieson> and I haven't come across anyone else with this data
lggr has quit [Ping timeout: 248 seconds]
<bnagy> anyway, all I'm saying is start with the questions, and that naturally leads you to the visualisation
dakine has quit [Read error: Connection reset by peer]
elux has joined #ruby
dakine has joined #ruby
<bnagy> right I need to do some work
ryanlecompte has quit [Remote host closed the connection]
<falieson> yeah, thanks for the help man
lggr has joined #ruby
starship has quit [Read error: Connection reset by peer]
<falieson> not super interesting, but at least a basis
starship has joined #ruby
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
jer1ko_away is now known as jer1ko
g0bl1n has quit [Read error: Connection reset by peer]
jer1ko has quit [Remote host closed the connection]
jer1ko has joined #ruby
chrxn has joined #ruby
cbuxton has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 246 seconds]
ndboost has quit [Remote host closed the connection]
steffes has joined #ruby
cbuxton has joined #ruby
lggr has joined #ruby
manizzle has quit [Ping timeout: 244 seconds]
steffes has quit [Remote host closed the connection]
macmartine has joined #ruby
mahmoudimus has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
rakunHo has joined #ruby
lggr has joined #ruby
icole has joined #ruby
cbuxton has quit [Read error: Connection reset by peer]
crankycoder has quit [Remote host closed the connection]
icole has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
elux has quit [Quit: Leaving...]
lggr has joined #ruby
cbuxton has joined #ruby
moshee has quit [Ping timeout: 255 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
manizzle has joined #ruby
ada2358_ is now known as adamblackwell
mercwithamouth has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
g0bl1n has joined #ruby
_nitti has joined #ruby
mmitchell has joined #ruby
lggr has joined #ruby
ryanlecompte has joined #ruby
love_color_text_ has quit [Remote host closed the connection]
_nitti has quit [Ping timeout: 246 seconds]
mmitchell has quit [Ping timeout: 246 seconds]
ananthakumaran has quit [Quit: Leaving.]
keyvan has joined #ruby
mercwithamouth has joined #ruby
icole has joined #ruby
elico has quit [Quit: elico]
lggr has quit [Ping timeout: 260 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
keyvan has quit [Remote host closed the connection]
carlyle has quit [Remote host closed the connection]
lggr has joined #ruby
Elico1 has quit [Quit: Elico1]
fredjean has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
dmiller has quit [Remote host closed the connection]
lggr has joined #ruby
ChampS666 has joined #ruby
sweet_kid has quit [Ping timeout: 260 seconds]
KindOne has quit [Ping timeout: 255 seconds]
bradleyprice has joined #ruby
elico has joined #ruby
raul782 has quit [Remote host closed the connection]
tekacs has quit [Ping timeout: 268 seconds]
quest88 has joined #ruby
AlbireoX`Laptop has joined #ruby
xuser has quit [Ping timeout: 245 seconds]
hoelzro|away has quit [Ping timeout: 260 seconds]
hoelzro|away has joined #ruby
Eplemosen has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
xuser has joined #ruby
tekacs has joined #ruby
KindOne has joined #ruby
changedNicks has joined #ruby
AlbireoX has quit [Ping timeout: 248 seconds]
g0bl1n has quit [Quit: Ex-Chat]
lggr has joined #ruby
macmartine has quit [Read error: Connection reset by peer]
Eplemosen has quit [Client Quit]
minijupe has quit [Quit: minijupe]
tagrudev has joined #ruby
fyolnish has joined #ruby
AlbireoX`Laptop has quit [Ping timeout: 256 seconds]
ananthakumaran has joined #ruby
macmartine has joined #ruby
jameshyde has joined #ruby
swarles has quit [Read error: Operation timed out]
lggr has quit [Ping timeout: 244 seconds]
n_blownapart has joined #ruby
lggr has joined #ruby
carlyle has joined #ruby
<roadt> hi, does T_ICLASS macro in ruby mean 'internal class'?
jrist is now known as jrist-afk
aces23up has quit [Remote host closed the connection]
aces1up has joined #ruby
<n_blownapart> hi. interested to know about the second argument here, '\1 \1' . Is this code for the global variable $1 outputted from a capture? thanks: http://pastie.org/4906423
slicslak has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
khakimov has joined #ruby
n_blownapart has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
reset has joined #ruby
n_blownapart has joined #ruby
<ryanf> it's specific to gsub, but it's the same idea, yeah
<ryanf> you can't use $1 because the order of evaluation would be wrong
KindOne has quit [Changing host]
KindOne has joined #ruby
dmiller has joined #ruby
<rking> n_blownapart: Note that '\1' comes out as "\\1". The backslash is a literal, interpreted specially by the gsub
minijupe has joined #ruby
carlyle has quit [Ping timeout: 245 seconds]
bradleyprice has quit [Remote host closed the connection]
lggr has joined #ruby
otters has quit [Ping timeout: 248 seconds]
slicslak has quit [Ping timeout: 240 seconds]
<n_blownapart> ryanf: rking: not sure I understand. the (\w+) "captures" and ascribes the capture to a global variable, right?
<ryanf> that is a side effect of the regex match
<n_blownapart> but there is only one capture for the entire string (4 words) ^^
<n_blownapart> ryanf: rking i.e. when I do puts $1 it returns 'here'
<rking> n_blownapart: What's your question?
<roadt> n_blownapart, 4 captures actually. final one is that 'here'.
colinbm has joined #ruby
stephenjudkins has joined #ruby
<Paradox> heh
<Paradox> i just wrote a ruby irc server in eventmachine
JC_SoCal has quit [Quit: Connection closed for inactivity]
<n_blownapart> thanks roadt rking ryanf one second baffled here
<Paradox> that ALSO has built in websockets
* rking congratulates the /^r.{4}$/ posse.
<n_blownapart> thing is roadt if I enter puts $2 I get nil
dmiller has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 260 seconds]
zigomir has joined #ruby
arturaz has joined #ruby
JonnieCache has joined #ruby
<n_blownapart> wait rking is that the regex for rking roadt and ryanf or am I tripping?
chrishunt has joined #ruby
starship has quit [Ping timeout: 246 seconds]
<roadt> n_blownapart, yeah, since you regex is '\b(\w+)', note that has only one capture.
<rking> n_blownapart: Yeah, sorry.
_nitti has joined #ruby
<n_blownapart> rking brilliant that is cool
lggr has joined #ruby
c0rn_ has joined #ruby
<n_blownapart> roadt: thanks will ponder the '\1 \1' bit
<roadt> n_blownapart, ["double every word here.".gsub(/\b(\w+) (\w+)/, "\\1 \\2") ,$1, $2]
colinbm has quit [Quit: colinbm]
<roadt> btw, does channel have evalbot ?
<n_blownapart> roadt looks cool will try it
<rking> >>> "there was an evalbot. Do we still have him around?"
<rking> Hrm
sarmiena_ has joined #ruby
<rking> jrajav had it.
<ryanf> >> "I thought it was two >>s"
<sarmiena_> I would like to store a lambda in a class constant, then use it to call an instance method
_nitti has quit [Ping timeout: 246 seconds]
haxrbyte has joined #ruby
<sarmiena_> however, defining the lambda at the class level doesn't allow me to call instance methods. how do i change the binding?
<roadt> ok, i can see..
<rking> ryanf: Yep, you're right.
fortysixandtwo has quit [Quit: fortysixandtwo]
vitor-br has quit [Ping timeout: 260 seconds]
<roadt> n_blownapart, it didn't nothing, just show the point. $n is mapped to the regx's capture syntax (i.e. parenthesis).
<roadt> s/ it didn't nothing/it did nothing/
lggr has quit [Ping timeout: 245 seconds]
monkegjinni has joined #ruby
<n_blownapart> roadt I'm a bit confused but working on it. why the brackets?
<sarmiena_> this is what i would like to achieve: http://pastie.org/4906488
quest88 has quit [Quit: quest88]
<sarmiena_> but obviously the block's binding is set to the class, not the instance of the class
cburyta has joined #ruby
haxrbyte has quit [Remote host closed the connection]
lggr has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
haxrbyte has joined #ruby
cburyta has quit [Ping timeout: 246 seconds]
<roadt> sarmiena_, how can you call a instance method without any created instance , i mean, thru that class constant you defined..
arturaz has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 246 seconds]
<sarmiena_> roadt: hmmm well the method isn't defined at the class level. but it is at the instance
<n_blownapart> roadt: I still don't see why the capture is mapped from the right side (i.e. why is double and every in the $1 and $2 place?)
<n_blownapart> why are they not* in the $1 and $2 places? ^^
ryanlecompte has quit [Remote host closed the connection]
maesbn has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
<roadt> sarmiena_, then how you call lambda FOO? i mean Foo.FOO this is constant without any given instance.
<sarmiena_> roadt: Foo.new.call_foo
ForevernadeAFK has joined #ruby
<sarmiena_> roadt: as per the pastie
vitor-br has joined #ruby
<roadt> sarmiena_, sorry. hmm..
Liquid_X has joined #ruby
lggr has joined #ruby
<sarmiena_> roadt: it was suggested that i pass in the current instance to the lambda. which definitely solves the problem
<sarmiena_> however, i thought there was a snazzy way to change a binding for a proc/lambda
falieson has quit [Quit: you're awesome!]
Mon_Ouie has quit [Ping timeout: 260 seconds]
HashNuke has joined #ruby
<HashNuke> hey guys.
Forevernade has quit [Ping timeout: 244 seconds]
<HashNuke> I'm trying to port a C library to Ruby. I found this line ((void)(x)). What does that do? set x to nil or unset the var?
maletor has joined #ruby
<roadt> sarmiena_, seems lambda 's self is binded to class object. so.. don't see better way yet. unless context of lambda can be altered in someway .
seoaqua has joined #ruby
<sarmiena_> roadt: yeah that's what i thought ruby allowed you to do. not that i wanted to necessarily do it. was more curious
<roadt> n_blownapart, i'm not quite sture where you are stuck. '\b(\w+) (\w+)' have two brackets, 1st () gives $1, 2nd () gives $2. it is quite straightforward from my point of view.
lggr has quit [Ping timeout: 256 seconds]
dmiller has joined #ruby
<ryanf> sarmiena_: yes, instance_eval
<ryanf> would also solve your problem
<sarmiena_> ryanf: i tried that, didn't seem to work
aganov has joined #ruby
<roadt> ryanf, instance_eval 's receiver is still undeterimined in class body.
<ryanf> did you change your pastie?
<sarmiena_> ryanf: yeah. crap :O i can remake it for the sake of conversation, if you'd like
<sarmiena_> sec
lggr has joined #ruby
<n_blownapart> roadt sorry but why are the 3rd and 4th words of the string getting captured, and not the 1st and 2nd words: 'double' 'every'
cbuxton has quit [Quit: Leaving.]
<n_blownapart> I added your example here: http://pastie.org/4906423 ^^
<roadt> n_blownapart, because gsub do capture twice. 1st $1=double, $2=every, 2nd, $1=word, $2=here.
<roadt> n_blownapart, and $1, $2 only can store the 2nd value..
love_color_text has quit [Remote host closed the connection]
<sarmiena_> ryanf: http://pastie.org/4906488
love_color_text has joined #ruby
dmiller has quit [Ping timeout: 248 seconds]
Spooner has quit [Ping timeout: 260 seconds]
havenn has quit [Remote host closed the connection]
burgestrand has quit [Quit: Leaving.]
<sarmiena_> ryanf: innnnteresting. instance_exec, eh? interesting syntax too. arguments first, then block
<sarmiena_> just like a method
<ryanf> it is a method
<ryanf> instance_eval is also a method
<ryanf> eval is also a method
<ryanf> etc
<n_blownapart> roadt thanks I guess its a strange quirk that needs to be memorized. many thanks
arturaz has joined #ruby
ryanlecompte has joined #ruby
chendo_ has quit [Ping timeout: 240 seconds]
diverdude has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<roadt> n_blownapart, yeah, the point gsub is global substitution, it will search many times to replace every matched items. so $1 $2 have to show values of final match.
<sarmiena_> ryanf: so should instance_eval work here, too?
<ryanf> instance_eval would work fine except that you can't pass parameters into the block
<ryanf> that's why you need instance_exec in this case
<sarmiena_> ahhh i see
chendo_ has joined #ruby
ChampS666 has quit [Ping timeout: 255 seconds]
<sarmiena_> thanks for the info. <3 metaprogramming
<n_blownapart> roadt: got it that helps a lot. thank you
<roadt> n_blownapart, np.
bartj3 has joined #ruby
FifthWall has quit [Quit: Zzzzzzzzzzzzz]
lggr has joined #ruby
<roadt> instance_exec ,cool.
iamjarvo has quit [Ping timeout: 240 seconds]
mahmoudimus has joined #ruby
ChampS666 has joined #ruby
_mak has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
awestroke has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
n_blownapart has quit [Remote host closed the connection]
workmad3 has joined #ruby
bricker has quit [Quit: leaving]
lggr has joined #ruby
chendo_ has quit [Ping timeout: 244 seconds]
amskah has joined #ruby
amskah has quit [Client Quit]
margle has joined #ruby
chendo_ has joined #ruby
love_color_text has quit [Remote host closed the connection]
sspiff has joined #ruby
sspiff has joined #ruby
ryanf has quit [Quit: leaving]
ryanlecompte has quit [Remote host closed the connection]
love_color_text has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
zommi has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
verto|off is now known as verto
ForevernadeAFK is now known as Forevernade
lggr has joined #ruby
havenn has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
oz has quit [Ping timeout: 268 seconds]
havenn has quit [Ping timeout: 246 seconds]
_nitti has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
rubious has quit [Quit: Leaving...]
fortysixandtwo has joined #ruby
zii has quit [Read error: Connection reset by peer]
c0rn_ has quit []
_nitti has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
cezar has joined #ruby
cburyta has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
workmad3 has joined #ruby
_TB_ has joined #ruby
khakimov has joined #ruby
havenn has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 256 seconds]
JonnieCache|work has joined #ruby
cburyta has quit [Ping timeout: 240 seconds]
verto is now known as verto|off
stephenjudkins has quit [Quit: stephenjudkins]
senny has joined #ruby
lggr has joined #ruby
minijupe has quit [Quit: minijupe]
luckyruby has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
daniels` has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
eubide has joined #ruby
piotr_ has joined #ruby
dhruvasagar has joined #ruby
maletor has joined #ruby
luckyruby has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
bartj3 has quit []
Virunga has joined #ruby
Virunga has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
ryanf has joined #ruby
heftig has quit [Quit: leaving]
bartj3 has joined #ruby
lggr has joined #ruby
elico has quit [Quit: Elico]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
elsifaka has joined #ruby
dr_bob has joined #ruby
_bart has quit [Ping timeout: 260 seconds]
xorgnak has joined #ruby
Morkel has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
luckyruby has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
eubide has quit [Quit: Leaving]
lggr has quit [Ping timeout: 260 seconds]
leehambley has joined #ruby
fortysixandtwo_ has joined #ruby
maletor has joined #ruby
hoelzro|away is now known as hoelzro
und3f has joined #ruby
chimay has joined #ruby
leehambley has quit [Client Quit]
Banistergalaxy has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
xorgnak has quit [Remote host closed the connection]
fortysixandtwo has quit [Ping timeout: 256 seconds]
xorgnak has joined #ruby
fortysixandtwo_ has quit [Ping timeout: 240 seconds]
awestroke has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
fixl has joined #ruby
xorgnak has joined #ruby
Bosox20051 has quit [Remote host closed the connection]
Hamed-R has joined #ruby
xorgnak has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 245 seconds]
xorgnak has joined #ruby
<shevy> let's make ruby overtake perl on TIOBE
parzorep has joined #ruby
JonnieCache|work has quit [Ping timeout: 248 seconds]
<A124> Visual Basic.. wtf.
lggr has joined #ruby
awestroke has joined #ruby
<rking> I couldn't care less about things like TIOBE rankings.
alem0lars has joined #ruby
<rking> Just look at the garbage that ranks high.
moshee has quit [Ping timeout: 246 seconds]
<hoelzro> +1
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<hoelzro> TIOBE is full of crap
<rking> I don't know how they do their polling, but whatever it is it really isn't a measurement of what languages are worth knowing.
xorgnak has quit [Remote host closed the connection]
prtksxna has joined #ruby
Elhu has joined #ruby
fortysixandtwo has joined #ruby
fortysixandtwo has quit [Read error: Connection reset by peer]
fortysixandtwo has joined #ruby
bluOxigen has joined #ruby
<ryanf> I think it has to do with like google counts
jameshyde has quit [Remote host closed the connection]
<ryanf> I forget, it is really dumb though
jimeh2 has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<hoelzro> it uses search terms and such
ChampS666 has quit [Ping timeout: 240 seconds]
<A124> It's only TIOBE related, nothing more.
quazimodo has quit [Ping timeout: 244 seconds]
flype has joined #ruby
lggr has joined #ruby
colinbm has joined #ruby
Banistergalaxy has joined #ruby
<shevy> but it's the best we got!
<shevy> second best is to count how many folks are in #ruby
<shevy> then compare this to #perl and #python
<shevy> the numbers there right now absolutely reflect the TIOBE ranking :(
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<A124> Heh.
<shevy> #ruby 627, #perl 634, damn #python 986
<shevy> I don't know why python has so many more
<jokar> shevy: hi
DrWhax has quit [Ping timeout: 264 seconds]
<jokar> how are you?
<shevy> hi jokar
<jokar> :)
<shevy> dunno, thinking about what to add
<shevy> to a shell
Banistergalaxy has quit [Remote host closed the connection]
<hoelzro> shevy: #python is always really busy when I'm in there
lggr has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
<shevy> damn snakes
<shevy> I wanna smoke em out
_nitti has joined #ruby
lggr has joined #ruby
<hoelzro> why does it matter?
<hoelzro> some people happen to prefer Python, some happen to prefer Perl
<hoelzro> who cares what language they prefer?
<shevy> a language with a lot momentum behind will become better
<hoelzro> so as long as the Ruby community isn't stagnating, isn't that ok?
<shevy> the language Io had some momentum ~4 years ago, now it's kinda dead
<hoelzro> keep in mind: it's still ok to steal ideas from other communities =)
<jokar> shevy : i want send an email for you
<shevy> I dunno, rails changed a lot
fortysixandtwo_ has joined #ruby
<hoelzro> meh, I wouldn't say Io had that much momentum...
_nitti has quit [Ping timeout: 246 seconds]
<shevy> I mean, the rails community is not the same as the ruby community. there are partial overlaps
<shevy> hehe
<shevy> well it had around 50 people on #io :)
<shevy> #gobolinux is funny, about 10-15 people on it although it is kinda dead. it's now more chatter about the good old days...
<shevy> Title: "How Gobolinux failed to change the world."
<hoelzro> I thought gobo was a cool idea
skogis has joined #ruby
Jork1 has joined #ruby
<shevy> yeah
<jokar> shevy: is it OK?
<shevy> but it stagnated when the main developers started to work full time
fortysixandtwo__ has joined #ruby
fortysixandtwo_ has quit [Read error: Connection reset by peer]
<shevy> jokar I'll read my mail only at late evening
fortysixandtwo has quit [Read error: Connection reset by peer]
fortysixandtwo__ is now known as fortysixandtwo
<shevy> jokar you can write but I won't reply until it is late here
<jokar> shevy :OK
<hoelzro> shevy: that happens a lot =)
<shevy> yeah :(
<hoelzro> I worked on an RPG for two years...then I got a job.
<hoelzro> and a girlfriend.
_bart has joined #ruby
<hoelzro> double anti-development whammy.
<_bart> hi
<hoelzro> although I'm happy to have both ;)
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
d3vic3 has joined #ruby
<shevy> what
<shevy> you first got the job, then the girl?
<hoelzro> yes
sarmiena_ has quit [Quit: sarmiena_]
<shevy> pffft
<shevy> women... always looking for men with jobs!
<hoelzro> haha
<shevy> about RPGs, I think that takes a LOT of time to develop and maintain
<hoelzro> oh my yes
<_bart> so I have two nokogiri documents, one has only the structure of the document and all the //text() removed, and one is just the original document parsed, now I'm looping through all levels using /*/*/*…etc on the second (original) document, but from time to time I want to check the structure of the element/node I'm currently on, which is in the other document? How do I loop through both the same time to keep track of the exact position of the node in
<_bart> both documents or is there another way?
<hoelzro> I made a *lot* of bad decisions in developing it
<hoelzro> doing it in C++, doing it as a 3D game...
<_bart> (be causing removing all the //text() on every single node separately is a performance-killer)
<shevy> I once had an idea to use our own custom RPG, with the fantasy world we did (for almost 20 years by now, it has a lot of details), to also use a 3D world model of it and create a MUD... but it is way way way too much work for me
<_bart> because*
<hoelzro> my eyes were bigger than my stomach
<shevy> hah I made bad decisions too, I rewrote it twice, then abandoned it
Xeago has quit [Remote host closed the connection]
<shevy> but slowly I am beginning to believe that the only way to build something big is to focus on the smallest possible step first and advance from there
<hoelzro> it was fun to work on though =)
<shevy> _bart still clinging to XML?
lggr has joined #ruby
<_bart> shevy: yes, this is quite a big project
<shevy> _bart I can tell you, abandoning XML made my life better :)
<shevy> ewww
<hoelzro> it's still the largest piece of code I've ever written not for work, and I learned a lot in the process
<shevy> sounds as if you will need a lot of XML
<shevy> I think PHP got me into XML back then, when I iterated through the XML nodes
<_bart> shevy: refactoring some parts too now, because I was lazy on the TDD and some bad decisions.
<shevy> hoelzro, did you turn it into a gem? :)
<_bart> shevy: but hey, I'm close to a perfect project now, but I only have to speed up the performance.
<hoelzro> shevy: it was written in C++ and Lua =)
<shevy> _bart, hehe
<shevy> perfection is hard to reach
<shevy> I try to go for 80% "perfection" usually
Hanmac has joined #ruby
Hanmac1 has quit [Ping timeout: 246 seconds]
<_bart> shevy: let's say I'm in a random /*/*/*/* fourth level node, now how do I get the .inner_html of that node from the other document?
<shevy> hmm
<_bart> shevy: or should I just loop through both at the same time to never lose track
<shevy> I usually write down things like that for my local knowledge-base
<shevy> but I used REXML back then
<shevy> nokogiri did not work for me
<_bart> ah wait I think I already got it
daniels` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
DrWhax has joined #ruby
<shevy> does this not use .each ??
<_bart> just talking about things helps
<_bart> maximum.times do |i|
<_bart> so I can just use the index on both documents, silly me
josh^ has quit [Ping timeout: 240 seconds]
JoshWines has quit [Ping timeout: 240 seconds]
manizzle has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 255 seconds]
josh^ has joined #ruby
JoshWines has joined #ruby
elaptics`away is now known as elaptics
lggr has joined #ruby
triptec has quit [Quit: triptec]
Vainoharhainen has joined #ruby
ephemerian has joined #ruby
wallerdev has quit [Quit: wallerdev]
parzorep has quit [Quit: parzorep]
Zai_ has joined #ruby
ryanf has quit [Quit: leaving]
Rochefort has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
monkegjinni has quit [Remote host closed the connection]
thanpolas has joined #ruby
manizzle has joined #ruby
<thanpolas> need some help with exceptions handling: http://pastebin.com/pYsn46NT
<hoelzro> thanpolas: what kind of error gets raised in that situation?
morozovm has joined #ruby
leehambley has joined #ruby
lggr has joined #ruby
<thanpolas> `read': unable to open file `v….` @ error/png.c/ReadPNGImage/3665 (Magick::ImageMagickError)
Hanmac has quit [Remote host closed the connection]
pskosinski has joined #ruby
burgestrand has joined #ruby
timmow has joined #ruby
Iszak has joined #ruby
parzorep has joined #ruby
tvw has joined #ruby
Xeago has joined #ruby
maasha has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
frogstarr78 has quit [Ping timeout: 256 seconds]
slava_dp has joined #ruby
slava_dp has joined #ruby
<slava_dp> hey people. is there a way to trace script execution in the manner of ''bash -x'' ?
havenn has joined #ruby
<thanpolas> hoelzpro got it, it wanted "rescue Exception => bang" instead of "SystemCallError"
<slava_dp> or I could use loading file in irb with on-screen immediate execution. do you know a way?
<maasha> I need something explained here. (0...n).each { |i| } is a slower way of iterating than a for loop because the first way is allocating an array?
frogstarr78 has joined #ruby
<hoelzro> maasha: no array is allocated for that expression
<hoelzro> 0...n is a Range object
* maasha cant find ruby book - suspect it is being used as support for the projector in the meeting room.
<hoelzro> which is a lightweight enumerable
lggr has joined #ruby
workmad3 has joined #ruby
JonnieCache|work has joined #ruby
jokar has quit [Read error: Connection reset by peer]
icole has quit [Remote host closed the connection]
ephemerian has quit [Quit: Leaving.]
<slava_dp> I found a way. irb < script.rb
havenn has quit [Ping timeout: 244 seconds]
leehambley has quit [Quit: leehambley]
claymore has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<claymore> is gem supposed to be run as root?
<hoelzro> claymore: it doesn't need to be
<claymore> I'm trying to install rspec on opensuse 12.2, but running "gem install rspec" throws up "You don't have write permissions into the /usr/lib/ruby/gems/1.9.1 directory"
catphish has joined #ruby
<claymore> running as root, it just hangs
<claymore> there's an rspec package available, but I should surely be able to install it through gem... hmm
lggr has joined #ruby
timmow has quit [Quit: has left the building]
<maasha> hoelzro: someone must be telling me lies. Benchmark shows that the range.each is a tad faster than a regular for loop.
timmow has joined #ruby
<hoelzro> maasha: what does your for loop look like?
<hoelzro> also, the compiler may optimize range.each because it's so common
<maasha> hoelzro: http://pastie.org/4906996
baphled has joined #ruby
<catphish> seems to me range.each would be heavily optimized
justinmcp has quit [Remote host closed the connection]
<hoelzro> maasha: I wonder if the for loop implicitly converts the range?
<catphish> that really should be the same
<catphish> but does it really matter?
<catphish> both should be incredibly fast
<hoelzro> they should, yes
<Xeago> tbh, that for loop uses a range, for good comparison, it should use classic c style
<maasha> yes, it is clearly not a place for optimerisation.
<JonnieCache|work> shall we have a collection to buy ruby-lang.org some better hosting
quazimodo has joined #ruby
<Xeago> JonnieCache|work: what's wrong with ruby-lang.org?
<catphish> it's slow
<maasha> Xeago: can you do classic c loops in ruby... why I never new.
Rochefortes has joined #ruby
<catphish> downloads from it have always been slow for me
<catphish> but today the site is crazy slow
<Xeago> that's why there's mirrors..
<catphish> they're not very obvious
<JonnieCache|work> between us we must be able to afford the s3 bill or whatever so we can download the tarballs at more than 70 kb/s
<JonnieCache|work> rvm etc dont know about the mirros
<catphish> if there's mirrors i've never found them
<maasha> Xeago: what is the syntax for a C style loop in ruby?
<catphish> who hosts it?
<JonnieCache|work> its all mirrored on github. maybe theres an easy way to point rvm there?
kryl99_ has joined #ruby
<maasha> Xeago: C style for loop even :o)
chussenot has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<catphish> does anyone know why this happens:
<catphish> "\250".force_encoding('BINARY').encode('ASCII', :invalid => :replace)
<Xeago> maasha: it is a while :3
<catphish> Encoding::UndefinedConversionError: "\xA8" from ASCII-8BIT to UTF-8
<Xeago> tho, you should use n.times
<catphish> oh, maybe forcing the encoding to ascii initially will make the :invalid check work
<maasha> ok
<catphish> since nothing is invalid in binary
Rochefort has quit [Ping timeout: 246 seconds]
<maasha> hm while loop is 4x faster
<Xeago> either use while (condition) { } or n.times {|i| }
margle has joined #ruby
<catphish> n.times seems the best way
<Xeago> while loop does not have a range, or enumerator
_nitti has joined #ruby
<Xeago> how is n.times?
lggr has joined #ruby
<catphish> n.times is so easy to optimize, i can't imagine they've done it wronf
<catphish> *wrong
margle has quit [Client Quit]
<catphish> n.times needs an enum though, so may be slower than a c-style while loop
<catphish> as Xeago says
<roadt> tried here. don't see big difference between range and for..
<maasha> n.times is slow as well
<Xeago> however, catphish n.times has a set amount of executions, could be unrolled
<Xeago> maasha: mind pasting test code?
preller_ has quit [Quit: leaving]
m_3_ has quit [Ping timeout: 240 seconds]
_nitti has quit [Ping timeout: 246 seconds]
preller has joined #ruby
preller has quit [Changing host]
preller has joined #ruby
<roadt> for > n.times > range . here. *shrug*
<JonnieCache|work> hmmm there is `rvm tools mirror` which sets it to point at mirrorservice
m_3 has joined #ruby
<JonnieCache|work> but the urls it points to are broken :(
lkba has quit [Ping timeout: 260 seconds]
<catphish> Xeago: true, as i said, i would expect n.times to be very well optimized
<catphish> it could trivially be converted to a c-style while loop by the interpreter
<catphish> but that's way further inside ruby than i understand
jimeh2 has quit [Read error: Connection reset by peer]
jimeh2 has joined #ruby
ephemerian has joined #ruby
<maasha> catphish: but the n.times is slower than a while loop x4
<clocKwize> Morning
Synthead has quit [Quit: p33 ba115]
lorn has quit [Ping timeout: 256 seconds]
parzorep has quit [Quit: parzorep]
kryl99_ has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
lggr has quit [Ping timeout: 244 seconds]
<catphish> oh ok
<catphish> weird
<claymore> why might gem not have write permissions?
<catphish> but does this matter?
<Xeago> infair comparison tbh, n.times does stuff in body
lorn has joined #ruby
<Xeago> only the while one should increment
<Xeago> no reason for .times to increment
<maasha> catphish: well, obviously you can speed up a script x4
<catphish> oh yeah, you run extra code in n.times
<catphish> that's hardly fair
<maasha> Xeago: I do need an index
<catphish> maasha: no, you can speed up a script that does *nothing* x4
<catphish> but why would you?
<catphish> maasha: n.times do |n|
<catphish> the index is available
cburyta has joined #ruby
<maasha> x4 speedup is significant for some heavy duty stuff. the difference between waiting 15 min or an hour.
<catphish> n.times do {|i|}
<catphish> maasha: no
<catphish> maasha: you are only getting x4 on a script that *does nothing*
<Xeago> maasha: the loop overhead is insignificant to the body
<catphish> what's the advantage
beiter has joined #ruby
<catphish> also, try n.times do {|i|} for a fair comparison
lggr has joined #ruby
<catphish> since this is a huge pointless overhead: { i = 1; (n - 1).times { i += 1 } }
dangerousdave has joined #ruby
<maasha> n.times do {|i|} gives a slight improvement, but the while loop is still 3x faster
Hanmac has joined #ruby
<Xeago> how to read the results, real is in seconds?
<Xeago> for me, while is slowest..
<catphish> i'm running it myself
<Xeago> (with times {|o|)
<catphish> for me, while is much faster than the others
<Xeago> Range 10.930000 0.030000 10.960000 ( 11.108404)
<Xeago> For 7.570000 0.020000 7.590000 ( 7.660665)
<Xeago> While 30.080000 0.060000 30.140000 ( 30.342705)
<Xeago> Times 9.710000 0.020000 9.730000 ( 9.846316)
<catphish> what ruby?
<catphish> Range 7.260000 0.000000 7.260000 ( 7.263608)
<catphish> For 7.930000 0.000000 7.930000 ( 7.925880)
<catphish> While 2.970000 0.000000 2.970000 ( 2.972253)
<catphish> Times 7.450000 0.000000 7.450000 ( 7.449322)
<Xeago> 1.8.7
<catphish> oh.
cburyta has quit [Ping timeout: 246 seconds]
<Xeago> regardless
<catphish> well i'm using 1.9.3
<Muz> That's not a ruby interpreter, that's an old joke taken too far.
awestroke has quit [Remote host closed the connection]
<Muz> 1.8.7 that is. ¬_¬
<catphish> indeed
<catphish> ok, so while is faster
<Xeago> these differences are so negligible, add worthy body content or stop doing benchmakrs
<catphish> not *that* surprising
<maasha> Ruby 1.9 ...
<catphish> the others need to make an enum
awestroke has joined #ruby
icole has joined #ruby
<catphish> but still, totally irrelevant
<catphish> even if you're iterating 100 million times, it only makes 5 seconds difference!
<Xeago> and then add body contents
<Hanmac> ruby1.8.7 is allready undead ... only the bury takes time ...
<Xeago> 5 seconds on 5 hours
<roadt> while is the fastest. because it does't have iterator/block switch..
<Xeago> what would happen if there was a leap second in there
<maasha> scientific computing calls for a lot of iterations...
<catphish> Xeago: on linux the whole box would crash :)
<Xeago> catphish: depending on version
<catphish> maasha: i'm not buying it
<Xeago> and presence of ntp
<catphish> Xeago: indeed, took down my whole network
<Xeago> maasha: loop overhead is negligeble
<Xeago> I heard it the day the leap second was occurring
<Xeago> managed to save half my cluster
berserkr has joined #ruby
<Xeago> don't have a thing that runs stuff over all boxes
lggr has quit [Ping timeout: 246 seconds]
<catphish> i'm in the UK, got hit 5 hours before anyone in the US :(
<catphish> i don't know why
<Xeago> timezone?
<catphish> since leap seconds are UTC
<catphish> but it seemed to happen to different people at different times
<Xeago> they are utc, but they get applied timezone specific
<catphish> oh ok
<catphish> i was probably UTC+0 at the time
<Xeago> did you read the buggy code catphish?
<catphish> Xeago: no
<Xeago> you should :)
<Xeago> it starts making more sens
<Xeago> there's a good article on serverfault
<catphish> i was too busy rebooting everything in my cluster
<Xeago> date -s now did my trick
<Xeago> ssh connections were slow tho
parzorep has joined #ruby
<catphish> everything was slow, all processes were reporting 100% cpu usage
lggr has joined #ruby
<catphish> the date workaround wasnt widely known when mine went down
<catphish> and i only had a few minutes to fix it
samphippen has joined #ruby
charliesome has joined #ruby
<Xeago> I knew it from some years ago, when my desktop crashed
icole has quit [Ping timeout: 260 seconds]
samphippen has quit [Ping timeout: 246 seconds]
<_bart> how is this invalid ruby: collection.match(filter).to_s.length if (filter.class.to_s == 'Regexp')
<_bart> `to_s': wrong number of arguments(1 for 0) (ArgumentError)
jenrzzz has joined #ruby
fortysixandtwo has quit [Quit: fortysixandtwo]
leehambley has joined #ruby
<Hanmac> _bart show me more of your code
cascalheira has joined #ruby
<_bart> ah I was looking at the wrong line :<
lggr has quit [Ping timeout: 246 seconds]
<Hanmac> PS: Regexp === filter
ABK has joined #ruby
samphippen has joined #ruby
parzorep has quit [Quit: parzorep]
indel has joined #ruby
Rochefortes has quit [Remote host closed the connection]
lggr has joined #ruby
quazimodo has quit [Remote host closed the connection]
quazimodo has joined #ruby
maasha has quit [Quit: Page closed]
Criztian has joined #ruby
iCEAGE has joined #ruby
Criztian has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 240 seconds]
Hamed-R has quit [Ping timeout: 246 seconds]
daniel_- has joined #ruby
elico has joined #ruby
claymore has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
Russell^^ has joined #ruby
nari has quit [Ping timeout: 245 seconds]
<JonnieCache|work> oooh travis ci is getting more and more integrated with github
lggr has quit [Ping timeout: 260 seconds]
<JonnieCache|work> i sent a pull request to rvm and now on the pull request screen it links me to the travis ci test run progress for my commit
<JonnieCache|work> living in the future
<Xeago> they've been having uptime issue's lately, thanks to github :(
<JonnieCache|work> booo
<Xeago> tho their service is lovely
<JonnieCache|work> ill have to see if i can pursuade the new work to sponsor a worker :)
Trioke has quit [Ping timeout: 252 seconds]
<pskosinski> Anyone knows if Webby has an IRC channel...?
<Xeago> you should
lggr has joined #ruby
claymore has joined #ruby
<Xeago> also JonnieCache|work you can arrange free private repo's for a fulltime worker tbh
<Xeago> if you want private repo's
<Xeago> my work is considering
<Xeago> tho, we just got hit by vc stuff and a tax claim
vjt has quit [Ping timeout: 272 seconds]
vjt has joined #ruby
<JonnieCache|work> so hold on, youre saying you get free private github repos by sponsoring a worker?
<Xeago> JonnieCache|work: talk to the travis guys
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<JonnieCache|work> hmmmmm interesting
DuoSRX has joined #ruby
<Xeago> 1 worker otuways the cost of 1 company having private repo's
<JonnieCache|work> although we have a git server with fancy scripts and stuff already
<Xeago> yes but on that 1 server
<Xeago> you can't test your architecture can you?:)
<JonnieCache|work> what do you mean
<Xeago> travisci boots up multiple vm's if you need
<Xeago> 2 different services need to be running over network
heftig has joined #ruby
margle has joined #ruby
<Xeago> travis can start a different vm for that
<JonnieCache|work> oh so you mean you get free private github repos and travis will actually privately test them as well?
<Xeago> e.g. integration between 2 projects
<Xeago> the private github projects go to standard github payments
<Xeago> travis can test private repo's
claymore has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 240 seconds]
fermion has joined #ruby
<JonnieCache|work> ah didnt know that
_nitti has joined #ruby
maride has joined #ruby
maride has quit [Client Quit]
lggr has joined #ruby
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
_nitti has quit [Ping timeout: 246 seconds]
Russell^^ has quit [Ping timeout: 255 seconds]
Takehiro has joined #ruby
danielsz has quit [Ping timeout: 256 seconds]
lkba has joined #ruby
alem0lars has quit [Quit: quit]
maesbn has quit [Ping timeout: 240 seconds]
_br_ has quit [Excess Flood]
maesbn has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
Averna has quit [Quit: Leaving.]
jgrevich has quit [Quit: jgrevich]
cburyta has joined #ruby
_br_ has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
cburyta has quit [Ping timeout: 256 seconds]
_br_ has quit [Excess Flood]
Hanmac has quit [Remote host closed the connection]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
bartj3 has quit []
_br_ has joined #ruby
emsilva has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 240 seconds]
icole has joined #ruby
<pskosinski> Meh, what to do when there is a bug in app from gems and I want to fix it...? Speak like to noob ^^
<pskosinski> I know how to fix bug but...
<pskosinski> It was reported 3 months ago...
<fermion> pskosinski fork it, make the fix to your fork and point your Gemfile to your fork
<pskosinski> ok, ty
yshh has quit [Remote host closed the connection]
lggr has joined #ruby
<fermion> pskosinski np, gl
<pskosinski> I don't know why someone is using unicode quotes instead of... ascii?
parzorep has joined #ruby
<JonnieCache|work> some editors, and some browsers and stuff will automatically insert them
<JonnieCache|work> wordpress is terrible for thart
elico has quit [Remote host closed the connection]
<JonnieCache|work> *that
icole has quit [Ping timeout: 248 seconds]
samphippen has joined #ruby
Russell^^ has joined #ruby
<Xeago> there's a standard for doing it, smartypants when publishing
gry has quit [Quit: Reconnecting]
<Xeago> editing and persistent content should happen the dumbpants
leehambley has quit [Quit: leehambley]
<JonnieCache|work> what are everyones favourite ruby static analysis tools? i have a new large and convoluted rails app to get my head around
beiter has quit [Ping timeout: 245 seconds]
chimay has quit [Quit: WeeChat 0.4.0-dev]
lggr has quit [Ping timeout: 245 seconds]
Xeago_ has joined #ruby
swarley has joined #ruby
undersc0re97 has joined #ruby
bartj3 has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
djdb has joined #ruby
rakunHo has quit [Remote host closed the connection]
Xeago has quit [Ping timeout: 240 seconds]
Xeago_ is now known as Xeago
HashNuke has quit [Quit: HashNuke]
yoklov has quit [Quit: computer sleeping]
parzorep has quit [Quit: parzorep]
lggr has quit [Ping timeout: 260 seconds]
thillux has quit [Remote host closed the connection]
swarley has quit [Remote host closed the connection]
jokar has joined #ruby
lggr has joined #ruby
reset has quit [Quit: Leaving...]
pgpkeys has joined #ruby
pgpkeys is now known as deryl
jenrzzz has quit [Ping timeout: 240 seconds]
ledao has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 245 seconds]
Takehiro has quit [Remote host closed the connection]
lggr has joined #ruby
<bnagy> rm
<bnagy> just run it on all the files you're interested in
mucker has joined #ruby
<JonnieCache|work> interesting approach
gregharvey has joined #ruby
<JonnieCache|work> unfortunately i dont have write access to the git server so it would be pretty futile
HashNuke has joined #ruby
<JonnieCache|work> i made a graphviz of the activerecord relations, it was actually pretty enlightening
<JonnieCache|work> i might swank up the script so the bubbles are proportional to linecount, and add some colour coding
<Xeago> JonnieCache|work: do want
gregharvey has left #ruby [#ruby]
soulisson has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 260 seconds]
<JonnieCache|work> but it could certainly be taken a lot further
iamjarvo has joined #ruby
<awestroke> I want to use ruby for this assignment, but the target system is running 1.8.7 without any gem at all. Give up or hack around?
Russell^^ has quit [Quit: Russell^^]
beiter has joined #ruby
<JonnieCache|work> install 1.9?
thecreators has joined #ruby
lggr has joined #ruby
<awestroke> JonnieCache|work: do you think I would have asked if I had root?
<JonnieCache|work> you dont need root
iCEAGE has quit [Remote host closed the connection]
<awestroke> others need to be able to run it without knowing about rvm/rbenv
<awestroke> on the target system
<JonnieCache|work> write it in 1.8.7 and package all the gem code with the app?
_nitti has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
fyolnish has quit [Remote host closed the connection]
DuoSRX has quit [Remote host closed the connection]
frogprince_mac has joined #ruby
yoklov has joined #ruby
_nitti has quit [Ping timeout: 246 seconds]
<awestroke> JonnieCache|work: hmm.. so bundle gems into the app directory with bundler?
lggr has quit [Ping timeout: 248 seconds]
<JonnieCache|work> i think bundler can do that yes
<JonnieCache|work> theres a `bundle package` command or something
<JonnieCache|work> otherwise you can just do it manually
larissa has joined #ruby
Zai_ has quit [Quit: Zai_]
lggr has joined #ruby
lupine_85 has quit [Changing host]
lupine_85 has joined #ruby
<Xeago> there's also bundle install to vendor thingy
steakknife has joined #ruby
<JonnieCache|work> maybe thats what im thinking of
cburyta has joined #ruby
gregharvey has joined #ruby
lolmaus has joined #ruby
<JonnieCache|work> exit
JonnieCache|work has quit [Quit: leaving]
stephenjudkins has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
robertotauille has joined #ruby
S3kx has quit [Read error: Connection reset by peer]
S3kx has joined #ruby
cburyta has quit [Ping timeout: 240 seconds]
ledao has joined #ruby
Jay_Levitt has joined #ruby
lggr has joined #ruby
JonnieCa1he has joined #ruby
Meon has joined #ruby
HashNuke has quit [Ping timeout: 260 seconds]
HashNuke has joined #ruby
monkegjinni has joined #ruby
zommi has quit [Ping timeout: 265 seconds]
HashNuke has quit [Client Quit]
rh1n0 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
Gal3rielol has joined #ruby
reuf has joined #ruby
parzorep has joined #ruby
lggr has joined #ruby
beiter has quit [Read error: Connection reset by peer]
seoaqua has quit [Ping timeout: 244 seconds]
vlad_starkov has quit [Remote host closed the connection]
arietis has joined #ruby
beiter has joined #ruby
Xeago has quit [Remote host closed the connection]
awestroke has quit [Remote host closed the connection]
Xeago has joined #ruby
notVert has joined #ruby
colinbm has quit [Quit: colinbm]
fermion has quit [Ping timeout: 256 seconds]
Zai_ has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
zommi has joined #ruby
colinbm has joined #ruby
ananthakumaran1 has joined #ruby
mxweas has joined #ruby
dhruvasa1ar has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
ananthakumaran has quit [Ping timeout: 240 seconds]
hsbt is now known as hsbt_away
parzorep has quit [Quit: parzorep]
parzorep has joined #ruby
Mon_Ouie has joined #ruby
reuf has quit [Quit: Leaving]
<Kovensky> odd, I'm doing the equivalent of:
<Kovensky> post = Post.get(1) # find a post to add a comment to
<Kovensky> comment = post.comments.new(:subject => 'DataMapper ...')
<Kovensky> on datamapper, but I'm getting the equivalent of 'undefined method 'new' for nil::NilClass'
fir_ed has quit [Read error: Connection reset by peer]
<Kovensky> (equivalent because I'm uising create =p)
fir_ed has joined #ruby
AndChat| has joined #ruby
lkba has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
parzorep has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 244 seconds]
g-ram_ has quit [Quit: Computer has gone to sleep.]
otters has joined #ruby
<Kovensky> hm nvm; it was an one-to-one relationship and apparently you don't get the convenience of a many-to-one =p
lggr has joined #ruby
JonnieCache has quit [Ping timeout: 240 seconds]
roadt has quit [Ping timeout: 252 seconds]
<JonnieCa1he> calling all sublime users: cmd+U is "movement undo"
<JonnieCa1he> youre welcome
yshh has joined #ruby
JonnieCa1he is now known as JonnieCache|work
<JonnieCache|work> actually its "soft undo" apparently
resure has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<Kovensky> it does seem that rsrc.many_to_many_relationship.create(...) isn't actually saving the created object though (the related SQL isn't printed to console until I call save on the return value) :S
Criztian has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
deadghost has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
Gal3rielol has quit [Ping timeout: 252 seconds]
F1skr has joined #ruby
flype has joined #ruby
duracrisis_ has joined #ruby
_nitti has joined #ruby
deryl has left #ruby [#ruby]
zommi has quit [Ping timeout: 265 seconds]
beiter has quit [Quit: beiter]
pgpkeys has joined #ruby
fyolnish has joined #ruby
pgpkeys has quit [Client Quit]
lggr has quit [Ping timeout: 244 seconds]
margle has joined #ruby
deryl has joined #ruby
deryl is now known as ddd
kjellski has joined #ruby
DuoSRX has joined #ruby
nari has joined #ruby
slainer68 has joined #ruby
ddd has quit [Client Quit]
_nitti has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
ddd has joined #ruby
fyolnish has quit [Ping timeout: 246 seconds]
mark_locklear has joined #ruby
frogprince_mac has quit [Ping timeout: 246 seconds]
justinmcp has joined #ruby
S3kx has quit [Quit: Leaving]
awestroke has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
cburyta has joined #ruby
lggr has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
cburyta has quit [Ping timeout: 240 seconds]
iamjarvo has joined #ruby
jamaa has joined #ruby
cburyta has joined #ruby
fyolnish has joined #ruby
<jamaa> hi all, I'm trying to use Logger, to write to screen and file messages. I wrote: logger = Logger.new(STDOUT);logger = Logger.new("mylog.log");logger.info "some text"; I connect through terminal to linux box, run my script but I don't get logging to the screen, only to the file. Can anyone help me with this ?
Takehiro has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
mohits has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
carlyle has joined #ruby
parzorep has joined #ruby
jcoglan has joined #ruby
DuoSRX_ has joined #ruby
DuoSRX has quit [Ping timeout: 260 seconds]
fixl has quit [Remote host closed the connection]
<invisime> jamaa: the second time you assign to the logger variable, you overwrite the first one.
bartj3 has quit []
lggr has quit [Ping timeout: 252 seconds]
ndboost has joined #ruby
<jamaa> invisime: I'm such a donkey! thanks. checking how to add different outputs to same logger
<invisime> jamaa: yep. :-)
<invisime> jamaa: (on the new approach, not on you being a donkey.)
lggr has joined #ruby
joofsh has joined #ruby
thillux has joined #ruby
Takehiro has quit [Remote host closed the connection]
roadt has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
ndboost has quit [Remote host closed the connection]
Takehiro has joined #ruby
<gregharvey> this is something of a shot in the dark, but does anyone in here do commercial RoR development who would be interested in writing a Redmine plug-in?
iamjarvo has quit [Ping timeout: 240 seconds]
<JonnieCache|work> gregharvey: ive had success on odesk with that kind of thing
<gregharvey> JonnieCache|work: thanks for the tip, that might be worth a shot
ndboost has joined #ruby
<gregharvey> hadn't occured to me :)
lggr has joined #ruby
<JonnieCache|work> people often cite bad experiences with those sites, but that tends to be when theyre looking for php monkies
morozovm_ has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
frogprince_mac has joined #ruby
ndboost has quit [Remote host closed the connection]
<JonnieCache|work> the quality of rails devs on those sites tends to be higher
<gregharvey> well, we're an OSS company, so we should be able to pretty accurately spec what we want … we just don't have *any* Ruby people internally
<JonnieCache|work> especially if you stipulate that they must supply a full test suite, that weeds out the clueless
<gregharvey> so need to outsource this
nwest has joined #ruby
<gregharvey> it's to link a scrum management tool we use that has a SOAP interface to Redmine, basically
morozovm has quit [Ping timeout: 246 seconds]
morozovm_ is now known as morozovm
MikeyV27 has joined #ruby
iamjarvo has joined #ruby
<gregharvey> aaanyway, I'll pen a listing I guess :)
<JonnieCache|work> you might have success here as well, it seems a bit quiet right now
<JonnieCache|work> also theres the rubyonrails channel
undersc0re97 has quit [Quit: i use linux l o l]
jamaa has quit [Quit: Page closed]
<gregharvey> ohhh, I should duck my head in there as well then
jokar has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 245 seconds]
oldB has joined #ruby
bartj3 has joined #ruby
joast has quit [Quit: Leaving.]
Criztian has quit [Remote host closed the connection]
lggr has joined #ruby
nanderoo has joined #ruby
joast has joined #ruby
ABK has quit [Ping timeout: 240 seconds]
mensvaga has joined #ruby
morozovm_ has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
dpk has joined #ruby
_nitti has joined #ruby
Asher has quit [Ping timeout: 260 seconds]
sebastorama has joined #ruby
pseudo has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
hgf has joined #ruby
ltsstar has joined #ruby
<pseudo> Can someone that knows how ruby SSL works, help me figure out what is going wrong here?
<pseudo> SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
morozovm has quit [Ping timeout: 260 seconds]
morozovm_ is now known as morozovm
hgf has quit [Client Quit]
lggr has joined #ruby
<heftig> openssl failed to verify the server certificate
tommyvyo has joined #ruby
<pseudo> i understand that, but the certificate is valid, it works in firefox
<pseudo> so something is wrong with my code
<resure> Is there registered freenode Ruby group (with hostname cloak and etc.)?
<heftig> pseudo: firefox might be using a different cert store
<heftig> especially if it's not linux
<pseudo> it is linux, but yes, it is using pkcs12 which ruby does not like
<pseudo> this is the same exact cert thats inside the pkcs12 file though
_nitti has quit [Ping timeout: 246 seconds]
EddieS_ has quit [Read error: Connection reset by peer]
JoshWines has quit [Remote host closed the connection]
josh^ has quit [Remote host closed the connection]
changedNicks has quit [Ping timeout: 245 seconds]
<heftig> pseudo: try using http.ca_path = "/etc/ssl/certs"
thecreators has quit [Quit: thecreators]
carloslopes has joined #ruby
IrishGringo has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0.1/20120905151427]]
<JonnieCache|work> yeah you probably dont have the ca_certs file loaded
<JonnieCache|work> or the wrong one
thecreators has joined #ruby
<JonnieCache|work> curl provide one here: http://curl.haxx.se/ca/cacert.pem
<JonnieCache|work> they extract it from the firefox source
AndChat| has quit [Quit: Bye]
tekacs has quit [Ping timeout: 245 seconds]
<pseudo> it is a self signed cert
<heftig> pseudo: then you need to add the cert to the cert store
lkba has joined #ruby
thecreators has quit [Remote host closed the connection]
<heftig> or use http.verify_mode = OpenSSL::SSL:VERIFY_NONE
<heftig> er, ::VERIFY_NONE
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
undersc0re97 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
EddieS_ has joined #ruby
<pseudo> heftig: i was using that before, but i keep getting http bad requests back, even though my payload format is valid. this led me to think that my ssl was incorrect
<pseudo> #<Net::HTTPBadRequest:0x0000000139ce88>
<pseudo> and there is no body in the return message
hoelzro has quit [Ping timeout: 260 seconds]
hoelzro has joined #ruby
nigelb has quit [Ping timeout: 260 seconds]
verto|off is now known as verto
<steakknife> pseudo: check that you're talking HTTPS to an HTTPS port. often that's the code for HTTP/HTTPS mismatch.
tekacs has joined #ruby
<pseudo> steakknife: postive that 8444 is the right port
xiexie_11 has joined #ruby
dhruvasa1ar has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
nigelb has joined #ruby
Spooner has joined #ruby
<steakknife> Can you curl it with the same headers / etc?
dhruvasagar has joined #ruby
timrom has joined #ruby
klaas has quit [Read error: Connection reset by peer]
changedNicks has joined #ruby
AndrzejK1zywda has joined #ruby
AndrzejKrzywda has quit [Ping timeout: 268 seconds]
timrom_ has quit [Ping timeout: 264 seconds]
klaas_ has joined #ruby
<pseudo> I am fairly new to web programming, how can i curl over https?
GoGoGarrett has joined #ruby
<steakknife> your shell> curl https://blah:8444
ndboost has joined #ruby
Indecipherable has joined #ruby
geekbri has joined #ruby
_bart has quit [Quit: _bart]
verto is now known as verto|off
<steakknife> man curl or http://linux.die.net/man/1/curl also helps ;)
bartj3 has quit []
Indecipherable has left #ruby [#ruby]
asuka has quit [Ping timeout: 248 seconds]
fmcgeough has joined #ruby
jeffreybaird has joined #ruby
yoklov has quit [Quit: computer sleeping]
morozovm_ has joined #ruby
Meon has quit [Read error: Connection reset by peer]
ltsstar has quit [Quit: ltsstar]
asuka has joined #ruby
Meon has joined #ruby
<steakknife> pseudo: might want to have a look at https://www.ruby-toolbox.com/projects/httparty
lggr has quit [Ping timeout: 252 seconds]
chrisja has joined #ruby
timrom_ has joined #ruby
haxrbyte has quit [Ping timeout: 255 seconds]
timrom has quit [Ping timeout: 245 seconds]
Elhu has quit [Ping timeout: 240 seconds]
morozovm has quit [Ping timeout: 244 seconds]
morozovm_ is now known as morozovm
emsilva has joined #ruby
emsilva has quit [Changing host]
emsilva has joined #ruby
Elhu has joined #ruby
skaczor has joined #ruby
icole has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
lggr has joined #ruby
Neomex has joined #ruby
asuka has quit [Ping timeout: 246 seconds]
Neomex has quit [Client Quit]
oldB has quit [Quit: oldB]
yoklov has joined #ruby
asuka has joined #ruby
Xeago_ has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
nateberkopec has joined #ruby
<pseudo> figuring out how to get curl to use an x509 cert is getting to be futile
icole has quit [Ping timeout: 260 seconds]
<steakknife> curl -k will ignore it
yoklov has quit [Client Quit]
<pseudo> been using -k
Xeago has quit [Ping timeout: 246 seconds]
<steakknife> Oh, it's expecting a "client" certificate
undersc0re97 is now known as Ethan
mucker has quit [Ping timeout: 256 seconds]
<steakknife> Curl -k ignores the "server" cert, like for a test app with a self-signed cert.
<pseudo> there we go
zommi has joined #ruby
<steakknife> :D
jrist-afk is now known as jrist
lggr has quit [Ping timeout: 256 seconds]
frogprince_mac has quit [Ping timeout: 246 seconds]
justinmcp has quit [Ping timeout: 246 seconds]
mercwithamouth has quit [Ping timeout: 255 seconds]
linoj has joined #ruby
<pseudo> it is still saying error:14094412:SSL routines:SSL3_READ_BYTES:sslv3 alert bad certificate
ramusara has joined #ruby
Ethan is now known as undersc0re97
<workmad3> steakknife: or, more accurately, -k ignores *validating* the server cert
ramusara has quit [Client Quit]
<steakknife> whatever
<workmad3> steakknife: so if the common name is wrong, or the signing CA is unknown, -k ignores that, it still uses the cert for encryption
justinmcp has joined #ruby
lggr has joined #ruby
<steakknife> anyone that knows how ssl works gets that, but thanks for the clarification.
<steakknife> pseudo: any luck?
S1kx has joined #ruby
<pseudo> not really getting anywhere with it. this is the command i am using: curl -v -k --key /var/lib/oat/APIclient.pem:password https://oat.unhwildhats.com:8444
<pseudo> still failing with sslv3 alert bad certificate
timrom has joined #ruby
asuka has quit [Ping timeout: 255 seconds]
* workmad3 shudders
<workmad3> I just googled that error, top results were about shibboleth
timrom_ has quit [Ping timeout: 246 seconds]
clocKwize has quit [Remote host closed the connection]
<workmad3> pseudo: a quick check indicates that the error is from the server being unable to verify your client cert
bartj3 has joined #ruby
fredjean has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 252 seconds]
ananthakumaran1 has quit [Quit: Leaving.]
<steakknife> pseudo: you need to run curl with more debug output, possibly need to fire up wireshark as well.
Neomex has joined #ruby
ananthakumaran has joined #ruby
elico has joined #ruby
timrom_ has joined #ruby
timrom has quit [Ping timeout: 240 seconds]
reuf has joined #ruby
<pseudo> steakknife: i know that the certificates are valid. someone must have used ruby to do this before.
whitenoise has joined #ruby
<steakknife> pseudo: Check the code in the SO link, it looks sensible.
asuka has joined #ruby
<steakknife> pseudo: take out the bits about generating a cert, you already have that.
lggr has joined #ruby
xclite has joined #ruby
timrom has joined #ruby
JustinCampbell has joined #ruby
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby
timrom_ has quit [Ping timeout: 256 seconds]
awarner has joined #ruby
JonnieCache has joined #ruby
bmxpert1 has joined #ruby
haxrbyte has joined #ruby
JustinCampbell has quit [Remote host closed the connection]
cdzombak has joined #ruby
<pseudo> steakknife: changing the code around to make a request like that SO gives a slightly more meaningful error, but essentially the same thing.
<pseudo> #<Net::HTTPBadRequest 400 Bad Request readbody=true>
iamjarvo has joined #ruby
<steakknife> pseudo: check out http://www.rubyinside.com/nethttp-cheat-sheet-2940.html with PEM certificate
justinmcp has quit [Ping timeout: 240 seconds]
<steakknife> pseudo: Also, is the key in the right format? That could definitely mess things up.
lggr has quit [Ping timeout: 246 seconds]
<JonnieCache|work> am i supposed to inherit from Exception, Error or StandardError?
<steakknife> StandardError usually.
<JonnieCache|work> thanks. i can never seem to remember
<JonnieCache|work> i dont really like exceptions
<steakknife> I usually do something like ... class MyAppError < StandardError ; end .... class MyAppFooError < MyAppError ; end.
mmitchell has joined #ruby
mucker has joined #ruby
<JonnieCache|work> im not going to need that much complexity but that is a good idea
Neomex has quit [Quit: Neomex]
<steakknife> JonnieCache|work: There's always Go. ; D
<JonnieCache|work> go doesnt have exceptions does it?
jrist is now known as jrist-demo
changedNicks has quit [Changing host]
changedNicks has joined #ruby
changedNicks is now known as sweet_kid
<steakknife> Not usually IIRC, but i'm sure someone at GOOG bolted them on.
haxrbyte_ has joined #ruby
<JonnieCache|work> iirc they deliberately avoided them. thats supposed to be the point of go, it doesnt have stuff it doesnt really need
JustinCampbell has joined #ruby
lggr has joined #ruby
pseudo has quit [Ping timeout: 240 seconds]
ndboost has quit [Remote host closed the connection]
larissa has quit [Quit: Leaving]
<JonnieCache|work> hopefully theyre "bolting on" a decent gc right now
Neomex has joined #ruby
Neomex has quit [Client Quit]
<steakknife> I wonder if the boehm gc is any good.
xclite has quit [Remote host closed the connection]
mmitchel_ has joined #ruby
mmitchell has quit [Ping timeout: 246 seconds]
haxrbyte has quit [Ping timeout: 260 seconds]
hoelzro has quit [Ping timeout: 260 seconds]
xclite has joined #ruby
_bart has joined #ruby
hoelzro has joined #ruby
sweet_kid has quit [Read error: Connection reset by peer]
dr_bob has quit [Quit: Leaving.]
_mak has quit [Ping timeout: 246 seconds]
Elico1 has joined #ruby
sweet_kid has joined #ruby
piotr__ has joined #ruby
_nitti has joined #ruby
xiexie_11 has quit [Quit: Leaving.]
piotr_ has quit [Ping timeout: 246 seconds]
Hanmac has joined #ruby
timrom has quit [Read error: Connection reset by peer]
xiexie_11 has joined #ruby
pseudo has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
_mak has joined #ruby
<pseudo> not the best time for a power outage
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
v0n has joined #ruby
timrom has joined #ruby
philcrissman has joined #ruby
<steakknife> Anyone using scrypt for password hashing instead of bcrypt?
jcaudle has joined #ruby
jcaudle has quit [Client Quit]
rabidpraxis has joined #ruby
jcaudle has joined #ruby
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
lggr has joined #ruby
Guest36719 has quit [Changing host]
Guest36719 has joined #ruby
Guest36719 is now known as starship
ananthakumaran has quit [Quit: Leaving.]
verto|off is now known as verto
frogprince_mac has joined #ruby
prtksxna has quit [Read error: Connection reset by peer]
stopbit has joined #ruby
_TB_ has quit [Remote host closed the connection]
cakehero has joined #ruby
joshman_ has joined #ruby
timrom has quit [Read error: Connection reset by peer]
kjellski has quit [Remote host closed the connection]
Elico1 has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
elux has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
Elico1 has joined #ruby
timrom has joined #ruby
morozovm_ has joined #ruby
lggr has joined #ruby
<JonnieCache|work> steakknife: last time i checked there werent any hardened implementations
<JonnieCache|work> i could only find his example code
<JonnieCache|work> it does look terribly clever though
ZubKonst_ has joined #ruby
ttt has quit [Remote host closed the connection]
morozovm has quit [Ping timeout: 260 seconds]
morozovm_ is now known as morozovm
ZubKonst has quit [Ping timeout: 246 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
Criztian has joined #ruby
<JonnieCache|work> we need a good ruby implementation so we can start looking down on php devs properly again. they have bcrypt built in now
lggr has quit [Ping timeout: 246 seconds]
<JonnieCache|work> although having it *built in to the language* is still a good reason to look down on them
whitenoise has quit [Changing host]
whitenoise has joined #ruby
_Amen_Makaveli_ has joined #ruby
lggr has joined #ruby
emsilva has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
MikeyV27_ has joined #ruby
<Xeago_> Okay now we know, jekyll --auto --server crashes after 8 days of uptime
<Xeago_> it just killed my shell
ledao1 has joined #ruby
dEPy has joined #ruby
jrist-demo is now known as jrist
margle has joined #ruby
catphish has quit [Quit: Leaving]
mensvaga has quit [Remote host closed the connection]
AlbireoX has joined #ruby
cakehero has joined #ruby
ffranz has joined #ruby
<steakknife> JonnieCache|work: that denies the existence of colin's implementation, which has a $1k bug bounty. https://www.tarsnap.com/bugbounty.html
MikeyV27 has quit [Ping timeout: 246 seconds]
ledao has quit [Ping timeout: 246 seconds]
<steakknife> JonnieCache|work: perhaps a few hand-audits of a separate libscrypt would make it more palatable.
MikeyV27_ has quit [Ping timeout: 246 seconds]
<steakknife> by few, that means like a $300k bug bounty
Criztian has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 248 seconds]
_Amen_Makaveli_ has quit [Remote host closed the connection]
gmci has quit [Ping timeout: 245 seconds]
ismaelga has joined #ruby
_Undeveloped_Con has joined #ruby
oldB has joined #ruby
_Undeveloped_Con has quit [Remote host closed the connection]
Undeveloped_Cont has joined #ruby
sent-hil has joined #ruby
lggr has joined #ruby
<matti> steakknife: ?
<steakknife> 300k reward = lots of audits.
Hanmac has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
timrom_ has joined #ruby
<JonnieCache|work> how the way i remember it colins implementation on that page was just a proof of concept
<JonnieCache|work> maybe things have changed or maybe i misremembered
kjellski has joined #ruby
daniel_- has quit [Ping timeout: 240 seconds]
<steakknife> JonnieCache|work: He bets his reputation and business upon it.
timrom has quit [Ping timeout: 256 seconds]
asteve has joined #ruby
ismaelga has quit [Remote host closed the connection]
<JonnieCache|work> oh im not knocking colin percival. im not supid ;)
<JonnieCache|work> *stupid
<JonnieCache|work> :(
<steakknife> Colin's a genius in the nerd's nerd sense.
<JonnieCache|work> indeed
zigomir has quit [Ping timeout: 248 seconds]
<pseudo> hey guys. i am getting there with this REST api. My next question is - how to I alter HTTP headers in a ruby http request. for example, i need to change Content-Type: application/x-www-form-urlencoded to Content-Type: application/json
<JonnieCache|work> steakknife: know anything about the ruby wrapper for it?
<steakknife> JonnieCache: There's two, I'm using gem scrypt
timrom has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
<JonnieCache|work> iirc bcrypt-ruby has been audited
haxrbyte has joined #ruby
punkrawkR has joined #ruby
<JonnieCache|work> i doubt that applies to the scrypt gem
<steakknife> JonnieCache: scrypt has a native ext, https://github.com/coderrr/scrypt-ruby is the ffi version.
timrom_ has quit [Ping timeout: 246 seconds]
timrom has quit [Read error: Connection reset by peer]
<steakknife> By whom? Is there an audit trail?
<steakknife> Audit, it's all about the doc. ;)
<JonnieCache|work> i have no idea. i seem to remember reading that it had been done
Hanmac has joined #ruby
<steakknife> No worries, the clients i have would surely pay for an audit of either scrypt or bcrypt to know it's good.
sailias has joined #ruby
Elico1 has quit [Ping timeout: 245 seconds]
<steakknife> scrypt is awesome because it's purposely inefficient in terms of memory and cpu to use an irreducible amount of hardware and/or software.
lggr has joined #ruby
Russell^^ has joined #ruby
<JonnieCache|work> thats the main difference isnt it, thats its irreducible rather than just large?
resure has quit [Changing host]
resure has joined #ruby
Elico1 has joined #ruby
<steakknife> Exactly, it scales to what resources are available.
chimay has joined #ruby
haxrbyt__ has joined #ruby
<steakknife> Good luck burning an ASIC to crack that, NSA. ;)
haxrbyte_ has quit [Ping timeout: 256 seconds]
haxrbyte has quit [Ping timeout: 248 seconds]
<JonnieCache|work> theyll just find a flaw in the algo instead :)
<steakknife> And they'll win $1k ;)
rbennacer has joined #ruby
<rbennacer> hello
timrom has joined #ruby
<steakknife> The fatal flaw in the HN comment logic is that 'nobody has ever hardware-optimized a bcrypt cracker' is a fallacy claiming an unknowable.
oldB has quit [Quit: oldB]
Elico1 has quit [Ping timeout: 248 seconds]
iori has quit [Remote host closed the connection]
pricees has joined #ruby
<rbennacer> how can i grab with a regex all the text between '[' ']', example: [test1] [text1], i want to grab test1 and text1
haxrbyt__ has quit [Remote host closed the connection]
<JonnieCache|work> steakknife: with the nsa comment i was referring to that incident where they forced intel (?) to use specific numbers in a crypto scheme
minijupe has joined #ruby
x82_nicole has joined #ruby
<JonnieCache|work> everyone thought it was a backdoor, but decades later it turned out they were hardening it against a then unknown attack
lggr has quit [Ping timeout: 248 seconds]
<JonnieCache|work> proving the nsa are decades ahead with crypto
<steakknife> Lots of things work like that.
<steakknife> Yeah, the nsa isn't all evil.
haxrbyte has joined #ruby
Elico1 has joined #ruby
<JonnieCache|work> i reckon theyre more trustworthy than the other american three letter agencies
<steakknife> Most of the good crypto research is classified.
leehambley has joined #ruby
<steakknife> There's an enormous corpus of classified research most people have no clue about.
nightfalcon has joined #ruby
oz has joined #ruby
Poapfel has quit [Quit: WeeChat 0.3.7]
<JonnieCache|work> have you seen some of it or is this second hand information?
<steakknife> I'm not going to comment either way.
xiexie_11 has quit [Ping timeout: 260 seconds]
<JonnieCache|work> those NDAs are pretty wideranging in their terms arent they
<JonnieCache|work> although thats probably above a normal nda
lggr has joined #ruby
Ankhers has joined #ruby
locriani has quit [Remote host closed the connection]
pricees has quit [Quit: leaving]
haxrbyte_ has joined #ruby
drbawb has joined #ruby
_bart has quit [Quit: _bart]
baroquebobcat has joined #ruby
<rbennacer> helkp plz
<xclite> rbennacer: not fully tested. \[([^\[\]]*)\]
<steakknife> There are NDAs and then are relationships. The latter hold more weight.
ataher has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
<iamjarvo> what's the difference between "the".each_char and "the".chars
<JonnieCache|work> indeed
Russell^^ has quit [Quit: Russell^^]
<steakknife> each_char would probably imply it needs a block to iterate over.
<JonnieCache|work> or returns an enumerator
haxrbyte has quit [Ping timeout: 246 seconds]
<iamjarvo> chars withour a block returns an enumerator also
<rbennacer> it is giving me the right result
imami|afk is now known as banseljaj
vieq_ has joined #ruby
<xclite> rbennacer, in the limited playing i've done it seems to work. I didn't test nesting of [] or anything like that
<rbennacer> i don't understand you regex though
Undeveloped_Cont has quit [Remote host closed the connection]
_bart has joined #ruby
Elico1 has quit [Ping timeout: 252 seconds]
_nitti has quit [Remote host closed the connection]
<rbennacer> why does \[(.*)\] not work?
no_worries has joined #ruby
<hoelzro> rbennacer: because that will match ] inside of [...] as well
<xclite> rbennacer, because . is any char, so it will be greedy and except the brackets
baroquebobcat has quit [Client Quit]
<xclite> rbennacer, that's why I used the character class [^\[\]]
<steakknife> needs to be something like [^\]]
lggr has quit [Ping timeout: 240 seconds]
<steakknife> try it on rubular
<rbennacer> i am on rebular
_nitti has joined #ruby
nari has quit [Ping timeout: 256 seconds]
mercwithamouth has joined #ruby
<xclite> rbennacer, my regexp is similar to yours, except that the grouping between () matches anything but the "[]" characters
MikeyV27 has joined #ruby
havenn has joined #ruby
_nitti has quit [Remote host closed the connection]
<rbennacer> i though ^ was used to define the begining of the word
<ataher> is there a way to specify what data types are in an array
<Hanmac> imjarvo each_char and chars are the same on 1.9.+
_bart has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
lolmaus has quit []
<xclite> rbennacer, it is outside of character classes
<xclite> I use [] to create a character class
<xclite> and ^ to negate it
<xclite> a character class says "match anything in here"
<xclite> so I said "Match anything that isn't '[' or ']'" using ^
rasbonics has joined #ruby
<rbennacer> ooo
_nitti has joined #ruby
<rbennacer> i didn't know we can do that
<rbennacer> this is awesome
Elico1 has joined #ruby
<rbennacer> thanks man
awestroke has quit [Remote host closed the connection]
<steakknife> If the intention is to grab a pattern including nested [] exclusive of the outer: \[(.*)\]
<xclite> rbennacer, regexps are nice. careful of overusing them, they can be a pain to decipher
CannedCorn has joined #ruby
_bart has joined #ruby
<CannedCorn> hey guys, is yardoc fundamentally incompatable with github
<CannedCorn> i want to put things like a tutorial in my project
<CannedCorn> but github doens't have repo relative links
argoneus has joined #ruby
<argoneus> Hello
mikepack has joined #ruby
<argoneus> is it any easier to learn ruby / RoR if I know python/php?
<rbennacer> so you are using this feature : [^ ] any single character NOT of set
awestroke has joined #ruby
<steakknife> argoneus: yep
dhruvasagar has quit [Quit: Lost terminal]
<steakknife> argoneus: check out rubymonks or ruby koans.
lggr has quit [Ping timeout: 240 seconds]
maesbn has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
slava_dp has quit [Quit: Bye]
mars__ has joined #ruby
maesbn has joined #ruby
drbawb has quit [Quit: WeeChat 0.3.9]
mucker has joined #ruby
chimkan has joined #ruby
dpk is now known as hmm
cardoni has joined #ruby
hmm is now known as dpk
rasbonics has left #ruby [#ruby]
indel has quit [Ping timeout: 252 seconds]
sspiff has quit [Remote host closed the connection]
jprovazn has quit [Remote host closed the connection]
<steakknife> For the grand-prize trip for 2 to tahiti, what's the calling convention using ruby ffi to an objective c function: https://gist.github.com/3833327
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
rasbonics has joined #ruby
sspiff has quit [Remote host closed the connection]
bbttxu has quit [Read error: Connection reset by peer]
cardoni has quit [Client Quit]
cardoni has joined #ruby
<Hanmac> i didnt even know that FFI support objective C :D
lggr has joined #ruby
<steakknife> I've made some calls to other frameworks
booginga has joined #ruby
Elico1 has quit [Read error: Operation timed out]
dangerousdave has quit [Quit: Leaving...]
<steakknife> but the objective-c styled ones don't seem to support any of the dozen or so permuations syntices i've tried.
colinbm has quit [Quit: colinbm]
indel has joined #ruby
<steakknife> i might actually have the wrong framework as well.
maesbn has quit [Ping timeout: 260 seconds]
mahmoudimus has joined #ruby
<Hanmac> i may not helpful for using FFI .... i wrote my ruby gems with c++ ...
colinbm has joined #ruby
bmxpert1_ has joined #ruby
<steakknife> :D
<steakknife> I'm trying to call standardUserDefaults, which has a signature of:
davidcelis has quit [Quit: K-Lined.]
<steakknife> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation: 000000000000aac4 t +[NSUserDefaults(NSUserDefaults) standardUserDefaults]
_bart has quit [Ping timeout: 246 seconds]
multi_io has joined #ruby
beit has joined #ruby
Elico1 has joined #ruby
bmxpert1 has quit [Ping timeout: 246 seconds]
jcaudle has quit [Quit: jcaudle]
sebastorama has quit [Quit: Computer has gone to sleep.]
<multi_io> have there ever been plans to somehow retain the API documentation at runtime (attach it to the respective runtime artifacts like classes, methods etc.), so they could easily be made available to tools like interactive shells and editors?
lggr has quit [Ping timeout: 240 seconds]
fredjean has joined #ruby
bmxpert1_ has quit [Client Quit]
jcaudle has joined #ruby
indel has quit [Read error: Operation timed out]
<multi_io> have other languages done this?
argoneus has left #ruby ["Leaving"]
<steakknife> multi_io: e.g., docstrings?
<Hanmac> multi_io or do you mean something like "ri Array#map" ?
<ataher> http://pastie.org/4909232 why am I getting a "rb:11:in `getNextPrime': undefined method `+@' for nil:NilClass (NoMethodError)" error
und3f has quit [Quit: Leaving.]
<steakknife> ++ isn't a ruby operator
<Hanmac> ataher ruby has no ++ or --
<steakknife> += 1
<ataher> oh lol
macmartine has joined #ruby
<ataher> thanks
<multi_io> steakknife: ah, yeah. That's Python, right?
xiexie_11 has joined #ruby
<steakknife> Look at pry-doc and help of various REPLs.
lggr has joined #ruby
indel has joined #ruby
crankycoder has joined #ruby
rh1n0 has quit [Quit: Linkinus - http://linkinus.com]
<sent-hil> what does x &&= y mean?
<sent-hil> i understand it becomes x = x && y, but can't wrap my head around it
RJ3000_ has quit [Remote host closed the connection]
juarlex has joined #ruby
<steakknife> x = y if x
ndboost has joined #ruby
<steakknife> x ||=y # x = y unless x
<sent-hil> steakknife: ah, thx
<steakknife> ||= # default
<steakknife> &&= # override if set
<pseudo> does anyone know how i can remove the Content-Type field from an HTTP header? request.delete("Content-Type") is not working...
cbuxton has joined #ruby
answer_42 has joined #ruby
samphippen has quit [Ping timeout: 260 seconds]
<pseudo> also, Connection: close is making its way into the http header somehow
RJ3000_ has joined #ruby
<pseudo> i need to remove that too
<pseudo> if there is a way to just form the entire http header myself i would like that also
hoelzro is now known as hoelzro|away
<pseudo> i have been googling this for the last hour and havent gotten very far
Elico1 has quit [Ping timeout: 240 seconds]
capsule_toy has joined #ruby
samphippen has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
ttt has joined #ruby
bartj3 has quit []
baroquebobcat has joined #ruby
<steakknife> pseudo: i bet net:http is adding the content type back
<pseudo> steakknife: can i just make my own request without it?
<steakknife> pseudo: this is the time to bust out the ruby source
carloslopes has quit [Quit: Leaving.]
lggr has joined #ruby
awarner has quit [Remote host closed the connection]
Elico1 has joined #ruby
ttt has quit [Ping timeout: 240 seconds]
bbttxu has joined #ruby
IrishGringo has joined #ruby
Takehiro has quit [Remote host closed the connection]
<steakknife> pseudo: doesnt the client use a content-encoding header in the response and the server send a content-type in the response?
<steakknife> s/response/request/
<Xeago_> Accept: encodings
rubious has joined #ruby
aganov has quit [Remote host closed the connection]
Criztian has joined #ruby
leehambley has quit [Read error: Connection reset by peer]
DaniG2k has joined #ruby
<shevy> Reject: liabilities
lggr has quit [Ping timeout: 246 seconds]
<DaniG2k> can someone help me figure out what I'm supposed to look up on google to answer this question plz?
<DaniG2k> Define a method attr_accessor_with_history that provides the same functionality as attr_accessor but also tracks every value the attribute has ever taken.
leehambley has joined #ruby
leehambley has quit [Client Quit]
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<pseudo> steakknife: it does not, it uses a context header. no content
jwallace has joined #ruby
resure has left #ruby [#ruby]
indel has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
lggr has joined #ruby
<matti> Folks. C in Ruby is C89 or C99?
<steakknife> Context-Type header?
iamjarvo has quit [Ping timeout: 260 seconds]
<steakknife> i doubt Ruby would compile on Borland C++ 4.01.
<pseudo> steakknife:
ryanlecompte has joined #ruby
<pseudo> page 9 shows what the http header should look like
<matti> steakknife: I've seen some cruft there ;p You'd be surprised if it did ;]
<steakknife> :)
<steakknife> pseudo: the doc looks dodgy, might be a typo.
slainer6_ has joined #ruby
<pseudo> ive tried with content-type, get a 400 error
fram has joined #ruby
Elico1 has quit [Ping timeout: 248 seconds]
<steakknife> There's enough UML screen caps to choke an elephant. ;)
irleif has joined #ruby
<pseudo> for that matter, everything i have tried has gotten a 400 error, so idk...
<pseudo> they like their diagrams
<Hanmac> ataher: look at this: ((lastPrime+lastPrime%2+1)..Float::INFINITY).step(2).find {|i| 3.step(i-1,2).none?{|ii|i%ii==0 }}.to_i
<Hanmac> shevy you could look too
ndboost has quit [Remote host closed the connection]
<steakknife> pseudo: alright, let's reenigne their crappy api :)
<ataher> jebus thats hard to read lol
_mak has quit [Read error: Connection reset by peer]
Morkel has quit [Quit: Morkel]
ryanlecompte has quit [Remote host closed the connection]
<steakknife> it's doable. beer to the first one that gets it.
<pseudo> :P
<steakknife> is there a sandbox somewhere to play with non-prod stuff?
jwallace has left #ruby [#ruby]
lggr has quit [Ping timeout: 260 seconds]
slainer68 has quit [Ping timeout: 246 seconds]
<pseudo> i can open up a port
<steakknife> as long as it's not going to get anyone intro trouble
ananthakumaran has joined #ruby
<steakknife> you did a whois on my address, right? ;)
nignaztic has quit [Quit: WeeChat 0.3.2]
fram has quit [Ping timeout: 244 seconds]
<pseudo> its on my home network, and its definately not production ;)
tnk1 has quit [Remote host closed the connection]
<steakknife> good times
tnk1 has joined #ruby
morozovm has quit [Ping timeout: 256 seconds]
Virunga has joined #ruby
lggr has joined #ruby
drmegahertz has quit [Quit: leaving]
<ataher> can I do a % mod on a bignum?
mahmoudimus has quit [Quit: Computer has gone to sleep.]
wallerdev has joined #ruby
fram has joined #ruby
<steakknife> ataher: try it in pry or irb. 1111111111111111111111111111111111111111111111111111111111111 % 6
irleif has quit [Quit: Computer has gone to sleep.]
_nitti has quit [Quit: Leaving...]
tnk1 has quit [Read error: Connection reset by peer]
zommi has quit [Quit: Leaving.]
tnk1 has joined #ruby
<ataher> http://pastie.org/4909392 getting an error "rb:7:in `%': nil can't be coerced into Fixnum (TypeError)"
deadghost has joined #ruby
philcrissman has quit [Remote host closed the connection]
bartavelle has joined #ruby
bartavelle has left #ruby ["couic"]
<matti> ataher: (x % i) == 0
<ataher> oh
<ataher> I got it
lggr has quit [Ping timeout: 248 seconds]
philcrissman has joined #ruby
<ataher> my getNextPrime was not returning the next prime but printing it
tnk1 has quit [Read error: Connection reset by peer]
<matti> Ah
<matti> LOL
<matti> ;]
chimkan has quit [Quit: chimkan]
<ataher> super ruby noob
tnk1 has joined #ruby
QKO_ has joined #ruby
<ataher> I have a feeling ruby is going to mess up my coding in other languages. No semicolons, some methods can return the last evaluated item
<ataher> ...
xiexie_11 has quit [Ping timeout: 244 seconds]
chrishunt has quit [Ping timeout: 260 seconds]
<Xeago_> everything returns the last evaluated thing
rbennacer has left #ruby ["Leaving"]
<matti> ataher: I am doing C as of late.
<matti> ataher: And was puting "end" everwhere.
<ataher> lol
blazes816 has joined #ruby
lggr has joined #ruby
QKO has quit [Ping timeout: 240 seconds]
irleif has joined #ruby
jgrevich has joined #ruby
Jork1 has quit [Quit: Jork1]
<Hanmac> its funny ... ruby has methods for gcd and lcm but no method to get the Prime factors ... very funny
colinbm has quit [Quit: colinbm]
tnk1 has quit [Read error: Connection reset by peer]
Trioke has joined #ruby
mahmoudimus has joined #ruby
tnk1 has joined #ruby
d3vic3 has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 255 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
Takehiro has joined #ruby
oldB has joined #ruby
d3vic3 has joined #ruby
Jork1 has joined #ruby
<tos9> matti: I made sure to use endwise.vim to make sure they don't start popping up in my other languages :)
RJ3000_ has quit [Remote host closed the connection]
nat2610 has joined #ruby
lggr has joined #ruby
nat2610 has quit [Read error: Connection reset by peer]
nat2610 has joined #ruby
Jork1 has quit [Client Quit]
SegFaultAX|work has joined #ruby
bradleyprice has joined #ruby
jakzale has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
RJ3000_ has joined #ruby
tnk1 has quit []
<DaniG2k> can someone help me understand what i need to do for this question plz
tnk1 has joined #ruby
<DaniG2k> Define a method attr_accessor_with_history that provides the same functionality as attr_accessor but also tracks every value the attribute has ever taken.
<DaniG2k> apparently I need to use class_eval for this
chimkan_ has joined #ruby
ataher has quit [Remote host closed the connection]
rehat has joined #ruby
deadghost has quit [Ping timeout: 244 seconds]
<matti> tos9: ? ;]
<matti> tos9: Oh... ends ;d
<matti> Haha
lggr has quit [Ping timeout: 246 seconds]
aantix has joined #ruby
c0rn_ has joined #ruby
aantix has quit [Read error: Connection reset by peer]
burgestrand has quit [Quit: Leaving.]
aantix has joined #ruby
saedelaere has joined #ruby
aantix has quit [Read error: Connection reset by peer]
NiteRain has joined #ruby
lggr has joined #ruby
samphippen has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
Xeoncross has joined #ruby
<saedelaere> hi, I want to count words in a string. I am using a hash to do this but my keys do not seem to be strings but arrays with one string.
<saedelaere> here is what I gt
<saedelaere> any idea?
alvaro_o has joined #ruby
nazty has joined #ruby
ryanlecompte has joined #ruby
zinjacoder has joined #ruby
<Hanmac> saedelare: remove the () from your regexp
Virunga has quit [Remote host closed the connection]
DaniG2k has quit [Quit: Leaving]
ephemerian has quit [Quit: Leaving.]
<reactormonk> saedelaere: amount of words or amount of different words?
tvw has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 252 seconds]
<saedelaere> Hanmac: perfect thanks
<reactormonk> saedelaere: Hash.new {|h,k| h[k] = 0}
<saedelaere> reactormonk: I want to count how often each word occurs
senny has quit [Remote host closed the connection]
<saedelaere> with Hanmacs help it is now correct :)
Tom2 has joined #ruby
capsule_toy has quit []
<Tom2> Probably a contentious issue but vim or emacs?
Xeoncross has quit [Quit: Ex-Chat]
<reactormonk> saedelaere: how many words are in "'I am Borat'-kit"?
wallerdev has quit [Quit: wallerdev]
BadLarry has quit [Quit: quitting]
maletor has joined #ruby
Elico1 has joined #ruby
<saedelaere> reactormonk: hehe good question
<saedelaere> but I can safely ignore all non word characters
icole has joined #ruby
<reactormonk> saedelaere: everything concerning natural language is non-trivial
brianpWins has joined #ruby
lggr has joined #ruby
relative has joined #ruby
<Hanmac> array=str.scan(/\b\w+\b/);array.uniq.each_with_object(Hash.new(0)){|w,h| h[w]=array.count(w)}
stephenjudkins has joined #ruby
khakimov has joined #ruby
ngoldman has joined #ruby
icole has quit [Ping timeout: 246 seconds]
gimireh has joined #ruby
leifmadsen has joined #ruby
gimireh has left #ruby ["Leaving"]
deadghost has joined #ruby
yshh has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 240 seconds]
mucker has quit [Quit: leaving]
Poapfel has joined #ruby
Elico1 has quit [Ping timeout: 244 seconds]
Jay_Levitt has quit [Quit: Jay_Levitt]
<Xeago_> merge conflict is lasting 5 hours atm
<Xeago_> new highscore
<Xeago_> since svn
lggr has joined #ruby
nwertman has joined #ruby
<leifmadsen> afternoon all. I'm trying to track down an issue where the following line (http://bit.ly/QJHUyE) is called with 2 arguments and not 1. I think the issue is in an external library, but I'm having issues tracking down "what" is calling it incorrectly. The issue and backtrace are here (http://bit.ly/QKG4KE). Someone suggested pry-rescue the other day which looks really cool, but I wasn't able to figure out exactly how to modify
<leifmadsen> the file.rb resource to make it work.
seoaqua has joined #ruby
Trioke_ has joined #ruby
<leifmadsen> any pointers on how I can trace back what is calling 'diff' incorrectly would be incredibly helpful
c0rn_ has quit []
<Xeago_> fields.each {|field| dataset=dataset.select field }
<Xeago_> can I write that easier?
BadLarry has joined #ruby
<Xeago_> asin, each iteration takes uses the previous result and calls select on it
chrishunt has joined #ruby
Trioke has quit [Ping timeout: 260 seconds]
Xeoncross has joined #ruby
<Xeago_> s/takes/
Criztian has quit [Remote host closed the connection]
irleif has joined #ruby
cantonic_ has joined #ruby
ncr100 has joined #ruby
Elico1 has joined #ruby
fantazo has joined #ruby
gregharvey has left #ruby [#ruby]
cantonic has quit [Ping timeout: 245 seconds]
cantonic_ is now known as cantonic
lggr has quit [Ping timeout: 244 seconds]
davidcelis has joined #ruby
vlad_starkov has joined #ruby
lggr has joined #ruby
Trioke_ has quit [Ping timeout: 248 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
irleif has quit [Quit: Computer has gone to sleep.]
D4T has quit [Quit: Computer has gone to sleep.]
Elico1 has quit [Ping timeout: 256 seconds]
Trioke has joined #ruby
Eplemosen has joined #ruby
Xeoncross has quit [Quit: Ex-Chat]
khakimov has quit [Quit: Computer has gone to sleep.]
seoaqua has quit [Ping timeout: 256 seconds]
Elico1 has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
cardoni has quit [Quit: cardoni]
stim371 has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
maletor has joined #ruby
<bnagy> inject, by the sounds
mrsolo has joined #ruby
beit has quit [Quit: beit]
Elico1 has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
xiexie_11 has joined #ruby
Takehiro has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
<nyuszika7h> any idea why require_relative gives this error?
<nyuszika7h> 18:38:54 — | ./prime_division:3:in `require_relative': cannot load such file -- /home/nyuszika7h/scripts/ruby/lib/primes (LoadError)
<nyuszika7h> 18:38:54 — | from ./prime_division:3:in `<main>'
<nyuszika7h> the file _does_ exist
<nyuszika7h> 18:39:00 — | -rw-r--r-- 1 nyuszika7h nyuszika7h 208 Oct 4 18:36 lib/primes
<nyuszika7h> (sorry for cross-post, also the — = me)
khakimov has joined #ruby
leehambley has joined #ruby
slainer6_ has quit [Remote host closed the connection]
Elico1 has joined #ruby
_nitti has joined #ruby
SegFaultAX|work has quit [Ping timeout: 244 seconds]
<awestroke> nyuszika7h: is there a primes.rb file in lib/ ?
<nyuszika7h> oh, it needs to have .rb extension?
<nyuszika7h> wait, wtf, ruby1.9.1?
<nyuszika7h> /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- generator (LoadError)
<nyuszika7h> does not compute
<nyuszika7h> ruby -v says: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
<shevy> Hanmac your ruby style is so strange man :)
<awestroke> nyuszika7h: rbenv or rvm?
<nyuszika7h> I don't use either
voodoofish430 has joined #ruby
<nyuszika7h> I didn't use ruby for a long time so I didn't really care to have one of those installed
<steakknife> bundler at least?
JonnieCache|work has quit [Read error: Operation timed out]
wallerdev has joined #ruby
fyolnish has quit [Remote host closed the connection]
bmxpert1 has joined #ruby
darthdeus has joined #ruby
<bnagy> 1.9.1 is just the api version, that's not weird
<bnagy> but generator is 1.8 style, from memory
<bnagy> you trying to run something really old?
lggr has quit [Ping timeout: 256 seconds]
nazty has quit [Ping timeout: 260 seconds]
<nyuszika7h> it's 1.8 style?
<nyuszika7h> what is the equivalent in 1.9?
<bnagy> no direct one afaik
<bnagy> Enumerator
<bnagy> kind of
<nyuszika7h> what I want is a prime generator :P
<nyuszika7h> that gives the next prime on primes.next
<nyuszika7h> or similiar logic
bricker has joined #ruby
<nyuszika7h> * similar
<bnagy> isn't that in stdlib?
Elico1 has quit [Read error: Operation timed out]
<nyuszika7h> what? a prime generator?
<bnagy> require 'prime'
Zai_ has quit [Quit: Zai_]
daniel_- has joined #ruby
Criztian has joined #ruby
Jork1 has joined #ruby
wedtm|away is now known as wedtm
Elhu has quit [Quit: Computer has gone to sleep.]
Elico1 has joined #ruby
apok has joined #ruby
<nyuszika7h> oh, nice!
fram has quit [Ping timeout: 245 seconds]
My_Hearing has joined #ruby
lggr has joined #ruby
bmxpert1 has quit [Quit: bmxpert1]
SegFaultAX|work has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
mikepack has quit [Remote host closed the connection]
whaley has joined #ruby
elaptics is now known as elaptics`away
<bnagy> night
davidcelis has quit [Ping timeout: 246 seconds]
elaptics`away is now known as elaptics
apok_ has joined #ruby
leehambley has quit [Quit: leehambley]
mohits has quit [Read error: Connection reset by peer]
<vieq_> guys if I know nothing about DBs and want something to learn along with ruby
Iszak has quit [Quit: User has gone to sleep.]
Mon_Ouie has quit [Ping timeout: 246 seconds]
<vieq_> what are my options for a cool not shuting off start
fram has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
mohits has joined #ruby
davidcelis has joined #ruby
apok has quit [Ping timeout: 248 seconds]
apok_ is now known as apok
<nyuszika7h> what's the difference between ruby1.9.1 1.9.3.194-1 and ruby1.9.3 1.9.3.194-1?
DuoSRX_ has quit [Remote host closed the connection]
havenn has joined #ruby
mikepack has joined #ruby
booginga5000 has joined #ruby
<blazes816> vieq_: my recommendation is that if you want to learn something mega cool, databases should be it
<blazes816> they're awesome
<vieq_> blazes816, you're missing the point :D
<blazes816> but if not, perhaps a game (in jruby)?
lggr has quit [Ping timeout: 252 seconds]
<nyuszika7h> never mind, I got it
<vieq_> I just need a startup and after that what ever suits me I 'll be using
GoGoGarrett has quit [Remote host closed the connection]
<vieq_> it's just the start that I am looking for
<vieq_> now some told me of sqlite and Postgresql
shevy has quit [Ping timeout: 245 seconds]
<blazes816> what about them? they're great databases.
booginga has quit [Ping timeout: 260 seconds]
chussenot has quit [Quit: chussenot]
<blazes816> although I only like sqlite for in-memory stores
argoneus has joined #ruby
<argoneus> Hello
<vieq_> blazes816, dude I know nothing of them and just need a recommendation of any name of them to start with
<argoneus> Is it worth it to learn ruby, specifically Rails?
<argoneus> I mean
<argoneus> does it bring anything new to the table compared to python?
<vieq_> just I need something that won't get me headches at start
apok has quit [Read error: Connection reset by peer]
<vieq_> thats all
<argoneus> like a new way of thinking or such
<blazes816> lol
<vieq_> I am not asking which is cooler
<blazes816> sorry man
<awestroke> argoneus: if you do web development, you should learn ruby + rails|sinatra in my oppinion
apok has joined #ruby
<blazes816> i get what you're asking now
<kaleido> rails is nasty, imo
sneakyness_wk has joined #ruby
<kaleido> but others love it
<blazes816> postgres is really good
<awestroke> kaleido: tried sinatra?
<kaleido> its like asking me what ice cream tastes best to you
<kaleido> i love sinatra
<awestroke> :)
<argoneus> lemon ice cream!
<blazes816> vieq_: postgres works really well. mysql is super easy and a lot of people prefer it. either of those is good
lggr has joined #ruby
<blazes816> vieq_: if you're a hipster and don't want to to build an application that does anything real you can check out document dbs like mongo
<vieq_> blazes816, better than sqlite for newbies?
Xeago_ has quit [Remote host closed the connection]
<vieq_> mm
<kaleido> hahahaha, nice blazes
<blazes816> vieq_: the only advantage to sqlite over others is that it's easier to setup
<vieq_> even the names acronyms feel weirdo to me yet.
sent-hil has quit [Remote host closed the connection]
<vieq_> blazes816, that only?
<blazes816> pretty much, in every other way postgres or mysql is better
evilsushi has left #ruby [#ruby]
<vieq_> cool then, postgresql it is
<vieq_> thanks man
<blazes816> np
sepp2k has joined #ruby
<argoneus> um
timmow has quit [Quit: is having a nap]
<argoneus> coming from mysql
<argoneus> what does Rails prefeR?
<argoneus> prefer*
<awestroke> argoneus: it's db agnostic
samphippen has quit [Quit: Computer has gone to sleep.]
oldB has quit [Quit: oldB]
adamkittelson has joined #ruby
<awestroke> argoneus: you will be writing for activerecord. You can develop on sqlite or mysql and deploy live on postgres without knowing
havenn has quit [Remote host closed the connection]
<awestroke> you should know though
engel has joined #ruby
<argoneus> active record?
d3vic3 has quit [Quit: leaving]
<argoneus> the wiki page didn't tell me much
Elico1 has quit [Ping timeout: 240 seconds]
<argoneus> is it like mysql?
<jakzale> Should "crazier it seems".split(" ").sort{|w| w.length}.join(" ") return "it seems crazier"?
bluenemo has quit [Remote host closed the connection]
<kaleido> jakzale: run it in irb
frogprince has quit []
dakine has quit [Quit: Leaving]
Elico1 has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
<jakzale> I am asking because it gives me weird results in irb: "seems it crazier"
heftig has quit [Quit: leaving]
<awestroke> argoneus: activerecord is an ORM
<awestroke> google ORM and then look at the rails tutorial regarding models
<kaleido> well
<kaleido> split doesnt need (" "), itll just make an array of the three words, right?
<argoneus> so it's an alternative to SQL
<argoneus> um
<argoneus> could you please rephrase this?
<argoneus> <awestroke> argoneus: you will be writing for activerecord. You can develop on sqlite or mysql and deploy live on postgres without knowing
<argoneus> I don't understand that sentence
<awestroke> argoneus: you will make a schema with migrations, and then use dynamic activerecord models to create, query, modify and delete data
<argoneus> wait
<kaleido> and i dont think length does what you think it does
<argoneus> are the two sentences related?
xiexie_11 has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
hoelzro|away is now known as hoelzro
<jakzale> kaleido: only took Ruby recently, still I am bit confused about the output of the sort method
<awestroke> argoneus: I suggest just reading http://ruby.railstutorial.org/chapters/a-demo-app.html#top
chimkan_ has quit [Quit: chimkan_]
<argoneus> thanks AwesomeGarethMan
<argoneus> awestroke:
shevy has joined #ruby
Synthead has joined #ruby
Takehiro has joined #ruby
booginga1000 has joined #ruby
havenn has joined #ruby
Takehiro has quit [Remote host closed the connection]
<fbernier> jakzale: is this what you're trying to do?:
vlad_starkov has quit [Remote host closed the connection]
<fbernier> "crazier it seems".split(" ").sort{|w, x| w.length <=> x.length}.join(" ")
Takehiro has joined #ruby
Elico1 has quit [Ping timeout: 260 seconds]
<fbernier> jakzale: look the sort method documentation: http://www.ruby-doc.org/core-1.9.3/Array.html#method-i-sort
mohits has quit [Ping timeout: 240 seconds]
<fbernier> and try playing with the <=> operator in irb
Elico1 has joined #ruby
nwertman has quit [Quit: nwertman]
booginga5000 has quit [Ping timeout: 245 seconds]
Asher has joined #ruby
baphled has quit [Ping timeout: 260 seconds]
haxrbyte_ has quit [Ping timeout: 246 seconds]
elaptics is now known as elaptics`away
vieq_ has quit [Quit: Leaving]
lggr has quit [Ping timeout: 246 seconds]
<Hanmac> fbernier & jakzale: "crazier it seems".split(" ").sort_by(&:length).join(" ")
vitoravelino is now known as vitoravelino`afk
Asher has quit [Client Quit]
gruwl has joined #ruby
<fbernier> Hanmac: yup, that's better. Was just reading about sort_by
fram has quit [Ping timeout: 260 seconds]
frogprince has joined #ruby
<jakzale> Hanmac: thanks
gruwl has quit [Client Quit]
h4mz1d has joined #ruby
leehambley has joined #ruby
fram has joined #ruby
Elico1 has quit [Ping timeout: 256 seconds]
Jamone has quit [Read error: Connection reset by peer]
<shevy> hmm
<shevy> guys
<shevy> what is the difference between:
<shevy> "5".to_i and Integer "5"
carloslopes has joined #ruby
Monie has joined #ruby
lggr has joined #ruby
<shevy> the first one seems so much more natural to use...
<xclite> shevy, I recall reading about there actually being a different, semantically
<xclite> difference*
<Hanmac> shevy: try both with "0xFF"
<fbernier> shevy: try with non-number
Elico1 has joined #ruby
eldar has joined #ruby
<shevy> aha
<shevy> so via .to_i more information can potentially be lost than with Integer()
<Hanmac> yeah, Float("1.0e-100") is cool too
nwertman has joined #ruby
<awestroke> shevy: I use to_i when I want an integer no matter what, and I want 0 when the value isn't an integer
<awestroke> if you want an exception when it's not a valid integer format, use to_int / Integer()
Takehiro has quit [Remote host closed the connection]
<awestroke> oops there is no to_int
<Hanmac> the methods like Float(), Integer(), Reational() can parse so freaking strings like "0xFF" and "1.0e-100" ... the to_* cant do it
gruwl has joined #ruby
<Hanmac> awestroke there are to_int but they are for the numeric childs
lggr has quit [Ping timeout: 260 seconds]
gruwl has quit [Client Quit]
icole has joined #ruby
gruwl has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
bbttxu has quit [Quit: bbttxu]
sepp2k has quit [Ping timeout: 245 seconds]
samphippen has joined #ruby
sepp2k has joined #ruby
lggr has joined #ruby
djdb has quit [Remote host closed the connection]
kjellski has quit [Quit: This computer has gone to sleep]
Takehiro has joined #ruby
rakm has joined #ruby
fredjean has quit [Quit: Computer has gone to sleep.]
sent-hil has joined #ruby
wpaulson has joined #ruby
Asher has joined #ruby
My_Hearing has quit [Read error: Connection reset by peer]
arturaz has quit [Ping timeout: 246 seconds]
Elico1 has quit [Ping timeout: 245 seconds]
c0rn__ has joined #ruby
Elico1 has joined #ruby
CannedCorn has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 252 seconds]
My_Hearing has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
iNerd has joined #ruby
gruwl has quit [Quit: Computer has gone to sleep.]
<lectrick> How do I tell a block what a call to "self" inside it should refer to?
havenn has quit [Remote host closed the connection]
daniel_hinojosa has joined #ruby
<lectrick> In this case the block is saved as an instance attribute, but I want any call to "self" in the block to refer to the instance itself that the attribute is defined on
mikepack has quit [Remote host closed the connection]
Elico1 has quit [Read error: Operation timed out]
Criztian has quit []
lggr has joined #ruby
<Hanmac> @obj.instance_eval{ ... }
alfism has joined #ruby
daniel_hinojosa has quit [Read error: No route to host]
cpetzold has joined #ruby
cpetzold has left #ruby [#ruby]
leehambley has quit [Quit: leehambley]
steffes has joined #ruby
cj3kim has joined #ruby
<lectrick> So @obj.instance_eval{ @obj.attribute_containing_a_block.call } ?
Elico1 has joined #ruby
daniel_hinojosa has joined #ruby
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
skaczor has quit [Ping timeout: 246 seconds]
IrishGringo has quit [Ping timeout: 240 seconds]
samphippen has quit [Ping timeout: 246 seconds]
snearch has joined #ruby
steffes_ has joined #ruby
cardoni has joined #ruby
fyolnish has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
steffes_ has quit [Remote host closed the connection]
daniel_hinojosa has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
mercwithamouth has quit [Ping timeout: 244 seconds]
jgrevich_ has joined #ruby
jcoglan has quit [Ping timeout: 245 seconds]
steffes has quit [Ping timeout: 248 seconds]
jgrevich has quit [Ping timeout: 240 seconds]
jgrevich_ is now known as jgrevich
Elico1 has quit [Quit: Elico1]
fyolnish has quit [Ping timeout: 260 seconds]
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
irleif has joined #ruby
daniel_hinojosa has joined #ruby
mikepack has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
pdtpatrick has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
samphippen has joined #ruby
gruwl has joined #ruby
<rehat> is there a onliner to convert an array of string numbers into an array of numbers
xiexie_11 has joined #ruby
<steakknife> %w|1 2 3 4|.map(&:to_i)
fyolnish has joined #ruby
gruwl has left #ruby [#ruby]
<TTilus> lectrick: no, @obj.instance_eval @obj.attribute_containing_a_block
<TTilus> lectrick: iirc
<rehat> steakknife: thanks
iamjarvo has joined #ruby
ndboost has joined #ruby
<rehat> what is this operator called "$:"
whaley has quit [Remote host closed the connection]
<ndboost> in ruby how can i properly do the following code, without it adding two sets of quotes around class="frontend-page"
<ndboost> <body <%= (controller.controller_name == 'home') ? 'class="frontend-page" ' : '' -%> >
<rehat> sorry "&:"
<ndboost> class=""frontend-page""
lggr has joined #ruby
<ndboost> is what im getting
<steakknife> fancy way to call a method using it's atom name
<TTilus> rehat: operator is &
<canton7> rehat, look for Symbol#to_proc
Rydefalk_ has joined #ruby
<rehat> thanks
Rydefalk has quit [Read error: Connection reset by peer]
<TTilus> rehat: unary ampersand in param list tells ruby thet the particular param is to be treated the block param
<TTilus> rehat: even if it is not a block
samphippen has quit [Ping timeout: 246 seconds]
<lectrick> rehat: google "method to proc"
<blazes816> ndboost: try #rubyonrails, but probably you want to call #html_safe on the string
<TTilus> rehat: and in case it is not, #to_proc is called on it to make it one
sarmiena_ has joined #ruby
ken_barber has joined #ruby
<steakknife> uncut theatrical version: ["1", "2", "3", "4"].map do |x| x.to_i end
<rehat> TTilus: thanks dude
<steakknife> do ... end is a proc
fyolnish has quit [Ping timeout: 264 seconds]
Rydefalk_ has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
mgates has joined #ruby
nightfalcon has quit [Quit: Lost terminal]
<TTilus> rehat: and Symbol#to_proc does Proc.new { |x| x.send self }
g-ram has joined #ruby
<canton7> steakknife, it's a block, surely?
Takehiro has quit [Remote host closed the connection]
Jay_Levitt has joined #ruby
<steakknife> And what type is a &block?
whaley has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
Asher has quit [Ping timeout: 246 seconds]
<canton7> steakknife, I'm getting lambdas and procs muddled in my tiredness - ignore me!
Vainoharhainen has joined #ruby
<TTilus> steakknife: there is a suble difference, do ... end is a block and it gets converted to proc on the way
pfaff has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 264 seconds]
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk_ has joined #ruby
ChampS666 has joined #ruby
<steakknife> And there are a whole bunch of non-closure lexical anomalies between { } and do end
Ankhers has quit [Remote host closed the connection]
<steakknife> Don't get me started, or i'm liable to submit a patch
Asher has joined #ruby
<steakknife> ;)
leehambley has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<TTilus> canton7: lambda returns the block given to it as proc
Rydefalk has joined #ruby
graft has quit [Quit: leaving]
Vainoharhainen has quit [Client Quit]
ChampS666 has quit [Client Quit]
cardoni has quit [Quit: cardoni]
senny has joined #ruby
<canton7> really? I had it in mind the main proc/labmda difference was the scope of break/return, and some subtle stuff to do with argument omissions
Rydefalk_ has quit [Read error: Connection reset by peer]
<steakknife> Proc binding should be faster, they are uses so often.
samphippen has joined #ruby
<steakknife> used*
<steakknife> Yeap.
ForevernadeAFK has joined #ruby
leehambley has quit [Read error: Connection reset by peer]
lggr has joined #ruby
<steakknife> There are i think 5 different lambda/proc/Proc constructions that result in about 3 thingies (technical term), depending on ruby ver/platform.
_nitti has quit [Remote host closed the connection]
niklasb has joined #ruby
<canton7> so the 'proc' and 'Proc.new' methods turned a block into a proc (in 1.9, 'proc' in 1.8 did something different), but a lambda behaved more like a method
<steakknife> Anyone every write a combinator library out of procs?
Asher has quit [Client Quit]
<steakknife> I'm looking for a combinator table, esp the universal combinator.
<steakknife> iota preferred.
ltsstar has joined #ruby
<TTilus> canton7: you are right, i was confused, too late apparently
sarmiena_ has quit [Quit: sarmiena_]
asuka has quit [Ping timeout: 244 seconds]
My_Hearing has quit [Read error: Connection reset by peer]
Forevernade has quit [Ping timeout: 260 seconds]
pfaff has joined #ruby
<steakknife> ι = λ x . x (λ f g y . f y (g y)) (λ y z . y) :D
Rydefalk_ has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
GoGoGarrett has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
<notbrent> what is the difference between self.class.new and just new?
enroxorz-work has quit [Read error: Connection reset by peer]
Rydefalk_ has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 248 seconds]
<TTilus> steakknife: jimweirich did his ycombinator talk at frozenrails, saw it there
Rydefalk has joined #ruby
<steakknife> ycombinator, bah, too simple ;)
<blazes816> zcombinator
<steakknife> yc was a joke, now it's a business school
<TTilus> notbrent: self.class.new and self.new (which "just new" is) call new on diffderent objects, except when self is Object
Takehiro has joined #ruby
<steakknife> TTilus: anyhow, pg needs a good jab every now and then.
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
<TTilus> steakknife: pg? (sorry im slow now)
ken_barber has quit [Remote host closed the connection]
lggr has joined #ruby
<steakknife> sorry, valley lingo
Russell^^ has joined #ruby
<notbrent> TTilus: right, makes sense - self.class.new on instance method == self.new on class method
<notbrent> thanks
apok_ has joined #ruby
asteve has quit [Ping timeout: 240 seconds]
asteve has joined #ruby
mars__ has quit [Quit: Leaving]
Virunga has joined #ruby
jenrzzz has joined #ruby
Takehiro has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
asuka has joined #ruby
awarner has joined #ruby
apok has quit [Ping timeout: 245 seconds]
apok_ is now known as apok
<steakknife> TTilus: zomg, missed flowdock at frozenrails
zinjacoder has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
<steakknife> random q, is there yet a crossroads io gem?
cascalheira has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 256 seconds]
ryanlabouve has joined #ruby
mercwithamouth has joined #ruby
<tbrock> hey guys, is anyone here amazing with loadpaths?
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
<tbrock> i've got a problem where i'm explicitly saying gem 'test-unit' require 'test/unit' and it isn't loading test unit 2.x
argoneus has left #ruby ["Leaving"]
<tbrock> instead it constantly uses the one inside rub
<tbrock> ruby*
<tbrock> bundle exec works but it throws hundreds of errors for our test suite
<steakknife> answering own q, ffi-rxs
<tbrock> running it outside of rake works fine
<TTilus> steakknife: you were there?
Asher has joined #ruby
bbttxu has joined #ruby
<steakknife> TTilus: schedule conflict sadly
<steakknife> I was in europe for most of the summer, so not a huge loss generally.
<TTilus> steakknife: did you miss deveo talk too? :)
cableray has joined #ruby
lggr has joined #ruby
<steakknife> i'll check it out, but codebasehq is pretty hard to beat
<rakm> how do I search the inerwebs to see what the |= method does?
<steakknife> depends on needs
<rakm> googling and searching ruby-docs doesn't work
cardoni has joined #ruby
<rakm> always run into this problem with operators
stim371 has quit [Quit: stim371]
IrishGringo has joined #ruby
<TTilus> rakm: doesnt any core rdoc list that operator too?
scx has joined #ruby
<TTilus> rakm: i mean apidock, rdock.info and all the official options
Rydefalk_ has joined #ruby
<steakknife> deveo.com FAIL
Rydefalk has quit [Read error: Connection reset by peer]
<rakm> I looked at fixnum and array classes on ruby-doc.org but it wasn't in there list of methods
reset has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
SegFaultAX|work has quit [Ping timeout: 260 seconds]
<tbrock> anyone?
daniel_-_ has joined #ruby
ledao1 has quit [Read error: Connection timed out]
<TTilus> rakm: ah, sorry, its syntactic sugar, you should be looking for pipe operator
apok_ has joined #ruby
apok has quit [Remote host closed the connection]
apok_ is now known as apok
bmxpert1 has joined #ruby
advorak has joined #ruby
bmxpert1 has quit [Client Quit]
<rakm> ahh thanks TTilus googleing "single pipe equals ruby" did the trick.
daniel_- has quit [Ping timeout: 240 seconds]
<rakm> although still most of the resluts are for double pipe equals
lggr has joined #ruby
jcaudle is now known as jcaudle_
<steakknife> rakm: trick to remembering double operator || is logical, single operator | is binary.
g-ram has quit [Quit: Computer has gone to sleep.]
irleif has quit [Quit: Computer has gone to sleep.]
<steakknife> x = 2 ; x |= 1 ; x # => 3
Asher has quit [Quit: Leaving.]
jcaudle_ is now known as jcaudle
irleif has joined #ruby
<rakm> right. I'm new to this whole programming thing so I don't quite understand binary operators yet, but my question was more about how to look these up since you can't just google the actual operator
skaczor has joined #ruby
<rakm> thanks the for the tip
<Hanmac> steakknife: i = 4; [1,2,3].each {|i| }; i #=> quess i after the loop
gazler has joined #ruby
heftig has joined #ruby
robustus has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
soulisson has joined #ruby
<steakknife> rakm: binary usually means dealing with integers, boolean means true, false
<steakknife> rakm: check out http://rubymonk.com, it's awesomesauce
lggr has joined #ruby
mgates has quit [Quit: mgates]
<rakm> ooh nice, i should go through rubymonk again. it's been a while. only went through their basic ones ebfore
a_a_g has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
mgates has joined #ruby
Rydefalk_ has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
vlad_starkov has joined #ruby
<steakknife> the other free one is ruby koans
<Hanmac> and steakknife, do you solv my guessing?
workmad3 has quit [Ping timeout: 252 seconds]
Rydefalk_ has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
kirun has joined #ruby
philcrissman has quit [Remote host closed the connection]
<steakknife> Hanmac, go troll someone else that's not busy.
<steakknife> But thanks anyhow :)
xorigin has joined #ruby
macmartine has joined #ruby
<steakknife> Ignore banhammer complete.
sarmiena_ has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
philcrissman has joined #ruby
<TTilus> rakm: check web.njit.edu/all_topics/Prog_Lang_Docs/html/ruby/syntax.html#assign on self assignment
xorigin has left #ruby [#ruby]
<wmoxam> Hanmac: I would guess 3
rbennacer has joined #ruby
<fbernier> 4
<steakknife> wmoxam ignored
<TTilus> rakm: a op= b is a shorthand for a = a op b
awarner has quit [Ping timeout: 252 seconds]
chimay has quit [Quit: WeeChat 0.4.0-dev]
pseudo has quit [Ping timeout: 246 seconds]
<wmoxam> lolwat
<rakm> got it. thanks TTilus
fyolnish has joined #ruby
<rbennacer> i am using CSV library to generate a csv file , the problem is in some attribute the character ',' exist and it is creating problems when i try to open it with excel. ex: "rege ,greg re " wil be devided in 2 column and it shoudl be in one
<steakknife> needs escaping
<Hanmac> wmoxam & fbernier you are both right, depending on the ruby version
awarner has joined #ruby
<steakknife> excel IIRC quotes csv in that case
lggr has joined #ruby
<wmoxam> Hanmac: that changed in 1.9?
<steakknife> "a, a, a",b,"c, ,c ,c c"
c0rn__ has quit [Quit: Computer has gone to sleep.]
Takehiro has joined #ruby
<fbernier> I started ruby and 1.9 was already out :)
<wmoxam> hrmmm, appears so
<steakknife> rbennacer: see also http://creativyst.com/Doc/Articles/CSV/CSV01.htm
vlad_starkov has quit [Ping timeout: 245 seconds]
<Hanmac> wmoxam right, in 1.9 the block variable does only shadow local variables, they does not overwide them like in 1.8
<wmoxam> Hanmac: I'm not sure that I like that
<wmoxam> I guess it's supposed to make scoping more sensible or something
fermion has joined #ruby
<wmoxam> but I find it makes it more confusing :p
irleif has quit [Quit: Computer has gone to sleep.]
<wmoxam> [1,2,3].each {|i| } # 4; [1,2,3].each {|i| i = i} # 3
<wmoxam> :p
<Hanmac> i dont care about 1.8 ... imo its allready dead
vjt has quit [Remote host closed the connection]
vjt has joined #ruby
<wmoxam> I'm switching stuff off 1.8 soonish
<wmoxam> want to move a few remaining apps to Rails 3+ first
<fbernier> 1.8 is so unsupported nowadays
<wmoxam> fbernier: I haven't run into much trouble
<awestroke> 1.8 is fantastic! With default settings, 1.8 udpsockets are 3x slower than tcpsockets
<wmoxam> ported one gem to 1.8
<rbennacer> i am using the CSV.open(filename, 'w',:col_sep => ",") do |csv|, but it is still not escaping the commas
<awestroke> rbennacer: try fastercsv gem
<steakknife> fastercsv FTW
lggr has quit [Ping timeout: 260 seconds]
fyolnish has quit [Remote host closed the connection]
jakzale has quit [Ping timeout: 260 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
booyakah has joined #ruby
elux has quit [Quit: Leaving...]
elux has joined #ruby
booginga1000 has quit [Quit: Leaving]
<fbernier> fastercsv is the default csv in 1.9
<rbennacer> i am using 1.9.2
gmci has joined #ruby
<rbennacer> and it is causing a roblem
lggr has joined #ruby
<rbennacer> problem
<booyakah> Hi guys. Ruby newbie here and trying to learn. I have a small script where I'm trying database access
<booyakah> this gives me
<booyakah> sqlite.rb:9:in `<main>': undefined method `>' for [[7]]:Array (NoMethodError)
Rydefalk_ has quit [Read error: Connection reset by peer]
<booyakah> it complains on the operator greater then
<booyakah> what am i doing wrong?
irleif has joined #ruby
Rydefalk has joined #ruby
_nitti has joined #ruby
<wmoxam> booyakah: exactly what the error message says
<wmoxam> booyakah: you're invoking '>' on an array
<wmoxam> booyakah: on line 9
<booyakah> oohhh of course
<booyakah> it's been a while since I coded
<booyakah> i'm rusty as shit
Rydefalk_ has joined #ruby
carloslopes has quit [Read error: Connection reset by peer]
<booyakah> (and i've never done ruby)
wpaulson has quit [Ping timeout: 256 seconds]
Rydefalk has quit [Read error: Connection reset by peer]
relative has quit [Quit: Page closed]
<awestroke> booyakah: Use irb ALOT. It's awesome
<awestroke> just paste in the line that doesn't work, play around with it until it works, copy it back
Jork1 has quit [Quit: Jork1]
<booyakah> i know irb is great i haven't learned it properly yet though
Rydefalk has joined #ruby
Rydefalk_ has quit [Read error: Connection reset by peer]
<booyakah> but i couldn't just post that line in my example?
Rydefalk has quit [Read error: Connection reset by peer]
My_Hearing has quit [Ping timeout: 260 seconds]
Vainoharhainen has joined #ruby
Rydefalk has joined #ruby
ledao has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
_nitti has joined #ruby
<steakknife> booyakah: get pry. it's better.
Chryson has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
<booyakah> steakknife, thanks will look into it
<steakknife> booyakah: gem install pry pry-gist
carloslopes has joined #ruby
Meon has quit [Quit: Leaving]
lggr has quit [Ping timeout: 260 seconds]
<wmoxam> steakknife ignored
jenrzzz has quit [Ping timeout: 246 seconds]
mercwithamouth has quit [Ping timeout: 260 seconds]
rippa has quit [Ping timeout: 256 seconds]
ananthakumaran has quit [Quit: Leaving.]
rburton- has joined #ruby
lggr has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
iNerd has quit [Quit: iNerd]
invisime has quit [Quit: Leaving.]
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
jcaudle has quit [Quit: jcaudle]
Juul has joined #ruby
SegFaultAX|work has joined #ruby
<lectrick> If I pass a block to object.instance_eval, and that block takes 1 parameter, why is the 'object' yielded to the block, when 'self' inside the block refers to the object, anyway?
<lectrick> Hanmac: ^
<lectrick> Basically I want to instance_eval a block which takes an arg, but I want it to take MY arg and not yield self by default
elux has quit [Quit: Leaving...]
scx has quit [Ping timeout: 240 seconds]
fredjean has joined #ruby
johnmilton has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
scx has joined #ruby
ndboost has quit [Remote host closed the connection]
stim371 has joined #ruby
<Hanmac> and what arg are you want to yield?
lggr has joined #ruby
burgestrand has joined #ruby
<heftig> lectrick: use instance_exec
c0rn_ has joined #ruby
asuka has quit [Ping timeout: 256 seconds]
<lectrick> Hanmac: I am storing a block which takes an arg, and I want to be able to call it later with an arg, and have self be the instance with the instance variable holding the block.
cj3kim has quit [Quit: This computer has gone to sleep]
cj3kim has joined #ruby
asuka has joined #ruby
<lectrick> heftig: oh wow, i think that's the answer. "Unfortunately, instance_eval does not currently allow you to pass parameters.". You know, if I had a way to beer people over the Internet, I'd be poor.
JonnieCache|work has joined #ruby
mgates has quit [Quit: mgates]
mgates has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
sspiff has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
cj3kim has quit [Client Quit]
asuka has quit [Remote host closed the connection]
asuka has joined #ruby
pseudo has joined #ruby
elux has joined #ruby
Asher has joined #ruby
rbennacer has left #ruby ["Leaving"]
lggr has joined #ruby
skaczor has quit [Ping timeout: 252 seconds]
<lectrick> heftig: I made it work thanks to that. Tests pass :) Hanmac: what heftig said worked. I basically needed an instance_eval that takes params, which is what instance_exec is.
<lectrick> ok is it 'params' or 'args' because I seem to use those interchangeably but I know there is a zealot out there who will happily correct me
_Mon_Ouie_ has joined #ruby
piotr_ has joined #ruby
heftig has quit [Quit: leaving]
Jork1 has joined #ruby
_Mon_Ouie_ is now known as Mon_Ouie
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
piotr__ has quit [Ping timeout: 246 seconds]
c0pp3rnick has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
My_Hearing has quit [Ping timeout: 260 seconds]
<c0pp3rnick> how can I send POST request with arguments shoved in the request body, and not query params (GET-like behaviour)
Mon_Ouie has quit [Read error: Connection reset by peer]
<hoelzro> c0pp3rnick: sorry, could you repeat that?
<hoelzro> EPARSE
JonnieCache|work has quit [Ping timeout: 260 seconds]
Zai_ has joined #ruby
tbrock has quit [Quit: Leaving]
<c0pp3rnick> hoelzro, I'm using 'net/http' to send POST/GET requests
xiexie_11 has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 256 seconds]
<hoelzro> ok
geekbri has quit [Remote host closed the connection]
<c0pp3rnick> GET request params are shoved in URL, like in google ?q=<something>&lang=en&somethingelse=<somethingelsest>
Mon_Ouie has joined #ruby
iamjarvo has joined #ruby
dekroning has joined #ruby
<c0pp3rnick> but the problem is that I get 414 errors when using POST too
<c0pp3rnick> (URL too long)
whaley has quit [Remote host closed the connection]
<c0pp3rnick> so I'd like to send POST params in a request body
<hoelzro> I'm sorry; I don't follow. How is that different from a regular POST?
whaley has joined #ruby
steffes has joined #ruby
yoklov has joined #ruby
lggr has joined #ruby
heftig has joined #ruby
<workmad3> c0pp3rnick: simple, set the body for a post request rather than the query string
<c0pp3rnick> workmad3, how? =)
<workmad3> c0pp3rnick: check out the docs for net/http, it's in there :P
<c0pp3rnick> okay, so it was RTFM after all, thanx workmad3 =)
<workmad3> (which I know, because that's where I have to go every time I want to use the f***ing library because it's annoying)
macmartine has quit [Quit: Computer has gone to sleep.]
ken_barber has joined #ruby
<workmad3> c0pp3rnick: you could also consider a library like httparty, which wraps net/http in a nicer, more ruby-esque syntax that's easier to write :)
<lectrick> ok, how many use cases are better off using each_with_object instead of inject? FIGHT!
<c0pp3rnick> workmad3, thanx, will check it out
snearch has quit [Quit: Verlassend]
skaczor has joined #ruby
* lectrick is relieved that he can wave his nerd flag all over the fucking place in here, thank you all
chimkan_ has joined #ruby
stephenjudkins has joined #ruby
<dekroning> I've got a question about what type of variable "random_num" is in the following example: http://pastie.org/4910569
<workmad3> lectrick: all the use cases where each_with_object is right
<hoelzro> dekroning: yes?
iamjarvo has quit [Ping timeout: 245 seconds]
Takehiro has quit [Remote host closed the connection]
thillux_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Targen has joined #ruby
Xeago has joined #ruby
Roa has quit [Ping timeout: 256 seconds]
iNerd has joined #ruby
<lectrick> workmad3: Of course.
cakehero has quit [Quit: Computer has gone to sleep.]
Guedes is now known as Guedes_out
nanderoo has quit [Quit: Leaving.]
g-ram has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
<dekroning> hoelzro: is there a specific name for such variable? it's not an instance variable right? local class variable perhaps ?
skaczor has quit [Ping timeout: 246 seconds]
<kenneth> hey, how would you spec something with spec as "not throwing an exception"
DrShoggoth has joined #ruby
thillux has quit [Ping timeout: 260 seconds]
<hoelzro> I'd say it's a local variable
<rehat> do I need to know about ruby dbi if I am using rails?
iamjarvo has joined #ruby
adamkittelson has quit [Remote host closed the connection]
lggr has joined #ruby
<Hanmac> rehat yes you should
<dekroning> hoelzro: local variable in which scope?
<hoelzro> dekroning: the class body
fermion has quit [Ping timeout: 256 seconds]
s0ber_ has joined #ruby
<dekroning> hoelzro: so what's the difference in variable type between random_num and RANDOM (besides that it's a constant)
steffes_ has joined #ruby
<dekroning> hoelzro: because line #9 I can't replace it with "random_num" it will say undefined local variable
<hoelzro> dekroning: afaik, random_num goes out of scope after the class body is done
johnmilton has quit [Quit: peace]
<hoelzro> whereas RANDOM will not
<workmad3> dekroning: 'class', 'module' and 'def' are all ruby keywords that create a new scope for local variables
rburton- has quit [Quit: Linkinus - http://linkinus.com]
<workmad3> dekroning: any local variable outside of the scope defined by one of those keywords can't be used inside
<Hanmac> workmad3 blockvariabes are also in an extra scope under 1.9+
daniel_hinojosa has quit [Ping timeout: 264 seconds]
s0ber has quit [Ping timeout: 256 seconds]
<workmad3> Hanmac: true
s0ber_ is now known as s0ber
<hoelzro> Hanmac: I thought they always were?
<workmad3> hoelzro: no, they weren't pre 1.9
<hoelzro> except 1.9 allows you to explicitly introduce them
MikeyV27_ has joined #ruby
<booyakah> Okay I can't handle this so I'll just ask. Could someone tell me how I should perform this?
<booyakah> line 9
<booyakah> I've tried for like 30 minutes now googling and stuff but I can't figure it out
lggr has quit [Ping timeout: 260 seconds]
_bart has joined #ruby
nat2610 has quit [Quit: Leaving.]
steffes has quit [Ping timeout: 248 seconds]
sqlbyme has joined #ruby
<Hanmac> booyakah:change "if result > 0" to "if result[0][0] > 0"
lteo has quit [Quit: leaving]
<booyakah> wtf really?
<booyakah> i did "if result[0] > 0"
piotr__ has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
lupine_85 has quit [Ping timeout: 260 seconds]
nat2610 has joined #ruby
sqlbyme has quit [Client Quit]
MikeyV27 has quit [Ping timeout: 246 seconds]
piotr_ has quit [Ping timeout: 260 seconds]
sqlbyme has joined #ruby
fyolnish has joined #ruby
lggr has joined #ruby
the_jeebster1 has joined #ruby
dmiller_ has joined #ruby
Coolhand has quit [Ping timeout: 246 seconds]
iamjarvo has quit [Ping timeout: 245 seconds]
sarmiena_ has quit [Quit: sarmiena_]
Araxia has joined #ruby
g-ram has joined #ruby
<the_jeebster1> I've got an array x = [1, 2, 3]. Is there any same-line shorthand notation to assign the returned values of a detect to another variable x.detect { |n| n > 2 }
<the_jeebster1> in other words, can I say if a value is returned from x.detect { |n| n > 2 }, assign it to y all in one line?
nat2610 has quit [Client Quit]
fram has quit [Remote host closed the connection]
minijupe has joined #ruby
Rydefalk has quit [Ping timeout: 264 seconds]
<Hanmac> like this?
<Hanmac> y = x.detect { |n| n > 2 }
MikeyV27_ has quit [Ping timeout: 246 seconds]
minijupe has quit [Client Quit]
Asher has quit [Quit: Leaving.]
fyolnish has quit [Ping timeout: 260 seconds]
_nitti has quit [Remote host closed the connection]
Rydefalk has joined #ruby
<the_jeebster1> yeah. that was dumb :)
<the_jeebster1> mid-day brainfart
<iNerd> hmm
<iNerd> bundler is being a dick, won't find a locally installed gem
lggr has quit [Ping timeout: 255 seconds]
colinbm has joined #ruby
Eplemosen has quit [Quit: NOPE]
samuel02 has joined #ruby
daniel_hinojosa has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
irleif has joined #ruby
lggr has joined #ruby
a_a_g has quit [Quit: Leaving.]
wallerdev has quit [Quit: wallerdev]
_bart has quit [Quit: _bart]
<booyakah> Hanmac, that seems to work in that example. Thank you
bbttxu has quit [Ping timeout: 248 seconds]
<booyakah> However, I have another weird problem
<workmad3> iNerd: is the gem added to your Gemfile?
<booyakah> I am trying to make a IRC bot with Cinch
<iNerd> sigh
wedtm is now known as wedtm|away
Sulaweyo1 has joined #ruby
<iNerd> forgot the comma before version number
<iNerd> it's always something simple that takes you ages
<booyakah> I am trying to use this in chooseClass
<booyakah> here
<booyakah> and i get this weird error message that i do not understand
bluOxigen has quit [Ping timeout: 255 seconds]
<booyakah> gah hold on
<booyakah> have to update that error message
wallerdev has joined #ruby
<booyakah> here is the error message
<booyakah> when i'm trying to do !class
<booyakah> wtf is NilClass?
<booyakah> it works as expected in delClass but not in chooseClass
lggr has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
<Hanmac> hm do this: if result && result[0][0] > 0
khakimov has quit [Quit: Computer has gone to sleep.]
_nitti has joined #ruby
<booyakah> Hanmac, same error message
jgarvey has joined #ruby
<booyakah> i cannot wrap my head around this. why is it working in delClass but not in chooseClass?
fmcgeough has quit [Quit: fmcgeough]
eldar has quit []
<Hanmac> hm "p result" before the error
lggr has joined #ruby
<booyakah> hmm what Hanmac?
<booyakah> that i did not understand
<booyakah> aha
<booyakah> puts result
<booyakah> hold on
_nitti_ has joined #ruby
sailias has quit [Ping timeout: 260 seconds]
<bricker> To clarify - `true ^ false` means true OR false, but not BOTH, correct?
<bricker> whereas `true || false` means "true or false, or both"
<Spooner> bricker, yes, XOR vs OR
senny has quit [Remote host closed the connection]
<bricker> Spooner: thankds
<bricker> thanks*
<booyakah> Hanmac, nothing changed. It doesn't output anything
<Hanmac> :/
<booyakah> (except the error)
_nitti has quit [Ping timeout: 260 seconds]
Xeago has quit [Read error: Connection reset by peer]
IrishGringo has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 264 seconds]
_bart has joined #ruby
booyakah_ has joined #ruby
booyakah has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
booyakah_ is now known as booyakah
gqlewis has joined #ruby
booyakah has quit [Client Quit]
yoklov has quit [Quit: computer sleeping]
booyakah has joined #ruby
Sulaweyo1 has quit [Quit: Leaving.]
mengu has joined #ruby
gqlewis has quit [Remote host closed the connection]
<rehat> http://pastie.org/4910747 this seems to hang on the terminal
Sulaweyo1 has joined #ruby
<rehat> do I need to do something special for the require 'socket' when running it through the command line?
stan_man_can has joined #ruby
nat2610 has joined #ruby
Sulaweyo1 is now known as informatician
yoklov has joined #ruby
<stan_man_can> Is there anything similar in Ruby to PHP's strtotime? I have a bunch of times that are formatted kind of randomly, it could be "5 mins" "5 minutes" "1 hour" ect.
lggr has joined #ruby
<booyakah> Hanmac, no more ideas?
<Hanmac> i dont know :(
<booyakah> okay
<booyakah> thanks anyway
hoelzro is now known as hoelzro|away
informatician is now known as zenformatics
<booyakah> this is so weird
robustus has quit [Ping timeout: 255 seconds]
<stan_man_can> PHP I could do something like time() - strtotime("+$delay") and it returns the time in seconds
<stan_man_can> so if $delay = "1 hour" then it reruns 3600, $delay = "5 mins" it returns 300
zenformatics has quit [Client Quit]
mark_locklear has quit [Remote host closed the connection]
<blazes816> stan_man_can: active support has a bunch of junk of that volition
zenformatics has joined #ruby
<blazes816> stan_man_can: actually, check out Chronic
chrisja has quit [Quit: leaving]
_nitti_ has quit [Remote host closed the connection]
<blazes816> stan_man_can: https://github.com/mojombo/chronic
<Hanmac> stan_man_can DateTime.strptime
<blazes816> or that :(
parzorep has quit [Quit: parzorep]
gqlewis has joined #ruby
sent-hil has quit [Remote host closed the connection]
<Hanmac> but i think if you want php like stuff you need chronic ...
<blazes816> yes!
baphled has joined #ruby
gqlewis has quit [Remote host closed the connection]
wargasm1 has joined #ruby
wargasm has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 244 seconds]
slainer68 has joined #ruby
steffes_ has quit [Remote host closed the connection]
robertotauille has quit [Quit: Leaving...]
t0rc has joined #ruby
sarmiena_ has joined #ruby
lggr has joined #ruby
adamkittelson has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
adamkittelson has quit [Remote host closed the connection]
zii has joined #ruby
griffindy has joined #ruby
jenrzzz has joined #ruby
gmci has quit [Ping timeout: 246 seconds]
Mon_Ouie has quit [Ping timeout: 245 seconds]
gmci has joined #ruby
Mon_Ouie has joined #ruby
asteve has quit []
Araxia has quit [Read error: Connection reset by peer]
_nitti has joined #ruby
cakehero has joined #ruby
BinaryMaster has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
cj3kim has joined #ruby
mgates has quit [Quit: mgates]
<BinaryMaster> Question: /usr/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED) … I can hit the url in a browser any ideas what may cause this?
mrck has joined #ruby
<blazes816> many things. whats the url?
<blazes816> is it public?
mgates has joined #ruby
Araxia has joined #ruby
<BinaryMaster> yes
whaley has quit [Remote host closed the connection]
<blazes816> that doesn't work for me
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
lggr has joined #ruby
<blazes816> in browser or in curl
<blazes816> which would be your issue
pfaff has quit [Ping timeout: 245 seconds]
<BinaryMaster> :(
<Hanmac> the url does not work in my browser
<blazes816> http://webcache.googleusercontent.com/search?q=cache:http://www.truesarasota.com/sitemap.xml
<blazes816> works
<blazes816> something is up with the site
<blazes816> are you sure it works for you?
<BinaryMaster> I just pulled it up
<BinaryMaster> yes
<blazes816> hmm
<blazes816> do you work for them? i.e. are you on their network?
<BinaryMaster> Yes
<blazes816> talk to ops
<blazes816> you guys are down
<BinaryMaster> lol … Okay but I don't know if I will listen to myself :)
<blazes816> also sitemap.xml is actually html
linoj has quit [Quit: linoj]
<blazes816> haha
<BinaryMaster> can you hit the root
<blazes816> you ops people
<blazes816> nope
<blazes816> not at all
<BinaryMaster> interesting
cantonic has quit [Read error: Connection reset by peer]
<BinaryMaster> thank you
<blazes816> np
<blazes816> good luck
IrishGringo has joined #ruby
cantonic has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
irleif has quit [Quit: Computer has gone to sleep.]
sarmiena_ has quit [Quit: sarmiena_]
sarmiena_ has joined #ruby
Virunga has quit [Remote host closed the connection]
darule has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
_bart has left #ruby [#ruby]
pseudo has quit [Ping timeout: 255 seconds]
<BinaryMaster> well that was fun is it up for you now?
aetaric has quit [Quit: Got ZNC?]
sent-hil has joined #ruby
<blazes816> BinaryMaster: you're up!
gmci has quit [Ping timeout: 240 seconds]
g-ram has joined #ruby
<BinaryMaster> good :)
solidus-river has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
<solidus-river> if i wanted to regex checking for the end of a string to match a specific string how would i do that using ruby
<solidus-river> i'm used to *endname
<solidus-river> but that seems invalid according to rails regex
<solidus-river> er, ruby regex, sorry
lggr has joined #ruby
<solidus-river> 1.9.3
irleif has joined #ruby
<blazes816> "this string should end in a dance party".match /a dance party$/
<blazes816> $ anchors a regex to the end of a string
<blazes816> (not sure if this answers your questions, I didn't totally understand it)
<Hanmac> "abcde".end_with?("de")
pcarrier_ is now known as pcarrier
<solidus-river> cool thanks! those are both it, which is preferred, is .end_with faster because it can assume your just checing for the end, or does it really matter at all
tommyvyo has quit [Quit: Computer has gone to sleep.]
<bperry> Hanmac: I would be interested to see which of those was the fester one
<canton7> blazes816, actually $ is the end of the line in ruby, confusingly
poindontcare has quit [Remote host closed the connection]
poindontcare has joined #ruby
<BinaryMaster> what kind of quoting do I need to use with mysql statements in ruby
catphish has joined #ruby
<blazes816> canton7: wtf
catphish has left #ruby [#ruby]
<blazes816> anybody have any idea why that decision was made?
zenformatics has quit [Quit: Leaving.]
<canton7> it's caused a number of security holes I believe. \A and \Z or \z match the beginning and end of the entire string
elux has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 256 seconds]
the_jeebster1 has left #ruby [#ruby]
skaczor has joined #ruby
zenformatics has joined #ruby
lggr has joined #ruby
und3f has joined #ruby
<blazes816> i'm interested to find out more. googling now. but it seems like a massive php-ism
griffindy has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
recycle has joined #ruby
zenformatics has quit [Client Quit]
zenformatics has joined #ruby
margle has joined #ruby
cardoni has quit [Quit: cardoni]
tnk1 has quit [Ping timeout: 246 seconds]
rabidpraxis has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
und3f has quit [Ping timeout: 245 seconds]
tnk1 has joined #ruby
alfism has quit [Quit: alfism]
stephenjudkins has quit [Client Quit]
ncr100_ has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
cardoni has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 244 seconds]
ncr100 has quit [Ping timeout: 255 seconds]
macmartine has joined #ruby
lggr has joined #ruby
wedtm|away is now known as wedtm
ryanlabouve has quit [Quit: Computer has gone to sleep.]
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Asher has joined #ruby
irleif has joined #ruby
ncr100_ has quit [Ping timeout: 256 seconds]
ryanlabouve has joined #ruby
c0pp3rnick has quit [Ping timeout: 240 seconds]
carloslopes has quit [Quit: Leaving.]
jenrzzz has quit [Ping timeout: 256 seconds]
whitenoise has quit [Quit: This computer has gone to sleep]
lggr has quit [Ping timeout: 255 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
rabidpraxis has joined #ruby
timrom_ has joined #ruby
timrom has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
williamcotton has quit [Quit: williamcotton]
gmci has joined #ruby
xclite has quit [Quit: Leaving]
Xeoncross has joined #ruby
recycle has quit [Remote host closed the connection]
workmad3 has joined #ruby
ltsstar has quit [Quit: ltsstar]
cj3kim has joined #ruby
chrishunt has quit [Read error: Operation timed out]
iNerd has quit [Quit: iNerd]
sailias has joined #ruby
Hanmac has quit [Ping timeout: 255 seconds]
dekroning has quit [Ping timeout: 240 seconds]
cj3kim has quit [Client Quit]
cbuxton has quit [Quit: Leaving.]
cj3kim has joined #ruby
emmanuelux has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
soulisson has quit [Ping timeout: 260 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
awestroke has quit [Remote host closed the connection]
Hanmac has joined #ruby
mrck has quit [Ping timeout: 245 seconds]
tommyvyo has joined #ruby
lggr has joined #ruby
tomku has quit [Quit: WeeChat 0.3.7]
_nitti has quit [Remote host closed the connection]
cuminmyanus has joined #ruby
thone has joined #ruby
jimeh2 has quit [Ping timeout: 256 seconds]
mrck has joined #ruby
IrishGringo has quit [Ping timeout: 240 seconds]
cardoni has quit [Quit: cardoni]
_nitti has joined #ruby
Asher has quit [Read error: No route to host]
josh^ has joined #ruby
jakzale has joined #ruby
thone_ has quit [Ping timeout: 260 seconds]
dekroning has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 256 seconds]
stim371 has quit [Quit: stim371]
notVert has quit [Ping timeout: 252 seconds]
tomku has joined #ruby
margle has quit [Ping timeout: 256 seconds]
evilsushi has joined #ruby
evilsushi has joined #ruby
deadghost has quit [Ping timeout: 252 seconds]
theRoUS has quit [Ping timeout: 244 seconds]
lupine_85 has joined #ruby
xyzodiac has joined #ruby
lggr has joined #ruby
cardoni has joined #ruby
iamjarvo has joined #ruby
jgwong_ has joined #ruby
xyzodiac has quit [Client Quit]
gregorg has quit [Ping timeout: 260 seconds]
dekroning has quit [Ping timeout: 244 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
ryanlabouve has quit [Quit: Computer has gone to sleep.]
kyb3r has joined #ruby
c0pp3rnick has joined #ruby
dpk has quit []
xyzodiac has joined #ruby
xyzodiac has quit [Max SendQ exceeded]
<roychri> I am writing a class and I need the same code to be executed before any method and after any methods. I could copy and paste in all those methods... but... Is there another way?
jgwong has quit [Ping timeout: 246 seconds]
<roychri> Another class that wraps it?
xyzodiac has joined #ruby
<bperry> the latter is a correct solution
joshman_ has quit [Ping timeout: 246 seconds]
xyzodiac has quit [Max SendQ exceeded]
<roychri> with missing_methods ?
g-ram has quit [Quit: Computer has gone to sleep.]
xyzodiac has joined #ruby
<blazes816> def execute_with_wrap(meth); before(); send(meth); after(); end
JustinCampbell has quit [Remote host closed the connection]
stkowski has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
JustinCampbell has joined #ruby
<blazes816> MyClass.new.execute_with_wrap(:my_method)
sent-hil has quit [Remote host closed the connection]
<blazes816> obviously I wouldn't call it that
<roychri> hehe
sent-hil has joined #ruby
sent-hil is now known as x13\x00\x00\x00\
x13\x00\x00\x00\ has left #ruby [#ruby]
JustinCampbell has quit [Read error: Connection reset by peer]
alanp_ has quit [Ping timeout: 240 seconds]
JustinCampbell has joined #ruby
cdzombak has quit []
lggr has quit [Ping timeout: 244 seconds]
philcrissman has quit [Remote host closed the connection]
frogprince_mac has quit [Ping timeout: 246 seconds]
Asher has joined #ruby
JustinCampbell has quit [Remote host closed the connection]
binaryplease has joined #ruby
lggr has joined #ruby
<roychri> Could I have some kind of method that redefines all the existing (and perhaps future) methods of my class? "à la rails before_filter"
no_worries has quit [Remote host closed the connection]
<Spooner> roychri : Yeah, you need to use alias_method on the old methods and replace them with a wrapper method and it can be done magically pretty easily.
brianpWins has quit [Read error: Connection reset by peer]
<Spooner> roychri : But I have to wonder why you really need that...
CodeFriar has quit [Quit: Leaving...]
brianpWins has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
emdub has quit [Quit: new kernel time]
jgwong has joined #ruby
tommylommykins has joined #ruby
<roychri> Spooner: The context: a class which uses redis in every method. But I want a specific database to be selected for all of them and restore db 0 after each method.
jgwong_ has quit [Read error: Connection reset by peer]
<roychri> Spooner: All db 5 for example. I`d rather not have to do $redis.select(5) in every method.
yoklov has quit [Quit: computer sleeping]
emdub has joined #ruby
samuel02 has quit [Remote host closed the connection]
<Spooner> Well, you could use a block to save having to restore it at the end, but that only halves the effort.
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
lggr has quit [Ping timeout: 256 seconds]
<tommylommykins> hmm
scx has quit [Ping timeout: 240 seconds]
jgwong has quit [Ping timeout: 240 seconds]
<tommylommykins> if if change String's initializer to be.. def initialize; puts "foo" end
<tommylommykins> if there's a string literal in my code
thillux_ has quit [Remote host closed the connection]
<tommylommykins> how come it never prints foo when the interpreter evaluates that string literal?
<solidus-river> if i wanted to take a string in from a form like 'jack, steve, jason, osby' and then split it and find users by that name whats the best way to give an input form for that?
jgwong has joined #ruby
kirun has quit [Quit: Client exiting]
<Spooner> tommylommykins : Probably uses magic to create a String from plain "frog", but not from String.new "frog"
<bperry> Spooner: I would expect because it is using ::String and not YourClass:String
<bperry> willing to eat my words
lggr has joined #ruby
<tommylommykins> ::String?
<blazes816> :: means the root namespace
<bperry> ::String is the absolute base class string
<bperry> yes
<blazes816> well, :: as a prefix
<tommylommykins> si this something that I can't get to?
<Spooner> bperry : If you monkeypatch String, then it changes String. Strings, like a lot of built in stuff aren't regular Ruby objects though.
<bperry> ah
<tommylommykins> ah
<blazes816> ah
<tommylommykins> that doesn't break my mental model any more :)
<Spooner> So I'm guessing *guessing* that "frog" doesn't call String.new internally.
<bperry> yes I see what you mean
<bperry> Spooner: you so smart
* bperry gives a gold star
<tommylommykins> I guess I'd be inviting infinite recursion by instantiating another new string in the initializer for strings
<bperry> tommylommykins: perhaps :)
_nitti has quit [Remote host closed the connection]
<Spooner> See, Mon_Ouie Is filled with proof as well as guesses.
manizzle has quit [Ping timeout: 245 seconds]
jgwong_ has joined #ruby
<roychri> blazes816,bperry, Spooner: Thanks for your help :)
scx has joined #ruby
cuminmyanus has quit [Read error: Connection reset by peer]
<Spooner> roychri : You maybe want to look at #alias_method and #define_method to create a method chain. Not pretty, but it could do the job if you are particularly keen.
lggr has quit [Ping timeout: 248 seconds]
<roychri> Spooner: cool, thanks. I'll explore that option
chrishunt has joined #ruby
<Spooner> I'd worry, however, since you are either a) going to have to list all your methods manually (maintenance issues) or b) grab all the public methods and hope you never have a method that doesn't need wrapping in that way.
jgwong has quit [Ping timeout: 240 seconds]
<roychri> Spooner: And I do not think that would cover methods that are defined after the aliases are done
<Spooner> roychri : Nope.
Zai_ has quit [Quit: Zai_]
lggr has joined #ruby
Kovensky has quit [Ping timeout: 245 seconds]
daniel_hinojosa has quit [Ping timeout: 264 seconds]
cardoni has quit [Quit: cardoni]
mrck has quit [Remote host closed the connection]
deadghost has joined #ruby
thanpolas_ has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
thanpolas has quit [Ping timeout: 256 seconds]
brianpWins has quit [Ping timeout: 240 seconds]
SJrX has quit [Ping timeout: 252 seconds]
nat2610 has quit [Quit: Leaving.]
mmitchel_ has quit [Ping timeout: 246 seconds]
pseudo has joined #ruby
theRoUS has quit [Read error: Operation timed out]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
roadt has quit [Ping timeout: 260 seconds]
JonnieCache|work has joined #ruby
nat2610 has joined #ruby
mahmoudimus has joined #ruby
<solidus-river> can you use cacans ability on something thats only a controller?
Kovensky has joined #ruby
<solidus-river> i want to set up a restriction on something that doesn't have a model
c0rn_ has joined #ruby
<tommylommykins> hmmm
manizzle has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
<tommylommykins> puts foo.bar {some_block} #=> no error
<tommylommykins> puts foo.bar do some_block end #=> no clock supplied
<tommylommykins> D:
<tommylommykins> b
<Spooner> tommylommykins It is the way they bind.
carlyle has quit [Remote host closed the connection]
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Spooner> The former, the block is sent to #bar, the latter, the block is sent to puts.
SJr has joined #ruby
<tommylommykins> oh
jimeh2 has joined #ruby
* tommylommykins investigates
<Spooner> Write the former as puts(foo.bar) {some_block} and it will act like the second one.
workmad3 has quit [Ping timeout: 245 seconds]
<tommylommykins> yeah
stopbit has quit [Quit: Leaving]
CodeFriar has joined #ruby
<tommylommykins> what's the reason they should have different behaviour?
<Spooner> Different precedence for the parser.
brianpWins has joined #ruby
lggr has joined #ruby
iamjarvo has quit [Ping timeout: 245 seconds]
brianpWins has quit [Remote host closed the connection]
<tommylommykins> indeed, do you know why?
<tommylommykins> 'just because' ?
<Spooner> Same happens with '&&' and 'and' - they do the same thing, but they have different precedence.
daniel_hinojosa has joined #ruby
gregorg has joined #ruby
steffes has joined #ruby
<tommylommykins> the resulting semantic difference with && and and is well known though :s
saedelaere has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Xeoncross has quit [Quit: Ex-Chat]
<Spooner> So is the {} do/end one ;)
<tommylommykins> Usually the choice is governed by whether the block is multi-line or not?
<tommylommykins> :s
jeffreybaird has quit [Quit: jeffreybaird]
JustinCampbell has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
<tommylommykins> so why would there need to be a difference in parser precedence?
Kuhni has joined #ruby
<Kuhni> how do I tell ruby to check if a specific item is inside an array?
<Spooner> That is purely a stylistic choice and we like to keep one for single line and one for multi-line. I don't know _why_ they need to have different precedence.
<Kuhni> like, [1,2,3] and have it check if 3 is inside the array
<Spooner> Kuhni : [1, 2, 3].include? 3
vitoravelino`afk is now known as vitoravelino
<Kuhni> thanks!
sailias has quit [Quit: Leaving.]
c0rn_ has joined #ruby
JonnieCache|work has quit [Ping timeout: 240 seconds]
<shadoi> tommylommykins: I pretty much just always refer to this quickref for any oddities: http://zenspider.com/Languages/Ruby/QuickRef.html#blocks-closures-and-procs
JustinCampbell has quit [Remote host closed the connection]
<tommylommykins> ah ok
parzorep has joined #ruby
cardoni has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
cardoni has quit [Client Quit]
daniel_hinojosa has quit [Ping timeout: 246 seconds]
gmci has joined #ruby
<Spooner> Kuhni : Take a wander through http://www.ruby-doc.org/core-1.9.3/Array.html - all sorts of magic there!
<bperry> careful, there be dragons
jakzale has quit [Remote host closed the connection]
lggr has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
sepp2k has quit [Remote host closed the connection]
vitoravelino is now known as vitoravelino`afk
verto is now known as verto|off
<BinaryMaster> with Net::HTTP.get_response is there a way to find out what url a redirect is bringing you?
mahmoudimus has quit [Quit: Computer has gone to sleep.]
gmci has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
vitoravelino`afk is now known as vitoravelino
monkegjinni has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 240 seconds]
gmci has joined #ruby
lggr has joined #ruby
dpk has joined #ruby
<aces1up> hey = dude.map{ |key, value| key.to_s.include?('dec') } how do I return the whole hash that matches? so basically I want to extract into a second hash some hashes from the first hash.. a sub hash.
<blazes816> wat
<blazes816> Hash#select?
whitenoise has joined #ruby
vitor-br has quit [Quit: Saindo]
<tommylommykins> dud.each_with_object(Hash.new) {|(k, v) new_hash| new_hash[k] = v if your_condition}
<blazes816> hey = dude.select{|k,v| k.to_s.include? 'dec'}
<tommylommykins> maybe that works?
g-ram has joined #ruby
whitenoise has quit [Client Quit]
<tommylommykins> oh
rabidpraxis has quit [Remote host closed the connection]
<tommylommykins> hash#select already does it for you :D
chussenot has joined #ruby
* tommylommykins is trying to wrap his head around instance_eval
<tommylommykins> it's confusing
<davidcelis> why
<tommylommykins> Because stuff in my imperfect mental of model about how ruby works gets broken by it
<tommylommykins> Because I had a bad mental model :P
gmci has quit [Ping timeout: 246 seconds]
<bperry> heh, in metasploit, we take the ruby model and turn it completely around and misuse every feature of the language
bier has quit [Ping timeout: 240 seconds]
<bperry> sometimes you come up with cool stuff by using bad models :P
<aces1up> hash.select returns an array.
<aces1up> for some reason.
lggr has quit [Ping timeout: 256 seconds]
[Neurotic] has joined #ruby
<blazes816> then hash is an array
mgates has quit [Quit: mgates]
mahmoudimus has joined #ruby
<tommylommykins> for example
<tommylommykins> I thought that should print "Object's x"
<tommylommykins> but it prints "Hello!"
lggr has joined #ruby
<tommylommykins> What order does Ruby resolve identifiers in? Local variables, then methods, then instance variables?
<bperry> tommylommykins: did you rea dthe link that was pasted earlier?
<tommylommykins> bperry: not all of them them :s
<bperry> it explains that behaviour, the ruby-forums one
gmci has joined #ruby
<tommylommykins> oh, but the code I pasted doesn't have to do with literal instantiation, does it?
* tommylommykins rereads
nari has joined #ruby
daniel_hinojosa has joined #ruby
<bperry> it does faict
<shevy> off topic but
baphled has quit [Ping timeout: 240 seconds]
<bperry> "Object's x" is literally instantiated
<shevy> does one of you know if I can turn an image from right side to left side via CSS alone?
<bperry> do you mean a rotation?
<shevy> yeah
<shevy> is that possible? or will I have to change the .jpg file hmm
<bperry> javascript yo
<shevy> aha ok
<shevy> cool enough, never tried that before
<bperry> og that is neat
<bperry> oh*
<blazes816> before long css will completely replace js at this rate
* tommylommykins doesn't understand. The issues is why in the block, x resolves to the x bound just outside of the block
<shevy> hopefully hahaha
binaryplease has quit [Ping timeout: 240 seconds]
<shevy> I cant stand javascript
<tommylommykins> rather than the x method in Object?
<blazes816> can't wait for server side css
klaas_ is now known as klaas
<shevy> only gripe with CSS is that it can become quite complex
<blazes816> for sure
<blazes816> stylus helps a lot
<davidcelis> #css
<shadoi> blazes816: NodeCSS, evented CSS for ALL PURPOSES!
<davidcelis> node.css would be so webscale
<blazes816> fo sho
<shadoi> werd
<davidcelis> we definitely need some non-blocking css
<shevy> hmmm
gmci has quit [Ping timeout: 248 seconds]
<shevy> node.js node.css ... does the nodeness never stop?
<davidcelis> node.rb
<davidcelis> i.e. EM
<blazes816> only if you want the web scales to stop
<blazes816> do you?!
<blazes816> node.txt
lggr has quit [Ping timeout: 255 seconds]
<davidcelis> node.Markdown
chimkan_ has quit [Quit: chimkan_]
binaryplease has joined #ruby
<blazes816> node.vimrc
<blazes816> and with that, i'm finished
<davidcelis> ahhahahahhahahha
<davidcelis> winner
ForevernadeAFK has quit [Ping timeout: 256 seconds]
c0pp3rnick has quit [Quit: Leaving]
steffes has quit [Remote host closed the connection]
jgwong has joined #ruby
c0rn_ has joined #ruby
justinmcp has joined #ruby
lggr has joined #ruby
jgwong_ has quit [Ping timeout: 240 seconds]
dross has joined #ruby
bier has joined #ruby
<shevy> ack
jgarvey has quit [Quit: Leaving]
davidcelis has quit [Quit: K-Lined.]
<tommylommykins> just to elaborate... http://pastebin.com/Whz9aj33
Foxandxss has joined #ruby
<tommylommykins> my understanding that ruby assumes an identifier is a method first
<shadoi> Why wouldn't it? There's no other reference to x in the foo case.
CodeFriar has quit [Ping timeout: 265 seconds]
<tommylommykins> so in foo, why doesn't the x in {puts x} resolve to Object#x ?
<tommylommykins> but the block is being instance_eval'd within the context of Object?
<tommylommykins> so it calls Object#puts(Object#x) ?
josh^ has quit [Ping timeout: 245 seconds]
<shadoi> I don't think the order is the way you're assuming, instance_eval has somewhat murky definition
<blazes816> tommylommykins: you've closured all over your scope
thanpolas_ has quit [Ping timeout: 255 seconds]
_nitti has joined #ruby
<blazes816> tommylommykins: in #bar, change x to self.x
<blazes816> to be explicit as to what you mean
thanpolas has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
<tommylommykins> sure, but I thought ruby always assumes an identifier is a method first
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<tommylommykins> so it should find object#x before finding the x in the enclosing scope
carlyle has joined #ruby
josh^ has joined #ruby
Jellyg00se has quit [Ping timeout: 246 seconds]
lkba has quit [Ping timeout: 240 seconds]
oldB has joined #ruby
<blazes816> after "def bar", add "def x; 'boom!'; end", and use "x" instead of "self.x"
pseudo has quit [Quit: Lost terminal]
carlyle has quit [Remote host closed the connection]
lggr has joined #ruby
<blazes816> ruby will check in the enclosed scope, then if it fails it will keep looking in the chain
radic has quit [Quit: Verlassend]
_nitti has quit [Ping timeout: 256 seconds]
skogis has quit [Ping timeout: 240 seconds]
jgwong has quit [Ping timeout: 255 seconds]
<tommylommykins> oh
<tommylommykins> that raised an error
* tommylommykins scratches his head
rehat has quit [Remote host closed the connection]
radic has joined #ruby
<blazes816> did you do it right? or maybe I typed it wrong. works for me, 1 sec
<tommylommykins> ah
<tommylommykins> no, it was right
<tommylommykins> private method `x' called for MyClass:Class (NoMethodError)
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
radic has quit [Client Quit]
<blazes816> lol, actually nvm
gmci has joined #ruby
<blazes816> i completely misread my results
<blazes816> it DOES say Hello!
slainer68 has quit [Remote host closed the connection]
radic has joined #ruby
<blazes816> wow
<blazes816> MyClass.x calls it?
* tommylommykins is confused about that too
<blazes816> me too
cibs has quit [Ping timeout: 260 seconds]
cibs has joined #ruby
ncr100 has joined #ruby
<blazes816> wtf
nat2610 has quit [Quit: Leaving.]
<blazes816> are you seeing that?
xyzodiac has quit [Ping timeout: 255 seconds]
<blazes816> ohhh
lggr has quit [Ping timeout: 248 seconds]
<blazes816> idk, but i think it probably has to do with monkey patching Object, which i just now realized you were doing
banseljaj is now known as imami|afk
<blazes816> no
Jork1 has quit [Quit: Jork1]
xyzodiac has joined #ruby
nat2610 has joined #ruby
patrick99e99 has joined #ruby
lggr has joined #ruby
pipopopo has quit [Ping timeout: 260 seconds]
Russell^^ has quit [Quit: Russell^^]
gmci has quit [Ping timeout: 255 seconds]
<tommylommykins> is the object that I'm interacting with at the top level (it seems to be called main)
<tommylommykins> interacting with MyClass?
v0n has quit [Ping timeout: 246 seconds]
fredjean has quit [Quit: Computer has gone to sleep.]
poindontcare has quit [Remote host closed the connection]
<blazes816> yes, tommylommykins you win
pipopopo has joined #ruby
robertotauille has joined #ruby
<blazes816> not cool
<blazes816> i never realized that before
<blazes816> I need to get more familiar with the execution processes
rb1980 has joined #ruby
* tommylommykins nods
<tommylommykins> me too :P
<blazes816> however, def'ing x outside of bar causes it to be private
<blazes816> whereas doing it inside bar makes it public
<blazes816> even more wtf
nat2610 has left #ruby [#ruby]
<tommylommykins> so defining a method at the 'top level' is just inserting private methods into Object?
jenrzzz has joined #ruby
<blazes816> i guess so
lkba has joined #ruby
<patrick99e99> Hi everyone.. I am trying to dynamically add a render action to a controller class.. https://gist.github.com/af0a33b4f7dfe7bb3361
binaryplease has quit [Quit: WeeChat 0.3.8]
<blazes816> rib > "self.class" #=> Object
<patrick99e99> I get the error "undefined method 'render'" because I guess the context is wrong... How do I properly execute that block but have it be within the context of the controller ?
<blazes816> patrick99e99: try #rubyonrails
gmci has joined #ruby
cj3kim has joined #ruby
dEPy has quit []
<patrick99e99> blazes816: but this isn't a rubyonrails problem really, blazes816
<patrick99e99> it's a context + block execution problem
lggr has quit [Ping timeout: 245 seconds]
mercwithamouth has joined #ruby
<blazes816> patrick99e99: good point, you win this round patrick99e99
dekroning has joined #ruby
<patrick99e99> great, now how about some help?
<rb1980> ok, total ruby noobie question: in a case/when statement, does it abort on the first match, or does it continue down the line evaluating each when clause till it gets to the end?
ozette has joined #ruby
<tommylommykins> it aborts on first match
<rb1980> cool, thanks. just wanted to be sure :-)
rb1980 has left #ruby [#ruby]
<tommylommykins> it's as if Ruby secretly inserted a break statement at the end of each thing
<blazes816> ah
lggr has joined #ruby
<blazes816> b = case 'b'; when 'b'; 'b'; when 'c'; 'c'; end
<blazes816> I prepared that example. and he just leaves
<blazes816> :(
rasbonics has quit [Quit: rasbonics]
gmci has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
recycle has joined #ruby
dekroning has quit [Ping timeout: 248 seconds]
stephh has joined #ruby
jimeh2 has quit [Ping timeout: 260 seconds]
recycle has quit [Remote host closed the connection]
_nitti has joined #ruby
gmci has joined #ruby
<patrick99e99> blazes816: what is the problem exactly?
iamjarvo has joined #ruby
<blazes816> patrick99e99: i didn't have the switch problem, rb1980 did
uris has joined #ruby
<patrick99e99> oohhhhh
<blazes816> i made that example to illustrate that it only executes one branch
<patrick99e99> sorry
<patrick99e99> hahaha
<blazes816> but he left
<blazes816> np
<patrick99e99> i thought it was the other way around
<blazes816> i'm looking at your problem, but idk what the issue is
<patrick99e99> yeah its annoying me..
lggr has quit [Ping timeout: 248 seconds]
sneakyness_wk has quit [Quit: fuck dis]
Synthead has quit [Quit: p33 ba115]
lggr has joined #ruby
SegFaultAX|work has quit [Ping timeout: 255 seconds]
solidus-river has left #ruby [#ruby]
<patrick99e99> blazes816: the issue is that for whatever reason, when I do blah { render }
nat2610 has joined #ruby
<patrick99e99> and then when I do ApplicationController.class_eval { define_method :bar { block.call } }
<patrick99e99> it seems to try to call render from the context where blah was called
<patrick99e99> and it complains
<patrick99e99> when ApplicatioNController should have access to a render method
<patrick99e99> in fact, if I do ApplicationController.class_eval { define_method :bar { render ... } }
<patrick99e99> that works fine
<patrick99e99> it just doesn't seem to like that I am passing a block with render in it from somewhere else
<patrick99e99> and I dont understand why
<bperry> anyone have a suggestion for a UI toolkit to use with ruby?
<bperry> gtk looks dead
<bperry> ruby-gtk bindings that is
<blazes816> gtk is wounded
<blazes816> i think your best bet is jruby + swing
<bperry> haha fuck that
nari has quit [Ping timeout: 264 seconds]
<bperry> will make a web app before I do that
<blazes816> that's a much better choice
baroquebobcat has quit [Quit: baroquebobcat]
<bperry> ruby tk looks OK
<dross> :|
<tommylommykins> swing?
<dross> surely you jest good sir
<bperry> maybe shoes?
yshh has joined #ruby
<bperry> I write in ruby, I am not a real rubyist
deadSnowman has quit [Ping timeout: 260 seconds]
<blazes816> shoes is pretty basic. if that works for you, go for it