<masterasia>
why is the to_date necessary for created_at?
<masterasia>
it is a datetime according to my schema
<masterasia>
but gets instantiated as a activesupport:timewithzone class
pygospa has quit [Quit: leaving]
pygospa has joined #ruby
ramfjord has joined #ruby
ryzokuken has joined #ruby
jinie_ has quit [Ping timeout: 240 seconds]
<Yxhuvud>
please go to #rubyonrails for rails related questions.
ramfjord has quit [Ping timeout: 248 seconds]
dcunit3d has joined #ruby
pootiscoder has quit [Quit: Going offline, see ya! (www.adiirc.com)]
jinie_ has joined #ruby
FahmeF has joined #ruby
moeabdol has joined #ruby
pootiscoder has joined #ruby
impermanence has joined #ruby
pootiscoder has quit [Client Quit]
pootiscoder has joined #ruby
impermanence has quit [Client Quit]
beauby has joined #ruby
lele has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
ta_ has quit [Remote host closed the connection]
lele has joined #ruby
dcunit3d has quit [Ping timeout: 276 seconds]
ramfjord has quit [Ping timeout: 260 seconds]
rivalomega has quit []
mim1k has joined #ruby
lxsameer has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
yabbes has joined #ruby
ramfjord has joined #ruby
pootiscoder has quit [Quit: Going offline, see ya! (www.adiirc.com)]
pootiscoder has joined #ruby
vuoto has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
foooobear has joined #ruby
z0mbee has quit [Remote host closed the connection]
dionysus69 has joined #ruby
beauby has quit [Ping timeout: 260 seconds]
pabs has quit [Ping timeout: 240 seconds]
pabs has joined #ruby
anisha has joined #ruby
foooobear has quit [Read error: Connection reset by peer]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
hanmac has quit [Ping timeout: 255 seconds]
dcunit3d has joined #ruby
opekktar has joined #ruby
high_fiver has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
mjolnird has quit [Read error: Connection reset by peer]
WeiJunLi has joined #ruby
mjolnird has joined #ruby
pygospa has quit [Quit: leaving]
ramfjord has joined #ruby
pygospa has joined #ruby
cagomez has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
cagomez has quit [Ping timeout: 240 seconds]
bb010g_ has quit [Quit: Connection closed for inactivity]
bb010g_ has joined #ruby
bb010g_ has quit [Client Quit]
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
marr123 is now known as marr
ramfjord has joined #ruby
MarkBilk has quit [Ping timeout: 258 seconds]
high_fiver has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 246 seconds]
ryzokuken has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
pootiscoder has quit [Ping timeout: 276 seconds]
Mon_Ouie has quit [Quit: WeeChat 1.9]
WeiJunLi has quit [Ping timeout: 255 seconds]
jackjackdripper has quit [Quit: Leaving.]
conta has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
Tempesta has joined #ruby
BTRE has quit [Quit: Leaving]
cveron has joined #ruby
MarkBilk has joined #ruby
cveron has quit [Quit: Leaving]
cagomez has joined #ruby
Emmanuel_Chanel has joined #ruby
ltem has quit [Quit: Leaving]
BTRE has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
rgr has joined #ruby
vuoto has quit [Remote host closed the connection]
CrazyEddy has quit [Ping timeout: 260 seconds]
beauby has joined #ruby
impermanence has joined #ruby
dcunit3d has quit [Quit: WeeChat 1.4]
impermanence has quit [Client Quit]
__Yiota has joined #ruby
ramfjord has joined #ruby
impermanence has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
impermanence has quit [Client Quit]
_whitelogger has joined #ruby
acalycine has quit [Ping timeout: 276 seconds]
skdjas has joined #ruby
domgetter has joined #ruby
dlitvak has joined #ruby
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
impermanence has joined #ruby
impermanence has quit [Client Quit]
c__ has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
skdjas has quit [Remote host closed the connection]
selim_ has quit [Ping timeout: 240 seconds]
Emmanuel_Chanel has joined #ruby
selim has joined #ruby
impermanence has joined #ruby
marxarelli|afk has quit [Ping timeout: 260 seconds]
impermanence has quit [Client Quit]
alex`` has joined #ruby
mabus44 has joined #ruby
mabus44 has quit [Ping timeout: 260 seconds]
marr has quit [Ping timeout: 260 seconds]
beauby has quit [Ping timeout: 240 seconds]
phinxy has joined #ruby
kahra has quit [Ping timeout: 248 seconds]
kahra has joined #ruby
t-recx has joined #ruby
impermanence has joined #ruby
impermanence has quit [Client Quit]
mim1k has joined #ruby
kahra has quit [Ping timeout: 248 seconds]
cadillac_ has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
cadillac_ has joined #ruby
beauby has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
nowhere_man has joined #ruby
melkor has joined #ruby
<melkor>
I am trying to build ruby2.3.4 and when I run make, it says that prefix is /usr, but I ran ./configure --prefix=/path/to/where/I/want
charliesome has joined #ruby
evie_hammond has joined #ruby
impermanence has joined #ruby
impermanence has quit [Client Quit]
<melkor>
odd, it worked finally. Not sure what I did differently.
moeabdol has quit [Quit: WeeChat 1.9]
kahra has joined #ruby
HoierM has joined #ruby
Guest9443 is now known as alamar
beauby has quit [Ping timeout: 240 seconds]
apparition47 has joined #ruby
glaux has joined #ruby
impermanence has joined #ruby
glaux has left #ruby [#ruby]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
glaux has joined #ruby
impermanence has quit [Client Quit]
glaux has quit [Client Quit]
seybo has joined #ruby
bruno- has quit [Ping timeout: 240 seconds]
moeabdol has joined #ruby
moeabdol has left #ruby [#ruby]
impermanence has joined #ruby
impermanence has quit [Client Quit]
conta has quit [Ping timeout: 248 seconds]
InfinityFye has quit [Ping timeout: 260 seconds]
gr33n7007h has joined #ruby
FahmeF has quit [Remote host closed the connection]
ryzokuken has joined #ruby
andrzejku has joined #ruby
<melkor>
It appears my vps doesn't have enough memory to run ./passenger-install-apache2-module. Is there anything I can do?
impermanence has joined #ruby
impermanence has quit [Client Quit]
bmurt has joined #ruby
bmurt has quit [Client Quit]
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
beauby has joined #ruby
digitalnomad has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
beauby has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
_sfiguser has joined #ruby
segy has joined #ruby
<darix>
melkor: you are sure it can run your app under passenger afterwards?
Guest98725 is now known as rprimus
faraco has joined #ruby
bruno- has joined #ruby
mim1k has joined #ruby
acalycine has quit [Ping timeout: 276 seconds]
bruno- has quit [Read error: Connection reset by peer]
Seenox has quit [Quit: Connection closed for inactivity]
sleepee has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 276 seconds]
bruno- has joined #ruby
<faraco>
Hi guys, I have a good background in Python and fairly small in Perl. I use them both usually for commandline utils/text parsing and simple web development. Let's say I want to scrape web pages and do GUI development, what Ruby offers in terms of gems and what Ruby is generally suited for? I'm not really 'trendy' person, which I use tools only when I need it. I want to give ruby a try and want to get some insights from the ruby devs.
<faraco>
In Python, for web scraping, I got scrapy and beautifulsoup, and for packet processing, I can use scapy. What Ruby offers in this case?
impermanence has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
impermanence has quit [Client Quit]
bruno- has joined #ruby
nowhere_man has quit [Remote host closed the connection]
bruno- has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
mim1k has joined #ruby
duderonomy has joined #ruby
<faraco>
nevermind I guess
sepp2k has joined #ruby
bruno- has joined #ruby
jphase has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
opekktar has quit [Ping timeout: 276 seconds]
<gr33n7007h>
faraco: web scrpaing (nokogiri) packet processing (packetfu) just my two bits
bruno- has quit [Read error: Connection reset by peer]
hutch34 has joined #ruby
<faraco>
thanks, I never knew that gem is in existence. I should look more harder..
bruno- has joined #ruby
avelldiroll has quit [Quit: WeeChat 1.0.1]
sleepee has joined #ruby
jphase has quit [Ping timeout: 246 seconds]
<apeiros>
faraco: mechanize for scraping (builds up on nokogiri)
impermanence has joined #ruby
<faraco>
mechanize? That's cool. I'm familiar with Perl's WWW::Mechanize too. This is great.
<apeiros>
quite likely it's inspired by that
ryzokuken has quit [Remote host closed the connection]
bruno- has quit [Read error: Connection reset by peer]
impermanence has quit [Client Quit]
bruno- has joined #ruby
ryzokuken has joined #ruby
<faraco>
then I just need to learn ruby quite a bit more thoroughly since the libraries I need are available and I don't have to write on by myself. Thank you.
ltem has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
<faraco>
anyway, I believe most ruby devs are on Mac. On linux, what is the 'good' way to get the ruby interpreter and the toolchains setup?
<apeiros>
I use rvm. there's a couple of people advocating other tools. chruby and rbenv iirc are popular options
<faraco>
using package manager on linux doesn't seems great because they need super user access. I had to 'su gem install blah' everytime..
<apeiros>
yeah, all three options I named install ruby and gems in userspace
mim1k has joined #ruby
<apeiros>
no need for root :)
<faraco>
apeiros: thanks so much. :)
<apeiros>
yw
Tempesta has quit [Quit: See ya!]
bruno- has joined #ruby
ta_ has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
bruno- has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
ta_ has quit [Remote host closed the connection]
avelldiroll has joined #ruby
pygospa has quit [Quit: Lost terminal]
faraco has quit [Quit: Leaving]
rgr_ has joined #ruby
mim1k has joined #ruby
rgr has quit [Ping timeout: 258 seconds]
mahlon has quit [Ping timeout: 240 seconds]
bruno- has quit [Read error: Connection reset by peer]
impermanence has joined #ruby
bruno- has joined #ruby
ged has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 260 seconds]
mahlon has joined #ruby
impermanence has quit [Client Quit]
ged has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
avelldiroll has quit [Quit: WeeChat 1.6]
avelldiroll has joined #ruby
noname1 has joined #ruby
ncthom91 has joined #ruby
Bhootrk_ has quit [Read error: Connection reset by peer]
ncthom91 has quit [Max SendQ exceeded]
nopolitica has quit [Ping timeout: 248 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mustaffa__ has quit [Ping timeout: 255 seconds]
melkor has quit [Ping timeout: 260 seconds]
avelldiroll has quit [Quit: WeeChat 1.6]
noname1 has quit [Ping timeout: 240 seconds]
avelldiroll has joined #ruby
acalycine has joined #ruby
mim1k has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
impermanence has joined #ruby
leandrobighetti has joined #ruby
impermanence has quit [Client Quit]
alex`` has joined #ruby
FrankD__ has quit [Ping timeout: 260 seconds]
acalycine has quit [Ping timeout: 248 seconds]
opekktar has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
vad4r has joined #ruby
vad4r has quit [Client Quit]
rgtk has joined #ruby
apparition47 has quit [Quit: Bye]
GodFather has quit [Read error: No route to host]
GodFather has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
KeyJoo has quit [Ping timeout: 240 seconds]
ltem has quit [Quit: Leaving]
avelldiroll has quit [Quit: WeeChat 1.6]
avelldiroll has joined #ruby
bruno- has joined #ruby
deduped has joined #ruby
tom69 has joined #ruby
mim1k has joined #ruby
GodFather has quit [Ping timeout: 276 seconds]
leandrobighetti has quit [Remote host closed the connection]
nunchuck has quit [Ping timeout: 276 seconds]
leandrobighetti has joined #ruby
beauby has joined #ruby
impermanence has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
mustaffa__ has joined #ruby
avelldiroll has quit [Quit: WeeChat 1.6]
avelldiroll has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
impermanence has quit [Client Quit]
beauby has quit [Ping timeout: 246 seconds]
tom69 has quit [Quit: WeeChat 1.9]
mim1k has joined #ruby
tom69 has joined #ruby
romankapitonov has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
digitalnomad has joined #ruby
FahmeF has joined #ruby
bruno- has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 260 seconds]
FahmeF has quit [Client Quit]
bruno- has joined #ruby
bruno- is now known as Guest61815
nopolitica has joined #ruby
icarus has quit [Ping timeout: 260 seconds]
Guest61815 has quit [Read error: Connection reset by peer]
impermanence has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
impermanence has quit [Client Quit]
bruno-_ has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
romankapitonov has joined #ruby
rabajaj has quit [Quit: Leaving]
bruno-_ has quit [Read error: Connection reset by peer]
impermanence has joined #ruby
impermanence has quit [Client Quit]
nadir has quit [Quit: Connection closed for inactivity]
mim1k has joined #ruby
http_GK1wmSU has joined #ruby
vuoto has joined #ruby
http_GK1wmSU has left #ruby [#ruby]
mim1k has quit [Ping timeout: 255 seconds]
Guest76729 has quit [Changing host]
Guest76729 has joined #ruby
Guest76729 has joined #ruby
Guest76729 is now known as pskosinski
vuoto has quit [Quit: Lost terminal]
vuoto has joined #ruby
acalycine has joined #ruby
PaulCapestany has quit [Read error: Connection reset by peer]
hutch34 has joined #ruby
mim1k has joined #ruby
mabus44 has joined #ruby
vuoto has quit [Client Quit]
acalycine has quit [Ping timeout: 240 seconds]
vuoto has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
mabus44 has quit [Ping timeout: 260 seconds]
InfinityFye has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
knight33 has joined #ruby
bruno-_ has joined #ruby
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ryzokuken has quit [Ping timeout: 246 seconds]
jackjackdripper has joined #ruby
romankapitonov has joined #ruby
cdg has joined #ruby
leandrobighetti has quit [Remote host closed the connection]
kies has quit [Ping timeout: 240 seconds]
digitalnomad has joined #ruby
swills has quit [Remote host closed the connection]
romankapitonov has quit [Read error: Connection reset by peer]
bruno-_ has quit [Ping timeout: 260 seconds]
Silthias has quit [Read error: Connection reset by peer]
knight33 has quit [Ping timeout: 246 seconds]
impermanence has joined #ruby
<impermanence>
What is the best way to compare object arrays and remove duplicates based on a shared attribute? I think using group_by(&:attr) and something else?
romankapitonov has joined #ruby
ryzokuken has joined #ruby
swills has joined #ruby
swills has quit [Changing host]
rgtk has quit [Ping timeout: 240 seconds]
ted_ has joined #ruby
AxelAlex has joined #ruby
ted_ has quit [Read error: Connection reset by peer]
phinxy has quit [Ping timeout: 276 seconds]
swills has joined #ruby
swills has joined #ruby
AxelAlex has quit [Quit: AxelAlex]
hutch34 has joined #ruby
leandrobighetti has joined #ruby
AxelAlex has joined #ruby
AxelAlex has quit [Remote host closed the connection]
leandrobighetti has quit [Ping timeout: 276 seconds]
acalycine has joined #ruby
acalycine has quit [Changing host]
acalycine has joined #ruby
runescape07rsps has joined #ruby
acalycine has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby
AxelAlex has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
rvca has joined #ruby
ascarter has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ryzokuken has quit [Remote host closed the connection]
ryzokuken has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
rvca has quit [Ping timeout: 240 seconds]
VladGh has quit [Remote host closed the connection]
VladGh has joined #ruby
Azure has joined #ruby
vuoto has quit [Quit: Lost terminal]
rgtk has joined #ruby
vuoto has joined #ruby
cdg_ has joined #ruby
cdg_ has quit [Remote host closed the connection]
cdg_ has joined #ruby
bruno- has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
romankapitonov has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 260 seconds]
hutch34 has quit [Ping timeout: 255 seconds]
eightlimbed_ has joined #ruby
romankapitonov has joined #ruby
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
leandrobighetti has joined #ruby
mustaffa__ has quit [Ping timeout: 260 seconds]
dviola has joined #ruby
leandrobighetti has quit [Remote host closed the connection]
acalycine has joined #ruby
mim1k has joined #ruby
minimalism has joined #ruby
govg has quit [Ping timeout: 276 seconds]
bruno- has quit [Ping timeout: 240 seconds]
acalycine has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 260 seconds]
vuoto has quit [Remote host closed the connection]
AxelAlex has quit [Quit: AxelAlex]
hutch34 has joined #ruby
vuoto has joined #ruby
rgtk has quit [Ping timeout: 246 seconds]
Sammichmaker has joined #ruby
Sammichmaker has joined #ruby
Sammichmaker has quit [Changing host]
Jonathan_ has joined #ruby
gnoss has quit [Quit: jetsetradio.live]
mustaffa__ has joined #ruby
Jonathan_ has quit [Client Quit]
romankapitonov has quit [Read error: Connection reset by peer]
mustaffa__ has quit [Ping timeout: 240 seconds]
millerti has joined #ruby
jrabe has joined #ruby
goyox86_ has joined #ruby
romankapitonov has joined #ruby
ych has joined #ruby
mim1k has joined #ruby
all_thr9 has joined #ruby
InfinityFye has quit [Quit: Leaving]
all_thr9 has left #ruby [#ruby]
rgtk has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby
mustaffa__ has joined #ruby
workmad3 has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3_ has joined #ruby
mim1k has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
bruno- has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
workmad3_ has quit [Ping timeout: 240 seconds]
nadir has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
meadmoon has joined #ruby
vuoto has quit [Remote host closed the connection]
nobitanobi has joined #ruby
chouhoulis has joined #ruby
yokel has quit [Remote host closed the connection]
<ruby[bot]>
baweaver: # => [#<struct C name="test", category="one">, #<struct C name="foo", category="one">] (https://eval.in/841950)
<baweaver>
Don't use Structs like that, just needed a cheap class to demonstrate
hkdsun has joined #ruby
ecuanaso has joined #ruby
<impermanence>
ah, I see
<baweaver>
So now line 8 is gone, and line 9 becomes: companies.select { |x| x.category == company.category && x != company }.sort_by(&:capital).reverse
<baweaver>
with line breaks preferably
<baweaver>
the delete_if can be combined with the select as the: && x != company
hutch34 has quit [Ping timeout: 255 seconds]
conta has joined #ruby
<impermanence>
yes I see that now, wow
<baweaver>
also throw a uniq on the end if you want.
<baweaver>
that'll prevent dupes
<impermanence>
in other words: ...reverse.uniq ?
kahra has quit [Quit: WeeChat 1.9]
<baweaver>
though it'd be rather odd for there to be duplicates except for the recommending company
<baweaver>
Have you heard of testing yet?
kahra has joined #ruby
eightlimbed_ has quit [Ping timeout: 246 seconds]
<impermanence>
I am familiar with literally just the very basics: minitest, assert_equal, etc.
<baweaver>
You might start using some of it to verify that your code works as expected
<baweaver>
Look into Guard as well which will run them on file changes
<baweaver>
ie: foo.rb changing triggers a run of foo_spec.rb
<impermanence>
I will do that
<baweaver>
Nice to get fast feedback on things
<baweaver>
you can even tie it into mac notifications to get an alert for them
meadmoon has quit [Quit: I am functioning within established parameters.]
workmad3 has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
mim1k has joined #ruby
<impermanence>
I updated my first method with your changes :) much easier to read!
opekktar has quit [Quit: leaving]
mim1k has quit [Ping timeout: 255 seconds]
t-recx has quit [Quit: t-recx]
hanmac has joined #ruby
icarus has joined #ruby
nopolitica has joined #ruby
airdisa_ has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
airdisa has quit [Ping timeout: 258 seconds]
acalycine has joined #ruby
acalycine has joined #ruby
acalycine has quit [Changing host]
<impermanence>
baweaver: any thoughts on my second method?
acalycine has quit [Ping timeout: 246 seconds]
icarus has quit [Ping timeout: 255 seconds]
mim1k has joined #ruby
FahmeF has joined #ruby
cdg has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
cdg_ has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 248 seconds]
mim1k has joined #ruby
runescape07rsps has quit [Quit: Leaving]
mtkd has quit [Ping timeout: 276 seconds]
<impermanence>
baweaver: I feel like this should be close: backed_companies.each_with_index { |val, idx| all_companies.select { |x| val.category == x.category && val != x }.sort_by(&:capital).reverse.uniq }
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
t-recx has joined #ruby
acalycine has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
opekktar has joined #ruby
acalycine has quit [Ping timeout: 240 seconds]
rvca has joined #ruby
acalycine has joined #ruby
kahra_ has joined #ruby
MrBusiness has joined #ruby
ncthom91 has joined #ruby
kahra has quit [Ping timeout: 248 seconds]
sleepee has quit [Ping timeout: 260 seconds]
digitalnomad has joined #ruby
cdg has quit [Remote host closed the connection]
<apeiros>
impermanence: why each_with_index? you don't use the index.
mim1k has quit [Ping timeout: 276 seconds]
<impermanence>
apeiros: I'll show you what I am using now, which is just each b/c you're right :)
<apeiros>
also, each_* returns backed_companies, so the result in your block is thrown away.
<apeiros>
and one thing regarding the performance of your code: you go through all companies once for every backed_company. that's n*m. you could do it in n+m (go through all backed_companies once and go through all companies once)
<apeiros>
say you have 100 backed companies and 10000 companies, that's 1_000_000 times the block invoked vs. 10_100, or a ~100x speed up.
<impermanence>
apeiros: ah...hm. could you show me the code difference? I can not visualize that in code, sorry.
<apeiros>
(though, in the n+m variant, the block for the n iterations will differ from the one for the m iterations, so it's not really possible to compare iterations 1:1)
<apeiros>
works with any properly programmed class (namely it has proper #hash and #eql? methods)
<impermanence>
apeiros: ah, I see...
<impermanence>
apeiros: wait, where is the - backed_companies part? I don't see it in the original part.
<apeiros>
22:53 apeiros: oh, might have to do `result - backed_companies`, since your block seems to throw those out too.
<apeiros>
23:00 apeiros: just (all_companies.select { … } - backed_companies).sort_by(&:capital)
_sfiguser has quit [Quit: Leaving]
<impermanence>
apeiros: tab completing now :) yes, I see it, thank you.
<apeiros>
for reference, #hash and #eql? are normally based on identity. they're used to determine whether two objects should be treated as the same key in a hash.
<impermanence>
apeiros: oh, okay.
<apeiros>
e.g "foo" and "foo" are two different objects, but they're the same hash key.
<impermanence>
apeiros: I must be missing something. above you show: (all_companies.select { … } - backed_companies).sort_by(&:capital)
<impermanence>
apeiros: what are the parentheses around (all_companies ... backed_companies) ?
<apeiros>
just that, parens
<apeiros>
without them, sort_by would only affect backed_companies.
<apeiros>
(a - b).sort # sort the return value of `a - b`
<apeiros>
a - b.sort # sort b, subtract it from a
<apeiros>
a - b.sort # sort b, subtract *the result* from a (small clarification to what I wrote above)
mustaffa__ has quit [Ping timeout: 240 seconds]
<impermanence>
apeiros: where should I begin that parens set at?
<apeiros>
think about what you want to be sorted.
<apeiros>
around that.
ltem has joined #ruby
<apeiros>
you can also just work with assigning intermediate results to variables and split your code to more lines.
<apeiros>
makes probably more sense at your current level of knowledge.
sepp2k1 has joined #ruby
conta has quit [Ping timeout: 240 seconds]
sepp2k has quit [Ping timeout: 246 seconds]
<impermanence>
apeiros: one sec
<apeiros>
I'll be playing soon, so my replies might get more sporadic anyways ;-)
ltem has quit [Client Quit]
kkiero has joined #ruby
ledestin has joined #ruby
<impermanence>
apeiros: I just did your line - backed_companies :)
ledestin has quit [Ping timeout: 240 seconds]
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mustaffa__ has joined #ruby
vuoto has quit [Remote host closed the connection]
nopolitica has joined #ruby
icarus has joined #ruby
Murda has quit [Quit: Murda]
icarus has quit [Client Quit]
mim1k has joined #ruby
kkiero has left #ruby [#ruby]
melkor has joined #ruby
d33pb00k-GK1wmSU has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
d33pb00k-GK1wmSU has left #ruby [#ruby]
mustaffa__ has quit [Ping timeout: 276 seconds]
selim has quit [Ping timeout: 240 seconds]
rvca has quit [Ping timeout: 248 seconds]
selim has joined #ruby
eightlimbed_ has quit [Ping timeout: 246 seconds]
FahmeF has quit [Remote host closed the connection]
<rapha>
without having read that yet ... spawn does return the pid. so all should be fine. except if i want to see the spawned process's stdout i guess
mim1k has joined #ruby
<eam>
you can give spawn a descriptor for stdin/out
<eam>
that'll give you popen-ish behavior
eizua has joined #ruby
<rapha>
i'll stop asking stupid questions now and just try to get it working and maybe come back with better questions
<ssplatt>
I’m trying to use some data from the nfl fantasy football api, so i made a wrapper object and methods. they work in irb but when i call them in my web app i keep getting “undefined method `[]' for nil:NilClass”
<ssplatt>
@nfl.get_players_details(@lineup.qb_id)["players"][0] gives that error. removing the [0] makes it go away, but then i can’t process the data correctly because it’s a hash in a list
<ssplatt>
is there any reason why @nfl.get_players_details(@lineup.qb_id)["players"][0] would work in irb but not the web app?
ShekharReddy has quit [Quit: Connection closed for inactivity]
<rapha>
hmm
<rapha>
so i spawned a new process and have its pid now. i can wait for it to end or i can end it. but how do i tell it to pause? (i.e. as if i was pressing Ctrl-Z in the terminal and then did "fg" to resume it)
alveric4 has joined #ruby
<apeiros>
ctrl-z probably signals the app
<apeiros>
so find the signal, then Process.kill to send that signal
<apeiros>
eh
<apeiros>
no, silly me
nobitanobi has joined #ruby
<apeiros>
doesn't ctrl-z just background the job?
<matthewd>
Yeah, sigstop/sigcont
<rapha>
No, it pauses it and backgrounds it, both
<rapha>
Yay+
xuanrui has quit [Ping timeout: 260 seconds]
<apeiros>
ok, then what was the command to background an app? o0
<rapha>
bg
alveric3 has quit [Ping timeout: 268 seconds]
<impermanence>
Suppose I have a method that takes a lambda as an argument. This lambda has two parameters itself. Is it possible for me to access the lambda's parameters inside the method?
yabbes has quit [Ping timeout: 276 seconds]
nobitanobi has quit [Remote host closed the connection]
airdisa_ has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
ssplatt has quit [Quit: ssplatt]
<apeiros>
impermanence: no. and that'd be bad design anyway.