TvL2386

Activity Graph

Page 1 of 7 | Next »

2019-05-28

[18:55:55] TvL2386: Ping timeout: 246 seconds
[18:58:42] TvL2386: has joined #RubyOnRails
[18:58:42] TvL2386: has joined #ruby

2019-05-15

[22:00:01] TvL2386: Remote host closed the connection
[22:02:48] TvL2386: has joined #RubyOnRails
[22:02:48] TvL2386: has joined #ruby

2019-05-08

[20:15:03] TvL2386: Ping timeout: 250 seconds
[20:16:50] TvL2386: has joined #RubyOnRails
[20:16:50] TvL2386: has joined #ruby

2019-05-01

[03:18:10] TvL2386: Ping timeout: 246 seconds
[03:22:46] TvL2386: has joined #RubyOnRails
[03:22:46] TvL2386: has joined #ruby

2019-04-26

[08:38:23] TvL2386: Ping timeout: 245 seconds
[08:47:36] TvL2386: has joined #RubyOnRails
[08:47:36] TvL2386: has joined #ruby

2019-04-15

[21:12:20] TvL2386: hey guys, I'm trying to parse a datetime stamp to a Time object. This is the String: "UTC 2019-03-18 14:47:13". I'm especially wondering how I can handle that "UTC" part. Looking at Time.strptime(...)
[21:15:51] TvL2386: just strptime('%Z')?
[21:17:19] TvL2386: jordanm: looking at the docs I don't think so... %Z - Equivalent to %:z (e.g. +09:00)
[21:23:32] TvL2386: SeepingN: works like a charm!
[21:28:35] TvL2386: I did: Time.parse("UTC 2019-03-18 14:47:13".split(' ', 2).reverse.join(' '))
[21:29:16] TvL2386: thanks! :)

2019-04-13

[16:49:53] TvL2386: *.net *.split

2019-04-09

[09:59:06] TvL2386: has joined #RubyOnRails
[09:59:06] TvL2386: has joined #ruby

2019-04-08

[00:13:32] TvL2386: Ping timeout: 250 seconds
[00:20:32] TvL2386: has joined #ruby
[15:01:34] TvL2386: Quit: leaving
[15:01:59] TvL2386: has joined #RubyOnRails
[15:01:59] TvL2386: has joined #ruby
[19:20:08] TvL2386: Ping timeout: 250 seconds

2019-04-05

[15:07:39] TvL2386: Ping timeout: 255 seconds
[15:08:24] TvL2386: has joined #ruby

2019-04-02

[08:46:35] TvL2386: has joined #ruby

2019-03-21

[14:40:40] TvL2386: Ping timeout: 255 seconds

2019-03-20

[21:21:31] TvL2386: has joined #ruby

2019-03-19

[16:09:54] TvL2386: Ping timeout: 246 seconds

2019-03-14

[01:58:16] TvL2386: Ping timeout: 246 seconds
[03:11:24] TvL2386: has joined #RubyOnRails
[03:11:24] TvL2386: has joined #ruby
[03:16:13] TvL2386: Ping timeout: 255 seconds
[05:21:19] TvL2386: has joined #RubyOnRails
[05:21:19] TvL2386: has joined #ruby

2019-03-07

[04:06:26] TvL2386: Ping timeout: 250 seconds
[04:10:40] TvL2386: has joined #RubyOnRails
[04:10:40] TvL2386: has joined #ruby

2019-02-27

[06:40:58] TvL2386: has joined #RubyOnRails
[06:40:58] TvL2386: has joined #ruby

2019-02-26

[11:01:19] TvL2386: Ping timeout: 246 seconds

2019-02-17

[21:11:26] TvL2386: Ping timeout: 250 seconds
[21:11:51] TvL2386: has joined #ruby
[21:11:52] TvL2386: has joined #RubyOnRails

2019-02-09

