<terrellt>
shevy: No, but my employer is, and free computers are good.
<benzrf>
shevy: i use linix
<shevy>
platzhirsch we two are like the last linuxers
<lewellyn>
Linux duchess.greenviolet.net 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 11:13:47 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux
<shevy>
didn't you say you use windows!
<lewellyn>
as a window manager.
choobie has quit [Quit: choobie]
<lewellyn>
Interix boojum 6.2 10.0.7063.0 x86 Intel_x86_Family6_Model58_Stepping9 Windows
<lewellyn>
i have a local shell, of course, though.
<terrellt>
platzhirsch: What is this?
<terrellt>
platzhirsch: Metadata census that is.
mansi has quit [Ping timeout: 260 seconds]
<platzhirsch>
terrellt: It's my master's thesis project
<benzrf>
platzhirsch: o:
<platzhirsch>
metadata aggregator, computes quality metrics on open government data portals and ranks them
<terrellt>
platzhirsch: For where? Sorry, library developer for a university, you peaked my interest.
bennyboobooboo has quit [Remote host closed the connection]
<terrellt>
platzhirsch: How is quality defined?
zxd has quit [Ping timeout: 272 seconds]
<lewellyn>
terrellt: qualitatively!
<platzhirsch>
by different metrics, like completeness (number of fields filled out), readability (reading ease), availability (url link checker), etc. each results in a metric score that get aggregated to a total score
<terrellt>
Masters in CS?
<benzrf>
nice bootstrap
<benzrf>
:3
mary5030 has joined #ruby
<platzhirsch>
terrellt: yeah
percival__ has joined #ruby
percival__ is now known as percival_m
joaoh82 has joined #ruby
kevind_ has joined #ruby
<terrellt>
platzhirsch: Librarians may be interested in this. When you're done, you may want to shoot a note to the mailing list behind code4lib. Very cool dude, platzhirsch++
<platzhirsch>
terrellt: good to know, I will take note.
Megtastique has joined #ruby
kevind_ is now known as kevind
<benzrf>
bbl
benzrf is now known as benzrf|dinner
phipes has quit [Remote host closed the connection]
horofox_ has quit [Quit: horofox_]
snath has quit [Ping timeout: 272 seconds]
<platzhirsch>
shevy: there are these startups which offer you full Apple equipment as a perk
<platzhirsch>
I wonder if that includes any other vendor
<platzhirsch>
Sorry, Mac only, you have to leave this company again
SHyx0rmZ has joined #ruby
<platzhirsch>
and if not you would be the ultimate outcast, everytime there is a problem on your machine and not the others... they will hate you
mary5030 has quit [Remote host closed the connection]
bilbo_swaggins has joined #ruby
fgo has joined #ruby
bilbo_swaggins has quit [Client Quit]
bennyboobooboo has joined #ruby
newUser1234 has joined #ruby
deens has quit [Remote host closed the connection]
subbyyy has joined #ruby
lfox has quit [Quit: ZZZzzz…]
burlyscudd has quit [Quit: Leaving.]
drumusician has quit [Ping timeout: 246 seconds]
sailias has quit [Ping timeout: 240 seconds]
burlyscudd has joined #ruby
kitak_ has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
zeade has quit [Quit: Leaving.]
subbyyy_ has quit [Ping timeout: 272 seconds]
Ohga has joined #ruby
Mars___ has quit [Read error: Connection reset by peer]
ringaroses has joined #ruby
Mars has joined #ruby
Mars is now known as Guest47780
phipes has joined #ruby
w_alexus has quit [Ping timeout: 252 seconds]
<Ohga>
hi, anyone testing with the Bacon gem around? I've got a strange exception when calling #it without a block. I should get a failure "not implemented" but it raise ArgumentError
mneorr__ has quit [Remote host closed the connection]
<shevy>
I am looking at a pdf generator in ruby, the fpdf one
<shevy>
there are things like:
<shevy>
out '/Decode [1 0 1 0 1 0 1 0]'
mneorr has joined #ruby
kitak has quit [Ping timeout: 245 seconds]
<Ohga>
.. and I'm running the tests with a Rake::TestTask
<shevy>
I understand that this is some pdf specification probably. anyone knows if this is official documentation I can view?
vlad_starkov has quit [Read error: Connection reset by peer]
<shevy>
I haven't seen this yet
<shevy>
platzhirsch, which of the two ^^^ do you prefer?
<ericwood>
lol updating it to work with ruby 1.9
<platzhirsch>
shevy: I tend to prefer the require ones
emocakes has joined #ruby
<platzhirsch>
I think I switched some of mine to require_relative to work equally when calling code from a Raketask
<shevy>
hmm
<shevy>
they are about the same length in the example here now
barratt has quit [Quit: Leaving...]
mneorr has joined #ruby
horofox_ has joined #ruby
<platzhirsch>
shevy: but it seems _relative has more redundant characters, so if you compress the file at some point you save more file size?
<shevy>
I don't mind the file size compressed
<shevy>
I mind the time it takes me for extra keystrokes
b00stfr3ak has quit [Ping timeout: 272 seconds]
guinslym has joined #ruby
<shevy>
or for how easy it is to read something
<shevy>
platzhirsch, right now I stare at:
<shevy>
i.read(1).unpack('C')
<shevy>
where i is input to a method... hmm
XenoWolf has joined #ruby
<shevy>
I have seen unpack before
<shevy>
but .read(1) ? hmm
<platzhirsch>
Reminds me of the PhD thesis which could be summarized as: If you look at Van Gogh’s paintings closely, you’ll realize you’re using your brain to analyze them.
krz has joined #ruby
phipes has quit [Remote host closed the connection]
toastynerd has joined #ruby
<platzhirsch>
shevy: yeah that's definitely some fun time you found there
jamesaanderson has joined #ruby
fusi0n has quit [Quit: .]
Megtastique has joined #ruby
<shevy>
I kinda morphed parts of it already so I can better understand it
axl_ has quit [Quit: axl_]
<shevy>
self.Cell(l/1000.0*@FontSize,h,s[j,i],0,0,'',0,link) if i!=j
<shevy>
:\
Ohga has left #ruby [#ruby]
Jdubs has quit [Remote host closed the connection]
<platzhirsch>
just found old chat logs of you shevy
<platzhirsch>
god I hate irc logging that gets indexed by google
<shevy>
lol
sharms has quit [Ping timeout: 240 seconds]
<shevy>
there is so much information crammed into just one method call
<shevy>
I mean take it... not only is it capitalized, it accepts at the least 8 arguments
<platzhirsch>
so your first two projects in Ruby were an IRC bot and a game? And you certainly broke the bot
<shevy>
:(
deens has joined #ruby
<shevy>
platzhirsch, yeah...
<shevy>
it was how I came to ruby
<platzhirsch>
Robot means slave
<shevy>
I failed to make a bot in php
<shevy>
but my bot worked in ruby
LinearInterpol has left #ruby ["Hack the planet."]
<shevy>
that means that the better language helps a dumber person move further down the road
axl_ has joined #ruby
jamesaanderson has quit [Client Quit]
<platzhirsch>
Sounds like a book title
zz_karupanerura is now known as karupanerura
<platzhirsch>
"Learn Ruby and feel dumber while solving problems"
<shevy>
it's more like elementary wisdom
tylersmith has quit [Remote host closed the connection]
toastynerd has quit [Ping timeout: 245 seconds]
Bumptious has quit [Remote host closed the connection]
<shevy>
nono not just ruby, I mean in general
<shevy>
things like "use the right tool for the job"
sharms has joined #ruby
<shevy>
I changed it to "use the better tool for the job"
fedesilva has joined #ruby
saarinen has quit [Quit: saarinen]
superscott[8] has quit [Quit: superscott[8]]
Bumptious has joined #ruby
<shevy>
man, I find so many weird things in this project
<shevy>
nl=nl+1
predator217 has joined #ruby
<platzhirsch>
wow I guess you need to slam a lot of Ruby idioms into the refactoring process
predator117 has quit [Read error: Operation timed out]
<shevy>
how can you make a method with 107 lines!
mneorr has quit [Remote host closed the connection]
<platzhirsch>
Might it be he translated the PHP code line by line?
FifthWork has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<shevy>
I think so
mneorr has joined #ruby
<shevy>
the code is very atypical for ruby
bigbadbear has joined #ruby
<shevy>
while (c = freadbyte(f)) != 0xff
<shevy>
I guess I am convincing myself to give up and use prawn instead
<platzhirsch>
Yesterday I started to use a Ruby idiom in Python, which seems really wrong. While it make sense, one should stick to the native language's idioms
krz has quit [Ping timeout: 252 seconds]
meatherl_ has joined #ruby
<shevy>
another cool example:
<shevy>
@InFooter = true
<shevy>
self.Footer
<platzhirsch>
xD
<shevy>
well, I'd like to have this compared
<platzhirsch>
prawn looks like a proper open source king pin. 2,4k commits
<shevy>
like, take 10 projects from PHP written by a good PHP hacker. and take 10 projects from python written by a good python hacker
<shevy>
and then have one ruby hacker, a good ruby guy, translate these things into ruby
newUser1234 has quit [Remote host closed the connection]
<shevy>
(with a time limit)
cameronbarton has quit [Quit: cameronbarton]
<shevy>
I'd assume that the code from the python will be cleaner, even translated into ruby
<terrellt>
Well, you just had one guy write 20 projects.
<terrellt>
He's probably tired.
<miah>
i have yet to see nice oop python code
meatherly has quit [Ping timeout: 272 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
<platzhirsch>
My institute does this language comparison every year or two. One project, different teams, different languages, same project specification
mansi has joined #ruby
b00stfr3ak has joined #ruby
b00stfr3ak has joined #ruby
b00stfr3ak has quit [Changing host]
nanoyak has quit [Quit: Computer has gone to sleep.]
bigbadbear has quit [Ping timeout: 246 seconds]
<terrellt>
platzhirsch: More than one team per language I hope.
<platzhirsch>
terrellt: It's often difficult to find enough volunteers
kitak_ has quit [Remote host closed the connection]
horofox_ has quit [Quit: horofox_]
mneorr has quit [Ping timeout: 272 seconds]
jerius has quit []
kitak has joined #ruby
sassamo_ has quit [Remote host closed the connection]
Killa has quit [Remote host closed the connection]
<fire5>
I'm a curious, does anyone know how to call a method from another method? I'm having trouble solving a puzzle I'm working on and I think that is what its trying to get me to do.
<binaryhat>
blehh
Hobogrammer_ has quit [Read error: Connection reset by peer]
meatherly has quit [Ping timeout: 252 seconds]
nanoyak has quit [Quit: Computer has gone to sleep.]
aspires has quit []
gja has joined #ruby
<shevy>
fire5 you can call a method inside of a method
<shevy>
def foo; puts 'foo'; end; def bar; foo; end
nanoyak has joined #ruby
<benzrf>
fire5: thers nowhere to call methods from besides other methods...
varfoo has joined #ruby
<benzrf>
i guess from blocks?
mneorr has quit [Remote host closed the connection]
<benzrf>
oh i guess there are class bodies
mneorr has joined #ruby
<fire5>
benzrf: Here is the example then. x=measure {sleep 5}. Then x should equal 5.
<fire5>
I assume what this block is doing is calling on another method called sleep.
<fire5>
Which is taking in 1 arguement which is a number.
<fire5>
So If I make a sleep method.
<fire5>
It should call on that method, no?
<benzrf>
yeah
tylersmi_ has joined #ruby
binaryhat has quit [Quit: Leaving]
<fire5>
benzrf: I did that and it says it fails.
<benzrf>
sleep already exists though
<fire5>
Its is a puzzle that is basically rspec tests.
<fire5>
I made one method called measure and another called sleep.
lfox has joined #ruby
<benzrf>
sleep already exists
<benzrf>
it pauses for the number of seconds you pass it
psyl0n has joined #ruby
tylersmith has quit [Ping timeout: 252 seconds]
<shevy>
def sleep(i); return i; end; def measure; return yield if block_given?; end; x = measure { sleep 5 }; p x # => 5
<shevy>
<fire5>
benzrf: So its basically a default method already in ruby?
<benzrf>
fire5: right
<benzrf>
it is in Kernel i think
<fire5>
Sigh, then I am lost.
mneorr has quit [Ping timeout: 252 seconds]
eka has quit [Quit: Computer has gone to sleep.]
<fire5>
I passed one test which basically just calls on measure with a blank block. It returns 0.
<benzrf>
i think the idea is that you are supposed to write a method called measure which times the block
<fire5>
I basically put 0 in the method and get test to pass.
<fire5>
Then the above occurs and I am lost how to make that pass.
<fire5>
benzrf: You are right.
<fire5>
That is the idea.
fijimunkii has joined #ruby
<fire5>
I'm sucking at this puzzle too.
<benzrf>
heh
<fire5>
benzrf: Is a timing thing is the time ruby docs?
IceDragon has quit [Ping timeout: 246 seconds]
<fire5>
benzrf: Or am I approaching this completely wrong?
<benzrf>
think about it.
<benzrf>
don't try to think in terms of ruby
<benzrf>
think in terms of common sense
<benzrf>
if you want to know how long something takes, how can you find out?
<benzrf>
if you do not have a stop watch
<fire5>
count
<benzrf>
:p
<benzrf>
lets say it's a multi-minute thing
havenwood has joined #ruby
subbyyy has quit [Ping timeout: 252 seconds]
<benzrf>
you want to find out how long it takes you to walk accross your town
<benzrf>
no counting/stopwatche
<benzrf>
s
<benzrf>
how can you find out?
<benzrf>
dont try to be clever
<fire5>
Ummm, let me try to think, um...
<benzrf>
just think of how you would actually do it
<fire5>
measure the distance and compare where the sun is when you started til finish?
<benzrf>
09:13 < benzrf> dont try to be clever
<benzrf>
look at a clock at the beginning
<benzrf>
look at one at the end
<benzrf>
subtract
<fire5>
Oh, sorry.
<fire5>
I was making this too complicated.
<fire5>
I see.
<benzrf>
i find that beginners tend to do that a lot
<fire5>
So then maybe just make an object.
<fire5>
Have it be time.now
<benzrf>
programming is just telling the computer what to do in a way that it understands
<fire5>
and then compare to the new time .
Galgorth has joined #ruby
<benzrf>
right!
<Jake232>
a = Time.now; do_something; time_taken = Time.now - a;
jamesaanderson has joined #ruby
pwh has quit []
jamesaanderson has quit [Max SendQ exceeded]
<fire5>
Thanks, jeez, I don't know why I didn't see this.
<fire5>
I really enjoy programming, but I have a lot to learn.
jamesaanderson has joined #ruby
<benzrf>
get used to it
<benzrf>
programming means running into that feeling at least once per day for the rest of your life
<benzrf>
assuming you program every day
<benzrf>
you will never escape the 'OH CRAP IT WAS OBVIOUS'
<Jake232>
I wish it was only once per day ;)
joaoh82 has joined #ruby
<benzrf>
i said 'at least'
<fire5>
Yeah, but I'm really bad right now. And I eventually want to get a job in this.
<fire5>
I work in finance right now.
<benzrf>
no way man
<fire5>
But really want this.
<fire5>
Its just frusterating I guess.
<benzrf>
the fact that you managed to jump from a real life description to how to do it in code shows that you at least have a LITTLE skill yet
<benzrf>
;p
<Jake232>
Be glad you ended up with ruby anyway
<Jake232>
or python
<Jake232>
and not PHP
<Jake232>
;)
<benzrf>
programming is the art of training yourself to think in ways other than your natural state
nhhagen has quit [Remote host closed the connection]
<fire5>
I guess, I'm still stuggling here. I wont ask for any more help though. I will try to solve it from here and come back tomorrow if I can't figure it out.
<fire5>
For some more hints.
<benzrf>
:0
<benzrf>
no shame in hints
<benzrf>
i ask for help all the time
<benzrf>
copying code is How It's Done
fijimunkii has quit [Ping timeout: 272 seconds]
<benzrf>
your skill as a programmer is creating a program that:
<fire5>
Yeah, but I guess I need to figure things out on my own otherwise IDK. I wish I had some mentor in real life who could help guide me.
<benzrf>
a. does what it should
<benzrf>
b. is readable and alterable
<benzrf>
anything else is secondary\
stkowski_ has joined #ruby
<benzrf>
if you copy somebody else's code, that does not make you a bad programmer
<benzrf>
it makes you a resourceful one
<benzrf>
;)
Hanmac has joined #ruby
<fire5>
Yeah, true :).
<fire5>
That is what I do, is google a lot.
<fire5>
And look at stack overflow.
stkowski_ is now known as stkowski
<benzrf>
that is the mark of a smart programmer
<benzrf>
stackoverflow is invaluable
<Jake232>
I kid you not, one of the best skills a programmer can have
AlSquire has quit [Quit: This computer has gone to sleep]
<Jake232>
is learning how to google their questions correctly
<Jake232>
If you can work out how to ask what you want, and put it into words
<fire5>
If I cant find it that way, I come here or somewhere else I guess, lol :P.
<benzrf>
figuring out all of the tricky little ways to solve specific problems like timing things is very tempty
<benzrf>
*tempting
<Jake232>
the chances are somebody has been in the situtation before, and generally somebody who is a better programmer than you has already asked it
<benzrf>
but it is not the real point
havenwood has quit [Ping timeout: 252 seconds]
sassamo has quit [Remote host closed the connection]
<benzrf>
if you can figure it out, good for you!
joaoh82 has quit [Ping timeout: 246 seconds]
<benzrf>
if not, googling it is not something to be ashamed of
<benzrf>
but since they get their point across, they are still good stories
Hanmac1 has quit [Ping timeout: 252 seconds]
<benzrf>
*good stories are, w/e
lukec has quit [Quit: lukec]
IceDragon has joined #ruby
<fire5>
Yeah, true.
<benzrf>
but dont sweat the not-figuring-things-out part
<fire5>
I will keep googling and "cheating" then, even though its really just learning.
<benzrf>
no matter how good you get there will always be somebody smarter who figured out your problem already
<benzrf>
fire5: it's good to try to figure it out, just to acclimate yourself to the language
<benzrf>
just don't concentrate on something to the point of wasting time when you could be looking it up
<fire5>
benzrf: True.
agent_white has joined #ruby
<benzrf>
the real key is to get yourself to think in terms of the language
<fire5>
benzrf: I'm going to be going to sleep soon. Do you think the article that Jake linked would help me solve this btw?
<benzrf>
maybe, i didnt look at it
<fire5>
Jake232: Thanks for the article btw.
mneorr has joined #ruby
iMe has quit [Ping timeout: 240 seconds]
<fire5>
benzrf: Reason I ask is because I was going to bookmark it and save it.
<fire5>
And read it tomorrow after work.
<fire5>
Or, if not, I would just ask for one more hint before leaving.
<Jake232>
fire5: No problem.
<benzrf>
fire5: that looks like it explains how to use a nice built in module in ruby designed for solving this
<benzrf>
not how to do it from scratch
<fire5>
oh, probably not what I want then.
<benzrf>
you figured it out earlier anyway :)
<benzrf>
i said the looking at clocks thing and you replied with a description of the correct answer
Mars has joined #ruby
<fire5>
Yes, I don't know how to turn it into code to solve this rspec though.
sassamo has quit [Ping timeout: 272 seconds]
<benzrf>
ah
<fire5>
There is code before this.
<fire5>
That asked to see if time didn't pass.
Mars is now known as Guest33399
<fire5>
basically, just a the method with no block.
nisstyre has quit [Quit: Leaving]
<fire5>
I put 0 in the method.
<fire5>
It solved the problem.
<fire5>
Then the sleep 5 was introduced.
<fire5>
And now I'm lost.
<benzrf>
well, running that block takes 5 seconds
<benzrf>
more like 5.000001 actually or something
Brolen has joined #ruby
iMe has joined #ruby
<benzrf>
the sleep call should take just about 5 seconds to complete because that is what sleep does
Galgorth has quit [Quit: Galgorth]
<benzrf>
how do you define a method that figures out how long it takes to run the block you give it?
deens has joined #ruby
pwh has joined #ruby
<fire5>
I'm trying to think.
gja has quit [Quit: This computer has gone to sleep]
cj3kim has quit [Remote host closed the connection]
<benzrf>
just write down a series of steps
<benzrf>
think of it as what you would do if you were the computer
<fire5>
1.) Define method
baroquebobcat has joined #ruby
<fire5>
2.) compare start time to new time
<fire5>
3.) Return the difference
Galgorth has joined #ruby
robertrv has joined #ruby
<benzrf>
ok, now turn that into code
Guest33399 has quit [Remote host closed the connection]
<benzrf>
dont worry about if its correct
<benzrf>
once you have something incorrect but extant, you have something to work off o
<benzrf>
f
<benzrf>
like writing a bad draft, then correcting it
<Galgorth>
Hi, quick newbie question.. if I define a method in rib, why doesn't that method show up as a class when I use .class on it? For example, a_plus_b.class returns an error message 'wrong number of arguments'
<Galgorth>
*irb
<benzrf>
it's easier to see the problem sometimes if you write it down
<benzrf>
Galgorth: what do you mean?
<benzrf>
Galgorth: you are trying to call a_plus_b, then call class on the result
heidi has quit [Quit: Leaving.]
<benzrf>
Galgorth: but you arent giving a_plus_b any args
<fire5>
Time.now-Time.now
<fire5>
Inside the method
<Galgorth>
benzrf: Can't I just call class on the method itself?
<fire5>
Solved the problem, although I had to vary that code a bit to match with the instance variable.
<benzrf>
Galgorth: the method itself isnt an object
Liothen has quit [Remote host closed the connection]
<benzrf>
fire5: sort of.
<Galgorth>
benzrf: I read that everything in ruby is an object though
<benzrf>
fire5: you need to measure how long _running the block_ takes
<benzrf>
Galgorth: all values are objects
<benzrf>
Galgorth: methods are not values
deens has quit [Ping timeout: 252 seconds]
dik_dak has quit [Quit: Leaving]
Liothen has joined #ruby
<benzrf>
Galgorth: methods are in a separate namespace from variables
<Galgorth>
benzrf: Ahhh ok, so not *everything* is an object lol.. guess that article must have been incorrect
emocakes has quit [Quit: Leaving...]
<benzrf>
Galgorth: no, all values are objects
<benzrf>
Galgorth: methods just arent values
<fire5>
benzrf: I think I read the rspec code more and figure out what its doing. Its setting an initial time of 11:00am.
<Galgorth>
benzrf: Ok, thanks
Barrin6 has joined #ruby
<benzrf>
fire5: let's say you have a block in front of you.
<Galgorth>
benzrf: Where can I read about the different namespaces underlying ruby?
<fire5>
It is then in the first two asking if nothing is passed in a block, what time has passed.
nanoyak has quit [Read error: Operation timed out]
<benzrf>
fire5: how can you figure out how long running the block takes?
<benzrf>
Galgorth: I can tell you :)
<benzrf>
Galgorth: there are constants, ivars, methods, local vars, and class vars
<benzrf>
there, that's it
Spami has quit [Quit: This computer has gone to sleep]
<fire5>
Look at the time when it started and compare to when it finished.
<benzrf>
Galgorth: have you done any other languages?
<fire5>
And subtract the two times.
<Galgorth>
benzrf: I see.. so all of those are objects except methods? And what are ivars?
<benzrf>
fire5: ok, turn that into a series of steps.
digital-ghost has quit [Remote host closed the connection]
<benzrf>
Galgorth: no, those are namespaces
<benzrf>
Galgorth: meaning, sets of names where the same one overlaps
<benzrf>
Galgorth: so you have have a local var and a method called the same thing
<benzrf>
Galgorth: but not 2 local vars named the same
mansi has quit [Remote host closed the connection]
nanoyak has joined #ruby
dik_dak has quit [Quit: Leaving]
bricker`LA has joined #ruby
Spami has joined #ruby
okinomo has joined #ruby
kiri has quit [Ping timeout: 272 seconds]
h_kon has joined #ruby
kiri has joined #ruby
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
browndawg has joined #ruby
mneorr has quit [Remote host closed the connection]
noop has joined #ruby
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mneorr has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
daniel_sun has quit [Quit: Leaving]
moholinati has joined #ruby
mneorr has quit [Ping timeout: 272 seconds]
mengu has quit [Remote host closed the connection]
sassamo has joined #ruby
apeiros has quit [Remote host closed the connection]
`petey` has joined #ruby
dogweather has quit [Remote host closed the connection]
apeiros has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
camilasan has joined #ruby
dmarr has joined #ruby
brennanMKE has quit [Remote host closed the connection]
mjmac has joined #ruby
mbff has joined #ruby
nhhagen has joined #ruby
epochwolf has joined #ruby
DarkFoxDK has joined #ruby
aetaric has joined #ruby
flagg0204 has joined #ruby
seich- has joined #ruby
kenichi has joined #ruby
Nightmare has joined #ruby
Paradox has joined #ruby
mbff is now known as Guest8854
brennanMKE has joined #ruby
utkarsh has joined #ruby
poutine has joined #ruby
blo has joined #ruby
okinomo has quit [Ping timeout: 265 seconds]
artgoeshere has joined #ruby
sophomorical has joined #ruby
atraylen2 has quit [Ping timeout: 246 seconds]
`petey` has quit [Ping timeout: 253 seconds]
apeiros has quit [Ping timeout: 260 seconds]
moholinati has quit [Quit: Leaving]
moholinati has joined #ruby
sassamo has quit [Ping timeout: 240 seconds]
St_Marx has joined #ruby
nhhagen has quit [Ping timeout: 246 seconds]
jgrevich has joined #ruby
brennanMKE has quit [Ping timeout: 260 seconds]
pu22l3r has quit [Ping timeout: 272 seconds]
zz_jrhorn424 has joined #ruby
zz_jrhorn424 is now known as jrhorn424
croaky has quit [Ping timeout: 252 seconds]
pu22l3r has joined #ruby
enape_101 has quit [Ping timeout: 272 seconds]
xorgnak has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
Kneferilis has quit [Read error: Connection reset by peer]
timonv has joined #ruby
geggam has quit [Remote host closed the connection]
tylersmith has quit [Remote host closed the connection]
xorgnak has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
okinomo has joined #ruby
joaoh82 has joined #ruby
shedd has quit [Remote host closed the connection]
progrock has joined #ruby
havenwood has quit [Remote host closed the connection]
pranny has joined #ruby
<progrock>
Hi, I'm a pretty well versed programmer... looking to pick up the basics of ruby's syntax.... anyone got a good reference site... maybe one directed towards programmers?
Bumptious has quit [Remote host closed the connection]
havenwood has joined #ruby
m00nlight_ is now known as m00nlight
Bumptious has joined #ruby
choobie has joined #ruby
joaoh82 has quit [Ping timeout: 252 seconds]
fgo has joined #ruby
okinomo_ has joined #ruby
havenwood has quit [Ping timeout: 252 seconds]
camilasan has quit [Ping timeout: 240 seconds]
reset has joined #ruby
okinomo has quit [Ping timeout: 252 seconds]
Wolland has joined #ruby
agent_white has quit [Quit: night]
Mars has joined #ruby
brennanMKE has joined #ruby
Mars is now known as Guest75744
fgo has quit [Ping timeout: 252 seconds]
gasbakid has joined #ruby
reset has quit [Ping timeout: 265 seconds]
<toastynerd>
progrock: what language backgrounds do you have?
Wolland has quit [Ping timeout: 240 seconds]
<toastynerd>
"well versed programmer" can mean a lot of different things
buzzybron has quit [Ping timeout: 260 seconds]
buzzybron1 has joined #ruby
brennanMKE has quit [Ping timeout: 265 seconds]
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
alol_ is now known as alol
bluenemo has quit [Max SendQ exceeded]
pehlert has joined #ruby
end_guy has quit [Remote host closed the connection]
bluenemo has joined #ruby
end_guy has joined #ruby
bigbadbear has joined #ruby
bluOxigen has joined #ruby
butblack has quit [Quit: butblack]
kung has joined #ruby
<progrock>
toastynerd: many years ago PHP, C++, Java.... not as many Python, Scala.... but primarily JavaScript
bigbadbear has quit [Ping timeout: 252 seconds]
timonv has quit [Remote host closed the connection]
<progrock>
toastynerd: enough that a syntax overview would cover 95% of what I need to know right now... and I can learn from looking at libraries and code examples to figure out common design patterns
VinceThePrince has quit [Read error: No route to host]
emocakes has quit [Quit: Leaving...]
<progrock>
Supposed to be helping a girl learn ro program in Ruby to prep for a course (she's very smart, but its her first language).. so I want to know enough that I can be confident in what I tell her
Sp4rKy is now known as Sp4rKy_
<flaccid>
google.com, but alas there should be a ton of resources if you look
<progrock>
reading the first section of ProgrammingRuby on ruby-docs.com ... seems like a decent reference to skim
<progrock>
heh these modifier one liners look funky at first... are they pretty common practice?
<progrock>
I guess its s imilar concept to using && or || instead of if's.. or as a coalesce
<toastynerd>
yeah, they're very common and a while to get used if you haven't used a similar language
<toastynerd>
take a while*
<progrock>
Gotta love seeing regular expressions in the first few pages of a book... always a good sign
pehlert has quit [Ping timeout: 265 seconds]
<toastynerd>
after you get through the basics, look into bloc/proc/lambdas and metaprogramming
flaccid has left #ruby ["Konversation terminated!"]
w1xz has joined #ruby
<progrock>
Mastering regular expressions is still by a logn shot my favorite technical book... my coworkers make fun of me because of how much I like it
aganov has joined #ruby
<progrock>
toastynerd: oh.. now those do sound interesting
<toastynerd>
progrock: yeah, they're really the aspects of Ruby that make it worth learning.
<progrock>
hoping ruby isn't as crazy as scala with regards to looking at deveopers code.
Kneferilis has joined #ruby
jprovazn has joined #ruby
<ar>
progrock: regular expressions are nice, but aren't usually the proper solution
<progrock>
Ruby doesnt have block level scoping, right?... just classes and methods?
<progrock>
ar: sad that its true... that book makes you want to use them for everything... but itis true I only use them for very few tasks
Guest75744 has quit [Remote host closed the connection]
nanoyak has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby
<toastynerd>
progrock: for scoping, you can use either block level or classes/methods
<shevy>
progrock ruby is rather economic in its expressions, that's why one liners are often there
<shevy>
progrock a block to a method has its own scope. you can also use procs/lambdas and .call on them at a later time
blaxter_ has joined #ruby
nanoyak has joined #ruby
<progrock>
shevy: understandable... I was mroe saying, from my experience with scala... its usually taken a little further than it should be (IMMO) to the point code is no longer verbose
gja has joined #ruby
fgo has joined #ruby
<shevy>
don't know scala
<progrock>
ok, guess I need to read a bit on scoping
blaxter_ is now known as blaxter
<shevy>
ruby is more like perl 2.0 (they way how perl should have been done)
<shevy>
*the
gasbakid_ has joined #ruby
nwertman has quit [Ping timeout: 252 seconds]
<shevy>
progrock read less, write more :)
<progrock>
heh, I'm kinda glad that y experiece in perll didnt go much further than online form submission
gasbakid_ has quit [Read error: Connection reset by peer]
<toastynerd>
well, if you didn't like perl, you might not like ruby....
gasbakid has quit [Ping timeout: 260 seconds]
<progrock>
|name| notation... is that primarily used in loops to define a reference to the element in the array?
<shevy>
progrock a string object in ruby has inbuilt support for regex. x = "abc def"; x[/(e)f/]; $1 # => "e"
<toastynerd>
it's used in blocks, which can be part of loops
<progrock>
I briefly messed with perl.... it wasnt that bad... but at that time for some reason (dnt know why) I was interested in TCL and TK... never got very far tho
<shevy>
progrock if you have a container object like an array, it responds to #each, and you need to give these elements some name inside the block in order to acces sthem
predator217 has quit [Ping timeout: 252 seconds]
<shevy>
I didn't like perl much
<shevy>
6 months later I had no idea what I had written
<shevy>
my own code looked like alien spaghetti
<progrock>
hmm, ok well at least the basic use of |..| I get... definitely seems a little odd to me... but, we'll see if it gets crazier as I read
sassamo has joined #ruby
shedd has joined #ruby
amclain has quit [Quit: Leaving]
predator117 has joined #ruby
<progrock>
shevy: heh, reminds me of my JS back in 1999 to like 2002... used to think it was so ugly... now, its 95% of what I do.. and I think much more highly of it
<ayaz>
I loved Perl when I was heavily using it. It truly is 'Black Magic'.
browndawg has quit [Quit: Leaving.]
<ayaz>
I still have The Camel book lying around with me.
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nhhagen has joined #ruby
<toastynerd>
a block is essentially ruby's version of functional programming, think of the |...| as parameters into javascript's anonymous functions (most of the time)
<toastynerd>
yes I have, it's what inspired me to mess around in the js console
<toastynerd>
love that video
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<progrock>
That null >= 0 sounds like an interview question at a place that doesnt know how to interview people, lol
zipper has quit [Ping timeout: 252 seconds]
<progrock>
I'm always amused when I'm asked questions that are about corner cases you would very rarely run into
Czupa has joined #ruby
Czupa has quit [Client Quit]
<progrock>
or even worse, when asked about shit very ffew people would ever memorize
Czupa has joined #ruby
<progrock>
was asked the default styles for H1 through H6 once... my response "I could google that in 3 seconds"
<rcs>
null == 0 would make me very sad.
<rcs>
I can't imagine wanting that to work.
w4pm has quit [Ping timeout: 246 seconds]
<toastynerd>
true that, like I said, "fun fact" not really useful
<canton7>
NULL == 0 is true in C ;)
canton7 has left #ruby ["Leaving"]
canton7 has joined #ruby
w1xz has quit [Ping timeout: 246 seconds]
<canton7>
well, almost always
<progrock>
rcs: well its JS, use === if you want to be careful
<rcs>
canton7: I would very sad if (void*)0 != 0 .
jimeh has quit [Remote host closed the connection]
<toastynerd>
rcs: it's more that null >= 0 works but not either part of that statement by itself
jimeh_ has joined #ruby
zigomir has joined #ruby
zigomir has quit [Read error: Connection reset by peer]
Xzanron has joined #ruby
zigomir has joined #ruby
sandelius has joined #ruby
<progrock>
toastynerd: so apparently its because when using >= and <= with null (or any other values) its coerced to a number.. while with == null is not coerced toa number, but rather to undefined
joaoh82 has joined #ruby
Guest55474 has quit [Ping timeout: 240 seconds]
<progrock>
still pretty strange
camilasan has joined #ruby
chris613 has quit [Read error: Connection reset by peer]
Zhwazi has quit [Quit: Bouncer shutting down]
<toastynerd>
progrock: exactly, it's one of the reasons I can't stand JS.
CpuID has joined #ruby
CpuID has joined #ruby
CpuID has quit [Changing host]
<toastynerd>
personal preference
<progrock>
toastynerd: lots of people have problems with JS.. especially the Scala developers at my old job... but from my experience actually developing in it, I very much enjoy it
foooobear has joined #ruby
<toastynerd>
I will say, I like node for some reason and it's mostly the DOM api I don't like
<toastynerd>
but I wouldn't want to work with JS on a day to day basis
<progrock>
But I suppose I've been doing it for long enough that I have imbedded in my head many things "not to do".... and have gotten accustomed to certain patterns that are less dangerous... but it can be scary ooking at an inexperienced developes JS
<toastynerd>
progrock: so true and I am pretty inexperienced in js
mojjojo has joined #ruby
<progrock>
well I was doing JS back when browsers were horrific and most JS code was very ugly... so compared to now, things are so much better that I can look past any issues I have
blueOxigen has quit [Read error: Connection reset by peer]
Tarential has quit [Excess Flood]
CpuID has quit [Client Quit]
jhaals has joined #ruby
Tarential has joined #ruby
<progrock>
And I get to do a lot of development with d3.js ... and the author, Mike Bostock, is a fucking genius... it is such a pleasure to look at and learn from his code
bluenemo has quit [Remote host closed the connection]
<progrock>
and he just happens to program in a similar style to me.... not using JS as if it was a truely object oriented language
<Mon_Ouie>
canton7: As far as I understand it, the standard guarantees that converting integer zero into a pointer gives null, and vice versa; it just doesn't guarantee that the byte-level representation will be all 0s
<progrock>
yet another favorite, laughable, interview question "do you program in object oriented JS"
<progrock>
no
deens_ has quit [Remote host closed the connection]
<Mon_Ouie>
(so, for example, if you memset it to 0, it wouldn't necessarily work)ç
bluOxigen has joined #ruby
relix has joined #ruby
blueOxigen has joined #ruby
Kruppe- has joined #ruby
dukz has joined #ruby
zipper has joined #ruby
apeiros has joined #ruby
Kar- has joined #ruby
Spami has joined #ruby
<progrock>
so class variables (@@) are shared across all instances of the class I would assume?
<tobiasvl>
progrock: yes, but don't use them
<toastynerd>
yes
tylersmith has joined #ruby
<toastynerd>
yeah, unless you have a very good reason to (you probably don't)
ahmedelgabri has quit [Remote host closed the connection]
bluOxigen has quit [Read error: Connection reset by peer]
<progrock>
tobiasvl: haha, ok. Just needed to know since thats the first piece of code this girl showed me that I couldn;t guess at without looking it up
<progrock>
I just need to be confident enough withthe basic that I dont feed her misinformation
<progrock>
basics* [of Ruby]
<sandelius>
Is it possible to remove CommonLogger from the default Rack middleware?
Guest92073 has joined #ruby
<toastynerd>
sandelius: you could monkey patch it....
brennanMKE has joined #ruby
mojjojo has quit [Quit: mojjojo]
<sandelius>
toastynerd Yeah but that's what I'm trying to avoid :)
Mars has joined #ruby
<toastynerd>
sandelius: I figured =P
zxd has joined #ruby
<progrock>
well you guys definitely win with regards to IRC programmer community (or I just picked a good time to come in here, lol)
mojjojo has joined #ruby
tylersmith has quit [Ping timeout: 272 seconds]
Mars is now known as Guest37845
<toastynerd>
progrock: good luck!
pranny1 has joined #ruby
<progrock>
Thanks for the help, I'm sure I'll be back when I dive deeper
barratt has joined #ruby
sleetdrop has joined #ruby
<progrock>
one quick OT question, but maybe I'll get lucky. I'm rusty with IRSSI... using it on a chromebook... I remapped my volume keys to page up and down.... but I can;t figure out what button I need to have to press first to be able to back scroll... anychance anyone knows?
sleetdrop has quit [Max SendQ exceeded]
tectonic has quit []
robonerd has joined #ruby
<robonerd>
heya
<progrock>
Im thinking it may be scroll lock.. but I just cant remmeber and didnt find out in a google search
<robonerd>
what is the easiest way to build web apps with ruby? i can do low level stuff, but i want to more 'bang out' rapid prototyping
blackmesa has joined #ruby
caliburr has joined #ruby
pranny has quit [Ping timeout: 252 seconds]
<robonerd>
normally i write everything myself, but with this i was to use the latest but quality way of building stuff
<robonerd>
w/e gems that is
brennanMKE has quit [Ping timeout: 272 seconds]
<robonerd>
i want to rapidly dev web apps (with jason api interface too) and a db backend
<robonerd>
sqlite, pgsql, should be modular
<progrock>
robonerd: Thats not entirely true.. I find JS easier... with node and the fact that front end and back end code is the same language (but totally personal preference there.. I' sure ruby is quite good for webapps)
<robonerd>
(without having to change api used in app logic)
sleetdrop has joined #ruby
sleetdrop has quit [Max SendQ exceeded]
<robonerd>
what isn't entirely true?
<progrock>
oh.. shit I read why not what
mojjojo has quit [Quit: mojjojo]
<progrock>
I cant read, sorry... almost 4 am here
<robonerd>
np, so what's up then?
<zxd>
hi the # is not for comments here is it ? default['yum']['main']['bandwidth'] = nil # /^\d+$/
<progrock>
me about to go to sleep... but was getting some great help on the basics of ruby, lol
<tobiasvl>
zxd: yes it is
dfranciosi has joined #ruby
L8D has quit [Read error: Operation timed out]
mojjojo has joined #ruby
<zxd>
tobiasvl: so it's strange that they have code there
<progrock>
zxd: looks like a commented out regex to me... but let someone mroe knowledgable confirm that
wildroman2 has quit [Remote host closed the connection]
mavcunha has joined #ruby
drumusician has quit [Ping timeout: 252 seconds]
wildroman2 has joined #ruby
banister has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
Guest3004 has quit [Quit: Guest3004]
mojjojo has joined #ruby
dEPy has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
soba has quit [Ping timeout: 260 seconds]
zipper_ has quit [Ping timeout: 272 seconds]
ferr has joined #ruby
zipper_ has joined #ruby
zipper_ is now known as zipper
kacperix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ferr>
https://gist.github.com/anonymous/8315732 I got the issue with this piece of code. The only get the last song in the file, so I believe it is something related with overwriting
kacperix has joined #ruby
<Hanmac1>
ferr you dont need f.close there
<ferr>
ok but it doesn't solve it
<pontiki>
also, i think you want to reverse the order of those blocks
simoz114 has joined #ruby
<pontiki>
open the file, then loop through each playlist entry
<Hanmac1>
ferr look at L27-L32 you do it wrong
<ferr>
that makes sense
<pontiki>
currently, you overwrite the file with each song
carraroj has quit [Ping timeout: 240 seconds]
<pontiki>
you could also shorting things up a bit by doing something like File.write(filename, playlist.join("\n"))
<ferr>
thanks
<dEPy>
I have a problem (ofcourse else I wouldn't be talking here), so... I have a class (service) for authentication and in this class I do @@secret = CONFIG[:secret]
<dEPy>
When testing rspec complains (ofcourse) that it doesn't know what CONFIG is
<dEPy>
Now, I might need this CONFIG in alot of other services and I don't want to do it this way with class variable because it seems bad.
shime has joined #ruby
simoz114 has quit [Ping timeout: 260 seconds]
fgo has joined #ruby
ewnd9_ has joined #ruby
<pontiki>
not sure what the question is, dEPy
wildroman2 has quit [Remote host closed the connection]
mrnugget has joined #ruby
ewnd9 has quit [Ping timeout: 265 seconds]
<mrnugget>
Is there a way to access ruby vm settings from inside ruby? e.g. see what RUBY_HEAP_MIN_SLOTS is set to, without any environment variables
simoz115 has joined #ruby
yugui is now known as yugui_zzz
<alexherbo2>
how make StringScanner returns MatchData, instead of matched string ?
<dEPy>
pontiki: well, how should I handle configs? is the way I do it ok?
<alexherbo2>
tobiasvl: i would avoid
shime has quit [Ping timeout: 252 seconds]
<alexherbo2>
i have to parse text on stream
<dEPy>
and on the other hand doesn't the thing that you need to do some mumbo jumbo with missing dependency classes in tests tell you something is wrong?
<pontiki>
dEPy: i don't have enough info about what you're doing, really
<pontiki>
just assuming you're talking about configuring an application, i'd build that into a singleton class in the app
noop has joined #ruby
mvangala has quit []
popl has quit [Read error: Operation timed out]
shime has joined #ruby
flame_ has joined #ruby
lioninawhat has joined #ruby
w4pm has joined #ruby
asattar has quit [Remote host closed the connection]
n00batirc has joined #ruby
toastynerd has joined #ruby
lioninawhat has quit [Remote host closed the connection]
glundgren has joined #ruby
glundgren is now known as guilund
phutchin1 has quit [Quit: Lost terminal]
Wixy has joined #ruby
Wixy has joined #ruby
Wixy has quit [Changing host]
mvangala has joined #ruby
w4pm has quit [Read error: Operation timed out]
nhhagen has joined #ruby
flame_ has quit [Quit: Computer has gone to sleep.]
toastynerd has quit [Ping timeout: 272 seconds]
TaxmanBD has quit [Ping timeout: 240 seconds]
aes has joined #ruby
decoponio has joined #ruby
dkamioka has joined #ruby
aes has left #ruby ["Ex-Chat"]
asattar has joined #ruby
lkba has joined #ruby
decoponio has quit [Max SendQ exceeded]
<dEPy>
pontiki: I have a yaml cofiguration that is loaded into CONFIG object (hash), then in my AuthenticationService I do @@secret = CONFIG[:secret]
xiphias has quit [Remote host closed the connection]
Targen has quit [Ping timeout: 252 seconds]
decoponio has joined #ruby
enape_101 has quit [Ping timeout: 252 seconds]
xiphias has joined #ruby
nwertman has quit [Ping timeout: 252 seconds]
<dEPy>
and in my tests I don't want to load real configuration and I can't stub_const in before block because I'm assigning CONFIG to class variable
<dEPy>
So my thought was that doing @@secret = CONFIG[:secret] is not a good way to do it
<dEPy>
on the other hand I don't want to make an object instnance of that AuthenticationService cause then I'll have to pass in configuration every time
<asattar>
Hello, I just finished reading the "The Ruby Programming Language" book by David Flanagan and Matz, I want to read another book writing code, in "The Ruby way"
<asattar>
Is there any good book you can suggest?
joaoh82 has joined #ruby
<pontiki>
i don't know what the class variable gets you in any case
<pontiki>
so, yeah, dump that
decoponio has quit [Max SendQ exceeded]
soulcake has quit [Read error: Connection reset by peer]
decoponio has joined #ruby
Bira has quit [Remote host closed the connection]
xiphias has quit [Ping timeout: 240 seconds]
soulcake has joined #ruby
dpaulus_ is now known as dpaulus
xiphias has joined #ruby
<dEPy>
pontiki: so just use CONFIG[:secret] everywhere I need it?
Bira has joined #ruby
joaoh82 has quit [Ping timeout: 252 seconds]
fgo has joined #ruby
psyl0n has quit [Remote host closed the connection]
rootshift has joined #ruby
lkba has quit [Ping timeout: 246 seconds]
shedd has joined #ruby
tharindu has quit [Quit: Leaving...]
mikecmpbll has joined #ruby
kitak has quit [Remote host closed the connection]
xiphias has quit [Ping timeout: 240 seconds]
dreinull_ has joined #ruby
brennanMKE has joined #ruby
xiphias has joined #ruby
mikecmpbll has quit [Client Quit]
brennanMKE has quit [Read error: Connection reset by peer]
fgo has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
<dreinull_>
I have a bunch of Date objects for each day of the month but it just doesn't respond to #sunday? I checked with is_a? Date and it's true. Nothing's wrong with it. And I'm certain one of the objects is a sunday.
<zxd>
is this not valid syntax ["foo"]["bar"]["cheese"] = [] ?
brennanMKE has joined #ruby
<zxd>
1:in `[]': can't convert String into Integer (TypeError)
<tobiasvl>
zxd: is that the entire code?
<tobiasvl>
what are you indexing?
<zxd>
that isn't the entire code, but how do I need to define other values before?
mojjojo has joined #ruby
tkuchiki has quit [Remote host closed the connection]
shedd has quit [Ping timeout: 252 seconds]
tkuchiki has joined #ruby
<tobiasvl>
define what? you don't use any variables
<tobiasvl>
please show the entire code
<tobiasvl>
(all relevant code)
yasushi has joined #ruby
<zxd>
ah
<zxd>
sec
cbetta_afk is now known as cbetta
ando has joined #ruby
psyl0n has joined #ruby
psyl0n has quit [Changing host]
psyl0n has joined #ruby
ewnd9_ has quit [Ping timeout: 260 seconds]
<tobiasvl>
i think you have an array where you think you have a hash
<tobiasvl>
arrays can only have integer indices
okinomo has joined #ruby
<dreinull_>
slightly embarrassing, the mistake is elsewhere, never mind :)
<zxd>
tobiasvl: see
<zxd>
I see
<zxd>
this also dosen't work default["foo"]["bar"]["cheese"] = []
brennanMKE has quit [Ping timeout: 246 seconds]
<tobiasvl>
what is default and what does it contain?
<zxd>
nothing
<zxd>
not defined before
ahawkins has quit [Ping timeout: 260 seconds]
danijoo has quit [Read error: Connection reset by peer]
<tobiasvl>
well you need to define it
danijoo has joined #ruby
ferr has quit [Read error: Connection reset by peer]
xiphias has quit [Ping timeout: 240 seconds]
tkuchiki has quit [Ping timeout: 260 seconds]
caliburr has quit [Quit: caliburr]
ahawkins has joined #ruby
EngierkO has joined #ruby
ando has quit [Ping timeout: 240 seconds]
Bira has quit [Remote host closed the connection]
<tobiasvl>
you want default to be a hash that looks kind of like this? {"foo" => {"bar" => {"cheese" => []}}}
MrThePlague has joined #ruby
<tobiasvl>
is this JSON?
<zxd>
no
xiphias has joined #ruby
<zxd>
chef
<zxd>
heh
dEPy has quit [Quit: Computer has gone to sleep.]
<zxd>
why JSON
patriciomacadden has joined #ruby
noname001__ has quit [Ping timeout: 272 seconds]
<tobiasvl>
because JSON is represented like nested hashes in ruby
sepp2k has joined #ruby
<tobiasvl>
i'm just guessing what you want to achieve here, because you're not telling us ;)
shaunbaker has quit [Remote host closed the connection]
<zxd>
tobiasvl: because I took it from chef cookbook, it dosen't show the whole code has it's own DSL
<zxd>
but's it's ruby
Bira has joined #ruby
<zxd>
default["system"]["packages"]["install"] should be defined
<zxd>
I am trying to save it to something more easy to work with to push to eat more elements
moshee has quit [Read error: Operation timed out]
<zxd>
like e = default["system"]["packages"]["install"] ; e.push %w{ ...
<zxd>
don't know if this is valid syntax
patriciomacadden has left #ruby [#ruby]
<zxd>
to it*
<zxd>
not eat
kacperix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
MrThePlague has quit [Ping timeout: 252 seconds]
<zxd>
can I do that ? tobiasvl
Bira has quit [Remote host closed the connection]
Bira has joined #ruby
kacperix has joined #ruby
<tobiasvl>
it is valid syntax.
<tobiasvl>
>> e = default["foo"]["bar"]["cheese"]; e.push [1]; puts default
<tobiasvl>
sorry
<vlad_starkov>
Question: Any suggestion of a good SOA on Ruby/RoR books?
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<alexherbo2>
no one to solve my problem?
xiphias has quit [Ping timeout: 240 seconds]
gja has joined #ruby
phansch has quit [Quit: Leaving]
xiphias has joined #ruby
varfoo has quit [Quit: WeeChat 0.4.0]
camilasa_ has quit []
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mansi has joined #ruby
varfoo has joined #ruby
varfoo has quit [Client Quit]
kalelsage has joined #ruby
yasushi has quit [Quit: Leaving...]
dweeb_ has quit [Quit: Computer has gone to sleep.]
yasushi has joined #ruby
kung has quit [Read error: Connection reset by peer]
kung has joined #ruby
atraylen has joined #ruby
RaCx has joined #ruby
dEPy has joined #ruby
`petey` has joined #ruby
kacperix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mansi has quit [Ping timeout: 260 seconds]
RaCx has quit [Client Quit]
dfranciosi has quit [Remote host closed the connection]
Kneferilis has joined #ruby
xiphias has quit [Ping timeout: 240 seconds]
larissa has joined #ruby
krz has quit [Quit: WeeChat 0.4.2]
dEPy has quit [Quit: Computer has gone to sleep.]
nhhagen has quit [Remote host closed the connection]
Kar- has joined #ruby
xiphias has joined #ruby
RaCx has joined #ruby
varfoo has joined #ruby
nhhagen has joined #ruby
max96at has joined #ruby
atraylen has quit [Ping timeout: 272 seconds]
lkba has joined #ruby
sassamo has joined #ruby
reset has joined #ruby
`petey` has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dEPy has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
ewnd9_ has joined #ruby
alexherbo2 has quit [Quit: WeeChat 0.4.3-dev]
alexherbo2 has joined #ruby
doodlehaus has joined #ruby
alexherbo2 has quit [Client Quit]
noname001__ has joined #ruby
doodlehaus has quit [Remote host closed the connection]
nhhagen has quit [Ping timeout: 252 seconds]
RaCx has quit [Quit: Computer has gone to sleep.]
alexherbo2 has joined #ruby
sassamo has quit [Ping timeout: 252 seconds]
zumba_addict has quit [Quit: zumba_addict]
reset has quit [Ping timeout: 240 seconds]
xiphias has quit [Ping timeout: 240 seconds]
RaCx has joined #ruby
Landshark753 has joined #ruby
Landshark753 has quit [Max SendQ exceeded]
xiphias has joined #ruby
xiphias has quit [Changing host]
xiphias has joined #ruby
DouweM has joined #ruby
Landshark753 has joined #ruby
Landshark753 has quit [Max SendQ exceeded]
banister has joined #ruby
robbyoconnor has quit [Quit: Konversation terminated!]
r0bby_ has joined #ruby
Landshark753 has joined #ruby
dweeb_ has joined #ruby
timonv has quit [Remote host closed the connection]
LadyRainicorn has joined #ruby
carraroj has joined #ruby
kacperix has joined #ruby
moshee has joined #ruby
toastynerd has joined #ruby
toastynerd has quit [Remote host closed the connection]
toastynerd has joined #ruby
ctp has joined #ruby
Landshark753 has quit [Ping timeout: 240 seconds]
xiphias has quit [Ping timeout: 240 seconds]
razibog has joined #ruby
dfranciosi has joined #ruby
<zxd>
tobiasvl: is this valid ruby syntax {"b" => {"platform_family" => {"rhel" => []}}}
jovon has joined #ruby
Targen has joined #ruby
xiphias has joined #ruby
<DouweM>
try it out in irb
toastynerd has quit [Ping timeout: 246 seconds]
L8D has joined #ruby
mary5030 has joined #ruby
joaoh82 has joined #ruby
mark_locklear has joined #ruby
ewnd9_ has quit [Remote host closed the connection]
<workmad3>
Oog: because daemonised processes are detached from a terminal?
gja has quit [Quit: This computer has gone to sleep]
zoscoy has joined #ruby
<Oog>
workmad3: so im running on heroku and cant log to a file afaik... any way to get logs? advice?
brennanMKE has joined #ruby
<workmad3>
Oog: maybe by not using the daemons gem?
gja has joined #ruby
<Oog>
alternative?
<workmad3>
Oog: heroku uses foreman to spin up services
Landshark753 has joined #ruby
<workmad3>
Oog: just run your long-running process on a worker dyno maybe?
Landshark753 has quit [Max SendQ exceeded]
<Oog>
workmad3: thats waht im doing but i want each dyno to run multiple processes
<workmad3>
Oog: there shouldn't be a need to mess around with heroku to turn it into a daemonised service
Ceph_away has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
Landshark753 has joined #ruby
Landshark753 has quit [Max SendQ exceeded]
<waxjar>
Oog: daemons lets you set up a log file, no?
<Oog>
otherwise id have to pay for 4 dynos
emocakes has joined #ruby
<workmad3>
Oog: or maybe you should consider something other than heroku?
<workmad3>
Oog: this is kinda one of the heroku restrictions :P
<Oog>
waxjar: yes - but i dont think heroku does...
xiphias has quit [Ping timeout: 240 seconds]
VTLob has joined #ruby
<waxjar>
ah, no. heroku doesn't let you use a (persistent) file system
Landshark753 has joined #ruby
aryaching has joined #ruby
okinomo has quit [Ping timeout: 265 seconds]
sepp2k has quit [Read error: Connection reset by peer]
<workmad3>
also heroku expects a 12-factor app, which means you log to stdout (and don't detach yourself from a terminal)
mechanicles has joined #ruby
<Oog>
so basically not possible?
Landshark753 has quit [Max SendQ exceeded]
okinomo has joined #ruby
<workmad3>
Oog: you might be able to hack something together by forking yourself and handling logging in a sensible manner
<workmad3>
Oog: but it's not something that heroku makes easy... after all, this is what they charge for
sailias has joined #ruby
<waxjar>
you set it up in a Procfile and let heroku handle everything. that's why one would choose heroku, so you dont have to deal with all that
<workmad3>
Oog: unicorn manages with multiple child processes, for example
sepp2k has joined #ruby
<Oog>
can unicorn do what daemonize does?
<Oog>
i use unicorn on the webserver
<Oog>
and that logging works
<workmad3>
Oog: no, unicorn is the app server
brennanMKE has quit [Ping timeout: 252 seconds]
<workmad3>
Oog: it just forks child processes to handle requests
<workmad3>
and then has a master process to keep track and manage them
<workmad3>
it's not a service framework... I'm pointing out that what you want is possible, but it's not necessarily easy and requires you to know what you're doing regarding unix process forking
doodlehaus has joined #ruby
carraroj has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Remote host closed the connection]
h_kon has quit [Remote host closed the connection]
<workmad3>
and as waxjar said, if you're doing that then why are you bothering with heroku? heroku charges you a premium so you don't have to give a crap about any of this stuff :)
shedd has joined #ruby
<workmad3>
if you're gonna do this level of work, why not get a cheaper VPS and just set it up yourself? it'll be easier
<Oog>
yeah i dont want to care about this stuff but.... id like a little logging
emocakes has quit [Client Quit]
dEPy_ has quit [Quit: Computer has gone to sleep.]
kewubenduben has quit [Ping timeout: 260 seconds]
<waxjar>
a logging add-on is how heroku does that, i believe
xjiujiu has quit [Read error: Connection reset by peer]
gja has quit [Quit: This computer has gone to sleep]
<workmad3>
waxjar: as I already said, heroku expects stdout to be your log, and makes that available to you
vlad_starkov has joined #ruby
<waxjar>
ah, makes sense
<workmad3>
waxjar: but yeah, they add an extra bit into rails apps on deploy to force them to log to stdout
mrnugget has joined #ruby
gja has joined #ruby
<workmad3>
12-factor app :)
noop has quit [*.net *.split]
mvangala has quit [*.net *.split]
TDJACR has quit [*.net *.split]
m4rcu5 has quit [*.net *.split]
jimeh_ has quit [*.net *.split]
St_Marx has quit [*.net *.split]
zz_jrhorn424 has quit [*.net *.split]
sophomorical has quit [*.net *.split]
artgoeshere has quit [*.net *.split]
utkarsh has quit [*.net *.split]
Paradox has quit [*.net *.split]
Nightmare has quit [*.net *.split]
blo has quit [*.net *.split]
poutine has quit [*.net *.split]
aetaric has quit [*.net *.split]
Guest8854 has quit [*.net *.split]
DarkFoxDK has quit [*.net *.split]
seich- has quit [*.net *.split]
kenichi has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
mjmac has quit [*.net *.split]
epochwolf has quit [*.net *.split]
dmarr has quit [*.net *.split]
interactionjaxsn has quit [*.net *.split]
shedd has quit [Ping timeout: 252 seconds]
<AntelopeSalad>
i never had logs only goto stdout before but it does make sense to do
dEPy has joined #ruby
zipper has quit [Ping timeout: 260 seconds]
MrThePlague has joined #ruby
<workmad3>
it's a useful way to separate concerns... if you log to stdout, then you can have some form of central logging just attached to the pipe and handle it completely outside your app without extra config
<workmad3>
or you can just pipe to a file
razibog has quit [Ping timeout: 265 seconds]
n00batirc has quit [Ping timeout: 272 seconds]
<benzrf|semiafk>
hrku
<AntelopeSalad>
yeah it seems like a great thing to have if you are using multiple servers
<benzrf|semiafk>
it is p good
<benzrf|semiafk>
i use it to host any web apps i have writen
<benzrf|semiafk>
which is like 2
<AntelopeSalad>
dealing with log rotation and running out of disk space stinks haha
<AntelopeSalad>
(on your app servers)
zipper has joined #ruby
Paradox has joined #ruby
zz_jrhorn424 has joined #ruby
poutine has joined #ruby
noop has joined #ruby
sophomorical has joined #ruby
aetaric has joined #ruby
St_Marx has joined #ruby
interactionjaxsn has joined #ruby
flagg0204 has joined #ruby
mvangala has joined #ruby
Guest8854 has joined #ruby
blo has joined #ruby
kenichi has joined #ruby
TDJACR has joined #ruby
Nightmare has joined #ruby
mjmac has joined #ruby
epochwolf has joined #ruby
Landshark753 has joined #ruby
artgoeshere has joined #ruby
DarkFoxDK has joined #ruby
dmarr has joined #ruby
m4rcu5 has joined #ruby
utkarsh has joined #ruby
seich- has joined #ruby
jimeh_ has joined #ruby
Megtastique has joined #ruby
noop has quit [Ping timeout: 240 seconds]
okinomo has quit [Ping timeout: 252 seconds]
<AntelopeSalad>
btw workmad3, thanks again for recommending that rvm cookbook, it's so much more seamless than the alternatives
okinomo has joined #ruby
<Oog>
thanks for the help
<workmad3>
AntelopeSalad: no probs... it would be a good idea to consider using poise or similar in the future though
<AntelopeSalad>
yeah, but right now it's at a weird point
Soda has quit [Read error: Connection reset by peer]
<AntelopeSalad>
the poise author says it's pg's fault and the pg's author says there's nothing he can do it about it
<workmad3>
AntelopeSalad: yeah, you're transitioning atm too, which leads to odd problems anyway :)
noop has joined #ruby
Landshark753 has quit [Max SendQ exceeded]
<AntelopeSalad>
i was happy though, the rvm setup code in my recipe was like 2 lines
Landshark753 has joined #ruby
failshell has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
ferr has joined #ruby
jajaja has joined #ruby
ahmedelgabri has joined #ruby
enebo has joined #ruby
n00batirc has joined #ruby
<ferr>
can I assign a variable to file content like this "variable = File.read(filename)"
gja has joined #ruby
gja has quit [Changing host]
gja has joined #ruby
mrnugget has quit [Quit: mrnugget]
<waxjar>
sure
Oog has quit [Quit: Page closed]
jajaja has left #ruby [#ruby]
<tobiasvl>
what's File#read
zipper has quit [Ping timeout: 252 seconds]
zipper has joined #ruby
<tobiasvl>
oh yeah
momomomomo has joined #ruby
Landshark753 has quit [Ping timeout: 240 seconds]
user10121 has joined #ruby
<user10121>
this is probably a very newbie-level question. i need to see as much of the code as possible while coding. sometimes i even prefer to "minify", which considerably affects readability but maximizes the amount of code i can see at once.
<user10121>
#1 am i a rare case? if so, what do you think are your compensatory practices or skills? #2 what are some of the tools you [think i could] use for this? something that shows a reasonably detailed outline of the code (with support for comments/annotations?). something that makes it easy to find my way around my own code.
<tobiasvl>
user10121: what editor do you use?
burlyscudd has quit [Quit: Leaving.]
momomomomo has quit [Client Quit]
okinomo has quit [Ping timeout: 260 seconds]
Virtualize has joined #ruby
okinomo has joined #ruby
`petey` has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
interactionjaxsn has quit [Remote host closed the connection]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gja has quit [Client Quit]
reset has joined #ruby
orionstein_away is now known as orionstein
jlast has joined #ruby
ahmedelgabri has quit [Remote host closed the connection]
jamesaanderson has joined #ruby
ewnd9 has quit [Ping timeout: 252 seconds]
razibog has joined #ruby
enape_101 has quit [Ping timeout: 276 seconds]
burlyscudd has joined #ruby
lukec has joined #ruby
<ferr>
I've got a string with three commas and at first one I need it to split into two pieces, any suggestions?
<waxjar>
>>"1,2,3".split ",", 2
tharindu has joined #ruby
interactionjaxsn has joined #ruby
reset has quit [Ping timeout: 252 seconds]
rootshift has quit [Quit: rootshift]
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
gja has joined #ruby
okinomo has quit [Ping timeout: 245 seconds]
okinomo has joined #ruby
toastynerd has joined #ruby
MrPopinjay has joined #ruby
jhaals has joined #ruby
tt1187 has quit [Ping timeout: 252 seconds]
<MrPopinjay>
Hello all. I've written a short script in Ruby 2.0.0. I want to run it on my co-worker's machine, which has 1.9.7 installed, but it seems that with 1.8.7 the IO class doesn't have the write method. Other than upgrading his version of ruby, how ought I get around this problem? Thank you.
<wmoxam>
MrPopinjay: maybe it's a different problem?
gja has quit [Quit: This computer has gone to sleep]
enape_101 has joined #ruby
burlyscudd has quit [Quit: Leaving.]
heftig has joined #ruby
`petey` has quit [Remote host closed the connection]
pen has joined #ruby
<MrPopinjay>
I'm confused, is that a different function with the same name, or am I misunderstanding something
ctp has quit [Read error: Connection reset by peer]
carraroj has quit [Ping timeout: 252 seconds]
`petey` has joined #ruby
ctp has joined #ruby
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<Hanmac1>
there is also IO.write / File.write as class method, but it seems that 1.8.7 dind had it yet
<MrPopinjay>
Ah, wait, I think I have it. 'File.open(yourfile, 'w') { |file| file.write("your text") }' Pretty ugly in comparison to 2.0.0's IO.write, but it'll do
okinomo has quit [Ping timeout: 252 seconds]
apeiros has quit [Remote host closed the connection]
`petey` has quit [Read error: Connection reset by peer]
`petey` has joined #ruby
apeiros has joined #ruby
okinomo has joined #ruby
brennanMKE has joined #ruby
<benzrf|semiafk>
oh hi MrPopinjay
<benzrf|semiafk>
didnt i see you in #haskell?
<benzrf|semiafk>
like weeks ago
<benzrf|semiafk>
*months
<MrPopinjay>
Probably, I bounce about all over the place with languages
<benzrf|semiafk>
i think i ranted at you about monads and stuff
nateberkopec has quit [Quit: Leaving...]
<Hanmac1>
your coworkers machine should be updated ... ruby does not support 1.8.7 anymore (so no security fixes)
<LadyRainicorn>
monads are monadic.
<benzrf|semiafk>
algebraic!
<LadyRainicorn>
MATHEMATICAL!
maroloccio has joined #ruby
<waxjar>
confusing!
<MrPopinjay>
Hanmac1: Really? Oh dear. Convincing people to upgrade is difficult...
<LadyRainicorn>
l i e s
* LadyRainicorn
gives waxjar the test of the candy guardians.
<benzrf|semiafk>
Alphanumeric!
bennyboobooboo has joined #ruby
<Hanmac1>
LadyRainicorn: ROMBUS!
<LadyRainicorn>
noooo
fusi0n has quit [Quit: .]
<waxjar>
i would probably eat those LadyRainicorn
<Hanmac1>
;P
<benzrf|semiafk>
both archer & at resume on the 13th
<waxjar>
i like candy
<tobiasvl>
MrPopinjay: he should at the very least run 1.9.3
<LadyRainicorn>
rhombus
<benzrf|semiafk>
the question here is which one should i watch first
<LadyRainicorn>
Me too.
<LadyRainicorn>
Buy me candy, waxjar.
<waxjar>
whats in it for me
gja has joined #ruby
mojjojo has joined #ruby
<benzrf|semiafk>
waxjar: as a jar, you can hold the candy
alexherbo2 has quit [Ping timeout: 265 seconds]
apeiros has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #ruby
Fuzai has joined #ruby
<waxjar>
wax and candy? hmm
<LadyRainicorn>
I will eat the candy and it will be yummy and you will smile knowing you made me happy.
cafhacker has joined #ruby
<Fuzai>
If Datamapper has been left for dead, and Ruby Object Mapper isn't ready yet, what does someone use as a replacement that can use mongo as a backend database?
ckinni has joined #ruby
<benzrf|semiafk>
screw mongo use postgres
<benzrf|semiafk>
B)
tyl has joined #ruby
gja has quit [Client Quit]
mengu has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
nhhagen has joined #ruby
nhhagen has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
mojjojo has quit [Quit: mojjojo]
mojjojo has joined #ruby
IceyEC has joined #ruby
okinomo has quit [Ping timeout: 276 seconds]
okinomo has joined #ruby
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vlad_sta_ has joined #ruby
shedd has joined #ruby
blackmesa has joined #ruby
nwertman has joined #ruby
dangerousdave has joined #ruby
mojjojo has quit [Client Quit]
<MrPopinjay>
Hello again. I'm on OS X. When I run a script as './scriptname.rb' rather than 'ruby scriptname.rb' it uses an older version of ruby, even though it's not the first in my $PATH. What ought I do about this?
vlad_starkov has quit [Ping timeout: 252 seconds]
mojjojo has joined #ruby
<Hanmac1>
MrPopinjay: what is the very first line in the ruby script?
RaCx has quit [Quit: Computer has gone to sleep.]
<MrPopinjay>
Hanmac1: The shebang, ah. Ok. So if I were to change the symlink in /usr/bin/ to the new version, do you think there would be a problem?
<benzrf|semiafk>
MrPopinjay: shebang line
<benzrf|semiafk>
MrPopinjay: just change your sheban
<benzrf|semiafk>
g
<benzrf|semiafk>
or use env
<MrPopinjay>
It's linking to the old one at the moment
<benzrf|semiafk>
$ man env
mansi_ has joined #ruby
vlad_sta_ has quit [Ping timeout: 260 seconds]
<benzrf|semiafk>
MrPopinjay: 'env' can be used to execute a command as it appears in your path
toastyne_ has quit [Remote host closed the connection]
<olivier_bK>
in my compagnie we use for dns for establish a connection between two server
eliasp_ is now known as eliasp
rdark has joined #ruby
obs_ has joined #ruby
deception has joined #ruby
aganov has quit [Remote host closed the connection]
bennyboo_ has quit [Remote host closed the connection]
bennyboobooboo has joined #ruby
vt102 has joined #ruby
okinomo has quit [Ping timeout: 265 seconds]
tharindu|away is now known as tharindu
okinomo has joined #ruby
gja has joined #ruby
shedd has joined #ruby
bennyboobooboo has quit [Read error: Connection reset by peer]
ehc has joined #ruby
enape_101 has joined #ruby
bennyboobooboo has joined #ruby
tropicalmug has left #ruby [#ruby]
brennanMKE has quit [Remote host closed the connection]
bennyboobooboo has quit [Read error: Connection reset by peer]
digital-ghost has joined #ruby
Kruppe- is now known as Kruppe
brennanMKE has joined #ruby
bennyboobooboo has joined #ruby
momomomomo has joined #ruby
IceDragon has quit [Ping timeout: 246 seconds]
danijoo has quit [Read error: Connection reset by peer]
gilcosson has quit [Remote host closed the connection]
danijoo has joined #ruby
rdark has quit [Ping timeout: 252 seconds]
Spami has joined #ruby
ce_afk is now known as cescalante
cads has joined #ruby
rdark has joined #ruby
allaire has quit []
burlyscudd has quit [Quit: Leaving.]
heftig has quit [Quit: Quitting]
gilcosson has joined #ruby
mary5030_ has joined #ruby
wildroman2 has quit [Remote host closed the connection]
mary5030_ has quit [Remote host closed the connection]
okinomo has quit [Remote host closed the connection]
mary5030_ has joined #ruby
makerops has joined #ruby
okinomo has joined #ruby
<makerops>
hi, whats the best pattern for writing a piece of code for a time window
<makerops>
backoff timer doesnt seem to be what i need
nateberkopec has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<makerops>
ie, im processing a stream of messages, and I want to correlate the last 30 seconds repeatedly
shaunbak_ has joined #ruby
mary5030 has quit [Ping timeout: 252 seconds]
<Jamo>
Id probably just make a new thread, set it to sleep for correct time...
<Jamo>
but there probably is a nicer way to do that...
nateberkopec has quit [Client Quit]
AlSquire has joined #ruby
fedesilva has joined #ruby
<makerops>
well, i have a constant stream of messages coming in, when it does, i send it to a process method
<makerops>
so spawn a thread off the process method?
sambao21 has joined #ruby
gigetoo has quit [Remote host closed the connection]
dEPy has quit [Quit: Computer has gone to sleep.]
gigetoo has joined #ruby
rickruby has joined #ruby
shaunbaker has quit [Ping timeout: 245 seconds]
dEPy_ has joined #ruby
dapz has quit [Ping timeout: 260 seconds]
subbyyy has joined #ruby
cafhacker has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
okinomo has quit [Ping timeout: 252 seconds]
user10121 has left #ruby ["Leaving"]
okinomo has joined #ruby
nateberkopec has joined #ruby
`petey` has quit [Remote host closed the connection]
tharindu is now known as tharindu|away
jprovazn has quit [Quit: Leaving]
IceDragon has joined #ruby
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
`petey` has joined #ruby
noname001__ has quit [Ping timeout: 260 seconds]
pu22l3r has quit [Remote host closed the connection]
ewnd9 has joined #ruby
mityaz has joined #ruby
Bira has quit [Remote host closed the connection]
`petey`_ has joined #ruby
wildroman2 has joined #ruby
sassamo has quit [Remote host closed the connection]
ahawkins has joined #ruby
wildroman2 has quit [Remote host closed the connection]
`petey` has quit [Read error: Connection reset by peer]
sassamo has joined #ruby
wildroman2 has joined #ruby
vlad_starkov has joined #ruby
platzhirsch has joined #ruby
<platzhirsch>
Just installed pry on a new machine and strings are colored red instead of green
<platzhirsch>
That doesn't even make any sense
jamesaanderson has joined #ruby
bennyboobooboo has quit [Remote host closed the connection]
rickruby has quit [Remote host closed the connection]
bennyboobooboo has joined #ruby
rickruby has joined #ruby
Cephalostrum has joined #ruby
burlyscudd has joined #ruby
tharindu|away is now known as tharindu
vlad_starkov has quit [Remote host closed the connection]
ahawkins has quit [Ping timeout: 260 seconds]
<benzrf|semiafk>
my god
<benzrf|semiafk>
there is now a cryptocurrency called 'coinye'
<benzrf|semiafk>
formerly 'coinye west'
okinomo has quit [Ping timeout: 272 seconds]
<platzhirsch>
Just another digital currency
Liothen has joined #ruby
lethjakman has quit [Ping timeout: 252 seconds]
okinomo has joined #ruby
senj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bennyboobooboo has quit [Ping timeout: 252 seconds]
zumba_addict has joined #ruby
rickruby has quit [Ping timeout: 276 seconds]
gja has quit [Quit: This computer has gone to sleep]
poseid has quit [Quit: Page closed]
ozgun has quit [Quit: Leaving]
grn has joined #ruby
jlast has quit [Remote host closed the connection]
shaunbak_ has quit [Remote host closed the connection]
nhhagen has joined #ruby
aspires has joined #ruby
cafhacker has joined #ruby
`petey`_ has quit [Remote host closed the connection]
cafhacker has quit [Remote host closed the connection]
`petey` has joined #ruby
rickruby has joined #ruby
johchri has joined #ruby
camilasan has quit []
jlast has joined #ruby
WhoreMarketer has quit [Quit: Lost terminal]
nwertman has quit [Ping timeout: 265 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
gja has joined #ruby
Czupa has joined #ruby
jlast has quit [Remote host closed the connection]
`petey`_ has joined #ruby
`petey` has quit [Read error: Connection reset by peer]
batchitcray has joined #ruby
enape_101 has quit [Ping timeout: 252 seconds]
rickruby has quit [Remote host closed the connection]
simoz116 has joined #ruby
andikr has quit [Read error: Connection reset by peer]
zigomir has quit [Remote host closed the connection]
kevind_ has joined #ruby
rickruby has joined #ruby
tt1187 has quit [Read error: Operation timed out]
senj has joined #ruby
rhys has joined #ruby
dEPy_ is now known as dEPy
pen has joined #ruby
bline79_1 has joined #ruby
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fedesilva has quit [Read error: Connection reset by peer]
tt1187 has joined #ruby
okinomo has quit [Ping timeout: 252 seconds]
<rhys>
so have a question on patterns. i want to build a gem that wraps up other DNS gems. such that i can go add/del/update a and cname records, and then have various other gems under the hood go and do that
sambao21 has joined #ruby
fedesilva has joined #ruby
okinomo has joined #ruby
dukz has joined #ruby
fedesilv_ has joined #ruby
tropicalmug has joined #ruby
kevind has quit [Ping timeout: 276 seconds]
dukz has quit [Read error: Connection reset by peer]
kevind_ is now known as kevind
Spami has quit [Quit: This computer has gone to sleep]
dukz has joined #ruby
kobain has quit [Ping timeout: 252 seconds]
troyready has joined #ruby
rickruby has quit [Ping timeout: 245 seconds]
<joelio>
I guess I'm probably looking for a magic elixir that doesn't exist, but are there any decent gem's that can handle openoffice and office docs.. specifically for dealing with the metadata/fields. I guess it's all 'just XML' but interested to hear
Neomex has joined #ruby
ahmedelgabri has quit [Remote host closed the connection]
<joelio>
motive being the generate document templates with pre-filled fields based on arbirtary data stored in a webapp
Neomex has quit [Client Quit]
coca_rails has quit [Remote host closed the connection]
johchri has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
m8 has joined #ruby
dagobah has quit [Remote host closed the connection]
fedesilva has quit [Ping timeout: 245 seconds]
ferr has quit [Ping timeout: 246 seconds]
toastynerd has joined #ruby
brianpWins has quit [Quit: brianpWins]
toastynerd has quit [Remote host closed the connection]
toastynerd has joined #ruby
coca_rails has joined #ruby
Brolen has quit [Quit: Brolen]
tylersmith has quit [Remote host closed the connection]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
Fire-Dragon-DoL has joined #ruby
reset has joined #ruby
Neomex has joined #ruby
zeeraw has joined #ruby
simoz116 has quit [Ping timeout: 246 seconds]
dukz has quit [Ping timeout: 272 seconds]
bluOxigen has joined #ruby
platzhirsch has quit [Ping timeout: 240 seconds]
burlyscudd has quit [Quit: Leaving.]
mereghost has quit [Ping timeout: 276 seconds]
bennyboobooboo has joined #ruby
Virtualize has quit [Quit: Leaving...]
nik_-_ has joined #ruby
dukz has joined #ruby
nik_-_ has quit [Client Quit]
faceblaster has joined #ruby
okinomo has quit [Ping timeout: 252 seconds]
RaCx has joined #ruby
mereghost has joined #ruby
platzhirsch has joined #ruby
reset has quit [Ping timeout: 272 seconds]
okinomo has joined #ruby
nhhagen has quit [Remote host closed the connection]
Spami has joined #ruby
ehc has quit [Quit: ehc]
nhhagen has joined #ruby
dukz_ has joined #ruby
timonv has quit [Remote host closed the connection]
w|t has quit [Ping timeout: 252 seconds]
Voodoofish430 has joined #ruby
_maes_ has quit [Read error: Connection reset by peer]
Neomex has quit [Quit: Neomex]
terrellt has left #ruby [#ruby]
coca_rails has quit [Remote host closed the connection]
tharindu has quit [Quit: Leaving...]
dukz has quit [Ping timeout: 272 seconds]
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
aryaching has quit [Ping timeout: 272 seconds]
tharindu has joined #ruby
nwertman has joined #ruby
faceblaster has quit [Ping timeout: 252 seconds]
nhhagen has quit [Ping timeout: 265 seconds]
wildroman2 has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
zeade has joined #ruby
Virtualize has joined #ruby
Virtualize has quit [Client Quit]
Spami has quit [Quit: This computer has gone to sleep]
enape_101 has joined #ruby
fedez77 has quit [Read error: Connection reset by peer]
hiall has joined #ruby
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
apeiros has joined #ruby
wildroman2 has joined #ruby
okinomo has quit [Ping timeout: 252 seconds]
tobago has quit [Remote host closed the connection]
okinomo has joined #ruby
unixpro1970 has joined #ruby
unixpro1970 has quit [Max SendQ exceeded]
coca_rails has joined #ruby
croaky has joined #ruby
razibog has joined #ruby
simoz116 has joined #ruby
Galgorth has joined #ruby
netf has joined #ruby
pwh has quit []
browndawg has quit [Quit: Leaving.]
Virtualize has joined #ruby
dukz has joined #ruby
Nogbit has joined #ruby
jlast has joined #ruby
roolo has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jlast has joined #ruby
havenwood has joined #ruby
jlebrech has quit [Quit: Konversation terminated!]
danshultz has quit [Read error: Operation timed out]
mrnugget has joined #ruby
pranny has joined #ruby
michael_lee has quit [Quit: Ex-Chat]
fusi0n has joined #ruby
<benzrf|semiafk>
are class-vars accessed from a method defined in a module looked up in the module or in the class of the object you call the method on?
fedez77 has joined #ruby
rickruby has joined #ruby
okinomo has quit [Ping timeout: 252 seconds]
okinomo has joined #ruby
danijoo has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
danijoo has joined #ruby
oneveil has quit [Quit: Leaving]
simoz116 has quit [Ping timeout: 265 seconds]
timonv_ has quit [Read error: Connection reset by peer]
subbyyy has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
mklappst_ has quit [Remote host closed the connection]
rickruby has quit [Remote host closed the connection]
larissa has quit [Quit: Leaving]
cj3kim has joined #ruby
arietis has joined #ruby
simoz116 has joined #ruby
mlpinit_ has joined #ruby
kacperix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mlpinit has quit [Read error: Operation timed out]
mereghost has quit [Ping timeout: 246 seconds]
w|t has joined #ruby
simoz117 has joined #ruby
m00nlight_ has joined #ruby
ambushsabre has quit [Quit: rip]
m00nlight has quit [Ping timeout: 265 seconds]
cj3kim_ has joined #ruby
sporkubus has joined #ruby
mereghost has joined #ruby
wgosling has quit [Quit: Konversation terminated!]
RaCx has quit [Quit: Computer has gone to sleep.]
`petey`_ has quit [Remote host closed the connection]
simoz116 has quit [Ping timeout: 276 seconds]
unixpro1970 has joined #ruby
`petey` has joined #ruby
cj3kim has quit [Ping timeout: 245 seconds]
Advocation has joined #ruby
jlast has quit [Remote host closed the connection]
sporkubus has quit [Remote host closed the connection]
simoz118 has joined #ruby
okinomo has quit [Ping timeout: 272 seconds]
noop has quit [Ping timeout: 252 seconds]
wgosling has joined #ruby
noop has joined #ruby
okinomo has joined #ruby
`petey` has quit [Read error: Connection reset by peer]
`petey`_ has joined #ruby
Soda has joined #ruby
nhhagen has joined #ruby
Advocation has quit [Client Quit]
carraroj has joined #ruby
Intrepidd has joined #ruby
maletor has joined #ruby
simoz117 has quit [Ping timeout: 252 seconds]
peterhu has quit [Quit: leaving]
subbyyy_ has joined #ruby
simoz118 has quit [Ping timeout: 276 seconds]
w|t has quit [Ping timeout: 272 seconds]
wgosling has quit [Quit: Konversation terminated!]
mneorr has joined #ruby
wgosling has joined #ruby
lfox has joined #ruby
devdazed_ has joined #ruby
`petey`_ has quit [Remote host closed the connection]
`petey` has joined #ruby
bashdy has joined #ruby
unixpro1970 has quit [Ping timeout: 252 seconds]
RaCx has joined #ruby
unixpro1970 has joined #ruby
TMM has quit [Quit: Ex-Chat]
unixpro1970 has quit [Max SendQ exceeded]
okinomo has quit [Ping timeout: 252 seconds]
bilbo_swaggins has joined #ruby
okinomo has joined #ruby
gcds has joined #ruby
postmodern has joined #ruby
`petey`_ has joined #ruby
<gcds>
Hello, maybe someone could help to fix spelling and grammar on my project description it's only one page not full
<gcds>
Because English is not my first language
`petey`_ has quit [Remote host closed the connection]
lukec has joined #ruby
Mars has joined #ruby
`petey` has quit [Read error: Connection reset by peer]
heftig has joined #ruby
w4pm has joined #ruby
Mars is now known as Guest14464
Liquid_X has left #ruby [#ruby]
spider-mario has quit [Remote host closed the connection]
zxd has quit [Ping timeout: 272 seconds]
heidi has joined #ruby
nhhagen has quit []
<benzrf|semiafk>
gcds: sure@
<benzrf|semiafk>
*sure!
<benzrf|semiafk>
link please?
tylersmith has joined #ruby
reset has joined #ruby
meatherly has joined #ruby
Intrepidd has quit []
cj3kim_ has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
nwertman has quit [Ping timeout: 265 seconds]
MrZYX|off is now known as MrZYX
Astralum has joined #ruby
Kar- has quit [Ping timeout: 252 seconds]
Astralum has quit [Read error: Connection reset by peer]
reset has quit [Ping timeout: 265 seconds]
okinomo has quit [Ping timeout: 252 seconds]
apeiros has quit [Remote host closed the connection]
okinomo has joined #ruby
diegoviola has joined #ruby
timonv has quit [Remote host closed the connection]
apeiros has joined #ruby
saarinen has joined #ruby
peterhu has joined #ruby
lukec has quit [Quit: lukec]
ambushsabre has joined #ruby
rickruby has joined #ruby
obs_ has quit [Quit: Saliendo]
`petey` has joined #ruby
kloeri has quit [Ping timeout: 630 seconds]
apeiros has quit [Ping timeout: 260 seconds]
Brolen has joined #ruby
cj3kim has joined #ruby
jlast has joined #ruby
meatherly has quit [Remote host closed the connection]
intuxicated_ has joined #ruby
mklappstuhl has joined #ruby
figgleberry has quit [Ping timeout: 252 seconds]
<Galgorth>
How does the initialize method in classes work?
joaoh82 has quit [Remote host closed the connection]
<Galgorth>
Hanmac1: That just confuses me more haha
<benzrf|semiafk>
Galgorth: after the object is already created, it automatically gets initialize called on it
<benzrf|semiafk>
with the arguments you sent to new
zumba_addict has quit [Quit: zumba_addict]
axl_ has quit [Quit: axl_]
CaptainJet has joined #ruby
<Galgorth>
benzrf: Hrmm ok, I'm just reading this code example: https://gist.github.com/gphummer/8321775 dealing with closures, and it looks like initialize was explicitly defined there
<benzrf|semiafk>
Galgorth: do you know what a closure is?
<benzrf|semiafk>
Galgorth: yeah, initialize is defined by you
rootshift has joined #ruby
<benzrf|semiafk>
Galgorth: then when you call 'new' on a class, the new method internally will call initialize on the new object
<benzrf|semiafk>
after it is created
<benzrf|semiafk>
that way you can set up some code that will be run for every time you create an object of that class
Cephalostrum has joined #ruby
Cephalostrum has quit [Max SendQ exceeded]
<Galgorth>
benzrf|semiafk: I see
Cephalostrum has joined #ruby
<Galgorth>
benzrf|semiafk: From what I gather, a closure is a method that you can call from outside the scope of a class
<benzrf|semiafk>
not exaxctly
<benzrf|semiafk>
a closure is a piece of code like a proc or a function that remembers the variables that were around it when it was defined
`petey` has quit [Remote host closed the connection]
<benzrf|semiafk>
that is, when a piece of code is lexically scoped
rubyracer has joined #ruby
<benzrf|semiafk>
if a language supports passing functions around and has lexical scope but does not support closures, that would mean that if you defined a function and then gave it back, it would not be able to see the variables in the scope where it was defined unless that scope still exists
<benzrf|semiafk>
with closures, the proc 'closes over' the variables around it
<benzrf|semiafk>
even if the scope it was defined in is otherwise lost
<benzrf|semiafk>
for example
<benzrf|semiafk>
local vars are scoped to one run-through (or invocation) of a method
razibog has quit [Ping timeout: 252 seconds]
<benzrf|semiafk>
so they go away when the method finishes that run-through
baschtmobil has quit [Ping timeout: 246 seconds]
cmedeiros has joined #ruby
<benzrf|semiafk>
but if you make a proc in that method and return it, the variables you defined in the method will still be visible to the proc
<benzrf|semiafk>
even though that scope no longer exists in any other way
cmedeiros has quit [Max SendQ exceeded]
<benzrf|semiafk>
the method is 'closed over' that scope
<Galgorth>
benzrf|semiafk: Cool, so a proc is a way to save the variables in a method that you don't want to go away
<Galgorth>
benzrf|semiafk: after the method completes
<benzrf|semiafk>
well, normally you just return any values you give back
<benzrf|semiafk>
*you want to give back
Landshark753 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Galgorth>
benzrf|semiafk: What does give back mean in this context?
<benzrf|semiafk>
you return it
Advocation has joined #ruby
phipes has quit [Remote host closed the connection]
<benzrf|semiafk>
the values that the variables in the method point to still exist even if the variables go away, as long as you keep ahold of a reference to it
kpshek has quit []
danshultz has joined #ruby
<Galgorth>
benzrf|semiafk: I see
<benzrf|semiafk>
closures just mean that you are free to talk about the variables near you when you define a proc without worrying about them no longer being available if you run the proc somewhere else entirely
nwertman has joined #ruby
<benzrf|semiafk>
so I can do this:
<benzrf|semiafk>
def foo
<benzrf|semiafk>
a = 3
olivier_bK has quit [Read error: Operation timed out]
<benzrf|semiafk>
proc {a + 1}
<benzrf|semiafk>
end
okinomo has quit [Ping timeout: 260 seconds]
<benzrf|semiafk>
closure = foo
<benzrf|semiafk>
closure.call
<benzrf|semiafk>
^that gives 4
burlyscudd has quit [Quit: Leaving.]
tyl has quit [Ping timeout: 272 seconds]
<benzrf|semiafk>
even though the method finished, the proc can still see 'a'
<benzrf|semiafk>
because it is closed over it
<benzrf|semiafk>
it sees the variables from where it is defined, not from where it is called
<Galgorth>
and a is saved to 3 in that case
<benzrf|semiafk>
right
okinomo has joined #ruby
<Galgorth>
if you did close.call again
rdark has quit [Quit: leaving]
<Galgorth>
er
<Galgorth>
closure.call
<Galgorth>
would it output 5?
<benzrf|semiafk>
no
<benzrf|semiafk>
I'm not /setting/ a
<benzrf|semiafk>
just looking at it
<benzrf|semiafk>
proc {a + 1}
<Galgorth>
ahhh right
fijimunkii has quit [Ping timeout: 252 seconds]
<benzrf|semiafk>
anyway, a block is a new scope
<benzrf|semiafk>
lvars defined or changed in a block will not persist outside the block
<benzrf|semiafk>
look @ this:
<benzrf|semiafk>
def foo
rickruby has quit [Remote host closed the connection]
<benzrf|semiafk>
thing = proc {a = 2}
<benzrf|semiafk>
thing.call
<benzrf|semiafk>
a
<benzrf|semiafk>
end
<benzrf|semiafk>
^that will error
rickruby has joined #ruby
<benzrf|semiafk>
even though proc can see the scope it was defined in, it can't /change/
<benzrf|semiafk>
it
axl_ has joined #ruby
<benzrf|semiafk>
that defines a new lvar called a
bennyboobooboo has quit [Remote host closed the connection]
<benzrf|semiafk>
*blocks are scopes for lvars too
<benzrf|semiafk>
not just methods
<benzrf|semiafk>
class blocks are also lvar scopes
tyl has joined #ruby
bennyboobooboo has joined #ruby
<Galgorth>
i see
<benzrf|semiafk>
an important thing to understand is the distinction between variables/names and objects/values
<benzrf|semiafk>
changing an object is NOT the same as moving variables around
<benzrf|semiafk>
when I do this:
<benzrf|semiafk>
str1 = "foo"
<benzrf|semiafk>
str1 = "bar"
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
<benzrf|semiafk>
I changed what str1 refers to
<benzrf|semiafk>
but i DIDN'T change the original string object that contained "foo"
danshultz has quit [Remote host closed the connection]
<benzrf|semiafk>
it stil exists somewhere, impossible to reach since I don't have any way of finding it
vt102 has quit [Remote host closed the connection]
<Galgorth>
interesting
danshultz has joined #ruby
<benzrf|semiafk>
eventually ruby will throw it away when it realizes that it can't be seen
<benzrf|semiafk>
that's called garbage collection
<Galgorth>
so there are two str1 objects in memory then?
horofox has joined #ruby
<benzrf|semiafk>
not str1 objects
<benzrf|semiafk>
objects don't know what variable they're in
<benzrf|semiafk>
variables are names that point to objects or values
<benzrf|semiafk>
now...
<benzrf|semiafk>
str1 = "foo"
<benzrf|semiafk>
str1.reverse!
<benzrf|semiafk>
THAT actually changed the object
tharindu has quit [Ping timeout: 252 seconds]
<benzrf|semiafk>
str1 still points to the same object as before
<benzrf|semiafk>
but now the object is different!
<benzrf|semiafk>
str1 = "foo"
rickruby has quit [Read error: Operation timed out]
<benzrf|semiafk>
str1 = str1.reverse
LiohAu has joined #ruby
<benzrf|semiafk>
'reverse' returns a new string without changing the old one
<benzrf|semiafk>
so that last example DOESNT change the original string
<Galgorth>
yeah
<benzrf|semiafk>
it just changes what str1 points to
<benzrf|semiafk>
changing an object is called 'mutation'
<benzrf|semiafk>
changing what a name points to is called 'reassignment'
<terrellt>
Er, why is this important? Definitely neat, but unless you want to deal with the garbage collector..
<benzrf|semiafk>
terrellt: because I know the pain of not understanding the difference between reassignment and mutation
<benzrf|semiafk>
it caused me issues
rickruby has joined #ruby
<Galgorth>
str1.reverse! changes str1 permanently instead of just modifying str1 temporarily?
<benzrf|semiafk>
it changes the object str1 points to
<benzrf|semiafk>
str1 is not repointed
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<Galgorth>
i see
<benzrf|semiafk>
while reassigning str1 leaves the original object alone, and repoints str1
<Galgorth>
str1.reverse and str1.reverse! are two different methods
<benzrf|semiafk>
yeah!
<Galgorth>
reverse! permanently changes it
bennyboobooboo has quit [Ping timeout: 265 seconds]
<benzrf|semiafk>
while reverse gives back a new string
<Galgorth>
yep, cool
ambushsabre has joined #ruby
<benzrf|semiafk>
here is an example of when this matters:
<benzrf|semiafk>
str1 = "foo"
<benzrf|semiafk>
str2 = str1
<benzrf|semiafk>
str1 = str1.reverse
vlad_starkov has joined #ruby
<Galgorth>
ahhhh
<Galgorth>
does it point to
<benzrf|semiafk>
^in that case, str1 still points to the original string
<Galgorth>
foo
<Galgorth>
or oof?
<benzrf|semiafk>
while str2 points to a new string
<benzrf|semiafk>
oops
<benzrf|semiafk>
got it backward
<benzrf|semiafk>
my bad
<Galgorth>
str2 points to foo
<Galgorth>
while str1 points to oof
<benzrf|semiafk>
right
<benzrf|semiafk>
now, if I did this:
<benzrf|semiafk>
str1 = "foo"
<benzrf|semiafk>
str2 = str1
<benzrf|semiafk>
str1.reverse!
mechanicalfish has joined #ruby
<benzrf|semiafk>
now BOTH are "oof"
<Galgorth>
interesting
<benzrf|semiafk>
because you changed the single object that they both point to
<benzrf|semiafk>
that can cause bugs if you don't understand what's going on!
horofox has quit [Ping timeout: 260 seconds]
<Galgorth>
lol i bet
<benzrf|semiafk>
this is why you don't want to change objects given to your methods at will
<benzrf|semiafk>
if you have a method called 'get_user' that takes a string for a username
<benzrf|semiafk>
and you change that string
<benzrf|semiafk>
the code that calls it might keep using the same string you passed to the method
<benzrf|semiafk>
even though now it's different!
<benzrf|semiafk>
for example:
<benzrf|semiafk>
user = get_user(username)
|RicharD| has joined #ruby
dEPy has quit [Quit: Computer has gone to sleep.]
<|RicharD|>
hi i have updated to ruby 2.1
gja has quit [Quit: This computer has gone to sleep]
<benzrf|semiafk>
most other popular languages nowadays (afaik) have immutable strings
<benzrf|semiafk>
which means there's no way to change a string object
<benzrf|semiafk>
you can only get back new ones
<benzrf|semiafk>
to prevent exactly the kind of bug you see above
<Galgorth>
yeah
RaCx has quit [Quit: Computer has gone to sleep.]
okinomo has joined #ruby
<Galgorth>
from the rails reading i've done
<Galgorth>
it seems like they haven't changed objects very much
<Galgorth>
it's almost all been reassignment
bricker has joined #ruby
<Galgorth>
in the tutorials, at least
<bilbo_swaggins>
Galgorth, it takes longer, but I really recommend learning Ruby before Rails
<Galgorth>
bilbo_swaggins: I came to that painstaking conclusion last night ;p
<bilbo_swaggins>
Rails is my least favorite thing about Ruby. Don't get me wrong: it's neat and has a lot going for it, but Ruby is a powerful language and is useful for many things.
madhadron has joined #ruby
<bilbo_swaggins>
With great power comes great debugging
<madhadron>
Does anyone know how to get an authentication token for 'gem push' without actually pushing?
ewnd9 has quit [Read error: Operation timed out]
Kruppe has quit [Read error: Connection reset by peer]
cmedeiros has joined #ruby
Kruppe- has joined #ruby
shime has joined #ruby
brianpWins has joined #ruby
`petey` has joined #ruby
<Galgorth>
benzrf|semiafk: actually, if you changed the string-object in the 'get_user' method, wouldn't it return back an error since that string no longer exists?
<Galgorth>
benzrf|semiafk: rather than printing the wrong string
<bilbo_swaggins>
Galgorth, can you provide more context? Scope is all-important in this case.
cads has quit [Quit: Leaving]
mrnugget has quit [Quit: mrnugget]
cads has joined #ruby
<Galgorth>
bilbo_swaggins: I'm referring to benzrf's example of the 'get_user' method where the input is changed at the memory object level rather than reassigned
kirun has joined #ruby
ehc has joined #ruby
mudmaster has joined #ruby
lukec has joined #ruby
allaire has joined #ruby
zigomir has joined #ruby
<mechanicalfish>
madhadron: you can just call the api, no?
reset has joined #ruby
jlast has joined #ruby
mudmaste_ has quit [Ping timeout: 252 seconds]
<madhadron>
mechanicalfish: I suppose I can. Was hoping for a less inscrutable shell command, but I can certainly do that.
nanoyak has joined #ruby
Virtualize has quit [Quit: Leaving...]
okinomo has quit [Ping timeout: 260 seconds]
okinomo has joined #ruby
shime has quit [Ping timeout: 260 seconds]
joaoh82 has joined #ruby
<mechanicalfish>
madhadron: I was looking around in gem documentation but can't find anything useful
mr_red has quit [Ping timeout: 252 seconds]
rootshift has quit [Quit: rootshift]
ferr has joined #ruby
<madhadron>
mechanicalfish: Nor could I.
senj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pwh has joined #ruby
zumba_addict has joined #ruby
tvw has quit []
pixelgremlins has quit [Read error: Connection reset by peer]
<bilbo_swaggins>
Galgorth: if I understand correctly, then, we're talking about a single object pointed two by two variables: one within a method and one without
nowthatsamatt has joined #ruby
kpshek has joined #ruby
<bilbo_swaggins>
You want to avoid making editions to an object referenced in multiple places, unless you know exactly what you're doing
nowthatsamatt has left #ruby [#ruby]
RaCx has joined #ruby
<bilbo_swaggins>
Luckily, you can instead create a new object from the previous, with the changes you desire, without modifying the latter
rootshift has joined #ruby
* madhadron
files some issues on the gem team to add authentication commands and a --dry-run option to gem push.
joaoh82 has quit [Ping timeout: 252 seconds]
<bilbo_swaggins>
The general rule (but don't *rely* on this) is that methods which mutate objects have an exclamation point at the end of their name
senj has joined #ruby
shaunbaker has joined #ruby
<bilbo_swaggins>
So, as previously discussed, "foo".reverse and "foo".reverse! are doing quite different things
Advocation has quit [Quit: Advocation]
<bilbo_swaggins>
They still return the same value, but the exclamationy one permanently alters the object rather than creating a new one with the changes you wanted
sambao21 has joined #ruby
mehlah has quit [Quit: Leaving...]
<Galgorth>
bilbo_swaggins: ok
<Galgorth>
bilbo_swaggins: i'm using the pragmatic programmers 1.9/2.0 ruby tutorial book
Virtualize has joined #ruby
<Galgorth>
bilbo_swaggins: gonna read that some more then I'm sure I will have more questions ;p
mr_red has joined #ruby
dik_dak has joined #ruby
<Galgorth>
bilbo_swaggins: thanks
<bilbo_swaggins>
Is this your first language?
Virtualize has quit [Client Quit]
<bilbo_swaggins>
In some ways it introduces programming concepts gracefully, but in others it presents many pitfalls
<madhadron>
Yes, for a first language you're probably much better off with Scheme.
mocfive has joined #ruby
<bilbo_swaggins>
I'll save you the pain I spent months of debugging a sudoku-solver on: object.copy does not do what you might think it does
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<bilbo_swaggins>
madhadron: not sure if serious
<madhadron>
bilbo_swaggins: Me? Absolutely. But I'm also responsible for the Unix daemon utilities in Haskell.
Kar- has joined #ruby
<madhadron>
Scheme has about the lowest incidental complexity for a new programmer of any language I know. Forth requires too much time to learn stack discipline. Logo, maybe...
ahmedelgabri has joined #ruby
<bilbo_swaggins>
I still need to learn a proper functional language
<bilbo_swaggins>
But oh the stacks of books I "need" to read
<madhadron>
bilbo_swaggins: *grin* Yup. True for everyone.
<bilbo_swaggins>
on both counts, to be sure
<madhadron>
I was only referring to the books. Lots of folks get by fine without learning a pure functional language.
<madhadron>
Or go down the Prolog path instead.
timonv has joined #ruby
okinomo has quit [Ping timeout: 260 seconds]
<Xeago>
how about clojure?
<madhadron>
Xeago: Neat, neat language.
ferr has quit [Ping timeout: 257 seconds]
mneorr has quit [Remote host closed the connection]
<bilbo_swaggins>
I'm intrigued what the "atoms" in clojure are
okinomo has joined #ruby
<bilbo_swaggins>
explain like I'm five?
<Xeago>
thread safety things
<madhadron>
For learning a functional language, I recommend going to somewhere that won't let you use previous knowledge as a crutch, though. Ergo: Haskell.
<Xeago>
sorry, that's all I know
mneorr has joined #ruby
<madhadron>
bilbo_swaggins: Anything that isn't a list is an atom.
<bilbo_swaggins>
madhadron: that's precisely what I was thinking
<bilbo_swaggins>
oh alright
<bilbo_swaggins>
typed primitives
rootshift has quit [Quit: rootshift]
<Xeago>
madhadron: I think haskell is awkward for that, the naming of things are way too weird
gcds has quit [Read error: Connection reset by peer]
Kar- has quit [Ping timeout: 252 seconds]
<Xeago>
and not guessable imo
<madhadron>
So the EBNF of a Lisp is expr := atom | '(' expr+ ')'
gcds has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
<madhadron>
bilbo_swaggins: No, not at all. Syntax, not semantics.
<madhadron>
Xeago: I felt the same way about Ruby when I learned it.
<madhadron>
Intuitive is not usually a good indicator of anything except what your background is.
<bilbo_swaggins>
Xeago: don't you know programming is all about doing things the hard way to prove your manliness?
dfranciosi has quit [Remote host closed the connection]
<Xeago>
ruby reads like english?
<Xeago>
english is my background
mneorr has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
bennyboobooboo has joined #ruby
<benzrf|semiafk>
Xeago: haskell is excellent
<madhadron>
Xeago: And Haskell comes from a math background.
<benzrf|semiafk>
dem monads
<bilbo_swaggins>
abstract algebra is the dopest
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<madhadron>
bilbo_swaggins: If you mean symbols, i.e., 'something, then that's a different beast.
<Xeago>
s/background/foundation
<ericwood>
I like haskell, but I feel like I'd only truly enjoy it if I were a math person
<havenwood>
benzrf|semiafk: no woman no cry, no types no monads
rootshift has joined #ruby
<Xeago>
no monads no types
<Xeago>
that fits the lyrics
* madhadron
admits to being a mathematician in a previous career phase.
<bilbo_swaggins>
madhadron: I don't know what you mean
<havenwood>
Xeago: good point, types isn't multi-syllabic enough
<bilbo_swaggins>
I wanted to be a physicist since age 8. Didn't pan out that way. :P
<Xeago>
neither is cry
<Xeago>
tihypes I guess?
<madhadron>
bilbo_swaggins: I studied to be a physicist, and then ended up in math and then biology.
<bilbo_swaggins>
oh I didn't like biology at first, but now see the error of my ways
<bilbo_swaggins>
I'm fascinated by self-assembling machinery
<madhadron>
That is, how do you tell Lisp that you want an actual piece of data, not something executed.
Jake232 has joined #ruby
<bilbo_swaggins>
madhadron: I'm way out of my element with that
jerius has quit [Ping timeout: 252 seconds]
<bilbo_swaggins>
oh oh I get it
<madhadron>
bilbo_swaggins: Hmm. Maybe this will help. There are various atoms in a language: strings ("abc"), numbers (32), etc....but what do you call things like 'if'?
<bilbo_swaggins>
okay no I don't
<madhadron>
bbs, work calls
<bilbo_swaggins>
alright
<bilbo_swaggins>
I'll try to parse out what you're describing
sambao21 has quit [Quit: Computer has gone to sleep.]
burlyscudd has joined #ruby
<bilbo_swaggins>
so it's the treatment of code as data?
Advocation has joined #ruby
havenwood has quit [Remote host closed the connection]
<benzrf|semiafk>
madhadron: semantically or syntactically?
<bilbo_swaggins>
syntactically, they're reserved words / control structures / etc
<bilbo_swaggins>
semantically, I assume code as data
hiall has quit [Quit: hiall]
<benzrf|semiafk>
you can write a metacircular evaluator in Io the way you can in lisp
<benzrf|semiafk>
i think
cj3kim has quit [Remote host closed the connection]
mocfive has quit [Remote host closed the connection]
<bilbo_swaggins>
That's alright. I realized I wasn't as smart as I thought I was when I got 3/4 of the way through Goedel's proofs. I think I'm okay with not knowing everything. :P
Cephalostrum has joined #ruby
Sid05 has quit [Ping timeout: 260 seconds]
Sid05 has joined #ruby
rickruby has quit [Read error: Connection reset by peer]
sambao21 has joined #ruby
chomskiii has quit [Read error: Connection reset by peer]
<benzrf|semiafk>
i read about 1/2 of GEB
chomskiii has joined #ruby
rezzack has joined #ruby
<benzrf|semiafk>
which is where i got my basic understanding of the incompleteness thereom
<benzrf|semiafk>
*theorem
<benzrf|semiafk>
of course that was years ago, maybe id understand it better now
<benzrf|semiafk>
@_@
<benzrf|semiafk>
i could barely process it @ that point
okinomo has quit [Ping timeout: 260 seconds]
okinomo has joined #ruby
bashdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rootshift has quit [Quit: rootshift]
Czupa has quit [Remote host closed the connection]
bashdy has joined #ruby
baroquebobcat has joined #ruby
mlpinit_ has quit [Remote host closed the connection]
<bilbo_swaggins>
I was taking nothing as given and working through it
<madhadron>
bilbo_swaggins: All syntactically at this point.
<bilbo_swaggins>
Now I see why Goedel starved to death
<benzrf|semiafk>
this looks a little bit more impenetrable than GEB
<benzrf|semiafk>
@_@
<bilbo_swaggins>
yeah and this is the *handholding* version
mlpinit has joined #ruby
<madhadron>
So if an atom is "123" we say it's a string. If it's 123 we say it's a number. If it's if we say it's a symbol.
<madhadron>
If you were writing a parser, that's what you would call the types representing the atoms.
alvaro_o has joined #ruby
<madhadron>
Lisp (and Ruby, actually) let you get symbols as values. In Lisp, you can put them into lists and tell the Lisp compiler to compile what you've created.
doodlehaus has quit [Read error: Connection reset by peer]
doodlehaus has joined #ruby
qubit_ is now known as qubit
qubit has quit [Changing host]
qubit has joined #ruby
blackmes1 is now known as blackmesa
burlyscudd has quit [Quit: Leaving.]
dapz has quit [Ping timeout: 272 seconds]
bluOxigen has quit [Ping timeout: 276 seconds]
`petey` has quit [Remote host closed the connection]
dEPy has joined #ruby
interactionjaxsn has quit [Remote host closed the connection]
RaCx has joined #ruby
<bilbo_swaggins>
okay
<bilbo_swaggins>
how long have you been programming?
<madhadron>
Umm...17 years now, I guess.
<bilbo_swaggins>
oh wow okay
<bilbo_swaggins>
I tried to learn C++ when I was 15. Terrible choice of a first language.
<bilbo_swaggins>
I put down coding for a long time after that
maroloccio has quit [Ping timeout: 252 seconds]
rootshift has joined #ruby
phipes has joined #ruby
Zhwazi has joined #ruby
<madhadron>
I guess I learned QBASIC from my father earlier than 17 years ago, but that was when I started doing stuff seriously.
noop has quit [Ping timeout: 276 seconds]
<bilbo_swaggins>
Ruby has been my first serious venture into programming.
<madhadron>
C was the first language I learned. Then Perl, PHP, JavaScript, and then Lisp and Forth oddly enough.
<benzrf|semiafk>
I learned True BASIC from /my/ father!
<bilbo_swaggins>
actually, C is nice
<benzrf|semiafk>
it will have been about 10 years in a bit
okinomo has quit [Ping timeout: 260 seconds]
<benzrf|semiafk>
i think
<bilbo_swaggins>
making something complex is difficult, but there are few parts
<madhadron>
bilbo_swaggins: C is not nice. It is simply ubiquitous.
<benzrf|semiafk>
ive never done qbasic
<madhadron>
It has lots of jagged edges.
<bilbo_swaggins>
fair enough; that's why I stick with my 'easy' languages
<madhadron>
I suggest ALGOL W as an interesting example of an old procedural language with a very clean design.
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
okinomo has joined #ruby
<benzrf|semiafk>
easy language ftw B)
<benzrf|semiafk>
*languages
arietis has quit [Quit: Computer has gone to sleep.]
kacperix has joined #ruby
poulson has quit [Remote host closed the connection]
_honning_ has joined #ruby
<madhadron>
*shrugs* I regard Ruby as a hard language. Lots of sharp edges. Lots of incidental complexity.
<bilbo_swaggins>
pretty much what I was saying to Galgorth
<bilbo_swaggins>
:P
<benzrf|semiafk>
madhadron: yeah :|
<bilbo_swaggins>
I'm self-taught and actually really dug getting into CS theory. However, I want to study advanced concepts that school would really help with
<guilund>
hey guys, how can i create a hash using .map? it always writes a []
<benzrf|semiafk>
bilbo_swaggins: same :D
<benzrf|semiafk>
guilund: map makes [], that is what map does
<benzrf|semiafk>
guilund: you can turn it back into a hash if you wish
<benzrf|semiafk>
use Hash.[]
<bilbo_swaggins>
[].map {}.hash
<madhadron>
bilbo_swaggins: Hey, I never took a programming class. I did physics and math, and went to grad school in biology.
<guilund>
hmm
<bilbo_swaggins>
although that's leaving out a lot of important things to consider
interactionjaxsn has joined #ruby
<bilbo_swaggins>
I think #hash lines up [0] as the key to [1], [2] to [3], etc
<bilbo_swaggins>
grad school is what I want to go to
<guilund>
.hash gives me a number
<bilbo_swaggins>
Perhaps I could just get a bachelors in music and then convince someone to let me study AI
LiohAu has quit [Quit: LiohAu]
<madhadron>
bilbo_swaggins: I can't recommend grad school to anyone.
<benzrf|semiafk>
bilbo_swaggins: perhaps you mean #to_hash
<bilbo_swaggins>
madhadron: I'm insane enough to want it
<guilund>
benzrf|semiafk: thats the thing, it returns empty :P
<guilund>
benzrf|semiafk: i tried already
<benzrf|semiafk>
guilund: it expects an arg list of alternating k/v
<benzrf|semiafk>
not a single list
<benzrf|semiafk>
use *
<bilbo_swaggins>
moreso I want the environment of other motivated people
<benzrf|semiafk>
guilund: these are both valid:
<bilbo_swaggins>
hence, I spend a lot of time on IRC
<benzrf|semiafk>
Hash[:a, 1, :b, 2]
<benzrf|semiafk>
Hash[[[:a, 1], [:b, 2]]]
shadoi has joined #ruby
<guilund>
hmmm
<benzrf|semiafk>
give it either straight args or a list of pairs
<madhadron>
bilbo_swaggins: That doesn't require gradschool.
<benzrf|semiafk>
NOT a list of args
b00stfr3ak has joined #ruby
<benzrf|semiafk>
that is, Hash[[:a, 1, :b, 2]] is wrong
<guilund>
then the hash will be k => v with 0, 1
<guilund>
?
bline79_1 has quit [Remote host closed the connection]
<benzrf|semiafk>
hm?
reset has quit [Quit: Leaving...]
maroloccio has joined #ruby
<bilbo_swaggins>
well, the reason I didn't do well in school in the first place is I'm an arrogant bastard of a student, so you may have a point
Eiam has joined #ruby
<guilund>
{ :a => 1 }, { :b => 2 }
<benzrf|semiafk>
guilund: yes
<b00stfr3ak>
I'm having trouble using strict_encode/strict_decode64 I get the following error `unpack': invalid base64
dvarrui has joined #ruby
<madhadron>
bilbo_swaggins: *shrugs* So are half the folks you would be in grad school with. It's more that it's a very dysfunctional environment in most places and disciplines.
<benzrf|semiafk>
if you have a list of alternating k/v, use Hash[*the_list]
<benzrf|semiafk>
if you have a list of lists where the sublists look like [k, v], use Hash[the_list]
`petey` has joined #ruby
okinomo has quit [Ping timeout: 260 seconds]
<b00stfr3ak>
I'm trying to encrypt/decrypt contents of a file
<guilund>
it work deep in the array?
<benzrf|semiafk>
hm?
gcds has quit [Read error: Connection reset by peer]
okinomo has joined #ruby
skaflem has quit [Quit: Leaving]
<guilund>
[k, [[k, v] [k,v]]]
gcds has joined #ruby
<guilund>
something like that
<bilbo_swaggins>
guilund: if you have a list of keys and a list of values, you could zip them together first, ensuring an alternating set of keys and values
<bilbo_swaggins>
I'm not sure about the data you're operating on, though
rootshift has quit [Quit: rootshift]
<guilund>
im trying to 'draw' a hash with a lot of data, like a json
jnoob22 has quit [Ping timeout: 260 seconds]
<guilund>
to liquid template
<madhadron>
b00stfr3ak: Do you see any newlines or the like in your base64 encoded output?
<guilund>
ok guys, thanks
<guilund>
let me play a little with this Has
<b00stfr3ak>
madhadron: looks like just one line
<madhadron>
b00stfr3ak: If it says invalid base64, typically that means you've got a character that's not part of the encoding in it.
jnoob22 has joined #ruby
tropicalmug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<b00stfr3ak>
madhadron: ok it is encoding the \n because the file has new lines (hmmm)
rcs has quit [Ping timeout: 265 seconds]
cj3kim has joined #ruby
<madhadron>
b00stfr3ak: Of course it encodes the \n. base64 is for encoding binary sequences of bytes to be safely transmitted as ASCII.
ahuman has quit [Remote host closed the connection]
<madhadron>
Wixy, If you don't care about race conditions you don't need much of anything. Ruby has a Global Interpreter Lock.
okinomo has joined #ruby
mrnugget has joined #ruby
<guilund>
almost returns what i need, but it puts another [] in each item
bigbadbear has joined #ruby
<madhadron>
Wixy: Unless you need to always leave @foo in a particular state.
aspires has quit []
<guilund>
how can i get rid of these [] ?
jlast_ has joined #ruby
Kruppe has joined #ruby
larissa has joined #ruby
<guilund>
{"page"=>[[{"titulo"=>"Clinica"}, {"url"=>"Clinica"}], [{"titulo"=>"Teste 2"}, {"url"=>"Teste 2"}]]} returns something like this
<Wixy>
madhadron, what do you mean by global interpreter?
joaoh82 has quit [Ping timeout: 256 seconds]
<Hanmac1>
guilund: are you sure you want [{ 'titulo' => nav.titulo}, {'url'=>nav.titulo}] and not { 'titulo' => nav.titulo, 'url'=>nav.titulo} ?
cbetta is now known as cbetta_afk
<madhadron>
Wixy: Ruby only runs a single thread at once, no matter how many processors you have.
<Wixy>
alright, so it won't crash
billiam has joined #ruby
<DouweM>
madhadron: MRI has a GIL, not Ruby per se.
<Wixy>
but there will be race conditions
drumusician has joined #ruby
<Wixy>
right?
<madhadron>
Anyway, off to work
madhadron has quit [Quit: Leaving]
<guilund>
hanmac: this way you told
<Wixy>
ok thanks :P
<guilund>
hanmac: i made a mistake
<guilund>
hanmac: this {"menu" => [{ "label"=>"Clinica", "url"=>"Clinica", "titulo" => "Titulo da Page" }, { "label"=>"Lorem", "url"=>"lorem", "titulo" => "Titulo da Page" }] } works
Guest14464 has quit [Remote host closed the connection]
<DouweM>
Wixy: that single thread stuff is about MRI. If your script is ever going to be run on another implementation, you'll run into problems
aspires has joined #ruby
<Wixy>
MRI?
<Wixy>
I'm running it with "ruby", is it MRI?
<Wixy>
whatever it means
<DouweM>
Matz's Ruby Interpreter
<Wixy>
I didn't even know there were other implementations
<DouweM>
there are, JRuby, Rubinius etc
<Wixy>
oh, ok, sure
Kruppe has quit [Client Quit]
<billiam>
I want to check whether two arrays have an intersection, but don't actually care what that insersection is. Is there a more expressive/concise way of writing `([:a, :b] & [:b, :c]).empty?`
<Wixy>
I knew JRuby actually
<Wixy>
but no, it's with MRI
Advocation has quit [Quit: Advocation]
<DouweM>
so, the global interpreter lock stuff mentioned only counts for MRI
<benzrf|semiafk>
billiam: you could use sets
<benzrf|semiafk>
but otherwise no :\
<Wixy>
ok, thanks
<DouweM>
Wixy: i you're sure no-ones gonna run it on another impl, go ahead
<benzrf|semiafk>
see you all later
nanoyak has quit [Quit: Computer has gone to sleep.]
benzrf|semiafk has quit [Quit: pchoooooooo]
pwh has quit []
relix has joined #ruby
<Wixy>
what's the fastest btw?
jlast has quit [Ping timeout: 252 seconds]
Kruppe has joined #ruby
<terrellt>
Wixy: If one was obviously better there wouldn't be three.
<Wixy>
that's not true
<DouweM>
Wixy: depends. a large plus on the side of JRuby is that it doesn't have a GIL and so has actual concurrency with threads
<terrellt>
Wixy: Well, one isn't obviously better, so there's three.
bennyboobooboo has quit [Remote host closed the connection]
heidi has quit [Quit: Leaving.]
<Wixy>
alright, thanks guys
<guilund>
Hanmac: shit, its easy, i dont know why i didnt realize that [] in the map is not necessary
<guilund>
ashamed
Virtualize has joined #ruby
<Eiam>
billiam: sure..
senj has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Eiam>
>> [1,2] & [3,2] ? true : false
<billiam>
Eiam: oh?
<Eiam>
>> [1,2] & [3,2] ? true : false
* Eiam
stabs the bot
<DouweM>
Eiam: `? true : false` is pretty pointless
Hanmac1 is now known as Hanmac
<Eiam>
DouweM: no its there to indicate it provides those values..
<billiam>
also, isn't an empty array truthy?
intuxicated_ has quit [Read error: No route to host]
<Hanmac>
guilund: it is if you want to return more than one element
<terrellt>
Hey, if Rails can pollute ruby namespace, so can I.
pixelgremlins has joined #ruby
<Eiam>
terrellt: oh what a fantastic justification
sassamo has joined #ruby
<Eiam>
cause rails fuckign with the namespace never bit anyone in the ass ever
<DouweM>
:)
<Eiam>
(me, several times.)
<Eiam>
*staring at ruby documentation.. "but thats exactly what the method does.."*
<terrellt>
=)
<Eiam>
2 hours later
<Eiam>
RAILS YOU MOTHER FUCKERS
<DouweM>
hah, yeah that sounds familiar
<terrellt>
But yeah, writing Array#intersects? isn't -that- bad, since it's adding a method.
<DouweM>
exactly
<Eiam>
I guess. I just hate clever.
<Eiam>
its my least favorite part of ruby people
<Eiam>
being clever.
<DouweM>
haha
<Eiam>
oh look meta programmer jerk off code I get to understand and extend
<Eiam>
fantastic. just what I wanted to do today
`petey` has quit [Remote host closed the connection]
<Eiam>
fuck yeah he's using method missing everywhere, someone get me some coffee and a piece of paper stat
* Eiam
gouges eyeballs and pounds face into desk
<terrellt>
That's how I write all my code. Method missing and a big switch case.
<DouweM>
lol
dik_dak has quit [Quit: Leaving]
<bilbo_swaggins>
metaprogramming is dark voodoo not meant for man to comprehend
<Eiam>
my boss came in one day and said hey I wrote this cool new thing it does all this stuff that we always wanted
<Eiam>
so I was thinking cool thats good, good problem to solve
Virtualize has joined #ruby
reset has joined #ruby
<Eiam>
so I go read the code, its all method missing based, regexing on args and a switch-esque logic based on what regex find in the args, then re-calling itself again against method missing with new args from those args
<DouweM>
ew ew ew
<DouweM>
you made him fire himself right
<Eiam>
I spent about 3 hours that evening making sense of it, texted him and told him his code was really clever
<Eiam>
and that he's an asshole and i hate him.
`petey` has joined #ruby
sassamo has quit [Ping timeout: 252 seconds]
<b00stfr3ak>
madhadron: figured it out. dumb me wasn't adding a new line to the file i was writing to.
<Eiam>
he also didn't implement a respond_to_mssing
colonolGron has joined #ruby
hoelzro has quit [Ping timeout: 245 seconds]
Virtualize has quit [Client Quit]
<Hanmac>
Eiam "respond_to_missing?" is not always needed but a nice to have
hoelzro has joined #ruby
<Eiam>
DouweM: nah, I just called him an asshole and said he's too clever for his own good. even smart people can do dumb things. I think he realized when he had to later go extend the functionality how difficult it was to remember how all the metaprogramming worked originally now that he'd forgotten
okinomo has quit [Ping timeout: 252 seconds]
<Eiam>
everything makes sense *when you write it*
<Eiam>
its two months later that I care about, because heyo my job involves a lot of maintenance programming
<DouweM>
Eiam: yeah, I was just kidding. I've gone too far with cleverness on occasion as well
<Eiam>
I rarely write new code from scratch, hell I'm lost trying to bring up new projects from scratch
okinomo has joined #ruby
<|RicharD|>
I have a big problem
<|RicharD|>
i do a simple script that search on twitter
<Eiam>
|RicharD|: better get it resolved quick! =)
<Eiam>
I have 0 desire to ever "relearn" C++ (like I ever knew it anyway, even after 4 years of doing it)
<Eiam>
i'll learn haskell before I learn C++
<|RicharD|>
i can paste the script because there are the tokens :S anyway it works fine…it show me the twitter messages
carraroj has quit [Quit: Konversation terminated!]
<bilbo_swaggins>
Eiam: I agree that Ruby does have a lot of cleverness. Attractive nuisances, to borrow a legal term.
<|RicharD|>
but then, when have "finished" give me this error, at my co-workers/friend NO
alexherbo2 has joined #ruby
<|RicharD|>
I use: witter (5.5.1) and ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-darwin12.5.0] like my friend
<Eiam>
bilbo_swaggins: I mean its fine, I love ruby after all, but it does attract a bit too much of that kind of people for me, but thats okay, I rarely have to deal with their code, and I certainly don't have to write code like that, so its OK
dik_dak has joined #ruby
<Hanmac>
Eiam i use C macros do bind C++ functions to ruby ;P (and you are only safe because i am to lazy to add other languages into the equalization ;P)
<Eiam>
DSLs are reaching face punch reaction for me too lately but w/e
heidi has quit [Quit: Leaving.]
<Eiam>
I'm a quirky dude =)
<Eiam>
fantastic you mean I can't actually read your code either until I first learn your subset of ruby, lovely. thanks asshole.
<bilbo_swaggins>
my code, my rules
<bilbo_swaggins>
:P
<|RicharD|>
Any idea/suggest ?
<bilbo_swaggins>
I'm going to monkey patch control structures
Virtualize has joined #ruby
guilund has quit [Remote host closed the connection]
sassamo has joined #ruby
Soda has quit [Read error: Connection reset by peer]
decoponio has quit [Quit: Leaving...]
reset has joined #ruby
senj has joined #ruby
amedeiro_ has joined #ruby
amedeiros has quit [Write error: Connection reset by peer]
amedeiro_ is now known as amedeiros
cj3kim has quit [Read error: Connection reset by peer]
cj3kim_ has joined #ruby
okinomo has quit [Ping timeout: 260 seconds]
pwh has quit []
senj has quit [Client Quit]
bilbo_swaggins has quit [Quit: Leaving]
croaky has quit [Ping timeout: 276 seconds]
okinomo has joined #ruby
senj has joined #ruby
jeremyevans has joined #ruby
burlyscudd has joined #ruby
subbyyy_ has quit [Ping timeout: 272 seconds]
zipper has joined #ruby
coca_rails has quit [Remote host closed the connection]
P1RATEZ has joined #ruby
mehlah has joined #ruby
<jeremyevans>
If anyone here knows MRI internals well, is INSN.operand_size (compile.c) allowed to be negative?
coca_rails has joined #ruby
Kar- has quit [Ping timeout: 252 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
<Hanmac>
jeremyevans: what is INSN?
<jeremyevans>
I'm investigating a crash on OpenBSD/sparc64 where it is negative, and want to know if I can catch it when the INSN is created instead of later where it is used
<jeremyevans>
Hanmac: typedef struct iseq_insn_data in compile.c
jlast_ has quit [Remote host closed the connection]
nari has quit [Ping timeout: 272 seconds]
jlast has joined #ruby
jerius has joined #ruby
kt__ has joined #ruby
jlast has quit [Read error: Connection reset by peer]
po10 has quit [Quit: /]
jlast has joined #ruby
<kt__>
What's up with this:
<kt__>
rake aborted!
<kt__>
undefined method `join' for LL(:migrate, "db"):Rake::Scope
<kt__>
happens after the rake contract changes between versions
razibog has joined #ruby
flame_ has joined #ruby
po10 has joined #ruby
sec^nd has joined #ruby
alexherbo2 has quit [Read error: Connection reset by peer]
kt__ has quit [Client Quit]
jlast has quit [Read error: Connection reset by peer]
<sec^nd>
What is the correct to use should ? I was doing error (my function) error?.should == false and then I switched to error?.should be_false, "Message" and now it fails because there is no be_false
RaCx has quit [Quit: Computer has gone to sleep.]
<sec^nd>
What is the correct to do assertions with error messages in ruby?
danshultz has quit [Remote host closed the connection]
mocfive has joined #ruby
jlast has joined #ruby
danshultz has joined #ruby
okinomo has quit [Ping timeout: 252 seconds]
flame_ has quit [Remote host closed the connection]
mklappst_ has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
okinomo has joined #ruby
zipper has quit [Quit: leaving]
wildroman2 has quit [Remote host closed the connection]
apeiros has joined #ruby
claymore has quit [Ping timeout: 252 seconds]
mklappstuhl has quit [Ping timeout: 265 seconds]
shadoi has quit [Quit: Leaving.]
coca_rails has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
Brolen has quit [Quit: Brolen]
mneorr has joined #ruby
claymore has joined #ruby
drumusician has quit [Read error: Connection reset by peer]
maletor has quit [Quit: Computer has gone to sleep.]
vlad_starkov has quit [Remote host closed the connection]
benlieb has joined #ruby
Brolen has joined #ruby
nanoyak has joined #ruby
tyl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
d2dchat has joined #ruby
gcds has quit [Quit: gcds]
ehaliewicz has joined #ruby
okinomo has quit [Ping timeout: 265 seconds]
ckinni has joined #ruby
mneorr has quit [Ping timeout: 252 seconds]
okinomo has joined #ruby
heidi has joined #ruby
subbyyy_ has joined #ruby
drumusician has joined #ruby
croaky has joined #ruby
joaoh82 has joined #ruby
Advocation has joined #ruby
cbetta_afk is now known as cbetta
bennyboobooboo has joined #ruby
Advocation has quit [Client Quit]
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
joaoh82 has quit [Ping timeout: 252 seconds]
codepython777 has joined #ruby
rootshift has joined #ruby
wildroman2 has joined #ruby
AlSquire has quit [Quit: Quitte]
sambao21 has joined #ruby
mneorr has joined #ruby
gasbakid has joined #ruby
psyl0n has joined #ruby
RaCx has joined #ruby
Jdubs has joined #ruby
havenwood has joined #ruby
guilund has joined #ruby
stetho has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<chebyte>
hi guys I have a question I was using wkhtmlpdf and when I generate a pdf from html with 72 dpi in linux it generates a empty page and in mac is ok
<chebyte>
anyone knows why?
Mars is now known as Guest97614
Zesty has joined #ruby
fijimunkii has joined #ruby
Zesty has quit [Client Quit]
dEPy has quit [Quit: Computer has gone to sleep.]
IceDragon has quit [Read error: No route to host]
Guest97614 has quit [Ping timeout: 252 seconds]
pwh has joined #ruby
danshultz has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
panchiniak has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
kobain has joined #ruby
simoz118 has joined #ruby
m8 has quit [Quit: Sto andando via]
mityaz has quit [Quit: See ya!]
makkura has joined #ruby
coca_rails has joined #ruby
dkamioka has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
IceDragon has joined #ruby
Wolland has quit [Remote host closed the connection]
gasbakid has quit [Read error: Connection reset by peer]
figgleberry has joined #ruby
bashdy has quit []
makerops has quit [Remote host closed the connection]
okinomo has quit [Ping timeout: 260 seconds]
sailias has quit [Quit: Leaving.]
okinomo has joined #ruby
Albright has quit [Ping timeout: 246 seconds]
apeiros has quit [Remote host closed the connection]
charliesome has joined #ruby
mrnugget has quit [Quit: mrnugget]
apeiros has joined #ruby
Virtualize has quit [Quit: Leaving...]
diegoviola has quit [Quit: WeeChat 0.4.2]
maletor has joined #ruby
Albright has joined #ruby
AlSquire has joined #ruby
dEPy has joined #ruby
sambao21 has joined #ruby
t4nkd has joined #ruby
ahmedelgabri has quit []
drumusician has quit [Ping timeout: 252 seconds]
mark_locklear has quit [Ping timeout: 252 seconds]
apeiros has quit [Ping timeout: 260 seconds]
bilbo_swaggins has joined #ruby
croaky has quit [Ping timeout: 252 seconds]
lkba has quit [Ping timeout: 252 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lkb has quit [Ping timeout: 260 seconds]
Kar- has joined #ruby
beneggett has joined #ruby
yasushi has joined #ruby
zegerjan has quit [Ping timeout: 260 seconds]
bilbo_swaggins has quit [Quit: Leaving]
dEPy has quit [Quit: Computer has gone to sleep.]
axl_ has joined #ruby
Kar- has quit [Ping timeout: 265 seconds]
FifthWork has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
fgo has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
dEPy has joined #ruby
croaky has joined #ruby
yasushi has quit [Ping timeout: 260 seconds]
kung has quit [Read error: Connection reset by peer]
echevemaster has joined #ruby
dangerousdave has quit []
terrellt has left #ruby [#ruby]
kung has joined #ruby
drumusician has joined #ruby
DrShoggoth has joined #ruby
horofox_ has joined #ruby
lkb has joined #ruby
mengu has quit [Remote host closed the connection]
pwh has quit []
wookiehangover is now known as sambreed
jovon has quit [Quit: Leaving]
horofox_ has quit [Client Quit]
mocfive has quit [Remote host closed the connection]
Wixy has quit [Read error: Operation timed out]
panchiniak has left #ruby ["Leaving"]
drewgle_ has joined #ruby
danshultz has joined #ruby
Wolland has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
<drewgle_>
Is there a similarly succinct form of enum_of_objects.map(&:attr) for an enum of hashes?
<user10121>
this is probably a very newbie-level question. i need to see as much of the code as possible while coding. sometimes i even prefer to "minify", which considerably affects readability but maximizes the amount of code i can see at once.
<user10121>
#1 am i a rare case? if so, what do you think are your compensatory practices or skills? #2 what are some of the tools you [think i could] use for this? something that shows a reasonably detailed outline of the code (with support for comments/annotations?). something that makes it easy to find my way around my own code.
<benzrf>
user10121: nice reposting :)
Advocation has joined #ruby
cameronbarton has joined #ruby
<user10121>
benzrf: no answer reached me last time
<benzrf>
I'm proofreading something for a guy here but I dont remember his nick, are you there? I still have your email
<benzrf>
user10121: yeah
<benzrf>
user10121: I dont really have too much of an issue with that
<benzrf>
user10121: dunno if other people do
<user10121>
benzrf: do you just have a very good visual memory?
havenwood has quit [Ping timeout: 260 seconds]
gasbakid has joined #ruby
<benzrf>
user10121: it's ok
<benzrf>
but why would you need visual memory?
<benzrf>
maybe the issue is with your program design and not your ability to code
coca_rails has joined #ruby
simoz118 has quit [Ping timeout: 252 seconds]
Xeago has quit [Remote host closed the connection]
<benzrf>
if you have a whole lot of methods, that might make it hard to remember which one you need
<benzrf>
vs. a few methods that take parameters
<user10121>
benzrf: i don't know... i often end up having to think of the whole program... i guess
pen has quit [Remote host closed the connection]
<benzrf>
alright
<benzrf>
well, ive heard people lauding ST's minimap feature
havenwood has joined #ruby
<benzrf>
which you can also get for gvim
pen has joined #ruby
<benzrf>
personally i just hop around the code if I need to see another part of ItSANgo
<benzrf>
or are you talking about overall structure?
<user10121>
that too
<benzrf>
*it, not ItSANgo
joaoh82 has joined #ruby
<benzrf>
well, if your program is well-designed, you shouldn't have to be thinking about anything other than the part you're working on and what it calls
<benzrf>
;p
<user10121>
but quick/efficient navigation and especially very efficient ways to switch back to my previous location would be tremendous
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benzrf>
what editor do you use?
drewgle_ has quit [Quit: leaving]
w4pm has quit [Ping timeout: 252 seconds]
<user10121>
i know how well vim supports this, but i don't use vim
<benzrf>
what tho
<user10121>
i use kate, but i guess i'm supposed to switch to emacs sooner or later (which can mean as soon as this week)
pehlert has quit [Ping timeout: 260 seconds]
<benzrf>
why emacs??
<user10121>
they say it's wildly extendable
<benzrf>
it is
<user10121>
i would use it with vimperator anyway
sambao21 has joined #ruby
<benzrf>
vim is also great though
<user10121>
because i like modal editing
<benzrf>
basically
<benzrf>
vim is amazing for the nuts and bolts of editing
jkamenik has quit [Quit: Leaving.]
<user10121>
yeah, i know that
<benzrf>
i.e. shifting stuff around, jumping to places, altering text
Wixy has joined #ruby
<user10121>
have you ever tried vimperator, by the way?
<benzrf>
no
<benzrf>
i thought emacs had evil and viper, not vimperator
<benzrf>
isnt that a firefox plugin?
<user10121>
i was wondering how good a replacement it was
<user10121>
sorry
<user10121>
viper
<user10121>
is what i meant
<benzrf>
ah
<benzrf>
well, emacs is largely good at understanding and manipulating code, vs text
<benzrf>
vim is powerful at understanding text, emacs at code
<benzrf>
debatable
<benzrf>
*debatably
charliesome has joined #ruby
joaoh82 has quit [Ping timeout: 260 seconds]
<benzrf>
i use vim, but i dont dispute that id probably like emacs if I learned it
croaky has quit [Ping timeout: 265 seconds]
Bira has joined #ruby
<benzrf>
still, it is my duty as a cultist of vim to inform you that if you don't use vim you are literally the worst person in the world
<user10121>
:)
eka has quit [Quit: Computer has gone to sleep.]
timonv has joined #ruby
croaky has joined #ruby
<lewellyn>
benzrf: i use the one true vi. :) Version SVR4.0, Solaris 2.5.0
<lewellyn>
(that's the literal :version output, yes.)
charliesome has quit [Client Quit]
<benzrf>
heresy
<benzrf>
you cant even install surround.vim
<benzrf>
you pitiable fool
<lewellyn>
it's what you could call... a joy to use.
<lewellyn>
(the greybeards are free to groan at that)
aspires has quit []
<user10121>
lewellyn: are you serious? isn't it limited?
<benzrf>
why ;-;
zigomir has quit [Remote host closed the connection]
mojjojo has joined #ruby
<benzrf>
why would you make that kind of pun
<lewellyn>
user10121: depends on your definition of "limited".
kaldrenon has quit [Remote host closed the connection]
<lewellyn>
it's a hell of a lot faster for screen updates, though. :D
<benzrf>
pfft
<lewellyn>
(for real hell, try vim on a 9600 bps connection...)
clamstar has quit [Quit: Computer has gone to sleep.]
<benzrf>
who even has that
<user10121>
lewellyn: i guess it lacks a lot of the vim additions
zoscoy has joined #ruby
<makkura>
user10121: I use SublimeText and RubyMine. SublimeText has a section to the side where you can see the general flow of the code [like a very zoomed out version of the code] with a highlight on the section currently visible... RubyMine allows for collapsing of code blocks.. These are both things I've found helpful in finding or getting the right code on screen.
<lewellyn>
user10121: vim is marginally vi-compatible.
<makkura>
Poor folks like myself that never learned the vi/vim keyboard shortcuts are stuck with sluggish gui tools :/
Bira has quit [Remote host closed the connection]
<lewellyn>
benzrf: anyone with a serial console.
<user10121>
makkura: oh, thanks a lot. i'm going to check it out.
<benzrf>
makkura: if i learned vim you can learn vim
<benzrf>
user10121: vim has code folding too
<benzrf>
so does emacs
aspires has joined #ruby
<benzrf>
EVERYTHING has code folding
<benzrf>
that isnt friggin notepad
timonv has quit [Remote host closed the connection]
cj3kim_ has quit [Remote host closed the connection]
<benzrf>
ok so my vps host says i havent paid for my last bill yet
<benzrf>
but i couldve sworn i did
eka has joined #ruby
<benzrf>
so if this overdraws me im going to sue them
<user10121>
lewellyn: well, yes. but i was thinking that the other way around wasn't true.
mneorr has quit [Remote host closed the connection]
<makkura>
sublimetext doesn't.. but it's a glorified notepad [syntax highlighting, regex] .. i certainly don't want a full IDE suggesting things to me all the time [which is why i don't use RubyMine all the time]
lkb has quit [Quit: Wychodzi]
croaky has quit [Ping timeout: 260 seconds]
<makkura>
benzrf: costly vps?
mneorr has joined #ruby
Bira has joined #ruby
<benzrf>
only 3.50 ;p
<benzrf>
p/m
<benzrf>
but i have either 3.80 in my acc right now or .30
<lewellyn>
user10121: there are some marginally-used bits of sysv vi which aren't in vim. and none of the vim extensions are in most vis.
<benzrf>
depending on whether the last payment went through
<benzrf>
oh go|dfish
<benzrf>
*god
<benzrf>
'Failed to authorize: Authorization Failed '
<benzrf>
wtf is this
<benzrf>
oh shit did my card expire
<makkura>
ouch :(
<benzrf>
oh fft
<makkura>
3.50? is that USD? I thought mine was cheap at $10.50
<benzrf>
i wrote down my name as 'Ben RF' instead of my full name
<benzrf>
oops
zigomir has quit [Ping timeout: 260 seconds]
eka has quit [Client Quit]
Bira has quit [Remote host closed the connection]
<benzrf>
...and still not working
Wolland has quit [Ping timeout: 265 seconds]
jxport has quit [Read error: Operation timed out]
Bira has joined #ruby
jxport has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benzrf>
oh nooo
<benzrf>
it is supposed to expire 2/14
<benzrf>
it is not 2/14!
mneorr_ has joined #ruby
dweeb_ has joined #ruby
mneorr_ has quit [Read error: Connection reset by peer]
mneorr_ has joined #ruby
<makkura>
It's a bit specific but I'm having issues with RVM trying to grab ruby install files from the jruby amazon cloud. Can't seem to get a work around. Anyone else have similar issues? rvm channel is abit dead atm so thought i'd go ahead and ask
mneorr has quit [Ping timeout: 260 seconds]
timonv has joined #ruby
danshultz has quit [Remote host closed the connection]
<makkura>
benzrf: your bank might be blocking it if you haven't successfully charged there before? small transactions from international locations can look fraudulent .. just a guess though
<benzrf>
I have though
<makkura>
mm that's different then
<benzrf>
ive been paying for it just fine for a few months
pranny has quit [Quit: Leaving.]
rasbonics has joined #ruby
<makkura>
Confirm your funds? I'd assume it's charging is as credit rather than debit [since you have $ in the account it sounds like a checking debit/credit card]
<makkura>
as credit it may not overdraft and reject instead?
mklappst_ has quit []
<benzrf>
it is debi
<benzrf>
t
lkba has joined #ruby
<benzrf>
i have no direct way to check
deens has joined #ruby
<benzrf>
i -never- remember my acc info on the bank website
MrThePl__ has joined #ruby
MrThePl__ has quit [Remote host closed the connection]
<makkura>
ahh
MrThePla_ has joined #ruby
mneorr_ has quit [Ping timeout: 265 seconds]
<makkura>
alternative such as paypal?
<benzrf>
no money in it :|
<benzrf>
well i have a few days
<benzrf>
ill work something out
<benzrf>
u-u
mklappstuhl has joined #ruby
MrThePlague has quit [Ping timeout: 260 seconds]
colonolGron has quit [Read error: Connection reset by peer]
lioninawhat has joined #ruby
drumusician has quit [Ping timeout: 252 seconds]
okinomo has quit [Ping timeout: 252 seconds]
nfk has quit [Quit: yawn]
okinomo has joined #ruby
robertrv has quit [Ping timeout: 252 seconds]
drumsrgr8forn8 has joined #ruby
terrellt has joined #ruby
Soda has joined #ruby
rootshift has quit [Quit: rootshift]
Brolen has quit [Remote host closed the connection]
wildroman2 has quit [Remote host closed the connection]
Mars is now known as Guest2998
Neomex has joined #ruby
axl_ has quit [Quit: axl_]
cbetta is now known as cbetta_afk
Exeia has quit [Client Quit]
Kar- has quit [Ping timeout: 252 seconds]
zumba_addict has quit [Quit: zumba_addict]
RedWraith has joined #ruby
Neomex has quit [Client Quit]
RedWraith has left #ruby [#ruby]
cbetta_afk is now known as cbetta
<shevy>
matti why are you still awake, go to bed!
nimitz has left #ruby ["."]
eyckelboom has quit [Quit: bye!]
mlpinit_ has joined #ruby
mlpinit has quit [Ping timeout: 260 seconds]
<matti>
shevy: Its 10pm.
joaoh82 has joined #ruby
d2dchat has quit [Remote host closed the connection]
<matti>
shevy: U nuts?
<matti>
;]
okinomo has quit [Ping timeout: 260 seconds]
Advocation has quit [Quit: Advocation]
<benzrf>
makkura: haha what is that
okinomo has joined #ruby
Bira has joined #ruby
Bira has quit [Remote host closed the connection]
jlast has quit [Remote host closed the connection]
<shevy>
matti I just woke up :(
mlpinit_ has quit [Ping timeout: 265 seconds]
Bira has joined #ruby
<matti>
;s
P1RATEZ has quit []
maroloccio2 has quit [Quit: WeeChat 0.4.2]
razibog has quit [Ping timeout: 252 seconds]
nanoyak has joined #ruby
psyl0n has joined #ruby
cbetta is now known as cbetta_afk
doodlehaus has quit [Remote host closed the connection]
mojjojo has quit [Quit: mojjojo]
agjacome has quit [Quit: leaving]
_honning_ has quit [Ping timeout: 260 seconds]
axl_ has joined #ruby
coca_rails has quit [Remote host closed the connection]
cameronbarton has joined #ruby
shadoi has joined #ruby
fijimunk1i has joined #ruby
cbetta_afk is now known as cbetta
fijimunkii has quit [Ping timeout: 252 seconds]
makkura is now known as mak|idle
alexfreidah has joined #ruby
<shevy>
869 folks here
<shevy>
we'll hit 1000 too eventually
|RicharD| has joined #ruby
<|RicharD|>
hi to all
<shevy>
hi IRichie
<Jdubs>
shevy, are you ever not here?
<Jdubs>
seriously
<Jdubs>
lol
<shevy>
Jdubs dunno, I rarely restart my computer and IRC is always running in a window
kcombs has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
jonnyro has joined #ruby
ando has joined #ruby
yasushi has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
eyckelboom has joined #ruby
<benzrf>
Jdubs: he is omnipresent
<benzrf>
within this channel
<benzrf>
he is never not here
<benzrf>
he is the Eternal One
jbueza has joined #ruby
kirun has quit [Quit: Client exiting]
mojjojo has joined #ruby
<shevy>
you make me older than I am :(
<shevy>
but benzrf one day you'll be old as well!
* shevy
shakes fist
<jonnyro>
Is this a valid way to define a hash containing hashes? a = { 1=> {:x => 'dog', :y => 'cat', :z => 'llama'}, 2=> {:x=>'wombat', :y => 'marmoset', :z => 'llama } }
<benzrf>
( ͡° ͜ʖ ͡°)
asmodlol has joined #ruby
<benzrf>
jonnyro: of course
<shevy>
jonnyro, I tried it in IRB and it does not work
<shevy>
I assume because 'llama has no closing '
<benzrf>
oh hmm
<jonnyro>
Is this a valid way to define a hash containing hashes? a = { 1=> {:x => 'dog', :y => 'cat', :z => 'llama'}, 2=> {:x=>'wombat', :y => 'marmoset', :z => 'llama' } }
<benzrf>
jonnyro: keep in mind that ruby 1.9 and greater support 'foo: bar' as a shorthand for ':foo => bar'
<shevy>
jonnyro can you not return all values by doing .values?
<benzrf>
include? is for keys
<shevy>
or .has_value
Hanmac has quit [Ping timeout: 260 seconds]
<shevy>
I mean
<shevy>
.has_value?()
<benzrf>
jonnyro: why are you using a hash anyway?
<jonnyro>
My apologies, I would like to check only 2 of the 3 attributes
ffranz has quit [Quit: Leaving]
<benzrf>
number-key hashes should really be arrays
travisjeffery has joined #ruby
<jonnyro>
otherwise i think .has_value would work
nateberkopec has quit [Quit: Leaving...]
croaky has quit [Ping timeout: 252 seconds]
<jonnyro>
benzrf: the example is a simplified version of something else that requires a hash
<shevy>
jonnyro can you use .select ?
<benzrf>
jonnyro: oh
<jonnyro>
select is interesting
<benzrf>
jonnyro: why not use any? with a block that compares
<jonnyro>
do a select and check that it is not empty
<jonnyro>
ah
<benzrf>
jonnyro: any? is like that but one method
<jonnyro>
Excellent!
charliesome has joined #ruby
<benzrf>
=]
<jonnyro>
exactly what i was looking for
<jonnyro>
Being new to ruby, i am constantly feeling like I am doing the wrong thing. There must be an easier method
<shevy>
benzrf have you had a new revelation in ruby?
<jonnyro>
benzrf: the keys in this case are likely to be 1,2,80001,80005. They are very sparse
bean__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jonnyro>
Does Array hurt you when your keys are not 1,2,3,..,n,n+1
claymore has quit [Quit: Leaving]
<benzrf>
hm
<shevy>
I would assume that array would be faster than hashes
<benzrf>
?
<jonnyro>
i think it would be faster. I just dont want it to allocate a bunch of nil entries
<benzrf>
shevy: what is this revelation
<shevy>
you can kill nil entries from an array with .compact! method
<benzrf>
shevy: spares arrays via hashes are well-documented i think
<jonnyro>
its possible that Array is smart enough to not store anything between a[1] and a[5] when a[2..4] were never assigned
<shevy>
benzrf I dunno, you usually have learned something new
<benzrf>
shevy: yes but he must look up entries via numbers
<benzrf>
silly
<benzrf>
shevy: well i have managed to push at least one commit per day on Legend
<benzrf>
=D
<benzrf>
so far
<benzrf>
hopefully i will not break that todaty
<benzrf>
*today
FifthWork has joined #ruby
<shevy>
jonnyro first off, array starts at [0] so when you say a[2..4] to never be assigned, but a[1] and a[5], it confuses me why you omit a[0] :)
<jonnyro>
You are correct
<benzrf>
wait hold on
<shevy>
as for entries in between two elements of the array
<benzrf>
hmm push
<shevy>
ruby apparently seems to fill them up with nils
<shevy>
array = []
okinomo has quit [Ping timeout: 253 seconds]
<jonnyro>
a = Array.new ; a[1]=2 ; puts a yields "[nil,2]"
<shevy>
array[0] = 5
<benzrf>
i guess i have not pushed commits every day since starting ;-;
<shevy>
array[5] = 6
<shevy>
array # => [5, nil, nil, nil, nil, 6]
`petey` has quit [Remote host closed the connection]
<jonnyro>
So really what i'm asking, are the nils in the middle run length encoded or something
<benzrf>
jonnyro: ignore shevy
okinomo has joined #ruby
<shevy>
apparently they are stored
<benzrf>
jonnyro: hashes are fine for spares arrays
<benzrf>
jonnyro: and downright common for sparse grids
`petey` has joined #ruby
w4pm has joined #ruby
<shevy>
jonnyro btw if the data structure is complicated for you, it may be best to access that data structure through method calls
<jonnyro>
the indices in this case are auto generated positive integers at the front of mysql table rows
<shevy>
rather than directly fiddling with it
<jonnyro>
shevy: you raise an interesting point, i should probably just wrap this in a class
orionstein is now known as orionstein_away
kacperix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
QKO has quit [Ping timeout: 260 seconds]
<shevy>
<benzrf> jonnyro: why are you using a hash anyway?
<shevy>
<benzrf> jonnyro: hashes are fine for spares arrays
<shevy>
!!!
dblessing has quit [Quit: dblessing]
pranny has joined #ruby
<shevy>
jonnyro: ignore benzrf
dachi_ has joined #ruby
dachi_ has left #ruby [#ruby]
<benzrf>
bbiab
<shevy>
he can't decide what he wants to suggest
<benzrf>
see you
benzrf is now known as benzrf|afk
<jonnyro>
thanks
<shevy>
jonnyro for a while, complicated hash structures annoyed me until I started to try to simplify the data structures in the first place
<shevy>
and when that still did not work out, I wrapped it into methods (or as you said perhaps even a class)
<|RicharD|>
I have a simple script that use twitter gem, but after it show me all messages etc…it give me this error: /Users/riccardo/.rvm/gems/ruby-2.0.0-p353/gems/twitter-5.5.1/lib/twitter/rest/client.rb:143:in `rescue in request': execution expired (Twitter::Error)
rootshift has quit [Quit: rootshift]
<shevy>
I created a class Configuration simply because I want to do this:
QKO has joined #ruby
cj3kim has joined #ruby
<|RicharD|>
At a friend mine, not give this error…and we use the same ruby version, same twitter gem version
<shevy>
configuration = Configuration.new('path_to_the_config_dir_here'); configuration.debug = true # now the project feedsback a lot of debug values
<shevy>
configuration.debug = false # now it is mute again
<shevy>
and all config-values also become method calls automatically in this configuration object
CpuID has joined #ruby
CpuID has quit [Changing host]
CpuID has joined #ruby
phinfonet has joined #ruby
`petey` has quit [Ping timeout: 252 seconds]
saarinen has quit [Quit: saarinen]
LekeFly has joined #ruby
<jonnyro>
thanks for the help shevy
mojjojo has quit [Quit: mojjojo]
<|RicharD|>
anyone can try my script ? i can give the link in private because have the api keys...
<|RicharD|>
please
wildroman2 has joined #ruby
pranny has quit [Ping timeout: 260 seconds]
allsystemsarego has quit [Quit: Leaving]
gcds has joined #ruby
fedesilv_ has quit [Remote host closed the connection]
<TigerWolf>
dammit github, you have one job :P
MrThePla_ has quit []
aryaching has joined #ruby
axl_ has quit [Quit: axl_]
pel_daniel has quit [Ping timeout: 245 seconds]
mootpointer has joined #ruby
crypt1d has joined #ruby
cameronbarton has joined #ruby
cj3kim has quit [Remote host closed the connection]
gcds has quit [Client Quit]
<lewellyn>
hahahaha. github's been down for like an hour now :P
allaire has quit []
rubyracer has quit [Quit: Konversation terminated!]
olivier_bK has joined #ruby
BraddBitt has quit [Ping timeout: 252 seconds]
croaky has joined #ruby
Guest2998 has quit [Remote host closed the connection]
Mars has joined #ruby
Mars is now known as Guest62454
vallieres has joined #ruby
vallieres is now known as vallieres_
kpshek has quit []
Albright has joined #ruby
rubyracer has joined #ruby
Kar- has joined #ruby
vallieres_ has quit [Client Quit]
vallieres_ has joined #ruby
Guest62454 has quit [Ping timeout: 260 seconds]
fgo has joined #ruby
rootshift has joined #ruby
mootpointer has quit [Quit: ENOCAFFEINE.]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BraddPitt has joined #ruby
Kar- has quit [Ping timeout: 260 seconds]
nateberkopec has joined #ruby
Bira has quit [Remote host closed the connection]
mklappstuhl has quit [Remote host closed the connection]
fgo has quit [Ping timeout: 252 seconds]
Albright has quit [Ping timeout: 260 seconds]
Bira has joined #ruby
DrShoggoth has quit [Quit: Leaving]
burlyscudd has joined #ruby
benlieb has joined #ruby
mansi has quit [Remote host closed the connection]
horofox_ has joined #ruby
mansi has joined #ruby
enebo has quit [Quit: enebo]
rasbonics has left #ruby [#ruby]
cescalante is now known as ce_afk
drumsrgr8forn8 has quit [Ping timeout: 260 seconds]
Albright has joined #ruby
ahawkins has joined #ruby
charliesome has joined #ruby
mansi has quit [Ping timeout: 252 seconds]
danijoo has quit [Quit: Leaving...]
rootshift has quit [Quit: rootshift]
jerius has quit [Ping timeout: 252 seconds]
sassamo has quit [Remote host closed the connection]
sassamo has joined #ruby
mootpointer has joined #ruby
fedez77 has quit [Ping timeout: 245 seconds]
workmad3 has quit [Ping timeout: 272 seconds]
geggam has quit [Remote host closed the connection]
wildroman2 has quit [Remote host closed the connection]
mini```` has joined #ruby
b00stfr3ak has quit [Read error: Operation timed out]
sassamo has quit [Ping timeout: 265 seconds]
amedeiros has quit [Ping timeout: 252 seconds]
nateberkopec has quit [Ping timeout: 265 seconds]
gilcosson has quit [Remote host closed the connection]
maroloccio has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
mini``` has quit [Ping timeout: 246 seconds]
nanoyak has quit [Quit: Computer has gone to sleep.]
pehlert has joined #ruby
nanoyak has joined #ruby
toastynerd has quit [Remote host closed the connection]