Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<brool>
is it a bad idea to use File.open() in a sinatra app? i made a hangman game and File.open() just loads the word bank and picks one for the session
<brool>
i'm assuming it's a bad idea but i don't know why
<brool>
even though it works ¯\_(ツ)_/¯
<adam12>
brool: Seems OK to me. I might not open files in a hot path for an app that's doing 1000's of requests per second, but for your hangman app I don't see an issue.
<brool>
ok
Arkantos has joined #ruby
<adam12>
brool: I'd probably make sure you're closing the files tho. Either use File.read or File.open with a block. Or make sure you call #close on the file object. Something.
<brool>
i have File.open().read_lines.to_a
<brool>
s/read_lines/each_line
roadie has joined #ruby
ritalinona has quit [Remote host closed the connection]
ritalinona has joined #ruby
<adam12>
brool: File.readlines("filename")
<brool>
ooh
<adam12>
brool: Unless the file is huge.
<adam12>
I'm out. Good luck.
<brool>
it's only a few hundred lines, 8.6kb
<brool>
basically "keyword,hint" on each line
<al2o3-cr>
brool: just for good measure add chomp: true to readlines.
<brool>
ok
roadie has quit [Ping timeout: 240 seconds]
brool has quit [Ping timeout: 252 seconds]
brendan- has quit [Ping timeout: 252 seconds]
brendan- has joined #ruby
sergioro has joined #ruby
LDonoughe has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.7.1]
brendan- has quit [Ping timeout: 250 seconds]
al2o3-cr has joined #ruby
gix has quit [Ping timeout: 265 seconds]
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ChmEarl has quit [Quit: Leaving]
roadie has joined #ruby
roadie has quit [Ping timeout: 256 seconds]
LDonoughe has quit [Ping timeout: 256 seconds]
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
jtdowney has joined #ruby
jmcgnh has quit [Remote host closed the connection]
alfiemax has joined #ruby
jtdowney has quit [Client Quit]
jtdowney has joined #ruby
cschneid_ has joined #ruby
cschneid has quit [Ping timeout: 256 seconds]
jtdowney has quit [Client Quit]
jtdowney has joined #ruby
jtdowney has quit [Quit: Bye]
jtdowney has joined #ruby
jtdowney has quit [Remote host closed the connection]
braincrash has quit [Quit: bye bye]
jtdowney has joined #ruby
code_zombie has quit [Quit: Leaving]
braincrash has joined #ruby
LDonoughe has joined #ruby
jtdowney has quit [Quit: Bye]
jtdowney has joined #ruby
jtdowney has quit [Remote host closed the connection]
LDonoughe has quit [Ping timeout: 256 seconds]
jtdowney has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
jmcgnh has joined #ruby
brendan- has joined #ruby
brool has joined #ruby
brool has quit [Client Quit]
wmoxam_ is now known as wmoxam
wmoxam has quit [Changing host]
wmoxam has joined #ruby
LDonoughe has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LDonoughe has quit [Ping timeout: 240 seconds]
cd has quit [Quit: cd]
KeyJoo has quit [Quit: KeyJoo]
duderonomy has quit [Ping timeout: 264 seconds]
duderonomy has joined #ruby
akem has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 252 seconds]
jingjinghack has joined #ruby
sergioro has quit [Quit: leaving]
alfiemax has joined #ruby
factormystic7 has joined #ruby
sergioro has joined #ruby
factormystic has quit [Ping timeout: 256 seconds]
factormystic7 is now known as factormystic
cthu| has joined #ruby
ritalinona has quit [Ping timeout: 240 seconds]
iNs has quit [Remote host closed the connection]
lineus has quit [Remote host closed the connection]
galaxie has quit [Write error: Connection reset by peer]
iNs has joined #ruby
ritalinona has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
lineus has joined #ruby
galaxie has joined #ruby
sergioro has quit [Quit: leaving]
jmcgnh has joined #ruby
cschneid has joined #ruby
cschneid_ has quit [Ping timeout: 256 seconds]
pandakekok9 has joined #ruby
alfiemax has quit [Remote host closed the connection]
roadie has joined #ruby
alfiemax has joined #ruby
LDonoughe has joined #ruby
sergioro has joined #ruby
LDonoughe has quit [Ping timeout: 264 seconds]
LDonoughe has joined #ruby
jmcgnh has quit [Ping timeout: 252 seconds]
jmcgnh_ has joined #ruby
jmcgnh_ is now known as jmcgnh
bvdw has quit [Read error: Connection reset by peer]
LDonoughe has quit [Ping timeout: 246 seconds]
bvdw has joined #ruby
alfiemax has quit [Ping timeout: 252 seconds]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
roadie has joined #ruby
Arkantos has joined #ruby
LDonoughe has joined #ruby
dviola has quit [Quit: WeeChat 2.7.1]
LDonoughe has quit [Ping timeout: 265 seconds]
mheld has quit [Quit: Connection closed for inactivity]
markopasha has joined #ruby
cthu| has quit [Ping timeout: 252 seconds]
Arkantos has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
xco has quit [Client Quit]
hiroaki has quit [Ping timeout: 258 seconds]
roadie has quit [Remote host closed the connection]
markopasha has quit [Ping timeout: 265 seconds]
jmcgnh has quit [Remote host closed the connection]
conta has joined #ruby
LDonoughe has joined #ruby
xco has joined #ruby
xco has quit [Client Quit]
LDonoughe has quit [Ping timeout: 252 seconds]
cschneid has quit [Ping timeout: 246 seconds]
cschneid has joined #ruby
sergioro has quit [Quit: leaving]
arcaos has joined #ruby
conta has quit [Quit: conta]
arcaos has quit [Read error: Connection reset by peer]
arcaos has joined #ruby
arcaos has quit [Remote host closed the connection]
_phaul has joined #ruby
phaul has quit [Ping timeout: 250 seconds]
pandakekok9 has quit [Ping timeout: 252 seconds]
pandakekok9 has joined #ruby
schne1der has joined #ruby
_phaul has quit [Ping timeout: 260 seconds]
_phaul has joined #ruby
mainfram has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
TomyWork has joined #ruby
arekushi has joined #ruby
phaul has joined #ruby
alfiemax has joined #ruby
_phaul has quit [Ping timeout: 264 seconds]
alfiemax has quit [Remote host closed the connection]
phaul has quit [Ping timeout: 256 seconds]
phaul has joined #ruby
gix has joined #ruby
xyhuvud has quit [Read error: Connection reset by peer]
<patrick99e99>
Hi everyone.. I am not sure if this is the place to ask-- but I am trying to do something involving openssl, and am getting: FFI::NotFoundError (Function 'OPENSSL_init_ssl' not found in [libssl.dylib])
<xco>
i know
<xco>
adam12 but what is it, what does it represent?
<al2o3-cr>
xco: it's the code point for 🇦
<xco>
al2o3-cr :D silly me did "A".unpack('U*') and got [65] and got confused
<xco>
al2o3-cr thank you :)
<al2o3-cr>
np :P
funnel has quit [Ping timeout: 260 seconds]
<al2o3-cr>
[240, 159, 135, 166] this is the bytes
<xco>
al2o3-cr if i have the codepoint how do i get the grapheme? I can't seem to copy this to check
<xco>
al2o3-cr oh i agree. i'm now conviced encodings are a whole new different separate topic. you have to spend time to study it for it to make any sense
<al2o3-cr>
xco: you really do.
<xco>
havenwood 127462.chr(Encoding::UTF_8) < OK now i think i get what's going on
<xco>
thanks guys... back to writing my blog post :D
<xco>
al2o3-cr oh it says "Wrong spelling/No reported cases on FOO." doesn't make sense is that what you mean?
funnel has joined #ruby
<xco>
havenwood i tested those out already locally so i understand those very well
<xco>
al2o3-cr perhaps kovid state foo should explicitely state that foo is not a state?
<havenwood>
xco: It might be kind to the reader to write it as: 'A'.upto('Z').with_index('🇦'.ord).to_h.freeze
<al2o3-cr>
xco: nvm, i updated to gem it's fixed! ;)
<xco>
al2o3-cr whew! :P
<al2o3-cr>
me and my outdated gem :)
<xco>
right
<havenwood>
xco: For fun, here's another way to write it: Enumerator.produce(['A', '🇦'.ord]) { |ascii, utf| [ascii.succ, utf.succ] }.first(26).to_h.freeze
* al2o3-cr
likes this ^
<xco>
havenwood I see you like Enumerator.produce :D
<xco>
this looks fun
<xco>
i'm testing what will happen if i pust 30 to #first