« Back to channel list

#ruby-offtopic - 16 November 2017

« Back 1 day Forward 1 day »
[00:22:44] tcopeland: has joined #ruby-offtopic
[01:04:12] pwnd_nsfw`: has joined #ruby-offtopic
[01:16:22] helpa-bot: has joined #ruby-offtopic
[01:22:50] helpa: has joined #ruby-offtopic
[01:28:16] al2o3-cr: has joined #ruby-offtopic
[01:28:16] Fire-Dragon-DoL: has joined #ruby-offtopic
[01:28:16] eam: has joined #ruby-offtopic
[01:28:17] `derpy: has joined #ruby-offtopic
[02:58:13] nofxx: has joined #ruby-offtopic
[03:09:12] al2o3-cr: has joined #ruby-offtopic
[03:44:09] pwnd_nsfw: has joined #ruby-offtopic
[04:20:35] al2o3-cr: has joined #ruby-offtopic
[05:03:13] helpa: has joined #ruby-offtopic
[05:06:23] al2o3-cr: has joined #ruby-offtopic
[05:36:33] al2o3-cr: has joined #ruby-offtopic
[06:11:11] apeiros: weird, got up like usual, but this time I got 15min to spare. normally I run for the train.
[06:11:33] apeiros: ACTION wonders whether there's some time dilation field active
[07:02:02] al2o3-cr: has joined #ruby-offtopic
[07:09:42] nofxx: has joined #ruby-offtopic
[07:13:02] al2o3-cr: has joined #ruby-offtopic
[07:20:07] apeiros_: has joined #ruby-offtopic
[07:35:46] baweaver: Upvotes appreciated! :D - https://www.reddit.com/r/ruby/comments/7davkf/wip_illustrated_guide_to_ruby/
[07:36:12] baweaver: Trying to spread the good word
[07:43:53] havenwood: baweaver: Upvoted!
[07:45:11] baweaver: havenwood: also much love for spreading the good word if you get a chance at RubyConf :D
[07:45:22] al2o3-cr: has joined #ruby-offtopic
[07:45:32] havenwood: baweaver: Ooh, good idea!
[07:45:55] havenwood: I should have done lemur stickers to bring...
[07:46:12] havenwood: You need lemur stickers, clearly!
[07:46:17] baweaver: I'll get some
[07:46:24] baweaver: working on Getting all the sketches done first
[07:46:27] baweaver: then to Illustrator
[07:46:35] baweaver: which means I get good SVGs
[07:48:30] baweaver: havenwood: pinned to my twitter: https://twitter.com/keystonelemur
[07:48:34] baweaver: so easier to get a hold of
[07:55:14] baweaver: https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/assets/each_far_view.png
[07:55:20] baweaver: https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/assets/each_close_view.png
[07:55:26] baweaver: Those two took a bit to come up with
[08:06:41] Mon_Ouie: has joined #ruby-offtopic
[08:10:06] apeiros: baweaver: https://imgur.com/fBoM2 is what I used
[08:10:38] baweaver: Oooooo, I might adapt that a bit
[08:11:05] apeiros: second of your images does not seem to load :-|
[08:11:14] dminuoso: baweaver: And you can juxtapose that with negative indices.
[08:11:17] dminuoso: Perhaps on the topside instead.
[08:11:26] dminuoso: Things like arr[1,-2] are kind of cool.
[08:11:55] apeiros: each_close_view.png
[08:12:10] dminuoso: baweaver: And then you talk about currying lambdas right?
[08:12:12] baweaver: https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/assets/each_close_view.png
[08:12:13] baweaver: should work now
[08:12:14] baweaver: it was probably updating
[08:12:27] baweaver: I intend to do a FP run soon, but probably not in this book until far later.
[08:12:33] baweaver: basics first ;)
[08:12:36] dminuoso: baweaver: :)
[08:13:00] dminuoso: baweaver: Look! https://gist.github.com/dminuoso/dee20f83832ba02161c0445c0b73917a
[08:13:11] dminuoso: I just figured out that monads encapsulate the idea of expression substitution.
[08:13:59] dminuoso: Although this still feels horriby wrong.
[08:14:00] dminuoso: For some reasons.
[08:14:20] dminuoso: Especially that const a <$> t bit feels like I should be using >>= instead somehow.
[08:14:40] baweaver: Starting to wonder if you're trying to implement LISP Macros :P
[08:15:28] dminuoso: Haskell has no homoiconicity
[08:17:02] dminuoso: But you can kind of do it in Elixir, just not as elegant (because in lisp the code *is* just plain lists)
[08:17:18] dminuoso: The abuse of it in ecto is extreme though
[08:19:00] Technodrome: has joined #ruby-offtopic
[08:25:48] al2o3-cr: has joined #ruby-offtopic
[08:53:54] mikecmpbll: has joined #ruby-offtopic
[09:10:23] al2o3-cr: has joined #ruby-offtopic
[11:02:14] al2o3-cr: has joined #ruby-offtopic
[11:07:24] elomatreb: Over in #ruby: Not starting a flamewar
[11:29:48] apeiros: why not?! spoilsport :<
[11:29:55] apeiros: (eh, thanks, I guess :D)
[11:30:55] dminuoso: ACTION pokes apeiros
[11:30:57] dminuoso: ACTION pokes apeiros again
[11:31:03] apeiros: ACTION pokes back
[11:31:09] apeiros: ACTION walks off because boss calls
[12:05:48] nofxx: has joined #ruby-offtopic
[12:12:20] kapil___: has joined #ruby-offtopic
[12:15:20] Technodrome: has joined #ruby-offtopic
[12:21:32] apeiros: oh I see what I missed, AR::Base.suppress
[12:26:27] al2o3-cr: has joined #ruby-offtopic
[12:43:38] al2o3-cr: has joined #ruby-offtopic
[13:13:40] pwnd_nsfw: has joined #ruby-offtopic
[13:17:43] al2o3-cr: has joined #ruby-offtopic
[13:30:39] dminuoso: apeiros: How do you deal with connection timeouts on the SQL developer?
[13:30:50] dminuoso: Its a real pita because the entire UI hangs for minutes..
[14:06:20] apeiros: dminuoso: I swear a lot
[14:06:29] apeiros: it's the application I force-quit the most often. by far.
[14:07:02] apeiros: and I don't want to know how often I lost sql worksheets. I tend to write all my sql in sublime now and just copy&paste them into sql dev
[14:09:47] al2o3-cr: has joined #ruby-offtopic
[14:42:56] apeiros_: has joined #ruby-offtopic
[14:43:49] apeiros_: the amount of crashes happening with this mbp is inacceptable :(
[14:49:18] dminuoso: apeiros_: Did they make some mistake during reassembly perhaps?
[14:53:11] apeiros: might also be high sierra. before the fix I had sierra.
[14:54:13] apeiros: this awfully feels like the terrible ages of OS 9
[14:54:35] apeiros: that's the only time I ever pondered switching to windows. nowadays it'd probably be linux.
[15:33:16] Technodrome: has joined #ruby-offtopic
[15:46:14] workmad3: has joined #ruby-offtopic
[15:56:52] mikecmpb_: has joined #ruby-offtopic
[16:08:05] Exhiled: has joined #ruby-offtopic
[16:10:12] guacamole: has joined #ruby-offtopic
[16:12:28] al2o3-cr: has joined #ruby-offtopic
[16:20:21] mikecmpbll: has joined #ruby-offtopic
[16:26:50] apeiros: has joined #ruby-offtopic
[16:36:35] baweaver: Random person hating on Rails "because reasons"
[16:36:47] baweaver: Well that's one more item on this weeks bingo card
[16:36:55] baweaver: matthewd: what was the prize again?
[16:47:44] elomatreb: Pretty shitty bingo from the sounds of it
[16:50:43] guacamole: has joined #ruby-offtopic
[16:57:16] guacamole: has joined #ruby-offtopic
[17:01:12] mikecmpb_: has joined #ruby-offtopic
[17:01:26] guacamole: has joined #ruby-offtopic
[17:04:00] guacamole: has joined #ruby-offtopic
[17:38:10] eckhardt: has joined #ruby-offtopic
[17:47:55] guacamole: has joined #ruby-offtopic
[17:50:01] Technodrome: has joined #ruby-offtopic
[18:09:51] mikecmpbll: has joined #ruby-offtopic
[18:14:33] nofxx: has joined #ruby-offtopic
[18:17:28] guacamole: has joined #ruby-offtopic
[18:18:53] eckhardt: has joined #ruby-offtopic
[18:20:57] baweaver: elomatreb: I had to stop playing on HackerNews
[18:21:01] baweaver: I'd get a bingo in 10m
[18:21:54] elomatreb: The only bingo where you lose when you get a row of crosses
[18:25:22] baweaver: havenwood: Looks like reddit likes the book so far from all the upvotes :D
[18:25:49] al2o3-cr: has joined #ruby-offtopic
[18:31:33] eckhardt: has joined #ruby-offtopic
[18:35:09] guacamole: has joined #ruby-offtopic
[18:40:55] kapil___: has joined #ruby-offtopic
[18:46:25] baweaver: https://www.reddit.com/r/ruby/ +45 so far, it's really taking off, I'm impressed.
[19:02:38] aScottishBoat: has joined #ruby-offtopic
[19:02:46] baweaver: Can't say I have
[19:02:52] aScottishBoat: it's delicious mate
[19:02:54] baweaver: Balvanie is by go-to
[19:03:11] aScottishBoat: Ever try Dalwhinie, or Talisker, or Glen Garioch?
[19:03:20] baweaver: Can't say I have, still fairly new to it
[19:03:34] aScottishBoat: I've been to the Glen Garioch distillery, and I've driven right past Talisker and Dalwhinie not long ago (but driving past distilleries isn't uncommon)
[19:03:43] aScottishBoat: What style do you prefer?
[19:03:43] baweaver: Lagavulin, Highland Park, Auschentoshen, and a few others
[19:03:54] aScottishBoat: Lagavulin is my second favourite. My god it's delicious
[19:04:13] aScottishBoat: Auschentoshen I think is owned by the same company that owns Glen Garioch (although not saying much, that's common)
[19:04:50] baweaver: Started with Johnny Walker, then ran into Balvanie
[19:04:53] baweaver: never looked back
[19:05:34] aScottishBoat: I like Islays, but not all the time... Which is why I _love_ Caol Ila moscatel finish. It's aged in moscatel barrels. So it has that rich peaty premiere taste... Just punches you with the aroma of peat... But quickly eases into a sweet aftertaste
[19:05:36] baweaver: Though more rum recently for kicks. Diplomatico is nice. El Dorado is a bit flat and Four Square is horrid stuff.
[19:05:43] aScottishBoat: Very impressive distilled spirit
[19:06:00] aScottishBoat: Meh, I drink vodka or whiskey. Otherwise, beer or cider
[19:06:15] baweaver: could never get into beer
[19:06:21] apeiros: ACTION neither
[19:06:37] aScottishBoat: More of a stout guy
[19:06:52] aScottishBoat: Guinness, Belhaven Black, etc. Also like the micro-brew stouts lately, but most imho suck.
[19:06:56] apeiros: got an abnormal distaste for bitter. hence no coffee or beer :-/
[19:07:19] aScottishBoat: I'm thinking of making apple jack this winter.
[19:07:24] baweaver: I tend to drink Gin too, so it's not the bitter per-se for me
[19:07:51] aScottishBoat: you make cider (easy to make), then freeze it outside (only portions freeze), then you remove it. Hence you raise the ABV
[19:08:21] aScottishBoat: Gin meh. Although St. Andrew's gin distillery makes some funky gin flavours, like blueberry vanilla. lol
[19:08:53] aScottishBoat: baweaver, try Dalwhinie or Talisker.
[19:08:58] aScottishBoat: and get back to me whenever you do
[19:09:22] baweaver: I'll put those on the list
[19:09:35] baweaver: recently I tend to go through a good deal of rum while writing
[19:10:02] aScottishBoat: What do you enjoy writing mate
[19:10:10] baweaver: Keeps it a bit more whimsical - https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/
[19:10:53] baweaver: Thinking about changing up the cover to be more Sgt Pepper style later though
[19:12:08] aScottishBoat: Nice pics mate
[19:12:20] aScottishBoat: I'm crap at drawing
[19:12:33] baweaver: Took me years to get into
[19:12:41] baweaver: Array was the hardest to draw so far
[19:12:47] baweaver: and it only has half the images I want it to
[19:13:11] baweaver: Trying to explain blocks and each was interesting
[19:13:41] aScottishBoat: I visited github.com/baweaver
[19:13:48] aScottishBoat: so San Francisco, huh? You enjoy it?
[19:14:02] aScottishBoat: one of my closest mates is hiking the Pacific Crest Trail atm
[19:14:09] baweaver: So far so good
[19:14:10] aScottishBoat: thru-hiked the APT now doing the PCT
[19:14:19] baweaver: I don't live there, outside a bit, much cheaper
[19:14:29] aScottishBoat: yeah I hear SF is a pain to live in
[19:14:31] baweaver: There are a number of us out here.
[19:14:49] aScottishBoat: number of who? Rubyists? Outside of the city? Lemur lovers?
[19:15:13] baweaver: eam, havenwood, eckhardt, and some others.
[19:15:23] baweaver: well, I assume eam and eckhardt like Lemurs
[19:15:28] baweaver: can't see why they wouldn't
[19:16:15] baweaver: conveniently we all work at the same place too
[19:16:34] aScottishBoat: now I want to work there. I'm new to #ruby but havenwood seems like a good guy/gal
[19:16:46] eckhardt: hehe i don't think i've ever seen a lemur in person
[19:16:52] aScottishBoat: I see your book says he's off to RubyConf... Lucky guy haha in New Orleans
[19:16:53] baweaver: Oakland Zoo
[19:16:57] baweaver: you should go :D
[19:17:07] eckhardt: yeah heard good things about it...and lived here for 4 years and still haven't been
[19:17:13] baweaver: Yeah, it's my way of making fun of him not having a bio yet
[19:17:21] baweaver: eckhardt: I'm probably going this weekend some time
[19:17:31] baweaver: but people want me to be social and go see Justice League too
[19:17:40] eckhardt: haha the struggle is real
[19:20:28] baweaver: aScottishBoat: You could always apply too some time :D
[19:20:45] baweaver: Though to be fair they have offices elsewhere
[19:20:48] baweaver: so not just SF
[19:20:52] aScottishBoat: I just got a new job working DevOps in Atlanta.
[19:21:02] aScottishBoat: would look bad if I hopped ship lol (get it? I'm a boat)
[19:21:14] baweaver: ACTION claps
[19:21:19] baweaver: you'll fit right in here
[19:21:37] baweaver: We have an office there too if you want to dock at other ports ;)
[19:22:14] baweaver: We're all at Square currently.
[19:22:55] aScottishBoat: what does Square do?
[19:24:58] Technodrome: has joined #ruby-offtopic
[19:25:02] baweaver: Know that white square people put in their cellphones to take payments?
[19:26:21] aScottishBoat: oh dang you guys make that? awesome
[19:26:27] baweaver: that among several other things
[19:26:40] Papierkorb: .. is that only in the US?
[19:26:47] aScottishBoat: I saw you write Go baweaver... Do you those squares use go? or is that classified?
[19:26:51] baweaver: and Australia and the UK and a few other things
[19:27:01] baweaver: Ruby, Java, Kotlin, Go
[19:27:08] baweaver: Some Python and R in the ML/DS areas
[19:27:11] aScottishBoat: ahh I've been wanting to learn Kotlin.
[19:27:24] baweaver: Machine Learning / Data Science
[19:27:32] aScottishBoat: man sounds like a good outfit
[19:28:27] baweaver: As per always, if any of you find a position on the careers site you like feel free to ping me
[19:28:52] aScottishBoat: sounds good mate
[19:30:52] aScottishBoat: baweaver, the Oakland zoo should have a scotch night
[19:48:17] baweaver: Need to read up more on lookaheads some time
[19:48:23] baweaver: though never had a case to use them so far.
[20:03:00] RickHull: a good place to start with understanding some deeper parts of regex is greedy vs. non-greedy
[20:03:12] baweaver: Guitar (acoustic, electric, classical), Bass, Piano, Trumpet, French Horn, Flugelhorn, and some others I only know in passing
[20:09:01] aScottishBoat: RickHull, greedy vs. non-greedy?
[20:09:26] RickHull: yeah, non-greedy is also known as lazy
[20:09:31] aScottishBoat: baweaver, I play the drums, classical guitar (learning), various percussive instruments, didgeridoo (though poorly), and the tin whistle
[20:09:31] RickHull: most regex default to greedy behavior
[20:11:58] RickHull: '<em>stuff</em>'.match(%r{(<.+>)})
[20:12:05] RickHull: aScottishBoat: what is captured? ^
[20:12:58] RickHull: '<em>stuff</em>'.match %r{(<.+>)} # easier to read
[20:13:20] RickHull: two main choices are: <em> OR <em>stuff</em>
[20:13:36] aScottishBoat: because of the .+
[20:13:38] RickHull: >> '<em>stuff</em>'.match %r{(<.+>)} # easier to read
[20:13:39] ruby[bot]: RickHull: # => #<MatchData "<em>stuff</em>" 1:"<em>stuff</em>"> (https://eval.in/901872)
[20:14:09] RickHull: the return value shows that the input string was matched. the 1: shows what was captured
[20:14:50] RickHull: >> '<em>stuff</em>'.match %r{(<.+?>)} # lazy
[20:14:51] ruby[bot]: RickHull: # => #<MatchData "<em>" 1:"<em>"> (https://eval.in/901874)
[20:15:24] RickHull: %r{} wraps the regex
[20:15:30] RickHull: () wraps the capture
[20:15:44] RickHull: <> are literals, matching HTML tag syntax
[20:15:54] RickHull: .+ means one or more of any char
[20:16:16] RickHull: defaults to greedy
[20:16:25] RickHull: .+? is the lazy version of .+
[20:16:42] RickHull: lazy says, quit matching as soon as I have anything valid
[20:16:50] RickHull: greedy says keep matching until I have something invalid
[20:18:05] RickHull: I shouldn't have included the capture. I mistakenly thought it helped demonstrate. let me try again
[20:18:26] RickHull: >> '<em>stuff</em>'.match %r{<.+>} # greedy
[20:18:27] ruby[bot]: RickHull: # => #<MatchData "<em>stuff</em>"> (https://eval.in/901875)
[20:18:35] RickHull: >> '<em>stuff</em>'.match %r{<.+?>} # lazy
[20:18:42] ruby[bot]: RickHull: # => #<MatchData "<em>"> (https://eval.in/901876)
[20:19:18] aScottishBoat: RickHull, what is this sorcery
[20:19:42] RickHull: just regular ol expressions
[20:20:33] aScottishBoat: no, I'm gonna sit down and properly get it out
[20:20:42] aScottishBoat: Zed Shaw has a book on regexp
[20:20:48] aScottishBoat: I'll get that eventually.
[20:23:01] aScottishBoat: anyways work's done so I'm outta' here. Enjoy guys
[20:41:37] RickHull: baweaver: 10 year old reddit thread, as linked https://www.reddit.com/r/programming/comments/10c60/how_to_match_regular_expressions_faster_than_perl/
[20:41:59] RickHull: u/mjd comments there, pretty sure that's Mark J Dominus
[20:42:10] RickHull: u/mjd and u/rsc both still active redditors :)
[20:56:01] baweaver: Show that to aScottishBoat when he shows back up - https://baweaver.github.io/classtab/
[20:56:11] baweaver: If he's learning classical guitar that'll help a bit
[21:24:28] baweaver: havenwood: You know if core has ever considered adding a "since Ruby version x" to method docs in the source?
[21:36:14] havenwood: baweaver: hmmm, i haven't seen that discussed anywhere
[21:45:42] RickHull: i could imagine a script to add rdoc comments
[21:46:20] RickHull: first get a list of method signatures to check. then a procedure to find them in source (e.g. pry)
[21:46:59] RickHull: then start with ruby 2.0.0 and for every existent signature, add rdoc comment "exists since 2.0"
[21:47:29] RickHull: then for e.g. 2.1, any new signatures get "since ruby 2.1"
[21:48:16] al2o3-cr: don't they do this already?
[21:49:53] workmad3: has joined #ruby-offtopic
[22:06:24] eckhardt: has joined #ruby-offtopic
[22:06:30] guacamole: has joined #ruby-offtopic
[22:30:24] al2o3-cr: it's a mathematical world.
[22:32:27] al2o3-cr: so whats new in 2.5?
[22:33:47] havenwood: al2o3-cr: yield_self
[22:34:20] havenwood: al2o3-cr: Matz introduced it by saying how baffled he was that people wanted it so bad. Hehe.
[22:34:33] havenwood: |> next plz!
[22:35:32] al2o3-cr: havenwood: how is this different from instance_eval?
[22:36:49] al2o3-cr: or is it the same with a different name?
[22:41:51] al2o3-cr: what reads better iterator? or block_given?
[22:43:28] havenwood: al2o3-cr: There're a few differences.
[22:43:31] havenwood: It's not an alias.
[22:43:50] al2o3-cr: please share :)
[22:44:18] havenwood: #yield_self doesn't change scope like #instance_eval
[22:44:26] havenwood: and without a block it returns an enumerator
[22:45:01] havenwood: al2o3-cr: 42.instance_eval { abs2 } #=> 1764
[22:45:16] havenwood: al2o3-cr: With #yield_self: NameError: undefined local variable or method `abs2'
[22:45:26] havenwood: al2o3-cr: 42.yield_self #=> #<Enumerator: 42:yield_self>
[22:45:40] al2o3-cr: interesting, i see.
[22:45:42] havenwood: 42.instance_eval #!> ArgumentError: wrong number of arguments (given 0, expected 1..3)
[22:46:39] havenwood: al2o3-cr: i got to teach Ruby objects that their size is 1 while reimplementing #yield_self ;-)
[22:47:56] havenwood: al2o3-cr: https://github.com/ruby/ruby/commit/dc6d7cc58e78903e8309ff94c9e7112d661646ee
[22:48:26] havenwood: al2o3-cr: just a few lines of code, but I was pleased to contribute C code since it was a challenge for me to grok
[22:48:52] havenwood: al2o3-cr: removal of top level constants is a nice one
[22:49:02] al2o3-cr: i was gonna say, didn't know you knew C ;)
[22:49:13] al2o3-cr: too well anyway :}
[22:49:15] havenwood: #each_grapheme_cluster and #grapheme_clusters
[22:49:22] havenwood: those are nice
[22:49:24] havenwood: emoji-friendly
[22:50:00] havenwood: al2o3-cr: they really did a ton of tiny performance improvements in 2.5
[22:50:12] havenwood: Matz really opened the flood gates on those with the call for 3x3
[22:50:26] al2o3-cr: thats why i love ruby
[22:50:44] al2o3-cr: +1 for C level cont.
[22:52:26] havenwood: al2o3-cr: I think the most exciting news so far is that the work makarov showed off at RubyKaigi is moving forward.
[22:52:31] havenwood: https://github.com/vnmakarov/ruby
[22:52:51] al2o3-cr: i call him the hash guy :P
[22:53:05] havenwood: Well, the hash guy really outdid himself this time...
[22:53:07] al2o3-cr: very impressive really
[22:53:30] havenwood: Rewriting CRuby VM to use RTL...
[22:53:37] havenwood: yikes, yeah
[22:53:46] havenwood: What a huge undertaking.
[22:54:04] al2o3-cr: very smart guy, seriously.
[22:54:22] havenwood: being able to just turn the JIT on or off sounds great
[22:54:34] havenwood: i love they're actually on track to hit the 3x target
[22:54:39] al2o3-cr: this isn't even remotley easy
[22:55:03] ruby[bot]: This discussion is too on topic for #ruby-offtopic. Please continue on #ruby.
[22:56:47] havenwood: The Ruby future looks bright.
[22:57:13] havenwood: JRuby is doing great. They can just turn Graal on for free wins and there's lots of room for them to optimize.
[22:57:17] al2o3-cr: the futures bright, the futures ruby.
[22:57:26] havenwood: RTL MJIT and yomikomu for CRuby.
[22:57:43] havenwood: And if that wasn't enough... TruffleRuby + Graal + SubstrateVM.
[22:57:57] al2o3-cr: havenwood: don't, please stop.
[23:00:19] al2o3-cr: havenwood: long shot, but, do you know fiddle much?
[23:00:49] havenwood: al2o3-cr: A little. Others here have played with it a lot more than me.
[23:03:59] al2o3-cr: >> STDIN.reopen(STDOUT)
[23:04:00] ruby[bot]: al2o3-cr: # => <STDIN> can't change access mode from "r" to "w" (ArgumentError) ...check link for more (https://eval.in/901901)
[23:04:17] al2o3-cr: this is what i'm trying to avoid
[23:06:11] al2o3-cr: in rb_io_t fptr should be 24 bytes down.
[23:06:55] al2o3-cr: ah, hang on a minute
[23:09:28] al2o3-cr: >> require 'fiddle'; include Fiddle; Pointer[dlwrap STDIN][24,8] = Pointer[dlwrap STDOUT][24,8]; STDIN.puts 'works'
[23:09:29] ruby[bot]: al2o3-cr: # => not opened for writing (IOError) ...check link for more (https://eval.in/901902)
[23:10:30] al2o3-cr: if i'm change the file pointer shirley i'm doing something wrong.
[23:11:18] al2o3-cr: that error doesn't even make sense
[23:12:50] al2o3-cr: robject is two longs
[23:13:05] al2o3-cr: oh, ffs wait..
[23:13:26] al2o3-cr: what a clown.
[23:14:09] al2o3-cr: i was adding robject + 8, 8 :(
[23:15:02] al2o3-cr: >> require 'fiddle'; include Fiddle; Pointer[dlwrap STDIN][16,SIZEOF_LONG] = Pointer[dlwrap STDOUT][16,SIZEOF_LONG]; STDIN.puts 'works'
[23:15:03] ruby[bot]: al2o3-cr: # => not opened for writing (IOError) ...check link for more (https://eval.in/901903)
[23:15:25] al2o3-cr: wait, this works.
[23:15:40] al2o3-cr: >> require 'fiddle'; include Fiddle; Pointer[dlwrap STDIN][16/2,SIZEOF_LONG] = Pointer[dlwrap STDOUT][16/2,SIZEOF_LONG]; STDIN.puts 'works'
[23:15:41] ruby[bot]: al2o3-cr: # => works ...check link for more (https://eval.in/901904)
[23:16:16] havenwood: just keep fiddling with it
[23:16:32] havenwood: ACTION plays a tiny fiddle
[23:16:37] al2o3-cr: haha, i've given up fiddling now :P
[23:17:43] al2o3-cr: C makes me dizzy sometimes.
[23:18:08] baweaver: Well it'd be easier if you could only C#er
[23:18:24] baweaver: </godawful-pun>
[23:19:11] al2o3-cr: hey, baweaver what was that keyword hash thingymagic?
[23:19:28] baweaver: >> [{a: 1, b: 2}, {b: 2, c: 3}].map { |a:1,b:2,c:3| a + b + c }
[23:19:29] ruby[bot]: baweaver: # => [6, 6] (https://eval.in/901906)
[23:20:13] al2o3-cr: baweaver: serioulsy didn't know this.
[23:20:13] baweaver: The two hashes are missing c and a respectively, so the block defaults them
[23:20:20] baweaver: me either until last night :D
[23:20:33] al2o3-cr: ACTION puts this al2o3-cr memory box.
[23:20:42] baweaver: well, I kinda did but it didn't occur to me until I thought about how nice it'd be to use destructuring in Ruby like JS
[23:20:56] baweaver: Waitasecond....
[23:21:54] al2o3-cr: i don't generally miss a trick, but this had me :P
[23:22:58] baweaver: >> [{a: 1, b: 2}, {b: 2, c: 3}].reduce(0){|sum,a:1,b:2,c:3| sum + a + b +c }
[23:22:59] ruby[bot]: baweaver: # => 12 (https://eval.in/901907)
[23:23:11] baweaver: drat, you can't deconstruct the accumulator
[23:23:55] al2o3-cr: baweaver: you'll find a way, i know it. :P
[23:24:15] baweaver: >> [{'a' => 1, 'b' => 2}, {'b' => 2, 'c' => 3}].map { |'a' => 1, 'b' => 2, 'c' => 3| a + b + c }
[23:24:16] ruby[bot]: baweaver: # => /tmp/execpad-99a85de55f33/source-99a85de55f33:2: syntax error, unexpected tSTRING_BEG, expecting '|' ...check link for more (https://eval.in/901908)
[23:24:42] baweaver: >> [{'a' => 1, 'b' => 2}, {'b' => 2, 'c' => 3}].map { |{'a' => 1, 'b' => 2, 'c' => 3}| a + b + c }
[23:24:43] ruby[bot]: baweaver: # => /tmp/execpad-f14fd9644c0f/source-f14fd9644c0f:2: syntax error, unexpected {, expecting '|' ...check link for more (https://eval.in/901909)
[23:24:51] baweaver: So only symbol keys
[23:25:17] baweaver: well, kwargs does it that way so reasons
[23:25:25] baweaver: waitasecond
[23:25:35] baweaver: >> [{'a' => 1, 'b' => 2}, {'b' => 2, 'c' => 3}].map { |**{'a' => 1, 'b' => 2, 'c' => 3}| a + b + c }
[23:25:36] ruby[bot]: baweaver: # => /tmp/execpad-a2031f8c4f8e/source-a2031f8c4f8e:2: syntax error, unexpected {, expecting '|' ...check link for more (https://eval.in/901910)
[23:25:40] baweaver: Ha, worth a try
[23:26:02] al2o3-cr: let me fiddle with this :P
[23:26:05] baweaver: >> [{a: 1, b: 2}, {b: 2, c: 3}].reduce(0){|sum,**{a:1,b:2,c:3}| sum + a + b +c }
[23:26:06] ruby[bot]: baweaver: # => /tmp/execpad-65689e6dfb15/source-65689e6dfb15:2: syntax error, unexpected {, expecting '|' ...check link for more (https://eval.in/901911)
[23:26:15] baweaver: So it takes it literally
[23:26:33] baweaver: So no making a default, you have to spell it o... ooooooooh
[23:26:41] havenwood: mandatory block args are interesting
[23:26:49] al2o3-cr: looks so, but, you never know :)
[23:26:59] havenwood: [{s: 'whee'}].map { |s:, mmm: ' \o/'| s + mmm } #=> ["whee \\o/"]
[23:27:38] havenwood: #!> ArgumentError: missing keyword: s
[23:34:10] al2o3-cr: baweaver: surely something can be done with Enumerable#sum?
[23:34:33] baweaver: I could but I like doing statewise reductions with reduce too
[23:35:01] baweaver: https://medium.com/@baweaver/reducing-enumerable-sorting-and-state-a336e098693d
[23:35:05] baweaver: See the MinMax blocks
[23:36:51] al2o3-cr: baweaver: you prefer reduce over inject?
[23:37:30] baweaver: you're reducing a set of values into another one
[23:37:37] baweaver: or foldLeft if you're using Haskell
[23:37:46] baweaver: inject just doesn't make semantic sense
[23:37:54] al2o3-cr: ok, then how about this
[23:38:09] al2o3-cr: 1.step(100).inject :lcm
[23:38:10] baweaver: and I say that because in the process of teaching newbies I switched to using inject and had a string of failures afterwards
[23:38:35] baweaver: least common multiple?
[23:38:49] al2o3-cr: what i'm saying is though
[23:39:00] baweaver: ACTION is guessing
[23:39:27] al2o3-cr: inject is doing this 1.lcm(2).lcm(3).lcm(4) etc inject inbetween.
[23:39:46] baweaver: Map is directions from one value to another. Select is selecting only certain values. Find is finding one value. Reduce is reducing into one value
[23:40:06] baweaver: To me and several newbies I've taught reduce comes across as clearer
[23:41:00] baweaver: I prefer fold left myself, but that's not Ruby
[23:41:06] baweaver: you're folding to the left starting with 0 using + for instance
[23:41:17] al2o3-cr: maybe that is why it's aliased.
[23:41:26] baweaver: It'll make more sense once I get to the Enumerable section and draw it
[23:41:52] baweaver: https://medium.com/@baweaver/reducing-enumerable-the-basics-fa042ce6806
[23:42:02] baweaver: That went over a lot of it at least, but no pictures
[23:42:21] al2o3-cr: i understand fully, but hopefully for you're readers it will become apparent ;)
[23:42:38] baweaver: Towards the bottom I try it with #each - https://baweaver.gitbooks.io/an-illustrated-guide-to-ruby/content/hip-hip-array.html
[23:43:01] baweaver: Turns out it's danged hard to explain those with pictures and distill it to reasonable clarity
[23:43:02] baweaver: and I'm still not entirely sure I did it right :P
[23:44:03] al2o3-cr: btw, you've done a great job and clarity is top notch. (and them lemurs, sure i had a dream about lemurs last night :P)
[23:45:13] baweaver: Ah great! Its working! :D
[23:45:21] baweaver: That said I don't think inject is wrong either al2o3-cr
[23:45:38] baweaver: In some cases it makes more sense, though I just use too much JS :P
[23:46:09] al2o3-cr: :P js is good too.
[23:49:36] baweaver: So whatever terms I can share I tend to
[23:50:02] workmad3: has joined #ruby-offtopic
[23:50:48] RickHull: the name inject comes from smalltalk
[23:51:02] baweaver: So they did inject Smalltalk into Ruby
[23:51:12] RickHull: class Ruby < Smalltalk
[23:51:17] RickHull: mixin perl and lisp?
[23:51:30] RickHull: probably Ruby < Perl
[23:51:33] baweaver: class Ruby; include Perl; include Lisp; include Smalltalk; end
[23:57:30] havenwood: clearly we should implement all stdlibs in Ruby
[23:58:36] havenwood: I should fill out Elixir.rb with the more difficult recent stuff...
[23:58:51] havenwood: Flow and StreamData would be interesting
[23:59:22] havenwood: safari is so screwing my links...
[23:59:32] havenwood: https://github.com/whatyouhide/stream_data