vasilakisFiL

Activity Graph

Page 1 of 5 | Next »

2019-04-01

[22:10:49] vasilakisFiL: Remote host closed the connection

2019-03-31

[08:51:20] vasilakisFiL: Ping timeout: 250 seconds
[11:00:01] vasilakisFiL: has joined #elixir-lang

2019-03-30

[10:50:27] vasilakisFiL: has joined #elixir-lang
[10:52:14] vasilakisFiL: hi! I am trying to implement merge sort in Elixir to learn functional programming and elixir, but I am stuck. Specifically, I get an error as explained here: https://gist.github.com/vasilakisfil/4563c9f014ce90271d76a90d52869a16
[10:53:04] vasilakisFiL: I am wondering why the '\t' appears. Shouldn't after split, list_a be just an empty list? ([])
[11:16:42] vasilakisFiL: *.net *.split
[11:21:30] vasilakisFiL: ok found the issue
[11:21:54] vasilakisFiL: I had [head_a, tail_a] instead of [head_a | tail_a]

2018-11-16

[10:52:02] vasilakisFiL: has joined #ruby
[10:52:35] vasilakisFiL: hi, accessing a hash value by key is extremely fasst. Is it possible to access the value of the first key with the same performance ?
[10:56:54] vasilakisFiL: actualy it's not that fast
[10:58:50] vasilakisFiL: ah sorry my bad folks, I misread the benchmark's results
[10:59:25] vasilakisFiL: for the record here are the results: https://gist.github.com/vasilakisfil/6bd0375681ba65d8b6fa1d3cf2e720bd
[11:00:17] vasilakisFiL: ah no my bad again, I am saying it right: HASH[:aaaa] is the fastest by far
[11:00:33] vasilakisFiL: then it's HASH.first[0] and then of course HASH.keys.first
[11:00:50] vasilakisFiL: it's a big difference, any idea how to speed it up ?
[11:04:04] vasilakisFiL: yeah maybe it is actually, does it make difference ? let me check initializing before the faked data
[11:05:56] vasilakisFiL: now made it to be the first, now it seems like directly accessing the key is even faster
[13:11:08] vasilakisFiL: Quit: Konversation terminated!

2018-09-17

[01:45:43] vasilakisFiL: has joined #ruby
[01:46:01] vasilakisFiL: I am a bit confused: is there an as_json method in Ruby or is it only Rails ?
[02:04:24] vasilakisFiL: I guess it's railsy
[02:22:58] vasilakisFiL: Ping timeout: 245 seconds

2018-08-09

[17:00:20] vasilakisFiL: has joined #ruby
[17:01:35] vasilakisFiL: if you would accept a proc/lambda in some part of your code as an argument, would you check it using responds_to?(:call) or is_a?(Proc) ? The former has the advantage the you can send whatever as long as it responds to call, what is the advantage of the latter ?
[17:04:30] vasilakisFiL: yeah I agree, I do the same when dealing with method arguments. My use case is a hash-based DSL that you can set an option using a symbol or a proc.
[17:04:33] vasilakisFiL: cool I didn't know that
[17:21:26] vasilakisFiL: Ping timeout: 255 seconds

2018-05-08

[10:39:31] vasilakisFiL: has joined #ruby
[10:40:09] vasilakisFiL: hi I have this string in a var: " \"Sí\"" and I want to store in a new variable the string itself without the start/end escaped quotes, like "Sí". In another example I would like " \"Sí \"seniorita\" \"" to become " Sí \"seniorita\" ". I tried with eval but only the first string works. Any idea/hint would be helpful.
[10:52:46] vasilakisFiL: basically I want to "unquote" it, like there is something wrong and the string has extra starting/terminating quotes
[10:58:13] vasilakisFiL: thanks! seems to me like very advanced code but interesting regardless :D
[10:59:02] vasilakisFiL: my problem is that I parse an invalid yaml which has in its (invalid) valus quoted strings, but I want to "unquote" those before exporting the valid yaml
[12:03:55] vasilakisFiL: Quit: Konversation terminated!

