Page 1 of 1
[07:24:22] lewis1711: for some inexplicable reason, #pop removes from the end of an array, but pop(n) removes from the front
[21:51:42] lewis1711: if I have an array "xs", how to get an enumerator starting at a particular index in the array?
[03:42:47] lewis1711: or, I guess to re-phrase - nothing wrong with exceptions-as-control-flow in ruby, i guess? judging by the way this API has been written
[01:14:49] lewis1711: http://ruby-doc.org/stdlib-2.2.0/libdoc/matrix/rdoc/Matrix.html#method-c-columns when I type that line into IRB my output does not look like that at all. it just looks like " => Matrix[[25, -1], [93, 66]] ". why?
[03:13:22] lewis1711: with unicode characters, some characters take up double width when displayed. is there anyway to get this info from a string, or is that related to the font itself?
[03:20:49] lewis1711: that's the proper way to do it, but a bit over kill, I am only dealing with 36 characters, so that's easy to enumerate over
[01:07:34] lewis1711: how do I map over a hash to get another hash? I want to perform some function on evey value, but leave the keys
[01:09:55] lewis1711: Ox0dea, nope, that looks great, but it never showed up when I searched. I was looking for "to_hash". thanks
[06:39:47] lewis1711: d = Dir("/d"). let's say I know the name of a file inside d. can I get it from the dir object?
[06:45:28] lewis1711: unless there's some overloaded .each for Array etc now, that returns an enumerator.
[06:48:05] lewis1711: yeah those are all familiar to me. the .each thing return an enumerator was new
[07:12:57] lewis1711: baweaver, .each in a Dir just gives the string names, not files. so it's not possible. I'll just use strings rather than trying to do things with Dir
[03:31:27] lewis1711: is there a simple ruby testing framework? one that doesn't involve sub-classing or separate files
[03:35:10] lewis1711: phat4life, nothing at the moment. I am just wanting to have system that's like "write a bit of code, write a test just after it, carry on".
[03:38:30] lewis1711: phat4life, thanks. I'm a simple person, I will only unit test if it's completely thoughtless, I don't like ceremony
[03:56:01] lewis1711: sphex, pretty much the only language I ever used unit tests in was racket, because rackunit was so simple. I search for something similar in other languages, but it's hard to find. I don't really want to write anything longer than a couple of hundred lines in ruby without unit tests, because it's so super dynamic
[05:36:13] lewis1711: this is at least the third time in my life I have spent minutes figuring out why I couldn't construct my class because I wrote "initialise" instead of "initialize".
[01:35:58] lewis1711: is there anyway to have variable that's only computed when you access it? like "page = some_long_operation()". only have it computed once, when it's first accessed?