havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
ramfjord_ has joined #ruby
kmurphy4_ has quit [Quit: kmurphy4_]
Creatornator has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
akem_ has joined #ruby
ramfjord_ has quit [Ping timeout: 245 seconds]
jcarl43 has quit [Quit: WeeChat 2.1]
ramfjord has joined #ruby
akem has quit [Ping timeout: 260 seconds]
Scriptonaut has joined #ruby
<Scriptonaut> hey all, I was curious, are there any good terminal interface libraries other than ncurses?
<Scriptonaut> I have always found ncurses to be pretty unintuitive, and figured by now there must be some other good quailty gems for writing terminal applications
cthulchu_ has quit [Ping timeout: 240 seconds]
ciscam has quit [Ping timeout: 240 seconds]
ciscam has joined #ruby
desperek has quit [Quit: xoxo]
npgm has quit [Quit: Connection closed for inactivity]
eckhardt_ has joined #ruby
Mia has quit [Read error: Connection reset by peer]
nertzy has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
BlopMonster has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
kmurphy4_ has joined #ruby
BlopMonster has quit [Ping timeout: 268 seconds]
srruby has quit [Ping timeout: 248 seconds]
chamar has joined #ruby
pabs has quit [Ping timeout: 264 seconds]
ur5us has quit [Remote host closed the connection]
cconstantine has joined #ruby
pabs has joined #ruby
ur5us has joined #ruby
zapata has quit [Read error: Connection reset by peer]
kmurphy4_ is now known as kmurphy4
chamar has quit [Quit: Leaving]
gizmore has joined #ruby
karapetyan has quit [Remote host closed the connection]
gizmore|2 has quit [Ping timeout: 240 seconds]
cconstantine has quit [Quit: cconstantine]
zapata has joined #ruby
dendazen has joined #ruby
dendazen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
chamar has joined #ruby
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
sanscoeur has quit [Ping timeout: 264 seconds]
dendazen has joined #ruby
beefjoe has joined #ruby
Mike11 has joined #ruby
jrafanie has joined #ruby
syndikate has quit [Ping timeout: 248 seconds]
sylario has quit [Quit: Connection closed for inactivity]
matthewd has quit [Ping timeout: 248 seconds]
matthewd has joined #ruby
cyberg has quit [Remote host closed the connection]
aeontech has quit [Quit: aeontech]
syndikate has joined #ruby
jready has joined #ruby
mikeiniowa has quit [Ping timeout: 240 seconds]
shinnya has joined #ruby
t0xik has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
mrBen2k2k2k has quit [Ping timeout: 256 seconds]
Mike11 has quit [Quit: Leaving.]
shinnya has quit [Ping timeout: 240 seconds]
ciscam has quit [Ping timeout: 260 seconds]
ciscam has joined #ruby
dendazen has quit [Read error: Connection reset by peer]
beefjoe has quit [Remote host closed the connection]
bmurt has joined #ruby
nicht_ has quit [Ping timeout: 245 seconds]
BlopMonster has joined #ruby
duderonomy has joined #ruby
BlopMonster has quit [Ping timeout: 245 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has quit [Ping timeout: 240 seconds]
jready has quit []
jamesaxl has quit [Quit: WeeChat 2.1]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
dreamthese has quit [Remote host closed the connection]
darkhanb has joined #ruby
dreamthese has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
duderonomy has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 264 seconds]
tdy has joined #ruby
apeiros_ has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
AJA4350 has quit [Quit: AJA4350]
gnufied has quit [Quit: Leaving]
karapetyan has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
bipul has quit [Changing host]
bipul has joined #ruby
lytol has quit [Remote host closed the connection]
plujon has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
thebetrayer has quit [Read error: Connection reset by peer]
thebetrayer has joined #ruby
Sonia has joined #ruby
Sonia has quit [Remote host closed the connection]
Creatornator has joined #ruby
Creatornator has quit [Client Quit]
ciscam has quit [Ping timeout: 256 seconds]
kmurphy4 has quit [Quit: kmurphy4]
ciscam has joined #ruby
cgfbee has quit [Quit: cgfbee]
Eiam has quit [Ping timeout: 240 seconds]
BlopMonster has joined #ruby
BlopMonster has quit [Ping timeout: 240 seconds]
<dminuoso> Who here is familiar with STM?
<havenwood> dminuoso: Who isn't?!
<dminuoso> Hah. Too few it seems.
<dminuoso> havenwood: Care to look at something for me? I cant read ruby code.
<havenwood> dminuoso: Aye, I'd like more STM. Sure I'll read.
<dminuoso> Does this look weird to you?
<havenwood> dminuoso: Here was my stab at getting at STM in Ruby ;-P https://gist.github.com/havenwood/5654484
<dminuoso> Hahaha
<havenwood> It's fancy how easy it is to get at Clojure from JRuby.
<dminuoso> havenwood: Ive started to greatly appreciate coordinating threads with nothing but TQueue and TVar's
<dminuoso> Even things like consumer/producer become so mindboggingly trivial, fast and safe...
<dminuoso> havenwood: I mean the whole TVar implementation is weird. (Who calls retrying a transaction "aborting")
<havenwood> dminuoso: hah
<havenwood> dminuoso: this method is hard to read...
<dminuoso> I know right?
amar has joined #ruby
<dminuoso> havenwood: As far as I can make it out, it tries to detect whether there have been uncommitted writes to any versions that have been read.
<dminuoso> havenwood: That doesn't look right. Should be .any
<havenwood> dminuoso: isn't it false if any?
<dminuoso> Or you need to flip the condition
<havenwood> i think flip
<dviola> will jit be enabled by default in 2.6? I think it requires passing -jit right now
<dminuoso> Oh.
<dminuoso> dviola: No
<dminuoso> dviola: It's experimental for now.
<dviola> dminuoso: we'll have to specify -jit in 2.6 also?
<dviola> ok, I see
ur5us has quit [Remote host closed the connection]
<dviola> any benchmarks?
<havenwood> dviola: --jit, two dashes
<dviola> havenwood: I see, thanks
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amar has quit [Ping timeout: 248 seconds]
<havenwood> It's faster yet in recent benchmarks :-D
akaiiro has quit [Remote host closed the connection]
<havenwood> still slow with Rails
<dviola> I got confused because of the use of this dash here: –jit
<dviola> hrm, looking...
<dminuoso> havenwood: In Ruby everything is slow.
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
<dviola> I'll have to compile preview2 to see it for myself
<havenwood> dviola: Yup
<dviola> but it looks neat so far
<dminuoso> havenwood: By the way, Ive been thinking about rigging a compiler optimization pass into Ruby.
<dminuoso> One that would require a small bit of code analysis
<dviola> will it be like python that we'll get a lot of pyc files when executing code? :P
<dviola> well, rbc in this case
<dminuoso> Imagine you could write lambda literals, to_proc them - and gain the efficiency of blocks!
Guest75272 has quit [Ping timeout: 245 seconds]
<dminuoso> Sadly the existence of ObjectSpace makes this impossible.
sauvin has joined #ruby
<dminuoso> And this is ultra sad, because you'd think that `pred = -> a { ... }; arr.filter(&pred)` could optimize the lambda away *statically*
cgfbee has joined #ruby
<havenwood> dviola: Tools like yomikomu and bootsnap have options for locally cached ir, but both use a central default location. They'd be the ones creating .rbc files, precompiling Ruby code to intermediate representation.
<havenwood> dviola: The JIT actually uses /tmp for .c and .so files.
<havenwood> dviola: /tmp is in-memory on Linux
<dviola> havenwood: nice
<dviola> right, tmpfs
<dviola> reading your blog post, havenwood
za1b1tsu has joined #ruby
reber has joined #ruby
Puffball has quit [Quit: Puffball]
<dviola> very nice, I need to try optcarrot
<eam> all reads and writes are potentially in memory on linux, until you flush a cache
anisha has joined #ruby
reber has quit [Remote host closed the connection]
<dminuoso> all writes are potentially in a cache line, until you evict it
* dminuoso pokes eam with further pedantry
troys has quit [Quit: Bye]
za1b1tsu has quit [Quit: WeeChat 2.1]
venmx has joined #ruby
pabs has quit [Ping timeout: 264 seconds]
pabs has joined #ruby
reber has joined #ruby
aupadhye has joined #ruby
aupadhye_ has joined #ruby
aupadhye_ has quit [Client Quit]
mikeric has quit []
karapetyan has joined #ruby
karapetyan has quit [Ping timeout: 276 seconds]
ciscam has quit [Ping timeout: 260 seconds]
ciscam has joined #ruby
biberu has joined #ruby
amar has joined #ruby
andikr has joined #ruby
kliq has joined #ruby
amar has quit [Ping timeout: 256 seconds]
donofrio has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
schleppel has joined #ruby
yohji has joined #ruby
<dminuoso> havenwood: I just realized that this implementation is garbage.
<dminuoso> It's such a cheap and bad implementation
<dminuoso> It produces space leaks, has weird edge cases where TVar users spin in a loop
<dminuoso> "abort_transaction"
<dminuoso> I shouldn't have been surprised.
dviola has quit [Quit: WeeChat 2.1]
wkoszek2 has joined #ruby
Jiaoyin has quit [Ping timeout: 260 seconds]
dreamthese has quit [Read error: Connection reset by peer]
wkoszek2 has quit [Ping timeout: 248 seconds]
dreamthese has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
clemens3_ has joined #ruby
sysvalve has joined #ruby
mtkd has joined #ruby
Xiti` has joined #ruby
Xiti has quit [Ping timeout: 264 seconds]
Guest73837 is now known as ndrst
clemens3 has joined #ruby
Burgestrand has joined #ruby
venmx has quit [Ping timeout: 264 seconds]
vondruch has joined #ruby
snickers has joined #ruby
dionysus69 has joined #ruby
Nussi has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
za1b1tsu has joined #ruby
claudiuinberlin has joined #ruby
eb0t_ is now known as eblip
aeontech has joined #ruby
chamar has quit [Ping timeout: 245 seconds]
pabs has quit [Ping timeout: 245 seconds]
canton7 has quit [Ping timeout: 240 seconds]
canton7 has joined #ruby
ta_ has joined #ruby
paul_ has joined #ruby
dr3w_ has joined #ruby
pabs has joined #ruby
amar has joined #ruby
<arne> dminuoso: can you elaborate on the TVar from yesterday? what would it do?
<arne> how would i write my own version of that thingie
<dminuoso> arne: do you want a buffer of keys or is a single key enough?
<arne> uhm, buffer means multiple values, that get "hold back" and single key means 1, right?
<dminuoso> right
<dminuoso> well you can switch out the solution later it doesnt matter
<dminuoso> so lets focus on a single value because its easier
<arne> well buffer would be cooler, ofcourse
<arne> do people still use rubinius? im just reading the tvar article of concurrent-ruby
<arne> and rubinius is listed in the graphs
<dminuoso> arne: so with a single item you'd just use an mvar like this:
grilix has quit [Ping timeout: 245 seconds]
amar has quit [Ping timeout: 256 seconds]
amar has joined #ruby
<dminuoso> arne: the cool trick here is that MVar *blocks* when you try to take from an empty mvar or put into a filled mvar.
<arne> oh well, i meant without concurrent-ruby
<arne> well it makes for a not so readable code, does it?
sylario has joined #ruby
<dminuoso> what doesnt?
<arne> doesn't it*
<arne> well, fuck it, i add concurrent-ruby to the gemfile, could you show me a buffer version?
<arne> and how is this any different from Queue.pop.. that one blocks, too?
<dminuoso> arne: the problem is controlling the flow
<dminuoso> arne: You'd need a full fledged TQueue
<arne> but a normal queue would block too if there is nothin gin there
<dminuoso> Imo concurrent-ruby should have a TQueue, if you want a bit Ill submit a PR to concurrent-ruby providing for one
<dminuoso> arne: the producer cant stop producing, thats the problem
<arne> well it can check the length of the queue, but that is pretty busy, so yeah
<dminuoso> with a TQueue you can write the code as if it looks busy, but it *blocks*
<arne> yeh, i see the beauty in there
<arne> having a producer thread like that wouldn't be expensive at all then, i guess even in ruby
<arne> since it sleeps all the time
<dminuoso> yup
<arne> but one question remains for me: the software architecture of this project im working on
<arne> has 8 programs.. using the same models
<dminuoso> if you had a TQueue you'd just check the length and retry the transaction if its too long
<arne> if i was to tell every program, to pre-buffer 8 rsa keys, for usage
<arne> it would peck my cpu at 100% for quite a while
<dminuoso> and because of how stm works the transaction will block until there's any write recorded to the tvars you have *read* until you retried
<arne> how would one tackle that problem?
<dminuoso> and the really awesome thing with STM is
omth has joined #ruby
<dminuoso> you could spin up 8 threads that all push into that queue
<dminuoso> (but oh well. hello GVL)
NL3limin4t0r has joined #ruby
<dminuoso> that thing probably needs some `peekTQueue` or equivalent for the producer to know the size
grilix has joined #ruby
<dminuoso> This implementation uses 2 internal buffers to decrease contention, allowing writers and readers to not affect each other
tvw has joined #ruby
<dminuoso> arne: wait a second, let me make this better
<dminuoso> because we should make this a bounded queue
yaewa has joined #ruby
yaewa has quit [Client Quit]
moei has quit [Ping timeout: 248 seconds]
<arne> dminuoso: i don't want to steal time from your job :o
mikecmpbll has joined #ruby
ciscam has quit [Ping timeout: 264 seconds]
<arne> what are you doing btw, if i may ask
aeontech has quit [Read error: Connection reset by peer]
<dminuoso> arne: Implementing a TBQueue in Ruby real quick.
<dminuoso> Its fine because I want one for my project anyway, so its no waste
<arne> i mean for a living
ciscam has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
aeontech has joined #ruby
<dminuoso> arne: updated, reload for an example at the bottom
<dminuoso> You cant write simpler code than that (under the assumption that TBQueue is provided of course)
<dminuoso> you can have multiple producers as well as multiple consumers too
barq has quit [Changing host]
barq has joined #ruby
barq has joined #ruby
<arne> that is cool, thank you
<arne> aren't short variable names like t,xss,r non-ruby-idiomatic?
<dminuoso> arne: it makes sense in a local sense
<dminuoso> arne: Im refactoring the renaming slightly, give me a moment
<dminuoso> (this is just a raw haskell stm clone)
ur5us has joined #ruby
BlopMonster has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
<arne> thanks alot, i will tell you how good this performs
<dminuoso> arne: I discovered a bug in concurrent ruby that will cause a consumer to go hot until you've written to this at least once, just something to keep in mind
jottr has joined #ruby
BlopMonster has quit [Ping timeout: 264 seconds]
<dminuoso> (so if that ever becomes an issue, you can simply. atomically { pool.unget(nil); pool.read } during setup
<arne> well, there will be written to it, i gues
<arne> dminuoso: but what do i do with the following problem
<arne> let's say i do a queue of 8 8192-length rsa keys
<arne> this code will start on ~8 processes
<arne> which results in 8*8 8192-length rsa keys being created on startup
amar_ has joined #ruby
<dminuoso> Oh I should add a note you aught to read up on how STM works probably. There's some subtleties that are not obvious, for example the code inside `atomically` blocks need to be pure (no side effects)
<dminuoso> (Because may be retried)
amar has quit [Ping timeout: 240 seconds]
<arne> well, not for me , i understand the code, kinda :)
<arne> but will this be part of concurrent ruby? then you maybe should
Beams has joined #ruby
bathtub_shark has quit [Quit: WeeChat 2.1]
Zarthus has quit [Quit: I can't go to hell. I'm all out of vacation days.]
venmx has joined #ruby
<dminuoso> arne: yes
<dminuoso> arne: is there a question by the way? I dont see what the problem is
pabs has quit [Ping timeout: 264 seconds]
conta has joined #ruby
claudiuinberlin has quit [Ping timeout: 248 seconds]
<arne> dminuoso: well... startup would be super expensive.. if 8 programs do fill this queue
<arne> there is no clever way to tackle this.. is there?
<dminuoso> arne: across different processes?
<arne> yes
<arne> pls don't say redis or database
pabs has joined #ruby
<dminuoso> arne: there's a wonderful solution here that relies soley on TQueues now.
<dminuoso> arne: you could write a small server that has a TBQueue and serves RSA keys from it to requests
<dminuoso> perhaps a miniature sinatra server listening on a unix domain socket
<dminuoso> and then each process has a "producer" that fetches from that server
<dminuoso> and uses a local TBQueue
<dminuoso> or perhaps you do some other form of IPC, maybe pipes
<dminuoso> (transactional queues are such a wonderful method of synchronization)
Zarthus has joined #ruby
<dminuoso> arne: but I dont know whether you gain any advantage from that
<dminuoso> 10:54 arne | which results in 8*8 8192-length rsa keys being created on startup
<dminuoso> this will happen in separate threads though
<dminuoso> but. GVL.
<arne> yeah but still, thats a lot of calculations
<arne> causes some lag in other proccesses
<dminuoso> not as much other processes but your ruby app
<arne> mini-IPC i wonder how you would do that
<dminuoso> like I said.
<dminuoso> you have one small server with a TBQueue
<arne> but i guess not possible, since each process is a docker container :/
<dminuoso> so what?
<dminuoso> arne: you can use network
<arne> well it would be tcpip.. and would need a stupid complexity for such simple task
<arne> well then i would just use the database as IPC
<dminuoso> you dont need complexity thats the point
<dminuoso> arne: Pool = TBQueue.20; Thread.new { loop do; key = generate_key; Concurrent.atomically { Pool.write key } }.join
<dminuoso> and then you write a miniature sinatra server that just does
<dminuoso> get '/key' do; key = nil; Concurrent.atomically { key = Pool.read }; answer_with_key; end
<dminuoso> arne: and each process then does some:
<dminuoso> Pool = TBQueue.new 4; Thread.new { loop do; key = http.get('blabla/key'); Concurrent.atomically { Pool.write key } }.join
<dminuoso> and when each process needs to serve an RSA key then just atomically read from the local pool
<dminuoso> arne: you could then have that sinatra server maybe delegate the RSA generation to a native extension
<arne> well i am sorry, usually you have really good ideas but that sounds like a terrible idea :D
<arne> even if i was about to do that
<dminuoso> haha
<arne> why not just do it with TCP/IP?
<arne> Socket.write "#{some_)ey}"
<arne> why would i have sinatra including rack for it
<dminuoso> arne: the point was not sinatra.
arekushi has quit [Ping timeout: 256 seconds]
<dminuoso> arne: fairness is going to be a big problem though. I think each server doing its own generation might be wiser
tvw has quit []
<dminuoso> arne: unrelatedly, is RSA forced on you? Is ECDSA an option?
<arne> in this case it's DKIM keys cor e-mail signage
<arne> s/cor/for
<arne> so yes, it's rsa
<dminuoso> arne: is there dedicated hardware for key generation?
<arne> well, my startup is going to bankrupt this next few month (maybe, maybe not)
<arne> this would be way to sophisticated
<arne> :D
<arne> working on a dead project as of now, but i still get paid so what
<dminuoso> arne: regarding your initial problem
<dminuoso> you could control the rate of key generation and scale it up after server start
<dminuoso> that way starting the services up wont be as brutal
marius has joined #ruby
<dminuoso> (it may also be possible to resize the queue, but Id have to think about that)
<arne> dminuoso: yeah something like that, sounds good
<dminuoso> arne: Oh yeah thats actually trivial
<Burgestrand> I'd probably just use a SizedQueue from core, as opposed to a TVar, what's your thinking on that dminuoso?
<arne> something like that works :o?
<arne> exists*?
<Burgestrand> Yeah
<dminuoso> Burgestrand: I like STM because I can reason about that.
<Burgestrand> >> SizedQueue.new(5)
<ruby[bot]> Burgestrand: # => #<Thread::SizedQueue:0x40a89c84> (https://eval.in/1017448)
<dminuoso> Burgestrand: And I can seamlessly integrate it into concurrent code.
<arne> uhh and that thing blocks when it's full?
<dminuoso> SizedQueue wont go well
<Burgestrand> arne Yeah.
<dminuoso> Burgestrand: But yeah, I didnt know about that.
<dminuoso> Burgestrand: Id prefer the TBQueue still.
<Burgestrand> dminuoso How so?
<arne> i wonder about that one too
<dminuoso> Burgestrand: Because `atomically`?
<Burgestrand> SizedQueue is documented to be thread-safe for both push and pop
<Burgestrand> (same as Queue)
<dminuoso> Concurrent.atomically { b = someQueue.read; a = someTvar.read; someOtherQueue.write(a + b) }
<dminuoso> Voila. SizedQueue no longer works for this kind of thing.
<dminuoso> You end up with crazy locking mechanics if you do anything non trivial with SizedQueue
<dminuoso> with STM you talk in terms of transactions and consistent views of memory
<Burgestrand> Yeah, I agree, when you start coordinating multiple pieces of mutable state then locking becomes prone to a bunch of problems that you don't really have with STM.
<Burgestrand> Although in this case it feels like using a nuke to open an egg when a spoon is sufficient >D
<Burgestrand> … although, to be fair, in the case of generating expensive resources you want to spread that across multiple machines anyway so neither approach is actually useful
<dminuoso> Burgestrand: Ive grown accustomed to defaulting to STM because I found that I have fewer issues in the long run.
<dminuoso> Because at some point you may decide to "make a little tweak" and then you end up wasting weeks of debugging race conditions
<dminuoso> Also I can trivially reason about STM. I cant trivially reason about SizedQueue without fully diving into its implementation.
<Burgestrand> Absolutely. I used STM in haskell quite extensively, I like it, especially when the type system helps you even further to make it impossible to attempt to use it where it doesn't make sense.
<dminuoso> Burgestrand: btw its funny that the haskell implementation and my code line up exactly.. :D
<lupine> I bought hardware on the strength of it having hardware transactional memory
<lupine> but then they disabled it in a microcode update :'(
<Burgestrand> dminuoso I'm not surprised you brought up STM with your recent (well, a year or two) interest in type theory and functional programming
<Burgestrand> dminuoso sorry, that sounded way more douchy than I realized at first, I apologize!
<dminuoso> Burgestrand: All good. I read it as "it seemed like a logical consequence"
<Burgestrand> dminuoso Indeed, it's been interesting to read your explanations on all the advanced stuff you've been teaching in here :)
pabs has quit [Ping timeout: 255 seconds]
amar_ has quit [Remote host closed the connection]
pabs has joined #ruby
<dminuoso> Burgestrand: By the way, SizedQueue might be substantially slower
<dminuoso> The reason is that uses a single mutex protected queue
<dminuoso> The double buffering in my TBQueue makes concurrent accesses possible without conflict
<dminuoso> (as long as the read buffer still has resources left of course)
<Burgestrand> dminuoso I admit I didn't read the entire TBQueue implementation, but I assume it holds true no matter the number of producers/consumers or speed of production/consumption?
apeiros_ has joined #ruby
karapetyan has joined #ruby
<dminuoso> Burgestrand: Right. My TBQueue internally has two tvar buffers: An in buffer and an out buffer. Reads are served from the in buffer, writes are served to the out buffer
<dminuoso> if the read buffer is empty, the write buffer is flushed into the read buffer
<dminuoso> err.. switch in and out in that sentence =)
<dminuoso> though I suppose if the producer is really slow it wont really matter
ellcs has joined #ruby
<Burgestrand> dminuoso My memory is a bit foggy, I recall the transaction is only retried if the initial state of accessed memory is changed from the conditions you entered the transaction in, i.e. it's not gonna spin forever if the circumstances don't change?
Beams has quit [Ping timeout: 240 seconds]
<dminuoso> Burgestrand: right
<dminuoso> Burgestrand: STM keeps a log on all writes and logs on each transaction
<Burgestrand> (because otherwise we'd end up in a case where the consumers could starve the producers of resources if they keep polling while the queue is empty)
<dminuoso> Burgestrand: so every `t.read` I do is recorded. If I retry the transaction, it will block until any tvar I've read has been changed
karapetyan has quit [Remote host closed the connection]
<Burgestrand> Aye-aye, that makes sense, since the requirement is that the update is pure
<Burgestrand> dminuoso Indeed, that's the retry I was referring to
<dminuoso> haha yes
<dminuoso> on that note...
<dminuoso> arne: I have a massive bug!
<dminuoso> Burgestrand: so much for the type system preventing me from doing IO inside STM transactions :D
<Burgestrand> :D
<dminuoso> Burgestrand: now if only we could do something like
<dminuoso> atomically (waitSTM async1 <|> waitSTM async2 <|> takeTMVar someVar >>= putTMVar resultVar)
<Burgestrand> dminuoso Liking type systems (e.g. haskell, or more recently swift) AND dynamic non-typed systems (e.g. ruby) alike is a constant battle of mine, it doesn't make sense to me but it's there nonetheless
<dminuoso> Burgestrand: The more I get into type theory, the more I realize that "no type system" (there is *no such thing* as a dynamic type system) have very few to no benefits.
<dminuoso> No type systems gain the ability to express certain good programs (according to your operational model) that a type system might prevent. But with good habits this will very rarely be the case.
<dminuoso> Burgestrand: Why do you like lack of types?
minimalism has quit [Quit: minimalism]
<Burgestrand> Yeah, I try to avoid the labels of what to call the different type systems, I try to stick to providing concrete examples of implementations instead :)
<Burgestrand> (mainly because I don't know what terminology to use, and even if I did I'm not sure my audience does either)
karapetyan has joined #ruby
<dminuoso> Burgestrand: ruby has no type system to begin with.
<Burgestrand> dminuoso I probably like it because all explicitly typed systems I've come across so far has lacked expressiveness in one way or the other, which causes a bunch of boilerplate that makes things (feel) unecessarily difficult to implement
karapetyan has quit [Remote host closed the connection]
<dminuoso> Burgestrand: Many programmers conflate runtime object tagging and types. They are somewhat related, but types are not about the former.
<dminuoso> And you cant do the former to do the latter *at all*
<Burgestrand> e.g. my gripe with haskell started as I was writing a network protocol parser and the only acceptable path forward was Template Haskell, and at the time that wasn't really a nice compromise either
<dminuoso> Huh? :o
<dminuoso> TH is quite a bag, what kind of problem did you have?
<Burgestrand> I'm not sure I can do the specifics justice to justify it today, but I had the luck of having a handful of haskell core members around me to ask for advice at the time that verified my approach, i.e. put up with the boilerplate or use template haskell. I wish I had a better answer than "trust me", because honestly I don't think that's a good argument :)
<dminuoso> Burgestrand: No I get it. Im writing a protocol implementation and I have to use TH for one part of it (but thats really just boilerplate reduction) as well.
<dminuoso> Burgestrand: In most cases you *could* still escape into the value world (like you would do in Ruby anyhow)
<Burgestrand> Aye, it wasn't something that couldn't be solved in regular haskell, it just required A LOT of typing, it was essentially turning a stream of bytes into a stream of records
karapetyan has joined #ruby
<Burgestrand> s/records/packet data types/
<dminuoso> Burgestrand: But I like TH for the fact that I get to do meta programming before the type checker runs.
<cdunklau> dminuoso: when you say "type" what do you mean
<cdunklau> like, type theory type?
Mike11 has joined #ruby
<dminuoso> cdunklau: what other types are there?
<cdunklau> dminuoso: it's a massively overloaded term
<dminuoso> cdunklau: if you implement a type system, its really not
<dminuoso> cdunklau: its just programmers that dont understand it well/at all that have a bajillion ideas what a type might be
<dminuoso> cdunklau: https://ro-che.info/ccc/17
<leah2> anyone know if Eric Wong is on irc?
plexigras has joined #ruby
<dminuoso> cdunklau: the probably best universally accepted definition arises from TaPL: "A type system is a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according to the kinds of values they compute"
karapetyan has quit [Remote host closed the connection]
<cdunklau> dminuoso: okay
shinnya has quit [Ping timeout: 260 seconds]
<cdunklau> dminuoso: i was mostly just wondering what you meant by type there, semantically
<cdunklau> dminuoso: thanks for the link, i was looking for a rabbit hole to dive into :)
<dminuoso> cdunklau: There's a lot of depth in that definition by the way, and it might hint at what Im trying to say.
<dminuoso> a "type-safe" language, is that that ties types to a certain operational model
<dminuoso> *is a language that
<cdunklau> dminuoso: oh i meant the link that your link gave https://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/
<dminuoso> cdunklau: ah yeah its a nice little read :)
<cdunklau> dminuoso: i never had a formal CS education (or math beyond linear algebra), so getting tidbits like this is as frusterating as it is astonishing :)
ellcs has quit [Ping timeout: 260 seconds]
<cdunklau> dminuoso: i suppose what i'm trying to say is "i have no idea what you're saying"
<dminuoso> cdunklau: Let me give you an example:
<cdunklau> if you want. i'm not confident i'll be able to understand it, fair warning :)
<dminuoso> cdunklau: Type safe means: "Within some model, a well-typed program will not perform a set of *bad* behaviors"
<dminuoso> cdunklau: On Java that set of bad behaviors includes "not seg faulting"
<dminuoso> Which is to say: If a Java program type checks, you are guaranteed to not have seg faults.
<Burgestrand> dminuoso I guess my opinion stems from the common one, i.e. I'm okay with trading correctness (better type system) for convenience (and in effect, higher risk of bugs)
<Burgestrand> Which is why I like both ruby… and not ruby :)
<dminuoso> Burgestrand: but what convenience do you get?
<Burgestrand> Anyway, lunch time!
<Burgestrand> dminuoso I do believe it's more convenient to not have to think about the types in such a rigid fashion
<cdunklau> dminuoso: clearly, the freedom of lunchtime
<Burgestrand> I'll be back later to elaborate if necessary
<dminuoso> Burgestrand: foo.bar.quux[10] ... "It's okay to not think too hard what `quux` actually is. Maybe its an array, or maybe it's an Integer.. but its beneficial that this is accepted and crashes instead"
<dminuoso> This is what Im getting from you :P
<dminuoso> *`foo.bar.quux`
AJA4350 has joined #ruby
<dminuoso> We programmers tend to think a lot about types implicitly. When we write code, we always have some intuition about how to use results further - we have some intuition about what state the data is in.
<dminuoso> We have some intuition about some of the invariants we have
<dminuoso> Here's one proof that you do think about types:
cadillac_ has quit [Ping timeout: 260 seconds]
Mike11 has quit [Ping timeout: 264 seconds]
amar_ has joined #ruby
<dminuoso> 1.puts({ nil.nil.nil => raise "This is nonsense" })
cadillac_ has joined #ruby
<dminuoso> This would make any ruby programmer scream.
<dminuoso> But why?
<cdunklau> dminuoso: can you translate that to a language i know? :P
<dminuoso> Thats ruby.
<cdunklau> say, python, or javascript
<cdunklau> i know, i'm new here :)
<dminuoso> cdunklau: Oh.
<cdunklau> i assume the arg to puts() is a hash?
<dminuoso> cdunklau: 1.puts({ (nil.nil.nil): throw "this is nonsense" })
<cdunklau> or is => a different thing
<dminuoso> this then
<dminuoso> equivalent in JavaScript
<cdunklau> well that's a syntax error isn't it?
<dminuoso> Is it?
<dminuoso> Oh I think I may have to use
<dminuoso> 1.puts({ [nil.nil.nil]: throw "this is nonsense" })
<dminuoso> maybe some more parens for throw?
<dminuoso> 1.puts({ [nil.nil.nil]: throw("this is nonsense") })
<dminuoso> cdunklau: we constantly think in terms of contracts, what we can do with things, and what we get back
<cdunklau> dminuoso: 1.puts({ nil.nil.nil => raise "This is nonsense" }) is a syntax error in ruby too
<cdunklau> dminuoso: for the sake of discussion, can i just assume that `raise "this is nonsense"` is supposed to be an expression that throws an exception?
<dminuoso> 1.puts({ nil.nil.nil => raise("This is nonsense") })
<dminuoso> cdunklau: Yes.
<cdunklau> ok
marius has quit [Quit: baj]
<dminuoso> cdunklau: Here's the following contracts I broke: puts is not a (public) method of Integer. I probably meant `Kernel#puts` but who knows.
<dminuoso> nil.nil.nil is a silly thing to do
karapetyan has joined #ruby
marius has joined #ruby
<dminuoso> and Im putting a `raise` in a spot where a value is expected
<cdunklau> dminuoso: ok, i have to step away for a few minutes, but please continu
<cdunklau> e
<dminuoso> if you write: console.log.log("foo") in javascript this would obviously be wrong too. the reason for that, is that you mentally know that `console.log` does not give you something back, that has .log in its prototype.
<dminuoso> even when you type `console.log` you make the implicit assumption that `console` has a prototype that provides `log`
<dminuoso> when you write: `a + b` you already have the thought lingering in your head "a" and "b" are numbers
karapetyan has quit [Remote host closed the connection]
chat has joined #ruby
<dminuoso> cdunklau: https://gist.github.com/dminuoso/f552b4ddebaf64ca64d7b4ffb46f538c when you read this, does this look right to you?
chat_ has quit [Ping timeout: 260 seconds]
Beams has joined #ruby
aufi_ has joined #ruby
rr4 has joined #ruby
Beams__ has joined #ruby
rr4 is now known as oxx16
zapata_ has joined #ruby
Beams has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
zapata has quit [Ping timeout: 256 seconds]
<cdunklau> dminuoso: no, because add doesn't return something callable
Beams__ has quit [Ping timeout: 248 seconds]
<dminuoso> cdunklau: would you accidentally write it? or would you think about what add returns when you use it?
<cdunklau> dminuoso: i would think that add returns a number, so calling the result would not make sense
oxx16 has left #ruby [#ruby]
<cdunklau> and presumably i'd have a unit test for add() that would catch that it doesn't return the result
za1b1tsu has quit [Quit: WeeChat 2.1]
<dminuoso> cdunklau: so this would trigger a certain bad behavior: A runtime error "blablabl is not a function" right?
<cdunklau> sure
schleppel has quit [Quit: Konversation terminated!]
<dminuoso> flow for example, wrt to the operational model of JavaScript, classifies "is not a function" as bad behaviors.
<dminuoso> cdunklau: and it does the same thing that you did in your head.
<cdunklau> flow is the typescripty thing right?
<dminuoso> nope
<dminuoso> its a great example of what type systems are about.
<dminuoso> its just a stand alone program. you give it some JS code, and it will either "type check" or "not"
jrafanie has joined #ruby
<dminuoso> it does so soley based on syntactic elements
<dminuoso> it "stares at the code" and says "this doesnt make sense"
<dminuoso> just what you did.
<dminuoso> except it doesnt justify by guessing, but by employing an automated theorem solver
<dminuoso> its particularly a good example because it shows that type checking and compilation/runtime are not necessarily related in any way
aufi_ has quit [Quit: Leaving]
karapetyan has quit [Remote host closed the connection]
<dminuoso> now the value from type checkers stems from the fact that they prove the absence of certain behaviors.
karapetyan has joined #ruby
<cdunklau> neat
schleppel has joined #ruby
<dminuoso> flow doesnt provide a particularly useful type system *in that sense* because there exist escape hatches that basically invalidate most such proofs.
<dminuoso> its still valuable in a different sense
<dminuoso> but in Haskell and Java the type system *proves* (amongst other things) the absence of segmentation faults.
<dminuoso> which means you can get rid of all tests that assert segfaults dont happen, because you have 100% complete provable coverage for that behavior.
<dminuoso> Haskell too has escape hatches (which means it's not *as provable* as one might hope), that is there's certain primitives I can use to provoke a segfault.
<dminuoso> So again, it's not that useful to make that particular claim.
karapetyan has quit [Remote host closed the connection]
Zaab1t has joined #ruby
ramfjord has joined #ruby
<dminuoso> but they prove the absence of many other properties too. rich type systems allow you to specify such properties within the type system, so you can codify arbitrary "bad properties", and have the type system *prove* their absence to you
<dminuoso> For example you might have some type `InputString a` parameterized over another type. If you then consume only `InputString Sanitized` in the database, and produce `InputString Unsanitized` from the userinput, then the type system will prove that no unsanitized string enters your database,.
raynold has quit [Quit: Connection closed for inactivity]
<Burgestrand> dminuoso your original interpretation sounds about right :)
ramfjord has quit [Ping timeout: 276 seconds]
Beams has joined #ruby
tcopeland has quit [Quit: tcopeland]
cadillac_ has quit [Ping timeout: 256 seconds]
yokel has quit [Ping timeout: 255 seconds]
hays has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
hays has joined #ruby
cadillac_ has joined #ruby
<Burgestrand> dminuoso in theory I guess there could be a perfect type system and perfect type inference, but I'm not aware of any such implementation today
dionysus69 has quit [Quit: dionysus69]
<arne> wow, you're still going
dionysus69 has joined #ruby
<Burgestrand> arne Well, lunch is over, and I got a question :)
ldnunes has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Burgestrand> arne or, well, it felt like an implied question!
yokel has joined #ruby
cadillac_ has quit [Ping timeout: 265 seconds]
cadillac_ has joined #ruby
agent_white has quit [Quit: bbl]
<cdunklau> dminuoso: out of curiosity, what languages do you enjoy using?
psychicist__ has joined #ruby
<cdunklau> dminuoso: let me be more specific
fmcgeough has joined #ruby
<cdunklau> what languages do you enjoy using to write useful software
<cdunklau> i'm not sure there's a difference, but just in case :)
ur5us has quit [Remote host closed the connection]
tvw has joined #ruby
ur5us has joined #ruby
micutzu has quit [Ping timeout: 244 seconds]
jottr has quit [Ping timeout: 268 seconds]
chamar has joined #ruby
Nuve has left #ruby ["✌"]
synthroid has joined #ruby
whowantstolivefo has joined #ruby
jcalla has joined #ruby
karapetyan has joined #ruby
ellcs has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
conta has quit [Quit: conta]
llua` has joined #ruby
cyberg has joined #ruby
llua has quit [Ping timeout: 260 seconds]
llua` is now known as llua
ellcs has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
c0ncealed1 has quit [Remote host closed the connection]
chamar has quit [Quit: Leaving]
k0mpa has joined #ruby
c0ncealed1 has joined #ruby
ellcs has joined #ruby
reber has quit [Ping timeout: 248 seconds]
reber__ has joined #ruby
<dminuoso> Burgestrand: Actually it's been shown that a perfect type system cant exist.
<dminuoso> Burgestrand: Id have to dig but there are proofs that demonstrate that type systems always filter out *some* good programs.
<Burgestrand> dminuoso Oh, cool, I didn't know that
ramfjord has joined #ruby
jottr has joined #ruby
kliq has quit [Ping timeout: 264 seconds]
<dminuoso> Burgestrand: Just asked some friends. Rice's theorem is the foundation.
<cdunklau> my intuition tells me that's probably related to Gödel's incompleteness theorem
karapetyan has quit [Ping timeout: 255 seconds]
ramfjord has quit [Ping timeout: 248 seconds]
tcopeland has joined #ruby
ellcs has left #ruby [#ruby]
<dminuoso> cdunklau: http://tunes.org/~nef/logs/haskell/18.06.08 near the bottom.
wkoszek2 has joined #ruby
<cdunklau> dminuoso: see i do know stuff! i just can't prove it :P
wkoszek2 has quit [Ping timeout: 260 seconds]
tcopeland has quit [Quit: tcopeland]
BlopMonster has joined #ruby
synthroid has quit [Remote host closed the connection]
karapetyan has joined #ruby
BlopMonster has quit [Ping timeout: 245 seconds]
karapetyan has quit [Ping timeout: 245 seconds]
micutzu has joined #ruby
synthroid has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
synthroid has quit [Ping timeout: 264 seconds]
griffindy has joined #ruby
karapetyan has joined #ruby
mudwaf has joined #ruby
<mudwaf> Is this the right place to ask about a problem I'm having with ruby + Sequel / SQLite?
<Burgestrand> mudwaf Give it a try, if it isn't somebody is hopefully helpful enough to point you to a better place :)
<dminuoso> cdunklau: I like SQL very much.
<cdunklau> dminuoso: ooooh
<dminuoso> It's declarative, pure.. and its an algebra.
<cdunklau> dminuoso: have you been nerd-sniped by https://www.schemaverse.com/ yet?
apparition has joined #ruby
<dminuoso> cdunklau: I cant access it, it appears
<cdunklau> oh nooooo
<cdunklau> :(
<cdunklau> dminuoso: tl;dr it's a simple space fleet combat game implemented entirely in a postgres DB
<dminuoso> cdunklau: with or without PL/...?
<cdunklau> multiplayer. the only UI you get is psql or whatever client you want
karapetyan has quit [Ping timeout: 256 seconds]
<cdunklau> dminuoso: you can use the normal PL/s
<dminuoso> There we goi
<dminuoso> cdunklau: Ah shoot, that's far less boring.
<cdunklau> lol
<cdunklau> but iirc there's a limiting factor for scripts
<cdunklau> like you can only have a certain number of "fleet scripts"
<dminuoso> cdunklau: but to answer your original question I enjoy Haskell a lot these days. Rust is also quite fine, PureScript is on my list as well as Idris.
jamesaxl has joined #ruby
<dminuoso> Probably should learn more OCaml as well.
<mudwaf> Well, the program starts out by opening a SQLite database read-only, and reading in many rows. It then forks many processes (based on the data read in), but when those processes attempt to use the database, some of them sometimes raise an exception: `SQLite3::CorruptException: database disk image is malformed`. The database is not actually corrupted and it works fine if the children processes execute serially. It's not consistently at a single spot
<mudwaf> in the child process code, so I'm thinking it has to do with the code being parallel, though Sequel claims to be fully "Thread safe." Has anyone here run into something similar?
<cdunklau> dminuoso: if you're curious about schemaverse maybe poke them in #schemaverse to tell them about it
<dminuoso> cdunklau: Nah. With PL/.. stuff its boring.
<cdunklau> heh
<cdunklau> dminuoso: you don't have to use PL/
<cdunklau> the game is what you make it ;)
<dminuoso> cdunklau: I actually know of one major "business" company that makes million on a grand software consisting of literalls tens of thousands of *triggers*
<dminuoso> They encoded a whole identity managemer, transitions, rule engine - all with triggers.
pabs has quit [Ping timeout: 268 seconds]
<cdunklau> dminuoso: i'm not a good enough DBA to grasp the implications of that, but i can't imagine it's good
<dminuoso> You have to run this on a MSSQL server with 64GiB of RAM to perform well.
<cdunklau> shite
<dminuoso> At first I thougth it was a joke when the guy was telling me about it in amazement.
<cdunklau> lol
<cdunklau> dminuoso: i haven't gotten deep into many languages. my python is on point, i'm decent with JS, but i can't claim more than passing familiarity with any other languages
<cdunklau> dminuoso: i'm here because i'm considering a job that uses Java, Groovy, PHP, and Ruby
<dminuoso> Sounds horrid!
<cdunklau> java is... eh. dunno about groovy. PHP is clearly awful. ruby looks niceish though
<cdunklau> dminuoso: eh, devops
<dminuoso> devops with Java, Groovy and PHP?
<cdunklau> and ruby
<cdunklau> :P
epochwolf|2 has joined #ruby
<cdunklau> that's just "languages our company uses", not necessarily what devops uses
<cdunklau> i suspect a lot of the job would be messing around with puppet and such
synthroid has joined #ruby
* dminuoso can already see cdunklau ending up in a dark cellar being locked away with ancient cruft PHP scripts invoking `ldapsearch` to pump information from one place to the next
* dminuoso ... and it being called devops
<cdunklau> the thing that gets me excited about it the possibility of working with people more experienced with me. right now i'm doing QA-ish automation stuff, and nobody else knows wtf they're doing
donofrio has joined #ruby
<cdunklau> that's not *really* a fair assessment, but it's the feeling i have
pabs has joined #ruby
<cdunklau> dminuoso: jesus don't put that poison in my brain! :D
epochwolf|2 has quit [Client Quit]
snickers has quit [Ping timeout: 245 seconds]
rippa has joined #ruby
hobbes_ has joined #ruby
chamar has joined #ruby
Creatornator has joined #ruby
hobbes_ has quit [Remote host closed the connection]
mrBen2k2k2k has joined #ruby
TomyWork has joined #ruby
hays_ has joined #ruby
hays_ has joined #ruby
hays_ has quit [Changing host]
karapetyan has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
<cdunklau> dminuoso: what do you like about rust?
Azure has quit [Read error: Connection reset by peer]
<dminuoso> cdunklau: It has a type system that is somewhat expressive.
Azure has joined #ruby
<dminuoso> cdunklau: In a lot of ways it's built on first principles and has managed to avoid a lot of the issues of many mainstream languages.
jottr has quit [Ping timeout: 260 seconds]
Rapture has joined #ruby
Jeff_D has joined #ruby
chat_ has joined #ruby
chat has quit [Ping timeout: 256 seconds]
k0mpa has quit [Remote host closed the connection]
karapetyan has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ciscam has quit [Ping timeout: 276 seconds]
<Jeff_D> Can anybody answer, or point me to where I can find answered, questions about running capybara-webkit tests from `rake` inside a Docker container? I understand that I need to run within the context of Xvfb. `docker-compose exec web xvfb-run -a ruby path/to/some_spec.rb` works, but `docker-compose exec web xvfb-run -a bin/rake` has a failure in `some_spec.rb` because a Capybara match fails. I'm pulling my hair out here, and I really don't have a lot to start
<Jeff_D> with :P
paul_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
kliq has joined #ruby
karapetyan has quit [Ping timeout: 276 seconds]
nowhere_man has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
mikecmpbll has quit [Ping timeout: 240 seconds]
ciscam has joined #ruby
biberu has quit []
jottr has joined #ruby
ciscam has quit [Read error: Connection reset by peer]
ciscam has joined #ruby
hays_ has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
<Jeff_D> hmmmm...anybody awake?
dendazen has joined #ruby
amar_ has quit [Ping timeout: 265 seconds]
Creatornator has joined #ruby
rsh has joined #ruby
jrafanie has joined #ruby
gnufied has joined #ruby
kliq has quit [Ping timeout: 276 seconds]
andikr has quit [Remote host closed the connection]
<flips> I'm afraid being awake is not enough, I have no idea about capybara/docker stuff ...
dionysus69 has quit [Ping timeout: 265 seconds]
aupadhye has quit [Remote host closed the connection]
<Jeff_D> well, thanks anyway. I'll keep beating my head against this until one or the other breaks, or until massive expenditures of Google-fu start showing less whimsical returns
nowhere_man has quit [Ping timeout: 256 seconds]
amar_ has joined #ruby
akaiiro has joined #ruby
[Butch] has joined #ruby
[Butch] has quit [Client Quit]
Axy has joined #ruby
Mia has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
snickers has joined #ruby
jinie has quit [Ping timeout: 256 seconds]
megamos has joined #ruby
jinie has joined #ruby
yorickpeterse has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
tvw has quit [Remote host closed the connection]
akaiiro has quit [Ping timeout: 260 seconds]
za1b1tsu has joined #ruby
shinnya has joined #ruby
clemens3 has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Closing time!]
karapetyan has joined #ruby
jinie has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 264 seconds]
yorickpeterse has quit [Quit: WeeChat 2.1]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinie has joined #ruby
Creatornator has joined #ruby
karapetyan has quit [Ping timeout: 245 seconds]
yokel has quit [Ping timeout: 264 seconds]
suukim has joined #ruby
nowhere_man has joined #ruby
apparition has quit [Quit: Bye]
akaiiro has joined #ruby
chouhoulis has joined #ruby
psychicist__ has quit [Ping timeout: 264 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 268 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cam27 has joined #ruby
pabs has quit [Ping timeout: 248 seconds]
dmgk has joined #ruby
pabs has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
yohji has quit [Remote host closed the connection]
pabs has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
jottr has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
mikecmpbll has quit [Ping timeout: 264 seconds]
pabs has joined #ruby
jcarl43 has joined #ruby
Creatornator has joined #ruby
megamos has quit [Ping timeout: 240 seconds]
Immune has joined #ruby
Creatornator has quit [Client Quit]
sysvalve has quit [Quit: Leaving]
amar__ has joined #ruby
amar_ has quit [Ping timeout: 256 seconds]
pabs has quit [Ping timeout: 260 seconds]
darkhanb has joined #ruby
amar__ has quit [Ping timeout: 265 seconds]
cthulchu has joined #ruby
Immune has left #ruby ["WeeChat 2.1"]
amar_ has joined #ruby
jinie has quit [Ping timeout: 240 seconds]
cyberg has left #ruby ["Leaving"]
jinie has joined #ruby
bbobb has joined #ruby
Jeff_D has quit [Quit: STRPT: JMP $ ; Story of my day.]
FernandoBasso has joined #ruby
chopin has joined #ruby
DTZUZO has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
biberu has joined #ruby
<chopin> Any time I run rspec "x86_64-darwin-17" is added to my Gemfile.lock under the PLATFORMS heading. Any ideas why that is / how to stop it?
pabs has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
amar__ has joined #ruby
eckhardt_ has joined #ruby
amar_ has quit [Read error: Connection reset by peer]
Beams has quit [Quit: .]
psychicist__ has joined #ruby
BlopMonster has joined #ruby
sanscoeur has joined #ruby
synthroid has quit []
BlopMonster has quit [Ping timeout: 256 seconds]
chouhoulis has quit [Remote host closed the connection]
jyaworski has joined #ruby
chouhoulis has joined #ruby
ldepandis has joined #ruby
chouhoul_ has joined #ruby
ldepandis has quit [Client Quit]
venmx has quit [Ping timeout: 256 seconds]
chouhou__ has joined #ruby
chouho___ has joined #ruby
chou_____ has joined #ruby
chouhoulis has quit [Ping timeout: 276 seconds]
chouhoul_ has quit [Ping timeout: 276 seconds]
chouhoulis has joined #ruby
chouhou__ has quit [Ping timeout: 264 seconds]
chouhoul_ has joined #ruby
chouho___ has quit [Ping timeout: 276 seconds]
chouhou__ has joined #ruby
karapetyan has quit [Remote host closed the connection]
chou_____ has quit [Ping timeout: 264 seconds]
RougeR has quit [Ping timeout: 248 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 264 seconds]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 264 seconds]
millerti has joined #ruby
chouhou__ has joined #ruby
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 248 seconds]
ta_ has quit [Remote host closed the connection]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 248 seconds]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 264 seconds]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 256 seconds]
chouhou__ has joined #ruby
ta_ has joined #ruby
chouho___ has quit [Ping timeout: 248 seconds]
TomyWork has quit [Remote host closed the connection]
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 256 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 265 seconds]
chouhoul_ has joined #ruby
chouhou__ has quit [Ping timeout: 240 seconds]
chouho___ has quit [Ping timeout: 265 seconds]
chouh____ has quit [Ping timeout: 248 seconds]
chouh____ has joined #ruby
chouhoulis has quit [Ping timeout: 265 seconds]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 256 seconds]
jinie has quit [Ping timeout: 245 seconds]
chouhoul_ has joined #ruby
chouhou__ has joined #ruby
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 264 seconds]
chouh____ has joined #ruby
jinie has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
paraxial has quit [Read error: Connection reset by peer]
chouhoul_ has quit [Ping timeout: 268 seconds]
chouhoul_ has joined #ruby
mikecmpbll has joined #ruby
Mike11 has joined #ruby
chouhou__ has quit [Ping timeout: 268 seconds]
chouhou__ has joined #ruby
chouho___ has quit [Ping timeout: 240 seconds]
mtkd has quit []
chouho___ has joined #ruby
chouh____ has quit [Ping timeout: 256 seconds]
[Butch] has joined #ruby
chouh____ has joined #ruby
jottr has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
chouhoul_ has quit [Ping timeout: 256 seconds]
chouhou__ has quit [Ping timeout: 268 seconds]
paraxial has joined #ruby
chouho___ has quit [Ping timeout: 240 seconds]
chouh____ has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
lytol has joined #ruby
paraxial has quit [Read error: Connection reset by peer]
paraxial has joined #ruby
Cavallari has joined #ruby
Cavallari has quit [Client Quit]
npgm has joined #ruby
mtkd has joined #ruby
cam27 has quit [Quit: cam27]
Mike11 has quit [Ping timeout: 264 seconds]
suukim has quit [Quit: Konversation terminated!]
Zaab1t has quit [Quit: Zaab1t]
ta_ has quit [Remote host closed the connection]
ramfjord has joined #ruby
amatas has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
amatas_ has joined #ruby
micutzu has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
bmurt has joined #ruby
amatas_ has quit [Remote host closed the connection]
amatas_ has joined #ruby
amatas has quit [Ping timeout: 276 seconds]
amatas_ is now known as amatas
amatas has quit [Client Quit]
karapetyan has joined #ruby
za1b1tsu has joined #ruby
amatas has joined #ruby
apeiros_ is now known as apeiros
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
paraxial has quit [Ping timeout: 264 seconds]
karapetyan has quit [Ping timeout: 245 seconds]
TomyLobo has joined #ruby
pabs has quit [Ping timeout: 260 seconds]
pabs has joined #ruby
amatas has quit [Quit: amatas]
chat__ has joined #ruby
paraxial has joined #ruby
jottr has joined #ruby
chat_ has quit [Ping timeout: 276 seconds]
jottr has quit [Ping timeout: 255 seconds]
sauvin has quit [Remote host closed the connection]
paraxial has quit [Ping timeout: 260 seconds]
mtkd has quit []
paraxial has joined #ruby
micutzu has joined #ruby
mtkd has joined #ruby
paraxial has quit [Read error: Connection reset by peer]
paraxial has joined #ruby
orbyt_ has joined #ruby
paraxial has quit [Ping timeout: 264 seconds]
paraxial has joined #ruby
\void has joined #ruby
darkhanb has quit [Ping timeout: 264 seconds]
paraxial has quit [Ping timeout: 265 seconds]
izaac has quit [Changing host]
izaac has joined #ruby
dendazen has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
dionysus69 has joined #ruby
cadillac_ has quit [Ping timeout: 264 seconds]
cadillac_ has joined #ruby
lethan has joined #ruby
kapil___ has joined #ruby
rsh has quit [Quit: leaving]
moei has joined #ruby
millerti has quit [Ping timeout: 240 seconds]
tanema has joined #ruby
paraxial has joined #ruby
tanema has quit [Quit: WeeChat 2.1]
paraxial has quit [Ping timeout: 256 seconds]
agent_white has joined #ruby
mjolnird has quit [Remote host closed the connection]
mtkd has quit []
amar__ has quit [Remote host closed the connection]
paraxial has joined #ruby
<cthulchu> folks, how do we execute_script having the @selenium_wrapper
tanema has joined #ruby
mtkd has joined #ruby
<cthulchu> or @driver_wrapper
cthulchu_ has joined #ruby
cthulchu has quit [Ping timeout: 245 seconds]
pabs has quit [Ping timeout: 264 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
<dminuoso> arne: Hah okay. So it turns out the Ruby implementation of TVar is way too naive to pull this off.
pabs has joined #ruby
tanema has quit [Ping timeout: 256 seconds]
tanema has joined #ruby
tdy1 has joined #ruby
micutzu has quit [Ping timeout: 264 seconds]
tdy has quit [Ping timeout: 264 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
amar has joined #ruby
tdy1 has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 256 seconds]
grilix has quit [Ping timeout: 256 seconds]
tanema has quit [Ping timeout: 265 seconds]
ta_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
karapetyan has joined #ruby
jcalla has quit [Quit: Leaving]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tanema has joined #ruby
dionysus69 has joined #ruby
tdy1 has joined #ruby
karapetyan has quit [Ping timeout: 255 seconds]
tanema has quit [Ping timeout: 240 seconds]
grilix has joined #ruby
biberu has quit []
jottr has joined #ruby
cthu| has joined #ruby
megamos has joined #ruby
cthulchu_ has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 256 seconds]
venmx has joined #ruby
ta_ has quit [Remote host closed the connection]
tanema has joined #ruby
mudwaf has quit [Quit: Leaving]
beefjoe has joined #ruby
megamos has quit [Ping timeout: 248 seconds]
megamos has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
tdy1 has quit [Ping timeout: 240 seconds]
megamos has quit [Ping timeout: 240 seconds]
ta_ has joined #ruby
tanema has quit [Quit: WeeChat 2.1]
ta_ has quit [Remote host closed the connection]
edwardly has quit [Ping timeout: 264 seconds]
weaksauce has joined #ruby
lethan has quit []
lunarkitty7 has quit [Ping timeout: 276 seconds]
tdy1 has joined #ruby
akem has joined #ruby
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
micutzu has joined #ruby
akem_ has quit [Ping timeout: 256 seconds]
BlopMonster has joined #ruby
bga57 has quit [Remote host closed the connection]
BlopMonster has quit [Ping timeout: 260 seconds]
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
orbyt_ has joined #ruby
TomyLobo has quit [Ping timeout: 260 seconds]
lunarkitty7 has joined #ruby
yellowman has joined #ruby
<yellowman> Hi, I'm trying to use Builder::XmlMarkup, and over here https://github.com/jimweirich/builder#version-200-compatibility-changes it says I have to use symbol values to not escape the XML. How do I pass a string value contained in a hash as a symbol?
pabs has quit [Ping timeout: 264 seconds]
beefjoe has quit [Ping timeout: 268 seconds]
pabs has joined #ruby
<yellowman> Never mind, that is for attributes only. I figured it out.
yellowman has quit [Quit: ircII EPIC4-2.10.6 -- Are we there yet?]
t0xik has joined #ruby
beefjoe has joined #ruby
chouhoul_ has joined #ruby
chouhoul_ has quit [Remote host closed the connection]
mjolnird has joined #ruby
ldnunes has quit [Quit: Leaving]
chouhoulis has quit [Ping timeout: 268 seconds]
edwardly has quit [Ping timeout: 260 seconds]
za1b1tsu has quit [Quit: WeeChat 2.1]
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
dionysus69 has quit [Quit: dionysus69]
<beefjoe> Why is this not working
<beefjoe> `JSON.generate({ :result => res) })`
<beefjoe> says syntax error
<beefjoe> res is a variable
<Zarthus> look at the )
<Zarthus> there's two of them.
<Zarthus> But the number of ( I See is only one.
<beefjoe> how ?
<Zarthus> ..by using your eyes.
<Zarthus> I'm not sure what to tell you.
<beefjoe> omg right
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
schleppel has quit [Quit: Konversation terminated!]
micutzu has quit [Ping timeout: 260 seconds]
beefjoe has quit [Remote host closed the connection]
amar_ has joined #ruby
amar has quit [Ping timeout: 248 seconds]
zapata_ is now known as zapata
za1b1tsu has joined #ruby
planigan has joined #ruby
karapetyan has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
eckhardt_ has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
ramfjord has joined #ruby
mjolnird has quit [Remote host closed the connection]
micutzu has joined #ruby
sonOfRa has quit [Remote host closed the connection]
Anthony_Bourdain has joined #ruby
karapetyan has quit [Remote host closed the connection]
karapetyan has joined #ruby
RougeR has quit [Ping timeout: 264 seconds]
cthulchu_ has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 256 seconds]
sonOfRa has joined #ruby
karapety_ has joined #ruby
jrich523 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
ramfjord has joined #ruby
cthu| has quit [Ping timeout: 245 seconds]
plexigras has quit [Ping timeout: 255 seconds]
eckhardt_ has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
bbobb has quit [Quit: bbobb]
ramfjord has quit [Ping timeout: 240 seconds]
eckhardt_ has quit [Client Quit]
ramfjord has joined #ruby
griffindy has quit [Read error: Connection reset by peer]
beefjoe has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
eckhardt_ has joined #ruby
paraxial has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
chopin has quit []
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
knight33 has joined #ruby
knight33 has quit [Max SendQ exceeded]
jottr has joined #ruby
sameerynho has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
Asher has quit [Ping timeout: 260 seconds]
micutzu has quit [Ping timeout: 240 seconds]
Puffball has joined #ruby
postmodern has joined #ruby
jottr has quit [Ping timeout: 256 seconds]
mtkd has quit []
za1b1tsu has quit [Quit: WeeChat 2.1]
jenrzzz has quit [Ping timeout: 240 seconds]
clemens3_ has quit [Ping timeout: 265 seconds]
<cthulchu_> folks, I have a question about instance variables
<havenwood> cthulchu_: ask away
<cthulchu_> if we extend a class that has @a. We extend it by creating another class. How do we refer to that @a in the child class? just @a?
<apeiros> cthulchu_: you can't
<apeiros> instance variables belong to a single object
<apeiros> and in the case of it belonging to a class, it belongs to that class alone.
<cthulchu_> errr
<cthulchu_> I don't understand why can't I
<apeiros> lets see whether you understand it for "normal" instances
<apeiros> >> class Foo; def initialize(x); @x = x; end; attr_reader :x; end; a = Foo.new(:ivar_of_a); b = Foo.new(:ivar_of_b); {a: a.x, b: b.x}
<ruby[bot]> apeiros: # => {:a=>:ivar_of_a, :b=>:ivar_of_b} (https://eval.in/1017991)
<apeiros> cthulchu_: ^ you understand why a.x and b.x are different, and that a can't access b's @x directly?
<cthulchu_> I have a class "living being" with variable @height. I extend it with a class "dog". Can I use @height in dogs?
<apeiros> yes. but the values in LivingBeing will not be the same as in Dogs.
<cthulchu_> I didn't ask if the values in living being will be the same
<cthulchu_> okay
<cthulchu_> got it
<cthulchu_> thanks
<apeiros> yes, but your question was also vague.
<apeiros> but I'll note that you want strictly just answers to what you've asked. I hope you're prepared to deal with potential confusion then :-p
<cthulchu_> yes, it'd be faster :)
amar has joined #ruby
shinnya has joined #ruby
<cthulchu_> so just like in other languages, if I create a dog, it implicitly creates a living being
amar_ has quit [Ping timeout: 256 seconds]
<cthulchu_> and all the @ variables defined in living being are now can be used in dog
<apeiros> that's not how I'd phrase it.
<apeiros> that's also strictly not accurate.
<cthulchu_> it's just I'm tring to read this code properly
<cthulchu_> ok, what's not accurate?
<apeiros> you don't define variables in ruby. first assignment vivifies them.
<cthulchu_> oh
<cthulchu_> wow
<cthulchu_> hell
<apeiros> code running in the context of an object has access to ivars of that object
<apeiros> i.e. a superclass' method running on an object has access because it runs in the context of a subclass' instance.
<cthulchu_> interesting
<apeiros> and classes are objects. their ivars obey the same rules.
<cthulchu_> so we can use ivars of a subclass in a superclass' method?
<apeiros> yes
<cthulchu_> weird
<apeiros> and vice versa.
<cthulchu_> anyhow, why then do this? https://i.imgur.com/0TGcDa3.png
<apeiros> because "ivars of a class" is wrong
<apeiros> it's "ivars of an object"
<cthulchu_> right right
<apeiros> code as an image? srsly? :D
<cthulchu_> well it's in a VNC here
<cthulchu_> hard to copy from there
<apeiros> you'd have to ask the author. I do it to make it clear which variables will be used in a class.
<cthulchu_> oh, good
<apeiros> i.e. I'll always initialize all ivars in #initialize
<apeiros> but it's not required.
<apeiros> ivars and globals are special in that they can also autovivify on first read (they'll automatically be assigned nil)
<apeiros> >> class Foo; attr_accessor :x; end; foo = Foo.new; p before: foo.instance_variables; foo.x; p after: foo.instance_variables # check the link
<ruby[bot]> apeiros: # => {:before=>[]} ...check link for more (https://eval.in/1017993)
<apeiros> oh, huh?
<apeiros> that's interesting. probably an optimization
<cthulchu_> if I have a thing -> living being -> dog -> saint bernard structure and I have a saint bernard object. Can I access methods of a thing directly from my lovely saint bernard?
<cthulchu_> oh, one more thing. there's no protection?
<cthulchu_> I don't see private, public, protected, etc
<apeiros> wow, apparently that has changed a long time ago already.
<cthulchu_> so all is public?
<apeiros> there is
<apeiros> you can mark methods as private or protected. but it's not the same as in java.
<apeiros> also it's more like "advisory", it can be bypassed.
<cthulchu_> oh wow
<apeiros> havenwood: 👍🏻
<apeiros> cthulchu_: and the mechanics for protected are iirc also different.
<cthulchu_> so I can access any superclass' method from any representative of any of its subclasses
<apeiros> hm, it seems I misremembered this. ok, so reading does not actually add them to the ivar table.
<apeiros> cthulchu_: in general, yes.
<cthulchu_> cool
<apeiros> there are a couple of "but"s
<cthulchu_> seems like a pretty relaxed language
<apeiros> it is. if you want to aim a rocket launcher at your foot, ruby will gladly let you.
<apeiros> it does provide you with tools to give you a hint that it might not be a good idea :)
sameerynho has quit [Ping timeout: 264 seconds]
zenspider has quit [Ping timeout: 260 seconds]
zenspider has joined #ruby
BigRonnieRon has joined #ruby
sanscoeur has quit [Ping timeout: 240 seconds]
<cthulchu_> and so we also can do something like @object1.@object2?
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
<cthulchu_> no
<cthulchu_> we can't do that
<cthulchu_> okay, it's weird
<FernandoBasso> What do the cool people use for unicode string manipulation in ruby?
<cthulchu_> I have this awesome method (probably Object's method) that is instance_variables
<cthulchu_> so I can do @selenium_wrapper.instance_variables
<cthulchu_> and get a list of them when I puts them
<cthulchu_> one of the thing I get in the output is the @driver
<cthulchu_> ivar
<cthulchu_> how do I refer to that driver? @selenium_wrapper.driver doesn't work, to my surprise.
<cthulchu_> @selenium_wrapper.@driver doesn't work either
eelster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zenspider has quit [Ping timeout: 240 seconds]
ramfjord has quit [Ping timeout: 264 seconds]
<Zarthus> cthulchu_: what's the output of the puts
<cthulchu_> it says undefined method driver
<cthulchu_> but it's not a method
<cthulchu_> it's a var
<cthulchu_> and I don't ask for .driver()
<cthulchu_> I ask for .driver
<cthulchu_> weird
venmx has quit [Ping timeout: 255 seconds]
ramfjord has joined #ruby
<Zarthus> irb(main):021:0> A.new.instance_variables[0] => :@x
<Zarthus> this doesn't return the value, just the name
<Zarthus> you want to add getter/setter methods.
<cthulchu_> I also investigated. I found the class of my selenium_wrapper and make sure that it's the class I get when puts selenium_wrapper.class
<cthulchu_> and that class looks good and driver is there
micutzu has joined #ruby
zenspider has joined #ruby
<cthulchu_> OMG!
<cthulchu_> there's .instance_variable_get("@#{name}")
<cthulchu_> vvvai?!
<cthulchu_> this is very unusual, but I guess Ruby had a reason to complicate things like so
<Zarthus> *shrug* i would still use a getter
<Zarthus> i haven't really got the ruby expertise for it, but just because something exists doesn't mean it should be used :P
<cthulchu_> sure, a getter... even Java has easier access to them and it can enforce the use of getters
amar has quit [Remote host closed the connection]
amar has joined #ruby
<cthulchu_> oh! it worked
ogres has joined #ruby
<cthulchu_> hell I wouldn't expect something so trivial to be so difficult, but cool! I have the driver! ha! congrats!
ramfjord has quit [Ping timeout: 264 seconds]
amar has quit [Remote host closed the connection]
<cthulchu_> ahahahah, and now I see that there actually is a get_driver
<cthulchu_> loool
<cthulchu_> but it's good to know I can get stuff I need when I need it
venmx has joined #ruby
<apeiros> cthulchu_: are you using pry?
<apeiros> if so, try `ls @selenium_wrapper`
<cthulchu_> I don't know what pry is.
<apeiros> do you know irb?
<cthulchu_> no. It's not my framework. I'm just studying it to inject my testing in existing tests
<cthulchu_> they test frontend functionality and I'm injecting analytics testing in there
<apeiros> trying to find common ground here… do you know what a repl is?
<cthulchu_> no
<apeiros> ok, I guess best thing is you just try it. in your shell, type `irb` and hit enter.
<apeiros> you're in an interactive ruby env there. every line you type is executed and the result shown.
<apeiros> repl = read eval print loop
<apeiros> irb ships with ruby
<cthulchu_> yeah
<cthulchu_> that I have
<apeiros> pry = a better irb, but doesn't ship with ruby (`gem install pry` to get it)
ta_ has joined #ruby
<cthulchu_> why do I need irb though?
<apeiros> to quickly test things
<cthulchu_> yeah
<cthulchu_> but I won't be able to test my classes there
<apeiros> if you have pry installed, you can put `binding.pry` anywhere in your code and it'll drop you into a pry session when that line hits
<cthulchu_> only basic Ruby functionality
<apeiros> you can load any code into irb
<cthulchu_> woooooooow
<cthulchu_> hell yeah
<apeiros> also binding.pry is more what I wanted to tell you about
<cthulchu_> wait
<apeiros> it makes it easy to poke around
beefjoe has quit [Remote host closed the connection]
<cthulchu_> let me play with it first
<apeiros> another note: if @selenium_wrapper.driver does not exist (and hence does not return @driver), it usually means that the author did not want users to access @driver
eelster has joined #ruby
<apeiros> since classes are open, you can always patch it in live in a session. @selenium_wrapper.class.class_eval do attr_accessor :driver end
<cthulchu_> should I require it first maybe?
<apeiros> :) yes
<cthulchu_> how do I require it after I installed it?
<apeiros> sorry, some things become obvious at some point and one forgets to mention them.
<apeiros> require 'pry'
<apeiros> if your project uses a Gemfile, you have to add it there
<apeiros> brb
<cthulchu_> no, require 'pry' doesn't work
<cthulchu_> says can't cannot load such file -- pry (LoadError)
agent_white has quit [Quit: brb]
agent_white has joined #ruby
venmx has quit [Ping timeout: 256 seconds]
<cthulchu_> and it's installed. weird
ta_ has quit [Remote host closed the connection]
chat has joined #ruby
<cthulchu_> aha
<cthulchu_> gemfile thenn
<Zarthus> if it's a literal wrapper, it makes sense it's called get_driver
<Zarthus> but a good wrapper would make it use rubyisms.
psychicist__ has quit [Ping timeout: 256 seconds]
<lupine> mm, rename it to chunky_bacon
shinnya has quit [Ping timeout: 240 seconds]
ta_ has joined #ruby
<cthulchu_> hooooooooly coooow!
<cthulchu_> wow
<cthulchu_> this is like a debugging heaven
chat__ has quit [Ping timeout: 255 seconds]
<cthulchu_> my QA friends will be so happy to learn about it
<Zarthus> it's uh.. pretty normal.
<Zarthus> are you not a ruby developer by trade?
<cthulchu_> no
<cthulchu_> I wonder if JS has it
<cthulchu_> gonna go ask
<Zarthus> your colleagues don't really do teamwork huh :P
<Zarthus> it's called a "REPL", and nodejs has one
<cthulchu_> oh, good then
<Zarthus> pry is by far one of the most pleasant ones to use though.
<cthulchu_> hell
<cthulchu_> and I have two bloody computer science higher educations
<cthulchu_> why don't they teach it
<Zarthus> they don't teach kids useful things in school ;)
<cthulchu_> ridiculous
<agent_white> A cozy cottage of code creations cushioning comfortably conjunctively.
ta_ has quit [Ping timeout: 240 seconds]
<apeiros> cthulchu_: eh, higher eds are supposed to learn about the "lower level stuff" themselves ;-p
gnufied has quit [Ping timeout: 240 seconds]
<Zarthus> apeiros: Lower level stuff, like SQL injections and upgrading your PHP version from old, EOL versions ;)
<apeiros> yupp
<apeiros> "here's some books, read them". or actually even just: "there are books, you should pick some and read them"
<apeiros> oh well, I'm old
<apeiros> today it's probably just "eh, you know how google works, right?"
<Zarthus> apeiros: Not kidding, they used php5.2 and `ext-mysql` (which doesn't support prepared statements, only "real_escape_string", even that wasn't taught) in the first year of college. In 2016 or so.
<Zarthus> for the record, php5.2 was created in 2006 or so
<apeiros> I know. I used php5.2, one of the last versions I used before I found ruby.
<cthulchu_> we used php of 2013 version in my college.
<cthulchu_> it had issues with chaining
<cthulchu_> and ternaries
<apeiros> lolwut? still?
<apeiros> I remember php4 could not chain at all.
<cthulchu_> I know
<cthulchu_> it could, but not always
<apeiros> $foo->bar()->baz() was a syntax error
<Zarthus> php 2013 shouldn't have any problems with either of those.
<apeiros> more like: I'm not aware of a situation where it could. you had to assign to temp variables to chain.
<Zarthus> would be nice if most colleges would just brush up on their modernisation a little bit, anyhow.
<cthulchu_> exactly
<cthulchu_> I ended up having temporary vars
<cthulchu_> completely unneded otherwise
<Zarthus> php4 was terrible, php5 (later versions, 5.4+) was OK, php7+ is nice.
<apeiros> yeah. same.
<apeiros> I came to php4 from perl. always considered it a downgrade.
<Zarthus> sounds about right.
<cthulchu_> after so much disappointment with php, I rewrote all my php stuff into node
<cthulchu_> I embrased callbacks
<cthulchu_> lol
grilix has quit [Ping timeout: 256 seconds]
<Zarthus> we use nodejs at work for a small application made by one node fanatic which has since left the company. None of us want to really learn it
<Zarthus> we're competent enough to write javascript, though.
<lupine> just transpile it to C
<lupine> get your own back
<cthulchu_> node is js. very convenient to work with web
<Zarthus> i'm sure there's specific things to nodejs that we don't learn/care about.
<cthulchu_> although I must admit, I enhoy ruby's syntax a lot more than JS'
<Zarthus> we just treat it as vanilla js
<cthulchu_> yeah
<apeiros> transpile… unword of the year 2016…
mikecmpbll has quit [Quit: inabit. zz.]
<FernandoBasso> Damn php killed perl.
<apeiros> (it's compile)
<FernandoBasso> People stopped using perl for web because php was the new shiny cute thing.
<FernandoBasso> (well, not cute, and not shiny)
<cthulchu_> yes! it worked!
<apeiros> FernandoBasso: right. polished turd.
<cthulchu_> I managed to get JS objects from Selenium into here
<apeiros> cthulchu_: 👍🏻
<cthulchu_> how do we work with JS objects in Ruby though?
<Zarthus> i imagine it involves reading the documentation.
<apeiros> cthulchu_: depends on how the integration layer works. the objects are probably bridged. at least if it uses libv8 or something similar.
<cthulchu_> I'm getting that large Json object
<cthulchu_> in JS I can cast json into object and work with it very conveniently
<apeiros> ?jsonobject
<ruby[bot]> there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
<apeiros> and from your image, I'd say you have a ruby object
<apeiros> (array of hashes & stuff)
<cthulchu_> oh
chamar has quit [Ping timeout: 276 seconds]
<cthulchu_> really?
<apeiros> I *can* be mistaken. you can verify by asking for its class.
<cthulchu_> I will then
eelster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> re json object not existing: in other languages, it'll of course be objects of that language instead of "ruby objects". e.g. in javascript it'll be javascript arrays, objects, strings etc.
cajone has left #ruby [#ruby]
<cthulchu_> the type is array
<cthulchu_> which is perfect
<cthulchu_> it's how I work with it in the browser console