2018-05-03

[13:27:43] vasilakisFiL: has joined #RubyOnRails
[16:22:45] vasilakisFiL: Quit: Konversation terminated!

2018-05-01

[04:05:14] vasilakisFiL: Ping timeout: 260 seconds
[04:21:07] vasilakisFiL: has joined #ruby
[04:48:33] vasilakisFiL: Ping timeout: 248 seconds

2018-04-30

[10:17:38] vasilakisFiL: has joined #ruby
[10:18:40] vasilakisFiL: hi! Any idea why Regexp.escape('$') returns '\\$\ and not just '\$' ? The former escapes \ (which didn't appear in the initial string anyway) and not $, right ?
[10:19:11] vasilakisFiL: sorry I meant it returns '\\$' not '\\$\
[10:20:37] vasilakisFiL: ah right thanks!
[11:46:41] vasilakisFiL: I see thanks!
[12:01:43] vasilakisFiL: interesting thanks!

2017-10-04

[12:45:47] vasilakisFiL: has joined #ruby
[12:48:19] vasilakisFiL: hey folks! I am wondering, doesn anyone know why self.private_method= doesn't raise an error bug self.private_method does? (snippet: https://gist.github.com/vasilakisfil/7eb19688f3861d9e1b54437c47c60f07 )
[12:51:16] vasilakisFiL: interesting thanks!
[12:52:41] vasilakisFiL: but that's inconsistend a bit. In any case, I would really like it if ruby could extend this special case to the self.foobar as well, so that we can access private accessor from inside our class seamlessly (in case we use a local variable of the same name)
[15:16:34] vasilakisFiL: Quit: Konversation terminated!

2017-05-02

[07:19:18] vasilakisFiL: has joined #ruby
[07:34:43] vasilakisFiL: Ping timeout: 260 seconds
[07:59:20] vasilakisFiL: has joined #ruby
[16:18:32] vasilakisFiL: Quit: Konversation terminated!

2017-05-01

[16:46:20] vasilakisFiL: has joined #ruby
[16:46:34] vasilakisFiL: can I use prepend for a module ? (prepend a module in another module and call super)
[17:12:58] vasilakisFiL: Ping timeout: 258 seconds

2017-04-04

[09:52:44] vasilakisFiL: has joined #RubyOnRails
[09:53:05] vasilakisFiL: does anyone know how I can modify a view's `virtual_path` ?
[09:56:34] vasilakisFiL: thomasfedb are you talking about this? http://www.rubydoc.info/docs/rails/4.1.7/ActionView%2FTemplate%3Avirtual_path
[11:06:53] vasilakisFiL: Ping timeout: 258 seconds
[11:48:14] vasilakisFiL: has joined #RubyOnRails
[15:25:40] vasilakisFiL: Quit: Konversation terminated!

2017-03-29

[08:37:43] vasilakisFiL: has joined #RubyOnRails
[08:38:00] vasilakisFiL: is there a way to get a list of before_actions defined in a controller ?
[08:47:30] vasilakisFiL: perfect it worked
[08:47:53] vasilakisFiL: some stuff haven't changed in Rails source many years now
[08:48:07] vasilakisFiL: I guess they were really good that's why
[09:39:00] vasilakisFiL: Quit: Konversation terminated!

2017-03-28

