<csffsc>
and that resolves to {21=>[7, 7, 7], 20=>[7, 8, 5], 19=>[7, 7, 5]}
<csffsc>
when, 21 should equal, 7, 7, 7 and 8, 8, 5
<csffsc>
it's isolated to '.keep_if { |sum, _| sum < 22 }.sort.reverse'
alexju has joined #ruby
Mars` has quit [Remote host closed the connection]
zz_tsykoduk is now known as tsykoduk
<csffsc>
okay.. the bug is that upon using an integer - it can't be used again
<havenwood>
csffsc: oops, yeah that is my mistake - you can't have the key be the sum, or the last combo will overwrite the others
mobileblue has quit [Ping timeout: 248 seconds]
<havenwood>
>> Hash[hand.combination(cards).map { |cards| [cards, cards.inject(:+)] }.keep_if { |_, sum| sum < 22 }.sort_by { |_, v| v }.reverse]
<eval-in>
havenwood => undefined local variable or method `hand' for main:Object (NameError) ... (https://eval.in/55902)
roflpox has joined #ruby
<havenwood>
csffsc: well, i don't wanna paste spam, but that ^
<havenwood>
brb
mobileblue has joined #ruby
Heero` has joined #ruby
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
alexju has quit [Remote host closed the connection]
mrsolo_ has joined #ruby
<roflpox>
this recursion problem is killing me
alexju has joined #ruby
tndrbt has joined #ruby
<csffsc>
havenwood: thanks, much better! what exactly is the point of the underbar _ inside the |k v| statements?
fschuindt has joined #ruby
<havenwood>
csffsc: a convention if you're not going to use a variable to name it _
<havenwood>
csffsc: then linters etc don't complain you've defined a var that isn't used
<havenwood>
csffsc: also improves readability for those familiar with the convention
<csffsc>
havenwood: ah.. linters?
Heero has quit [Ping timeout: 265 seconds]
<havenwood>
csffsc: well, if you run ruby with -w it will complain, or linters, which are code analysis tools
<havenwood>
like flay, flog, ruby-lint
roflpox has quit [Quit: Leaving]
Jetchisel has joined #ruby
s3itz has joined #ruby
hogeo has joined #ruby
<volty>
Tractatus By Cardinal Of Cards
<volty>
.......
alexju has quit [Ping timeout: 245 seconds]
<havenwood>
csffsc: The -w flag from manpage: Enables verbose mode without printing version message at the beginning. It sets the $VERBOSE variable to true.
aspires has quit [Quit: sudo making a sandwich]
alexju has joined #ruby
<csffsc>
ok cool
felixjet__ has joined #ruby
aspires has joined #ruby
x1337807x has joined #ruby
nfk has quit [Ping timeout: 272 seconds]
<havenwood>
csffsc: mostly just to signal to code readers that you don't mean to use it
<havenwood>
so they don't go searching for where you do
felixjet_ has quit [Ping timeout: 248 seconds]
ZhBPi has joined #ruby
<volty>
if the receiver has the right slot
bradhe has quit [Remote host closed the connection]
Mars` has joined #ruby
bradhe has joined #ruby
<volty>
if not he will have to come to consult with experts
<volty>
that will tell him that it is a 'convention'
<csffsc>
first time I've seen that, but it's good to know about
alexju_ has joined #ruby
<volty>
would be much better to have the possibility to just drop a parametere
<volty>
and I hope they will do it (one day)
alexju has quit [Read error: Connection reset by peer]
<volty>
did you make a gem out of all this mapping and summing of cards?
mrsolo_ has quit [Quit: This computer has gone to sleep]
bradhe has quit [Ping timeout: 272 seconds]
alexju has joined #ruby
alexju_ has quit [Read error: Connection reset by peer]
<csffsc>
me?
<csffsc>
.. stupid question, dont know who else is wasting their time on this
<csffsc>
I'm still working on it :p
<volty>
all of you, both of you :)
<volty>
or maybe it was just a teaching session
aspires has quit [Quit: sudo making a sandwich]
<csffsc>
I have two 'issues' to solve prior to this being finished
<csffsc>
A) combing thru the final hash, and removing the 'keys' with the highest value
<csffsc>
B) accounting for Jack Queen King Ace
aspires has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bradhe has joined #ruby
<csffsc>
J Q K are all worth 10, and don't have a pecking order, but if only a queen is used, then a queen has to be returned, not a 10
<xybre>
It has tools to help find where methods were defined. It can at least tell you if its a C function. If you have pry-doc installed it can even show you info about them too.
bradhe has joined #ruby
<kraljev2>
cool, i'll take a look, thanks
jrhe has joined #ruby
Mars` has quit [Remote host closed the connection]
akemrir has joined #ruby
Mars` has joined #ruby
bradhe has quit [Ping timeout: 272 seconds]
devoldmx27 has quit [Remote host closed the connection]
<Mon_Ouie>
Oh, except the characters might not match the map you're expecting
svector has quit [Ping timeout: 256 seconds]
<wildroman>
Mon_Ouie: why so?
alexju has quit [Ping timeout: 272 seconds]
<Mon_Ouie>
Depends if you use a = 0 or a = 10
danshultz has joined #ruby
relix has joined #ruby
<wildroman>
Hmm... I was expecting it to just encode 5 bits at a time of whatever binary value I throw at it
alexju_ has quit [Remote host closed the connection]
<wildroman>
so as long as I stay with ints I know what binary values are out there, once I go to chars I guess you are right. So now I am even more perplexed as to why Base32::encode does not accept binaries.
alexju has joined #ruby
lessless has joined #ruby
<Mon_Ouie>
I don't know what you mean by "binaries"
danshultz has quit [Ping timeout: 256 seconds]
Zolo has quit [Remote host closed the connection]
<wildroman>
"binary integer"
<wildroman>
0b01011
<wildroman>
for example
Zolo has joined #ruby
<Mon_Ouie>
Don't confuse an integer with one of its representation
athst has quit [Quit: athst]
<Mon_Ouie>
0b01011 or 9 (if I can count :p) are the same thing
<kraljev2>
No, no success
<kraljev2>
neither pry-stack-explorer doesn't show the functions
<Mon_Ouie>
11* (of course I can't)
<kraljev2>
Why cant the f*** exception show where the function is, please?
<kraljev2>
even php does that.
patjoh has joined #ruby
<Mon_Ouie>
kraljev2: You're yet to show a code that allows to reproduce your error
<kraljev2>
i cannot, unless I upload 50KB code somewhere
<kraljev2>
apparently it is not simply reproducible
alexju has quit [Ping timeout: 272 seconds]
<kraljev2>
ArgumentError should show the function on call trace
<Mon_Ouie>
It does
allsystemsarego has joined #ruby
allsystemsarego has quit [Changing host]
allsystemsarego has joined #ruby
<kraljev2>
only the function call
<kraljev2>
not the location of the function called
<wildroman>
Mon_Ouie: so assuming I have 0b01011 (which I assume you meant to say is not the same as 9), how do I got about base32 encoding it (efficiently, without encoding "0b01011")
<Mon_Ouie>
wildroman: I meant to say "It is *exactly* the same thing as 11"
<kraljev2>
>> def a; end; a(10)
<eval-in>
kraljev2 => wrong number of arguments (1 for 0) (ArgumentError) ... (https://eval.in/55947)
Zolo has quit [Ping timeout: 245 seconds]
<wildroman>
Mon_Ouie: so why not confuse them? I have a 1 in the database which I want to encode into base32, encoding "1" is not a correct solution. Stuck.
<Mon_Ouie>
You can get the least significant digit of a number N in base M with N % M, the rest is M / N, repeat until you get to 0
mayorga has joined #ruby
_dma has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
lsmola has quit [Ping timeout: 256 seconds]
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
roolebo has quit [Ping timeout: 265 seconds]
orien has quit [Quit: Computer has gone to sleep.]
Al_ has quit [Quit: Al_]
jbpros has joined #ruby
timonv has quit [Ping timeout: 272 seconds]
T__T has joined #ruby
frustrum has quit [Ping timeout: 240 seconds]
Guest32345 has quit [Remote host closed the connection]
patjoh has quit [Quit: Computer has gone to sleep.]
<shevy>
right now I am still trying to understand what your code tries ;)
astrobunny has quit [Ping timeout: 272 seconds]
jbpros has quit [Quit: jbpros]
<shevy>
hmm csffsc
<shevy>
the code is not easy to understand for me
<csffsc>
sure, what It's doing is, taking a list of numbers [7, 7, 7, 10 , 11] and from that set trying to find the optimal combination of cards for blackjack
<shevy>
Hash[hand.combination(groupsize).map { |cards| [cards, cards.inject(:+)] }.keep_if { |_, sum| sum < 22 }.sort_by { |_, v| v }.reverse]
<shevy>
end
<csffsc>
yeah, it's a bit... all in one
<shevy>
ok, so sample input is something like an array: [7, 7, 7, 10, 11]
<shevy>
now I need to lookup how blackjack is played... time for some googling ... :P
mrsolo_ has joined #ruby
<csffsc>
so, if you see the hand = ARGV command
<csffsc>
you can comment that out, and then uncomment the line below it
<csffsc>
makes it a bit faster to work with
greenrose1 is now known as greenrose
claymore has quit [Ping timeout: 240 seconds]
korisnik has quit [Ping timeout: 272 seconds]
astrobunny has joined #ruby
<csffsc>
shevy: I have the orginal problem that I'm working thru, if you'd like to see that as well
Mattias has quit [Ping timeout: 272 seconds]
nouitfvf has quit []
Mattias has joined #ruby
wallerdev has quit [Quit: wallerdev]
tobyo has joined #ruby
skaflem has joined #ruby
coderhs has quit [Ping timeout: 272 seconds]
nisstyre has joined #ruby
mixel has quit [Quit: mixel]
qinix has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Remote host closed the connection]
srji has quit [Quit: leaving]
bradhe has joined #ruby
wesside has quit [Quit: I think I heard an ice cream truck..]
dzhulk has quit [Quit: Leaving.]
mary5030 has joined #ruby
kazuuu has quit [Remote host closed the connection]
kazuuu has joined #ruby
boxmein_ has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
boxmein_ is now known as boxmein
mary5030 has quit [Remote host closed the connection]
patjoh has quit [Quit: Computer has gone to sleep.]
Mon_Ouie has quit [Ping timeout: 272 seconds]
io_syl has joined #ruby
io_syl has quit [Client Quit]
leonidlm has joined #ruby
Vivekananda has quit [Read error: Connection reset by peer]
kazuuu has quit [Ping timeout: 265 seconds]
zarubin has quit [Ping timeout: 272 seconds]
astrobunny has quit [Ping timeout: 245 seconds]
jbpros has joined #ruby
lyanchih has quit [Quit: lyanchih]
sniffingcats has joined #ruby
coderhs has joined #ruby
RubyRonin has quit [Quit: ChatZilla 0.9.90.1 [Firefox 18.0.2/20130201065344]]
<csffsc>
so I have a key of 2, with a value which is a new hash. Keys = Card + Card, Values = Sum
rotor has quit [Ping timeout: 248 seconds]
Imaginativeone has quit [Quit: Imaginativeone]
rahulkmr has quit [Ping timeout: 272 seconds]
roolebo has joined #ruby
choobie has joined #ruby
burlyscudd has quit [Quit: Leaving.]
choobie has left #ruby [#ruby]
Wasp has quit [Remote host closed the connection]
|PiP| has quit [Ping timeout: 248 seconds]
rotor has joined #ruby
burlyscudd has joined #ruby
bradhe has joined #ruby
v0n has quit [Ping timeout: 245 seconds]
kazuuu has quit [Remote host closed the connection]
boxmein has quit [Read error: Connection reset by peer]
boxmein has joined #ruby
boxmein has quit [Max SendQ exceeded]
<csffsc>
canton7: did I lose you?
clocKwize has joined #ruby
boxmein has joined #ruby
<canton7>
sorry, IRC is normally minimsed unless I get pinged
<canton7>
*minimised
<csffsc>
canton7: no problem.. I have the same issue (unless someone hits my name)
bradhe has quit [Ping timeout: 248 seconds]
<canton7>
yeah, I know what your data structure looks like - I had a peek. And that's what I'm saying: you're calling #max ona hash of e.g. {[8, 8]=>16, [7, 8]=>15, [7, 7]=>14, [8, 5]=>13, [7, 5]=>12}, and I'm pretty sure it won't do what you're expecting it to
<csffsc>
Orginally the 'key' was the sum
<canton7>
try calling #max_by{ |k,v| v } maybe
<canton7>
make it clear that you want the element with the maximum key
<canton7>
sorry, value
forcefsck has quit [Quit: Ex-Chat]
<csffsc>
however the enum wasn't generating the combinations properly, and someone suggested the current route
<csffsc>
which then created the proper cards, but a wonky hash format
<canton7>
...which is all fine, but even with the hash the other way around, you'd still be calling #max on a hash, and it still wouldn't do what you expect
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
beilabs has quit [Ping timeout: 240 seconds]
maroloccio has joined #ruby
Flashmasterson has joined #ruby
Kabaka has joined #ruby
<Flashmasterson>
whenever i close iTerm 2, it disappears from my bottom bar - how do i prevent this?
saarinen has joined #ruby
krz has quit [Quit: krz]
kaspergrubbe has quit [Remote host closed the connection]
krz has joined #ruby
kaspergrubbe has joined #ruby
osvico has quit [Ping timeout: 265 seconds]
<canton7>
csffsc, tbh I'd break it up a bit. make that chained mess several lines
<canton7>
Flashmasterson, mac? can't you right-click and pin to dock, or so?
Guest35176 has joined #ruby
<csffsc>
canton7: i'm looking thru my code and experimenting with it..
ChronocityLC has quit [Ping timeout: 272 seconds]
nism-pi has quit [Ping timeout: 272 seconds]
timonv has quit [Remote host closed the connection]
w3pm has joined #ruby
<csffsc>
the thing is the top level hash is created & sorted by pairs, triples, quadruples, etc.. then inside each hash (pairs) for ex, the |k v| are sorted from largest value to smallest
claymore has joined #ruby
timonv has joined #ruby
<csffsc>
which, based on the generate function, is something that can be relied upon
<Flashmasterson>
canton7: yeah 10.8, i pin it as you said, but when i close it it disappears. then i have to pin it again
<canton7>
Flashmasterson, fair enough. I'm not a mac user I'm afraid
<canton7>
csffsc, I suspect it's picking the element with the highest value somewhere in it
<canton7>
so in your case, the first element has 11 in it, hence it gets chosen
<canton7>
but you'll have to see the docs for Enumerable#max
varfoo has quit [Quit: WeeChat 0.4.0]
t_p has quit [Quit: Computer has gone to sleep.]
nism-pi has joined #ruby
saarinen has quit [Ping timeout: 245 seconds]
<csffsc>
max: Returns the object in enum with the maximum value. The first form assumes all objects implement Comparable; the second uses the block to return a <=> b.
patjoh has joined #ruby
osvico has joined #ruby
ChronocityLC has joined #ruby
timonv has quit [Ping timeout: 272 seconds]
pwh has quit []
nism-pi has quit [Ping timeout: 248 seconds]
timonv has joined #ruby
beilabs has joined #ruby
deens has quit [Remote host closed the connection]
<canton7>
csffsc, so, see how an array of [2, 3] compares to the int 1, for example
kofno has joined #ruby
<csffsc>
canton7: yeah I noticed the discrepancy from your first example (not saying that the form is correct), however in this case the hash can be relied upon to be sorted from highest value to lowest value
<csffsc>
and the key are two numbers that when summed are equal to the key
<csffsc>
so for this, [2, 3] => 5
<canton7>
csffsc, I'm wondering if you're completely missing the point I'm making. Is your problem still that reduce() is picking the wrong set of numbers?
<csffsc>
yes
<csffsc>
I might be
<csffsc>
:/
nari has quit [Ping timeout: 248 seconds]
<canton7>
I'm telling you exactly why it's failing
<Flashmasterson>
ok sweet but i still don't know why i get "Nothing known about String#upcase" when i enter "$ ri String#upcase"
<Flashmasterson>
without quotes
bradhe has quit [Ping timeout: 240 seconds]
<Flashmasterson>
black says i should get something different, but he's using 1.9.1 - a version i'm told is very unstable
<MrZYX>
because your ruby installation does not have local docs
Xeago_ has joined #ruby
<MrZYX>
how you can obtain them is highly dependent on how you installed ruby, so there's no general answer to fix that issue
<Flashmasterson>
:(
<MrZYX>
also I recommend you to use ruby 2.0.0, there's little sense in learning an outdated version and the differences between 1.9 and 2.0 aren't big anyway
<Flashmasterson>
i agree but i just paid for that book
<csffsc_>
Flashmasterson: which version was the book for?
<Flashmasterson>
"Covers 1.9.1"
Volsus has joined #ruby
<MrZYX>
as said the differences aren't that big, I wouldn't expect you hit any while learning the basics
<csffsc_>
agreed
<MrZYX>
yet if you do, it's better to hit them now than to have relearn later
nism-pi has quit [Remote host closed the connection]
Trudko has joined #ruby
Tamae has quit [Ping timeout: 272 seconds]
danshultz has quit [Ping timeout: 265 seconds]
jrhe has joined #ruby
T__T has quit [Remote host closed the connection]
<Trudko>
guys I have object with three attributes points_one, points_two, points_three and I would like to define method which returns how many of the are not null. What is best way how to implement this?
<Flashmasterson>
MrZYX: right, i've already hit a few like require "loadee"
athst_ has joined #ruby
<Flashmasterson>
MrZYX: which is apparently now require './loadee'
<Mon_Ouie>
Trudko: I'd just use Array#count
kazuuu has joined #ruby
<Flashmasterson>
MrZYX: the relearning ideas you mentioned really bothers me. i'll call manning publishing tomorrow and try to get a free update or something
<MrZYX>
Flashmasterson: nope, now it's require_relative 'loadee' in simple projects and manually setting up the load path in larger ones
workmad3 has quit [Ping timeout: 272 seconds]
Kabaka has quit [Ping timeout: 240 seconds]
kaspergrubbe has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
<Trudko>
Mon_Ouie: how would you use it ?
<Flashmasterson>
MrZYX: jesus christ technology moves fast
Davey has joined #ruby
<MrZYX>
require './loaddee' still works, it's just bad practice
<Mon_Ouie>
[points_one, points_two, points_three].count { |x| x }
sparq_ has joined #ruby
sparq_ has quit [Read error: Connection reset by peer]
larissa has joined #ruby
<MrZYX>
Flashmasterson: and that's the case since Ruby 1.9.2 (iirc that's the one which removed the current directory from the load path)
Kabaka has joined #ruby
<Mon_Ouie>
Not to mention current directory vs. directory that contains your files
<Mon_Ouie>
When using ., you have to cd in your project directory to be able to run it
athst_ has quit [Quit: athst_]
<banisterfiend>
Mon_Ouie you want an 'id' function
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<Mon_Ouie>
I imagined calling it "self"
rahulkmr has joined #ruby
<Mon_Ouie>
So I could do .count(&:self)
<Flashmasterson>
ok so what is an ri command that will work
kaspergrubbe has quit [Ping timeout: 256 seconds]
newbiehacker has quit [Ping timeout: 256 seconds]
deens has joined #ruby
<Trudko>
Mon_Ouie: ou ofc thank you!
amacgregor has quit [Read error: Connection reset by peer]
<MrZYX>
Flashmasterson: I can only reiterate it again: You need to have local docs for ri to work, how you can obtain them depends on the way you got ruby installed
rahulkmr1 has quit [Ping timeout: 256 seconds]
<Flashmasterson>
MrZYX: ok, i installed ruby through rvm
mklappstuhl has quit [Remote host closed the connection]
Vivekananda has joined #ruby
_5kg has joined #ruby
noop has joined #ruby
vipjun has joined #ruby
Jun_ has joined #ruby
vipjun has quit [Remote host closed the connection]
Jun_ has quit [Remote host closed the connection]
vipjun has joined #ruby
flops has joined #ruby
Tamae has joined #ruby
astrobunny has joined #ruby
Xeago_ has quit [Remote host closed the connection]
sniffingcats has quit [Quit: Til rivido Idisti!]
<Flashmasterson>
MrZYX: ok i went through the process of that page and i still get the same result for $ ri String#upcase
Jun_ has joined #ruby
<MrZYX>
did you make sure to have activated your ruby with rvm use before running either command?
Jun_ has quit [Remote host closed the connection]
bricker`away has quit [Ping timeout: 272 seconds]
<Flashmasterson>
MrZYX: i'm not sure, i know rvm works and is active
<Flashmasterson>
MrZYX: keep in mind that i'm very new to this language
<MrZYX>
well, I can say is that it worked for me back when I used rvm
<banisterfiend>
Mon_Ouie maybe if tap also worked without a block
renderful has quit [Remote host closed the connection]
vipjun has quit [Quit: Leaving]
vipjun has joined #ruby
samsonasu has joined #ruby
jibi has quit [Quit: .]
jonathanwallace has quit [Ping timeout: 248 seconds]
fuhgeddaboudit has quit [Ping timeout: 272 seconds]
atmosx has joined #ruby
<Flashmasterson>
MrZYX: shoot. black mentions that it's not a big deal to learn right now, but i'd still like to take something useful away from it - will it be a big deal down the line?
frustrum has joined #ruby
vipjun has quit [Client Quit]
vipjun has joined #ruby
bricker`away has joined #ruby
Hobogrammer has quit [Ping timeout: 245 seconds]
jibi has joined #ruby
Zolo has joined #ruby
<MrZYX>
I'd call it a personal workflow thing, the way you prefer to consume documentation. Some prefer ri, some pry(-doc), some the local rdoc documentation, some ruby-doc.org, some rubydoc.info and I'm sure there are more methods I'm not aware of
<MrZYX>
and of course all combinations are valid too
<ghargoil>
Hi all, I'm a noob at Ruby, and I think I' missing something really obvious
<ghargoil>
but I've declared a module Xyz in the file xyz.rb
<ghargoil>
and I want to load it from abc.rb ?
<ghargoil>
and require "xyz" doesnt seem to work
<Flashmasterson>
MrZYX: alright thanks for the answer
<MrZYX>
ghargoil: make sure your loadpath contains the directory which holds xyz.rb or if that's too much trouble in your learning process right now, have a look at require_relative
<ghargoil>
ahh
<ghargoil>
lemme try that
decoponio has quit [Quit: Leaving...]
dhamidi has quit [Ping timeout: 272 seconds]
bradhe has joined #ruby
<ghargoil>
woohooo!! thanks MrZYX
<MrZYX>
just keep in mind that setting up the right $LOAD_PATH for your project is considered the "proper" way
<ghargoil>
hrmm, how do I do that?
<MrZYX>
$LOAD_PATH is simply an array of paths you can modify
<ghargoil>
would I do something like
dzhulk has quit [Quit: Leaving.]
<ghargoil>
$LOAD_PATH << './' ?
<MrZYX>
yeah or .unshift to prepend something. Just don't use '.' since that's a source of trouble
<MrZYX>
use an absolute path
Hobogrammer has joined #ruby
ewnd9 has quit [Read error: Operation timed out]
renderful has joined #ruby
noop has quit [Ping timeout: 256 seconds]
jibi has quit [Read error: Operation timed out]
timonv has joined #ruby
bradhe has quit [Ping timeout: 272 seconds]
<havenwood>
if it is Ruby 2.0+ only, you can: $LOAD_PATH << __dir__
Steve009 has joined #ruby
x1337807x has joined #ruby
jibi has joined #ruby
amacgregor has joined #ruby
<havenwood>
for same result as more verbose: $LOAD_PATH << File.dirname(File.realpath(__FILE__))
<Flashmasterson>
who has the 'ruport' gem?
<MrZYX>
you can find that out by going to http://rubygems.org/ and searching for it
<chobbit>
Is there a way I can add a def to a Hash so I can call it like this_is_a_hash[dynamic_command_name]()
<havenwood>
chobbit: never trailing parens in Ruby! (well, almost never)
<MrZYX>
chobbit: not exactly like that, what would be the use? Storing methods in a hash?
<chobbit>
MrZYX: I want to do a dynamic command system for an IRC bot
<micho>
chobbit: so, for what libraries should I look for to get that info I need?
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<chobbit>
I don't know.
<Flashmasterson>
havenwood: ok. i just updated gems last night. is all of that really required to get the 'ruport' gem?
jhaals has joined #ruby
<havenwood>
micho: Grab the page with HTTPClient or Mechanize or whatever, then parse the HTML with Nokogiri and check if the "party is over" using xpath: //*[@id=":sk.yb"]/div[3]/div[1]/div/div[2]
mayorga has quit [Read error: Connection reset by peer]
jhaals has quit [Client Quit]
<MrZYX>
micho: maybe mechanize can do what you want, as last resort you can drive a real browser with something like capybara
x1337807x has joined #ruby
<havenwood>
micho: You can look at the page in a browser like Chrome, and copy the xpath of the node you're looking for.
<micho>
thanks guys, I'll check it out
<chobbit>
So I just do that, MrZYX ?
newbiehacker has joined #ruby
<chobbit>
Is there anything I need to do in Bot.rb to register the plugin, MrZYX ?
<micho>
havenwood: it would take a lot of time, wouldn't it?
<havenwood>
micho: maybe to get used to mechanize and nokogiri, but once you're familiar a quick task
<MrZYX>
chobbit: yup, have a look at the plugins readme
<Xeago>
other than that, great reference - thanks!
timonv has quit [Remote host closed the connection]
rahulkmr has quit [Ping timeout: 272 seconds]
vlad_starkov has quit [Remote host closed the connection]
R3dy has quit [Quit: Lost terminal]
timonv has joined #ruby
gyre007 has joined #ruby
Banistergalaxy has joined #ruby
Steve009 has quit [Quit: Steve009]
gyre007 has quit [Remote host closed the connection]
jonathanwallace has quit [Ping timeout: 248 seconds]
Skylab has joined #ruby
newbiehacker has quit [Ping timeout: 248 seconds]
verazabeida has joined #ruby
danshultz has joined #ruby
timonv has quit [Ping timeout: 272 seconds]
bluenemo has quit [Remote host closed the connection]
astrobunny has quit [Ping timeout: 272 seconds]
krz has quit [Quit: krz]
allsystemsarego has quit [Quit: Leaving]
krz has joined #ruby
swordsmanz has quit [Read error: Operation timed out]
krz has quit [Client Quit]
danshultz has quit [Ping timeout: 272 seconds]
BizarreCake has quit [Ping timeout: 245 seconds]
renderful has joined #ruby
astrobunny has joined #ruby
bradhe has joined #ruby
kaspergrubbe has joined #ruby
workmad3 has joined #ruby
ghargoil has quit [Remote host closed the connection]
rahulkmr1 has quit [Ping timeout: 240 seconds]
workmad3 has quit [Client Quit]
workmad3 has joined #ruby
vlad_starkov has joined #ruby
ehc has joined #ruby
timonv has joined #ruby
samsonasu has quit [Quit: samsonasu]
ChronocityLC has quit [Ping timeout: 240 seconds]
<Flashmasterson>
havenwood: is it a problem that i have macports or fink installed?
bigmac has joined #ruby
bigmac is now known as i8igmac
osvico has quit [Ping timeout: 248 seconds]
<havenwood>
Flashmasterson: Either is a fine alternative as a package manager. But not the path of least resistance as everything will presume brew.
jalcine is now known as jalcine_
<havenwood>
Flashmasterson: If you install `brew` and `brew doctor` i think it'll whine about MacPorts, ymmv
<Flashmasterson>
havenwood: ymmv?
<MrZYX>
he's on RVM. Flashmasterson check the rvm rubygems
<MrZYX>
command
<havenwood>
Flashmasterson: your mileage may vary
newbiehacker has joined #ruby
<i8igmac>
ruby script.rb abc"123" ------> abc123
<havenwood>
Does RVM work with Fink or MacPorts? I think it might?
<havenwood>
rvm requirements
<i8igmac>
how can i use quotes with my ARGV
<Flashmasterson>
ok. i'm just waiting for brew install openssl-osx-ca to finish
Valicek1 has joined #ruby
<havenwood>
Flashmasterson: I'd suggest just going with `brew`. (Unless you're in the vast minority of people who actually use OS X as a multi-user system.)
jalcine_ is now known as jalcine
<havenwood>
MrZYX: Good point, there is an RVM-specific solution to this too i think i saw just the other day.
<havenwood>
rvm pkg install somthing?
<Flashmasterson>
ok i'm not sure im in that minority
<Flashmasterson>
i just want to go the healthiest route
rippa has joined #ruby
<Flashmasterson>
i'm very new
<workmad3>
Flashmasterson: rvm osx-ssl-certs update all
Ahti333 has joined #ruby
<havenwood>
workmad3: that was it! :)
<workmad3>
(which seems to work better with rvm installed rubies than the openssl-osx-ca package does, going by previous help I've given)
Seus has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
<workmad3>
havenwood: and iterm2 rather than terminal.app ;)
<havenwood>
workmad3: mm, i ditched oh-my-zsh after getting annoyed with its poor quality
<havenwood>
workmad3: but stole my prompt from it
<havenwood>
workmad3: <3 zsh
rippa has quit [Ping timeout: 248 seconds]
<havenwood>
workmad3: ahh, well there we part - i'm with Terminal.app
<workmad3>
havenwood: do you use tmux then?
alx- has quit [Quit: Leaving...]
<havenwood>
workmad3: nope, poked around with it but basically use key commands for window positions and tabs
<workmad3>
havenwood: the main reason I use iterm2 is because I then get sane keyboard shortcuts for changing windows and panels :)
<Flashmasterson>
havenwood: as opposed to iTerm 2?
<havenwood>
workmad3: would like to use it more for terminal sharing, but have no interest in splitting my console screen - prefer to just have multiples of em
xk_id has quit [Quit:
theRoUS has joined #ruby
rahulkmr has joined #ruby
<workmad3>
havenwood: yeah, I've only just started playing with a split screen rather than just tabs
rahulkmr has quit [Max SendQ exceeded]
<havenwood>
workmad3: is use a combo of built-in Terminal.app keys and Spectacles i think it is called for windows poitioning and resizing by key command
<havenwood>
i use for all my windows, not just Terminal
<workmad3>
havenwood: and would have switched back if there hadn't been a cmd-shift-return shortcut to make the current panel full
rahulkmr has joined #ruby
<havenwood>
option-cmd arrow key for me puts a window to that half the screen
<havenwood>
ctrl-cmd for top left or top right and shift-ctrl-cmd arrow for bottom left or right
<havenwood>
long as i have a key command you know to move windows i'm happy
<havenwood>
i know**
<workmad3>
yeah, that's pretty much it for me too
<havenwood>
I like the Mavericks Terminal.app well enough. I'll check out iTerm3 or whatever but just haven't found that compelling feature yet.
timonv has quit [Remote host closed the connection]
<workmad3>
Flashmasterson: nope
<workmad3>
Flashmasterson: it's from ri, the gem installed fine just some warnings generating docs
timonv has joined #ruby
<havenwood>
Flashmasterson: You can skip ri doc installation altogether, many devs do.
<workmad3>
Flashmasterson: a lot of people just turn off ri and rdoc generation in their .gemrc :)
<havenwood>
Flashmasterson: Add this line to ~/.gemrc: gem: --no-rdoc
sdouglas has joined #ruby
<havenwood>
Flashmasterson: if you wish to join the ranks of the ri-less
<workmad3>
havenwood: --no-rdoc --no-ri
<havenwood>
workmad3: modern RubyGems no need for --no-rdoc
<Flashmasterson>
havenwood: ok and how does that benefit me as a very new learner?
<workmad3>
havenwood: ah, it takes both from just one? :)
<havenwood>
Flashmasterson: Your gems install faster and you don't have ri documentation installed.
<havenwood>
workmad3: I think just doesn't generate rdoc anymore by default.
eka has joined #ruby
<havenwood>
Many have asked for ri off by default too.
<workmad3>
Flashmasterson: chances are any docs you look at, you'll do online
<havenwood>
That Issue ticket is crazy long if I recall.
kaspergrubbe has quit [Remote host closed the connection]
NinjaPenguin has quit [Ping timeout: 272 seconds]
<dobry-den>
i've never looked up local ri documentation
<workmad3>
Flashmasterson: if you really need them locally, you can generate on-demand and launch a gem documentation server at that point
kaspergrubbe has joined #ruby
<dobry-den>
maybe if i knew i was going off grid for a while
<Flashmasterson>
workmad3: ok and that command is what?
<workmad3>
Flashmasterson: err... one that I google on every single one of the maybe 2 times I've used it?
timonv has quit [Ping timeout: 240 seconds]
<workmad3>
Flashmasterson: it's also probably in the gem help :)
T__T has quit [Remote host closed the connection]
<Flashmasterson>
ok… black doesn't say to do that in his book so i'll hold off for now
Lewix has joined #ruby
<havenwood>
Flashmasterson: `gem help server` or `yard help server` or whatev
<havenwood>
rdoc and yard are the big two for that type of documentation
atmosx has quit [Quit: Lost in trance]
Xeago has quit [Read error: Connection reset by peer]
kaspergrubbe has quit [Ping timeout: 240 seconds]
einarj has joined #ruby
scottstamp has joined #ruby
Xeago has joined #ruby
samsonasu has joined #ruby
jrhe has quit [Quit: jrhe]
<Flashmasterson>
havenwood: ok i'll try to keep it in mind
<havenwood>
Flashmasterson: Or don't. :P Most anything else is more important and Google sure works well! :)
renderful has quit [Remote host closed the connection]
<havenwood>
i almost never use yard or rdoc
justsee has joined #ruby
<workmad3>
documentation? isn't that just another term for 'source code'? :)
<Morrolan>
Only when the devs are silly enough not to document their code. ;)
coderhs has quit [Ping timeout: 272 seconds]
renderful has joined #ruby
renderfu_ has joined #ruby
<Flashmasterson>
havenwood: cool thanks
TorpedoSkyline_ is now known as TorpedoSkyline
burlyscudd has quit [Ping timeout: 248 seconds]
TorpedoSkyline has quit [Changing host]
TorpedoSkyline has joined #ruby
zz_tsykoduk is now known as tsykoduk
renderful has quit [Remote host closed the connection]
Imaginativeone has joined #ruby
robustus has quit [Ping timeout: 245 seconds]
fgo has joined #ruby
ravster has left #ruby [#ruby]
robustus has joined #ruby
dorei has joined #ruby
rahulkmr has quit [Ping timeout: 272 seconds]
<Flashmasterson>
what are some key things involved in creating a web app that contains audio files - for uploading and downloading. a website like soundcloud for example
<Flashmasterson>
?
<csffsc_>
carrierwave is one
<csffsc_>
allows you to upload stuff to amazon s3
<workmad3>
Flashmasterson: storage space
<csffsc_>
and retrieve
jibi has quit [Remote host closed the connection]
<workmad3>
Flashmasterson: with soundcloud, there's also a certain amount of analysis, I believe, in order to generate the visualisations
alx- has joined #ruby
jonathanwallace has joined #ruby
s3itz has joined #ruby
<Flashmasterson>
workmad3: ahh you mean how the tracks display a hz range?
<Flashmasterson>
for your mention of visualizations
zarul has joined #ruby
<workmad3>
Flashmasterson: yeah
<shevy>
havenwood how do you document your projects?
zarul has quit [Changing host]
zarul has joined #ruby
Hanmac1 has joined #ruby
<Hanmac1>
shevy you still there?
<Flashmasterson>
workmad3: cool, and that is something i can find in black's book or is that a ror discussion?
Hanmac1 is now known as Hanmac
<havenwood>
shevy: I honestly think it best to let code and tests speak for themselves. Sometimes I document, depends if my project or i'm in Rome.
<shevy>
Hanmac1 kinda... trying to get an USB printer to work... on linux ... :\ :/ :ß
<workmad3>
Flashmasterson: I'm not sure what 'blacks' book is
<shevy>
Hanmac hehe
<csffsc_>
Hanmac: yeah i saw that on HN yesterday
<shevy>
havenwood that reminds me of Hanmac :D
<Flashmasterson>
workmad3: my bad, the well-grounded rubyist
<workmad3>
Flashmasterson: and it's not something that will be a general discussion point... you'd be trawling through and connecting the dots between several fairly separate areas :)
<workmad3>
Flashmasterson: ah, TWGR... no, I kinda doubt that will cover the finer points of either audio analysis or sensible ways to handle large HTTP uploads :)
niklasb has joined #ruby
bobsapto has joined #ruby
jibi has joined #ruby
<workmad3>
Flashmasterson: not to mention that you're likely looking at javascript and HTML5 canvas elements to handle the visualisation itself
<havenwood>
Hanmac: wow, that's better than my name as a Captain (last name is Skipper, so Captain Skipper or aye aye Skipper Skipper).. sheesh
sniffingcats has joined #ruby
<havenwood>
Hanmac: Hope his middle name is T.
bobsapto has left #ruby [#ruby]
yacks has quit [Quit: Leaving]
<Hanmac>
yeah that would be 20% more awesome
xk_id has joined #ruby
<Flashmasterson>
workmad3: ok point taken. then is going through twgr with a fine toothed comb for that purpose a slight waste of time? i want to learn the language, but developing this website idea is the point of everything i'm doing
<Hanmac>
havenwood: but i prefer picard over Kirk ... but Janeway has more "balls" than all other captains combined
newbiehacker has quit [Ping timeout: 240 seconds]
<samfisher>
can I use ruby to parse a website and collect some data I need?
habstinat has quit [Quit: WeeChat 0.3.8]
pirelenito has quit [Ping timeout: 272 seconds]
<samfisher>
correction, can I "uncomplicately" use ruby for that
<havenwood>
samfisher: Mechanize is a nice gem for that purpose.
jonathanwallace has quit [Ping timeout: 248 seconds]
kaspergrubbe has joined #ruby
<havenwood>
Hanmac: I'd like to serve under Picard. Indeed Janeway is no pushover.
ehc has quit [Quit: ehc]
* havenwood
goes back to rapping Ode to Spot.
<samfisher>
havenwood: thank you
<Hanmac>
i mean the other captains are only trying to avoid or fight the arch-enemy ... janeway is the only one "crazy" enough to "Hunt" Borg oO ;D
Soda has joined #ruby
coderhs has joined #ruby
yacks has joined #ruby
Imaginativeone has quit [Quit: Imaginativeone]
MrV has joined #ruby
fgo has quit [Remote host closed the connection]
gyre007 has joined #ruby
Steve009 has joined #ruby
havenwood has quit [Remote host closed the connection]
fgo has joined #ruby
jb41 has joined #ruby
newbiehacker has joined #ruby
ehc has joined #ruby
fgo has quit [Remote host closed the connection]
Giorgio has joined #ruby
<Freeaqingme>
Just discovered that the Resolve::DNS class doesn't support mdns (yet). How can I have Ruby resolve hostnames through Avahi?
<Flashmasterson>
is 'obj' still a valid command in 2.0?
<Hanmac>
Flashmasterson: you mean in a function call? you need to show more of what you want
devoldmx3 has joined #ruby
<Flashmasterson>
ok i want obj = Object.new
<MrZYX>
sure, that's still valid in ruby 2
<AntelopeSalad>
i'm trying to share variables across rake tasks, when i do $foo = [] inside of task #1 and try to read $foo in task #2 it says $foo is nil , what's going on?
<Flashmasterson>
MrZYX: hmm ok but i get command not found when i enter it into ruby
astrobunny has quit [Ping timeout: 240 seconds]
<MrZYX>
command not found?
<Hanmac>
Flashmasterson: then you are not in ruby, you are still in your bash
<MrZYX>
what are you entering exactly, where exactly?
<Morrolan>
Are you sure you are entering it into irb / pry, and not bash/zsh/some other shell? :P
<Flashmasterson>
maybe he means create that as a text file?
<Morrolan>
Well, now this is fine. You created a new object (of class Object), and assigned it to the variable 'obj'.
<Morrolan>
Eh, if it's a beginner's guide, then he probably wants you to use irb. Irb is an interactive Ruby interpreter, which allows you to play around / test things interactively.
<Morrolan>
But sure, you can also enter the code in a text file, and execute it.
sdouglas has quit [Quit: sdouglas]
patjoh has quit [Quit: Computer has gone to sleep.]
Vivekananda has quit [Read error: Connection reset by peer]
Trudko has quit [Ping timeout: 272 seconds]
Trudko_ is now known as Trudko
theRoUS has quit [Ping timeout: 272 seconds]
<Flashmasterson>
Morrolan: *huff* i wish he would have specified.
endash_ has joined #ruby
Zolo has quit [Ping timeout: 245 seconds]
jonathanwallace has joined #ruby
<workmad3>
Flashmasterson: sorry, was distracted with some accountancy stuff, and now being dragged away by my wife :)
<Flashmasterson>
workmad3: life
Volsus has quit [Ping timeout: 265 seconds]
Volsus has joined #ruby
<Flashmasterson>
Morrolan: ok i created it as a text file but with the "new" extention. no dice for what black lists as what the result should be
kazuuu has quit [Remote host closed the connection]
<Morrolan>
Ruby won't care about the file extension. Now you can execute the script through the terminal by typing 'ruby script_name.extension'. However, since your script doesn't do anything besides creating a new object, you won't see any output.
vlad_starkov has quit [Remote host closed the connection]
kazuuu has joined #ruby
<Morrolan>
I can't suggest anything, since I have no clue what this book will tell you to do for the next step, but using irb is probably the way to go.
Banistergalaxy has quit [Read error: Connection reset by peer]
devoldmx has joined #ruby
dash_ has quit [Quit: dash_]
<Flashmasterson>
Morrolan: shoot
jonathanwallace has quit [Ping timeout: 272 seconds]
<ShellFu>
now what I want to do is remove from h1 everything in h2
<ShellFu>
not sure how to compare when the hash is nested and possibly deeper than above.
jrhe has joined #ruby
julweber has quit [Remote host closed the connection]
<Flashmasterson>
i'm still not sure why this command isn't working, keep in mind that i'm completely new to programming obj = Object.new
julweber has joined #ruby
eka has quit [Quit: Computer has gone to sleep.]
Monie has joined #ruby
<Freeaqingme>
I'm trying some examples from this page, but whatever gem I install, I get 'cannot load such file -- net/dns/mdns-resolv'. Does anybody know how to make it actually work?
<atmosx>
run 'sudo gem list' do you see your list of gems as you should?
<atmosx>
Flashmasterson: then, it's RVM ruby
pleal has quit [Ping timeout: 240 seconds]
<atmosx>
Flashmasterson: you're not running system-wide ruby anymore
knigitz has quit []
<Flashmasterson>
ok how do i do that
shevy has joined #ruby
<Flashmasterson>
atmosx: system wide i mean, if that's how that 'obj' command is going to work
<Flashmasterson>
atmosx: i'm just trying to go step-by-step with the well-grounded rubyist
verazabeida has quit [Read error: No route to host]
<atmosx>
Flashmasterson: no wait, now we're talking just about getting your library together (same path as ruby).
DropsOfSerenity has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Imaginativeone has quit [Read error: Operation timed out]
verazabeida has joined #ruby
<atmosx>
Flashmasterson: again, if you are going to use ruby in more than 5 server and you can run the program you're going to run as root, I suggest you dump rvm.
volty has joined #ruby
<atmosx>
Flashmasterson: if not, you need to install rvm on all your servers, which is a safe bet but I have no idea how you can do that automatically.
DropsOfSerenity has joined #ruby
<Flashmasterson>
atmosx: well shit
orionstein_away is now known as orionstein
<atmosx>
Flashmasterson: exactly
<Flashmasterson>
atmosx: are you familiar with that book?
justsee has quit [Ping timeout: 245 seconds]
<atmosx>
I've heard about it, never read it.
<atmosx>
switch to root
<atmosx>
sudo su -
<atmosx>
install the gems you need
<atmosx>
and run them, see what happens
<atmosx>
you should get everything working out of the box
justsee has joined #ruby
s3itz has quit [Read error: Connection reset by peer]
<Flashmasterson>
damn. i don't want to, because black doesn't say so.
Xaitec has joined #ruby
s3itz has joined #ruby
<Flashmasterson>
trying to play it safe with instructions
<atmosx>
I see.
<atmosx>
well it's all about setting up paths correctly actually
<atmosx>
and gems tend to mix up things on linux
Xaitec has quit [Remote host closed the connection]
<atmosx>
it's maintainers fault actually, not ruby's
tsykoduk is now known as zz_tsykoduk
<atmosx>
have to go to bed
<atmosx>
cya later
atmosx has quit [Quit: Lost in trance]
bradhe has joined #ruby
pwh has joined #ruby
kazuuu has joined #ruby
DanKnox_away is now known as DanKnox
devoldmx has quit [Ping timeout: 272 seconds]
marcdel has joined #ruby
wallerdev has quit [Quit: wallerdev]
bradhe has quit [Ping timeout: 272 seconds]
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
Xeago has quit [Remote host closed the connection]
Volsus has quit [Quit: Leaving]
theoretick has joined #ruby
nfk has quit [Quit: yawn]
korisnik has joined #ruby
korisnik has quit [Client Quit]
mojjoujo has joined #ruby
nilved has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
inorganicorc has joined #ruby
ssvo has joined #ruby
kaspergrubbe has joined #ruby
monkegjinni has quit [Remote host closed the connection]
monkegjinni has joined #ruby
jibi has quit [Quit: .]
Flashmasterson has quit [Quit: Leaving.]
mercwithamouth has quit [Ping timeout: 265 seconds]
inorganicorc has left #ruby ["Leaving"]
mklappstuhl has joined #ruby
kaspergrubbe has quit [Read error: Operation timed out]
failshell has joined #ruby
mary5030 has joined #ruby
failshell has quit [Remote host closed the connection]
nateberkopec has joined #ruby
monkegjinni has quit [Ping timeout: 272 seconds]
gmas has joined #ruby
marcdel has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wallerdev has joined #ruby
ewnd9 has joined #ruby
Mitchellvanw has quit [Quit: Quiting like a baws]
sepp2k has quit [Ping timeout: 272 seconds]
astrobunny has quit [Ping timeout: 240 seconds]
pleal has joined #ruby
kirun has quit [Quit: Client exiting]
mixel has quit [Quit: mixel]
g0bl1n_ has joined #ruby
ewnd9 has quit [Ping timeout: 272 seconds]
ce_afk is now known as cescalante
_dma has joined #ruby
bwarkee has joined #ruby
orionstein is now known as orionstein_away
roolebo has quit [Ping timeout: 248 seconds]
Trudko has quit [Read error: Connection reset by peer]
nilved has quit [Read error: Connection reset by peer]
xk_id has quit [Quit:
beilabs has quit [Ping timeout: 248 seconds]
astrobunny has joined #ruby
roolebo has joined #ruby
Ahti333_ has joined #ruby
aspires has quit [Quit: sudo making a sandwich]
randomnick_ has quit [Quit: Leaving]
beilabs has joined #ruby
devoldmx has joined #ruby
sepp2k has joined #ruby
nilved has joined #ruby
boxmein has left #ruby ["[00:12.05] <\m> An into-solid turner"]