[13:10:03] TvL2386: Ping timeout: 245 seconds
[13:58:45] TvL2386: has joined #ruby
[13:58:46] TvL2386: has joined #RubyOnRails
[14:03:56] TvL2386: Ping timeout: 240 seconds
[14:16:46] TvL2386: has joined #ruby
[14:16:47] TvL2386: has joined #RubyOnRails
[14:21:26] TvL2386: Ping timeout: 240 seconds
[14:47:42] TvL2386: has joined #RubyOnRails
[14:47:42] TvL2386: has joined #ruby
[14:53:04] TvL2386: Ping timeout: 272 seconds
[18:55:19] TvL2386: has joined #RubyOnRails
[18:55:19] TvL2386: has joined #ruby

2019-02-06

[09:27:26] TvL2386: doesn't logstash print anything useful?
[09:28:24] TvL2386: I can see double quotes to encapsulate your ruby code, but in the code you use double quotes as well... I'd at least change "::" to '::'
[09:29:00] TvL2386: and I think the \s*? is also weird in the regexp
[09:29:14] TvL2386: but that may be me, I'm no regexp guru
[09:30:09] TvL2386: canton7: ah ack! ty
[09:30:25] TvL2386: I also think field.strip! || field is weird
[09:31:30] TvL2386: I take that back, I thought strip! always returned nil, but that's not true
[09:32:48] TvL2386: I think your double quotes in the ruby code confuse logstash, since the ruby code stops at the first " and logstash configuration syntax continues afterwards and doesn't like the ::"

2019-02-05

[09:06:28] TvL2386: hey all, I've an issue with the ruby CSV class. I'm reading data from a mariadb database and create a csv. This data contains "weird chars". The CSV class is capable of generating the csv, but not reading it, because it will rais a CSV::MalformedCSVError
[09:06:36] TvL2386: code to reproduce is here: https://dpaste.de/6Y79#L14,27
[10:43:30] TvL2386: al2o3-cr: ty that works!
[10:47:04] TvL2386: al2o3-cr: reading about that option, makes me wonder why the generated csv is not RFC4180 compatible
[11:04:17] TvL2386: al2o3-cr: upon further inspection: enabling that option does deal with the Exception, but the printed row on line 15 is an Array with only 1 String in there
[11:08:02] TvL2386: al2o3-cr: please see: https://dpaste.de/KcQk
[11:08:33] TvL2386: you are totally correct sir
[11:08:42] TvL2386: I missed that -_-'

2019-02-04

[08:23:50] TvL2386: hi all! I'm writing a csv export script. It reads contents from a mariadb database and writes a csv file. My client decided to test my script by throwing in a bunch of "weird" characters. I was surprised to see that I could generate this csv file, but trying to parse it again results in exceptions
[08:24:26] TvL2386: I've reproduced it to a tiny script only requiring `csv`. I'm using ruby-2.5.1. Please see my dpaste: https://dpaste.de/6Y79
[08:25:04] TvL2386: I read that the csv implementation is pretty open to interpretation and not all libraries decode csv the same way and I'm not sure how to continue
[08:25:35] TvL2386: should I swap csv library? should I sanitize input? should I tell my customer to make sure not to insert a bunch of weird chars and just accept this?

2019-01-31

[02:06:32] TvL2386: Ping timeout: 246 seconds
[02:08:53] TvL2386: has joined #RubyOnRails
[02:08:53] TvL2386: has joined #ruby

2019-01-05

[15:37:54] TvL2386: Ping timeout: 250 seconds
[17:20:56] TvL2386: has joined #ruby
[17:20:57] TvL2386: has joined #RubyOnRails

2018-12-30

[15:37:44] TvL2386: has joined #RubyOnRails
[15:37:44] TvL2386: has joined #ruby

2018-12-28

[20:31:50] TvL2386: Ping timeout: 244 seconds

2018-12-25

[10:50:32] TvL2386: Ping timeout: 250 seconds
[19:26:57] TvL2386: has joined #RubyOnRails
[19:26:57] TvL2386: has joined #ruby

2018-12-19

[07:46:54] TvL2386: hey guys, last days I've been searching for a solution to my problem. My rails app connects to an external mysql database to which I have read access. The datetime attributes are written in the local timezone. This messes up rails' assumption that they'd be in UTC.
[07:47:07] TvL2386: This causes the dates to be incorrect in my rails app.
[08:13:57] TvL2386: I didn't know that, that's awesome :)

