| dew | when producing output with erb templates, what's the preferred method for html-escaping stuff? |
| Aria | If you want pure stdlib, CGI.escape_html, as far as I know. |
| dew | ah, right, it's a manual job, fair enough ;) what else is out there for templating, btw? |
| Aria | xtemplate, amrita, markaby, cerise, geez, there's a lot... Almost pythony. |
| dew | hmm okay xtemplate, amrita and cerise appear to actually parse the html well, suppose they're assuming xml/xhtml and markaby is nice, but not quite what i'm after dammit, i'm gonna end up attempting to roll my own templating thing (and probably failing :)) |
| eetfunk | How can I connect to a local socket in Ruby? I am using InternetMessageIO right now, but would like to be able to connect directly through the local socket for performance. |
| wyhaines | eetfunk, http://ruby-doc.org/stdlib/libdoc/socket/rdoc/classes/TCPSocket.html |
| eetfunk | wyhaines: thanks i'll check it out |
| wyhaines | eetfunk, what is it that you are doing? |
| teferi | eetfunk: um, I sincerely doubt that using tcp sockets locally is a bottleneck |
| eetfunk | wyhaines: i'm hacking smtp.rb to make it connect on the local socket. we have a special implementation of an smtp server here and it also listens on a local socket teferi: we're passing a lot of data to the socket |
| teferi | that's what sockets are for |
| eetfunk | so you think i might just be wasting my time? |
| teferi | I do |
| eetfunk | ok. i'll reconsider it then :) |
| Bacon | You'd probably be better off spooling mail by piping to sendmail (or whatever the local MTA names the spooler) |
| eetfunk | Bacon: as I said, we're talking SMTP, but it's not a "real" smtp server. |
| mrturtle | Best way to order an array based on frequency? |
| dew | order an array based on how frequently things appear in it? c, a, b, b, a, a --> a, a, a, b, b, c ..? |
| mrturtle | Sorry...I'm not very clear. [5, 5, 2, 2, 2, 7] -> [2, 5, 7] |
| dew | ah use a hash (forgive my lack of ruby skills here) loop through the array, do something like hash[array_element]++ that'll give you a hash mapping keys to counts then sort the keys based on the value crap i don't know how to sort, or i'd give you some code ;) |
| action | dew looks it up |
| dew | looks it up |
| tpope | two bad group_by isn't in core because that'd be great for this I love that attitude dew, keep it up here, let me help |