ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
burns180 has joined #ruby-lang
srbaker has joined #ruby-lang
savage- has joined #ruby-lang
<andrewvos> hey guys
<andrewvos> Rails/github/mass assignment amirite??
<samuelkadolph> lol
* andrewvos is so outraged that rails hid these big security holes from us unsuspecting developers
ascarter has joined #ruby-lang
<samuelkadolph> Yeah, let's grab our pitchforks and go find DHH's house.
achiu has joined #ruby-lang
<andrewvos> Indeed
<samuelkadolph> I think the best part is the people on the github blog post saying he should be rewarded for doing this.
<andkerosine> He... should?
<andkerosine> Innocuous black hats are essentially white hats.
<samuelkadolph> Reward the guy that compromised GitHub and tampered with a client of their's? Makes sense
<andrewvos> The only non-troll sentence I will say is: he could have just emailed github about it.
<samuelkadolph> Nah, don't create your own repo and show GitHub it can be done.
Tearan has joined #ruby-lang
<imperator> whoa what?
<samuelkadolph> Go ahead and get revenge on the project that decided that they didn't want to change something you disagreed with
<imperator> what are we talking about? how was github compromised?
<andkerosine> With Google.
<andrewvos> imperator: Have you not seeen the internet in the last few hours :)
<samuelkadolph> Mass assignment vulnerability let some guy commit to rails
<samuelkadolph> And edit someone else's issue and post an issue from 3012
<imperator> andrewvos, got a link?
<andrewvos> imperator: It's probably the first post on hacker news
<andrewvos> ...
<andrewvos> imperator: Yeah it is :/
<samuelkadolph> 4 of the top 5 on Hacker News
<imperator> ok
<andkerosine> Programmers asking for links kind of blows my mind.
<imperator> ty
<andkerosine> : P
<andrewvos> imperator: It's the second post on HN too
<samuelkadolph> He's a bit of a creeper too, got a crappy octocat tattoo
<andrewvos> imperator: IT'S THE TOP FOUR POSTS ON HN. Right no more hacker news forme
<imperator> andkerosine, i don't read hacker news normally
<imperator> right, got it
<andkerosine> But Google doesn't block you, do they? : )
<andkerosine> samuelkadolph: Not him in that picture.
<imperator> thought maybe there was a specific news story, which would have a specific link, that's why i asked
<andrewvos> imperator: The github blog post is basically the only link worth reading from what I've seen
<andkerosine> See... it's a /web/ of links, this Internet.
<andrewvos> heh
<imperator> andkerosine, yes, but they're mostly cats :-P
<andkerosine> imperator: An astute observation.
* imperator reads
shevy has joined #ruby-lang
<andkerosine> It honestly could have been much, much worse.
burns180_ has joined #ruby-lang
<darkf> >prt
<andrewvos> There's the commit ^
<andrewvos> And the issue he submitted https://github.com/rails/rails/issues/5228
dejongge1 has joined #ruby-lang
jxie has joined #ruby-lang
erpuds has joined #ruby-lang
burns180 has joined #ruby-lang
chimkan has joined #ruby-lang
savage- has joined #ruby-lang
apeiros_ has joined #ruby-lang
justinxreese has joined #ruby-lang
S1kx has joined #ruby-lang
Joeysomo has joined #ruby-lang
neoesque has joined #ruby-lang
burns180_ has joined #ruby-lang
<A124> *lols*
<mistym> Wow.
<andrewvos> Yeah I don't even
<A124> What is connected with ruby on that? :D
<andrewvos> A124: More than we'll ever know.
<mistym> A124: Obviously the deer is written in Ruby!
<A124> mistym: Yes, that's the only only metaphoric connection I see xD
<andrewvos> mistym: The deer is DHH?
QoQOoO has joined #ruby-lang
darkf has joined #ruby-lang
dfr|mac has joined #ruby-lang
<andrewvos> And the rockets are closed GH issues
<andrewvos> haha ok obviously time for sleep. Night people
<A124> Good night, sir.
dfr|mac has joined #ruby-lang
QaDeS_ has joined #ruby-lang
wallerdev has joined #ruby-lang
igotnolegs has joined #ruby-lang
srbaker has joined #ruby-lang
thutch has joined #ruby-lang
slyphon has joined #ruby-lang
<imperator> speaking of github, i don't see how to go back to a specific tag via the interface any more
<imperator> used to be a drop down that i could click, now it forces me to download a zip file
burns180 has joined #ruby-lang
<lianj> imperator: click on the hash below the zip download link. but yea
<imperator> lianj, that only seems to show me the latest commit; i don't see how to browse the source at a given tag
<lianj> there is a "browse code" button in the commit message box
<imperator> lianj, aha, thanks!
dfr|mac_ has joined #ruby-lang
savage- has joined #ruby-lang
amerine has joined #ruby-lang
Joeysomo has joined #ruby-lang
shtirlic_ has joined #ruby-lang
QoQOoO1 has joined #ruby-lang
<erikh> man I hate HN
<seanstickle> erikh: oh?
<erikh> dunno, the sensationalism of it all and the inane comments
<erikh> it's like irc without /ignore
dfr|mac has joined #ruby-lang
<seanstickle> All this Github stuff?
<seanstickle> Or jut in general?
<erikh> eh, it's just one more thing honestly
burns180_ has joined #ruby-lang
<andkerosine> "endowed... with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Indignation."
justinxreese has joined #ruby-lang
rushed has joined #ruby-lang
darkf_ has joined #ruby-lang
Joeysomo has joined #ruby-lang
achiu has joined #ruby-lang
ankurgel has joined #ruby-lang
burns180 has joined #ruby-lang
ascarter has joined #ruby-lang
dfr|mac has joined #ruby-lang
srbartlett has joined #ruby-lang
mikeric has joined #ruby-lang
* imperator implements writev in ffi
krz has joined #ruby-lang
codewrangler has joined #ruby-lang
tux__ has joined #ruby-lang
srbartlett has joined #ruby-lang
mistym has joined #ruby-lang
<andkerosine> So... sprite extraction.
burns180_ has joined #ruby-lang
fayimora_ has joined #ruby-lang
<andkerosine> Find first non-background pixel, check cardinal directions, then do the same for each of those recursively?
<tux__> can someone look at my compile errors please http://pastebin.com/itTCYzRA
amerine has joined #ruby-lang
srbaker has joined #ruby-lang
tellett has joined #ruby-lang
gjaldon has joined #ruby-lang
krz has joined #ruby-lang
chimkan has joined #ruby-lang
adit has joined #ruby-lang
banister has joined #ruby-lang
Marco has joined #ruby-lang
erpuds has joined #ruby-lang
burns180 has joined #ruby-lang
achiu has joined #ruby-lang
cout has joined #ruby-lang
amerine has joined #ruby-lang
morozovm has joined #ruby-lang
Daerun has joined #ruby-lang
QoQOoO has joined #ruby-lang
WillMarshall has joined #ruby-lang
srbartlett has joined #ruby-lang
csherin has joined #ruby-lang
twittard has joined #ruby-lang
srbartlett has joined #ruby-lang
burns180_ has joined #ruby-lang
rohit has joined #ruby-lang
ascarter has joined #ruby-lang
countskm has joined #ruby-lang
QoQOoO has joined #ruby-lang
PatrixCR has joined #ruby-lang
burns180 has joined #ruby-lang
brownies has joined #ruby-lang
gjaldon has joined #ruby-lang
ramonmaruko has joined #ruby-lang
takaokouji has joined #ruby-lang
looopy has joined #ruby-lang
rippa has joined #ruby-lang
PatrixCR has quit [#ruby-lang]
seanstickle has joined #ruby-lang
burns180_ has joined #ruby-lang
jmontross has joined #ruby-lang
jmontross has quit [#ruby-lang]
igotnolegs has joined #ruby-lang
stepnem has joined #ruby-lang
lake has joined #ruby-lang
macmartine has joined #ruby-lang
Zolrath has joined #ruby-lang
chimkan has joined #ruby-lang
burns180 has joined #ruby-lang
QoQOoO has joined #ruby-lang
amerine has joined #ruby-lang
kp666 has joined #ruby-lang
erpuds has joined #ruby-lang
burns180_ has joined #ruby-lang
kp666 has joined #ruby-lang
gokul has joined #ruby-lang
tyman_ has joined #ruby-lang
wmoxam_ has joined #ruby-lang
ovnimancer has joined #ruby-lang
mikeric has joined #ruby-lang
woollyams has joined #ruby-lang
gianlucadv has joined #ruby-lang
dhruvasagar has joined #ruby-lang
amerine has joined #ruby-lang
<countskm> trying hard to write my test first ... tough sometimes :-)
<wallerdev> at least you're trying :)
burns180_ has joined #ruby-lang
<countskm> heh - yeah i heard a podcast w/ guys fighting over bdd vs tdd vs cucumber yadada and i thought the same thing - its good we are at the point where at the worst we are bitchin ;-)
<countskm> was listening to kent beck tonight and it inspired me to re-write some tests
mikeric has joined #ruby-lang
x0F_ has joined #ruby-lang
kitallis has joined #ruby-lang
ryanf has joined #ruby-lang
<Asher> if you are arguing over bdd vs. tdd vs. cucumber you are wasting time instead of getting worthwhile coding done
<erikh> Asher: emacs sucsk
<erikh> I use vim
butchanton has joined #ruby-lang
<erikh> and textmate
<erikh> and joe
<Asher> hahaha
<bnagy> erikh: yeah? Well linux sucks balls, Win7 is way better
<erikh> heh, I actually like win7 a lot
<erikh> it's basically what everythings since windows NT should have been
<bnagy> yeah, I hate linux a lot :(
<erikh> I think they're going to go back to sucking hard with win8 though.
<erikh> anyone here know the multithreaded version of the gdb rb_raise() trick?
<erikh> I need to break into a ruby session and send a rb_raise to a specific thread.
<TTilus> all editors suck
<erikh> man, it's like the test suite gets tired of being run and just starts getting pissy
<TTilus> and operating systems for that matter
QoQOoO has joined #ruby-lang
QoQOoO has quit [#ruby-lang]
<TTilus> they just get in your way
* TTilus uses magnetic needle and steady hand
savage- has joined #ruby-lang
burns180 has joined #ruby-lang
Keva161 has joined #ruby-lang
burns180 has joined #ruby-lang
QoQOoO has joined #ruby-lang
<andkerosine> TTilus: So... it has come to this.
Fullmoon has joined #ruby-lang
|Vargas| has joined #ruby-lang
burns180_ has joined #ruby-lang
savage- has joined #ruby-lang
Quazi_Farhan has joined #ruby-lang
heppy has joined #ruby-lang
yxhuvud has joined #ruby-lang
mikeric has joined #ruby-lang
Heimidal has joined #ruby-lang
butchanton has joined #ruby-lang
burns180 has joined #ruby-lang
voker57 has joined #ruby-lang
heppy has joined #ruby-lang
brianpWins has joined #ruby-lang
burns180_ has joined #ruby-lang
QaDeS has joined #ruby-lang
burns180_ has joined #ruby-lang
Fractality has joined #ruby-lang
twittard has joined #ruby-lang
benvds has joined #ruby-lang
burns180 has joined #ruby-lang
zmack has joined #ruby-lang
zmack has joined #ruby-lang
gasbakid has joined #ruby-lang
gokul has joined #ruby-lang
dc5ala has joined #ruby-lang
QaDeS has joined #ruby-lang
solars has joined #ruby-lang
gnufied has joined #ruby-lang
burns180_ has joined #ruby-lang
frangiz has joined #ruby-lang
denysonique__ has joined #ruby-lang
Quazi_Farhan_ has joined #ruby-lang
tyman has joined #ruby-lang
mikeric has joined #ruby-lang
cyri_ has joined #ruby-lang
burns180 has joined #ruby-lang
benvds has joined #ruby-lang
benvds has joined #ruby-lang
burns180_ has joined #ruby-lang
Fullmoon has joined #ruby-lang
davidw has joined #ruby-lang
lbrent has joined #ruby-lang
d3vic3 has joined #ruby-lang
lbrent has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has joined #ruby-lang
jordan` has joined #ruby-lang
srbartlett has joined #ruby-lang
adambeynon has joined #ruby-lang
francisfish has joined #ruby-lang
woollyams has joined #ruby-lang
<shevy> yeah TTilus the wise men just tries to overcome those obstacles - by writing a new OS. The ruby OS!!!
kp666 has joined #ruby-lang
burns180_ has joined #ruby-lang
btfriar has joined #ruby-lang
futurechimp has joined #ruby-lang
gianlucadv has joined #ruby-lang
<yorickpeterse> Sounds performant
<shevy> yorickpeterse yeah, we all use C because it is the fastest, and other languages have no chance!!!
pbjorklund has joined #ruby-lang
<yorickpeterse> :)
<shevy> well I'd be even happy enough to see shell scripts being replaced by ruby scripts... or python scripts... but they seem to stay around for so long :(
<ruskie> nothing wrong with shell scripts
<shevy> I know. sysadmins don't wanna lose their job after all
workmad3 has joined #ruby-lang
<ruskie> shevy, heh
<shevy> I am only half serious btw
<ruskie> frankly I'm terrified when I get asked why I use shell scripts instead of perl
<ruskie> because apparently everyone should know perl and use that
<ruskie> atleast shell scripts can be used by anyone that can use a shell
<bnagy> wat?
<bnagy> that statement is insane
<ruskie> which one?
<bnagy> reading and writing shell scripts has more or less nothing to do with using a shell day to day
<shevy> yeah, there is a big inertia against change in general. just look how long it takes for cmake to get adopted. and even when it does, it does not offer feature parity towards GNU autoconfigure
<ruskie> bnagy, most shell scripts are simple affairs that just call different normal commands
<A124> True.
<bnagy> that's a bit subjective :)
srbartlett has joined #ruby-lang
postmodern has joined #ruby-lang
<ruskie> but yeah some of the shell scripting that I've seen done and have done myself would be a problem for mostly anyone not a coder
<shevy> perl was cool once
<bnagy> shevy: that's when the alternatives were Ada and fortran90
<shevy> hehe
<ruskie> but I believe 90% of the scripts I use day to day for work stuff is basically a bunch of commands so I don't need to rerun them all the time by hand
PhilCK has joined #ruby-lang
<bnagy> :>
<bnagy> I don't mind the odd loop or env var, but as soon as it gets functional I'mm pulling out a proper language
<shevy> hehe
<shevy> ewwwwww
<shevy> at least I am documenting my shell scripts
<bnagy> rvm is basically bucketsful of ewww
<bnagy> if anything else worked I'd switch in a second :(
<shevy> typical shell script mentality - no docu, random line noise. at least perl brought in docu usually
<shevy> though it also brought in the line noise :\
<shevy> hmm was there a "scripting" language before perl that was somewhat widespread? other than shell scripts that is
<bnagy> awk?
<bnagy> I dunno, not that I remember
<shevy> hmm
<bnagy> sendmail.cf I think is turing complete... ;)
<shevy> eww
<shevy> what about lisp? was it used like perl?
* shevy spanks bnagy
<shevy> I'll ask on #lisp
<bnagy> I never learnt lisp, everyone I know did admin with bash then probably perl
burns180 has joined #ruby-lang
<bnagy> this is 90s, I didn't do *nix before then
<shevy> whoa
<shevy> those were my DOS days!
<shevy> I liked DOS a lot more than what came afterwards... like win xp
<bnagy> well actually technically probably csh, tcsh, zsh blah blah, back when choice of shell was a religion like choice of OS
<bnagy> crazy neckbeards :/
dhruvasagar has joined #ruby-lang
<shevy> haha
<shevy> what shell do you use most of the time today bnagy? :>
<bnagy> whatever comes installed :P
mytrile has joined #ruby-lang
<bnagy> woop, sunset! Time for G&T
roadkith has joined #ruby-lang
ankurgel has joined #ruby-lang
kedare has joined #ruby-lang
ankurgel has joined #ruby-lang
jbvp has joined #ruby-lang
<jbvp> hi
sandbags has joined #ruby-lang
Bwild has joined #ruby-lang
d3vic3 has joined #ruby-lang
judofyr has joined #ruby-lang
burns180_ has joined #ruby-lang
srbartlett has joined #ruby-lang
<rue> HI
<ankurgel> rue, hi
Bwild has joined #ruby-lang
Oetti has joined #ruby-lang
<rue> HI
<ankurgel> ??
Oetti has quit ["Wub Wub"]
<judofyr> HI
<andrewvos> obligatory HI
<ankurgel> ^+1
<ankurgel> andrewvos, Is it necessary to include 'attr_reader :' in class for it's function to work?
<ankurgel> gisting
<ankurgel> consider these few basic lines: https://gist.github.com/1977961
<ankurgel> until I use attr_reader there, my healthy? function doesn't work. Generates error
<ankurgel> `healthy?': undefined local variable or method `calories' for #<Dessert:0x9caf180 @name="ice", @calories=100.0> (NameError)
<ankurgel> from p4.rb:23:in `<main>'
<andrewvos> ankurgel: Yeah or just do @calories
<andrewvos> on line 10
<ankurgel> @calories<200 ?
burns180 has joined #ruby-lang
<ankurgel> yes worked, andrewvos
<ankurgel> but, why wasn't it working?
<ankurgel> without attr_reader ?
<ankurgel> I thought it's purpose was to serve the function the value of any variable being used in class.
<rippa> ankurgel: http://ideone.com/1d0Mw
<rippa> works here
<ankurgel> rippa, but you still used attr_accessor
<rippa> yes
<rippa> ankurgel: well, there's no local variable "calories" nor method with that name
<rippa> ofc it errors
<ankurgel> but local variable for class was initialized in def initialize, no?
<ankurgel> def healthy? is part of that class itself.
<uniqanomaly> @ at 8 line :<\
<rippa> ankurgel: that's instance variable
<roadkith> sequel doesnt seem to understand iso-8859-1 in a mysql db
<rippa> and it has @ as part of name
gasbakid__ has joined #ruby-lang
<rippa> @calories no calories
<rippa> *not
<ankurgel> yes, agreed.
<ankurgel> hm. okay, making sense now. :)
<ankurgel> yes. clear. :) thanks rippa andrewvos
<ankurgel> one more thing, are these called as getters/setters?
<ankurgel> or are they different?
<rippa> who?
<ankurgel> are attr_reader , attr_accessor called as getter and setters in ruby?
<rippa> I'm not sure I get what you mean
<ankurgel> rippa, okay, read this: " Create a class Dessert with getters and setters for name and calories. Define
<ankurgel> instance methods healthy?, which returns true if a dessert has less than 200
<ankurgel> calories, and delicious?
<ankurgel> "
<ankurgel> This is what I'm asked to do.
<rippa> yeah
<ankurgel> create this basic class with those functions and everything.
<rippa> attr_accessor difenes getter and setter methods
<rippa> *defines
<ankurgel> okay
<tobiasvl> attr_accessors are getters and setters
<tobiasvl> yeah
<tobiasvl> attr_reader is just a getter
<ankurgel> and attr_accessor can set as well..
<tobiasvl> yep
<ankurgel> so it's setter as well as getter, right.
<rippa> attr_writer is setter
<rippa> attr_accessor is both
<ankurgel> all right. So, attr_reader as getter, attr_writer as setter and attr_accessor as both.
<ankurgel> If I include attr_accessor in my class, I don't have to use attr_reader there.
<tobiasvl> correct
vmoravec has joined #ruby-lang
QaDeS has joined #ruby-lang
burns180_ has joined #ruby-lang
<ankurgel> tobiasvl, rippa http://ideone.com/XxbfA Have a look at JellyBean class inherited from Dessert. name, calories are inherited.
<ankurgel> Do I have to initialize them again in def initialize ?
seanstickle has joined #ruby-lang
<ankurgel> oh. hm. Yes, I should I think. They are not actually being initialized directly when I am using object of JellyBean
<tobiasvl> ankurgel: yes
<rippa> ankurgel: call super
<tobiasvl> what rippa said
<ankurgel> how?
<tobiasvl> super(name, calories)
<rippa> yes
<ankurgel> ^It worked!
<ankurgel> so, it will send these variables to it's parent class?
<tobiasvl> yes
<ankurgel> and they will get initaized there?
<ankurgel> initialized*
<tobiasvl> super calls the super (parent) class's initialize method
<tobiasvl> correct
<ankurgel> bravo! thanks guys! :)
<rippa> super calls parent version of any method
<rippa> inside which it's used
<tobiasvl> truwe
<tobiasvl> true
<ankurgel> in case of multiple inheritence, calling super(with_vars_belonging_to_diff_class), it will automatically call their respective init ?
publicvoid_ has joined #ruby-lang
<ankurgel> if multiple inheritence happens in rb. I am not sure
<rippa> ruby doesn't have multiple inheritance
<ankurgel> like java has interfaces to implement it, do we have something like that in rb?
<rippa> no, because dynamic language
<dominikh> nobody needs multiple inheritance when he has mixins :P
<ankurgel> :D okay.
Fullmoon has joined #ruby-lang
isale-eko has joined #ruby-lang
<kke> !down rubygems
<kke> thought there was a command like that
thone_ has joined #ruby-lang
<ddfreyne> there is one, but it takes the given site down, so usage is not recommended!
<ddfreyne> thanks for ruining rubygems, kke
burns180 has joined #ruby-lang
<kke> np
<kke> i got too much work done when it was up and didn't have enough time to browse the net
_bat has joined #ruby-lang
<kke> fixed it now
<kke> no i didn't
<roadkith> rubygems.org is down
kaiwren has joined #ruby-lang
<yorickpeterse> They're working on it
kain has quit ["Sto andando via"]
burns180_ has joined #ruby-lang
malev has joined #ruby-lang
malev has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
fayimora_ has joined #ruby-lang
mssola has joined #ruby-lang
<nofxx> What do you guys use for load balancing? hproxy?
gasbakid has joined #ruby-lang
tomzx has joined #ruby-lang
burns180_ has joined #ruby-lang
canton7 has joined #ruby-lang
mistym has joined #ruby-lang
alessio_rocco has joined #ruby-lang
dfr|mac has joined #ruby-lang
francisfish has joined #ruby-lang
tommyvyo has joined #ruby-lang
burns180_ has joined #ruby-lang
jxie has joined #ruby-lang
<darix> nofxx: haproxy
davidw has joined #ruby-lang
mistym has joined #ruby-lang
PhilCK has joined #ruby-lang
Fullmoon has joined #ruby-lang
justinxreese has joined #ruby-lang
Spooner has joined #ruby-lang
dhruvasagar has joined #ruby-lang
uniqanomaly_ has joined #ruby-lang
S1kx has joined #ruby-lang
s_dana has joined #ruby-lang
bglusman has joined #ruby-lang
frem has joined #ruby-lang
beiter has joined #ruby-lang
<beiter> Here there. I parse an HTML file with haricot (Ruby 1.8.7) there are letter like ä. When i try to save the text into a db, the ä becomes '\303\204'
<beiter> how can i fix this problem ?
JEG2 has joined #ruby-lang
<judofyr> beiter: 1.8 or 1.9?
<judofyr> oh
<judofyr> you said 1.8.7
<beiter> yes
<judofyr> ah, encodings
<beiter> and i meant hpricot
<beiter> jear /:
<judofyr> beiter: is the database set up for UTF-8?
<beiter> yes
<beiter> should i change this encoding
leonL has joined #ruby-lang
<shevy> UTF-pony
<judofyr> nah, \303\204 is UTF-8 already
<judofyr> (right?)
bryancp has joined #ruby-lang
<beiter> hmm should
<beiter> the encoding of the database is utf-8
<beiter> but the value in there isn't right
krzyhoo has joined #ruby-lang
<krzyhoo> hello gurus. a quick question. need to execute an external progam with the following command: `
<krzyhoo> C:\Informatica\9.1.0\server\bin\pmrep.exe connect -r dev1_rsrv -d Domain_WIN-Q7OTL5RPDL7 -n kradecki -x kradecki
slyphon has joined #ruby-lang
<krzyhoo> how do i do this? defining a variable with this command and stringt and backticking it doesn't work. i get the following error message:
<krzyhoo> No such file or directory - connect
headius has joined #ruby-lang
<andrewvos> krzyhoo: Put some code on gist.github.com
<andrewvos> And show us
dv310p3r has joined #ruby-lang
<shevy> show us baby!
burns180 has joined #ruby-lang
enebo has joined #ruby-lang
moncyn has joined #ruby-lang
tekin has joined #ruby-lang
moncyn has quit [#ruby-lang]
morozovm has joined #ruby-lang
<andrewvos> Guess he got it working
<beiter> dbh.query("INSERT INTO #{t_name} (`page`, `text`)
<beiter> VALUES (#{i}, '#{content}');
<beiter> dbh = Mysql.new(mysql_server, mysql_user, mysql_pass, mysql_db)
<beiter> does this work in utf8 ?
<beiter> though my Output should be already UTF8
outoftime_ has joined #ruby-lang
<krzyhoo> andrewvos: ok, solved it
<krzyhoo> am to dumb to incluge #{xxx} when I am quoting a command
<krzyhoo> thanks anyway
aqua has joined #ruby-lang
okhra has joined #ruby-lang
mistym has joined #ruby-lang
<krzyhoo> but have another good one. this is the output of the command
<okhra> can someone help with a ruby question ?
<okhra> I have a string variable, temp= "howdy" how do I dynamically create @howdy using only temp ?
<bougyman> instance_variable_set("@howdy", temp)
<krzyhoo> how do i remove all the lines up to "Invoked..." and after "Completed..."
<bougyman> but: why?
<bougyman> what is it you are trying to do?
<bougyman> oh, i see.
<krzyhoo> instanca-varaible_set
<bougyman> instance_variable_set("@#{temp}", value), i guess?
<bougyman> why on earth would you want this?
<beiter> This Solved my problem
<beiter> dbh = Mysql.init
<beiter> dbh.options(Mysql::SET_CHARSET_NAME, 'utf8')
<beiter> dbh.real_connect(mysql_server, mysql_user, mysql_pass, mysql_db)
<beiter> dbh.query("SET NAMES utf8")
<okhra> temp is a string passed in. Want to dynamically create instance variable passed in, corresponding setters and getters
<krzyhoo> okhra: try this
<krzyhoo> instance_variable_set "@#{key}", value # Allows to dynamically create instance variables self.class.__send__(:attr_reader, "#{key}") # Dynamically expands the attr_reader creating reader for keys
rippa has joined #ruby-lang
<okhra> thanks, will try that
jasonw22 has joined #ruby-lang
<krzyhoo> yay, krzyhoo +1 ;-)
aqua has quit ["Leaving"]
aqua has joined #ruby-lang
<injekt> oh remove them, use reject instead of select
burns180_ has joined #ruby-lang
<krzyhoo> injekt: thanks mate
<krzyhoo> cheers
wyhaines has joined #ruby-lang
gasbakid__ has joined #ruby-lang
Sailias has joined #ruby-lang
tbuehlmann has joined #ruby-lang
darkf has joined #ruby-lang
darkf_ has joined #ruby-lang
robbrit has joined #ruby-lang
rayners has joined #ruby-lang
Marco has joined #ruby-lang
Sailias has joined #ruby-lang
s_dana has joined #ruby-lang
fireglow has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
s_dana has joined #ruby-lang
savage- has joined #ruby-lang
d3vic3 has joined #ruby-lang
Heimidal has joined #ruby-lang
dborin has joined #ruby-lang
rayners has joined #ruby-lang
kyrylo_ has joined #ruby-lang
kyrylo_ has joined #ruby-lang
wmoxam has joined #ruby-lang
virunga has joined #ruby-lang
virunga_ has joined #ruby-lang
pemeon has joined #ruby-lang
virunga has joined #ruby-lang
pemeon has quit [#ruby-lang]
dous has joined #ruby-lang
havenn has joined #ruby-lang
burns180_ has joined #ruby-lang
dejongge has joined #ruby-lang
Spooner has joined #ruby-lang
sdeobald_ has joined #ruby-lang
Stalkr_ has joined #ruby-lang
<andrewvos> Anyone else having problems doing a `git push heroku`??
ankurgel has joined #ruby-lang
comboy has joined #ruby-lang
<ankurgel> andrewvos, shevy Can you help me out in this? https://gist.github.com/1979206
<ankurgel> I'm trying to make one attr accessor which also records history.
<ankurgel> and it's not completely my code either. So, I don't understand it completely as well.
<ankurgel> Please to help :)
adambeynon has joined #ruby-lang
flak has joined #ruby-lang
<shevy> LONG LIVE RUBY!
<shevy> ankurgel, you must get a structure into your code
<shevy> right now this is just fancified line noise
<shevy> also "attr_reader attr_name"
<shevy> I have not seen this before
<shevy> attr_reader :attr_name
<shevy> that I would have seen
<shevy> but you should move this outside of "def initialize", move it above
<shevy> about class_eval, sorry, I recommend for everyone to stop using any kind of eval in ruby.
morozovm has joined #ruby-lang
<ankurgel> outside?
<shevy> you want to define your own attrs?
<ankurgel> erm.
<ankurgel> yes, like what is happening in Foo.
<ankurgel> check the input case in comment.
<ankurgel> attr_accessor_with_history :bar
<ankurgel> bar will be the one collecting the history then.
<ankurgel> which can be viewed later by bar_history
<shevy> ankurgel, that's how I used to define my own attr in the past:
<shevy> I no longer use this though, I found that the disadvantages outweigh the advantages
<shevy> most importantly, that you would have to carry around such modifications on your own
<ankurgel> starting to get confused.
<ankurgel> wait a min
fayimora has joined #ruby-lang
Natch has joined #ruby-lang
<shevy> sure
<shevy> after all eval is there to confuse people
savage- has joined #ruby-lang
<ankurgel> I was reading about instance_eval and class_eval today.
<shevy> I'll never understand the logic behind expanding the spaghetti evals
<ankurgel> that said, they create eval of vice versa.
<ankurgel> kinda weird. :D
<shevy> yah well I am glad to have decided to avoid that shit
rippa has joined #ruby-lang
<shevy> I am proud that my code does not use eval :P
<ankurgel> shevy, okay, check this: https://gist.github.com/1979278
<ankurgel> this is part of some tutorial that I was following.
<ankurgel> Help me out!
<shevy> what with
<shevy> I won't touch eval
<ankurgel> okay, modification in it such that eval is not used but modification of Class exists.
<ankurgel> ?
<shevy> class?
<shevy> you mean class Class?
<shevy> I dont think I ever modified class Class hmm
<ankurgel> :(
<shevy> :)
<shevy> first thing you should do is define your method bar_history somewhere
<shevy> right now it is not even defined anywhere, it is only called
<ankurgel> that would be defined in Foo, right.
<ankurgel> but that will not serve the purpose, being a method.
<ankurgel> that has to be an attr , that's what it all about, no
<shevy> f.bar_history
rindolf has joined #ruby-lang
<shevy> what is this then
<shevy> looks like a method call to me
<ankurgel> seems like this thing will take time to get figured out. Must get back to it after some time.
<ankurgel> Meanwhile help me out in other one.
<ankurgel> designing one rock-paper-scissor game.
<ankurgel> [ [ "Armando", "P" ], [ "Dave", "S" ] ]
<ankurgel> # => returns the list ["Dave", "S"] wins since S>P
<ankurgel> S --> Stone, P->Paper,
gianlucadv has joined #ruby-lang
<ankurgel> and ofcourse R -> Rock
macmartine has joined #ruby-lang
<shevy> yay, a game
<ankurgel> :D
t0h has joined #ruby-lang
<ankurgel> I tried to think about it..
<ankurgel> but nothing just could come in mind except traditional c++ approach.
<ankurgel> which will just involve working on multiple cases.
<Spooner> ankurgel: It would be more usual, in Ruby, to use :stone, :paper rather than the "P" "S"
<ankurgel> Spooner, why symbol will do where?
<shevy> what is wrong with multiple cases?
<ankurgel> Since I would provide my function with strings; if symbols are more efficient here, guess I can convert "R","P" etc to symbol in function itself.
fayimora has joined #ruby-lang
<Spooner> However, I suppose that "p", "s" is the input (press p for paper, s for stone, etc).
<shevy> I mean I dont see a question so far
<ankurgel> shevy, multiple cases will be like gruesome!
<shevy> use it
<shevy> :)
<shevy> make it work
<shevy> then make it elegant
<ankurgel> hm
<ankurgel> working.
<ankurgel> I mean, "I'm on it"
blarghl has quit [#ruby-lang]
mattonrails has joined #ruby-lang
<darix> lianj: wouldnt method_missing be a bit more elegant in that situation?
<ankurgel> *gasps*
<lianj> darix: dunno, your choice :D
<ankurgel> will look it after 5-10 min. Rock-Paper-Scissor on my mind first. :D
chimkan_ has joined #ruby-lang
<lianj> well, its a 'working' solution. show others
<darix> ankurgel: for more choices: Rock paper scissors lizard Spock
<darix> ;)
<shevy> lol
<ankurgel> darix, I KNOW
<ankurgel> that is the main aim actually.
<ankurgel> THE MAIN
<ankurgel> EPIC EPIC EPIC
<shevy> that's from a tv show right
<ankurgel> TBBT #FTW
<darix> shevy: yeah
<shevy> I only know that because I watched the bloopers, but never a single episode
<ankurgel> "Dr. Sheldon Cooper"
<lianj> bazinga!
<shevy> bloopers seem always more fun than the actual shows ;)
<ankurgel> lianj, :D
<Spooner> It is from Big Bang, but I think it existed before.
<ankurgel> ^+1
codewrangler has joined #ruby-lang
<ankurgel> Penny penny ..
<ankurgel> someone sing me 'Soft Kitty' now
butchanton has joined #ruby-lang
<ankurgel> hahaha
<ankurgel> Soft Kitty, Warm Kitty, little ball of fur..
<ankurgel> happy kitty, pretty kitty? purr purr purr.
fayimora_ has joined #ruby-lang
<lianj> no, start over again
fayimora has joined #ruby-lang
<slyphon> dominikh: hey, cinch question, is there a builtin nickserv helper?
Marco has joined #ruby-lang
<dominikh> slyphon: not built-in, but there's a plugin available
<slyphon> ah
<slyphon> oh i see it
<slyphon> kewl
dr_bob has joined #ruby-lang
<dominikh> readme has install instructions
<slyphon> dominikh: much obliged!
<dominikh> :)
burns180_ has joined #ruby-lang
<slyphon> wow
<slyphon> i havent even run it yet, but i'm seeing this is gonna go way easier than the last 5 times i had to write this same thing
<slyphon> :)
<dominikh> yey. what did you use the last 5 times? ;)
<slyphon> rbot, pircbot, some other ruby thing, pircbot, then an attempt with node.js that ended in a rather poor opinion of the code generated by that community
<slyphon> :)
<dominikh> haha, alright
<slyphon> (this is over 6 years or so)
<slyphon> this is great though
m3nd3s has joined #ruby-lang
<darix> slyphon: didnt the github guys release some node.js based bot?
scampbell has joined #ruby-lang
<andrewvos> yeah
<dominikh> shush
<dominikh> I'm sure it's bad.
<slyphon> ha
<andrewvos> it's node
<slyphon> if it's node that means its SUPER FAST BECAUSE IT'S EVENTED!!
<slyphon> EVENTED CODE IS THE *ONE* *TRUE* *WAY*!
<dominikh> tobiasvl: you're very late to the party.
<ankurgel> I can't give multiple statements in when?
<andrewvos> slyphon: and super shit, because it's javascript
<slyphon> haha
<ankurgel> in 'when'*
virunga has joined #ruby-lang
gnufied has joined #ruby-lang
<dominikh> ankurgel: uh, yes you can, and that example works perfectly correct, too
<ankurgel> er.. not. check output.
<ankurgel> 3 answers!
<dominikh> I did check, it is right
<dominikh> uh, heh
<dominikh> well
<dominikh> still correct according to your code
<dominikh> you're doing assignments, not equality checks
<ankurgel> in case, it should have gone in one 'when'
<dominikh> if game[1][1]='R' ← this _sets_ game[1][1] to 'R', and the return value of assignments is the right hand, so 'R', which is true
<ankurgel> oh oh
<ankurgel> guess I shouldn't have use if that way
<ankurgel> OH DAMN
<ankurgel> I am fool
<dominikh> you should use == and not =.
<ankurgel> yes, yes yes yes
<ankurgel> what the..
<ankurgel> Dave Wins. woks now. :)
<ankurgel> now help me make it elegant.
<ankurgel> :)
<Spooner> ankurgel: winner = case [game[0][1], game[1][1]]
<Spooner> when ['R', 'R'] then nil
<slyphon> 3
<Spooner> when ['R', 'P'] then 1 #etc
<ankurgel> two values in case?
<ankurgel> aah
<Spooner> No, one value (an array).
<ankurgel> one more new thing I learnt tpdau/ "_
<ankurgel> okk..
<ankurgel> modifying.
<Spooner> actually: when ['R', 'P'], ['P', 'S'], ['S', 'R'] then 1
io_syl has joined #ruby-lang
<Spooner> Oops, I'm doing it for you. Sorry :$
<ankurgel> :)
<ankurgel> no problem
<ankurgel> :D
<canton7> I golfed RPS once... def play s;
<canton7> a=%w(Rock Paper Scissors Win Draw Lose);i=a.index s;r=rand 3;a[((i||0)+r-1)%3]+?,+a[i ?r+3:5];
<canton7> end was my best. Other, better ones are at http://rubysource.com/ruby-golf/
<ankurgel> Spooner, ^
<Spooner> If they are both the same, then no-one wins.
Heimidal has joined #ruby-lang
gasbakid__ has joined #ruby-lang
<ankurgel> I want first one to win in that case.
<Spooner> OK.
<ankurgel> by default :0
<ankurgel> :)
<ankurgel> Spooner, thanks a lot! That was awesome addon.
<Spooner> I was suggesting you do winner = case (and the result being 0, 1, or nil) so you could do: puts "#{winner ? game[winner][0] : "noone"} wins"
<ankurgel> I can sit on #ruby-lang all day long now.
<ankurgel> oh
<Spooner> It isn't perfect, but at least it now looks like Ruby :)
<ankurgel> yes
francisfish has joined #ruby-lang
achiu has joined #ruby-lang
wallerdev has joined #ruby-lang
<Spooner> And don't feel you have to use "then" as I did. Just easier to fit it on one line for IRC. Anyway. I'll try not to answer with the end, rather than the next step next time.
Asher has joined #ruby-lang
<ankurgel> Hm. Yeah, I could have used next line or ; there instead of then there.
<Spooner> Nah, you shouldn't ever really be using ;. 'then' is better than ; in the case of short when lines that look fine on one line.
<slyphon> dominikh: ok, so, $50,000 question. I want to make a REST API I can use to do announcements with cinch, is there a threadsafe way i can do that?
Muz has joined #ruby-lang
<Asher> is it really worth $50k? ;P
<dominikh> slyphon: well, what about it has to be threadsafe in particular?
<dominikh> Asher: I sure hope so, I am waiting for the money
<slyphon> dominikh: there's a network socket
gnufied has joined #ruby-lang
<slyphon> i.e. one global resource
<slyphon> i guess the better question would be
<slyphon> "How can i do that?"
<slyphon> just grab the bot instance and..
<dominikh> slyphon: run Bot#start in a thread, run whatever you use for REST in another thread, use the bot instance and have fun
<dominikh> slyphon: Cinch itself is heavily using threads, so all processing of events, managing the socket etc are already threadsafe.
<slyphon> oh, duh
<slyphon> ok, cool
<slyphon> just wanted a sanity check
<slyphon> thanks :)
<dominikh> sure thing
workmad3 has joined #ruby-lang
Sailias_ has joined #ruby-lang
piglop has joined #ruby-lang
<ankurgel> Spooner, http://ideone.com/VfCUn
enebo has joined #ruby-lang
<ankurgel> using two exceptions
<ankurgel> is there something wrong I did there in NoSuchStrategyError ?
<ankurgel> when called, it is being invoked even for input case 2
<ankurgel> where WrongNumberOfPlayersError must have invoked
indstry has joined #ruby-lang
seoaqua has joined #ruby-lang
kp666 has joined #ruby-lang
<ankurgel> ?
<ankurgel> *bump*
<injekt> ankurgel: your unless statement is all kinds of wrong
<injekt> you can't do if foo == ('a'||'b'||'c')
<injekt> ['a', 'b', 'c'].include?(foo)
manojhans has joined #ruby-lang
<injekt> or foo == 'a' || foo == 'b' || foo == 'c'
<ankurgel> 1.9.2p290 :001 > game='R'
<ankurgel> => "R"
<ankurgel> 1.9.2p290 :002 > puts 'hello' if game==('R'||'S')
<ankurgel> hello
<ankurgel> => nil
<ankurgel> 1.9.2p290 :003 > puts 'hello' if game==('R'&&'S')
<ankurgel> => nil
<ankurgel> sorry for not using gist etc
<injekt> right
heppy has joined #ruby-lang
<ankurgel> then, why not there?
<injekt> it's using 'R' and doesnt care about 'S'
<injekt> 'a' == ('a' || 'c') #=> true
<injekt> 'c' == ('a' || 'c') #=> false
<ankurgel> it is?
<ankurgel> checking
<ankurgel> :O why
<injekt> because that's not valid
burns180 has joined #ruby-lang
<injekt> ('a' || 'c') returns 'a' every time
<injekt> because 'a' is truthy
<ankurgel> mm-hmm
<injekt> so you're never comparing against 'c'
<injekt> or w/e in your example
knightMBP has joined #ruby-lang
<ankurgel> still a bit confused in this one. :(
<erikh> if 'a'; p "a is true"; end
<ankurgel> yes
<erikh> puts "a" || "b"
<ankurgel> because 'a' is true
<injekt> you're trying to do; if foo == 'a' || foo == 'c' but writing it as if foo == ('a' || 'c')
<erikh> run it 400 times
<erikh> it'll always be a
<ankurgel> when it does 'c'==('a'||'c') if 'c' doesn't matches with 'a' first,
<erikh> zedas has a really nice truth table for python.
<ankurgel> shouldn't it check itself with 'c'?
<injekt> no
<injekt> ('a' || 'c') returns a
<injekt> every. time.
<erikh> 'c' == 'a' || 'a' == 'a'
<erikh> actually ignore that
Cool_Fire has joined #ruby-lang
<erikh> because ruby's precedence rules are whack.
<erikh> use 'or'
<Cool_Fire> morning
<injekt> heh
<dominikh> you have to simplify your expression from the inside out. 'c' == ('a' || 'c') -> 'c' == ('a') -> 'c' == 'a' -> false
<ankurgel> Cool_Fire, In few hours, I would be saying 'Good night, good sir'
mrsolo has joined #ruby-lang
<ankurgel> dominikh, okk
<Cool_Fire> ankurgel: same really, but it's the internet :p
<erikh> %w[a c].include?("a") is really the idiomatic way to do this.
<ankurgel> Cool_Fire, :D
<erikh> with the exception of very simple cases.
<ankurgel> erikh, yes, injekt suggestion of replacing to : raise NoSuchStrategyError unless ['R','P','S'].include?(game[0][1])&&['R','P','S'].include?(game[1][1]) worked.
chris2 has joined #ruby-lang
<injekt> now DRY
konr has joined #ruby-lang
<Cool_Fire> Does anyone know why in Ruby 1.8.7 doing a blocking pop() on a Queue in it's own thread, doesn't unblock it (either that, or the thread doesn't get scheduled for some reason)
curtism has joined #ruby-lang
<erikh> [game[0][1], game[1][1]].all? { |x| %w[R P S].include?(x) }
<Cool_Fire> I mean, it's not unblocked when something is added to the queue
<erikh> enumerable is here to make your code less ugly
<erikh> use it.
<ankurgel> erics, injekt thanks again :)
heppy has joined #ruby-lang
<injekt> weird how my name was right there
<injekt> usually other way around
<erikh> inkjet
<ankurgel> I should make a rb bot to say 'thanks' everytime someone helps me. :D
<injekt> you shouldn't, but if you did, there's cinch!
<injekt> dominikh: and you say I dont help
<ankurgel> I am tired of writing ink[tab] and waiting for irc to complete.. then erase back and do this again.
<injekt> just use i[tab]?
<shevy> why not i[Phone] !
<injekt> har
<shevy> hmm why do you write ink ankurgel
<shevy> inkjet
<shevy> aaaaaah :)
<ankurgel> shevy, exactly
<shevy> never knew that was your real nick
<ankurgel> inkjet
<ankurgel> and injekt sounds more like #inject
<ankurgel> so, confuses me over.
<injekt> it's really not hard
<injekt> (that's what she said)
<ankurgel> TWSS
<ankurgel> haha
<ankurgel> exaclty
<ankurgel> exactly*
Tearan has joined #ruby-lang
solars has joined #ruby-lang
burns180_ has joined #ruby-lang
achiu has joined #ruby-lang
Fullmoon has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
tenderlove has joined #ruby-lang
gianlucadv has joined #ruby-lang
<ankurgel> injekt, Spooner Let's make this a Rock_Paper_scissor tournament!
<shevy> exaclty <-- haha it IS hard for ankurgel :)
gasbakid__ has joined #ruby-lang
kitallis has joined #ruby-lang
<Spooner> ankurgel: What if people prefer to play ro-sham-bo? :D
<ankurgel> shevy, Dont' troll now. :P
<shevy> what
<shevy> I only like typos made by others
<shevy> :)))
<ankurgel> shevy, :D sometimes fingertips just slide over the keys.
<ankurgel> wrongly
ascarter has joined #ruby-lang
<ankurgel> Spooner, we first conduct this tournament, then we arrange ro-sham-bo for them :P
havenn has joined #ruby-lang
rindolf has quit ["Yay! I'm a llama again. http://www.shlomifish.org/"]
butchanton has joined #ruby-lang
<Spooner> ankurgel: ro-sham-bo is the same game, but in Japanese.
<ankurgel> Spooner, I have read that.. I meant, we can do modification for rashamboo in that after creating tournament.
<ankurgel> :)
riginding has joined #ruby-lang
burns180 has joined #ruby-lang
Nowaker has joined #ruby-lang
Sailias_ has joined #ruby-lang
morozovm has joined #ruby-lang
jsaak has joined #ruby-lang
knightMBP has joined #ruby-lang
mytrile has joined #ruby-lang
urbanmonk has joined #ruby-lang
publicvoid has joined #ruby-lang
achiu has joined #ruby-lang
SuperTa__ has joined #ruby-lang
mytrile has joined #ruby-lang
burns180_ has joined #ruby-lang
<konr> How can I iterate over an array and return nil if a block returns nil? Like [3,30].all_must_hold {|x| x<10}
<rippa> konr: #any?
<rippa> and
<rippa> #none?
<rippa> and
<rippa> #all?
<konr> rippa: great! thanks
Keva161 has joined #ruby-lang
<lianj> dominikh is rich now \o/
<lianj> oh, and my buffer was scrolled up :D
<dominikh> …
headius has joined #ruby-lang
pemeon has joined #ruby-lang
mark_locklear has joined #ruby-lang
justinmcp has joined #ruby-lang
Giddeon has joined #ruby-lang
imperator has joined #ruby-lang
<imperator> 'ello 'ello
<ankurgel> .gsub('['
<ankurgel> .gsub('[']','h')
sdeobald_ has joined #ruby-lang
darkf_ has joined #ruby-lang
kaiwren has joined #ruby-lang
Heimidal has joined #ruby-lang
qpingu has joined #ruby-lang
brianpWins has joined #ruby-lang
gregf has joined #ruby-lang
futurechimp has joined #ruby-lang
gix has joined #ruby-lang
kp666 has joined #ruby-lang
Skif has joined #ruby-lang
Heimidal has joined #ruby-lang
dustacio has joined #ruby-lang
burns180 has joined #ruby-lang
sdeobald_ has joined #ruby-lang
twittard has joined #ruby-lang
Giddeon has joined #ruby-lang
neoesque has joined #ruby-lang
SITZ has joined #ruby-lang
<dominikh> yeah, that will not work.
<dominikh> like, at all :P
Giddeon has joined #ruby-lang
lsegal has joined #ruby-lang
Heimidal_ has joined #ruby-lang
<mistym> Might get imperator by accident ;)
<mistym> Apparently I was scrolled way way up. Embarassing.
<mistym> /ignore self
cwd1 has joined #ruby-lang
<imperator> hm?
<shevy> hmm question...
<shevy> let's say I have 100 .rb classes running
<shevy> now I want to modify a special variable, let's call it "foo", in one of those classes - and I want to propagate the new value of this variable to all the other running instances of that class too
<shevy> (they are all the same class)
<shevy> hmmmm
<shevy> I am going to ponder more about this first
<futurechimp> @@foo?
<futurechimp> (without the "?") :)
<shevy> hmm that could work
<shevy> or would it?
* manveru pretends he didn't see that
<futurechimp> sounds like you want a class variable maybe?
<imperator> shevy, Observable?
<shevy> thanks imperator, will have a look
burns180_ has joined #ruby-lang
gasbakid has joined #ruby-lang
gregf has joined #ruby-lang
tyman has joined #ruby-lang
seanstickle has joined #ruby-lang
bryancp has joined #ruby-lang
mikeric has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
erics has joined #ruby-lang
cyri_ has joined #ruby-lang
woollyams has joined #ruby-lang
burgestrand has joined #ruby-lang
y3llow has joined #ruby-lang
s0ber has joined #ruby-lang
y3llow has joined #ruby-lang
y3llow has joined #ruby-lang
y3llow has joined #ruby-lang
apeiros_ has joined #ruby-lang
A124 has joined #ruby-lang
y3llow has joined #ruby-lang
burns180 has joined #ruby-lang
y3llow has joined #ruby-lang
karshenas has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
dborin has quit [#ruby-lang]
<karshenas> It's been several years since I've used IRC, but if I remember right it was usually best to read a FAQ before posting anything. Is this still common practice?
y3llow has joined #ruby-lang
<saneshark> is everyone idle?
<shevy> saneshark wat
<A124> karshenas: Depends on interpretation of 'best'.
<shevy> the strongest idler becomes king
<shevy> I am a solid runnerup
<saneshark> Hi shevy, i have a question about custom Liquid tags in ruby
<shevy> that is nice but you should ask in general
<shevy> this is the first time I heard about "custom liquid tags" so I could not be of any help
<saneshark> i see, channel ruby-general?
<saneshark> thanks
cored has joined #ruby-lang
cored has joined #ruby-lang
y3llow has joined #ruby-lang
<shevy> wat
<shevy> here
<shevy> and then wait
<shevy> you can idle while waiting :P
<saneshark> heh ok, well perhaps I should ask phrase the question more specifically
<saneshark> I have a class ImageTag < Liquid::Tag
y3llow has joined #ruby-lang
<saneshark> I would like to create a class FigureImageTag < Liquid::Tag
<saneshark> both of these will have a number of required parameters and optional parameters
mattonrails has joined #ruby-lang
<saneshark> Since FigureImageTag uses the functionality of ImageTag by making a call to it, i need a way of parsing the regular expressions for the ImageTag provided by the user after initializing FigureImageTag… to do this, I most likely need to parse using a separator of some sort
y3llow has joined #ruby-lang
<saneshark> Basically, what i'm trying to do, is create a custom tag to display something like this:
malev_ has joined #ruby-lang
<saneshark> <figure class=center>
<saneshark>   <img src="/contra.jpg" alt="One of the greatest nintendo games of all time">
<saneshark>   <figcaption>Up Up Down Down Left Right Left Right B A B A <a href="http://www.youtube.com/contramoves/">Watch on Youtube</a></figcaption>
<saneshark> </figure>
kp666 has joined #ruby-lang
<saneshark> i already have a custom class created for the line that produces img, but I need that to appear nested within a figure
y3llow has joined #ruby-lang
<saneshark> the figure will also need to have additional attributes for a possible link (to go around the img), and a caption for figcaption
<saneshark> since some of the attributes of img can be optional from ImageTag , and likewise some will be optional in the link attributes… I imagine I will need to do parsing via a separator such as ';'
burgestrand has joined #ruby-lang
y3llow has joined #ruby-lang
<saneshark> Is there some better way that I could implement these "nested" liquid tags using filters or drops as opposed to a using a bunch of regex? There has to be an efficient and yet DRY approach to solving this problem.
tenderlove has joined #ruby-lang
<saneshark> If anyone has any thoughts, please feel free to respond here or if you prefer: http://stackoverflow.com/questions/9569650/nesting-two-custom-liquid-tags-that-have-optional-parameters
y3llow has joined #ruby-lang
benanne has joined #ruby-lang
RickHull has joined #ruby-lang
chimkan has joined #ruby-lang
chimkan_ has joined #ruby-lang
virunga has joined #ruby-lang
WillMarshall has joined #ruby-lang
malev has joined #ruby-lang
malev_ has joined #ruby-lang
<shevy> young padawan ;)
<shevy> it may be that 80% here are idling right now and none knows about liquid tag
<shevy> (of the remaining 20% who read it that is)
<A124> 20% Isn't that too much? :D
davidw has joined #ruby-lang
<wmoxam> shevy: or there's the 57% who don't care
havenn has joined #ruby-lang
<wmoxam> shevy: also, 43% of stats are made up on the spot ;)
ascarter has joined #ruby-lang
cored has joined #ruby-lang
cored has joined #ruby-lang
<apeiros_> wmoxam: and 78% of them are wrong
<shevy> wmoxam well, I reckon that 98% of those who don't care in your equation also don't know about liquid tags
<shevy> A124 they are just and try to be quiet :)
<shevy> oops
<shevy> A124 they are just shy and try to be quiet
<shevy> must. not. forget. words...
<wmoxam> shevy: I'm sure that you gave it 110%, but I'm 88% sure that you're wrong about that assumption
<shevy> nono really
<shevy> wmoxam, admit it. you are clueless about liquid tags :P
<shevy> everyone else is too
<wmoxam> shevy: like, liquid the template language?
<shevy> I officially declare liquid tags to be dead
<wmoxam> used by Shopify
<shevy> wmoxam, awww you got me there :( I have absolutely no idea...
<shevy> dont know Shopify either
QaDeS has joined #ruby-lang
<shevy> saneshark, wmoxam may know more!
<wmoxam> shevy: but I don't care
<wmoxam> :p
<A124> Nah I'm not surprised if there is a social talk in #ruby now
<shevy> :(
<saneshark> Liquid tags are a nightmare
<A124> And you are their son?
<shevy> the sad number one rule in rubylandia is
<shevy> - write things on your own
<shevy> 2% of the projects out there are good
<shevy> rubygems. is good
<shevy> well perhaps less than 2%, I cant come up with more examples
QaDeS has joined #ruby-lang
<wmoxam> shevy: I'm 47% sure that you're 83% wrong again
burns180_ has joined #ruby-lang
<shevy> hopefully
<shevy> it would be sad if I would be right
shtirlic has joined #ruby-lang
shtirlic has joined #ruby-lang
<lianj> even a sad panda is always 4% happy
<saneshark> I am 2% happy
<shevy> that's not much
srbartlett has joined #ruby-lang
shtirlic has joined #ruby-lang
<saneshark> i know, i started losing %s happiness at exponential rate f(x) = normalwakinghours + timetosolveproblem
Heimidal has joined #ruby-lang
shtirlic has joined #ruby-lang
<saneshark> quantity squared
<erikh> most software sucks
<drbrain> slyphon: Y U NO WRITE PATCH?
<slyphon> drbrain: wah?
<drbrain> slyphon: oops, Y U NO WRITE TEST?
<slyphon> drbrain: you said you'd write the test
<slyphon> "Don't worry, i can take care of that"
<drbrain> OH RIGHT!
<drbrain> DISREGARD
<slyphon> hahahaha
<slyphon> :D
<saneshark> LOL
malev has joined #ruby-lang
brownies has joined #ruby-lang
delinquentme has joined #ruby-lang
kp666 has joined #ruby-lang
<saneshark> i recall irc having a lot more stupid rules in channels than I'm finding here on freenode.net, but I suppose it was a bit more active too.
<saneshark> maybe that was just EFNET?
<drbrain> saneshark: maybe
<drbrain> the rule here is mostly just "don't be a jerk"
<drbrain> oh, and "no talking bots"
<drbrain> … besides corundum
<saneshark> oh, thank god for that - bots had to have been one of the most annoying things. except when they leeched files.
fayimora_ has joined #ruby-lang
fayimora has joined #ruby-lang
dajmon has joined #ruby-lang
<dajmon> I am a master’s student performing research at the University of Texas at Austin School of Information. I am observing the channel as part of a study on Ruby culture (IRB Study Number 2011-12-0078).
<dajmon> I am not collecting any identifying information. Please feel free to message me if you are interested in participating in a short interview.
<dajmon> You may contact James Howison, the Principal Investigator, via e-mail at jhowison@ischool.utexas.edu or phone at (512) 232-9219 with questions, comments, or suggestions.
srbaker has joined #ruby-lang
<dominikh> dajmon: your professor didn't teach you good manners, did he? Like, don't repeat that annoying message over and over :/
<saneshark> lol
<drbrain> dominikh: how many times is that?
<drbrain> … in how many hours/days …
<dominikh> four times over the course of 6 days
<TTilus> you might get waycooler study if you built it on top of pry instead of irb..
<drbrain> dajmon: are you a bot?
<dajmon> no i'm not a bot
<dajmon> it's a condition of my IRB approval that i have to say that every time i come in
<dajmon> i originally didn't write it in but they requested that i do so
<dominikh> okay, they actually teach you bad manners, that's great :D
<saneshark> For good time email -- jhowison@ischool.utexas.edu -- he likes porn
<workmad3> dajmon: I do not give permission for any of my conversation to be put into a research study for any purpose, even if it is stripped of non-identifying information
<drbrain> dajmon: ☹
* workmad3 wonders how that will be handled :)
<drbrain> dajmon: you should use dircproxy to stay in the channel longer
<drbrain> then you won't have to repeat yourself so much, and we'll be less annoyed
<ged> workmad3: Stripped of *non*-identifying information?
<TTilus> irssi+tmux
<workmad3> ged: :P
<ged> :P
<dajmon> i'm sorry if i've annoyed you, no one expressed any annoyance up until now. the spirit of the approval is that i have to say that every time i engage in any kind of participation/observation in here so i don't think i can get away with only saying it every time i physically join :(
<dajmon> also, i'm not citing any specific quotes from people unless they consent to an interview, so you don't have to worry about me quoting your conversation
<dominikh> how will they know you didn't do it? Also, are you going to mention this incident in your research? ;)
<drbrain> I've read too many statistical reconstruction papers to believe in "non-identifying information"
<dominikh> because I want to be mentioned by name :>
<drbrain> dajmon: it's fine
<dajmon> i will probably mention it in my research :P
<workmad3> dajmon: I was more stating that I don't want anything I say in chan to be used in any research, not just that I don't want to be quoted
<felideon> dajmon: how do you differentiate between #ruby-lang culture and IRC culture in general?
<TTilus> dajmon: just out of curiosity, who are "they" who gave you that "approval"?
<dajmon> the institutional review board
<drbrain> dajmon: but, I think your research project is interesting
<lianj> depends on the outcome :D
<drbrain> TTilus: I would guess his research was reviewed for ethical practices
<TTilus> workmad3: just sue them, then we'll see how it goes =D
<dajmon> and felideon: that's an interesting question, i picked a specifically ruby-centered channel but there are definitely irc channels with no specific drive
<TTilus> drbrain: most probably
<workmad3> TTilus: :D that's an idea... a private british citizen suing an american university :)
<dajmon> workmad3: i welcome you to e-mail the principal investigator at the e-mail address i sent above, but you'll find it's hard to argue that case because IRC channels are publicly logged and are public spaces
acyed has joined #ruby-lang
<dajmon> at least in the definition of the IRB at the minute
<dajmon> the equivalent is going into a town square and shouting "HEY EVERYONE I'M GOING TO WATCH WHAT YOU DO NOW"
achiu has joined #ruby-lang
woollyams has joined #ruby-lang
<drbrain> workmad3: I think whitequark runs a public log
<dajmon> i could technically have worked just from the public logs but i wanted to come in and talk to people :)
<workmad3> drbrain: I don't mind being publically logged... I just disapprove of being used in research without being politely requested in advance :)
<drbrain> and I have a private log
<workmad3> hell, I don't even really disapprove of that... I was just curious as to how the research project would handle it :)
<drbrain> workmad3: it's likely that most of the places you shop at use your actions for research…
<workmad3> if the answer is 'screw you', that says a lot about it IMO ;)
<dajmon> it's not something any of the researchers can answer beyond what i just said, really, you'd probably have to take it up with the institutional review board
looopy has joined #ruby-lang
<dajmon> my answer isn't "screw you" :(
burns180 has joined #ruby-lang
<workmad3> dajmon: it kinda is... a bit nicer, but essentially 'I'm not going to specifically exclude you because you requested it'... also, is this giving you insight into the culture of the Ruby community? :)
<dajmon> a bit!
<TTilus> workmad3: most probably! =D
<dajmon> i mean i'm just not sure what you want me to do to "exclude you" if all i'm doing is reporting on the general topics of conversation
<TTilus> dajmon: are you taking timezones into account?
<workmad3> dajmon: I'm just messing with you now :D
RickHull has quit [#ruby-lang]
<dajmon> TTilus: i can't, really, since I'm not collecting any kind of information, i can really only say "at these times (CST) people were talking about this thing
<dajmon> "
<TTilus> dajmon: i mean, the quality of the conversation skyrockets when the new continent is sleeping =D
urbino has joined #ruby-lang
tenderlove has joined #ruby-lang
<dajmon> i wasn't aware of this, but i'll take it into account
<dajmon> workmad3: i know you're teasing but this is my first irb-approved study so i am feeling a little nervous!!
<workmad3> dajmon: also, how do you handle making sure people that join the channel after you've joined know that you're observing and researching them?
<urbino> Anyone here willing to help a pythonista transition to ruby?
<felideon> workmad3: someone should set the /topic for him
<dajmon> well having a script at all is basically the research equivalent of throwing your hands up in the air and saying "well this is the best i can do"
gsav has joined #ruby-lang
<dajmon> i mean, if I spammed it any more often I think people would get REALLY annoyed, as someone has already shown :P
<lianj> urbino: always
* TTilus doesnt really have a clue, but likes to think the old continent (and himself belonging there) as cognitively superior =D
<workmad3> dajmon: also... is this conversation on IRB approved research going to end up as a conversation topic in your research? or are you going to attempt to remove the bias caused by your spam messages? :)
<urbino> Thanks lianj
<urbino> I am new to IRC and not a git gister but I am here to get over that too
<lianj> whats irb again?
<dajmon> workmad3: i don't think i'd QUITE qualify an informed consent script as spam…but yes, I think it would be silly not to talk about having this conversation
Pikkachu has joined #ruby-lang
* TTilus is still puzzled how the research is irb based instead of, say, pry
<dajmon> part of my sort of ideological slant has to do with treating an ethnographic researcher as a living breathing person and participant, rather than playing at objectivity
<lianj> urbino: did you read some tutorials/books yet? any questions so far?
<drbrain> TTilus: which continent is the old one?
<dominikh> TTilus: that was a joke, right?
<dajmon> TTilus: by that definition, the research is Adium-based :P
countskm has joined #ruby-lang
<workmad3> dajmon: cool, throwing objectivity away as unobtainable :D
<urbino> Yep, I get the built-ins but I am over looking something or coverage is rather implicit on...
<drbrain> TTilus: I thought that Canada had some of the oldest exposed rocks…
<urbino> in python I write a foo.py and have one bar function.
<TTilus> dajmon: \o/ at least you are intellectually honest
<dominikh> dajmon: what would the interview consist of?
<urbino> from irb how do I start it interactivly to run the function from the foo.rb
<TTilus> dominikh: me never jokin'
<dominikh> TTilus: because, really, I hope the irb thing was one :P
<dajmon> dominikh: interview is semi-structured and about half an hour of your time (less/more if you like) and i just cover a few basic topics and let you say whatever you want to say :)
<drbrain> urbino: irb foo.rb
<workmad3> dominikh: either he was joking, or he was proving his own statement about the old continent false :)
<dominikh> workmad3: haha
<felideon> 30 min? geez
<dominikh> dajmon: well, I could give it a try but cannot promise to be interesting.
<dajmon> i'm just basing 30 minutes on what other people have done so far
<lianj> urbino: echo 'def foo; p :foo; end' > foo.rb; irb -I. -rfoo
Kero has joined #ruby-lang
<dajmon> one person talked for almost an hour and a half but generally they lasted around half an hour
<dominikh> oh, we're supposed to be creative? :>
<dajmon> no need to be creative!
<urbino> irb will not stay in interactive mode.?.
<workmad3> urbino: irb is purely interactive mode
<dominikh> dajmon: well then, feel free to give me a try.
<workmad3> urbino: irb is interactive ruby
<TTilus> drbrain: canada has some pretty old rocks, but so do finns
<lianj> dominikh: please answer for me too ;)
<drbrain> urbino: oops, lianj is right
<urbino> it throws errors if I try to call the function from irb but it will run the script and produce the correct output
<dominikh> lianj: sorry, my mind-reading skills suck. I will just insert EM and FFI randomly, okay?
<workmad3> urbino: people were just telling you how to require the script when you load irb :)
<lianj> dominikh: yep, that should work
<dominikh> great
<saneshark> what a bunch of exhibitionists… someone asks a question and everyone's silent, but someone shows up telling you they want to write about you and everyone gets excited! :)
<dominikh> I only answer interesting questions :P
<dominikh> and bark at people.
<dominikh> I earned this
<workmad3> I wasn't even looking at the channel, I just flicked through and saw an argument about politeness and read more :)
<TTilus> urbino: "throws errors"?
<dajmon> apologies again if spamming the channel is annoying, i'm having to walk a fine line between not being able to get everyone's consent, but still trying to let everyone know that i'm here
Pikkachu has quit [#ruby-lang]
<drbrain> dajmon: if you could get it down to one line people wouldn't be annoyed so much
<saneshark> ./title dajmon would like to interview you, msg him if you would like to participate
<saneshark> darn, i'm not an op
<dominikh> I am sure you could state the "yo, I am researching" part and add a link to a pastie with all the contact info etc
<urbino> tell me where I am going wrong here http://pastie.org/3529508
<urbino> unknown local variable error
<dajmon> dominikh: that's probably the best option since I have to include the IRB number and contact info, I'll do that
<urbino> Do I need to cread classes for every function?
<urbino> Or to use any function rather?
<mistym> urbino: ? The code in that pastie works fine for me.
<drbrain> TTilus: here's a wikipedia page we can argue over: http://en.wikipedia.org/wiki/Oldest_dated_rocks
<urbino> how do I find the IRB cwd?
<workmad3> urbino: so the method definition is in foo.rb, and then you're just loading up irb and trying to type 'palindrome?("...")' straight away?
gsav has joined #ruby-lang
<urbino> no. <<require foo
<lianj> foo should be a string like "foo"
<urbino> returns: NameError; undefined local var or method 'foo' for main:Object
<workmad3> urbino: that should be 'require "foo"' or, if you're in ruby 1.9.2+, 'require_relative "foo" '
<TTilus> drbrain: u win
<saneshark> i could have sworn I saw this same question in stackoverflow ten minutes ago.
<workmad3> urbino: hmm, or maybe just 'require "./foo" ' (can't remember how require_relative behaves in rb)
<workmad3> s/rb/irb
<mistym> workmad3: require_relative doesn't work in irb
<workmad3> mistym: that's the one :)
<urbino> Ruby 1.9.3p125> require_relative "foo"
<urbino> returns: LoadError: cannot inder basepath
<lianj> < mistym> workmad3: require_relative doesn't work in irb
<urbino> Ahh..
<lianj> either start irb with irb -I. or use require "./foo.rb"
<urbino> => true
<urbino> finally
<urbino> a sign of lide
<urbino> life
<urbino> Thanks
brushbox has joined #ruby-lang
<TTilus> urbino: on finding cwd, go with Dir.pwd
<mistym> urbino: Cheers!
<urbino> Dir is builtin?
<lianj> yep
<mistym> urbino: Yes, Dir (and File) are builtin. There's also Pathname (which is builtin but not loaded by default).
<lianj> irb -rirb/completion is nice also
<TTilus> urbino: and on classes, "everything is" and "you always have" =D
<urbino> Thanks, its another great language, but got to sort out the execution caveats diff from python
<TTilus> urbino: uhm, s/classes/objects/
davidw has joined #ruby-lang
<urbino> TTilus: that actually scares me. pure functional Lisp makes more sens to me sometimes.
<lianj> urbino: tryruby.org is nice for a first syntax sanity check
<TTilus> urbino: rumor has it you are best of with rbenv or rvm
<TTilus> urbino: u dont need to think about it
<urbino> I use rvm
<mistym> re: tryruby.org, I also find repl.it lovely
musl has joined #ruby-lang
<TTilus> urbino: you can just code away and not once wonder what is self when you are on toplevel
<lianj> mistym: ah nice. bookmarked
<urbino> I like functions ala ["100 functions at one chunk of data"] but oop classes to me are are/can be 100 designer funcs for one chunk
<TTilus> urbino: whats your general convenience/knowledge on programming languages? done any non-trivial things with different languages?
<urbino> Python: Distributed, crawling and parsing
Kichael has joined #ruby-lang
<urbino> But I still use functions as much as possible
sandbags has joined #ruby-lang
<TTilus> then youll most prolly like what you find in Enumerable
<TTilus> and Array and Hash, of course
<urbino> Enums I have to work with more
<urbino> Are there frozen sets in ruby
<TTilus> urbino: require 'set'; frozen_set = Set.new.freeze
burns180_ has joined #ruby-lang
<TTilus> urbino: that's what you asked for?
<urbino> Yep, thats it.
<urbino> Whats is the best xml parser in ruby?
<drbrain> urbino: nokogiri
<lianj> TTilus: that object cries 'damn im useless'
Sailias_ has joined #ruby-lang
petercooper has joined #ruby-lang
<TTilus> lianj: agreed
<drbrain> lianj: nature abhors an empty set?
<urbino> forzen sets are efficient when order is not important
<drbrain> urbino: if you're doing web crawling/scraping, mechanize combines nokogiri with browser-like behavior
* TTilus does not have a faintest idea of the effectivenes of ruby stdlib set implementation
<urbino> Plus & yuou need an immutable
<urbino> I use mechanize in python, I like it... anyone come up with a webkit integration ?
<urbino> handing javascript would be huge.
rushed has joined #ruby-lang
<apeiros_> there are headless webkit drivers for testing
<apeiros_> you could probably easily retrofit them for crawling
<urbino> I have seen them for node.js
<drbrain> urbino: I think there's capybara-webkit
<gate> urbino: capybara webkit rocks, I've used it heavily in testing
<apeiros_> +1
<TTilus> i like capybara dsl alot
darkf_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
<urbino> does white space & tabs matter in ruby?
virunga has joined #ruby-lang
<urbino> standard tab in python is 4 spaces for code
virunga_ has joined #ruby-lang
<drbrain> urbino: no, but the convention is two-space indent
<urbino> I have read two for ruby but it does not seem to mind yet
<TTilus> urbino: not other than the difference between zero and some space ;)
<TTilus> the convention is two-space (and no tabs)
<dominikh> the only way ruby cares about indentation is that with -W (warnings enabled) it will bark when nesting is uneven. other than that, no indentation required at all, mixed is allowed, indenting every new line by 2 more spaces works as well. people will just hate you.
Giddeon has joined #ruby-lang
skipper has joined #ruby-lang
imperator has joined #ruby-lang
isale-eko has joined #ruby-lang
<urbino> Is there a Counter function for item frequency "word frequency"
<TTilus> like Array#count?
<urbino> yep
<dominikh> 30
<dominikh> arg.. never mind that
<dominikh> for your information: it actually does take about 30 minutes :P
<urbino> array.count will count items in array but what about frequency of items in the array?
<A124> urbino: There is a way to do it through hash. Although there might be a funtion in that today.
<urbino> how do you count frequency of words in a string?
<A124> Give me a sec.
<urbino> is the a collections class with a hash that can default to int values?
<TTilus> urbino: what do you mean?
<A124> Yes.
<TTilus> urbino: you can set default for hash values
<A124> Hash.new(0)
burns180 has joined #ruby-lang
<A124> s = "one two two three three three"; s.split(' ').inject(Hash.new(0)) { |h,v| h[v] += 1; h }
<A124> urbino: Is that what you want?
<A124> In case you want inteligent word splitting, use Shellwords.split instead of split
<zenspider> useless use of inject is useless
<zenspider> anytime you see ; in an inject is a red flag
<dominikh> +1
<A124> Agreed. Sorry, and thanks for poiting that out.
<A124> But the functionality is basically that, I wanted to show that, just rewrite it.
* petercooper <3 each_with_object/each.with_object
alex_k has joined #ruby-lang
<zenspider> petercooper: I still don't see the point... honestly all the tap/inject/with_object stuff seems like lazy rationalization to save 1 line
<zenspider> and in most cases... it doesn't save a line
<petercooper> You mean as opposed to defining that hash earlier?
<zenspider> tap is always the same number of lines
<zenspider> yup
mistym has joined #ruby-lang
darkf_ has joined #ruby-lang
<petercooper> DHH's use of tap jarred me a lot at first. I'm kinda on the fence now.
<zenspider> it's the same number of lines. less clear. and slower... what are you on the fence about?
<petercooper> It fits into the Rails ethos of pointless magic to me so maybe it's fine for that ;-)
<zenspider> that and DHH is a walking anti-pattern when it comes to actual code
<petercooper> "I think the Law of Demeter is shit and I never follow it."
<petercooper> I would quote you but I like you too much.
<petercooper> :-P
<petercooper> (and people who quote off of IRC are a bit skeevy at the best of times..)
<urbino> A124: thanks
<wmoxam> omg, sounds like someone is wrong on the internet
<urbino> that works
<A124> urbino: Welcome.
chimkan has joined #ruby-lang
<zenspider> haha
<petercooper> The only thing I learned that genuinely surprised me from the latest debacle is there's a repo on GitHub that abuses and slanders Zed Shaw, coupled with a weird rape fantasy cartoon with Zed's head pasted in.
<zenspider> HAHA
<zenspider> wtf?
<petercooper> And we've had our differences, but I think it's crazy they let that stay.
<ged> If I am writing data to a socket that is a binary header followed by utf-8 text, how do I avoid the "incompatible character encodings" when I try to append one to the other?
<zenspider> petercooper: libels
<wmoxam> petercooper: link?
<petercooper> good point
<zenspider> ged: with a gun to your mouth...
<petercooper> although maybe it was also all uttered whilet yping it, heh
<zenspider> seriously... the encoding shit drives me up the wall
<zenspider> haha
<ged> Hahaha.
<petercooper> wmoxam: https://github.com/nickmartini/dongml .. see far bottom of page for the "comic"
<drbrain> ged: force_encoding the UTF-8 text to BINARY
<dominikh> ged: String#force_encoding the utf-8 part to BINARY
<wmoxam> oh, dongml
<wmoxam> :p
<dominikh> drbrain: was that necessary? :P
<drbrain> ged: and have the socket wrapper verify it
<zenspider> wtf?
<ged> Ah, okay, nice.
<urbino> lianj: and TTilus: thanks for your help too.
<zenspider> wow. dongml... dick and boob coding...
<urbino> got to go
<zenspider> is this written by a 10 year old boy?
<drbrain> dominikh: which where?
<dominikh> drbrain: being faster than me by two seconds.
<zenspider> dominikh: you were more clear tho... it might not have been a String method :P
<dominikh> thank you! :P
<wmoxam> petercooper: that's fucked up
<drbrain> dominikh: heh
<wmoxam> where can I downvote this?
<petercooper> I don't know if repos have a way to flag them
<petercooper> until yesterday, pasting in your public key and changing the repo would have been OK
<wmoxam> heh
rippa has joined #ruby-lang
<dominikh> :D
burns180_ has joined #ruby-lang
enebo has joined #ruby-lang
aza_kibou has joined #ruby-lang
<cored> hello
<cored> I'm getting
<cored> a nil pointer exception with this spec
fukushima has joined #ruby-lang
<zenspider> cored: oh
<zenspider> is there a question in there?
naz has joined #ruby-lang
<cored> zenspider: :-
<cored> :-)
<deryldoucette> doesn't look like you closed the [] in 128
<A124> ["Armando", "S
<deryldoucette> yep that'd be where i mean
<A124> deryldoucette: <<
<cored> no that was a bad pastie
<cored> but the code is good
<zenspider> cored... if you want help with something. you need to provide more information than a blob of code. A question and enough data to support that question is needed if we're to understand anything
<A124> Exactly.
CodyD has joined #ruby-lang
<zenspider> and see above for my rant on your reduce. it's wholly unnecessary
RomyRomy has joined #ruby-lang
<deryldoucette> my usual alias..
<deryldoucette> Please ask SICCO questions :) Specific, Informative, Concise, Complete, and On-Topic. This means we need a description of the problem, it's symptoms, what you have tried, and MAKE SURE you've searched for answers on your own FIRST! GOOGLE IS YOUR FRIEND! Without this information, we can not assist you since we can not troubleshoot a problem if we have no info regarding what it should be doing and is not.
<A124> zenspider: Talking to me?
<deryldoucette> follow that to get higher quality assistance back from your questions
<zenspider> A124: still talking to cored
<A124> Ah. ok. Thanks
<zenspider> and now it seems like I'm talking to a wall
<A124> That's normal.
<ged> drbrain, dominikh: That worked great, thanks!
achiu has joined #ruby-lang
dous has joined #ruby-lang
<A124> Why there are two channels anyway? #ruby and #ruby-lang?
<dominikh> because some people thought it was a good idea to open their own, inofficial channel, ignoring freenode channel naming guidelines
<petercooper> Whoa, I never ever realized
<drbrain> A124: and so people have a place to go when they get kicked out for being jerks
<deryldoucette> err? how is that a violation? ruby-lang is the official, ruby is about well ruby
<A124> dominikh: Yes, that is the only thing that probably axplains it
<deryldoucette> never saw that as being a violation
<petercooper> it should be ##ruby, deryldoucette
<deryldoucette> ahhh
<dominikh> what he said
<petercooper> on freenode, # channels are, I believe, meant to be 'official' for the named project
<dominikh> correct
<deryldoucette> got ya. thanks for the clarification
<petercooper> Though does that mean this channel was founded in relation to ruby-lang.org?
<A124> Yes, they ar.
<drbrain> petercooper: I think so
<dominikh> yup
<A124> ruby-lang is in esential current ruby development
<drbrain> I can't remember that far back
<deryldoucette> heh
<dominikh> one way or another it's the official channel now
* petercooper prays #ruby isn't the Ruby equivalent of #rubyonrails
burns180 has joined #ruby-lang
<deryldoucette> i ahve trouble remembering what i did yesterday, nevermind what took place way back when :)
<deryldoucette> s/ah/ha/
<dominikh> ahahaha
<zenspider> I thought ## was for stuff "off topic"... this being an open source irc... that's why I'm in ##mathematica
<zenspider> and ##homebrew is about beer :)
<deryldoucette> mmmm beer
<zenspider> (and ALWAYS gets me when I need help with machomebrew)
<dominikh> haha. well, it follows the same principles ;)
<dominikh> the channel founders do not own the names mathematics or homebrew
<dominikh> also not sure if joking or serious
<petercooper> http://freenode.net/policy.shtml#channelnaming for the similarly bored