[07:23:30] vasilakisFiL: has joined #RubyOnRails
[07:23:45] vasilakisFiL: does anyone know how I cam make Rails NOT to include helpers on views ?
[09:08:34] vasilakisFiL: has joined #ruby
[09:08:48] vasilakisFiL: can anyone help me why the last method here raises an error? https://gist.github.com/vasilakisfil/f6b5c6bdd6da0f60c24cba5c26433934
[09:29:31] vasilakisFiL: canton7 in the last line of my gist I show what error I get
[09:29:50] vasilakisFiL: essentially the block within I define some methods is not passed in the class during the class initialization
[09:30:00] vasilakisFiL: maybe I am doing something wrong but I don't know how I can achieve that
[09:30:11] vasilakisFiL: I have seen folks in active admin do the same thing so it should be possible
[09:30:26] vasilakisFiL: canton7 here: https://gist.github.com/vasilakisfil/f6b5c6bdd6da0f60c24cba5c26433934#file-test-rb-L31
[09:31:04] vasilakisFiL: when I dynamically define a new class, it picks up the inheritence not the methods in the block though
[09:55:15] vasilakisFiL: matthewd I know I am experimenting
[09:55:18] vasilakisFiL: thanks it worked !
[19:12:08] vasilakisFiL: Ping timeout: 260 seconds
[19:56:35] vasilakisFiL: has joined #RubyOnRails
[19:56:36] vasilakisFiL: has joined #ruby
[20:21:48] vasilakisFiL: Quit: Konversation terminated!

2017-03-09

[08:46:35] vasilakisFiL: has joined #RubyOnRails
[08:47:26] vasilakisFiL: I had seen a tool that was like travis CI but would allow you to add whatever backend you wanted to run the tests (like EC2 instances).. is there any chance anyone knows what I am talking about ? I have been googling all day but I can't find it
[16:10:10] vasilakisFiL: Quit: Konversation terminated!

2016-06-13

[07:49:05] vasilakisFiL: has joined #ruby
[07:49:05] vasilakisFiL: has joined #RubyOnRails
[12:27:28] vasilakisFiL: Quit: Konversation terminated!

2016-06-10

[15:57:20] vasilakisFiL: Ping timeout: 272 seconds

2016-06-09

[09:13:16] vasilakisFiL: has joined #RubyOnRails
[09:13:20] vasilakisFiL: has joined #ruby
[09:13:40] vasilakisFiL: "When you buy Sidekiq Pro, a custom URL associated with your email address will be sent to you. You add this URL to your Gemfile and everything else is seamless"
[09:13:50] vasilakisFiL: how can I do the same with my gem?\
[09:13:53] vasilakisFiL: is there a service for that ?

2016-04-13

[08:25:51] vasilakisFiL: has joined #ruby
[08:26:22] vasilakisFiL: if I have a method inside a class and I do Foo.new.bar, is it possible inside there to get the 'self' of the caller ?
[08:30:31] vasilakisFiL: it would be nice if it was officially supported though
[08:41:01] vasilakisFiL: yeah I got that :) I hoped there would be a way though :)
[08:51:11] vasilakisFiL: does this pattern has a name? https://gist.github.com/vasilakisfil/e095e5ea133e23374b723fe14063725d
[08:51:33] vasilakisFiL: a closure which when run takes into account the running environment and not the environment that was defined
[08:57:19] vasilakisFiL: but I think it's usefull in many cases
[08:57:53] vasilakisFiL: I will rename the method to rebind then instead of reshape
[10:50:49] vasilakisFiL: Ping timeout: 260 seconds
[10:52:58] vasilakisFiL: has joined #ruby
[10:57:16] vasilakisFiL: Ping timeout: 252 seconds

2016-04-12

[20:23:55] vasilakisFiL: has joined #RubyOnRails
[20:24:56] vasilakisFiL: how can I override a column read by an AR model? I can override the getter by defining a method with the same name as the column but that doesn't work all the times (for instance it will work if you do user.column but not when you do User.first)
[20:44:11] vasilakisFiL: unfortunately AMS reads the .attributes method so it doesn't always work
[20:53:20] vasilakisFiL: but I am stuck in a commit from February so maybe it has been fixed now
[20:53:41] vasilakisFiL: epochwolf in any case if you do User.first.attributes it gets the attributes straight from db
[20:53:50] vasilakisFiL: no matter what you override
[22:12:35] vasilakisFiL: Quit: Konversation terminated!

2016-03-30

