<merqlove>
It depends on your network. type gogohome
tonyhb has joined #ruby
<gogohome>
my network?
<gogohome>
how merqlove
<ari-_-e>
gogohome: did you read the answer?
<gogohome>
yes
<gogohome>
i read it.
<ari-_-e>
then what is your question?
<gogohome>
in gernal no?
<merqlove>
yeah. man said about multiple modes of wireshark for each network connection type
<merqlove>
:)
agrinb has quit [Ping timeout: 240 seconds]
jayunit100 has quit [Quit: jayunit100]
tonyhb has quit [Ping timeout: 260 seconds]
benzrf|offline is now known as benzrf
<ari-_-e>
that answer doesn't really have much to do with wireshark modes
seamon has quit [Quit: Zzzzzzz]
<merqlove>
Yeah. more about network type
<gogohome>
then i must study about network?
<ari-_-e>
gogohome: sure?
<gogohome>
thanks
<gogohome>
:D
kevkev____ has joined #ruby
gogohome has left #ruby [#ruby]
gogohome has joined #ruby
jjasonclark has quit [Quit: jjasonclark]
<gogohome>
wasamasa: i want request to you.
chihhsin has quit [Remote host closed the connection]
wrist has quit [Quit: Leaving...]
kevkev____ has quit [Ping timeout: 260 seconds]
Spami has quit [Quit: This computer has gone to sleep]
sixxy has joined #ruby
drawingthesun has quit [Ping timeout: 250 seconds]
mikesplain has joined #ruby
davedev24_ has quit [Remote host closed the connection]
davedev24_ has joined #ruby
Zenigor has quit [Remote host closed the connection]
bmurt has quit []
Zenigor has joined #ruby
mikesplain has quit [Ping timeout: 240 seconds]
nasj has joined #ruby
amclain has quit [Quit: Leaving]
brianherman has joined #ruby
Zenigor has quit [Ping timeout: 255 seconds]
redondos has quit [Excess Flood]
nasj has quit [Ping timeout: 240 seconds]
redondos has joined #ruby
beneggett has quit [Ping timeout: 260 seconds]
SomeGuy has joined #ruby
lxsameer has joined #ruby
gogohome has left #ruby [#ruby]
<SomeGuy>
Hi
SomeGuy has left #ruby [#ruby]
pallavi_ has joined #ruby
pallavi_ is now known as pallavi_shastry
SomeGuy123123132 has joined #ruby
<SomeGuy123123132>
any professional ruby devs around?
eka has quit [Max SendQ exceeded]
<ari-_-e>
no we're all highly unprofessional
<SomeGuy123123132>
haha
<SomeGuy123123132>
I'm a bit confused and would like some clarity about a recent interview process
eka has joined #ruby
vsoftoiletpaper has quit []
<SomeGuy123123132>
it was for a rails position, and I was asked to check validity of credit card using luhn algorithm
beneggett has joined #ruby
<SomeGuy123123132>
trouble is, I don't have much experience with such algorithms. My first choice would be to see current implementations. I found a few on stackoverflow, and it didn't look that complicated
vsoftoiletpaper has joined #ruby
<SomeGuy123123132>
however, I still would have used something like ActiveMerchant
<SomeGuy123123132>
should I know this algorithm? I just don't see why I would be checking validity of credit card numbers. Why would I not use an API?
brianherman has quit [Read error: Connection reset by peer]
<ari-_-e>
did they not give you the opportunity to do research at all?
<SomeGuy123123132>
Does every interview involve flexing your algorithm knowledge? Really starting to irk me. I've worked on large applications and been professional for a good 4 years. never have I once had to implement common algorithms in a language like ruby
<SomeGuy123123132>
It's a remote position, so I have plenty of time to research
<SomeGuy123123132>
but it's troubling me
<SomeGuy123123132>
is such a test a red flag?
<ari-_-e>
I don't think so
<ari-_-e>
in an in-person interview I think it would be
<ari-_-e>
assuming that someone knows this special-purpose interview would be bad
<ari-_-e>
special-purpose algorithm
<SomeGuy123123132>
fair point
<SomeGuy123123132>
I'm just worried of what they might ask me when they get me on the phone
<SomeGuy123123132>
how's about this then... in their conditions they said I'd be required to be on web cam during working hours for legal reasons in their country (oz)
<SomeGuy123123132>
that is surely a red flag?
<SomeGuy123123132>
I said no
<ari-_-e>
but if it's like a "answer this question and get back to us" sort of thing, it can just be a test of how well you can do research and such
<SomeGuy123123132>
they still sent me interview questions
<ari-_-e>
and in general, algorithmic knowledge is pretty good to have if you're a programmer
<ari-_-e>
ah yeah, the web cam thing is weird
<SomeGuy123123132>
so would you implement this algorithm manually, or would you use an already available solution? for example, active merchant has such things for validating credit card numbers
Atttwww has quit [Ping timeout: 255 seconds]
<ari-_-e>
legal reasons? bs
<SomeGuy123123132>
if I were to do this in a project, I'd suspect I'd be working with credit cards, and so I'd want to work with a mature library
centipedefarmer has joined #ruby
<SomeGuy123123132>
I know algorithms are important, it's one of my weak spots. I've only ever used high-level dynamic languages. everything is already implemented for me
benlakey has joined #ruby
<SomeGuy123123132>
for a ruby position, I would expect questions about oop and such
<ari-_-e>
well, some algorithms are written for you - sorting, searching, etc
<ari-_-e>
but you have to write your own all the time
matrixdevuk has quit [Excess Flood]
<SomeGuy123123132>
true, I mean common algorithms
edwardly has quit [Excess Flood]
jdj_dk has joined #ruby
matrixdevuk has joined #ruby
edwardly has joined #ruby
jdj_dk has quit [Remote host closed the connection]
<SomeGuy123123132>
the second part of that question:
<SomeGuy123123132>
" Similarly, write a second function that takes a
<SomeGuy123123132>
number of any length and calculates the Luhn check digit and returns the original
<SomeGuy123123132>
number with the check digit appended on the end."
jdj_dk has joined #ruby
<godd2>
isnt the luhn algo just an alternating chucksum?
<ari-_-e>
from your description it sounds like they want you to implement the algorithm
Tarential has quit [Excess Flood]
<SomeGuy123123132>
yeh from what I've read
<hakunin>
i have a slightly mind-bending (for me) question that i'm trying to wrap my head around…
Tarential has joined #ruby
Sthebig has quit [Excess Flood]
jdj_dk has quit [Read error: Connection reset by peer]
centipedefarmer has quit [Ping timeout: 250 seconds]
jdj_dk_ has joined #ruby
<godd2>
feel free to ask hakunin
<ari-_-e>
of course, you can just copy-paste from somewhere, which would make the exercise sorta pointless
<SomeGuy123123132>
ari-_-e, which is why I'm here :) I want to learn
<hakunin>
godd2: yeah typing : )
<hakunin>
Say you have 2 pieces of code that generate file from database. They both use .each, that goes over records in the database. They go over the same record. Instead of running one then another, I'd like to run both in parallel but have iteration over database happen only once…
<ari-_-e>
I think the best you can do is to read a description of the algorithm and try to write the code yourself
<SomeGuy123123132>
that link came along with the question
<ari-_-e>
hah ok
<hakunin>
The punchline is - it should be in streaming fashion, no buffering all records from db.
<hakunin>
so i'm thinking fibers/iterators direction, but having hard time figuring it out…
<godd2>
hakunin, are you doing more than just reading the values from the record?
jdj_dk_ has quit [Remote host closed the connection]
d00n has left #ruby [#ruby]
<hakunin>
godd2: they iterate over thousands of records and generate 2 different files based on them
<hakunin>
godd2: completely unrelated 2 routines just happen to need to read the same stuff from db
<SomeGuy123123132>
ari-_-e, how long would you be prepared to spend on interview/pre-interview questions/exercises?
<ari-_-e>
I dunno, depends on how busy I am hah
<hakunin>
so i want to somehow share db iterator among them
<hakunin>
i can change how they iterate (like, inject my own iterator object)
<hakunin>
specifically they both generate an xml file using builder in a "stream directly to upload" fasion
<hakunin>
(builder gem)
Zenigor has joined #ruby
<SomeGuy123123132>
thanks for the help ari-_-e
SomeGuy123123132 has quit [Quit: Leaving]
<hakunin>
gotta give it more thought…
Pharaoh2 has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hakunin>
my ruby sense tells me this is possible
<benzrf>
ari-_-e: your nick looks pissed off
<ari-_-e>
benzrf: it's tired
mary5030 has quit [Remote host closed the connection]
mary5030 has joined #ruby
InfraRuby has joined #ruby
lid_ has joined #ruby
jtdowney has quit []
Zenigor has quit [Remote host closed the connection]
oo_ has joined #ruby
lidaaa has quit [Ping timeout: 255 seconds]
InfraRuby has left #ruby [#ruby]
Zenigor has joined #ruby
SomeGuy123123132 has joined #ruby
mary5030 has quit [Ping timeout: 255 seconds]
Zenigor_ has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
<SomeGuy123123132>
ok, I'm back. Could somebody explain how you might approach this problem?
<SomeGuy123123132>
"If two or more processes started to update the same logical payment (line_item_id, service_id)
<SomeGuy123123132>
simultaneously then
<SomeGuy123123132>
update the object and let the next one(s) do its(their) job.
<SomeGuy123123132>
If the payment did not exist, one of the processes will create it and other processes should
<SomeGuy123123132>
there should not be 2 or more payments afterwards, instead each process should wait its turn,
<SomeGuy123123132>
wait their turn and use that exact payment object for update."
Guest2685 has quit [Read error: Connection reset by peer]
<SomeGuy123123132>
won't paste like that again
<SomeGuy123123132>
suggestions? database lock? I haven't thought about it too deeply, but I'd appreciate some pointers so I can go educate myself
EvanR has joined #ruby
jackneill has joined #ruby
EvanR is now known as Guest89567
godd2 has quit [Remote host closed the connection]
<merqlove>
Write library
<merqlove>
which can implement it
<SomeGuy123123132>
it's the implementation that I'm stuck on
Zenigor has quit [Ping timeout: 253 seconds]
<SomeGuy123123132>
if two requests come in, there in different ruby processes, how do I manage in that case?
lw has joined #ruby
lw has quit [Max SendQ exceeded]
<merqlove>
as I've seen at wiki long pythonyto example
<merqlove>
think you can do it shorter
Wolland has joined #ruby
kevkev____ has joined #ruby
amacou has joined #ruby
lw has joined #ruby
<mattalexx>
#linux
<merqlove>
via sidekick
<merqlove>
fuck ipad) sidekiq
<SomeGuy123123132>
or redis?
<SomeGuy123123132>
sidekiq seems bit ott
<merqlove>
maybe
<SomeGuy123123132>
and I'm still not sure how it would logically work
<merqlove>
something like
<merqlove>
for what you want todo it?
<SomeGuy123123132>
first process updates payment, second process simultaneously tries to update same payment -- how to make it wait for first update to happen?
<SomeGuy123123132>
you mean queue?
<merqlove>
Yeah
silentpost has quit [Quit: silentpost]
philcris_ has joined #ruby
theharshest has quit [Quit: This computer has gone to sleep]
<SomeGuy123123132>
ok, I'll look into it. cheers
<merqlove>
You can't save one and than work with when secon arrived?
<bobdobbs`>
I've got that open in front of me as well. I installed rbenv from the git repo
InfraRuby has left #ruby [#ruby]
teddyp1cker has joined #ruby
<bobdobbs`>
it says "rbenv works by inserting a directory of shims at the front of your PATH", but it doesn't say how the shims get there. or how to put them there.
<bobdobbs`>
that's kinda frustrating... I don't know if that's something I'm supposed to do when installing rbenv, or not.
<bobdobbs`>
maybe not, because there don't seem to be any instructions on how to do it.
<bobdobbs`>
but then again, maybe I'm supposed to do it, but the instructions have been ommitted
ericmathison has joined #ruby
<dseitz>
Yeah if you missed a detail on steps 2 and 3, it won't setup things right when you login
kevkev____ has joined #ruby
mary5030 has joined #ruby
axl_ has joined #ruby
axl_ has quit [Client Quit]
kireevco1 has joined #ruby
kireevco1 has quit [Max SendQ exceeded]
bluOxigen has joined #ruby
kireevco1 has joined #ruby
kireevco1 has quit [Max SendQ exceeded]
kireevco1 has joined #ruby
kireevco1 has quit [Max SendQ exceeded]
kireevco1 has joined #ruby
kireevco1 has quit [Max SendQ exceeded]
kireevco has quit [Ping timeout: 240 seconds]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
seamon has joined #ruby
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
starkhalo has quit [Ping timeout: 255 seconds]
kireevco has joined #ruby
kireevco has quit [Max SendQ exceeded]
mary5030 has quit [Ping timeout: 250 seconds]
kevkev____ has quit [Ping timeout: 240 seconds]
kireevco has joined #ruby
<ericmathison>
I'm having some trouble understanding the result of: (~0b10).to_s(2)
mikecmpbll has quit [Quit: i've nodded off.]
<ericmathison>
I would expect the result to be the string '1'
<ericmathison>
what am i missing? the tilde flips each bit of a ixnum right?
<ericmathison>
*Fixnum
<bobdobbs`>
dseitz: I've altered my .zshrc. rbenv is definately in my path.
<ari-_-e>
ericmathison: yes, but the fixnum is not two bits long
<dseitz>
and is the rbenv init line in there too?
<bobdobbs`>
if I enter 'rebenv versions', I see which versions are available, and which one is selected
<bobdobbs`>
test, the rbnev init line is in there
MindfulMonk has quit [Ping timeout: 250 seconds]
<bobdobbs`>
but I have the same issue even if I enter 'rbenv init' manually
ziyadb has joined #ruby
<ericmathison>
ari-_-e: it isn't? how so?
<ari-_-e>
ericmathison: how many bits would you say 0b00000010 is?
<ericmathison>
I'm not sure :) Do the zeros count?
<ari-_-e>
no
SomeGuy123123132 has joined #ruby
<ericmathison>
ari-_-e: two bits then?
MindfulMonk has joined #ruby
<dseitz>
bobdobbs`: type env | grep PATH and tell me if you see the /shims directory listed
<ari-_-e>
ericmathison: actually, you tell me if they count
<ari-_-e>
ericmathison: are those different numbers?
<ericmathison>
no, i don't think so
mikesplain has joined #ruby
mattalexx has quit [Ping timeout: 246 seconds]
<dseitz>
Only extra thing I can think (I've had this issue before) was that I had to completely log out and log back in
<ari-_-e>
ericmathison: it might help you to read the documentation for Fixnum
rippa has joined #ruby
<ari-_-e>
it tells you what fixnums actually are
<ari-_-e>
ericmathison: in general, computers don't really deal in bits very much
<bobdobbs`>
dseitz: yes, I can the dir with the shims: /home/mantis/.rbenv/shims
<dseitz>
Ok. If you're in a GUI shell; try logging back in and seeing it starts to function as expecte
<SomeGuy123123132>
question: I have two threads attempting to create an object. first thread creates object, how to make second thread wait until first thread is done with object, and pass that exact object to second thread??
<ericmathison>
ari-_-e: ok. it says they are integers that can be represented by a native machine word minus one. maybe i'm missing something more fundamental though since in my current frame of thinking (~0b00000010).to_s(2) and (~0b10).to_s(2) would return '1'.
<ari-_-e>
ericmathison: ~ flips all of the bits
hellangel7 has joined #ruby
nasj has joined #ruby
<ericmathison>
oh. even the leading zeros?
<ari-_-e>
yes
<ari-_-e>
fixnum actually uses native integers
<SomeGuy123123132>
drizz, cheers. what if they are in different processes? I should note,the objects are backed by a database
<SomeGuy123123132>
I have tried row-level locking, but not sure it is solution here
<ericmathison>
ari-_-e: In that case, wouldn't something like (~0b00000010).to_s(2) return '11111101'?
<Noob101>
question before I go to bed
<ari-_-e>
ericmathison: only if the word size is one byte
<Noob101>
what does string literal in condition mean?
<ericmathison>
I think this all is making more sense to me now. thanks ari-_-e and Hanmac
<SomeGuy123123132>
I don't need a solution, I just need an idea of where to look. I've checked mutexes, row-level locking, queues. what is a decent way to deal with this?
mateu has joined #ruby
Zespre has joined #ruby
<ericmathison>
the "%b" % (~0b10) ouput combined with ari-_-e's explanitory comment clears alot up for me. Thanks!
<ari-_-e>
ericmathison: that was a quote from the Kernel.sprintf documentation, btw
<ericmathison>
ari-_-e: thanks i'll take a look
jjasonclark has joined #ruby
Sou|cutter has quit [Ping timeout: 264 seconds]
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
SCHAAP137 has joined #ruby
kireevco has quit [Ping timeout: 255 seconds]
teddyp1cker has quit [Remote host closed the connection]
teddyp1cker has joined #ruby
<SomeGuy123123132>
anyone? http://pastie.org/9441203 -- I feel completely lost. maybe suggestions on where I can find this being solved already? spree maybe? I don't even know what terms to search to understand the problem/solution
tvw has joined #ruby
<ari-_-e>
SomeGuy123123132: might help to ask in the rails channel?
<Radar>
Sounds like homework
<SomeGuy123123132>
yeh, possibly
<ari-_-e>
yes, that too
<SomeGuy123123132>
Radar, most definitely not homework, but yes, you could see it as homework if you like
<Radar>
bbl
<SomeGuy123123132>
Radar, however, I'm not AT ALL asking for a solution. I'm asking for a shove in the right direction
<SomeGuy123123132>
Radar, is spree already dealing with something like this?
<SomeGuy123123132>
I will go through your code for 8 hours if I have to
<SomeGuy123123132>
I'm not looking for free handouts. I just want to learn
jackneill has quit [Ping timeout: 260 seconds]
teddyp1cker has quit [Ping timeout: 255 seconds]
<ari-_-e>
it sorta seems like all you'd need is some sort of transaction
nairys has quit [Quit: nairys]
chipotle has joined #ruby
<ari-_-e>
but I'm not positive and I don't know how rails exposes that stuff
Zespre has quit [Quit: leaving]
teddyp1cker has joined #ruby
Cache_Money has joined #ruby
vsoftoiletpaper has quit []
<SomeGuy123123132>
that's why I was hoping Radar could chip in. I'm already poring through spree code, but can't really see where this might have been handled
Zespre has joined #ruby
Zespre has quit [Client Quit]
Zespre has joined #ruby
philcris_ has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
cantonic has quit [Quit: cantonic]
GriffinHeart has joined #ruby
seamon has quit [Quit: Zzzzzzz]
philcris_ has quit [Ping timeout: 255 seconds]
ferr has joined #ruby
Sou|cutter has joined #ruby
pierre1_ has quit [Quit: Leaving]
theharshest has quit [Quit: This computer has gone to sleep]
Ilyas has quit [Read error: Connection reset by peer]
<Mon_Ouie>
I wonder if he called people java fanboys on #java
<shevy>
lol
<Mon_Ouie>
(or whatever's the Java channel)
<shevy>
probably #java-serious-business-only
AlexRussia has joined #ruby
supermarkettoday has quit [Ping timeout: 245 seconds]
Rollabunna has quit [Read error: No route to host]
mikesplain has quit [Ping timeout: 240 seconds]
jdj_dk has joined #ruby
iamcalledrob has quit [Ping timeout: 240 seconds]
Ayey_ has joined #ruby
nateberkopec has quit [Ping timeout: 240 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdj_dk_ has joined #ruby
jdj_dk has quit [Read error: Connection reset by peer]
<TieSoul>
erm, if I have a class foo with a method bar in one file, and I import it into another file, it doesn't seem to let me do fooo = foo; puts fooo.bar; in the other file.
<shevy>
please, write correct code
<shevy>
'class foo' can not be correct
<jhass>
TieSoul: put your real code to gist.github.com
<TieSoul>
it's just a placeholder name, the real name is "BefungeIP" and the method is "coords"
<shevy>
now that is better
<shevy>
>> class BefungeIP; def bar; puts 'hi from bar'; end; end; fooo = BefungeIp.new; fooo.bar
mosez has quit [Quit: Switching back to real life]
jdj_dk_ has quit [Ping timeout: 240 seconds]
mosez has joined #ruby
iamcalledrob has quit [Ping timeout: 256 seconds]
GriffinHeart has quit [Ping timeout: 240 seconds]
jottr has joined #ruby
centipedefarmer has joined #ruby
SomeGuy123123132 has quit [Ping timeout: 244 seconds]
redlegion has joined #ruby
Dr3amc0d3r|away has quit [Changing host]
Dr3amc0d3r|away has joined #ruby
Dr3amc0d3r|away is now known as Dr3amc0d3r
yourmother_ has joined #ruby
yourmother_ has quit [Read error: Connection reset by peer]
centipedefarmer has quit [Ping timeout: 256 seconds]
kirun has joined #ruby
Dr3amc0d3r is now known as Dr3amc0d3r|away
shadow4snake has quit [Quit: shadow4snake]
Zebroid has joined #ruby
carraroj has joined #ruby
redlegion has quit [Ping timeout: 260 seconds]
SilkFox has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 260 seconds]
blackmesa has quit [Remote host closed the connection]
jottr has joined #ruby
kldskp has joined #ruby
w09x has joined #ruby
soulcake has quit [Quit: Quack.]
nateberkopec has joined #ruby
soulcake has joined #ruby
redlegion has joined #ruby
kldskp has quit [Ping timeout: 240 seconds]
sandelius has joined #ruby
<sandelius>
If I have gems difenied in a gems Gemfile, will they be used in "production" or is only gems listed in the gemspec used?
jdj_dk has joined #ruby
nateberkopec has quit [Ping timeout: 240 seconds]
sandelius has left #ruby [#ruby]
sandelius has joined #ruby
<sandelius>
If I have gems difenied in a gems Gemfile, will they be used in "production" or is only gems listed in the gemspec used?
jdj_dk has quit [Read error: Connection reset by peer]
<Hanmac>
sandelius: "bundler"? if yes, try #bundler
jdj_dk has joined #ruby
lxsameer has quit [Quit: Leaving]
kevkev____ has joined #ruby
musicmatze has joined #ruby
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<musicmatze>
Hi #ruby! Can I somehow generate a Ruby Proc (block) with N arguments, where N is the number of arguments of a Proc/block I want to encapsulate?
beef-wellington has joined #ruby
redlegion has quit [Ping timeout: 255 seconds]
Dr3amc0d3r|away is now known as Dr3amc0d3r
kevkev____ has quit [Ping timeout: 250 seconds]
blackmesa has joined #ruby
w09x has quit []
brianherman has quit [Read error: Connection reset by peer]
centrx has joined #ruby
beef-wellington has quit [Ping timeout: 250 seconds]
philcrissman has joined #ruby
mikesplain has joined #ruby
<shevy>
cool
<shevy>
::Kernel.puts
<shevy>
that reads strangely
supermarkettoday has joined #ruby
heftig has quit [Ping timeout: 250 seconds]
redlegion has joined #ruby
philcrissman has quit [Ping timeout: 255 seconds]
jdj_dk has quit [Ping timeout: 245 seconds]
Photism has quit [Quit: Leaving]
mikesplain has quit [Ping timeout: 244 seconds]
wildroman2 has quit [Remote host closed the connection]
wildroman2 has joined #ruby
kldskp has joined #ruby
InfraRuby has joined #ruby
wildroman2 has quit [Ping timeout: 255 seconds]
klaut has quit [Remote host closed the connection]
klaut has joined #ruby
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
caveat- has quit [Ping timeout: 250 seconds]
spacebug has quit [Ping timeout: 260 seconds]
wildroman2 has joined #ruby
sinkensabe has joined #ruby
blackmesa has quit [Quit: WeeChat 0.4.3]
blackmesa has joined #ruby
blackmesa has quit [Remote host closed the connection]
Rollabunna has quit [Read error: No route to host]
Rollabunna has joined #ruby
mostlybadfly has joined #ruby
klaut has quit [Ping timeout: 255 seconds]
centrx has quit [Quit: Mead error: Connection reset by beer]
DrCode has joined #ruby
iamcalledrob has joined #ruby
agjacome has joined #ruby
bmurt has joined #ruby
iamcalledrob has quit [Ping timeout: 244 seconds]
benzrf|offline is now known as benzrf
tonyhb has joined #ruby
TorpedoSkyline has joined #ruby
pzula has joined #ruby
Wolland_ has quit [Remote host closed the connection]
tonyhb has quit [Read error: Connection reset by peer]
Wolland has joined #ruby
nfk has quit [Ping timeout: 250 seconds]
supermarkettoday has quit [Remote host closed the connection]
VTLob has joined #ruby
tonyhb has joined #ruby
Wolland has quit [Ping timeout: 260 seconds]
Jetchisel has quit [Quit: "Unfortunately time is always against us" -- *Morpheus*]
jdj_dk has joined #ruby
sevenseacat has joined #ruby
craigbowen3 has quit [Ping timeout: 240 seconds]
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matrixdevuk has quit [Remote host closed the connection]
matrixdevuk has joined #ruby
ctp has quit [Client Quit]
<jhass>
musicmatze: just like methods blocks and procs can receive an arbitrary number of arguments and pass them on: proc {|*args| other_proc.call(*args) }
craigbowen3 has joined #ruby
LadyRainicorn has joined #ruby
abuzze has quit [Remote host closed the connection]
abuzze has joined #ruby
sirecote has joined #ruby
sinkensabe has quit [Remote host closed the connection]
nateberkopec has joined #ruby
DaniG2k has quit [Ping timeout: 245 seconds]
earthquake has joined #ruby
Jetchisel has joined #ruby
codecop has quit [Remote host closed the connection]
marr has quit [Read error: Connection reset by peer]
bMalum_ has joined #ruby
nateberkopec has quit [Ping timeout: 240 seconds]
codecop has joined #ruby
tkuchiki has joined #ruby
jdj_dk has quit [Ping timeout: 256 seconds]
kevkev____ has joined #ruby
timonv_ has quit [Remote host closed the connection]
Fire-Dragon-DoL has joined #ruby
pallavi_shastry has quit [Quit: Connection closed for inactivity]
yliu has quit [Ping timeout: 256 seconds]
jottr has quit [Ping timeout: 250 seconds]
kevkev____ has quit [Ping timeout: 240 seconds]
o0oo0o has joined #ruby
DaniG2k has joined #ruby
jonr22 has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
o0oo0o has quit [Client Quit]
fgo has quit [Remote host closed the connection]
fgo has joined #ruby
sandelius has joined #ruby
GriffinHeart has joined #ruby
yliu has joined #ruby
timonv_ has joined #ruby
GriffinHeart has quit [Remote host closed the connection]
Emmanuel_Chanel has quit [Remote host closed the connection]
gogohome has joined #ruby
<gogohome>
hello
mikesplain has joined #ruby
<gogohome>
ruby programmer.
Emmanuel_Chanel has joined #ruby
<gogohome>
wasamasa: hello
<gogohome>
what are you doing?
wildroman2 has quit []
<gogohome>
wasamasa: you like wasabi?
fgo has quit [Ping timeout: 260 seconds]
root3d has quit [Remote host closed the connection]
<jhass>
I guess one question is why you create them with mixed lengths when you need them the same length in the first place
iamcalledrob has quit [Ping timeout: 250 seconds]
<jhass>
the other one might be whether you're sure you need them the same length
centipedefarmer has joined #ruby
<TieSoul>
It's for an interpreter of an esoteric language (Befunge) which needs all lines to be padded to the same length.
hlcmvb has joined #ruby
<Mon_Ouie>
When you're working with strings you can easily use String#ljust for that purpose
<jhass>
but for the sake, I'd go with lines.each do |line| item.fill(0, line.size, width-1); end
benzrf is now known as benzrf|offline
<Mon_Ouie>
and that with arrays
<TieSoul>
it's not strings
<jhass>
* line.fill (too much correcting in the quest of finding proper variable names)
<TieSoul>
the string gets turned into a 2D array.
Akagi201 has quit [Read error: Connection reset by peer]
<jhass>
I really hope your real code doesn't use arr, e and so on all the time
sirecote has joined #ruby
InfraRuby has joined #ruby
Akagi201 has joined #ruby
zz_anildigital is now known as anildigital
p0sixpscl has joined #ruby
sandelius has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
centipedefarmer has quit [Ping timeout: 240 seconds]
<TieSoul>
oh no it doesn't
<TieSoul>
of course not.
<jhass>
why the hassle of renaming them for the examples you post then
<TieSoul>
idk
<jhass>
;)
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
<TieSoul>
no don't forfeit
<TieSoul>
don't
<TieSoul>
oops
<TieSoul>
wrong chat
<TieSoul>
srry
<TieSoul>
I game while I code sometimes :P
jdj_dk has quit [Ping timeout: 240 seconds]
carraroj has quit [Quit: Konversation terminated!]
p0sixpscl has quit [Ping timeout: 250 seconds]
<shevy>
hmm
InfraRuby has left #ruby [#ruby]
koderok has quit [Ping timeout: 255 seconds]
earthquake has quit [Quit: earthquake]
newUser1234 has joined #ruby
<shevy>
hmmmm
<shevy>
can it be that gems slow down ruby startup?
<Hanmac>
depends how many gems are automaticly required at startup
nateberkopec has joined #ruby
heftig has joined #ruby
uxp has quit [Remote host closed the connection]
philcris_ has joined #ruby
nateberkopec has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
uxp has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
philcris_ has quit [Ping timeout: 255 seconds]
mikecmpbll has joined #ruby
teddyp1cker has quit [Remote host closed the connection]
teddyp1cker has joined #ruby
jackneill has quit [Remote host closed the connection]
m8 has joined #ruby
teddyp1cker has quit [Ping timeout: 245 seconds]
craigbowen3 has quit [Ping timeout: 255 seconds]
jackneill has joined #ruby
jdj_dk_ has joined #ruby
mikesplain has joined #ruby
pzula has quit [Ping timeout: 260 seconds]
acumiskey has joined #ruby
justinv has joined #ruby
iamjarvo has joined #ruby
Photism has joined #ruby
mikesplain has quit [Ping timeout: 255 seconds]
acumiskey has quit [Client Quit]
jgt has joined #ruby
abuzze_ has joined #ruby
benzrf|offline is now known as benzrf
abuzze_ has quit [Remote host closed the connection]
pzula has joined #ruby
abuzze_ has joined #ruby
arya_ has joined #ruby
sixxy has joined #ruby
abuzze has quit [Ping timeout: 260 seconds]
iamcalledrob has joined #ruby
Channel6 has joined #ruby
axl_ has joined #ruby
jdj_dk_ has quit [Ping timeout: 255 seconds]
arup_r has quit [Quit: Leaving.]
axl_ has quit [Client Quit]
gruz0[russia] has joined #ruby
iamcalledrob has quit [Ping timeout: 245 seconds]
jackneill has quit [Ping timeout: 250 seconds]
agrinb has joined #ruby
Dr3amc0d3r is now known as Dr3amc0d3r|away
jonr22 has quit [Ping timeout: 244 seconds]
arya_ has quit [Ping timeout: 250 seconds]
timonv_ has quit [Remote host closed the connection]
tylerkern has joined #ruby
pangur has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.3]
tonyhb has quit [Quit: peace]
mattstratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
supermarkettoday has joined #ruby
supermarkettoday has quit [Remote host closed the connection]
arup_r has joined #ruby
supermarkettoday has joined #ruby
supermarkettoday has quit [Remote host closed the connection]
asmodlol has quit [Quit: Leaving]
<pangur>
I have four classes (District, Phone, Address, Person) defined in one file, which I require for my main file. Everything works fine except my District.counter (@@district_counter) reports the wrong number. It should say 49. Instead it says 1508, which is 4 times the number of people. I can post my classes for anyone willing to have a look to see what I might be doing wrong.
claymore has joined #ruby
<pangur>
When I use Person.counter, it reports 377, which is correct.
arup_r has quit [Ping timeout: 244 seconds]
<pangur>
Address.counter reports 2 times the number of addresses.
Jetchisel has quit [Ping timeout: 256 seconds]
<pangur>
Sorry, I meant Address.counter reports twice the number of people.
abuzze has joined #ruby
jottr has joined #ruby
banister has joined #ruby
tkuchiki has quit [Remote host closed the connection]
LadyRainicorn has joined #ruby
<pangur>
The number of addresses is actually 287. Addresses.counter says 754.
phutchin1 has quit [Ping timeout: 250 seconds]
<pangur>
Is it likely to be something wrong with the class definitions or with the main file?
supermarkettoday has joined #ruby
supermarkettoday has quit [Remote host closed the connection]
silentpost has joined #ruby
supermarkettoday has joined #ruby
fgo has joined #ruby
tylerkern has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
supermarkettoday has quit [Remote host closed the connection]
abuzze_ has quit [Ping timeout: 260 seconds]
<shevy>
ossl_ssl.c:133:27: error: 'SSLv2_method' undeclared here (not in a function)
<shevy>
OSSL_SSL_METHOD_ENTRY(SSLv2),
<shevy>
damn
pzula has quit [Quit: leaving]
mattstratton has joined #ruby
agrinb has quit [Remote host closed the connection]
agrinb has joined #ruby
supermarkettoday has joined #ruby
tylerkern has joined #ruby
jdj_dk has joined #ruby
astav has joined #ruby
nateberkopec has joined #ruby
tjr9898 has joined #ruby
centipedefarmer has joined #ruby
tjr9898 has quit [Remote host closed the connection]
tjr9898 has joined #ruby
supermarkettoday has quit [Remote host closed the connection]
tjr9898 has quit [Remote host closed the connection]
* pangur
attempts to split his data file into four, allocating each of the four to tables of differing lengths.
iamcalledrob has joined #ruby
<pangur>
Am I on the right track?
bmurt has quit []
<pangur>
Should I get rid of the @@variables as they seem to be useless to me?
<pangur>
Unreliable at best.
seamon has quit [Quit: Zzzzzzz]
* pangur
's head is in a spin
Rollabunna has quit [Remote host closed the connection]
mrnugget has quit [Quit: mrnugget]
teddyp1cker has joined #ruby
patrick99e99 has quit [Ping timeout: 256 seconds]
iamcalledrob has quit [Ping timeout: 240 seconds]
<hakunin>
hm, this is reaching limits of my understanding. if i have 2 iterators that yield, then advance each other (using iter1.next or iter2.next respectively), how come first time they yield - it plays the original block they were started with, but subsequent yields aren't playing their blocks…
<Mon_Ouie>
They work just fine for the purpose you're using them
<Mon_Ouie>
You're just creating more instances than you seem to know
<hakunin>
(p.s. i'm not even sure if what i'm trying to achieve is possible)
gruz0[russia] has quit [Read error: Connection reset by peer]
centipedefarmer has quit [Ping timeout: 255 seconds]
nateberkopec has joined #ruby
godd2 has joined #ruby
supermarkettoday has quit [Remote host closed the connection]
alexju has joined #ruby
sdegutis has joined #ruby
<sdegutis>
Hi.
<hakunin>
idea was that if you have 2 iterations somewhere, and they use the same values, and you can supply any iterator to them, can you write said iterator such that the iterator will only have to be walked once
<sdegutis>
Is there some shortcut for passing blocks that represent [] calls?
kireevco has joined #ruby
<godd2>
Is it better to use the os gem to know what platform ruby is on or should I use RbConfig directly?
<sdegutis>
I want to use sort_by on an Array, but it's an array of hashes, and I'm wondering if I can just pass a block like I would have been able to do with &:foo if it was an accessor.
jottr has quit [Ping timeout: 256 seconds]
blackmesa has joined #ruby
ptrrr has joined #ruby
Atttwww has joined #ruby
<hakunin>
so i thought 1. iterator starts the other method, 2. other method's iterator yields, then advances iterator in the first method, 3. first method iterator yields, then advances iter in the second method, … (etc)
neohunter has quit [Quit: Linkinus is updating...]
neohunter has joined #ruby
georgelappies has joined #ruby
<hakunin>
it might not be doing what i think it's doing though, e.g. stack might be growing, not sure how fibers work in that scenario
hellangel7 has joined #ruby
supermarkettoday has joined #ruby
alexju has quit [Remote host closed the connection]
szuletett has joined #ruby
ari-_-e has quit [Ping timeout: 255 seconds]
theharshest has joined #ruby
IceDragon has quit [Ping timeout: 260 seconds]
IceDragon has joined #ruby
<wasamasa>
sdegutis: in what way is ruby-mode "unusable" compared to enh-ruby-mode?
axl_ has joined #ruby
<sdegutis>
wasamasa: Most ways.
<wasamasa>
that's not really helpful
<sdegutis>
wasamasa: I had a file with an __END__ block and ruby-mode tried to parse the stuff after it as Ruby.
<wasamasa>
all I know is it's running an external process to fontify the buffer
<sdegutis>
wasamasa: And when it tried to operate in the line containing the minified normalize.css, emacs just froze.
<shevy>
isn't that a bug?
jdj_dk has quit [Ping timeout: 240 seconds]
<sdegutis>
Yes.
<wasamasa>
which wouldn't help me much since the only fontification bug I've encountered was about string interpolation
<wasamasa>
sdegutis: does it do indentation differently?
bMalum__ has joined #ruby
bMalum_ has quit [Ping timeout: 250 seconds]
philcrissman has joined #ruby
<sdegutis>
Half the time I couldn't get it to indent a line at all -- it would just push it to the beginning of the line.
<wasamasa>
I haven't found a way to indent arguments differently
InfraRuby has joined #ruby
<wasamasa>
the official ruby-mode has only lining up or only hanging for offer
<wasamasa>
I'd want it to support both depending on the first line
chihhsin_cloud has quit [Quit: Connection closed for inactivity]
Ayey_ has joined #ruby
tharindu has joined #ruby
Kricir has quit [Remote host closed the connection]
<wasamasa>
also, what's with the encoding autocookie?
<wasamasa>
is it necessary?
<szuletett>
watching gorails
philcrissman has quit [Ping timeout: 255 seconds]
sepp2k has joined #ruby
sdegutis has left #ruby [#ruby]
crazydev has joined #ruby
benzrf is now known as benzrf|offline
<shevy>
goatrails?
coderhs has joined #ruby
zkay11 has joined #ruby
agjacome has quit [Quit: leaving]
Ayey_ has quit [Ping timeout: 260 seconds]
peret has joined #ruby
tylerkern has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Asher has quit [Quit: Leaving.]
nfk has quit [Ping timeout: 245 seconds]
lw has quit [Quit: s]
centipedefarmer has joined #ruby
<AlexRussia>
Hello!
tylerkern has joined #ruby
<AlexRussia>
How i could made sth like 'enum' in ruby?
<AlexRussia>
make*
<Mon_Ouie>
You can use symbols for the different values of your enumeration
<jhass>
we generally just use symbols for that
<AlexRussia>
symbold could have diffrent value than default? sth like :foo = "bar" ?
Doppp has quit [Read error: Connection reset by peer]
agrinb_ has joined #ruby
advorak has joined #ruby
<jhass>
no
<AlexRussia>
ok
<jhass>
that's not the point of an enum anyway. Do you look for constants?
chihhsin_cloud has joined #ruby
<AlexRussia>
idk what i look
<AlexRussia>
i want move all my identification logic on one private method, but idk what i need to return
<AlexRussia>
okay, i guess, symbold be nice
<AlexRussia>
symbols*
charliesome has joined #ruby
vsoftoiletpaper has quit []
<AlexRussia>
how i could define symbols in class for make they availble for all methods?
vsoftoiletpaper has joined #ruby
pangur has quit [Quit: Ex-Chat]
kenneth has joined #ruby
<jhass>
you don't define symbols, you just use them
<AlexRussia>
@_@
agrinb has quit [Ping timeout: 260 seconds]
<jhass>
def check_for_bla; if whatever; :this; elsif whatelse; :that else :thisthat; end; if check_for_bla == :this; do_stuff; end
<wasamasa>
"My little Ruby - Symbols are Magic!"
crazydev has quit [Ping timeout: 246 seconds]
Doppp has joined #ruby
sinkensabe has joined #ruby
Zebroid has quit [Remote host closed the connection]
Zebroid has joined #ruby
<pontiki>
a symbol is a literal, like a string, number, etc
<Mon_Ouie>
AlexRussia: You can usually replace symbols with integers: "how could i define integers in a class to make them available for all methods?"
<pontiki>
it isn't a variable or constant
justinv has quit [Remote host closed the connection]
tylerkern has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<AlexRussia>
Mon_Ouie: @_@
F1skr has joined #ruby
<AlexRussia>
Mon_Ouie: ok, ok
kireevco has quit [Quit: Leaving.]
klaut has joined #ruby
<shevy>
has one of you guys managed to compile a static ruby that has no external dependencies?
Atttwww has quit [Ping timeout: 255 seconds]
shtirlic_ has quit [Ping timeout: 256 seconds]
jdj_dk has joined #ruby
starkhalo has quit [Ping timeout: 264 seconds]
razum2um has quit [Quit: Leaving.]
inkblots has joined #ruby
jdj_dk has quit [Read error: Connection reset by peer]
coderhs has quit [Read error: Connection reset by peer]
nanoyak has joined #ruby
jdj_dk has joined #ruby
mikesplain has joined #ruby
sinkensabe has quit [Remote host closed the connection]
goodenough has quit [Remote host closed the connection]
sinkensabe has joined #ruby
agrinb_ has quit [Remote host closed the connection]
Rollabunna has quit [Quit: Leaving...]
agrinb has joined #ruby
jjasonclark has joined #ruby
lkba has quit [Read error: Connection reset by peer]
lkba has joined #ruby
ftj has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
m8 has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mary5030 has joined #ruby
m8 has joined #ruby
mikesplain has quit [Ping timeout: 240 seconds]
deweichen has joined #ruby
sinkensabe has quit [Ping timeout: 250 seconds]
agrinb has quit [Ping timeout: 245 seconds]
anildigital is now known as zz_anildigital
hellangel7 has quit [Ping timeout: 255 seconds]
starkhalo has joined #ruby
InfraRuby has left #ruby [#ruby]
relix has joined #ruby
tjr9898_ has quit [Remote host closed the connection]
theharshest has quit [Quit: This computer has gone to sleep]
Kricir has joined #ruby
Panicky has joined #ruby
iamcalledrob has joined #ruby
centipedefarmer has quit [Ping timeout: 260 seconds]
gruz0[russia] has quit [Quit: This computer has gone to sleep]
amclain has joined #ruby
zz_anildigital is now known as anildigital
shtirlic has joined #ruby
jdj_dk has quit [Ping timeout: 250 seconds]
jjasonclark has quit [Quit: jjasonclark]
centipedefarmer has joined #ruby
iamcalledrob has quit [Ping timeout: 255 seconds]
tharindu is now known as tharindu|away
DaniG2k has joined #ruby
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kricir has quit [Ping timeout: 256 seconds]
centipedefarmer has quit [Ping timeout: 256 seconds]
nfk has joined #ruby
centipedefarmer has joined #ruby
txdv has quit [Read error: Connection reset by peer]
DaniG2k has quit [Quit: leaving]
gruz0[russia] has joined #ruby
txdv has joined #ruby
<AlexRussia>
jhass: yo, what a hell is going on if i define constant outside of any method in class?
<jhass>
the normal stuff? defining it inside a method is rather uncommon
<shevy>
AlexRussia it should reside in class Object I think?
sinkensabe has joined #ruby
nasj has quit [Remote host closed the connection]
inkblots has quit [Quit: WeeChat 0.3.8]
nasj has joined #ruby
<AlexRussia>
oh shit
<AlexRussia>
jhass: how to i could change name one of field my model?
<AlexRussia>
jhass: RoR question
nanoyak has quit [Quit: Computer has gone to sleep.]
<jhass>
#rubyonrails (but by creating a migration that changes it)
atmosx has quit [Ping timeout: 264 seconds]
<shevy>
jhass why did you learn rails? for work?
<jhass>
contributing to diaspora
<AlexRussia>
jhass: no, i need change it in generally
Xiti has quit [Quit: Leaving]
MartinCleaver has joined #ruby
<AlexRussia>
jhass: i've thought, you knew
<jhass>
I've no idea what you're talking about, but again, -> #rubyonrails
centipedefarmer has quit [Ping timeout: 240 seconds]
goodenough has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Max SendQ exceeded]
goodenough has quit [Remote host closed the connection]
nasj has quit [Ping timeout: 264 seconds]
iamjarvo has joined #ruby
SouL has joined #ruby
Xiti has joined #ruby
sandelius has joined #ruby
fold has quit [Ping timeout: 240 seconds]
Ayey_ has joined #ruby
amacou has quit [Remote host closed the connection]
SouL has quit [Read error: Connection reset by peer]
amacou has joined #ruby
Kricir has joined #ruby
centipedefarmer has joined #ruby
IceDragon has quit [Ping timeout: 264 seconds]
jdj_dk has joined #ruby
Ayey_ has quit [Ping timeout: 250 seconds]
IceDragon has joined #ruby
amacou has quit [Ping timeout: 245 seconds]
centiped_ has joined #ruby
jayunit100 has quit [Quit: jayunit100]
nasj has joined #ruby
iamcalledrob has joined #ruby
Kricir has quit [Ping timeout: 240 seconds]
centipedefarmer has quit [Ping timeout: 255 seconds]
Nahra has quit [Remote host closed the connection]
sixxy has quit [Read error: Connection reset by peer]
MartinCleaver has quit [Read error: Connection reset by peer]
phinfonet has joined #ruby
jdj_dk has quit [Ping timeout: 255 seconds]
<godd2>
What's the difference between add_dependency and add_runtime_dependency in a gemspec? Does the former apply to runtime and development environments? Or is it something else?
<shevy>
custom_methods.rb:3725: unknown type of %string
<shevy>
%i( foo )
<shevy>
is there a way to make this code safe for ruby 1.9.3 to at least not break down?
<jhass>
godd2: they're aliases
<jhass>
shevy: replace by %w(foo).map(&:to_sym)
<shevy>
ok
mary5030 has joined #ruby
mikesplain has joined #ruby
sinkensabe has quit [Read error: Connection reset by peer]
sinkensabe has joined #ruby
banjara has joined #ruby
TieSoul has quit [Read error: Connection reset by peer]
mgorbach has quit [Remote host closed the connection]
mgorbach has joined #ruby
MatthewsFace has joined #ruby
autochthon has quit [Quit: autochthon]
ftj has joined #ruby
lw has quit [Ping timeout: 250 seconds]
axl__ has joined #ruby
agjacome has joined #ruby
agjacome has quit [Client Quit]
patrick99e99 has joined #ruby
axl__ has quit [Client Quit]
neohunter has quit [Ping timeout: 240 seconds]
nanoyak has joined #ruby
chrishough has quit [Quit: chrishough]
benzrf is now known as benzrf|offline
Nahra has joined #ruby
silentpost has quit [Quit: silentpost]
starkhalo has quit [Ping timeout: 264 seconds]
patrick99e99 has quit [Ping timeout: 256 seconds]
Shidash has joined #ruby
davedev2_ has joined #ruby
DaniG2k has quit [Ping timeout: 240 seconds]
OrangeJewce has joined #ruby
chipotle has joined #ruby
Tamae has joined #ruby
maletor has joined #ruby
centipedefarmer has quit [Remote host closed the connection]
tharindu has joined #ruby
fold has joined #ruby
davedev24_ has quit [Ping timeout: 255 seconds]
uxp has quit [Remote host closed the connection]
jdj_dk has joined #ruby
<OrangeJewce>
Hi all, I'm wondering what you guys think a "Hash tree" is? I was asked to store some data in a "hash tree" and I don't see using a Merkle tree for such an exercise.
philcrissman has joined #ruby
gr33n7007h has joined #ruby
uxp has joined #ruby
jdj_dk has quit [Read error: Connection reset by peer]
jdj_dk has joined #ruby
deweichen has quit [Remote host closed the connection]
starkhalo has joined #ruby
centipedefarmer has joined #ruby
philcrissman has quit [Ping timeout: 240 seconds]
bluOxigen has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
<jhass>
vifino: for anything complex you probably have to use ncurses. For rudimentary stuff search for ASCII control sequences, there's stuff like erasing the current line, the screen etc.
thams has joined #ruby
Kricir has quit [Ping timeout: 244 seconds]
<vifino>
ok.
ftj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<wasamasa>
alternatively you might write an actual gui
astav has quit [Ping timeout: 260 seconds]
<jhass>
ncruses almost is an actual gui these days
wchun has quit [Quit: Leaving]
<jhass>
I mean you can click on the menu items and stuff
<vifino>
jhass: You know how I can delete the current line?
<jhass>
there's an ASCII control sequence for that
<jhass>
er, ANSI, not ASCII
tectonic has quit []
autochthon has quit [Remote host closed the connection]
timonv_ has joined #ruby
ftj has joined #ruby
<wasamasa>
vifino: I hope you don't plan on making this work on windows, too :P
maxk has joined #ruby
<vifino>
wasamasa: hell no! :P
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wasamasa>
good
ftj has quit [Client Quit]
sigurding has quit [Quit: sigurding]
astav has joined #ruby
<vifino>
jhass: Do you know how I can do this without modifying every "puts" line?
<jhass>
write your own puts
<vifino>
._.
mspah_ has joined #ruby
hfp has joined #ruby
<wasamasa>
let's take a look at the ruby toolbox
<wasamasa>
they have terminal coloring :P
<vifino>
._.
Spami has joined #ruby
<wasamasa>
which is just convenience over puts
mikesplain has joined #ruby
Soda has joined #ruby
sigurding has joined #ruby
<jhass>
def reprint msg; print ERASE_LINE; print msg; end
<vifino>
Whats "ERASE_LINE"
<vifino>
?
<jhass>
a constant
<vifino>
You mean, in standard ruby?
<vifino>
O.O
<jhass>
no
<vifino>
:<
jdj_dk has joined #ruby
<jhass>
I didn't bother looking up the code for you
tectonic has joined #ruby
anildigital is now known as zz_anildigital
hfp_ has quit [Ping timeout: 255 seconds]
<wasamasa>
jhass: read something like tldp for the ansi codes
<wasamasa>
jhass: have fun
<wasamasa>
err, vifino
zz_anildigital is now known as anildigital
<vifino>
wasamasa: yes?
<wasamasa>
doit
hfp has quit [Ping timeout: 260 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
<wasamasa>
vifino: if you can't figure out the ansi codes by reading tldp, you won't get to hack something together with ncurses either :P
mikesplain has quit [Ping timeout: 240 seconds]
<vifino>
._.
hfp has joined #ruby
<wasamasa>
what, did you expect us spoonfeeding you?
JoshGlzBrk has joined #ruby
pr0t has quit [Ping timeout: 244 seconds]
<shevy>
hmm
lidenbrock has joined #ruby
<shevy>
how are .send and __send__ related to one another?
<jhass>
I think nowadays send just delegates to __send__
revvy has joined #ruby
<banister>
jhass you should stop working on diaspora
<jhass>
shevy: looks like two names for the same C function in MRI
centipedefarmer has quit [Read error: Connection reset by peer]
deweichen has joined #ruby
bklane has joined #ruby
ftj has joined #ruby
centipedefarmer has joined #ruby
<wasamasa>
shevy: are you related with that person?
MartinCleaver has joined #ruby
<shevy>
revvy?
<shevy>
I like his nick
<shevy>
but he has not much to say, doesn't he
sigurding has quit [Quit: sigurding]
<shevy>
wasamasa I think your nick would sound better if it were "wasamasy"
vt102 has quit [Ping timeout: 256 seconds]
tkuchiki has joined #ruby
<wasamasa>
shevy: dunno what my friends thought
<wasamasa>
shevy: my nick IRL is "wasa"
<shevy>
like the swedish bread?
<bklane>
I am confused in an #initialize when to use =|| versus = for defining the variables. Anyone have a resource or able to explain the reasoning?
<jhass>
I suppose you mean ||=
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jhass>
I can't remember using ||= in initialize
<bklane>
yes, sorry
<banister>
bklane theres' no real point to use ||= in #initialize
jjasonclark has joined #ruby
mattmcclure has joined #ruby
<bklane>
alright, interesting someone in a code review said that would be helpful. Thank you
<apeiros>
bklane: unless you call initialize in other places, it's pointless
<bklane>
jhass, banister, and apeiros thank you, I appreciate the help.
x1337807x has joined #ruby
Kricir has joined #ruby
jdj_dk has quit [Ping timeout: 255 seconds]
<godd2>
I'm developing a gem and was wondering if anyone would like to take a look at it to look over the general structure. It's still in alpha, but I want to make sure I'm developing in the right direction, or at least, in ways similar to other projects: https://rubygems.org/gems/juicy
Kricir_ has joined #ruby
codecop has quit [Remote host closed the connection]
jabbott has joined #ruby
<jabbott>
How do I remove mongoid from my system? I'm getting /var/lib/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- mongoid (LoadError) . I've tried to remove the gem and do a bundle update and upgrade and keep receiving that error...
gruz0[russia] has quit [Quit: This computer has gone to sleep]
<jhass>
godd2: bin/ stuff usually has a shebang and no .rb extension
seamon has quit [Quit: Zzzzzzz]
developer has joined #ruby
Kricir has quit [Ping timeout: 240 seconds]
<jhass>
godd2: also once the gem is installed, lib is added to the loadpath by rubygems, so you can do normal require's as if you're a user of your gem in bin/. During development you can execute the scripts with ruby -Ilib bin/foo
<jhass>
godd2: don't use require_relative in lib, as said once installed your gems lib is in the load path
microdex has joined #ruby
<godd2>
oh os instead of require_relative 'juicy/pitch' just do require 'juicy/pitch' ?
peret has quit [Remote host closed the connection]
<jhass>
yeah
<godd2>
awesome, thank you for the tips
Kricir_ has quit [Ping timeout: 264 seconds]
mike24 has joined #ruby
<jhass>
for the specs you usually have a spec helper that adds lib to the load path and then no need for relative requires there either
<vifino>
#redefiningputs ftw
DrCode_ has joined #ruby
<jhass>
godd2: also I would settle on either test-unit / minitest test-unit style or rspec / minitest rspec style, not using both
seamon has joined #ruby
rdark has quit [Quit: leaving]
<godd2>
I was under the impression I was using only rspec
<jhass>
you do have a test/ directory with a file in it
<godd2>
oh right. Yea, that's an old file that I need to remove
<godd2>
You said bin/ doesn't have .rb files in it, and I don't know what a shebang is. Could you elaborate?
centipedefarmer has joined #ruby
<jhass>
oh, you're on windows, right?
<godd2>
Yea, but I want my gem to be cross platform
jmurphy has joined #ruby
<anildigital>
again for those who missed yesterday http://ruby-operators.herokuapp.com/ ppl do contribute if you know any other nice ruby operator with awesome name
jmurphy has left #ruby [#ruby]
Hobogrammer has joined #ruby
<jhass>
on unix systems a shebang is a special first line in a file that, if the file is marked as executable, designated the program to be launched with the script as argument. So for ruby scripts it would be #!/usr/bin/env ruby for example
mike24 has quit [Quit: Leaving]
<godd2>
Oh so you wouldn't have to type `ruby some_script...`
<jhass>
yeah
kldskp has quit [Quit: Computer has gone to sleep.]
kldskp has joined #ruby
tkuchiki has quit [Remote host closed the connection]
SilkFox has quit [Ping timeout: 240 seconds]
jayunit100 has quit [Quit: jayunit100]
Ayey_ has joined #ruby
Kricir has joined #ruby
<gr33n7007h>
Why can't I send anything over sockets always returns `Errno::EPIPE: Broken pipe - send(2)` any ideas ?
<jhass>
can you provide an example that we can pull and run?
mostlybadfly has quit [Quit: Connection closed for inactivity]
<godd2>
Oh I moved all those rb files that were in bin into an examples folder. There are no files inside bin now.
<gr33n7007h>
Got it doesn't matter:symbolize_names => true
<gr33n7007h>
keep forgetting tab completion in pry
jabbott has quit [Quit: Page closed]
<godd2>
Since you said bin folder doesn't have rb files in it, so I took them out.
<godd2>
Did you mean I should add shebang to each of the rb files that were in there?
<jhass>
no
<czaks>
symbolize_names is a DoS vector i believe
Channel6 has quit [Quit: Leaving]
<jhass>
godd2: the bin/ folder is used for ruby scripts that should be installed in a way that they can be called from the command line, that is in a folder that is added to the $PATH
BadQuanta has joined #ruby
<czaks>
i'm not sure if something changed, but ruby used to allocate all symbols and don't free them during the lifetime of a program
goodenough has joined #ruby
roolo has joined #ruby
tectonic has quit []
<jhass>
godd2: now you don't want to have executables like juicy.rb, you want juicy instead. And to be then able to just type juicy you need to have the scripts marked executable and have a proper shebang
jdj_dk has quit [Ping timeout: 250 seconds]
<jhass>
czaks: yes, it's a DoS vector if you don't totally trust the source, thus I asked if he does
tectonic has joined #ruby
<godd2>
ok, I still don't quite understand, but I'm gonna jot down everything you wrote here and look into understanding it later. Thanks for all your help :)
tylerkern has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
justinv has joined #ruby
jdj_dk has quit [Read error: Connection reset by peer]
jdj_dk has joined #ruby
pskosinski has joined #ruby
iamcalledrob has joined #ruby
ferr has quit [Ping timeout: 250 seconds]
centipedefarmer has quit [Ping timeout: 250 seconds]
centipedefarmer has joined #ruby
codygman has quit [Remote host closed the connection]
peret has joined #ruby
Channel6 has joined #ruby
iamcalledrob has quit [Ping timeout: 245 seconds]
tvw has quit [Ping timeout: 255 seconds]
<nymous>
i'd rewritten it to use start-stop-daemon and you know what? it doesn't write to logs either
<shevy>
hmm
Kricir has joined #ruby
vsoftoiletpaper has quit []
<nymous>
it works if started in foreground
stytown has quit [Quit: stytown]
<jhass>
nymous: I'd try passing a Logger instance instead
kireevco has joined #ruby
VTLob has quit [Quit: VTLob]
<jhass>
or WEBrick::BasicLog
tylerkern has joined #ruby
Lexun has joined #ruby
<nymous>
ok, looks like docs gives bad advice
<nymous>
i've replaced log_file with my constant LOGFILE
<nymous>
so it's not a handler, but plain filename
<nymous>
and it works!
olivier_bK has quit [Ping timeout: 256 seconds]
tylerkern has quit [Client Quit]
hakunin has quit [Remote host closed the connection]
sethen has joined #ruby
hakunin has joined #ruby
tjr9898 has joined #ruby
jdj_dk has quit [Ping timeout: 250 seconds]
Sauvin has quit [Ping timeout: 255 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
hakunin has quit [Ping timeout: 264 seconds]
kireevco has quit [Quit: Leaving.]
Kricir has quit [Remote host closed the connection]
benzrf is now known as benzrf|offline
tjr9898 has quit [Ping timeout: 250 seconds]
astav has quit [Quit: astav]
<shevy>
huh
<shevy>
now that seems as if the simplest solution has worked
_whitelogger has joined #ruby
_whitelogger_ has joined #ruby
stytown has joined #ruby
leslie_ has joined #ruby
elektronaut has joined #ruby
Zebroid has quit [Ping timeout: 256 seconds]
x1337807x has joined #ruby
ixti has joined #ruby
jdj_dk has joined #ruby
aledovsky has quit [Ping timeout: 250 seconds]
andrewlio has quit [Remote host closed the connection]
<shevy>
can I alias methods like so
<shevy>
def foo; end; alias bar= foo ?
aledovsky has joined #ruby
<shevy>
hmm
<shevy>
seems to work
<shevy>
I wonder why I always used alias_method
amystephen has joined #ruby
kldskp has quit [Ping timeout: 250 seconds]
Lavender has joined #ruby
end_guy has joined #ruby
x1337807x has quit [Ping timeout: 244 seconds]
Soda has joined #ruby
banister_ has joined #ruby
banister has quit [Read error: Connection reset by peer]
justinv has quit [Remote host closed the connection]
bridge_ has quit [Remote host closed the connection]
tkuchiki has joined #ruby
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<Lavender>
How well does this room deal with question from total newbies? I don't want to set myself up to get yelled at for not being an expert...
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<gzl>
Lavender: I haven't noticed any issues.
<hoelzro>
Lavender: I've found most everyone here is very kind
<hoelzro>
just ask your question; you won't get yelled at =)
banister has joined #ruby
<Lavender>
haha, okay, I just wanted to ask, I've found some programmers get weirld offended by newbies
aspires has quit []
banister has quit [Max SendQ exceeded]
nobodyzzz has joined #ruby
benzrf|offline is now known as benzrf
banister_ has quit [Ping timeout: 250 seconds]
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<Lavender>
I started learning on code academy, maybe not the best source, but a place to start. I'm trying to improve one of their projects and I'm running into a error I don't know how to handle
blackmesa has quit [Remote host closed the connection]
nasj has joined #ruby
<shevy>
what error
banister has joined #ruby
blackmesa has joined #ruby
banister has quit [Max SendQ exceeded]
<Lavender>
so running this section http://i.imgur.com/SPkZmxk.png when I try to actually add a new movie I get undefined method `to_sym' for nil:NilClass
zcreative has joined #ruby
<Lavender>
I'm not sure what I changed to break that though, cause it worked dfine before I started playing
<shevy>
you have a nil there
banister has joined #ruby
banister has quit [Max SendQ exceeded]
jxf has joined #ruby
banister has joined #ruby
banister has quit [Max SendQ exceeded]
phutchins has joined #ruby
<Lavender>
right, I was under the impression that .nil? should just be checking it the title is present or not
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<benzrf>
Lavender: fyi, dont do to_sym on arbitrary input
<benzrf>
the whole point of symbols is to be prespecified in-code identifiers
<benzrf>
like variable names
<Lexun>
yeah, the problem is that the title variable is nil, so you can't call to_sym on it
<shevy>
well
banister has joined #ruby
banister has quit [Max SendQ exceeded]
<shevy>
Lavender you can check whether a title is included in a hash or not
<shevy>
for instance: hash.has_key? 'this_key'
<benzrf>
i have a theory that better languages have nice communities
<gzl>
Lavender: you're using gsub! instead of gsub. also you're using movies[title] in one place and movies[title.to_sym] in another.
<benzrf>
*nicer
<shevy>
Lavender, also, you must be careful if you use .gsub!
banister has joined #ruby
<benzrf>
hence why this room is quite nice
nasj has quit [Ping timeout: 245 seconds]
<benzrf>
and #haskell is even nicer
<gzl>
Lavender: but the nil problem is because of the use of gsub!.
<benzrf>
;)
<shevy>
Lavender in your example, change .gsub! to .gsub
zcreative has quit [Ping timeout: 245 seconds]
<Lavender>
ah, taking out ! did it
<shevy>
\o/
phoo1234567 has quit [Quit: Leaving]
basiclaser has quit [Excess Flood]
<Lavender>
now I have to make sure I understand why, haha. like I said at the start, newbie
<shevy>
now you only have to understand why
<shevy>
do you know why some methods in ruby have the ! character
fgo has joined #ruby
<Lavender>
if I remember correctly the ! makes it permanently modify what it's attached to? sorry if "attached to" isn't the right term, I'm still trying to get all the terms straight
<benzrf>
Lavender: remember, having the ! doesn't actually explicitly do something
<benzrf>
Lavender: it's just part of the name
basiclaser has joined #ruby
<benzrf>
and ! at the end of mutators is a naming convention
jdj_dk has quit [Ping timeout: 260 seconds]
<benzrf>
Lavender: you cannot put ! at the end of random methods and have them mutate
<benzrf>
l8r
<shevy>
Lavender usually a method with ! in ruby means
<shevy>
DANGEROUS!
<shevy>
it may be assumed that it will modify-in-place
benzrf is now known as benzrf|offline
<shevy>
for instance, you have a string object: foo = 'hi there'
<shevy>
now you have two ways to modify it, which are the same for the net result
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fgo has quit [Read error: No route to host]
JoshGlzBrk has joined #ruby
fgo has joined #ruby
iamcalledrob has quit [Ping timeout: 240 seconds]
<gzl>
Lavender: did you figure it out?
stytown has quit [Quit: stytown]
<Lavender>
I think I'm starting to understand, I also found a question about ! on stackoverflow. so the issue is that it wasn't returning a modified title, it was just mutating the string?
arya_ has quit [Ping timeout: 255 seconds]
lw has joined #ruby
x1337807x has joined #ruby
<gzl>
Lavender: there's two things going on. if s is a string, then s.gsub('abc', 'def') does not change s, but returns the modified version of s (which is just s if no replacements are done). so you would use this and assign the result to a new variable, like "new_s = s.gsub('abc', 'def')".
lw_ has joined #ruby
<gzl>
Lavender: s.gsub!('abc', 'def') modified s itself and returns the result of the replacement. if it made any changes, it's the modified string (which is why your code kind of worked). if it doesn't make any changes, it just returns nil.
zcreative has joined #ruby
fgo has quit [Ping timeout: 255 seconds]
<Lavender>
Ah! okay, I understand!
gr33n7007h has quit [Ping timeout: 256 seconds]
klaut has quit [Remote host closed the connection]
hekin has joined #ruby
klaut has joined #ruby
sinkensabe has quit [Remote host closed the connection]
<gzl>
Lavender: you would guess that you use the ! version to modify in place and the other one to generate a new version of the string because of the naming conventions. for the nil return value thing, you just have to read the documentation.
x1337807x has quit [Ping timeout: 250 seconds]
jayunit100 has joined #ruby
lw has quit [Ping timeout: 256 seconds]
justinv has quit [Remote host closed the connection]
lw_ has quit [Client Quit]
<Lavender>
I think the problem came in me assuming I understood things that I turned out I didn't fully understand. still learning and making silly mistakes :)
axsuul has joined #ruby
Lexun has quit [Quit: Manjaro-KDE user leaving!]
arya_ has joined #ruby
<gzl>
yeah. just need to go one step at a time.
kenneth has joined #ruby
doub has quit [Ping timeout: 260 seconds]
magic has quit [Ping timeout: 250 seconds]
roolo has quit [Quit: Leaving...]
Zebroid has joined #ruby
brianherman has joined #ruby
<Lavender>
even if it was a silly mistake, I really appreciate you guys explaining it in easy to understand terms :)
Lexun has joined #ruby
klaut has quit [Ping timeout: 255 seconds]
ringarin has quit [Quit: Leaving]
<gzl>
no problem
acumiskey has joined #ruby
<shevy>
well
<shevy>
you'll make the .gsub vs .gsub! mistake only once (normally)
acumiskey has quit [Client Quit]
<shevy>
so now you should be safe for the rest of your life
<Lavender>
haha, kind of like when I made an infinite loop and crashed chrome >.>
benzrf|offline is now known as benzrf
Zebroid has quit [Ping timeout: 255 seconds]
<shevy>
in javascript?
<Lavender>
yup
aspires has joined #ruby
lidaaa has joined #ruby
jdj_dk has joined #ruby
nobodyzzz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
magic has joined #ruby
Beoran__ has quit [Ping timeout: 244 seconds]
axl__ has joined #ruby
axl__ has quit [Client Quit]
MartinCleaver has joined #ruby
mikesplain has joined #ruby
leslie_ is now known as leslie
leslie has quit [Changing host]
leslie has joined #ruby
lw has joined #ruby
gregf has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
mikesplain has quit [Ping timeout: 255 seconds]
jtdowney has joined #ruby
goshdarnyou has quit [Quit: Connection closed for inactivity]
axl_ has quit [Quit: axl_]
aspires has quit []
Wolland_ has quit [Remote host closed the connection]
greyEarl has joined #ruby
Wolland has joined #ruby
marr has quit [Ping timeout: 240 seconds]
Beoran__ has joined #ruby
njection has quit [Ping timeout: 240 seconds]
greyEarl has left #ruby [#ruby]
larissa has quit [Quit: Leaving]
jdj_dk has quit [Ping timeout: 240 seconds]
kldskp has joined #ruby
Wolland has quit [Ping timeout: 264 seconds]
mary5030 has joined #ruby
arya_ has quit [Quit: sayonara^_^]
kldskp has quit [Ping timeout: 255 seconds]
weems|nix has quit [Ping timeout: 255 seconds]
doub has joined #ruby
gruz0[russia] has quit [Quit: This computer has gone to sleep]
Shidash has quit [Ping timeout: 240 seconds]
jhass is now known as jhass|off
mijicd has quit [Remote host closed the connection]
stytown has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonr22 has joined #ruby
nasj has joined #ruby
SouL__ has quit [Quit: No Ping reply in 180 seconds.]
tkuchiki has quit [Remote host closed the connection]
SouL_ has joined #ruby
kireevco has joined #ruby
kireevco has left #ruby [#ruby]
blackmesa has quit [Ping timeout: 264 seconds]
nasj has quit [Ping timeout: 245 seconds]
DreamingRainne has joined #ruby
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<DreamingRainne>
Right, so, I'm on a fresh OS install (Mint 17), and had been using 1.8.7 since the late Middle Ages. Maybe now I can go for a fresh start. Any recommendations of version, etc?