shortCircuit__

Activity Graph

Page 1 of 17 | Next »

2019-08-26

[05:14:21] shortCircuit__: has joined #ruby
[05:16:01] shortCircuit__: Read error: Connection reset by peer

2019-08-24

[09:55:19] shortCircuit__: has joined #ruby
[10:41:43] shortCircuit__: Ping timeout: 245 seconds
[11:22:59] shortCircuit__: has joined #ruby
[13:10:18] shortCircuit__: Ping timeout: 258 seconds

2019-08-23

[01:44:59] shortCircuit__: has joined #ruby
[01:49:13] shortCircuit__: Ping timeout: 245 seconds

2019-08-22

[07:05:25] shortCircuit__: has joined #ruby
[07:33:56] shortCircuit__: Ping timeout: 248 seconds
[07:59:59] shortCircuit__: has joined #ruby
[08:14:38] shortCircuit__: I wanted to know, that give on timezone in ZZZZ format like +0530 how to convert a Time.now to that timezone?
[08:16:49] shortCircuit__: damn it should have read the docs better
[09:59:53] shortCircuit__: has joined #RubyOnRails
[10:00:05] shortCircuit__: I have a question.
[10:01:56] shortCircuit__: So presently we have this csv import thing. where we are doing CSV.foreach and inserting records like Store.create(record) . I understand that this is a bad approach. A better approach is to save an array of records and then run a records.each_slice(n) and then do Store.create(sliced_array_of_record)
[10:02:39] shortCircuit__: my question is, given a csv file of say 6000-7000 or 10k lines, is it a good idea to use a variable to store the array?
[10:03:37] shortCircuit__: can the app run out of memory? if yes, then what is a better option? without using any sidekiq things.
[10:04:06] shortCircuit__: I was thinking if it was possible to read a CSV file in batches, but that is not that simple I guess
[10:19:18] shortCircuit__: well I mean its simple. I can add a counter and use %
[10:57:36] shortCircuit__: Ping timeout: 268 seconds
[11:38:29] shortCircuit__: has joined #ruby
[11:42:55] shortCircuit__: Ping timeout: 258 seconds
[11:44:27] shortCircuit__: has joined #ruby
[11:48:47] shortCircuit__: Ping timeout: 245 seconds
[11:56:44] shortCircuit__: has joined #ruby
[13:02:10] shortCircuit__: Ping timeout: 268 seconds
[13:16:44] shortCircuit__: has joined #ruby
[13:47:58] shortCircuit__: Ping timeout: 245 seconds
[18:44:32] shortCircuit__: has joined #ruby
[18:49:04] shortCircuit__: Ping timeout: 246 seconds
[22:45:01] shortCircuit__: has joined #ruby
[22:49:40] shortCircuit__: Ping timeout: 248 seconds

2019-08-13

[13:58:17] shortCircuit__: has joined #RubyOnRails
[14:04:48] shortCircuit__: I have a question, The problem I have is, I am using a sidekiq worker to lookup data from db and then push to kafka. sidekiq has a concurrency of 20 nd database has a pool size of 10. Now when I try to push say a 100 or even 5 messages from rails c. Some of the jobs are enqueued for some time and most jobs fail saying Activerecord Conncetionpool couldn't obttain connecttion in 5 seconds
[14:08:10] shortCircuit__: But when I change the synchronous delivery to asynchronous the jobs pass without gettting stuck in enqueued. So my question is, is it possible that because the kafka delivery is synchronous and some of them remain in enqueued state the database connection is not released.
[14:09:24] shortCircuit__: Linell: when I make the concurrency and database pool size same, the errors are definitly reduced. But is it the only reason?
[14:14:47] shortCircuit__: Linell: do you think that unless an enqueued worker finishes the database connection is not released?
[14:17:13] shortCircuit__: oh ok. then that might explain the issue. because most times the number of enqueued jobs is same as the database connection pool. I need to recheck this
[14:17:39] shortCircuit__: ok, let me check
[14:27:22] shortCircuit__: Linell: https://github.com/mperham/sidekiq/issues/2624#issuecomment-278737024 this is the best. here it says it sidekiq calls AR::Base.clear_active_connections!
[14:31:26] shortCircuit__: but when is this called? does it mean it releases the connection after the record has been fetched?
[14:32:06] shortCircuit__: oh wait, no this is when sidekiq exits
[15:38:52] shortCircuit__: Ping timeout: 246 seconds

