Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has left #ruby ["WeeChat 2.9"]
dviola has joined #ruby
nyuszika7h has quit [Quit: ZNC 1.8.1+deb1~bpo10+1 - https://znc.in]
BTRE has quit [Remote host closed the connection]
BTRE has joined #ruby
al2o3-cr has joined #ruby
nyuszika7h has joined #ruby
Swyper has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 260 seconds]
nyuszika7h has quit [Quit: ZNC 1.8.2+deb1~bpo10+1 - https://znc.in]
nyuszika7h has joined #ruby
cthulchu_ has quit [Ping timeout: 260 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
nyuszika7h has quit [Quit: ZNC 1.8.2+deb1~bpo10+1 - https://znc.in]
nyuszika7h has joined #ruby
hiroaki has quit [Ping timeout: 240 seconds]
nyuszika7h has quit [Remote host closed the connection]
nyuszika7h has joined #ruby
<nakilon>
strings like "\x01\x02\x03\x04" often work faster than arrays like [1, 2, 3, 4]
<nakilon>
I guess they are presented simpler in memory
<nakilon>
but to get the int from that numeric array I have to do just [n] while to get the number from string I have to do .bytes[n] that makes string slower
<nakilon>
I wish there was such ability to have s 3-dimensional array and apply .uniq to rows and cols in such way that elements would be deleted if there is the same element in the same row or col and after the operation the array would still be 3-dimensional
roshanavand has quit [Ping timeout: 256 seconds]
gix- has joined #ruby
gix has quit [Disconnected by services]
baojg_ has joined #ruby
baojg has quit [Ping timeout: 260 seconds]
mozzarella has quit [Ping timeout: 260 seconds]
<summerisle>
you could easily program it and then patch it onto the Array class at runtime to effectively add those features
mozzarella has joined #ruby
drincruz has quit [Ping timeout: 272 seconds]
<al2o3-cr>
nakilon: can you show us what you are trying to do?
ur5us has quit [Ping timeout: 264 seconds]
<nakilon>
al2o3-cr it's hard to describe; sometimes you have multidimensional array that you need to apply some typical methods on different axes
jottr has joined #ruby
Swyper has quit [Remote host closed the connection]
<nakilon>
for example, in my current problem the only correct way to solve it to group the array by rows, while I've just realised there is a theorem that makes it possible to apply .uniq to cols; but even .transpose won't help because items should remain in different cells after that
<nakilon>
imagine such .uniq! method that accepts multiple arrays and mutates them deleting items that are duplicates of items in the same or other arrays that are passed
<al2o3-cr>
nakilon: have you looked at the matrix class?
<nakilon>
it won't help
<nakilon>
the problem is that Array#uniq! goes over 1-dimensional array
<al2o3-cr>
nakilon: ah, ok. could you create a gist showing a 3d array and what you'd like the output to be, because tbh, i'm not grasping what you need.
<al2o3-cr>
it's just not going in my brain :p
jottr has quit [Ping timeout: 240 seconds]
<nakilon>
a = [[[1,2],[3,4],[5,6]],[[2,3],[4,5],[6,7]],[[3,4],[5,6],[7,8]]]; a.transpose[1].cool_uniq!; # a => [[[1,2],[3,4],[5,6]],[[2,3],[5],[6,7]],[[3,4],[6],[7,8]]]
<al2o3-cr>
nakilon: let me play with it
<nakilon>
al2o3-cr you will do Set.new and call keep_if on each subarray ..D but I wish it was in stdlib
dfucci has joined #ruby
<al2o3-cr>
nakilon: is that what you're doing now?
Swyper has quit [Remote host closed the connection]
BSaboia has joined #ruby
jottr has joined #ruby
roadie` has quit [Ping timeout: 272 seconds]
Seich has quit [Quit: Gone fishing.]
Seich has joined #ruby
roadie has joined #ruby
paul0 has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
_paul0 has quit [Ping timeout: 256 seconds]
Seich has quit [Quit: Gone fishing.]
Seich has joined #ruby
_whitelogger has joined #ruby
rippa has joined #ruby
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
BSaboia has joined #ruby
_whitelogger has joined #ruby
cd has quit [Quit: cd]
BenDover has joined #ruby
jottr has joined #ruby
jintseng has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
jintseng has quit [Client Quit]
cloud69 has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
al2o3-cr has joined #ruby
gdonald has quit [Ping timeout: 240 seconds]
gdonald has joined #ruby
jottr has joined #ruby
cloud69 has quit []
jottr has quit [Ping timeout: 240 seconds]
fippy_ has quit [Quit: Leaving]
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
BSaboia has joined #ruby
BSaboia has quit [Remote host closed the connection]
akem__ has joined #ruby
paul0 has quit [Quit: Leaving]
akem_ has quit [Ping timeout: 264 seconds]
nofrex has quit [Quit: WeeChat 2.7.1]
TCZ has joined #ruby
jottr has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
BenDover has quit [Quit: BenDover]
Rudd0 has quit [Ping timeout: 240 seconds]
TCZ has quit [Remote host closed the connection]
BenDover has joined #ruby
dionysus69 has joined #ruby
lucasb has joined #ruby
fippy_ has joined #ruby
VicMackey has joined #ruby
drincruz has joined #ruby
impermanence has quit [Quit: Connection closed]
<VicMackey>
Hello there! There were two online resources that taught Ruby, and were very much recommended. One of them was RubyMonk, and the other one had some comics on it, but I don't recall its name. Do you guys know what could it be? Thanks!
TCZ has joined #ruby
drincruz has quit [Ping timeout: 264 seconds]
Swyper has joined #ruby
akem__ has quit [Quit: Leaving]
fippy__ has joined #ruby
<VicMackey>
Sorry for not looking first. I was talking about Poignant!
fippy_ has quit [Ping timeout: 264 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
Technodrome has joined #ruby
roadie has joined #ruby
akem has joined #ruby
TCZ has quit [Quit: Diabe? tkwi w szczegó?ach]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
ChmEarl has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
Rudd0 has joined #ruby
cd has joined #ruby
Esa__ has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
jottr_ has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
<isene>
If I want a series of numbers (1..3, 8, 12..15), how can I get that into a variable so that I can do var.each on that to get this captured: 1, 2, 3, 8, 12, 13, 14, 15
jottr_ has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
<isene>
I wish I could do this; var = (1..3,8,12..17)