[10:50:22] vasilakisFiL: has joined #ruby
[10:50:56] vasilakisFiL: is it possible to create another object and behave like Proc ? for instance f = Foobar.new{ puts 'hey!' };
[11:02:06] vasilakisFiL: basically what I want is something else: I want a proc to always set as the referencing environment, the environment that is called from (using some magic + instance_exec) and not the environment that was defined. But I doubt I can do it.
[11:06:53] vasilakisFiL: djellemah I want to define a proc in point A: proc{ return params[:foo]} and use it in point B where params variable has changed and be able to return the new params value
[11:06:57] vasilakisFiL: how would you do that ?
[12:09:37] vasilakisFiL: Ping timeout: 250 seconds
[12:24:32] vasilakisFiL: has joined #ruby
[13:28:31] vasilakisFiL: Ping timeout: 268 seconds
[13:52:33] vasilakisFiL: has joined #ruby
[14:25:21] vasilakisFiL: Ping timeout: 276 seconds

2016-03-24

[15:52:52] vasilakisFiL: has joined #ruby
[15:53:03] vasilakisFiL: a closure in Ruby (and other languages) encapsulates the environment that is defined on.. how can I achieve the opposite? I want do define something in place A, call it in place B and reference variables from place B
[16:26:07] vasilakisFiL: interesting! thanks adaedra. it worked like a charm! Changing the context of a lambda is not an expensive operation, is it ?
[17:23:19] vasilakisFiL: Quit: Konversation terminated!

2016-03-23

[09:09:49] vasilakisFiL: has joined #RubyOnRails
[09:10:19] vasilakisFiL: is it possible to get this structure from url params somehow? {fields: [:id, user: [:name]]} ? whatever I do, I get 400
[09:27:16] vasilakisFiL: has joined #ruby
[09:27:22] vasilakisFiL: what happened to rack 2?
[17:17:11] vasilakisFiL: Quit: Konversation terminated!

2016-03-22

[10:27:42] vasilakisFiL: has joined #RubyOnRails
[17:27:36] vasilakisFiL: Quit: Konversation terminated!

2016-03-02

[10:20:16] vasilakisFiL: has joined #ruby
[10:21:32] vasilakisFiL: has joined #RubyOnRails
[10:21:35] vasilakisFiL: I have this class: http://pastie.org/private/qyocshcojj5r3ofyftszda (Comment is another AR model). When I call Statistic::Comment.stats from rails console, it works. When I call it from a rake task I get NameError: uninitialized constant Statistic::Comment::Comment on line 6.
[10:21:38] vasilakisFiL: what could be the issue ?
[10:25:12] vasilakisFiL: I have 2 distinct classes: Statistic::Comment and Comment. On line 6 I want to call Comment
[10:26:08] vasilakisFiL: hmm so I need to do ::Comment ?
[10:26:28] vasilakisFiL: I am confused why it's working correctly from the rails console but not from the rake task :/
[10:28:40] vasilakisFiL: ok I am trying it now and see..but if I had anyother class inside Statistics::Comment like Foobar wouldn't that work without calling ::Foobar ?
[10:29:09] vasilakisFiL: is it because I have Comment inside Statistics and Comment outside statistics ?
[13:08:25] vasilakisFiL: Ping timeout: 240 seconds

2016-02-29

[13:28:06] vasilakisFiL: has joined #ruby
[13:28:47] vasilakisFiL: hello: was there any safe navigation operator in ruby implemented as `.?` ?
[13:30:03] vasilakisFiL: I found this https://github.com/ruby/ruby/commit/a356fe1c3550892902103f66928426ac8279e072 through https://github.com/vim-ruby/vim-ruby/pull/274 and I am trying to understand if the latter pull request is still valid
[13:30:08] vasilakisFiL: ah ok then I will tell them to fix it :)
[13:33:04] vasilakisFiL: ah sorry my bad
[17:13:55] vasilakisFiL: Quit: Konversation terminated!

2016-02-18

[09:53:04] vasilakisFiL: has joined #ruby
[10:05:08] vasilakisFiL: Read error: Connection timed out
[10:31:09] vasilakisFiL: has joined #ruby
[16:15:11] vasilakisFiL: Quit: Konversation terminated!

