<erikh>
still keeps the role and node count local to the case instrumentation without completely clobbering the super/teardown
<erikh>
thanks for the comments.
havenn has joined #ruby-lang
qwerxy has quit [Client Quit]
datanoise has quit [Ping timeout: 256 seconds]
CaptainJet has quit []
justinram has quit [Read error: Connection reset by peer]
outoftime has quit [Quit: Leaving]
justinram has joined #ruby-lang
enebo has joined #ruby-lang
robbyoconnor has joined #ruby-lang
tenderlo_ has joined #ruby-lang
stardiviner has joined #ruby-lang
Kingy has quit [Quit: Leaving]
justinram has quit [Remote host closed the connection]
tenderlove has quit [Ping timeout: 245 seconds]
intellitech is now known as intellitech|afk
mwjcomputing has joined #ruby-lang
<Harzilein>
hi
<Harzilein>
is there something more current/maintained then cookiejar for parsing cookie-headers?
<Harzilein>
than*
<Harzilein>
cookiejar seems to have trouble with multiple cookies in a header
<drbrain>
Harzilein: mechanize?
<Harzilein>
drbrain: i'd like to do everything else by foot
<Harzilein>
i.e. i just want to _parse_ set-cookie headers, not maintain a user agent object with them
gregmoreno has quit [Ping timeout: 245 seconds]
<zenspider>
by foot?
<manveru>
he likes doing things the... roundabout way :)
<zenspider>
oh look... that sorta looks like a wheel... sorta...
Madis has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
toretore has quit [Quit: Leaving]
Kainore has quit []
<Harzilein>
:D
<Harzilein>
the mechanize cookiejar/cookieobject doesn't seem to provide a parse function for set-cookie headers
slyphon has quit [Ping timeout: 245 seconds]
swarley_ has joined #ruby-lang
<Harzilein>
Mechanize::HTTP contains classes for communicated with HTTP servers. All API under this namespace is considered private and is subject to change at any time.
<Harzilein>
that's not the kind of api i want in this case
<zenspider>
_I_ see a parse function...
<drbrain>
me too, and it's not in Mechanize::HTTP
<drbrain>
Mechanize::Cookie.parse
<Harzilein>
drbrain: that parses _one_ cookie as far as i can tell
<drbrain>
Harzilein: I'm not sure what use Mechanize::Cookie.parse would be if it didn't parse multiple cookies in one go
<Harzilein>
yeah, nvm, it does. i don't quite like its approach (splitting on both , and ; and then aggregating them again, but i guess that's the easiest way to make it robust
<Harzilein>
s/again,/again)/
<zenspider>
# Parses a Set-Cookie header line +str+ sent from +uri+ into an # array of Cookie objects
<drbrain>
Harzilein: it has to deal with what browsers do, of course it's going to be ugly
swarley_ has left #ruby-lang [#ruby-lang]
<Harzilein>
is there any advantage in this case to using %r instead of /.../?
<drbrain>
it's an rdoc bug
postmodern has joined #ruby-lang
emptyflask has quit [Ping timeout: 245 seconds]
<erikh>
ah, http
<erikh>
your like smtp, but everyone still loves you
gsav has joined #ruby-lang
<erikh>
s/your/you're/
m3nd3s has quit [Ping timeout: 245 seconds]
iamlacroix has joined #ruby-lang
gsav_ has joined #ruby-lang
iamlacroix has quit [Remote host closed the connection]
<manveru>
wish i could love it...
GorbiE has quit []
bfreeman has quit [Quit: bfreeman]
<erikh>
manveru: you know it well enough to have the sense not to
<erikh>
side note, it's absolutely hilarious to get raggi going on http
<manveru>
yeah, it'd just stab me in the back while i'm not watching
<erikh>
well-formed data? schmell-formed data!
<manveru>
if i had the choice between fixing http and total ipv6 coverage... i'd choose fixing http, i think :)
<manveru>
or maybe just fix people to stop thinking about http as the magic layer that binds everything
<erikh>
what do you mean? you mean there are other protocols layer 7 can use?
<manveru>
:P
thone_ has joined #ruby-lang
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
thone has quit [Ping timeout: 260 seconds]
havenn has quit [Remote host closed the connection]
<ttilley>
...is there a way to force ruby to shotgun destroy and GC all objects at exit? or at least make valgrind not complain about leaked memory that's only "leaked" because manual cleanup before exit isn't necessary?
<ttilley>
hm
<Harzilein>
drbrain: -.-
mrsolo has quit [Quit: Leaving]
<Harzilein>
oh well, guess i can use mechanize's cookie object then
<Harzilein>
or cookiejar object
<Harzilein>
thanks for pointing it out. maybe i should extract it and send a patch for the cookiejar gem
datanoise has quit [Ping timeout: 276 seconds]
slyphon has joined #ruby-lang
<zenspider>
ttilley: look at ruby-talk@ in the last week or so. matz posted a file that cleans up valgrind for ruby
<zenspider>
and the answer is: no. you can't. because ruby GC is conservative (and dumb)
<ttilley>
fair enough
pkrnj has joined #ruby-lang
datanoise has joined #ruby-lang
dorei has quit []
slyphon has quit [Ping timeout: 245 seconds]
stardiviner has joined #ruby-lang
jxie has quit [Quit: leaving]
datanoise has quit [Ping timeout: 245 seconds]
<zenspider>
hoe 3.3.0 released
Paradox has quit [Ping timeout: 252 seconds]
blazes816 has quit [Quit: blazes816]
CaptainJet has joined #ruby-lang
Paradox has joined #ruby-lang
tenderlo_ is now known as tenderlove
shtirlic has quit []
shtirlic has joined #ruby-lang
roadt has joined #ruby-lang
methods1 has joined #ruby-lang
methods has quit [Read error: Connection reset by peer]
gregmoreno has joined #ruby-lang
gmci has joined #ruby-lang
<dankest>
What's the difference between this channel and #ruby?
gmci is now known as Guest46770
spuk has joined #ruby-lang
Guest46770 has quit [Client Quit]
tenderlove has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
<drbrain>
dankest: this is the official channel
mpatel has left #ruby-lang [#ruby-lang]
<dankest>
drbrain: thanks. What is the content difference between this channel and #ruby?
<drbrain>
I don't visit #ruby, so I'm not sure
<drbrain>
there are many that are in both channels
<dankest>
drbrain: for sure. #ruby has like 5x more people in it, so I wasn't sure if there was a reason to idle here
<drbrain>
I tried starting the process of getting the channels merged, but it's difficult to get the proper file in the proper place on ruby-lang.org
<erikh>
well this channel has more characters in the name
sn0wb1rd has quit [Quit: sn0wb1rd]
lsegal has joined #ruby-lang
gregmore_ has joined #ruby-lang
methods has joined #ruby-lang
methods1 has quit [Read error: Operation timed out]
gregmoreno has quit [Ping timeout: 248 seconds]
slyphon has joined #ruby-lang
methods1 has joined #ruby-lang
methods1 has quit [Client Quit]
methods has quit [Read error: Connection reset by peer]
sepp2k1 has quit [Remote host closed the connection]
Xzyx987X has quit [Read error: Connection reset by peer]
Xzyx987X has joined #ruby-lang
rekky has quit [Quit: rekky]
Nisstyre has quit [Ping timeout: 252 seconds]
davidbalber|away is now known as davidbalbert
emptyflask has quit [Remote host closed the connection]
savage- has joined #ruby-lang
Nisstyre has joined #ruby-lang
WillMarshall has joined #ruby-lang
areil has joined #ruby-lang
emptyflask has joined #ruby-lang
davidbalbert is now known as davidbalber|away
<TTilus>
erikh: i guess that makes this channel more official :)
rekky has joined #ruby-lang
rekky has quit [Client Quit]
rekky has joined #ruby-lang
thinkdev_ has joined #ruby-lang
datanoise has joined #ruby-lang
thinkdevcode has quit [Read error: No route to host]
senekis has quit [Remote host closed the connection]
gsav_ has quit [Read error: Connection reset by peer]
gsav has quit [Read error: Connection reset by peer]
datanoise has quit [Ping timeout: 240 seconds]
thinkdev_ has quit [Remote host closed the connection]
thinkdevcode has joined #ruby-lang
emptyflask has quit [Remote host closed the connection]
lcdhoffman has quit [Quit: lcdhoffman]
TylerGillies has joined #ruby-lang
<TylerGillies>
is there a way to get [1,2,3,4] as an io object so i can do something like arr.read(5) and get something like [1,2,3,4,0] ?
<TylerGillies>
#shift and #first just give me the rest of the array
<TylerGillies>
i can guess i can check size of sub array and pad with leading zeros
<TylerGillies>
trailing rather
yxhuvud has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
RantriX has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
<postmodern>
TylerGillies, checkout StringIO
<erikh>
TTilus: if nothing else, it wins at strcmp
Hakon has quit [Read error: Connection reset by peer]
Hakon has joined #ruby-lang
sush24 has joined #ruby-lang
robbyoconnor has joined #ruby-lang
cschwartz has joined #ruby-lang
slyphon has quit [Ping timeout: 245 seconds]
|Vargas| has joined #ruby-lang
|Vargas| has quit [Changing host]
|Vargas| has joined #ruby-lang
NemesisD has joined #ruby-lang
<NemesisD>
anyone ever use ruby to process large XML files? i've found that i get crazy memory leaks when using nokogiri and jruby
<NemesisD>
i'd be willing to try something else if it worked with jruby. i've found SAX to be far too difficult to work with
<postmodern>
NemesisD, SAX is your best beat
<postmodern>
NemesisD, there was a recent XML benchmark article too
<postmodern>
NemesisD, some people recommend OX
<postmodern>
NemesisD, but it doesn't use libxml2, so beware
<NemesisD>
postmodern: i've been using Nokogiri::XML::Reader
<postmodern>
NemesisD, ah nice
<NemesisD>
my problem with sax is that you have to maintain a stack of elements and internally build up the nodes. i've got a huge file full of <release> tags. i just want to yield a node per one of those tags
<NemesisD>
it works ok in ruby 1.9.3 but i would like some parallelism, and in jruby it just sits around, exhausts the stacks then bails
<NemesisD>
sax is so much work to get anything remotely approaching useful
svyatov has joined #ruby-lang
stonerfish has quit [Quit: Leaving.]
rippa has joined #ruby-lang
savage- has quit [Quit: savage-]
ryanf has joined #ruby-lang
<crankharder>
I've got what looks like an empty space but isn't, gsub/strip won't get rid of it... how do i identifiy it?
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 276 seconds]
areil_ has joined #ruby-lang
areil has quit [Ping timeout: 268 seconds]
pcboy_ has quit [Read error: Connection reset by peer]
pcboy_ has joined #ruby-lang
<mfn>
ruby 2 should really make "-v" default ... it's incredible how many gems spit out warnings, making it impossible to sanely use it with your own code
<erikh>
1.9 already has $VERBOSE set
<erikh>
it's just not set as high as -v sets it, IIRC.
mwjcomputing has joined #ruby-lang
<mfn>
hmm .. in my ruby 1.9.3p194 $VERBOSE = false by default and gets set to true when I use -v
<erikh>
right, in typical ruby parlance that's confusing
<erikh>
so, setting it to nil disables warnings entirely
<erikh>
setting it to false enables "some" warnings
<erikh>
constant overwrites are one you'll see
<mfn>
lol, ok. Thanks for the education. hrm :)
<erikh>
sec
<erikh>
here's some gory ugliness I had to write recently to step around a library I was using that used the stdio constants, which I needed to redirect
stiang has quit [Remote host closed the connection]
stiang has joined #ruby-lang
<mfn>
So your github project is called rlint and the game is ruby-lint but there is a rlint gem which is *not* your project O_o ... :)
<mfn>
s/game/gem/
<yorickpeterse>
Yes, it's kinda annoying
<yorickpeterse>
I have however already renamed all the directories and such to "ruby-lint"
sailias has joined #ruby-lang
<yorickpeterse>
I'll probably rename the GH project at some point as well
<yorickpeterse>
Though since you can't set up redirects I'd like to wait a bit until the storm of people going "Hm, what's this shit" settles down a bit
<apeiros_>
yorickpeterse: I'd keep the old one anyway
<mfn>
yeah, I thought so too about the redirec
<apeiros_>
simply pointing to the new one
<yorickpeterse>
apeiros_: That's still a bit confusing
<yorickpeterse>
But yeah, I'll most likely do that anyway
<apeiros_>
sure, but it's less confusing than "wtf, where did it go?"
<yorickpeterse>
true
aflynn has quit [Quit: Ex-Chat]
areil_ has quit [Remote host closed the connection]
mrsolo has quit [Quit: This computer has gone to sleep]
kalleth has quit [Quit: kalleth]
rafael has joined #ruby-lang
mrsolo has joined #ruby-lang
rebelcan has joined #ruby-lang
rafael is now known as Guest70418
d3vic3 has quit [Ping timeout: 268 seconds]
robotmay has quit [Read error: Connection reset by peer]
Uranio has quit [Remote host closed the connection]
robotmay has joined #ruby-lang
d3vic3 has joined #ruby-lang
bfreeman has joined #ruby-lang
cultureulterior has quit [Quit: cultureulterior]
robbyoconnor has quit [Ping timeout: 256 seconds]
sn0wb1rd has joined #ruby-lang
rafrcruz has joined #ruby-lang
Guest70418 has quit [Ping timeout: 245 seconds]
alexkira has joined #ruby-lang
cultureulterior has joined #ruby-lang
robbyoconnor has joined #ruby-lang
<rafrcruz>
Hello guys... I'm new in Ruby (and even in object oriented programming)... I'm trying to develop a simulation enviroment in ruby. Indeed, that simular is already done in MATLAB... My project is basically translate some fuctions and incorporate the object oriented paradigm to the project
<rafrcruz>
I intend to use the Gosu and chipmunk frameworks
kalleth has joined #ruby-lang
runeb has joined #ruby-lang
quatauta has quit [Quit: Verlassend]
kalleth has quit [Client Quit]
<rafrcruz>
The problem is that the number of robots in the simulation may vary. My question is if there is any way for me to get all objects of a class to invoke a method
davidbalber|away is now known as davidbalbert
<lianj>
keep a array of all items in the scene, then just use that array
<zzak>
or write a class method that returns the number of instances of that class, and everytime you initialize a new instance, increment that number
cschwartz has joined #ruby-lang
<lianj>
or that, but he didnt ask for a number but for a way to iterate over them
<rafrcruz>
zzak, the number of instances can be known through a class variable, don't you think? like @@number_of_objects... but that information by it self is not enought to make every instance call the method
kalleth has joined #ruby-lang
kalleth has quit [Client Quit]
mwjcomputing has joined #ruby-lang
mwjcomputing has quit [Read error: Connection reset by peer]
<zzak>
hmm
<zzak>
maybe with objectspace
runeb has quit [Ping timeout: 252 seconds]
cschwartz has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 256 seconds]
<rafrcruz>
maybe would be better if I explain the problem better... I'm intend to create a thread that every 100 milliseconds calculate a new control action for the robots ( the velocity for each wheels). Suppose that the method's name is controlRobot. If I has two robots, it is just Robot1.controlRobot and Robot2.controlRobot
<Kero>
keep a list. avoid to make classes the bags that hold the instances. classes should (mostly) only create the instances
<rafrcruz>
The problem is that the number of robots may vary... So it would be interesting to me has something who make every object of the class call this method
<zzak>
ObjectSpace.each_object(Object) { |obj| do something with obj if obj.instance_of?(Robot) }
<apeiros_>
zzak: each_object(Robot) then
Aria has quit [Ping timeout: 260 seconds]
<lianj>
anyhow, i hope none of you suggest actually using it
<zzak>
that too
<zzak>
haha
<apeiros_>
yupp, ObjectSpace is for debugging
Hakon has quit [Quit: Leaving...]
<drbrain>
or dirty tricks like DRb
cyri_ has quit [Quit: cyri_]
<zzak>
drbrain: hi!
justinram has quit [Remote host closed the connection]
<zzak>
drbrain: i was going to ask you the other day about manpages but forgot
<rafrcruz>
And for make a execution every 100 milliseconds, I should use the Time class and make something like: if (initialTime-curentTime) > 100 then computing_code, initialTime = 0 end
<rafrcruz>
that inside the thread scope.
<rafrcruz>
Or there is a better why or a class that do a precise interrupt for me?
<Discordian93>
hi! I'm trying to learn ruby, I am doing a very simple conditional check and I don't see where it possible could be wrong, but it doesn't run
<yorickpeterse>
Does anybody know if `defined?()` is a method call or a statement?
<Mon_Ouie>
defined? is a keyword
<Mon_Ouie>
It wouldn't work as a method, because it would have to evaluate its argument
Aria has joined #ruby-lang
<yorickpeterse>
ta
sn0wb1rd has quit [Remote host closed the connection]
havenn has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
achiu has quit [Quit: WeeChat 0.3.9]
qpingu has joined #ruby-lang
<apeiros_>
somebody knows!
sabfer has joined #ruby-lang
<apeiros_>
definded? is awesome and horrible in one…
Aria has quit [Ping timeout: 260 seconds]
<drbrain>
apeiros_: indeed
<yorickpeterse>
Hm, TIL about `* = 'some value'`
<apeiros_>
you know about def foo(*) already?
Serial_Killer_C has quit [Read error: Connection reset by peer]
<yorickpeterse>
Nope, the fuck does that do?
lcdhoffman has quit [Quit: lcdhoffman]
<apeiros_>
proc { |@foo, @@baz, $bar| died in 1.9 iirc, yes?
<apeiros_>
it takes any amount of args and ignores them
Serial_Killer_C has joined #ruby-lang
<yorickpeterse>
Yeah that proc gives syntax errors
<apeiros_>
nice for stuff where you just do something regardeless of the args and then call super
<yorickpeterse>
apeiros_: aah
_sillymarkets has joined #ruby-lang
runeb has quit [Ping timeout: 248 seconds]
<_sillymarkets>
Is anyone good with Shoes here?
<yorickpeterse>
_sillymarkets: Do you need to tie them?
<yorickpeterse>
*rimshot*
<_sillymarkets>
basically :\
imajes has quit [Excess Flood]
<_sillymarkets>
I want a simple button that when its clicked runs another ruby script (telnets into a box, and saves output to a file). Im not seeing any errors in Shoes, but I know the telnet function isnt working since the output file is not being created
<_sillymarkets>
The telnet function and Ruby class work as standalone. Thought it would be an easy Shoes.app {
<_sillymarkets>
button.click { RubyScript.new }
imajes has joined #ruby-lang
<_sillymarkets>
any helpful words or links?
intellitech has quit [Quit: This computer has gone to sleep]
gsav_ has quit [Ping timeout: 248 seconds]
headius has quit [Quit: headius]
<zzak>
drbrain: how come stdlib 2.0 was removed from ruby-doc.org? :(
<drbrain>
zzak: was it ever there?
<drbrain>
zzak: James Britt runs ruby-doc.org, you'd need to ask him
<zzak>
yeh, it was before
<zzak>
ill shoot him an email
<jkyle>
I'm trying to set the teimout on the Net::HTTP object. I did a http = Net::HTTP.new, then http.read_timeout = 1. But when it still seems to take a minute or so to timeout, not 1s
<zzak>
drbrain: tryin to get evan to sync documenting-ruby repo too btw
<drbrain>
jkyle: maybe you need to set open_timeout also?
<apeiros_>
teh fuck?
<apeiros_>
Kernel#y is dead?
<apeiros_>
======(
<drbrain>
apeiros_: it likely died with syck
<jkyle>
that's it, much better
robgleeson has joined #ruby-lang
<apeiros_>
drbrain: WHYYYYYYYYYY!?!?
<drbrain>
jkyle: note that read_timeout isn't the timeout for the entire body
<drbrain>
apeiros_: oversight by tenderlove, probably
<jkyle>
open_timeout is what I was looking for, I want it to quite quickly if it can't establish a connection
robgleeson has quit [Quit: WeeChat 0.3.7]
francisfish has quit [Remote host closed the connection]
<drbrain>
ok
<drbrain>
apeiros_: sick had lots of monkeypatches