2018-12-17

[13:46:50] TvL2386: hey guys, I'm querying data from a mysql database I have read access to. There is a datetime column that has no timezone information. When I query on that field (gteq: Time.now), the query will actually use (Time.now-1.hour) because I'm in GMT+1.
[13:47:03] TvL2386: OTC I use #ruby for ruby questions
[13:48:57] TvL2386: OTC I have no idea what it's for :)
[13:50:05] TvL2386: On the ruby website they promote #ruby as: The Ruby Language IRC Channel is a wonderful way to chat with fellow Rubyists.
[14:01:17] TvL2386: tbuehlmann: I already have `config.time_zone = 'Amsterdam'` in my application.rb
[14:02:01] TvL2386: tbuehlmann: using Time.current instead of Time.now (or Time.zone.now) all result in the same query... Starting from an hour ago instead of now
[14:02:22] TvL2386: is there a way to tell activerecord that this particular model is not UTC?
[14:55:10] TvL2386: server time not up to date?
[14:55:31] TvL2386: server time set at 2000?
[14:57:24] TvL2386: cgibsonmm: well... It could be set wrong from the start, it probably does not sync with a ntp server. Or it drifted too far and is set to not autocorrect it
[14:57:59] TvL2386: cgibsonmm: so: calling Time.now from another method gives the correct value?
[15:00:02] TvL2386: cgibsonmm: I just read that using Time.now is not good. That you should use Time.current
[15:02:05] TvL2386: what's the type of "published_on" in the database?

2018-12-13