2016-02-02

[11:52:31] vasilakisFiL: has joined #RubyOnRails
[17:48:14] vasilakisFiL: Quit: Konversation terminated!

2016-01-21

[10:32:51] vasilakisFiL: has joined #RubyOnRails
[17:42:57] vasilakisFiL: Quit: Konversation terminated!

2016-01-10

[18:16:02] vasilakisFiL: has joined #RubyOnRails
[21:18:05] vasilakisFiL: Remote host closed the connection
[21:18:29] vasilakisFiL: has joined #RubyOnRails
[23:13:55] vasilakisFiL: Ping timeout: 240 seconds

2016-01-08

[15:27:17] vasilakisFiL: has joined #RubyOnRails
[15:27:24] vasilakisFiL: when searching the same query over ES using searchkick again and again I get different results all the time (although all of them are relevant to what I search)... am I missing something or is ES built like that ?
[19:15:35] vasilakisFiL: Ping timeout: 240 seconds

2016-01-05

[14:25:38] vasilakisFiL: has joined #RubyOnRails
[14:25:53] vasilakisFiL: what is a good idea to use as etag of a record/collection of records ?
[17:06:52] vasilakisFiL: tubbo could you elaborate ?
[17:46:21] vasilakisFiL: but have you ever signed an NDA for a project at all? :P
[17:46:49] vasilakisFiL: I guess you have, it's just isn't clear from your sentence
[18:59:08] vasilakisFiL: Quit: Konversation terminated!

2016-01-02

[16:48:19] vasilakisFiL: has joined #ruby
[16:48:48] vasilakisFiL: how is this implemented? uri = URI("http://foo.com/posts?id=30&limit=5#time=1305298413") I mean passing an option to the class name instead of Uri.new(...)
[16:54:36] vasilakisFiL: hmm good idea
[21:53:40] vasilakisFiL: Read error: Connection reset by peer

2015-12-28

[09:43:29] vasilakisFiL: has joined #RubyOnRails
[09:44:23] vasilakisFiL: ok let's say that we increase heroku dynos and/or puma workers and db connections go up to 400.. (serving a JSON API) is that a good idea? or is it a better idea to shard the db ?
[11:12:15] vasilakisFiL: Ping timeout: 240 seconds
[11:53:02] vasilakisFiL: has joined #RubyOnRails
[13:00:16] vasilakisFiL: Quit: Konversation terminated!
[13:00:26] vasilakisFiL: has joined #RubyOnRails
[15:43:42] vasilakisFiL: Remote host closed the connection

2015-12-27

[09:03:00] vasilakisFiL: has joined #RubyOnRails
[09:52:36] vasilakisFiL: hey! I run puma with 3 workers on 1 X2 heroku dyno with 12 threads. I have db pool= 10 which means 10*3 = 30 connections. Then, I have 10 heroku X2 dynos which means 300 connections. My db supports only up to 240 connections but still I think I should have max 150-180 connections because I should also take into account sidekiq (background workers). What can I do? Shard my database?
[19:08:29] vasilakisFiL: Remote host closed the connection
[19:09:36] vasilakisFiL: has joined #RubyOnRails
[19:28:13] vasilakisFiL: Quit: Konversation terminated!

2015-12-26

[02:36:55] vasilakisFiL: Ping timeout: 240 seconds
[10:27:59] vasilakisFiL: has joined #ruby
[10:28:00] vasilakisFiL: has joined #RubyOnRails
[14:19:36] vasilakisFiL: Ping timeout: 240 seconds
[18:47:07] vasilakisFiL: has joined #RubyOnRails
[18:49:20] vasilakisFiL: hey! I run puma with 3 workers on 1 X2 heroku dyno with 12 threads. I have db pool= 10 which means 10*3 = 30 connections. Then, I have 10 heroku X2 dynos which means 300 connections. My db supports only up to 240 connections but still I think I should have max 150-180 connections because I should also take into account sidekiq (background workers). What can I do? Shard my database?
[21:17:36] vasilakisFiL: Ping timeout: 240 seconds

