havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.org | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3 | Can't talk? Register/identify with NickServ
skyikot has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Quit: WeeChat 2.9]
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 Ruby had a ByteArray type
<nakilon> hmmmm somehow I missed this: https://apidock.com/ruby/String/getbyte
jottr has joined #ruby
Technodrome has joined #ruby
<al2o3-cr> &>> "\x01\x02\x03\x04".unpack1('@3C')
<rubydoc> # => 4 (https://carc.in/#/r/a0i0)
<al2o3-cr> nakilon: but i would imagine #getbyte is considerably faster, not checked though.
TCZ has quit [Quit: Diabe? tkwi w szczegó?ach]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
coniptor has quit [Ping timeout: 268 seconds]
DaRock has joined #ruby
Furai has quit [Ping timeout: 272 seconds]
EvilJStoker has quit [Ping timeout: 272 seconds]
Furai has joined #ruby
shenghi has quit [Ping timeout: 272 seconds]
shenghi has joined #ruby
EvilJStoker has joined #ruby
coniptor has joined #ruby
DaRock has quit [Ping timeout: 240 seconds]
cer0 has joined #ruby
dfucci has joined #ruby
cer0 has quit [Ping timeout: 272 seconds]
dfucci has quit [Ping timeout: 272 seconds]
ChmEarl has quit [Quit: Leaving]
jottr has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
bvdw has quit [Quit: The Lounge - https://thelounge.chat]
jottr has quit [Ping timeout: 240 seconds]
bvdw has joined #ruby
Swyper has joined #ruby
ur5us has joined #ruby
<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?
roadie has joined #ruby
<nakilon> not yet
<nakilon> imagine another possibility
dfucci has quit [Ping timeout: 260 seconds]
<nakilon> a = [[1,2,3],[4,5,6],[7,8,9]]; a.map! &:zip; a.flatten(1).cool_uniq{ |x| (x+1)/2 } # => [[[1],[],[3]],[[],[5],[]],[[7],[],[9]]]
roadie` has joined #ruby
roadie has quit [Ping timeout: 272 seconds]
Swyper has joined #ruby
fippy_ has joined #ruby
Swyper has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
fippy has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 264 seconds]
_whitelogger has joined #ruby
Swyper has joined #ruby
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)
BTRE has quit [Remote host closed the connection]
<adam12> isene: [*1..3, 8 ,*12..17]
dionysus69 has joined #ruby
<adam12> isene: [1..3, 8 ,12..17].flat_map { Array(_1) }
<isene> adam12: Nice!
<apotheon> VicMackey: I'm glad you found it.
nbm has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
al2o3-cr has joined #ruby
roadie has quit [Remote host closed the connection]
BTRE has joined #ruby
hsmath has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.9]
al2o3-cr has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
postmodern has joined #ruby
Esa__ has quit [Ping timeout: 265 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Swyper has quit [Remote host closed the connection]
akem has quit [Ping timeout: 272 seconds]
bdnelson has joined #ruby
Swyper has joined #ruby
Swyper has quit [Ping timeout: 264 seconds]
ZeroFreak has joined #ruby
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 272 seconds]
zapata has joined #ruby
rubydoc has joined #ruby
phaul has joined #ruby
ZeroFreak has quit [Quit: Leaving]
ZeroFreak has joined #ruby
ZeroFreak has quit [Client Quit]
ZeroFreak has joined #ruby
dfucci has joined #ruby
akem has joined #ruby
ZeroFreak has quit [Quit: Leaving]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
zapata has quit [Quit: WeeChat 3.0]
dionysus69 has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
jottr has joined #ruby
ChmEarl has quit [Quit: Leaving]
ur5us has joined #ruby
akem has quit [Ping timeout: 255 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
Swyper has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
gdonald has left #ruby [#ruby]
Swyper has quit [Ping timeout: 244 seconds]
akem has joined #ruby
duderonomy has quit [Ping timeout: 264 seconds]
Technodrome has joined #ruby
Axy has joined #ruby
duderonomy has joined #ruby
jottr has quit [Quit: WeeChat 3.0]
Mia has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
TCZ has joined #ruby
rubydoc has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
rubydoc has joined #ruby
akem has quit [Quit: Leaving]
dfucci has joined #ruby
skyikot has joined #ruby
akem has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #ruby
akem has quit [Quit: Leaving]
akem has joined #ruby
fippy__ has quit [Ping timeout: 256 seconds]
skyikot has quit [Quit: skyikot]
ur5us has quit [Ping timeout: 264 seconds]
akem has quit [Remote host closed the connection]
TCZ has quit [Remote host closed the connection]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
BenDover has quit [Quit: BenDover]
hiroaki has joined #ruby
bdnelson has quit [Quit: Textual IRC Client: www.textualapp.com]
poguez_ has joined #ruby
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
budonyc has quit [Quit: Leaving]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
trepanger has joined #ruby
akem has joined #ruby
akem has quit [Client Quit]
akem has joined #ruby
trepanger has left #ruby ["channel"]