<Verity>
but if anyone has a moment to take a look and see if I made an glaring errors or big mistakes
<Verity>
(it fully works, aside from any unknown bugs)
<Verity>
but I'd like to improve my ruby code quality as I picked this project to learn the language
<nofxxx>
Verity, rubocop it, nice to find lil improves
<Disavowed>
Verity: Not a mistake, but I know that attr_accessor has unlimited arity, so I don't think you need to call it for each attribute. That might be rubbish though - I'm not exactly seasoned at Ruby
Rodya_ has joined #ruby
<Verity>
rubocop has some problems with it, mostly methods too long and some other stuff I didn't understand. I used it to help fix a lot of stuff though and meet standard preferred form
<nofxxx>
Disavowed, +1 that...
<Verity>
oh I see
<Verity>
that could be one attr_accessor
<Verity>
with a comma separated list of properties
Pumukel has joined #ruby
<Disavowed>
Verity: That's the way.
naprimer has quit [Ping timeout: 268 seconds]
agent_white has joined #ruby
<havenwood>
Verity: Consider `%w[-s -r]` on line 7.
<havenwood>
Verity: Do any of these not need a setter as well as a getter? If so, change to: attr_reader
<Verity>
I'll have to go through and check, but absolutely some only need a getter, yes
<nofxxx>
Verity, just a suggestion too: the commands == 's' and 'r' blocks, could be inside the class, so no need for p1. p1. p1. on each line, just: SerialPort.new(com_port).send! or ... (com_port).receive!
<havenwood>
Verity: Why `0xff.chr` instead of `255.chr` when the rest are ints?
<Verity>
I think its a relic from when I was confused, I'l fix that
<Verity>
ah ok, didn't realize that would work here too
<havenwood>
Verity: Just `exit` produces a success exit signal of 0. Consider using `abort` instead for an exit signal of 1.
<elomatreb>
unless is even more ruby-ish probably
chouhoulis has quit [Remote host closed the connection]
_sfiguser has quit [Quit: Leaving]
<Verity>
is this what you mean about the shoveling line, "packet = soh + payload + gen_crc8(packet.bytes).chr"
<havenwood>
Verity: Also, `puts` prints to STDOUT not STDERR. You can `warn`, but better yet use `abort('Error. Bad filename.')` to both warn and exit(1).
<Verity>
ah wait that would be a problem, I'll think it over
chouhoulis has joined #ruby
<havenwood>
Verity: It's nice to use File.open with a block so it's self-closing. If you don't use a block it's up to you to ensure it closes.
<Verity>
I think I forget to close it
<Verity>
if thats the case
<havenwood>
Verity: On these lines like `if finished == true` change it to just `if finished`.
<havenwood>
Verity: Just `finished` is already truthy or falsey.
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Verity>
alright
<Verity>
and so if !finished would work too?
<Verity>
for the lines that need the reverse
<havenwood>
Verity: Except say `unless finished`
<havenwood>
Verity: but yes, `!finished` is not finished
<havenwood>
Instead of `ARGV.count < 3 || ARGV.count > 3` just do `ARGV.count == 3`
<havenwood>
Verity: case command; when '-s'; ...; when '-r'; ...; end
<Verity>
that will be cleaner, I had forgotten///not learned ruby had a switch type statement
<Verity>
thanks for all of these tips, I'm going to make the improvements
naprimer has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
hahuang65 has joined #ruby
gnufied has quit [Ping timeout: 246 seconds]
hutch34_ has joined #ruby
gnufied has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
LuckyABA has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
gnufied has quit [Client Quit]
jgpawletko has quit [Quit: jgpawletko]
<allisio>
Ruby's `case` is way better than $LANG's `switch`.
charliesome has joined #ruby
<StoneCypher>
why
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<allisio>
It uses the case equality (`===`) operator (which is really the #=== method) to do the comparison, so you get a lot of nifty functionality for free.
marr has quit [Ping timeout: 260 seconds]
ahrs has quit [Remote host closed the connection]
patarr has joined #ruby
Channel6 has joined #ruby
ahrs has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
raspado has quit [Read error: Connection reset by peer]
raspado has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
Pumukel has quit [Remote host closed the connection]
<Komic>
ERROR: Ruby install aborted due to missing extensions
patarr has joined #ruby
enterprisey has joined #ruby
<Komic>
output*
PorcoRex has joined #ruby
znz_jp has quit [Remote host closed the connection]
nofxxx has quit [Remote host closed the connection]
nofxx has joined #ruby
<PorcoRex>
Good evening from Argentina #ruby. It's nice to see such a popular channel about Ruby.
patarr has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
znz_jp has joined #ruby
kaspergr1bbe has quit [Quit: Lost terminal]
Guest96_ has quit [Remote host closed the connection]
shterrett has joined #ruby
cam27 has joined #ruby
patarr has joined #ruby
<PorcoRex>
I have a question about concurrency in Ruby, not specifically on the MRI implementation of the language. I want to make my gem thread safe using a readers-writer lock.
Guest96 has joined #ruby
shterrett has quit [Client Quit]
<PorcoRex>
I'm aware the Sync class in the standard library that provides this kind of functionality, but I have seen the Mutex being used much more often, even when a shared/exclusive lock would be a better choice (i.e. Singleton).
<PorcoRex>
I was just wondering if anyone has some concerns or commentary on the Sync class and if it would be safe to use considering different language implementations.
chouhoulis has quit [Remote host closed the connection]
chouhoul_ has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
<Komic>
dang okay
<Komic>
i fixed it
<Komic>
turns out it was just confused because it expected another version of openssl
patarr has joined #ruby
<Komic>
apt install libssl1.0-dev to replace libssl-dev fixed it
<Komic>
i'll reinstall libssl-dev later~
<Komic>
sorry for the bother
<Komic>
the error message is a bit weird, tho
<allisio>
PorcoRex: Sync appears to be almost completely undocumented.
<allisio>
Does Mutex and its #synchronize method not serve your purpose?
<PorcoRex>
Well, it is almost completely undocumented in the docs, but there are just the examples I needed on the Pickaxe. I believe (though I might be wrong) that Mutex does not allow to open shared/exclusive locks. So for instance:
<PorcoRex>
I believe the SHA# should be generated only be based on the file contents, but I might be off.
raspado has quit [Remote host closed the connection]
hahuang65 has joined #ruby
StoneCypher has quit [Ping timeout: 260 seconds]
pwnd_nsfw has joined #ruby
DTZUZU has quit [Quit: WeeChat 1.5]
KevinCOM has joined #ruby
gusrub has quit []
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
tolerablyjake has joined #ruby
c_nick has joined #ruby
hndk has joined #ruby
<c_nick>
hi ..Addition of two arrays into a third.. is the '+' operator the right way to do it ? or should i loop the contents and use '<<' operator ?
KevinCOM has quit []
zipace has quit [Ping timeout: 246 seconds]
<PorcoRex>
c_nick, "+" is concatenation, and should work fine unless there is a reason for you not to add a particular element into the array (for example you don't want repeated elements or etc.).
<PorcoRex>
c_nick, also "<<" will append items in place, which might or might not be what you want to do.
jamesaxl has quit [Ping timeout: 240 seconds]
<c_nick>
PorcoRex, indeed, was planning to loop in the array and then add the individual element in the new array
<c_nick>
conatenation is not a costly operation right as compared to <<?
<c_nick>
concatenation* (appologies for the typo, getting used to the new laptop keyboard)
<PorcoRex>
Just give us a brief example and maybe we can figure out the best way to implement it.
bkxd has joined #ruby
<c_nick>
PorcoRex, simple addition .. [1,2] [3,4] no issues of duplicated.. i can use concat to save on the extra variable (being too miser?)
<allisio>
You said you had three arrays.
<allisio>
If that's still the case, you want either #concat or `reduce(:+)`.
<PorcoRex>
c_nick, consider that the "+" method is native, i.e. C code, so it should be better than iterating the arrays yourself in Ruby.
<PorcoRex>
*should.
<c_nick>
ok thanks everyone :)
FoX_77 has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
esObe_ has quit [Ping timeout: 240 seconds]
raspado has quit [Ping timeout: 256 seconds]
<al2o3-cr>
[*a, *b] is the faster of those three
marxarelli is now known as marxarelli|afk
<PorcoRex>
al2o3-cr, ¿even the "+" concatenation?
<al2o3-cr>
yep
<PorcoRex>
al2o3-cr, very interesting.
<al2o3-cr>
concat is faster than +
<al2o3-cr>
on ruby 2.4 anyway
<PorcoRex>
al2o3-cr, seems counterintuitive considering that #concat can concatenate multiple arrays and "+" can only concatenate a pair of them.
<al2o3-cr>
PorcoRex: only true as of 2.4
erlend has quit [Read error: Connection reset by peer]
erlend has joined #ruby
<PorcoRex>
Don't misunderstand me, I'm just saying it's a bit weird.
<PorcoRex>
:)
<al2o3-cr>
how do you mean "+" can only concatenate a pair?
<allisio>
A pair of arrays.
<allisio>
You can't say `a.+(b, c)`.
<PorcoRex>
Right.
<al2o3-cr>
i see :)
ixti has quit [Quit: WeeChat 1.7]
* baweaver
actually thought about how to monkeypatch that
Channel6 has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
johnzorn has joined #ruby
johnzorn has quit [Client Quit]
gigetoo has joined #ruby
<allisio>
You would.
dar123 has joined #ruby
skweek has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
c_nick has quit [Quit: ciaos]
HippoDippo has joined #ruby
hutch34_ has joined #ruby
<HippoDippo>
In general, what are the main reasons why someone would use recursion?
ElSif has joined #ruby
Sweetlie has quit [Ping timeout: 268 seconds]
<PorcoRex>
That sounds like a homework/test question.
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
dar123 has quit [Read error: Network is unreachable]
jaequery has joined #ruby
<allisio>
HippoDippo: We would appreciate your candor.
Sweetlie has joined #ruby
hutch34_ has quit [Ping timeout: 260 seconds]
<HippoDippo>
allisio: I suppose i am just wondering what is recursion used for other than, looping through a method with a modified parameter. I'll find the answer somewhere but was just seeing if i could get a quick answer.
<allisio>
HippoDippo: Recursion essentially gives you an implicit stack, and stacks are mighty useful.
<allisio>
Iteration and recursion can be shown to be completely equivalent; it's just that one or the other is usually more convenient (read: well-suited) to a particular problem.
<PorcoRex>
HippoDippo, it's a bit more than that. For instance you'll want to have a condition in your method that returns something. Say you have a circle with more circles inside, and you want to count all circles.
<HippoDippo>
Ohh i see
<PorcoRex>
Then you could go to the big circle and count all circles that are immediately inside it, and then you would call the function recursively on each of the inner circles. Once a circle does not have inner circles you would return 1 (to count oneself).
<PorcoRex>
Boom, it's magic.
jenrzzz has quit [Ping timeout: 260 seconds]
<PorcoRex>
You add all the ones and return the additions, and you go adding them as you're going out of the recursion. Then you have the total ammount of circles.
<PorcoRex>
Also works with triangles.
<HippoDippo>
what about hexagons?
<PorcoRex>
I haven't tried, but probably works. ;)
<HippoDippo>
Like you said, MAGIC ;)
truenito has quit [Ping timeout: 240 seconds]
jcao219 has quit [Ping timeout: 240 seconds]
<PorcoRex>
Talking about recursion in Ruby, do you think it would be a good or bad idea for a "functional" approach to Ruby? I mean for example tail call optimization or at least a good trampolining option for using recursion for looping?
jenrzzz has joined #ruby
<baweaver>
ruby has TCO as a compile flag
<baweaver>
but I wouldn't call that true support
<PorcoRex>
baweaver, that's neat, I wasn't aware of it!
<baweaver>
Ruby can go functional-lite, but you can only get so far on it without straight lambda-calculus style programming with lambdas
xall has joined #ruby
<PorcoRex>
I know a guy that'll love it.
<baweaver>
Scala is probably a better language for it on the hybrid end
<PorcoRex>
I'm not really functional-oriented myself, in fact I'm a layman. What is the flag just out of curiosity?
<PorcoRex>
I'll let him know on his birthday or something.
<baweaver>
if you want to go full on functional you'll end up deep into a magical land called category theory
AnoHito_ has joined #ruby
<baweaver>
Read 'The Haskell Book' or 'Learn you a Haskell' if you're inclined to take that jump
mitt3ns has joined #ruby
<baweaver>
that's effectively the deep end
jcao219 has joined #ruby
AnoHito_ has quit [Read error: Connection reset by peer]
<baweaver>
Scala (JVM), Kotlin(JVM), F#(.NET), and others are more hybrid in their approaches and can be more welcoming.
AnoHito_ has joined #ruby
<baweaver>
Clojure in the case that you want to stay dynamic
bkxd has joined #ruby
AnoHito_ has quit [Read error: Connection reset by peer]
<PorcoRex>
baweaver, I've started reading some Haskell because, if I must learn functional programming, I don't want the JavaScript functional approach. I want the real thing, you know? But it's good to have a reference to start.
AnoHito_ has joined #ruby
<baweaver>
For all the hate, JS actually has more potential to be functional than Ruby
MrBismuth has joined #ruby
<PorcoRex>
baweaver, oh, definitely, but if I learn a completely new paradigm I'm more prone on making mistakes on JS than on Haskell.
AnoHito has quit [Ping timeout: 246 seconds]
esObe_ has joined #ruby
agent_white has quit [Ping timeout: 246 seconds]
<baweaver>
fair
<baweaver>
Scala will feel very familiar as well
MrBusiness has quit [Ping timeout: 246 seconds]
StoneCypher has joined #ruby
<PorcoRex>
baweaver, I prefer the hard road, just to assimilate the paradigm. Once I'm confortable I think I can make the choice of a hybrid lang.
<baweaver>
fair
<PorcoRex>
In any case, which one would you recommend on a complete noob of functional programming, the Haskell book or the other one?
<baweaver>
note I mentioned two Haskell books
<baweaver>
The Haskell Book is paid
<baweaver>
but also written by BiteMyApp (Chris Evans) who's one of the best IRC helpers around for the language
<baweaver>
so if anyone knows it....
<PorcoRex>
If it's worth it, then it's a great gift after I finish reading it.
chouhoulis has quit [Remote host closed the connection]
<baweaver>
It's definitely a tome, fair warning
bkxd has quit [Ping timeout: 260 seconds]
<PorcoRex>
So I guess that's the recommended one. :) Thanks!
esObe_ has quit [Ping timeout: 246 seconds]
<PorcoRex>
baweaver, and if I might pick your brain one last time tonight, in your biased opinion, is a declarative or an imperative approach better, considering an app that will need to be maintained in the long term?
hndk has quit [Quit: Leaving]
mim1k has joined #ruby
<PorcoRex>
And also performance, if you want to take it into account.
<baweaver>
depends heavily on what the app is in my opinion
<baweaver>
and by which metric you want to measure performance
<baweaver>
it's silly to use a chainsaw on a Bonsai tree, but also foolish to use a hand axe on a redwood
<baweaver>
right tool for the job and such
<PorcoRex>
baweaver, that's fair, but consider I'm completely unaware of the declarative programming paradigm.
<baweaver>
Erlang/Elixir are great for highly concurrent systems but can be terrible at string manipulation
<baweaver>
Haskell gets a ton of use in the financial sectors
<allisio>
Is it "a ton" these days?
<baweaver>
there's really not a good answer
<StoneCypher>
erlang is fine for string manipulation.
<PorcoRex>
baweaver, then a better question would probably be, if there was only the choice, would you use declarative or imperative?
<baweaver>
which tree am I trying to cut down?
HippoDippo has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<StoneCypher>
that reputation comes from people who don't know the language suffering performance consequences that chapter 2 of the manual would have warned them away from, such as binary caching
<StoneCypher>
PorcoRex: there are almost no real world declarative languages
<StoneCypher>
PorcoRex: unless you're talking about css, the chances that a declarative language is available to you is small enough that i have serious doubts about the question
<StoneCypher>
PorcoRex: in the meantime, the language is far more important than under what paradigm it is described
<StoneCypher>
PorcoRex: with respect i would proffer that you should consider another approach
pulkit4tech has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
<PorcoRex>
StoneCypher, another approach in what sense? I'm just considering approaching a different paradigm and I want to assess how far of my confort zone that will get me.
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<StoneCypher>
PorcoRex: another approach in the sense that looking by paradigm is like looking for the best car by paint color.
<baweaver>
Prolog is a declarative language, but you'd be hard pressed to make it do general work.
<StoneCypher>
PorcoRex: instead consider looking for a language by the set of tools it offers for your current situation
<baweaver>
mainly it ends up on rule engines and logic chains
djbkd has joined #ruby
<StoneCypher>
baweaver: it's actually not. the rules are modifiable and it's implemented with horn clauses
<StoneCypher>
it's close enough that people say that
<StoneCypher>
but, technicality land, etc
<PorcoRex>
StoneCypher, I don't think that's entirely correct. For instance I can live confortably generating random numbers by calling a method in Ruby, but hard pressed to think about such a thing in a functional language such as Haskell.
<StoneCypher>
PorcoRex: well, ... i'm not sure why
<StoneCypher>
PorcoRex: probably that's because you don't speak haskell
<StoneCypher>
PorcoRex: but not because of its paradigm, really. like, you can do the same thing procedurally, imperatively, or functionally easily in ruby (and probably also javascript)
<PorcoRex>
baweaver, is it straightforwards to generate random numbers in Haskell?
<StoneCypher>
... yes
<baweaver>
I'd have a heck of a time describing something in spanish or german, but can do just fine in english
aglorei has quit [Remote host closed the connection]
<StoneCypher>
baweaver: that's a good way to explain that. i'm stealing it
Pumukel has joined #ruby
<baweaver>
Mein deutsch ist schrecklich
aglorei has joined #ruby
<baweaver>
steal away
<StoneCypher>
mein deutsch ist nicht so gut
<PorcoRex>
Pero yo no hablo el Alemán.
<StoneCypher>
it's good enough for me to say "kartoffelsalat" in entirely inappropriate places, on purpose
<allisio>
Gesundheit.
<StoneCypher>
allisio: no, it's mayonnaise
mitt3ns is now known as agent_white
<allisio>
To your health, all the same.
<agent_white>
I like butter on my sandwiches instead.
<StoneCypher>
:D
<PorcoRex>
StoneCypher, I think you're right. I might as well delve into it and see how everything clicks.
<agent_white>
Mayo is ok too though.
<baweaver>
Remember you have years in C style languages
<baweaver>
not so much in Haskell land
<StoneCypher>
PorcoRex: haskell is too large and difficult to be a useful platform for learning paradigms. if you want to learn it, great; it's a wonderful language. but if your goal is to learn functional programming, it's as bad a choice as learning c++ to pick up datastructures.
* baweaver
coughs
<agent_white>
I dunno about that.
* baweaver
tries to forget college
<agent_white>
I think it's entirely useful.
* StoneCypher
didn't say anything about utility.
<StoneCypher>
oh
<agent_white>
We are a carrier (CLEC) and our infrastructure is heavily based in Haskell.
<StoneCypher>
actually i did. sorry and withdrawn
<StoneCypher>
agent_white: okay?
<StoneCypher>
agent_white: note that what i said was "useful for learning paradigms"
<agent_white>
StoneCypher: To discount Haskell, or any language, is sillyness. Don't be a silly nilly.
<PorcoRex>
StoneCypher, fair enough. Do you say that because C already had data structures or because I'm learning Haskell when a good and minimal subset of functional programming can be had somewhere else?
<StoneCypher>
agent_white: c++ is a wonderful tool for a lot of things too. just not for learning the basics of datastructures.
<StoneCypher>
agent_white: i didn't discount haskell
<StoneCypher>
agent_white: in fact i said "if you want to learn it, great; it's a wonderful language"
<agent_white>
Most colleges teach those data structures in C or Java. So don't be surprised when folks come from there.
<StoneCypher>
PorcoRex: c doesn't have datastructures :D structs aren't datastructures. but yes, i meant that in contrast to c, where implementing them tends to be easier.
<agent_white>
Haskell will be nothing like C.
<agent_white>
Just know that.
<PorcoRex>
agent_white, probably not. :)
<agent_white>
The paradigm shift is fairly drastic.
Pumukel has quit [Ping timeout: 258 seconds]
<PorcoRex>
I'll just do Haskell. Null nil void alternatives seem a bit redundant to me.
jdm_ has joined #ruby
<baweaver>
Maybe
<StoneCypher>
PorcoRex: if your goal is to learn haskell, then do
<baweaver>
I find it all Optional
<StoneCypher>
baweaver: ... ouch
renchan has joined #ruby
<baweaver>
welcome to #ruby, where a good pun is its own reword
gigetoo has quit [Ping timeout: 256 seconds]
<PorcoRex>
StoneCypher, thanks! :)
<Verity>
I learned data structures in C++
AnoHito has joined #ruby
danielpclark has quit [Remote host closed the connection]
jdm has quit [Ping timeout: 240 seconds]
<PorcoRex>
Verity, I need to read about them. I thought they were the "struct" ones up until this point.
<agent_white>
Someone shoulda asked HippoDippo what the function of a slope is to explain one reason why a function would be recursive.
AnoHito_ has quit [Ping timeout: 268 seconds]
<StoneCypher>
Verity: ... ouch
AnoHito has quit [Read error: Connection reset by peer]
AnoHito has joined #ruby
hutch34_ has joined #ruby
<PorcoRex>
agent_white, I think he just wanted to understand why does recursion might even be useful at any point in time.
AnoHito has quit [Read error: Connection reset by peer]
<agent_white>
Or factorials I guess. Maybe say "if you're doing finance here is your compound interest function stuffs"
<agent_white>
Yeah I know :)
<agent_white>
Taxes!
<agent_white>
Or stocks or something.
<PorcoRex>
agent_white, and Hanoi.
<Verity>
nrf.rf_setup(:rate_250kbps, :max_power
<Verity>
)
<agent_white>
PorcoRex: Well that problem largely depends on the colour of the stacks. If I don't like the colours they won't stack.
<agent_white>
;D
<Verity>
obj.method(:arg=12, :arg2=42)
<Verity>
what is this?
<StoneCypher>
PorcoRex: all a struct does is say "these fields exist and have this name and type" (and in some versions of the language, maybe specify packing)
<StoneCypher>
PorcoRex: a proper datastructure is something like List or Map (that is, not an implementation of them, but the general idea)
<PorcoRex>
agent_white, the most amazing thing about the Hanoi Towers is, if I'm not mistaken, was a game people used to play, with wooden pieces and everything.
<StoneCypher>
PorcoRex: generally defined in terms of what things it has to do, at what performance
<StoneCypher>
not *
<StoneCypher>
but rather in terms of how it's actually implemented
<StoneCypher>
that is, it's only a list if it's node and (pointer-or-reference-or-whatever) based
<StoneCypher>
so if you have some wacky alternate setup that offers the same api, it's not actually the same datastructure (at that point, you're talking about containers instead)
<StoneCypher>
which is why people get confused how maps aren't always trees (because sometimes they're hashes)
<StoneCypher>
you should go into efnet #c++ and say "which is worse: cplusplus.com or w3schools.com?"
JoshS has joined #ruby
<StoneCypher>
it will start a hilarious rage war
hutch34_ has quit [Ping timeout: 264 seconds]
<PorcoRex>
StoneCypher, dude, you're right. I just got confused because I read bad bibliography in the past. Take it easy.
<StoneCypher>
this is actually part of the c++ standard, by the way. although they call them ADTs instead of datatypes because "abstract"
<StoneCypher>
take it easy?
<PorcoRex>
Maybe?
<StoneCypher>
because ... i think the rage wars in another channel/network are funny? :D
<Verity>
anyone?
<StoneCypher>
Verity: i don't really speak ruby, but those look like named arguments to me
<PorcoRex>
Look, I'm just came today to the friendly #Ruby channel. I don't intend to create any conflicts here. I'm sure many people are laughing at me for misunderstanding what a datastructure is. I can take it.
<StoneCypher>
PorcoRex: i'm not sure what conflict you see, but i'll withdraw
Channel6 has quit [Quit: Leaving]
<dminuoso>
Since we're already in the business of making fun, what are we making fun of?
<PorcoRex>
dminuoso, the Hanoi tower game. Did people in the past actually played it. And if so, how many pieces did they use?
<dminuoso>
PorcoRex: Ive read about your discussion. If you apply your Haskell background to Ruby you will end up with painless and easy-to-test Ruby, but Rubyists will hate you for it.
<dminuoso>
Mostly because half the people in here don't even know the meaning of a "pure function"
<dminuoso>
PorcoRex: It depends. Some players haven't advanced beyond 2 pieces on 4 poles.
<dminuoso>
It's pretty tough.
<PorcoRex>
dminuoso, not all of them, as I was telling some dude that makes the language, some people like it. Maybe it's hype about functional programming? IDK.
<dminuoso>
Functional programming is not hyped, it's simply better for so many reasons.
<dminuoso>
But that's a fact that has been known for about 50 years or so.
gigetoo has joined #ruby
<PorcoRex>
dminuoso, since I know pretty much nothing besides entry level I will not discuss that fact. BUT, when close to the metal, how does functional programming fare against the CPU's way of processing stuff? Does it translates fairly?
gigetoo has quit [Read error: Connection reset by peer]
<dminuoso>
PorcoRex: It depends on a few factors. On an immediate level it's pretty shitty because of how CPUs work internally.
<StoneCypher>
pure function is easier to explain than to make fun of
<StoneCypher>
kindness goes a long way sometimes
<PorcoRex>
dminuoso, I see it a bit like raycasting and the way GPUs work. Light works much more like raycasting, but GPUs work on triangle things.
__Yiota has joined #ruby
<dminuoso>
PorcoRex: It's a good comparison. FP is applied everywhere on GPUs. Shader cores are basically exactly that.
<PorcoRex>
So functional programming may be better overall, but how does it fare against the chip that interprets it?
<dminuoso>
Shader cores are just pure functional processing cores.
im314ous has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
And that shows the power of it, how you can ruthlessly parallelize a problem across (nowdays) thousands of stream processors.
gigetoo has joined #ruby
<dminuoso>
PorcoRex: Though in the end it's a matter of principle. On a hardware level a general-purpose CPU is basically a huge imperative machine.
<dminuoso>
The entire CPU design is so massively complicated because of it. Just look how bus arbitration and cache coherency protocols make designing effective CPUs really hard.
<StoneCypher>
so what would a functional cpu, as opposed to an imperative cpu, look like?
<PorcoRex>
dminuoso, well that's right, but your comment about the shader cores picked my interest. I need to delve into it as I learn a bit of FP.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdm_ has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
astrobunny has quit [Remote host closed the connection]
patarr has joined #ruby
<PorcoRex>
dminuoso, I believe "piqued" is the actual word. Sorry about the confution, and thanks StoneCypher for correcting me via a private message.
hahuang65 has quit [Ping timeout: 240 seconds]
esObe_ has joined #ruby
tau has quit [Remote host closed the connection]
<StoneCypher>
lol
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<PorcoRex>
*consufion <- I corrected this myself.
patarr has quit [Ping timeout: 256 seconds]
gdonald has quit [Ping timeout: 264 seconds]
astrobunny has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
Guest96 has quit [Remote host closed the connection]
esObe_ has quit [Ping timeout: 258 seconds]
Guest96 has joined #ruby
<agent_white>
PorcoRex: We use some Haskell for mission-critical functions: Knowing that if you call a function with a set of arguments deterministically always leads to the same result can help a lot with debugging and reasoning about code.
<agent_white>
Strongly typed to scope out errors at compile time rather than later should your code take an uncommon path and assumptions violated.
<agent_white>
(which is where pure functions/isolated effects is nice)
<PorcoRex>
agent_white, yes, I understand that and I think that's probably the greatest appeal (functions are like math. functions).
<PorcoRex>
Don't get me wrong, I really like that, but I need to think a different way to code that way. I'm just used to state, and keep the state encapsulated, but able to touch it at a whim.
luluapple has joined #ruby
<PorcoRex>
FP is a new and interesting way of thinking about solutions, and I'm just trying to get the right foot in.
<agent_white>
Aye. Best to just have atter; then after using it you'll see cases where it could/should be applied.
<agent_white>
Until then you won't know.
<agent_white>
Personally I've been leaning towards Elixir because of Erlang; OTP is a thing of beauty :)
<agent_white>
(of course, also cause it's scriptures are written with a Ruby-esque hand)
<PorcoRex>
agent_white, I remember when I went from C++/Java to Ruby that first time. It was anathema. Constants can be modified? Classes can be reopened and tinkered with? After some time it all made sense. And really, Ruby is one of my favorite OOP languages nowadays.
gdonald has joined #ruby
<PorcoRex>
It's also a great entry languagem, because procedural languages are not as widely used as before.
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
__Yiota has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
whiteline has quit [Remote host closed the connection]
Rodya_ has quit [Ping timeout: 246 seconds]
xall has quit [Quit: WeeChat 1.7]
whiteline has joined #ruby
<PorcoRex>
And that's an interesting discussion if anyone has some spare time for it, should entry level courses on CS be procedural (i.e. Pascal, C, etc.)? I think Ruby would be an easier to learn language and then leave Assembler, C, etc. as advanced machine-thinking languages.
nofxxx has joined #ruby
nofxx has quit [Ping timeout: 240 seconds]
moei has joined #ruby
xall has joined #ruby
hutch34_ has joined #ruby
hutch34_ has quit [Ping timeout: 240 seconds]
armando1 has quit [Remote host closed the connection]
dhollinger has quit [Ping timeout: 260 seconds]
amclain has quit [Quit: Leaving]
<StoneCypher>
PorcoRex: pascal and c are imperative, not procedural. there is no call graph. there is no global ordering. yes, pascal has things called procedures. yes, wikioverflow probably says that procedural is a kind of imperative. yes, sql really is the one getting it right this time.
<StoneCypher>
PorcoRex: the distinction between a function and a procedure is atomic transactionality. yes, no programming language other than sql that i can think of gets that right
<StoneCypher>
PorcoRex: the only time a procedure should be able to run during another procedure (WALs and etc notwithstanding) is when it's called by that procedure
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bock has joined #ruby
igniting has joined #ruby
anisha has joined #ruby
pwnd_nsfw has quit [Ping timeout: 264 seconds]
houhoulis has joined #ruby
nadir has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
<dminuoso>
PorcoRex: Ruby is only a small taste. You should try Smalltalk.
<dminuoso>
Which is one of the major languages that Ruby was designed around.
pwnd_nsfw has joined #ruby
volix has joined #ruby
volix has joined #ruby
volix has quit [Changing host]
bkxd has quit [Ping timeout: 260 seconds]
terens_ has quit [Read error: Connection reset by peer]
<StoneCypher>
dminuoso: still kind of curious what a functional cpu would be
<StoneCypher>
hoping you just didn't see me ask
ta_ has quit [Remote host closed the connection]
dhollinger has joined #ruby
harfangk has joined #ruby
djbkd has quit [Quit: My people need me...]
pulkit4tech has quit [Quit: Connection closed for inactivity]
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
octo8 has joined #ruby
<octo8>
photoshop is now open source !
<StoneCypher>
... wut
<octo8>
StoneCypher: sorry, wrong channel.
Rodya_ has joined #ruby
naprimer has quit [Ping timeout: 240 seconds]
Pumukel has joined #ruby
<PorcoRex>
dminuoso, I've heard of Smalltalk, one of the first OO languages (maybe the first?). I don't know much about it, but do you think it's a good entry language?
last_staff has joined #ruby
<PorcoRex>
dminuoso, and also, do you think an OO language is a good entry language, as BASIC was in the 80's for instance?
cfec0b8d has joined #ruby
naprimer has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
Bock is now known as Sauvin
gigetoo has quit [Ping timeout: 264 seconds]
Pumukel has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
<StoneCypher>
PorcoRex: people argue about whether true oo is from algol/simula (older than smalltalk) or smalltalk
<StoneCypher>
PorcoRex: what ken did was more important, but he wasn't the first to use that name, or the vague idea
<PorcoRex>
StoneCypher, care to answer my question or are you only interested in planting seed of random factoids?
<StoneCypher>
is smalltalk a good entry language?
<StoneCypher>
not in my opinion, no
<StoneCypher>
is an oo language in general a good entry language?
<StoneCypher>
depends on which one you're asking about. some of them are, sure
<StoneCypher>
javascript, ruby, and python, which are oo to varying degrees, all seem to me like reasonable starting places
<StoneCypher>
also some languages that aren't oo do too
<StoneCypher>
i don't think oo (on or off) is that important, personally. ymmv
<agent_white>
I've been learning some Perl. Coming from a Ruby it's just as fun to play with :) The grammar is pretty neat.
<PorcoRex>
StoneCypher, ok, but do you have a preference for a language that does not know how to program enter into the career?
<StoneCypher>
i'd generally choose according to the project that motivates them. i know that's kind of a dodge answer
<PorcoRex>
for a person*
<StoneCypher>
like, the right language for a web thing is not the same as the right language for a phone game, you know?
<StoneCypher>
but
hutch34_ has joined #ruby
<StoneCypher>
the answer i think i should probably give is i'd try to motivate them to choose a language which you can learn a small piece of and be able to do things, which is relatively easy to set up, and which is relatively easy to debug
<StoneCypher>
and then frame it to whatever they're actually trying to accomplish
<StoneCypher>
i find that i end up recommending javascript more often than most other languages.
<StoneCypher>
but sometimes i recommend ruby
<PorcoRex>
I'm not sure we're discussing the same thing. It's like trying to figure out the best way to teach math to a child and you telling me that it depends if they want to do a bank job or rocket science.
govg has joined #ruby
gigetoo has quit [Ping timeout: 268 seconds]
gigetoo has joined #ruby
<agent_white>
StoneCypher: Best entry level? I dunno. Depends on the person and how they learn.
<agent_white>
The neat thing is, most languages that would cover that question can be tried out for free.
<agent_white>
;P
JoshS has quit [Quit: Leaving]
hutch34_ has quit [Ping timeout: 260 seconds]
yourname1 has joined #ruby
<StoneCypher>
i actually feel like one not-free language is actually pretty profoundly good for this, with a select small group of people, given active instruction
<StoneCypher>
namely, mathematica
<StoneCypher>
or the wolfram language or whatever marketey bs you want to call it
<agent_white>
I have a buddy learning programming, just moving from methods onto the concept of classes... it can be a weird thing to grasp.
<StoneCypher>
shapes usually make it easy. if not, roguelike monsters.
<StoneCypher>
if not, have a doctor see them
<PorcoRex>
Thank you all for a very interesting discussion, I'll be sure to drop by some other time. Good night!
PorcoRex has quit [Quit: Leaving]
jusa has joined #ruby
conta has joined #ruby
antgel has joined #ruby
yourname1 has quit [Quit: leaving]
zun has joined #ruby
jcao219 has quit [Ping timeout: 260 seconds]
ta_ has joined #ruby
StoneCypher has quit [Ping timeout: 258 seconds]
uncertainty has quit [Ping timeout: 260 seconds]
v1_ has joined #ruby
StoneCypher has joined #ruby
zipace has joined #ruby
hahuang65 has joined #ruby
jcao219 has joined #ruby
postmodern_ has joined #ruby
uncertainty has joined #ruby
postmodern has quit [Ping timeout: 246 seconds]
patarr has joined #ruby
lhambley has joined #ruby
StoneCypher has quit [Ping timeout: 246 seconds]
ratcatcher has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
Arpanet69 has joined #ruby
houhoulis has quit [Remote host closed the connection]
esObe_ has joined #ruby
astrobunny has quit [Remote host closed the connection]
ratcatcher has quit [Client Quit]
patarr has quit [Ping timeout: 260 seconds]
astrobunny has joined #ruby
esObe_ has quit [Ping timeout: 240 seconds]
jgt has joined #ruby
govg has quit [Ping timeout: 260 seconds]
Guest96 has quit [Remote host closed the connection]
govg has joined #ruby
Guest96_ has joined #ruby
TomyWork has joined #ruby
aganov has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
aufi has joined #ruby
pytuger has quit [Ping timeout: 260 seconds]
v1_ has quit [Ping timeout: 268 seconds]
esObe_ has joined #ruby
Rodya_ has joined #ruby
v1_ has joined #ruby
pytuger has joined #ruby
pytuger has quit [Read error: Connection reset by peer]
v1_ has quit [Client Quit]
mim1k has joined #ruby
mark_66 has joined #ruby
kegster has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Ping timeout: 246 seconds]
kegster has joined #ruby
kegster has quit [Changing host]
kegster has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
ratcatcher has joined #ruby
hutch34_ has joined #ruby
Qchmqs has joined #ruby
dionysus69 has joined #ruby
hutch34_ has quit [Ping timeout: 240 seconds]
vali has joined #ruby
minimalism has quit [Quit: minimalism]
ammar__ has quit [Quit: Ex-Chat]
toretore has joined #ruby
Toledo has quit [Ping timeout: 268 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<arne_>
rob_: well, i don't have something like that, yet
<arne_>
but my guess i need nginx => nginx(docker), yes
<arne_>
because only nginx(docker) sees the other docker hosts
agent_white has quit [Read error: Connection reset by peer]
<arne_>
"hosts"
N30 has joined #ruby
N30 has quit [Client Quit]
Pumukel has joined #ruby
uncertainty has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
stamina has joined #ruby
naftilos76 has joined #ruby
bkxd has joined #ruby
Pumukel has quit [Ping timeout: 240 seconds]
Ag3nt has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
bkxd has quit [Ping timeout: 256 seconds]
shterrett has joined #ruby
workmad3 has joined #ruby
Pumukel has joined #ruby
ejnahc_ has quit [Remote host closed the connection]
ejnahc has joined #ruby
uncertainty has quit [Ping timeout: 260 seconds]
bkxd has joined #ruby
jgt has quit [Ping timeout: 240 seconds]
ddffg has quit [Quit: Leaving]
bkxd has quit [Ping timeout: 260 seconds]
Ag3nt has quit [Quit: Ag3nt]
bkxd has joined #ruby
patarr has joined #ruby
jeyraof^mbpr has quit [Quit: This computer has gone to sleep]
patarr has quit [Ping timeout: 264 seconds]
hardwin has joined #ruby
jaruga has joined #ruby
<hardwin>
hi guys
Guest96 has joined #ruby
Ag3nt has joined #ruby
Ag3nt has quit [Client Quit]
<Burgestrand>
?guys hardwin
<ruby[bot]>
hardwin: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<Burgestrand>
hardwin also hi! :D
paemlm has quit [Remote host closed the connection]
lazyatom has quit [Quit: Connection closed for inactivity]
Paraxial has quit [Ping timeout: 268 seconds]
tvw has joined #ruby
<hardwin>
sorry, i bad speak english
<hardwin>
my bad
<hardwin>
i just need to find some comunity, to ask some questions about ruby
aryaching_ has joined #ruby
<Burgestrand>
hardwin you've probably come to the right place then :)
<hardwin>
am newbie on it
roshanavand has joined #ruby
tvw has quit [Read error: Connection reset by peer]
zcq100 has joined #ruby
aryaching has quit [Ping timeout: 256 seconds]
<zcq100>
a
zcq100 has quit [Client Quit]
blackmesa has joined #ruby
zcq100 has joined #ruby
Fernando-Basso has joined #ruby
nadir has joined #ruby
ensyde has quit [Ping timeout: 264 seconds]
tau has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 246 seconds]
xall has quit [Ping timeout: 256 seconds]
Guest96 has quit [Remote host closed the connection]
Ag3nt has joined #ruby
Guest96 has joined #ruby
shterrett has quit [Quit: shterrett]
hahuang65 has joined #ruby
Ag3nt has quit [Quit: Ag3nt]
roshanavand has quit [Ping timeout: 260 seconds]
aryaching_ has quit [Remote host closed the connection]
StoneCypher has joined #ruby
aryaching has joined #ruby
Burgestrand has quit [Quit: Closing time!]
dionysus69 has quit [Ping timeout: 258 seconds]
jgt has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
raspado has joined #ruby
StoneCypher has quit [Ping timeout: 260 seconds]
maloik has quit [Remote host closed the connection]
Ag3nt has joined #ruby
lenwood has quit [Ping timeout: 240 seconds]
ensyde has joined #ruby
jgt has quit [Ping timeout: 268 seconds]
uncertainty has joined #ruby
j0bk has joined #ruby
raspado has quit [Ping timeout: 240 seconds]
millerti has joined #ruby
zcq100 has quit [Ping timeout: 240 seconds]
jgt has joined #ruby
gk_1wm_su has joined #ruby
zcq100 has joined #ruby
gk_1wm_su has left #ruby [#ruby]
Rodya_ has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
zapata has quit [Quit: WeeChat 1.7]
shterrett has joined #ruby
shterrett has quit [Client Quit]
spyder55 has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
aryaching_ has joined #ruby
aryaching has quit [Remote host closed the connection]
ldnunes has joined #ruby
aryaching has joined #ruby
Ag3nt has quit [Quit: Ag3nt]
aryaching__ has joined #ruby
aryaching has quit [Remote host closed the connection]
esObe_ has quit [Remote host closed the connection]
yurikoles has joined #ruby
<Burgestrand>
Verity I'd vote first, because the keyword arguments are reduntant when you name your method as such.
<matthewd>
Verity: For two parameters, and especially where there's a somewhat "natural" order.. the first.
<Burgestrand>
Verity depending (very much) on context, a call such as e.g. `show(name: "Someone", address: "Somewhere")` could also be OK.
mim1k has quit [Ping timeout: 240 seconds]
fmcgeough has joined #ruby
<Verity>
ok
aufi has joined #ruby
spyder55 has quit []
d^sh has quit [Ping timeout: 246 seconds]
HoierM has joined #ruby
synthroid has joined #ruby
knight33 has joined #ruby
aryaching has quit [Remote host closed the connection]
ta_ has quit [Remote host closed the connection]
aryaching has joined #ruby
blackmesa has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vuoto has joined #ruby
workerbeetwo has joined #ruby
<workerbeetwo>
Hi. is there a short cut for constructions liek this ? : def mything { a: other.a, b: other.b, c: other.c } where attributes are the very same?
pliniker has quit [Quit: WeeChat 1.4]
aryaching_ has joined #ruby
pliniker has joined #ruby
rwb has quit [Ping timeout: 268 seconds]
aryaching has quit [Remote host closed the connection]
<matthewd>
workerbeetwo: No
kegster has quit [Ping timeout: 240 seconds]
kegster has joined #ruby
nemesit|znc has quit [Ping timeout: 260 seconds]
Pumukel has quit [Remote host closed the connection]
esObe_ has joined #ruby
<hardwin>
hey folks, got a question here
Pumukel has joined #ruby
_sfiguser has joined #ruby
Pumukel has quit [Remote host closed the connection]
<hardwin>
how many times you use a special math in web development practice?
<Burgestrand>
hardwin what is special math?
Pumukel has joined #ruby
<hardwin>
means eny math
t-recx has joined #ruby
<hardwin>
any
<hardwin>
lol
<Burgestrand>
hardwin +-/* sometimes, more involved less times
kegster has quit [Read error: Connection reset by peer]
<hardwin>
ok big thanks for u
<hardwin>
=*
nemesit|znc has joined #ruby
<Burgestrand>
hardwin but you can be web developer without being math expert, no problem
fmcgeough has quit [Read error: Connection reset by peer]
<hardwin>
i think i do)
fmcgeough has joined #ruby
Pumukel has quit [Ping timeout: 240 seconds]
osliusar has quit [Ping timeout: 260 seconds]
<sonOfRa>
modulo is useful as a fifth
<sonOfRa>
Also knowing that floating point math doesn't work as you would expect it to work
<volty>
could be i can give you sol for linux , wait
sepp2k has joined #ruby
<username_>
ah, yeah
<volty>
found, I use wmctrl to get a list of windows on my desk
<username_>
so it basically just sits on top of au3/AutoIt or xdtoolanyways
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has joined #ruby
SuperLag has joined #ruby
<volty>
as for the standard library I guess it isn't here just because almost no ruby coders need it
<username_>
volty: makes sense
bkxd has joined #ruby
hahuang65 has joined #ruby
saneax has joined #ruby
mim1k has quit [Ping timeout: 256 seconds]
knight33 has joined #ruby
tercenya has quit [Remote host closed the connection]
<username_>
but at the same time it seems like it would fairly trivial to implement in the OS module or something similar
<username_>
*shrugs*
tercenya has joined #ruby
phoo1234567 has joined #ruby
Xiti has joined #ruby
<username_>
but seems like other languages face the same problem
<username_>
so im thinking its an interface issue
<username_>
difficult to maintain likely
<matthewd>
It's just really not a thing applications need to do
<volty>
you can extend the os module calling external progs, or you can extend it writing your own c routines
bkxd has quit [Ping timeout: 256 seconds]
zun has quit [Quit: Connection closed for inactivity]
jgt has quit [Ping timeout: 240 seconds]
<volty>
the os's were designed for human clicking and typing
marcdel has quit [Ping timeout: 240 seconds]
<volty>
bye
volty has quit [Quit: Konversation terminated!]
<username_>
volty: nice
_sfiguser has joined #ruby
duderonomy has quit [Ping timeout: 256 seconds]
vali has quit [Ping timeout: 260 seconds]
renchan_ has quit [Quit: Leaving...]
AndBobsYourUncle has joined #ruby
Puffball has quit [Remote host closed the connection]
Snickers has joined #ruby
Puffball has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
<raspado>
hi all, is it fine to put an if statement inside my unless? https://pastebin.com/tL3yqW5n heres my example, seems to work fine but not sure if this has damaging effects
ovidnis` has left #ruby ["ERC (IRC client for Emacs 25.1.1)"]
ovidnis has joined #ruby
bsartek has quit [Quit: This computer has gone to sleep]
Rodya_ has quit [Ping timeout: 246 seconds]
outreachdan has quit [Read error: Connection reset by peer]
outreachdan has joined #ruby
<baweaver>
raspado: It isn't necessary
patarr_ has joined #ruby
<baweaver>
just put all the conditionals on one line
cfec0b8d has quit [Quit: Leaving.]
<raspado>
i just need to exclude 1 env so it does not run through that if statement
<baweaver>
only use two conditional branches if there's a difference between what'll execute
<raspado>
oh so just another && ?
postmodern has joined #ruby
bsartek has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
patarr has quit [Ping timeout: 246 seconds]
<baweaver>
honestly I think you could just write it as: abort "exiting #{cloud} is not training" unless cloud.match(/training/) || issue_type != 'non-prod deploy'
<havenwood>
celesteh: If not, you're good to go. Another question is whether there's a precompile binary available for your os/distro. If there is, you don't need build tools.
bruce_lee has quit [Read error: Connection reset by peer]
ldnunes has quit [Quit: Leaving]
skweek has quit [Ping timeout: 240 seconds]
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
esObe_ has quit [Remote host closed the connection]
tercenya has quit [Remote host closed the connection]
tercenya has joined #ruby
AndBobsYourUncle has joined #ruby
maattdd_ has joined #ruby
ResidentBiscuit has joined #ruby
shwouchk has quit [Quit: Connection closed for inactivity]
maattdd has quit [Read error: Connection reset by peer]
tildes has quit [Ping timeout: 240 seconds]
jeffreylevesque has quit [Ping timeout: 258 seconds]
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #ruby
planigan has joined #ruby
rgtk has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
username has joined #ruby
tildes has joined #ruby
s1kx has joined #ruby
tildes has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
lupine has joined #ruby
antgel has quit [Ping timeout: 246 seconds]
samdvr has joined #ruby
samdvr has quit [Client Quit]
planigan has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
br0d1n has joined #ruby
milardovich has quit [Remote host closed the connection]
cdg has joined #ruby
JoshS has joined #ruby
lupine has quit [Read error: Connection reset by peer]
zipace has joined #ruby
zipace has quit [Max SendQ exceeded]
zipace has joined #ruby
nowhere_man has joined #ruby
zipace has quit [Max SendQ exceeded]
zipace has joined #ruby
lupine has joined #ruby
futilegames has joined #ruby
planigan has joined #ruby
raul782 has quit [Remote host closed the connection]
raul782 has joined #ruby
skweek has joined #ruby
raul782 has quit [Ping timeout: 240 seconds]
furkanusta has quit [Quit: Leaving]
nahra has joined #ruby
MrBismuth has quit [Ping timeout: 246 seconds]
DoubleMalt has joined #ruby
MrBusiness has joined #ruby
rwb has quit [Ping timeout: 258 seconds]
planigan has quit [Ping timeout: 240 seconds]
ta_ has joined #ruby
planigan has joined #ruby
antgel has joined #ruby
kitikonti has joined #ruby
esObe_ has joined #ruby
naftilos76 has quit [Quit: Αποχώρησε]
username has quit [Quit: Lost terminal]
username has joined #ruby
esObe_ has quit [Ping timeout: 240 seconds]
hutch34_ has quit [Ping timeout: 268 seconds]
ddffg has joined #ruby
uncertainty has joined #ruby
synthroi_ has quit []
govg has quit [Ping timeout: 260 seconds]
hutch34_ has joined #ruby
futilegames has quit [Quit: futilegames]
milardovich has joined #ruby
Rodya_ has joined #ruby
mim1k has joined #ruby
muelleme_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
TomyLobo has quit [Ping timeout: 264 seconds]
patarr_ has quit [Ping timeout: 258 seconds]
milardovich has quit [Ping timeout: 260 seconds]
akkad has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
muelleme_ has quit [Ping timeout: 260 seconds]
ldnunes has joined #ruby
yurikoles has quit [Read error: No route to host]
sepp2k has quit [Ping timeout: 260 seconds]
patarr has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
Ishido has quit [Ping timeout: 240 seconds]
yurikoles has joined #ruby
ltem has quit [Quit: Leaving]
br0d1n has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 240 seconds]
jusa has joined #ruby
aglorei has quit [Remote host closed the connection]
aglorei has joined #ruby
rwb has joined #ruby
raul782 has joined #ruby
hxegon has quit [Ping timeout: 256 seconds]
jusa has quit [Ping timeout: 268 seconds]
planigan has quit [Quit: leaving]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
Rodya_ has joined #ruby
raul782 has quit [Remote host closed the connection]
uncertainty has quit [Ping timeout: 256 seconds]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
ldnunes has quit [Quit: Leaving]
aupadhye_ has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
antgel has quit [Ping timeout: 256 seconds]
ij has left #ruby ["WeeChat 1.7"]
Fernando-Basso has quit [Quit: WeeChat 1.7]
gnufied has quit [Ping timeout: 246 seconds]
ramortegui has joined #ruby
ramortegui has quit [Remote host closed the connection]
milardovich has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhereman has joined #ruby
Guest96 has quit [Remote host closed the connection]
<raspado>
this might be a hack but is it acceptable? !['prod'].include?(env)
<matthewd>
raspado: What part of it?
<raspado>
basically trying to accomplish the opposite of exclude
<raspado>
oops opposite of include? :)
<bougyman>
why not just use unless?
<bougyman>
unless ['prod'].include? env
<matthewd>
raspado: Yes, ! is a perfectly reasonable thing to use; that's why it's there :)
Guest96 has joined #ruby
<raspado>
^ bougyman hmmm true ;)
<bougyman>
i just feel like unless is more clear.
<raspado>
but that was part of a one liner conditional
<elomatreb>
If your env array only has one entry anyway, why not just compare them?
<raspado>
but yeah maybe i should just add the unless in the if
<raspado>
makes more sense for sure
cagomez has joined #ruby
<bougyman>
some_shit unless ['prod'].include? env
<bougyman>
still a one-liner
<elomatreb>
i.e. env == "prod"
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<raspado>
elomatreb: i was thinking just incase we need to add more in the future
<elomatreb>
<Insert quote about premature optimisation>
<matthewd>
`unless x` > `if !x`... but `if x && !y` > `if x; unless y; ..`
<matthewd>
(IMO, as a general principle, YMMV, etc)
naprimer has quit [Ping timeout: 246 seconds]
zun has quit [Quit: Connection closed for inactivity]
<raspado>
nice thx matthewd bougyman
<elomatreb>
If you're going to plan ahead and use the array, I'd at least recommend to move that to a constant instead of using the literal directly. (SOME_ENVS = ["prod"])
<matthewd>
Oh, and yeah, I wouldn't bother with an array just to save the possible effort of maybe changing == to include? in the future.
esObe_ has joined #ruby
<allisio>
matthewd: How about `... unless y if x`?
[Butch] has quit [Quit: I'm out . . .]
<matthewd>
allisio: (face melting)
StoneCypher has joined #ruby
<matthewd>
allisio: I mean.. no, I'd personally avoid that as it's not as clear as some alternatives
bronson has joined #ruby
JeanCarloMachado has joined #ruby
govg has joined #ruby
naprimer has joined #ruby
esObe_ has quit [Ping timeout: 260 seconds]
StoneCypher has quit [Ping timeout: 240 seconds]
ovidnis has quit [Remote host closed the connection]
VladGh has quit [Ping timeout: 264 seconds]
DoubleMalt has quit [Ping timeout: 240 seconds]
hutch34_ has quit [Ping timeout: 258 seconds]
VladGh has joined #ruby
hutch34_ has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
r3m has joined #ruby
narval has quit [Ping timeout: 258 seconds]
hahuang61 has quit [Quit: WeeChat 1.7]
hahuang65 has quit [Ping timeout: 240 seconds]
kristofferR has joined #ruby
polishdub has quit [Quit: Leaving]
aryaching has quit [Ping timeout: 260 seconds]
chouhoul_ has joined #ruby
workmad3 has quit [Ping timeout: 268 seconds]
am55 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Ping timeout: 260 seconds]
chouhoul_ has quit [Ping timeout: 246 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
raul782 has joined #ruby
hutch34_ has quit [Ping timeout: 240 seconds]
Mrgoose has joined #ruby
<Mrgoose>
Any of you familiar with ruby and openssl? Im trying to use grpc in ruby to connect to a grpc server and im getting ssl_transport_security.c:947] Handshake failed with fatal error SSL_ERROR_SSL: error:1000006b:SSL routines:OPENSSL_internal:BAD_ECC_CERT
<Mrgoose>
but If I use openssl directly it works fine
<al2o3-cr>
hey,
<al2o3-cr>
Mrgoose
<Mrgoose>
sup
raul782 has quit [Ping timeout: 256 seconds]
grh has joined #ruby
minimalism has quit [Quit: minimalism]
maddmaxx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
aryaching has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
<al2o3-cr>
package ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]