mxweas has quit [Quit: Computer has gone to sleep.]
<n_blownapart>
hi from the command line I type irb -rrbconfig, then from irb Config::CONFIG{"rubylibdir"] to get into standard library. error message says roughly: do not use archaic name, us rbConfig::CONFIG["rubylibdir"]. is that correct. I get errors when I try it.
mxweas has joined #ruby
virunga has quit [Quit: Sto andando via]
phinfonet has joined #ruby
jrist-afk is now known as jrist
brdude has quit [Quit: brdude]
x77686d has quit [Ping timeout: 244 seconds]
<kirill>
n_blownapart: the fact u're using irb instead of pry disappoints me greatly, and to punish you, i will not help you
pedrohenrique has quit [Ping timeout: 244 seconds]
EPIK has quit []
<n_blownapart>
kirill: I couldn't get it to work on pry.
<n_blownapart>
either
<kirill>
n_blownapart: RbConfig
<kirill>
not rbConfig
<n_blownapart>
thanks are you a henchman of Banisterfiend?
<n_blownapart>
kirill: sweet can't wait to really use it.
mascool has quit [Ping timeout: 240 seconds]
pnbeast has joined #ruby
headius has joined #ruby
liluo has joined #ruby
<n_blownapart>
kirill: hey that f = cgi.rb ... .cat #{f} didn't work like the previous 0 = RbConfig. etc. did I miss something?
opus has quit [Quit:]
pdtpatrick has quit [Quit: pdtpatrick]
pdtpatrick_ is now known as pdtpatrick
<kirill>
n_blownapart: f = "cgi.rb"
zodiak has quit [Remote host closed the connection]
pdtpatrick has quit [Quit: pdtpatrick]
conorwade has joined #ruby
techsurvivor has left #ruby ["WeeChat 0.3.8"]
randomautomator has quit [Remote host closed the connection]
<otters>
kirill: it's pretty new
<kirill>
otters: well something must be wrong if everything takes a long time to start, even without an ssd. Guess it depends whatyoure expectations are htough
kenneth has joined #ruby
<n_blownapart>
kirill: sorry I can't seem to open files using any sort of cat command
kenneth has quit [Client Quit]
<otters>
kirill: not everything, just firefox, opera, and pry
<otters>
but actually firefox has been performing better
<jonahR>
try this: .cat "#{o}/#{f}"
<kirill>
otters: how long does pry take? and what ruby version are you using?
<jonahR>
keeping in mind that f = cgi.rb and o was the rubylibdir
<otters>
maybe 2 seconds
<kirill>
jonahR: did that work for u?
<otters>
ruby 1.9.4
<jonahR>
yes
<otters>
1.9.3 rather
<kirill>
otters: 1.9.4 ?! what is that?
<kirill>
oh ok
justsee is now known as justsee|away
<otters>
it's called a "typo"
<kirill>
otters: this is without any plugins?
<otters>
no, it's got the readline syntax highlighter thing
<otters>
pry-coolline
<otters>
pry is faster when I uninstall it
<otters>
and is also less broken
<jonahR>
kirill: did it work?
<kirill>
otters: what's broken about it with coolline installed?
<kirill>
jonahR: should do
<n_blownapart>
jonahR: kirill sweet that works
<otters>
kirill: if you start pry, then start typing before the prompt comes up, it doesn't remember anything you typed
<jonahR>
;)
darren has joined #ruby
<kirill>
otters: oh ok
<kirill>
otters: you should switch back to irb
excelsior has quit [Ping timeout: 265 seconds]
shadda has quit [Quit: Terminated with extreme prejudice - dircproxy 1.0.5]
<otters>
yeah, maybe
<kirill>
otters: you're probably not using any advacned pry features anyway
<otters>
I doubt it
friskd_ has joined #ruby
<kirill>
otters: irb could be a better choice for noobs i think
<otters>
yeah, I think "noob" is a little insulting
<otters>
but I don't require the advanced features of pry, not at the moment
<kirill>
otters: you're not new to ruby? :)
yoklov has quit [Quit: computer sleeping]
<kirill>
you seem kind of new
<otters>
nah, I've been using it for a couple years
berserkr has joined #ruby
<kirill>
hmm, surprising
<otters>
I'd say it's probably my best language
friskd has quit [Ping timeout: 265 seconds]
friskd_ is now known as friskd
<kirill>
i figured you'd only been using it a couple of weeks
<otters>
because of my pry problems?
yasushi has joined #ruby
<otters>
I'm definitely new to pry
<otters>
installed it probably four days ago
adeponte has quit [Remote host closed the connection]
yasushi has quit [Remote host closed the connection]
pnbeast has left #ruby [#ruby]
<kirill>
nah, just a general impression by your chat on channel, i just picked that you werne't that experienced
<kirill>
(not with pry in particular)
yasushi has joined #ruby
<otters>
probably because of my use of the vague words "thing" and the wrong ruby version
<otters>
s/words/word/
<otters>
I could have sworn ruby 1.9.4 was the earliest version, but now I see that it's actually 1.9.3-p194
darren has quit [Ping timeout: 276 seconds]
<otters>
that's where the confusion came from
<otters>
*newest
<otters>
I'm making a right pig's ear of it, aren't I
<eam>
kirill: is it necessary to be such a dick?
<jonahR>
word
<otters>
I thought it was an honest observation
<kirill>
it was..
<kirill>
i thought you were new, that's all
dimday has joined #ruby
<otters>
yeah, cool your jets, everybody
<otters>
kirill: ask me an advanced ruby question
<jonahR>
gem install nyancat
<jonahR>
all problems go away...
<otters>
wow, there is actually a nyancat gem
<kirill>
otters: sure
<kirill>
otters: one second
<jonahR>
its awesome hahah
yasushi has quit [Ping timeout: 240 seconds]
<otters>
holy crap, an ascii nyan cat
<otters>
what is this strange new world
classix has quit [Remote host closed the connection]
<jonahR>
try CTRL + C
<jonahR>
YOU NYANED FOR 60.06 SECONDS
<jonahR>
its crazy
<jonahR>
*it's
<otters>
I have to ^D
<otters>
oh wait no, you're right
savage- has quit [Ping timeout: 252 seconds]
<otters>
and it expands to fill vertical width, but not horizontal :|
punknology has joined #ruby
<kirill>
otters: what is the difference in between the follow, and why? :) o = Class.new; o.instance_eval { def hello; end } and o.instance_eval { define_method(:hello) {} }
<kirill>
following
punknology has quit [Client Quit]
chimkan has joined #ruby
w400z has quit []
<kirill>
otters: and where does 'hello' get defined in each case :P
<kirill>
(and why:P)
n_blownapart has quit [Remote host closed the connection]
<otters>
isn't define_method a class method?
<otters>
so let's see
<kirill>
feel free to play in irb of course
justsee|away is now known as justsee
<otters>
example 1 creates a class method, example 2 creates an instance method
skilcraft has quit [Quit: leaving]
<kirill>
otters: Yep, but why? why should 'def' and 'define_method' behave diffrently in that situation?
<otters>
yeah
<kirill>
whereas in most situations they're kind of the same
<otters>
because o is an instance of Class, so a "class instance method" is a class method
<otters>
but define_method is a class method that creates an instance method
<otters>
or rather, defines
<otters>
no irb necessary
<otters>
I was expecting you to bring something out about callcc or something
<otters>
which would have stumped me, because I can't continuations
<kirill>
but i dont understand your answer
<otters>
oh
<otters>
okay
classix has joined #ruby
<kirill>
why does 'def' create a class method in this case? and define_method create an instance method? when in this sitation
<kirill>
class Hello; def hello; end; define_method(:goodbye) {} ; end
<kirill>
you get two instance methods
stephenjudkins has quit [Quit: stephenjudkins]
<otters>
yeah but o is an instance of Class
<kirill>
so is Hello in the case of: class Hello
ringotwo has joined #ruby
zeen has joined #ruby
<kirill>
it's also an instance of Class :P; Hello.class #=> Class
<otters>
right
<otters>
I know why I'm right, but I can't explain it
<otters>
o.instance_eval { def hello; end } is the same as def o.hello; end
<kirill>
yes
<kirill>
but 'why' :)
<kirill>
that's the question im asking
freeayu has quit [Ping timeout: 256 seconds]
<kirill>
why is it equivalent to def o.hello; end when define_method(:hello) {} by contrast creates instance methods
friskd has quit [Quit: friskd]
<kirill>
so something weird is going on with the 'def' keyword in that situation...
<kirill>
otters: because in this situation they're equivalent: o.class_eval { def hello; end define_method(:hello) {} }
friskd has joined #ruby
rakm has joined #ruby
<kirill>
so what is instance_eval doing differently to class_eval
<kirill>
mksm: i know the answer already, otters asked me to ask him a tricky question taht's all :)
chichou has quit [Remote host closed the connection]
<otters>
well, so explain it to me
krz has quit [Quit: krz]
<otters>
instance_eval evaluates the block in the context of the receiver
<kirill>
otters: not exactly
<kirill>
if it evaluated the block in the context of the receiver then: class Hello; end; Hello.instance_eval { def hello; end } would be equivalent to: class Hello; def hello; end; end
<kirill>
which it isnt
<jrajav>
For anyone who doesn't know yet
<jrajav>
>> puts 'Hi I interpret Ruby'
<al2o3cr>
Hi I interpret Ruby
<jrajav>
:D
_jorge has quit [Remote host closed the connection]
<mksm>
what ...
<otters>
kirill: so explain it
<mksm>
>> puts 'whazap'
<al2o3cr>
whazap
jonnn has joined #ruby
<mksm>
:O
friskd has quit [Ping timeout: 245 seconds]
friskd_ is now known as friskd
_jorge has joined #ruby
<kirill>
otters: ruby has 3 different implicit selfs that matter at any point, there's the 'self' returns by 'self' Hello.instance_eval { self } #=> Hello
<jrajav>
For now, you have to actually puts or p anything that you want it to print
<jrajav>
That will change soon
<jonahR>
>> puts RUBY_VERSION
<al2o3cr>
1.9.3
<otters>
kirill: you're right, I had no idea about this
<otters>
I guess you can tell I just picked ruby up yesterday
<kirill>
otters: and there's the 'self' where constants are defined: Hello.instance_eval { Goodbye = :hi }
uris has joined #ruby
<mksm>
jrajav: neat, I just hope it's safe
<otters>
>> puts IO.class
<al2o3cr>
Class
<jrajav>
It's locked down pretty right in a chroot
<al2o3cr>
r_otters.rb:1:in `popen': No such file or directory - uname -a (Errno::ENOENT)
<jrajav>
Which is itself inside a linux VM that's running nothing but the bot
<jrajav>
So yeah
<kirill>
otters: in that case, Goodbye is not defined under Hello, it's in fact defind at top-level, so the 'self' which Goodbye is using is not the 'self' inside the block (Hello)
<jrajav>
Also, the chroot has no binaries or libs except 'sudo', 'ruby', and what they need
<jrajav>
:P
freeayu has joined #ruby
<kirill>
otters: there's also the third self which is where methods are defined using 'def'
<otters>
ok
<kirill>
otters: in the case of class_eval: Hello.class_eval { def hi; end } the self where methods are defined is the same as the receiver, so in the case just before, 'hi' is defined on Hello
jonnn has quit [Client Quit]
<kirill>
otters: but in the case of instance_eval, the 'self' where methods are defined is actually on the eigenclass of the receiver
<kirill>
otters: so: Hello.instance_eval { def hi; end } 'hi' is defined on Hello.singleton_class instead
<jonahR>
>> puts Dir.entries(Dir.pwd)
<al2o3cr>
stdout too long, PMed
<otters>
okay
Hanmac1 has joined #ruby
<mksm>
>> p Thread.start {}.kill
<al2o3cr>
#<Thread:0x00000000c11d30 aborting>
<jonahR>
evil
Hanmac has quit [Read error: Operation timed out]
friskd has quit [Quit: friskd]
<mksm>
well i'm not gonna break it :P
<otters>
I did not even know about metaclasses
<otters>
TIL
bradhe has quit [Remote host closed the connection]
<kirill>
otters: so, this is pretty interesting: assume we're at top-level, and we do this: Hello.instance_eval { } there are actually 3 distinct selves which are used inside that block: 1. the normal 'self' (returned by 'self' keyword) this is where methos defined usine define_method are defined. 2. the 'self' where constants are defined, in this case it's equivalent to Object, and 3. the self where methods are defined using 'def', which is on
<kirill>
the eigenclass of Hello. So the 3 selves are: 1. Hello, 2. Object, 3. eigenclass of Hello
<kirill>
otters: i can ask a less theoretical question if u want
erichmenge has joined #ruby
<otters>
okay so class << some_instance; def foo; end; end
<otters>
that defines "foo" on some_instance's eigenclass
<otters>
what is some_instance's eigenclass?
<kirill>
Yeah
<otters>
is it equivalent to some_instance.class?
<kirill>
no, but it should be :)
a_a_g has joined #ruby
<kirill>
eigenclass is like a special class created specifically for that instance
<otters>
I see
<jrajav>
By the way, please try to break the bot if you can :)
<jrajav>
If there are any holes I'd like to know about them sooner rather than later
<kirill>
if you introspect on the actual lookup chain (from C) you'll see the eigenclass is the immediate class of the instance, and its' a direct subclass of the 'actual' class of the object
<otters>
so class << foo; def self.hi; "foo"; end; end
<otters>
foo is now inaccessible without opening the eigenclass
<otters>
so without some clever metaprogramming
<kirill>
otters: so, say you had: o = "hello"; def o.hello; "hi"; end then the 'actual' class of o is String, but the immediate class of o is the eigenclass of o, and the eigenclass of o is a subclass of String
<n_blownapart>
jonahR: yeah that I get. require only lets you get it once. but the book says you don't the need the extension with require because it is a "feature" which could be C code, etc.
<n_blownapart>
jonahR: thanks for the link...this is so basic but if I don't sort it out now...
Nisstyre has quit [Read error: Connection reset by peer]
<jonahR>
n_blownapart: exactly you don't need to use the extension with require
<bnagy>
I like the hard way approach, I just wish it had been written by someone that speaks fluent ruby
gen0cide_ has quit [Ping timeout: 246 seconds]
stephenjudkins has joined #ruby
adeponte has joined #ruby
gen0cide_ has joined #ruby
jrist is now known as jrist-afk
banisterfiend has quit [Remote host closed the connection]
rouss has quit [Ping timeout: 265 seconds]
ananthakumaran has joined #ruby
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
Konboi has quit [Remote host closed the connection]
rbanffy has joined #ruby
kyktommy has joined #ruby
brdude has joined #ruby
igotnolegs has joined #ruby
butblack has left #ruby [#ruby]
_jorge has quit [Remote host closed the connection]
jillsmitt_ has quit [Remote host closed the connection]
jillsmitt has quit [Remote host closed the connection]
moshee has quit [Ping timeout: 256 seconds]
moshee has joined #ruby
BMF has quit [Remote host closed the connection]
jillsmitt has joined #ruby
seoaqua has quit [Ping timeout: 240 seconds]
burgestrand has quit [Quit: Leaving.]
vitor-br has quit [Ping timeout: 276 seconds]
savage- has joined #ruby
sevvie has quit [Ping timeout: 246 seconds]
justsee|away is now known as justsee
cbuxton has quit [Ping timeout: 244 seconds]
yoklov has joined #ruby
chimkan has quit [Quit: chimkan]
tommyvyo has quit [Quit: Computer has gone to sleep.]
yasushi has joined #ruby
chimkan has joined #ruby
graspee has quit [Quit: leaving]
cloud|droid has joined #ruby
icy` has quit [Quit: .: adios :.]
cloud|droid has quit [Client Quit]
cloud|droid has joined #ruby
kyktommy has quit [Quit: kyktommy]
jonahR has quit [Quit: jonahR]
charliesome has joined #ruby
kyktommy has joined #ruby
lurch_ has quit [Quit: lurch_]
bradhe has joined #ruby
holy has quit []
nXqd has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
wallerdev has joined #ruby
Derander has quit [Ping timeout: 244 seconds]
brianpWins has joined #ruby
iori has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
Derander has joined #ruby
despoil has joined #ruby
ph^_ has joined #ruby
ph^ has quit [Read error: Connection reset by peer]
tommyvyo has joined #ruby
chimkan has joined #ruby
yxhuvud has joined #ruby
gen0cide_ has quit [Ping timeout: 245 seconds]
tonini has joined #ruby
vlad_starkov has joined #ruby
cbuxton has joined #ruby
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
jasmina87SA__ has joined #ruby
Konboi has joined #ruby
banisterfiend has joined #ruby
jasmina87SA__ has quit [Read error: Connection reset by peer]
reuf has joined #ruby
cbuxton has quit [Ping timeout: 260 seconds]
Konboi has quit [Read error: Connection reset by peer]
yasushi has quit [Ping timeout: 244 seconds]
Konboi has joined #ruby
Banistergalaxy has quit [Ping timeout: 276 seconds]
n_blownapart has joined #ruby
n_blownapart has quit [Remote host closed the connection]
jimeh has quit [Ping timeout: 245 seconds]
kyktommy has quit [Quit: kyktommy]
cbuxton has joined #ruby
iamjarvo has quit [Quit: Leaving...]
SphericalCow has quit [Quit: Leaving]
jillsmitt has quit [Remote host closed the connection]
jillsmitt has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
yasushi has joined #ruby
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
cbuxton has quit [Ping timeout: 245 seconds]
burgestrand has joined #ruby
Morkel has joined #ruby
Hanmac1 is now known as Hanmac
gen0cide_ has joined #ruby
mockra has quit [Remote host closed the connection]
yasushi has quit [Ping timeout: 252 seconds]
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
_jorge has joined #ruby
chimkan has quit [Quit: chimkan]
tommyvyo has quit [Ping timeout: 244 seconds]
Foxhoundz has quit [Ping timeout: 248 seconds]
yoklov has quit [Quit: computer sleeping]
gmci has joined #ruby
JohnBat26 has joined #ruby
_jorge has quit [Remote host closed the connection]
_guns_ is now known as guns
katherinem13_ is now known as katherinem13
banisterfiend has quit [Remote host closed the connection]
Guest74974 has joined #ruby
und3f has joined #ruby
mahmoudimus has joined #ruby
himsin has quit [Ping timeout: 248 seconds]
mahmoudimus has quit [Client Quit]
tastycakeman has joined #ruby
blazes816 has quit [Quit: Leaving]
w0lverine has joined #ruby
cbuxton has joined #ruby
Banistergalaxy has joined #ruby
lurch_ has joined #ruby
mahmoudimus has joined #ruby
chriskk has quit [Quit: chriskk]
apeschel has joined #ruby
rutkla has joined #ruby
havenn has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
gen0cide_ has quit [Ping timeout: 246 seconds]
ananthakumaran has joined #ruby
dhruvasagar has quit [Ping timeout: 248 seconds]
sepp2k has joined #ruby
dhruvasagar has joined #ruby
Konboi has quit [Remote host closed the connection]
kyktommy has joined #ruby
d3vic3 has quit [Ping timeout: 265 seconds]
Konboi has joined #ruby
d3vic3 has joined #ruby
mockra has joined #ruby
Konboi_ has joined #ruby
Konboi has quit [Read error: Connection reset by peer]
red_ has joined #ruby
mockra has quit [Ping timeout: 252 seconds]
verto is now known as verto|off
Chryson has quit [Quit: Leaving]
savage- has quit [Remote host closed the connection]
noyb has joined #ruby
kpshek has quit []
Gurpartap has joined #ruby
<Gurpartap>
Why should I care about Actors if I know how to use Threads?
<Gurpartap>
(not that I know Ruby's Threads so well, but it's critic on why should I implement Actors)
<Gurpartap>
Anyone?
dr_bob has joined #ruby
<dr_bob>
mornink
<Gurpartap>
morwing
xaq has quit [Remote host closed the connection]
<bnagy>
Gurpartap: whah?
<bnagy>
Actors and not mutually exclusive with threads in theory
<Gurpartap>
bnagy: I'm assuming that Actors/Fibers are something Ruby provides as an abstraction over implementing Threads. Am I right?
<bnagy>
although in practice, probably
<bnagy>
no fibers are completely unrelated
mmokrysz has joined #ruby
<Gurpartap>
Ok
jimeh has joined #ruby
<bnagy>
it's not really something that's any easier / harder in ruby than anything else imho
<burgestrand>
Gurpartap: Ruby does not provide actors (even though I heard something about Actors in Rubinius about a year ago).
adeponte has quit [Remote host closed the connection]
<bnagy>
Actor Model is just a design that uses very encapsulated agents, explicit mesaging and kind of implicit state
<Gurpartap>
Celluloid brought actors, which is where I started considering it
<bnagy>
no, it didn't :) It's a good example of the pattern though
<burgestrand>
Aye. A general idea is that you use message passing over sharing state, which in turn makes you less prone to introducing deadlocking bugs due to shared state synchronization.
<Gurpartap>
s/Celluloid brought actors/Celluloid brought actors to me/
<Gurpartap>
:p
khakimov has quit [Quit: Computer has gone to sleep.]
<bnagy>
Gurpartap: in _general_ threads are inimical to that model
<burgestrand>
Banistergalaxy: sweet. Always nice to find new things on this piece of rock.
<burgestrand>
Banistergalaxy: sinkholes are scary.
iamtakin1iteasy is now known as iamtakingiteasy
* burgestrand
adds inimical to new word for the day
<bnagy>
cause all the things that would make you choose threads - like mutexes, semaphores, shared memory - are what the model is designed to avoid
<Banistergalaxy>
It also falls in the time period of permian triassic extinction
kpshek has joined #ruby
<Banistergalaxy>
Which they thought was just due to volcanies
tndrbt has joined #ruby
<bnagy>
so you could do it with threads, but you basically don't use any of the things that make threads good
<bnagy>
or bad
<bnagy>
depending on one's point of view
<bnagy>
the tradeoff is that you get much better and simpler concurrency models that scale
maesbn has joined #ruby
<bnagy>
which is why celluloid -> dcell is such a natural extension
<burgestrand>
And it’s easier to reason about when you… yeah, dcell.
nXqd has joined #ruby
<Gurpartap>
i see
khakimov has joined #ruby
<Gurpartap>
burgestrand: remember the flavors/regions issue i had the other day?
<burgestrand>
Gurpartap: nope, I might’ve been idling at that time
<Gurpartap>
burgestrand: you were helpful that day, to be idle
<burgestrand>
Gurpartap: perhaps you were talking to banisterfiend and not me? either that or I should really eat bigger breakfasts
mmokrysz has left #ruby [#ruby]
<Gurpartap>
i was really you :X
<burgestrand>
Gurpartap: enlighten me!
<Gurpartap>
i remember trying to get back to you, but you left within few monites
<Gurpartap>
minutes
<burgestrand>
I should search my logs.
<Gurpartap>
search for :flavor_ids or :flavors
<Gurpartap>
anyways,
elhu has joined #ruby
ipoval has joined #ruby
<Gurpartap>
i'm confused remembering how i solved the issue
<Gurpartap>
lol
<bnagy>
try not using threads / regexes / class variables
<bnagy>
( I have no idea what the issue was, but that advice seems to fix it 80% of the time )
<Gurpartap>
i see. i'm writing another gem that i tried implementing celluloid's actors with
<Gurpartap>
hah :p
<burgestrand>
Meh. Adium has been so much fail these past years. Log searching borked. ~.~
<bnagy>
you use Adium for irc??
<Gurpartap>
^
<burgestrand>
Yeah, it’s the only client where I don’t need yet another client for Jabber/IRC that doesn’t make me want to gauge out my eyes.
<burgestrand>
And I’m not even convinced about not gauging my eyes out yet.
DarthGandalf has quit [Ping timeout: 260 seconds]
<bnagy>
my internet is too crap to use anything but irssi + screen
<bnagy>
not that I would change now if I had better internet
<bnagy>
anyways
<burgestrand>
I don’t need the terminal/hackery look in my IM clients, I sit all day in the terminal, I’d grow visually impaired if exposed to more of the terminal. :p
<Gurpartap>
i started with mirc or something of those days in around 2002 :D
* Gurpartap
was a school kid back then
DarthGandalf has joined #ruby
<Gurpartap>
from india!
<Gurpartap>
on a dial up!
<burgestrand>
I miss the modem sound.
<Gurpartap>
lol
<Gurpartap>
trying to download pirated music through warez channels!
<Gurpartap>
which i never happened to finish
<burgestrand>
limewire and kazaa.
<burgestrand>
\o/
<Gurpartap>
for the slow internet
<Gurpartap>
yeah they worked though
xnm has joined #ruby
<burgestrand>
Yeah but you often got the wrong song. >:(
davidcelis has joined #ruby
<Gurpartap>
:D
<burgestrand>
Then again that made me find even more music I like that I eventually bought!
* burgestrand
nostalgia
<Gurpartap>
(:
<Gurpartap>
by the time i learnt how to mute the modem's sound, so the parent's wont hear it (since dial up was so costly here); by that time i was mature enough to make my decision whether or not to use internet LoL
<Gurpartap>
s/parent's/parents/
<Gurpartap>
mature = my parents would let me have my own take
banisterfiend has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
elhu has quit [Quit: Computer has gone to sleep.]
Progster has quit [Ping timeout: 240 seconds]
kyktommy has quit [Quit: kyktommy]
Advocation has joined #ruby
subbyyy has quit [Quit: Leaving.]
quest88 has quit [Quit: quest88]
tastycakeman1 has joined #ruby
tastycakeman has quit [Ping timeout: 246 seconds]
\13k has quit [Quit: Leaving]
jprovazn has joined #ruby
_jorge has joined #ruby
adeponte has joined #ruby
answer_42 has joined #ruby
havenn has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
w0lverine has quit [Ping timeout: 246 seconds]
_jorge has quit [Ping timeout: 246 seconds]
AxonetBE has joined #ruby
deryl has joined #ruby
tndrbt has quit [Quit: tndrbt]
seoaqua has joined #ruby
lkba has joined #ruby
tuxillo_ is now known as tuxillo
razeetg has joined #ruby
<razeetg>
n00b guides please.
justsee is now known as justsee|away
ly_gs has joined #ruby
ipoval has quit [Quit: ipoval]
w0lverine has joined #ruby
seoaqua has quit [Ping timeout: 244 seconds]
mockra has joined #ruby
workmad3 has joined #ruby
razeetg has left #ruby [#ruby]
Shamgar has quit [Ping timeout: 265 seconds]
nohonor has quit [Quit: Leaving]
\13k has joined #ruby
TPFC-SYSTEM has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
al2o3cr has joined #ruby
n_blownapart has joined #ruby
tastycakeman1 has quit [Ping timeout: 246 seconds]
manizzle is now known as WeLoveCP
WeLoveCP is now known as manizzle
justsee|away is now known as justsee
manizzle has quit [Quit: Leaving]
manizzle has joined #ruby
fantazo has quit [Remote host closed the connection]
bluOxigen has joined #ruby
ctp has quit [Read error: Connection reset by peer]
jillsmitt has quit [Ping timeout: 260 seconds]
elhu has joined #ruby
<n_blownapart>
hi I'm trying to create my first Rakefile. I don't know where to put the file, if it needs an extension (.rb), or where to put the /tmp directory that it goes through and deletes files from. Here is the rakefile if anyone has time: http://pastie.org/4421284
<n_blownapart>
its an example in a book.
Shamgar has joined #ruby
Banistergalaxy has quit [Ping timeout: 244 seconds]
elhu has quit [Client Quit]
dankest has quit [Quit: Leaving...]
elhu has joined #ruby
g_rotbart has quit [Remote host closed the connection]
elhu has quit [Client Quit]
workmad3 has quit [Ping timeout: 248 seconds]
jillsmitt has joined #ruby
elhu has joined #ruby
und3f has quit [Read error: Connection reset by peer]
khakimov has quit [Quit: Computer has gone to sleep.]
und3f has joined #ruby
aganov has joined #ruby
<burgestrand>
n_blownapart: you create a file named Rakefile, no extension, and place that code in it
<burgestrand>
n_blownapart: you can then execute the tasks in your rakefile with "rake taskname", and list the tasks with descriptions using "rake -T"
evilthomas is now known as thomas
<burgestrand>
n_blownapart: since the directory /tmp starts with a slash, it‘s considered an absolute path to a directory on your system
chussenot has joined #ruby
<n_blownapart>
thanks burgestrand , can I try out the Rakefile by typing "y" to delete a file somewhere?
xorigin has joined #ruby
darren has quit [Remote host closed the connection]
<burgestrand>
n_blownapart: even if the code is from a book, you should answer that question yourself as you will be running the code
<burgestrand>
I managed to get a person to run `rm -rf /` once, don’t be that guy
<n_blownapart>
burgestrand: I don't understand. so I wouldn't create a bogus /tmp file with some bogus files in it, to delete?
* burgestrand
tumbleweed
daniel_hinojosa has quit [Ping timeout: 240 seconds]
eldariof has joined #ruby
w0lverine has quit [Ping timeout: 240 seconds]
MarGarina has joined #ruby
<n_blownapart>
tumbleweed whats that?
<n_blownapart>
burgestrand: ^^
noyb has quit [Quit: Leaving.]
mfridh has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
<Hanmac>
n_blownapart did you hear about the epic fail of Bumblebee (nividia package)?
<n_blownapart>
Hanmac: what? I'm a noob to oop
brdude has quit [Quit: brdude]
<Hanmac>
there was an rm command but the path was not escaped ... so the thing destroyed the whole system
Banistergalaxy has joined #ruby
gmci has joined #ruby
jeff_sebring has joined #ruby
Advocation has quit [Quit: Advocation]
<bnagy>
with great # comes great responsibility
<n_blownapart>
Hanmac: I'm just trying to follow a tutorial that is leaving out a lot of context.
<bnagy>
although afair it wasn't even a /, it was a stray space, right?
<bnagy>
sorry not escaping, it was a stray space
<bnagy>
like rm / tmp
thone_ has joined #ruby
dangerousdave has joined #ruby
Rochefort has joined #ruby
Rochefortes has joined #ruby
andrew_the_Bruce has joined #ruby
<andrew_the_Bruce>
Hello everyone
thone has quit [Ping timeout: 244 seconds]
<n_blownapart>
goodnight.
<andrew_the_Bruce>
anyone here learn ruby from 'ruby.learncodethehardway.org' ?
<n_blownapart>
I heard it was good on this channel andrew_the_Bruce
chichou has joined #ruby
<andrew_the_Bruce>
I got recommended it by a developer at work, currently on exercise/lesson 38
<n_blownapart>
also I heard rubymonk.com is good
<burgestrand>
It used to be very non-idiomatic ruby, but it appears it’s gotten better.
<bnagy>
I like the approach, I hate a lot of the solutions
hoelzro|away is now known as hoelzro
<shevy>
andrew_the_Bruce, I used chris pine learn to program, then read the pickaxe
Rochefort has quit [Ping timeout: 265 seconds]
<andrew_the_Bruce>
I program i nphp and java, understand c + ask… but I must admit Ruby beats all of them hands down with the perl-like features without the horrid syntax
Banistergalaxy has quit [Ping timeout: 248 seconds]
<shevy>
hehe
<shevy>
that's a good way of saying it
<shevy>
perl-like features without the horrid syntax
n_blownapart has quit [Remote host closed the connection]
<andrew_the_Bruce>
it will be a slow process for me learning this I think though, everything else I use has the curly braces and semi-colons… maybe my first project should be a script to remove semi-colons for mthe end of any lines
<hoelzro>
haha
<hoelzro>
that's not a bad start =)
<andrew_the_Bruce>
Are there any sites like learncodethehardway that are a bit more advanced (for when I finish these lessons) yet teach as practical as possible? (I am a hands-on learner and like a little guidance as I go, such as challenges to accomplish)
gilead has joined #ruby
IPGlider has joined #ruby
<hoelzro>
sorry to break topic, but The Ruby Programming Language eBook is 50% off for the next week
<andrew_the_Bruce>
Are hashes popular more because of the added readability, or the fact that developers don't need to remember the numbers?
<hoelzro>
andrew_the_Bruce: hashes are used for all sorts of things
<bnagy>
andrew_the_Bruce: puzzlenode, but the problems are hard
<hoelzro>
arrays have their own benefits, though
<bnagy>
like graduate level compsci hard
<andrew_the_Bruce>
puzzle node, is it like projecteuler?
<bnagy>
less mathy
<andrew_the_Bruce>
I am a graduate from Computer Science, just haven't used ruby before last night
<bnagy>
projecteuler puzzles are mostly pretty easy and short, the challenge is being elegant
<andrew_the_Bruce>
already there and put it on my reading list
<shevy>
andrew_the_Bruce they are popular because you dont have to ask yourself "at which position is the colour of the cat stored", compared to an array
<shevy>
hash[:colour]
<shevy>
array[5]
<shevy>
!!!!
<andrew_the_Bruce>
yeah so more for the original developer than readability (I understand the advantages, just not sure which one led to the popularity)
<shevy>
but it is very readable :)
<shevy>
hashes
s1n4 has joined #ruby
<shevy>
what sucks are arrays of arrays stored in hashes of arrays
<andrew_the_Bruce>
what about hashes of hashes?
xavi has joined #ruby
<xavi>
hi there
<andrew_the_Bruce>
hey xavi
<shevy>
andrew_the_Bruce, you just need to look at them, then you will know if they are ugly or not
chussenot has quit [Quit: chussenot]
dpk has joined #ruby
<andrew_the_Bruce>
I think they look ok, in the right circumstances (like storing data for a chess game)
<lurch_>
hi, should I always explicitly call .close() on an io object in ruby? or can i just rely on the garbage collector? ie. is this considered bad code: ERB.new(File.new('my-file').read) ?
<bnagy>
File.read('my-file') is atomic, so it's safe
<bnagy>
only thing to try and avoid if fh=File.open('foo'); #do stuff and then forget to close
<bnagy>
also, just .close, not .close()
mockra has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
dangerousdave has quit [Quit: Leaving...]
<lurch_>
bnagy: ok, thx
<andrew_the_Bruce>
but also if you code in other languages it might be good practice to keep using the close t ovoid making the mistake in C, though ruby is better at handling this.
<bnagy>
where possible use the block form to File.open
apeiros_ has joined #ruby
<bnagy>
andrew_the_Bruce: you can't, anyway
<bnagy>
that snippet will never assign an IO object to a var
mneorr has quit [Ping timeout: 246 seconds]
<andrew_the_Bruce>
oh right, sorry… still a bit too used to C-based languages I guess
PapaSierra2 is now known as PapaSierra
<bnagy>
actually... File.new(blah).read .. that _is_ going to have to be GC'ed - that's why File.read is better
Advocation has joined #ruby
<bnagy>
but you still can't close it :(
lolmaus has joined #ruby
mockra has quit [Ping timeout: 248 seconds]
<andrew_the_Bruce>
I just meant that I made the mistake and you are right, and just stated that my error was due to not being familiar enough with ruby, instead being used to C-based languages.
<andrew_the_Bruce>
I better be off, back to the lessons. Thanks all, nice meeting you.
andrew_the_Bruce has quit [Quit: Leaving]
qwerxy has joined #ruby
twinturbo has joined #ruby
fastred has joined #ruby
peterhellberg has joined #ruby
qwerxy has quit [Quit: offski]
ly_gs has quit [Remote host closed the connection]
deryl has quit [Quit: deryl]
nilg has joined #ruby
baphled has joined #ruby
Rochefort has joined #ruby
Banistergalaxy has joined #ruby
a_a_g has quit [Quit: Leaving.]
reuf has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
Synthead has joined #ruby
Rochefortes has quit [Ping timeout: 246 seconds]
gen0cide_ has joined #ruby
lord4163 has joined #ruby
<lord4163>
Hi
moshee has quit [Ping timeout: 260 seconds]
<peterhellberg>
Hi there lord4163
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<lord4163>
If I understand right an array is a number right?
gen0cid__ has joined #ruby
<Hanmac>
peterhellberg: http://fritzing.org << is that the company you are working ?
gen0cide_ has quit [Ping timeout: 246 seconds]
gen0cid__ is now known as gen0cide_
<peterhellberg>
Nope, it’s just a pretty cool company/project :)
<apeiros_>
lord4163: hu? no
<peterhellberg>
(I just got a few kits from them)
<apeiros_>
lord4163: an array is a collection of objects, organized by index
<peterhellberg>
lord4163: No, an array is a list
<apeiros_>
i.e. ordered and accessible by index
<lord4163>
ok but how do I convert a string to a number?
<peterhellberg>
"123".to_i
<apeiros_>
or Integer("123")
<apeiros_>
the latter will complain if you try to convert something that is not a number
virunga has joined #ruby
<lord4163>
Ok, thx :)
<apeiros_>
you may also want to be more precise than "number" - programming languages know many kinds of numbers
<al2o3cr>
r_apeiros_.rb:1:in `Integer': invalid value for Integer(): "xFF" (ArgumentError)
<al2o3cr>
from r_apeiros_.rb:1:in `<main>'
<apeiros_>
>> Integer("0xFF")
<apeiros_>
al2o3cr: you're slow!
<Hanmac>
>> p Integer("0xFF")
<al2o3cr>
255
<apeiros_>
oooh
<apeiros_>
it doesn't print the return value? shame :(
<Hanmac>
yeah :(
<apeiros_>
>> p Integer("0xFF", 16)
<al2o3cr>
255
<apeiros_>
>> p Integer("FF", 16)
<al2o3cr>
255
<apeiros_>
various ways :)
mneorr has joined #ruby
dimday has quit [Remote host closed the connection]
jeff_sebring has quit [Ping timeout: 244 seconds]
arkiver has quit [Ping timeout: 256 seconds]
mjbamford has joined #ruby
<peterhellberg>
I think we have gone off on a tangent here :)
<peterhellberg>
lord4163: Is Ruby your first programming language?
alup has quit [Ping timeout: 252 seconds]
<Hanmac>
peterhellberg: about the link ... i can build "blueprints" for prototypes ... but can i do more? it would be cool if i could put the elements together and and then they react like real elements
Advocation has quit [Quit: Advocation]
shadoi has quit [Quit: Leaving.]
gmci has quit [Quit: Computer has gone to sleep.]
<peterhellberg>
Hanmac: I thought it was pretty cool that it does auto-routing for the PCB… but no, I don’t think it is able to do any simulation
<lord4163>
I know a little bit of bash and php
<Hanmac>
but an simulatior would be VERY COOL :P
konk is now known as custardcow
<peterhellberg>
Hanmac: You can also order custom PCB's via the software :)
<apeiros_>
does he actually mention the case of the identity crisis of php's arrays?
<peterhellberg>
I pointed the PHP developers to that article a while back, and they found it _very_ useful.
<Gurpartap>
PHP = Punction Hunction Punction
arvidkahl has quit [Read error: Connection timed out]
jerk is now known as thomas
<Gurpartap>
PHP has popularity because their abundant functions make for their location location location
<Gurpartap>
s/make/making/
<Hanmac>
php had/has an funny bug that two different strings are still equal because the numbers inside are equal "enough"
<apeiros_>
please, lets stop talking about php. it makes me feel ill.
<apeiros_>
suppressing the memories is hard enough already :-p
<Gurpartap>
^_^
<allyraza>
apeiros: please talk about ruby not php
saj has joined #ruby
<Hanmac>
ruby supports an eigenclass of an eigenclass of an eigenclass of an eigenclass of an eigenclass of an eigenclass of an eigenclass of an eigenclass (and so on :P)
<hoelzro>
shevy: if it were german, it would Gewicht, right? ;)
* apeiros_
is always surprised by how many type out nicks instead of using tab completion…
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<shevy>
lol hoelzro
<apeiros_>
hoelzro: that'd interfere with rubys naming requirements
<hoelzro>
apeiros_: how can you tell if someone tab completes or not?
<hoelzro>
apeiros_: I know; that's part of the joke!
<apeiros_>
hoelzro: simple. there's no "apeiros" in the channel
<hoelzro>
ah ha
<apeiros_>
also everybody who writes aperios_ - but that's somehow cute, because they even think of the _, but completely don't get the nick itself :)
<shevy>
hoelzro, the south africans... in africaans language... speak some dutch-german variant... I dont understand much at all, but they have this "Rehwildsböckli" or something... for deer food, you know... Geißbock or Steinbock or something like that... dunno what kind of deer it is, some antelope like deer
<shevy>
apieros is the nick
mockra has quit [Ping timeout: 245 seconds]
Vert has joined #ruby
<hoelzro>
I've never heard Afrikaans, but I've heard it's some crazy Dutch offshoot
arvidkahl has quit [Read error: Connection timed out]
notVert has joined #ruby
<allyraza>
hoelzro, is crazy you right i am from south africa
notVert has quit [Remote host closed the connection]
fjkbvkg has joined #ruby
n1x has joined #ruby
u_u has quit [Ping timeout: 268 seconds]
<burgestrand>
shevy: capricorn
guns has quit [Quit: guns]
pskosinski has joined #ruby
elhu has quit [Ping timeout: 244 seconds]
red_ has quit [Ping timeout: 245 seconds]
<shevy>
capricorn?
<shevy>
I can't concentrate on a nick like burgerstrand without getting hungry :(
red_ has joined #ruby
<Muz>
I can't concentrate on a nick like otters without my face turning into :3.
elhu has joined #ruby
<apeiros_>
:-)3
<apeiros_>
:-)3-<
sepp2k has quit [Ping timeout: 246 seconds]
<peterhellberg>
shevy: Burger stand!
<apeiros_>
peterhellberg sounds like a brand of beer
workmad3 has joined #ruby
<peterhellberg>
apeiros_: Bit Burger perchance?
<peterhellberg>
Or rather Bitburger
<apeiros_>
no, I mean, I wouldn't be surprised if there was a beer named 'hellberg'
<shevy>
Bitburger sounds like the ideal food for the Tron Matrix
ixti has joined #ruby
<peterhellberg>
apeiros_: Ah :)
<shevy>
tried to find a hellberg beer... only found a "Winter Coat is a homebrewed beer from beer blogger Anton Hellberg who writes Välbalanserad."
dross has quit [Read error: Connection reset by peer]
<apeiros_>
see
<apeiros_>
and I'm not surprised
blacktulip has quit [Ping timeout: 252 seconds]
<shevy>
hehe
<tuxillo>
later
tuxillo has left #ruby [#ruby]
<shevy>
that's kinda insane to have amazon send beer (???)
<shevy>
oh
<shevy>
a wall clock
wallerdev has quit [Quit: wallerdev]
elhu has quit [Ping timeout: 246 seconds]
cloud|droid has quit [Ping timeout: 256 seconds]
a_a_g has quit [Read error: Connection reset by peer]
a_a_g has joined #ruby
mxweas has quit [Quit: Leaving...]
iamlacroix has quit [Remote host closed the connection]
ephemerian has joined #ruby
Markvilla has joined #ruby
elhu has joined #ruby
ramblex has quit [Quit: ramblex]
nobdrais1ntone has quit [Ping timeout: 244 seconds]
mucker has joined #ruby
nobdraisentone has joined #ruby
blacktulip has joined #ruby
arvidkahl has joined #ruby
despoil has quit [Ping timeout: 246 seconds]
Criztian has joined #ruby
kitofr has quit [Quit: ~ Trillian Astra - www.trillian.im ~]
ping-pong has quit [Ping timeout: 246 seconds]
alup has joined #ruby
<PapaSierra>
i'm using capistrano to deploy. from my vm i can ssh my server use rsa key auth. my bitbucket account has my vm's key file. my vm is set up for agent forwarding for the server's ip address. what's missing? i'm getting "Host key verification failed.", "fatal: The remote end hung up unexpectedly"
sepp2k has joined #ruby
<Muz>
peterhellberg: inline images in your IRC client? Right who's going to be the first to post goatse...
<Muz>
PapaSierra: you're getting that error when you do what exactly? Your explaination is a bit terse on details.
AxonetBE has left #ruby [#ruby]
Criztian_ has joined #ruby
<PapaSierra>
ok, from my vm i run $ cap deploy which connects by ssh to the server. the server then does a git pull from bitbucket. in order for the server to have authenication on bitbucket it must be able to sign in. rather than teaching the server how to sign in i'd like to agent forward from the vm
<PapaSierra>
i've had this working before but now i have a new server.
thisirs has joined #ruby
gmci has joined #ruby
cascalheira has joined #ruby
ping-pong has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
<PapaSierra>
interestingly on the server when i do ssh git@bitbucket.org it offers to add the RSA key to the list of known hosts. is that required?? since i'm using agent forwarding? anyway, if it is i'm getting permission denied
abstrusenick has joined #ruby
<Muz>
It's probably one of two things. You're missing the correct public keys on the correct machines, you're missing the correct private key on the correct machines, your permissions for these files are out of whack, or you have an off by two counting error in listing possible causes.
<Muz>
Wouldn't hurt to add it. I imagine you would need to do so.
flype has joined #ruby
elhu has quit [Ping timeout: 245 seconds]
<PapaSierra>
:) that was the problem
<PapaSierra>
thanks for making me think Muz
arkiver has quit [Quit: Leaving]
<Muz>
ssh does have an option to ignore that iirc, but I'd be surprised if Capistrano relied on that.
elhu has joined #ruby
<chiel>
PapaSierra: list of known hosts is kept per machine as well, doesn't get sent along with the -A
jeff_sebring has quit [Ping timeout: 246 seconds]
ramblex has joined #ruby
lkba has quit [Quit: Bye]
ramblex has quit [Client Quit]
<PapaSierra>
chiel i'm not quite with you?
<PapaSierra>
-A ?
<Muz>
-A is the SSH commandline client option to enable authentication agent forwarding.
ConstantineXVI has quit [Ping timeout: 246 seconds]
<kalleth>
Muz: witty, btw
<kalleth>
i'm stealing that, if thats ok :p
<Muz>
kalleth: hm?
<kalleth>
"or you have an off by two counting error in listing possible causes."
kaen has quit [Ping timeout: 240 seconds]
bigkevmcd has quit [Quit: outta here]
<Muz>
Oh. I wasn't sure whether to say "one" or "two". How meta.
bigkevmcd has joined #ruby
ConstantineXVI has joined #ruby
<chiel>
PapaSierra: ah, I assumed you were sshing with -A to forward your agent
arvidkahl has quit [Read error: Connection timed out]
vectorshelve has joined #ruby
<vectorshelve>
shevy: Hi :)
kaen has joined #ruby
<chiel>
PapaSierra: ah right, I think that is more or less the same
abstrusenick has quit [Ping timeout: 272 seconds]
<PapaSierra>
cool. well i think i'm good to go, thanks folk
ephemerian1 has joined #ruby
Speed has joined #ruby
ephemerian1 has quit [Remote host closed the connection]
ephemerian1 has joined #ruby
ephemerian has quit [Ping timeout: 268 seconds]
ephemerian1 has quit [Client Quit]
ephemerian has joined #ruby
willian has joined #ruby
jeff_sebring has joined #ruby
<vectorshelve>
the print statement isnt printing a string althought the simple program runs fine and there are blank lines as o/p instead of the o/p which is not getting displayed. any idea
willian has quit [Quit: willian]
tonini has quit [Remote host closed the connection]
Rochefort has quit [Remote host closed the connection]
brdude has joined #ruby
Hanmac has joined #ruby
<vectorshelve>
print command to o/p data doesnt seems working in a simple command line program.. any idea wt I am missing ?
mockra has joined #ruby
<hoelzro>
vectorshelve: would you mind posting some code?
<allyraza>
vectorshelve, please do a gist or pastie
dpk has quit [Ping timeout: 244 seconds]
<vectorshelve>
hoelzro: allyraza sure here it is http://pastie.org/4428821 it is working in my machine but not in another one which I am working on now.. its blank I get nothing displayed
<zaargy>
i have a hash { :foo => "something", :bar => "something else") and i want to pass the values to a method foo, what's the best way to do this?
<zaargy>
splat thing?
iamlacroix has joined #ruby
<hoelzro>
zaargy: you mean like method(*hash.values)?
br4ndon has joined #ruby
r4um has joined #ruby
<zaargy>
yeah that's what i'm doing
<allyraza>
vectorshelve, what is your output
<hoelzro>
zaargy: is it not working?
<vectorshelve>
my o/p should be
<vectorshelve>
X X
mockra has quit [Ping timeout: 248 seconds]
<zaargy>
it is working
<vectorshelve>
X X
<zaargy>
i just thought i remembered a better way
<vectorshelve>
in two lines.. but now just two blank lines
<flexoid>
Hi guys, could you suggest how to simplify common code pattern like this "if something.another.than.another > value ? something.another.than.another : 0"
<vectorshelve>
allyraza: no use ;(
<flexoid>
I know i can assign this long stuff to new variable, but maybe we can use some ruby magic here?
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
<allyraza>
its your machine
avalarion has joined #ruby
<vectorshelve>
allyraza: as u said, its the terminal issue... bt simply not able to find the fix
<avalarion>
Hey there, how do I fix This installation of RMagick was configured with ImageMagick 6.7.6 but ImageMagick 6.7.8-7 is in use. ?
brdude has quit [Quit: brdude]
<Hanmac>
avalarion reinstall the gem
<Muz>
Uninstall and reinstalling the gem should rebuild any native extensions against new header files you have.
<allyraza>
vectorshelve, let me try
<vectorshelve>
allyraza: sure
<vectorshelve>
allyraza: it should work it will work.. its not ruby fault ;)
<avalarion>
Hanmac, Muz, I will emerge gem and test it, thanks =)
<Muz>
Ah, if you're emerging it, it may be pre-built and packaged against a specific version of imagemagick.
<Muz>
But worth a shot none the less. I've no idea how much of a mess Gentoo have maanged to make gems and Ruby. I'm not going to hold mybreath, given how poor Debian and Ubuntu are when it comes to that.
<vectorshelve>
the print in my program doesnt display output.. wt am I missing... ??? any help appreciated http://pastie.org/4428821 it is working on other machines.. is something wrong with the terminal.. any fix for it? thanks
arkiver has joined #ruby
r4um has quit [Ping timeout: 246 seconds]
Stalkr_ has joined #ruby
ly_gs has quit [Remote host closed the connection]
ly_gs has joined #ruby
<vectorshelve>
allyraza: any good mate ? :)
<allyraza>
vectorshelve, still busy bra
qwerxy has joined #ruby
<avalarion>
Muz, gem install rmagick worked =)
<vectorshelve>
allyraza: bra or bro :D
<allyraza>
bro
<allyraza>
your mind is *&**^^
<allyraza>
can you give me gist with all you code
<vectorshelve>
allyraza: :( I need to fix it.. without seeing the o/p how can I work ahead :(
flint__ has quit [Read error: Operation timed out]
elhu has quit [Quit: Computer has gone to sleep.]
<vectorshelve>
allyraza: thats difficult :(
ramblex has joined #ruby
<vectorshelve>
allyraza: let me run a simple ruby prgram with just print and try
<peterhellberg>
vectorshelve: display(OpenStruct.new({ height: 1, cells: [ OpenStruct.new(y: 1, alive?: true) ] })) <- Is printing the "X" in my IRB session
flint__ has joined #ruby
<allyraza>
vectorshelve, try that
<vectorshelve>
allyraza: sure
a_a_g has quit [Ping timeout: 246 seconds]
<vectorshelve>
peterhellberg: that is not my code and u havent used print there
<peterhellberg>
vectorshelve: I _called_ your code
<vectorshelve>
allyraza: peterhellberg simple print hello works
Konboi_ has quit [Remote host closed the connection]
<peterhellberg>
vectorshelve: My OpenStruct is just a "fake" grid for your code
a_a_g has joined #ruby
Foxandxss has joined #ruby
<vectorshelve>
peterhellberg: ok
<allyraza>
vectorshelve, damn its something in your code the code you gave look ok
ly_gs has quit [Remote host closed the connection]
<peterhellberg>
vectorshelve: Also, why do you start the grid on line 0?
<vectorshelve>
peterhellberg: ok got it :) i didnt have a value in one attribute which I had apparently changed unknowingly :D
<vectorshelve>
peterhellberg: I am starting the grid with x=0 and y=0
<vectorshelve>
peterhellberg: allyraza thanks for all ur patience.. :)
<peterhellberg>
vectorshelve: Ok, makes sense… I guess you are building Conway's Game of Life?
<vectorshelve>
peterhellberg: yes I have my cells and grid ready
gmci has quit [Quit: Computer has gone to sleep.]
<vectorshelve>
what Iam finding difficult now is to find the neighbouring cells... any suggetions... need for a particular cell.. I need to search for 8 possible cells with coordinates relative to the current coordinates. how can I apply the formula in the least complicated code structure
<vectorshelve>
peterhellberg: well I am implementing it in a different way ;) peterhellberg I am pretty clear with the login.. need to tranform it to code once I do that will need expert help to optimize it :)
<peterhellberg>
Hmm, I’m currently writing a class where I have a method that doesn’t need to be exposed, but I’d like to test the output. Would you guys prefer if the method was public or if I call .send() in the test?
<peterhellberg>
The method is just returning a generated URI
<Spooner>
peterhellberg : Just call send on it and keep it protected.
<peterhellberg>
Spooner: Yeah, I thought so
mockra has quit [Ping timeout: 248 seconds]
pzol has left #ruby ["Sayonara!"]
d3vic3 has joined #ruby
rutkla_ is now known as rutkla
lockweel has joined #ruby
d3vic3 has quit [Client Quit]
fforbeck has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
enroxorz has quit [Disconnected by services]
Paul-Atreides has joined #ruby
Paul-Atreides has joined #ruby
Paul-Atreides has quit [Client Quit]
mirTapir has joined #ruby
<mirTapir>
can't activate rack (~> 1.1.0, runtime) for [], already activated rack-1.4.1 for []
<mirTapir>
any solutions ?
`brendan has joined #ruby
adeponte has joined #ruby
<peterhellberg>
mirTapir: Do you need to have 1.1.0 installed?
<peterhellberg>
mirTapir: And what library has that requirement?
<mirTapir>
well i tried to remove it
<mirTapir>
but now i have to reinstall some gems
<mirTapir>
because it just dropped dependencies or so
<mirTapir>
i have no idea why i should need 1.1.0 when i got 1.4.1
<mirTapir>
peterhellberg: the intresting thing is after removing the old version it still doesnt think the 1.4.1 version is ok
Abbas5 has joined #ruby
Abbas5 is now known as Abbas-
<mirTapir>
its in the list of packages but it doesnt take it for some reason
Abbas- has quit [Changing host]
Abbas- has joined #ruby
Abbas- is now known as Abbas5
<peterhellberg>
Something has a dependency on 1.1.0-1.1.9
iamjarvo has quit [Quit: Leaving...]
robbyoconnor has quit [Ping timeout: 240 seconds]
nateberkopec has joined #ruby
uris has quit [Quit: leaving]
adeponte has quit [Remote host closed the connection]
_jorge has joined #ruby
alek_b has quit [Remote host closed the connection]
Hanmac has quit [Remote host closed the connection]
<vectorshelve>
shevy: I have a cell with an x and y axis value (cell has x and y attributes) and then am finding its 8 neighbours and passing it into array
ly_gs has joined #ruby
<shevy>
it would be easier if you make one new method that does the checking
<shevy>
vectorshelve and did that work?
<shevy>
vectorshelve I showed you the grid layout minesweeper code I wrote about 5 years ago
FlyingFoX has joined #ruby
<vectorshelve>
shevy: I will do it but it seems the error is something unrelated to it.. its throwing some argument count eror
<shevy>
I forgot how I solved it but it works
<shevy>
ok when do argument count errors happen
<shevy>
def foo(a,b,c)
<shevy>
end
<shevy>
foo()
<vectorshelve>
shevy: yes but I am trying it in a different way... so...
Markvilla has joined #ruby
<shevy>
ArgumentError: wrong number of arguments (0 for 3)
elhu has joined #ruby
<shevy>
the argument error happens because you invoke a method
<shevy>
and you invoke it incorrectly
gmci has joined #ruby
apeiros_ has joined #ruby
<vectorshelve>
shevy: yes bt as u can see I am passing the arguments..correctly :-/
<shevy>
and lateron, change this awful code anyway :P
<vectorshelve>
shevy: I hadnt declared neighbouring_cells = [] before the block so got the error now fixed it :)
<shevy>
good!
<shevy>
note that this is a local variable though
Progster has joined #ruby
<vectorshelve>
shevy: but the way as the given code now http://pastie.org/4433456 how can I shorten it and make it better
yoklov has joined #ruby
<shevy>
well
<vectorshelve>
shevy: yes got it.. thanks :)
<shevy>
I would write a new method
<shevy>
inside the {|cell_object
<shevy>
first change it to something like
tomku has joined #ruby
<shevy>
neighbouring_cells << cell if is_nearby?(cell_object)
<shevy>
then it would be only one line
<shevy>
and in the new method
<shevy>
def is_nearby?(i)
<shevy>
you use the logic from there
<shevy>
return true if INSERT_CONDITIONS_HERE
<vectorshelve>
shevy: good but again all the repeatition will happen in the new method ryt ?
<shevy>
not sure
<shevy>
you have three varying conditions
<shevy>
+1, +0, -1
<vectorshelve>
shevy: as u can see if a 3 by 3 square grid there will always be 8 possiblity of 8 neighbours based on the middle element
<shevy>
yeah let's ask a math expert
<shevy>
workmad3, ^^^
<shevy>
vectorshelve yeah but perhaps there is a better way to get all neighbours correctly
<shevy>
it's an array after all no?
<shevy>
x - x - x
<shevy>
x - x - x
<shevy>
x - x - x
<vectorshelve>
shevy: yes.. u there.. that is what I am trying to crux and also beautify (less complicate my messy code )
<shevy>
with 9 elements for every point on the grid
jeff_sebring has quit [Quit: Leaving]
syraxes has joined #ruby
<vectorshelve>
shevy: I have array of cells for grid and each cell has its x and y coordinate values... I am reading input pattern from a file
<shevy>
hmm
<vectorshelve>
shevy: the grid has atribute cells (array), breadth and height
geekbri has joined #ruby
n1x has quit [Quit: Ex-Chat]
arkiver has joined #ruby
<vectorshelve>
vectorshelve: so now I hope the code makes sense toyou
_JamieD_ has joined #ruby
al2o3cr has quit [Remote host closed the connection]
subbyyy has joined #ruby
verto|off is now known as verto
al2o3cr has joined #ruby
<jrajav>
>> p 'Yar'
<jrajav>
D:
Banistergalaxy has quit [Ping timeout: 248 seconds]
al2o3cr has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
al2o3cr has joined #ruby
vlad_starkov has joined #ruby
<jrajav>
>> p 'Yar'
<al2o3cr>
[No output]
<jrajav>
:|
<jrajav>
>> puts 'Yar'
<al2o3cr>
[No output]
<jrajav>
:<
mneorr has quit [Quit: Leaving.]
liluo has joined #ruby
deryl has quit [Quit: deryl]
* Muz
ponders jrajav testing the bot in a different dedicated channel, instead of spamming this one.
<shevy>
jrajav, note that Muz used a '.' at the end
<shevy>
:)
* fearoffish
likes it
al2o3cr has quit [Remote host closed the connection]
masak has left #ruby [#ruby]
<jrajav>
Muz: I wasn't expecting to have to test it, sorry
al2o3cr has joined #ruby
<Muz>
As much as I like trying to break the bot...
<jrajav>
FWIW I moved after the last Yar
yasushi has joined #ruby
<vectorshelve>
shevy: as of now is there any possibility u see for shortening the code atleast ?
<shevy>
vectorshelve dunno... I am not sure
<shevy>
vectorshelve perhaps to return true always, unless this or that
<shevy>
right now you only work on positive conditions. perhaps it would be easier to check for negative conditions only
mockra has joined #ruby
<Mon_Ouie>
Changing your data structure, using instance methods instead of those class methods for everything
sailias has quit [Quit: Leaving.]
JohnBat26 has quit [Remote host closed the connection]
<vectorshelve>
shevy: but if you could shorten the code in any way some good ruby array api's it will be really helpful Mon_Ouie u cud try as well in making this method code concised http://pastie.org/4433456
<shevy>
god, I hate your code ;)
mneorr has joined #ruby
<vectorshelve>
shevy: please shover your blessings and make it better :)
<allyraza>
vectorshelve, did you get it right sorry man could help had to go
al2o3cr has quit [Remote host closed the connection]
al2o3cr has joined #ruby
<vectorshelve>
allyraza: yes thanks mate.. now stuck with optimizing this code http://pastie.org/4433456 need to make it short
Mon_Ouie has quit [Read error: Connection reset by peer]
moshee has quit [Ping timeout: 246 seconds]
<jrajav>
Wow, so, um apparently the resource limits I'm setting on the bot are so stringent that it can't even execute a "puts 'hiya'"
moshee has joined #ruby
himsin has joined #ruby
<jrajav>
I have no idea which limit is gimping it that much
<jrajav>
Ruby doesn't need more than 50 mb just to run, does it? :X
<allyraza>
f* that is mess lets see how we can improve it
<peterhellberg>
vectorshelve: Ok, but there might be some pointers in there about how to solve the problem.
<vectorshelve>
allyraza: your positive approach allievates my stress :)
<shevy>
vectorshelve it is always about finding a way that is better
lorandi has joined #ruby
<vectorshelve>
peterhellberg: I have the logic in my mind abt the solution.. working my way out with the code now.. so need to improve the code :)
poga has quit [Remote host closed the connection]
<allyraza>
vectorshelve, thats how you tackle this shit
<vectorshelve>
shevy: u said it.. but u love it when u learning something beautiful (ruby) each day by doing something just by yourself emotionally logically conceptually and programatically
<vectorshelve>
allyraza: :) need your help
<shevy>
I dunno. I myself usually stop when I found a solution that works
<allyraza>
working on you code
<vectorshelve>
allyraza: thanks
hynkle has joined #ruby
<peterhellberg>
Sweet, Solar Fields have released a new album (Random Friday)
<vectorshelve>
shevy: thats bad for me... we will never be able to make our thoughts work in a problem situation later for a real world issue
<shevy>
vectorshelve no, I think it can still work... you improve very slowly, day by day :)
<jrajav>
Wow, Ruby is heavier than I thought
<shevy>
jrajav 12.3 kg here
<jrajav>
I can't even limit its memory limit to 150mb without it dying right away
GoGoGarrett has joined #ruby
<shevy>
hehehe
<vectorshelve>
shevy: world is so competitive these days :)
subbyyy has quit [Quit: Leaving.]
<shevy>
jrajav, even 1.9.x?
<jrajav>
Yeah
<allyraza>
vectorshelve, have you noticed you using collect
<vectorshelve>
allyraza: yes
<allyraza>
collect returns a array
<allyraza>
so you should use each
<allyraza>
let me give you my version
<jrajav>
Okay, even *400mb*? Really?
<jrajav>
I must be misunderstanding something here
davidpk has quit [Quit: Asleep at the keyboard.]
<jrajav>
The scriptlets run fine with no resource limit except the cpu time
<jrajav>
But when I limit the total available memory and core size to 400000 bytes, they die immediately
<jrajav>
With a SIGSEGV signal
syraxes has quit [Quit: Leaving]
<jrajav>
At least that's an improvement from the SIGKILL it was getting with 150000 bytes
codeFiend has joined #ruby
keymone has left #ruby [#ruby]
<vectorshelve>
allyraza: yes collect return an array and what I want is also an array
<jrajav>
I guess I just won't limit the scriptlet's available memory. The cpu time limit should kill any resource hogs
<vectorshelve>
shevy: Spooner but the method stil returns false number of live cells for a cell http://pastie.org/4433606 code is here http://pastie.org/4433456 I try passing the first cell to the method
enroxorz has quit [Changing host]
enroxorz has joined #ruby
<vectorshelve>
allyraza: ^^
jrist-afk is now known as jrist
linoj has joined #ruby
emmanuelux has joined #ruby
<Mon_Ouie>
Is your Grid class totally empty?
clocKwize has joined #ruby
<allyraza>
vectorshelve, busy dude
<allyraza>
still busy
<vectorshelve>
allyraza: ok
<vectorshelve>
Mon_Ouie: no grid has array of cells... so in the http://pastie.org/4433606 as u can see it has 4 cells
<allyraza>
in case you wanna see
<vectorshelve>
Mon_Ouie: sorry 8 cells
<vectorshelve>
Mon_Ouie: X represents live cell and - represent dead cell
<Mon_Ouie>
I mean, why don't you put the methods that manipulate grid on your Grid class?
<Mon_Ouie>
That's what classes are for
w400z has joined #ruby
Renrea has quit [Remote host closed the connection]
emmanuelux has quit [Read error: Operation timed out]
<shevy>
vectorshelve listen to Mon_Ouie
<shevy>
vectorshelve put the code you need into your class
<vectorshelve>
allyraza: its returning wrong number of neighbours ;)
<shevy>
let your class solve the problem for you
<vectorshelve>
Mon_Ouie: tick is an action on a grid (applying rules) so I have a tick class and I am passing the grid object to tick
asteve has joined #ruby
<Mon_Ouie>
tick is an action on a grid, so you should have a tick method on Grid
<allyraza>
vectorshelve, how many you spouse to return
<Spooner>
You are also keen to avoid using objects, rather than passing instances to the class. It is a bit of a mess and solving one thing shows up other problems.
cburyta has joined #ruby
<vectorshelve>
Mon_Ouie: but tick works based on a set of rules.. which could change so I have tick class accepting grid and tick methods as those rules and one tick method to apply the rules and produced the transformed grid
<vectorshelve>
allyraza: first cell neighbours should be 3 ryt always and ur code returning 9
monkegji_ has quit [Remote host closed the connection]
rutkla has joined #ruby
yoklov has quit [Quit: computer sleeping]
<Spooner>
vectorshelve : you should be doing something like http://pastie.org/4433647 rather than checking _every_ cell to see whether it is both adjacent and alive.
_JamieD_ has quit [Quit: _JamieD_]
<Spooner>
vectorshelve : The design is fundamentally broken and we should be helping you fix that, not individual lines of code.
<vectorshelve>
Spooner: ok will try it
nanderoo has joined #ruby
<allyraza>
vectorshelve, please let use know what exactly you trying to achieve if we understand we problem may be we can help you and get sorted
<vectorshelve>
allyraza: sure 2 minutes I will try pushing the code
dev_ryan70 has joined #ruby
bbttxu has joined #ruby
erichmenge has joined #ruby
<Spooner>
vectorshelve : My code will not work. It assumes things in the rest of the design, which I assume aren't there. You seem to be avoiding OO in some places, which makes things a lot more clunky.
freeayu has quit [Read error: Connection reset by peer]
nari has quit [Ping timeout: 245 seconds]
<shevy>
I have a hash like ... hash = {:foo => :name_of_method_to_invoke }. Now I can get this via hash[:foo], but how would I invoke the method? do I have to use .send hash[:foo] or is there another way?
virunga has quit [Quit: Sto andando via]
<vectorshelve>
Spooner: why would I need 00 ?
dev_ryan70 has quit [Remote host closed the connection]
<allyraza>
Spooner, you right need to look at the whole pic
[Neurotic] has quit [Remote host closed the connection]
deryl has joined #ruby
<Spooner>
vectorshelve : You are making the cells into objects (I can see cell.x, cell.y) but it looks liek the Grid class is just using class methods (def self.whatever) and ignoring the fact that it would be cleaner as an object too.
<Spooner>
vectorshelve : I said OO (object-orientation), not 00.
<jrajav>
Hmmm, does anyone know of something like Open3.pipeline_rw that will let me pipe stdin to the first command and get both stdout AND stderr of the last command?
<jrajav>
pipeline_rw only gives the stdout
slux has joined #ruby
BrokenCog has joined #ruby
<jrajav>
Mon_Ouie: This is related to allowing p eval($stdin.read)
<Spooner>
shevy : Taht is how hashes work :D
<shevy>
Spooner yeah but I mean, to call the method in the module ... hmm
<vectorshelve>
Spooner: shevy allyraza 1 minute I am uploading it to github
<Spooner>
shevy there isn't a magic shortcut for the very rare use case you are using.
<shevy>
the code I just wrote is very ugly :(
<shevy>
send(hash[:foo])+'hi'
<Spooner>
shevy : I can't make you design better code :)
<Spooner>
shevy : You are going to get that if you have dynamic code. Can't you avoid that?
ananthakumaran has quit [Quit: Leaving.]
<shevy>
hmm
<shevy>
I am using this in a module right now
<shevy>
Spooner, need to think a bit how to solve this differently
<vectorshelve>
how can I pull the entire code folder as it is to github by creating a new repo ?
<vectorshelve>
push
<shevy>
right now I have methods that mostly do this: def red; RED; end; def blue; BLUE; end ... where these UPCASED constants are just the ansi colour codes for the respective colours
<cburyta>
Is this an ok room for basic rake questions?
<Spooner>
shevy Why do you need them as methods since they are fine as constants?
<shevy>
cburyta you can try, not everyone here knows a lot about rake
yasushi has quit [Remote host closed the connection]
<jrajav>
Mon_Ouie: Erm, how do you even run Ruby on a script that's being piped in?
yasushi has joined #ruby
johnlcox has joined #ruby
<shevy>
Spooner I want to do two things: (a) "Hello "+red("World") and more importantly (b) "Hello "+simportant("World"), where simportant() would be a method that could be re-assigned to return different colours (i.e. call another colour-method lateron)
<shevy>
for (a) I could do "Hello "+RED+"World" too. but I also need to rever to the default colour in use
<shevy>
*revert
Progster has quit [Ping timeout: 246 seconds]
<Spooner>
shevy : I'm sure there are already methods that do all that.
<cburyta>
just wondering if anyone knows if using the "directory" task or "files" task to create files is preferred http://pastebin.com/yikR8yPx
gen0cide_ has quit [Ping timeout: 260 seconds]
<Spooner>
shevy : There should be at least one gem already that handles all those ansi codes perfectly well.
crankycoder|afk is now known as crankycoder
graspee has joined #ruby
axl__ has joined #ruby
<Spooner>
cburyta : You can use: mkdir_p "dir2" (in Rake)
yasushi has quit [Ping timeout: 276 seconds]
yasushi_ has joined #ruby
mneorr has quit [Quit: Leaving.]
<cburyta>
spooner: i'll look into that more, thanks
yule has joined #ruby
<yule>
hello
<Spooner>
cburyta : Just shorthand for the 'Dir.mkdir("dir2") unless Dir.exists?("dir2")' though, not a direct answer to your question.
yule has quit [Remote host closed the connection]
_jorge has joined #ruby
axl_ has quit [Ping timeout: 244 seconds]
axl__ is now known as axl_
<cburyta>
spooner: right, i was mainly wondering if the well-documented task "directory" was known to be deprecated, im new to ruby but can't find anywhere why that directory task in my rakefile fails silently
<Spooner>
cburyta : You probably don't want to create the folders outside of a task though, but I'm not sure what you are trying to do overall.
enroxorz has quit [Ping timeout: 248 seconds]
asobrasil has joined #ruby
<cburyta>
spooner: agreed, im just starting it out, i tried it in a task also, but failed silently still
<Spooner>
(you don't need to make a Rakefile into an executalbe with a shebang, since you only run them via "rake")
<cburyta>
spooner: awesome! that worked
lolmaus has quit []
<Spooner>
Oh, "blob" should be :blob, of course. You know what I mean.
erichmenge has quit [Quit: Be back later]
<cburyta>
spooner: thanks, that helps a ton, i was hoping it was a basic thing i was missing
<vectorshelve>
Spooner: Mon_Ouie not able to push to github my code :) http://pastie.org/4433752 allyraza
<Spooner>
It nearly always is. Doesn't make a difference how much wisdom you have :)
<shevy>
heheeh
uris has joined #ruby
<shevy>
in 100 years, the folks will laugh about us, how primitive our code all was ...
<Spooner>
vectorshelve : You can't push to it like that.
katherinem13 has quit [Read error: Operation timed out]
<Spooner>
You need to look for the ssh version of the repo on your github project page.
yasushi has quit [Ping timeout: 240 seconds]
awarner has joined #ruby
theRoUS has joined #ruby
<Spooner>
Actually, ignore me, I'm sure you can do it that way. I just only ever use ssh. Sorry.
<vectorshelve>
Spooner: then how do I ? I first created it in github then cloned it in machine added files made a local commit and trying to push to github
sailias has joined #ruby
internet_user has joined #ruby
d3vic3 has joined #ruby
<Spooner>
vectorshelve : As I say, I've only ever used ssh for it, so I am not sure what is involved in using https.
<vectorshelve>
Spooner: ok thanks
<peterhellberg>
http://screenr.com/eet8 <- Just modified a simple version of Game of Life… 100% more Emoji :)
yasushi has joined #ruby
erichmenge has joined #ruby
mockra has joined #ruby
cburyta has quit [Remote host closed the connection]
katherinem13 has joined #ruby
mockra has quit [Ping timeout: 240 seconds]
<jrajav>
Sorry guys, bot's down again until I get it all figured out
<jrajav>
I'm out for a few hours
jrajav has quit [Quit: The best darkness is strange and surprising]
jonahR has joined #ruby
vectorshelve has quit [Quit: Page closed]
sendoushi has joined #ruby
ipoval has joined #ruby
davidpk is now known as dpk
mahmoudimus has joined #ruby
tndrbt has joined #ruby
stopbit has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
elhu has joined #ruby
<lectrick>
In .each(&:to_s), where is the method to proc (&) defined?
<lectrick>
So what converts the ampersand to a "to_proc" call?
hoelzro has quit [Remote host closed the connection]
<Spooner>
& isn't a method, if that is what you mean. It is a magic thingie like *
<lectrick>
oh wait... &block...
<Spooner>
Yeah, it is the same thing.
<lectrick>
what is the english translation for what that is?
IPGlider has joined #ruby
IPGlider has quit [Max SendQ exceeded]
<Spooner>
Ampersand?
<lectrick>
you know what I mean
arvidkahl has joined #ruby
<lectrick>
its functionality, what it does
lxsameer has joined #ruby
IPGlider has joined #ruby
<peterhellberg>
lectrick: A block?
IPGlider has quit [Max SendQ exceeded]
specialGuest has joined #ruby
<Spooner>
Block operator? No idea.
jillsmitt has joined #ruby
wmoxam_ has joined #ruby
lxsameer has quit [Max SendQ exceeded]
<peterhellberg>
lectrick: You mean the ampersand in something like this?: def foo(&block); yield; end
nicoulaj has joined #ruby
lxsameer has joined #ruby
niklasb has joined #ruby
<lectrick>
* is a splat operator, and it converts an array of elements to those elements inline (as args, whatever). I am looking for a similar explanation for &
poppiez has joined #ruby
<Spooner>
peterhellberg : Nice to see that the proc created by &:symbol is cached, though people told me that was slower (Well, it is slower, but only if you use it only once for a symbol).
IPGlider has joined #ruby
<lectrick>
Spooner: It's cached meaning when it is used for, say, an inject, it doesn't get re-evaluated for every element, you mean?
<lectrick>
peterhellberg: Yes, but I mean the ampersand in general. I know what it does with regards to blocks. Maybe I can start with that....
dpk has quit [Ping timeout: 246 seconds]
<lectrick>
&block to me means "grab an implicit block if one is passed to this method and store it in 'block'". Later, giving a method "block" gives it block as an actual argument; giving it &block gives it the block as an implicit block
<lectrick>
Does &block do some to_proc on something? Or is it pure syntax?
<peterhellberg>
lectrick: By prepending the method parameter with the & symbol you tell the method to treat the block it gets as a closure and assign it to that parameter.
<peterhellberg>
lectrick: A block is just a Proc
<lectrick>
peterhellberg: ah right, the closure explanation is better.
<Spooner>
lectrick : But in an actual call (rather than that usage in def) it does the same thing with a proc or a symbol. Calls to_proc on it, which for a proc returns self, but for a symbol or method object, creates a new proc.
pandersen has joined #ruby
<pandersen>
hello
<pandersen>
anyone here know if there's some method in e.g. io/console that allows you to get a "hidden" string from the command line? like when you type in a password
dpk has joined #ruby
<pandersen>
to get a string from the command line that doesn't show when the user types it
<Spooner>
lectrick : It seems to store _up to_ the last 33 symbol.to_procs in a very simple hash (not Hash), so if you call the same methods (like &:to_s) a lot, it doesn't re-create them.
<Spooner>
lectrick : I read the code wrong. It stores up to 66 procs :)
mneorr has joined #ruby
specialGuest has quit [Changing host]
specialGuest has joined #ruby
<peterhellberg>
pandersen: Highline does that
axl__ has joined #ruby
jpreyer has joined #ruby
<Spooner>
But it hashes them based on symbol.__id__ % 66, so the hashing is rather likely to mean some things get replaced a lot. I should read more of the C code now I have made a few extensions and vaguely know what is going on :)
<lectrick>
so symbol to proc is implemented in C, so I can't for example write my own to_proc, I guess
monkegjinni has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<Spooner>
Of course you can override it in that or any other class.
mneorr has quit [Read error: Connection reset by peer]
<lectrick>
I tried this: m = ''.method(:to_s); [1,2,3].each(&m)
mneorr1 has joined #ruby
<lectrick>
or you see what I was getting at I hope, I got a wrong number of args (1 for 0) error
<lectrick>
if for example you are debugging and want to inspect the elements in the middle of a call chain
<lectrick>
Can all Ruby enumerators be chained or only certain ones?
Abbas5 is now known as Abbas|
<lectrick>
or even more terse, since p is already defined [1,2,3].tap(&method(:p)).inject(&:+)
Synthead has joined #ruby
<shevy>
ewww
<lectrick>
lol
<shevy>
Hanmac likes this code
<shevy>
he is collecting odd combinations
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
* Hanmac
is the master of oddness
<lectrick>
is there a shortcut to the "method" method? :)
<shevy>
!!!
<shevy>
if we could alias ^ to it
<shevy>
[1,2,3].tap(&^(:p)).inject(&:+)
ringotwo has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
PapaSierra has left #ruby [#ruby]
flexoid has quit [Remote host closed the connection]
tk_ has quit [Quit: ばいばい]
ipoval has quit [Quit: ipoval]
x77686d has joined #ruby
<lectrick>
oh snap
<lectrick>
and i was thinking class Object; alias m method; end; [1,2,3].each(&m(:p))
clocKwize has quit [Quit: clocKwize]
_pdelgallego has joined #ruby
<lectrick>
which works, but a single character method is kind of icky... but there's already 'p'
miho has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
_pdelgallego is now known as pdelgallego
elhu has quit [Quit: Computer has gone to sleep.]
lxsameer has quit [Quit: Leaving]
<lectrick>
but if you, say, already had a "debug" method in your scope that took a parameter and output a bunch of stuff, you could simply do [1,2,3].each(&m(:debug)) or what have you
clocKwize has joined #ruby
Hanmac has quit [Read error: Operation timed out]
quest88 has joined #ruby
apeiros_ has quit [Remote host closed the connection]
etisfo_ has joined #ruby
etisfo has quit [Ping timeout: 248 seconds]
elhu has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
Morkel has quit [Quit: Morkel]
beakerma_ has joined #ruby
davidcelis has joined #ruby
axl_ has joined #ruby
r0bby has joined #ruby
ramblex has quit [Ping timeout: 246 seconds]
arturaz has quit [Ping timeout: 268 seconds]
<mirTapir>
he
beakerman has quit [Ping timeout: 246 seconds]
shevy has quit [Ping timeout: 245 seconds]
<mirTapir>
what is that gem called which i can deploy ruby and isolated environments with multiple versions ?
jjbohn has joined #ruby
pzol has joined #ruby
<davidcelis>
capistrano...?
<mirTapir>
no
<mirTapir>
it was a 3 literal word
kuzushi has joined #ruby
<mirTapir>
but i cant memorize it
<hoelzro>
rvm?
robbyoconnor has quit [Ping timeout: 246 seconds]
<mirTapir>
oh rvm
<davidcelis>
"deploy"
<davidcelis>
is what tripped me up
<davidcelis>
methinks you meant install
chimkan_ has quit [Quit: chimkan_]
<mirTapir>
oh
<mirTapir>
sorry
nXqd has joined #ruby
IPGlider has quit []
pu22l3r has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
kvirani has joined #ruby
mahmoudimus has joined #ruby
TorpedoSkyline has joined #ruby
chimkan has joined #ruby
<obryan>
what's a good gem for getting system data, like OS, memory free/total, cpu activity, etc
workmad3 has quit [Ping timeout: 245 seconds]
erichmenge has quit [Quit: Be back later]
adeponte has joined #ruby
<fearoffish>
ummm, ohai
<fearoffish>
used by chef
<fearoffish>
there might be others, and I'm not sure it'll do everything you want
<fearoffish>
but in the past I've just created my own tiny class that does it, it's only parsing text anyway
<obryan>
yeah i thought ohai was the answer but the documentation seems... opaque
<obryan>
and the sysinfo gem is just too limited
<mirTapir>
mhm
_adeponte has joined #ruby
<mirTapir>
you know waht sucks
<mirTapir>
there is cfengine and there is puppetmaster
hoelzro is now known as hoelzro|away
<mirTapir>
but no clips for this task
adeponte has quit [Read error: Connection reset by peer]
maxmmurphy has joined #ruby
<mirTapir>
clips for back and forthprop
<obryan>
don't get me started on cfengine
reff has joined #ruby
<obryan>
but i just want a simple little thing that takes the system stats and reports'm back, ohai seems like the way to go but they seem short on practical examples
jgrevich has quit [Quit: jgrevich]
<mirTapir>
hey i know what you can do if you know how with logic constraint and data oriented programming etc
<mirTapir>
but these systems are more complex than they should be for what they can do
voodoofish has quit [Quit: Leaving]
<chiel>
does any of you ever deploy anything on debian squeeze? I'm wondering what the best place would be for my app.
<chiel>
(with unicorn, though i doubt it matters)
<mirTapir>
but well you dont get paid today
<mirTapir>
for flaming the software
<mirTapir>
i got 4 squeeze running
<mirTapir>
but squeeze is eol
<chiel>
or does everyone just use heroku running nowadays? D:
brdude has joined #ruby
benson has joined #ruby
<chiel>
mirTapir: yeah, but i've been using squeeze for a while
reff has quit [Remote host closed the connection]
<mirTapir>
you need to use stable :P
<Muz>
Fuck heroku.
<Muz>
Really.
<mirTapir>
i prefer any system with working security
shevy has joined #ruby
<chiel>
just not 100% sure on what the "correct" place is to deploy to
<chiel>
now I just have it in /www/sites/<sitename>
<mirTapir>
chiel: i use squeeze for long time on routers
<chiel>
but well, that folder is usually not there in debian :)
<mirTapir>
which got no gui
<mirTapir>
no problem with that
xorigin has quit [Quit: leaving]
<chiel>
yeah I am running debian on my server
<mirTapir>
but i know a friend who runs it on his desktop
<mirTapir>
he always got stress with dependancy loops and broken stuff
<chiel>
just from an os-standpoint I wondered what is the usual place to deploy
<chiel>
mirTapir: I'm not using it on my desktop
<mirTapir>
deploy ?
<chiel>
yeah
<chiel>
like to a webserver.
<mirTapir>
on debian ?
<mirTapir>
one second
<chiel>
yes.
<mirTapir>
nginx or apache ?
<mirTapir>
/var/www/
<chiel>
unicorn, but with nginx proxy
<chiel>
ah k, cool
<mirTapir>
but no idea
<chiel>
that's all I was wondering :)
<mirTapir>
maybe i changed it
jonahR has joined #ruby
<mirTapir>
but i guess its default
ly_gs has quit [Remote host closed the connection]
<mirTapir>
i dont need to change stuff
<mirTapir>
it changes itself
Hanmac has joined #ruby
<mirTapir>
^^
<mirTapir>
eh they should put optocouplers on the soekris boxes
<mirTapir>
i would run it from battery then
<mirTapir>
but it suxx they dont sell it ready modified to precision timing
<mirTapir>
replacin the onboard oscillator with rubidium is nice
jc33 has joined #ruby
<mirTapir>
ok well i guess i could have bought a real timeserver ^^
<mirTapir>
for the mone
<mirTapir>
lol
syamajala has joined #ruby
<mirTapir>
but mine is better ^^
Rajesh has joined #ruby
<chiel>
O.o
Rajesh is now known as Guest38070
<mirTapir>
make: *** No rule to make target `/usr/include/ruby-1.9.1/ruby.h', needed by `fcgi.o'. Stop.
<mirTapir>
i got 1.9.3
<mirTapir>
it fails on the gem for rack
zmbmartin has left #ruby [#ruby]
erichmenge has joined #ruby
excelsior has quit [Ping timeout: 240 seconds]
custardcow is now known as mrmist
excelsior has joined #ruby
<mirTapir>
lol
<mirTapir>
if you dont take care and you look at ruby
_jorge has joined #ruby
<mirTapir>
you read rub her
<mirTapir>
lol
dpk has quit [Quit: Asleep at the keyboard.]
jc33 has left #ruby [#ruby]
pandersen has quit [Ping timeout: 252 seconds]
ringotwo has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
Bonkers has joined #ruby
<shevy>
wat
savage- has joined #ruby
<shevy>
check the error you get for rack
_jorge has quit [Remote host closed the connection]
<shevy>
"it fails on the gem for rack" contains not enough information really
brdude has quit [Quit: brdude]
Beoran__ has joined #ruby
Stalkr_ is now known as Stalked_
Vert has quit [Ping timeout: 252 seconds]
ntome has joined #ruby
<ntome>
hi
Stalked_ is now known as Stalkd_
<ntome>
when i do JSON.parse('1') it tells me it needs at least 2 bytes, why?
Beoran_ has quit [Ping timeout: 244 seconds]
r0bby has quit [Read error: Connection reset by peer]
maletor has joined #ruby
<Muz>
ntome: because the smallest valid JSON document is 2 bytes in size.
<Muz>
{}
<Spooner>
ntome : Yeah, this is dumb: JSON.parse(1.to_json)
<Spooner>
But as Muz implies, it isn't a json document, even if it is valid JSON for 1.
<ntome>
a json document is restricted to array and hash types?
<Muz>
No, a JSON document is restricted to valid JSON.
<Muz>
http://www.json.org/ Those flow diagrams sum up how to form a JSON document nicely.
cantonic has joined #ruby
<ntome>
so "1" is not json, it's a valid value to put somewhere in json, but not json per-se?
randomautomator has joined #ruby
<Muz>
Indeed.
pandersen has joined #ruby
<ntome>
while an array is both valid json and a valid value to put somewhere inside other json?
bluOxigen has quit [Ping timeout: 252 seconds]
<davidcelis>
no
<davidcelis>
an array is a valid json value
<Muz>
The ruby syntax for an array can often be a valid JSON value.
nepo has joined #ruby
<ntome>
ok, thanks
<Muz>
Note: "can".
<davidcelis>
example of when it can't?
Eiam has joined #ruby
<ntome>
"[1,]"?
<Muz>
davidcelis: a Ruby array of constants.
<Muz>
[FOO, BAR, YOUR, MUM]
<ntome>
"[1,]" is valid ruby but not valid json
<davidcelis>
Muz: ah, yep
<Muz>
davidcelis: single quoted string too
<Muz>
*strings
<Muz>
.
tatsuya_o has quit [Remote host closed the connection]
ananthakumaran has quit [Quit: Leaving.]
jonathanwallace has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
nerdo has joined #ruby
dr_bob has quit []
Hanmac has quit [Ping timeout: 260 seconds]
<ntome>
thanks, bye
ntome has left #ruby ["WeeChat 0.3.5"]
w400z has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
zz_chrismcg is now known as chrismcg
nepo has quit [Quit: Leaving]
havenn has quit [Remote host closed the connection]
<w400z>
anyone with mechanize/nokogiri experience here?
nXqd has quit [Ping timeout: 256 seconds]
<Muz>
Rather than asking a vague question, ask the actual question to your problem.
<Muz>
If someone knows, they'll answer. If they don't, they won't.
ephemerian has quit [Quit: Leaving.]
<nerdo>
For example, "What's the cleanest way to retreive a subset of an array from a particular index to the end of the array?"
<nerdo>
That's a real question actually...
<nerdo>
I could do [1,2,3,4,5][-2,2], but is there something more like [1,2,3,4,5][-2...]?
<Muz>
nerdo: "array[5..-1]"
<nerdo>
gotcha
jonathanwallace has joined #ruby
excelsior has quit [Ping timeout: 252 seconds]
Clooth has quit [Quit: Bye!]
<nerdo>
thanks
maxmmurphy has quit [Quit: maxmmurphy]
nerdo has quit [Quit: irc2go]
wallerdev has joined #ruby
<w400z>
using mechanize, is there a way to download all links with a certain extension? for example, i want to find all the links on a page with a ".pdf" or ".mp3" extension and download those files.
gilead has quit [Quit: This computer has gone to sleep]
<katherinem13>
What's the ruby equivelant of this python? '[1, 2, 3][1:] I.e., I want to slice off the first element of an array, but haven't stored it in a variable so can't reference it's .length property to do a two arcument call to #slice
GoldenPie has joined #ruby
poga has quit [Remote host closed the connection]
tommyvyo has joined #ruby
jonahR has quit [Quit: jonahR]
kpshek has quit []
ringotwo has quit [Read error: Connection reset by peer]
blast_hardcheese has quit [Ping timeout: 240 seconds]
theRoUS has quit [Remote host closed the connection]
gilead has quit [Read error: Connection reset by peer]
gilead has joined #ruby
hadees has joined #ruby
gilead has quit [Remote host closed the connection]
<Muz>
katherinem13: array[1..-1]
MarGarina has quit [Ping timeout: 260 seconds]
<Muz>
katherinem13: that returns a section of the array from index position 1, through to the last item.
<Muz>
Or do you actually want to remove the first item from the start of the array? See Array#shift
nohonor has joined #ruby
<Muz>
The return value is the item removed, but the array itself would now hold the remaining items.
<katherinem13>
Muz: Oh, cool, didn't know the -1 syntax was shared. Cool. While I was waiting for a response, I found #drop. Any reason to prefer one over the other?
<katherinem13>
Just returning the array minus the first element is fine.
paolooo has quit [Quit: Page closed]
hadees has quit [Remote host closed the connection]
<Muz>
Readability of code, or if you're using the return value for something else, or passing the array around elsewhere etc
<Muz>
Whatever works for you, and is clean for you, go with really.
<w400z>
Muz that's money. thanks.
fgro_ has joined #ruby
<Muz>
It's missing storing the response from the b.get(link) to a file on disk, but I'm sure you can figure that out for yourself.
gilead has joined #ruby
<w400z>
yup
rutkla has quit [Ping timeout: 244 seconds]
<fgro_>
i have a method which expects key/value pairs as input parameters, say "def test(:url => x, :attribute => y ...)" . now i have a hash which i would like to pass to test(), as if the key/value pairs were written in the method call. Not sure if my question makes sense...
<shevy>
my $foo<>%()()=&&/=§&!!&)=°"&/()=°"&/(?&"?
<davidcelis>
shevy <3 perl
<Mon_Ouie>
He doesn't want Perl's awesomeness to get into Ruby
<perlsyntax>
oh really
kidoz has joined #ruby
<davidcelis>
perlsyntax: you should talk perl with shevy
<davidcelis>
he loves that shit
<xargoon>
ruby is perl with nice syntax
<shevy>
perl had a few cool things
<shevy>
like larry
<perlsyntax>
perl is cool i think.
<perlsyntax>
:)
<perlsyntax>
i try to get into ruby.
<shevy>
ruby is cooler
<perlsyntax>
how fast is ruby if ok to ask.
<shevy>
it took the good ideas from perl, took some more good ideas from somewhere else, then spoke japanese magic words, and there you got something beautiful
inteq has joined #ruby
<shevy>
as fast as perl
cantonic has quit [Quit: cantonic]
<perlsyntax>
i didn't know that.
cj3kim has quit [Quit: Leaving]
Hanmac has joined #ruby
<Muz>
Depends what you're asking it to do.
<davidcelis>
waiting for my ruby code to compile is like waiting for godot
<Hanmac>
shevy i think it counts the line ... you need more lines in javascript todo something like array.map(&:to_i).inject(:+)
mjbamford has joined #ruby
cbuxton has quit [Quit: Leaving.]
Eldariof59-ru has joined #ruby
johnlcox has quit [Ping timeout: 245 seconds]
krz has quit [Quit: krz]
Ethan has joined #ruby
jbw has joined #ruby
havenn has quit [Remote host closed the connection]
johnlcox has joined #ruby
voodoofish430 has joined #ruby
maxmmurphy has quit [Read error: No route to host]
Eldariof-ru has quit [Ping timeout: 252 seconds]
<shevy>
hmm
maxmmurphy has joined #ruby
davidcelis has joined #ruby
banisterfiend has joined #ruby
Squarepy has joined #ruby
andrewhl has quit [Ping timeout: 246 seconds]
toofar has quit [Quit: Ex-Chat]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
obryan has quit [Quit: Konversation terminated!]
<Hanmac>
shevy i think you should watch "adventure time" :P
syamajala has quit [Remote host closed the connection]
jonahR has joined #ruby
_s1n4_ has joined #ruby
<jrajav>
So, uh, what the hell is going on here. When I run this line in command, it runs fine: sudo -u jrajav ruby -e 'p eval(File.open("r_jrajav.rb", "r") {|f| f.read})'
Squarepy_ has joined #ruby
<jrajav>
However, when I run the same line with Ruby's popen3, it gives an error in 'spawn': No such file or directory
atrika has joined #ruby
<jrajav>
And sends back the whole line
Squarepy_ has quit [Read error: Connection reset by peer]
jpreyer has quit [Read error: Connection reset by peer]
sernin is now known as sphera
<jrajav>
I'm sure that I'm escaping the line correctly in Ruby -- that is precisely the line that the shell (or whatever Process#spawn sends it to) gets
<jrajav>
Okay. I hacked around the problem for now
al2o3cr has joined #ruby
<jrajav>
I'd still appreciate if anyone has input on the earlier question of mine
<jrajav>
Because as of now the bot is actually using two new script files for each scriptlet :/
mohits has joined #ruby
<jrajav>
However...
<jrajav>
>> 1 + 4
<al2o3cr>
(Fixnum) 5
<jrajav>
>> puts 'Heya'
<al2o3cr>
Heya
<al2o3cr>
(NilClass)
ggrocco has joined #ruby
h8R_at_work has quit [Ping timeout: 245 seconds]
<jrajav>
Hanmac: I also fixed for forkbombing
<jrajav>
*the
<jrajav>
I don't know if you were here for that
<jrajav>
Observe:
<jrajav>
>> while true; Process.fork end
<al2o3cr>
[Nothing on stdout]
<al2o3cr>
[FATAL] Failed to create timer thread (errno: 11)
<al2o3cr>
stderr:
<al2o3cr>
exit status: pid 4197 exit 1
<al2o3cr>
[FATAL] Failed to create timer thread (errno: 11)
abstrusenick has joined #ruby
elhu has joined #ruby
<jrajav>
Each scriptlet now has a resource limit of 2 seconds cpu time, 10mb file writing, and 2 processes
mucker has quit [Remote host closed the connection]
maxownz has joined #ruby
<Mon_Ouie>
>> "foo"
<al2o3cr>
(String) foo
<Mon_Ouie>
You should use #inspect, not #to_s
jonahR has quit [Quit: jonahR]
<jrajav>
?
<jrajav>
I'm not using to_s
<Mon_Ouie>
Yes you are, when you print the result
cakehero has joined #ruby
<Mon_Ouie>
Even if it's implicit
mxbtty has quit [Ping timeout: 260 seconds]
maxownz is now known as mxbtty
w400z has quit []
<jrajav>
The "outer" scriptlet is this: result = eval(File.open("r_#{m.user.nick}.rb", "r") {|f| f.read}); puts "(#{result.class}) #{result}"
jgrevich has joined #ruby
<jrajav>
Oh. I see. lol
<jrajav>
Wait, how was I doing it before then....
<jrajav>
I know I was using p..
<bradhe>
Load order question: If I do $ irb; require 'irb' then the gem loads fine. If I try to require 'irb' via rake, it blows up because it can't find the gem. Why would this be...?? same enviro
<Spooner>
bradhe : Using 1.8.7 and forgetting to require "rubygems"?
jonahR has joined #ruby
<jrajav>
Mon_Ouie: So should I do p "(" + result.class + ") " + result ?
<bradhe>
Spooner: Nope, I just figured it out actually. Renamed the relevant rake task from "irb" to "console" -- somehow the task name was colliding with the gem it would seem. #fml
chichou_ has quit [Remote host closed the connection]
<mspo>
I'm running into a problem with rack/passenger where it attempts to url decode cookie values and chokes
<mspo>
anyone know about this?
pfaff has quit [Quit: Leaving]
<banisterfiend>
bradhe: irb isnt a gem, it's in stdlib
excelsior has joined #ruby
pfaff has joined #ruby
<bradhe>
banisterfiend: got it, thanks.
Abbas| has quit [Ping timeout: 265 seconds]
Hanmac has quit [Ping timeout: 248 seconds]
perlsyntax has quit [Quit: Leaving]
liluo has joined #ruby
<jrajav>
Mon_Ouie: Do you have any idea how I would do that p eval($stdin.read) thing you were mentioning before? Right now I'm using popen3 to open the script; that doesn't have any option to pass things in through stdin, as far as I can see
<jrajav>
Mon_Ouie: But if I use pipeline_rw in the same module, then I can only get the resulting stdout, not stderr. Not that big of a loss; but we found out with the last bot that it can be useful to see the error message sometimes. For instance, to see if something is actually breaking or if it's just a syntax error
<Spooner>
bradhe : Everyone wants that, but that is no real reason to dismiss stuff. Plenty of more sensible reasons to not want pry though :P (takes a long time to load; none of its extra features are relevant to my use-case; etc.).
jrist is now known as jrist-mtg
alindeman has joined #ruby
Araxia has quit [Read error: Connection reset by peer]
Abbas5 is now known as Abbas|
spg has joined #ruby
spg has left #ruby [#ruby]
darren has quit [Remote host closed the connection]
axl_ has quit [Read error: Connection reset by peer]
Markvilla has quit [Ping timeout: 244 seconds]
axl_ has joined #ruby
spg has joined #ruby
Markvilla has joined #ruby
Markvilla has quit [Client Quit]
tewecske has joined #ruby
tewecske has quit [Max SendQ exceeded]
chichou has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
duper has joined #ruby
spg has left #ruby [#ruby]
dpk has quit [Quit: Asleep at the keyboard.]
levity_island has joined #ruby
levity_island has quit [Client Quit]
levity_island has joined #ruby
cearls has quit [Quit: cearls]
wangr has quit [Ping timeout: 252 seconds]
Clooth is now known as Clooth[afk]
Clooth[afk] is now known as Clooth
kidoz has quit [Quit: Ухожу я от вас]
bricker88 has joined #ruby
<bricker88>
There is no difference between "123".match(/1/), and /1/.match("123"), right? Is one of them "better" for any reason?
<Hanmac>
bricker88 both methods return ecaxly the same
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
Russell^^ has joined #ruby
stephenjudkins has joined #ruby
<Beoran__>
bricker88, if you youse variables, I guess a.match(/1/) looks better, but that's subjective.
eignerchris has quit [Ping timeout: 248 seconds]
<bricker88>
Beoran__: It seems to be more readable to use the string first
<jrajav>
For what it's worth, most languages act like you're executing a regex on a string
yekta has joined #ruby
<jrajav>
Erm.
<jrajav>
I mean, executing a regex, like, with a string as the parameter
<jrajav>
So /1/.match("123") makes more intuitive sense to me
yoklov has joined #ruby
<Beoran__>
jrajav, I'd say, use whatever,, just do t consistently in all your programs :)
<jrajav>
Well that's no fun ;D
<jrajav>
Variety is the spice of life!
gilead has quit [Quit: This computer has gone to sleep]
ianbrandt has joined #ruby
Russell^^ has left #ruby [#ruby]
scriabin has joined #ruby
specialGuest has joined #ruby
mxbtty has quit [Read error: Connection reset by peer]
<Spooner>
Why not just use this and be damned: [/1/, "123"].shuffle.tap {|a, b| a.match b }
yoklov has quit [Client Quit]
mxbtty has joined #ruby
<GeekOnCoffee>
yup, that's clearly more obvious
erichmenge has quit [Quit: Be back later]
v0n has quit [Ping timeout: 246 seconds]
<Spooner>
Sadly, it doesn't work, or I'd be pasting that into my code, GeekOnCoffee.
demian`_ has quit [Quit: demian`_]
<Spooner>
>> [[/1/, "123"].shuffle].map {|a, b| a.match b }.first
<al2o3cr>
(MatchData) #<MatchData "1">
manizzle has quit [Read error: Connection reset by peer]
Goles has quit [Quit: Computer has gone to sleep.]
grulf has joined #ruby
ddouglas has joined #ruby
ryanf has joined #ruby
yoklov has joined #ruby
<ddouglas>
hey guys, I need a term for a text-editor/IDE feature: what is that thing that puts the brackets around your code to show nesting and generally tell you that you've added the correct amount of "ends" to not get a syntax error?
<ddouglas>
and does it exist on gedit?
<shevy>
I think I know what you mean
<shevy>
I call it ... closing-bracket-highlighter
<shevy>
:D
<ddouglas>
does it exist on gedit in some form?
<ddouglas>
as a plugin or something?
<banisterfiend>
ddouglas: switch to a real editor, almost anything is better than gedit ;)
<shevy>
if I'd start from zero today, I'd pick up sublimetext... but I used bluefish first, and it kinda stuck to my brain. I am lazy to change
<shevy>
ddouglas I used gedit last about 5 years ago too, it was not very good back then. I tried it ~2 years ago or so, it improved quite nicely, but I still found it got into my way too often
kpshek has quit []
asteve has joined #ruby
scriabin has quit [Remote host closed the connection]
wangr has joined #ruby
codeFiend has quit [Ping timeout: 246 seconds]
aeontech has joined #ruby
<shevy>
man
<shevy>
so many on #debian
jankly has quit [Read error: Connection reset by peer]
iamjarvo has quit [Read error: Connection reset by peer]
jankly has joined #ruby
<Hanmac>
and shevy is anyone helping you there?
mxbtty has quit [Read error: Connection reset by peer]
tastycakeman has joined #ruby
mxbtty has joined #ruby
mxbtty is now known as Guest10915
Guest74974 has quit [Quit: Guest74974]
<shevy>
Hanmac nah
<shevy>
data.tar.gz vs. data.tar.xz
elhu has quit [Quit: Computer has gone to sleep.]
<Hanmac>
xz is cool :P
<shevy>
I suppose the answer to my question would be "use only .tar.gz for data and nothing else"
manizzle has joined #ruby
<shevy>
yeah
<shevy>
less space needed for my backups
<shevy>
glib-2.33.3.tar.xz 6.0M
<shevy>
glib-2.29.14.tar.bz2 7.1M
kpshek has joined #ruby
cbuxton has joined #ruby
tommyvyo has quit [Read error: Connection reset by peer]
scriabin has joined #ruby
tommyvyo_ has joined #ruby
_jorge has quit [Remote host closed the connection]
kyb3r has joined #ruby
specialGuest has quit [Remote host closed the connection]
x77686d has quit [Ping timeout: 244 seconds]
<ddouglas>
When trying to install geany, getting this: configure: error: Package requirements (gtk+-2.0 >= 2.16 glib-2.0 >= 2.20 gio-2.0 >= 2.20 gmodule-2.0) were not met:
<ddouglas>
No package 'gtk+-2.0' found
<ddouglas>
No package 'glib-2.0' found
<ddouglas>
No package 'gio-2.0' found
<ddouglas>
No package 'gmodule-2.0' found
dekroning has joined #ruby
<dekroning>
hi all
t_j has joined #ruby
johnlcox has quit [Quit: Computer has gone to sleep.]
<t_j>
having some threading issues, getting errors about being unable to launch threads
<ddouglas>
ahh installing from apt`-get now
specialGuest has joined #ruby
<t_j>
any ideas where to look or how to debug?
jrist-mtg is now known as jrist
aezop has quit [Remote host closed the connection]
kpshek has quit [Client Quit]
johnlcox has joined #ruby
ddouglas has quit [Quit: Ex-Chat]
spg has left #ruby [#ruby]
pu22l3r has quit [Read error: Connection reset by peer]
pu22l3r has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
Beoran__ has quit [Ping timeout: 246 seconds]
luther07 has joined #ruby
<maletor>
As long as I put magic encoding comments on line 1 I can do this in 1.9 right? title.gsub('—', '-')
<otters>
substitute - for -?
Clooth is now known as Clooth[afk]
<otters>
you don't need encoding comments for that
yoklov has quit [Quit: computer sleeping]
monkegjinni has joined #ruby
<maletor>
maybe irc didn't come thorugh, but the first one is a looooooong dash
<sneakyness_wk>
first result for "using rake" on teh googles
tatsuya_o has joined #ruby
dtribble has joined #ruby
<shevy>
lol
<Spooner>
Oh, I see. Well, it does introduce the idea of dependencies. I have to admit I've used Rake a fair bit, but I've never used it to build C stuff.
jonathanwallace has joined #ruby
<shevy>
I never found my way into rake
<eam>
my understanding is that rake offers nothing compelling
schaerli has quit [Remote host closed the connection]
<eam>
it's just another NIH component
<shevy>
yeah, that was my impression quite a bit too, strangely. but everyone else seems to love it
lurch_ has left #ruby [#ruby]
<shevy>
but for me, I just write methods, put them into different .rb files, and then call them via aliases from the shell
jonathanwallace has quit [Remote host closed the connection]
<sneakyness_wk>
yeah I'm trying to get through all the hype
<shevy>
I think it was perhaps meant as a replacement to Makefile syntax
pu22l3r has quit [Ping timeout: 246 seconds]
hadees has joined #ruby
jonathanwallace has joined #ruby
<eam>
Mon_Ouie: yeah see, that's nonsense as far as I'm concerned
<shevy>
so perhaps it's better there... I don't know. I'd never write a Makefil by hand, I'd rather write ruby scripts to generate them for me
sendoushi has quit [Remote host closed the connection]
<eam>
there are a number of ways to improve what make does, but I don't see any of them incorporated in rake
<Spooner>
Makefiles aren't dynamic. That is the big difference.
<eam>
it ends up being just another way to fracture build systems
<eam>
Spooner: sure they are
meoblast001 has joined #ruby
Requiredev has quit [Read error: Connection reset by peer]
geekbri has quit [Ping timeout: 276 seconds]
<banisterfiend>
eam: because with rake you can stick to the Makefile-esque DSL, or you can drop down to ruby to do especially tricky stuff. The point is, you have a powerful, full programming language at your disposal whenever you need it
<Spooner>
eam You can put arbitrary code in a makefile? I'm not talking about just globbing paths and such (been a decade since I used makefiles though).
<sneakyness_wk>
pretty sure with the power of shell scripting you can do just about anything
verbad has joined #ruby
<banisterfiend>
eam: or if you dont need it, you can just stick to the DSL, which is clean and distinctive enough to nicely fulfill the typical Makefile use case
<sneakyness_wk>
I guess I'm just not seeing what ruby has to offer in this situation
asteve has quit []
codeFiend has joined #ruby
<eam>
banisterfiend: to me that's not a good thing -- I would prefer to generate the dependency structure into as much of a static format as possible
bluOxigen has joined #ruby
<Spooner>
shell scripts are terrible compared to Ruby (or Python or Lua).
<eam>
now, if someone replaced make with a structured yaml format ...
<banisterfiend>
eam: it's up to you what features you want to use, you can stick to the simple declarative DSL, or if you want (but only if you want) you could branch out to other stuff. Further the typical use case for Rake is not a Make replacment
<eam>
but the point is, toolchains which generate arbitrarily complex make rules have been around for decades, and they're cross platform and all that great stuff
poc has joined #ruby
<banisterfiend>
it's for automating general tasks for your ruby project
<Mon_Ouie>
Well, writing a Ruby script that just uses system/fork/popen at every line instead of a shell script is ridiculous
aeontech has quit [Ping timeout: 246 seconds]
asteve has joined #ruby
<eam>
Mon_Ouie: why?
<eam>
it's not ridiculous at all -- writing typical "shell script" jobs in ruby/python/perl prevents common escaping and quoting errors
<Mon_Ouie>
There's more noise with all the system calls than with a regular shell script
<banisterfiend>
like running tests, pushing gems, build C extensions, running profilers, and so on
stephenjudkins has quit [Quit: stephenjudkins]
<eam>
it's best practice
<eam>
Mon_Ouie: no way
<eam>
when you write "correct" shell with proper quoting it's just as or more noisy than ruby
<shevy>
Mon_Ouie I tend to just use a method that sanitizes that
internet_user has quit [Remote host closed the connection]
<eam>
eg every variable reference in ""
<Spooner>
eam So has Ruby (been around for decades, if less decades, and cross-platform). C has been around for decades and works fine, but people still use Ruby and Java. Not sure you're getting anywhere with the "it works, so never improve it" argument.
<shevy>
C never escaped the UNIX prison
<sneakyness_wk>
sorry for coming in here and stirring you guys up :)
<eam>
Spooner: there's a difference between "don't improve it" and "don't reimplement without reason"
<eam>
improving make and other build systems would be great -- rake does not do that
bothra has quit [Ping timeout: 245 seconds]
<eam>
it's just typical NIH syndrome
<shevy>
why does make insist on tabs :(
<eam>
shevy: yeah that's dumb
<banisterfiend>
eam: do you see how Rake is primarily used?
<banisterfiend>
eam: have oyu looked at a standard ruby project to see how it's actually used?
<shevy>
well ok... as I don't plan to write Makefiles by hand, I don't mind either way, but this seems such a trivial thing, that could only have been carried along because they must have been anxious to change it, and thus break older Makefiles?
Squarepy has quit [Quit: Leaving]
<Spooner>
banisterfiend : I think I get it. Rake used to do exactly the same thing that Make does, isn't actually better, which I can certainly see.
<eam>
banisterfiend: yes, and I don't like it. I'm not a fan of mixing up code snippets with what should be structured relationships between build artifacts or deployment steps
[Neurotic] has joined #ruby
<eam>
banisterfiend: I think many ruby folks may not have seen make used to drive similar processes
lorandi has quit [Quit: Leaving]
answer_42 has quit [Quit: WeeChat 0.3.8]
<Spooner>
sneakyness_wk : Yeah, we never argued before about anything. You are a bad influence :D
<banisterfiend>
eam: you should write a blog post on it and see what people say. But there is a simplicity to Rake, and its integration in the ruby ecosystem that makes it a natural tool for managing tasks related to ruby projects
<sneakyness_wk>
Spooner: I know better than to think that ;D
sendoushi has joined #ruby
v0n has quit [Ping timeout: 246 seconds]
stkowski has joined #ruby
<eam>
banisterfiend: I understand, and taken in isolation it's no big deal. But when every language attempts to re-invent the world it makes a big mess
adamkittelson has quit [Remote host closed the connection]
<eam>
that's my major complaint
<eam>
if all you do is ruby then great :)
<Spooner>
It is hard to make a dynamic build tool that is language-agnostic. Make is agnostic because it is incredibly limited in what it attempts to do.
<banisterfiend>
eam: every language has its own specific needs that aren't always met by a more general tool, look at rubygems vs debian packages for example
miho has quit [Ping timeout: 276 seconds]
<eam>
banisterfiend: mmm see that's a bad example, I have the same opinion with respect to language specific packaging
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
<graft>
hi ho, anyone know how to get file completion in irb?
sailias has quit [Ping timeout: 265 seconds]
s1n4 has quit [Quit: peace out]
<eam>
Spooner: I'd suggest that the separation of concerns is valuable
<eam>
most ruby projects are not terribly large (including ruby itself)
workmad3 has joined #ruby
<banisterfiend>
eam: so youd' want us to spam debian packages with a tonne of ruby libraries? and what about all the other packaging systems, macports and brew ? And how do you ensure each packaging system has the same packages that are at the same version level?
<eam>
so it's easy to gloss over the importance of build architecture
<eam>
the concept of repositories solves the "spam" issue you raise. Macports, brew, and other re-hashes without good reason fall into the same category -- they could just as easily all use rpm, or deb
<eam>
or some other universal format with a fully fleshed out packaging solution
<banisterfiend>
eam: so you're talking "perfect world" :) We have to deal with the world as we find it
<banisterfiend>
rubygems is realistic solution for a messy world
<eam>
well, I'm talking about how I do things
<banisterfiend>
well ify ou're just one person it's easy
<eam>
and all I'm saying is I'm let down by the solutions others find :)
<banisterfiend>
if you have to support a huge community of developers
Goles has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<banisterfiend>
it's a bit more difficult
<eam>
banisterfiend: not one, ten thousand-ish
adamkittelson has joined #ruby
allyraza has quit [Ping timeout: 245 seconds]
<eam>
I support a very large ecosystem
<eam>
or did, when I did packaging
tastycakeman has quit [Ping timeout: 240 seconds]
<eam>
millions of packages, many many thousands of developers
<eam>
I understand the challenges
<eam>
that's why I'm opinionated about build systems and packaging
arturaz has quit [Remote host closed the connection]
sgronblom has quit [Ping timeout: 276 seconds]
beneggett has joined #ruby
<banisterfiend>
well, when you get every OS to use rpm as the default
<eam>
I also worked with a large number of language platforms, and each one had an incomplete story when it came to build and package
<banisterfiend>
i guess they'll consider retiring rubygems