2019-06-04

[05:08:55] shortCircuit__: has joined #ruby
[05:16:07] shortCircuit__: Quit: WeeChat 1.8

2019-06-03

[05:12:31] shortCircuit__: has joined #ruby
[11:08:34] shortCircuit__: Ping timeout: 244 seconds
[14:05:14] shortCircuit__: has joined #ruby
[14:10:12] shortCircuit__: Ping timeout: 272 seconds
[22:06:12] shortCircuit__: has joined #ruby
[22:10:53] shortCircuit__: Ping timeout: 268 seconds

2019-05-31

[00:47:55] shortCircuit__: has joined #ruby
[00:52:16] shortCircuit__: Ping timeout: 248 seconds
[04:48:25] shortCircuit__: has joined #ruby
[04:52:48] shortCircuit__: Ping timeout: 248 seconds
[05:50:38] shortCircuit__: has joined #ruby
[06:51:04] shortCircuit__: Ping timeout: 268 seconds
[10:18:03] shortCircuit__: has joined #ruby
[10:26:22] shortCircuit__: Ping timeout: 246 seconds
[19:24:00] shortCircuit__: has joined #ruby
[19:28:32] shortCircuit__: Ping timeout: 248 seconds
[22:23:54] shortCircuit__: has joined #ruby
[22:28:23] shortCircuit__: Ping timeout: 245 seconds

2019-05-30

