apeiros changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.3.1; 2.2.5; 2.1.10: https://www.ruby-lang.org || Paste >3 lines of text on https://gist.github.com || Rails questions? Ask on #RubyOnRails || logs @ https://irclog.whitequark.org/ruby/
coolboy has joined #ruby
rbr has joined #ruby
Silthias has joined #ruby
alaibe has joined #ruby
hutch34 has joined #ruby
auxbuss has joined #ruby
auxbuss has quit [Client Quit]
kingkong- has joined #ruby
frankiee1 has joined #ruby
edrocks has joined #ruby
jmignault has joined #ruby
vdamewood has quit [Quit: Life beckons.]
elenatanasoiu has joined #ruby
frankiee_ has quit [Ping timeout: 264 seconds]
alaibe has quit [Ping timeout: 244 seconds]
hutch34 has quit [Ping timeout: 252 seconds]
edrocks has quit [Ping timeout: 252 seconds]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tcrypt has quit [Ping timeout: 265 seconds]
kingkong- has quit [Quit: No Ping reply in 180 seconds.]
elenatanasoiu has quit [Ping timeout: 264 seconds]
kingkong- has joined #ruby
AlphaAtom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
da3mon has quit [Quit: cya...]
johnmilton has quit [Ping timeout: 264 seconds]
djbkd has quit [Quit: My people need me...]
abernstein has joined #ruby
hahuang62 has joined #ruby
abernstein has quit [Client Quit]
teclator has quit [Ping timeout: 264 seconds]
jhack has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fmcgeough has joined #ruby
nettoweb has joined #ruby
craigp has joined #ruby
s2013 has joined #ruby
hahuang62 has quit [Ping timeout: 265 seconds]
Zamyatin has quit [Quit: Knocking out. Peace y'all...]
_sfiguser has quit [Ping timeout: 272 seconds]
nando293921 has joined #ruby
marr has quit [Ping timeout: 265 seconds]
tcrypt has joined #ruby
aryaching_ has joined #ruby
johnmilton has joined #ruby
banisterfiend has quit [Ping timeout: 265 seconds]
nando294021 has joined #ruby
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aryaching has quit [Ping timeout: 264 seconds]
ziprar has quit [Ping timeout: 272 seconds]
coolboy has quit [Ping timeout: 252 seconds]
nando293921 has quit [Quit: Reconnecting]
nando293921 has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
jonyijoe has quit [Ping timeout: 265 seconds]
jonyijoe_ has joined #ruby
saneax is now known as saneax-_-|AFK
chouhoulis has joined #ruby
_sfiguser has joined #ruby
banisterfiend has joined #ruby
Vile` has quit [Quit: .]
wldcordeiro has joined #ruby
charliesome has quit [Ping timeout: 272 seconds]
replay has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has quit [Ping timeout: 264 seconds]
Ropeney has joined #ruby
Rufus has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 252 seconds]
wldcordeiro has quit [Quit: WeeChat 1.4]
ur5us has joined #ruby
wldcordeiro has joined #ruby
rodfersou|dinner is now known as rodfersou
stupidystupid has joined #ruby
cyphase has quit [Ping timeout: 248 seconds]
agent_white has quit [Quit: brb]
charliesome has joined #ruby
aryaching_ has quit [Ping timeout: 252 seconds]
JeanCarloMachado has quit [Ping timeout: 265 seconds]
stupidystupid has quit [Client Quit]
craigp has quit [Ping timeout: 272 seconds]
stupidystupid has joined #ruby
charliesome_ has joined #ruby
boogeyman has quit [Quit: bb]
Naz has quit [Ping timeout: 265 seconds]
cyphase has joined #ruby
nitric has quit [Ping timeout: 244 seconds]
tcrypt has quit [Ping timeout: 265 seconds]
cyphase has quit [Max SendQ exceeded]
boogeyman has joined #ruby
charliesome has quit [Ping timeout: 244 seconds]
ruby_ has joined #ruby
zeroDi has quit [Quit: WeeChat 1.5]
SeepingN has joined #ruby
stupidystupid has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ichkv has joined #ruby
stupidystupid has joined #ruby
Bellthoven has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcao219 has quit [Ping timeout: 244 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dlam has quit [Remote host closed the connection]
symm- has joined #ruby
rodfersou has quit [Quit: leaving]
alaibe has joined #ruby
tcrypt has joined #ruby
cyphase has joined #ruby
Naz has joined #ruby
elenatanasoiu has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
someish has joined #ruby
alaibe has quit [Ping timeout: 244 seconds]
<someish> I’m struggling with finding the best, most ruby-like way to take the linked-to array of hashes, and generate a seperate array of hashes, with unique dates, and and average minutes for each date. https://gist.github.com/saturday/dbda279ee2359409d8d0b0c34a6218fb
<someish> Each date key contains a Date object.
Dimik has joined #ruby
elenatanasoiu has quit [Ping timeout: 244 seconds]
tvw has quit []
imightbestupid12 has joined #ruby
<imightbestupid12> what is a good package in atom that does not highlight unused variables, instance variables, global variables, etc...
samof76 has joined #ruby
stupidystupid has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<imightbestupid12> let's say you mistyped a variable name and you're looking everywhere for the bug but you can't find it after hours of looking through your code
stupidystupid has joined #ruby
<elomatreb> imightbestupid12: That is very hard to do in Ruby, since an apparently missing variable could just be a method defined somwewhere else
nando293921 has quit [Ping timeout: 265 seconds]
nando294021 has quit [Ping timeout: 265 seconds]
elvin_ has joined #ruby
Silthias has quit [Ping timeout: 265 seconds]
dviola has quit [Quit: WeeChat 1.5]
craigp has joined #ruby
fmcgeough has joined #ruby
blackwind_123 has quit [Ping timeout: 265 seconds]
fmcgeough has quit [Client Quit]
<imightbestupid12> cant
<imightbestupid12> elomatreb: can't the plugin scan for all of the files that have 'require' in them, put all the variables in memory and then see if they exist highlight and if they don't don't highlight
<elomatreb> Still wouldn't work reliable, since you can define methods, variables (even instance variables) dynamically through metaprogramming
ruby_ has quit [Remote host closed the connection]
xentity1x has quit [Ping timeout: 244 seconds]
ruby_ has joined #ruby
nankyokusei has joined #ruby
imightbestupid12 has quit [Quit: Page closed]
craigp has quit [Ping timeout: 272 seconds]
ruby_ has quit [Ping timeout: 265 seconds]
nankyokusei has quit [Ping timeout: 265 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ichkv has quit [Remote host closed the connection]
Pupeno has joined #ruby
<someish> If anyone cares, I found this stack overflow question that addresses my issue: http://stackoverflow.com/questions/5889589/ruby-summing-up-values-within-an-array-of-hashes-between-certain-dates
Silthias has joined #ruby
Pupeno has quit [Ping timeout: 248 seconds]
nando293921 has joined #ruby
nando294021 has joined #ruby
tcrypt has quit [Ping timeout: 265 seconds]
ElFerna has joined #ruby
duderonomy has quit [Ping timeout: 248 seconds]
s2013 has joined #ruby
ElFerna has quit [Client Quit]
tcrypt has joined #ruby
lel has quit [Quit: Reconnecting]
lel has joined #ruby
lel has quit [Changing host]
lel has joined #ruby
lel has quit [Client Quit]
chouhoulis has quit [Remote host closed the connection]
ltp has quit [Read error: Connection reset by peer]
slackbotgz has joined #ruby
elifoster has joined #ruby
eljimmy has joined #ruby
Rodya_ has quit [Remote host closed the connection]
ltp has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
finisherr has joined #ruby
craigp has joined #ruby
finisherr has quit [Client Quit]
Rodya_ has joined #ruby
finisherr has joined #ruby
ResidentBiscuit has quit [Ping timeout: 248 seconds]
ruby_ has joined #ruby
ruby_ has quit [Client Quit]
safetypin has joined #ruby
Rodya_ has quit [Ping timeout: 248 seconds]
samof76 has quit [Ping timeout: 244 seconds]
Silthias1 has joined #ruby
dtscode has joined #ruby
JakFrist[WVU] has joined #ruby
Silthias has quit [Ping timeout: 252 seconds]
someish has quit [Quit: someish]
tmtwd has joined #ruby
Fire-Dragon-DoL has joined #ruby
Silthias has joined #ruby
optiz0r has quit [Ping timeout: 248 seconds]
Silthias1 has quit [Ping timeout: 264 seconds]
Velizar has quit [Quit: Velizar]
hutch34 has joined #ruby
sdwrage has joined #ruby
craigp has quit [Ping timeout: 264 seconds]
tcrypt has quit [Ping timeout: 264 seconds]
edrocks has joined #ruby
abernstein has joined #ruby
elenatanasoiu has joined #ruby
hutch34 has quit [Ping timeout: 248 seconds]
edrocks has quit [Ping timeout: 252 seconds]
elenatanasoiu has quit [Ping timeout: 248 seconds]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
astrobunny has joined #ruby
finisherr has quit [Quit: finisherr]
hahuang62 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bellthoven has quit []
slackbotgz has quit [Remote host closed the connection]
hahuang62 has quit [Ping timeout: 252 seconds]
ARCADIVS has joined #ruby
Dobler has quit [Remote host closed the connection]
Dobler has joined #ruby
elenatanasoiu has joined #ruby
tyang has joined #ruby
thatsnotjack has quit [Ping timeout: 248 seconds]
craigp has joined #ruby
elenatanasoiu has quit [Ping timeout: 264 seconds]
rakm has joined #ruby
Dobler has quit [Remote host closed the connection]
Dobler has joined #ruby
Devalo has joined #ruby
dtscode has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Devalo has quit [Ping timeout: 265 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
auzty has joined #ruby
Silthias has quit [Ping timeout: 252 seconds]
duderonomy has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
craigp has quit [Ping timeout: 272 seconds]
dtscode has joined #ruby
elenatanasoiu has joined #ruby
charliesome_ has quit [Ping timeout: 244 seconds]
arescorpio has joined #ruby
elenatanasoiu has quit [Ping timeout: 252 seconds]
charliesome has joined #ruby
Silthias has joined #ruby
astrobunny has quit [Remote host closed the connection]
Dobler has quit [Quit: Textual IRC Client: www.textualapp.com]
astrobunny has joined #ruby
tyang has quit [Ping timeout: 272 seconds]
Dobler has joined #ruby
astrobun_ has joined #ruby
Vingador has joined #ruby
charliesome has quit [Ping timeout: 272 seconds]
astrobunny has quit [Ping timeout: 264 seconds]
alaibe has joined #ruby
Dobler has quit [Remote host closed the connection]
s2013 has joined #ruby
Dobler has joined #ruby
astrobun_ has quit [Ping timeout: 264 seconds]
braincrash has quit [Quit: bye bye]
elvin_ has quit [Quit: Textual IRC Client: www.textualapp.com]
tonini has quit [Quit: Connection closed for inactivity]
alaibe has quit [Ping timeout: 264 seconds]
elenatanasoiu has joined #ruby
elenatanasoiu has quit [Read error: Connection reset by peer]
craigp has joined #ruby
Jakey3 has quit [Ping timeout: 244 seconds]
pawnbox has joined #ruby
abernstein has quit [Quit: abernstein]
JoshS has joined #ruby
dtscode is now known as god
Dobler has quit [Remote host closed the connection]
nankyokusei has joined #ruby
Dobler has joined #ruby
Dobler has quit [Client Quit]
braincrash has joined #ruby
harai has quit [Ping timeout: 248 seconds]
pawnbox has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
nofxx has quit [Ping timeout: 264 seconds]
craigp has quit [Ping timeout: 248 seconds]
elenatanasoiu has joined #ruby
elenatanasoiu has quit [Ping timeout: 244 seconds]
shinnya has quit [Ping timeout: 264 seconds]
gix has quit [Ping timeout: 264 seconds]
Dobler has joined #ruby
Dobler has quit [Remote host closed the connection]
Dobler has joined #ruby
gix has joined #ruby
Dobler has quit [Client Quit]
optiz0r has joined #ruby
Dobler has joined #ruby
Dobler has quit [Client Quit]
tmtwd has quit [Ping timeout: 272 seconds]
harai has joined #ruby
elenatanasoiu has joined #ruby
harai has quit [Ping timeout: 252 seconds]
djbkd has joined #ruby
elenatanasoiu has quit [Ping timeout: 264 seconds]
craigp has joined #ruby
Vingador has quit [Remote host closed the connection]
Vingador has joined #ruby
aupadhye has joined #ruby
astrobunny has joined #ruby
wingwalker has joined #ruby
dminuoso has joined #ruby
xentity1x has joined #ruby
astrobunny has quit [Ping timeout: 272 seconds]
craigp has quit [Ping timeout: 272 seconds]
wingwalker has quit [Client Quit]
wingwalker has joined #ruby
wingwalker has quit [Max SendQ exceeded]
wingwalker has joined #ruby
edrocks has joined #ruby
passbe has quit [Remote host closed the connection]
passbe has joined #ruby
passbe has quit [Client Quit]
astrobun_ has joined #ruby
elenatanasoiu has joined #ruby
Dobler has joined #ruby
dminuoso has quit [Ping timeout: 244 seconds]
edrocks has quit [Ping timeout: 248 seconds]
wingwalker has quit [Quit: Leaving]
wingwalker has joined #ruby
elenatanasoiu has quit [Ping timeout: 244 seconds]
samof76 has joined #ruby
hahuang62 has joined #ruby
Silthias has quit [Ping timeout: 252 seconds]
hahuang62 has quit [Ping timeout: 265 seconds]
hutch34 has joined #ruby
pawnbox has joined #ruby
eizua has joined #ruby
wingwalker has quit [Quit: Leaving]
eizua has quit [Remote host closed the connection]
JakFrist[WVU] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
djbkd has quit [Quit: My people need me...]
eizua has joined #ruby
Dobler has quit [Remote host closed the connection]
Dobler has joined #ruby
Silthias has joined #ruby
craigp has joined #ruby
saneax-_-|AFK is now known as saneax
Dobler has quit [Remote host closed the connection]
jmignault has quit [Ping timeout: 244 seconds]
Dobler has joined #ruby
Dobler has quit [Client Quit]
Dobler has joined #ruby
A_Drone has joined #ruby
Dobler has quit [Client Quit]
A_Drone has quit [Remote host closed the connection]
craigp has quit [Ping timeout: 264 seconds]
Oclair_ has quit [Quit: Bye Bye]
A_Drone has joined #ruby
Oclair has joined #ruby
Vingador has quit [Remote host closed the connection]
amclain has quit [Quit: Leaving]
parus has joined #ruby
imightbestupid12 has joined #ruby
<imightbestupid12> what is the type of book or genre called about the book named ruby under a microscope?
dminuoso has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 248 seconds]
blackgoat has quit [Ping timeout: 252 seconds]
pwnd_nsfw has joined #ruby
blackgoat has joined #ruby
imightbestupid12 has quit [Ping timeout: 240 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
rsampaio_ has joined #ruby
abernstein has joined #ruby
AlexRussia_ has quit [Ping timeout: 252 seconds]
jarred has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alaibe has joined #ruby
safetypin has quit [Quit: Textual IRC Client: www.textualapp.com]
Mission-Critical has quit [Ping timeout: 264 seconds]
gizless has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
alaibe has quit [Ping timeout: 272 seconds]
elenatanasoiu has joined #ruby
A_Drone has quit [Remote host closed the connection]
qba73 has joined #ruby
tonini has joined #ruby
jshjsh has joined #ruby
elenatanasoiu has quit [Ping timeout: 264 seconds]
JoshS has quit [Ping timeout: 244 seconds]
Azure|dc has joined #ruby
Azure has quit [Ping timeout: 248 seconds]
dminuoso has quit [Remote host closed the connection]
nankyokusei has joined #ruby
Silthias has quit [Ping timeout: 252 seconds]
ayonkhan has joined #ruby
nando293921 has quit [Ping timeout: 265 seconds]
nando294021 has quit [Ping timeout: 265 seconds]
blackgoat has quit [Quit: WeeChat 1.5]
conta has joined #ruby
bluOxigen has quit [Ping timeout: 252 seconds]
nankyokusei has quit [Ping timeout: 248 seconds]
bluOxigen has joined #ruby
NTrash has joined #ruby
Dobler has joined #ruby
eizua has quit [Quit: Leaving]
gizmore has joined #ruby
Contigi has quit [Read error: Connection reset by peer]
blackgoat has joined #ruby
ta_ has quit [Ping timeout: 272 seconds]
Silthias has joined #ruby
dminuoso has joined #ruby
Devalo has joined #ruby
Pupeno has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
Pupeno has quit [Read error: Connection reset by peer]
sp_ has joined #ruby
Pupeno has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
Pupeno has quit [Client Quit]
A_Drone has joined #ruby
arescorpio has quit [Quit: Leaving.]
cibs has quit [Ping timeout: 268 seconds]
stupidystupid has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jackjackdripper has quit [Quit: Leaving.]
ruby-lang702 has joined #ruby
ruby-lang702 is now known as michaelrails
Contigi has joined #ruby
cibs has joined #ruby
sandelius has joined #ruby
beauby has quit [Ping timeout: 264 seconds]
<michaelrails> hey guys, does anybody know what algorithm Ruby uses for square roots? I used the Babylonian method and I can get it to work almost instantly when I round, but I can't get exact decimals with larger numbers in a decent amount of time
FINbit has quit [Ping timeout: 248 seconds]
<Radar> michaelrails: Do you have some code for us to look at?
<dminuoso> michaelrails: Whatever the underlying C library uses to implement sqrt.
<dminuoso> For Math::sqrt at any rate.
<michaelrails> Radar:
<michaelrails> def sq(num) guess = (1 + rand(num)) * 1.00 until guess.round(2) == (num/guess).round(2) guess = (guess + num/guess)/2 end guess = guess.round(2) if guess != num/guess return guess end is there a better way to format on here? new to freenode
<Radar> ?gist michaelrails
<ruby[bot]> michaelrails: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<michaelrails> cool, thanks
<dminuoso> michaelrails: What is that code supposed to do?
RTFM[away] has quit [Ping timeout: 272 seconds]
<michaelrails> it finds the square root. I just saw a video about the Babylonian method and wanted to recreate it quick
<michaelrails> right now it only finds the square root to 2 decimal places because of performance issues
<dminuoso> michaelrails: Comparison with floating point numbers requires a delta, you know that right?
<michaelrails> dminuoso: I didn't, but this seems to work. would using a delta help performance?
<dminuoso> So don't round, just use a delta.
<michaelrails> all I can find on Delta online is things related to date-time. can you elaborate or help me find a link?
<dminuoso> michaelrails: (expected - actual).abs <= delta
<dminuoso> michaelrails: It's the traditional way to compare two floating point numbers.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dminuoso> michaelrails: Also instead of multiplying by 1.0 you can use #to_f
Silthias1 has joined #ruby
rbr has quit [Read error: Connection reset by peer]
<michaelrails> dminuoso: thanks! but I still can't figure out how to use delta. I updated the gist
Silthias has quit [Ping timeout: 252 seconds]
<dminuoso> 07:50 < dminuoso> michaelrails: (expected - actual).abs <= delta
<michaelrails> should I replace delta with a decimal?
<dminuoso> Yeah.
<dminuoso> Well, you would declare some DELTA constant or variable.
<michaelrails> got it, that's what I figured. so this is more precise than rounding to 2 decimals, but not 100% exact
<dminuoso> Yeah. FP arithmetic is by definition never exact.
<michaelrails> yeah, I can see why. thanks so much for your help!
Devalo has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
rbr has joined #ruby
ur5us has joined #ruby
qba73 has quit []
<dminuoso> michaelrails: https://eval.in/654636
eljimmy has quit [Quit: This computer has gone to sleep]
<michaelrails> dminuoso: I went a little more exact https://gist.github.com/karpimpski/0b3cac5425656f348b170a9dce98071d but the same concept
<dminuoso> michaelrails: drop the rounding still.
<dminuoso> Otherwise the comparison with some delta is silly.
<michaelrails> dminuoso: wow, I thought I did. didn't even notice that, thanks
sp_ has quit [Ping timeout: 272 seconds]
ur5us has quit [Ping timeout: 265 seconds]
bocaneri has joined #ruby
abernstein has quit [Quit: abernstein]
craigp has joined #ruby
jaguarmagenta has joined #ruby
watersoul has quit [Remote host closed the connection]
watersoul has joined #ruby
bocaneri has quit [Max SendQ exceeded]
bocaneri has joined #ruby
edrocks has joined #ruby
dionysus69 has joined #ruby
elenatanasoiu has joined #ruby
beauby has joined #ruby
NTrash has quit [Quit: Konversation terminated!]
edrocks has quit [Ping timeout: 248 seconds]
michaelrails has quit [Ping timeout: 240 seconds]
gizless has joined #ruby
gizmore has quit [Ping timeout: 252 seconds]
elenatanasoiu has quit [Ping timeout: 252 seconds]
hahuang62 has joined #ruby
hahuang62 has quit [Ping timeout: 252 seconds]
teclator has joined #ruby
anisha has joined #ruby
rbr has quit [Ping timeout: 264 seconds]
Hyuk has joined #ruby
rbr has joined #ruby
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
raeoks has joined #ruby
tcrypt has joined #ruby
tcrypt has quit [Client Quit]
Guest43 has joined #ruby
hutch34 has quit [Ping timeout: 264 seconds]
Guest43 has quit [Client Quit]
conta1 has joined #ruby
sdwrage has quit [Quit: This computer has gone to sleep]
rsampaio_ has quit [Ping timeout: 252 seconds]
A_Drone has quit [Remote host closed the connection]
beauby has quit [Ping timeout: 265 seconds]
A_Drone has joined #ruby
mark_66 has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
boogeyman has quit [Quit: bb]
hahuang62 has joined #ruby
nhhc has joined #ruby
AlphaAtom has joined #ruby
nhhc is now known as Chau
blaxter has joined #ruby
lacour has quit [Quit: Leaving]
Devalo has joined #ruby
ta_ has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
blackwind_123 has joined #ruby
Hyuk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
hahuang62 has quit [Ping timeout: 265 seconds]
Devalo has quit [Ping timeout: 265 seconds]
sp_ has joined #ruby
dionysus69 has joined #ruby
alaibe has joined #ruby
DrCode has quit [Quit: ZNC - http://znc.in]
Muz_ is now known as Muz
submitnine has joined #ruby
ta_ has quit [Quit: Leaving...]
beauby has joined #ruby
elifoster has quit [Ping timeout: 264 seconds]
ta_ has joined #ruby
alaibe has quit [Ping timeout: 265 seconds]
zacts has quit [Ping timeout: 252 seconds]
A_Drone has quit [Remote host closed the connection]
c355e3b has quit [Quit: Connection closed for inactivity]
aidalgol has joined #ruby
xentity1x has quit [Ping timeout: 252 seconds]
A_Drone has joined #ruby
Ropeney has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
A_Drone_ has joined #ruby
A_Drone has quit [Remote host closed the connection]
CloCkWeRX has quit [Quit: Leaving.]
elastix has joined #ruby
god is now known as dtscode
Hyuk has joined #ruby
boogeyman has joined #ruby
aganov has joined #ruby
claudiuinberlin has joined #ruby
nankyokusei has joined #ruby
AlphaAtom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tjbiddle has joined #ruby
Couch has joined #ruby
rippa has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
Jameser has joined #ruby
nofxx has joined #ruby
blackgoat has quit [Quit: WeeChat 1.5]
frankiee1 has quit [Ping timeout: 244 seconds]
Hyuk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
|prawnzy has joined #ruby
bsrd has joined #ruby
aufi has joined #ruby
Hyuk has joined #ruby
Dimik has quit [Ping timeout: 244 seconds]
stupidystupid has joined #ruby
prawnzy has quit [Ping timeout: 265 seconds]
Silthias1 has quit [Ping timeout: 264 seconds]
jphase has quit [Remote host closed the connection]
hiasinho has joined #ruby
Jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
astrobun_ has quit [Remote host closed the connection]
astrobunny has joined #ruby
Silthias has joined #ruby
Jameser has joined #ruby
A_Drone_ has quit [Remote host closed the connection]
Jameser has quit [Client Quit]
astrobunny has quit [Ping timeout: 264 seconds]
astrobunny has joined #ruby
Burgestrand has joined #ruby
elastix has quit [Quit: elastix]
biberu has joined #ruby
stupidystupid has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Hyuk has quit [Quit: Textual IRC Client: www.textualapp.com]
chenxi has joined #ruby
gingray has joined #ruby
Jameser has joined #ruby
lxsameer has joined #ruby
andikr has joined #ruby
DaniG2k has joined #ruby
chenxi has quit [Client Quit]
l4v2 has quit [Quit: l4v2]
dn` has joined #ruby
alaibe has joined #ruby
last_staff has joined #ruby
Jameser_ has joined #ruby
Jameser has quit [Ping timeout: 265 seconds]
hiasinho_ has joined #ruby
elenatanasoiu has joined #ruby
alaibe has quit [Ping timeout: 264 seconds]
tvw has joined #ruby
Guest66898 is now known as ndrst
Dobler has quit [Quit: Textual IRC Client: www.textualapp.com]
Jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ayonkhan has quit [Read error: Connection reset by peer]
hiasinho_ has quit [Quit: WeeChat 1.5]
ayonkhan has joined #ruby
|prawnzy has quit [Remote host closed the connection]
ocbtec has joined #ruby
xall has quit [Ping timeout: 248 seconds]
samof76 has quit [Ping timeout: 244 seconds]
pragmaticus has joined #ruby
dtscode has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
dtscode has joined #ruby
Jameser has joined #ruby
edrocks has joined #ruby
Dobler has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
dtscode has quit [Client Quit]
dtscode has joined #ruby
Bish has quit [Remote host closed the connection]
jsrn_ has joined #ruby
DaniG2k has quit [Ping timeout: 244 seconds]
edrocks has quit [Ping timeout: 248 seconds]
bsrd has quit [Quit: WeeChat 1.5]
DaniG2k has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
marr has joined #ruby
Jakey3 has joined #ruby
modin has quit [Ping timeout: 265 seconds]
be_______ has joined #ruby
_sfiguser has quit [Ping timeout: 264 seconds]
Jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alaibe has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
flying has joined #ruby
modin has joined #ruby
be_______ has quit [Ping timeout: 248 seconds]
ichkv has joined #ruby
xall has joined #ruby
bsrd has joined #ruby
bsrd has quit [Client Quit]
DaniG2k has quit [Quit: leaving]
Snickers has joined #ruby
blackwind_123 has quit [Ping timeout: 264 seconds]
FINbit has joined #ruby
blackwind_123 has joined #ruby
xall has quit [Ping timeout: 272 seconds]
_sfiguser has joined #ruby
hurikhan|Work has joined #ruby
tomphp has joined #ruby
jshjsh has quit [Ping timeout: 272 seconds]
samof76 has joined #ruby
tjbiddle has joined #ruby
bsrd has joined #ruby
tjbiddle has quit [Client Quit]
sp_ has quit [Ping timeout: 264 seconds]
lxsameer has joined #ruby
Dobler has quit [Quit: Textual IRC Client: www.textualapp.com]
bsrd has quit [Quit: WeeChat 1.5]
dtscode has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<dminuoso> So for a while I started implementing DIP a lot in my Ruby code - basically enforcing a kind of adapter pattern in a lot of places.
<dminuoso> What do you folks thing about DIP in Ruby?
<dminuoso> think even.
Madplatypus has joined #ruby
<apeiros> DIP? == DI Pattern?
<dminuoso> apeiros: dependency inversion principle
<dminuoso> Idea is that high level components should not dependent on low level components.
<apeiros> oh, dependency inversion, not dependency injection. is that a different thing?
<dminuoso> But both should depend on a common abstraction.
<dminuoso> apeiros: It's a way to implement it.
hahuang62 has joined #ruby
ayonkhan has quit [Read error: Connection reset by peer]
Dobler has joined #ruby
ayonkhan has joined #ruby
jaequery has joined #ruby
Devalo has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
<apeiros> hm, a bit too much to read on the side of my work :-|
dn` has quit [Quit: dn`]
hahuang62 has quit [Ping timeout: 265 seconds]
JoshS has joined #ruby
braincrash has quit [Ping timeout: 272 seconds]
CHoltk has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
Devalo has quit [Ping timeout: 244 seconds]
JeanCarloMachado has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
teclator has joined #ruby
TomyWork has joined #ruby
Jameser has joined #ruby
yaewa has joined #ruby
moei has quit [Ping timeout: 264 seconds]
Jameser has quit [Client Quit]
braincrash has joined #ruby
lxsameer has quit [Ping timeout: 265 seconds]
bsrd has joined #ruby
y2mq37 has joined #ruby
bsrd has quit [Client Quit]
ichkv has quit [Ping timeout: 244 seconds]
dn` has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
alaibe has quit [Ping timeout: 265 seconds]
cyphase has joined #ruby
erlingur_ has joined #ruby
alaibe has joined #ruby
astrobunny has quit [Remote host closed the connection]
tvw has quit [Read error: Connection reset by peer]
nankyokusei has joined #ruby
bsrd has joined #ruby
xall has joined #ruby
bsrd has quit [Client Quit]
sp_ has joined #ruby
m1911 has joined #ruby
duncannz has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 252 seconds]
m1911 has quit [Remote host closed the connection]
ichkv has joined #ruby
Burgestrand has quit [Read error: Connection reset by peer]
xall has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
Beams has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgestrand has joined #ruby
symm- has quit [Ping timeout: 272 seconds]
<Beams> Hi all, just starting to learn Ruby. Quick refactor question if anyone has a sec http://hastebin.com/qisoluteci.rb
frankiee_ has joined #ruby
ichkv has quit [Remote host closed the connection]
ichkv has joined #ruby
nettoweb has joined #ruby
<canton7> Beams, .map{ |x| x.chomp } on the end
<Beams> canton7 much appreciated
ichkv has quit [Remote host closed the connection]
<canton7> or map(&:chomp) if you're feeling terse
gregf_ has quit [Ping timeout: 240 seconds]
erlingur has joined #ruby
lxsameer has joined #ruby
<frankiee_> yo canton7 :)
<frankiee_> long time long time. back from the spree days
<frankiee_> you the half german right?
<canton7> nope, you've got the wrong person
erlingur_ has quit [Ping timeout: 264 seconds]
merlin2049er has joined #ruby
merlin2049er has quit [Client Quit]
merlin2049er has joined #ruby
ichkv has joined #ruby
gregf_ has joined #ruby
soulisson has joined #ruby
mniip has quit [Ping timeout: 624 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
sepp2k has joined #ruby
JeanCarloMachado has quit [Ping timeout: 264 seconds]
sp_ has quit [Ping timeout: 265 seconds]
lugzer has joined #ruby
<lugzer> hello
JeanCarloMachado has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
<lugzer> any idea why "gem install sass" would say that there is no such gem?
prawnzy has joined #ruby
postmodern has quit [Quit: Leaving]
prawnzy has quit [Ping timeout: 248 seconds]
kgzm has joined #ruby
maloik72 has quit [Remote host closed the connection]
maloik has joined #ruby
<lugzer> i've followed the info on rubygems to update the system manually.. but still no luck
kgzm has quit [Client Quit]
edrocks has joined #ruby
yaewa has quit [Quit: Leaving...]
moei has joined #ruby
lugzer has quit [Remote host closed the connection]
stamina has joined #ruby
futilegames has joined #ruby
lugzer has joined #ruby
bsrd has joined #ruby
edrocks has quit [Ping timeout: 248 seconds]
xall has joined #ruby
soulisson has left #ruby ["Leaving"]
JeanCarloMachado has quit [Ping timeout: 244 seconds]
<lugzer> back for answer ;)
xall has quit [Ping timeout: 265 seconds]
JeanCarloMachado has joined #ruby
<workmad3> lugzer: what output do you get from running 'gem sources'?
<lugzer> *** CURRENT SOURCES *** https://rubygems.org/
<lugzer> i've tried changing to non-SSL for the sass install.. no luck
Fridtjof has quit [Ping timeout: 265 seconds]
<workmad3> lugzer: hmm... and what version of rubygems do you have? ("gem -v")
Tempesta has quit [Quit: See ya!]
<lugzer> 2.6.7
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ruby
Burgestrand has joined #ruby
Fridtjof has joined #ruby
<workmad3> ok... no idea then :(
gregf_ has quit [Ping timeout: 240 seconds]
symm- has joined #ruby
<lugzer> ok thanks for looking
Burgestrand has quit [Client Quit]
aidalgol has quit [Quit: zZzZzZzzz]
<hanmac> lugzer: have you tryied to ping rubygems.org? maybe there is something with your connection
Burgestrand has joined #ruby
<lugzer> well, my network does not allow ping, but i can normally clone from git, or install from brew...
<hanmac> hm maybe thats the reason that your network does not allow connection to rubygems?
<lugzer> could be.. i'll try connecting via phone and see if it makes a difference
sts_ is now known as sts
c355e3b has joined #ruby
tlaxkit has joined #ruby
<frankiee_> hanmac, solid stack, good ol' bsd times bring them back
<frankiee_> *mic dropped*
babblebre has joined #ruby
timmow has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
blackgoat has joined #ruby
Silthias has quit [Ping timeout: 252 seconds]
blackwind_123 has quit [Ping timeout: 252 seconds]
cored has joined #ruby
<cored> hi
<cored> I'm looking for a good tutorial on parsing ruby. Using whitequark parser gem
<cored> I started with an implementation which use an AST::Processor but I don't know if that's the good approach for what I want to do; I'm not doing a transformation of the AST but just reading and counting variables at least that's what I want for now
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
aries_liuxueyang has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gregf_ has joined #ruby
<dminuoso> cored: What exactly is your goal?
<dminuoso> cored: Note that in order to understand variables properly, you need to build a lexer.
<dminuoso> (Rubys system of recognizing a method or variable is built into the lexer rather than the parser)
<dminuoso> Or at the very least your AST would have to maintain lexigrahpical order.
Devalo has joined #ruby
<dminuoso> cored: Fuck me, I missed the bit that you are using whtiequark/parser
<dminuoso> cored: Yes, AST::Processor is fine.
y2mq37 has quit [Ping timeout: 248 seconds]
pawnbox has quit [Remote host closed the connection]
CHoltk has quit [Quit: Verlassend]
pawnbox has joined #ruby
Devalo has quit [Ping timeout: 244 seconds]
Snowy has joined #ruby
zipace has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
dionysus69 has joined #ruby
jaguarmagenta has quit [Remote host closed the connection]
ferr has joined #ruby
erlingur_ has joined #ruby
<cored> dminuoso: right, I just want to count variables and constant in a Ruby source
<dminuoso> cored: Yeah AST::Processor is fine.
<cored> dminuoso: but I want to associate the method name in which those variables were declare
<dminuoso> cored: If it's a method they were declared in..
<cored> what I'm doing is just counting in the same processor
<cored> yes if it's a method
<dminuoso> cored: And what if its a local variable inside a block?
<cored> but if it's a method then my desire output should be '#method_name variable, x, y, z'
xall has joined #ruby
<cored> dminuoso: I would like to count those too
<cored> but for now just the simple case
<dminuoso> cored: Sounds simple enough
erlingur has quit [Ping timeout: 248 seconds]
fivmo has joined #ruby
xall has quit [Ping timeout: 265 seconds]
bumao has joined #ruby
JakFrist[WVU] has joined #ruby
nankyokusei has joined #ruby
elenatanasoiu has quit [Ping timeout: 252 seconds]
lugzer has quit [Quit: Be back later ...]
auzty has quit [Quit: Leaving]
stamina has quit [Quit: WeeChat 1.5]
lugzer has joined #ruby
samof76 has quit [Ping timeout: 265 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
jphase has joined #ruby
_sfiguser has quit [Remote host closed the connection]
beauby has quit [Ping timeout: 264 seconds]
Guest81200 has quit [Read error: Connection reset by peer]
<fbt> Ever since I've started learning Ruby, I'm getting increasingly annoyed at how shells do loops.
<fbt> Well, not loops, but different blocks
<dminuoso> fbt: View it in the context of time and problem domain.
<fbt> 'for ...; do ...; done', but 'if ...; then ...; fi.
<dminuoso> Oh that's just syntax.
<fbt> And then case/esac
<fbt> It's annoying
<dminuoso> fbt: it's very clear how to close each block at least? :)
jphase has quit [Ping timeout: 244 seconds]
<fbt> I keep ending all these in 'end' in bash now and then getting angry at it for not working :)
<dminuoso> fbt: In Ruby it's a bit weird, how a class and if are closed with an "end" but without a "do"
<dminuoso> or a method definition.
johnmilton has quit [Remote host closed the connection]
<dminuoso> All languages have quirks.
<fbt> At least it's a single keyword for all of them. But yes, Ruby is being inconsistent there too, just slightly differently
<dminuoso> fbt: Or better yet, the fact that its determined at lexing that a variable is a variable or method?
<dminuoso> That one bugs me every single day.
<dminuoso> >> puts a if a = 1
<ruby[bot]> dminuoso: # => /tmp/execpad-89f4b660e286/source-89f4b660e286:2: warning: found = in conditional, should be == ...check link for more (https://eval.in/654852)
<fbt> But yeah, people kept telling me I would absolutely hate bash after I start writing in a “proper language”
<fbt> And no, that's not happening.
nuck has joined #ruby
<fbt> I've written quite a lot of bash code in ~8 years, it's a language that has its benefits.
nuck is now known as Guest35374
<dminuoso> Yeah, it keeps jobs safe.
<dminuoso> Because who in their right minds would learn bash nowadays.
<fbt> :D
<dminuoso> I mean honestly, it's an outdated tool that serves no practice purpose anymore.
JakFrist[WVU] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> practical
<fbt> Well what I mean is it's really handy when you do a lot of work with calls to external programs. And it's everywhere.
<fbt> And every admin knows it to an extent
<fbt> It does allow you to shoot your foot off easily though.
<dminuoso> Honestly? Most "administration" work that folks do who started out "being an admin" 10-20 years ago is really outdated concepts.
<fbt> Tech changes, some ways of doing things changed. Containers are a thing now, admins and developers pretty much merged. But you still write system glue.
<fbt> And that system glue, depending on the task, can be really awkward in something other than a shell language.
<fbt> Or not. Tool for the job.
<dminuoso> What kind of system glue are we talking about?
<fbt> “Make A take slightly modified input from B and then pass it on to C” type shit.
<fbt> Or, like, xinitrc :D
<dminuoso> Configuration Management
<fbt> But that's a desktop thing.
<dminuoso> Do it in puppet.
<dminuoso> No, its not a desktop thing, its a configuration thing.
<fbt> No, I mean xinitrc is.
<dminuoso> Its still a configuration issue.
<fbt> How does puppet change the fact that xinitrc is a bunch of external calls?
<fbt> That needs to be run on every X launch
JeanCarloMachado has quit [Remote host closed the connection]
<fbt> If you manage it with puppet, it will still be a shell script :)
kimegede has joined #ruby
ldnunes has joined #ruby
<fbt> Re-writing it to anything else would make it a very awkward script with a bunch of system() calls.
<dminuoso> So what? I mean its a bad example since you correctly pointed out it's a desktop (thus user frontend) domain already - but even so, what underlying concept is used does not matter.
<fbt> And not much benefit.
<dminuoso> It can use bash for all I care, but that doesn't require me to know bash.
<fbt> Well yeah, this type of stuff is mostly just a list of external calls, you don't need to know bash to read/modify them.
jcao219 has joined #ruby
<dminuoso> Indeed.
Jameser has joined #ruby
<fbt> For a bit of more admin-y stuff: https://git.fleshless.org/chroot-utils/tree/overlay-mount
<dminuoso> fbt: Mounting stuff? Configuration management. Have puppet deal with it.
<fbt> Not good enough, that needs to get run from a hookl
<fbt> It runs every time a package is built
<dminuoso> What for?
nfk has joined #ruby
<fbt> It's part of the process of creating a clean build chroot
<dminuoso> Sounds like you want docker instead.
<dminuoso> ;)
<fbt> I mean it's a reinventing the wheel type thing for my personal build system, but hey.
lugzer has quit [Remote host closed the connection]
<dminuoso> Oh wait, you mean vagrant?
<dminuoso> ;)
<fbt> Yeah, I could just use something like Jenkins (and I do), but under the hood that thing also runs shell :D
<dminuoso> Who cares what it runs on.
<dminuoso> Facebook uses plenty of PHP - that does not make it a technically bad website.
JeanCarloMachado has joined #ruby
<fbt> I see that attitude as a problem honestly. I care about what is under the hood not for some elitist shit but just for the value of knowing how to modify it if needed.
gingray has quit [Ping timeout: 264 seconds]
ARCADIVS has quit [Quit: ARCADIVS]
bsrd has quit [Quit: WeeChat 1.5]
<fbt> And systems are still ruled by C and shell.
Burgestrand has joined #ruby
<dminuoso> Im really unsure how these two relate to each other, but fine.
bsrd has joined #ruby
<dminuoso> fbt: And Jenkins runs on Java btw.
<fbt> C is the language of choice for system utilities still. Shell is the glue between them.
<fbt> I know. It also runs shell scripts.
<dminuoso> Ah yeah.
<dminuoso> fbt: C is the language of choice for a lot of applications. Not just system utilities.
<fbt> Sure, but in the scope of this specific conversation I mean system utilities.
<dminuoso> OH yeah
johnmilton has joined #ruby
johnmilton has quit [Client Quit]
lugzer has joined #ruby
<fbt> Obviously C is not limited to coreutils or runit :D
<dminuoso> fbt: Though as you said correctly, all "shell code" is for gluing stuff together. Nowadays we are lucky to have technologies that solve problems using domain specific languages often.
ldnunes has quit [Ping timeout: 244 seconds]
johnmilton has joined #ruby
<dminuoso> Giving us much more expressivity and compact ways to solve problems.
<dminuoso> Puppet connects, shell glues. ;-)
<fbt> In many cases yes. But then you need to just launch a bunch of progmans and you end up with awkward 30 lines of Python instead of 5 in shell :D
<fbt> programs*
<fbt> As I've said, tool for the job.
<dminuoso> fbt: Except, when I express that the state for a given puppet class requires a program to be running, then not only do I have this a) versioned in git, b) described and thus documented centrally, c) enforced by the puppet master but I can also reuse this d) freely
ldnunes has joined #ruby
<dminuoso> It easily beats the "5 line shell hack".
beauby has joined #ruby
<fbt> We had this colleague who insisted on writing monitoring plugins in Ruby. They are ugly and awkward as sin despite the idea being nice: he has this library to abstract some common stuff away and it's supposedly very clean
<fbt> But then we do system(), system(), system(), REGEXES EVERYWHERE, system(), system()
<fbt> And what was supposed to be a nice clean plugin ends up being horrendously awkward instead of just doing it with the tool that is good for these things.
<dminuoso> fbt: Well it's definitely not an easy task.
<fbt> Monitoring plugins are pretty simple things actually. Well. They are supposed to be.
<dminuoso> The frameworks around puppet are monstreous for example. But the way you can now write your own manifests - its amazing.
<workmad3> fbt: in the interest of fairness, I bet you've seen some pretty ugly monstrosities written in bash too :P
synthroid has joined #ruby
<workmad3> (a.k.a. horrible code is language-agnostic)
<fbt> workmad3, oh god yes. bash is REALLY YEASY to make ugly.
<fbt> easy*
<dminuoso> fbt: Any language is really easy to write horrible code in.
<fbt> The only other popular language that is even worse at allowing you to write insanely horrific shit is Perl.
<fbt> The shell family is a close second.
jenrzzz has joined #ruby
<fbt> But then shells more easily allow you to do horrifyingly easy to make mistakes that are hard to debug and are very severe if exploited.
<workmad3> fbt: the CS school grading system at my uni was written in a crazy mashup of bash, java and something else (perl I think)... it was arcane, weird, horrible code and somehow the java components were written so that they were processor-specific (as in a specific model of a processor :/ )
<dminuoso> fbt: I think the lack of debugging facilities is one of the biggest problems.
<fbt> And btw the people who write horrific shell scripts often turn out to be people who look down on them and refuse to learn the concepts.
<dminuoso> fbt: I have spent the better part of the last 4 months customizing GNU GCC and GNU binutils for a custom kernel. A lot of the time was spent in autotools - which is basically a horrible stack of bash scripts generating bash code.
JeanCarloMachado has quit [Ping timeout: 265 seconds]
<fbt> shells are *very different*. Either learn it or just don't use them!
prawnzy has joined #ruby
<fbt> workmad3, how do you even write Java that is that architecture-specific
<dminuoso> fbt: Honestly, try autotools for just a day. After that you will hate Bash for eternity.
<dminuoso> Or shell in general I should say.
xall has joined #ruby
<fbt> I've worked with autotools closely at various points in my career. They are insanely bad.
<workmad3> fbt: I have no idea, I never got to see the code... I just heard about it when they tried to update the machines the main server for it was running on
JeanCarloMachado has joined #ruby
<dminuoso> The only good product from autotools is make.
<dminuoso> That one is rock solid and fine.
<fbt> Still doesn't excuse the people who wrote the thing.
<workmad3> dminuoso: hmm... I thought make predated autotools?
<dminuoso> workmad3: Sure.
<dminuoso> workmad3: well make in general.
<fbt> Forgetting about quoting, not actually using the proper tools, assuming that they are under bash when the shebang is /bin/sh...
jenrzzz has quit [Ping timeout: 244 seconds]
<fbt> It's horrible novice-grade mistakes that get me in autotools.
<fbt> And yeah, make is not a part of autotools.
sp_ has joined #ruby
conta has quit [Ping timeout: 252 seconds]
conta1 is now known as conta
<dminuoso> fbt: Honestly I was really scared, when I realized, that for example there is a shared Makefile.in that a lot of big GNU projects use. They all use a shared mixed file - it's super insane.
prawnzy has quit [Ping timeout: 265 seconds]
tyang has joined #ruby
pec has joined #ruby
<fbt> I'm a fan of project-specific makefiles that are not generated by this insane monstrosity. It's a bit more work initially, but so much easier to debug.
<fbt> And is more flexible in the end.
xall has quit [Ping timeout: 248 seconds]
<dminuoso> fbt: Hand written Makefiles are great.
<dminuoso> As I said, make is about the only useful thing in the GNU build system. :P
<fbt> Well, those also allow you to do horrific stuff if you want to :D
raeoks has quit [Read error: Connection reset by peer]
<dminuoso> Though nowadays I just use cmake, since it makes managing dependencies that much easier.
tyang has quit [Read error: Connection reset by peer]
<fbt> I'm pretty sure my ruby code is horrific though.
sp_ has quit [Ping timeout: 248 seconds]
ICantCook has quit [Ping timeout: 265 seconds]
Jameser has quit [Ping timeout: 244 seconds]
edrocks has joined #ruby
<fbt> I just don't know the ways in which it is horrific
Jameser has joined #ruby
havenwood has quit [Ping timeout: 248 seconds]
G has quit [Ping timeout: 265 seconds]
aries_liuxueyang has quit [Ping timeout: 244 seconds]
Kruppe has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
havenwood has joined #ruby
guacamole has quit [Remote host closed the connection]
aries_liuxueyang has joined #ruby
G has joined #ruby
bruce_lee has quit [Ping timeout: 244 seconds]
guacamole has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
Kruppe has joined #ruby
edrocks has quit [Ping timeout: 248 seconds]
elenatanasoiu has joined #ruby
eljimmy has joined #ruby
Silthias has joined #ruby
pawnbox has quit [Remote host closed the connection]
elenatanasoiu has quit [Ping timeout: 244 seconds]
pawnbox has joined #ruby
crameth has joined #ruby
crameth has quit [Remote host closed the connection]
Ropeney has joined #ruby
edrocks has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
eljimmy has joined #ruby
samof76 has joined #ruby
pawnbox has quit [Remote host closed the connection]
brendan- has joined #ruby
eljimmy has quit [Read error: No route to host]
pawnbox has joined #ruby
sdwrage has joined #ruby
elenatanasoiu has joined #ruby
gnufied has joined #ruby
cored has quit [Quit: WeeChat 1.5]
alexherbo2 has joined #ruby
zacts has joined #ruby
tyang has joined #ruby
matp has quit [Quit: Bye!]
Rajamaa has joined #ruby
lugzer has quit [Read error: Connection reset by peer]
bsrd has quit [Read error: Connection reset by peer]
csk has joined #ruby
bsrd has joined #ruby
A_Drone has joined #ruby
matp has joined #ruby
beauby has quit [Ping timeout: 264 seconds]
modin has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Burgestrand> fbt I'd say most useful code is, so don't feel bad. :D
* Burgestrand is bitter
<fbt> I like pretty code.
A_Drone has quit [Ping timeout: 252 seconds]
<fbt> But I also get that my code won't be pretty in the near future.
<fbt> Ideally it would be nice to show the code to someone who would nitpick it :3
modin has joined #ruby
aupadhye has quit [Quit: Leaving]
<fbt> But I'm starting a new job soon, and there is just the guy working there.
<Burgestrand> fbt I'm sure you'll get some nitpicks if you post it in here. ;)
boogeyman has quit [Quit: bb]
<fbt> Well. If you're in the mood for such things: https://git.fleshless.org/moltenbar/tree/
chouhoulis has joined #ruby
<Burgestrand> (granted, it typically depends on time of day, mood of developers, code size, and moon phase)
Tempesta has joined #ruby
fmcgeough has joined #ruby
bsrd has quit [Read error: Connection reset by peer]
<Burgestrand> fbt I'm just on a short break from working so I don't have time to meaningfully nitpick at the moment, syntax-wise tabs (!) and parens on methods that don't take parameters are typically not done for Ruby (tabs more so than the parens).
<Burgestrand> fbt additionally, most of the time we're not using `for` so much in Ruby. We use methods on collections, e.g. `workers.each(&:kill)` as opposed to `for w in workers…`
<Burgestrand> I keep saying we, as if my opinion is part of some collective, it's not. :)
<fbt> Yeah, when it comes to style, I'm still trying to find the things I personally like.
<fbt> So it's all over the place.
<Burgestrand> fbt That's completely fine. Keep in mind that when it comes to tabs and spaces, ruby developers are fairly unanimous for 2 spaces.
synthroid has quit [Remote host closed the connection]
<fbt> I should at the very least make the project consistent, hmm.
<Burgestrand> fbt I'd say the same thing applies to the non-usage of `for`!
<fbt> Yeah, that's where my opinion is very much an unpopular one: tab strings everyday!
<fbt> :D
<dminuoso> fbt: Honestly, either use 2 spaces, or tabs.
<dminuoso> Tabs are fine, since you can easily just adjust your editors tabwidth settings. ;-)
<fbt> We had some very painful debates over this at various places I worked at, and the thing that works the best for large groups of people is indent with tabs and align with spaces.
<dminuoso> It's a bit annoying when you mix tabs with spaces for aligning things tho.
<fbt> So that everyone can set their own indentation locally and alignment works for everyone too, since it's static
matp has quit [Read error: Connection reset by peer]
<dminuoso> fbt: Mixing them both is the worst of all.
<fbt> Mixing for the same purpose is horrible.
<dminuoso> fbt: Let's say you indent a method invocation with 2 tabs, and split the arguments across next 2 lines.
<dminuoso> How do you deal with that?
<fbt> But if you indent with tabs and align with spaces, you get a consistent look.
matp has joined #ruby
hahuang62 has joined #ruby
<Burgestrand> Hehe, I've been on this boat before, I'm out. :)
<dminuoso> I suppose.
<dminuoso> fbt: In the end the most flexible solution is to simply use spaces.
DoubleMalt has joined #ruby
<dminuoso> There is just no real advantage of tabs over spaces.
<fbt> True, but you will find people who are really annoyed that you decided you want 4 spaces and they like 8.
<fbt> Or 3.
<fbt> Or 7
<dminuoso> Good modern editors can regulate indentment with single backspace buttons even with expanded tabs.
<matthewd> I'm pro-tabs in life, but there is a very strong convention in ruby; fighting it just doesn't make sense IMO
<fbt> Personally, I've just decided on tabs for indentation and do this in *every* language.
xall has joined #ruby
<fbt> Switching between languages just doesn't make any sense.
troulouliou_div2 has joined #ruby
<dminuoso> At the end I just hate how I regularly open C code, and then have to readjust my tab width settings just because it's a mixture of spaces and tabs for every damn project out there.
<fbt> I mean switching indentation style.
<fbt> Hahaha you haven't seen our puppet templates.
Chau has quit [Ping timeout: 252 seconds]
<matthewd> Well, expect complaints any time you ask people for opinions on your code
<dminuoso> matthewd: Folks can be lucky Im not a code auditor.
<fbt> Yeah, I'm used to indentation remarks.
<dminuoso> :p
<dminuoso> Comment style, that's another one.
<fbt> People aren't usually agressive about it tho.
<dminuoso> Linus rant a couple months ago anyone?
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<fbt> Yeah, comments are so all over the place in virtually any codebase
<fbt> The thing where you frame your comments with hashes? Who thought of that? It doesn't even *look* bice
<fbt> nice*
Rajamaa has quit [Ping timeout: 244 seconds]
<fbt> The most important thing IMO is to be consistent inside one codebase
hahuang62 has quit [Ping timeout: 265 seconds]
<dminuoso> I just wish we had proper multiline comment support in Ruby.
JeanCarloMachado has quit [Quit: Lost terminal]
<dminuoso> And don't get me started =begin =end
jenrzzz has joined #ruby
Rajamaa has joined #ruby
<fbt> Yeah the whole =begin =end thing is weird
<fbt> C-style /* */ would be nice
merlin2049er has left #ruby [#ruby]
xall has quit [Ping timeout: 244 seconds]
<dminuoso> The silly thing is that it would be relatively trivial to patch it into the lexer.
<fbt> But then we will have a war about the asinine alignment of the asterisks!
<fbt> :D
<dminuoso> Which brings us to the rant by Linus.
<fbt> Lius is one of those people who aligns the multiline comments with asterisks, yeah :D
<fbt> who align*
<fbt> Linus*. Jesus what is wrong with me
jenrzzz has quit [Ping timeout: 264 seconds]
blackgoat has quit [Quit: WeeChat 1.5]
minimalism has quit [Quit: minimalism]
solars has joined #ruby
minimalism has joined #ruby
ramortegui has joined #ruby
<solars> hey, does anyone know how to tell ruby csv to parse csv with double double quotes correctly? e.g. """Hotel Test","Zermatt""",CH_352 - in this example the first column contains Hotel Test, Zermatt
<chris2> can i do with YAML.safe_load what safe_yaml does? i.e. ignore unknown tags?
troulouliou_div2 has quit [Ping timeout: 276 seconds]
coolboy has joined #ruby
jonyijoe has joined #ruby
jonyijoe_ has quit [Ping timeout: 265 seconds]
erlingur_ has quit [Ping timeout: 248 seconds]
emilkarl has joined #ruby
edrocks has quit [Ping timeout: 248 seconds]
rodfersou has joined #ruby
coolboy has quit [Ping timeout: 265 seconds]
boogeyman has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
pwnd_nsfw` has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
brendan- has joined #ruby
be_______ has joined #ruby
<apeiros> solars: oy, swiss data? :D
pwnd_nsfw has quit [Ping timeout: 252 seconds]
beauby has joined #ruby
nankyokusei has joined #ruby
<apeiros> solars: can you write the corresponding ruby array-of-strings literal? Because I don't think this is the correct way to encode in csv what you want.
<apeiros> at least the CSV lib parses it the way I'd expect it to
rodfersou has quit [Read error: No route to host]
be_______ has quit [Remote host closed the connection]
be_______ has joined #ruby
<solars> apeiros: according to online validation it is correct, also according to: https://www.csvreader.com/csv_format.php
<apeiros> it is valid csv
<apeiros> but it might not be the way you want it
<solars> apeiros: but I have no idea how to make CSV.parse understand that
rodfersou has joined #ruby
lucasb_ has joined #ruby
<solars> apeiros: it is correct for the way I want it
<solars> I mean
<apeiros> I'd like to verify that. and for that I need the literal, so I know what you want.
devil_tux has joined #ruby
<solars> the problem is that CSV.parse does parse the first comma, which is actually in the escape string
<solars> (of the first field)
<apeiros> no, it is not
troulouliou_div2 has joined #ruby
<apeiros> I assume you want this? ['"Hotel Test, Zermatt"', 'CH_352']
<solars> apeiros: yes
<apeiros> then you quoted it wrong
<apeiros> """Hotel Test"", Zermatt", CH_352
<solars> apeiros: I did not quote it, I receive this csv from google, and it is valid in it's structure
<apeiros> whoops, superfluous space
nankyokusei has quit [Ping timeout: 265 seconds]
<apeiros> """Hotel Test"", Zermatt",CH_352
<apeiros> """Hotel Test" <-- this is '"Hotel Test', and the field ends at the quote.
<matthewd> solars: Do you have an online source we can look at?
<apeiros> "Zermatt""" <-- this is 'Zermatt"', and the field ends at the quote
hurikhan|Work has quit []
<solars> apeiros: the """ means the whole string until """ is quoted, according to the link I posted above
<solars> matthewd: unfortunately it's not public, it contains the exact line I posted
Bellthoven has joined #ruby
<apeiros> solars: no?
<apeiros> solars: care to paste the excerpt which says so?
<lucasb_> triple quotes? like like python syntax? is this valid CSV?
fuzzyhorns has joined #ruby
<apeiros> lucasb_: not the last time I read the rfc. I didn't find it in their link and I'd bet it's non-standard if it waas.
<apeiros> *was
<matthewd> I see no mention of triple quotes there
<matthewd> .. and that would leave quotes around the comma
<apeiros> double quote is the escape for a quote
pawnbox has quit [Remote host closed the connection]
<apeiros> *double double quote (?)
pawnbox has joined #ruby
RTFM[away] has joined #ruby
RTFM[away] has quit [Changing host]
RTFM[away] has joined #ruby
<lucasb_> yes, I get a CSV::MalformedCSVError when I try to input triple quotes
<solars> apeiros: let me find it again
<apeiros> a single double quote is only valid at begin/end of record and serves as delimiter, allowing a field to contain commas and newlines.
nando293921 has joined #ruby
nando294021 has joined #ruby
<solars> I think you're right, it's only escaping a single quote
<solars> single double quote
Lightsword has left #ruby [#ruby]
<apeiros> yeah, no triple quotes in the rfc either: https://www.ietf.org/rfc/rfc4180.txt
pawnbox_ has joined #ruby
<solars> you're right yeah, I couldn't find it, I misread the doc I posted
<apeiros> so the rule of thumb holds again - the answer to "why does X not parse my csv correctly?" is "your csv is incorrect"
<solars> well, I did not expect Google to have errors in their csv :)
<solars> I think it's a double quoting issue (in terms of twice)
nofxx has quit [Ping timeout: 244 seconds]
<solars> according to stackoverflow people ran into the same when using ruby csv with certain options
malconis has joined #ruby
bsrd has joined #ruby
erlingur_ has joined #ruby
pawnbox has quit [Ping timeout: 248 seconds]
hutch34 has joined #ruby
bkxd has quit [Ping timeout: 272 seconds]
brendan- has quit [Quit: Textual IRC Client: www.textualapp.com]
malconis has quit [Remote host closed the connection]
malconis has joined #ruby
brendan- has joined #ruby
troulouliou_div2 has quit [Ping timeout: 276 seconds]
pawnbox_ has quit [Ping timeout: 248 seconds]
<apeiros> my experience with csv and programmers: they fuck it up. a lot.
rodfersou has quit [Ping timeout: 265 seconds]
<apeiros> similar to encodings. sadly.
<apeiros> and timezones.
<apeiros> and floats.
<lucasb_> and... shell quotes :)
<apeiros> I should write a book :(
nando294021 has quit [Ping timeout: 272 seconds]
nando293921 has quit [Ping timeout: 272 seconds]
<apeiros> oh hell stay away from me with shell-outs by other programmers!
<apeiros> that's a bloody accident waiting to happen :(
<apeiros> sql injections are next, I guess
<apeiros> what else is on the list? :)
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nofxx has joined #ruby
<apeiros> though, granted, sql is badly equipped for proper escaping. bind variables often only work in a very narrow scope. e.g. no bind variables for table names.
<hanmac> yeah sql injections always reminds me at "Bobby Tables" ;P
<apeiros> having a ' in your name can be problematic enough :-S
rodfersou has joined #ruby
abernstein has joined #ruby
Burgestrand has joined #ruby
zotherstupidguy has joined #ruby
DoubleMalt has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
<apeiros> solars: google docs does it correctly for me
<apeiros> just tested
jrafanie has joined #ruby
patarr has joined #ruby
<apeiros> """Test Data, quoted""",1234
Rodya_ has joined #ruby
<apeiros> that's ['"Test Data, quoted"', '1234']
<solars> apeiros: correcly in the sense ruby csv does you mean
<apeiros> and that's also how it was in the document (2 cells)
<solars> thanks for the confirmation
<apeiros> correctly in the sense as "according to RFC", which happens to also be what (sensibly) ruby's CSV parses
<apeiros> i.e. google docs does indeed generate standards compliant csv. no idea what you did. seems to me what you thought was 1 cell was really 2 cells.
<apeiros> the things I remember seeing on SO btw. was issues with non-compliant csv. and some parsers will just happily process dirt. rubys does not.
<solars> apeiros: its a bit more clear if you look at the headers which I ommited, it should be a single cell with , in the name
<solars> apeiros: that's good to know
leitz has joined #ruby
zekriad has joined #ruby
xcesariox has joined #ruby
<dminuoso> apeiros: It's not an issue with "sql being badly equipped", but a bad influence of PHPs mysql2_really_no_i_mean_it_safe("SELECT $interpolate FROM USERS");
<apeiros> dminuoso: that's not what I mean
<dminuoso> apeiros: Adapters such as JDBC have had safe interpolation for ages. ;-)
<apeiros> dminuoso: bind variables exist, but you can't use them in all places in a query.
<matthewd> solars: In this particular case, though, I don't see how a looser parser could do it differently. The example you showed is a well-formed CSV string with a particular meaning, which happens to differ from what you want.
<dminuoso> apeiros: It's not as much of an issue for SQL itself, but adapters for those databases.
<apeiros> and I don't view any form of interpolation as safe. separation of query and data (aka bind variables) is the only thing I accept as truly safe :)
hakunin has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
jphase has joined #ruby
b________ has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
xall has joined #ruby
troulouliou_div2 has joined #ruby
Bellthoven has quit []
synthroid has joined #ruby
be_______ has quit [Ping timeout: 265 seconds]
<leitz> What's the syntax to not match a string? The opposite of "my_string.match(/abc/)"
<apeiros> !my_string.match(/abc/)
<hanmac> leitz: or better use !~
edrocks has joined #ruby
<apeiros> or since you won't get matchdata anyway, you can make it more lightweight: my_string !~ /abc/
ChiefAlexander has joined #ruby
xall has quit [Ping timeout: 264 seconds]
symm- has quit [Ping timeout: 244 seconds]
yazdmich is now known as BytesAndCoffee
<solars> matthewd: of course, it's invalid format that is not easily detectable
<solars> matthewd: well unless you compare header size to row size I think
<solars> I'm in google livechat already for this issue
<solars> let's see
ayonkhan has quit [Quit: Textual IRC Client: www.textualapp.com]
edrocks has quit [Ping timeout: 272 seconds]
<dminuoso> Disgusting! I finally was forced to use a dollar variable. Cry.
ponga has joined #ruby
thatsnotjack has joined #ruby
edrocks has joined #ruby
jenrzzz has joined #ruby
<leitz> Thanks! I prefer the extended form but yesterday my brain just couldn't figure it out.
coolboy has joined #ruby
prawnzy has joined #ruby
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
edrocks has quit [Read error: Connection reset by peer]
cdg has joined #ruby
samof76 has quit [Ping timeout: 264 seconds]
maddmaxx has joined #ruby
<apeiros> solars: as said, the format is valid. the data it represents just doesn't match with what you expected :)
<apeiros> i.e. well formed, but semantical difference
jenrzzz has quit [Ping timeout: 244 seconds]
gingray has joined #ruby
<dminuoso> When using case foo when /a/ then /* */ end do I really have to use $~ to get the match data? :(
prawnzy has quit [Ping timeout: 244 seconds]
<apeiros> dminuoso: yes
<apeiros> or the Regexp class methods
xentity1x has joined #ruby
<solars> apeiros: exactly
ICantCook has joined #ruby
fuzzyhorns has quit [Quit: Leaving.]
novikserg has joined #ruby
craigp has quit [Ping timeout: 272 seconds]
gregf_ has quit [Ping timeout: 240 seconds]
DoubleMalt has joined #ruby
eljimador has quit [Quit: Leaving]
solars has quit [Quit: Page closed]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
symm- has joined #ruby
samof76 has joined #ruby
jrafanie has joined #ruby
jcao219 has quit [Ping timeout: 244 seconds]
dionysus69 has quit [Ping timeout: 248 seconds]
mtkd has quit [Ping timeout: 248 seconds]
synthroid has quit [Remote host closed the connection]
mtkd has joined #ruby
wldcordeiro has quit [Ping timeout: 244 seconds]
brendan- is now known as bmurt
SteenJobs has joined #ruby
Snickers has quit [Ping timeout: 265 seconds]
s2013 has joined #ruby
dminuoso has quit [Ping timeout: 244 seconds]
xentity1x has quit [Ping timeout: 264 seconds]
SteenJobs has quit [Client Quit]
zotherstupidguy has quit [Quit: WeeChat 1.5]
tyang has quit [Ping timeout: 264 seconds]
abernstein has quit [Quit: abernstein]
axisys has joined #ruby
dminuoso has joined #ruby
merlin2049er has joined #ruby
fuzzyhorns has joined #ruby
SteenJobs has joined #ruby
kimegede has quit [Quit: Leaving...]
tyang has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
submitnine has quit [Remote host closed the connection]
merlin2049er1 has joined #ruby
A_Drone has joined #ruby
merlin2049er has quit [Ping timeout: 264 seconds]
Rajamaa has quit [Quit: Konversation terminated!]
abernstein has joined #ruby
xall has joined #ruby
merlin2049er1 has left #ruby [#ruby]
wldcordeiro has joined #ruby
A_Drone has quit [Ping timeout: 264 seconds]
dionysus69 has joined #ruby
cdg has quit [Remote host closed the connection]
cevett has quit [Ping timeout: 272 seconds]
bmurt has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
gregf_ has joined #ruby
xall has quit [Ping timeout: 252 seconds]
Jameser_ has joined #ruby
wldcordeiro has quit [Client Quit]
wldcordeiro has joined #ruby
cevett has joined #ruby
Jameser has quit [Ping timeout: 264 seconds]
Jakey3 has quit [Remote host closed the connection]
brendan- has joined #ruby
elifoster has joined #ruby
Axl_ has joined #ruby
samof76 has quit [Ping timeout: 264 seconds]
Rodya_ has quit [Remote host closed the connection]
_sfiguser has joined #ruby
Rodya_ has joined #ruby
kobain has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
emilkarl has quit [Read error: Connection reset by peer]
newbie22 has joined #ruby
emilkarl has joined #ruby
newbie22 has quit [Client Quit]
bba has joined #ruby
dliekw has joined #ruby
bba has quit [Client Quit]
be_______ has joined #ruby
JustinHitla_ has joined #ruby
<JustinHitla_> is this channel about pokemongo ?
<ljarvis> no
newbie22 has joined #ruby
newbie22 has quit [Max SendQ exceeded]
Jameser_ has quit [Quit: Textual IRC Client: www.textualapp.com]
Rodya_ has quit [Ping timeout: 272 seconds]
newbie22 has joined #ruby
emilkarl has quit [Client Quit]
<JustinHitla_> is ruby some sort of language ?
Devalo has joined #ruby
b________ has quit [Ping timeout: 265 seconds]
newbie22 has quit [Client Quit]
tyang has quit [Ping timeout: 264 seconds]
newbie22 has joined #ruby
fivmo has left #ruby ["Textual IRC Client: www.textualapp.com"]
<dminuoso> JustinHitla_: No. We hijack trains and sell the blinky stones.
newbie22 has quit [Max SendQ exceeded]
b________ has joined #ruby
Axl_ has quit [Ping timeout: 244 seconds]
dminuoso has quit [Remote host closed the connection]
TomyWork has quit [Ping timeout: 240 seconds]
be_______ has quit [Ping timeout: 252 seconds]
synthroid has joined #ruby
Axl_ has joined #ruby
abernstein has quit [Quit: abernstein]
jhooker has joined #ruby
Axl__ has joined #ruby
Axl_ has quit [Ping timeout: 264 seconds]
Axl__ is now known as axl_
ferr has quit [Quit: WeeChat 1.5]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
nankyokusei has joined #ruby
saneax is now known as saneax-_-|AFK
rmn has quit [Quit: leaving]
Silthias has quit [Ping timeout: 252 seconds]
Xiti` has joined #ruby
cschneid_ has joined #ruby
armin has joined #ruby
JustinHitla_ has left #ruby [#ruby]
armin has quit [Client Quit]
axl_ has quit [Ping timeout: 248 seconds]
Pixi_ has joined #ruby
armin has joined #ruby
Xiti has quit [Ping timeout: 264 seconds]
dviola has joined #ruby
aufi has quit [Ping timeout: 244 seconds]
<yorickpeterse> Ruby?
axl_ has joined #ruby
Oclair_ has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
Xiti` has quit [Ping timeout: 248 seconds]
Oclair has quit [Ping timeout: 265 seconds]
patarr has quit [Quit: patarr]
<ule> hey guys.. is there a magic ruby method to change the value for specific keys inside a hash without looping over all the elements?
<ule> not sure what's the best way?
patarr has joined #ruby
<ule> I was thinking in something like: my_hash.some_function(key_a, key_b).another_function( if key_a == 'Y', key_a='yes') ...
<ule> !ruby tap
NTrash has joined #ruby
aryaching has joined #ruby
<apeiros> hash[key] = value
brendan- has joined #ruby
aganov has quit [Remote host closed the connection]
<hanmac> ule: there is also Hash#store but it does not return the hash itself
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
malconis has joined #ruby
beauby has quit [Ping timeout: 248 seconds]
jonyijoe has quit [Remote host closed the connection]
valkyr1e_ has joined #ruby
h1fuelcell has joined #ruby
jonyijoe has joined #ruby
malconis has quit [Ping timeout: 264 seconds]
jonyijoe has quit [Ping timeout: 265 seconds]
ichkv1 has joined #ruby
pawnbox has joined #ruby
mark_66 has quit [Remote host closed the connection]
dminuoso has joined #ruby
synthroid has quit [Remote host closed the connection]
lacour has joined #ruby
hahuang62 has joined #ruby
amclain has joined #ruby
malconis has joined #ruby
<ule> I know how to do this.. I'll create my code here and will show to you guys
xall has joined #ruby
<ule> some of you always has a better solution with just one line
<ule> :)
<ule> I'm still thinking in C
bmurt has joined #ruby
<machty> today i have to debug why memory usage in my ruby server has suddenly spiked. a single API endpoint query makes it spike by 200mB
<machty> can someone confirm my understanding: a spike of 200mb does _not_ necessarily imply a leak, right?
malconis has quit [Client Quit]
<machty> if constructing the response to this api query takes a vast amount of memory, in which time the GC collects and can't recover unreferences objects, then I should expect memory usage to jump
<machty> and do so permanently
jsrn_ has quit [Quit: Leaving]
Rodya_ has joined #ruby
Hobbyboy has quit [Max SendQ exceeded]
valkyr1e_ has left #ruby [#ruby]
jackjackdripper has joined #ruby
Hobbyboy has joined #ruby
erlingur_ has quit [Ping timeout: 248 seconds]
patarr has quit [Quit: patarr]
FINbit has quit [Ping timeout: 265 seconds]
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
matp_ has joined #ruby
valkyr1e has left #ruby [#ruby]
jenrzzz has joined #ruby
cdg has joined #ruby
ChiefAlexander has quit [Remote host closed the connection]
<h1fuelcell> If I use a class-within-class style declaration, and use an include statement in the parent class, the nested classes will not be affected by that inclusion right?
matp has quit [Ping timeout: 252 seconds]
<h1fuelcell> Because I keep reading that nested classes are only for namespacing and will not cause any change of functionality
ChiefAlexander has joined #ruby
Coldblackice has joined #ruby
elifoster has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
dsea has quit [Quit: Leaving]
<dminuoso> h1fuelcell: Correct.
<h1fuelcell> Hmmmmm
<dminuoso> h1fuelcell: In a nutshell, an include inserts the parameter module into the inheritance chain of the target class.
synthroid has joined #ruby
<h1fuelcell> and nested classes don't inherit
<dminuoso> Correct
b________ has quit [Ping timeout: 272 seconds]
coolboy has quit [Ping timeout: 264 seconds]
duderonomy has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
ChiefAlexander has quit [Client Quit]
<h1fuelcell> So I want to use Resque::Mailer in my Rails project. That class provides an `include`able structure (it's a nested module) called Resque::Mailer. Now I need two identical classes that are different by just one setting: the name of the queue.
conta has quit [Ping timeout: 252 seconds]
<dminuoso> h1fuelcell: Or rather to put it the other way around, when a method or constant lookup happens, it looks for the method in its own class, and any of *its* ancestors.
xcesariox has joined #ruby
<h1fuelcell> So I went class EmailReceptionist include Resque::Mailer class InternalMailer default_queue_name="internal" end class ExternalMailer default_queue_name="external" end end
jonyijoe has joined #ruby
<h1fuelcell> which won't work of course b/c of what we just discussed
xentity1x has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
<h1fuelcell> I initially had a couple files called InternalMailer, ExternalMailer which independently include(d) the Resque::Mailer module
<h1fuelcell> which worked, just had duplication
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<h1fuelcell> How do I get what I want :P
Alayde has joined #ruby
<dminuoso> h1fuelcell: I did it as following with my worker stuff in rails: I had a namespace.rb module, and a namespace/base.rb class which set up the worker, and every namespace/worker then derived from namespace/base
fuzzyhorns has quit [Quit: Leaving.]
jcao219 has joined #ruby
<dminuoso> h1fuelcell: That way you could define common attributes in the namespace.rb module, which the namespace/base.rb would refer if you wanted it like that.
ChiefAlexander has joined #ruby
ziprar has joined #ruby
zipace has quit [Disconnected by services]
malconis has joined #ruby
<flying> hi guys can you help me with an exercise in ruby? :)
<flying> it's quite difficult for me
fuzzyhorns has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
centrx has joined #ruby
harai has joined #ruby
<dminuoso> h1fuelcell: However, there is a tricky situation where you might feel like you have access to the outer class.
Vingador has joined #ruby
<h1fuelcell> oho dminuoso thank you for saying that, lol I just discovered a folder full of jobs just like this in this codebase
nitric has joined #ruby
<dminuoso> h1fuelcell: Constant lookup works as follows: First it looks whether it can find a constant anywhere in the current scope (which if you are still in the outer open class includes any constants defined in there)
<h1fuelcell> I guess there's not much to do about the duplication
novikserg has quit [Quit: Page closed]
<flying> a non empty zero indexed array A consisting of N integers is given. you can perform a single swap operation in array A. This operation takes 2 indexes I and J such that 0<=I<=J<N and exchanges the values of A[I] and A[J].
<flying> the goal is to check whether array A can be sorted into non decreasing order by performing at most one swap operation.
<flying> how can I start it?
<flying> :(
SteenJobs has joined #ruby
Couch has quit [Ping timeout: 248 seconds]
beauby has joined #ruby
bsrd has quit [Quit: WeeChat 1.5]
Pixi_ has quit [Quit: Pixi_]
<h1fuelcell> thanks dminuoso
abernstein has joined #ruby
Voker57|2 has joined #ruby
claudiuinberlin has quit []
<lucasb_> flying: interesting problem. let me think for a while :)
Voker57|2 has quit [Client Quit]
<flying> ok :)
beauby has quit [Ping timeout: 265 seconds]
<lucasb_> one can start walking the array, from index 0
<dminuoso> h1fuelcell: However! It's not the entire truth.
<lucasb_> once a element is found, which is less than the previous, then a swap must be made
<dminuoso> h1fuelcell: There is a way to directly tap into a parents class, and that's by specifying it directly.
blackwind_123 has joined #ruby
<dminuoso> Im prepping an extensive example to show all the behavior.
lxsameer has quit [Quit: WeeChat 1.5]
dfinninger has joined #ruby
<lucasb_> then start walking the array backwards, to find the element that must be swapped
jonyijoe has quit [Remote host closed the connection]
jonyijoe has joined #ruby
<lucasb_> after, the swap, you continue walking from where you are at. if it reaches the end, then it only needed 1 swap
renderful has joined #ruby
<h1fuelcell> that would be interesting to see! These things won't likely pass code review in my team though :D
<h1fuelcell> But I'm interested to know for myself
jonyijoe has quit [Remote host closed the connection]
_sfiguser has quit [Ping timeout: 244 seconds]
jonyijoe has joined #ruby
<dminuoso> h1fuelcell: https://eval.in/655009
finisherr has joined #ruby
<dminuoso> h1fuelcell: However, I would consider it very poor style to pry into an outside class like that.
rodfersou is now known as rodfersou|lunch
<dminuoso> h1fuelcell: The mechanism with a common base class I mentioned is the clean way to tackle your problem. :)
mrmortondk has joined #ruby
render___ has quit [Ping timeout: 276 seconds]
<h1fuelcell> thanks :)
<sagax> hi all
Guest38 has joined #ruby
<havenwood> sagax: hi
<h1fuelcell> oh my god so writing class Outer2 a second time won't overwrite the whole class from the first time
<h1fuelcell> this is new
<dminuoso> h1fuelcell: No, it reopens the class.
<dminuoso> Which more often than not is also poor style.
jaequery has joined #ruby
<h1fuelcell> thank goodness!
SteenJobs has quit [Quit: SteenJobs]
<dminuoso> h1fuelcell: And I made a slight mistake: https://eval.in/655019
SteenJobs has joined #ruby
Xiti has joined #ruby
<dminuoso> Its fixed now
jaequery has quit [Client Quit]
<flying> yes but I need to swap it too :(
SeepingN has joined #ruby
dliekw has quit [Remote host closed the connection]
stamina has joined #ruby
tyang has joined #ruby
SteenJobs has quit [Ping timeout: 272 seconds]
shinnya has joined #ruby
elenatanasoiu has quit [Quit: WeeChat 1.5]
leitz has quit [Quit: Page closed]
elenatanasoiu has joined #ruby
blaxter has quit [Quit: foo]
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
ichkv1 has quit [Remote host closed the connection]
ichkv has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
centrx has quit [Remote host closed the connection]
replay has joined #ruby
neohunter has joined #ruby
rakm has joined #ruby
chouhoulis has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
A_Drone has joined #ruby
nikivi has joined #ruby
_sfiguser has joined #ruby
SeepingN_ has quit [Quit: The system is going down for reboot NOW!]
SeepingN has joined #ruby
stamina has quit [Ping timeout: 272 seconds]
Guest19391 has joined #ruby
A_Drone has quit [Ping timeout: 248 seconds]
anisha has joined #ruby
Beams has quit [Quit: .]
behemot has joined #ruby
xall has quit [Ping timeout: 272 seconds]
Ishido has joined #ruby
sp_ has joined #ruby
fuzzyhorns has quit [Quit: Leaving.]
fuzzyhorns has joined #ruby
flying has quit []
ChiefAlexander_ has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
novikserg has joined #ruby
craigp has joined #ruby
Akuma has joined #ruby
salut has quit [Quit: salut]
<sagax> what about table like this for ruby? http://dorey.github.io/JavaScript-Equality-Table/unified
<havenwood> sagax: It would be a boring table since Ruby is sane. :-P
<sagax> we have comparison table?
ChiefAlexander has quit [Ping timeout: 248 seconds]
<dminuoso> havenwood: It would be crazy, since it would have to be 5 dimensional.
<havenwood> A hypertable.
Rodya_ has quit [Quit: Leaving...]
RTFM[away] has quit [Ping timeout: 264 seconds]
<sagax> ^_^
<dminuoso> sagax: The real speciality that Ruby has comes from the fact that ==, ===, eql and equal? all do different thing.
AlexRussia_ has joined #ruby
<dminuoso> So a table depicing how they relate would be more useful ;p
troulouliou_div2 has quit [Quit: Leaving]
alaibe has quit [Ping timeout: 264 seconds]
<havenwood> >> a = [true, false, 1, 0, -2, 'true', 'false', '1', '0', '-1', '', nil, Float::INFINITY, -Float::INFINITY, [], {}, [[]], [0], [1], Float::NAN]; a.map { |i1| a.count { |i2| i1 == i2 } }
<ruby[bot]> havenwood: # => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0] (https://eval.in/655064)
[Butch] has joined #ruby
nikivi has quit [Quit: irc]
kobain has quit [Ping timeout: 252 seconds]
<hanmac> imo this javascript table is incomplete, what about 0.0 and "0.0" ? i remember there is some discontinuity in php about that
<havenwood> sagax: In Ruby it'd be a straight diagonal line, things only being equal to themselves - until you get to Float::NAN which isn't equal to itself or anything else.
elenatanasoiu has quit [Ping timeout: 265 seconds]
<dminuoso> Since you asked for it, an equivalent table for ruby.
<dminuoso> ;))
<hanmac> NAN is equal to NO ONE! XD
<havenwood> Batman!
<dminuoso> Mmm
bsrd has joined #ruby
<dminuoso> Well, and then there's this Float::EPSILON bit
jenrzzz has joined #ruby
NTrash has quit [Quit: Konversation terminated!]
ace05 has joined #ruby
<ace05> join #android
cdg has quit [Ping timeout: 248 seconds]
NTrash has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
gregf_ has quit [Ping timeout: 240 seconds]
conta has joined #ruby
cdg has joined #ruby
lxsameer has joined #ruby
akp has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
dionysus70 is now known as dionysus69
Velizar has joined #ruby
stamina has joined #ruby
rcvalle has joined #ruby
duderonomy has joined #ruby
Devalo has quit [Remote host closed the connection]
bocaneri has quit [Read error: Connection reset by peer]
pawnbox has quit [Ping timeout: 264 seconds]
pec has quit [Remote host closed the connection]
Snowy has quit [Remote host closed the connection]
Snowy has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
fiddlerwoaroof has joined #ruby
jaequery has joined #ruby
stamina has quit [Ping timeout: 244 seconds]
miqlas-H has joined #ruby
bluOxigen has joined #ruby
nankyokusei has joined #ruby
bebbo has joined #ruby
chouhoulis has joined #ruby
rodfersou|lunch is now known as rodfersou
tlaxkit has quit [Quit: tlaxkit]
chouhoulis has quit [Remote host closed the connection]
squarebracket has joined #ruby
Snowy has quit [Ping timeout: 264 seconds]
renderf__ has joined #ruby
<squarebracket> Is there a way to set the base_url for geminabox?
renderful has quit [Ping timeout: 248 seconds]
dhk has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has joined #ruby
AlphaAtom has joined #ruby
pawnbox has joined #ruby
djbkd has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
xall has joined #ruby
elifoster has joined #ruby
alaibe has joined #ruby
sergio_101 has joined #ruby
claudiuinberlin has joined #ruby
fantasticsid has joined #ruby
Silthias has joined #ruby
Devalo has joined #ruby
beauby has joined #ruby
tyang has quit [Ping timeout: 264 seconds]
nickjj has quit [Ping timeout: 264 seconds]
anisha has quit [Quit: This computer has gone to sleep]
Devalo has quit [Ping timeout: 272 seconds]
ElFerna has joined #ruby
patarr has joined #ruby
vdamewood has joined #ruby
Silthias has quit [Ping timeout: 252 seconds]
LastWhisper____ has joined #ruby
prawnzy has joined #ruby
BTheOne has joined #ruby
nickjj has joined #ruby
tyang has joined #ruby
ElFerna has quit [Quit: ElFerna]
miqlas-H has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ramfjord has joined #ruby
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
coolboy has joined #ruby
jcao219 has quit [Ping timeout: 265 seconds]
brendan- has joined #ruby
rodfersou is now known as rodfersou|afk
duderonomy has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
novikserg has quit [Ping timeout: 240 seconds]
dfinning_ has joined #ruby
JoshS has quit [Quit: Leaving]
RTFM[away] has joined #ruby
RTFM[away] has quit [Changing host]
RTFM[away] has joined #ruby
BTheOne has quit [Remote host closed the connection]
dfinning_ has quit [Read error: Connection reset by peer]
ace05 has quit [Remote host closed the connection]
AlphaAtom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
futilegames has quit [Quit: futilegames]
ben_ has joined #ruby
ace05 has joined #ruby
novikserg has joined #ruby
BTheOne has joined #ruby
myndzi` has joined #ruby
<BTheOne> hello
<myndzi`> what is `::Bar = Foo::Bar` doing?
<myndzi`> it's not inside any class/module/whatever block
dfinninger has quit [Ping timeout: 265 seconds]
beauby has quit [Ping timeout: 252 seconds]
<chrisseaton> myndzi`: it's assigning a constant called Bar to be the same as Foo::Bar, but the :: at the start of Bar means set it at the top level
conta has quit [Quit: conta]
<chrisseaton> if it isn't inside anything then the leading :: may be redundant, but harmless
Puffball has quit [Remote host closed the connection]
<myndzi`> so anything that includes this file will have 'Bar' accessible
<myndzi`> unqualified
<havenwood> BTheOne: hi
synthroid has quit [Remote host closed the connection]
<chrisseaton> without seeing more code, I believe so
<myndzi`> okay, thanks :)
<myndzi`> I can see why they might use the :: to make the intent clearer, but as I'm new to Ruby, I wasn't sure if it was doing anything 'special' -- and this is a tricky one to search!
biberu has quit [Ping timeout: 248 seconds]
ajsharma has joined #ruby
elenatanasoiu has joined #ruby
futilegames has joined #ruby
KCmetro has joined #ruby
elifoster has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
chouhoulis has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cdg has quit [Ping timeout: 264 seconds]
Robtop__ has joined #ruby
biberu has joined #ruby
shinnya has quit [Ping timeout: 272 seconds]
futilegames has quit [Quit: futilegames]
fantasticsid has quit [Ping timeout: 272 seconds]
pwnd_nsfw` has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Remote host closed the connection]
renderfu_ has joined #ruby
Guest1973 has quit [Changing host]
Guest1973 has joined #ruby
dhk has quit [Quit: Leaving]
renderf__ has quit [Ping timeout: 244 seconds]
synthroid has joined #ruby
elifoster has joined #ruby
Guest1973 has left #ruby [#ruby]
jcao219 has joined #ruby
CHOCODARCHEVILLE has joined #ruby
nando293921 has joined #ruby
nando294021 has joined #ruby
futilegames has joined #ruby
myndzi` has quit [Quit: Page closed]
armyriad has quit [Ping timeout: 272 seconds]
ben_ has quit [Read error: Connection reset by peer]
<squarebracket> novikserg: yeah, but for the server, not the client. I've got a Dockerfile all set up but I can't seem to figure out how to pass any host information through to it.
ben_ has joined #ruby
fantasticsid has joined #ruby
<squarebracket> Sinatra says I can `set :base_url, 'the-url'`, but I added that above the `run Geminabox::Server` call to no effect...
tyang has quit [Ping timeout: 264 seconds]
novikserg has quit [Ping timeout: 240 seconds]
<squarebracket> I don't really know anything about rackup though, I feel like I'm missing something obvious :\
xall has quit [Ping timeout: 244 seconds]
claudiuinberlin has joined #ruby
armyriad has joined #ruby
Macrobiotic has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
last_staff has quit [Quit: last_staff]
jcao219 has quit [Ping timeout: 264 seconds]
fantasticsid has quit [Quit: ERC (IRC client for Emacs 25.1.50.1)]
AlphaAtom has joined #ruby
CHOCODARCHEVILLE has quit [Excess Flood]
renderf__ has joined #ruby
Silthias has joined #ruby
renderfu_ has quit [Ping timeout: 264 seconds]
xall has joined #ruby
Velizar has quit [Ping timeout: 265 seconds]
futilegames has quit [Ping timeout: 244 seconds]
futilegames has joined #ruby
renderf__ has quit [Ping timeout: 265 seconds]
renderfu_ has joined #ruby
daemonwrangler has quit [Ping timeout: 252 seconds]
charliesome_ has joined #ruby
sneakers has joined #ruby
xall has quit [Ping timeout: 272 seconds]
Vingador has quit [Remote host closed the connection]
nikivi has joined #ruby
charliesome has quit [Ping timeout: 252 seconds]
futilegames_ has joined #ruby
zotherst1 has joined #ruby
futilegames has quit [Ping timeout: 272 seconds]
futilegames_ is now known as futilegames
AlphaAtom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Velizar has joined #ruby
A_Drone has joined #ruby
elvin has joined #ruby
pratch has quit [Read error: Connection reset by peer]
boogeyman has quit [Quit: bb]
gizless has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
A_Drone has quit [Ping timeout: 264 seconds]
nankyokusei has joined #ruby
futilegames has quit [Ping timeout: 252 seconds]
nankyokusei has quit [Ping timeout: 265 seconds]
tyang has joined #ruby
bluOxigen has quit [Ping timeout: 248 seconds]
Livecodingtv_Ale has joined #ruby
renderf__ has joined #ruby
emilkarl has joined #ruby
spider-mario has quit [Quit: WeeChat 1.5]
Robtop__ has quit [Read error: Connection reset by peer]
renderfu_ has quit [Ping timeout: 264 seconds]
spider-mario has joined #ruby
Robtop__ has joined #ruby
abernstein_ has joined #ruby
johnmilton has quit [Remote host closed the connection]
abernstein has quit [Ping timeout: 248 seconds]
abernstein_ is now known as abernstein
tyang has quit [Ping timeout: 264 seconds]
cjbischof_ has joined #ruby
a1fa has quit [Ping timeout: 265 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
a1fa has joined #ruby
craigp has quit [Ping timeout: 264 seconds]
fuzzyhorns has quit [Quit: Leaving.]
<LyndsySimon> I'm familiar with Object#method_mission, which is roughly equivalent to Python's object#__getattr__. Python also has object#__getattribute__ though, which intercepts method calls even if they exist. Does Ruby have an equivalent?
<apeiros> method mission! to the method mobile! :D
<LyndsySimon> :)
<apeiros> LyndsySimon: no, afaik not
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<apeiros> if you want that kind of thing, you'll usually work with a proxy object which inherits from BasicObject and delegates
JeanCarloMachado has joined #ruby
ocbtec has quit [Quit: leaving]
<LyndsySimon> Aww. OK, that's unfortunate then. I even tried implementing method_missing on mixin prepended to a class, which I thought might have done it.
<LyndsySimon> Yeah, delegation might do the trick. Thanks, I'll take a look.
al2o3-cr has joined #ruby
<apeiros> no. method lookup is: object's singleton class -> object's class' ancestry -> object's singleton class' method_missing -> object's class' ancestry's method_missing -> raise NoMethodError
erlingur_ has joined #ruby
<LyndsySimon> Wait, is delegate a rails-only thing?
webhat has joined #ruby
<apeiros> i.e. if *anything* in the chain responds, no method_missing is triggered. this btw. also means that method_missing is inherently more expensive than an existing method :)
<apeiros> delegation is a pattern.
<apeiros> Object#delegate is a rails thing
<apeiros> or rather, an AS thing
* LyndsySimon nods
<apeiros> delegation is trivial enough, but there's stuff like Forwardable in stdlib if you really need assistance ;-p
<dminuoso> I was about to say..
<apeiros> re trivial: def method_missing(name, *args, &block); if handle_myself? then … yourstuff … else @delegatee.public_send(name, *args, &block end end
<apeiros> ± one syntax error (like a missing ")")
emilkarl has quit [Read error: Connection reset by peer]
johnmilton has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
emilkarl has joined #ruby
Coldblackice has quit []
boogeyman has joined #ruby
<dminuoso> apeiros: can you clean up #rubyonrails ?
testo3 is now known as testo
<apeiros> pyemkey?
coolboy has quit [Remote host closed the connection]
<apeiros> I do have ops in rails, but I don't know the bot :(
<apeiros> no !fixcon :'(
<dminuoso> Just toss in random bans
<dminuoso> ban like *@*
<dminuoso> that ought to do the trick
<apeiros> btw., that's OT :)
charliesome_ has quit [Ping timeout: 248 seconds]
glundgren has joined #ruby
glundgren is now known as acidbyte
tyang has joined #ruby
wugy has quit []
mesamoo has joined #ruby
anisha has joined #ruby
xall has joined #ruby
abernstein has quit [Quit: abernstein]
zatherz has joined #ruby
<zatherz> is anyone here experienced with Parslet? how could I take in a parameter in a Parslet::Transform's initialize then use it inside one of the Transform's rules?
hammond has quit [Ping timeout: 252 seconds]
<dminuoso> zatherz: Fairly simple: Derive from Parslet::Transform, override def initialize and call super() inside
tyang has quit [Ping timeout: 264 seconds]
bebbo has quit []
<dminuoso> ?next
<ruby[bot]> dminuoso: I don't know anything about next
* dminuoso kicks ruby[bot]
hammond has joined #ruby
hammond has quit [Changing host]
hammond has joined #ruby
hammond has joined #ruby
hammond has quit [Changing host]
<zatherz> dminuoso: That's funny
<zatherz> because it's wrong.
last_staff1 has joined #ruby
<dminuoso> zatherz: How is that wrong?
<zatherz> Parslet::Transform runs rules in a special Context, and the self does not refer to the Parslet::Transform class instance
acidbyte has quit []
last_staff1 is now known as last_staff
nadir has joined #ruby
nikivi has quit [Quit: irc]
<dminuoso> zatherz: Does it have to be pretty, compact and/or elegant?
elvin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elvin_ has joined #ruby
<dminuoso> zatherz: I got at least one hacky solution in mind already. :-)
craigp has joined #ruby
<zatherz> dminuoso: It doesn't have to be the prettiest, most compact and most elegant, but it shouldn't be the ugliest, least compact and least elegant
symm- has quit [Quit: Leaving...]
lucasb_ has left #ruby [#ruby]
kobain has joined #ruby
<matthewd> zatherz: Isn't that what the context parameter to apply is for?
<zatherz> `puts calltransf.apply (typetransf.apply (parser.parse ARGV[0]), :ttest => 13)`, then inside a rule `puts ttest`, errors with method not nfound
coolboy has joined #ruby
<dminuoso> zatherz: Where is this rule defined on?
<dminuoso> zatherz: calltransf or typetransf?
<zatherz> CallTransform (calltransf)
<matthewd> I'd focus on why the documented thing isn't cooperating, rather than inventing a second approach from scratch, personally
hammond is now known as lz
<matthewd> .. you're passing it to typetransf.apply
<matthewd> Oh, no you're not
<matthewd> Weird spaces are weird, and confusing
elastix has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
<sagax> how to print all access modules in pry?
nadir is now known as Omega-41
armin has quit [Quit: brb]
<dminuoso> sagax: What is an access module?
elvin_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<sagax> it's all installed modules example
craigp has quit [Ping timeout: 265 seconds]
replay has quit [Ping timeout: 252 seconds]
armin has joined #ruby
<dminuoso> sagax: a module is not a package in the sense that you understand it.
eljimmy has joined #ruby
<dminuoso> sagax: are you talking about gems?
<sagax> or, exactly
A_Drone has joined #ruby
<sagax> i mean packages
Omega-41 is now known as nadir
<dminuoso> sagax: Inside Ruby or outside?
<sagax> inside
<zatherz> dminuoso: if you're want to test it, https://zatherz.eu/junk/isolatedbugtest.rb
<dminuoso> sagax: Gem::Specification gives you what you want
<sagax> pry or just ruby script
<zatherz> a minimal test case
Jackneill has joined #ruby
<zatherz> actuall wait fuck
<dminuoso> note you have to require rubygems for that
<zatherz> welp
<zatherz> nevermind, then
<zatherz> after fixing the test case it actually works, so it has to be a problem with the code
abernstein has joined #ruby
<havenwood> sagax: You might also want to take a look at: $LOADED_FEATURES
rashid has quit [Ping timeout: 244 seconds]
armin has quit [Client Quit]
<sagax> the $LOADED_FEATURES empty
armin has joined #ruby
<zatherz> dminuoso: holy shit, it turns out that the confusing spacing is what caused the problem
<dminuoso> sagax: I doubt that.
<zatherz> somehow
<dminuoso> zatherz: You got my curiosity.
<dminuoso> zatherz: Can you gist both variants for me?
<dminuoso> Just the raw syntax.
<zatherz> will do after testing more
<matthewd> Ah, yes, I see it now
<zatherz> I see it too.
AlphaAtom has joined #ruby
<zatherz> `typetransf.apply (parser.parse ARGV[0])`
<zatherz> unless I'm confusing something
<zatherz> because I do know that when I tried `rule (...something...)`, it errored, and with `rule(...something...)` it didn't
A_Drone has quit [Ping timeout: 264 seconds]
<dminuoso> zatherz: well by removing the space, you make it clear that the parens belong to the method call
<dminuoso> zatherz: if you leave a space, it could also indicate a grouped expression
<zatherz> ahhhh
<dminuoso> though Im curious how m (a, b) could be misunderstood
<elastix> hi guys someone can help me to do one exercise in ruby?
<matthewd> `a (b), c` == `a(b, c)`
<zatherz> I'm pretty new to ruby, started learning it like 2 days ago, thanks for making that clear!
<dminuoso> elastix: Hey. Just ask :)
<matthewd> Well, `a((b), c)`
<dminuoso> zatherz: Please gist the original non-working line of code
<dminuoso> zatherz: and the now fixed line of code
armin has quit [Client Quit]
<dminuoso> I would like to analyze this deeper. )
<dminuoso> :)
<dminuoso> ast>> puts calltransf.apply (typetransf.apply (parser.parse ARGV[0]), :ttest => 13)
<ruby[bot]> dminuoso: I have parsed your code, the result is at https://eval.in/655100
<dminuoso> ast>> puts calltransf.apply(typetransf.apply(parser.parse ARGV[0]), :ttest => 13) # working
<ruby[bot]> dminuoso: I have parsed your code, the result is at https://eval.in/655101
<dminuoso> uhh
replay has joined #ruby
<elastix> I was trying to do the exercise of another user ... just for test and improve my ruby skill :)
dionysus69 has quit [Ping timeout: 264 seconds]
<elastix> a non empty zero indexed array A consisting of N integers is given. you can perform a single swap operation in array A. this operation takes 2 indexes I and J such that 0<=I<=J<N and exchanges the value of A[I] and A[J] . the goal is to check whether array A can be sorted into non decresing order by performing at most one swap operation.
AlphaAtom has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KCmetro has quit [Quit: Leaving...]
bigkevmcd has joined #ruby
malconis has joined #ruby
fuzzyhorns has joined #ruby
bjensen82 has joined #ruby
whathappens has joined #ruby
<apeiros> fascinating that I <= J. I'd expect I < J. Since I = J makes no sense.
elifoster has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<bjensen82> , ideas please?
<bjensen82> I have the hash: {"foo"=>[:ffff, :fdsfds, :ffdsf], "bar"=>[1, 2, 3, 4]} which I could like to convert to the number of values as values so it would be: {"foo" => 3, "bar" => 4}.
<matthewd> apeiros: Simplifies the degenerate case of an already-sorted list ;)
<apeiros> matthewd: "at most one swap"
<matthewd> "simplifies"
<apeiros> it's valid to not swap. so I wouldn't expect to perform swap-noop
<dminuoso> bhaak: What have you tried so far?
<apeiros> bleh :)
<dminuoso> err bjensen82.
<dminuoso> Damn irssi not tab completing properly. :(
RTFM[away] has quit [Ping timeout: 252 seconds]
fuzzyhorns has quit [Client Quit]
fuzzyhorns has joined #ruby
<bjensen82> dminuoso: well result = {}; {"foo"=>[:ffff, :fdsfds, :ffdsf], "bar"=>[1, 2, 3, 4]}.each_pair{|k,v| result[k] = v.size}, but it was hoping for a more elegant solution without the use of the temp variable
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
* apeiros still confused why people even use .each_pair instead of .each
<dminuoso> bjensen82: Use Enumerable#map
<havenwood> bjensen82: map { |k, v| [k, v.size] }.to_h
<dminuoso> bjensen82: The resulting Array can be transformed back into a hash using #to_h
<dminuoso> havenwood: SHUSH
<dminuoso> :(
* havenwood goes back to eating lunch
<dminuoso> You owe me half your lunch.
<bjensen82> ah yeah, the transformation back to hash..forgot about that..thanks guys
<dminuoso> bjensen82: though honestly your method is fine too.
FastJack has quit [Quit: leaving]
<bhaak> \]
<bjensen82> dminuoso: yeah, but i was just looking for a one liner :-). I tend to forget the core methods
<dminuoso> bjensen82: Often the desire to write one liners hurts readability of code.
tyang has joined #ruby
<bjensen82> dminuoso: agreed, but I knew there was a way in this case and I wanted to know it :-)
Oclair_ has quit [Read error: Connection reset by peer]
Oclair has joined #ruby
<matthewd> {"foo"=>[:ffff, :fdsfds, :ffdsf], "bar"=>[1, 2, 3, 4]}.transform_values(&:size)
<matthewd> ActiveSupport (boo, hiss), and 2.4
<dminuoso> ActiveThisNeedsToDie :S
anisha has quit [Quit: This computer has gone to sleep]
whathappens has quit [Read error: Connection reset by peer]
blackgoat has joined #ruby
craigp_ has joined #ruby
<elastix> how can I check that all the elements of an array are bigger than 100?
<elastix> should I use a for loop?
whathappens has joined #ruby
<dminuoso> elastix: Use Enumerable#any?
<matthewd> elastix: Start by checking Array and Enumerable for the most likely-looking methods
<dminuoso> elastix: or Enumerable#all?
<elastix> is it a special function?
jenrzzz has joined #ruby
<dminuoso> elastix: How about you figure it out and tell us?
cevett has quit [Read error: Connection reset by peer]
cevett has joined #ruby
ChiefAlexander_ has quit [Read error: Connection reset by peer]
LoneHerm_ has quit [Read error: Connection reset by peer]
phaza has quit [Read error: Connection reset by peer]
dviola has quit [Quit: WeeChat 1.5]
claudiuinberlin has quit []
xall has quit [Read error: Connection reset by peer]
diego2 has joined #ruby
ChiefAlexander has joined #ruby
LoneHerm_ has joined #ruby
phaza has joined #ruby
xall has joined #ruby
diego2 has quit [Changing host]
diego2 has joined #ruby
diego2 is now known as dviola
<apeiros> hint on testing whether an array is sorted: each_cons is a nice help for that.
<elastix> The all? method returns true if the block never returns false
<elastix> but I need to check if there is an element greater than 100
craigp_ has quit [Ping timeout: 265 seconds]
<al2o3-cr> elastix: detect
<apeiros> -.-
<al2o3-cr> ive
jenrzzz has quit [Ping timeout: 265 seconds]
<matthewd> elastix: So what would you need to make the block do?
<apeiros> elastix: you mean you need to test whether any? element is greater than 100?
<apeiros> (sledgehammerhint)
<elastix> yes I need to check if in an array there is an element greater than 100
wldcordeiro has quit [Ping timeout: 265 seconds]
airstream66 has joined #ruby
<matthewd> elastix: Do you know how to use a block to iterate a collection?
babblebre has joined #ruby
sdwrage has quit [Quit: Leaving]
bjensen82 has quit []
bsrd has quit [Quit: WeeChat 1.5]
FastJack has joined #ruby
airstream66 has quit [Remote host closed the connection]
<elastix> no
<elastix> what is a collection?
lacour has quit [Quit: Leaving]
Silthias1 has joined #ruby
Pumukel has joined #ruby
<apeiros> things which contain more than one value. common collection types in ruby are arrays, hashes and sets.
<dminuoso> People use Set?
Silthias has quit [Ping timeout: 252 seconds]
<dminuoso> Amazing. :o)
<matthewd> In general: Enumerable
<apeiros> I'd use it quite a lot if it was native and hence would beat Array's set operation performance :(
* apeiros sadpanda
<dminuoso> If there was a literal to make a set I would use it for sure
<dminuoso> Perhaps we could finally make use of <>
elenatanasoiu has quit [Ping timeout: 248 seconds]
<apeiros> yes, literals would help tremendously too :)
<dminuoso> Though I think {1,2,3} would be fine.
<matthewd> elastix: I'd suggest you'll get more value from going through some tutorials for now, instead of trying to tackle a challenge by yourself
* apeiros wants 4 more literals: date/time, interval, set and orderedset
ur5us has joined #ruby
<apeiros> s/orderedset/sortedset/
<matthewd> elastix: I'm sure you could figure out *a* solution with a bare loop, but you'll get more benefit by building familiarity with the ruby-ish ways of approaching it
jcao219 has joined #ruby
futilegames has joined #ruby
<apeiros> though, given that they started special casing full expressions (e.g. [a,b].max not creating an array), I'd probably also be fine with native set and `Set(1,2,3)`
<matthewd> We could hand you the answer, but that doesn't help you learn either -- and that's surely the point of trying such a challenge in the first place
whathapp_ has joined #ruby
whathappens has quit [Read error: Connection reset by peer]
futilegames has quit [Client Quit]
<elastix> yes I got it
<elastix> can you help me to do that exercise?
sp_ has quit [Ping timeout: 244 seconds]
<elastix> a non empty zero indexed array A consisting of N integers is given. you can perform a single swap operation in array A. this operation takes 2 indexes I and J such that 0<=I<=J<N and exchanges the value of A[I] and A[J] . the goal is to check whether array A can be sorted into non decresing order by performing at most one swap operation.
lxsameer has quit [Quit: WeeChat 1.5]
tyang has quit [Ping timeout: 264 seconds]
mujou has joined #ruby
xall has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 244 seconds]
<matthewd> If you can't do the greater-than-100 one yet, this one definitely seems too hard
alaibe has quit [Read error: Connection reset by peer]
alaibe has joined #ruby
whathapp_ has quit [Read error: Connection reset by peer]
cydrobol- has quit [Quit: oooh...what does THIS button do?]
cydrobolt has joined #ruby
cydrobolt has joined #ruby
cydrobolt has quit [Changing host]
skweek has quit [Ping timeout: 252 seconds]
<dminuoso> matthewd: perhaps he has written a neat case that test for indices [0,0], [0,1], [0,2]... up until [100,100]
<dminuoso> Then it's understandable.
whathappens has joined #ruby
<dminuoso> I would probably recommend a good typing course to extend this for larger arrays.
craigp_ has joined #ruby
<elastix> I done the greater than 100 using a for loop :)
wldcordeiro has joined #ruby
<elastix> any help to do the exercise?
zeroDi has joined #ruby
<LyndsySimon> >> Object.new.class.ancestors.include? BasicObject
<ruby[bot]> LyndsySimon: # => true (https://eval.in/655137)
<apeiros> >> Object < BasicObject
<ruby[bot]> apeiros: # => true (https://eval.in/655138)
<LyndsySimon> Is there a better way than that to determine if an object is an instance of class or one of its descendant s?
<apeiros> >> Object.new.is_a?(BasicObject)
<ruby[bot]> apeiros: # => true (https://eval.in/655139)
<nofxx> elastix, loop is a word more forbidden here than science on 1600
<LyndsySimon> Awesome, ty :)
mujou has quit [Quit: Leaving...]
dminuoso has quit [Ping timeout: 244 seconds]
<apeiros> note, if you need "an instance of X" instead of "an instance of X or any superclass thereof", then there's also .instanceof?
craigp_ has quit [Ping timeout: 265 seconds]
nankyokusei has joined #ruby
<apeiros> >> [Object.new.instanceof?(Object), Object.new.instanceof?(BasicObject)]
<ruby[bot]> apeiros: # => undefined method `instanceof?' for #<Object:0x40f01ba4> ...check link for more (https://eval.in/655140)
<elastix> ?
<apeiros> >> [Object.new.instance_of?(Object), Object.new.instance_of?(BasicObject)]
<ruby[bot]> apeiros: # => [true, false] (https://eval.in/655142)
maddmaxx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
synthroid has quit []
whathappens has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
nankyokusei has quit [Ping timeout: 264 seconds]
<elastix> ??
<elastix> what is that?
Pumukel has quit [Read error: Connection reset by peer]
TPug has joined #ruby
RTFM[away] has joined #ruby
RTFM[away] has quit [Changing host]
RTFM[away] has joined #ruby
DenSchub has quit [Ping timeout: 265 seconds]
elenatanasoiu has joined #ruby
NTrash has quit [Quit: Konversation terminated!]
sergio_101 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
whathappens has quit [Read error: Connection reset by peer]
NTrash has joined #ruby
akp has quit [Disconnected by services]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
gingray has quit [Ping timeout: 265 seconds]
NTrash has quit [Client Quit]
<nofxx> Need help... rubies are red sapphires or sapphires are blue rubies?
whathappens has joined #ruby
NTrash has joined #ruby
NTrash has quit [Client Quit]
erlingur_ has quit [Ping timeout: 272 seconds]
JeanCarloMachado has quit [Ping timeout: 252 seconds]
erlingur_ has joined #ruby
Burgestrand has joined #ruby
hahuang62 has quit [Ping timeout: 265 seconds]
NTrash has joined #ruby
* baweaver puts down hammer slowly
* baweaver smiles at nofxx
mrmortondk has quit [Quit: Textual IRC Client: www.textualapp.com]
JeanCarloMachado has joined #ruby
rodfersou|afk is now known as rodfersou
Socah has joined #ruby
DenSchub has joined #ruby
Macrobiotic has quit [Quit: Connection closed for inactivity]
ldnunes has quit [Quit: Leaving]
jarred has quit [Quit: Connection closed for inactivity]
A124 has quit [Quit: '']
dviola has quit [Quit: WeeChat 1.5]
ben_ has quit [Remote host closed the connection]
craigp_ has joined #ruby
A124 has joined #ruby
dviola has joined #ruby
pawnbox has quit [Remote host closed the connection]
c355e3b has quit [Quit: Connection closed for inactivity]
craigp_ has quit [Ping timeout: 272 seconds]
skweek has joined #ruby
tercenya has joined #ruby
Qommand0r has quit [Quit: Exiting...]
Qommand0r has joined #ruby
airstream66 has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
SteenJobs has joined #ruby
Jackneill has quit [Remote host closed the connection]
y2mq37 has joined #ruby
ziprar is now known as zpace
zpace is now known as zipace
airstream66 has quit [Remote host closed the connection]
tsabx has joined #ruby
nh_cham has joined #ruby
axl_ has left #ruby [#ruby]
<LyndsySimon> One more question and I think I'll be done for the day. What method generates the string that's returned from the following line?
<LyndsySimon> >> class Foo end;Foo.new
<ruby[bot]> LyndsySimon: # => #<Foo:0x41349b58> (https://eval.in/655151)
SteenJobs has quit [Ping timeout: 252 seconds]
<elomatreb> LyndsySimon: Usually, it's #inspect
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<LyndsySimon> elomatreb: hmm... I built a proxy object that passes #inspect through, but it's not generating the string.
<elomatreb> btw, the line isn't actually returning that string, it's just what Kernel#p invokes on it
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Burgestrand has joined #ruby
<LyndsySimon> That'd be the problem then :) Kernel isn't in the namespace I'm using. Awesome, ty.
SCHAAP137 has joined #ruby
Burgestrand has quit [Client Quit]
behemot has quit [Ping timeout: 264 seconds]
Socah has left #ruby [#ruby]
jenrzzz has quit [Ping timeout: 252 seconds]
fuzzyhorns has quit [Quit: Leaving.]
jcao219 has quit [Ping timeout: 265 seconds]
dminuoso has joined #ruby
baweaver is now known as baweaver_away
axisys has quit [Quit: Lost terminal]
NTrash has quit [Quit: Konversation terminated!]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
craigp_ has joined #ruby
NTrash has joined #ruby
dminuoso has quit [Ping timeout: 244 seconds]
djbkd has quit [Remote host closed the connection]
SteenJobs has joined #ruby
djbkd has joined #ruby
<elastix> ?
elenatanasoiu has quit [Ping timeout: 272 seconds]
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
nando294021 has quit [Quit: Lost terminal]
nando293921 has quit [Quit: Lost terminal]
whathappens has quit [Remote host closed the connection]
craigp_ has quit [Ping timeout: 272 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
whathappens has joined #ruby
duncannz has joined #ruby
brendan- has joined #ruby
jphase has quit [Ping timeout: 272 seconds]
last_staff has quit [Quit: goes moo moo]
<elastix> how can I order an arrya?
<elastix> array
<elomatreb> elastix: Try .sort?
bmurt has joined #ruby
<Radar> ?g ruby order array
<ruby[bot]> Radar: I don't see no ruby, whom should I tell about g?
<Radar> ...
[Butch] has quit [Quit: I'm out . . .]
<Radar> google.com?q=ruby+sort+array
claw has quit [Ping timeout: 272 seconds]
<Zarthus> disorder is still order!
bmurt has quit [Client Quit]
GodFather has joined #ruby
ChiefAlexander has quit [Quit: Leaving...]
finisherr has quit [Quit: finisherr]
elenatanasoiu has joined #ruby
rodfersou has quit [Quit: leaving]
Madplatypus has joined #ruby
<elastix> ok thanks
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<elastix> last question :) ..... I have 2 array ... how can I check how many elements are different?
<elastix> a=[1,2,3,4] b=[1,2,4,3]
claw has joined #ruby
<elastix> I should compare 1 of the first array with 1 of the seconda array
<elastix> and so on
<croberts> elastix: it looks like the 3/4 are different :)
<elastix> yes in this case I have 2 elements are different
<elastix> how can I compare/check that?
<elastix> maybe with a for loop?
<croberts> i have no idea im still super new
jhooker has quit [Ping timeout: 272 seconds]
raeoks has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
tercenya has quit [Remote host closed the connection]
tercenya has joined #ruby
<nofxx> elastix, a - b
<Radar> nofxx: did you test that?
<nofxx> you need to forget loops, seriously elastix
<Radar> >> [1,2,3,4] - [1,2,4,3]
<ruby[bot]> Radar: # => [] (https://eval.in/655162)
hahuang62 has joined #ruby
<Radar> nofxx: can't tell if trolling
<nofxx> Radar, elements are not different, they aren't just ordered
<Radar> elastix: what is the intended output?
Devalo has joined #ruby
skweek has quit [Ping timeout: 272 seconds]
Robtop__ has quit [Read error: Connection reset by peer]
Robtop__ has joined #ruby
<elastix> I need to print false if there are more than 2 diffs in the 2 array
<matthewd> > I should compare 1 of the first array with 1 of the seconda array
<matthewd> > in this case I have 2 elements are different
kobain has quit [Ping timeout: 252 seconds]
<elastix> yes
<matthewd> So yeah, picking on detail of initial wording and ignoring clarifying data ~= trolling
<eam> "more than 2 differences" gets very interesting given the asymmetric nature of equality
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<eam> a == b sometimes when b != a
c355e3b has joined #ruby
<matthewd> Not with integers, and this is a simple programming challenge
<elomatreb> eam: I have a feeling "the nature of equality" isn't exactly relevant here :)
<Radar> the bikeshed is blue
<elastix> they are intere yes
<elastix> integers
Devalo has quit [Ping timeout: 264 seconds]
biberu has quit []
<Radar> >> a = [1,2,3,4]; b = [1,2,4,3]; a.each_with_index.to_a.select { |e,i| b[i] != e }
Livecodingtv_Ale has quit [Quit: ChatZilla 0.9.92 [Firefox 50.0/20160929120120]]
<ruby[bot]> Radar: # => [[3, 2], [4, 3]] (https://eval.in/655163)
craigp_ has joined #ruby
<Radar> That'll tell you what elements are different and what indexes those elements are at.
abernstein has quit [Quit: abernstein]
finisherr has joined #ruby
symm- has joined #ruby
coolboy has quit [Ping timeout: 244 seconds]
croberts is now known as Toledo-fqdn
djbkd has quit [Remote host closed the connection]
<elastix> I don't need of that :) I only need to check if there are more than 2 differences between the 2 arrays
djbkd has joined #ruby
<Radar> >> a = [1,2,3,4]; b = [1,2,4,3]; a.each_with_index.to_a.select { |e,i| b[i] != e }.count > 2
<ruby[bot]> Radar: # => false (https://eval.in/655164)
<Radar> next question plzkthx
<elomatreb> elastix: Did you say whether order in the array was relevant?
hutch34 has quit [Ping timeout: 272 seconds]
djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wilba has joined #ruby
erlingur_ has quit [Ping timeout: 272 seconds]
<wilba> hi
pwnd_nsfw has joined #ruby
<wilba> I am trying to figure out a suitable approach to extracting information from a collection of random websites, and was wondering if you guys could help me think this through
cdg has joined #ruby
<wilba> Imagine I have a list of sites for accountants, like this: https://gist.github.com/marcamillion/add37cb20389cb8e74b7d60b85092d7f
hutch34 has joined #ruby
skweek has joined #ruby
testo has quit [Quit: bbl]
<wilba> What I want to do is get the name of the managing partner along with their email address. Naturally, each of these websites are different, so that makes extraction of the info more difficult.
<Radar> wilba: hey marcamilly
Robtop__ has quit [Ping timeout: 272 seconds]
<Radar> ltns
shinnya has joined #ruby
<wilba> Hey Radar, ltns?
ResidentBiscuit has joined #ruby
<Radar> google it ;)
JoshS has joined #ruby
<wilba> ahh....long time no see, indeed.
<wilba> yeh been a while
<wilba> Ok, so to get the email, I was thinking of just crawling the entire site and looking for a `mailto` `a` tag....but that doesn't give me sufficient information.
nando293921 has joined #ruby
<wilba> For starters, that will pull all the email addresses without context, and it will be hard to know which belongs to the named partner as opposed to an office admin assistant
RTFM[away] has quit [Ping timeout: 264 seconds]
hutch34 has quit [Ping timeout: 252 seconds]
<wilba> The same thing applies to finding the name, I was thinking of searching for header tags and grabbing the text from within those header tags...but that's not sufficient enough because there are some sites that put the partners names in span tags and others that don't wrap them in any header tags at all, other than the `p` tag.
xentity1x has quit [Ping timeout: 244 seconds]
<wilba> So what are the sorts of things I should be considering/looking at to get the info I am looking for?
hutch34 has joined #ruby
<matthewd> wilba: ~impossible problem
<wilba> matthewd: I feared as much :(
<elastix> thanks:)
<elastix> sortedArray = aArray.sort!
<wilba> I need something like specific HTML tags or elements that I can extract, right?
<elastix> why aArray is sorted too?
NTrash has quit [Quit: Konversation terminated!]
<matthewd> elastix: Read the documentation
cschneid_ has quit [Remote host closed the connection]
<elastix> ok and how can I sort in a different variables?
dminuoso has joined #ruby
jphase has joined #ruby
<matthewd> elastix: You're not learning if you need to be handed every method name
<wilba> any other thoughts on my challenge?
<matthewd> elastix: It's far more important to learn how to find the method you need, than it is to get to the result
alaibe has quit [Ping timeout: 265 seconds]
<matthewd> wilba: I think impossible just about covers it
hutch34 has quit [Ping timeout: 272 seconds]
<elastix> but I can't find the method right for me
<matthewd> Where have you looked?
<wilba> elastix, what are you trying to do? i came in after you described your problem
<elastix> I need to sort an array
<matthewd> Which candidates have you considered, and why have you decided they're not a good fit?
<elastix> but using another variable
<elastix> array = 3,2,1
<elastix> sortedarray = 1,2,3
<elastix> I was using sortedarray = array.sort!
nankyokusei has joined #ruby
<elastix> but it sorts also my first variable array
<wilba> if you do that, sort! modifies array
<wilba> just try doing array.sort
<wilba> so sortedarray = array.sort
BTheOne has quit [Remote host closed the connection]
<wilba> the ! modifies the variable/data structure it is acting on
<wilba> that applies for all/most ruby methods
dminuoso has quit [Ping timeout: 265 seconds]
zeroDi has quit [Quit: WeeChat 1.5]
<elastix> ok thanks :)
<wilba> np
zeroDi has joined #ruby
csk has quit [Quit: Bye]
bjh13 has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
tonini has quit [Quit: Connection closed for inactivity]
nankyokusei has quit [Ping timeout: 244 seconds]
SteenJobs has joined #ruby
hiro` has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
nando293921 has quit [Quit: Lost terminal]
hahuang62 has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
elenatanasoiu has quit [Ping timeout: 265 seconds]
Xeago has quit [Ping timeout: 244 seconds]
Xeago has joined #ruby
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hiro`> Hey everyone, recently reinstalled RVM, now having an annoying problem bundling or installing gems. tried to bundle in a project, kept getting an error saying that I was on 2.3 and not 2.2 as specified by the Gemfile (I wasn't). Deleted the ruby version from the Gemfile. Bundler rebuilt everything from scratch. Tried to run a console - it blew up bc the json gem doesn't exist. Tried to gem install it - that blew up 'incompatible marshal
Kero_ has quit [Ping timeout: 240 seconds]
Ebok has joined #ruby
<havenwood> hiro`: Start by making sure you have Bundler installed with the Ruby you're using. Then sanity check with `gem which bundler` and `which bundle`.
patarr has quit [Quit: patarr]
whathapp_ has joined #ruby
<hiro`> havenwood: 'ERROR: Can't find ruby library file or shared library bundler'
eljimmy has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
<hiro`> which bundle goes to /usr/bin/bundle though
<havenwood> hiro`: Have you selected Ruby 2.3 as your current Ruby and run?: gem install bundler
<Radar> I see the problem: it starts with R and ends with VM>
<hiro`> havenwood: 2.3 isn't in my list of ruby version in RVM
<Radar> hiro`: what OS are you on?
<hiro`> Ubuntu
baweaver_away is now known as baweaver
whathappens has quit [Ping timeout: 244 seconds]
<hiro`> I recently reinstalled RVM
<hiro`> As in, today
<havenwood> hiro`: Dev or prod?
<hiro`> Dev
<Radar> rvm implode --force
jenrzzz has joined #ruby
<hiro`> I did rvm implode
<Radar> Marvel at how quickly your problems fade away.
<hiro`> That got me here
<matthewd> hiro`: Note that step two is not "reinstall rvm"
<hiro`> lol
<hiro`> :cries:
cdg has quit [Remote host closed the connection]
<hiro`> It seems to be trying to read from /usr/lib/ruby/gems/2.3.0/gems/
Kero has joined #ruby
eljimmy has joined #ruby
Azure|dc is now known as Azure
ponga has quit [Quit: Connection closed for inactivity]
toretore has joined #ruby
elenatanasoiu has joined #ruby
saneax-_-|AFK is now known as saneax
SCHAAP137 has quit [Quit: Leaving]
elenatanasoiu has quit [Ping timeout: 264 seconds]
synne has quit [Ping timeout: 248 seconds]
whathapp_ has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
coolboy has joined #ruby
chouhoul_ has joined #ruby
Dimik has joined #ruby
<hiro`> So `gem install bundler` errors with the same `incompatible marshal file format` message.
whathappens has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
mistergibson has joined #ruby
chouhoulis has quit [Ping timeout: 248 seconds]
chouhoul_ has quit [Ping timeout: 252 seconds]
whathapp_ has joined #ruby
whathappens has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
hahuang62 has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
vifino- has quit [Quit: Who turned this off?! D:<]
djbkd has joined #ruby
vifino has joined #ruby
whathapp_ has quit [Remote host closed the connection]
tenderlove has quit [Read error: No route to host]
whathappens has joined #ruby
tenderlove has joined #ruby
whathappens has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
zipace has quit [Ping timeout: 272 seconds]
djbkd has quit [Ping timeout: 264 seconds]
_djbkd has joined #ruby
_djbkd has quit [Client Quit]
wpostma has joined #ruby
Immune has joined #ruby
pwnd_nsfw` has joined #ruby
tenderlo_ has joined #ruby
<wpostma> I'm new to Ruby and Rails and curious what experienced folks think of Rails 5 so far.
wpostma has quit [Client Quit]
tenderlove has quit [Ping timeout: 244 seconds]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
whathappens has quit [Read error: Connection reset by peer]
vifino has quit [Quit: Who turned this off?! D:<]
marr has quit [Ping timeout: 265 seconds]
axl__ has joined #ruby
wpostma has joined #ruby
vifino has joined #ruby
whathappens has joined #ruby
<Radar> hiro`: did you end up following the guide?
wldcordeiro has quit [Ping timeout: 252 seconds]
pwnd_nsfw has quit [Ping timeout: 248 seconds]
<hiro`> Radar I'm trying rbenv since that has better emacs integration
tenderlove has joined #ruby
<Radar> Ok.
jhooker has quit [Ping timeout: 252 seconds]
whathappens has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
whathappens has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
pragmaticus has quit [Ping timeout: 264 seconds]
tenderlo_ has quit [Ping timeout: 252 seconds]
tenderlo_ has joined #ruby
<havenwood> hiro`: just curious but what about rbenv.el do you like better than chruby.el?: https://github.com/plexus/chruby.el
tenderl__ has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
SteenJobs has joined #ruby
<hiro`> havenwood: this bit "There is currently no support for Chruby's 'auto' functionality."
<havenwood> hiro`: aha
tenderlove has quit [Ping timeout: 252 seconds]
bjh13 has quit [Remote host closed the connection]
BTRE has quit [Quit: Leaving]
BTRE has joined #ruby
tenderlo_ has quit [Ping timeout: 272 seconds]
tenderl__ has quit [Ping timeout: 244 seconds]
johnmilton has quit [Ping timeout: 264 seconds]
tenderlove has joined #ruby
JeanCarloMachado has quit [Ping timeout: 248 seconds]
alaibe has joined #ruby
jcao219 has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
dminuoso has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
wpostma has quit [Quit: This computer has gone to sleep]
alaibe has quit [Ping timeout: 272 seconds]
rcvalle has quit [Quit: rcvalle]
nando293921 has joined #ruby
tenderlove has quit [Read error: Connection reset by peer]
jcao219 has quit [Ping timeout: 252 seconds]
tenderlove has joined #ruby
tenderlove has joined #ruby
tenderlove has quit [Changing host]
wilba has quit [Quit: Page closed]
dminuoso has quit [Ping timeout: 265 seconds]
nando293921 has quit [Client Quit]
skweek has quit [Ping timeout: 272 seconds]
Guest19391 has quit []
spiette has quit [Quit: :qa!]