2015-12-25

[14:00:50] vasilakisFiL: has joined #ruby
[14:01:01] vasilakisFiL: has joined #RubyOnRails
[14:01:25] vasilakisFiL: has anyone tried to run rails with frozen strings all over (ruby 2.3 I guess) ? Just wondering the performance gains
[17:40:35] vasilakisFiL: Ping timeout: 240 seconds
[22:08:16] vasilakisFiL: has joined #ruby
[22:08:17] vasilakisFiL: has joined #RubyOnRails

2015-12-22

[14:27:36] vasilakisFiL: do you know if puma creates a db connection for every thread or only for every process?
[14:27:55] vasilakisFiL: because with 10 heroku dynos connections go up to 240 :)
[14:31:56] vasilakisFiL: ok then I was confused from heroku dev article
[14:32:24] vasilakisFiL: I have a pool=5 on database.yml, but then in the database url there is a pool param which has value=128
[14:32:40] vasilakisFiL: does the second one take any effect ?
[14:33:38] vasilakisFiL: as far as I understand, given that I have ActiveRecord::Base.establish_connection only on_worker_boot puma should create 5 connections for each process
[14:34:00] vasilakisFiL: I have 8 puma processes X 10 dynos = 80 connections, why I get 240? :)
[15:02:01] vasilakisFiL: should I use pg bouncer if I have many dynos on heroku ?
[15:05:36] vasilakisFiL: I don't know, would it be wise to avoid itby trying to lower the open connections from the config files ? (in terms of perfomance)
[17:12:34] vasilakisFiL: Quit: Konversation terminated!

2015-12-21

[09:56:48] vasilakisFiL: has joined #RubyOnRails
[11:09:28] vasilakisFiL: has joined #ruby

2015-12-18

[08:15:22] vasilakisFiL: has joined #ruby
[08:32:43] vasilakisFiL: Read error: Connection reset by peer
[10:08:46] vasilakisFiL: has joined #RubyOnRails
[10:10:18] vasilakisFiL: is there a way to see the request waiting queue size in puma web server?
[18:05:07] vasilakisFiL: Quit: Konversation terminated!

2015-12-17

[13:13:04] vasilakisFiL: has joined #ruby
[13:14:07] vasilakisFiL: in my gem, in hashes as a value I can either have a regular value or a lambda or an object that responds to a #call method.. so instead of trying to figure out if the value of a specific key responds_to? :call everytime, I would like to create a new hash class that does that automatically
[13:14:14] vasilakisFiL: should I inherit the Hash or use composition ?
[13:32:14] vasilakisFiL: why google still keeps ruby 1.9.3 docs as top results :/
[13:43:54] vasilakisFiL: can't I define a method called real_[] ? :/
[13:44:11] vasilakisFiL: what's the actual limitation?
[13:45:26] vasilakisFiL: yeah I get that, but why is is not allowed by the ruby "specs" ? it wouldn't hurt, I think
[17:28:03] vasilakisFiL: Quit: Konversation terminated!

2015-12-16

[08:42:12] vasilakisFiL: how can I access the key ?
[08:43:03] vasilakisFiL: I have a use case in combination with https://github.com/fl00r/pickup
[08:43:33] vasilakisFiL: to generate random keys
[08:43:47] vasilakisFiL: but obviously that's not how it's meant to be used
[11:26:05] vasilakisFiL: Quit: Konversation terminated!
[13:41:21] vasilakisFiL: has joined #ruby
[13:42:37] vasilakisFiL: do lamdas return objects or something else ?
[15:03:28] vasilakisFiL: another issue having lambdas/procs as hash key is that hash.max fails
[15:09:47] vasilakisFiL: I agree but I use it in combination with https://github.com/fl00r/pickup
[17:11:00] vasilakisFiL: Quit: Konversation terminated!