<phaul>
Another completely different question is that if it's sensible to implement a linked list in Ruby in the first place..
<havenwood>
phaul: a Hash is a doubly-circularly linked list already :)
MoritaShinobu has quit [Quit: Leaving]
<phaul>
Yeah Im not saying what's what internally. Im saying using the exposed language features. no FFI
<havenwood>
phaul: yeah, I don't get much occasion to implement one mysellf
<warrshrike>
phaul: here you go class ListNode attr_accessor :val, :next def initialize(val, n) @val = val @next = n end end
<phaul>
exactly.
cd has joined #ruby
<phaul>
I guess insert/delete in the middle would be maybe faster than just an Array, with copying, but, still O(n) either way. But everything else I expect the stdlib Array to be better than this. shift/prepend etc.
eddof13 has quit [Ping timeout: 268 seconds]
hurricanehrndz has quit [Quit: Goodbye]
ricer2 has quit [Remote host closed the connection]
venmx has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.3]
<phaul>
havenwood: are you sure Hash is a double linked list?.. I can beleive it has double linked lists in it. Linked lists are not great for lookup :)
tdy has quit [Ping timeout: 268 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
venmx has quit [Ping timeout: 252 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
<ruby[bot]>
jlebrech: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<al2o3-cr>
>> 1
<ruby[bot]>
al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
despai has joined #ruby
<jlebrech>
Iambchop: i'm trying to run my first capybara test, it's not my code i'm sure. i've seen this issue with webmock but i've not got mocking set up.
<jlebrech>
how would i find out which gem is causing the issue?
<jlebrech>
my test runs without js, but as soon as I put js: true i get that error for the same test
krawchyk has joined #ruby
<Iambchop>
jlebrech: paste the output of "bundle show"
<jlebrech>
I might be on to something, different error when i commented out fakeweb
Inline has joined #ruby
Inline has quit [Remote host closed the connection]
Inline has joined #ruby
elphe has joined #ruby
bak1an has joined #ruby
<Iambchop>
jlebrech: let us know if you figure it out or still have trouble :)
<jlebrech>
Iambchop: now chromedriver is running on 9515 but getting unable to connect to chromedriver 127.0.0.1:9516
orbyt_ has joined #ruby
<jlebrech>
how to specify the port?
elphe has quit [Ping timeout: 244 seconds]
kaleido has joined #ruby
elphe has joined #ruby
despai has quit [Quit: ...]
<Iambchop>
jlebrech: are you using the chromedriver-helper gem?
<jlebrech>
no
<jlebrech>
just selenium-webdriver
<jlebrech>
or at least trying to use it
<jlebrech>
Iambchop: thanks
elphe has quit [Ping timeout: 268 seconds]
reber has quit [Remote host closed the connection]
<dachi>
jlebrech I was getting that yesterday but only when I built my gem
<jlebrech>
it opened chrome hehe
<dachi>
running with $ruby -Ilib was fine
<dachi>
It started to work with executable only after I restarted mac
<dachi>
I tried many things though, there was something with Xcode probably
<dachi>
I was using headless chromedriver
<jlebrech>
it's opening chrome now, is that doing to be a problem for circle ci?
<dachi>
with Watir
<jlebrech>
going*
<jlebrech>
Iambchop: thanks a lot i've been banging my head for weeks, as i've been told to write test only on fridays
elphe has joined #ruby
<Iambchop>
jlebrech: you might be able to use headless chrome in your ci
elphe has quit [Ping timeout: 260 seconds]
j416 has quit [Ping timeout: 252 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
CheetoH1tlerBad has quit [Ping timeout: 260 seconds]
j416 has joined #ruby
elphe has joined #ruby
chouhoulis has joined #ruby
<TvL2386>
thx Iambchop
TheBloke has quit [Read error: Connection reset by peer]
<ivanskie>
something like that from within ruby. expose the port, print a postgresql::// url in cli to open in postico.. then if it doesn't shutdown on its own, have some other loop to shutdown the tunnel
<ivanskie>
@params and params are indeed valid and separate things. so its not a typo in that regard.. uhm was looking at debugger output and it doesn't even try to send anything when i click the postgresql url then. for 127.0.0.1 etc etc
elphe has joined #ruby
<ivanskie>
am i crazy for trying to do this this way? lol
<kaleido>
what are you trying to do? send postgres queries to a server hiding behind an ssh tunnel?
<kaleido>
sorry, i'm not a pro by any stretch so i can't determine just from reading your paste.
<ivanskie>
our RDS (postgress database on amazon) isn't exposed to the public. But our bastion host has access to it. So I'm trying to open a tunnel to bastion with port forwarding to the RDS endpoint from bastion. if that makes sense?
elphe has quit [Ping timeout: 252 seconds]
akaiiro has joined #ruby
alicef has quit [Ping timeout: 246 seconds]
<ivanskie>
"ssh -f my_bastion_host -L $myport:$RDS_HOSTNAME:$RDS_PORT "sleep 10"" when the envars are filled... connects to bastion host, does local port forwarding to 65432 (in case one of us has local postgres server running). then I can just launch postico pointing to 127.0.0.1:56432 with credentials for RDS db. and get in there.
<ivanskie>
the "sleep 10" command just executes on bastion, giving me time to open postico. then ssh tunnel doesn't close until i close postico or whatever.
reber has quit [Read error: Connection reset by peer]
<ivanskie>
Im trying to do that now in ruby. because I need to dynamically lookup which bastion/jump box to connect to, and pull correct RDS endpoint and creds based on which app / environment is specified beforehand.
<ivanskie>
i have everything done except the tunnel building :(
<ivanskie>
i've tried building a system ssh command line string. and something isn't working right.
<ivanskie>
oh actually i think i just need to keep track of the PID... then i can kill it in ruby afterwords.. hmmmmmmmmmm anyway im hoping i can do this with net::ssh or net::ssh::gateway gem
alicef has joined #ruby
<ivanskie>
oh i think i just found the issue
sanscoeur has joined #ruby
<ivanskie>
i did it!!!!!
elphe has joined #ruby
<ivanskie>
cake time. unfortunately the one day i actually want to grab a beer. work fridge only has pop :( sad day
<ivanskie>
i noticed in debug output that it says when forwarding agent closes...
elphe has quit [Ping timeout: 244 seconds]
<ivanskie>
i wonder if there's a way I can have a loop in my code to monitor for that and just quit the app. for now i just have a 5 minute timer, or press any key to quit prompt
<ivanskie>
hmm... anyway now im in bonus round. maybe time to code a way to run rake tasks on our apps, without sshing in, etc etc
eddof13 has joined #ruby
elphe has joined #ruby
zapata has quit [Ping timeout: 252 seconds]
elphe has quit [Ping timeout: 272 seconds]
zapata has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 246 seconds]
elphe has joined #ruby
druonysus has joined #ruby
alicef has quit [Ping timeout: 246 seconds]
reber has joined #ruby
mochiyoda has joined #ruby
alicef has joined #ruby
jetchisel has joined #ruby
sagax has quit [Ping timeout: 252 seconds]
bootstrappm has joined #ruby
ShekharReddy has quit [Quit: Connection closed for inactivity]
<bootstrappm>
(crossposted to #rubyonrails): hey all, I wanted to get a little survey of some members of the community, please feel free to point me in the right direction if I'm in the wrong place. We've been having a hard time filling this position (https://www.linkedin.com/jobs/cap/view/911188581/?pathWildcard=911188581&trk=mcm), and I was wondering where do you think we should advertise to get in front of people that have been
<bootstrappm>
using Ruby for several years?
reber__ has joined #ruby
reber has quit [Ping timeout: 246 seconds]
reber has joined #ruby
reber__ has quit [Ping timeout: 268 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ellcs has quit [Ping timeout: 250 seconds]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alicef has quit [Ping timeout: 246 seconds]
alicef has joined #ruby
eddof13 has quit [Quit: eddof13]
elphe has quit [Ping timeout: 244 seconds]
eddof13 has joined #ruby
<havenwood>
bootstrappm: In-person in Boston or remote?
<havenwood>
bootstrappm: Have you tried the Boston Ruby Meetup?
elphe has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bootstrappm>
havenwood: In person, a bit old school
<bootstrappm>
and I haven't! I'll look them up now
eckhardt has joined #ruby
kaleido has quit [Read error: Connection reset by peer]
<ivanskie>
is there a way to modify yaml file without destroying the comments?
elphe has quit [Ping timeout: 268 seconds]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dellavg_ has quit [Ping timeout: 246 seconds]
beefjoe has joined #ruby
<JJonah>
is it possible to use `cycle` on an array and then extract the nth element using `[]` (or another method) without first converting the Enumerator to an array? Said another way, can you get the nth element of an Enumerator without calling `next` n times?