havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.5.0, 2.4.3, 2.3.6, 2.6.0-preview1: https://www.ruby-lang.org || Paste 4+ lines of text to https://gist.github.com || Rails questions? Ask in #RubyOnRails || Books: https://goo.gl/wpGhoQ || Logs: https://irclog.whitequark.org/ruby
n0m4d1c has joined #ruby
<havenwood> GetoptLong is the other stdlib option.
<havenwood> &ri GetoptLong
<havenwood> &ri OptionParser
<havenwood> I've never actually seen GetoptLong used. ¯\_(ツ)_/¯
pastorin_ has quit []
duckpuppy has joined #ruby
Psybur__ has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
Psybur_ has quit [Ping timeout: 264 seconds]
duckpuppy has quit [Ping timeout: 264 seconds]
<RedNifre> Well, I just want to do `encode --deck french52 "Some Text"` and `decode --deck quartett A4 C2 E1 B1 B2 ...`
<RedNifre> (It's a program to use decks of cards as a storage medium for unicode text)
SeepingN has quit [Quit: The system is going down for reboot NOW!]
jottr has quit [Ping timeout: 260 seconds]
banisterfiend has quit [Ping timeout: 246 seconds]
<weaksauce> RedNifre don't think either of those can do what you want really... optionparser can't handle the script.rb some verb --extraoptions "some option" style iirc
<RedNifre> Yeah, they looked too complicated so I just go with ARGV
beremenushka2 has quit [Ping timeout: 256 seconds]
beremenushka2 has joined #ruby
banisterfiend has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcarl43 has quit [Quit: WeeChat 2.0.1]
jcarl43 has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
sameerynho has joined #ruby
cdg_ has quit [Remote host closed the connection]
<RedNifre> Almost done... if I have an array of strings of size 2 each, how do I uppercase the first and lowercase the second letter?
nachoman has quit []
<RedNifre> never mind
<RedNifre> there's a method for everything :)
herbmillerjr has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
sameerynho has quit [Ping timeout: 264 seconds]
Psybur__ has quit [Ping timeout: 264 seconds]
banisterfiend has quit [Ping timeout: 260 seconds]
jackjackdripper has joined #ruby
phaul has quit [Ping timeout: 276 seconds]
am55 has quit [Quit: am55]
gbaptista has quit [Read error: Connection reset by peer]
SteenJobs has joined #ruby
SteenJobs has quit [Client Quit]
goatish has quit [Quit: bye]
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
duckpuppy has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
rfoust has joined #ruby
ramfjord has joined #ruby
Yzguy has quit [Quit: Zzz...]
Yzguy has joined #ruby
JoshS has quit [Read error: Connection reset by peer]
duckpuppy has quit [Ping timeout: 276 seconds]
jcarl43 has quit [Quit: WeeChat 2.0.1]
workmad3 has joined #ruby
nowhere_man has joined #ruby
Yzguy has quit [Ping timeout: 246 seconds]
nowhereman_ has quit [Ping timeout: 276 seconds]
shinnya has quit [Ping timeout: 246 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
jameser has joined #ruby
maxvaillancourt1 has quit [Quit: Leaving]
bmurt has joined #ruby
Dimik has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
jackjackdripper has quit [Ping timeout: 256 seconds]
nachoman has joined #ruby
RedNifre has quit [Quit: sleep]
roshanavand has joined #ruby
kn-928 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
imode has quit [Ping timeout: 240 seconds]
duckpuppy has joined #ruby
marr has quit [Ping timeout: 240 seconds]
DTZUZU has joined #ruby
duckpuppy has quit [Ping timeout: 246 seconds]
netherwolfe has joined #ruby
JonaBurgos has joined #ruby
<JonaBurgos> Hi guys and partners :)
m27frogy has quit [Quit: ZNC - http://znc.in]
JoshS has joined #ruby
jeffreylevesque has joined #ruby
jnollette has quit [Ping timeout: 268 seconds]
Gnut has quit [Ping timeout: 240 seconds]
netherwolfe has quit [Ping timeout: 276 seconds]
yokel has quit [Ping timeout: 260 seconds]
tolerablyjake has joined #ruby
cardoni has quit []
cdg has joined #ruby
KeyJoo has quit [Ping timeout: 246 seconds]
gnufied has quit [Ping timeout: 246 seconds]
gnufied has joined #ruby
minimalism has quit [Quit: minimalism]
cdg has quit [Ping timeout: 276 seconds]
pilne has quit [Quit: Leaving]
dinfuehr has joined #ruby
karapetyan has quit [Remote host closed the connection]
dinfuehr_ has quit [Ping timeout: 240 seconds]
n0m4d1c has quit [Read error: Connection reset by peer]
n0m4d1c has joined #ruby
vutral|kali has quit [Ping timeout: 264 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
tolerablyjake has quit [Ping timeout: 276 seconds]
cagomez has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
ramfjord has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
n0m4d1c has quit [Read error: Connection reset by peer]
cagomez has quit [Ping timeout: 240 seconds]
guacamole has quit [Client Quit]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
imode has joined #ruby
jeffreylevesque has quit [Read error: Connection reset by peer]
darkhanb has joined #ruby
AJA4350 has quit [Quit: AJA4350]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #ruby
nowhereman_ has joined #ruby
jeffreylevesque has joined #ruby
vutral|kali has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 276 seconds]
kn-928 has quit [Ping timeout: 260 seconds]
m27frogy has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jgpawletko has joined #ruby
jgpawletko has quit [Client Quit]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
alfiemax has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
Matthew1 has joined #ruby
Matthew1 has quit [Remote host closed the connection]
Matthew1 has joined #ruby
vutral|kali has quit [Excess Flood]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
gizmore has joined #ruby
milardovich has quit [Remote host closed the connection]
vutral|kali has quit [Excess Flood]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
gizmore|2 has quit [Ping timeout: 246 seconds]
milardovich has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duckpuppy has joined #ruby
n0m4d1c has joined #ruby
duckpuppy has quit [Ping timeout: 240 seconds]
jeffreylevesque has quit [Read error: Connection reset by peer]
JonaBurgos has quit [Quit: Textual IRC Client: www.textualapp.com]
jeffreylevesque has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
workmad3 has joined #ruby
Yzguy has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
jgpawletko has joined #ruby
jgpawletko has quit [Client Quit]
alfiemax has quit [Remote host closed the connection]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
milardovich has quit [Remote host closed the connection]
bmurt has quit [Client Quit]
jordanm has quit [Quit: Konversation terminated!]
jordanm has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
Yzguy has quit [Quit: Zzz...]
Matthew1 has quit [Remote host closed the connection]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John_Ivan has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
duckpuppy has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cschneid has joined #ruby
Yzguy has joined #ruby
duckpuppy has quit [Ping timeout: 276 seconds]
jackjackdripper has joined #ruby
zeds has left #ruby [#ruby]
zeds has joined #ruby
dr3w_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
nachoman has quit []
howdoi has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
jeffreylevesque has quit [Read error: Connection reset by peer]
jeffreylevesque has joined #ruby
alfiemax has joined #ruby
dnewkerk has joined #ruby
dnewkerk has quit [Client Quit]
trautwein has quit [Quit: ZNC 1.6.5 - http://znc.in]
trautwein has joined #ruby
dnewkerk has joined #ruby
kn-928 has joined #ruby
_aeris_ has quit [Remote host closed the connection]
_aeris_ has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #ruby
kn-928 has quit [Ping timeout: 246 seconds]
alfiemax has quit [Remote host closed the connection]
zeds has left #ruby [#ruby]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duckpuppy has joined #ruby
n0m4d1c has quit [Ping timeout: 246 seconds]
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
eckhardt has joined #ruby
BTRE has quit [Remote host closed the connection]
n0m4d1c has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duckpuppy has quit [Ping timeout: 264 seconds]
dviola has joined #ruby
alfiemax has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
cagomez has quit [Remote host closed the connection]
larson has joined #ruby
larson has quit [Client Quit]
cschneid has quit [Remote host closed the connection]
kn-928 has joined #ruby
r3m has quit [Quit: ZNC - http://znc.in]
r3m has joined #ruby
Gnut_ has joined #ruby
luminous has joined #ruby
sauvin_ has joined #ruby
cdg has joined #ruby
ramfjord has joined #ruby
exchgr has quit [Ping timeout: 256 seconds]
RyanMcCoskrie has joined #ruby
milardovich has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 276 seconds]
ramfjord has quit [Ping timeout: 276 seconds]
exchgr has joined #ruby
alfiemax has quit [Remote host closed the connection]
Gnut_ has quit [Ping timeout: 260 seconds]
Dimik has joined #ruby
alfiemax has joined #ruby
RyanMcCoskrie has quit [Remote host closed the connection]
KeyJoo has joined #ruby
duckpuppy has joined #ruby
jamesaxl has joined #ruby
nadir has joined #ruby
sauvin_ is now known as bocaneri
nadir has quit [Client Quit]
duckpuppy has quit [Ping timeout: 264 seconds]
anisha has joined #ruby
UKn0Me has left #ruby ["The Lounge - https://thelounge.github.io"]
aufi has joined #ruby
ledestin has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
Gnut has joined #ruby
milardovich has joined #ruby
aufi has quit []
milardovich has quit [Ping timeout: 240 seconds]
sidx64 has joined #ruby
oleo has quit [Quit: Leaving]
sidx64 has quit [Client Quit]
CrazyEddy has joined #ruby
eckhardt_ has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
CrazyEddy has joined #ruby
sidx64 has joined #ruby
jameser has quit [Ping timeout: 264 seconds]
kn-928 has quit [Ping timeout: 276 seconds]
SteenJobs has joined #ruby
SteenJobs has quit [Client Quit]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
Burgestrand has joined #ruby
sidx64_ has joined #ruby
sidx64 has quit [Read error: Connection reset by peer]
nachoman has joined #ruby
suukim has joined #ruby
sidx64 has joined #ruby
sidx64_ has quit [Ping timeout: 264 seconds]
Burgestrand has quit [Quit: Closing time!]
za1b1tsu has joined #ruby
jackjackdripper has joined #ruby
duckpuppy has joined #ruby
Burgestrand has joined #ruby
luminous has quit []
apeiros has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
n008f4g_ has joined #ruby
alex`` has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
sidx64_ has joined #ruby
halbbalda has quit [Quit: ZNC - http://znc.in]
sidx64 has quit [Read error: Connection reset by peer]
halbbalda has joined #ruby
sidx64 has joined #ruby
sidx64_ has quit [Ping timeout: 248 seconds]
jeffreylevesque has quit [Read error: Connection reset by peer]
halbbalda has quit [Quit: ZNC - http://znc.in]
halbbalda has joined #ruby
mtkd has joined #ruby
ramfjord has joined #ruby
nadir has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 260 seconds]
rideh has quit [Ping timeout: 276 seconds]
Dimik has quit [Ping timeout: 248 seconds]
rideh has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
n008f4g_ has quit [Ping timeout: 240 seconds]
halbbalda has quit [Quit: ZNC - http://znc.in]
halbbalda has joined #ruby
duckpuppy has joined #ruby
milardovich has joined #ruby
Papierkorb has joined #ruby
Papierkorb has left #ruby ["Konversation terminated!"]
duckpuppy has quit [Ping timeout: 276 seconds]
andikr has joined #ruby
guardianx has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troys has quit [Quit: Bye]
Burgestrand has quit [Quit: Closing time!]
sidx64 has joined #ruby
halbbalda has quit [Quit: ZNC - http://znc.in]
alfiemax has quit [Remote host closed the connection]
halbbalda has joined #ruby
zacts has quit [Quit: WeeChat 1.9.1]
cdg has joined #ruby
xorgnak has quit [Ping timeout: 276 seconds]
zacts has joined #ruby
imode has quit [Ping timeout: 276 seconds]
aufi has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
clemens3 has joined #ruby
TomyWork has joined #ruby
jameser has joined #ruby
schneider has joined #ruby
alfiemax has joined #ruby
halbbalda has quit [Quit: ZNC - http://znc.in]
alex`` has quit [Ping timeout: 240 seconds]
halbbalda has joined #ruby
jameser has quit [Client Quit]
remix2000 has quit [Quit: The Lounge - https://thelounge.github.io]
alfiemax has quit [Ping timeout: 264 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
yohji has joined #ruby
halbbalda has quit [Quit: ZNC - http://znc.in]
halbbalda has joined #ruby
remix2000 has joined #ruby
guardianx has quit []
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #ruby
alfiemax has joined #ruby
RougeR has quit [Ping timeout: 264 seconds]
oetjenj has joined #ruby
schneider has quit [Ping timeout: 264 seconds]
alfiemax has quit [Ping timeout: 276 seconds]
sylario has joined #ruby
sidx64 has joined #ruby
jottr has joined #ruby
xuyuheng has joined #ruby
mikecmpbll has joined #ruby
duckpuppy has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duckpuppy has quit [Ping timeout: 264 seconds]
AJA4350 has joined #ruby
aupadhye has joined #ruby
karapetyan has joined #ruby
MasterOfDisaster has quit [Quit: WeeChat 2.0.1]
deathwishdave has joined #ruby
workmad3 has joined #ruby
dnewkerk has quit [Quit: Textual IRC Client: www.textualapp.com]
laekur has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
schneider has joined #ruby
laekur has quit [Client Quit]
laekur has joined #ruby
<remix2000> Hello! Which framework (not rails) would be the best choice for an app that will use WebSockets?
Ltem has joined #ruby
<dminuoso> remix2000: Do you just want websockets or more?
jameser has joined #ruby
<remix2000> dminuoso: what does more mean there?
<dminuoso> remix2000: Do you also want to serve web pages?
<remix2000> dminuoso: yes
schneider has quit [Ping timeout: 260 seconds]
schneider has joined #ruby
apeiros has joined #ruby
marr has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
<Radar> Hanami has websocket support.
<Radar> Or... at least my memory told me so. Google says no.
Yzguy has quit [Quit: Zzz...]
<Radar> remix2000: why not Rails?
schneider has joined #ruby
guille-moe has joined #ruby
postmodern has quit [Quit: Leaving]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<remix2000> Radar: I think that Rails is an overkill for a simple app.
mtkd has quit [Ping timeout: 264 seconds]
camonz has joined #ruby
mtkd has joined #ruby
tomphp has joined #ruby
ltt has joined #ruby
ltt has quit [Client Quit]
alfiemax has joined #ruby
dviola has quit [Quit: WeeChat 2.0.1]
jnollette has joined #ruby
milardovich has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ltt has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Ping timeout: 264 seconds]
konsolebox has quit [Ping timeout: 264 seconds]
tomphp has joined #ruby
tomphp has quit [Client Quit]
milardovich has quit [Ping timeout: 246 seconds]
KeyJoo has quit [Ping timeout: 246 seconds]
konsolebox has joined #ruby
minimalism has joined #ruby
BTRE has joined #ruby
tomphp has joined #ruby
jackjackdripper has quit [Ping timeout: 260 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weaksauce has quit [Ping timeout: 246 seconds]
<zenspider> might be overkill but you could have been done by now. :P
jameser has joined #ruby
duckpuppy has joined #ruby
<dminuoso> Rails is not overkill. Let me just figure out the DSL to tell you how...
Beams has joined #ruby
jameser has quit [Client Quit]
nymous has joined #ruby
<nymous> hey folks. i have a question
jameser has joined #ruby
<nymous> i'm using Mutex::owned? in my app, but I need to run it on 1.9.3 now, which is lacking of this method
sidx64 has joined #ruby
<nymous> i can monkey patch Mutex i guess, but maybe there is a better way?
<apeiros> yes, it's not running 1.9
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> 1.9 is EOL and downwards compatibility from 2.5 with 1.9.3 is generally quite good. exotic native gems may cause issues, though.
duckpuppy has quit [Ping timeout: 264 seconds]
ta__ has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
* dminuoso .oO( Im so curious why so many people feel the need to monkey patch things )
<nymous> i have a bunch of old servers which i'm unwilling to upgrade yet
<dminuoso> I seem to be able to write thousands of lines of code without monkey patching other peoples code.
<apeiros> nymous: but you're willing to patch your way through?
<apeiros> frankly, you're spending your time on the wrong end of patching
<nymous> if it mean 10 mins vs 10 days - yes
<apeiros> iff
<apeiros> there's 2 assumptions in there which both may very well be wrong
<dminuoso> Clearly the only problem between 1.9.3 and 2.5 is Mutex#owned
<nymous> ok, i have to upgrade 80 servers with reconfiguring all the staff
<nymous> OR i can add 3 lines of code into my app
<apeiros> you're still making the same assumption
<apeiros> but then again, I don't know your setup. maybe you manually upgrade each server separately.
<apeiros> (but that only considers one side of the assumptions)
<apeiros> anyway, at that point, if you want to patch your way through, go with the monkey patch.
<dminuoso> If you have such an important software running on 80 servers, you should seriously make plans to patch things.
<apeiros> does not seem to contain Mutex#owned?, though
cschneid has joined #ruby
<nymous> even if it's upgrade is automated, you still have to reconfigure a lot
<dminuoso> "reconfigure" ?
* dminuoso smells an infrastructure where you have to manually manage, configure and deploy 80 servers
<apeiros> I don't see how replacing an executable requires new configuraiton, but ok…
<dminuoso> The only thing keeping me from upgrading to 2.5 right now is some native extensions.
<nymous> the software is written in java, so it doesn't care about the rest of OS
<dminuoso> Like Im too scared to try ruby-oci8.
<apeiros> dminuoso: same. oracle is usually our reason to lag behind. like two minors, not six (which equates to 6 years)
<nymous> look, if you want me to be more specific, i can. i run opennebula 4.12 on this servers with custom made drivers, running on debian wheezy
<apeiros> nymous: no I don't
<apeiros> it's your shot to call
<nymous> i have to redo all infrastructure including driver upgrades, redoing networking and staff
<nymous> i don't think i can simply apt dist-upgrade to stretch in 5 minutes
<apeiros> and I care relatively little. all I have is an opinion and I gave you both my opinion and my reasoning for it.
<dminuoso> I think I understand where the problem comes from.
<nymous> so, well, yes i can do an upgrade to run my 100 lines ruby script
<apeiros> a) you'll eventually have to upgrade
<dminuoso> nymous: Avoid using system shipped Ruby (especially on Debian)
<apeiros> b) all time you spend in making old stuff compatibly is essentially wasted time
<nymous> but it's not worth it by now
alfiemax has joined #ruby
<apeiros> c) the time it takes to make old stuff compatible can very well be open-ended
cschneid has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
<dminuoso> nymous: When we say "get new ruby", we usually mean some form of "use some ppa or ruby-install based mechanism to get a fresh ruby"
<nymous> times goes fast, setup was made in 2014 and it was ok back then
<nymous> debian doesn't support ppa
<nymous> it doesn't have newer rubies in backports
yohji has quit [Ping timeout: 245 seconds]
<nymous> i don't want to waste my time searching what will break if i upgrade ruby
conta has joined #ruby
<nymous> you know, opennebula uses ruby too
dviola has joined #ruby
qba73 has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
<apeiros> nymous: that's we we usually don't touch system ruby for our stuff
<apeiros> use a user-install where you only have to care about your stuff
<nymous> it's for a little backend script
<apeiros> not sure why you spend so much time here then. if it's a tiny script, fix the script to not use a 2.5 feature then.
mtkd has quit []
SynSynack has joined #ruby
Burgestrand has quit [Ping timeout: 246 seconds]
Fusselgesicht has joined #ruby
ledestin has joined #ruby
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oetjenj has joined #ruby
tomphp has joined #ruby
Serpent7776 has joined #ruby
yohji has joined #ruby
pugcs has joined #ruby
<nymous> i was hoping to hear about something like above mentioned backports lib, and not reinvent the wheel by myself
<dminuoso> It's fairly likely that you can just rewrite y using
<dminuoso> &ri try_lock
<gray_-_wolf> nymous: why not just make own ruby package? that should allow you upgrade ruby without having to touch rest of the os
<dminuoso> If its just a 100 line script, then fix the script - not the language.
<dminuoso> owned? is documented to be an experimental API
tomphp has quit [Client Quit]
<dminuoso> Or you know, you can use #locked? directly
qba73 has quit [Remote host closed the connection]
<dminuoso> It's completely beyond me why one would consider monkey patching anything.
rikkipitt has joined #ruby
<dminuoso> Monkey patching is almost always a design flaw.
qba73 has joined #ruby
<gray_-_wolf> dminuoso: sometimes on the library/gem part though
<nymous> see this?
mtkd has joined #ruby
<nymous> if i'll try to run this lib on 1.9.3 i get unknown method
<nymous> this is what i want to fix with less effort
<darix> nymous: probably the lib requires a newer ruby version
<nymous> own ruby package might work though
<nymous> omnibus or something
<darix> well depending on your platform ... your distro might also support newer versions
<darix> or there is a newer version of your OS which comes with a newer ruby version
<Ethan> nymous: that's a very old version of Ruby. What OS are you running?
<nymous> debian wheezy
<darix> is that even still supported?
<nymous> i think not
<Ethan> may I ask why you're running a 5 year old version of debian?
<nymous> i don't have time to upgrade 80 servers though
<Ethan> Wheezy LTS support ends May 31st
<Ethan> so if you care about the security of your servers, you'll want to reconsider.
<darix> "I will upgrade after I got hacked through a bug that would be fixed in a supported debian version"
<gray_-_wolf> so he's still good for 16 days ^_^
<darix> gray_-_wolf: 2.5months
<Ethan> TIME TRAVELLER!
<gray_-_wolf> f... May X March... my English sucks
terens has joined #ruby
<nymous> the problem is, these servers were supposed to be disabled in 2016, but real life is a little bit more complicated
<darix> nymous: so maybe use the next 2.5months to port your app to a newer ruby version and test the upgrade
<darix> nymous: if you leave them on, you also have to do the tasks that come with it. which includes updating :P
<nymous> my is already running on newer server with newer ruby
<darix> there is no free lunch
ltt has joined #ruby
hfp_work has quit [Quit: bye]
<Ethan> hey look the sysadmin I'd never want to work with
<nymous> but this bunch of old servers which i was unwilling to touch now need this script too
<gray_-_wolf> nymous: I think best solution here (assuming upgrading servers is not an option) is to make own ruby package; if possible it's probably better than monkeypatching it
<darix> Ethan: huh?
<darix> Ethan: I dont blame him
<darix> might be management problem
<nymous> my current setup runs latest debian stretch with ruby2.3
<nymous> so no problem here
<darix> nymous: which configuration management thing do you use?
<nymous> it's just a bunch of old servers which were supposed to be disposed 2 years ago, but in the middle of the process management said, stop, we are ok with that
hfp_work has joined #ruby
<nymous> so blame me or not, it's real life
<nymous> darix: puppet before, chef now
<darix> then you can automate the updating easily :P
za1b1tsu has quit [Quit: Leaving]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nymous> i can spend couple of days upgrading them and they would be disposed a week later
milardovich has joined #ruby
<nymous> idk
<nymous> jessie to stretch upgrading was relatively easy, but wheezy to jessie means porting sysv stuff to systemd etc
xuyuheng has quit [Ping timeout: 276 seconds]
<darix> nymous: or in 2 years you will be running the same servers
<nymous> yes, idk
milardovich has quit [Ping timeout: 245 seconds]
xuyuheng has joined #ruby
<nymous> the bad thing is that i'm using another networking virtualisation setup for my current servers, so i want them to be the same as the newer ones, i have to redone networking, which is pain and downtime
<nymous> *if i want
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duckpuppy has joined #ruby
ltt has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
<dminuoso> terens: Please make a habit to a) use a .rb file extension to enable syntax highlighting and b) fix your indentation issues. You are using mixed space and tabs.
<dminuoso> terens: Don't share your gist until you looked at your gist, and determined that is clean and easy to read.
<dminuoso> (Or perhaps its just some copy paste error - either way)
duckpuppy has quit [Ping timeout: 240 seconds]
phaul has joined #ruby
sidx64 has quit [Read error: Connection reset by peer]
ltt has quit [Client Quit]
sidx64 has joined #ruby
tockitj has joined #ruby
<tockitj> how to let drb instantiate new object on each client connection? So far I was able only to expose a class.
workmad3 has joined #ruby
jameser has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KeyJoo has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has joined #ruby
sidx64 has quit [Client Quit]
tvw has joined #ruby
guacamole has joined #ruby
guacamole has quit [Client Quit]
rikkipitt has quit [Quit: Leaving...]
jrafanie has joined #ruby
Burgestrand has joined #ruby
catphish has joined #ruby
pugcs has quit [Ping timeout: 260 seconds]
ltt has joined #ruby
<catphish> is the bundler gem dead? i see bundler in rubygems
_whitelogger_ has joined #ruby
kt2 has joined #ruby
n0m4d1c has quit [*.net *.split]
graft has quit [*.net *.split]
jordanm has quit [*.net *.split]
AgentVenom has quit [*.net *.split]
gray_-_wolf has quit [*.net *.split]
X-Jester has quit [*.net *.split]
iNs has quit [*.net *.split]
n13z has quit [*.net *.split]
jp has quit [*.net *.split]
segy has quit [*.net *.split]
kt has quit [*.net *.split]
psmolen has quit [*.net *.split]
noizex has quit [*.net *.split]
mlehrer has quit [*.net *.split]
CalimeroTeknik has quit [*.net *.split]
kloeri has quit [*.net *.split]
stairmast0r has quit [*.net *.split]
Bish has quit [*.net *.split]
shadeslayer has quit [*.net *.split]
sjums has quit [*.net *.split]
Drakevr has quit [*.net *.split]
izaac has quit [*.net *.split]
tycoon177 has quit [*.net *.split]
ptx0 has quit [*.net *.split]
hsiktas has quit [*.net *.split]
Yonk has quit [*.net *.split]
deimos has quit [*.net *.split]
koenrh has quit [*.net *.split]
mitsuhiko has quit [*.net *.split]
caw______ has quit [*.net *.split]
justache has quit [*.net *.split]
devyn has quit [*.net *.split]
pizzaops has quit [*.net *.split]
S007 has quit [*.net *.split]
levifig has quit [*.net *.split]
ozzloy has quit [*.net *.split]
cout has quit [*.net *.split]
cjohnson has quit [*.net *.split]
mnemon has quit [*.net *.split]
flips has quit [*.net *.split]
ccooke has quit [*.net *.split]
ljarvis has quit [*.net *.split]
flips_ is now known as flips
koenrh_ is now known as koenrh
jp| is now known as jp
CalimeroTeknik_ is now known as CalimeroTeknik
deimos_ is now known as deimos
pizzaops_ is now known as pizzaops
tycoon177_ is now known as tycoon177
mitsuhiko_ is now known as mitsuhiko
hsiktas_ is now known as hsiktas
justache_ is now known as justache
segy_ is now known as segy
jordanm has joined #ruby
WebDawg has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
octomancer has joined #ruby
_derpy has joined #ruby
cjohnson has joined #ruby
mikkel-_ has joined #ruby
mlehrer has joined #ruby
v0n has joined #ruby
Dark_Arc has quit [Ping timeout: 260 seconds]
AJA4350 has quit [Ping timeout: 260 seconds]
llua has quit [Ping timeout: 260 seconds]
dviola has quit [Ping timeout: 260 seconds]
Gnut has quit [Ping timeout: 260 seconds]
mozzarella has quit [Ping timeout: 260 seconds]
MarcWeber has quit [Ping timeout: 260 seconds]
mikkel- has quit [Ping timeout: 260 seconds]
knight_ has quit [Ping timeout: 260 seconds]
herbmillerjr has quit [Ping timeout: 260 seconds]
rwb has quit [Ping timeout: 260 seconds]
snapcase has quit [Ping timeout: 260 seconds]
ablackack_ has quit [Ping timeout: 260 seconds]
xsdg has quit [Ping timeout: 260 seconds]
nymous has quit [Ping timeout: 260 seconds]
foxxx0 has quit [Ping timeout: 260 seconds]
vdl has quit [Ping timeout: 260 seconds]
ericmathison has quit [Ping timeout: 260 seconds]
russt has quit [Ping timeout: 260 seconds]
Fraeon has quit [Ping timeout: 260 seconds]
DEac-_ has quit [Ping timeout: 260 seconds]
caw_______ has joined #ruby
Yonk_ has joined #ruby
mlehrer has joined #ruby
justache has joined #ruby
koenrh has joined #ruby
hsiktas has joined #ruby
Drakevr_ has joined #ruby
deimos has joined #ruby
pizzaops has joined #ruby
naquad has joined #ruby
`derpy has quit [Ping timeout: 260 seconds]
naquad has quit [Ping timeout: 260 seconds]
koenrh has quit [Changing host]
Yonk_ has quit [Changing host]
pizzaops has quit [Changing host]
justache has quit [Changing host]
caw_______ has quit [Changing host]
hsiktas has quit [Changing host]
deimos has quit [Changing host]
mlehrer has quit [Changing host]
AJA4351 is now known as AJA4350
mozzarel1 is now known as mozzarella
_whitelogger has quit [Remote host closed the connection]
rwb1 is now known as rwb
schneider has quit [Ping timeout: 276 seconds]
mnemon has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
mnemon is now known as Guest64122
za1b1tsu has joined #ruby
ramfjord has joined #ruby
tomphp has joined #ruby
naquad has quit [Ping timeout: 260 seconds]
naquad has joined #ruby
tomphp has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
qba73 has quit [Remote host closed the connection]
xorgnak has joined #ruby
qba73 has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pugcs has left #ruby [#ruby]
pugcs has joined #ruby
dr3w_ has joined #ruby
sidx64 has joined #ruby
pugcs has quit []
tomphp has joined #ruby
schneider has joined #ruby
pugcs has joined #ruby
duckpuppy has joined #ruby
Cavallari has joined #ruby
halbbalda has quit [Ping timeout: 240 seconds]
ltem_ has joined #ruby
qba73 has quit [Ping timeout: 264 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
WhereIsMySpoon has joined #ruby
<WhereIsMySpoon> Can someone help me how to use this library? https://github.com/jvoorhis/ruby-portaudio/blob/master/lib/portaudio.rb
halbbalda has joined #ruby
<WhereIsMySpoon> What do I need to require in order to use this PortAudio class
ldnunes has joined #ruby
duckpuppy has quit [Ping timeout: 248 seconds]
hlmjr has quit [Quit: Konversation terminated!]
herbmillerjr has joined #ruby
sidx64 has joined #ruby
<WhereIsMySpoon> He has an example at the bottom of the file but I dont understand how he’s using the PortAudio object
Ltem has quit [Ping timeout: 252 seconds]
qba73 has joined #ruby
roshanavand has quit [Quit: Leaving.]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John_Ivan has joined #ruby
<schneider> man, is there a way to use bundler to install gems from gemfile from a ruby script?
nachoman has quit []
raynold has quit [Quit: Connection closed for inactivity]
yokel has joined #ruby
milardovich has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
roshanavand has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
schneider has quit [Quit: WeeChat 2.0.1]
ltem_ is now known as Ltem
_nymous_ has joined #ruby
schneider has joined #ruby
<_nymous_> the bad thing about omnibus is that you need to rebuild package if you need more dependencies in one special case
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
guille-moe has quit [Ping timeout: 268 seconds]
shinnya has joined #ruby
<WhereIsMySpoon> Has anyone used google-cloud-speech here?
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<WhereIsMySpoon> Im trying desperately to find something that will capture microphone input so I can stream it into google cloud speech
<WhereIsMySpoon> The doc in the project isnt very useful
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
foxxx0_ is now known as foxxx0
<terens> WhereIsMySpoon, you need some system calls I guess
<WhereIsMySpoon> terens: any pointers?
<terens> dont know :(
<Burgestrand> WhereIsMySpoon what have you tried with to get the portaudio work?
<terens> in c it was relativly easy
IshMael_ has joined #ruby
dr3w_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<WhereIsMySpoon> Burgestrand: require ‘portaudio’ and require ‘ffi-portaudio'
<WhereIsMySpoon> neither work
<terens> too
<WhereIsMySpoon> yeah im trying to play with easy audio but i cant seem to get it to output to a file or to a stream
<WhereIsMySpoon> it just outputs straight back to speaker
oetjenj has joined #ruby
<terens> recording doesnt work?
<WhereIsMySpoon> recording works, i just cant work out how to make it record to a file/stream
<Burgestrand> WhereIsMySpoon so did you install ffi-portaudio before you tried it, or how'd you attempt to install the portaudio that you linked to?
<WhereIsMySpoon> rather than just record-playback
karapetyan has quit [Remote host closed the connection]
<WhereIsMySpoon> Burgestrand: I installed portaudio via brew
terens has quit [Quit: Leaving]
<Burgestrand> WhereIsMySpoon because ffi-portaudio and portaudio there are two different things
<Burgestrand> WhereIsMySpoon that's only the C library, not the ruby library that you showed us
<Burgestrand> (you need both)
<WhereIsMySpoon> right
<WhereIsMySpoon> ah, i think i installed the gem ffi-portaudio
<WhereIsMySpoon> not the ruby lib i linked
<WhereIsMySpoon> how do i install that ruby lib?..
<WhereIsMySpoon> or do I need to download the file and use it directly?
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
<Burgestrand> ffi-portaudio might be sufficient, easy_audio appears to use that too
<Burgestrand> … actually, maybe not.
<WhereIsMySpoon> easy_audio seems to be nicer
<Burgestrand> I did a bunch of audio driver work in ruby a while back, it was bad enough that I pretty much had to write my own…
<WhereIsMySpoon> if i could get it to output to file/stream
alfiemax has joined #ruby
<Burgestrand> Ah, yes, it does use ffi-portaudio, never mind!
anisha has quit [Quit: This computer has gone to sleep]
AndroUser has joined #ruby
<WhereIsMySpoon> Burgestrand: :) so I dont want portaudio ruby lib or ffi-portaudio
<WhereIsMySpoon> easy_audio will work?
<Burgestrand> Yeah, easy_audio also includes ffi-portaudio so you can drop down to the harder-to-use API if needed
<WhereIsMySpoon> Right, and can you help me understand how to record to a file/stream?
<WhereIsMySpoon> using easyaudio?
<Burgestrand> I'm trying to read it, but I'm not sure that easy_audio can output to anything other than a portaudio device (and I'm not familiar enough with portaudio to know if you can create a "file" device)
alfiemax has quit [Ping timeout: 240 seconds]
<Burgestrand> I'm fairly sure you'll get uncompressed PCM samples, what kind of input is your google speech thing expecting?
kapil___ has quit [Quit: Connection closed for inactivity]
<WhereIsMySpoon> uhhh
sidx64 has joined #ruby
alfiemax has joined #ruby
<Burgestrand> Maybe they can accept raw audio, there seems to be an encoding option in google speech thingy :)
<WhereIsMySpoon> Burgestrand: yes, it can
<WhereIsMySpoon> raw, flac, ogg
<WhereIsMySpoon> at least those
<WhereIsMySpoon> so whats a pcm sample?
<Burgestrand> Yeah, I'm not entirely sure `raw` is actually a format
<WhereIsMySpoon> linear16
<WhereIsMySpoon> is what it uses for RAW files
<Burgestrand> WhereIsMySpoon it's typically what speakers/microphones produce/consume, essentially a way to encode audio into digital format
<WhereIsMySpoon> in the examples at least
<Burgestrand> WhereIsMySpoon you can think of it as an array of numbers
<WhereIsMySpoon> ahh, is it an array of frequencies?
<WhereIsMySpoon> i have some experience with signals and audio, i did electronics at uni
<Burgestrand> Not quite, but you can analyze the frequencies using fourier transforms
<WhereIsMySpoon> bit hazy now :P
<WhereIsMySpoon> I see
<WhereIsMySpoon> and the numbers are the output of those transforms?
mtkd has quit [Ping timeout: 245 seconds]
<Burgestrand> WhereIsMySpoon so when you're dealing with raw PCM data, you typically need to know how many channels there are (i.e. 1 (mono), 2 (audio)) and the sample rate (i.e. 44.1kHz, playback speed) and the size of the samples (16bit?)
AndroUser has left #ruby ["退出消息"]
<WhereIsMySpoon> google cloud can only analyze 1 channel audio
AndroUser has joined #ruby
<Burgestrand> Maybe something more too, I might have forgotten…
<Burgestrand> Cool, so if your mic is giving you multiple channels we can probably just throw one away
<WhereIsMySpoon> it has inputs for sample rate
mtkd has joined #ruby
<WhereIsMySpoon> right, so how do I get easy_audio to output this raw data to a variable or file
<Burgestrand> … also important to know if the channels come interleaved or some other way
<Burgestrand> Not for google audio, but for when you're getting the data from the microphone
<Burgestrand> You can probably configure it to just give you a single channel, too :)
Psybur__ has joined #ruby
<Burgestrand> WhereIsMySpoon you do it yourself, you can pass a block to the EasyAudio::Stream.new, and that will get a buffer and a description of the contents of the buffer (sample rate, channels)
<WhereIsMySpoon> right so this: EasyAudio.easy_open(in: true, out: true, latency: 1.0) { current_sample } will do what? Output the mic input into current_sample?
<Burgestrand> WhereIsMySpoon keep in mind all of the audio stuff I'm explaining to you I've kind of taught myself through trial and error, there might be inconsistencies or gaps or straight out errors in what I say :)
<WhereIsMySpoon> better than what ive got :D
KeyJoo has quit [Ping timeout: 248 seconds]
<WhereIsMySpoon> this is all for a personal project so no biggie
<Burgestrand> Oh, wow, no I wouldn't use EasyStream
<Burgestrand> Well, depending on the hardware you're running on it might not be a problem
<WhereIsMySpoon> macbook air
<WhereIsMySpoon> i have gotten it to record and playback my voice already
<WhereIsMySpoon> just only ina direct input -> output
<WhereIsMySpoon> not storing the data
<Burgestrand> WhereIsMySpoon yeah, I think just use a regular stream with a block, so you get the samples chunked, that way you'll buffer the writes to file and it'll perform better :)
<Burgestrand> WhereIsMySpoon if I'm reading the source correctly, then if you return a symbol from the processing block it'll simply ignore whatever output device is configured
<Burgestrand> WhereIsMySpoon yeah I'm reading here: https://github.com/lsegal/easy_audio/blob/master/lib/easy_audio.rb hehe
<WhereIsMySpoon> Hum…Im probably being stupid
<WhereIsMySpoon> How do I use this? xD
<Burgestrand> Naw, this is some complex stuff, plus the code is old and documentation could be better :)
<WhereIsMySpoon> I dont mind complex
apeiros has quit []
<WhereIsMySpoon> As long as I can say stuff into my mic and I can throw it at google cloud speech :P
<Burgestrand> WhereIsMySpoon yeah, I'm playing a bit with the code at the moment, just writing up a basic project to see if I can get it to read my mic
<WhereIsMySpoon> ok :)
roshanavand has quit [Ping timeout: 256 seconds]
AndroUser is now known as edfk2012
konsolebox has quit [Ping timeout: 276 seconds]
<WhereIsMySpoon> im not sure theres a way of changing the output
<WhereIsMySpoon> i may need to download this file and integrate it with my project and change teh code
<WhereIsMySpoon> or just not use this project
<WhereIsMySpoon> and use something else
<Burgestrand> Appears that the released gem also doesn't contain the latest code
<WhereIsMySpoon> ah
<WhereIsMySpoon> device = API.Pa_GetDefaultOutputDevice
<WhereIsMySpoon> this needs changing somehow
Psybur__ is now known as Psybur
Psybur has quit [Changing host]
Psybur has joined #ruby
<WhereIsMySpoon> brb getting lunch
<WhereIsMySpoon> thank you so far :)
konsolebox has joined #ruby
WhereIsMySpoon has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
edfk2012 has quit [Remote host closed the connection]
ldnunes has joined #ruby
duckpuppy has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.0.1]
KeyJoo has joined #ruby
karapetyan has quit [Remote host closed the connection]
nadir has quit [Quit: Connection closed for inactivity]
edfk2012 has joined #ruby
kapil___ has joined #ruby
edfk2012 has left #ruby [#ruby]
edfk2012 has joined #ruby
leitz has joined #ruby
<CalimeroTeknik> (how) could I avoid using rescue in this getter? http://ix.io/Xot
<dminuoso> CalimeroTeknik: What exception are you trying to protect against?
_nymous_ has quit [Ping timeout: 264 seconds]
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> CalimeroTeknik: And what's the shape (sighs...) of @seen
<CalimeroTeknik> yes sorry, I should have provided an example: { 'foo' => {:nick => 'max'}, 'bar' => {:nick => 'axel'} }.find{|user, data| data[:nick] == 'baz' }.last
<CalimeroTeknik> with this snippet it's easier to try it out
<CalimeroTeknik> try replacing 'baz' with 'max' to see the expected result for when it does find it
duckpuppy has quit [Ping timeout: 260 seconds]
edfk2012 has quit [Remote host closed the connection]
<CalimeroTeknik> expectably the exception is NoMethodError, essentially the result of nil.last
edfk2012 has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rfoust has joined #ruby
<dminuoso> CalimeroTeknik: Let's say I forbid you to use rescue, what would you have to do?
ltd has joined #ruby
<CalimeroTeknik> find a monadic version of last
<dminuoso> Curious. What do you mean by monadic version of last?
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<CalimeroTeknik> a version of last that does not evaluate if not fed a value
memo1 has joined #ruby
<dminuoso> CalimeroTeknik: Alright cool. So you kind of misused monadic there. :-)
John_Ivan has quit [Ping timeout: 245 seconds]
<dminuoso> Although incidentally there is a monad you can tap into, but "monadic" is something far more general
<CalimeroTeknik> yes, because it's a weird stretch to consider 'nil' as a way to represent Maybe
<dminuoso> CalimeroTeknik: Yes! As it so happens, there is a monadic interface.
<dminuoso> CalimeroTeknik: &. is the equivalent of >>=
sidx64 has joined #ruby
edfk2012 has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
sidx64 has quit [Client Quit]
jeffreylevesque has joined #ruby
<CalimeroTeknik> oh, nice. as expected of ruby, the trick always exists
<dminuoso> CalimeroTeknik: I personally like to think of Ruby values as _all_ being Maybe wrapped.
<dminuoso> Since generally any method could somehow produce a nil back.
<CalimeroTeknik> indeed
nowhere_man has joined #ruby
<dminuoso> CalimeroTeknik: However, in a different perspective, your previous code does the same thing.
<dminuoso> Maybe models exceptions.
<dminuoso> If you think about it, the Maybe monad represents a failable computation, that once a failure occurs propagates the failure until someone cares about it. All the computation in between is shortcircuited.
<dminuoso> That is just an exception.
<CalimeroTeknik> admittedly, the point is to not use the rescue structure; I wanted the same semantics, but in the form of an expression
<dminuoso> CalimeroTeknik: Just for giggles, Array#flat_map is >>= for Array =)
<dminuoso> CalimeroTeknik: It may possibly be cleaner to do this
nowhereman_ has quit [Ping timeout: 264 seconds]
<dminuoso> >> { 'foo' => {:nick => 'max'}, 'bar' => {:nick => 'axel'} }.values.find { |e| e[:nick] = 'max' }
rwb has quit [Ping timeout: 256 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
cdg has joined #ruby
Strepsils has joined #ruby
sidx64 has joined #ruby
<CalimeroTeknik> oh, avoiding the call to last and the extra param indeed
<CalimeroTeknik> maybe you need == instead of =? isn't that mutating the value?
<dminuoso> CalimeroTeknik: Sorry yes.
<dminuoso> What can I say: Just proving a point that type systems are invaluable.
<CalimeroTeknik> curiously enough your version works
<CalimeroTeknik> I have yet to figure out what is going on there
oetjenj has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
<CalimeroTeknik> okay, first element…
<CalimeroTeknik> well, "first" is a coincidence, a hash has no order per se
<CalimeroTeknik> .values creates a brand new datastructure it seems
<CalimeroTeknik> uh no sorry, it clearly doesn't
<CalimeroTeknik> it's shallow
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has quit [Changing host]
<WhereIsMySpoon> Burgestrand: back :)
<Burgestrand> WhereIsMySpoon I got it to work!
<WhereIsMySpoon> :D
<WhereIsMySpoon> how how
<Burgestrand> WhereIsMySpoon the computer understands me!
<WhereIsMySpoon> hehehe
<Burgestrand> WhereIsMySpoon so, yeah, use EasyAudio::Stream.new(format) { |buffer| *code* } for one, the block will be called every N samples
<dminuoso> CalimeroTeknik: Hashes maintain insertion order.
<dminuoso> CalimeroTeknik: So they are not completely unordered.
ramfjord has joined #ruby
<Burgestrand> WhereIsMySpoon you can read the samples from the `buffer` (which is essentially a struct with some data), the samples you're after are inside `buffer.samples`, which is an array of floats
<Burgestrand> WhereIsMySpoon now, GCS expects 1-channel 16-bit little endian integer PCM data, so unfortunately we can't just pack the array of floats into a string and then save it, we need to convert it a little bit
<WhereIsMySpoon> sorry im a bit lost, where does buffer come from and how do i use it
<Burgestrand> WhereIsMySpoon EasyAudio::Stream.new(format) { |buffer| *code* } <- there is the buffer
<WhereIsMySpoon> right
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<WhereIsMySpoon> im still lost :P
<Burgestrand> WhereIsMySpoon where?
<WhereIsMySpoon> what is format supposed to be and what do i do with buffer
<Burgestrand> WhereIsMySpoon what format you want depends a bit, I just set it to the default, but made sure to specify that the number of input channels is 1 (most important)
ramfjord has quit [Ping timeout: 256 seconds]
<dminuoso> CalimeroTeknik: Oh and the regular usage of `.` equals to fromJust by the way - blowing up when nil comes along (kind of)
<WhereIsMySpoon> ok, so EasyAudio::Stream.new(in_chans: 1)
qba73 has quit [Ping timeout: 265 seconds]
<WhereIsMySpoon> and then what do i do with buffer
<dminuoso> (Also in a weird way)
qba73 has joined #ruby
<Burgestrand> WhereIsMySpoon buffer.samples is an array of floats, that's where the audio data is, so that's the thing that you need to save before the block returns
<WhereIsMySpoon> EasyAudio::Stream.new(in_chans: 1) { |buffer| a.push(buffer) }.start gives me an invalid memory address error
<WhereIsMySpoon> i made a an empty array
<WhereIsMySpoon> ah, right, all i want to do is store buffer.samples in a
<WhereIsMySpoon> not push it to a
<WhereIsMySpoon> but still, i get invalid memory error
<WhereIsMySpoon> paNoError
<WhereIsMySpoon> irb(main):053:0> invalid memory write at address=0x00000000000000
<Burgestrand> WhereIsMySpoon ah yes, make sure your block returns :paContinue
<WhereIsMySpoon> er…
<WhereIsMySpoon> irb(main):055:0> EasyAudio::Stream.new(in_chans: 1) { |buffer| a = buffer.samples; :paContinue }.start ?
<WhereIsMySpoon> oh wait itll be a variable on easyaudio somewhere
<WhereIsMySpoon> right?
psychicist__ has joined #ruby
<Burgestrand> WhereIsMySpoon if you return a symbol inside the block, EasyAudio will assume that's the return value of the entire audio processing callback, and will not send it to the speakers
<Burgestrand> WhereIsMySpoon so yeah, just make :paContinue the last line of the block
leitz has quit [Quit: Nappy time]
<WhereIsMySpoon> hm...nope
ltt has joined #ruby
<WhereIsMySpoon> that isnt working
<WhereIsMySpoon> ive required ffi-portaudio in my irb
<WhereIsMySpoon> and easy_audio ofc
am55 has joined #ruby
<WhereIsMySpoon> irb(main):004:0> EasyAudio::Stream.new(in_chans: 1) { |buffer| a = buffer.samples; :paContinue }.start
<WhereIsMySpoon> => :paNoError
<WhereIsMySpoon> irb(main):005:0> invalid memory write at address=0x00000000000000
<Burgestrand> Ah. Indeed, I'm using the easy_audio from github, not the release from rubygems, because the one in rubygems doesn't allow _not_ echoing to the speakers again :(
<WhereIsMySpoon> ahh
<WhereIsMySpoon> Burgestrand: I can grab the source, how do I put it in my project so I can just require it like i would a normal gem
<Burgestrand> WhereIsMySpoon are you using bundler for your project?
sidx64 has joined #ruby
<WhereIsMySpoon> i have bundler installed
<WhereIsMySpoon> i certianly can use it
<WhereIsMySpoon> ive used it before, but only for simple bundle install/bundle exec stuff
<Burgestrand> WhereIsMySpoon as long as you're not making a gem of this we're all good :)
<WhereIsMySpoon> nope
<WhereIsMySpoon> i wont be :)
<Burgestrand> WhereIsMySpoon call `bundle init` and then open the `Gemfile` that's created, and then you need to insert the name of all gems you'll be using in there
<WhereIsMySpoon> ive got a gemfile
<Burgestrand> WhereIsMySpoon for specifically easy_audio, you can insert: `gem "easy_audio", github: "lsegal/easy_audio"`
shinnya has quit [Ping timeout: 265 seconds]
<WhereIsMySpoon> oh!
<Burgestrand> WhereIsMySpoon … and then bundle install :) when you run your project make sure you use either `bundle exec` or you `require "bundler/setup"` somewhere in your code
<Burgestrand> WhereIsMySpoon all of this can be read about in http://bundler.io
<WhereIsMySpoon> how do I require easy_audio in irb now? :P
Ltem has quit [Quit: bye]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Burgestrand> WhereIsMySpoon same as before, just make sure you either launch IRB with bundler or require "bundle/setup" once you're in IRB
<WhereIsMySpoon> ah i need to..yeah
<WhereIsMySpoon> got it
duckpuppy has joined #ruby
<WhereIsMySpoon> >_>
<WhereIsMySpoon> i crashed irb
<WhereIsMySpoon> EasyAudio::Stream.new(in_chans: 1) { |buffer| a = buffer.samples; :paContinue }.start seems to block
<WhereIsMySpoon> and ctrl-c doesnt stop it
rafik has joined #ruby
sidx64 has joined #ruby
<Burgestrand> I've had it deadlock on me a few times too
<Burgestrand> It's not consistent
<WhereIsMySpoon> ah, pushing buffer.samples to a as an array seems to work
karapetyan has joined #ruby
rwb has joined #ruby
<WhereIsMySpoon> Burgestrand: right, I have a very large 2d array
<WhereIsMySpoon> im not sure what it contains
<WhereIsMySpoon> loads of numbers
<WhereIsMySpoon> what do i do with it now :)
<Burgestrand> WhereIsMySpoon hehe, buffer.samples is an array, so it's probably an Nx256 (i.e. each element is an array of 256 decimal numbers)
Guest94022 is now known as S007
S007 has quit [Changing host]
S007 has joined #ruby
<WhereIsMySpoon> right
<Burgestrand> WhereIsMySpoon I'm fairly sure that each float you have there is an amplitude value for each sample, between -1 and +1, does that look about right?
jamied has joined #ruby
<Burgestrand> WhereIsMySpoon (a float is a decimal number)
<WhereIsMySpoon> im aware what a float is :) yes i think so
duckpuppy has quit [Ping timeout: 240 seconds]
karapetyan has quit [Ping timeout: 260 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
<Burgestrand> WhereIsMySpoon yeah, alright, so I think GCS only accepts integer format audio, so you need to convert each -1 to +1 float into a -32768 to 32767 (i.e. minimum and maximum value of a 16-bit integer)
<WhereIsMySpoon> i suppose this involves bit shifting
<WhereIsMySpoon> or are there built in ruby tools for this :D
<Burgestrand> Well, maybe it could, but we're doing audio processing in ruby so we've already abandoned most of the efficiency requirements anyway :)
<WhereIsMySpoon> :D
<Burgestrand> (i.e. traditionally you don't want to allocate memory inside the audio processing callback, we're kind of screwed since we're using a ruby block as the callback)
<Burgestrand> WhereIsMySpoon so, well, easiest conversion is something like this: int16_sample = (float_sample * 32768).to_i
Dimik has joined #ruby
am55 has quit [Quit: am55]
tomphp has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SteenJobs has joined #ruby
tomphp has quit [Client Quit]
<Burgestrand> WhereIsMySpoon and once you've done that, there's only one step left, and that's converting the samples into a string of bytes, which you can do using Array#pack
<Burgestrand> WhereIsMySpoon I read that GCS wants 16-bit signed little-endian integers, so it'd look something like this:
xuyuheng has quit [Quit: Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Burgestrand> >> audio_data = [32767, 32767, 32767, 32767].pack("s<")
* Burgestrand kicks ruby[bot]
cschneid has joined #ruby
dr3w_ has joined #ruby
IshMael_ has quit [Ping timeout: 264 seconds]
<WhereIsMySpoon> oh god
<WhereIsMySpoon> how do i stop irb outputting this huge array each time xD
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Burgestrand> I'm not sure what you're doing to make it do that in the first place :)
nfsnobody has quit [Ping timeout: 248 seconds]
<WhereIsMySpoon> well i did a.each do |arr|; arr.each do | el | el = (el*32768).to_i; end; end
<Burgestrand> Oh, sorry, format should be "s<*" (or probably "s<256")
<WhereIsMySpoon> which actually doesnt seem to have done anything
<WhereIsMySpoon> hum
guille-moe has joined #ruby
<Burgestrand> WhereIsMySpoon yeah, look into Array#map
ryandv has joined #ruby
<Burgestrand> >> [1, 2, 3, 4, 5].map { |x| x * 2 }
<Burgestrand> … ruby[bot] wake up :(
<WhereIsMySpoon> :D
nfsnobody has joined #ruby
<WhereIsMySpoon> Burgestrand: 32767 or 32768 for the multiplier :P
<WhereIsMySpoon> 7 right?
<Burgestrand> WhereIsMySpoon minimum value should be -32768 but maximum value should be 32767
<WhereIsMySpoon> right, so its (el*32767).to_i
synthroid has joined #ruby
<Burgestrand> WhereIsMySpoon nay, 32768 (i.e. 2^16 / 2), but add a check to make sure you don't go out of bounds
cschneid has quit [Ping timeout: 264 seconds]
<Burgestrand> WhereIsMySpoon i.e. if it's above 32768 then set it to 32768, and vice versa for negative
Rapture has joined #ruby
<WhereIsMySpoon> im confused. so I need to do el = (el*32768).to_i; then do that check?
<Burgestrand> Oh, sorry, 32767 is upper limit, not 32768 :)
<WhereIsMySpoon> right
<WhereIsMySpoon> thats what i thoguht :P
<Burgestrand> Indeed, do it first and then constraint the result just to be sure
am55 has joined #ruby
<WhereIsMySpoon> ok
<WhereIsMySpoon> i think that worked
netherwolfe has joined #ruby
<WhereIsMySpoon> at least i have a 2d array of integers
<WhereIsMySpoon> ah now to pack it
<Burgestrand> WhereIsMySpoon aye indeed
<WhereIsMySpoon> its packed
<Burgestrand> WhereIsMySpoon if you still have an array like so: [[…], […], […]] you'll need to pack each one and then concatenate
<WhereIsMySpoon> yep
<WhereIsMySpoon> did that
<Burgestrand> +1
<Burgestrand> That should be all
<WhereIsMySpoon> b = b.map! { |arr| arr = arr.pack("s<256")}
<Burgestrand> You have the raw data for your file
<WhereIsMySpoon> i didnt need to do b = but whatever :P
<WhereIsMySpoon> ok
<Burgestrand> Either save it, or if you're using the GCS API then you can wrap it in a stringIO right away: audio = speech.audio StringIO.new(audio_data), encoding: :linear16, sample_rate: 44100, language: "?"
<Burgestrand> WhereIsMySpoon oh, keep in mind that the result of map! is now just an array of strings, but you can create a single string from them easily with `output_data = output_data.join`
jamied has quit [Quit: Textual IRC Client: www.textualapp.com]
dr3w_ has quit [Quit: Textual IRC Client: www.textualapp.com]
SteenJobs has quit [Quit: SteenJobs]
<WhereIsMySpoon> sigh
<WhereIsMySpoon> i wrote it to a file after joining and it has a load of newlines
<Burgestrand> It's not impossible that the audio actually converts to a newline character
<Burgestrand> … although it probably not be regular :)
<WhereIsMySpoon> \x01A\x01d\x01^\x01_\
<WhereIsMySpoon> does this look legit?
<WhereIsMySpoon> whats all the ^ and _
<WhereIsMySpoon> x8D\xFE(\xFF\xB5\
<WhereIsMySpoon> ( too
llua` is now known as llua
llua has quit [Changing host]
llua has joined #ruby
<Burgestrand> Yeah, the data when printed in Ruby is likely to look as such
<WhereIsMySpoon> i see
<Burgestrand> Actual data from my mic: \xC8\xFC\r\xFD\x91
<WhereIsMySpoon> i can understand the hex
<WhereIsMySpoon> just not the weird ^ _ and (
<WhereIsMySpoon> “ is there sometimes
<Burgestrand> Yeah, well, ruby tries its best to print the characters
<WhereIsMySpoon> }
<WhereIsMySpoon> :D
terens has joined #ruby
<Burgestrand> (if you inspect the data, that is)
<Burgestrand> However, your file shouldn't actually have the \x everywhere
Strepsils has quit [Read error: Connection reset by peer]
<WhereIsMySpoon> no it doesnt
<Burgestrand> Good :)
<WhereIsMySpoon> it has 0000 001c 6674 etc
<Burgestrand> So yeah, actual data from my end too: -\"\x1E\xA9,\xC11\x01$W!
jeffreylevesque has quit [Ping timeout: 248 seconds]
SteenJobs has joined #ruby
imode has joined #ruby
catphish has left #ruby ["Leaving"]
ramfjord has joined #ruby
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
kn-928 has joined #ruby
oetjenj has joined #ruby
kn-928_ has joined #ruby
nachoman has joined #ruby
<Burgestrand> WhereIsMySpoon you managed to get it to work yet? :)
<WhereIsMySpoon> almost
<WhereIsMySpoon> fighting google cloud
<Burgestrand> Ah yeah… the credentials stuff?
<WhereIsMySpoon> i had it working before im just trying to remember the variable names to pass in :P
kn-928 has quit [Ping timeout: 264 seconds]
<WhereIsMySpoon> right
<WhereIsMySpoon> i think i need to find a way to record more than just this non existant data
<WhereIsMySpoon> because doing the EasyAudio::Stream.new(in_chans: 1) { |buffer| a = buffer.samples; :paContinue } doesnt gather much
tomphp has joined #ruby
<Burgestrand> WhereIsMySpoon I thought you were appending to a, not assigning a?
<Burgestrand> WhereIsMySpoon i.e. a.push(buffer.samples)?
<WhereIsMySpoon> i am sorry
<WhereIsMySpoon> let me get what ive done in a gist
nachoman has quit []
tomphp has quit [Client Quit]
cschneid has joined #ruby
nachoman has joined #ruby
<WhereIsMySpoon> i think i did something weird with the array last time to get such a huge one, this time its a small 1d array
<Burgestrand> WhereIsMySpoon the code you have there should be an array of arrays, i.e. [[…], […], […]], but then your map treats it as an array of floats
<WhereIsMySpoon> it is a 1d array
<Burgestrand> WhereIsMySpoon you also never start the stream; not sure if that's needed to be frank though :)
<WhereIsMySpoon> Burgestrand: ive updated it
<WhereIsMySpoon> with outputs too
oleo has joined #ruby
<Burgestrand> WhereIsMySpoon if I run your code it throws an error in the map, so something sounds off
conta has quit [Quit: conta]
<WhereIsMySpoon> thats weird
<WhereIsMySpoon> this time its a 2d array
rikkipitt has joined #ruby
<WhereIsMySpoon> wtf
duckpuppy has joined #ruby
tomphp has joined #ruby
conta has joined #ruby
terens has quit [Ping timeout: 240 seconds]
conta has quit [Client Quit]
<WhereIsMySpoon> one moment :P
conta has joined #ruby
lele` has quit [Ping timeout: 256 seconds]
v0n is now known as vdl
alfiemax has quit [Remote host closed the connection]
rwb has quit [Ping timeout: 260 seconds]
duckpuppy has quit [Ping timeout: 240 seconds]
memo1 has quit [Quit: WeeChat 1.4]
memo1 has joined #ruby
roshanavand has quit [Quit: Leaving.]
roshanavand has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<WhereIsMySpoon> right
Cavallari has quit [Quit: Cavallari]
milardovich has joined #ruby
laekur has quit [Quit: Leaving]
sldetracking has joined #ruby
tomphp has joined #ruby
<WhereIsMySpoon> this gives me an empty array from the recognize, which is probably correct since i probably didnt record anything
<Burgestrand> WhereIsMySpoon 32767 should be 32768
<WhereIsMySpoon> wut
<WhereIsMySpoon> i thought you said upper was 32767
<Burgestrand> WhereIsMySpoon yeah, but lower is -32768
<WhereIsMySpoon> oh xD
qba73 has quit [Remote host closed the connection]
<Burgestrand> WhereIsMySpoon probably no biggie, but it shifts the amplitude (?) of the recording
<WhereIsMySpoon> right, so how do i record more
qba73 has joined #ruby
karapetyan has joined #ruby
Puffball has joined #ruby
<Burgestrand> WhereIsMySpoon don't start and then close right away, put a sleep in there for a few seconds perhaps?
<WhereIsMySpoon> start doesnt block
<Burgestrand> Which is exactly the problem :)
<WhereIsMySpoon> and im copy-pasting these commands
<WhereIsMySpoon> hm
<Burgestrand> If you start and then close you'll only be recording inbetween, which means for a miniscule amount of time
<WhereIsMySpoon> so if i just run stream.start, speak to my mic, then close, i should get something?
rikkipitt has quit [Remote host closed the connection]
<Burgestrand> WhereIsMySpoon so I'd suggest something akin to stream.start; sleep 5; stream.close
<Burgestrand> WhereIsMySpoon and then you have five seconds to speak to your computer, I don't know about you but I got some weird looks here in the office
<WhereIsMySpoon> XD
<WhereIsMySpoon> im on a hack day
milardovich has quit [Ping timeout: 240 seconds]
tomphp has quit [Client Quit]
<WhereIsMySpoon> Burgestrand: irb(main):013:0> a.map { |arr| arr.map { |el| if (el < -32768) { el = -32768} elsif (el > 32767) { el = 32767} } }
<WhereIsMySpoon> is this correct?
<WhereIsMySpoon> for correction
<Burgestrand> WhereIsMySpoon yup, should be alright!
<Burgestrand> WhereIsMySpoon oh, keep in mind, your assignment `el = ` does nothing, `map` only cares about the return value of the block
karapetyan has quit [Ping timeout: 265 seconds]
<WhereIsMySpoon> ah
<WhereIsMySpoon> so i just need -32768 for that
<WhereIsMySpoon> and 32767 for the other
<WhereIsMySpoon> a.map { |arr| arr.map { |el| if (el < -32768) { -32768} elsif (el > 32767) { 32767} } }
<Burgestrand> aye, and then you need to branch for if it's neither of those (i.e. return el)
rwb has joined #ruby
<WhereIsMySpoon> ok
<Burgestrand> otherwise you'll return nil when the value is already OK :)
c_nick has joined #ruby
jrafanie has joined #ruby
<WhereIsMySpoon> something is wrong in this
<WhereIsMySpoon> b.map { |arr| arr.map { |el| if (el < -32768) { -32768} elsif (el > 32767) { 32767} else {el} } }
<WhereIsMySpoon> i copied a into b just in case i fucked it up :P
tomphp has joined #ruby
<WhereIsMySpoon> irb seems to think im still inside one level of block
<Burgestrand> WhereIsMySpoon yeah, well, ruby does not do curly braces for if-statements
<WhereIsMySpoon> oh
<WhereIsMySpoon> oops :D
Puffball has quit [Remote host closed the connection]
<Burgestrand> WhereIsMySpoon (and they end with… well, `end` ;))
jobewan has joined #ruby
pastorinni has joined #ruby
IshMael_ has joined #ruby
rabajaj has joined #ruby
rabajaj has quit [Read error: Connection reset by peer]
rahul_bajaj has joined #ruby
<c_nick> The user interface for my web app is done using Slim in which i am creating a row (td) and dumping the data from a config file in it. Now I want to color the content dynamically
<Burgestrand> c_nick could you elaborate on `dynamically`?
suukim has quit [Quit: Konversation terminated!]
rikkipitt has joined #ruby
<c_nick> lets say i have a config file - data.yaml which has contents text="This is a sample text" and in my data.slim i am doing td = "#{@yaml.text}"
<WhereIsMySpoon> Burgestrand: :D:D
<WhereIsMySpoon> it worked
<Burgestrand> WhereIsMySpoon nice, well done!
<WhereIsMySpoon> no, well done you :D
<Burgestrand> WhereIsMySpoon here's my code for the same thing: https://gist.github.com/Burgestrand/b2310cb4ca05455acdbbe8be8598bb8f
sammi` has quit [Quit: Lost terminal]
<Burgestrand> WhereIsMySpoon didn't want to post it until you got it working yourself :)
<c_nick> Burgestrand, Now in my yaml file i want to do something like text = "sample data" <but hey! this should be in red> something like that
<WhereIsMySpoon> Burgestrand: whats this frame size?
<Burgestrand> WhereIsMySpoon I believe it's how many samples portaudio buffers up before calling the callback
<elomatreb> c_nick: You mean syntax highlighting?
<Burgestrand> WhereIsMySpoon the frame size tells you how long the buffer.samples array is
<WhereIsMySpoon> i see
hanmac has quit [Ping timeout: 240 seconds]
<Burgestrand> WhereIsMySpoon default value is 256, but I used it in the pack-format so I figured I'd specify it explicitly :)
<c_nick> elomatreb, yeah a protocol .. so that in user.slim i can understand and color it while in configuration file i define it
rwb has quit [Ping timeout: 265 seconds]
<WhereIsMySpoon> fair :)
pugcs has quit [Ping timeout: 240 seconds]
<WhereIsMySpoon> cheers man, you’re the best
<WhereIsMySpoon> :D
<Burgestrand> WhereIsMySpoon it was fun!
<elomatreb> c_nick: It sounds like you want a syntax highlighter, possibly with your own color theme. There are quite a few options, both server-side and client-side
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<c_nick> server side for me .. i want to communicate from yaml to my web app to color the text
<WhereIsMySpoon> Burgestrand: definitely :D
jeffreylevesque has joined #ruby
rahul_bajaj has quit [Quit: Leaving]
headius has left #ruby [#ruby]
rwb has joined #ruby
<dminuoso> 16:12 Burgestrand | WhereIsMySpoon yeah, well, ruby does not do curly braces for if-statements
<dminuoso> Haha. I could have sworn it did.
<c_nick> elomatreb, i guess this will work for me text {#formatting option}
<dminuoso> But it's kind of hard to remember in which special cases ruby requires {} and where it disallows them.
<c_nick> and in my web server i will try to search if there is any {} and dump the contents in a span style
<Burgestrand> >> if_statement = -> (bool, &block) { block.call if bool }
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
<dminuoso> 😂
<Burgestrand> Problem solved! dminuoso
tomphp has joined #ruby
<elomatreb> How would you do the else though
llua has joined #ruby
<c_nick> dminuoso, its a string so i will do string manipulation so no issues in ruby
<Burgestrand> if_statement(false) { puts "No!" } || begin puts "Why?" end
<dminuoso> elomatreb: -> (if_, then_, else_) { return then_ if if_; return else_ }.curry
<dminuoso> So clear.
<elomatreb> You could monkey patch the returned object to have a .else method (and other terrible ideas)
ptx0_ is now known as ptx0
<elomatreb> Truly poetic code
* c_nick off to code
marr has quit [Ping timeout: 268 seconds]
alfiemax has joined #ruby
terens has joined #ruby
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
c_nick has quit [Quit: ciaos]
alfiemax has quit [Read error: Connection reset by peer]
lele has joined #ruby
SteenJobs has quit [Quit: peaceee]
alfiemax has joined #ruby
za1b1tsu has quit [Quit: Leaving]
mikecmpb_ has joined #ruby
hanmac has joined #ruby
ycyclist has joined #ruby
<ycyclist> Did there used to be a splice method in strings or arrays?
<Burgestrand> Not AFAIK
<Burgestrand> There is an equivalent though
mikecmpbll has quit [Ping timeout: 264 seconds]
<elomatreb> What do you expect it to do?
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
<Burgestrand> But it requires mutation, I'm quite sure
<WhereIsMySpoon> Burgestrand: is there a bit shifting equivalent of el = (el * 32768).to_i
<WhereIsMySpoon> just out of curiosity
<Burgestrand> >> string = "Hello"; string[2, 0] = " spliced! "; p string
<Burgestrand> WhereIsMySpoon I don't think so, but I can't really say with an acceptable degree of confidence
<WhereIsMySpoon> hokay
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has joined #ruby
schneider has quit [Read error: Connection reset by peer]
schneider has joined #ruby
reber has joined #ruby
riotjoe has joined #ruby
tomphp has joined #ruby
leitz has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
riotjones has quit [Ping timeout: 264 seconds]
alfiemax has quit []
desperek has joined #ruby
<leitz> The other day someone said Ruby wasn't under a dictatorship anymore. Did I miss the memo?
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
tomphp has quit [Client Quit]
alfiemax has joined #ruby
karapetyan has joined #ruby
duckpuppy has joined #ruby
karapetyan has quit [Ping timeout: 252 seconds]
Strepsils has joined #ruby
riotjoe has quit [Remote host closed the connection]
riotjones has joined #ruby
<WhereIsMySpoon> Burgestrand: I guess the next thing to do now would be instead of stream.start and stream.stop, to just have it listening all the time and have it clear and analyze the output whenever the amplitude is above a certain number
<WhereIsMySpoon> Burgestrand: those numbers from -1 to 1 that I get iniitally, what are those again
psychicist__ has quit [Quit: Lost terminal]
<Burgestrand> WhereIsMySpoon I _believe_ that's amplitude
tomphp has joined #ruby
<WhereIsMySpoon> right
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
c_nick has joined #ruby
<Burgestrand> WhereIsMySpoon i.e. you can graph it over time and you'd get the waveform
roshanavand has quit [Ping timeout: 240 seconds]
<Burgestrand> WhereIsMySpoon which is why you need to use an FFT to get the frequency
<c_nick> hi again , name {color:red} how to extract just color:red from this text
<Burgestrand> s/frequency/frequencies
duckpuppy has quit [Ping timeout: 240 seconds]
<WhereIsMySpoon> Burgestrand: I see
<c_nick> \{\.*\} still gives the \{ \}
<WhereIsMySpoon> Burgestrand: and the el * 32768 .to_i and then bounding it is that fft?
<Burgestrand> WhereIsMySpoon no :)
<WhereIsMySpoon> :D
eckhardt_ has joined #ruby
deathwishdave has joined #ruby
<Burgestrand> WhereIsMySpoon that's converting float PCM data into int16 PCM data
<WhereIsMySpoon> ok
<Burgestrand> WhereIsMySpoon you're aware of that sound is essentially a bunch of different sine waves played on top of each other?
<WhereIsMySpoon> yes
roshanavand has joined #ruby
<Burgestrand> WhereIsMySpoon FFT is a mathy thing to extract the individual sine waves from the combined one
<WhereIsMySpoon> ah right
<WhereIsMySpoon> so if i have the amplitude
<Burgestrand> (or, well, FT => fourier transform, the extra F is because it's FAST!)
<WhereIsMySpoon> im reading that dB = 20 * log10(amplitude)
cagomez has joined #ruby
llua has joined #ruby
<Burgestrand> WhereIsMySpoon unfortunately I can't help you in figuring out the amplitude from the raw data, that's a little bit outside of what I've done before plus I'm leaving in like 3 minutes :)
<WhereIsMySpoon> :D
<WhereIsMySpoon> ok man, you’ve helped enough anyway
chouhoulis has quit []
<Burgestrand> Good luck!
n0m4d1c_ has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 240 seconds]
terens has quit [Ping timeout: 240 seconds]
synthroid has quit [Remote host closed the connection]
jeffreylevesque_ has joined #ruby
<leitz> c_nick, I'm not a great rubyist, but I'd get the index of the colon and the index of the closing brace, and then: mystring[colon + 1 .. closing_brace -1 ]
Strepsils has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
<leitz> There are probably better ways, though. That would expand if you had other needs.
marxarelli|afk is now known as marxarelli
<c_nick> leitz, yes thats a good one .. i am somehow hell bent on regex .. its like drugs
<c_nick> cooked up something like data.scan(/\{(.*)\}/).flatten.first
jeffreylevesque has quit [Ping timeout: 240 seconds]
<leitz> In a python book I read "First you start with a problem. You try to solve it with a regex. Now you have two probelms." :)
<c_nick> as scan gives u an array of all the groups in arrays and flatten will knock off the first array and first will get the value within
<c_nick> :-P
mikecmpb_ has quit [Quit: inabit. zz.]
<c_nick> leitz, but its super cool
<c_nick> unless u reach level 2
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
mikecmpbll has joined #ruby
llua has joined #ruby
jeffreylevesque_ has quit [Ping timeout: 240 seconds]
rippa has joined #ruby
<c_nick> leitz, /\{(.*)\}/.match(data)[1] seems better option
tolerablyjake has joined #ruby
<c_nick> no need of the beef
<WhereIsMySpoon> can I ask, what does array.pack(“s<256”) actually -mean-? I can see that s< means 16 bit little endian, but what does the 256 do
<leitz> I have a limited number of brain cells and keep things simple. :)
Burgestrand has quit [Quit: Closing time!]
synthroid has joined #ruby
aufi has quit [Quit: Leaving]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Zaab1t has joined #ruby
<WhereIsMySpoon> nvm, got it
jcarl43 has joined #ruby
<c_nick> thanks leitz :-)
c_nick has left #ruby ["Ex-Chat"]
oz has quit [Quit: EOF]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
roshanavand1 has joined #ruby
oz has joined #ruby
jrm2 has joined #ruby
jrm has quit [Ping timeout: 246 seconds]
jrm2 is now known as jrm
roshanavand has quit [Ping timeout: 246 seconds]
guacamole has quit [Client Quit]
alfiemax has quit [Remote host closed the connection]
alfiemax has joined #ruby
ltt has joined #ruby
psychicist__ has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
ltt has quit [Client Quit]
kn-928_ has quit [Quit: WeeChat 2.0.1]
alfiemax has quit [Ping timeout: 246 seconds]
ltt has joined #ruby
marr has joined #ruby
DLSteve has joined #ruby
tomphp has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
willmichael has quit [Read error: Connection reset by peer]
willmichael has joined #ruby
eckhardt_ has joined #ruby
tomphp has quit [Client Quit]
tomphp has joined #ruby
ryzokuken has joined #ruby
eckhardt_ has quit [Client Quit]
qba73 has quit [Ping timeout: 264 seconds]
schneider has joined #ruby
qba73 has joined #ruby
robscomputer has joined #ruby
alfiemax has joined #ruby
darkhanb has joined #ruby
mgraf has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
netherwolfe has quit [Quit: Leaving]
netherwolfe has joined #ruby
netherwolfe has quit [Client Quit]
netherwolfe has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
karapetyan has joined #ruby
jeffreylevesque has joined #ruby
milardovich has joined #ruby
alex`` has joined #ruby
clemens3 has quit [Ping timeout: 264 seconds]
milardovich has quit [Ping timeout: 240 seconds]
duckpuppy has joined #ruby
<leitz> The other day someone said Ruby wasn't under a dictatorship anymore. Did I miss the memo?
<leitz> More curious than anything.
orbyt_ has joined #ruby
eckhardt_ has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Client Quit]
pilne has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
mtkd has joined #ruby
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
<elomatreb> As opposed to all those other programming languages, where everything is decided by an elected representative body?
raynold has joined #ruby
eckhardt_ has quit [Read error: Connection reset by peer]
eckhardt_ has joined #ruby
<leitz> elomatreb, not sure on that. I assumed Matz was still "in charge", but the person's comment seemed to suggest otherwise
jottr has quit [Ping timeout: 248 seconds]
marr has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
WhereIsMySpoon has quit [Ping timeout: 260 seconds]
qba73 has quit [Remote host closed the connection]
headius has joined #ruby
qba73 has joined #ruby
karapetyan has quit [Remote host closed the connection]
roshanavand1 has quit [Ping timeout: 264 seconds]
Serpent7776 has quit [Quit: Leaving]
milardovich has joined #ruby
nowhereman_ has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> On nightly: Integer('nope', exception: false) #=> nil
ramfjord has joined #ruby
<havenwood> leitz: Matz has said he'll remain the benevolent dictator as long as he is in his corporeal form.
ansraliant has quit [Quit: WeeChat 2.0.1]
<leitz> havenwood, thanks! From down here (in the Ruby world) things seem to be going okay. Wasn't sure if it would change.
nowhere_man has quit [Ping timeout: 264 seconds]
rikkipitt has quit [Quit: Leaving...]
\void has joined #ruby
cthulchu| is now known as cthu
huyderman has quit [Remote host closed the connection]
yohji has quit [Remote host closed the connection]
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
alfiemax has quit [Remote host closed the connection]
cthu is now known as cthu|
alfiemax has joined #ruby
cthu| is now known as c
c is now known as cthu
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
llua has joined #ruby
aupadhye has quit [Quit: Leaving]
<phaul> does anybody use vim-bundler here? Does automatic setting of tags work for you?
alfiemax has quit [Ping timeout: 264 seconds]
tvw has quit [Remote host closed the connection]
robscomputer has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Ping timeout: 265 seconds]
nachoman has quit []
guille-moe has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
<ule> phaul: I use ctags
<ule> phaul: map <Leader>ct :<C-U>!=/usr/local/bin/ctags -R --languages=ruby --exclude=.git --exclude=log . $(bundle list --paths)<CR>
<ule> when I type: ,ct
<ule> it updates all ctags
<phaul> ule: i guess I could do something like that, although I liked the idea of having a separate tags per gem and load what's needed in the project
mikecmpbll has quit [Quit: inabit. zz.]
chouhoul_ has joined #ruby
schneider has quit [Ping timeout: 240 seconds]
<phaul> so vim-bundler makes the promise of populating your tags vim option based on your bundled gems. That way you only generate tags when you install a gem. bit like rdoc/ri sits in $HOME/.gems
<phaul> altough it doesn't work for me :)
IshMael_ has quit [Ping timeout: 246 seconds]
chouhoulis has quit [Ping timeout: 246 seconds]
clemens3 has joined #ruby
<ule> Yeah, in my case there I'm creating ctags based on all installed gems. "bundle --list"
duckpuppy has joined #ruby
karapetyan has joined #ruby
oncall-pokemon has joined #ruby
am55 has quit [Quit: am55]
duckpuppy has quit [Ping timeout: 246 seconds]
am55 has joined #ruby
robscomputer has joined #ruby
apeiros_ has joined #ruby
memo1 has quit [Ping timeout: 260 seconds]
eckhardt_ has joined #ruby
jottr has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
TomyWork has quit [Ping timeout: 240 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
qba73 has quit [Ping timeout: 240 seconds]
qba73 has joined #ruby
lytol has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
qba73 has quit [Remote host closed the connection]
Beams has quit [Quit: .]
karapetyan has quit [Remote host closed the connection]
jottr has joined #ruby
mtkd has quit []
robscomputer has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robscomputer has joined #ruby
bocaneri has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 240 seconds]
andikr has quit [Remote host closed the connection]
mtkd has joined #ruby
terens has joined #ruby
marxarelli is now known as marxarelli|afk
graft_ is now known as graft
<graft> what is the deal with URI.encode? are we supposed to use it? not use it? why can't we encode brackets? must I take up an 'addressable' dependency?
<graft> et cetera
kapil___ has joined #ruby
rwb has quit [Ping timeout: 264 seconds]
milardovich has quit [Remote host closed the connection]
jamesaxl has quit [Quit: WeeChat 2.0.1]
jottr has joined #ruby
jamesaxl has joined #ruby
mgraf_ has joined #ruby
<morfin> huh
<apeiros_> graft: hm? why do you think you're supposed to not use it?
<apeiros_> oh, I should not answer when going afk soon :(
apeiros_ is now known as apeiros
* apeiros afk for a bit
leotaku has joined #ruby
mgraf has quit [Ping timeout: 268 seconds]
jottr has quit [Ping timeout: 264 seconds]
mgraf_ has quit [Ping timeout: 240 seconds]
ltt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta__ has quit [Remote host closed the connection]
n008f4g_ has joined #ruby
mtkd has quit []
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
im0nde has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
leotaku has quit [Quit: ZNC 1.6.5 - http://znc.in]
mtkd has joined #ruby
IshMael_ has joined #ruby
jottr has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
cdg has quit [Remote host closed the connection]
fiachetti has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
jottr has quit [Ping timeout: 240 seconds]
riotjoe has joined #ruby
benharri has quit [Quit: benharri]
duckpuppy has joined #ruby
mgraf has joined #ruby
leotaku has joined #ruby
riotjones has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
riotjoe has quit [Ping timeout: 260 seconds]
ghormoon has quit [Ping timeout: 245 seconds]
duckpuppy has quit [Ping timeout: 240 seconds]
fiachetti has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 264 seconds]
alfiemax has quit [Remote host closed the connection]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
bmurt has joined #ruby
cagomez has quit [Remote host closed the connection]
milardovich has joined #ruby
jottr has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
leotaku has quit [Ping timeout: 240 seconds]
ghormoon has joined #ruby
karapetyan has joined #ruby
ltt has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
karapetyan has quit [Remote host closed the connection]
cagomez has joined #ruby
leotaku has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
mgraf has quit [Ping timeout: 264 seconds]
ltt has quit [Ping timeout: 246 seconds]
ledestin has joined #ruby
sameerynho has joined #ruby
karapetyan has joined #ruby
chouhoulis has joined #ruby
jottr has joined #ruby
karapetyan has quit [Ping timeout: 246 seconds]
Diabolik_ is now known as Diabolik
cagomez has quit [Remote host closed the connection]
ta_ has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cavallari has joined #ruby
rwb has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
John_Ivan has joined #ruby
John_Ivan has joined #ruby
John_Ivan has quit [Changing host]
jackjackdripper has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
workmad3 has joined #ruby
robscomputer has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tvw has joined #ruby
claudiuinberlin has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
jottr has joined #ruby
leitz has quit [Quit: Nappy time]
weaksauce has joined #ruby
coderphive has joined #ruby
SeepingN has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
nadir has joined #ruby
shinnya has joined #ruby
karapetyan has joined #ruby
jottr has joined #ruby
eckhardt_ has joined #ruby
pastorinni has quit [Remote host closed the connection]
pastorinni has joined #ruby
duckpuppy has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
pastorinni has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
ta_ has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
cagomez has joined #ruby
Psybur has quit [Ping timeout: 245 seconds]
anisha has joined #ruby
RougeR has quit [Ping timeout: 276 seconds]
jottr has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
cagomez has quit [Ping timeout: 268 seconds]
BTRE has quit [Ping timeout: 256 seconds]
BTRE has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhereman_ has quit [Ping timeout: 246 seconds]
tolerablyjake has joined #ruby
psychicist__ has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
milardovich has quit [Remote host closed the connection]
phaul has quit [Ping timeout: 246 seconds]
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has joined #ruby
jamiejackson has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
jenrzzz has joined #ruby
leotaku has quit [Ping timeout: 240 seconds]
deathwishdave has joined #ruby
cagomez has joined #ruby
jottr has joined #ruby
leotaku has joined #ruby
nowhereman_ has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
kfpratt has joined #ruby
karapetyan has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 240 seconds]
jackjackdripper has quit [Quit: Leaving.]
perzival has joined #ruby
jottr has joined #ruby
deathwishdave has quit [Ping timeout: 248 seconds]
sspreitz has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 263 seconds]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
terens has quit [Ping timeout: 260 seconds]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
sspreitz has joined #ruby
chouhoulis has quit [Ping timeout: 263 seconds]
jottr has joined #ruby
ta_ has joined #ruby
synthroid has quit []
cdg has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
mtkd has quit [Ping timeout: 248 seconds]
cdg has quit [Remote host closed the connection]
KeyJoo has quit [Quit: KeyJoo]
cdg has joined #ruby
BTRE has quit [Remote host closed the connection]
mtkd has joined #ruby
robscomputer has joined #ruby
jamiejackson25 has joined #ruby
orbyt_ has joined #ruby
jottr has joined #ruby
duckpuppy has joined #ruby
jamiejackson has quit [Ping timeout: 240 seconds]
ledestin has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
duckpuppy has quit [Ping timeout: 264 seconds]
jottr has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
pastorinni has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
terens has joined #ruby
jottr has quit [Ping timeout: 263 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
Quentinius has joined #ruby
roshanavand has joined #ruby
ta_ has quit [Ping timeout: 264 seconds]
Azure has quit [Read error: Connection reset by peer]
Quentinius has quit [Client Quit]
Azure has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure|dc has joined #ruby
ldnunes has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
memo1 has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
memo1 has quit [Ping timeout: 264 seconds]
Azure|dc is now known as Azure
ta_ has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
jottr has joined #ruby
cagomez has quit [Remote host closed the connection]
ta_ has quit [Ping timeout: 246 seconds]
cagomez has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Zaab1t has quit [Remote host closed the connection]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
jamiejackson2577 has joined #ruby
Cavallari has quit [Quit: Cavallari]
im0nde has quit [Ping timeout: 276 seconds]
cagomez has quit [Ping timeout: 240 seconds]
perzival has quit [Ping timeout: 260 seconds]
jottr has joined #ruby
jamiejackson25 has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
karapetyan has joined #ruby
memo1 has joined #ruby
jottr has quit [Ping timeout: 263 seconds]
robscomputer has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
le0taku has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
ramfjord has quit [Ping timeout: 245 seconds]
kloeri_ has quit [Remote host closed the connection]
leotaku has quit [Ping timeout: 264 seconds]
kloeri has joined #ruby
Guest41419 has quit [Ping timeout: 245 seconds]
cagomez has joined #ruby
cschneid has quit [Remote host closed the connection]
am55 has quit [Quit: am55]
im0nde_ has joined #ruby
jottr has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
shinnya has quit [Ping timeout: 276 seconds]
JoshS has quit [Quit: Leaving]
chouhoulis has joined #ruby
jackjackdripper has joined #ruby
jamesaxl has quit [Quit: WeeChat 2.0.1]
jottr has quit [Ping timeout: 264 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BTRE has joined #ruby
allcentury has joined #ruby
duckpuppy has joined #ruby
jottr has joined #ruby
jamiejackson2577 has quit [Ping timeout: 260 seconds]
jamiejackson2577 has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
alex`` has quit [Quit: WeeChat 2.0.1]
ramfjord has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
jinie has joined #ruby
cagomez has quit [Remote host closed the connection]
marr has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
duckpuppy has quit [Ping timeout: 248 seconds]
allcentury has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
jinie has quit [Client Quit]
cagomez has quit [Remote host closed the connection]
jinie has joined #ruby
cagomez has joined #ruby
arand has joined #ruby
leah2 has quit [Ping timeout: 240 seconds]
cschneid has joined #ruby
robscomputer has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
leah2 has joined #ruby
karapetyan has quit [Remote host closed the connection]
jottr has joined #ruby
marr has quit [Remote host closed the connection]
cschneid has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
terens has quit [Read error: Connection reset by peer]
terens has joined #ruby
desperek has quit [Quit: xoxo]
jottr has quit [Ping timeout: 264 seconds]
<arand> Being quite new to ruby, I have been using exclusive ranges x = y[a...-b] in order to extract "middle parts" of things, but this only works if b > 0, is it common to use inclusive syntax x = y[a..-(b + 1)] to avoid this edge case or is there a neater way?
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
netherwolfe has quit [Ping timeout: 264 seconds]
<weaksauce> arand perhaps doing it that way is not quite the ruby way unless you have a really specific need
<weaksauce> what are you doing that requires extracting the middle... maybe someone knows of a better method to do what you want?
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dimik has quit []
clemens3 has quit [Ping timeout: 264 seconds]
<apeiros> arand: huh? exclusive ranges work fine with negative end offset
<apeiros> >> [1,2,3][1...-1]
<arand> In a communications protocol I have a frame with a header, data field and a trailer, and I want to extract the data field.
* apeiros pokes ruby[bot]
<havenwood> #=> [2]
<apeiros> >> [1,2,3][1..-1]
<apeiros> # => [2, 3]
<havenwood> #=> [2, 3]
<arand> >> [1,2,3][1...-0]
jottr has joined #ruby
<apeiros> arand: misunderstanding on your part
<havenwood> #=> []
<apeiros> -0 == 0
<havenwood> #=> true
<apeiros> if you read the docs, it tells you that if N is negative, it's interpreted as length+N
<apeiros> and hence -1 is the last offset
<apeiros> (since length-1 is the last offset)
bmurt has joined #ruby
<havenwood> -0.negative? #=> false
<arand> Yes, and if the offset is variable, exclusive syntax cannot be used if the variable could conceivably be 0.
<eam> >> -0 == 0
<havenwood> #=> true
<eam> o is the thingy not running?
<apeiros> arand: sounds like "I can't use this if I have a logic error in my code", and why, yes of course.
<havenwood> eam: I'm trying to fill in. ;-P
<eam> haha ty
<eam> integers shouldn't have a negative zero, but floats should
<eam> ints don't have a way to store it
* havenwood pokes ruby[bot]
<eam> which is why integers can store one more negative number than positive (not counting zero)
reber has quit [Remote host closed the connection]
karapetyan has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
jrm has quit [Quit: ciao]
ruby[bot] has joined #ruby
<apeiros> eam: floats have
<apeiros> >> -0.0.equal?(0.0)
<havenwood> -0 #=> 0
<eam> however ... in Ruby it looks like maybe -0.0 is equal to 0.0
<arand> apeiros: My question is, is there a prettier way to write x = y[a..-(b + 1)] without the "+ 1"?
<ruby[bot]> apeiros: # => false (https://eval.in/972824)
<eam> which seems wrong to me
<havenwood> -0.0 #=> -0.0
jrm has joined #ruby
<apeiros> eam: it is ==, it's not equal?
im0nde_ has quit [Quit: im0nde_]
jottr has quit [Ping timeout: 264 seconds]
<eam> apeiros: aha!
<apeiros> eam: and the == is very much correct :)
<havenwood> 0.equal?(-0) #=> true
<havenwood> 0.0.equal?(-0.0) #=> false
<eam> and with equal? we do see that integer negative zero equals zero, but float negative zero does not
<eam> so all is well
<apeiros> havenwood: the bot works properly again. I restarted it.
orbyt_ has joined #ruby
<zenspider> y.first(a+b).last(b)
<apeiros> whatever was jammed
<zenspider> which is just dumb
<zenspider> it sounds like you're making this more difficult than it needs to be
terens has quit [Ping timeout: 260 seconds]
deathwishdave has joined #ruby
robscomputer has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> arand: no, I think not
IshMael_ has quit [Ping timeout: 260 seconds]
<apeiros> arand: there may be a prettier way to write your overall problem
<zenspider> arand: is this a binary protocol?
edwardly has quit [Ping timeout: 265 seconds]
karapetyan has quit [Ping timeout: 264 seconds]
<apeiros> arand: but for "prettier way for overall problem" I'd actually need more info :)
<arand> My source and target data are strings, representing a binary byte stream.
<zenspider> eam / havenwood : what's a nice hotel near your office?
<apeiros> also I use string[offset, length] way more often than string[offset..offset2], maybe that form would help you here too?
memo1 has quit [Ping timeout: 260 seconds]
<zenspider> arand: is that a yes or a no?
<zenspider> it's a simple question... I thought
* apeiros read that as a "yes"
deathwishdave has quit [Ping timeout: 264 seconds]
<zenspider> arand: `ri String.unpack`
<havenwood> zenspider: The InterContinental on Howard isn't too far. Hrm, there are probably closer.
jottr has joined #ruby
IshMael_ has joined #ruby
IshMael_ has left #ruby [#ruby]
coderphive has quit [Quit: coderphive]
mtkd has quit []
jottr has quit [Ping timeout: 264 seconds]
<arand> zenspider: I think so, what would be a non-binary protocol?
<zenspider> SMTP, HTTP, telnet (mostly), ftp... umm... most of them?
ta_ has joined #ruby
memo1 has joined #ruby
pddman has joined #ruby
<arand> I'm doing stage/chunk processing of a data stream, so my target format is string as well, hence I don't think I want to unpack it?
jottr has joined #ruby
<eam> zenspider: I'm the wrong guy to ask, I think all of SF is a stinkhole :D
sspreitz has quit [Quit: ZNC 1.6.2 - http://znc.in]
pastorin_ has joined #ruby
sameerynho has quit [Ping timeout: 246 seconds]
pastorinni has quit [Ping timeout: 264 seconds]
sspreitz has joined #ruby
nowhere_man has joined #ruby
samort7 has joined #ruby
<apeiros> arand: seems like you indeed have the case I said. you have size, not offset, so you should use slice!(offset, length), not slice!(0...offset)
<apeiros> ah, though, second is the size of the suffix. could remove that instead of the middle.
jottr has quit [Ping timeout: 240 seconds]
nowhereman_ has quit [Ping timeout: 240 seconds]
<zenspider> also remove line 6 and the assignment on line 5. no value
<zenspider> I would also remove all slice! and other destructive/mutative methods
duckpuppy has joined #ruby
<arand> Other than documentation no, does excess copies like that add cost in ruby?
<zenspider> @data[0, @cadu_size][CCSDS_SYNC_MARKER_LEN, @reed_solomon_size]
<zenspider> tho, really: @data[CCSDS_SYNC_MARKER_LEN, @reed_solomon_size]
<zenspider> you're using ruby. you don't care about cost until you measure
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
n008f4g_ has quit [Ping timeout: 246 seconds]
<arand> I do want to mutate @data though.
<zenspider> I recommend you don't
<zenspider> you can choose to ignore that advice... that's fine.
<zenspider> I charge a LOT for my debugging services. ;)
roshanavand has quit [Quit: Leaving.]
roshanavand has joined #ruby
<arand> @data is the buffer for the yet-unproccessed data.
yokel has quit [Remote host closed the connection]
duckpuppy has quit [Ping timeout: 264 seconds]
pastorin_ has quit [Remote host closed the connection]
<zenspider> I'm not confused about what @data is.
yokel has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jamiejackson2577 has quit [Ping timeout: 260 seconds]
<weaksauce> another option is to use StringIO if you want a stream to do variable length reads from without having to do all that intermediate splicing.
<zenspider> weaksauce: StringIO on a stream? or StringScanner?
<zenspider> (I dunno... maybe you can use StringIO on a stream? no clue, but that could be cool)
jottr has joined #ruby
<weaksauce> depends on what @data is actually i suppose
KeyJoo has joined #ruby
<arand> For excess context, I'm interfacing as a new "protocol" in https://github.com/BallAerospace/COSMOS/tree/master/lib/cosmos/interfaces/protocols
jobewan has quit [Quit: jobewan]
<arand> I get my data through an external call to read_data(data) with a string input and string output (or :STOP/:DISCONNECT)
rafik has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
<arand> This is for example how the same thing is done in the "length protocol": https://paste.ubuntu.com/p/PFtvcDTVrj/
<weaksauce> arand perhaps gist the entire code?
iszak_ has quit [Ping timeout: 256 seconds]
marr has joined #ruby
Fusselgesicht has quit [Quit: leaving]
jottr has quit [Ping timeout: 264 seconds]
pastorinni has joined #ruby
jottr has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
iszak has joined #ruby
iszak has joined #ruby
iszak has quit [Changing host]
nowhereman_ has joined #ruby
schneider has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
ta_ has quit [Ping timeout: 260 seconds]
pastorinni has quit [Remote host closed the connection]
schneider has quit [Ping timeout: 240 seconds]
ta_ has joined #ruby
alfiemax has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
tolerablyjake has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
<arand> I removed the second slice!, that was indeed pointless.
rfoust has joined #ruby
<zenspider> half your returns can go. you need not pass anything to super unless you're changing the args, still not sure why you're insisting on using ranges instead of lengths
jottr has quit [Ping timeout: 240 seconds]
le0taku has quit [Ping timeout: 246 seconds]
<zenspider> and to be clear: there's a semantic difference between super() and super
<zenspider> super() or super(args...) vs super
<arand> >> [0,1,2,3,4,5,6,7][1, 1] != [0,1,2,3,4,5,6,7][1..-(1 + 1)]
n0m4d1c has joined #ruby
<ruby[bot]> arand: # => true (https://eval.in/972836)
<weaksauce> >> [0,1,2,3,4,5,6,7][1, 6]
<ruby[bot]> weaksauce: # => [1, 2, 3, 4, 5, 6] (https://eval.in/972837)
<zenspider> arand: you seem stuck on that. not sure why
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
Guest27029 is now known as mrush
<arand> I'm using ranges instead of lengths since that means I don't need to calculate the length.
alfiemax has joined #ruby
<zenspider> *sigh* you ARE calculating the length.
<zenspider> I think I'm done. I don't understand your pathology.
ccooke_ is now known as ccooke
memo1 has quit [Ping timeout: 246 seconds]
n0m4d1c has quit [Remote host closed the connection]
Psybur has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
n0m4d1c has joined #ruby
milardovich has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n0m4d1c has quit [Read error: Connection reset by peer]
<arand> I guess there's no point further explaining that then. I should definitely read up on 'super' since I have basically just cargo-culted its use from other similar protocols so far. I guess by removing returns you mean using just the naked variable, which I conceede is just a non-idiomatic-roby-beginner taste of mine.
<arand> s/roby/ruby/
duckpuppy has joined #ruby
n0m4d1c has joined #ruby
ryandv has quit [Ping timeout: 248 seconds]
milardovich has quit [Ping timeout: 260 seconds]
tvw has quit [Remote host closed the connection]