adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview2: 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
drincruz has quit [Ping timeout: 258 seconds]
panorain has quit [Remote host closed the connection]
Fusl has quit [Ping timeout: 272 seconds]
Fusl has joined #ruby
Fusl has quit [Max SendQ exceeded]
Fusl has joined #ruby
Fusl has quit [Max SendQ exceeded]
Fusl has joined #ruby
Fusl has quit [Max SendQ exceeded]
Fusl has joined #ruby
Fusl has quit [Max SendQ exceeded]
dfucci has joined #ruby
Fusl has joined #ruby
Fusl has quit [Max SendQ exceeded]
mroulston has joined #ruby
drincruz has joined #ruby
mroulston has quit [Client Quit]
dfucci has quit [Ping timeout: 260 seconds]
akem_ has quit [Read error: Connection reset by peer]
AndyC has joined #ruby
AndyC has quit [Client Quit]
adu has joined #ruby
dfucci has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
s3nd1v0g1 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
s3nd1v0g1 has quit [Ping timeout: 240 seconds]
s3nd1v0g1us has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
s3nd1v0g1us has quit [Ping timeout: 240 seconds]
jetchisel has quit [Ping timeout: 265 seconds]
braincra- has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
kristian_on_linu has joined #ruby
kristian_on_linu has quit [Remote host closed the connection]
swaggboi has quit [Quit: C-x C-c]
orbyt_ has joined #ruby
aremaref has quit [Ping timeout: 256 seconds]
aremaref has joined #ruby
swaggboi has joined #ruby
s3nd1v0g1 has joined #ruby
dfucci has joined #ruby
s3nd1v0g1 has quit [Ping timeout: 260 seconds]
lucidreamachine has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
braincra- has quit [Ping timeout: 256 seconds]
drincruz has quit [Ping timeout: 246 seconds]
_aeris_ has quit [Ping timeout: 240 seconds]
_aeris_ has joined #ruby
dfucci has joined #ruby
Fusl__ has joined #ruby
aremaref has quit [Ping timeout: 256 seconds]
dfucci has quit [Ping timeout: 256 seconds]
Fusl__ is now known as Fusl
dfucci has joined #ruby
dfucci has quit [Ping timeout: 260 seconds]
sh7d has quit [Ping timeout: 256 seconds]
sh7d has joined #ruby
aremaref has joined #ruby
aremaref has quit [Ping timeout: 240 seconds]
drincruz has joined #ruby
adu has quit [Quit: adu]
adu has joined #ruby
drincruz has quit [Ping timeout: 246 seconds]
lucidreamachine has quit [Ping timeout: 264 seconds]
nowhere_man has joined #ruby
dfucci has joined #ruby
reaVer has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 272 seconds]
reaVer has joined #ruby
freshmaker666 has joined #ruby
freshmaker666 has quit [Changing host]
freshmaker666 has joined #ruby
dfucci has joined #ruby
panorain has joined #ruby
dfucci has quit [Ping timeout: 258 seconds]
icarus has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
icarus has quit [Read error: No route to host]
lucidreamachine has joined #ruby
ChmEarl has quit [Quit: Leaving]
elcuervo has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
aremaref has joined #ruby
aremaref has quit [Ping timeout: 258 seconds]
pwnd_sfw2 has joined #ruby
pwnd_sfw has quit [Ping timeout: 256 seconds]
pwnd_sfw2 is now known as pwnd_sfw
duderonomy has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 264 seconds]
lucidreamachine has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
lucidreamachine has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
aremaref has joined #ruby
nowhere_man has quit [Remote host closed the connection]
aremaref has quit [Ping timeout: 260 seconds]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 264 seconds]
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
aremaref has joined #ruby
orbyt_ has joined #ruby
lucidreamachine has quit [Ping timeout: 258 seconds]
aremaref has quit [Ping timeout: 258 seconds]
aremaref has joined #ruby
aremaref has quit [Ping timeout: 256 seconds]
adu has quit [Quit: adu]
lucidreamachine has joined #ruby
timwis has joined #ruby
aremaref has joined #ruby
hiroaki has quit [Ping timeout: 272 seconds]
aremaref has quit [Ping timeout: 246 seconds]
cd has quit [Quit: cd]
hiroaki has joined #ruby
blackmesa has joined #ruby
lucidreamachine has quit [Ping timeout: 264 seconds]
lucidreamachine has joined #ruby
dfucci has joined #ruby
aremaref has joined #ruby
Rudd0 has quit [Ping timeout: 256 seconds]
akem has joined #ruby
ua_ has joined #ruby
ua has quit [Ping timeout: 256 seconds]
FastJack has quit [Ping timeout: 256 seconds]
lucidreamachine has quit [Ping timeout: 260 seconds]
FastJack has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
FastJack has quit [Ping timeout: 240 seconds]
FastJack has joined #ruby
akem has quit [Ping timeout: 264 seconds]
otagi[m] has quit [Quit: Idle for 30+ days]
akem has joined #ruby
cloud69 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FastJack has quit [Ping timeout: 240 seconds]
FastJack has joined #ruby
blackmesa1 has joined #ruby
blackmesa has quit [Ping timeout: 265 seconds]
aremaref has quit [Ping timeout: 246 seconds]
lucidreamachine has joined #ruby
ropeney has quit [Quit: ZNC 1.7.4 - https://znc.in]
ropeney has joined #ruby
orbyt_ has joined #ruby
braincrash has joined #ruby
Rudd0 has joined #ruby
akem has quit [Quit: Leaving]
timwis has quit [Quit: Connection closed for inactivity]
dfucci has quit [Ping timeout: 256 seconds]
blackmesa1 has quit [Ping timeout: 264 seconds]
blackmesa1 has joined #ruby
k_sze has quit [Quit: ZNC 1.8.2 - https://znc.in]
k_sze has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
k_sze has quit [Client Quit]
Emmanuel_Chanel has joined #ruby
Emmanuel_Chanel has quit [Max SendQ exceeded]
k_sze has joined #ruby
BTRE has quit [Remote host closed the connection]
BTRE has joined #ruby
ignorand has joined #ruby
lucidreamachine has quit [Ping timeout: 258 seconds]
lucidreamachine has joined #ruby
aremaref has joined #ruby
iNs has joined #ruby
iNs_ has quit [Remote host closed the connection]
aremaref has quit [Ping timeout: 264 seconds]
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
<ignorand> Anyone here familiar with hateoas? I wonder how the client is supposed to know what to post - https://restfulapi.net/hateoas/
somazero has joined #ruby
akem has joined #ruby
lucidreamachine has quit [Ping timeout: 258 seconds]
HyFlex has joined #ruby
lucidreamachine has joined #ruby
<HyFlex> Hi I'm working through a ruby based implementation of RC4, this code takes a secret message and encrypts it, does what is described. Code is located here: https://github.com/caiges/Ruby-RC4/blob/master/lib/rc4.rb
<HyFlex> What I'm trying to do is output the keystream before it is XORd with the plaintext to produce the cyphertext. From my understanding this happens on line 14 of the code. I've tried returning the value in @state but I only get 256 integers returned regardless of text length. What is it about the .setbye and getbyte that makes it behave differently?
BSaboia has joined #ruby
dfucci has joined #ruby
ruurd has quit [Quit: ZZZzzz…]
somazero has quit [Quit: Leaving]
ruurd has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
somazero has joined #ruby
somazero has quit [Client Quit]
drincruz has joined #ruby
blackmesa has joined #ruby
blackmesa1 has quit [Ping timeout: 260 seconds]
lucidreamachine has quit [Read error: Connection reset by peer]
lucidreamachine has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
dionysus69 has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
Garb0 has joined #ruby
TCZ has joined #ruby
drincruz has quit [Ping timeout: 240 seconds]
BSaboia has joined #ruby
<nakilon> what is the simplest/cleanest/shortest way to take a 2-dimensional array with lines of different length and add a predefined value to each line enough times to make all the lines to be the same length, effectively making the initial array rectangular?
BSaboia has quit [Quit: This computer has gone to sleep]
<nakilon> nvm
<nakilon> btw about my yesterday's question about splitting
<nakilon> there is also some special case about the end of the string
<nakilon> >> "\n\na\n\nb\n\n".split "\n"
<ruby[bot]> nakilon: # => ["", "", "a", "", "b"] (https://carc.in/#/r/a3ox)
HyFlex has quit [Quit: Connection closed]
drincruz has joined #ruby
dfucci has quit [Ping timeout: 258 seconds]
panorain has quit [Quit: Leaving]
TCZ has quit [Quit: Diabe? tkwi w szczegó?ach]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
cloud69 has quit [Quit: Connection closed for inactivity]
dfucci has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
BSaboia has joined #ruby
lucidreamachine has quit [Ping timeout: 260 seconds]
drincruz has quit [Ping timeout: 260 seconds]
dfucci has quit [Ping timeout: 256 seconds]
Garb0 has quit [Read error: Connection reset by peer]
Garb0 has joined #ruby
Garb0 has quit [Remote host closed the connection]
ignorand has quit [Remote host closed the connection]
BSaboia has quit [Quit: This computer has gone to sleep]
somazero has joined #ruby
<akem> Hey i'm trying to escape ' character with gsub and i have a weird behavior: puts "_'_".gsub(/'/,'\\\'')
<akem> It's works normaly if i replace the last ' by " in gsub(). Any idea what's going on?
<akem> >> "_'_".gsub(/'/,'\\\"')
<ruby[bot]> akem: # => (https://carc.in/#/r/a3p1)
<akem> >> puts "_'_".gsub(/'/,'\\\"')
<ruby[bot]> akem: # => _\"_ ...check link for more (https://carc.in/#/r/a3p2)
<akem> >> puts "_'_".gsub(/'/,'\\\'')
<ruby[bot]> akem: # => ___ ...check link for more (https://carc.in/#/r/a3p3)
<akem> It outputs "___" instead of "_\'_" in the last one, why?
<akem> Even using "" as enclosure instead of '' in the gsub() method i still have the same issue. No idea why.
drincruz has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
drincruz has joined #ruby
dfucci has joined #ruby
ChmEarl has joined #ruby
Garb0 has joined #ruby
<leftylink> ah uh this is one of the things that will surprise unless having seen the docs
<leftylink> for thhis particularly tricky one I will find
<leftylink> &ri String#gsub
<leftylink> > Similarly, \&, \', \`, and + correspond to special variables, $&, $', $`, and $+, respectively. (See regexp.rdoc for details.)
<leftylink> that line specifically.
<leftylink> I thank them for finally adding documentation for this fact in... 2.7 it looks like
<leftylink> before them having documented that, there was almost no way to know that
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 258 seconds]
dfucci has quit [Ping timeout: 272 seconds]
Technodrome has joined #ruby
GodFather has joined #ruby
<akem> Yay, thanks leftylink :)
aremaref has joined #ruby
GodFather_ has joined #ruby
austin880625 has joined #ruby
drincruz has quit [Ping timeout: 264 seconds]
austin880625 has left #ruby [#ruby]
impermanence has joined #ruby
aremaref has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
umjisus has quit [Quit: Lost terminal]
umjisus has joined #ruby
leftylink has quit [Remote host closed the connection]
leftylink has joined #ruby
Furai has quit [Quit: WeeChat 3.0]
Furai has joined #ruby
drincruz has joined #ruby
ellcs has joined #ruby
naftilos76 has joined #ruby
drincruz has quit [Ping timeout: 258 seconds]
<naftilos76> Hi, i am trying to put together a website that i could save mqtt messages which during publishing are captured by the code in the link and are stored in a database table
<naftilos76> I am thinking that if too many messages are sent to the broker the client.get("#") block code must be really fast so that it will not delay the block
<adam12> naftilos76: I'd be inclined to introduce some sort of queue that just pops messages and writes them to the database.
<adam12> naftilos76: Inside client.get, just push to the queue.
<naftilos76> So i thought that if i could create a thread everytime a new mqtt message is captured that would introduce minimal delay to the client.get block
<naftilos76> adam12: i have been reading during the last days about threads and also queue. So do you beleive that queue is the best approach?
<adam12> naftilos76: Well it doesn't have to be `Queue` from stdlib explicitly, but maybe it's a Suckerpunch instance. Depends on if you need durability at all.
<naftilos76> well i was thinking that under production conditions the stress would be imence so yes the solution has to be solid
<adam12> naftilos76: If you're OK with no durability, you could use Suckerpunch, which has an inmemory queue. If you need durability, you'd need to persist the operations to disk.
<adam12> naftilos76: But a lot of this is going to be "it depends". In reality, how much of a backlog would you end up with. If you had Suckerpunch running with 2-3 workers, would you ever have a backlog? You might only lose a single message upon restart, which might be acceptable.
drincruz has joined #ruby
<naftilos76> i am facing an issue with retrieving lets say 15k of records. doing that takes over a second on a 10-core vps that i rented a few days ago so it has to be a type of cache unltimately located in ram
<naftilos76> that is the only way to get that data fast
<naftilos76> mysql is not fast enough especially when the data you are asking for is not the same with the previous query
<adam12> Well you're probably going to be IO bound, so either you take the chance by queuing and writing, or you write immediately but is slower. If you queue and want to prevent IO, you're risking durability.
<naftilos76> ok thanks for your time - i will have a look and run some tests
<adam12> I don't think ActiveRecord supports multi-INSERT but that would be an option to explore for speed.
<adam12> Sequel does if you'e problem is self-contained and you could use Sequel instead of AR here.
<naftilos76> i have to do that with mysql2 gem or something
<naftilos76> insert by writing raw sql
<naftilos76> multiple records
somazero has quit [Remote host closed the connection]
blackmesa1 has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
hiroaki has quit [Ping timeout: 272 seconds]
<akem> Hey, in Dir.glob("**/*") to list all files and directories, why is it "**/*" and not just "*/*"?
<akem> I've read that on stackoverflow, but i try with just "*/*" and it looks like it works too, but there is maybe a difference, need to check.
<akem> Hm no it's not the same.
<adam12> akem: I'm not sure I've ever looked too deeply into it, but generally `**` is a recursive match.
<akem> Yeah it does not include first level dir files with only one *.
<adam12> It's the same in a shell. */* will match single level, **/* will match everything.
<akem> adam12, I don't know. But trying it with "ls", i got the same output for both on Ubuntu.
<akem> List all subfolders and content, but not regular files at 1st level './'
hiroaki has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem_ has joined #ruby
akem has quit [Ping timeout: 256 seconds]
dfucci has quit [Ping timeout: 256 seconds]
naftilos76 has quit [Quit: Leaving]
blackmesa1 has quit [Ping timeout: 272 seconds]
drincruz has quit [Ping timeout: 256 seconds]
BenDover has joined #ruby
blackmesa1 has joined #ruby
blackmesa has joined #ruby
blackmesa1 has quit [Ping timeout: 258 seconds]
weaksauce has joined #ruby
dhollinger has quit [Ping timeout: 272 seconds]
dhollinger has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
leftylink has quit [Quit: Lost terminal]
dhollinger has quit [Ping timeout: 246 seconds]
dhollinger has joined #ruby
leftylink has joined #ruby
ChmEarl has quit [Quit: Leaving]
ChmEarl has joined #ruby
somazero has joined #ruby
Technodrome has joined #ruby
lucidreamachine has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Ping timeout: 240 seconds]
mohsen_in has joined #ruby
blackmesa has joined #ruby
blackmesa has quit [Ping timeout: 258 seconds]
blackmesa has joined #ruby
mohsen_in has quit [Quit: Leaving]
blackmesa has quit [Ping timeout: 240 seconds]
lucidreamachine has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
blackmesa1 has joined #ruby
blackmesa has quit [Ping timeout: 272 seconds]
BenDover has quit [Quit: BenDover]
lucidreamachine has joined #ruby
bambanx has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
duderonomy has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
_aeris has joined #ruby
_aeris_ has quit [Ping timeout: 240 seconds]
_aeris is now known as _aeris_
lucidreamachine has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
cd has joined #ruby
lucidreamachine has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
somazero has quit [Quit: Leaving]
blackmesa1 has quit [Ping timeout: 264 seconds]