<banister_>
MouseTheLuckyDog: i thought that was the code we were refactoring?
Joeysomo has joined #ruby-lang
Nisstyre has joined #ruby-lang
<MouseTheLuckyDog>
banister_, Tlo ber honest I have serious questions that you actually know what you are talking about. So I'll wait for someone else to answer.
igaiga has joined #ruby-lang
<banister_>
MouseTheLuckyDog: why dont you just try it? :)
<banister_>
MouseTheLuckyDog: it's not particularly difficult to try something out to verify if it works rather than just sitting her speculating
ilyam has joined #ruby-lang
<MouseTheLuckyDog>
You do realise that this is rspec code right. Whether or not it "works" is irrelevant.
<MouseTheLuckyDog>
In fact it shouldn't work at first.
<banister_>
MouseTheLuckyDog: you seem to think 'rspec' code is different to normal ruby code. It's just ruby, what i typed out is metaprogramming to generate 'it' blocks - it's *exactly* the same as if you'd typed out those blocks separately.
<banister_>
MouseTheLuckyDog: if you dont undersatnd that then you're clearly not as good at ruby as you think you are, and you can drop your arrogant condescending attitude. It doesn't befit a noob.
<theconartist>
hehe
max_dev has joined #ruby-lang
<drbrain>
MouseTheLuckyDog: banister_ is right, but I guess he's not going to want to help you anymore
ankurgel has joined #ruby-lang
tomb has joined #ruby-lang
robbyoconnor has joined #ruby-lang
rue has joined #ruby-lang
<erikh>
where's guy ferrari when you need him
<andshevy>
all that testing
r0bby has joined #ruby-lang
Sailias has joined #ruby-lang
<MouseTheLuckyDog>
drbrain, frankly I don't care if he wants to help me anymore. If this is the kind of help I get-- the only solution that would be more brain dead would be %w[aaa bbb ccc].each { |v| it "should blah #{v}" do; arg = v.dup; foo!(arg); arg.should == foo!(arg); end; }
<erikh>
I CAN GIVE YOU QUALITY HELP
<cout>
MouseTheLuckyDog: I don't want to help you either.
<MouseTheLuckyDog>
Which works too. Which was probably his dumbest comment.
<cout>
MouseTheLuckyDog: you're being an ass.
<erikh>
WEAR A RAINCOAT
<erikh>
WASH BEHIND YOUR EARS
<drbrain>
MouseTheLuckyDog: I don't see what's wrong with that, other than that newlines were removed
<erikh>
love your neighbor, but don't love them too much
<erikh>
that could land you in the slammer
<drbrain>
MouseTheLuckyDog: either
looopy has joined #ruby-lang
<MouseTheLuckyDog>
Well mine cannot fail. Any test that cannot fail is totally worthless.
<drbrain>
MouseTheLuckyDog: responding to a solution with such negativity is a sure sign of being an ass
<drbrain>
instead of just "your test cannot fail"
<erikh>
hey now, he just needs help
<erikh>
from ME
<shevy>
remove all tests
<erikh>
I'm a better mother than all of you
<shevy>
just because you are old?!?!
* shevy
hides
<erikh>
shevy: lol
<banister_>
MouseTheLuckyDog: what was braindead about it btw?
<erikh>
I just really want a happy ending for this guy that's never been in here before and demands help that meets his high standards
<shevy>
well
<shevy>
perhaps rspec doesn't make him happy
m0nki3 has joined #ruby-lang
<erikh>
rspec makes the baby jesus cry
lchi has joined #ruby-lang
rippa has joined #ruby-lang
<MouseTheLuckyDog>
banister_, the first thing is that when I look at your tests I wonder why you wrote foo! in the first place instead of just taking the 0 th element in the places I called foo.
burns180 has joined #ruby-lang
<MouseTheLuckyDog>
It's like writing #define BEGIN { in C.
davpoind_ has joined #ruby-lang
<banister_>
MouseTheLuckyDog: i was just copying your test, all i did was abstracted it out into a loop that generated the it blocks
<banister_>
MouseTheLuckyDog: i assumed you were testing whether foo!(arg) mutated arg properly
<banister_>
MouseTheLuckyDog: whch is what your first pastie seemed to imply -- that foo!(arg) mutated arg such that it's truncated to its first character
<banister_>
MouseTheLuckyDog: but in either case, the details of the tests aside, what i was showing you was how to DRY up tests by using a loop to generate similar tests
<banister_>
MouseTheLuckyDog: the dteails weren't so important (though the details of my implemetnation did match the details of your first pastie).
Slackwise has joined #ruby-lang
<MouseTheLuckyDog>
banister_: That's the second thing. One of the biggest criteria for tests is clarity. Metaprogramming in rspec is fine in a sense, but the way you do it reduces clarity.
<MouseTheLuckyDog>
Also clarity is more important then DRY in tests.
<banister_>
MouseTheLuckyDog: that's up to you and your own criteria; when i was generating around 30 tests that were very similar but different i used a metaprogramming approach, and that was fine for me.
<banister_>
MouseTheLuckyDog: if it's not fine for you then you can say that, rather than acting like a spoiled child
<erikh>
hey hey guys
<erikh>
I AM TOTALLY NOT GETTING ENOUGH ATTENTION HERE
<dominikh>
erikh: because you're unloved.
<erikh>
dominikh: i know :(
uniqanomaly has joined #ruby-lang
achiu1 has joined #ruby-lang
<MouseTheLuckyDog>
You further assumed that the way I wanted to mutate foos argument was to replace it by it's first element, which is more of an artifact of the example I showed then the actual structure of foo!.
<banister_>
MouseTheLuckyDog: again, that's just details! i assumed that was what you were testing, big deal!
<MouseTheLuckyDog>
Which you would have realised immediately iof you looked at the second example I posted.
<banister_>
christ you're a bore
<banister_>
forget it
<theconartist>
your name is too long
<dominikh>
banister_: you should be ashamed, not helping him properly.
<MouseTheLuckyDog>
theconartist, get a irc client that allows tab completion of names. or if you want you can just call me Mouse.
dhruvasagar has joined #ruby-lang
gnufied has joined #ruby-lang
<theconartist>
why not change your name to _dog
<theconartist>
_why not*
burns180_ has joined #ruby-lang
<MouseTheLuckyDog>
theconartist, My name is a collection of allusions, to change it would be to change it's meaning.
ryez has joined #ruby-lang
seanstickle has joined #ruby-lang
burns180_ has joined #ruby-lang
igaiga has joined #ruby-lang
<Boohbah>
MouseTheLuckyDog: are you the author of why's poignant guide?
TheMoonMaster has joined #ruby-lang
<MouseTheLuckyDog>
Boohbah: No.
<MouseTheLuckyDog>
Though that is one of the allusion's.
<gray>
so, i can write but i feel like i don't understand...
xiefai has joined #ruby-lang
frangiz has joined #ruby-lang
heftig_ has joined #ruby-lang
xiefai has joined #ruby-lang
WillMarshall has joined #ruby-lang
<gray>
i don't understand WHEN recursive function returns value. Because if function call self, self, self. If returns value each time when call self? or after last call?
<apeiros_>
gray: you'll have a condition at which point you don't recurse
<apeiros_>
gray: the code you have, use a little bit smaller n (maybe 3, or 5)
<apeiros_>
then add a couple of puts to it
<apeiros_>
like puts "before recurring, with n=#{n}"
<apeiros_>
same for after
<apeiros_>
then run it again
xiefai has joined #ruby-lang
<ddfreyne>
gray: take a piece of paper and write the call graph for a small n
<bnagy>
(do fibonacci or factorial, like we said)
lsegal has joined #ruby-lang
xiefai has joined #ruby-lang
burns180 has joined #ruby-lang
xiefai has joined #ruby-lang
<matled>
I try to generate the content of a gz file but Zlib::GzipWriter#close seems to close the io it writes to too, which is a StringIO in my case and therefore loses all its content...
<bnagy>
def recursion_template( arg ); return arg if arg==1; recursion_template(arg-1); end
<bnagy>
see how eventually it will stop recursing because of the boundary condition?
<bnagy>
see if you can write def fibonacci( n ). It should be 2 lies.
<bnagy>
*lines
<rippa>
1 line
<gray>
i don't understand last message, my english bad too
<bnagy>
no, it _should_ be 2, you can write it in 1 less clearly to show off
<gray>
aaaaaa
<gray>
fuck
<bnagy>
;)
<rippa>
bnagy: but ternary is clear
<rippa>
it's not even nested
<gray>
sorry guys, programming it's not for me.
<gray>
now I understand it clearly, thank you for your tyime
<bnagy>
recursion just takes getting used to
<gray>
I spent two days that used to understand the "simple" algorithm, but i don't undrestand. Also ruby it was interesting in the beginning. And now when i think that recursion is simply - i don't want think about hard things
<gray>
also... or you all genius here. or am I completely stupid
<bnagy>
well most of the people here have quite a bit of experience programming - every time you solve similar problems they get burnt a little deeper into your brain
<Elixor>
Hello people, please, can somebody tell me how is possible sort Array where i have instantions of some Class and i need sort them by their some atribut? For examle age? Thanks for help - and sorry for my english :P
<kyrylo>
What a sissy.
<bnagy>
Elixor: read Array#sort_by
<Elixor>
thanks i will try
wubino has joined #ruby-lang
manojhans has joined #ruby-lang
<Elixor>
<bnagy> i tryed and nothing. I dont understand this command... :( ... so, please look at this http://pastebin.com/guwTTg6b - its coppy of my Array and i need sort it by price. Can you show me command for this ?
<Elixor>
<bnagy> i dont have array of strings... i have array of instantions.
<bnagy>
sigh
<bnagy>
stocks.sort_by {|stock| stock.price}
<apeiros_>
Elixor: the common term is 'objects'
<apeiros_>
or better yet, the class of the objects you have
<Elixor>
objects and instantions of some class is same .. or not?
<Elixor>
right .. sorry * i have array of objects. :-)
burns180 has joined #ruby-lang
<apeiros_>
Elixor: well, unless your class is named Instantion…
m3nd3s has joined #ruby-lang
m3nd3s has joined #ruby-lang
<Elixor>
<bnagy> its worked :-) thank you so much
canton7 has joined #ruby-lang
<bnagy>
no problem
<shevy>
you two marry up!
gray has joined #ruby-lang
burns180_ has joined #ruby-lang
shtirlic has joined #ruby-lang
<Defusal>
Exception: Too many open files
uniqanomaly has joined #ruby-lang
<Defusal>
after seeing IO.read and File.read used in many places, i assumed it was safe to use for reading and closing files
<Defusal>
after seeing that exception, i have my doubts :(
<bnagy>
it should be
<Defusal>
i guess i must change all File.read(path) expressions back to open(path, &:read)
<apeiros_>
I doubt File.read caused that
<Defusal>
well what else could?
<apeiros_>
you probably had File/IO.open and didn't close them
<apeiros_>
or you're using a 3rd party lib which does that
<Defusal>
apeiros_, i am not a rookie :/
<bnagy>
IO.read ensures close
<Defusal>
bnagy, that's what i assumed
<apeiros_>
Defusal: that may well be, but there's only so and so many ways to get that exception
<bnagy>
are you threading massively or something?
<Defusal>
the exception was on a File.read line
<apeiros_>
you can use lsof to check what is open
<Defusal>
bnagy, single threaded huge EM-based platform
burgestrand has joined #ruby-lang
<apeiros_>
note that all kinds of filehandles count against that limit (sockets too e.g.)
<Defusal>
hmm
<apeiros_>
EM… that'd make sockets a likely issue
<bnagy>
yeah, check your rlimits
<Defusal>
then that sounds likely
<apeiros_>
you can tell your OS to increase the limits
<Defusal>
as i increased the frequency tcp connections are opened today, strange that EM is not destorying them though
<Defusal>
i wouldnt want to do that
<Defusal>
that would only delay the issue
<bnagy>
I'd ask the #eventmachine guys
<erikh>
you probably have SO_LINGER set too high
<erikh>
I run into this with 0mq stuff.
<erikh>
alternatively, just bump the value with ulimit
<erikh>
if it's your own thing, you can get away with it.
iande has joined #ruby-lang
<Defusal>
erikh, how long do EM connections stick around before getting destroyed usually?
<erikh>
dunno, that's what that socket option is for
<Defusal>
i would assume they're never being destroyed if this is happening
<erikh>
find out what they set it to if anything
<erikh>
use lsof and find out
<Defusal>
yeah i just filtered lsof
<Defusal>
there are a ton of tcp connections being left open
<erikh>
of course
<erikh>
they have a predetermined timeout
<erikh>
you're probably just hitting a barrier because you're allocating too many fd's before they get reaped and reused
<Defusal>
yup
<erikh>
in ruby, that means that ruby has to let go of them, the C extensions (if any) have to let go of them, and SO_LINGER has to say it's ready to move on
<Defusal>
i was wondering why after a number of connections the server it is connecting to was not responding quick enough, perhaps this is why
<erikh>
possible, there is a global high water mark too
<erikh>
I never can remember what it is, always have to look it up. it's a sysctl tunable
<erikh>
you really have to work hard to hit it.
<erikh>
netstat -an will show pages of shit in TIME_WAIT f.e.
<erikh>
this probably isn't that.
<erikh>
err, sorry. the amount of descriptors available for tcp connections isn't tunable IIRC, but the amount of time a socket stays in wait is
<erikh>
(and *that* is tunable via sysctl)
<Defusal>
alright
<erikh>
you could start there if EM doesn't expose SO_LINGER, though.
<erikh>
anyhow, hope this all helps, I think I need to hit the hay
<Defusal>
cool, thanks
<Defusal>
i will dig and see what i find :)
<gray>
C:/Users/lenovo/Desktop/ruby/drafts/hello matz.rb:2:in `gets': No such file or d
<gray>
irectory - 4 (Errno::ENOENT)
<gray>
from C:/Users/lenovo/Desktop/ruby/drafts/hello matz.rb:2
<gray>
code: counter = gets
<gray>
why gets don't works
<gray>
hhhhhhh
Banistergalaxy has joined #ruby-lang
gray has joined #ruby-lang
<bnagy>
works fine for me
burns180_ has joined #ruby-lang
Tukeke has joined #ruby-lang
Tukeke has quit [#ruby-lang]
jxie has joined #ruby-lang
virunga has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<Defusal>
gray
<Defusal>
i think i have experienced that issue myself
<gray>
Defusal: ?
<Defusal>
its strange, as it started occuring in a script that always worked fine
<Defusal>
my only workaround so far is to not pass anything to it via command line
<Defusal>
and then have it gets the input after starting
<Defusal>
sorry i can't tell you anything more, i have far more important things to work on, but if you figure out the cause let me know
<gray>
Defusal: ok, thx
<imperator>
so, it seems if you close the wrong fd, the ruby vm blows up in 1.9.3
<Defusal>
it doesn't make much sense how ARGV can break gets, but since it used to work fine, im even more clueless as to the cause
<shevy>
hmm
ankurgel has joined #ruby-lang
AlHafoudh has joined #ruby-lang
voker57 has joined #ruby-lang
burns180 has joined #ruby-lang
voker57 has joined #ruby-lang
burns180 has joined #ruby-lang
beiter_ has joined #ruby-lang
seanstickle has joined #ruby-lang
justinxreese has joined #ruby-lang
shtirlic has joined #ruby-lang
rue has joined #ruby-lang
rippa has joined #ruby-lang
zmack has joined #ruby-lang
burns180_ has joined #ruby-lang
kyrylo has joined #ruby-lang
ankurgel has joined #ruby-lang
cdnz has joined #ruby-lang
cdnz has joined #ruby-lang
leonL has joined #ruby-lang
shtirli__ has joined #ruby-lang
burgestrand has joined #ruby-lang
burns180 has joined #ruby-lang
Stalkr_ has joined #ruby-lang
heppy has joined #ruby-lang
yxhuvud has joined #ruby-lang
dous_ has joined #ruby-lang
burns180_ has joined #ruby-lang
ankurgel has joined #ruby-lang
krz has joined #ruby-lang
manojhans has joined #ruby-lang
burns180 has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
reitelles has joined #ruby-lang
reitelles has quit [#ruby-lang]
reitelles has joined #ruby-lang
manojhans has joined #ruby-lang
<rue>
Feebonakkee
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
heftig has joined #ruby-lang
Glauconite has joined #ruby-lang
Glauconite has joined #ruby-lang
<Glauconite>
hello
<andrewvos>
Feebonatshee
<imperator>
greetings Glauconite
<Glauconite>
Just starting my journey into Ruby so decided to install mIRC and hang out here throughout :-)
* imperator
is unfamilar with that mineral, looks it up, yep it's real
<imperator>
windows user, eh? :)
<imperator>
anyway, welcome to Ruby!
<Glauconite>
Indeed, no prior experience so linux isn't up my street! Thanks however! Startup culture really interests me and I've been told to start off with Ruby before progressing to RoR :-)
<andrewvos>
Glauconite: What languages do you use?
* andrewvos
guesses .net
* Stereokitsune
jealous such people
<Glauconite>
I'm fluent in noob++ ;)
<Stereokitsune>
because I'm too sociopathic and cannot understand English well to be able to take conversations in internet
<imperator>
Stereokitsune, i don't think sociopathic means what you think it means ;)
<Stereokitsune>
it's possible, I'm not an expert :)
* Stereokitsune
started learning ruby about two months ago
burns180_ has joined #ruby-lang
<Glauconite>
How are you finding the learning curve? Do you have prior programming experience?
<Stereokitsune>
I haven't an experience in "serious" programming, just wrining simple bash and perl scripts to automatize my workdays :) and written simple dynamic pages on PHP+MySQL, almost just for fun
<Glauconite>
Cool, I hope you're enjoying it.
robbrit has joined #ruby-lang
<Stereokitsune>
I don't know why I hadn't tried ruby previously, but after understanding its syntax and attempts to write simple scripts I've understood that it is a language I enjoy writing on :)
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
<Glauconite>
I'm just starting to learn it however my main goal is to get fluent enough to be able to make use of it's principles with RoR :)
<Stereokitsune>
I haven't tried to learn RoR yet
<Stereokitsune>
And sometimes when I see a samples of code from RoR projects, I scare that I won't be able to overcome it :(
<Glauconite>
I heard it is somewhat possible to learn RoR without knowledge of Ruby though to me that seems a little difficult, I'd much prefer to learn the language to a certain extent that a framework is based upon. I really hope I pick both up within time because I'd love to be pushing things out onto the web that other people can use :)
<andrewvos>
Glauconite: Meh. Just start with sinatra
<andrewvos>
Glauconite: IT's so easy
<robbrit>
Glauconite: i learned RoR while learning Ruby, in some ways it makes it easier to learn Ruby because it's easier to define a goal
<robbrit>
although this was a while back, Rails is a fair bit more complicated now
<shevy>
I think it is crazy to want to learn a framework but not the language
<Glauconite>
Note taken andewvos, thank you. I think I will keep going with Ruby for now, as I am literally just learning the basics. I'm too inexperienced you see to be able to differentiate learning x over y, so I took the advice of some web entrepreuners to learn Rails
<shevy>
if anything, then it should be drag and drop, rather than actual code, if people don't want to learn the language
heppy has joined #ruby-lang
<Glauconite>
Shevy, I have no experience in programming. I want to develop for the web, if learning Ruby helps me learn Rails then what is the problem with that? Critisim appreciated :)
<shevy>
the web is not homogeneous
<robbrit>
ah, if you have no experience programming then yes, learn Ruby first ;)
<shevy>
I dont think you can get far without knowing html css and at least understand what javascript is used for
<shevy>
then you put in rails into it, suddenly you need to know some basics of ruby, you need to understand databases too quickly enough and the intricacies of rails
<hangingclowns>
i understand how method missing works, but how to chain it together wtih the in method?
<hangingclowns>
this way a bit confuses me
<hangingclowns>
probably will have to use a @current_currency instance variable to keep track
<hangingclowns>
makes sense to me i think
xiefai has joined #ruby-lang
<Mon_Ouie>
Don't do anything like that
<Mon_Ouie>
Even defining euro, yen, etc. on Numerics sounds bad to me
<Mon_Ouie>
At least define only those you need, don't define method_missing there
<Mon_Ouie>
And just make them return an instance of Money like Money.new(self, currency)
<andrewvos>
Tired of programmers bitching about gender equality in programming. You know there are people getting raped and murdered around the world right now (not programming related)?.
<andrewvos>
/rant over
looopy has joined #ruby-lang
xiefai has joined #ruby-lang
burns180_ has joined #ruby-lang
io_syl has joined #ruby-lang
<hangingclowns>
no
<hangingclowns>
it's what i need to do for homework
<hangingclowns>
he's going to run some rspec tests against it
<apeiros_>
at every level of recursion, you double the number of calls
xiefai has joined #ruby-lang
<rippa>
This Fibonacci algorithm is a particularly poor example of recursion, because each time the function is executed on a number greater than one, it makes two function calls to itself, leading to an exponential number of calls (and thus exponential time complexity) in total.
<rippa>
exactly
<rippa>
factorial is better example
<rippa>
lol
<rippa>
in the wiki
<rippa>
"Implemented in the Java or the C# programming language:"
<muzone>
Ruby Piano starts with the Famous Yamaha C7 sound, Appearing on famous concert stages, international competitions and prestigious music events throughout the world.
<muzone>
heheh
burns180 has joined #ruby-lang
seacreature has quit [#ruby-lang]
xiefai has joined #ruby-lang
looopy has joined #ruby-lang
tekin has joined #ruby-lang
deryldoucette has joined #ruby-lang
<rue>
rippa: I'd probably go with a more iterative-looking version
<Stereokitsune>
this is the only way to get the costs to pay for my flat and food
<shevy>
(1) write small scripts
<shevy>
(2) start on a medium project that includes more scripts into that project
<shevy>
Stereokitsune a perl job?
<Stereokitsune>
no, I'm just demiindian technical support
<shevy>
ah
<Stereokitsune>
but I want to change my occupation to RoR developer
<rue>
Demi-indian?
<Stereokitsune>
possible, I've used the wrong word
<Stereokitsune>
unfortunately, English isn't my native language, and I was too lazy to learn it to talk in it free
<gray>
shevy: think in ruby? could you "show" example? :)
<gray>
shevy: could you give me a tasks?
jacktrick has joined #ruby-lang
sysbeast has joined #ruby-lang
burns180_ has joined #ruby-lang
<gray>
shevy: m?
pemeon has joined #ruby-lang
<erikh>
man I am so tempted to sing a song from the movie "clerks" right now
<shevy>
gray no that is a bad idea
<shevy>
gray just write a todo list with things you want to write
<shevy>
alternatively look at github for projects that have no maintainer... or just find anything that interests you
<shevy>
Stereokitsune global English is very fault tolerant :)
<deryldoucette>
if you do thins that don't interest you you'll end up just dropping it on the floor. shevy is trying to lead you ina direction that will keep your interest alive.
<deryldoucette>
good plan
<Stereokitsune>
shevy: I know but I have no other way to move up :)
<deryldoucette>
gray: start with little things that you need in say your own environment. what do you do on your computer that automating might help you. think of how you'd do that in ruby. then try your hand at it
<deryldoucette>
gray: try installing mysql, postgresql, and sqlite3 on your machine. install ruby 1.9.3. think of something like what shevy mentioned. a TODO list. write it without backing it with a database, then make it use a database on the backend to store the list(s).
<Stereokitsune>
is it good to rewrite existing scripts/projects in ruby? just to increase my own level
gray has joined #ruby-lang
<deryldoucette>
that way you learn A) how to write ruby, B) how to interact with a user, C) how to write the app itself, and then D) how to interact with databases (when you add the db support)
* Stereokitsune
want to move all sinatra's documentation to his head
<deryldoucette>
then go back over it all and think of ways you think it could be done better
DMKE has joined #ruby-lang
wallerdev has joined #ruby-lang
<deryldoucette>
Stereokitsune: yes if your goal is to increase your ruby knowledge. and maybe that bash based set of scripts that does BLAH works better and can be extended easier with ruby
<deryldoucette>
only one way to find out :) try
<Stereokitsune>
thanks, I'll do :)
<Stereokitsune>
that's bad that I'm worst free-lancer :( I think I'll need more "professional" development experience further
<deryldoucette>
Stereokitsune: and don't let anyone tell you this or that is worthless to do. I have a crapload of projects that I did JUSt to see if I could. NO ONE else will EVER see or use them. and thats fine.
<deryldoucette>
just do stuff that interests you and keep focused that you're doing this to improve YOU
<deryldoucette>
thats all that counts
<shevy>
Stereokitsune well that is hard to answer
<shevy>
usually I hate other people's code
<Stereokitsune>
I need more methods to improve my self-conception, yes :)
<deryldoucette>
Stereokitsune: just keep in mind, you WILL fall flat on your face. multiple times. then you'll get better. part of the process. no one WANTS to go through it, but thats how we learn. its OK to fail as long as you take the time to figure out HOW you failed.
lifestream has joined #ruby-lang
<shevy>
but I liked ruby-fpdf bindings, and I can't stand prawn (things tend to get bigger and bigger and depend on more and more other projects, which tend to break for me way too often), so one thing on my todo list is to maintain ruby-fpdf eventually (after I finished rewriting my main ruby project that is, which will still take some days)
<shevy>
I dont think I could take over a project that does not interest me at all
<lianj>
orly? :P
<deryldoucette>
Stereokitsune: and talk to people. one reason i stay here in this channel. i ask stuff, even if they don't give me the answer they point me in the right direction. remember in your head, there is only you. we NEED outside feedback.
<deryldoucette>
last thing i wanted to say. :)
<Stereokitsune>
deryldoucette: thank you very much, you motivate me very good :)
<deryldoucette>
good :)
<shevy>
hehe
<shevy>
deryldoucette, for some reason I always associate something to eat with your nick, something that tastes sweet
<deryldoucette>
there's always assholes, sometimes I'm even one of them. just keep at it. no matter what
<deryldoucette>
shevy: hehe
<deryldoucette>
shevy: i *think* there is a pastry that is similar in the spelling. or a sweet cheese.
<shevy>
yum
<deryldoucette>
ok, done being a motivational speaker. i stink. time to fix that &
ankurgel has quit [#ruby-lang]
<A124>
Anyone has in idea why Zlib::GzipWriter writes uncompressed stream for me instead of compressed?
m3nd3s has joined #ruby-lang
dfr|mac has joined #ruby-lang
<kyrylo>
shevy, what are your projects?
burgestrand has joined #ruby-lang
ascarter has joined #ruby-lang
dejongge has joined #ruby-lang
dejongge has joined #ruby-lang
<shevy>
kyrylo hmm the "build tools" project in ruby is my main one still (which I am rewriting right now), others are a ruby-like shell, a very primitive web framework, and a framework for pipes (parse and understand input like "*avi | filter huffyuff | cut 30-50 | save to /tmp")
<Stereokitsune>
sometimes I don't have enough avisynth on linux
<shevy>
you used avisynth Stereokitsune ?
<shevy>
I'd like to have all sorts of audio and video processing be done entirely scriptable
<Stereokitsune>
yes, I did; up to writing simple automatizators on Windows batches :)
<shevy>
even without something like virtualdub or avidemux
<shevy>
cool
lifestream has joined #ruby-lang
gix has joined #ruby-lang
srbaker has joined #ruby-lang
tomzx has joined #ruby-lang
<kyrylo>
shevy, are you an AviSynth contributor or what?
justinmcp has joined #ruby-lang
<rue>
C)
igotnolegs has joined #ruby-lang
<muzone>
At https://gist.github.com/1547595 - I need to add a separator (i.e. -----) between the diffs in git diff $old_commit HEAD -- $modified. Some dude told me: perl -pe 'print "----\n" if /^diff/ and $. > 1'
<muzone>
What would the Ruby equivalent of that be?
<apeiros_>
ruby -e '`perl -pe '\''print "----\n" if /^diff/ and $. > 1'\''`'
* apeiros_
hides
<rue>
You could try just s/perl/ruby/
<Mon_Ouie>
ruby -pe 'puts "----" if /^diff/ && i_dont_know_what_dollar_dot_is'
<erikh>
and be line-ending friendly for platforms that-shall-not-be-named
<muzone>
erikh: yeah that looks better too
<erikh>
puts; puts "###" or w/e
<muzone>
i dont like the way \n makes me feel
<muzone>
got it
<erikh>
anyhow, sorry to "well, actually" you.
<Mon_Ouie>
Doesn't Ruby convert line-ending by default (i.e. unless the file is explicitly opened as binary)?
<muzone>
thanks a lot guys!
<muzone>
git diff $old_commit HEAD -- $modified | ruby -pe 'puts; puts "###" if /^diff/ && $. > 1' | less
Y_Ichiro has joined #ruby-lang
Y_Ichiro has joined #ruby-lang
<muzone>
going for that then, no more awk
<Mon_Ouie>
$. was the perl one
<Mon_Ouie>
Or does it exist in Ruby too?
<drbrain>
$. is in ruby
<muzone>
cool
<drbrain>
I think all the perl magic $ variable features are in ruby
<muzone>
time to run this baby mama's mouth
<muzone>
drbrain: is there a prettier way to do it maybe?
burns180 has joined #ruby-lang
<rue>
muzone: Find out what $. does.
<muzone>
well
<rue>
(And/or any other parts that you don't know)
<drbrain>
muzone: I don't know if there's a prettier way
<drbrain>
maybe using ARGF
<muzone>
``Current line number for the last filehandle accessed.'' apaprently
<muzone>
drbrain: interesting
<muzone>
i like the sound of ARGF
<muzone>
(reminds me of when i had an arabic girlfriend)
<erikh>
drbrain: nah, but quite a few of them are.
<erikh>
`perldoc perlvar` for the 800lb gorilla.
<muzone>
for some reason though git diff $old_commit HEAD -- $modified | ruby -pe 'puts; puts "###" if /^diff/ && $. > 1' | less doublespaces everything
<drbrain>
muzone: you add an an extra newline for every read line with "puts;"
<muzone>
oh i see
<muzone>
thats not good..
<erikh>
what are you trying to do exactly?
<muzone>
erikh: just to make it easier to browse all the diffs
<muzone>
add some visual separators
<erikh>
oh a colordiff tool or something?
<erikh>
ah.
<erikh>
well diff -u has that already, sort of.
<muzone>
not familiar with colordif
<muzone>
really?
<erikh>
unified diff is what git outputs by default -- we may have a different idea of "readable"
<imperator>
erikh, howdy
<muzone>
git diff -u $old_commit HEAD -- $modified is all i need?
<erikh>
imperator: yo
<erikh>
muzone: no, `diff -u` is for the diff(1) tool.
<muzone>
oh ok
<erikh>
git diff outputs like `diff -u` already
<muzone>
its just that there is no separation between the files
<muzone>
so its very confusing to read
* imperator
finds gitx handy for visualizing diffs
<imperator>
cups update breaks printer on ubuntu...typical
looopy has joined #ruby-lang
<imperator>
so much for using libreoffice
burns180_ has joined #ruby-lang
Stalkr_ has joined #ruby-lang
WillMarshall has joined #ruby-lang
chimkan has joined #ruby-lang
heppy has joined #ruby-lang
igotnolegs has joined #ruby-lang
lchi has joined #ruby-lang
looopy has joined #ruby-lang
<Defusal>
never using Array.new([]) again in my life
<Defusal>
err, Hash.new([])
<Defusal>
it's been a very long day, and that just wasted quite a bit of my time
<lianj>
:D
<Defusal>
someone two different keys were resolving to the same values
<Defusal>
changing it to a normal hash and using (hash[key] ||= []) << item solved it
<Defusal>
s/someone/somehow
<Defusal>
guess i can take a break now, seeing as its 1am
hangingclowns has joined #ruby-lang
<lianj>
Defusal: its not somehow. its a feature in this case ;)
burns180 has joined #ruby-lang
<Defusal>
i was under the assumption that it would make a new value of [] if there was no such key...
<Defusal>
using that key, not some default key no matter what key is used
<RegEchse>
Defusal: You know about Hash.new{|h,k| h[k]=[] } ?
<RegEchse>
That would do what you described as your assumption.
<Defusal>
RegEchse, i guess that is what i was thinking of, i've been using ruby too little over the last few months :(
<Defusal>
thanks
<lianj>
"If obj is specified, this single object will be used for all default values. If a block is specified, it will be called with the hash object and the key, and should return the default value. It is the block’s responsibility to store the value in the hash if required."