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
tommyvyo_ has joined #ruby-lang
tommyvyo_ has joined #ruby-lang
srbartle_ has joined #ruby-lang
srbartle_ has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has joined #ruby-lang
<erikh> brahmana: enjoy
dejongge1 has joined #ruby-lang
dejongge1 has joined #ruby-lang
Jarred has joined #ruby-lang
Jarred has joined #ruby-lang
<Jarred> Does "maintaining state" also mean "Know what state to change to"?
<Jarred> or rather, include
Hackula has joined #ruby-lang
Hackula has joined #ruby-lang
<Jarred> (i.e in the context of a state machine)
tomzx has joined #ruby-lang
tomzx has joined #ruby-lang
Jarred has joined #ruby-lang
Jarred has joined #ruby-lang
<Jarred> Why does it seem like DataMapper wants to be ActiveRecord?
brownies has joined #ruby-lang
brownies has joined #ruby-lang
<shevy> hehe
Jarred has joined #ruby-lang
Jarred has joined #ruby-lang
<shevy> because it is ActiveFun after all!
<Jarred> Can I specify multiple modules to require in a Gemfile?
<skyjumper> hmm why might "rvm install ruby-head" be trying to install ruby-1.8.7-p358?
<Jarred> (e.g. gem 'datamapper', :require => 'dm/core' and 'dm-timestamps'
<Jarred> er
<Jarred> ['dm-core', 'dm-timestamps']
<Jarred> nvm
dkubb has joined #ruby-lang
dkubb has joined #ruby-lang
leonL has joined #ruby-lang
leonL has joined #ruby-lang
srbaker has joined #ruby-lang
srbaker has joined #ruby-lang
Jarred has joined #ruby-lang
Jarred has joined #ruby-lang
<Jarred> What's a good ORM for a Sinatra app?
<injekt> Jarred: I like sequel
havenn has joined #ruby-lang
havenn has joined #ruby-lang
<Jarred> The sinatra-sequel gem hasn't seen any commits in a year, is that a problem?
nanothief has joined #ruby-lang
nanothief has joined #ruby-lang
<injekt> Jarred: na, check the source code for it out, it's only a very simple wrapper
<injekt> I dont use it myself
robbyoconnor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
dous has joined #ruby-lang
dous has joined #ruby-lang
postmodern has joined #ruby-lang
postmodern has joined #ruby-lang
t has joined #ruby-lang
t has joined #ruby-lang
alex_k has joined #ruby-lang
alex_k has joined #ruby-lang
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
chessguy has joined #ruby-lang
chessguy has joined #ruby-lang
ilyam has joined #ruby-lang
ilyam has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has joined #ruby-lang
t_ has joined #ruby-lang
t_ has joined #ruby-lang
replore has joined #ruby-lang
replore has joined #ruby-lang
srbaker has joined #ruby-lang
srbaker has joined #ruby-lang
csprite has joined #ruby-lang
csprite has joined #ruby-lang
slimfit has joined #ruby-lang
slimfit has joined #ruby-lang
jxie has joined #ruby-lang
jxie has joined #ruby-lang
H2H has joined #ruby-lang
H2H has joined #ruby-lang
havenn has joined #ruby-lang
havenn has joined #ruby-lang
Heimidal has joined #ruby-lang
Heimidal has joined #ruby-lang
undersc0re has joined #ruby-lang
undersc0re has joined #ruby-lang
undersc0re has joined #ruby-lang
undersc0re has joined #ruby-lang
undersc0re has quit [#ruby-lang]
undersc0re has quit [#ruby-lang]
bryancp has joined #ruby-lang
bryancp has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
seanstickle has joined #ruby-lang
seanstickle has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has quit [#ruby-lang]
QoQOoO has quit [#ruby-lang]
QaDeS has joined #ruby-lang
QaDeS has joined #ruby-lang
coreydaley has joined #ruby-lang
coreydaley has joined #ruby-lang
Hackula has joined #ruby-lang
Hackula has joined #ruby-lang
Zolrath has joined #ruby-lang
Zolrath has joined #ruby-lang
gregf has joined #ruby-lang
gregf has joined #ruby-lang
slyphon has joined #ruby-lang
slyphon has joined #ruby-lang
andrewhl has joined #ruby-lang
andrewhl has joined #ruby-lang
burns180_ has joined #ruby-lang
burns180_ has joined #ruby-lang
shtirlic has joined #ruby-lang
shtirlic has joined #ruby-lang
macmartine has joined #ruby-lang
macmartine has joined #ruby-lang
Luxx_ has joined #ruby-lang
Luxx_ has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
wmoxam has joined #ruby-lang
wmoxam has joined #ruby-lang
stepnem has joined #ruby-lang
stepnem has joined #ruby-lang
wmoxam has joined #ruby-lang
wmoxam has joined #ruby-lang
neoesque has joined #ruby-lang
neoesque has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
jeffmoss has joined #ruby-lang
jeffmoss has joined #ruby-lang
<skyjumper> anyone know of a good library for normalizing html / forcing it to be valid?
<seanstickle> htmltidy?
<skyjumper> not a bad idea, ideally it wouldn't be external
<seanstickle> Ruby bindings, no?
<skyjumper> looks unmaintained
ilyam_ has joined #ruby-lang
ilyam_ has joined #ruby-lang
<seanstickle> Hooks into the lib and offers wrappers. How much maintenance does it need.
<skyjumper> dunno, could be broken
<seanstickle> Pretty easy to find out.
* skyjumper finds out
QoQOoO has joined #ruby-lang
QoQOoO has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
twittard_ has joined #ruby-lang
twittard_ has joined #ruby-lang
ilyam has joined #ruby-lang
ilyam has joined #ruby-lang
gnufied has joined #ruby-lang
gnufied has joined #ruby-lang
cjs226 has joined #ruby-lang
cjs226 has joined #ruby-lang
lightcap has joined #ruby-lang
lightcap has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
justinxreese has joined #ruby-lang
justinxreese has joined #ruby-lang
dv310p3r has joined #ruby-lang
dv310p3r has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has joined #ruby-lang
Aaaarg_ has joined #ruby-lang
Aaaarg_ has joined #ruby-lang
brianpWins has joined #ruby-lang
brianpWins has joined #ruby-lang
burns180_ has joined #ruby-lang
burns180_ has joined #ruby-lang
nofxx_ has joined #ruby-lang
nofxx_ has joined #ruby-lang
Asher has joined #ruby-lang
Asher has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
coreydaley has joined #ruby-lang
coreydaley has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
nofxx_ has joined #ruby-lang
nofxx_ has joined #ruby-lang
<postmodern> is there a way to access the AST of a Regexp in 1.9?
<cout> good question
<Asher> the AST being the regexp source?
<postmodern> Asher, the actual tree
<cout> postmodern: I think you could do it from C
<postmodern> Asher, it appears there's some regexp grammars, i could use those to parse the raw source
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
<cout> postmodern: look at onig_parse_make_tree()
<postmodern> oh interesting
nofxx_ has joined #ruby-lang
nofxx_ has joined #ruby-lang
rohit has joined #ruby-lang
rohit has joined #ruby-lang
nofxxx has joined #ruby-lang
nofxxx has joined #ruby-lang
nofxxx has joined #ruby-lang
nofxxx has joined #ruby-lang
nofxxx has joined #ruby-lang
nofxxx has joined #ruby-lang
nofxx_ has joined #ruby-lang
nofxx_ has joined #ruby-lang
<cout> postmodern: also print_indent_tree()
<cout> and onig_print_compiled_byte_code (which would be bytecode instead of AST)
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
skryking has joined #ruby-lang
skryking has joined #ruby-lang
jfelchner has joined #ruby-lang
jfelchner has joined #ruby-lang
naz has joined #ruby-lang
naz has joined #ruby-lang
jasonw22 has joined #ruby-lang
jasonw22 has joined #ruby-lang
csprite has joined #ruby-lang
csprite has joined #ruby-lang
achiu has joined #ruby-lang
achiu has joined #ruby-lang
rippa has joined #ruby-lang
rippa has joined #ruby-lang
uniqanomaly has joined #ruby-lang
uniqanomaly has joined #ruby-lang
burns180_ has joined #ruby-lang
burns180_ has joined #ruby-lang
Azure has joined #ruby-lang
Azure has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
jasonw22 has joined #ruby-lang
jasonw22 has joined #ruby-lang
srbartlett has joined #ruby-lang
srbartlett has joined #ruby-lang
savage- has joined #ruby-lang
savage- has joined #ruby-lang
brianpWins has joined #ruby-lang
brianpWins has joined #ruby-lang
cyndis has joined #ruby-lang
cyndis has joined #ruby-lang
wmoxam has joined #ruby-lang
wmoxam has joined #ruby-lang
ryanf has joined #ruby-lang
ryanf has joined #ruby-lang
shyouhei_ has joined #ruby-lang
shyouhei_ has joined #ruby-lang
yumike has joined #ruby-lang
yumike has joined #ruby-lang
<nofxx> Those sinatra apps are very handy , but cd folder... rake/start/whatever ... open firefox to type 'lo' and hope for the port there to avoid typing, sux.... anything I'm missing?
<nofxx> just `niceapp` ... bump, ffox or whatever running the thing
<nofxx> and it chooses a random port too, grrr nothing worst to ps aux for some app using 5678 hehe
<nofxx> I'm thinking writing a binary for the gems, do a random for port and uses launchy
<nofxx> bump/boom
<nanothief> can't you use -p to choose the port?
<nofxx> nanothief, you missed the rant idea heh
<nanothief> I'm not exactly following the rant though :P
<nanothief> oh you want to be able run something like "start_gem <sinatra_gem>", and it starts and opens a page in firefox?
<nofxx> nanothief, one, < 10 char command will do it all
<nofxx> nanothief, exactly
dfr|mac has joined #ruby-lang
dfr|mac has joined #ruby-lang
dfr|mac_ has joined #ruby-lang
dfr|mac_ has joined #ruby-lang
fayimora has joined #ruby-lang
fayimora has joined #ruby-lang
brownies has joined #ruby-lang
brownies has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has joined #ruby-lang
JohnBat26 has joined #ruby-lang
JohnBat26 has joined #ruby-lang
denysonique__ has joined #ruby-lang
denysonique__ has joined #ruby-lang
looopy has joined #ruby-lang
looopy has joined #ruby-lang
brownies has joined #ruby-lang
brownies has joined #ruby-lang
wyhaines_ has joined #ruby-lang
wyhaines_ has joined #ruby-lang
nguerin has joined #ruby-lang
nguerin has joined #ruby-lang
<nguerin> hey, does anyone have any experience using asian characters in ruby, for example 你好
x0F__ has joined #ruby-lang
x0F__ has joined #ruby-lang
woollyams has joined #ruby-lang
woollyams has joined #ruby-lang
rohit has joined #ruby-lang
rohit has joined #ruby-lang
yxhuvud has joined #ruby-lang
yxhuvud has joined #ruby-lang
imperator has joined #ruby-lang
imperator has joined #ruby-lang
DRCALKIN has joined #ruby-lang
DRCALKIN has joined #ruby-lang
csherin has joined #ruby-lang
csherin has joined #ruby-lang
replore_ has joined #ruby-lang
replore_ has joined #ruby-lang
bryancp has joined #ruby-lang
bryancp has joined #ruby-lang
genivf has joined #ruby-lang
genivf has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
Stereokitsune has joined #ruby-lang
Stereokitsune has joined #ruby-lang
twelvechairs has joined #ruby-lang
twelvechairs has joined #ruby-lang
lightcap has joined #ruby-lang
lightcap has joined #ruby-lang
<twelvechairs> anyone know how to parse a poorly-formatted RSS feed?
Banistergalaxy has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Stereokitsune has joined #ruby-lang
Stereokitsune has joined #ruby-lang
toretore has joined #ruby-lang
toretore has joined #ruby-lang
mytrile has joined #ruby-lang
mytrile has joined #ruby-lang
QoQOoO has joined #ruby-lang
QoQOoO has joined #ruby-lang
<rippa> format it right
frangiz has joined #ruby-lang
frangiz has joined #ruby-lang
<Jarred> How do I dereference an object manually?
daglees has joined #ruby-lang
daglees has joined #ruby-lang
<rippa> explain
<Jarred> wait
<Jarred> I'm probably doing this wrong
<Jarred> I'll explain
<Jarred> This is for a state machine. I store state changes and "why" in the database. Its an alarm. It has many sensor states and resident states (home or not)
<Jarred> But the actual state machine part -- the part that decides what state it should be in
<Jarred> that's within the AlarmState modle
<Jarred> *model
<Jarred> but that should probably be in the Alarm model
robbyoconnor has joined #ruby-lang
robbyoconnor has joined #ruby-lang
<Jarred> (They're just stubs atm)
RomyRomy has joined #ruby-lang
RomyRomy has joined #ruby-lang
<Jarred> Why I wanted to dereference an object is because the state machine gem is on the instance level, not on the class level
macmartine has joined #ruby-lang
macmartine has joined #ruby-lang
<yxhuvud> sounds like you need a redesign, not a way to savage the garbage collector
<erikh> he's using one of those state machine rails plugins
<erikh> those things are like spaghetti in a gem
<Jarred> lol
<yxhuvud> :D
<Jarred> I have no issues with that
<Jarred> The question is how
<Jarred> (or rather, in what way)
<Jarred> I'm not sure if Rails is the right solution for this
<erikh> it would serve you well to understand the difference between instance and class methods
<Jarred> Its going to be a physical alarm box at one point
<Jarred> Yeah I know
<Jarred> but
<erikh> but what
<yxhuvud> I'll remember the 'spaghetti in a gem' phrase.
<erikh> corundum: pickaxe?
<corundum> pickaxe is Programming Ruby, 3rd ed. by Dave Thomas, et al. Available for purchase (tree and pdf) at http://www.pragprog.com/ or at http://www.rubycentral.com/book/ (in first edition form) if you are a cheap bastard and hate kittens. or http://ruby-doc.org/docs/ProgrammingRuby/
<Jarred> Yeah, I shouldn't be using something that I have to work around to get working
<erikh> you probably want that book above.
<Jarred> This is a different part of the stack
<erikh> stack has nothing to do with your confusion about objects and classes
<Jarred> I know the difference. I was working around the gem
<erikh> fair enough
r0bby_ has joined #ruby-lang
r0bby_ has joined #ruby-lang
countskm has joined #ruby-lang
countskm has joined #ruby-lang
macmartine has joined #ruby-lang
macmartine has joined #ruby-lang
zmack has joined #ruby-lang
zmack has joined #ruby-lang
snafoo has joined #ruby-lang
snafoo has joined #ruby-lang
snafoo has joined #ruby-lang
snafoo has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
woollyams has joined #ruby-lang
woollyams has joined #ruby-lang
dc5ala has joined #ruby-lang
dc5ala has joined #ruby-lang
RomyRomy has joined #ruby-lang
RomyRomy has joined #ruby-lang
ankurgel has joined #ruby-lang
ankurgel has joined #ruby-lang
Bulkior has joined #ruby-lang
Bulkior has joined #ruby-lang
<Bulkior> Hi, does anyone know anything about writing a bandwidth tester in ruby?
Bulkior has quit [#ruby-lang]
Bulkior has quit [#ruby-lang]
solars has joined #ruby-lang
solars has joined #ruby-lang
havenn has joined #ruby-lang
havenn has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
ankurgel has joined #ruby-lang
ankurgel has joined #ruby-lang
<ankurgel> join #gsoc
<ankurgel> oops sorry
brianpWins has joined #ruby-lang
brianpWins has joined #ruby-lang
dkubb has joined #ruby-lang
dkubb has joined #ruby-lang
ankurgel_ has joined #ruby-lang
ankurgel_ has joined #ruby-lang
Tomtheun has joined #ruby-lang
Tomtheun has joined #ruby-lang
rolfb has joined #ruby-lang
rolfb has joined #ruby-lang
<shevy> cool
<shevy> in a subclassed method one can do return "foo"+super("bla") right?
<lianj> sure
<shevy> never did that before for some reason :)
<shevy> always used super standalone
roadkith has joined #ruby-lang
roadkith has joined #ruby-lang
gasbakid has joined #ruby-lang
gasbakid has joined #ruby-lang
yumike has joined #ruby-lang
yumike has joined #ruby-lang
<kke> any links to examples of complex rest api on padrino or sinatra?
gasbakid has joined #ruby-lang
gasbakid has joined #ruby-lang
davidw has joined #ruby-lang
davidw has joined #ruby-lang
zmack has joined #ruby-lang
zmack has joined #ruby-lang
gasbakid__ has joined #ruby-lang
gasbakid__ has joined #ruby-lang
<erikh> (just kidding)
bhrgunatha has joined #ruby-lang
bhrgunatha has joined #ruby-lang
tekin has joined #ruby-lang
tekin has joined #ruby-lang
gnufied has joined #ruby-lang
gnufied has joined #ruby-lang
yumatov has joined #ruby-lang
yumatov has joined #ruby-lang
davidw has joined #ruby-lang
davidw has joined #ruby-lang
d3vic3 has joined #ruby-lang
d3vic3 has joined #ruby-lang
kek1 has joined #ruby-lang
kek1 has joined #ruby-lang
replore_ has joined #ruby-lang
replore_ has joined #ruby-lang
apeiros_ has joined #ruby-lang
apeiros_ has joined #ruby-lang
adambeynon has joined #ruby-lang
adambeynon has joined #ruby-lang
tla has joined #ruby-lang
tla has joined #ruby-lang
tbuehlmann has joined #ruby-lang
tbuehlmann has joined #ruby-lang
Aaaarg_ has joined #ruby-lang
Aaaarg_ has joined #ruby-lang
cyri_ has joined #ruby-lang
cyri_ has joined #ruby-lang
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
yibe has joined #ruby-lang
yibe has joined #ruby-lang
shtirlic has joined #ruby-lang
shtirlic has joined #ruby-lang
workmad3 has joined #ruby-lang
workmad3 has joined #ruby-lang
judofyr has joined #ruby-lang
judofyr has joined #ruby-lang
h4y4shi_ has joined #ruby-lang
h4y4shi_ has joined #ruby-lang
gasbakid has joined #ruby-lang
gasbakid has joined #ruby-lang
<h4y4shi_> Does pushing add to the front or the end of an array?
<bnagy> 'front'
<h4y4shi_> Thanks
<bnagy> right, -1 etc
<bnagy> I guess it depends on how you visualise stuff :/
<h4y4shi_> so is the front the -1 value or the 0 value?
<bnagy> well if you're using it as a stack then the front is the -1 side :)
<Silex> for me front on an array is 0
<Silex> so push adds to the end
<Silex> :)
<bnagy> well I can't help it if your brain is broken :P
pp01bit has joined #ruby-lang
pp01bit has joined #ruby-lang
<Silex> bnagy: so #shift takes from the "back" for you?
<h4y4shi_> okay thanks lol, is pop adding to the 0 value?
<bnagy> no pop pops
<bnagy> ['stackbottom'].push(1).pop => 1
<Silex> [1,2].push(3) == [1,2,3]
<bnagy> Silex: yes, push / shift is the ring buffer pattern
gasbakid has joined #ruby-lang
gasbakid has joined #ruby-lang
<Silex> fwiw, in c++ push is named push_back :)
<Silex> but I guess it's a matter of how you see it
<Silex> I'm fairly certain most users see index 0 as the front and index -1 as the back
<bnagy> yes, correctly or otherwise
<Silex> bnagy: front somewhat indicates "first" to me
<Silex> and back somewhat indicates "last"
<bnagy> Silex: yeah and when you push onto a stack, that's now the first value
<Silex> but an array is not a stack
<bnagy> it is if you're using #push
<Silex> for an array, push adds to the end of the array
<bnagy> ok well you can be wrong on your own time
<bnagy> I'ma drink beer
<Silex> for a stack you're right
<Silex> but he asked for an array
<hagabaka> is it expected that if I open pry in a block, I can't access the block arguments?
<Banistergalaxy> hagabaka: gist code
<Banistergalaxy> hagabaka: And cann you move to #ruby ? I'm on phone here:)
<bnagy> SPLITTER
<h4y4shi_> I have a problem with ruby, I dont want it to factor in my remainder. I want it to always have the answer be a multiple of 40. However I get things that arent multiples of 40. I assume that it is giving me the answer with a decimal. Could someone help me make this always factor in a multiple of 40. @x_tile = (mouse_x / 40) * 40
<bnagy> h4y4shi_: if mouse_x is a float it will stay a float until you #round #floor #ceil it or something
<h4y4shi_> Oh yeah thank you bnagy
<bnagy> it might still be tricky, floats are awkward :(
<h4y4shi_> What if I turn it into an int?
<bnagy> what do you want? A range from 0..40 ?
<h4y4shi_> no I want it to be 0 or a multiple of 40 up to 640
<h4y4shi_> but I have the up to 640 part already figured out
<bnagy> (16 * float).round * 40 ?
lbrent has joined #ruby-lang
lbrent has joined #ruby-lang
<canton7> (mouse_x.floor / 40) * 40 ?
francisfish has joined #ruby-lang
francisfish has joined #ruby-lang
<h4y4shi_> Thank you from the bottom of my heart. I have been trying to get this to work for over a week
<h4y4shi_> I am so happy!
<bnagy> np
yibe has joined #ruby-lang
yibe has joined #ruby-lang
rolfb has joined #ruby-lang
rolfb has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
vmoravec has joined #ruby-lang
vmoravec has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
jasiek has joined #ruby-lang
jasiek has joined #ruby-lang
Indian has joined #ruby-lang
Indian has joined #ruby-lang
vmoravec has joined #ruby-lang
vmoravec has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
spuk has joined #ruby-lang
spuk has joined #ruby-lang
brushbox has joined #ruby-lang
brushbox has joined #ruby-lang
Arnvald has joined #ruby-lang
Arnvald has joined #ruby-lang
vmoravec has joined #ruby-lang
vmoravec has joined #ruby-lang
kek1 has joined #ruby-lang
kek1 has joined #ruby-lang
m3nd3s has joined #ruby-lang
m3nd3s has joined #ruby-lang
publicvoid_ has joined #ruby-lang
publicvoid_ has joined #ruby-lang
rohit has joined #ruby-lang
rohit has joined #ruby-lang
bosie has joined #ruby-lang
bosie has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
gasbakid has joined #ruby-lang
gasbakid has joined #ruby-lang
gianlucadv has joined #ruby-lang
gianlucadv has joined #ruby-lang
Joeysomo has joined #ruby-lang
Joeysomo has joined #ruby-lang
Joeysomo has joined #ruby-lang
Joeysomo has joined #ruby-lang
Azure has joined #ruby-lang
Azure has joined #ruby-lang
x0F__ has joined #ruby-lang
x0F__ has joined #ruby-lang
gianlucadv has joined #ruby-lang
gianlucadv has joined #ruby-lang
thone has joined #ruby-lang
thone has joined #ruby-lang
malev has joined #ruby-lang
malev has joined #ruby-lang
ovnimancer has quit [#ruby-lang]
ovnimancer has quit [#ruby-lang]
m3nd3s_ has joined #ruby-lang
m3nd3s_ has joined #ruby-lang
KU0N has joined #ruby-lang
KU0N has joined #ruby-lang
malev has joined #ruby-lang
malev has joined #ruby-lang
sandbags has joined #ruby-lang
sandbags has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
<h4y4shi_> My array is filled with objects, and each object has a method. The method is called under_point?. It tests if the image is under point by the mouse. I want to write an if statement that tests if any of the objects in the array are under point. I Just dont know how to call a method for every object in an array. This is hard because I keep pushing more objects onto the array.
<andrewvos> array.select($:.under_point?)
<andrewvos> h4y4shi_: That might work ^
<andrewvos> In ruby 1.9
<h4y4shi_> could you explain the array.select part
<andrewvos> h4y4shi_: It selects any item that returns true in the block
<judofyr> andrewvos: huh? are you sure you don't mean select(&:under_point?) ?
<andrewvos> judofyr: Probably :)
<andrewvos> h4y4shi_: Another way to write that is array.select {|d| d.under_point?}
<andrewvos> h4y4shi_: But because under_point? (seems to) doesn't take any parameters, you can use the shortened syntax
vdrab has joined #ruby-lang
vdrab has joined #ruby-lang
<judofyr> h4y4shi_: use #any?: [2, 4, 8].any? { |x| x == 2 } # => true
<judofyr> h4y4shi_: [1, 4, 6].any? { |x| x == 2 } # => false
<h4y4shi_> Thanks I will try this
<h4y4shi_> For both of the solutions it says that under_point? is an undefined method. My array doesnt have any methods itself but the objects inside each have their own method.
<judofyr> h4y4shi_: hm. seems like you have nested arrays then
Indian has quit [#ruby-lang]
Indian has quit [#ruby-lang]
takaokouji has joined #ruby-lang
takaokouji has joined #ruby-lang
<h4y4shi_> Okay thanks I remember something about that. I will look into that thanks
coreydaley has joined #ruby-lang
coreydaley has joined #ruby-lang
shtirlic has joined #ruby-lang
shtirlic has joined #ruby-lang
QaDeS has joined #ruby-lang
QaDeS has joined #ruby-lang
<andrewvos> h4y4shi_: He means you have an array that contains arrays inside it
<andrewvos> h4y4shi_: Or maybe you just have some objects in there that aren't your type
<andrewvos> h4y4shi_: Maybe you put nil in there at some point... What is the actual error?
<h4y4shi_> OK one second
<h4y4shi_> main.rb:34:in `update': undefined method `under_point?' for #<Array:0x45b3d0> (NoMethodError) from main.rb:68:in `<main>'
<rue> [].under_point?
<bnagy> yeah your arrays are nested
<andrewvos> h4y4shi_: Oh yeah, judofyr guessed right
<bnagy> .map(&:flatten)
<bnagy> or whatever
<bnagy> I'm quite drunk
<andrewvos> bnagy: But it's only 1pm!
<h4y4shi_> nice I tried er guotou yesterday have you ever had it?
<bnagy> 2012 heer
<andrewvos> 2011 here
<bnagy> lol I mean Wed Feb 29 20:12:31 ICT 2012
<tobiasvl> A DAY THAT DOESN'T EXIST
<tobiasvl> help
<h4y4shi_> if i push to an array does it create a new array inside the old array or does it add to the currently existing array? I think that might be my problem.
<bnagy> h4y4shi_: I can't parse that as chinese.. is that baijo?
<judofyr> h4y4shi_: a = [1, 2]; a.push([3, 4]); a => [1, 2, [3, 4]]
<judofyr> h4y4shi_: a = [1, 2]; a.concat([3, 4]); a => [1, 2, 3, 4]
<bnagy> judofyr: ha! I never knew that. Thanks :)
<tobiasvl> [1, 2] + [3, 4] => [1, 2, 3, 4]
<bnagy> it's like push *other_ary but working
<tobiasvl> + is cooler than concat ;)
<judofyr> tobiasvl: that creates a new array
<tobiasvl> true
<tobiasvl> +=
<judofyr> yeah
<tobiasvl> (and << is better than push)
<h4y4shi_> bnagy: I dont know what you mean about parsing chinese or baijo. But if you google er guotou then youll find a wiki article on it.
<bnagy> guotou is a kind of baijo,is what I was asking :)
<h4y4shi_> oh, well I have to go to work soon so bye and thanks for the help.
<bnagy> and yeah, looks like
<bnagy> tobiasvl: I thought they were alises?
<bnagy> << and push
<tobiasvl> oh, probably. i just mean "better" in terms of readability :)
mark_locklear has joined #ruby-lang
mark_locklear has joined #ruby-lang
<bnagy> aha
<bnagy> I always use push when I am going to use the array as a stack or buffer, and << when I am using it as a collection / linked list etc
<bnagy> which harks back a bit to the boring discussion earlier
<manveru> [] << :is << :just << :awesome; [].push(:is).push(:not).push(:cool)
<judofyr> manveru: [].push(:is, :pretty, :cool)
lbrent has joined #ruby-lang
lbrent has joined #ruby-lang
<manveru> :)
<judofyr> just sayin
<bnagy> just sayin
cyri_ has joined #ruby-lang
cyri_ has joined #ruby-lang
fayimora has joined #ruby-lang
fayimora has joined #ruby-lang
lbrent has joined #ruby-lang
lbrent has joined #ruby-lang
wyhaines has joined #ruby-lang
wyhaines has joined #ruby-lang
yalue has joined #ruby-lang
yalue has joined #ruby-lang
justinxreese has joined #ruby-lang
justinxreese has joined #ruby-lang
<shevy> the fins really hate the lion race
Spooner has joined #ruby-lang
Spooner has joined #ruby-lang
brickattack has joined #ruby-lang
brickattack has joined #ruby-lang
brickattack has quit [#ruby-lang]
brickattack has quit [#ruby-lang]
tekin has joined #ruby-lang
tekin has joined #ruby-lang
cout has joined #ruby-lang
cout has joined #ruby-lang
carlosgaldino has joined #ruby-lang
carlosgaldino has joined #ruby-lang
carlosgaldino has quit [#ruby-lang]
carlosgaldino has quit [#ruby-lang]
looopy has joined #ruby-lang
looopy has joined #ruby-lang
csherin has joined #ruby-lang
csherin has joined #ruby-lang
willdrew has joined #ruby-lang
willdrew has joined #ruby-lang
robbrit has joined #ruby-lang
robbrit has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
S2kx has joined #ruby-lang
S2kx has joined #ruby-lang
slyphon has joined #ruby-lang
slyphon has joined #ruby-lang
havenn has joined #ruby-lang
havenn has joined #ruby-lang
bglusman has joined #ruby-lang
bglusman has joined #ruby-lang
jxie has joined #ruby-lang
jxie has joined #ruby-lang
mika has joined #ruby-lang
mika has joined #ruby-lang
mika has joined #ruby-lang
mika has joined #ruby-lang
havenn has joined #ruby-lang
havenn has joined #ruby-lang
Sailias|work has joined #ruby-lang
Sailias|work has joined #ruby-lang
dv310p3r has joined #ruby-lang
dv310p3r has joined #ruby-lang
RomyRomy has joined #ruby-lang
RomyRomy has joined #ruby-lang
sush24 has joined #ruby-lang
sush24 has joined #ruby-lang
malev has joined #ruby-lang
malev has joined #ruby-lang
beawesomeinstead has joined #ruby-lang
beawesomeinstead has joined #ruby-lang
<sush24> Hi people!...I have one (prolly trivial?) query... How do I marshal more than one object into a particular file?
JEG2 has joined #ruby-lang
JEG2 has joined #ruby-lang
<ddfreyne> sush24: you can marshal an array of objects (which is one object)
<sush24> ddfreyne: *facepalm*.. it was that simple..
<sush24> thank you!
wallerdev has joined #ruby-lang
wallerdev has joined #ruby-lang
malev has joined #ruby-lang
malev has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has joined #ruby-lang
enebo has joined #ruby-lang
enebo has joined #ruby-lang
tomzx has joined #ruby-lang
tomzx has joined #ruby-lang
Sailias|work has joined #ruby-lang
Sailias|work has joined #ruby-lang
outoftime has joined #ruby-lang
outoftime has joined #ruby-lang
pp01bit has joined #ruby-lang
pp01bit has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has joined #ruby-lang
rippa has joined #ruby-lang
rippa has joined #ruby-lang
havenn has joined #ruby-lang
havenn has joined #ruby-lang
Taranis has joined #ruby-lang
Taranis has joined #ruby-lang
kurko_ has joined #ruby-lang
kurko_ has joined #ruby-lang
willdrew has joined #ruby-lang
willdrew has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
spap has joined #ruby-lang
spap has joined #ruby-lang
spap has quit [#ruby-lang]
spap has quit [#ruby-lang]
spap has joined #ruby-lang
spap has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
Luam has joined #ruby-lang
Luam has joined #ruby-lang
spap has quit [#ruby-lang]
spap has quit [#ruby-lang]
<Luam> Есть тут кто-нибуть русский?
<judofyr> Luam: yes
<Luam> )
<judofyr> Luam: I have no idea what you just said…
<Luam> Помоги пожалуйста с вопросом о русском языке в консоли виндоус 7
<Luam> В Питоне есть например такая штука как u"Привет"
<Luam> :D
<Luam> )) but you said that you russian
mssola has joined #ruby-lang
mssola has joined #ruby-lang
<outoftime> Luam: Нет, но я с удобным Переводчик Google
urbanmonk has joined #ruby-lang
urbanmonk has joined #ruby-lang
<Luam> ))) oh no
<Luam> he will translate not right
<Luam> i just asked about unicode in Windows console
<Luam> i have ruby 1.9.2
mgraham has joined #ruby-lang
mgraham has joined #ruby-lang
<outoftime> Luam: у вас больше шансов найти русского языка, чем пользователь Windows, здесь
<judofyr> I don't use Windows, so I don't really know how to fix that :/
<Luam> and i tryed to write in the test script non ASCII character
<Luam> (
<Luam> this only one think why i cant start to use Ruby normally
<Luam> thing
bosie has joined #ruby-lang
bosie has joined #ruby-lang
bosie has quit [#ruby-lang]
bosie has quit [#ruby-lang]
<outoftime> Luam: : )
<Luam> lol
<Luam> i use in virtual box Debian
<Luam> ))
<Luam> sorry in VMWare
<outoftime> whichever works, although I think virtualbox is free-er
<Luam> but....in python i dont need to use Debian at all....to develop
<Luam> i just write u"привет"
<Luam> and i get unicode string
<Luam> that work ok
<Luam> is there something in ruby
<Luam> ?
<outoftime> Luam: in Ruby 1.9, each source file can specify an encoding via a magic constant: http://blog.grayproductions.net/articles/ruby_19s_three_default_encodings
fayimora has joined #ruby-lang
fayimora has joined #ruby-lang
<outoftime> Luam: but there's no equivalent to u"some unicode"
<outoftime> oops, comment, not constant
<Luam> ( to bad
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<outoftime> Luam: once you have the right encoding specified, you just use a normal string literal
<judofyr> Luam: try starting the file with: # coding: UTF-8
<judofyr> as outoftime said
gasbakid has joined #ruby-lang
gasbakid has joined #ruby-lang
<frem> stupid question: can I rescue exceptions that only have a certain message in them?
<judofyr> frem: no, but you can rescue and re-raise those that don't match
<outoftime> frem: only by rescuing all exceptions of that class and then reading the message
<Luam> judofyr: i use it
<frem> oh, ok. thanks.
<judofyr> frem: rescue Foo => e; if e.message =~ /nice/; …; else; raise e; end
<outoftime> it would be cool for ruby to support that, though, since rescue statements are sort-of pattern-matching already
macmartine has joined #ruby-lang
macmartine has joined #ruby-lang
darkf has joined #ruby-lang
darkf has joined #ruby-lang
<Luam> outoftime: and there is no easier way to get unicode string?
<manveru> Luam: you can use encode! to change the encoding
<Luam> :(
<manveru> but ruby will complain if the syntax contains characters invalid for your source encoding
<Luam> so hard life for nonAscii guys in ruby
leonL has joined #ruby-lang
leonL has joined #ruby-lang
<manveru> no
bradland has joined #ruby-lang
bradland has joined #ruby-lang
<manveru> Luam: show your problem and i shall present you with a solution :)
<Luam> you know how i can take unicode string in python? just write u"Something on russian" and i get it in unicode
<manveru> yeah
<manveru> and how do you get it in utf-32?
<Luam> for what i need utf-32?
<judofyr> frem: actually, it seems that you can do this: rescue proc { |e| e.message =~ /nice/ }
<manveru> Luam: well, or KOI8-R or CP1251
<Luam> manveru: for what :)))?
<Luam> manveru: i use utf-8
<manveru> Luam: dunno, you said life is hard for non-ascii
v0yager has joined #ruby-lang
v0yager has joined #ruby-lang
<manveru> well, then put the comment in your file
<Luam> manveru: but when i need russian string in template from python source...i just write u"something on russian"
<manveru> in ruby you just write "something in russian"
<Luam> manveru: hah
<darix> Luam: you can easily test it
<manveru> >> "something in russian".encoding
<Luam> manveru: i made script...and run in this way : ruby test.rb
<manveru> => #<Encoding:UTF-8>
<darix> Luam: with the comment? and which version of ruby?
<Luam> darix: # encoding: utf-8, ruby 1.9.2
<darix> ok
<manveru> Luam: and what's the error?
<Luam> manveru: ╨Я╤А╨╕╨▓╨╡╤В but its maybe for now just windows cmd error?
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<manveru> ah, you try to print to the windows console?
<Luam> yeah
<Luam> ...in ruby console everything ok
<manveru> windows console is using codepage 1251 if your locale is russian
<darix> the console is cp1250 or so
<Luam> so... :( its just windows
<darix> Luam: correct
<judofyr> can't you do .encode("CP1250")?
<manveru> Encoding.default_external = 'CP1251'
<Luam> ok i`ll try
<manveru> judofyr: that will still reencode back on puts
<manveru> no?
<Luam> but
<judofyr> manveru: ah,I meant: puts …..encode("CP1251")
<Luam> in windows console is IBM866
<Luam> so i did .encode("IBM866")
<Luam> end its work :))))) haha
<Luam> stupid windows console
<judofyr> Luam: nice!
<manveru> IBM866... i thought that's OS/2 and MS-DOS?
<manveru> oh, cmd behaves like DOS, doesn't it
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<Luam> :)) tnx for help
<manveru> judofyr: if you set the default_external, $stdout.default_external will use it if it's nil
wmoxam has joined #ruby-lang
wmoxam has joined #ruby-lang
<judofyr> manveru: but doesn't that also affect outputted files?
<manveru> sure does
<manveru> just like LC_CTYPE
tekin has joined #ruby-lang
tekin has joined #ruby-lang
flak has joined #ruby-lang
flak has joined #ruby-lang
<Spooner> Can anyone recommend a good, ruby-friendly, online collaborative code editor thingie please?
<manveru> uhm
<outoftime> ssh + gnu screen : )
<manveru> tmux + ssh + vim :)
* Spooner rolls his eyes.
<judofyr> car
<manveru> cdr
<judofyr> cons
<manveru> :P
<judofyr> :)
<vereteran> are there any asynchronous (a-la node.js) frameworks for ruby? i need to process images uploaded by users and i would like to avoid blocking caused by actual image processing in sinatra / rails controller. also because i don't want to set up some queues, separate apps or similar SOA solutions
<Guest13404> eventmachine
<manveru> vereteran: jruby
<darix> vereteran: paperclip and others support to put the actual processing to a background queue handler
<vereteran> Guest13404, event machine from what i understand is not a web server solution and i'll have to implement lots of things by myself
<outoftime> vereteran: cramp
<vereteran> darix, as i've told i don't want to add queues
<manveru> Spooner: well, i know some, but they're rather meh and ruby-neutral, but online collaborative :)
<vereteran> outoftime, seen it and goliath, both look really raw. even examples with templates didn't work =\
rippa has joined #ruby-lang
rippa has joined #ruby-lang
<darix> why simple if it can also work more complex and complicated :)
<outoftime> vereteran: never tried it, it just looks cool
<vereteran> only looks
<Spooner> manveru: Yeah, I have just been using Etherpad, but it doesn't know Ruby and Amy, which is a bit meh.
<outoftime> vereteran: there's also an async sinatra add-on. but to be honest, unless the user is blocking on the upload request to get the processed image, I have to agree with others' suggestions that a background queue would be more appropriate.
<frem> Spooner: There's a syntax highlighting plugin in development for Etherpad, apparently. https://github.com/Pita/etherpad-lite/issues/121
<judofyr> vereteran: I'm actually working on some async web stuff in Ruby, but I'm far from done :(
<vereteran> outoftime, problem is it'll add complexity: i should return some token, then provide polling mechanism and content delivery after its done
<outoftime> judofyr: what are you up to? I played around with the idea of a Rack-based approach where the only difference is #call yields a result instead of returning it. got something basic working wrapped by EM.
<vereteran> judofyr, just a curiousity: did you end up with own solution or something existing?
<judofyr> vereteran: nginx has a plugin for handling big uploads
<outoftime> vereteran: with resque-status that's pretty easy.
<judofyr> vereteran: oh, I mean, an async web framework :)
<vereteran> judofyr, upload itself is not a problem, problems start in thumbnail generation, applying effects to images, etc...
<judofyr> outoftime: HTTP/1.1 server+client; WebSocket server+client. no dependencies by default (a simple even-loop written with IO.select), but you can "upgrade" it to use EM or libuv or whatever. that's the plan at least :)
<judofyr> outoftime: fiber-based
<Spooner> frem: good to know, but I wanted something sort of now :)
<outoftime> judofyr: interesting. I'd love to show you what I was working on but it's on my home machine and I didn't push it up to GH yet : \
andrewhl has joined #ruby-lang
andrewhl has joined #ruby-lang
<outoftime> judofyr: no reason the rack-that-yields approach has to use EM, of course.
<judofyr> outoftime: I'm specifically *not* designing my stuff around any spec. I'd rather not be limited by some silly old ideas :)
<outoftime> judofyr: ten four
jeffmoss has joined #ruby-lang
jeffmoss has joined #ruby-lang
divoxx has joined #ruby-lang
divoxx has joined #ruby-lang
<judofyr> outoftime: I've been talking a lot about it lately, so hopefully that will push me into finishing it :)
<outoftime> judofyr: would definitely be interested to see it when you're done
<judofyr> I think there's a wide gap when it comes to async stuff in Ruby
gregf has joined #ruby-lang
gregf has joined #ruby-lang
<outoftime> agreed. it's a really good language for it, actually, at least as good as JS, but the tools haven't caught up to node
<judofyr> outoftime: email address? I can notify you when I publish it!
Jan_ has joined #ruby-lang
Jan_ has joined #ruby-lang
Heimidal has joined #ruby-lang
Heimidal has joined #ruby-lang
<frem> outoftime: or twisted. :(
savage- has joined #ruby-lang
savage- has joined #ruby-lang
looopy has joined #ruby-lang
looopy has joined #ruby-lang
oilpastels has joined #ruby-lang
oilpastels has joined #ruby-lang
cjs226 has joined #ruby-lang
cjs226 has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
jasonw22 has joined #ruby-lang
jasonw22 has joined #ruby-lang
jasonw22 has joined #ruby-lang
jasonw22 has joined #ruby-lang
srbaker has joined #ruby-lang
srbaker has joined #ruby-lang
dejongge has joined #ruby-lang
dejongge has joined #ruby-lang
sirfilip has joined #ruby-lang
sirfilip has joined #ruby-lang
bcardarella has joined #ruby-lang
bcardarella has joined #ruby-lang
havenn has joined #ruby-lang
havenn has joined #ruby-lang
mytrile has joined #ruby-lang
mytrile has joined #ruby-lang
<bcardarella> With a gsub and passing a block it seems that I no longer have access to any of the groups I'm matching via \1, \2, etc... is there a way to access those groups in the context of a block in gsub or do I have to run another regex on the match itself?
rippa has joined #ruby-lang
rippa has joined #ruby-lang
m3nd3s has joined #ruby-lang
m3nd3s has joined #ruby-lang
jasonw22 has joined #ruby-lang
jasonw22 has joined #ruby-lang
<canton7> bcardarella, I found you can use $1, but it feels a little dirty
malev_ has joined #ruby-lang
malev_ has joined #ruby-lang
Heimidal has joined #ruby-lang
Heimidal has joined #ruby-lang
looopy has joined #ruby-lang
looopy has joined #ruby-lang
Heimidal has joined #ruby-lang
Heimidal has joined #ruby-lang
Heimidal has joined #ruby-lang
Heimidal has joined #ruby-lang
snafoo has joined #ruby-lang
snafoo has joined #ruby-lang
bglusman has joined #ruby-lang
bglusman has joined #ruby-lang
savage- has joined #ruby-lang
savage- has joined #ruby-lang
erics has joined #ruby-lang
erics has joined #ruby-lang
malev has joined #ruby-lang
malev has joined #ruby-lang
rippa has joined #ruby-lang
rippa has joined #ruby-lang
virunga has joined #ruby-lang
virunga has joined #ruby-lang
l0st1 has joined #ruby-lang
l0st1 has joined #ruby-lang
rayners has joined #ruby-lang
rayners has joined #ruby-lang
looopy has joined #ruby-lang
looopy has joined #ruby-lang
tekin has joined #ruby-lang
tekin has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
zerokarmaleft has joined #ruby-lang
GiambalaGiambala has joined #ruby-lang
GiambalaGiambala has joined #ruby-lang
gianlucadv has joined #ruby-lang
gianlucadv has joined #ruby-lang
ilyam has joined #ruby-lang
ilyam has joined #ruby-lang
butchanton has joined #ruby-lang
butchanton has joined #ruby-lang
gasbakid__ has joined #ruby-lang
gasbakid__ has joined #ruby-lang
pemeon has joined #ruby-lang
pemeon has joined #ruby-lang
tekin has joined #ruby-lang
tekin has joined #ruby-lang
QaDeS has joined #ruby-lang
QaDeS has joined #ruby-lang
tbuehlmann has joined #ruby-lang
tbuehlmann has joined #ruby-lang
* imperator releases net-ping 1.5.3 into the wild
m3nd3s_ has joined #ruby-lang
m3nd3s_ has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
m3nd3s has joined #ruby-lang
m3nd3s has joined #ruby-lang
flak has joined #ruby-lang
flak has joined #ruby-lang
achiu has joined #ruby-lang
achiu has joined #ruby-lang
twittard_ has joined #ruby-lang
twittard_ has joined #ruby-lang
H2H has joined #ruby-lang
H2H has joined #ruby-lang
virunga has joined #ruby-lang
virunga has joined #ruby-lang
Sailias|work has joined #ruby-lang
Sailias|work has joined #ruby-lang
bagratte has joined #ruby-lang
bagratte has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
gasbakid has joined #ruby-lang
gasbakid has joined #ruby-lang
macmartine has joined #ruby-lang
macmartine has joined #ruby-lang
rippa has joined #ruby-lang
rippa has joined #ruby-lang
andkerosine has joined #ruby-lang
andkerosine has joined #ruby-lang
rollandWebmag has joined #ruby-lang
rollandWebmag has joined #ruby-lang
rollandWebmag has quit [#ruby-lang]
rollandWebmag has quit [#ruby-lang]
brianpWins has joined #ruby-lang
brianpWins has joined #ruby-lang
westernanalog has joined #ruby-lang
westernanalog has joined #ruby-lang
* imperator releases win32-taskscheduler 0.2.2 into the wild
GiambalaGiambala has joined #ruby-lang
GiambalaGiambala has joined #ruby-lang
ascarter has joined #ruby-lang
ascarter has joined #ruby-lang
ylluminate has joined #ruby-lang
ylluminate has joined #ruby-lang
ryanf has joined #ruby-lang
ryanf has joined #ruby-lang
rollandWebmag has joined #ruby-lang
rollandWebmag has joined #ruby-lang
rollandWebmag has quit [#ruby-lang]
rollandWebmag has quit [#ruby-lang]
achiu has joined #ruby-lang
achiu has joined #ruby-lang
erpuds has joined #ruby-lang
erpuds has joined #ruby-lang
looopy has joined #ruby-lang
looopy has joined #ruby-lang
solars has joined #ruby-lang
solars has joined #ruby-lang
lsegal has joined #ruby-lang
lsegal has joined #ruby-lang
<erikh> guys, I'm hanging out in other programming channels more regularly now... I'm just saying because it needs to be said
<erikh> I love you guys
<deryl> no you don't or you'd stay just with us. boo hoo!
<deryl> :)
<erikh> I'm a polyglot, what can I say
<deryl> hehe
<erikh> I mean, by comparison this channel is pretty lax on rules, doesn't have an overwhelming amount of moist robots with anal retention issues, and generally just serves the purpose of answering the fucking question and being a not-hateful place to hang out
apeiros_ has joined #ruby-lang
apeiros_ has joined #ruby-lang
csherin has joined #ruby-lang
csherin has joined #ruby-lang
bcardarella has quit [#ruby-lang]
bcardarella has quit [#ruby-lang]
<manveru> erikh: looks like we're not using the same languages then :)
ilyam has joined #ruby-lang
ilyam has joined #ruby-lang
<erikh> perhaps not. what are you learning these days?
<erikh> I'm always excited to see what others are learning.
<manveru> i'm just practicing go again
<erikh> ah, I haven't even begun to crack that one open. Learning python and improving my C here.
<manveru> i've got this really annoying itch i want to scratch for two years now :)
<bougyman> i've been mires in C and Perl
<bougyman> not on purpose, mind you.
<erikh> I can help you with the latter if you need someone to bug
gregf has joined #ruby-lang
gregf has joined #ruby-lang
<bougyman> manveru: go have good webgl interface?
josh9 has joined #ruby-lang
josh9 has joined #ruby-lang
<bougyman> erikh: nah, it's not lack of knowledge in perl, just hate.
<manveru> bougyman: webgl is js
<erikh> ah
<bougyman> and C is well... every app is different.
<erikh> right
<bougyman> manveru: just js?
<manveru> well, or NaCl
<manveru> which also works with go, but that's normal gl, not webgl
<bougyman> i thought go might have some of the urweb type stuff that does js as well.
<bougyman> i've never delved into it except a few tutorials.
<manveru> nah, go is just a mix of erlang and c
<bougyman> erikh: if you want a nice mindfuck check our urweb.
<manveru> bougyman: there are a couple of other candidates now
<bougyman> they push an SML interpreter in javascript to the browser so the server and client code is the same
eggman2001 has joined #ruby-lang
eggman2001 has joined #ruby-lang
<erikh> wow
h4y4shi has joined #ruby-lang
h4y4shi has joined #ruby-lang
qpingu has joined #ruby-lang
qpingu has joined #ruby-lang
<manveru> http://www.haxenme.org/ looks pretty decent these days
<erikh> looking at that, is that what you're referring to? definitely has a haskell/ml feel to it
<manveru> erikh: yeah
<manveru> ur is based on ocaml
<erikh> oh ok
<erikh> I should probably get back to that someday
<bougyman> erikh: yes, they made xml a first-class type
<bougyman> makes for very safe code.
eggman2001 has quit [#ruby-lang]
eggman2001 has quit [#ruby-lang]
uniqanomaly has joined #ruby-lang
uniqanomaly has joined #ruby-lang
<manveru> that was the other one i thought of
<erikh> oh
<erikh> wow
<erikh> I wasn't sure what you meant by that, but I see now
<erikh> C# kind of has something like this but it maps everything back to class definitions
<bougyman> aww, they removed the demos
<bougyman> they used to have some neat demos on that site.
<bougyman> OH, nm, i'm blind: http://impredicative.com/ur/demo/
<bougyman> that's what got me excited about it.
<bougyman> i still like the idea, i don't like the idiom of ML programs to be so callback-heavy.
<manveru> bougyman: you ever looked at opa?
mytrile has joined #ruby-lang
mytrile has joined #ruby-lang
<bougyman> yeah, you showed it to me
<bougyman> i didn't do anything with it, though.
ttilley has joined #ruby-lang
ttilley has joined #ruby-lang
<manveru> "A large class of programming errors that goes unnoticed in Node.js and requires heavy testing and debugging is automatically detected in Opa and reported with helpful (most of the time) error messages."
<manveru> bad thing about opa is that it's got its own database
<manveru> and only mongodb as alternative
<manveru> though it has easy ocaml bindings, so you could use a pg list from there
_whitelogger1 has joined #ruby-lang
<manveru> s/list/lib/
<bougyman> i've been meaning to get back to hunchentoot.
<Tasser> manveru, opa?
westernanalog has joined #ruby-lang
eggman2001 has joined #ruby-lang
<manveru> Tasser: opapa
<Tasser> huh?
<rippa> oraoraora
<manveru> Tasser: what's the question?
<eggman2001> hello, what method can I use if I want to put the first several (say 4) items of an array into a new array?
<Tasser> manveru, what's opa?
<manveru> Tasser: http://opalang.org/
<bougyman> eggman2001: new_array = old_array[0 .. 3]
<rippa> new_array = old_array.take(4)
<bougyman> or that.
<Tasser> aww, ;
<eggman2001> ah, thanks!
whatasunnyday has joined #ruby-lang
<manveru> i thought that was old.shift(4)
<andkerosine> #shift modifies the original.
<andkerosine> Not sure if that's what eggman wanted or not.
<manveru> ah, take doesn't?
<manveru> guess i'm too used to old[0...4]
<manveru> guess take works better with enums
<eggman2001> new_array = old_array[0 .. 3] is perfect for me, and also easy to remember :-)
<andkerosine> But #take is more semantic.
<Tasser> manveru, oh, fancy stuff
<eggman2001> andkerosine: not sure what you mean
<manveru> andkerosine: you mean you can misinterpret what it means easier?
<andkerosine> Haha.
<andkerosine> More sensible when interpreted correctly.
<andkerosine> You want to /take/ four elements, so #take them. : )
havenn has joined #ruby-lang
<manveru> from which side?
<manveru> destructive?
<whatasunnyday> I've got a quick nokogiri question if anyone has a second, I'm searching a doc say doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove';)), doc.search("//a[@href]").each do |a| puts a #Gives me full anchor tag with href and anchor text, a['href'] #gives href url, how do I just get the text?
<manveru> whatasunnyday: a.text
shtirlic has joined #ruby-lang
justinmcp has joined #ruby-lang
<imperator> erikh, haven't found a channel yet better than this one :)
gix has joined #ruby-lang
jamw has joined #ruby-lang
Carnage\ has joined #ruby-lang
Skif has joined #ruby-lang
twittard has joined #ruby-lang
Sailias|work has joined #ruby-lang
brownies has joined #ruby-lang
cyri_ has joined #ruby-lang
curtism has joined #ruby-lang
jfelchner has joined #ruby-lang
urbanmonk has joined #ruby-lang
adambeynon has joined #ruby-lang
shtirlic has joined #ruby-lang
pandora17 has joined #ruby-lang
macmartine has joined #ruby-lang
daglees has joined #ruby-lang
daglees has joined #ruby-lang
havenn has joined #ruby-lang
daglees has joined #ruby-lang
<kith> hmmm i copy pasted the cinch samples for plugins but it doesnt reply :S
<kith> whats up with that?
mrsolo has joined #ruby-lang
daglees has joined #ruby-lang
<andrewvos> kith: Send the codes?
<whatasunnyday> thanks manveru!
daglees has joined #ruby-lang
daglees has joined #ruby-lang
<whatasunnyday> manveru, did you test it in rb?
<whatasunnyday> i got 0 as return
<manveru> whatasunnyday: >> open('http://www.google.com/search?q=tenderlove';){|io| Nokogiri::HTML(io).search('//a[@href]').map(&:text) }
<whatasunnyday> manveru, you a a wonderful soul, thank you.
<erikh> kith: #cinch exists, dominikh usually pays a lot more attention in there
francisfish has joined #ruby-lang
<whatasunnyday> manveru, my problem is that i did not output if you were wondering, prefacing it with puts solved my issue
francisfish has joined #ruby-lang
<andrewvos> kith: Try: match /hello/
erics has joined #ruby-lang
<hagabaka> I'm trying to convert from UTF-16 to UTF-8 in ruby 1.9, what am I doing wrong? http://pastie.org/3491011
<whitequark> hagabaka: byte order? UTF-16LE/UTF-16BE
<whitequark> try both
eggman2001 has quit [#ruby-lang]
<hagabaka> ah, thanks
adambeynon has joined #ruby-lang
ilyam has joined #ruby-lang
havenn has joined #ruby-lang
davidw has joined #ruby-lang
petercooper has joined #ruby-lang
pogopolice has joined #ruby-lang
a1ph4g33k has joined #ruby-lang
Skif has joined #ruby-lang
daglees has joined #ruby-lang
ilyam_ has joined #ruby-lang
workmad3 has joined #ruby-lang
malev_ has joined #ruby-lang
benanne has joined #ruby-lang
mssola has joined #ruby-lang
Heimidal_ has joined #ruby-lang
flebel has joined #ruby-lang
DRCALKIN has joined #ruby-lang
Swimming_Bird has joined #ruby-lang
tekin has joined #ruby-lang
erics has joined #ruby-lang
<kith> andrewvos: doesnt work either
<kith> ruby 1.9 with cinch 1.1.3
ltd- has joined #ruby-lang
srbartlett has joined #ruby-lang
<andrewvos> kith: Are you typing "!hello" ?
mytrile has joined #ruby-lang
<andrewvos> kith: That will activate the command
Defusal_ has joined #ruby-lang
Defusal_ has joined #ruby-lang
nazty has joined #ruby-lang
brownies has joined #ruby-lang
ged has joined #ruby-lang
flebel has joined #ruby-lang
gasbakid has joined #ruby-lang
benanne has joined #ruby-lang
Heimidal has joined #ruby-lang
josh9 has joined #ruby-lang
pemeon has joined #ruby-lang
pemeon has quit [#ruby-lang]
wyhaines has joined #ruby-lang
erpuds has joined #ruby-lang
<kith> andrewvos: oh... i was typing "hello"
<kith> why is the ! required?
<andrewvos> kith: Just kind of common for bots
<kith> or better how should i have known?
<kith> yeah true
<kith> but it just says match "hello" :D
<kith> not "!hello"
<andrewvos> kith: Should probably be in the docs somewhere highly visible cc: dominikh
<andrewvos> kith: Or better yet, do a pull request
<kith> whats a pull request?
<kith> to remove that "feature"?
<andrewvos> kith: Fix the readme, in code then submit a patch on github
<andrewvos> s/\,//
<workmad3> kith: if you didn't use the !, then the bot would respond to the command every time someone came into the channel and said 'hello'
<kith> workmad3: yeah
<kith> thats my intention
<workmad3> kith: is the bot noisy when you say hello?
<kith> i thought its more "progammer" friendly when the "!" is actually required in code
<workmad3> kith: because I'm not sure how appreciative people will be if they get blasted with output from a bot everytime they join a channel and say hello :)
<kith> workmad3: i'm just toying around
<kith> workmad3: our current bot doesnt use "trigger symbols"
<kith> ppl get along with that okayish
<workmad3> kith: fair enough
<tla> kith: put a prefix = "" in your plugin
<tla> prefix "" even
<andrewvos> I think both will work
H2H has joined #ruby-lang
<kith> tla: yay! thx!
<tla> kith: np
thrcka has joined #ruby-lang
<kith> can a plugin have more than one "match" line?
<erikh> sec
<kith> like match "hello" and match "hi"
<erikh> I don't believe so
<erikh> yeah my code has it all broken out into different classes
<erikh> you can match on regular expressions though
<kith> erikh: apparently it works
<kith> put two match lines into the class and it executes the method :)
<erikh> ah neat
<erikh> it executes both of htem?
<kith> theres only one method
<kith> it gets execute on both matches
gasbakid has joined #ruby-lang
<kith> once
<erikh> right
<erikh> it was the match portion I was concerned about.
<erikh> neat though; i'll have to keep that in mind
<kith> yeah saves me from writing redundant classes
<kith> somehow writing your own bot with cinch seems so simple its not even funny :D
<erikh> yeah it's pretty awesome
<erikh> dominikh has really done a stellar job
<erikh> you should see what's coming in 2.0
<kith> AI :D
<erikh> ha
davidw has joined #ruby-lang
<kyrylo> Let's praise dominikh!
<erikh> yes!
WillMarshall has joined #ruby-lang
headius has joined #ruby-lang
<zenspider> you fuckers missed out ... should have come to our party
<andrewvos> The praise dominikh party?
<ged> I wanted to.
<zenspider> ged: you should have!
lsegal has joined #ruby-lang
<imperator> was there....beer?
<zenspider> I still have wine and rum for days... the kegs will hopefully be finished off at tonight's beer && code
<ged> Next coding vacation I take I'm going to crash at least one seattle.rb soiree.
<ged> There's really no fucking excuse given how close I am.
<zenspider> nope
andrewhl has joined #ruby-lang
chendo_ has joined #ruby-lang
seanstickle has joined #ruby-lang
* imperator would have had a bit of a drive ;)
<ged> Heh, yes you would.
<ged> And this time of year it sucks.
workmad3 has joined #ruby-lang
<ged> But it's pretty nice in the summer.
<erikh> I'll try to make it to rubbyconf this year. that's about all the leaving the house this man can take
<ged> Rubby on Rails?
<erikh> yessirreee
ascarter_ has joined #ruby-lang
<zenspider> anyone have experience doing blog comment import into disqus?
slimfit has joined #ruby-lang
delinquentme_ has joined #ruby-lang
<delinquentme_> umm quick question on inheritance and Proc and lambda ....
<delinquentme_> a "lambda" is a proc ... right?
<delinquentme_> not vice versa
<andrewvos> zenspider: :( Feel bad for you man
<zenspider> is it that bad?
<erikh> I had a co-worker do it, it wasn't terrible
<zenspider> I can change systems... I don't have anything in disqus yet
<andrewvos> zenspider: Probably just because I was moving a wordpress blog over. Didn't enjoy it though and gave up
<zenspider> I'm moving over from MT... so just as bad.
<erikh> it was fiddly but dunno. you can retry pretty trivially.
<zenspider> esp given that I fixed all the url munging that MT did
<zenspider> erikh: can you purge and retry tho?
<erikh> delinquentme_: yes, a lambda is a proc with better argument checking
<erikh> yes
<zenspider> that'd be easiest
<zenspider> kk
<erikh> and I don't know much more than that, so I would love to help but imagine I would just add noise
<erikh> zenspider: moving to octopress?
<erikh> I just started one myself: erik.hollensbe.org
<zenspider> erikh: no... octopress, while pretty, was retarded because of jekyll. I couldn't handle it
<zenspider> I'm talking to imathis about moving octopress off of jekyll
<erikh> ah, interesting
<erikh> this is my first round with jekyll, always used nanoc before
<erikh> anyhow, best of luck!
<zenspider> find .site -type f | wc -l #=> 829
<zenspider> touch blog/2010-01-20-rubygems-sings.html.md ; time rake sync # => 4 sec
<ged> Ouch.
a1ph4g33k has quit [#ruby-lang]
<zenspider> jekyll would take 2-3 minutes
jmontross has joined #ruby-lang
<jmontross> How may I acces the filename using tempfile when posting in a file like so? curl -F attachments[0][uploaded_data]=@/sinatra_test.rb
<jmontross> using rack app like rails
<jmontross> or sinatra
Azure has joined #ruby-lang
<erikh> I'm a little stumped; is that curl syntax or ruby syntax or ?
<jmontross> it is curl syntax
<zenspider> jmontross: ri Tempfile
<jmontross> uploading a ruby file
<jmontross> I used Tempfile class… playing around with it and don't see method for getting file's actual name
<workmad3> jmontross: pretty sure it's just .path
<jmontross> i did .path and it gave me "/var/folders/f7/tnlfchd57n93qv9nnd3_21x80000gp/T/#<File:0x1105f1138>7331-0"
<jmontross> that's what i thought it would be.
<jmontross> i need the name from when it comes in.
<zenspider> jmontross: did you run ri Pathname?
<zenspider> err
<zenspider> Tempfile
<erikh> I think he means what rack thinks the filename should be
<erikh> e.g., from HTTP.
<erikh> (I don't know the answer, though)
<zenspider> ah. I couldn't tell that from the question... but you're prolly right
<ged> It looks like something is creating a tempfile by passing it an open File object.
hagebake_ has joined #ruby-lang
<ged> Judging by the "#<File:0x1105f1138>" part of the path, which is usually where the string name goes.
<erikh> yeah.
<erikh> oh, I see what you're saying
<ged> E.g.,
<ged> [3] pry(main)> tf = Tempfile.new( 'glarn' )
<ged> => #<File:/var/folders/fb/sjd5ksx94lb4g5s_mt64fvcc000205/T/glarn20120229-55725-1lybgx4>
tenderlove has joined #ruby-lang
* zenspider still needs to check out pry
<ged> It and 'htty' are making my life better.
hagabaka has joined #ruby-lang
<zenspider> what's htty?
<zenspider> ooooh
<andrewvos> HyperText Transfer Yodel
<andrewvos> I'll show myself the door
kyrylo has joined #ruby-lang
snafoo has joined #ruby-lang
<ged> Like an irb/pry for HTTP.
<zenspider> we should pair sometime. i wanna see your toys/patterns
<ged> Likewise.
<andrewvos> Umm, whoever mentioned htty: I love you
<andrewvos> This is going to make like so much easier at work tomorrow :|
<ged> Hehe.
<andrewvos> Seriously, I've just been using curl
<andrewvos> Debugging varnish configs and shit for days
<ged> It does save a bit of time to just be able to type 'get' over and over.
looopy has joined #ruby-lang
<zenspider> omfg I'm tired... just WIPED out from last night
shevy has joined #ruby-lang
nanothief has joined #ruby-lang