[10:59:46] shortCircuit__: has joined #ruby
[11:00:13] shortCircuit__: Is there a way to create a httpresponse object with nil body and 503 status code
[11:06:04] shortCircuit__: Net::HTTPResponse.new("1.1", 503, "hello").body this doesn't work. says `undefined method `closed?' for nil:NilClass`
[11:06:49] shortCircuit__: saw it in the doc https://apidock.com/ruby/v2_5_5/Net/HTTPResponse/new/class
[11:36:59] shortCircuit__: phaul the problem is a little deep. I have to introduce hystrix in an existing rails project. The project uses faraday as an http client. So I wrote a middleware that wraps the faraday's http call (@app.call env). The problem is if the request fails, and it goes to fallback, I can't just return false, I need to return a, say, mock http response object that has success? and status, body etc
[11:37:17] shortCircuit__: so that the whole thing is backward compatible
[11:48:16] shortCircuit__: Ping timeout: 248 seconds
[14:44:26] shortCircuit__: has joined #ruby
[14:48:37] shortCircuit__: Ping timeout: 246 seconds
[15:39:01] shortCircuit__: has joined #ruby
[15:50:34] shortCircuit__: there should have been a ruby implementation of hystrix
[15:52:42] shortCircuit__: o.. superthanks
[15:55:16] shortCircuit__: After doing all this, end of day, after sending PR, I realized there is no easy way to see a dashboard :D
[21:51:44] shortCircuit__: Ping timeout: 272 seconds

2019-04-08

[06:17:29] shortCircuit__: has joined #RubyOnRails
[06:22:36] shortCircuit__: I am having a problem while writing spec for a method that has a method that accepts a block.
[06:22:48] shortCircuit__: I am not being able to derive the cause of the error
[06:22:53] shortCircuit__: https://gist.github.com/ikouchiha47/fffdfd491a8df4212db0f1824df29762 this is the gist
[06:23:18] shortCircuit__: but if I comment out the particular lines in the code, rspec seems to run successfully
[06:45:18] shortCircuit__: if anyone needs more context I can put it in the gist
[06:58:52] shortCircuit__: dang I found the error. :/
[06:59:00] shortCircuit__: Quit: WeeChat 1.8

2018-07-03

[06:25:07] shortCircuit__: has joined #RubyOnRails
[06:27:00] shortCircuit__: I need a bit of help. Most rails applications in my organization has a code in intializer to check required ENV variables. My job is to migrate the routes. But I don't want to setup all of them and get stuck in figuring the ENV values.
[06:27:23] shortCircuit__: Is there a way to only generate the routes. without having to intervene the initializers/ files
[06:27:44] shortCircuit__: sevenseacat: doing more of go and devops-ish work these days
[06:54:44] shortCircuit__: what does this build_app do https://github.com/rails/rails/blob/b5db73076914e7103466bd76bec785cbcfe88875/actionpack/test/dispatch/routing/custom_url_helpers_test.rb#L119
[07:06:11] shortCircuit__: Ping timeout: 256 seconds
[07:36:23] shortCircuit__: has joined #RubyOnRails
[10:10:55] shortCircuit__: Ping timeout: 256 seconds

2018-05-14

[08:56:11] shortCircuit__: has joined #RubyOnRails
[09:03:34] shortCircuit__: Jruby is such a pain inducer. :( I do a java_import and in rspec every time I do a expect_any_instance of it says wrong number of arguments 0 for 1 .. and then I end up just doing a double .. but that just defeats the purpose of the test. and now I don't know wether the code will actually work
[09:09:44] shortCircuit__: no time zone :P
[09:11:15] shortCircuit__: what is the better way to do the test? avoiding any_instance . changing the code structure and maybe instead of intializing a class inside a method , inject it? Although that could end up into too many injections
[09:13:46] shortCircuit__: I meant a lot of paramters in the method. I actually haven't seen code like that, thats why I don't know if that like a normal thing or antipattern .
[12:15:57] shortCircuit__: Ping timeout: 240 seconds

2018-03-07

[05:03:13] shortCircuit__: has joined #ruby
[05:05:59] shortCircuit__: I wanted to know how to implement bignum ? (not specific with any language). Bignum is treated as if it were an infinite-length bitstring with 2’s complement representation. is what the ruby docs said. but there is nothing more. :(
[05:33:33] shortCircuit__: Ping timeout: 240 seconds
[06:02:14] shortCircuit__: has joined #ruby
[06:29:15] shortCircuit__: little helpz :(
[06:52:30] shortCircuit__: thanks :)))))))))))
[07:34:27] shortCircuit__: Ping timeout: 240 seconds

2017-07-23

[20:25:03] shortCircuit__: has left #RubyOnRails: ("WeeChat 1.8")
[20:25:09] shortCircuit__: has left #ruby: ("WeeChat 1.8")

2017-07-22

[06:39:26] shortCircuit__: has joined #RubyOnRails
[06:39:32] shortCircuit__: https://github.com/argentum47/rdspec
[06:43:43] shortCircuit__: can someone tell me how zeus works?

2017-06-22

[06:13:26] shortCircuit__: yoo your new website design looks good
[06:21:22] shortCircuit__: I met matsumoto at the kerala ruby conf. he is super awesome. I asked him how did you have the perseverance to write a huge language.
[06:22:47] shortCircuit__: now I can die in peace.
[06:33:04] shortCircuit__: https://gist.github.com/argentum47/8be5227aa0f1302c3d3da1f6d61f3a1b I just copy pasted the code. don't show it to anyone. So. those lines L15 L31. these often end up failing, saying expected 1 or 2 got 2 or 3 (consequtively). but they don't fail all the time. If I re run then it generally works
[07:01:09] shortCircuit__: what more code/context is needed other than the spec?
[07:05:58] shortCircuit__: well I am not sure. like its not a code problem. its a setup problem. and there is not database cleaner. only config.use_transactional_fixtures = true this is there. I feel they should be in order. like if retries one time then the count should be 1 , next time should be 2
[07:06:56] shortCircuit__: for that they should be inside one it block?
[07:08:10] shortCircuit__: line 15 fails like 70% of the time on first try.
[07:09:31] shortCircuit__: I was trying that :D .. wait
[07:13:33] shortCircuit__: login request model is simple https://gist.github.com/argentum47/8be5227aa0f1302c3d3da1f6d61f3a1b#file-login_request-rb
[07:15:42] shortCircuit__: there is no gemefile like parallel test or something. I am trying to find where that configuration is and what is it.
[07:16:22] shortCircuit__: *no gem in gemfile
[07:16:56] shortCircuit__: in the update method L26 ?
[07:17:50] shortCircuit__: pardon me, but how
[07:24:02] shortCircuit__: how to fix things like this.
[07:36:47] shortCircuit__: and u have certificates?
[07:40:24] shortCircuit__: it fails sometimes. it fails I retry it passes
[07:40:38] shortCircuit__: the first and second
[07:43:42] shortCircuit__: maybe he was screaming behind the screen
[07:54:30] shortCircuit__: Ping timeout: 240 seconds
[08:31:55] shortCircuit__: has joined #RubyOnRails
[09:36:10] shortCircuit__: hiiiiii workmad3
[11:32:35] shortCircuit__: Ping timeout: 240 seconds
[11:58:01] shortCircuit__: has joined #RubyOnRails
[13:23:19] shortCircuit__: Ping timeout: 246 seconds

2017-06-18

[17:17:37] shortCircuit__: has joined #RubyOnRails
[17:17:52] shortCircuit__: has left #RubyOnRails: ()

2017-06-09

[07:01:19] shortCircuit__: has joined #RubyOnRails
[07:01:56] shortCircuit__: needed to ask a question. doesn't rails escape html tags and stuff to prevent xss
[07:02:14] shortCircuit__: pwnd :D nice nick
[07:03:28] shortCircuit__: Radar nothing much. things in life change very fast. I have been tossed from golang to nginx and lua and then again rails .. :D
[07:06:26] shortCircuit__: having an issue where people are able to write some script tags in email. and then when a verifcation link is sent (not in gmail though) they get some html tags attached to it. I am wondering how :D
[07:08:16] shortCircuit__: possibly. just got the codebase. need to look.
[07:09:02] shortCircuit__: don't get mad please
[07:10:33] shortCircuit__: I piss people off pretty fast :D .. example ^
[07:11:58] shortCircuit__: I agree. But I really don;t know why. Like there are some people, people really don't get mad at. In real world I just avoid people.
[09:55:41] shortCircuit__: has joined #RubyOnRails
[10:00:15] shortCircuit__: so. I looked at the codebase. (couldnot produce the error though) but anyway. so from the android app or using an api, they send like <img src="javascript..."/> and then when it gets to database it becomes <img src=javascript:alert(0)> Tududu . and then I guess when it is rendered in some app like say an email client which doesn't sanitize. it shows alerts
[10:00:45] shortCircuit__: I am using rails-api .. so can;t use the actionview helpers sanitize method to sanitize before saving to database
[10:01:04] shortCircuit__: what alternative do I have? is there a owasp compliant gem?
[10:41:41] shortCircuit__: {"name"=>"<img src=javascript:alert(0)> Manish Jaiswal", "phone"=>"+919836870432", "email"=>"amitava.ghosh+6@go-jek.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"} this is not escaped .. so bad. on my part as well
[10:43:02] shortCircuit__: what is the norm to handle unescaped json data?
[12:27:05] shortCircuit__: I have a question. in rails say, there is a file where they have defined, class Notification::EmailTemplate and there is another file where there is module Notification; class EmailUpdate < EmailTemplate; now my question is if I do `include Sanitizer` inside the former class, will rails be able to find the methods it in the later ?
[13:13:09] shortCircuit__: I have a module inside app/controllers/datacleaner.rb .. and I want to include it in app/response_formats/v1/regirstration_success.rb . like class V1:RegistrationSuccess; include ::DataCleaner wouldn't work, what is the correct way to do it. I can actually put it from app controller to lib/
[14:23:32] shortCircuit__: Ping timeout: 246 seconds

2017-03-15

[08:12:59] shortCircuit__: has joined #RubyOnRails
[08:14:51] shortCircuit__: need some help with doing internalisation.. I am doing like this I18n.l(5.months.from_now, format: "%d %B %Y", locale: :id) .. but August is written as August .. not Augustus or whatever.. how to do this correctly
[08:15:32] shortCircuit__: also tried setting I18n.locale = :id and l(5.months.from_now, format: ...) still same
[08:16:27] shortCircuit__: do I have to add month names in id.yml?
[08:32:30] shortCircuit__: Ping timeout: 260 seconds

2016-07-08

[07:40:06] shortCircuit__: has joined #RubyOnRails
[07:42:14] shortCircuit__: I was trying to understand how rails builds associations when we write something like has_one and has_many .. I have found one intriguing thing .. Reflection and I also looked through the Association inheritance tree .. I also saw Hasone builder .. but I am not beiing able to understand what I sought in the first place
[07:42:20] shortCircuit__: I need some help
[08:19:46] shortCircuit__: the question is when I write something like class User has_many :profiles .. how dows active record work / what does it do to ensure that an user object will have a .profiles method. How role does Reflection in association.rb play?
[08:26:58] shortCircuit__: I first started here https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations.rb, and after that from associations/has_one.rb and singular_association.rb I reached https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/builder/association.rb .. but after that I can't understand what is happening
[13:44:00] shortCircuit__: Ping timeout: 250 seconds

2016-06-28

[11:02:19] shortCircuit__: has joined #ruby
[11:02:25] shortCircuit__: I have a question
[11:03:42] shortCircuit__: I have a module Abc which has a method foo and I also have a class Def which include Abc and also has a method foo .. now c = Def.new .. c.foo calls the class's foo ... how do I call the module's foo .... like a delegate or something
[11:06:44] shortCircuit__: is there something like a .call or .bind
[11:06:58] shortCircuit__: there is a .call on proc and lambda
[11:19:55] shortCircuit__: hanmac I would like from the object and Def#foo
[11:22:18] shortCircuit__: I see .. so just alias it just after the include Abc
[14:28:32] shortCircuit__: Ping timeout: 250 seconds

2016-06-23

[18:46:38] shortCircuit__: has joined #RubyOnRails
[18:47:31] shortCircuit__: hi.. I need some help with authenticating with captcha .. I need some ideas ... is someone willing to discuss
[19:33:15] shortCircuit__: there was something similar to even machine in rails . I can't rememeber .. maybe it started with A . it was in the spree gem I think .. or maybe I am wrong .. I just can't remember
[19:47:46] shortCircuit__: Quit: Page closed

2016-06-18

[10:35:48] shortCircuit__: has joined #RubyOnRails
[10:36:26] shortCircuit__: I have a strange problem, I am using debian gnome with a zsh terminal .. I can't type 'x' in irb or pry
[10:37:30] shortCircuit__: by pry I mean rails c
[11:18:45] shortCircuit__: Remote host closed the connection

2016-06-09

[00:14:52] shortCircuit__: Ping timeout: 264 seconds
[02:40:55] shortCircuit__: has joined #RubyOnRails
[03:09:28] shortCircuit__: Ping timeout: 264 seconds
[16:15:42] shortCircuit__: has joined #RubyOnRails
[17:02:03] shortCircuit__: Ping timeout: 246 seconds

2016-06-08

[01:24:17] shortCircuit__: has joined #RubyOnRails
[02:55:06] shortCircuit__: Ping timeout: 276 seconds
[06:19:16] shortCircuit__: has joined #RubyOnRails

2016-06-07

[19:41:35] shortCircuit__: has joined #RubyOnRails
[19:43:37] shortCircuit__: I had a question regarding rails catching .. I have never implemented one myself ..
[19:44:36] shortCircuit__: I have an autocomplete box .. where it sends requests (ajax) now I want to cache that result for say like 13 seconds ... I did something like this https://github.com/argentum47/location-share-web-app/blob/master/app/controllers/users_controller.rb#L13
[19:44:46] shortCircuit__: but this isn't correct is it?
[20:43:03] shortCircuit__: Ping timeout: 240 seconds

2016-05-22

[00:48:35] shortCircuit__: has joined #RubyOnRails
[00:49:18] shortCircuit__: hi anyone there!!
[01:32:48] shortCircuit__: Ping timeout: 250 seconds

2016-05-21

[10:56:57] shortCircuit__: I have not done rails for about 4 months straight .. I have forgotten a few things ..
[10:57:19] shortCircuit__: I was trying to do somestuff .. and I am stuck .. plz help
[10:58:36] shortCircuit__: https://gist.github.com/aghosh47/9ea236a36503e0258aa46db7b5e92a94 in my controller, is it possible to save the location and location_user data altogether at the same time .I mean I can thhink of doing location.save! followed by location_user.save but that feels not rails-ish
[11:18:16] shortCircuit__: Ping timeout: 250 seconds