oh and... for fic purposes i guess, its canon fp was the quarterback cuz on his cast someone wrote “QT QB” but thats so boring like.... of course ras made him a quarterback he has no imagination
lazy

seen from Malaysia

seen from United States

seen from United States
seen from Canada
seen from Australia
seen from China

seen from United States

seen from Australia
seen from United States
seen from United States

seen from Singapore
seen from China
seen from China

seen from United Kingdom

seen from Singapore

seen from Malaysia

seen from Malaysia
seen from China
seen from Italy
seen from Türkiye
oh and... for fic purposes i guess, its canon fp was the quarterback cuz on his cast someone wrote “QT QB” but thats so boring like.... of course ras made him a quarterback he has no imagination
lazy
Ruby `reject!`
The reject! method in Ruby selectively removes elements from an array in-place, based on a provided predicate (in the form of a block).
Between Ruby 1.9.3 and Ruby 2.3, reject! was accidentally quadratic.
The underlying bug was fairly straightforward. Every time the provided predicate returned true, the code immediately deleted that element:
if (RTEST(rb_yield(v))) { rb_ary_delete_at(ary, i); result = ary; }
In an array, deleting an index necessitates shifting back all the following episodes, and so is an O(n) operation; If your predicate rejects a fixed fraction of elements, the total runtime is this O(n²).
The bug was fixed by keeping a count of accepted elements, and moving each element into its proper final position as it is scanned, and truncating the array at the end.
This bug is fairly straightforward, but the part I find most interesting was why it was introduced. The code used to be linear, but it regressed in response to bug #2545, which concerned the behavior when the block passed to reject! executed a break or otherwise exited early. Because reject! is in-place, any partial modifications it makes are still visible after an early exit, and reject! was leaving the array in a nonsensical state. The obvious fix was to ensure that the array was always in a consistent state, which is what resulted in the "delete every time" behavior.
I find this interesting as a cautionary tale of how several of Ruby's features (here, ubiquitous mutability, blocks, and nonlocal exits) interact to create suprising edge cases that need to be addressed, and how addressing those edge cases can easily result in yet more problems (here, quadratic performance). In my mind, I'd just rather not have a reject! at all, and callers who need to mutate an array in-place can figure out how to do safely with respect to their own use cases.
(Thanks to Russell Davis for bringing this one to my attention).
Array#reject, Array#reject!
reject { |item| block } -> new array
reject -> enumerator
Returns a new array containing the items for which the block returns not true (note that Ruby docs specifically says not true, it doesn't say false, so this will include nil and false items).
If used with the bang character, reject! will instantly change the array, as opposed to changing it when the block has finished iterating. Returns nil if no changes were made.
a = %w{ cat dog bird beast flea argyle machine } a.reject! { |word| word.length > 3 } puts a.inspect # ["cat", "dog"]
I tried using a regexp to make this work, but I'm not familiar enough with them yet to make it work.
I need to go on a hand rant because it's been bothering me how much I love hands. Not just any hands though, they have to be sexy hands. I can't explain what I like about them but I like hands so much I would totally reject a guy if his hands were weird. So every time I start a new class at my college, if there are guys around me (which generally there are) I tend to look at their hands.
I feel like a freak, but there's something really, really sexy about hands. Matthew Bellamy has the best looking hands I've ever seen in my life. So does this guy that sits next to me in my sociology class. I tend to talk to him more just because he has pretty hands.
And there's another boy that sits on the other side of me in the same class and he was just staring at his hands today. And I was staring at them too. :/ He's crazy cute and so are his hands. It just drives me nuts how much I love hands. It's pretty much the first thing I look at if I'm around a guy. Generally not girls, depends on if I'm envious of their hands or not.
This is getting weird. I feel like a creep the more I talk about this. Hands are sexy. That was my general idea I wanted to represent with this little note here. Thank you. :D