#ruby - 23 July 2017
« Back 1 day Forward 1 day »
[05:40:06] radial: how can i do something for each element except the last one in an array, and do something different for the last one?
[05:47:30] firebird: I've been playing with ruby lately as I have the ambition to replace the python irc bots I run with ruby (using cinch). Ruby seems to grok with my brain a bit easier, still a long ways off but I'm working at it :)
[05:50:41] firebird: baweaver, great, thanks. :) For the use case of one of the bots I was pleasantly surprised with the cinch plugins already out there that people created (that bot has more basic needs than another one I run)
[05:51:20] firebird: been plugging away at putting it all together and getting the correct configuration sorted, and thus of course learning more about it along the way.
[06:33:36] baweaver: because if you count Damerau in there as well you get transposition in addition to the three base operations distinguishing distance.
[06:38:34] warrshrike: baweaver: right so i mentioned == because i assumed it responded to to equality like strings the levinshtein implementation might work without modification
[06:41:13] warrshrike: http://devnull.absolventa.de/2015/11/24/exploring-levenshtein-algorithm-with-ruby/
[06:42:10] baweaver: that way you can keep a command line open on the side to see whether it's working in real time
[06:43:05] baweaver: Whenever I'm not entirely sure what I'm doing I write out the expected case first and keep factoring away until I get green lights
[11:33:59] apeiros: warrshrike: it means that it's a keyword-argument, not a positional one. and since no default is given, it also means it's required.
[12:03:58] apeiros: there are a couple of mathematical operations which have an undefined result and therefore give nan (or domain error, like 0/0, only 0/0.0 will give nan)
[12:04:57] apeiros: google is probably a better source for operations resulting in nan than my memory ;-)
[18:00:02] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `' for nil:NilClass
[18:02:07] sharkyshark: oh yeah i just wrote another one out here, / (?imx):stuff/, in this spot all three would be turned on yeah
[18:10:59] kamilkucharski: Hello! I have a question about ruby spec. In reference documentation we have ceil with argument for Integer class (http://ruby-doc.org/core-2.4.1/Integer.html#method-i-ceil), but in ruby spec we haven't any test for that (https://github.com/ruby/spec/blob/master/core/integer/ceil_spec.rb). Now my question: why? Should be there? Or maybe ruby spec should pass since 1.9
[18:36:22] ruby[bot]: ruby[bot] kicked newage1: is a bannable offense, see http://ruby-community.com/pages/user_rules
[21:26:41] foamz: hello, does anyone have a source for this repo anywhere: https://github.com/Beakr/bot
[23:15:29] ruby[bot]: bonhoeffer: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP