havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
cats has quit [Remote host closed the connection]
alveric2 has quit [Ping timeout: 272 seconds]
gothicsouth has joined #ruby
Pongles has quit [Quit: Leaving]
Guest62009 has quit []
Pongles has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
<Pongles> Radar, sorry to bug you again, but do you know if there is a way to flush data sent to the server without blocking?
mrconfused has quit [Ping timeout: 268 seconds]
BSaboia has joined #ruby
milardovich has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
nobitanobi has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
<Pongles> I am trying to mimic a telnet server but I don't know a good way to grab the negotiation at the start
nobitanobi has quit [Ping timeout: 240 seconds]
sagax has quit [Ping timeout: 240 seconds]
LastWhisper____ has joined #ruby
<Radar> Pongles: no sorry I don't know that
cisco has quit [Quit: Leaving.]
mrconfused has joined #ruby
rgr has quit [Ping timeout: 245 seconds]
olivi____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
ResidentBiscuit has joined #ruby
oliv_____ has quit [Remote host closed the connection]
olivi____ has joined #ruby
mrconfused has quit [Ping timeout: 245 seconds]
Fernando-Basso has quit [Quit: WeeChat 1.8]
charliesome has joined #ruby
ResidentBiscuit has quit [Ping timeout: 240 seconds]
olivi____ has quit [Remote host closed the connection]
brent__ has quit [Remote host closed the connection]
mrconfused has joined #ruby
cam27 has quit [Quit: cam27]
im0nde has quit [Ping timeout: 240 seconds]
nadir has joined #ruby
sneakerhax has joined #ruby
claw has quit [Read error: Connection reset by peer]
claw has joined #ruby
oliv_____ has joined #ruby
apparition has joined #ruby
jameser has joined #ruby
brent__ has joined #ruby
chopin has joined #ruby
HumbleBee has quit [Quit: Leaving]
alveric3 has quit [Ping timeout: 240 seconds]
eightlimbed has quit [Ping timeout: 240 seconds]
alveric3 has joined #ruby
knamehost has joined #ruby
eightlimbed has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
erlend has quit [Quit: Bye]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SenpaiSilver_ has quit [Quit: Leaving]
PorcoRex has joined #ruby
<PorcoRex> Good evening.
brent__ has quit [Remote host closed the connection]
bruce_lee has quit [Read error: Connection reset by peer]
erlend has joined #ruby
<knamehost> hi . where ca i find a good read about ruby ... tuts vids etc
<PorcoRex> knamehost, there are several good resources. Are you a developer already? A beginner?
HoierM has joined #ruby
demio has joined #ruby
chopin has quit []
Gues_____ has joined #ruby
<knamehost> PorcoRex, beginner my friend
5EXAA2YP3 has joined #ruby
5EXAA2YP3 has quit [Client Quit]
<knamehost> im going to deve too as well
jusa has joined #ruby
Gues_____ has quit [Client Quit]
charliesome has joined #ruby
Gues_____ has joined #ruby
<PorcoRex> knamehost, this is probably a nice one to step your toe: http://poignant.guide/
jusa has quit [Ping timeout: 240 seconds]
zacts has quit [Quit: WeeChat 1.8]
<knamehost> ty PorcoRex
<PorcoRex> knamehost, sure, enjoy.
lel- is now known as lel
d^sh has quit [Ping timeout: 245 seconds]
jakew has joined #ruby
d^sh has joined #ruby
jakew has quit [Client Quit]
Uranio has joined #ruby
jrafanie has joined #ruby
jameser has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ResidentBiscuit has joined #ruby
<Arahael> Curious how ruby has both ==, and ===, if == already compares object identity.
mrconfused has quit [Ping timeout: 245 seconds]
<PorcoRex> Arahael, === is case equality. The operator can be overridden to give "better" matches, generally (and, in my opinion, preferably) on case statements.
Uranio has left #ruby ["while you read this, a kitty dies"]
<Arahael> PorcoRex: It's just a curiousity compared to say, javascript.
kies has quit [Ping timeout: 240 seconds]
<Arahael> PorcoRex: "==" there is 'somewhat equal', whereas '===' makes it more likely that the types themselves are equal as well
<PorcoRex> Arahael, it's completely different from JS in that sense. Not even close.
<Arahael> PorcoRex: Indeed. Not neccessarily a bad thing - the javascript situation is horrible.
<elomatreb> You generally don't use === yourself, ever
<Arahael> elomatreb: Good to know. (In ruby)
mrconfused has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
<Radar> Then there's the fabled ====
<PorcoRex> Radar, seriously? I just read it was reserved for future use.
<Arahael> Radar: I thought that was only for the haskell devs? ;)
demio has quit [Quit: Computer has gone to sleep.]
demio has joined #ruby
demio has quit [Client Quit]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
kies has joined #ruby
genpaku has quit [Remote host closed the connection]
AndBobsYourUncle has joined #ruby
AndBobsYourUncle has quit [Client Quit]
mrconfused has quit [Ping timeout: 245 seconds]
arescorpio has joined #ruby
genpaku has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
ResidentBiscuit has quit []
belmoussaoui has joined #ruby
belmoussaoui has quit [Remote host closed the connection]
<eightlimbed> can someone explain how this determines whether a number is prime or not?
<eightlimbed> (2..n/2).none? { |i| n % i == 0}
cyphase has quit [Ping timeout: 260 seconds]
<eightlimbed> why it is n/2 and not n-1
<elomatreb> A number larger than the half of n trivially can't divide it evenly
belmoussaoui has joined #ruby
roamingdog has joined #ruby
jgpawletko has joined #ruby
cyphase has joined #ruby
jgpawletko has quit [Client Quit]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
Uranio-235 has joined #ruby
Uranio-235 has quit [Client Quit]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mrconfused has joined #ruby
pb122 has joined #ruby
jusa has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
HoierM has quit [Ping timeout: 245 seconds]
charliesome has joined #ruby
milardovich has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
eightlimbed has quit [Ping timeout: 240 seconds]
mrconfused has quit [Ping timeout: 245 seconds]
jusa has quit [Ping timeout: 260 seconds]
mrconfused has joined #ruby
quazimodo has joined #ruby
_sfiguser has quit [Ping timeout: 245 seconds]
<quazimodo> Hi
<quazimodo> do we have file local constants in ruby?
<Nilium> Not that I'm aware of, unless you add something like const_missing and check the file and so on
gix has quit [Ping timeout: 260 seconds]
kies has quit [Ping timeout: 255 seconds]
agent_white has quit [Ping timeout: 272 seconds]
gix has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_sfiguser has joined #ruby
segmond has joined #ruby
kies has joined #ruby
gothicsouth has joined #ruby
harfangk has joined #ruby
mrconfused has quit [Remote host closed the connection]
tristanp has joined #ruby
N0ATN has quit [Ping timeout: 240 seconds]
jtdowney has quit [Quit: Ping timeout (120 seconds)]
cgfbee has quit [Ping timeout: 245 seconds]
olson86 has joined #ruby
cgfbee has joined #ruby
__Yiota has joined #ruby
patr0clus has quit [Quit: WeeChat 1.4]
PorcoRex has quit [Quit: Leaving]
rohitpaulk has joined #ruby
tristanp has quit [Remote host closed the connection]
tristanp has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
nobitanobi has joined #ruby
jameser has joined #ruby
nobitanobi has quit [Ping timeout: 258 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
segmond has quit [Quit: l8r]
jameser has quit [Read error: Connection reset by peer]
rohitpaulk has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
belmoussaoui_ has joined #ruby
belmoussaoui has quit [Ping timeout: 240 seconds]
kies has quit [Ping timeout: 255 seconds]
renchan has joined #ruby
TomyLobo has joined #ruby
jameser has quit [Read error: Connection reset by peer]
jameser has joined #ruby
uZiel has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has quit [Remote host closed the connection]
uZiel has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mortomes|Train has joined #ruby
zacts has joined #ruby
<zenspider> Pongles: did you get stuff figured out?
<Pongles> In regards to the telnet negotiation?
djbkd has joined #ruby
__Yiota has joined #ruby
mim1k has joined #ruby
herbmillerjr has quit [Quit: Konversation terminated!]
jusa has joined #ruby
arescorpio has quit [Quit: Leaving.]
Gues_____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 240 seconds]
jusa has quit [Ping timeout: 260 seconds]
tristanp has joined #ruby
knamehost has quit [Quit: Leaving]
<zenspider> I guess
nbering has joined #ruby
cam27 has joined #ruby
<Radar> Pongles: ^
<Pongles> I have yet to figure that out, nor have I had a chance to work on it since
<Pongles> I tried doing a client.read() before the first get but that appears to not work as intended
anisha_ has joined #ruby
<Radar> zenspider: Any idea how to make Pongles code not block? I tried coming up with an answer this morning but I couldn't.
<Radar> I'd like to see what you could come up with
<nbering> I have a question that's about something I see in Rails a lot, but is actually a language question. I often see code in a class like ActiveRecord's has_many function, and it looks almost like an include, but it feels more like a function call. What's actually happening when that's called? Speaking broadly of the pattern, not the specific example.
<Pongles> here is what my code currently looks like: https://gist.github.com/anonymous/b4e4e5801d5785c2bbe0b6c0721c244c
roshanavand has joined #ruby
<Radar> nbering: it's calling a class function.
<Radar> class method*
<zenspider> a class method that is generating other methods on the class
<nbering> Ok. I thought as much. When does that execute? Is it when Ruby evaluates the class definition, or when an instance is created?
<Radar> nbering: when Ruby evaluates the class definition.
<zenspider> Pongles: I don't know what the problem is. "not work as intended" is vague
aupadhye has joined #ruby
roshanavand has quit [Client Quit]
<Pongles> The client.read() appears to block until newline from client
<zenspider> yes... working as intended
<Pongles> as I am using port 23 to mimic a telnet server, the clients are sending negotiation characters at the start of the connection
<Radar> zenspider: I think Pongles wants the program to close the connection immediately when the client closes their connection. Right now it just waits for further input.
<nbering> Radar: Thank you very much. Smells like a rabbit hole indeed, but now I know where to look for it.
<Pongles> and I am trying to make it so they don't get added to the userid variable
<Pongles> @Radar, no
<Radar> ok, I'll let you explain it
<Pongles> I thought I did
nbering has quit [Quit: Leaving...]
<zenspider> `client.gets.chomp.to_s` is blocking code. as defined.
<Pongles> client.gets.chomp.to_s is not client.read
<Pongles> I have been having troubles trying to ignore the negotiation characters at the start of the connection from the client
roshanavand has joined #ruby
<Pongles> I tried client.read at the start to swallow them, but it didn't work
<zenspider> doesn't matter. They BOTH block, *AS DEFINED*
<Pongles> I NOTICED
kies has joined #ruby
<Pongles> That's not the problem though
karlding has joined #ruby
<Pongles> The problem is that I need to figure out a way to ignore the negotiation characters at the start of the connection that the client sends
<zenspider> you can't ignore them. try again
<Pongles> ...
roshanavand has quit [Read error: Connection reset by peer]
roshanavand1 has joined #ruby
<zenspider> they're sent over an IO that you're trying to use...
<zenspider> what do you really want?
<Pongles> did you ping me about my issue hours later just to troll me?
<zenspider> clearly
roshanavand1 has quit [Client Quit]
<zenspider> or you could do better than spend 10 minutes NOT describing your problem, and when obvious issues are brought up, you could address them
roshanavand has joined #ruby
<zenspider> you can't "ignore" the negotiation. You have to do something with the IO to get the meat you do want
<Pongles> I am fine with *getting* the characters and then doing nothing with them
<zenspider> so just to be really clear... blocking is NOT the issue at all?
<Pongles> I just need them to not be part of userid
<zenspider> are they fixed length? or fixed format?
<Pongles> blocking was never the main issue, it was just a side effect of the method I tried to fix
roshanavand has quit [Client Quit]
<Pongles> they are not fixed length, but they do have a standard format
roshanavand has joined #ruby
<zenspider> so you'll need to write some sort of (no-op) parser for it, reading n chars at a time (even 1) until it is gone
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
<zenspider> IO has #ungetc so you can put BACK a char if you go past the last negotiation sequence
<zenspider> even something as dumb as: c = io.getc until c == "\0";
<zenspider> what's the format?
roshanavand has quit [Client Quit]
<Pongles> they basically just add the characters for more options from what I've seen
<Pongles> it always starts the same but could end with anything
Mortomes|Train has quit [Ping timeout: 260 seconds]
<zenspider> is there some reason why you're NOT using net/telnet? or at least stealing from it
<zenspider> ?
<Pongles> the ruby telnet implementation appears to be clientside only
<Pongles> if I am wrong then I'd be more than willing to utitlize it
<zenspider> still seems to have all of this negotiation handling in it
<zenspider> string.gsub(/#{IAC}([#{IAC}#{AO}#{AYT}#{DM}#{IP}#{NOP}]| [#{DO}#{DONT}#{WILL}#{WONT}] [#{OPT_BINARY}-#{OPT_NEW_ENVIRON}#{OPT_EXOPL}]| #{SB}[^#{IAC}]*#{IAC}#{SE})/xno) do ...
ur5us has quit [Remote host closed the connection]
<zenspider> https://www.ruby-forum.com/topic/75391 james gray knows his shit
oleo has quit [Quit: irc client terminated!]
<Pongles> okay, I will look into that
anisha_ has quit [Ping timeout: 246 seconds]
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicso_ has joined #ruby
kies has quit [Ping timeout: 240 seconds]
gothicsouth has quit [Ping timeout: 268 seconds]
acemo_ has joined #ruby
rgr has joined #ruby
kies has joined #ruby
rohitpaulk has joined #ruby
Kug3lis_off is now known as Kug3lis
Emmanuel_Chanel has quit [Read error: No route to host]
Cohedrin has joined #ruby
zacts has quit [Ping timeout: 246 seconds]
oliv_____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
zacts has joined #ruby
Kug3lis is now known as Kug3lis_off
oliv_____ has quit [Ping timeout: 255 seconds]
gothicsouth has joined #ruby
gothicso_ has quit [Ping timeout: 245 seconds]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
Mortomes|Work has joined #ruby
DoubleMalt has joined #ruby
ahrs has quit [Remote host closed the connection]
TomyLobo has quit [Ping timeout: 240 seconds]
djbkd has quit [Ping timeout: 245 seconds]
Gucciferal has joined #ruby
ahrs has joined #ruby
anisha has joined #ruby
cfec0b8d has joined #ruby
mikecmpbll has joined #ruby
conta has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has quit [Quit: Leaving]
olson86 is now known as N0ATN
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
nofxxxx has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
govg has joined #ruby
nofxxx has quit [Ping timeout: 260 seconds]
mtkd has joined #ruby
roshanavand has joined #ruby
BSaboia has quit [Ping timeout: 260 seconds]
mark_66 has joined #ruby
roshanavand has left #ruby [#ruby]
_sfiguser has quit [Remote host closed the connection]
teclator has joined #ruby
mim1k has joined #ruby
jusa has joined #ruby
ltem has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
ta_ has joined #ruby
jgnagy has quit [Remote host closed the connection]
jaruga________ has joined #ruby
jusa has quit [Ping timeout: 268 seconds]
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aufi has joined #ruby
mim1k has joined #ruby
romank has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
erlend has quit [Ping timeout: 246 seconds]
TomyWork has joined #ruby
jgt has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 255 seconds]
glejeune has joined #ruby
erlend has joined #ruby
oliv_____ has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
zipper is now known as Guest3146
erlend has quit [Ping timeout: 260 seconds]
oliv_____ has quit [Ping timeout: 245 seconds]
cam27 has quit [Quit: cam27]
erlend has joined #ruby
mikecmpbll has joined #ruby
dlitvak has quit [Quit: Connection closed for inactivity]
nowhere_man has joined #ruby
flying has joined #ruby
kies has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
tsul has joined #ruby
ur5us has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
mark_66 has quit [Read error: Connection reset by peer]
mark_66 has joined #ruby
MarkBilk_ has joined #ruby
govg has quit [Ping timeout: 240 seconds]
belmoussaoui_ is now known as belmoussaoui
glejeune has quit [Remote host closed the connection]
al2o3-cr has quit [Quit: WeeChat 1.8]
MarkBilk has quit [Ping timeout: 272 seconds]
rohitpaulk has quit [Ping timeout: 272 seconds]
Dimik has quit [Ping timeout: 260 seconds]
mradmacher has quit [Quit: WeeChat 1.4]
Gucciferal has quit [Ping timeout: 258 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
TheHodge has joined #ruby
MarkBilk has joined #ruby
sonOfRa has quit [Ping timeout: 246 seconds]
sonOfRa has joined #ruby
MarkBilk_ has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
nobitanobi has joined #ruby
al2o3-cr has joined #ruby
polysics has joined #ruby
rohitpaulk has joined #ruby
Emmanuel_Chanel has quit [Read error: No route to host]
nobitano_ has joined #ruby
nobitanobi has quit [Ping timeout: 255 seconds]
rgr has quit [Remote host closed the connection]
dionysus69 has joined #ruby
cfec0b8d has quit [Remote host closed the connection]
Kug3lis_off is now known as Kug3lis
cfec0b8d has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
andikr has joined #ruby
tomphp has joined #ruby
Emmanuel_Chanel has joined #ruby
tomphp has quit [Client Quit]
gregf_ has joined #ruby
tomphp has joined #ruby
workmad3 has joined #ruby
lxsameer has joined #ruby
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 246 seconds]
jusa has joined #ruby
Pumukel has joined #ruby
vdl has quit [Ping timeout: 240 seconds]
jgnagy has joined #ruby
vdl has joined #ruby
jusa has quit [Ping timeout: 255 seconds]
BSaboia has joined #ruby
nowhere_man has joined #ruby
nowhereman has quit [Quit: Konversation terminated!]
andikr has quit [Ping timeout: 260 seconds]
jgnagy has quit [Ping timeout: 255 seconds]
Mortomes|Work_ has joined #ruby
Mortomes|Work has quit [Ping timeout: 260 seconds]
anisha has quit [Read error: Connection reset by peer]
vali has joined #ruby
Shashikant86 has joined #ruby
anisha has joined #ruby
Eiam has quit [*.net *.split]
iNs has quit [*.net *.split]
bhaak has quit [*.net *.split]
ByronJohnson has quit [*.net *.split]
kiltzman has quit [*.net *.split]
lpaste has quit [*.net *.split]
jhass has quit [*.net *.split]
Arahael has quit [*.net *.split]
ablackack has quit [*.net *.split]
Drakevr has quit [*.net *.split]
Didac has quit [*.net *.split]
ntt has quit [*.net *.split]
Sou|cutter has quit [*.net *.split]
uranellus has quit [*.net *.split]
Tralin has quit [*.net *.split]
wopi has quit [*.net *.split]
roger_rabbit has quit [*.net *.split]
freeze has quit [*.net *.split]
seggy has quit [*.net *.split]
joevandyk has quit [*.net *.split]
jdelstrother has quit [*.net *.split]
headius has quit [*.net *.split]
yorickpeterse has quit [*.net *.split]
csaunders has quit [*.net *.split]
shortdudey123 has quit [*.net *.split]
syndikate has quit [*.net *.split]
Karunamon has quit [*.net *.split]
dyjakan has quit [*.net *.split]
ddrmanxbxfr has quit [*.net *.split]
badeball has quit [*.net *.split]
Emmanuel_Chanel has quit [*.net *.split]
roshanavand has quit [*.net *.split]
flying has quit [*.net *.split]
mtkd has quit [*.net *.split]
Authenticator has quit [*.net *.split]
millerti has quit [*.net *.split]
armyriad has quit [*.net *.split]
edgr has quit [*.net *.split]
Archrover has quit [*.net *.split]
__main__ has quit [*.net *.split]
my123 has quit [*.net *.split]
ikopico has quit [*.net *.split]
dhollinger has quit [*.net *.split]
aspiers has quit [*.net *.split]
dn` has quit [*.net *.split]
am55 has quit [*.net *.split]
gf3 has quit [*.net *.split]
jidar has quit [*.net *.split]
lagweezle_away has quit [*.net *.split]
eam has quit [*.net *.split]
irick has quit [*.net *.split]
sjums has quit [*.net *.split]
camilasan has quit [*.net *.split]
giraffe has quit [*.net *.split]
segy has quit [*.net *.split]
ltp has quit [*.net *.split]
jdeen has quit [*.net *.split]
helpa has quit [*.net *.split]
noctux has quit [*.net *.split]
rt has quit [*.net *.split]
avelldiroll has quit [*.net *.split]
_br__ has quit [*.net *.split]
Prira_ has quit [*.net *.split]
sysanthrope has quit [*.net *.split]
nemesit|znc has quit [*.net *.split]
veloutin has quit [*.net *.split]
dysfigured has quit [*.net *.split]
marcellus has quit [*.net *.split]
alnewkir1 has quit [*.net *.split]
Jn_Kell has quit [*.net *.split]
genta has quit [*.net *.split]
thejoecarroll_ has quit [*.net *.split]
dysfigured has joined #ruby
armyriad has joined #ruby
helpa has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bokayio has quit [Ping timeout: 240 seconds]
duracrisis has quit [Ping timeout: 240 seconds]
vondruch_ has joined #ruby
Guest3146 has quit [Ping timeout: 240 seconds]
jaruga_________ has joined #ruby
edgr has joined #ruby
ikopico has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
Archrover has joined #ruby
jaruga________ has quit [Ping timeout: 240 seconds]
Shashikant86 has quit [Quit: Textual IRC Client: www.textualapp.com]
urbanslug has joined #ruby
bokayio has joined #ruby
ur5us has joined #ruby
duracrisis has joined #ruby
sysanthrope has joined #ruby
nobitano_ has quit []
nobitanobi has joined #ruby
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
acemo_ has quit [Quit: Updating details, brb]
acemo_ has joined #ruby
tomphp has joined #ruby
harfangk has joined #ruby
tomphp has quit [Client Quit]
tomphp has joined #ruby
marr has joined #ruby
andikr has joined #ruby
dyjakan has joined #ruby
badeball has joined #ruby
syndikate has joined #ruby
jhass has joined #ruby
csaunders has joined #ruby
Didac has joined #ruby
Tralin has joined #ruby
uranellus has joined #ruby
uranellus has joined #ruby
uranellus has quit [Changing host]
wopi has joined #ruby
bhaak has joined #ruby
ablackack has joined #ruby
ByronJohnson has joined #ruby
kiltzman has joined #ruby
ddrmanxbxfr has joined #ruby
iNs has joined #ruby
yorickpeterse has joined #ruby
Sou|cutter has joined #ruby
shortdudey123 has joined #ruby
lpaste has joined #ruby
Drakevr has joined #ruby
polysics has quit []
Karunamon has joined #ruby
ntt has joined #ruby
TomyWork has quit [Remote host closed the connection]
bokayio has quit [Ping timeout: 240 seconds]
bokayio has joined #ruby
gf3 has joined #ruby
ferr1 has joined #ruby
<kke> how would i make my own Foo("123") coercer thing, like Integer("123"), Array(foo), etc?
<dionysus69> btw I made a script to auto upload youtube videos based on what data is in google sheets https://github.com/webzorg/google-api-automation, maybe someone may use it as a template :)
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<canton7> kke, 'def Foo(input) ...'
<kke> monkeypatching Object i guess
<ljarvis> you don't need to monkeypatch Object
<kke> or Kernel. isn't that what you are monkeypatching if you run `def foo` from main?
<kke> >> def foo; puts "bar"; end; Kernel.method(:foo).call
<zenspider> you're conflating "monkeypatching"
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jokester has quit [Quit: update kernel]
<kke> looks like Array() String() etc are defined as methods in Kernel https://ruby-doc.org/core-2.4.1/Kernel.html#method-i-Array
<ljarvis> sure, you can add it to Kernel. You could also just drop it into the top level of your code
mtkd has joined #ruby
<ljarvis> (which is kind of the same thing)
<kke> unless you're `load`ing the file
<kke> from some strange context
<kke> i think
andikr has quit [Remote host closed the connection]
nug is now known as 94KAAUTVH
Emmanuel_Chanel has joined #ruby
rt has joined #ruby
roshanavand has joined #ruby
dn` has joined #ruby
__main__ has joined #ruby
flying has joined #ruby
dhollinger has joined #ruby
Jn_Kell has joined #ruby
my123 has joined #ruby
millerti has joined #ruby
aspiers has joined #ruby
Authenticator has joined #ruby
segy has joined #ruby
sjums has joined #ruby
irick has joined #ruby
jidar has joined #ruby
am55 has joined #ruby
giraffe has joined #ruby
noctux has joined #ruby
_br__ has joined #ruby
camilasan has joined #ruby
eam has joined #ruby
jdeen has joined #ruby
ltp has joined #ruby
avelldiroll has joined #ruby
nemesit|znc has joined #ruby
veloutin has joined #ruby
Prira_ has joined #ruby
lagweezle_away has joined #ruby
genta has joined #ruby
alnewkir1 has joined #ruby
thejoecarroll_ has joined #ruby
marcellus has joined #ruby
thejoecarroll_ has quit [Max SendQ exceeded]
segy has quit [Max SendQ exceeded]
rt has quit [Max SendQ exceeded]
nemesit|znc has quit [Max SendQ exceeded]
flying has quit [Max SendQ exceeded]
millerti has quit [Max SendQ exceeded]
segy has joined #ruby
nemesit|znc has joined #ruby
flying has joined #ruby
thejoecarroll has joined #ruby
Mortomes|Work_ has quit [Changing host]
Mortomes|Work_ has joined #ruby
vondruch_ has joined #ruby
jaruga_________ has joined #ruby
vondruch_ has quit [Changing host]
jaruga_________ has quit [Changing host]
acemo_ has joined #ruby
acemo_ has quit [Changing host]
nemesit|znc has quit [Remote host closed the connection]
nemesit|znc has joined #ruby
t-recx has joined #ruby
bokayio has quit [Ping timeout: 240 seconds]
syndikate has quit [Ping timeout: 240 seconds]
SirFunk has quit [Ping timeout: 240 seconds]
leonthemisfit has quit [Ping timeout: 240 seconds]
Radar has quit [Ping timeout: 240 seconds]
rt has joined #ruby
bokayio has joined #ruby
syndikate has joined #ruby
SirFunk has joined #ruby
Radar has joined #ruby
Radar is now known as Guest982
rgr has joined #ruby
leonthemisfit has joined #ruby
leonthemisfit has joined #ruby
leonthemisfit has quit [Changing host]
nowhereman has joined #ruby
nowhere_man has quit [Quit: Konversation terminated!]
mathys has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
roshanavand has left #ruby [#ruby]
GodFather has joined #ruby
tomphp has joined #ruby
pandaant has joined #ruby
oliv_____ has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
roshanavand has joined #ruby
rgr has quit [Quit: rgr]
tomphp has joined #ruby
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
teclator has quit [Read error: Connection reset by peer]
robouk has quit [Quit: Konversation terminated!]
opencw has joined #ruby
jrafanie has joined #ruby
jusa has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gil_ has joined #ruby
gil_ has joined #ruby
gil_ has quit [Changing host]
tomphp has joined #ruby
jusa has quit [Ping timeout: 272 seconds]
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
alveric4 has joined #ruby
alveric3 has quit [Ping timeout: 240 seconds]
quazimodo has quit [Ping timeout: 260 seconds]
ur5us has quit [Remote host closed the connection]
nobitanobi has quit []
ChewCraft has joined #ruby
rohitpaulk has quit [Ping timeout: 260 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis is now known as Kug3lis_off
HoierM has joined #ruby
jokester has joined #ruby
ldnunes has joined #ruby
djbkd has joined #ruby
A124 has joined #ruby
Mortomes|Work_ has quit [Ping timeout: 260 seconds]
yehowyada has quit [Quit: Textual IRC Client: www.textualapp.com]
oliv_____ has quit [Remote host closed the connection]
bernd9000 has quit [Remote host closed the connection]
yogg-saron has joined #ruby
jane_booty_doe has joined #ruby
im0nde has joined #ruby
im0nde has quit [Client Quit]
im0nde has joined #ruby
Burgestrand has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
jane_booty_doe has quit [Quit: Leaving]
jane_booty_doe has joined #ruby
bkxd has joined #ruby
jane_booty_doe has quit [Remote host closed the connection]
jbdoe has joined #ruby
oliv_____ has joined #ruby
jbdoe has quit [Remote host closed the connection]
oliv_____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
ltem has quit [Quit: Leaving]
bweston92 has quit [Quit: Connection closed for inactivity]
oliv_____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
belmoussaoui has quit [Ping timeout: 245 seconds]
synthroid has joined #ruby
belmoussaoui has joined #ruby
xall has joined #ruby
jgt has quit [Ping timeout: 255 seconds]
belmoussaoui__ has joined #ruby
xall has quit [Client Quit]
belmoussaoui has quit [Ping timeout: 246 seconds]
pandaant has quit [Remote host closed the connection]
sepp2k has joined #ruby
sepp2k has quit [Client Quit]
sepp2k has joined #ruby
pupsicle has joined #ruby
<dminuoso> asm>> Array(1..2)
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/807655
<dminuoso> asm>> Foo(1..2)
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/807656
<dminuoso> kke: If you use load you have already subscribed to the special semantic it incurs.
Guest____ has joined #ruby
Guest____ has quit [Client Quit]
mostlybadfly has joined #ruby
jenrzzz has joined #ruby
hashrocket has joined #ruby
djbkd has quit [Remote host closed the connection]
nobitanobi has joined #ruby
djbkd has joined #ruby
konsolebox has joined #ruby
djbkd has quit [Remote host closed the connection]
teclator has joined #ruby
djbkd has joined #ruby
rgr has joined #ruby
PatrikasZvaigzde has quit [Ping timeout: 245 seconds]
PatrikasZvaigzde has joined #ruby
djbkd has quit [Ping timeout: 260 seconds]
shinnya has joined #ruby
jaruga_________ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
mim1k has joined #ruby
roamingdog has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
belmoussaoui__ has quit [Ping timeout: 255 seconds]
yogg-saron has joined #ruby
jane_booty_doe has joined #ruby
Burgestrand has quit [Quit: Closing time!]
haylon has joined #ruby
opencw has quit [Quit: Leaving]
opencw has joined #ruby
stupidsenpai has joined #ruby
jgt has joined #ruby
kthibodeaux has joined #ruby
stupidsenpai has quit [Read error: Connection reset by peer]
saschavoid has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
apparition has joined #ruby
pandaant has joined #ruby
jusa has joined #ruby
pandaant has quit [Remote host closed the connection]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vali has quit [Quit: vali]
roamingdog has quit [Ping timeout: 245 seconds]
quazimodo has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
sysanthrope has quit [Remote host closed the connection]
<kke> yes. just hypothesising.
sysanthrope has joined #ruby
gnufied has joined #ruby
yottanami has joined #ruby
<yottanami> How can I write this code `total = 0;@products.each{|product| total += product.price}` using reduce?
<dminuoso> kke: Though no, it does not execute like you suggested.
dionysus69 has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 255 seconds]
<apeiros> kke: proper way to define Foo() is `module Kernel; module_function def Foo(…) … end; end`
<dminuoso> kke: Basically the main difference between the two is that require will not require the same file twice, whereas load will do it again. And load has a second argument (which is not very useful)
mim1k has joined #ruby
<apeiros> yottanami: @products.inject(0) { |sum, product| sum + product.price }
<dminuoso> yottanami: @products.map(&:price).inject(&:+)
<apeiros> dminuoso: don't forget about suffix requirement
<dminuoso> apeiros: mine is shorter! and slower!
<apeiros> dminuoso: shame on you for using &:+ instead of :+, also it's not equivalent without 0 as initial value
<dminuoso> apeiros: Oh. I keep forgetting which stupid enumerable methods support symbols and which dont.
<apeiros> basically inject. only. nothing else.
<dminuoso> Or idk. You are right.
<dminuoso> Haha ok
ur5us has joined #ruby
<dminuoso> fine
<apeiros> I still wish others would too
<dminuoso> @products.map(:price).inject(:+) || 0
<apeiros> like map, select, reject
<dminuoso> apeiros: ^- ?
<cjohnson> Would anybody mind taking a quick look at my exercise and tell me things I could have done better? This is beginner stuff so don't go too crazy but if I did any obviously silly things let me know: https://gist.github.com/chrisjohnson/af563f8c350e7e863c07b730812fee4a
<herwin> @products.map(:price).sum
<apeiros> yes. I'd love it if that'd work as intended. alas it doesn't.
<dminuoso> Oh. Oh.
<dminuoso> herwin wins.
<herwin> only when we're using ruby 2.4 or higher ;)
<herwin> iirc
<apeiros> herwin loses because it's not working
<apeiros> even in 2.4, you need &:price
<apeiros> but yes, .sum++ :)
<cjohnson> Already caught something, I should have just used a constant for factor_words
<dminuoso> We all fail so hard at this.
<apeiros> but loses again because that was not the question. the question specifically asked for inject/reduce :)
<dminuoso> Any way we can bikeshed yottanami's problem any further?
<apeiros> dminuoso: assume @products is an AR Relation
<apeiros> there you go
<apeiros> yottanami: is it? :D
<dminuoso> apeiros: @products.sum(:price)
<dminuoso> or something like that.
<dminuoso> I dont do AR silly stuff.
<dminuoso> Im a manly SQL man.
<apeiros> dminuoso: indeed. || 0 for equivalency
<dminuoso> Yeah.
<dminuoso> Oh that reminds me
<apeiros> yeah, AR's abstraction is too leaky.
<yottanami> dminuoso, It is not Active Record it is a simple object
<apeiros> PORO!
<dminuoso> I should submit a merge request for my where(foo: "") fix for the oracle enhanced adapter, apeiros.
<dminuoso> because seriously that shit is annoying.
<cjohnson> updated to use a constant for FACTOR_WORDS
<apeiros> hm, which way would you want that to work?
<kke> apeiros: looks clean and nice.
<dminuoso> apeiros: consider that you might have where(foo: bar) ;-)
<apeiros> create_empty_blob() or whatever the function was to create a true empty clob?
<dminuoso> Heh.
bkxd has joined #ruby
<apeiros> dminuoso: well, afaik that works correctly, regardless of whether it's nil/"", no?
<dminuoso> apeiros: You taught me that. I surprised the hell out of our oracle expert with that.
<dminuoso> apeiros: No. It emits a stupid where foo = '' clause
<apeiros> ah, right
<apeiros> it's too hot here!
<apeiros> I lose access to basic knowledge!
ur5us has quit [Ping timeout: 260 seconds]
<dminuoso> That high up in the alps?
<dminuoso> heh
<apeiros> I'm at only ~400müm
__Yiota has joined #ruby
<apeiros> what's müm in english? masl?
<dminuoso> Oh really, I didn't know that
<apeiros> (meters above sea level)
<dminuoso> apeiros: NHN
<apeiros> o0
<dminuoso> Is international even
<apeiros> lol, even though it stands for Normalhöhennull?
<dminuoso> Yeah. meters above NHN.
<dminuoso> :-)
<apeiros> seems like.
<apeiros> so 500NHN?
<apeiros> or 500man? (500 meters above NHN)?
<apeiros> this stuff is silly
__Yiota has quit [Client Quit]
<dminuoso> Mmmm
<apeiros> and it's still too effing hot
<apeiros> or fracking hot, if you're a battlestarist
<dminuoso> Fracking hot is that chick just passed by on the street.
<herwin> apeiros: you probably have to convert the meters to feet as well
HoierM has quit [Ping timeout: 240 seconds]
<dminuoso> apeiros: She could have been number six.
<apeiros> dminuoso: I'm more of a treckie, so… a 7of9?
<dminuoso> Yes.
<dminuoso> Very much so.
<dminuoso> number six is seven of nine without implants.
<dminuoso> Since it's basically taking a seven and removing parts.
<dminuoso> So you end up with six.
<dminuoso> Does that make any sense?
<apeiros> the mathematical relation between ST:VOY and BSG
<apeiros> we're very OT btw.
<dminuoso> def we_can_express_this; in_ruby(:code); too(); end
<dminuoso> %[no longer offtopic now, is it?]
<apeiros> def I(think: "this"); qualifies.as(:cheating); end
<dminuoso> apeiros: In Germany it's `m ü NHN'
<apeiros> not enough acronym inception
<dminuoso> That's because inception wasnt made when they came up with that.
<dminuoso> Pray that SI doesnt get wind of this.
ltem has joined #ruby
nobodyzxc has joined #ruby
<apeiros> GNU existed before too
<apeiros> and that's even infinite recursive acronym inception
<dminuoso> Im not sure about that.
<cjohnson> So I understand that :foo is a Symbol for 'foo', so can somebody explain to me what :+ here is doing? (5..10).reduce(:+)
<dminuoso> I have expanded GNU quite deeply, but Im not convinced that its truly recursive.
<cjohnson> from the ruby docs on Enumerable#reduce
nobodyzxc has quit [Client Quit]
<apeiros> cjohnson: :foo is not a symbol for "foo"
<cjohnson> wording
<cjohnson> "foo" is the string representation of the symbol :foo
<dminuoso> cjohnson: symbols are just a very fast way method of conveying information.
<apeiros> :foo is a symbol. its "value" can be represented by the string "foo". though it's actual value is actually a number.
<dminuoso> cjohnson: No it is not.
<dminuoso> cjohnson: symbols are just numbers
<apeiros> ^
<dminuoso> that happen to have a string representation.
<cjohnson> Right, and in the case of :foo, is the string representation not "foo"?
<dminuoso> cjohnson: The reason has to do with the fact that equality checks with numbers are much much faster than equality checks with strings.
<apeiros> anyway, to answer your question
<dminuoso> cjohnson: no.
<apeiros> the :+ tells inject that it should use the method +
<dminuoso> cjohnson: the string representation *IS* :foo
<dminuoso> >> :foo.to_i
<ruby[bot]> dminuoso: # => undefined method `to_i' for :foo:Symbol ...check link for more (https://eval.in/807766)
<apeiros> and the internal representation of method names are … tadaaa… symbols
<dminuoso> oh.
<cjohnson> >> :foo.to_s
<ruby[bot]> cjohnson: # => "foo" (https://eval.in/807767)
<dminuoso> >> :foo.internal
<ruby[bot]> dminuoso: # => undefined method `internal' for :foo:Symbol ...check link for more (https://eval.in/807768)
<dminuoso> bah
<cjohnson> looks like "foo" is the string representation of :foo ??
<dminuoso> >> :foo.intern
<ruby[bot]> dminuoso: # => :foo (https://eval.in/807769)
<dminuoso> cjohnson: no thats an actual conversion.
<cjohnson> Right
<cjohnson> I understand that the string is not the unique ID I'm just saying
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
<cjohnson> apeiros: Ok that makes sense
ResidentBiscuit has joined #ruby
<apeiros> interesting. seems current ruby no longer lets you access the numeric value.
<dminuoso> >> :foo.object_id
<ruby[bot]> dminuoso: # => 450738 (https://eval.in/807770)
<dminuoso> cjohnson: ^- there.
<cjohnson> Do all methods have symbols?
<apeiros> cjohnson: no
<dminuoso> cjohnson: Yes.
<cjohnson> lol
<apeiros> cjohnson: misunderstanding
<apeiros> all identifiable things in ruby have their identification as symbols
<cjohnson> got it
<apeiros> so "yes, all methods have symbols" if you accept bad wording :-p
<cjohnson> I'm newb, accept my bad wording for now please lol
<apeiros> proper: "yes, all methods are identified by a symbol"
rgr has quit [Quit: rgr]
<cjohnson> so in JS you can pass functions around as first class values. In ruby it seems like if you want to pass a method you want to pass its symbol
<dminuoso> cjohnson: It depends.
<dminuoso> cjohnson: You can also pass methods as first class values
<dminuoso> it just takes a little extra effort to do so.
<elomatreb> You can detach methods, but you need to attach them again if you want to call them
<dminuoso> ^-
<cjohnson> dminuoso: can you give an example?
<apeiros> it's gotten a bit trickier to prove that since ruby seems to create symbols more eagerly. but back in the days you could prove it by: `before = Symbol.all_symbols.dup; def foobarbaz; end; p(Symbol.all_symbols - before)`
<apeiros> it'd print "[:foobarbaz]"
<dminuoso> >> a = "foo".method(:length); p a
<ruby[bot]> dminuoso: # => #<Method: String#length> ...check link for more (https://eval.in/807771)
<dminuoso> cjohnson: ^-
<dminuoso> cjohnson: but yeah, you'd usually go the symbol way
<apeiros> elomatreb: you don't have to detach
Eleeleth has quit []
<apeiros> elomatreb: .instance_method detaches, .method doesn't
<dminuoso> cjohnson: the interesting thing is, when you do "foo".length what actually happens internally is "foo".send(:length)
kubunto has joined #ruby
<dminuoso> which is why using symbols is about as good.
<cjohnson> gotchya, that makes sense. so everything in ruby is implemented as a method basically?
<cjohnson> as far as operations
<dminuoso> cjohnson: No.
<cjohnson> ha
<apeiros> cjohnson: there are some syntax operations. but they are rare.
<dminuoso> cjohnson: There's some things that are optimized away.
<apeiros> defined?, &&, || and a couple of others
<apeiros> alias
<apeiros> super
<cjohnson> oh yeah good call
<apeiros> those are probably the most common syntax based operations
<cjohnson> those make sense
<matthewd> But yes, most operators are methods
<apeiros> stuff like +, -, ^, =~, [], []= etc. are despite their look actually methods
<dminuoso> cjohnson: for example: 1+2 is not a method
<dminuoso> asm>> 1+2
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/807774
HoierM has joined #ruby
<cjohnson> Isn't that slow?
<dminuoso> cjohnson: it's built as an immediate optimized vm instruction.
<cjohnson> gotchya
<apeiros> e.g. `foo[123, 45] = 67` is actually `foo.[]=(123,45,67)`, or `foo.send(:[]=, 123,45,67)`
<dminuoso> cjohnson: And yes, the worst part because methods can be monkey patched by anyone at any time, it leads to horribile performance.
<apeiros> dminuoso: makes me wonder whether ruby 3 will finally have that deoptimization thingy in it. they wanted to speed up arithmetic operations for inferred types and only deoptimize in case any of those get overridden (which happens almost never)
__Yiota has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<matthewd> dminuoso: Except yes it is a method
<cjohnson> So what is the general stance? Do seasoned rubyists tend to scoff at a lot of metaprogramming because it leads to bad performance?
<dminuoso> matthewd: Oh. oh. Yes.
<cjohnson> or are there good ways to get good performance without giving it all up
<dminuoso> You are right.
<matthewd> The fact the implementation has a shortcut for the default behaviour doesn't change that.
<dminuoso> cjohnson: No, the performance penalty has been incurred when you use Ruby.
<apeiros> and that penalty isn't as bad anymore as it used to be
<dminuoso> cjohnson: The mere fact that it *is* possible prevents Ruby from doing trivial optimizations.
<cjohnson> yeah
<cjohnson> ok that makes sense
<apeiros> the general consensus is that in most code it doesn't matter and that ruby saves enough time to rewrite sensitive stuff in native code if necessary.
<apeiros> and in most cases it becomes evident that it isn't actually necessary
<apeiros> so you just get the saved time ;-)
<cjohnson> Ha
<cjohnson> Yeah I get that, coming from JS and PHP
<dminuoso> cjohnson: Though if you look at chrisseaton's (et al) truffle/graal you can actually see amazing JIT behavior that can tackle these dynamic portions
<dminuoso> and bring Ruby in line with Java in terms of performance
<cjohnson> spent a lot of time telling C++ devs to chill out about performance
<cjohnson> hrm
<dminuoso> cjohnson: So it can be optimized. But MRI doesn't do much (yet)
<apeiros> bottom line: ruby is not the best choice for everything. now replace "ruby" with anything.
<cjohnson> ha
<dminuoso> cjohnson: In fact Ruby only optimizes the most trivial cases during compile time, and then tries to do the rest with heavy caching and cache invalidation strategies left and right.
<elomatreb> No, Javascript is obviously the perfect language and is probably what the universe is implemented in
<cjohnson> Seems like that leads to limited static analysis tooling
yottanami has quit [Ping timeout: 240 seconds]
<dminuoso> cjohnson: Indeed.
<cjohnson> can you lint ruby very well?
<dminuoso> No.
<cjohnson> I see
<elomatreb> It does, you need to write extensive comments for documentation
<dminuoso> Only for style mostly.
<cjohnson> elomatreb: lol yeah so then the answer is no
<cjohnson> hahaha
<apeiros> elomatreb: you surely meant lisp
<dminuoso> cjohnson: But the dynamic nature makes static analysis completely impossible. something like flowtype is not possible in pure ruby
<dminuoso> cjohnson: However there's Crystal.
<elomatreb> cjohnson: I was replying to "Seems like that leads to limited static analysis tooling" ;)
<cjohnson> Fair. Either way, if it relies on commenting, that means it's pretty limited imo
<cjohnson> most of those tools are there to catch things I didn't think of
<cjohnson> imo anyway
<dminuoso> cjohnson: The fact that you can brutally pry into ObjectSpace means you can globally fuck around with any object
<dminuoso> from anywhere.
<dminuoso> Which makes it impossible for any static tool to reason about anything.
<cjohnson> So there's no such thing as a sandboxed namespace that is safe from being touched by other code?
<elomatreb> The flipside of the Rust strategy of having programmers fight the compiler to get the program running
<matthewd> cjohnson: Correct
<dminuoso> elomatreb: Im not convinced. The program compilers if your semantics are right, and if the compiler emits errors it means your program is wrong.
beccamorgan has joined #ruby
<dminuoso> *the compiler errors..
<dminuoso> err *the program compiles..
<dminuoso> too hot. way too hot.
<elomatreb> Of course, but it makes translating the abstract concept of what you want to implement into code which the compiler then can translate harder
<dminuoso> elomatreb: In JS I find myself spending all that time "saved fighting the compiler" writing tests and flowtype definitions to ensure that proper semantics are preserved. So basically voiding all that effort saved. :P
<matthewd> dminuoso: if the compiler emits errors it means the compiler can't prove that your program is right
<dminuoso> matthewd: No, but it can prove its wrong.
<dminuoso> Ruby doesn't do either.
<dminuoso> Or rather JS since that was the basis of this discussion.
railswebdev has joined #ruby
tvw has joined #ruby
<dminuoso> matthewd: Mind my asking since I was curious anyway. Do you contribute to Rails for a living?
kubunto is now known as kubunto|afk
chouhoul_ has joined #ruby
<matthewd> Not particularly. Mostly free time, but if my employer has a specific need, then I'm obviously well placed to help stuff happen.
jane_booty_doe has quit [Quit: Leaving]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 240 seconds]
bkxd_ has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
tomphp has joined #ruby
eblip has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
A124 has quit [Disconnected by services]
A124 has joined #ruby
Kug3lis_off is now known as Kug3lis
94KAAUTVH is now known as nug
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
oleo has joined #ruby
charliesome has joined #ruby
<cjohnson> It seems like blocks get some sort of special treatment when being passed into functions. For example, to pass a block to Enumerable#reduce, you can just pass it like foo.reduce { |n| ... }
ta_ has quit [Remote host closed the connection]
jrafanie has joined #ruby
<cjohnson> But if you want to pass an initial value, it needs to be in a sorta seperate set of arguments, like: foo.reduce(0) { |n| ... }
<cjohnson> why is that? where can I read more about that behavior? Do methods get a special "block argument" space that is separate from normal args?
<matthewd> cjohnson: Yes, the block parameter is a syntactically separate thing
<cjohnson> ok so it's kinda like `this` in JS
<cjohnson> it's an argument, but it doesn't sit in the normal args list
<cjohnson> Are you limited to one block?
<apeiros> you can have it in the arg list too
<apeiros> yes, one block only
<apeiros> re in arg list: add_one = ->(n) { n + 1 }; [1,2,3].map(&add_one)
<cjohnson> How do you access teh block? does it do anythin magic or is it just an argument that the mehtod can use how it sees fit?
LastWhisper____ has joined #ruby
<apeiros> you can tell ruby to create an object representation of it by defining your method with a &arg: `def foo(&arg); …`
<apeiros> the variable `arg` will then contain the block
<matthewd> cjohnson: `yield` and `block_given?` built-ins, or &arg ^^
<cjohnson> interesting
<apeiros> if you don't need an object ^
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cjohnson> Are arguments optional? What happens if you omit a block in the def foo(&arg) ?
GodFather has joined #ruby
<apeiros> also `Proc.new` (without a block) will create a proc from the block (that's arcane btw., not many ruby coders will understand)
<matthewd> Block arguments are optional; others are required unless they have a default
mikecmpbll has quit [Quit: inabit. zz.]
<apeiros> I'd amend this to: blocks are *always* optional. it'll only ever raise if it tries to actually access it.
<apeiros> also you can pass a block to methods which don't make use of it:
<apeiros> >> puts "hi" do "what?" end
<ruby[bot]> apeiros: # => hi ...check link for more (https://eval.in/807865)
<apeiros> they'll simply ignore the block.
<apeiros> (NB: I don't exactly like that behavior)
mikecmpbll has joined #ruby
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
patarr has joined #ruby
cdg has joined #ruby
__Yiota has joined #ruby
<cjohnson> interesting
<apeiros> also note that `super`'s behavior wrt blocks and arguments is super unobvious
bkxd_ has quit [Ping timeout: 260 seconds]
<apeiros> `super` passes on all args passed to the method, `super()` will pass zero arguments, but will still pass on a block passed to the current method, `super(&nil)` passes no arguments and suppresses passing the block
hobodave has joined #ruby
<apeiros> note that in `def foo(a,b); a = 2; super; end; foo(5, 6)` will invoke the super method with the arguments (2, 6)
belmoussaoui has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
teclator has quit [Remote host closed the connection]
<cjohnson> oh that looks lovely lol
<cjohnson> Thanks apeiros that is a fantastic little explanation of various gotchyas
tomphp has joined #ruby
<cjohnson> So def foo(&block, a, b) will I call that as foo(1, 2) { |n| ... } ?
<cjohnson> same q with foo(a, b, &block)
meshsmith has joined #ruby
<matthewd> &block has to come last, but yes
<cjohnson> does it just sort of pluck the &block arg out of the list? or do I need it in a certain place
<cjohnson> oh ok
<cjohnson> makes sense
<cjohnson> Ok I think this is my last question for at least 10 minutes: Can you use both &block arg and the yield operator?
antgel has joined #ruby
<matthewd> Yes (and they'll both use the same/only block)
<cjohnson> >> def foo(&block); block; yield; block; end; foo { puts 'block' }
<ruby[bot]> cjohnson: # => block ...check link for more (https://eval.in/807898)
<cjohnson> perfect
dn` has quit [Read error: Connection reset by peer]
dn` has joined #ruby
<cjohnson> Why only 1 "block" here?
<apeiros> because reasons
<apeiros> design decision I guess
<havenwood> cjohnson: The return value is the one block. If you want those blocks to call: block.call
<apeiros> you can always pass any number of lambdas or procs, though
chouhoul_ has quit [Remote host closed the connection]
<cjohnson> Oh does puts not work in the bot? maybe that was my issue?
BSaboia has quit [Quit: Leaving]
<apeiros> it does
<apeiros> click the link
<cjohnson> I get why the final block was returned after havenwood's comment
<cjohnson> I did but I don't see "block" printed 3 times
<cjohnson> or even 2
<cjohnson> given the return
<apeiros> I misunderstood your question btw., I thought "why only 1 block" as "why only 1 block argument"
mtkd has quit [Ping timeout: 260 seconds]
<cjohnson> >> def foo(&block); block; yield; block; end; foo { puts 'I am here' }
<ruby[bot]> cjohnson: # => I am here ...check link for more (https://eval.in/807899)
<apeiros> as havenwood said, block.call
<cjohnson> Oh so you can't use a block like a method
<apeiros> it isn't a method :)
<apeiros> it's an object
<apeiros> or rather, "block" is a local variable
<cjohnson> got it
<apeiros> referencing to a reified block
mtkd has joined #ruby
<cjohnson> >> def foo(&block); block.call; yield; block.call; 'my return'; end; foo { puts 'I am here' }
<ruby[bot]> cjohnson: # => I am here ...check link for more (https://eval.in/807900)
<cjohnson> aha
<cjohnson> Thanks much everybody for helping me understand this stuff
<cjohnson> Is there any magic to `yield`? Or does it basically just do block.call
<apeiros> next level: figure out how scoping works related to `next`, `break`, `return`
<cjohnson> Cool, I will do some research on that stuff
<apeiros> it does block.call, with less effort
cdg_ has joined #ruby
<apeiros> converting between object and object-less block costs a bit
cdg has quit [Read error: Connection reset by peer]
<cjohnson> Ok so using yield over using a named block arg seems like it would be the more common usage
SuperLag has quit [Quit: Lost terminal]
<cjohnson> especially given the limit to 1 block
<apeiros> performance considerations: `def foo; yield; end` is faster than `def foo(&block); block.call; end`
<cjohnson> beautiful
<apeiros> but: `def foo; @data.each do |*args| yield(*args) end; end` is *slower* than `def foo(&block); @data.each(&block); end`
aurelien has joined #ruby
<apeiros> i.e. passing on a block which is invoked multiple times -> use &block
<apeiros> invoke a block directly -> use yield
<cjohnson> makes sense
<cjohnson> so Enumerable#reduce probably uses the named version (if you were to write the method in ruby)
<cjohnson> and other such enumerable stuff
<apeiros> and obviously: if you want to invoke the block at another time (aka "later") - use block
<cjohnson> ah yes
ferr1 has quit [Quit: WeeChat 1.7]
<apeiros> since it adds its own stuff in each iteration, I'd probably write it using yield
<apeiros> it's not a blanket delegation
SuperLag has joined #ruby
<cjohnson> I see
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
antgel has quit [Ping timeout: 260 seconds]
CacoS has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rippa has joined #ruby
jrafanie has joined #ruby
__Yiota has joined #ruby
roychri has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
<cjohnson> https://www.sitepoint.com/understanding-scope-in-ruby/ cool, this all makes sense to me. It seems pretty similar to JS in respect to scoping
mikecmpbll has quit [Quit: inabit. zz.]
jgnagy has joined #ruby
aufi has quit [Quit: Leaving]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
mikecmpbll has joined #ruby
cschneid_ has joined #ruby
meshsmith has quit [Remote host closed the connection]
duderonomy has quit [Ping timeout: 268 seconds]
TomyLobo has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oliv_____ has quit [Remote host closed the connection]
kegster has joined #ruby
olivi____ has joined #ruby
u0_a190 has joined #ruby
<cjohnson> Ok so @@ and @ are sorta like "static" variables that exist at the class level, and the difference seems to be in inheritance
<cjohnson> >> class Foo; attr_accessor :thing; thing = 'my thing'; end; Foo.new.thing
<ruby[bot]> cjohnson: # => nil (https://eval.in/807906)
<cjohnson> Am I misunderstanding how to use thing = 'my thing' here? I found a similar example in that sitepoint article
<cjohnson> My guess is probably that thing = 'my thing' needs to go in initialize
<matthewd> cjohnson: That's setting a local variable called 'thing'
<cjohnson> local to the instance?
<matthewd> Local to the scope, unrelated to the accessor
__Yiota has joined #ruby
<matthewd> You need `self.thing = ..` to call the accessor... and then yes, you'll need to put it in initialize
<cjohnson> Ok so is the only difference the fact that I can access Foo.thing
<cjohnson> if it's @thing
<cjohnson> But if it's thing = 'my thing' then regardless of attr_* I can't call Foo.thing
<cjohnson> ?
<elomatreb> No, you can access Foo.new.thing, important difference
<matthewd> Ruby @x == JS this.x (approximately)
<havenwood> cjohnson: `attr_accessor :thing` gets and sets `@thing` with the #thing and #thing= methods. Internally you can get and set `@thing` directly
ur5us has joined #ruby
<cjohnson> Ok so the attr_* stuff is more for external use, but internally you can just access the var directly using @. which will bypass getters and setters logic
<matthewd> Ruby `foo = 1` == JS `let foo = 1`
<cjohnson> Ok, makes sense
<apeiros> cjohnson: you can mostly forget about @@ and $
<elomatreb> Re-implementing the attr_* methods is a great exercise btw
<apeiros> they should only be used in exceedingly rare occasions
<cjohnson> Oh right and for "static class" variables that's where you do class Foo; self.static_thing = 'my static value'; end
<matthewd> Yes; attr_accessor is a shortcut for `def foo; @foo; end; def foo=(value); @foo = value; end`
<cjohnson> And that gives me Foo.static_thing
olivi____ has quit [Remote host closed the connection]
<apeiros> class << Foo; attr_accessor :static_thing; end
<apeiros> for funsies
<elomatreb> No, there are no properties in Ruby like in Javascript. Everything you access from "outside" a class is a method
<apeiros> usually done via `class Foo; class << self; …; end; end`
u0_a190 has quit [Ping timeout: 245 seconds]
<apeiros> (since self == Foo in that context)
<cjohnson> elomatreb: sorry, ignoring the method part. Object.keys in JS might be defined in ruby as class Object; def self.keys... end; end
<apeiros> yes
<cjohnson> But Object#hasOwnProperty might be class Object; def hasOwnProperty...; end; end
olivi____ has joined #ruby
<apeiros> or directly: def Object.keys; …; end
<cjohnson> Oh neat
<apeiros> which btw. works for any object
<apeiros> >> x = "hello"; def x.only_this_string; "#{self} woot!"; end; x.only_this_string
<ruby[bot]> apeiros: # => "hello woot!" (https://eval.in/807909)
<matthewd> Note that JS properties and methods live in the same namespace; that is not so in Ruby
<cjohnson> matthewd: can you expand on that?
<elomatreb> Almost any, no? Can't do that with immediate thingies I think?
<matthewd> `self.foo` and `@foo` are unrelated
<apeiros> elomatreb: correct
ur5us has quit [Ping timeout: 246 seconds]
<cjohnson> matthewd: because self.foo defines it on the class but @foo defines it on the instance?
<matthewd> (unless the 'foo' method happens to use @foo internally, for example)
<apeiros> elomatreb: also some other objects which chose to emulate immediates (Floats e.g.)
<matthewd> cjohnson: No, because instance variables and methods are unrelated
<cjohnson> hrm
<apeiros> cjohnson: he means call-site
<cjohnson> oh ok
<baweaver> morning
ascarter has joined #ruby
gothicsouth has joined #ruby
<cjohnson> marnin
safetypin has joined #ruby
<baweaver> BART got delayed, so coffee shop time
<apeiros> >> class Foo; def initialize; @foo = 123; end; def foo; 789; end; def bar; {@foo: @foo, foo: self.foo}; end; end; Foo.new.bar
<ruby[bot]> apeiros: # => /tmp/execpad-b41d220cf9d4/source-b41d220cf9d4:2: syntax error, unexpected ':', expecting => ...check link for more (https://eval.in/807910)
<apeiros> >> class Foo; def initialize; @foo = 123; end; def foo; 789; end; def bar; {"@foo": @foo, foo: self.foo}; end; end; Foo.new.bar
<ruby[bot]> apeiros: # => {:@foo=>123, :foo=>789} (https://eval.in/807911)
<apeiros> right, :@foo works, @foo: doesn't.
* apeiros stumbled over that before…
olivi____ has quit [Remote host closed the connection]
<apeiros> cjohnson: like ^
shinnya has quit [Ping timeout: 240 seconds]
<elomatreb> apeiros' fancy client collapses ... into a proper character, I'm jealous
<apeiros> elomatreb: no, I type it properly
<apeiros> opt-. is … here
oliv_____ has joined #ruby
<apeiros> with osx, you could set up a global short-cut for ... to collapse, though
<apeiros> btw., I mostly type it properly because it's less effort :D
Flonk has joined #ruby
<baweaver> apeiros: I'd hate OSX if it auto-collapsed that
* apeiros is the laziest of all lazy bastards
brent__ has joined #ruby
<apeiros> baweaver: js? :D
<baweaver> think ranges as well
DTZUZU has quit [Read error: Connection reset by peer]
aupadhye has quit [Ping timeout: 260 seconds]
oliv_____ has quit [Remote host closed the connection]
<apeiros> oh, right. I think I actually rarely use exclusive ranges.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
olivi____ has joined #ruby
<baweaver> but yeah, js too
chouhoulis has joined #ruby
<apeiros> maaaan, I really *love* how spreadsheet gem randomly converts dates to Date instances or Floats</sarcasm>
konsolebox has quit [Quit: Leaving]
mim1k has quit [Read error: Connection reset by peer]
<baweaver> apeiros: ask zenspider about rspec making their own inspect / pretty print interceptors
__Yiota has joined #ruby
<mikecmpbll> :D
<apeiros> baweaver: bah, zenspider made his own NilClass#method_missing black hole…
<apeiros> so he clearly takes the cake in that regard :-p
<baweaver> karma it is then
<apeiros> anyway, all those are/were deterministic
<baweaver> well, between that and what people like me, havenwood, Ox0dea, and banisterfiend have done to the language we're all due for some karmic fallout
brent__ has quit [Remote host closed the connection]
<apeiros> I can't figure out when spreadsheet behaves one way or the other. I run it twice on the same data with differing results.
brent__ has joined #ruby
conta has quit [Ping timeout: 260 seconds]
<baweaver> set_trace_func / binding.pry if value is a String and matches your data?
<baweaver> that way you have an interceptor that can trace the caller wherever that value happens to come up as a string
<baweaver> required reading :D
<baweaver> it's one of apeiros's favorites
<apeiros> ooooh dear
<apeiros> I figured why
<baweaver> do share
<apeiros> I do: data = sheet.to_a; data.map! { |c1, c1, …| }
<apeiros> I don't do *anything* with the column in question
<apeiros> but! data is not an array of arrays, it's an array of Spreadsheet::Excel::Row's, and splatting that converts
<apeiros> I'm not quite sure why, though, since neither Row#to_a nor #to_ary exhibit that behavior when called directly
<elomatreb> "PHP programmers may want to try implementing $REGISTER_GLOBALS for Rack." -- Some people just want to watch the world burn?
<apeiros> but adding a data.map!(&:to_a) fixes the issue… I thought ruby invoked to_ary or to_a (first which it responds to) for splatting…
perniciouscaffei has joined #ruby
<apeiros> elomatreb: didn't php developers figure out already that that was a bad idea to begin with? o0
cam27 has joined #ruby
<elomatreb> IIRC register_globals doesn't exist anymore for quite some time (5.5 I think?) and it was disabled by default long before that
<elomatreb> (The quote was from the article baweaver linked)
ozcanesen has joined #ruby
DTZUZU has joined #ruby
<apeiros> ok, I tested and ruby indeed tries to_ary first
synthroid has quit [Remote host closed the connection]
<apeiros> oooooh wow wtf, Row#to_ary actually returns itself (a Row instance, not an Array), didn't notice because same inspect
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kitikonti has joined #ruby
nobitanobi has quit [Remote host closed the connection]
DoubleMalt has quit [Ping timeout: 240 seconds]
mwlang has joined #ruby
<mwlang> /join #rubyonrails
<baweaver> give it some space mwlang :D
GodFather has quit [Ping timeout: 272 seconds]
jrafanie has joined #ruby
ozcanesen has quit [Quit: Textual IRC Client: www.textualapp.com]
<mwlang> baweaver: heh, no kidding. apparently, my login was still “registering”
<apeiros> I really don't get what ruby does there. if I create a BasicObject which returns itself on to_ary, ruby only ever calls to_ary once and nothing else and then raises
<apeiros> no idea why it wouldn't raise for the Row which returns itself too
<apeiros> aaahahaha, figured. Row < Array
<apeiros> now I just have to figure why that in turn causes this weird conversion of Date -> Float
belmoussaoui has quit [Remote host closed the connection]
zacts has quit [Ping timeout: 255 seconds]
belmoussaoui has joined #ruby
im0nde has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Cohedrin has joined #ruby
solos has quit [Ping timeout: 260 seconds]
marxarelli has joined #ruby
beccamorgan has quit [Read error: Connection reset by peer]
solos has joined #ruby
Exagone313 has quit [Quit: see ya!]
sneakerhax has quit [Ping timeout: 268 seconds]
belmoussaoui_ has joined #ruby
belmoussaoui has quit [Ping timeout: 260 seconds]
beccamorgan has joined #ruby
<cjohnson> baweaver: lol good article
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Exagone313 has joined #ruby
beccamorgan has quit [Remote host closed the connection]
nowhereman has quit [Ping timeout: 246 seconds]
beccamorgan has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
acemo_ has quit []
acemo has joined #ruby
gusrub has joined #ruby
gusrub has quit [Client Quit]
HoierM has quit [Ping timeout: 260 seconds]
ltd has quit [Ping timeout: 268 seconds]
gusrub has joined #ruby
ltd has joined #ruby
nobitanobi has joined #ruby
yeticry_ has joined #ruby
raspado has joined #ruby
nitric has joined #ruby
ascarter has joined #ruby
yeticry has quit [Ping timeout: 268 seconds]
Nightmare has quit [Excess Flood]
hobodave has quit [Quit: Computer has gone to sleep.]
Nightmare has joined #ruby
jaruga_________ has quit [Quit: jaruga_________]
synthroid has joined #ruby
Cohedrin has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
kubunto|afk has left #ruby [#ruby]
GodFather has joined #ruby
nowhereman has joined #ruby
kies has joined #ruby
muelleme has joined #ruby
ruby-lang972 has joined #ruby
hobodave has joined #ruby
dcunit3d has joined #ruby
__Yiota has joined #ruby
u0_a190 has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mark_66 has quit [Remote host closed the connection]
lxsameer has quit [Quit: WeeChat 1.7]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
olivi____ has quit [Remote host closed the connection]
mtkd has quit [Ping timeout: 268 seconds]
mtkd has joined #ruby
ruby-lang972 has quit [Ping timeout: 260 seconds]
u0_a190 has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
belmoussaoui_ has quit [Read error: Connection reset by peer]
belmoussaoui_ has joined #ruby
gusrub has quit [Ping timeout: 272 seconds]
yottanami has joined #ruby
Nightmare has quit [Excess Flood]
hutch34 has joined #ruby
belmoussaoui has quit [Ping timeout: 260 seconds]
haylon has quit [Remote host closed the connection]
jrafanie has joined #ruby
Nightmare has joined #ruby
romank has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fernando-Basso has joined #ruby
haylon has joined #ruby
belmoussaoui has joined #ruby
haylon has quit [Remote host closed the connection]
haylon has joined #ruby
JoshS has quit [Quit: Leaving]
renchan has quit [Quit: Leaving...]
duderonomy has joined #ruby
oliv_____ has joined #ruby
belmoussaoui_ has quit [Ping timeout: 260 seconds]
Cohedrin has joined #ruby
belmoussaoui has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
lf_an has joined #ruby
lf_an has left #ruby [#ruby]
roshanavand has quit [Quit: Leaving.]
BTRE has quit [Ping timeout: 240 seconds]
machinewar has joined #ruby
ldnunes has quit [Ping timeout: 240 seconds]
beccamorgan has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
belmoussaoui has quit [Ping timeout: 246 seconds]
chalkmonster has joined #ruby
BTRE has joined #ruby
belmoussaoui has joined #ruby
gusrub has joined #ruby
ur5us has joined #ruby
belmoussaoui has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
machinewar has quit []
ur5us has quit [Ping timeout: 260 seconds]
oliv_____ has quit [Remote host closed the connection]
nobitano_ has joined #ruby
shinnya has joined #ruby
<adaedra> hi
ldnunes has joined #ruby
gothicsouth has joined #ruby
belmoussaoui has quit [Ping timeout: 246 seconds]
<havenwood> g'mornin'
belmoussaoui has joined #ruby
ol_______ has joined #ruby
nobitanobi has quit [Ping timeout: 260 seconds]
uZiel has joined #ruby
* kenichi waves
hutch34 has quit [Read error: Connection reset by peer]
dain has joined #ruby
<apeiros> moin
hutch34 has joined #ruby
Didac has quit [Changing host]
Didac has joined #ruby
ol_______ has quit [Ping timeout: 255 seconds]
dain has quit [Quit: dain]
jane_booty_doe has joined #ruby
belmoussaoui has quit [Ping timeout: 245 seconds]
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
yottanami has quit [Ping timeout: 268 seconds]
GinoMan has joined #ruby
normie1 has joined #ruby
jane_booty_doe has quit [Client Quit]
oliv_____ has joined #ruby
mim1k has joined #ruby
beccamorgan has joined #ruby
DLSteve_ has joined #ruby
dc2 has joined #ruby
beccamorgan has quit [Remote host closed the connection]
dcunit3d has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
yottanami has joined #ruby
beccamorgan has joined #ruby
hobodave has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 260 seconds]
hobodave has joined #ruby
jgt has quit [Ping timeout: 255 seconds]
lxsameer has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
kirun has joined #ruby
donald has joined #ruby
<donald> hi
jgt has joined #ruby
<donald> is there a french irc channel about ruby?
<apeiros> ?channels donald
<ruby[bot]> donald: see http://ruby-community.com/pages/channels for a list of Ruby related channels on Freenode
hutch34 has quit [Ping timeout: 240 seconds]
<apeiros> #ruby.fr as it seems
quobo is now known as icydoge
Kug3lis is now known as Kug3lis_off
Pumukel has quit [Ping timeout: 255 seconds]
icydoge is now known as Guest45084
Guest45084 is now known as quobo
quobo is now known as qdoge
qdoge is now known as sdhand
sdhand is now known as Guest43073
Guest43073 is now known as quobo
muelleme has quit [Ping timeout: 260 seconds]
quobo is now known as c_s
c_s is now known as quobo
faces has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
muelleme has joined #ruby
beccamorgan has quit [Read error: Connection reset by peer]
faces has joined #ruby
Eiam has joined #ruby
ta_ has joined #ruby
hutch34 has joined #ruby
Kug3lis_off is now known as Kug3lis
uZiel has quit [Ping timeout: 248 seconds]
GodFather has quit [Ping timeout: 272 seconds]
belmoussaoui has quit [Remote host closed the connection]
beccamorgan has joined #ruby
Ferdroid has joined #ruby
belmoussaoui has joined #ruby
Bock has quit [Read error: Connection reset by peer]
beccamorgan has quit [Remote host closed the connection]
Exagone313 has quit [Quit: see ya!]
ta_ has quit [Quit: Leaving...]
hobodave has quit [Quit: Computer has gone to sleep.]
beccamorgan has joined #ruby
yottanami_ has joined #ruby
yottanami has quit [Remote host closed the connection]
conta2 has joined #ruby
lxsameer has joined #ruby
nobitano_ has quit [Remote host closed the connection]
nobitanobi has joined #ruby
Exagone313 has joined #ruby
nobitanobi has quit [Ping timeout: 255 seconds]
pazzaz has joined #ruby
ta_ has joined #ruby
marr has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #ruby
pazzaz has quit [Quit: WeeChat 1.7]
mwlang has quit [Quit: mwlang]
pazzaz has joined #ruby
perniciouscaffei has quit [Ping timeout: 240 seconds]
hobodave has joined #ruby
patarr_ has joined #ruby
belmoussaoui has quit [Ping timeout: 240 seconds]
quazimodo has quit [Ping timeout: 246 seconds]
jusa has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
im0nde has joined #ruby
oliv_____ has quit [Remote host closed the connection]
hobodave has quit [Quit: Computer has gone to sleep.]
oliv_____ has joined #ruby
roshanavand has joined #ruby
milardovich has joined #ruby
oliv_____ has quit [Remote host closed the connection]
pazzaz has quit [Quit: WeeChat 1.7]
cdg has joined #ruby
olivi____ has joined #ruby
mikecmpb_ has joined #ruby
cdg_ has quit [Ping timeout: 260 seconds]
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
mikecmpbll has quit [Ping timeout: 260 seconds]
pazzaz has joined #ruby
synthroi_ has joined #ruby
synthroid has quit [Ping timeout: 240 seconds]
pazzaz has quit [Quit: WeeChat 1.7]
pazzaz has joined #ruby
dionysus69 has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
KeyJoo has joined #ruby
yottanami_ has quit [Ping timeout: 260 seconds]
hobodave has joined #ruby
<centrx> yeah!
eightlimbed has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
tristanp has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
olivi____ has quit [Remote host closed the connection]
olivi____ has joined #ruby
flyingX has joined #ruby
<bougyman> manveru: ping
* apeiros mitm's the ping: pong
postmodern has joined #ruby
<manveru> bougyman: pong
<manveru> What's up
mvenancio has joined #ruby
<bougyman> pm
ur5us has quit [Ping timeout: 260 seconds]
ledestin has joined #ruby
flying has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
rohitpaulk has joined #ruby
flyingX has quit []
ledestin has quit [Ping timeout: 258 seconds]
conta2 has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
GodFather has joined #ruby
tristanp has joined #ruby
mvenancio has quit [Quit: mvenancio]
mvenancio has joined #ruby
mvenancio has quit [Remote host closed the connection]
matheussilva has joined #ruby
GodFather has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
patarr_ has quit [Ping timeout: 246 seconds]
ecuanaso has joined #ruby
Dimik has joined #ruby
eightlimbs has joined #ruby
<ule> Hey guys
eightlimbed has quit [Remote host closed the connection]
<ule> I'm dealing with some CSV.perse thing and it's blowing up when it finds a weird character and the file is not UTF-8
<ule> I'm wondering if anyone had the same issue before and could share some thoughts
beccamorgan has quit [Read error: Connection reset by peer]
<ule> *parse
eightlimbs has quit [Remote host closed the connection]
mikee has joined #ruby
eightlimbs has joined #ruby
brent__ has quit [Remote host closed the connection]
belmoussaoui has joined #ruby
marxarelli is now known as marxarelli|afk
<ule> trying here this: string.encoding('utf-8', string.encoding.to_s)
roamingdog has joined #ruby
yqt has joined #ruby
<apeiros> ule: that makes little sense?
<apeiros> the second arg already *is* source encoding
hutch34 has quit [Ping timeout: 245 seconds]
<apeiros> i.e. defaults to String#encoding
eightlimbs has quit [Ping timeout: 245 seconds]
pwnd_nsfw` has joined #ruby
<ule> apeiros: exactly, I actually just need one argument
<ule> good catch
pwnd_nsfw has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has joined #ruby
cdg_ has joined #ruby
ur5us has quit [Remote host closed the connection]
haylon has quit [Read error: Connection reset by peer]
DLSteve_ has quit [Read error: Connection reset by peer]
Keltia has quit [Read error: Connection reset by peer]
haylon has joined #ruby
DLSteve_ has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
cats has joined #ruby
belmoussaoui_ has joined #ruby
<ule> apeiros: what do you think?
pazzaz has quit [Quit: WeeChat 1.7]
marxarelli|afk is now known as marxarelli
belmoussaoui has quit [Ping timeout: 255 seconds]
Keltia has joined #ruby
jackrandom has joined #ruby
marr has joined #ruby
belmoussaoui_ has quit [Remote host closed the connection]
belmoussaoui has joined #ruby
<apeiros> ule: I think that I wonder why your string contains \x86
Pumukel has joined #ruby
roamingdog has quit [Ping timeout: 255 seconds]
<apeiros> String#scrub will get rid of it, but that's fighting symptoms. I wonder about the root of your issues.
<ule> .encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
<ule> this made the trick
<ule> :D
<apeiros> yeah, no
<ule> apeiros: that x86 is something that is showing up from some client .csv
<ule> don't ask me why
<ule> lol
<apeiros> but I do ask you why.
<apeiros> your solution is bad and you shouldn't use it. scrub is the way.
<apeiros> your solution will mangle and break tons of valid input.
<ule> apeiros: OK
<apeiros> >> "hägar@hølgerson.com".encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
<ruby[bot]> apeiros: # => "hgar@hlgerson.com" (https://eval.in/808030)
<ule> dammit
jrafanie has quit [Ping timeout: 245 seconds]
CacoS has quit [Remote host closed the connection]
<matthewd> If the file's not utf-8, it might be wiser to read it in the encoding it's actually using
<ule> matthewd: but my db is utf-8 so I need to convert it anyways
__Yiota has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ule> apeiros: checking that scrub()
<matthewd> Yes. *Convert*.
<apeiros> matthewd: and that'd be "but I ask" :)
<ule> matthewd: but that was the problem.. I converted and it changed to \86
<apeiros> ule: how do you figure your input is utf-8?
belmoussaoui_ has joined #ruby
<ule> apeiros: string.encoding
<apeiros> well, you *think* you converted it. we saw how you're "converting" stuff above.
<apeiros> ule: see, that doesn't do what you think it does.
<ule> lol
<apeiros> String#encoding tells you what *you* told ruby the encoding was
<apeiros> and *you* told ruby in this case most probably by just keeping the defaults
Fernando-Basso has quit [Quit: WeeChat 1.8]
rohitpaulk has quit [Remote host closed the connection]
belmoussaoui has quit [Ping timeout: 240 seconds]
<apeiros> so no, String#encoding is not a way to figure the encoding of data you're reading. it's a way to figure as what ruby will treat it (which in turn is based on what you tell it to)
<ule> apeiros: how can I just identify if the string has some fancy characters like those ones you sent in your german/swiss email?
<apeiros> string.b.scan(/[\x80-\xff]{2,}/)
<apeiros> run that, show us the first couple results
<apeiros> whoops, add an n flag to the regex (//n)
belmoussaoui has joined #ruby
<apeiros> hm, maybe this is even better: string.b.scan(/\w*[\x80-\xff]{2,}\w*/n)
<apeiros> will give us a bit of context
<ule> ok lemme check
<apeiros> (you can output it using p, e.g. `p string.b.scan(/\w*[\x80-\xff]{2,}\w*/n).first(5)`)
roamingdog has joined #ruby
olivi____ has quit [Remote host closed the connection]
belmoussaoui_ has quit [Ping timeout: 246 seconds]
<dminuoso> apeiros: Do you have that encoding gist handy?
<apeiros> I really should finish that
olivi____ has joined #ruby
<apeiros> ?encoding
<ruby[bot]> check https://gist.github.com/apeiros/39acc5b486f932403638 - it might contain useful informations to solve your encoding problems
<dminuoso> o7
<apeiros> ule: ^ should read that too
matheussilva has left #ruby ["Good Bye"]
brent__ has joined #ruby
<apeiros> also tell me if there's things you don't understand, or tell me what you liked/helped you.
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
<apeiros> is o7 an arrow?
<dminuoso> apeiros: You should at least refer to mojibaking by name, since it's a common term.
<dminuoso> apeiros: No that's a saluting person.
<dminuoso> Clearly.
<apeiros> ok, that's what I thought first, but didn't seem to make sense :D
<apeiros> mojibaking?
<apeiros> oh, didn't know that term. I guess I should. can you comment on the gist?
<dminuoso> apeiros: mojibake is when you interpret a text with a different encoding than was used when encoding.
<dminuoso> Sure
<apeiros> yes, seen. already on https://de.wikipedia.org/wiki/Zeichensalat
<apeiros> german++ :D
<apeiros> "character salad"
<apeiros> or rather "glyphsalad"
<dminuoso> Nice recovery there.
<ule> apeiros: I'm definitely gonna be reading that
<dminuoso> apeiros: Had a funny discussion the other day when someone asked about his language he was designing how to handle strings. And I asked him: "What do you understand as a string?"
<baweaver> Dumme Verwirrung?
<apeiros> dminuoso: do go on? :)
* apeiros actually has a ton of concepts on how to implement strings low level to handle different situations performantly or compactly
<dminuoso> apeiros: Ended up displaying Haskell is the best example, since it takes all 3 ways to consider "strings" and provides them as different types.
olivi____ has quit [Ping timeout: 260 seconds]
<apeiros> says "all" and "3" in the same phrase…
<apeiros> I'm not sure which one of these you consider correct :-p
<apeiros> which 3 ways does haskell provide?
<dminuoso> apeiros: String, Text and ByteString
<apeiros> I guess bytearray and character/codepoint array? which is the third?
yottanami_ has joined #ruby
<ule> apeiros: it's actually showing []
<apeiros> ule: ok, then you most likely do not have utf-8
<ule> yes
<apeiros> and given the string you already showed, it's not utf-16 or -32 either
milardovich has quit [Ping timeout: 246 seconds]
<dminuoso> apeiros: Well and then there is [Char] ..
<ule> I'm getting this with string.encoding: #<Encoding:ASCII-8BIT>
<apeiros> ule: change to `p string.b.scan(/\w*[\x80-\xff]+\w*/n).first(5)` please
<apeiros> yes. string.b changes the encoding to ascii-8bit
<ule> ["com\x86"]
<apeiros> in *all* your input data, all you get is the above?
<dminuoso> apeiros: So the question is: Is a string just a concatenation of bytes (C char array). Is it a concatenation of code points? (Thing c++ std::basic_string), if so, how are multi-byte code points implemented?
<ule> no
<ule> apeiros: it's just one line of the csv
Dwarf-br has joined #ruby
<dminuoso> Is it done with wide characters? Or spanning over multiple single characters? if so, how is length/truncation handled in the latter
<dminuoso> Is encoding information attached?
<dminuoso> Or maybe font face information
<apeiros> ule: … if you think a *single* point of information is enough, you're wildly mistaken.
dionysus70 has joined #ruby
Fernando-Basso has joined #ruby
<ule> apeiros: I mean.. in this .csv it's just one line.. but definitely I'm gonna get more in the future
<apeiros> "multibyte codepoint" the multibyte aspect is irrelevant if you handle it as codepoints (other than having to know the maximum value for a codepoint)
<dminuoso> apeiros: No it is not!
<apeiros> it is. because codepoint != bytes
ace05 has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> apeiros: Think std::basic_string<wchar_t> and std::basic_string<char>
yqt has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<dminuoso> apeiros: You can throw an UTF8 string into both.
<dminuoso> Linux uses the latter, Windows the former.
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
<dminuoso> The first one is far more comfortable to use but wastes tons of space.
<apeiros> if it matters, then you don't have a codepoint array.
<apeiros> you may have fancy facades, but in the end you have a bytearray.
hahuang65 has quit [Ping timeout: 240 seconds]
<dminuoso> apeiros: My point is, there's enough examples to show how inconsistent implementations can be/
<apeiros> or rather, codepoint list (array already comes with a lot of connotation on how it's stored in memory)
<dminuoso> apeiros: This codepoint array is a nice idea (and Windows does this excessively - sadly), but it performs really horrible.
<dminuoso> It drastically increases cache pressure and increases memory usage.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<apeiros> I'd guess a 4byte array would perform quite well. it'd just use a ton of space.
<apeiros> but yeah, I doubt codepoint lists are the way to go for everyday strings
<dminuoso> apeiros: In worst case, and considering how most of the time you only use ASCII compatible codepoints, you quadruple the cache pressure.
<dminuoso> (Which is far worse than actual memory usage)
<apeiros> you can have a codepoint array which adapts to its data
<apeiros> that's the point I tried to make when I replaced array with list
<dminuoso> apeiros: Worst case would be a single non-ascii compatible codepoint in a long string then.
<dminuoso> Or would you use a linked list of arrays?
<apeiros> how you store it in memory is a different thing from what you store
<dminuoso> apeiros: Well if you say "array of codepoints" its already an implementation detail, isnt it?
<apeiros> or a skip list, or ropes, or a custom data format. sure.
<dminuoso> apeiros: I mean the naive user expects an "array of characters"
<dminuoso> whatever their codepoints are
<dminuoso> (Which is what Ruby does)
<apeiros> no, array really just means sequential data. but yes, hence my "array already comes with a lot of connotation on how it's stored in memory"
<dminuoso> mmm
<apeiros> and hence my "list instead of array"
<apeiros> but there really isn't any loaded term for the abstract concept anymore
<apeiros> ule: well, from that single data point it looks like erroneous data.
<apeiros> ule: does the supplier of the data not tell you the encoding of the data? because really, that's the only *really* reliable way.
belmoussaoui_ has joined #ruby
belmoussaoui has quit [Ping timeout: 260 seconds]
spheric has quit [Ping timeout: 240 seconds]
gil_ has quit [Ping timeout: 272 seconds]
gil_ has joined #ruby
gil_ has joined #ruby
gil_ has quit [Changing host]
cdg_ has quit [Ping timeout: 240 seconds]
jusa has quit [Ping timeout: 260 seconds]
<ule> apeiros: Yeah.. I'm gonna investigate that
synthroi_ has quit []
<ule> apeiros: for now, I believe that the best thing to do is catch these erroneous lines and throw a message saying "check this line, it must be wrong"
cdg has joined #ruby
<apeiros> that's sensible
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros> have your strings encoded as utf-8, then you can use: string.valid_encoding?
<ule> I was doing this:
<ule> unless string.encoding.to_s.include?('UTF-8')
<apeiros> you're still not understanding what string.encoding is about
<apeiros> again, string.encoding is what YOU tell ruby. ruby doesn't perform any kind of magic to figure out which encoding data might use.
<apeiros> so all string.encoding.to_s.include?('UTF-8') does is test whether you're still using the same defaults (or explicit settings)
hobodave has quit [Quit: Computer has gone to sleep.]
gothicsouth has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ur5us has joined #ruby
<ule> I see
belmoussaoui has joined #ruby
<ule> how about: if string.force_encoding(Encoding::UTF_8).valid_encoding?
<ule> or scrub is the way to convert it?
belmoussaoui has quit [Client Quit]
belmoussaoui_ has quit [Ping timeout: 260 seconds]
<dminuoso> ule: Find out what encoding they use.
<dminuoso> Dont guess.
<apeiros> you really should read the link above
<dminuoso> ule: If you have to use valid_encoding?, chances are you are doing it wrong.
tomphp has joined #ruby
<apeiros> .scrub does not convert anything. all it does is remove bytes which do not represent a character in the current encoding.
<ule> dminuoso: It's not just one client.. could be any encoding
gil_ has quit [Quit: ZNC 1.6.5 - http://znc.in]
belmoussaoui has joined #ruby
<apeiros> and .valid_encoding? checks whether any such bytes are present
<ule> apeiros: make sense
<apeiros> dminuoso: I suggested .valid_encoding? and it makes sense for this task. assume it's utf-8, verify with .valid_encoding?, inform user that it contains data to be inspected if it's not valid.
<dminuoso> mmmm
<dminuoso> apeiros: I'd be lazy and use rchardet
<dminuoso> Because fuck encoding.
tomphp has quit [Client Quit]
<apeiros> dminuoso: you'd make things worse
<apeiros> IME rchardet and consorts are terribad at correctly guessing the encoding.
gil_ has joined #ruby
gil_ has joined #ruby
gil_ has quit [Changing host]
tomphp has joined #ruby
olivi____ has joined #ruby
<dminuoso> apeiros: It's bad enough I have to deal with CR+LF, LF, CR issues every week..
<apeiros> those are easy
<dminuoso> apeiros: That depends on what you are doing.
<apeiros> gsub(/\r\n?|\n/, "\n")
<dminuoso> apeiros: Do you do this everytime you File.read?
<apeiros> there, normalized to \n all variants I know about
<apeiros> no. but I consume sane data.
<dminuoso> apeiros: Heh.
<apeiros> I do it in one case where users can upload csv.
<apeiros> and there I have a custom heuristic to determine whether it's utf-8, utf-16, windows-latin1 or macroman
<dminuoso> apeiros: It's easy if you are limited to one particular language.
<apeiros> and a custom heuristic to determine whether it's craptastic excel csv which thinks the C in csv stands for "semicolon"
* ule learning a lot about encoding
<dminuoso> apeiros: Do you have any French in your company?
<apeiros> dminuoso: yes and yes
<dminuoso> apeiros: haha!
* ule starting to hate encoding as well
<apeiros> ule: don't. learn how it works
Dwarf-br has quit [Ping timeout: 240 seconds]
<dminuoso> ule: Go solve it by inventing a unified encoding for them a..
<ule> dminuoso: apeiros we have french/canadian encodings here as well
<apeiros> the only bad part about encodings is the lack of containers which contain the metadata.
<Papierkorb> apeiros: We had that too in a prod app of ours. Exactly same use-case lawl. also, some tools giving utf8, others windows-*whatever*
<dminuoso> Papierkorb: Here I solved it by not accepting CSV anymore.
<dminuoso> We supply our own tools to deal with data, so that I control the encoding, not them.
opencw has quit [Quit: Leaving]
belmoussaoui has quit [Ping timeout: 240 seconds]
<dminuoso> apeiros: And then there's the cases where PDF vendors use custom font faces to disallow copy pasting..
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<dminuoso> apeiros: or the cases where you cant convert certain characters because users pick silly code points..
belmoussaoui has joined #ruby
<apeiros> pdf…
<dminuoso> apeiros: :D
<apeiros> you know pdf has a custom encoding?
<ule> dminuoso: lol
<apeiros> it's insane
<dminuoso> PDF has all kinds of crazy shit.
<dminuoso> I opened a PDF with the PDF specification once.
<apeiros> indeed
<dminuoso> Preview hang up for 20s.
<ule> dminuoso: I like this idea not accepting .csv anymore
GinoMan has quit [Ping timeout: 255 seconds]
<Papierkorb> truth be told, no one ever used the words "sane" and "pdf" in the same sentence
<apeiros> also silly pdf vendors - all they have to do is render the fonts
<apeiros> and they're still silly because OCR
<apeiros> so yeah, fuck them
<dminuoso> apeiros: OCR is the only way to process some PDFs..
<apeiros> Papierkorb: it's a ton saner than .doc or .docx
workmad3 has joined #ruby
<Papierkorb> apeiros: but who wouldn't want to be able to run custom code in PDFs?!
<dminuoso> I run custom code in power point now.
<apeiros> did I mention that I'm actually asleep for the last 15min?
<dminuoso> *14
troys has joined #ruby
<Papierkorb> apeiros: Look at photoshop files lol
* dminuoso keeps track of apeiros' sleep pattern
<apeiros> Papierkorb: you're aware that postscript is touring complete and that there's things like sudoku solvers implemented in it?
<apeiros> and I bet pdf being the spiritual successor is touring complete too
<Papierkorb> sure
<Papierkorb> apeiros: you can embed postscript in PDF
<apeiros> there you go
<apeiros> eps…
ldnunes has quit [Quit: Leaving]
<apeiros> well, afk
<baweaver> Turing
<baweaver> apeiros ^
mim1k has joined #ruby
<apeiros> it's late! and I'm dreamtyping!
<apeiros> so give me a break!
<baweaver> never
<apeiros> =(
<baweaver> :D
belmoussaoui has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
jrafanie has joined #ruby
roamingdog has quit [Remote host closed the connection]
jackrandom has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
Archrover has quit [Changing host]
Archrover has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
jackrandom has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
kiltzman has quit [Ping timeout: 258 seconds]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
zacts has joined #ruby
<dminuoso> baweaver
<dminuoso> How's the punning going
<baweaver> dminuoso
roamingdog has quit [Remote host closed the connection]
<baweaver> I've had a few gems
belmoussaoui has quit [Quit: belmoussaoui]
roamingdog has joined #ruby
<dminuoso> Really
<dminuoso> Tell me more
roamingdog has quit [Remote host closed the connection]
belmoussaoui has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
gothicsouth has joined #ruby
kiltzman has joined #ruby
mathys has quit [Quit: Leaving]
kies has quit [Ping timeout: 246 seconds]
belmoussaoui has quit [Remote host closed the connection]
lagweezle_away is now known as lagweezle
belmoussaoui has joined #ruby
mikecmpb_ has quit [Quit: inabit. zz.]
nertzy has joined #ruby
im0nde has quit [Ping timeout: 245 seconds]
duderonomy has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
marxarelli is now known as marxarelli|afk
sepp2k has quit [Ping timeout: 255 seconds]
pupsicle has quit [Remote host closed the connection]
mikecmpbll has quit [Ping timeout: 260 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> i don't know, but i've had a few gills
haylon has quit []
ascarter has joined #ruby
SpComb has quit [Ping timeout: 240 seconds]
troys is now known as troys_
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
SpComb has joined #ruby
kirun has quit [Quit: Konversation terminated!]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
tvw has quit [Remote host closed the connection]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GinoMan has joined #ruby
ltem has quit [Quit: Leaving]
im0nde has joined #ruby
weathermaker has joined #ruby
weathermaker has quit [Client Quit]
ecuanaso has joined #ruby
Pumukel has quit [Ping timeout: 246 seconds]
im0nde has quit [Ping timeout: 245 seconds]
im0nde has joined #ruby
patarr has quit [Ping timeout: 255 seconds]
patarr has joined #ruby
gothicsouth has joined #ruby
centrx has quit []
patarr has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Ping timeout: 245 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest69 has joined #ruby
HoierM has joined #ruby
dionysus69 has quit [Quit: dionysus69]
saschavoid has quit [Quit: die();]
safetypin has quit [Ping timeout: 240 seconds]
Fernando-Basso has quit [Quit: WeeChat 1.8]
ace05 has quit [Remote host closed the connection]
ace05 has joined #ruby
weaksauce has quit [Quit: Textual IRC Client: www.textualapp.com]
ace05 has quit [Read error: No route to host]
ace05_ has joined #ruby
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
duderonomy has joined #ruby
Guest982 is now known as Radar
Radar has quit [Changing host]
Radar has joined #ruby
minimalism has quit [Quit: minimalism]
shtirlic has quit [Quit: ZNC - http://znc.in]
shtirlic has joined #ruby
gusrub has quit [Remote host closed the connection]
weaksauce has joined #ruby
yottanami_ has quit [Remote host closed the connection]
yottanami_ has joined #ruby
minimalism has joined #ruby
yottanami_ has quit [Remote host closed the connection]
yottanami_ has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
jusa has joined #ruby
ecuanaso has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
KeyJoo has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
hutch34 has joined #ruby
yitsushi has quit [Ping timeout: 264 seconds]
enterprisey has quit [Read error: Connection reset by peer]
Yxhuvud has joined #ruby
yottanami_ has quit [Ping timeout: 260 seconds]
Larahero has joined #ruby
yitsushi has joined #ruby
olivi____ has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 272 seconds]
oliv_____ has joined #ruby
cam27 has quit [Quit: cam27]
roamingdog has joined #ruby
alveric1 has joined #ruby
moei has quit [Quit: Leaving...]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oliv_____ has quit [Ping timeout: 240 seconds]
alveric4 has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 260 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
gusrub has joined #ruby
DTZUZU has joined #ruby
raspado has quit [Remote host closed the connection]
mim1k has joined #ruby
raspado has joined #ruby
cschneid_ has quit [Remote host closed the connection]
raspado has quit [Ping timeout: 245 seconds]
lxsameer has quit [Quit: WeeChat 1.7]
mim1k has quit [Ping timeout: 255 seconds]
marxarelli|afk has quit [Quit: Textual IRC Client: www.textualapp.com]
marxarelli has joined #ruby
jackrandom has quit [Remote host closed the connection]
cam27 has joined #ruby
cdg has quit [Remote host closed the connection]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
cam27 has quit [Client Quit]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
kitikonti has quit [Quit: Textual IRC Client: www.textualapp.com]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
Guest69 has joined #ruby
railswebdev has joined #ruby
cam27 has joined #ruby
kies has joined #ruby
apparition has joined #ruby
apparition has quit [Client Quit]
GinoMan has quit [Ping timeout: 255 seconds]
marr has quit [Remote host closed the connection]
Cohedrin has quit [Read error: Connection reset by peer]
nertzy has quit [Quit: This computer has gone to sleep]
Cohedrin has joined #ruby
roshanavand has quit [Ping timeout: 245 seconds]
milardovich has joined #ruby
<craysiii> ls
<craysiii> oops..
dc2 has quit [Ping timeout: 255 seconds]
hutch34 has joined #ruby