apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
otters has joined #ruby
otters has joined #ruby
conor_ireland has joined #ruby
kevinbond has joined #ruby
ryanf has joined #ruby
kevinbond has joined #ruby
chimkan has joined #ruby
kevinbond has joined #ruby
engineerkp has joined #ruby
ryanf has joined #ruby
looopy has joined #ruby
engineerkp has joined #ruby
wallerdev has joined #ruby
<jrhorn424>
hm. breaking out of an explicit block (ruby 1.9.3, irb, iTerm2, Lion) doesn't seem to work.
jhunter has joined #ruby
Drewch has joined #ruby
fermion has joined #ruby
gurugeek_ has joined #ruby
<gurugeek_>
hello any gem that can write on an .ods file (open office calc) ? roo doesn't write and google doesn't return anything valuable :S
gomix has joined #ruby
* gomix
waves hi...
<gurugeek_>
any taker on the open office challenge? : D
<gurugeek_>
don't be shy ;)
c0rn has joined #ruby
banisterfiend has joined #ruby
strife25 has joined #ruby
species has joined #ruby
ryanf_ has joined #ruby
fixl has joined #ruby
aknewhope has joined #ruby
husimon___ has joined #ruby
prometheus has joined #ruby
<gomix>
im having some troubles using Base64.encode64 and/or Base.b64encode to mimic base64 linux utility for the same input
shevy has joined #ruby
<gomix>
any pointers? (ruby version 1.8 converts using lines, while base64 does not, i must get rid off so many \n's"
mikeycgto has joined #ruby
mikeycgto has joined #ruby
netrealm has joined #ruby
rock-n-rolla has joined #ruby
rock-n-rolla has quit [#ruby]
savage- has joined #ruby
nif_ has joined #ruby
tingo has joined #ruby
Nathandim has joined #ruby
tingo has joined #ruby
[Keith] has joined #ruby
luckman212 has joined #ruby
[Keith] has quit [#ruby]
tingo has joined #ruby
c0rn has joined #ruby
MrGando has joined #ruby
dotnull has joined #ruby
gtuckerkellogg has joined #ruby
nif has joined #ruby
baroquebobcat has joined #ruby
gurugeek_ has quit [#ruby]
luckman212_ has joined #ruby
<davidcelis>
why is it hard to get rid of the
<davidcelis>
line breaks
<davidcelis>
thats easy, it's a single gsub
<gomix>
david yes did that.. but i was expecting base64 module to do that
<ryanf>
the
<ryanf>
line breaks
VegetableSpoon has joined #ruby
<davidcelis>
ryanf: get it??
<gomix>
davidcelis: yes
<davidcelis>
gomix: No, what if someone wants to encode a linebreak in base64?
<davidcelis>
gomix: Module shouldn't expect what input its getting. You should make sure you're passing the input you want it to encode. Thats not its responsibility
seanstickle has joined #ruby
<ryanf>
i think he might be saying encode64 adds line breaks to the encoded output? is that right?
<davidcelis>
Sounds like he's saying that he wants his \n's stripped out of his input
<ryanf>
but if so, yeah, just a gsub
<gomix>
hmm davidcelis, well yes, but maybe some kind of args on base64 methods to make it easier
<davidcelis>
Dude, it's a gsub. It really doesn't get much easier than that.
<gomix>
i was looking at base64 ruby 1.9... and it does have some...
<gomix>
davidcelis: done ;)
<gomix>
that way
<davidcelis>
Lol
<gomix>
but im still on 1.8
Nathandim has joined #ruby
senthil has joined #ruby
tommyvyo has joined #ruby
robdodson has joined #ruby
Progster has joined #ruby
indeterminate has joined #ruby
<wroathe>
If autoload lazy loads dependancies only when they are needed why would anyone ever use require?
chimkan_ has joined #ruby
igotnolegs has joined #ruby
Cyrus has joined #ruby
<heftig>
wroathe: because if you're going to use it anyway, might as well load it now
<heftig>
autoload also needs some ugly locking
<wroathe>
Yeah, I just started reading about the thread safety issues
<wroathe>
Was a stupid question :P
chimkan has joined #ruby
nari has joined #ruby
banisterfiend has joined #ruby
<richardlxc>
hello
Sailias has joined #ruby
RORgasm has joined #ruby
mikepack has joined #ruby
banisterfiend has joined #ruby
moshee has joined #ruby
ZachBeta has joined #ruby
liluo has joined #ruby
richardlxc has joined #ruby
shtirlic_ has joined #ruby
richardlxc has joined #ruby
jimeh has joined #ruby
natemcguire has joined #ruby
radic_ has joined #ruby
zeroeth has joined #ruby
pac1_ has joined #ruby
<robdodson>
what's the term for this operator =~
Teddy2steper has joined #ruby
nerdy_ has joined #ruby
<robdodson>
match?
richardlxc has joined #ruby
<ryanf>
match i guess. i think i call it that
sbanwart has joined #ruby
sacarlson has joined #ruby
<robdodson>
k thanks :)
jiangle has joined #ruby
looopy has joined #ruby
iamjarvo has joined #ruby
brngardner has joined #ruby
<richardlxc>
hello
<fowl>
SUP
ryanf_ has joined #ruby
<fowl>
welcome to #ruby , where the sex flows like wine
kennyd has joined #ruby
kennyd has quit [#ruby]
nvez has joined #ruby
mdhopkins has joined #ruby
freeayu has joined #ruby
richardl1c has joined #ruby
d2dchat has joined #ruby
Drewch has joined #ruby
nif has joined #ruby
Teddy2steper has joined #ruby
VegetableSpoon has joined #ruby
richardl2c has joined #ruby
ZachBeta has joined #ruby
liluo has joined #ruby
jimeh has quit ["WeeChat 0.3.7"]
gtuckerkellogg has joined #ruby
h4mz1d has joined #ruby
mxweas_ has joined #ruby
gift has joined #ruby
BSaboia__ has joined #ruby
kazin_ has joined #ruby
aknewhope has joined #ruby
sacarlson has joined #ruby
mlevin_ has joined #ruby
aknewhope has quit [#ruby]
Brasdof has joined #ruby
<delinquentme_>
anyone here happen to know how I might append a nodeset to a nodeset?
<delinquentme_>
more appropriately .. combine nodesets?
<fowl>
delinquentme_, it is very possible that the universe would collapse in on itself
<delinquentme_>
O_o
<delinquentme_>
nope tried it .. didnt collapse ;D
alx- has joined #ruby
hrs has joined #ruby
ben225 has joined #ruby
silverhand has joined #ruby
riyonuk has joined #ruby
<riyonuk>
Can someone tell my why the last variable is never increased? :/ - http://pastie.org/3753391
<fowl>
riyonuk, because you output remaining_months
<fowl>
instead of current_date
Gekz has joined #ruby
advorak has joined #ruby
seanstickle has joined #ruby
<riyonuk>
LOL
<riyonuk>
Wow
<riyonuk>
That's just sad.
Osek has joined #ruby
<fowl>
lol i make errors like that all the time, but im dyslexic, what's your excuse? :p
silverhand has quit [#ruby]
nif has joined #ruby
RORgasm has joined #ruby
cobragoat has joined #ruby
<riyonuk>
How can I get todays month, add to it, and then turn that value back into a month?
sam113101 has quit [#ruby]
sacarlson has joined #ruby
<fowl>
riyonuk, my only suggestion is to do it in pry
<riyonuk>
cause I'm doing time.new.month but it's getting really confusing
<riyonuk>
and then what happens when the month goes into the new year? how does it know it's 2013 and not 2012? :/
<riyonuk>
Ughh date/datetime/time is just plain difficult
sam113101 has joined #ruby
artOfWar has joined #ruby
nari has joined #ruby
sterNiX has joined #ruby
sterNiX has joined #ruby
jayne has joined #ruby
Bonkers has joined #ruby
artOfWar has joined #ruby
lkba has joined #ruby
alx- has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
fayimora has joined #ruby
liluo has joined #ruby
KL-7 has joined #ruby
shadoi has joined #ruby
gtuckerkellogg has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
zemanel has joined #ruby
MrGando has joined #ruby
My_Hearing has joined #ruby
deobald has joined #ruby
CheeToS has joined #ruby
wookiehangover has joined #ruby
robdodson has joined #ruby
gokul has joined #ruby
zeroeth has joined #ruby
<hemanth>
how does one check if require was successful or not ?
<banseljaj>
use a simple test method?
<banseljaj>
then remove it later?
<hemanth>
was doing something like @test.methods.grep()
<hemanth>
but rather puts "Did not happen" unless require "/lib/test/blah" would be useful?
<hemanth>
Cos i'm not getting the methods even after requiring
RORgasm has joined #ruby
c0rn has joined #ruby
richardlxc has joined #ruby
<wolgo>
require returns true if the require word right?
<ryanf>
no
<ryanf>
it returns true if it actually loaded the file. it returns false if the file was already loaded
<ryanf>
but neither of those are failures
<ryanf>
it raises a LoadError if it actually fails
akemrir has joined #ruby
gtuckerkellogg has joined #ruby
<wolgo>
ahh right
araujo has joined #ruby
araujo has joined #ruby
JohnBat26 has joined #ruby
<hemanth>
ryanf, there is no load error, but still i'm able to access any of the methods :/
<hemanth>
I have extended a module
eldariof has joined #ruby
dubios has joined #ruby
mikepack has joined #ruby
MrGando has joined #ruby
rippa has joined #ruby
x0F__ has joined #ruby
nfluxx has joined #ruby
<jrhorn424>
is Arr#uniq with block guaranteed to remove secondary occurences? In other words, I'm looking to keep the first occurrence within each array, since I'm sorting before applying uniq.
<kish>
You don't have write permissions into the /var/lib/gems/1.8 directory.
<kish>
should i make the 1.8 directory writable by all?
mikepack_ has joined #ruby
<jrhorn424>
kish, are you using `gem install`? have you tried `sudo gem install`
<jrhorn424>
fowl: that didn't look clear at first, but I see what you mean. I've been switching back and forth between arrays and hashes all night.
<jarred>
For something I'm working on, I need to parse Nginx's config file. Has anyone heard of a gem or C library that does this? (Besides Nginx itself)
<advorak>
When I create a new class, #inspect is a clone of #to_s, correct? Then how do I maintain the functionality of #inspect and create my own #to_s without impacting #inspect?
RangerMauve has joined #ruby
<fowl>
advorak, when you alias a method in ruby it copies, not links
c0rn has joined #ruby
<advorak>
fowl, When I create a new class and override #to_s, #inspect seems to want to do whatever #to_s does ...
<advorak>
I want #inspect to do what it did before I overrode it with #to_s
cheok has joined #ruby
Morkel has joined #ruby
yxhuvud has joined #ruby
djdb has joined #ruby
kaneda has joined #ruby
vectorshelve has joined #ruby
djdb has joined #ruby
a_a_g has joined #ruby
<fowl>
advorak, you're right!
<fowl>
idk, that's weird
<fowl>
generally you write your own inspect so you can put your own information in it
MrGando has joined #ruby
<advorak>
oh! I get it ..
nari has joined #ruby
<advorak>
class Andy; alias :inspect :s; def to_s; 'my to_s';end;end
<advorak>
:-)
<advorak>
That does what I want it to ..
<advorak>
thanks for your hint that "alias makes a copy of the method"
schovi has joined #ruby
surfprimal has joined #ruby
MasterIdler_ has joined #ruby
<advorak>
looopy has joined #ruby
banisterfiend has joined #ruby
etehtsea has joined #ruby
Sigma00 has joined #ruby
LMolr has joined #ruby
francisfish has joined #ruby
flaggy has joined #ruby
cola_zero has joined #ruby
kiwnix has joined #ruby
gokul has joined #ruby
c0rn has joined #ruby
c0rn_ has joined #ruby
<fowl>
advorak, alias is also syntax
<fowl>
you can do `alias inspect to_s`
<fowl>
no commas, bare methods, its weird
guardian has joined #ruby
<advorak>
*nods*
<shevy>
it's pretty!
<shevy>
alias_method :ack, :yuck!
<shevy>
^^^ ugly!
<shevy>
alias ack much_better
<shevy>
^^^ nicer!
<jrhorn424>
how would you pass in symbols from the command line?
<shevy>
ARGV has only strings as its array members but you can convert them into symbols if you really must, in your .rb script
<jrhorn424>
shevy: yeah, i want to selectively keep some keys in a large hash, but I'd like to do that dynamically from the command line
<shevy>
yeah, impossible from your shell alone. it is all strings at that point
<jrhorn424>
shevy: i could do ARGV.to_sym, though
<shevy>
yes, you can do everything IN-side your .rb script
<jrhorn424>
shevy: oh, i see your point
<shevy>
you could use a ruby shell perhaps :)
<jrhorn424>
:D
<jrhorn424>
shevy: is there an idiomatic way to pull in all command line arguments after a certain position? I have ARGV[0] and ARGV[1] used as filenames, for example, but it would be nice to do `ruby myscript.rb file1 file2 symbol1 symbol2 symbol3`
<jrhorn424>
some splat magic, perhaps?
<shevy>
well
<shevy>
I usually handle all ARGV stuff after doing a:
<shevy>
if __FILE__ == $PROGRAM_NAME
<shevy>
_ = MyClass.new
<shevy>
hmm
<shevy>
actually
<shevy>
_ = MyClass.new(ARGV)
<fowl>
jrhorn424, *ARGV ?
<shevy>
usually like this
<rking>
Hrm. Does "_" have any special meaning?
<shevy>
and then, inside my class, I act on that input
<fowl>
*ARGV[2..-1]
<jrhorn424>
i was expecting ARGV[2:] to work
<jrhorn424>
fowl: that's it...
<shevy>
rking, nah, it is just a local variable without a real name
<shevy>
ohhhh
<rking>
K.
<shevy>
you come from python?
<jrhorn424>
shevy: yep
<jrhorn424>
my google-fu doesn't help me when I don't know what I'm looking for. thanks.
<jrhorn424>
(FWIW, octave/matlab works the same way with array ranges)
<shevy>
oh yeah, googling for splat is not easy when one does only know the syntax name *
<rking>
shevy: Is that the custom... "foo"/"_"?
<jrhorn424>
shevy: :D
<fowl>
jrhorn424, you can also do [1,2,3,4,5][1,2] to start at index 1, length 2
<shevy>
rking dunno. I like _ ... it is short ... it never needs a name... I used to use things like x or y in the past, but those always have a name... I like things to have no name if they are not really important
<rking>
Yeah.
<shevy>
I also used to use things like _tmp but this is a dark time that I'd rather not refer to anymore... :P
<epitron>
is there a way to stream one IO into another IO?
<jrhorn424>
fowl: helpful tip, though have mercy if I want to add more positional arguments after a range
<rking>
For some reason that makes me think of device driver programming.
<fowl>
NO
<epitron>
without writing a loop? :)
zodiak has joined #ruby
<fowl>
epitron, ruby doesnt handle IO, sorry
* epitron
pushes fowl into the mud
<shevy>
jrhorn424 I think it is better to handle the ARGV logic from within a method
* fowl
drags epitron with him and starts 'wrestling' ;)
<shevy>
omg
<Quadlex>
Aww, I love this channe;
<jrhorn424>
Quadlex: +1
<epitron>
so like, if i had a 10 gajillion byte file, and i wanted to write it to another file
<epitron>
with ruby IO objects
<epitron>
how would i do it so as to not require 10 gajillion bytes of ram?
<shevy>
hmm
<shevy>
you want to use files rather than IO objects?
<fowl>
epitron, IOStream?
<fowl>
streamIO or something like that
<epitron>
the files are already IO objets :D
<fowl>
i think
<epitron>
i'm actually just writing a general purpose method that lets you write files or strings to a file
<epitron>
and if it's an IO object, it streams it
<Quadlex>
Does anyone else find it hard to reason through different patterns?
richardlxc has joined #ruby
<rking>
shevy: Hehe.. I happened to stumble on this... interesting use of "_". _, *unquoted, _ = '"quoted"'.split(//)
<banisterfiend>
Quadlex: no, everyone is smarter than you
<Quadlex>
I doub it
<Quadlex>
Can't be so
<banisterfiend>
rking: you could call _ anything there ;)
<Quadlex>
Lots of people watch Reality TV
<rking>
banisterfiend: I'd call it bad_idea, but yeah.
<rking>
banisterfiend: Actually, since I have you here, what did you mean by, "I use the def meth(*) end syntax when calling super in a subclass: def meth(*) puts "subclass"; super; end "
<banisterfiend>
rking: well it means you dont have to fill out the arg list or resort to *args and pass it up
<rking>
banisterfiend: Oh. "super" defaults to passing the same args?
<banisterfiend>
rking: yeah
<rking>
I didn't expect that.
<fowl>
super()
<rking>
fowl: That's how you get it to pass nothing?
<shevy>
yeah, the parser here knows that nothing is passed
qakka has joined #ruby
<rking>
Hrm. Before that, I would have said "x == x()"
<fowl>
i think super is the only case like that
<fowl>
its more for convenience
deobald has joined #ruby
<fowl>
x == x() unless x is a local
<rking>
And what happens when it is?
RORgasm has joined #ruby
<banisterfiend>
rking: local gets priority
<shevy>
rking we train you to think like the ruby parser itself!!!
<fowl>
if x is a local than `x` is that local, `x()` would still refer to the method (or `x arg, etc`)
<rking>
OK.
<rking>
So what does Integer(1) do?
<banisterfiend>
rking: calls Integer() method
<shevy>
I suppose it makes an Integer ... x = Integer(2)
<shevy>
oops I meant
<shevy>
x = Integer("2")
<rking>
But, I mean, syntactically.. there's a parens pair following an object.
<shevy>
hmm it looks kinda odd yeah
timonv has joined #ruby
<banisterfiend>
rking: no, it's a method call
<fowl>
hehe
<banisterfiend>
rking: there's a method called Integer()
<rking>
oooOOOOoh
<banisterfiend>
rking: and just as fowl said, you invoke the method Integer() by using (), if you just put Integer by itself (with no ()) you'd get the Integer class
<rking>
So.. how do Integer the method and Integer the class coexist?
<banisterfiend>
rking: different namespace i guess
<shevy>
I would assume there is no problem as class Integer already namespaced it, and def foo is within that namespace
<rking>
I don't understand this namespace concept.
<fowl>
its nothing to do with namespaces
<rking>
So there are separate buckets for names of classes and functions?
<banisterfiend>
fowl: haha that guy who runs that site reminds me of you
<fowl>
rking, methods can be uppercased
<shevy>
X() is always a method call
<banisterfiend>
fowl: ef*kt
<fowl>
how
<shevy>
and I think all functions are methods, attached to a class in ruby
<shevy>
hmm
<rking>
shevy: I agree with that much.
<shevy>
I dont think I like that Foobar() thingy much
<rking>
But the part I don't get is how this pastebin works. Seems like the def X() should overshadow the class X altogether.
<shevy>
it's not as intuitive as object.foo()
<shevy>
why
<shevy>
def anything never conflicts with class anything
<shevy>
oh let me test something
<rking>
Oh, because you're actually defining Object.X
<rking>
No wait, "class X" would be "Object::X"?
<My_Hearing>
If it can be parsed as a constant access, it will be parsed like that and not as a method call
<rking>
I'm so confused. =(
<Mon_Ouie>
(i.e. no arguments, no parens, no receiver)
<shevy>
I get confused too
<Mon_Ouie>
And the constant namespace just isn't the same as the method one
<rking>
I'm not even to the part where it can parse the call.. I'm stuck at the declaration.
<rking>
Mon_Ouie: How can we see this?
<Mon_Ouie>
See what?
<fowl>
listen to Mon_Ouie , he is wise beyond his years
<fowl>
seriously tho, kids a genius
<rking>
Like constants() vs. methods()
<rking>
Whoa, those actually both exist.
<Mon_Ouie>
Except you probably meant instance_methods
<fowl>
rking, most of the time you dont even need to worry about this, I can't even think of a time i've seen Integer() used
<fowl>
a lot of times it is for convenience, ie calling JSON() instead of JSON.parse()
<shevy>
rking, dont worry, i am confused too now
<fowl>
oh and whoever asked about _ earlier, in pry it is used to get the last value returned, and i think it might be that way in IRB too
<shevy>
how do you define something like Integer() ?
<fowl>
now shevy is being dumb
<Mon_Ouie>
def Integer(obj, base = 10); …; end
<shevy>
hmm
<rking>
fowl: OK, yeah, I've seen it like that. (And I was the one who asked.)
<Mon_Ouie>
In this particular case, it is defined within Kernel as a module_function
<shevy>
ohhhhh
ewemoa has joined #ruby
tewecske has joined #ruby
<shevy>
hmm
<shevy>
this kinda shakes up the foundation of my belief in Constants
<rking>
Is there a simple way to describe Kernel vs. Object?
<shevy>
perhaps I should want to make all methods start with an upcased letter like in C#
<shevy>
def Add
<shevy>
World.Add Planet.new
<rking>
Not Planet.New ?
<shevy>
oh man
<fowl>
do that and i will shoot you in the leg shevy
<shevy>
rking now you see how confusing this is
snearch has joined #ruby
<fowl>
wtf
ephemerian has joined #ruby
<fowl>
how can you be confused shevy
<fowl>
how does this information change anything you previously knew
<irmbrady>
C# should be AddNewPlanetToWorld(Planet planet, null, null, null, null);
twinturbo has joined #ruby
<rking>
I hope to someday sit down with some C# enthusiast and understand where they are coming from. Same thing with NASCAR.
mikeric has joined #ruby
<shevy>
fowl I am not sure ... that def Integer thing kinda changed my world today
<rking>
Perhaps both activities can only be explained in the context of drunkenness, I don't know.
<irmbrady>
I use C# at work - I think you would be more interested in speaking to VB enthusiasts; they are a great bunch
<fowl>
ew i didnt know VB existed still
<shevy>
rking humans are weird. there are those who believe the world will end at XYZ. even when it becomes more and more unlikely, they start to believe more and more into this date, because of their earlier investments into it
nemesit has joined #ruby
<fowl>
btw
<fowl>
X = method(:X)
<fowl>
now what
<fowl>
:P
<rking>
Haha
<banisterfiend>
fowl: similar sense of humor
berserkr has joined #ruby
<shevy>
hmmm
<rking>
OK, X = instance_methods(:X) simply warns you about the overwriting of a constant, then yeah, makes the X constant the method.
<shevy>
I am unfunny :( I dont like this at all
<shevy>
yeah that warning should be dropped
<shevy>
it would instantly eliminate several hundred lines of warnings in my code :)
gen0cide_ has joined #ruby
<fowl>
rking, constants aren't constants in ruby, you can overwrite them and just get a warning
<fowl>
or do $VERBOSE=nil then do it, and get no warning :P
<fowl>
but yeah, they're not really constants, lul
<vectorshelve>
shevy: How you ?
<vectorshelve>
We last ended on an afghan note :) remember !!
<shevy>
not sure I remember
<shevy>
my IRC brain has like a remember-history of about 2 days :\
<shevy>
like the guy in the movie Memento
<shevy>
I am doing the same thing every day, again and again, and I dont remember having done them before
<vectorshelve>
shevy: afghanistan has got a lot of beatiful women... :) Thats what I said last somalia and afghan are the two most volatile nations today
trivol has joined #ruby
cezar has joined #ruby
sgmac has joined #ruby
sgmac has quit [#ruby]
ukwiz has joined #ruby
<vectorshelve>
shevyennu
shiroginne has joined #ruby
blacktulip has joined #ruby
davidpk has joined #ruby
roolo has joined #ruby
knopkodav has joined #ruby
<shevy>
there are lots of volatile nations
<shevy>
mali lately
<shevy>
abchasia and georgia some years ago
<shevy>
it's always the big nations that wanna wage their wars through proxy states
<shevy>
Integer() somehow makes me sad :(
workmad3 has joined #ruby
<rking>
LOL
<shevy>
I guess with ruby one has to accept the good bits with the bits that stink
<vectorshelve>
shevy: :)
<shevy>
at least it's better than in PHP
<shevy>
hmm on another note
<shevy>
mailing lists confuse me
jfelchner has joined #ruby
<rking>
shevy: That's a(nother) strange thing to say.
<shevy>
rking hmm there is only one fantasy author I still read books, and it seems he will stop to do so soonish
<shevy>
been following him since 18 years, the last one... wanted to say something, but that would require of me to subscribe to a mailing list. hate hate hate, so I decided to not write anything...
shiroginne has joined #ruby
<shevy>
I mean, I hate this subscribe thing
rubyninja has joined #ruby
<shevy>
ah well, everything fades anyway
gokul has joined #ruby
<fowl>
shevy, you aren't on the gobo list are you
<shevy>
fowl hmm no
<shevy>
but it's dead anyway :(
<fowl>
nah its low-volume
<shevy>
I think mhomer got too much into the project, it was much better even when hisham had less time, with jonas still around...
<shevy>
everything fades
dhruvasagar has joined #ruby
<shevy>
but I am still going to have RBT be 100% compatible with the gobolinux scripts one day!
<fowl>
wat u mean homer got too much into it
<fowl>
hes like the only one doing anything aside from the occasional package updates from hisham
mneorr has joined #ruby
bier has joined #ruby
<shevy>
yeah hmm
<shevy>
it's a shaky theory I have for sure
<vectorshelve>
shaky shevy
<shevy>
sometimes when other people take over a project, the whole nature of the project changes significantly
<shevy>
the golden years were from like 2004 to 2008
<shevy>
:(
timonv has joined #ruby
<shevy>
rubyX / Heretix had two maintainers
<shevy>
the guy who wrote most of it, and the guy who tried to push it forward
<shevy>
when the first one had less and less time, the other one also had less time due to reallife/university
<vectorshelve>
shevy: IT industry is boring... after long
<shevy>
yeah, but there are ideas which are important and cool
apeiros_ has joined #ruby
<vectorshelve>
shevy: yes but you cant spoil this wonderful life by spending a good part of it sitting in front of a computer and coding :(
<vectorshelve>
I seek salvation :'(
<shevy>
oh I dont like computers anyway
<shevy>
it's also not so much the coding that is nice, it's the creativity that is what I like
<shevy>
you build on ideas on ideas on ideas on ideas
wilmoore has joined #ruby
<shevy>
it's like evolution in some way. sometimes an idea branch dies out, sometimes not
<shevy>
I am sure when _why decided to die his virtual death, some of that creativity in his idea branches died
<vectorshelve>
shevy: if you dont like computers.. u r using one at this point of time right ?
<vectorshelve>
shevy: I wanna disappear into the depths of silence and peace... cuddle to my love and sleep for eternity :0
lolsuper_ has joined #ruby
bpalmer has joined #ruby
tobago has joined #ruby
<banisterfiend>
vectorshelve: do u have vectors on your shelf, do u keep it beside the cornflakes
<apeiros_>
that means you're passing a Symbol to []
d34th4ck3r has joined #ruby
<apeiros_>
which is a method
<apeiros_>
probably - as fowl says - an array
<apeiros_>
nothing to do with case/when.
<hemanth>
yup, true, worked well on irb
<yxhuvud>
or it means he is relying on symbols being integers, which they are not anymore
<fowl>
you get that error if you do [][:hi]
<fowl>
or [].[] :hi
<fowl>
lol
<hemanth>
hmm in testrunner.rb
<hemanth>
test-unit gem
dhruvasagar has joined #ruby
Indian has joined #ruby
<apeiros_>
I don't know what you're trying to tell us, hemanth
a_a_g has joined #ruby
a_a_g has joined #ruby
<vectorshelve>
hemanth: kya bol raha hai yaar ?
xanaru has joined #ruby
<hemanth>
ok...
<hemanth>
in 1.9.3
<hemanth>
Test::Unit::UI::Console.TestRunner.run(TS_my_test_case, outputlevel=14) is bombing ; 'test/unit/testsuite' and 'test/unit/ui/console/testrunner' are the gems that are required
<hemanth>
bomb -> [] : can't convert symbol into Integer
<hemanth>
apeiros_, vectorshelve ^
a_a_g has joined #ruby
<vectorshelve>
hemanth: put some code out on gist and show
<fowl>
how do you call a method with named args
<fowl>
o.o
<hemanth>
fowl, initialize has suite,options={}
Floydzy has joined #ruby
<fowl>
then you want to send :outputlevel => 4 or outputlevel: 4
<hemanth>
vectorshelve, @listeners = @options[:listeners] || [] is where it's bombing
<fowl>
outputlevel = 4 is an assigment
<fowl>
so @options is probably 4
<hemanth>
oh :/ gosh!
<fowl>
:)
* hemanth
shudders for silly mistakes and takes a small break
<vectorshelve>
:)
RORgasm has joined #ruby
<hemanth>
i'm porting a automation framework from watir to watir-webdriver
<fowl>
what a weird benchmark, they do completely different things >_>
<shevy>
:<
<Pip>
Is that the cutting-edge technology in programming language?
sterNiX has joined #ruby
<shevy>
Pip it's the current buzzword. everything that is lazy is good
randym has joined #ruby
<Mon_Ouie>
fowl: They all evaluate to something true-ish!
<Pip>
Wait a second, is Matz here?
<fowl>
lol
<Pip>
Well, once I was asking if Stallman was present in #GNU
<fowl>
Pip, one time i thought i had to fart, ended up shitting my pants
sterNiX has joined #ruby
<Pip>
lol
<fowl>
true story
<Pip>
That's possible
<Pip>
Shit happens
johndbritton has joined #ruby
<Mon_Ouie>
I think Matz used to be on IRC, actually
gokul has joined #ruby
<vectorshelve>
Every time I start lving ruby's beauty.. rails dominance disturbs me :'( I need sanity in ruby :)
sterNiX has joined #ruby
sgmac has joined #ruby
<vectorshelve>
Pip: shit happens... just flush it and move on :)
<shevy>
Pip I think matz used to be on #ruby-lang a long time ago
<shevy>
but he said it's eating time or something like that and has given up on it
<shevy>
vectorshelve, what works for me is to ignore rails
<Pip>
Well, I think he is busy designing and improving Ruby
<shevy>
Pip, dunno... sometimes I feel as if nobu is doing more work, and matz is doing just some theoretical thinking for the future now :P
<vectorshelve>
shevy: thats unfortunately my bread and butter... what to do unless someone gives me salvation.. I am trying for it.. amen... :)
<shevy>
I see
iocor has joined #ruby
iocor has joined #ruby
<Pip>
So Ruby has been standardized?
spencerward has joined #ruby
<shevy>
hehe
<shevy>
where!
qakka has joined #ruby
<Pip>
JIS
<Pip>
Japan Industrial Standard
rushed has joined #ruby
dordo has joined #ruby
sgmac has joined #ruby
bpalmer has quit ["ERC Version 5.1.2 $Revision: 1.796.2.6 $ (IRC client for Emacs)"]
<shevy>
hmmm
alup has joined #ruby
gokul has joined #ruby
<Pip>
So we are using the CRuby as the mainstream implementation right?
<gogiel>
hello. is there better way to do inject([]) { |s,x| s.concat some_array } ?
<shevy>
not sure who is we Pip . I use the ruby you can download from the official ruby site. And I always will
<Pip>
Does Ruby support arbitrary number of parameters for methods?
<banisterfiend>
Pip: Yeah, do u?
<Pip>
:D
<gogiel>
Pip: of coure
<Pip>
Is there any design program in Ruby?
<Pip>
*problem
<gogiel>
Pip: yes, it's slow :D
<Pip>
Wow~~~ that's impressive
<Pip>
I mean that's the common problem for many languages, not just Ruby
<Pip>
So no other problems?
<gogiel>
Ruby for me is the greatest and the most flexible language ever made. And it's slow because of it.
<banisterfiend>
Pip: it's not very lazy, but that's being fixed in 2.0
<Pip>
How fast do you want it to be?
<gogiel>
reading good Ruby code is pleasure. you can open any file and you can understand what's going on. that's beautiful
<banisterfiend>
anyone here subscrbe to railscasts?
aibo has joined #ruby
rohit has joined #ruby
<shevy>
Pip every language has problems
<shevy>
ruby has significantly less problems than PHP though
gokul has joined #ruby
<Pip>
How is Ruby's parallel feature?
sgmac has quit [#ruby]
<shevy>
it has two rails
<shevy>
perfectly parallel
<gogiel>
Pip: it had problem with real threading, GIL
<shevy>
there are so many problems
<shevy>
I am glad you are not into programming Pip
<Pip>
lol
<Pip>
How do you know that I'm not into programming?
<Pip>
Because I am asking nerd questions?
<gogiel>
is there real threading now in Ruby?
davidcelis has joined #ruby
<gogiel>
AFAIK interpreting is still blocked by GIL, but it has improved concurrency IO
<gogiel>
am i right?
<Pip>
Okay, what kind of GC is Ruby equipped right now?
<shevy>
Pip nah, but because your questions are kinda like "what if the world would be perfect" and "what do you like about [insert any programming language here]" interview style
daed has joined #ruby
<Pip>
Right
sgmac has joined #ruby
<shevy>
GC 10.0 Steroid
<shevy>
it beats every other GC out there
<shevy>
it runs 525.203 miles / hour
<shevy>
in fact, ruby is soon as fast as C
<gogiel>
GC in Ruby has been rewritten, it's a lot better now
<shevy>
then we will have a rubyOS :)
sgmac has quit [#ruby]
<Pip>
:O
<shevy>
gogiel, simple answers to simple questions eh ;)
<shevy>
everything is better now!
<gogiel>
shevy: but it really is, it has been rewritten some time ago actually ;)
<shevy>
yeah
<shevy>
we kinda answered all of Pip's questions that way too
<Pip>
"Lazy Sweep GC is one of his works for CRuby's GC. You can use it since Ruby 1.9.3!"
<chiklazy>
Rigg ass graggan Arewenoo.. Arwenoo zee-oo zaya. Chinna 2olombia adaa wella shrek raflood lool. Ground rearing some groans. I'm huff tuff reffa leffa lurf nords. I'm just like... vanilla ice foe davvity wheel barow Exparly ex preggo Is anyone out there a rig ass graggan? lelly in mah kellar WRESTLING'S FAKE!
<chiklazy>
Pargastian wildly nig nargs. smeggalty dellets Far foo faqqin Digital damage. Where wally niqqs. It's coast to coast night. Hoke a lup! Free faq fornag! Puck a leek a lup to lup round tround. Wormser marrial niqs. El delphin trilaxal. Blanking bluck to the black a lickel bleck narge.
<chiklazy>
Puggy muggle maggity ass riggle ma hole. Buck a waath ess wheel wall! Bustin' room past tin! Buckin' room past in! A harnaly scrary o mep. Rons raplaisher pa noans rebble dibby dump dimp gabble dak. A wristafiable pluckin' Blacking it up to the reng teng blickhole. I kleb to the sand of the blicka rickin time.
<chiklazy>
Rekkal theh mick thuck the rep tep taistral. Wallif ma wallis wallets. Is anyone here a jelly-o shkrapper? Bam glacky I'm mega man! Has anyone here ram baisted before? The koost a heeckil pludgeon. Feathers round rick gring air! Liquid cereal's good for you. The mummified goblin. Pallaj oh plex.
<chiklazy>
Moomassu desu, niddle the bair bons with caution Belgabble wolf waffy. Is anyone here a rubberty duggger? Is anyone a reggy dick plegger? Shoody spalooj moojer! Mella murtasTcM. Is this happy hour at the retard shack again? ron ron reggatoon. Walla julie malerf luck. Weggerty wing yaing plucking time!
<shevy>
omg
<fowl>
sigh
<chiklazy>
Gotta set up for the suicide slide Gamma mareenmon. I've got more scrap ass shit than you can balieve with. Sally McDuffo whip. after secv on a sp00ky stream F/\gga foo regga makegg mahoun. Its all fun and games until the power goes out. Mennima Pay Street. rubbbity dib dadge pickard. Lelly in ma kellar.
<shevy>
spam attack
<chiklazy>
I'm on recky o gregor street. Miggity ass raggan. Boyar bod. Pellicka pool wiss wall. Watching bynum bukkake the smelts Haggity ass mahown. Trukkity rep roon, the kitz a kickel plujin. Trellalickers and burb street. Huck a dickin' dime.
<chiklazy>
Float a pelly plaack ass. You're a digital dumbass. Smuggy jaloo meff jillahole. Dick, dick, dick dickaloo! Dick dickaloo my darling. Haggity ma heggal hole. nuriggerdy diggal. Visi blurb cage. O melon man mist meluhn mijohn. Oh man mellajoram. Hebble oh babble.
<chiklazy>
Two guns and a ruck roog. Turned into a hollow loop. scritch scratch the happy fog. Is anyone here a fudge plucker. I'm talking bout a rastal marry yo map. Too many ruggerty dag datoes Or are you fuck wappys out for kill gore!
<chiklazy>
The curmudgeonly pearl; ask and you might be answered. Finger with a whop top tinger. Rig tig tigger. I'm ram bastin' I'm feelin' clean! Pricey bad ass, a whop winger! Gullable dick waffer. Miggity mahoming beacon. Nick lickal novice. Your remenance. Square juice miknuller. Permio plather.
<fowl>
apeiros_,
<chiklazy>
Where does master words eat pies for shells? Trenna ma lilla manole. A rargy barg ark. Shockity strip with the rectify guy. Clockity rep with the rectify fly. Hebble o babble. Rudda nah neh noo. HEP TEP ROGGY! I'm thinkin' about greckin' the rummified coin! Let's look at Amenhotep 4's mummified groin!
<chiklazy>
Ploona lefflie ludge picking! Haggy smith heddal, marry oh dettal. Hannabalist, no cannibalist, no hannibalist balievar. Ban dackoo. Put on weight! Wherr wiss fall, nudge plucking. too many |\|igg/\s, that's my line. I'm squirt with the worth of the mother plucking fine. Hoomee missee Mic daisy too. Davey oh doubt. Meggie mahoo middle.
<chiklazy>
Too many Romulan potatoers. Matoonal dakkal. Helly muhp, melly muhp, runna minuck taste-rum. Wack ass weight! Hellamanorf weg watthal. I think I'll just start to try my .smuretsaTcN rubbbity boom ducking. Hitchaleval exasht romice. Up with jelly my humpfrins. Uva devil miss tee pie. She can't poo!
<shevy>
HELP
<chiklazy>
Shniqqen munuh lik leggal perritolma penis pran chella maloney day breeze Paahster jam ban wikkle. Hella mah lun mick hella malole. Hella minull mic mella manoh. The roadline, it's illegal. Trully mulla mih nole. I'm a relladge-o-melladge-o-ram. Come on you fuckin dag asses.
<shevy>
KILL HIM
<Pip>
:D
<fowl>
lmao
<Pip>
My links got flushed
<shevy>
were they important? :D
<Pip>
Not to most people
<linduxed>
the almighty k-line struck hard
<Quadlex>
Bitch got K-lined
<Quadlex>
Such a "Gangsta" term for something so geeky as IRC
<Mon_Ouie>
I mean, you can't really know more without having more context…
<linduxed>
or the rails one
<linduxed>
hmmm wait
<linduxed>
lemme check around the code a bit more
saster has joined #ruby
<sacarlson>
linduxed: it depends on what created the object ore_contents
dshdsgdfdf has joined #ruby
<linduxed>
collection.build(attributes = {})
<linduxed>
Returns a new object of the collection type that has been instantiated with attributes and linked to this object through the join table, but has not yet been saved.
<linduxed>
found it
slonimsky has joined #ruby
d34th4ck3r_ has joined #ruby
adac has joined #ruby
slonimsky has joined #ruby
vdv has joined #ruby
<vdv>
hi all
<bgfbghnbgh>
hi
<bgfbghnbgh>
a/s/l?
<bgfbghnbgh>
jk
jbw has joined #ruby
<vdv>
if i read from url with content = open(url, ua).read, how can i then pipe that content to exteral prog?
nari has joined #ruby
pu22l3r has joined #ruby
<apeiros_>
vdv: popen
thecreators has joined #ruby
<Spaceghostc2c>
I am very fond of popen, I tend to mispronounce it in my head and call it pippin, like in LOTR
<sacarlson>
seems I've lost the gpg decryption/encryption method plugin that was available in gedit when I ran ubuntu 10.04, now in ubuntu 11.10 it seems no longer exists. what is a replacement for this?
<apeiros_>
vdv: also, use &:read: content = open(url, ua, &:read)
<fowl>
sacarlson, look on launchpad?
<sacarlson>
fowl: what am I looking for gedit plugins ?
Synthead has joined #ruby
<sacarlson>
fowl: I've been googleing it without finding anything yet
LMolr has joined #ruby
<fowl>
sacarlson, look for some way to contact the gedit devs
<Synthead>
how do I iterate through all files (not directories) in a directory?
<fowl>
Synthead, you're going to get directories in the list, sort it out with File.directory?
<fowl>
Dir['*'] or Dir.entries('.')
<sacarlson>
fowl: I'm not sure the gedit devs and gedit plugin devs are in the same group but I'll keep tring wether it be gedit or not
<vdv>
apeiros_, seems with popen it's not possible to pass something to called process via stdin
<fowl>
sacarlson, still they would be the most likely to know about this, or maybe someone on #ubuntu
<apeiros_>
vdv: I don't know what docs you read, but that's exactly the purpose of popen
<vdv>
ah sorry
<vdv>
runs the specified command as a subprocess; the subprocess’s standard input and output will be connected to the returned IO object.
<apeiros_>
to be able to write to stdin and read from stdout of a process.
<sacarlson>
fowl: oh wow I had the tab set on the wrong place I thought this was #ubuntu sorry
<Synthead>
fowl: that's the correct syntax for File.file? if I want to check if it's not a file?
<fowl>
Synthead, File.directory? and File.file? are what you need then
<Synthead>
fowl: what?
<fowl>
durr?
<Synthead>
fowl: how can I check if it is not a file?
<fowl>
what did you not understand -- from what i said two times
<fowl>
holy shit guy
<fowl>
are you slow or something
<apeiros_>
Synthead: fowl told you how
<fowl>
i'll write your code for you, 30$/hr is the going rate
<Synthead>
fowl: do I use ! File.file? ? I don't want to use File.directory? because not all items on a filesystem that aren't files are directories.
<apeiros_>
fowl: I hope you at least bill only full hours…
<apeiros_>
don't know why you do > 2&>, don't know why you'd use /dev/zero either
<vdv>
ok, thanks :)
chico has joined #ruby
Sailias has joined #ruby
strife25 has joined #ruby
td123 has joined #ruby
tommyvyo has joined #ruby
richardlxc has joined #ruby
bgfbghnbgh has quit [#ruby]
Drewch has joined #ruby
Eldariof-ru has joined #ruby
sbanwart has joined #ruby
tomzx has joined #ruby
tommyvyo has joined #ruby
zeroeth has joined #ruby
fr0gprince_mac has joined #ruby
richardl1c has joined #ruby
Squarepy has joined #ruby
d34th4ck3r has joined #ruby
Squarepy has joined #ruby
guardian has quit [#ruby]
kpshek has joined #ruby
vereteran-x has joined #ruby
askTheUser has joined #ruby
geekbri has joined #ruby
linoj has joined #ruby
moshef has joined #ruby
Yu\2 has joined #ruby
seanstickle has joined #ruby
sbanwart has joined #ruby
mstratman has joined #ruby
nacengineer has joined #ruby
theRoUS has joined #ruby
pu22l3r has joined #ruby
EvanR has joined #ruby
EvanR has joined #ruby
vereteran has joined #ruby
sacarlson has joined #ruby
crankycoder has joined #ruby
pu22l3r_ has joined #ruby
mdhopkins has joined #ruby
crankycoder has joined #ruby
Bauer has joined #ruby
Sailias has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
bgfbghnbgh has joined #ruby
frontendloader has joined #ruby
<any-key>
I need to create a /dev/one
looopy has joined #ruby
<any-key>
Okay, so say I want to use pry as a replacement for script/console in a rails 2 app
<any-key>
but I don't want to add it to my gemfile, since my coworkers wouldn't appreciate that
RORgasm has joined #ruby
<any-key>
is there a way I can make that happen?
pu22l3r has joined #ruby
<fowl>
any-key, ask in #pry
<any-key>
it's more of a bundler question, I suppose
<any-key>
but I'll hop over there
<fowl>
any-key, why do you think you coworkers wouldn't appreciate pry? :)
dfibre has joined #ruby
lorandi has joined #ruby
<any-key>
hehe we have a fairly large gemfile...I'm an intern so I don't really get the freedom to add dependencies without consulting with a bunch of peoples :P
kevinbond has joined #ruby
<fowl>
ah
<fowl>
lol @ RORgasm
<fowl>
thats a fan
gtuckerkellogg has joined #ruby
Teomari has joined #ruby
bgfbghnbgh has quit [#ruby]
alx- has joined #ruby
kennyd has joined #ruby
kennyd has quit [#ruby]
rbanffy has joined #ruby
zeroeth has joined #ruby
sgmac has joined #ruby
brngardner has joined #ruby
krusty_ar has joined #ruby
sectionme has joined #ruby
sgmac has quit [#ruby]
dv310p3r has joined #ruby
chson has joined #ruby
Kiall_ has joined #ruby
bbttxu_ has joined #ruby
RORgasm has joined #ruby
axl_ has joined #ruby
frontendloader has joined #ruby
thone has joined #ruby
<msch>
what's the canonical way to fix this rake issue? i remember having it all the time in the past, now it seems it's back: .rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/rake/version.rb:2: warning: already initialized constant VERSION
netrealm has joined #ruby
sahli_ has joined #ruby
<JohnBat26>
I am developing ruby and rails applications and want to use good logging gem. What do you can advice me ?
mikeycgto has joined #ruby
mikeycgto has joined #ruby
sahli_ has joined #ruby
dbgster has joined #ruby
<twinturbo>
hey
<twinturbo>
if I start a new Thread and I don't join back to the parent, will the child be killed when the parent exits?
fudanchii has joined #ruby
hrs has joined #ruby
nif has joined #ruby
phantasm66 has joined #ruby
niku4i has joined #ruby
dfamorato_ has joined #ruby
<apeiros_>
twinturbo: ruby only waits until the main thread is finished
<apeiros_>
other threads will be just killed when the main thread is finished
zakwilson has joined #ruby
dfamorato has joined #ruby
emmanuelux has joined #ruby
surfprimal has joined #ruby
td123 has joined #ruby
headius has joined #ruby
dfamorato_ has joined #ruby
mdw has joined #ruby
mikepack has joined #ruby
dql has joined #ruby
barometz has joined #ruby
sinusss has joined #ruby
flagg0204 has joined #ruby
andrewhl has joined #ruby
sinussss has joined #ruby
pen has joined #ruby
apeiros_ has joined #ruby
wataken44 has joined #ruby
froy has joined #ruby
barometz has quit [#ruby]
kvirani has joined #ruby
abstrusenick has joined #ruby
mikepack_ has joined #ruby
sinusss has joined #ruby
pastjean has joined #ruby
luckman212 has joined #ruby
luckman212 has joined #ruby
nricciar has joined #ruby
KL-7 has joined #ruby
statarb3 has joined #ruby
rippa has joined #ruby
natemcguire has joined #ruby
nlc has joined #ruby
Drewch has joined #ruby
<vdv>
i do following call of popen: IO.popen("sox -t mp3 - -t mp3 - silence 1 0.1 -40d reverse silence 1 0.1 -40d reverse", "w+")
<vdv>
sox command supports in data on stdin and out data on stdout
<vdv>
i've tested command separately
mikepack has joined #ruby
<vdv>
and i become output if i pipe input
<vdv>
but IO.open returns empty
chimkan has joined #ruby
<vdv>
i.e. after data = IO.popen(), data is empty
<Mon_Ouie>
I think I lost you at "i become output"
<Mon_Ouie>
popen returns an IO object when you don't pass a block to it
<Mon_Ouie>
(Or it raises an exception)
<vdv>
replace become with get
sgmac has joined #ruby
<Mon_Ouie>
Ah
sgmac has quit [#ruby]
<vdv>
Mon_Ouie, but how can i get contents of stdout?
<Mon_Ouie>
You can't read from stdout : it's a write-only stream
<vdv>
ah, i forgot read
<Mon_Ouie>
Oh, or do you mean read the output of the command you called?
<Synthead>
I'm doing a lot of string comparison, and it's pretty unreadable having a one-liner of this or this or this or ... you get the idea. can I break this up into multiple lines?
adeponte has joined #ruby
<adac>
nw, let me try this out :)
luckman212_ has joined #ruby
<fowl>
Synthead, if you leave the expression open (&& ||, something like that) you can just carry over to the next line
<Synthead>
fowl: ah, that did it. I was trying 'or' right after a newline before :)
<Synthead>
thanks!
fayimora_ has joined #ruby
n1x has joined #ruby
joaoh82 has joined #ruby
<adac>
nw, yes its basically about the url. Works like a chanrm! Thank you now i becomes clearer to me
<adac>
*it becomes
SegFaultAX|work has joined #ruby
<fowl>
Tachyon, more important than it taking X time
<fowl>
is that you close your files
<Tachyon>
O.o
<fowl>
you aren't right there
<fowl>
File.read() or File.readlines() is what you want
<fowl>
unless you plan on doing f = File.open; f.read(); f.close
<Tachyon>
ok
<Tachyon>
i try it
<workmad3>
fowl, or File.open() do |f|; f.each do |...|
<fowl>
yes
<fowl>
using a block with File.open will close it for you also
<Tachyon>
the file has 151 000 lines
cwang has joined #ruby
<fowl>
it takes 4 seconds to complete? doesnt seem too bad to me..
<Tachyon>
it seems absolutlely totaly horrific
<Tachyon>
the file has 15 mb
williamcotton has joined #ruby
<workmad3>
tachyon: 15mb is a lot of text data to process
<Tachyon>
O.o
<Tachyon>
i'll try c program to process it
<Tachyon>
i doubt it'll take more than a milisecond
cespare has joined #ruby
<Tachyon>
hm
<Tachyon>
actually 0.5 second is minimum according to my disk speed
rking has joined #ruby
rking has joined #ruby
wmoxam has joined #ruby
\1gn0tus has joined #ruby
<Tachyon>
exactly what i expected
<Tachyon>
hm
<Tachyon>
maybe not mmnt
flaggy has joined #ruby
<fowl>
well gl with that
<fowl>
idk why anybody would say "i cant spare these 4 seconds, gotta rewrite in c"
\1gn0tus has quit [#ruby]
<fowl>
but have fun lol
sohocoke has joined #ruby
<workmad3>
tachyon: assuming you get max throughput, and don't forget that you're dealing with more overhead in ruby than just plain string processing... 151000 lines means that you're creating 151000 string objects to start with, plus an extra 4 or so per line...
<workmad3>
tachyon: you could look at using something like the CSV lib with a tab delimiter to read the file btw
<Tachyon>
so it is the speed of ruby
<Tachyon>
hmm
<Tachyon>
csv could do that
<Tachyon>
i'll try it
<Tachyon>
thanks
<workmad3>
tachyon: it's not the 'speed of ruby', it's understanding what's happening... and what's happening is that you're creating massive amounts of objects, which has overhead
Teddy2steper has joined #ruby
<Tachyon>
i'm not much used to it
<Tachyon>
i hoped that there is some clever oraculum that knows that these objects are temporary and optimize it somehow
<workmad3>
tachyon: and don't forget that you're doing about 300000 string comparisons there too, which aren't the cheapest operations in the world ;)
<Tachyon>
well i used to have there regex
<Tachyon>
and the speed was comparable
Ionic has joined #ruby
<Tachyon>
the main bottleneck is the loop
<fowl>
you sure about that?
<Ionic>
Hi. I'm having a rather weird and difficult problem
<Tachyon>
File.readlines("tags").each { |line|
<Tachyon>
print line
<Tachyon>
}
<Tachyon>
this is comparable with the previous code
<Ionic>
I'm using ruby via apache httpd and mod_fcgid, but nowadays the interpreter segfaults whenever a script is started
natemcguire has joined #ruby
<Tachyon>
even this is problem
<Tachyon>
File.readlines("tags");
<Tachyon>
so there is bottleneck in the ruby handling the files
<Ionic>
Not sure where to start. As ruby in general is not having any problems and I *can* start an fcgid script via a FcgidWrapper script, I suspect fcgid is doing something wrong, probably spawning the process in a wrong way
<shevy>
Tachyon pls dont make the ;
<Tachyon>
ok :)
<Ionic>
(the wrapper I'm talking about is just a shell script with 'exec /usr/bin/ruby1.9.1 foo.rbx')
<shevy>
File.readlines can become slow if the files are large
nerdy_ has joined #ruby
tommyvyo has joined #ruby
<shevy>
there is a "trick" to read in snippets or something... I remember that manveru used it but I forgot what it was... hmm ... File.read ... in 1024 bytes or something... and repeat something else... hmm hmm hm
<shevy>
helpful what I write isn't it :P
adamkittelson has joined #ruby
<shevy>
trying to remember if I have a snippet
<Tachyon>
shevy: i try some optimalization like that
<shevy>
f.write(tempfile.read(2**16)) until tempfile.eof?
<shevy>
ewwww
<shevy>
that is kinda ugly
ghvandoorn has joined #ruby
<Tachyon>
i try this
<Ionic>
Not sure if you really wanna use 2**16
<shevy>
hehe
<Ionic>
Depending on how ruby handles constant values
<apeiros_>
Tachyon: don't know what you do wrong, but reading 15MB of data takes 0.25s here
cha1tanya has joined #ruby
td123 has joined #ruby
<Tachyon>
apeiros_: and what code do you use ?
<apeiros_>
File.readlines(path)
<Ionic>
if it's really calculating 2^16 "by hand" everytime it gets ugly
<apeiros_>
just as you
<Tachyon>
O.o
<Ionic>
if it's bit shifting... well ok
<Tachyon>
i try it on my server
<Ionic>
if it's bit shifting once and using the constant result, even better
<shevy>
hmm
<Ionic>
well 1 << 16 isn't really a big deal
<apeiros_>
oh, d'oh - sorry Tachyon - I know what I did wrong
<apeiros_>
I wrote 15KB instead of 15MB of data into the file. my fault
aphyr_ has joined #ruby
* apeiros_
tries again
<Tachyon>
:D
<Ionic>
Sorry, I'm uninteresting
<shevy>
Ionic it's ok as long as you are a girl and good looking!
aphyr has joined #ruby
<aphyr>
What's the idiomatic way to remove a method from a class which its superclass defines?
<Ionic>
shevy: I'm a guy, fat and ugly
rtdp has joined #ruby
<shevy>
Ionic I would not know how to solve your problem though, never used Fcgid ... dont have a wrapper script either... and dnot use .rbx myself
<shevy>
Ionic :(
<Ionic>
.rbx is just my personal extension for a ruby fcgi script
<shevy>
aphyr idiomatic hah :D
<Ionic>
could well be just .rb
<shevy>
remove_method(:foo)
pastjean has joined #ruby
<apeiros_>
hm, ok, while writing the file was fast, reading it is horribly slow. that's odd…
<Ionic>
dunno seems like I'll be having a lot of fun debugging mod_fcgid...
<apeiros_>
25s? wtf?
apok has joined #ruby
<Tachyon>
O.o
<Tachyon>
apeiros_: how many lines ?
<Tachyon>
IO.read("tags")
<Tachyon>
this is relatively fast
<bawer>
ionic: this proably isn't helpful, but sometimes good to hear: how about doing it another way? use nginx or passenger+apache or pure thin?
<apeiros_>
Tachyon: I wrote 60 chars per line
<apeiros_>
so around 256000
<Tachyon>
hmm
<apeiros_>
s/around/exactly/
<apeiros_>
and it took 25s with File.read. I interrupted File.readlines
<apeiros_>
that's unreasonably slow…
<fowl>
lol
<fowl>
i said you should be happy with 4 secs :)
CrazyGangster has joined #ruby
<shevy>
yeah
zakwilson_ has joined #ruby
<apeiros_>
this is an SSD, so the storage media shouldn't be the limiting factor
<bawer>
IO.readlines: "Reads the entire file specified by name as individual lines, and returns those lines in an array. Lines are separated by sep."
DPP has joined #ruby
<apeiros_>
hm
<Tachyon>
apeiros_: i have faster code i think
<apeiros_>
ok, this makes it even odder - I ran the same code via `time ruby -e`, and there it took 0m0.204s
<apeiros_>
what in the world would make it so much slower in irb?
<bawer>
how are you guys measuring the code?
nfluxx has joined #ruby
schaerli has joined #ruby
<Tachyon>
apeiros_:
<Tachyon>
lines=IO.read("tags").split("\n")
<Tachyon>
lines.each { |line| print line+"\n" }
<apeiros_>
bawer: in irb using Benchmark.measure to get both, real and cpu time
<apeiros_>
bawer: and outside irb: `time ruby -e`, as said
<Tachyon>
this goes about 1 sec
c0rn has joined #ruby
<DPP>
I'm having issues getting net/http to use https.
<DPP>
i'm setting a Net::HTTP object to use_ssl=true but then the request returns with " wrong status line: "
<DPP>
Net::HTTPBadResponse from deep within http.rb
<apeiros_>
oooh… my… I forgot my bench{} method has a default of 1000 runs :-S
<apeiros_>
shiit, stupid :)
mxweas_ has joined #ruby
<Tachyon>
:DD
<bawer>
Tachyon: how about IO.foreach("tags","\n") { |t| puts t}
<DPP>
I can see that it is asking for a non SSL connection on 443, which is... wrong.
<apeiros_>
I thought my pbench & mbench used that default and that bench was raw with a single run… my fault. so: now with the file being cached, I'm at 0.02s for File.read
<fowl>
lol apeiros_
<Tachyon>
bawer: it is slow as before
<apeiros_>
and 0.18s with File.readlines
<Tachyon>
ok i'm going to test it no my server
<Tachyon>
apeiros_: what is the syntax of bench ?
<apeiros_>
fuck, 2 fuckups in a benchmarks… first only 15KB, then wrong number of runs :)
<apeiros_>
Tachyon: you don't have bench. You can use `require 'benchmark'; Benchmark.measure { …code… }`
riyonuk has joined #ruby
<shevy>
wait what are you testing now
<shevy>
IO.foreach ?
<riyonuk>
Can I not do puts "You have" + method() + "pieces of cake"?
natemcguire_ has joined #ruby
<shevy>
riyonuk __method__.to_s I think or #{__method__} or something like that but if you mean any method() then also, just return a STRING
<fowl>
riyonuk, what do you expect that to do
<apeiros_>
hm, gist can't mark lines like rest of github can? too sad…
* apeiros_
just noticed that this irbrc has an older def of password…
<apeiros_>
the newer definition returns a String whose inspect returns "[PASSWORD]"
<apeiros_>
so it doesn't show up in irb :)
<fowl>
irbrc, how ruby 1.8
<fowl>
hyuck hyuck hyuck
<apeiros_>
fowl: yeah, I started using pry
<shevy>
long live ruby 1.8 !!!
<apeiros_>
just gotta move a couple of things from my irbrc
<riyonuk>
To run the method, since it returns a number
<riyonuk>
:/
<shevy>
riyonuk so what
<shevy>
method().to_s
<riyonuk>
I just keep getting undefined method
<shevy>
then this method does not exist!
<fowl>
stty -echo, why didnt i think of that
matt312 has joined #ruby
<riyonuk>
It does!
<riyonuk>
It's below the code
<fowl>
i had some getch() loop that put ansi codes so it erased input >_>
<shevy>
riyonuk what code. I dont see any code.
<riyonuk>
I dont' want to show it to the public. It's not ready D:
<fowl>
riyonuk, you can't do puts "sup #{coolmethod}" without coolmethod already defined
<riyonuk>
but it's defined below it?
brngardner has joined #ruby
<fowl>
yeah
<riyonuk>
it has to be before?
<riyonuk>
Ughhh
<shevy>
riyonuk try it
<shevy>
if it works, then you answered your question :>
<riyonuk>
do people just put all their methods at the top?
joaoh82 has joined #ruby
<fowl>
riyonuk, what do you expect, coolmethod doesnt exist at that point
<shevy>
riyonuk, nah usually not
<riyonuk>
I thought that was only with C++ >.>
<shevy>
they go like
<shevy>
class Fo
<shevy>
def whatever
<riyonuk>
I'm bout to rage.
<shevy>
def yada
<fowl>
since you can define/redefine methods as see fit, yeah riyonuk
My_Hearing has joined #ruby
<Tachyon>
apeiros_: bawer: shevy: workmad3: It mus be the windows implementation of ruby. In linux server with the same file there is no performance problem.
<bawer>
aaah.. gotta love winblows
<shevy>
apeiros hehehe :D -> # Ok, I usually hate that and prefer plain requires, but due to begin/rescue for each of it, I'll do it this
<Tachyon>
maybe 64 bit windows virtualization is messining it up
<Ionic>
wtf...
<bawer>
Tachyon: could be that
<Ionic>
This is fucking bullshit
<shevy>
\o/
<fowl>
" 64 bit windows virtualization" god that sounds scary
<Ionic>
If I start httpd -X -f debug_config my fcgid stuff is working fine
<shevy>
I got 63 bit virtualization
<shevy>
one bit got dropped
<Tachyon>
64 bit windows virtualization of 32 bit environment
<shevy>
Ionic, problem solved!
<Ionic>
shevy: ... no
<Ionic>
shevy :/
Russell^^ has joined #ruby
wyhaines has joined #ruby
<riyonuk>
Looks like it worked if I moved the method up
<apeiros_>
shevy: whot?
<riyonuk>
okay, with that said, is there a ruby equiv of a prototype?
<riyonuk>
I like my functions at the bottom :
<fowl>
riyonuk, generally your CLASSES are in separate files and included
<fowl>
but if you want to have bare methods, do the same thing
<shevy>
apeiros_ from your irbrc hehe
<fowl>
s/included/required
<riyonuk>
and can this only be variables? #{}?
<riyonuk>
Can we do #{method}?
<shevy>
Can we kill riyonuk?
<fowl>
riyonuk, its more like #{expression}
<riyonuk>
:<
<shevy>
methods man, methods!
<fowl>
ie "#{puts 'hi'; x = 4; x * 2}"
<shevy>
and "prototype", it depends what you need. a Struct could help
<apeiros_>
shevy: ah
<riyonuk>
shevy: Oooooh, I thought that was only for string interpolation
<aphyr>
Any tax stuff y'al
<aphyr>
™¡™££
<riyonuk>
That's what the guy from Gowalla told me :/
<shevy>
record = OpenStruct.new; record.name = "John Smith"
<fowl>
riyonuk, you can literally do anything in there, "#{"#{"oh hi there"}"}"
<iury3>
i started reading that one but got bored in the middle with all the side storys
<shevy>
Spaceghostc2c, well there still will be documentation. But it will be terse, and to the point. And I'll always have a tutorial how to use my things
<shevy>
but up to now... I kinda was documentating every method
<aphyr>
iury3: That's when you turn to the pickaxe book
<shevy>
# Read file content into @foo
<shevy>
def read_file_content
<shevy>
:\
<Spaceghostc2c>
shevy: You should just make only the methods you intend people to use public method.
<shevy>
hmm
<Spaceghostc2c>
Then only document those.
<Spaceghostc2c>
Write us a haiku as well.
<shevy>
lol
tomaw has joined #ruby
iury3 has quit [#ruby]
savage- has joined #ruby
foysavas has joined #ruby
mrsolo has joined #ruby
RubyRedGirl has joined #ruby
RubyRedGirl has joined #ruby
pen has joined #ruby
mikeric has joined #ruby
kpshek has joined #ruby
bigdc1 has joined #ruby
mxweas_ has joined #ruby
ghanima has joined #ruby
jakky has joined #ruby
jhowarth has joined #ruby
jhowarth has quit [#ruby]
sacarlson has joined #ruby
Eldariof59-ru has joined #ruby
mbreedlove has joined #ruby
rking has joined #ruby
thoradam has quit [#ruby]
newellista has joined #ruby
rramsden has joined #ruby
mutewinter has joined #ruby
<DPP>
has anyone seen a gem for editing an apache config file?
<DPP>
I've found a few that create them, but I'd rather just have it as a template of some sort
Guest52365 has joined #ruby
Guest52365 has quit [#ruby]
rking_ has joined #ruby
rking has joined #ruby
dhruvasagar has joined #ruby
gurugeek_ has joined #ruby
<shevy>
DPP that seems a very small use case
CoderCR|work has joined #ruby
icecream has joined #ruby
aphyr has quit [#ruby]
<Guest70315>
hi :)
<DPP>
shevy: editing a config without generating from scratch? I wouldn't have thought so
<DPP>
guess i'd settle for any gems that simply templating without doing tedious parsing
<ghanima>
hey guys
<ghanima>
quick question
<ghanima>
how do I create a hash from another hash
<shevy>
DPP yeah I think editing is slightly more complicated than generating a completely new one
<canton7>
ghanima, expand?
<bawer>
ghanima: clone?
gurugeek_ has joined #ruby
<DPP>
I'm way more comfortable doing file parsing in perl than ruby.. not even sure why I wanted to do this in ruby other than being obstinate
startling has joined #ruby
<DPP>
but here I am!
nif has joined #ruby
<ghanima>
bawer: Clone works for what I need thank you
foysavas has joined #ruby
sarmiena_ has joined #ruby
<sarmiena_>
is there a way to write to a fake in memory file?
CoderCR|work has joined #ruby
<shevy>
sarmiena_ not sure. you could use a tempfile in ruby tho
<sarmiena_>
shevy: thanks
<bawer>
sarmenia_: IO.pipe
<sarmiena_>
bawer: thanks
rushainem has joined #ruby
<ghanima>
I am trying to use the Typhoeus gem to do HTTP GET request to an HTTP Auth page and pull metrics from a very generic page. I am trying to construct the following., request = Typhoeus::Request.new('http://xxx.xxx.xxx.xxx:7017',
<bawer>
sarmenia_: like this "r, w = IO.pipe" then you get a read and a write pipe
<ghanima>
I want to the :params => hash to be set from a another hash
<headius>
some of the python benchmarks use numpy too
<headius>
so they're really testing native C libraries, not python itself
<Boohbah>
what a bunch of tards
<bawer>
yeah, that test looks inconclusive
<Pip>
I wish Ruby is the fastest dynamic language among the others
<Boohbah>
well, i am going to rewrite pidigits ruby version today
<Pip>
:D
<bawer>
Pip: what is your usecase?
<apeiros_>
Pip: you should use self then
<apeiros_>
afaik the sun researchers got self quite close to C
chimkan_ has joined #ruby
<Pip>
usecase? just general programming, mostly on math
davidpk has joined #ruby
<havenn>
Pip: require 'mathn'
rushainem has joined #ruby
<Pip>
I heard the Sciruby is under development, right?
enroxorz has joined #ruby
<Boohbah>
headius: gmpy used in pidigits.py is also a C library
<headius>
yeah, so there's the problem with the shootout
<headius>
the jruby version could just call Java library to do shit too, but that's not useful
pingveno has joined #ruby
<apeiros_>
I think it'd be nice to have 2 benches for each language
<apeiros_>
one limited to core/stdlib
Sailias_ has joined #ruby
<apeiros_>
and one where you can use everything you can
macmartine has joined #ruby
deception_ has joined #ruby
<TTilus>
its gonna be "flawed" nevertheless
gomix has joined #ruby
robdodson has joined #ruby
<apeiros_>
there's no such thing as a perfect benchmark
<bawer>
yes, but there should at least be tests that do it closer to "as good as possible" than the one's we see
<apeiros_>
but at least you get an idea
<apeiros_>
there's also the difference between highly optimized native code vs. idiomatic native code
<apeiros_>
but who decides what idiomatic code is?
<bawer>
at the end of the day most of the lag in software that I need to write comes from the fact of actual physical bit's flying around the world and the waiting for them to make their roundtrip :)
<apeiros_>
I mean at the company, we've some code in the ETL part which is quite ugly, but it performs good
tatsuya_o has joined #ruby
mattyoho has joined #ruby
<TTilus>
shootout is a noneven and unfair comparison of a great number of random and partly irrelevant factors to the performance of a code snippet ... and damn great fun to read and argue about
tatsuya_o has joined #ruby
mattyoho has joined #ruby
<bawer>
yep, prefereably while drinking beer
gurugeek_ has quit [#ruby]
simao has joined #ruby
* TTilus
prefers tea
<bawer>
each to his one, I guess. :)
gomix1 has joined #ruby
<TTilus>
good beer will do too, sure
melba has joined #ruby
<bawer>
each to his own? that's what I meant :)
* bawer
thinks ruby is pretty
trivol has joined #ruby
cousine has joined #ruby
chico has joined #ruby
nlc has joined #ruby
<shevy>
hmm
<shevy>
if I have... module Foo; def bar ...
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
<shevy>
and when I require that code ... I want to kinda treat this file as if "def bar" has been defined without being in module Foo namespace
<shevy>
so that require automatically would mean include or extend
<shevy>
(it's a one-method file. I am deciding whether it should be within a namespace or without right now.)
<shevy>
ah screw it. one method, no namespace. is simpler.
<Boohbah>
going to rm -rf $GEM_HOME and install rvm now
<shevy>
Pip now that looks like a sane path to me
<any-key>
router: you can code ruby on any platform
<router>
on windows?
<shevy>
router the rails folks, lot of them use a mac
<any-key>
yes
<Boohbah>
even windows
<shevy>
but linux is more fun!
<any-key>
for best results use OS X or linux
<deception_>
Anyone here used Xvfb. About to take a stab at setting it up to run headless web app testing
<Boohbah>
shevy += 1
<any-key>
but it works just fine on windows
<matt312>
linux since you're most likely to deploy to linux
<router>
why is it best results ot use osx or linus
<Boohbah>
router: because ruby was developed on linux
<any-key>
don't program on Linus, he may not appreciate that :P
<Pip>
shevy, very complex
<Boohbah>
and it is usually deployed on linux servers
<router>
does it matter?
<any-key>
router: they're equal as far as I'm concerned
<shevy>
matt312, well, all my ruby scripts will work on windows too (with perhaps 0.5% of them needing SMALL modifications i.e. path related things, or they only work on linux actually... but very small part altogether)
<any-key>
router: linux or OS X will work great
<kjg>
Is there a known issue with 1.9.3p125 installed via rvm on Lion and UTF-8 not working?
<matt312>
shevy agreed, its that .5% that can waste time
<Boohbah>
not sure, i don't have a Lion
<shevy>
I have a Panther
<matt312>
and windows lacks a unix shell
<shevy>
in my pants!!!
<matt312>
which makes it worhtless
<shevy>
matt312, true, but you can use msys, all bash aliases will work, most unix commands will work too
<Boohbah>
matt312: but what about PowerShell? :)
<shevy>
though I think MSYS kinda died. I hate cygwin :(
Radium has joined #ruby
<matt312>
imo, not the same shevy & boohbah
<matt312>
but to each their own
<shevy>
powershell I dont know
Radium has joined #ruby
<any-key>
kjg: unicode seems to work here
<shevy>
msys is ok though
<shevy>
but windows as a whole goes on my nerves
<RubyPanther>
by that logic, linux lacks a "unix" shell too
<any-key>
linux is technically not posix compliant
<matt312>
:P
<RubyPanther>
linux and windoze are both (technically? wtf that does that mean) POSIX compliant
<any-key>
but it uses all the POSIX apis
<any-key>
windows is not posix compliant...
<any-key>
hmm
<RubyPanther>
Oh yes it is, and their POSIX compliance is what got them accepted for highly secure government installations. (true story)
<kjg>
any-key: hm. When I type a unicode charater just outputs the the escaped values for me "\U+FFC3" I wonder if I'm missing a dependency of some sort
<shevy>
"Without these features, they are usually noncompliant."
Radium has joined #ruby
<any-key>
kjg: did you use .inspect or p to output it?
y3llow has joined #ruby
s0ber has joined #ruby
wyhaines_ has joined #ruby
<RubyPanther>
If you actually read those links and understand what POSIX is, it is not a checklist on wikipedia. Windows is as compliant as any of the modern *nix OSes that are broadly considered "POSIX" such as Linux, FreeBSD, Solaris, etc
<kjg>
any-key: nope. Just Typing it on the keyboard for example opt-r for registered symbol shows up as escaped values in irb prompt. And then putting it in quote just returns an empty string
<any-key>
hmmm
<any-key>
I'm not sure
<Boohbah>
RubyPanther: are you serious?
<RubyPanther>
Are parts of it optional and not always installed? Yeah, that's true on AIX too
linoj has joined #ruby
andrewhl has joined #ruby
deception_ has quit [#ruby]
<RubyPanther>
I've been using only *nix since the 90s. I am indeed serious about *nix. POSIX is.
<shevy>
yeah Afal I see you are an attentive reader :)
<RubyPanther>
And literally, like a decade or more ago, Windows got certified for various "secure" government installations. That stuff is why NT4 started adding POSIX in the first place. Without Windows POSIX we never would have seen an aircraft carrier dead in the water because it blue-screened
Radium has joined #ruby
schaerli_ has joined #ruby
Radium has joined #ruby
luckman212_ has joined #ruby
robdodson has joined #ruby
Radium has joined #ruby
y3llow has joined #ruby
<kjg>
any-key: so doing puts [174].pack('U*') outputs the correct symbol, but just typing opt-r or copying and pasting to the irb prompt outputs escaped values. p0 works as expected. -head also seems to not work for me
Radium has joined #ruby
<any-key>
better than nothing
Urthwhyte has quit [#ruby]
luckman212_ has joined #ruby
chico has joined #ruby
<kjg>
haha
<Divinite>
RubyPanther: And that's why Linux is here.
<any-key>
the NT kernel is really robust
<Pip>
weird
<any-key>
having a microkernel will do that
y3llow has joined #ruby
<shevy>
a microrubykernel
<any-key>
but if you layer nothing but shit on top of that it's not going to be very good :P
<RubyPanther>
a kernel better be robust, that is a rather small compliment
gen0cide_ has joined #ruby
<Boohbah>
my methane gas output is also really robust
gomix has joined #ruby
<shevy>
but it's bacteria that produce it, not you!
<Boohbah>
shevy: where do i draw the line between me and bacteria? if i need the bacteria to survive, are they not part of me?
<RubyPanther>
You don't need them to survive, it is just more pleasant with them
Radium has joined #ruby
<Divinite>
RubyPanther: You do need bacteria to survive.
<any-key>
is this a channel of biologists all of a sudden?
<shevy>
well he is kinda right, if all bacterias would be dead, we couldn't digest food
<Boohbah>
Pip: so, you removed rubygems and now you're trying to use it?
* Boohbah
so confused
<RubyPanther>
it is a channel of idiots who read some trivial pursuit, apparently. Some people actually have their bacteria killed off or have to take drugs to suppress them. It isn't deadly, but it certainly changes how you plan your diet.
<any-key>
Boohbah: I fucking told him not to
Radium has joined #ruby
<any-key>
but nooooooo
<Pip>
I removed ruby and manually removed the entire directory /usr/lib/ruby
<Pip>
And reinstalled ruby
Radium has joined #ruby
<Divinite>
In the beginning there was a word. The word was....
<Pip>
And got this
<Boohbah>
Pip: why did you do that?
<Divinite>
Ruby
<any-key>
because I said the opposite
Radium has joined #ruby
Radium has joined #ruby
<Pip>
Boohbah, I wanted to clean everything
<any-key>
Pip: you should really really really set up rvm
<Boohbah>
Pip: that was not the right way to do it
<Pip>
:S
Radium has joined #ruby
bglusman has joined #ruby
<Pip>
So what's going on on my computer?
<shevy>
Pip why did you keep gem?
<Pip>
it's messed up?
<Boohbah>
who knows? you are doing strange and unsupported things to it
<Pip>
shevy, some gems are shipped with ruby
<any-key>
yes, you'll need to purchase a new one
<shevy>
Pip no
<any-key>
Pip: install rvm
<any-key>
NOW
<Pip>
How?
<Divinite>
Or die.
<shevy>
oh
<any-key>
it will let you install/uninstall versions of ruby all day long
<Pip>
:D
<shevy>
you use 1.9.x so gem is part of your ruby version
<shevy>
lectrick completely regular syntax, often found in .rb files too
<Pip>
I don't believe that
<shevy>
but I dont like it, visually
<Pip>
This is science
<bawer>
letrick: yes, it's metaprogramming..
<Pip>
God doesn't play dies
<shevy>
dies?
<any-key>
class Foo << self creates a class with only class methods, correct? I don't run into that pattern very often
<shevy>
one die... many dice?
<lectrick>
shevy: I know, but if it's regular ruby then how can you append self to whatever the keyword "class" refers to? Or is << defined on class Class? I'm so confused
<banisterfiend>
you could always apply for nick sponsporship: ap[buy_coke]eiros
luckman212 has joined #ruby
<lectrick>
I have a Regexp with an .encoding of US-ASCII but I am trying to use it on a string with a different encoding that is not UTF-8, how do I force it/
<lectrick>
?
apok has joined #ruby
ScottNYC has joined #ruby
decaf has joined #ruby
brngardner has joined #ruby
luckman212_ has joined #ruby
<lectrick>
Figured it out. Have to add a /u switch to the end of the regex to make it utf8. Is there any way to tell Ruby to assume all code is UTF-8 without adding # encoding: UTF-8 to the top of each and every file?
<matti>
Mon_Ouie: Haha ;-)
dwon has joined #ruby
<ScottNYC>
whats the p0 mean in ruby 1.9.3 p0?
luckman212 has joined #ruby
<ScottNYC>
I see all the versions have it
<banisterfiend>
ScottNYC: patch level
<apeiros_>
lectrick: no sane one, no
<apeiros_>
using the encoding comment is IMO the best thing to do.
<rking>
Hrm. How important is the behavior of ruby -w / $VERBOSE = true? In Perl it's pretty much non-optional.
robbyoconnor has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
looopy has joined #ruby
runix__ has joined #ruby
eka has joined #ruby
ConstantineXVI has joined #ruby
<runix__>
heyas. I have a response string from an API, it's encoded as ASCII-8BIT. I would like to log it for debug purposes, but my logging string is in UTF-8 (Padrino.logger.debug "Result #{response}") and I'm getting an encoding error. how can I do to log this?
Boohbah has joined #ruby
r0bby has joined #ruby
entrenador has joined #ruby
<rking>
runix__: Maybe this questionable-sounding answer will get someone who knows to come out of the woodwork and say, "NOoo!1 Do it this way!" ... but you can call "asdf".force_encoding('UTF-8') on the ASCII string, and I can't imagine what harm would come of it (since ASCII is a subset of UTF-8)
voodoofish4301 has joined #ruby
r0bby_ has joined #ruby
<Pip>
er...let me guess, rubygems.org is written in ruby right?
* rking
hopes it's written in PHP.
<canton7>
asp! come on, it's got to be asp
niku4i has joined #ruby
looopy has joined #ruby
<shevy>
ewww
<rking>
Pip: I don't know Rails well enough to say for sure, but it does seem to have a few tell-tale signs in the HTML source.
<shevy>
the design looks typical rails design
<shevy>
so I think it is written in rails
<rking>
Hehe... shevy, what does that even mean?
<rking>
A web page... with links and stuff. === Rails.
<Pip>
fair enough
<shevy>
well if you look at 100 different rails sites
<shevy>
they share some common patterns
<rking>
Such as?
<shevy>
and it really looks extremely close to all those patterns
<rking>
canton7: Maybe it's something about your ISP/IP.
max_ has joined #ruby
r0bby_ has joined #ruby
<shevy>
oh
<shevy>
chrome :D
snip_it has joined #ruby
<canton7>
ooh I think I know. For a cryptography courswork we had to try and find a site with a key which was vulnerable to that debian openssh vulnerability from a while back. I made a bot and set it loose findign domains. I think it may have found yellowpages...
<rking>
Ahh, wow.
<rking>
That's a cool course.
<canton7>
aye, it's dastardly hard, but fascinating. I did put a max-number-of-pages-per-domain limit on the thing to stop it getting caught on sites like that, or google. Looks like it was too high
<canton7>
awesome rejection page, anyway
pting has joined #ruby
<rking>
I like that it ambiguously says "one of" the 3 laws. Not saying which.
r0bby_ has joined #ruby
<canton7>
and my bot was following orders, and didn't harm anyone *innocent*
<canton7>
unless a member of yellowpages staff gets shocked every times there's a page view
nari has joined #ruby
<VegetableSpoon>
collateral damage
moshee has joined #ruby
moshee has joined #ruby
maahes has joined #ruby
wyhaines has joined #ruby
<lindenle>
Hi guys, what version of ruby do i need for rubygems?
r0bby_ has joined #ruby
gurugeek_ has joined #ruby
<gurugeek_>
anyone knows a good lib to write on an .ods open office spreadsheet? thanks
<bawer>
lidenle: it should work for any ruby? it's actually bundled with 1.9.x.
<lindenle>
<bawer> 1.8.1-7? On rhel4? Do I just need to install it?
<gurugeek_>
rking: I need to be able to insert data inside the .ods file :X
<rking>
gurugeek_: Yeah, write is always harder than read.
<rking>
gurugeek_: Can you get away with reading it via roo then writing as .csv?
<rking>
The roo.rubyforge.org background is... unique.
zeroeth has joined #ruby
<gurugeek_>
rking: I guess but doesn't really help no ? :)
<rking>
gurugeek_: I don't know what you're trying to do. OO.o will easily import .csv files.
<rking>
In fact I wouldn't be surprised if you could do something wily like save CSV as .ods
<rking>
Or else invoke oocalc or whatever on it.
<rking>
gurugeek_: The only reason why I'd expect the CSV idea to fail is if you needed to do stuff beyond what CSV supports, like fancy formatting.
<gurugeek_>
rking: thanks a lot for the hint… just I would need to use the .ods somehow like a db so if I pass through csv to write it makes it a bit complex but I guess it cannot be done easily :S
<gurugeek_>
rking: will try to save on google spreadsheet..even thou it would be slower at least it does write on it :)
<rking>
gurugeek_: Also, OO.o is scriptable, so you could write a layer that farms out to your Ruby and back.
<rking>
gurugeek_: But the Google Spreadsheet idea sounds fine to me.
dv310p3r has joined #ruby
<gurugeek_>
rking: out of interest which mvc do you use ?
<gurugeek_>
rking: do you do freelance jobs? :P
<gurugeek_>
rking: yes google spreadsheet works very well…can't find out how to search inside it yet but I will get there I guess
<rking>
gurugeek_: If you knew the details of my day job you would laugh. Basically I'm using the next few months to get back into programming full-time.
andrewhl has joined #ruby
<gurugeek_>
rking: hehe well you are very helpful so I am sure I wouldn't laugh !
<rking>
gurugeek_: I'm a soldier in the U.S. Army, Infantry. =)
<gurugeek_>
rking: wow that's so cool
<gurugeek_>
rking: respect really for being able to do so many things well :)
<rking>
\o/ <-- j/k. =)
r0bby_ has joined #ruby
icy` has joined #ruby
icy` has joined #ruby
danielvdotcom has joined #ruby
<rking>
Wow. xnee just changed my life a bit.
<rking>
Even for something as simple as automating the save-switch-to-browser-reload loop.
baroquebobcat has joined #ruby
<lindenle>
So if require is not working in puppet, is that because I dont have ryubygems installed?
<lindenle>
bawer: no go in ruby 1.8.1...
<VegetableSpoon>
looks pretty cool indeed
<VegetableSpoon>
I'll bookmark that
Emery has joined #ruby
<Emery>
Having a problem with a blog i'm working on, can't figure out where i've gone wrong. http://pastebin.com/09EkMbs6 .. Any ideas ?
bglusman has joined #ruby
chico has joined #ruby
nopolitica has joined #ruby
<canton7>
aha, this is presumably the fallout from the rails vulnerability which was used on github
chico has joined #ruby
Emery has joined #ruby
<nopolitica>
cd #net
<Emery>
yeah rails has failed me
<Emery>
can't figure out what's wrong!
<canton7>
I've no idea of the details of how it was fixed, but basically a mass-assignment was used to write to database fields which weren't supposed to be written to
<canton7>
the "fix" looks like it was to stop you mass-assigning to some of the fields
<Emery>
I'll ask in RoR see if I can get some sense
<canton7>
I suspect there's probably a property or somesuch you can set in your model to allow mass-assigning to those fields
<gurugeek_>
shadoi: thanks a lot just I don't get it I have like ws.list() and retuns me an object which is normal. The other method I can't call ws.list(index.hash) will dig further thou