[11:10:12] TvL2386: hey guys, I have a rails project using 'activerecord-sqlserver-adapter'. Now I would also like to connect to a mysql database. I added `gem 'mysql2', '~> 0.5.2'` to my Gemfile and it loaded... In rails console I see that Mysql2 is present, however, when trying to use a model in that mysql database, I get:
[11:10:22] TvL2386: Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).
[11:10:26] TvL2386: from /usr/local/bundle/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:188:in `rescue in spec'
[11:30:11] TvL2386: I'm onto something
[11:30:57] TvL2386: it seems `bundle update` fixed it
[11:31:14] TvL2386: I did `bundle install` before
[13:32:50] TvL2386: body: attachemnts,
[13:33:12] TvL2386: ahh... consequent typo I see
[14:42:17] TvL2386: I'm having mulitple databases in my rails project and would like to run a migration on :other_db instead of :development
[14:48:37] TvL2386: tdelam: usually if I need to craft xml, I resort to gem "builder". I use version 3.2.3 and is very easy to create xml documents
[14:48:49] TvL2386: maybe it can help you
[14:49:03] TvL2386: I'm using httprb to actually post it
[15:45:19] TvL2386: tdelam: yw!

2018-12-10

[01:54:40] TvL2386: Ping timeout: 264 seconds
[02:18:31] TvL2386: has joined #RubyOnRails
[02:18:31] TvL2386: has joined #ruby
[23:04:14] TvL2386: Ping timeout: 250 seconds
[23:04:25] TvL2386: has joined #RubyOnRails
[23:04:25] TvL2386: has joined #ruby

2018-11-22

[04:04:58] TvL2386: Ping timeout: 246 seconds
[04:09:14] TvL2386: has joined #RubyOnRails
[04:09:14] TvL2386: has joined #ruby

2018-11-13

[22:19:43] TvL2386: Ping timeout: 268 seconds
[22:21:14] TvL2386: has joined #RubyOnRails
[22:21:14] TvL2386: has joined #ruby

2018-11-12

[13:27:15] TvL2386: hey guys, I've got a ruby process started from cron which is hanging
[13:28:02] TvL2386: is there any way to terminate it and get the stack trace?
[15:04:40] TvL2386: I'm curious as well why that works and what's actually being called
[15:10:10] TvL2386: I suppose you didn't miss anything
[15:10:17] TvL2386: I'm waiting on you to supply us with the answer :)
[15:15:20] TvL2386: erpel: ah nice!
[15:15:54] TvL2386: ... as long as a percent-string is not last ...
[15:16:36] TvL2386: I'd never use it
[15:18:11] TvL2386: LinuxKnight: is that in your Vagrantfile?
[15:20:13] TvL2386: LinuxKnight: like phaul said: it looks good
[15:20:27] TvL2386: irb(main):002:0> opts = { addon_disk_count: 3 } ; (1..opts[:addon_disk_count]).to_a
[15:20:30] TvL2386: => [1, 2, 3]
[15:20:54] TvL2386: but: I assume opts[:addon_disk_count] to actually be an Integer
[15:21:03] TvL2386: I don't know what it is in your case
[15:21:10] TvL2386: obviously it's something wrong
[15:21:48] TvL2386: so: go up 1 line in your Vagrant file and do "puts opts[:addon_disk_count].inspect"
[15:21:58] TvL2386: LinuxKnight: are you 100% sure
[15:22:02] TvL2386: because I don't believe it
[15:23:49] TvL2386: LinuxKnight: better add: `puts "opts[:addon_disk_count] is #{opts[:addon_disk_count]} and is a #{opts[:addon_disk_count].class}"`
[15:24:34] TvL2386: my guess is that the value is a String
[15:25:34] TvL2386: yeah, I mistakenly thought inspect would print the class name... sorry :)
[15:28:59] TvL2386: no problem, glad it's clear to you now :)
[15:29:45] TvL2386: so was it a String or a NilClass?
[15:30:14] TvL2386: check... do you actually do something with |i| ?
[15:31:27] TvL2386: because if not, you can replace it with `opts[:addon_disk_count].to_i.times do ... end`
[15:32:55] TvL2386: however, there is a difference: (1..2).to_a == [1,2] and 2.times.to_a == [0,1]
[15:33:27] TvL2386: lets say opts[:addon_disk_count].to_i == 5
[15:33:44] TvL2386: 5.times do ... end # will execute the block 5 times
[15:34:00] TvL2386: (1..5).each do |i| ... end # will also execute the block 5 times
[15:34:28] TvL2386: you can also do 5.times do |i| ... end
[15:34:53] TvL2386: except with 5.times you get an array of [0,1,2,4] and with (1..5) you get an array of [1,2,3,4,5]
[15:35:15] TvL2386: have fun with vagrant and Ruby! :)
[15:37:50] TvL2386: Hi all, I have a ruby process that is hanging. It's consuming 100% cpu.
[15:38:18] TvL2386: I want to know why it is doing this
[16:08:16] TvL2386: everybody can get access to that channel right?
[16:08:25] TvL2386: #rubyonrails
[16:09:11] TvL2386: I've been in there for at least several days without disconnection
[16:11:58] TvL2386: aces1up: how about
[16:12:29] TvL2386: aces1up: aces1up [5] pry(main)> window_start = Time.now - 2.hours ; window_end = Time.now + 2.hours ; (window_start..window_end).include?(Time.now)
[16:14:07] TvL2386: gotta go... afk

2018-11-02

[08:31:03] TvL2386: hi guys, is it possible to connect ruby on windows to mssql on windows?
[08:31:12] TvL2386: (I don't want to use powershell)
[08:33:54] TvL2386: https://github.com/Microsoft/sql-server-samples/tree/master/samples/tutorials/ruby/windows
[08:34:07] TvL2386: never mind
[15:06:42] TvL2386: thx Iambchop

2018-11-01

[10:05:48] TvL2386: hey guys. I know it's possible to use the tiny_tds gem to connect to a MSSQL Database from linux, but is it also possible to connect to a MSSQL database when running ruby on windows?

2018-10-30

[21:30:04] TvL2386: has joined #ruby
[21:30:05] TvL2386: has joined #RubyOnRails

2018-10-26

[03:44:34] TvL2386: Ping timeout: 268 seconds

2018-10-25

[16:07:59] TvL2386: hi all! I've been reading about getting metrics out of a rails application and been reading this post: https://www.robustperception.io/instrumenting-a-ruby-on-rails-application-with-prometheus
[16:08:15] TvL2386: seems very interesting to export metrics to be collected by prometheus.
[16:08:26] TvL2386: However I don't know how to protect this /metrics endpoint
[16:10:02] TvL2386: I was thinking I want to add basic authentication to /metrics
[16:10:06] TvL2386: no idea how though
[16:10:19] TvL2386: can someone point me in the right direction?
[19:55:50] TvL2386: orbyt_: running `gem list my_gem` will just print what gems are installed on your local machine. Has nothing to do with the fact that you are running that in your rails app dir
[19:56:10] TvL2386: orbyt_: `bundle show my_gem` will print the version of that gem that is used in your rails app

2018-10-24

[00:14:51] TvL2386: Ping timeout: 260 seconds
[00:15:34] TvL2386: has joined #RubyOnRails
[00:15:34] TvL2386: has joined #ruby

2018-10-07

[17:33:26] TvL2386: samort7: nope
[17:57:39] TvL2386: yeah I wouldn't use it either
[17:57:58] TvL2386: I've seen things before like : return @bla if defined? @bla
[17:58:11] TvL2386: That gets totally messed up by using that method

2018-10-05

[12:37:21] TvL2386: catphish: I always use .count
[12:39:23] TvL2386: catphish: and it results in "SELECT COUNT(*)"
[12:40:31] TvL2386: catphish: oh I see! .any? does something else
[12:40:59] TvL2386: yes that's awesome :)

2018-09-19

[07:54:02] TvL2386: hey guys, question about documentation of code: Since ruby always returns the result of the last evaluation in a method, something may be returned that the author didn't intend to or simply is not interested in. Should I then document what it returns, or should I document it returns nothing?
[07:54:40] TvL2386: I feel like I should change all my methods to return nil if I'm going to document that
[07:54:53] TvL2386: but then that makes me sad
[07:56:11] TvL2386: no surprises :)
[08:05:08] TvL2386: sounds like a good plan!
[08:09:29] TvL2386: yes it can
[08:09:52] TvL2386: first of all I would do "if condition? or another_condition?"
[08:09:58] TvL2386: because the body is identical
[08:11:17] TvL2386: anyway: it looks fine and small to me
[09:49:23] TvL2386: marz_d`ghostman: probably depends on which backend you're using
[09:50:09] TvL2386: marz_d`ghostman: I'm only used to activerecord though
[09:51:30] TvL2386: marz_d`ghostman: for plain ruby I mostly use mysql2, but that's not an ORM
[09:53:42] TvL2386: marz_d`ghostman: sounds cool! My next little rails project will also use mongodb (mostly for learning purposes)
[10:02:38] TvL2386: sequel extends activerecord
[10:04:48] TvL2386: arg... I'm sorry, that's not correct... I was thinking about `squeel`
[10:05:36] TvL2386: yeah lol :)

2018-09-18

[10:07:15] TvL2386: hi everyone. I'm currently having 2 database connections to the same mssql server to retrieve data from my rails database and some other db. I want to do JOIN queries that join tables from both databases. That's not possible using 2 separate connections right
[10:09:12] TvL2386: Is this even possible?
[10:14:04] TvL2386: well, 42min to be exact
[11:13:18] TvL2386: Terens: only if it fits your requirements
[12:35:18] TvL2386: Terens: that's because it is
[12:35:53] TvL2386: Terens: but if that is what you want/need, then you will have to implement it :)
[12:40:09] TvL2386: Terens: you're not even talking about authorizing access to instances of models. Maybe you want to be able to edit your own user profile, but not the profile of other users
[16:23:31] TvL2386: hi NL3limin4t0r, thanks for your response
[16:24:35] TvL2386: I knew it was possible, I was just wondering if rails can do it (activerecord / arel)
[16:25:18] TvL2386: I have a few models in db1 through connection1 and I have some other models in db2 through connection2. I've given rights to the user user ind connection1 to also access db2
[16:26:44] TvL2386: so in theory one connection is enough, I just have to tell each model in which db they are

2018-09-11

[11:03:17] TvL2386: has joined #ruby
[11:03:21] TvL2386: Quit: leaving
[11:03:45] TvL2386: has joined #RubyOnRails
[11:03:45] TvL2386: has joined #ruby