<mzo>
i don't need to click any links to know that's false
<mzo>
yes and i watched a good chunk of the talk
<allisio>
I was obviously speaking hyperbolically, but only just.
benlieb has quit [Quit: benlieb]
<mzo>
once you realize procs let you express the lambda calculus, the rest of the talk is just the boring process of going through church numerals, booleans, etc.
<allisio>
Well, ain't you just too clever by half?
am55_ has joined #ruby
<mzo>
i'm dumb i don't get functional programming
<allisio>
How can functions be real if zygohistomorphic prepromorphisms aren't real?
<mzo>
lel
<mzo>
i want to make my language good so i need to know what to steal from ruby
<allisio>
All of it.
<allisio>
None of it.
<mzo>
ur confusing me
m_31 has joined #ruby
<mzo>
i definitely don't want all of it
<allisio>
What's your least favorite part?
<mzo>
lack of #to_i on TrueClass and FalseClass
<allisio>
I, for one, hate having to say `@foo = foo; @bar = bar`.
<mzo>
jk
<allisio>
Please to fix.
<mzo>
subclass Struct
benlieb has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
<Disavowed>
allisio: I'm new-ish to Ruby and I'm surprised there isn't some syntactic sugar a la attr_reader to fix that one.
<mzo>
i was thinking of that though
<mzo>
i might do class Foo(x, y, z) and auto-generate a ctor like init(x, y, z) { self.x = x; self.y = y; self.z = z; }
m__31 has quit [Ping timeout: 260 seconds]
<mzo>
Disavowed: what other langs do u know
<Disavowed>
mzo: Have you ever seen that in any language though? It seems neat, but I assume people much smarter than me have thought of it before and rejected it in their implementation.
<mzo>
yes Scala has it
<Disavowed>
mzo: Nothing of note. Python and Clojure would be my main ones
<Disavowed>
I'm trying to crack Haskell but I have that nagging feeling I'm not yet smart enough
<mzo>
the implicit ctor in my lang would be like a data constructor in haskell
<mzo>
data Foo = Foo Int Int Int ; let foo = Foo 4 5 6
eboaz has joined #ruby
<allisio>
Without mucking around with TracePoint to get at the binding implicitly: https://eval.in/753890
<Disavowed>
hang on, doesn't JS have prototypal inheritance? So if an attribute is bound to an object from the constructor, does that mean it's present on unrelated objects that inherit from the same type? Or have I made a mistake in my assumptions somewhere?
<jhack>
avdi, thanks for the freebies :)
<mzo>
every object has a prototype
<Disavowed>
allisio: That is kind of neat
<allisio>
Disavowed: You're kind of neat.
<Disavowed>
allisio: <3
Coldblackice has joined #ruby
<Disavowed>
You've just given me a wonderful idea
<allisio>
I like it when that happens.
<allisio>
Keep talkin' dirty to me.
<Disavowed>
I always get frustrated at forgetting to coerce a varuiable to a string before I raise it as an exception. I could just patch the exception class to automatically do that for me when I'm debugging.
<Disavowed>
allisio: You got it baby!
<allisio>
Disavowed: You'd do that with Module#prepend, though.
<Disavowed>
TIL
<mzo>
how crucial are mixins to ruby's magicalness
<allisio>
Multiple inheritance has its pros and cons.
<mzo>
how about operator overloading. good?
<allisio>
They don't have much of anything to do with its (absurdly thorough) metaprogramming facilities, though.
chrickso has joined #ruby
<allisio>
Not something I'd want to be without, but you should make assignment an operator.
<mzo>
what are the key features that make metaprogramming tick in ruby
FoolsGambit has joined #ruby
<mzo>
make assignment an operator? isn't it already?
<allisio>
How do I overload it?
<mzo>
just because you can't overload it doesn't mean it's not an operator
<mzo>
or does it
<allisio>
It's not a "Ruby operator" like all the other Ruby operators.
<mzo>
it doesn't make sense to overload though
<allisio>
</3
mikecmpbll has quit [Quit: inabit. zz.]
<mzo>
i mean how could it possibly have sensible semantics
<allisio>
It'd be nice to be able to "respond" to an assignment.
tmtwd has quit [Ping timeout: 246 seconds]
<mzo>
foo['bar'] = 'baz' would invoke = on foo['bar'], but presumably you'd want to call = on foo with 'bar', 'baz'?
shinnya has joined #ruby
<allisio>
#[]= is an operator.
<mzo>
yes
<allisio>
But #= is not.
<allisio>
Problem.
<mzo>
how
<mzo>
what could you ever want to do in response to =
<allisio>
Things.
<allisio>
Bad things, granted.
<allisio>
But still things.
<mzo>
user-defined operators
<mzo>
what do u think
<allisio>
Scary.
<bougyman>
are you trying to make ruby golf better?
<bougyman>
that's the only use case I could see for that.
<allisio>
mzo: Have you seen what the Haskellers get up to in that department?
<mzo>
used extensively in haskell and we all know haskell is the best
<mzo>
are u telling me a <*<$>*> b doesn't make sense to u
<allisio>
Puts the spaceship operator to shame.
jenrzzz has joined #ruby
<allisio>
Did you know you can customize how your objects participate in Ranges?
milardovich has quit [Remote host closed the connection]
antoniobeyah has quit [Quit: Connection closed for inactivity]
<mzo>
does * work on any Enumerable
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
rhyselsmore has joined #ruby
cdg_ has joined #ruby
<allisio>
>> class Integer; def to_a; ['lol'] end end; *42
<ruby[bot]>
allisio: # => /tmp/execpad-52bc8132ca2a/source-52bc8132ca2a:2: syntax error, unexpected '\n', expecting &. or :: o ...check link for more (https://eval.in/753893)
<allisio>
Wat.
FoolsGambit has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<allisio>
Anyway, anything with a #to_ary or (failing that) #to_a method.
<chrickso>
hi all. i'm looking for advice. i already know python and flask enough to make some stuff but i'm feeling this gravity towards rails to speed things up and have an all-in-one well-maintained package. anyone have experience with both languages/frameworks that could offer any insight?
hutch34 has joined #ruby
<mzo>
do u find ruby's naming a little inconsistent
<allisio>
It's objectively the case.
<mzo>
why is array abbreviated in to_ary but then there's long methods like each_with_index
<baweaver>
chrickso: Objectively Flask is analogous to Sinatra in Ruby.
jameser has joined #ruby
<allisio>
Coercion implicitly tries to use #to_ary and #to_str first, but then it's #to_h for `**`.
<baweaver>
chrickso As far as Rails itself, it's batteries included
<baweaver>
chrickso: meaning that it does a lot of the lifting for you out of the gate. The problem with that is you have to know what those things are and then you have to play nicely with them being that way.
<chrickso>
baweaver: ya, i've heard that. guess i have so many batteries plugged into flask and my concern is that they are not particularly well mainted/cohesive
<Disavowed>
chrickso: I spent many years using Flask and Django; now I reach for Rails whenever I have the choice. YMMV of course, but the switch isn't that taxing
<baweaver>
If you've dealt with one MVC framework Rails is straightforward
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d^sh has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 246 seconds]
<mzo>
whats the best way to learn rails these days
raul782 has joined #ruby
<baweaver>
Rails 4 in Action
<mzo>
i thought rails 5 is out
<baweaver>
It is. Books can take a bit to write.
<mzo>
so that book there will get me up to speed
<baweaver>
There are a few 5 specific books out, but the differences are small enough it's mainly just an extension on concepts you'd learn already as a base.
d^sh has joined #ruby
<mzo>
chrickso: lets learn rails
<baweaver>
The Rails 5 Way is still beta and is the Tome level book (big, beefy, and super-reference potential)
<baweaver>
That'd be the advanced option
<baweaver>
R4iA is the beginner option
<mzo>
last thing i need is a tome
<mzo>
lifes 2 short 4 tomes
<baweaver>
There's also Hartl's Rails tutorial online which is also in the newbie category.
<baweaver>
Pragmatic Programmers had a Rails 5 book that I haven't read but they put out good stuff consistently
<mzo>
chrickso: no i want to learn it hehe
<chrickso>
whats the thoughts on learning from the rails 4 book using rails 5?
<mzo>
check above baweaver commented on that
rkazak_ has joined #ruby
<baweaver>
Basics are the same, only really big differences are Webpack and ActionCable, both of which I would avoid in the short term
<chrickso>
whats a good place for tutorials beyond the beginner basics? like full blown user account setup with all the security in mind?
<baweaver>
r4ia covers that
raul782 has quit [Ping timeout: 260 seconds]
rkazak_ has quit [Client Quit]
alibby has quit [Quit: Leaving.]
<baweaver>
Radar: sell your dang book
<mzo>
i want to make full blown rails apps
<Disavowed>
mzo: The Hartl book I linked walks you through making a twitter clone, replete with authentication, etc
<baweaver>
Jokes aside, both the Rails Tutorial and Rails 4 in Action build complete apps
<baweaver>
including testing, authentication, and the rest of it
<mzo>
i want to hook my rails app up to mongodb. i want it to talk to postgres. i want it playing with redis. you name it, i want my rails app to tie into it some how or other.
<baweaver>
Avoid Mongo
<baweaver>
PSQL is easy. Redis is easy.
<mzo>
rails doesn't play nicely with mongo?
<baweaver>
It can, but Mongo doesn't play nicely with architectural sanity
<chrickso>
so rails 4 in action will take me from beginner to advanced and convert easily to rails 5?
<mzo>
Disavowed: ok i will check that out
<baweaver>
It'll take you from Beginner to Low Intermediate
<chrickso>
anyone know a timeline if they are updating to rails 5 in action? hasn't 5 been out for like 6 months?
<baweaver>
They'd have to find more authors because Manning treats authors poorly.
<chrickso>
whats the low intermediate to advanced book?
<baweaver>
The Rails 5 Way
<mzo>
the idea of being a rails developer is very cool to me
<mzo>
i want to get a rails sticker on my macbook
jhack has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 258 seconds]
<mzo>
can rails play nicely with React?
<baweaver>
If it can supply JSON, it can play with React
<baweaver>
or Angular or Ember or Vue or....
<mzo>
i like to have my main http server just server static html, js, and css, and then have a separate rack server running my application that only serves JSON
<mzo>
but it seems with rails there's this focus on erb
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has joined #ruby
govg has quit [Ping timeout: 260 seconds]
JeanCarloMachado has quit [Ping timeout: 260 seconds]
jnoob22 has quit [Changing host]
jnoob22 has joined #ruby
OTORelic has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
raspado has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
gigglypuff has joined #ruby
gigglypuff has left #ruby [#ruby]
cschneid_ has quit [Ping timeout: 264 seconds]
OTORelic has joined #ruby
Derperperd has quit [Quit: WeeChat 1.5]
govg has joined #ruby
xall_ has joined #ruby
Ropeney has joined #ruby
xall_ has quit [Client Quit]
dviola has quit [Quit: WeeChat 1.7]
xall has joined #ruby
duderonomy has joined #ruby
pawnbox has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
pilne has quit [Quit: Quitting!]
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
astrobun_ has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
OTORelic has quit [Ping timeout: 260 seconds]
_djbkd has joined #ruby
eclecticjohny has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
JeanCarloMachado has joined #ruby
enterprisey has joined #ruby
enterprisey has quit [Remote host closed the connection]
cfec0b8d has joined #ruby
enterprisey has joined #ruby
jameser_ has joined #ruby
matcouto_ has joined #ruby
jameser has quit [Ping timeout: 264 seconds]
matcouto has quit [Ping timeout: 240 seconds]
xenops has joined #ruby
jameser_ has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
xenops has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
hutch34 has joined #ruby
pawnbox has quit [Ping timeout: 258 seconds]
jameser has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
hotpanca_ has quit [Remote host closed the connection]
ahrs_ has joined #ruby
hutch34 has quit [Ping timeout: 260 seconds]
patarr has joined #ruby
ahrs has quit [Ping timeout: 256 seconds]
jameser has quit [Ping timeout: 257 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has quit [Ping timeout: 268 seconds]
jameser has joined #ruby
gix has quit [Ping timeout: 258 seconds]
govg has quit [Ping timeout: 256 seconds]
jameser has quit [Read error: Connection reset by peer]
JeanCarloMachado has quit [Ping timeout: 258 seconds]
govg has joined #ruby
gix has joined #ruby
jameser has joined #ruby
JeanCarloMachado has joined #ruby
pawnbox has joined #ruby
hotpancakes has joined #ruby
pawnbox has quit [Remote host closed the connection]
jameser has quit [Ping timeout: 240 seconds]
Channel6 has quit [Quit: Leaving]
jameser has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
ahrs_ has quit [Ping timeout: 268 seconds]
ahrs has joined #ruby
jameser has quit [Ping timeout: 246 seconds]
JeanCarloMachado has joined #ruby
bocaneri has joined #ruby
<raul782>
Hi guys
jameser has joined #ruby
pawnbox has joined #ruby
<havenwood>
raul782: hi
kolaman has quit [Quit: leaving]
<raul782>
So I've been using rails for a while and I'm starting to dive deeper in how some gems work, but I'm finding really difficult to understand how/when a callback is called within the ruby code
<allisio>
Generally, wherever you see `block.call` or `yield`.
matcouto has joined #ruby
matcouto_ has quit [Read error: Connection reset by peer]
<allisio>
Under the broadest interpretation of "callback", anyway.
<raul782>
humm, but somehow I can't catch where this is called, so I can debug the so called callback
<raul782>
Let me show you the gem which is act_as_audited
JeanCarloMachado has quit [Ping timeout: 260 seconds]
jameser has quit [Read error: Connection reset by peer]
raul782 has quit [Read error: Connection reset by peer]
<raul782>
This is the part that elludes me, for example for the create action callback, you pass 3 attributes.
<raul782>
and you call self.audits.create(attrs), I'd understand that only those 3 fields would be filled in the audits table
<raul782>
but for other models, I see that the auditable_type and auditable_id are recorded
<raul782>
and I can't figure it out, how this code is extracting those values
<raul782>
It works on all models being audited except for the User model
<dminuoso>
raul782: ?rubyonrails
<dminuoso>
?rails raul782
<ruby[bot]>
raul782: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<dminuoso>
?crossposting
<ruby[bot]>
dminuoso: I don't know anything about crossposting
<dminuoso>
?cross
<ruby[bot]>
dminuoso: I don't know anything about cross
* dminuoso
sighs
<havenwood>
?crosspost
<ruby[bot]>
Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
pawnbox has quit [Remote host closed the connection]
elifoster has quit [Quit: sleep]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus69 has joined #ruby
hotpancakes has joined #ruby
Mortomes|Work has joined #ruby
hotpancakes has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
yaboiyungspasm has joined #ruby
<yaboiyungspasm>
hello?
<yaboiyungspasm>
is anyone here?
nofxxx has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
ruby-lang229 has joined #ruby
jgnagy has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
hotpancakes has joined #ruby
<ruby-lang229>
hiii
lightheaded has joined #ruby
jgnagy_ has quit [Ping timeout: 260 seconds]
milardovich has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
<ruby-lang229>
hello
milardovich has quit [Ping timeout: 246 seconds]
<yaboiyungspasm>
ruby-land229: would switching to a higher level lang like ruby (as a c programmer) make any real difference in my overall understanding of code structure, being that it's less verbose?
<yaboiyungspasm>
and doesn't have memory management?
<yaboiyungspasm>
or does it really not matter?
jgnagy_ has joined #ruby
djbkd_ has joined #ruby
pawnbox has joined #ruby
jgnagy has quit [Ping timeout: 258 seconds]
ruby-lang229 has quit [Ping timeout: 260 seconds]
andikr has joined #ruby
hotpancakes has quit [Remote host closed the connection]
toretore has joined #ruby
conta has joined #ruby
yaboiyungspasm has left #ruby [#ruby]
bkxd has quit [Ping timeout: 264 seconds]
uncertainty has joined #ruby
hotpancakes has joined #ruby
ledestin has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Tharbakim has quit [Ping timeout: 260 seconds]
last_staff has joined #ruby
milardovich has joined #ruby
Burgestrand has joined #ruby
TomyWork has joined #ruby
stoffus has left #ruby [#ruby]
norbertka has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
keanny479 has joined #ruby
<keanny479>
hello
<keanny479>
i have the following project https://goo.gl/b1bRMK, i'm looking for a way to color the score line (table) of the user when it is a new score, anyone can help me ?
djbkd_ has quit [Remote host closed the connection]
<tobiasvl>
keanny479: I have no idea what file or line you're talking about and I don't want to go through your entire code, but check out https://github.com/fazibear/colorize
Burgestrand has quit [Quit: Closing time!]
<keanny479>
tobiasvl, the code is located in format.rb
<keanny479>
tobiasvl, line 14*
tomphp has joined #ruby
aufi has joined #ruby
<tobiasvl>
then check out the gem I linked to
<tobiasvl>
oh you already use it I guess
<tobiasvl>
judging by line 6
<keanny479>
tobiasvl, i use colored gem
Silthias has joined #ruby
Silthias2 has joined #ruby
<xpt>
Hello, is there well-known regex to match valid domain or IP addr range, analogic to email regex stated here http://emailregex.com/
<xpt>
hmm.. should have asked on #regex probably...
xall has quit [Ping timeout: 260 seconds]
lenwood has joined #ruby
Silthias1 has quit [Ping timeout: 260 seconds]
Silthias has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
tildes has quit [Remote host closed the connection]
<tobiasvl>
bestel: so for every iteration of the block you split the string in two, char and rest. so rest is the entire string except one character. then you call permutations recursively with that shorter string.
<bestel>
tobiasvl: Thank you so much! Cheers!
<bestel>
It's clear
<bestel>
^)
troulouliou_div2 has quit [Quit: Leaving]
norbertka has joined #ruby
lightheaded has joined #ruby
milardovich has joined #ruby
bestel has quit [Ping timeout: 260 seconds]
jpterry has quit [Ping timeout: 268 seconds]
milardovich has quit [Ping timeout: 260 seconds]
pytuger has joined #ruby
herbmillerjr has quit [Remote host closed the connection]
<pytuger>
in python I can do
<pytuger>
my_dictionary = {key: [each_value for each_value in range(1,11)] for key in range(1,11)}
<pytuger>
my_list = [x for x in range(1,11)] # to get a list of 1-10 and
<pytuger>
how can list and dictionary comprehension be achieved in Ruby
<pytuger>
in perl it is
<pytuger>
@array = (1..11); #and one would use map for Perl hashes
<matthewd>
The literal translation would be `my_list = (1..10).map {|x| x }`
<matthewd>
But you'd actually use: my_list = (1..10).to_a
<pytuger>
my_list = (1..10).map {|x| x } #is logic that makes sense to me
<pytuger>
I appreciate that
<pytuger>
I learn languages better when I can translate them
<elomatreb>
(1..10).to_a is probably more common than that map construct, and possibly faster too
<matthewd>
So on the latter, I'm mapping to an array of 2-element arrays, then just pass that to Hash.[] to convert it
<pytuger>
that maybe so, but it will honestly probably take me longer to remeber
<pytuger>
my brain is funny like that
<pytuger>
also the mapping of ruby I can relate with perl
herbmillerjr has joined #ruby
cfec0b8d has quit [Ping timeout: 260 seconds]
<elomatreb>
If you don't actually need the array and just want to iterate the numbers there are utility methods on the number classes, e.g. 10.times or 1.upto(10)
<matthewd>
You can use 1...11 if you really prefer, too
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
jhack has joined #ruby
jhack has joined #ruby
jhack has quit [Changing host]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agent_white has joined #ruby
<agent_white>
Mornin' folks
terens has quit [Remote host closed the connection]
chenzfroff has joined #ruby
chenzfroff has quit []
chenzfroff has joined #ruby
chenzfroff has left #ruby [#ruby]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DLSteve_ has joined #ruby
martinhez has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lenwood has joined #ruby
redhedded1 has joined #ruby
rfoust has joined #ruby
uncertainty has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 240 seconds]
pytuger has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
lightheaded has quit [Read error: No route to host]
lightheaded has joined #ruby
toretore has quit [Ping timeout: 260 seconds]
toretore has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
Alina-malina has quit [Ping timeout: 240 seconds]
martinhez has quit [Ping timeout: 240 seconds]
lightheaded has quit [Remote host closed the connection]
bweston92 has joined #ruby
lightheaded has joined #ruby
chenzfroff has joined #ruby
lightheaded has quit [Read error: Connection reset by peer]
lightheaded has joined #ruby
aufi has quit [Ping timeout: 260 seconds]
lightheaded has quit [Remote host closed the connection]
lightheaded has joined #ruby
chenzfroff has left #ruby [#ruby]
krobzaur has quit [Ping timeout: 260 seconds]
lightheaded has quit [Ping timeout: 260 seconds]
millerti has joined #ruby
anisha has quit [Quit: Leaving]
cfec0b8d has quit [Ping timeout: 268 seconds]
lightheaded has joined #ruby
polishdub has joined #ruby
saneax-_-|AFK is now known as saneax
lightheaded has quit [Remote host closed the connection]
lightheaded has joined #ruby
cdg has joined #ruby
<mc_fail>
hi guys
aufi has joined #ruby
<mc_fail>
is there any way to distribute my .yaml configs with gems?
<mc_fail>
like, i have an app which has condig file in etc/config.yaml inside the gem
<mc_fail>
how do i read it from the app itself
<mc_fail>
considering that every path for this gem can be different
lightheaded has quit [Read error: No route to host]
<mc_fail>
(depending where you install it)
lightheaded has joined #ruby
lenwood has quit [Ping timeout: 260 seconds]
jhack_ has joined #ruby
mzo has quit [Quit: :*]
tenderlove has quit [Remote host closed the connection]
jhack has quit [Ping timeout: 246 seconds]
pawnbox has joined #ruby
jgnagy has joined #ruby
cdg has quit [Remote host closed the connection]
jhack_ is now known as jhack
cdg has joined #ruby
jhack has quit [Changing host]
jhack has joined #ruby
mikecmpbll has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
t-recx has joined #ruby
nowhereman has joined #ruby
tvw has quit [Ping timeout: 264 seconds]
dar123 has joined #ruby
tvw has joined #ruby
dopamean_ has quit [Ping timeout: 268 seconds]
lightheaded has quit [Remote host closed the connection]
lightheaded has joined #ruby
lightheaded has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 260 seconds]
aufi has quit [Ping timeout: 258 seconds]
jhack_ has joined #ruby
<jonathanwallace>
can you keep the yaml file in the gem and allow end users to overwrite?
raul782 has joined #ruby
bkxd has joined #ruby
jhack has quit [Ping timeout: 268 seconds]
mzo has joined #ruby
<mzo>
hi
Alina-malina has joined #ruby
<mzo>
how do people feel about Array#[] returning nil for out-of-bounds indices? should it raise instead, or does this behavior make the most sense?
norbertka has quit [Quit: Leaving]
jhack__ has joined #ruby
cschneid_ has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
<leah2>
you can use .fetch if you want that behavior
jhack_ has quit [Ping timeout: 240 seconds]
minimalism has joined #ruby
<mzo>
leah2: thanks, that's good to know
JeanCarloMachado has quit [Ping timeout: 258 seconds]
<mzo>
is the behavior of #[] considered to be a mistake
<mzo>
if you could go back in time would you make #[] raise for invalid indices
aufi has joined #ruby
<herwin>
it's what most languages do
<leah2>
i like the default behavior
JeanCarloMachado has joined #ruby
lightheaded has joined #ruby
<mzo>
herwin: is it?
raul782 has quit [Read error: Connection reset by peer]
<herwin>
perl returns undef (the equivalent of nil), I believe java returns null
raul782 has joined #ruby
<leah2>
java raises
<herwin>
it always confuses the heck out of me when I have to make a change to a python thing and it raises an error
<herwin>
C just segfaults ;)
Inv1s1ble_ has quit [Ping timeout: 256 seconds]
lightheaded has quit [Remote host closed the connection]
lightheaded has joined #ruby
<mzo>
yeah it's an exception in java and undefined behavior in C. in C++ it's undefined behavior, or on STL containers you can use .get() which will throw an exception
polishdub has quit [Quit: leaving]
krobzaur has joined #ruby
vali has quit [Ping timeout: 258 seconds]
<mzo>
in javascript it returns undefined though
eclecticjohny has joined #ruby
hxegon_afk is now known as hxegon
lightheaded has quit [Read error: Connection reset by peer]
lheaded has joined #ruby
<mzo>
in statically typed languages it almost *must* be an error, because e.g., in java if you have int[] a; then a[i] == null is ill-typed
rippa has joined #ruby
jhack__ has quit [Quit: Leaving]
lheaded has quit [Remote host closed the connection]
Mr_Pancake has quit [Ping timeout: 240 seconds]
jhack has joined #ruby
jhack has quit [Changing host]
jhack has joined #ruby
<mzo>
do you frequently rely on the fact that #[] returns nil? like `foo = bar[i] or baz` or so?
<mzo>
or would that be poor style in ruby
<herwin>
foo.fetch(i, baz)
<leah2>
i use || for default value often
<leah2>
more with hashes than arrays tho
<herwin>
actually, i don't think i use array indexes that much
Rodya_ has quit [Remote host closed the connection]
<herwin>
mostly just map/each
nhhc has joined #ruby
lightheaded has joined #ruby
OTORelic has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
frack has joined #ruby
gsilva has joined #ruby
Inv1s1ble_ has joined #ruby
minimalism has quit [Quit: minimalism]
<frack>
How do you print numbers to a new line ie puts var + var
lightheaded has quit [Remote host closed the connection]
<leah2>
puts var, var
philpep has left #ruby [#ruby]
benlieb has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
naprimer_2 has joined #ruby
jgnagy has quit [Ping timeout: 258 seconds]
ozcanesen has joined #ruby
krobzaur has quit [Ping timeout: 240 seconds]
naprimer_3 has quit [Ping timeout: 258 seconds]
CloCkWeRX has quit [Quit: Leaving.]
Lord_of_Life has quit [Excess Flood]
etehtsea has joined #ruby
Lord_of_Life has joined #ruby
patarr has joined #ruby
jgnagy has joined #ruby
raphaelmro has joined #ruby
yeticry has joined #ruby
Qchmqs has quit [Quit: Konversation terminated!]
unshadow has quit [Quit: leaving]
Arpanet69 has quit [Ping timeout: 264 seconds]
yeticry_ has quit [Read error: Connection reset by peer]
aganov has quit [Remote host closed the connection]
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
Arpanet69 has joined #ruby
minimalism has joined #ruby
jenrzzz has joined #ruby
Burgestrand has quit [Read error: Connection reset by peer]
Burgestr_ has joined #ruby
uncertainty has joined #ruby
<allisio>
mc_fail: Put it in your library's `data/` directory and use `Gem.datadir` later to retrieve the actual path.
jenrzzz has quit [Ping timeout: 268 seconds]
raspado has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
<keanny479>
does anyone can help me to color the user score line in a table (i use terminal-table gem) ?
todd1 is now known as Todd
milardovich has quit [Remote host closed the connection]
<keanny479>
the file concerned : lib/format.rb
blackwind_123 has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
uncertainty has joined #ruby
DARPA has joined #ruby
_djbkd has joined #ruby
Danny_ has joined #ruby
milardovich has quit [Ping timeout: 246 seconds]
Arpanet69 has quit [Ping timeout: 264 seconds]
DARPA has quit [Ping timeout: 256 seconds]
pawnbox has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troulouliou_div2 has quit [Quit: Leaving]
dar123 has joined #ruby
dlitvak has quit [Quit: Connection closed for inactivity]
mzo has quit [Ping timeout: 264 seconds]
duderonomy has quit [Ping timeout: 258 seconds]
mgorbach has quit [Ping timeout: 256 seconds]
<Eiam>
a[20] if 20 is out of range shouldn't return nil, that perpetuates the practice of making nil have a meaning
<Eiam>
which leads to people checking for nil like its a "thing"
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<allisio>
It's a "thing" just as much as zero is.
tvw has quit [Ping timeout: 260 seconds]
tolerablyjake has joined #ruby
aupadhye has joined #ruby
<havenwood>
Eiam: I recall someone saying that if you ask Ruby to go to the store and get some grapefruit gum it comes back and says there was none. If you ask Python to go to the store and by grapefruit gum it burns the store down.
<Eiam>
allisio: um, no
dar123 has quit [Read error: Network is unreachable]
cdg_ has quit [Remote host closed the connection]
<allisio>
Eiam: It's an encoding of absence.
<havenwood>
Eiam: When something isn't there it makes sense to say there was nothing. It's not a particularly exceptional event.
<Eiam>
I had 3 pieces of candy and I ate 3, now I have 0 left. 0 is a value, nil is not
<allisio>
You're using largely unrelated precepts from other fields to make conclusions about the Ruby language.
<Eiam>
allisio: I write plenty of ruby every day. Using Nil as a placeholder for meaning is poor design. it leads to nil checks and all sorts of crap in your code
<Eiam>
because you are treating nil like it has meaning , like "empty" or "0"
br0d1n has joined #ruby
<Eiam>
then it creeps in everywhere and you are stuck defending your code from nils all over the place
<allisio>
It has the meaning "nonexistence", but that does not cause nil itself to be nonexistent in any useful sense.
<Eiam>
non-existence is not the same as 0
<allisio>
No, they're not, but there's an obvious relationship.
<Eiam>
if I take an average and the value is 0, thats not the same as the value being nil
* baweaver
wanders in
<baweaver>
Ah, we have another Nil zealotry argument, fun.
aupadhye has quit [Remote host closed the connection]
* Papierkorb
sips tea
dar123 has joined #ruby
* havenwood
gulps coffee
* herwin
grabs the popcorn
* Eiam
watches in amusement from the sidelines too
<Eiam>
wait what?
<Papierkorb>
What will happen next? Will Eiam and allisio come to a conclusion?! Tune in next time to Language Fights to find out!
<baweaver>
If you're really bent on that you can always use a Hash instead with a default constructor
<baweaver>
or make a new array
<eam>
< allisio> Is that a dare? -- lol
<Eiam>
I'm just generally against concepts that perpetuate the idea of assigning nil to have some kind of meaning in code instead of taking the time to assign it an ACTUAL value that has ACTUAL meaning
<Eiam>
like :not_found or a results object, etc
<allisio>
Eiam: Sparse arrays.
<allisio>
Would you want to *have* to use a Hash for those?
<nofxxx>
Eiam, which will be what for yourt unexistent oblivion NIHIL a[20] ?
<allisio>
A "null" type just *is* useful for encoding the notion of absence.
<Eiam>
nofxxx: there are other solutions beyond a nil.
<Eiam>
nofxxx: how do you distinguish if the nil means I put it there or it started that way?
<nofxxx>
Eiam, I don't know a better one, do you?
* baweaver
waits for Monads to come up again
keanny479 has quit [Ping timeout: 260 seconds]
<allisio>
I concede that `nil` isn't "necessary", in any meaningful sense, but it's part of the "flavor" of Ruby and just one of those things you have to take on board at some point.
blackmesa has joined #ruby
roadrunneratwast has joined #ruby
<Eiam>
nofxxx: you could raise, oob error, return a type designed to mean something. I'm not suggesting that Ruby should suddenly *start* doing these things ,but plenty of languages DON'T return a nil/null in such a case
<havenwood>
Eiam: nil is the type designed to mean the something, from the Lisps
rquid has joined #ruby
<nofxxx>
Eiam, that won't be simple as nil. Nothing beats the simplest solution.
preyalone has joined #ruby
<Eiam>
havenwood: I get that its old
Snickers has joined #ruby
<elomatreb>
If you want strict key behaviour, both Hash and Array have #fetch. But then you have rescues all over your code instead of nil checks :shrug:
<toretore>
havenwood: isn't this built in functionality?
<nofxxx>
Eiam, well, we could agree in one thing: we should have a std lib 'maybe' monad
<toretore>
havenwood: maybe not in ruby where nil actually is a reference, but in other languages it's the lack of one, and you don't know until you try
<nofxxx>
rails did it with #try
Danny_ has quit []
<allisio>
Is `nil` a reference?
<toretore>
so in one way ruby doesn't actually have a null reference, the absence of a value is the value nil
<username1>
what about the fact that theres no action on the string
milardovich has quit [Ping timeout: 256 seconds]
[Butch]_ has joined #ruby
frack has joined #ruby
<matthewd>
It would be *possible* for the parser to special-case that, I guess, but it doesn't seem generally useful
<username1>
clearly, i had some misconceptions
<username1>
matthewd: thanks
<username1>
hxegon: thanks
<hxegon>
username1: no problem.
jgnagy has quit [Ping timeout: 260 seconds]
invalidusrname has joined #ruby
[Butch] has quit [Ping timeout: 256 seconds]
[Butch] has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
nhhc has quit [Quit: Leaving]
blackmesa has joined #ruby
[Butch]_ has quit [Ping timeout: 256 seconds]
HoierM has joined #ruby
<mzo>
ruby is exciting
HoierM has quit [Max SendQ exceeded]
<allisio>
You're exciting.
HoierM has joined #ruby
<mzo>
hehe ^___^
HoierM has quit [Max SendQ exceeded]
[Butch] has quit [Ping timeout: 240 seconds]
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
[Butch] has joined #ruby
aryaching has joined #ruby
rob has joined #ruby
zacts has quit [Quit: WeeChat 1.7]
zacts has joined #ruby
Ishido has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
Coldbla2 has joined #ruby
uncertainty has quit [Ping timeout: 240 seconds]
Coldblackice has quit [Ping timeout: 246 seconds]
Jayson_Virissimo has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
troulouliou_dev has joined #ruby
hahuang61 has quit [Ping timeout: 258 seconds]
jgnagy has joined #ruby
zeroDi has joined #ruby
xall has quit [Ping timeout: 256 seconds]
DARPA has joined #ruby
zeroDi has quit [Read error: Connection reset by peer]
zeroDi has joined #ruby
hotpancakes has joined #ruby
roadrunneratwast has left #ruby [#ruby]
dionysus69 has joined #ruby
szulak_ has joined #ruby
_djbkd has quit [Remote host closed the connection]
_djbkd has joined #ruby
bilal80 has quit [Quit: bilal80]
enterprisey has quit [Remote host closed the connection]
_djbkd has quit [Ping timeout: 240 seconds]
hotpancakes has quit [Remote host closed the connection]
Robtop__ has joined #ruby
hotpancakes has joined #ruby
rikkipitt has joined #ruby
rikkipitt has quit [Client Quit]
Ishido has quit [Ping timeout: 260 seconds]
pwnd_nsfw` has quit [Ping timeout: 258 seconds]
troulouliou_dev has quit [Quit: Leaving]
Ravunni has joined #ruby
jenrzzz has joined #ruby
frack has left #ruby ["Leaving"]
Ravunni has left #ruby [#ruby]
m_31 has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
jgnagy has quit [Ping timeout: 268 seconds]
bkxd has quit [Ping timeout: 260 seconds]
jgnagy has joined #ruby
username1 has quit [Ping timeout: 246 seconds]
<Eiam>
ruby is fun, definitely the most fun language I use =p
szulak_ has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<Eiam>
baweaver: I've seen this, thanks =) I used to have my results from LYAH & CS194 on github but I guess I pulled it down... did all the workshets and such. was fun, haskell was fun to play in
Rodya_ has quit [Remote host closed the connection]
rkazak_ has joined #ruby
gusrub has quit [Remote host closed the connection]
Jayson_Virissimo has quit []
hahuang61 has joined #ruby
mula has joined #ruby
_djbkd has joined #ruby
enterprisey has joined #ruby
gloscombe_ has joined #ruby
kitikonti has joined #ruby
onkelhotte has joined #ruby
augcesar has quit [Quit: Connection closed for inactivity]
JeanCarloMachado has joined #ruby
hahuang61 has quit [Quit: WeeChat 1.5]
vali has joined #ruby
vali has quit [Remote host closed the connection]
Raboo has quit [Ping timeout: 264 seconds]
uncertainty has joined #ruby
br0d1n has quit [Quit: Leaving]
benlieb has joined #ruby
onkelhotte has quit [Quit: WeeChat 1.6]
cdg has joined #ruby
cpruitt has quit [Ping timeout: 240 seconds]
onkelhotte has joined #ruby
username1 has joined #ruby
jgnagy_ has joined #ruby
gusrub has joined #ruby
jgnagy has quit [Ping timeout: 240 seconds]
rkazak_ has quit [Quit: Sleep.....ing....]
onkelhotte has quit [Quit: WeeChat 1.6]
enterprisey has quit [Ping timeout: 260 seconds]
SuperTux88 has quit [Ping timeout: 255 seconds]
blackmesa has quit [Ping timeout: 256 seconds]
onkelhotte has joined #ruby
enterprisey has joined #ruby
onkelhotte has quit [Client Quit]
onkelhotte has joined #ruby
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
onkelhotte has quit [Client Quit]
DARPA has quit [Ping timeout: 258 seconds]
onkelhotte has joined #ruby
esObe_ has joined #ruby
esObe_ has quit [Remote host closed the connection]
esObe_ has joined #ruby
kirun has joined #ruby
haylon has quit [Quit: Leaving]
dopamean_ has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
SuperTux88 has joined #ruby
KnownSyntax has quit [Remote host closed the connection]
saslam has joined #ruby
bkxd has joined #ruby
marxarelli is now known as marxarelli|afk
uncertainty has quit [Ping timeout: 240 seconds]
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
<raspado>
hi all, I have a script that shows "self.delete( hosts )", it calls another lib with "def delete ( hosts = [] ) ... " is self.delete ( hosts ) an array or is it a string?
<raspado>
not sure if I should pass hosts as ["blah.vmbox"] or "blah.vmbox"
roadrunneratwast has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
cpruitt has joined #ruby
onkelhotte has quit [Quit: WeeChat 1.6]
KnownSyntax has quit [Ping timeout: 246 seconds]
milardovich has joined #ruby
<agent_white>
!tias
<agent_white>
D:
dionysus69 has quit [Ping timeout: 240 seconds]
<dminuoso>
?tias
<ruby[bot]>
Why don't you try it and see for yourself?
skweek has quit [Ping timeout: 268 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
saslam_ has joined #ruby
DTZUZU has quit [Quit: WeeChat 1.5]
szulak_ has joined #ruby
griffindy has joined #ruby
tystr has joined #ruby
saslam has quit [Ping timeout: 258 seconds]
HoierM has joined #ruby
<raspado>
array... i see thx!
HoierM has quit [Max SendQ exceeded]
onkelhotte has joined #ruby
griffindy has quit [Ping timeout: 258 seconds]
hooper has joined #ruby
IRCFrEAK has joined #ruby
IRCFrEAK has quit [Max SendQ exceeded]
pytuger has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
workmad3 has quit [Ping timeout: 264 seconds]
blackwind_123 has joined #ruby
hotpancakes has quit [Remote host closed the connection]
saslam has joined #ruby
saslam_ has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
d0nn1e has quit [Ping timeout: 256 seconds]
d0nn1e has joined #ruby
renchan has quit [Remote host closed the connection]
raul782 has quit [Remote host closed the connection]
lupine has joined #ruby
ldnunes has quit [Quit: Leaving]
jgnagy_ has quit [Ping timeout: 268 seconds]
alphor has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 256 seconds]
pawnbox has quit [Remote host closed the connection]
jgnagy has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
pawnbox has joined #ruby
aryaching has joined #ruby
milardov_ has joined #ruby
vikaton has quit [Quit: Connection closed for inactivity]
oryman has joined #ruby
onkelhotte has quit [Quit: WeeChat 1.7]
oryman has quit [Client Quit]
blackmesa has quit [Ping timeout: 246 seconds]
milardovich has quit [Ping timeout: 260 seconds]
jgnagy_ has joined #ruby
pawnbox has quit [Ping timeout: 256 seconds]
DARPA has joined #ruby
hahuang61 has joined #ruby
jgnagy has quit [Ping timeout: 264 seconds]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
DARPA has quit [Ping timeout: 268 seconds]
jamesaxl has joined #ruby
hotpancakes has joined #ruby
invalidusrname has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang61 has quit [Ping timeout: 268 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
pulkit4tech has quit [Quit: Connection closed for inactivity]
jamesaxl has joined #ruby
uncertainty has joined #ruby
futilegames has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
KnownSyntax has quit [Ping timeout: 260 seconds]
[Butch] has quit [Ping timeout: 260 seconds]
jamesaxl has joined #ruby
[Butch] has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
patarr has quit [Ping timeout: 240 seconds]
KnownSyntax has joined #ruby
KnownSyntax has joined #ruby
KnownSyntax has quit [Changing host]
kendocode has joined #ruby
cdg has quit [Remote host closed the connection]
kendocode has quit [Quit: Leaving]
kendocode has joined #ruby
agent_white has quit [Quit: leaving]
pwnd_nsfw has joined #ruby
Robtop__ has quit [Ping timeout: 268 seconds]
raul782 has joined #ruby
[Butch]_ has joined #ruby
alphor has joined #ruby
cdg has joined #ruby
tomphp has joined #ruby
[Butch]_ has quit [Client Quit]
[Butch] has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
raul782 has quit [Remote host closed the connection]
postmodern has joined #ruby
blackmesa has joined #ruby
jamesaxl has quit [Quit: Leaving]
sepp2k has quit [Ping timeout: 256 seconds]
dlitvak has joined #ruby
litheum has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
<jaffejoe>
anyone here familiar with using watir gem for web scraping?
<jaffejoe>
trying to figure out this error message i'm getting
raul782 has joined #ruby
<mzo>
actually with the new optimizations in ruby 2.5 it's slightly faster than even hand-tuned assembly in several of the benchmarks i've put together
<ddffg>
rust is super fast
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
<mzo>
yes it is. the rust team is doing some impressive work and leveraging the amazing LLVM infrastructure. still not quite as fast as ruby 2.5, but before long i suspect rust will take the lead.
<Disavowed>
mzo: Is 2.5 the one where the hash tables move to open addressing? I'm surprised to see Ruby smoke Python so comprehensively in those benchmarks
pwnd_nsfw` has quit [Read error: Connection reset by peer]
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
pwnd_nsfw` has joined #ruby
HoierM has joined #ruby
HoierM has quit [Max SendQ exceeded]
<havenwood>
ddffg: That comparison doesn't allow high level languages to use idiomatic constructs. So it favors low level languages or those whose idiomatic form mirrors them.