cagmz

Activity Graph

Page 1 of 1

2019-06-12

[23:03:32] cagmz: has joined #RubyOnRails
[23:03:40] cagmz: does add_foreign_key create a new column if it doesn't exist? or do I need to add_column first?
[23:42:21] cagmz: Ping timeout: 256 seconds

2019-02-09

[01:03:49] cagmz: Quit: Page closed

2019-02-08

[21:19:25] cagmz: has joined #RubyOnRails
[21:19:48] cagmz: Having issues with my Docker build using an incorrect version of Bundler. Rather than using this solution ( https://discuss.circleci.com/t/using-bundler-2-0-during-ci-fails/27411/3 ) , can I follow these instructions to automatically use the Gemfile.lock version of Bundler? https://bundler.io/blog/2019/01/03/announcing-bundler-2.html

2019-02-07

[01:25:03] cagmz: Ping timeout: 256 seconds

2019-02-06

[18:15:19] cagmz: has joined #RubyOnRails
[18:16:40] cagmz: if I have a `datetime` column on a rails model, does it matter if I set it using a `Time` object or a `Date` object?

2019-02-01

[01:02:54] cagmz: Quit: Page closed

2019-01-31

[23:37:54] cagmz: has joined #ruby
[23:45:15] cagmz: How do I "undo" a module `prepend` dynamically at runtime?
[23:45:45] cagmz: it overrides a method, and then calls `super`, but I only want to cal `super` with the args

2019-01-25

[01:48:27] cagmz: Ping timeout: 256 seconds

2019-01-24

[18:30:34] cagmz: has joined #ruby
[18:30:58] cagmz: how do I create a private class method if I'm using the `class << self` to define my public methods?
[18:32:48] cagmz: found the answer: https://stackoverflow.com/a/27866601/9670992

2018-07-06

[00:52:54] cagmz: Read error: Connection reset by peer

2018-07-05

[23:01:15] cagmz: has joined #RubyOnRails
[23:01:15] cagmz: has joined #ruby

2018-04-28

[04:14:02] cagmz: Read error: Connection reset by peer

2018-04-26

[02:06:57] cagmz: has joined #RubyOnRails
[02:06:57] cagmz: has joined #ruby

2018-04-19

[02:15:55] cagmz: has joined #ruby
[02:15:55] cagmz: has joined #RubyOnRails
[02:16:59] cagmz: Remote host closed the connection

2018-04-18

[03:34:17] cagmz: has joined #ruby
[03:34:17] cagmz: has joined #RubyOnRails
[03:37:21] cagmz: what is the best way generate a hash from a hash of k,v pairs? ie least chance of collision
[03:38:27] cagmz: cagmz, hash/checksum generated from a Hash. like an MD5 hash
[03:38:48] cagmz: haha wow, long day. @ havenwood
[03:40:09] cagmz: well, my intent is to pass it to Rails.cache.write to ensure a unique cache key
[03:40:44] cagmz: not sure if generating a checksum from a {} is overkill. yes, multiple ruby processes accessing a distributed cache (multiple memcached servers)
[03:44:41] cagmz: the hash will contain k, v values such as { user_id: 1, item_id: 2 }
[03:46:08] cagmz: yes. that hash would be a key to item 2's data. and { user_id: 1, item_id: 3 } for item 3
[03:48:15] cagmz: havenwood, yeah, the hash content is the actual cache key. not the object id
[03:51:18] cagmz: >> require 'digest'; key = { user_id: 1, item_id: 2 }; Digest::SHA256.digest key.to_s
[03:53:15] cagmz: why is Hexdigest better?
[03:56:20] cagmz: ah ok. just saw this: "Returns the hex-encoded hash value of a given string. This is almost equivalent to Digest.hexencode(Digest::Class.new(*parameters).digest(string))."
[04:00:38] cagmz: what do you mean?
[04:01:42] cagmz: I don't mind, but since the {} will be a cache key, I think Hexdigest is more semantic
[04:02:29] cagmz: Marshal.dump is neat, though
[04:04:52] cagmz: this is giving me ideas haha. what do you think about using Marshal.dump work with an in-memory store?
[04:05:25] cagmz: *meant to ask what you thought about using Marshal.dump with an in-memory store, and if it would work in the first place
[04:07:32] cagmz: what's the diff between storing on disk vs memory? besides the obvious
[04:07:49] cagmz: I mean, what are the trade offs?
[04:10:30] cagmz: hmm so with the YAML::Store, a process' memory usage may grow until...?
[04:11:08] cagmz: or will it just load the entire thing into memory and reach the memory cap right away? when/how can this memory be released?
[04:12:18] cagmz: so say it falls out of scope and no methods are using it, is that when it's dereferenced?
[04:12:36] cagmz: wow, til!
[04:12:55] cagmz: ^_^ amazing
[04:16:45] cagmz: got it, thanks again! goodnight
[04:17:03] cagmz: Quit: Leaving

2018-04-16

[04:07:18] cagmz: Quit: Leaving

2018-04-15

[03:23:14] cagmz: has joined #ruby
[03:23:14] cagmz: has joined #RubyOnRails
[03:24:24] cagmz: How does the block in the first line know what 'tree_block' is? `tree_block = lambda{|h,k| h[k] = Hash.new(&tree_block) } ; opts = Hash.new(&tree_block)`
[03:25:39] cagmz: ie how does `Hash.new(&tree_block)` know what `tree_block`? What exactly is `tree_block referring to?
[03:28:09] cagmz: baweaver, so is `default_proc` self-referencing?
[03:29:41] cagmz: sorry, can't contain my excitement. this is weird
[03:30:49] cagmz: `class HashHash < Hash; def default(key = nil); self[key] = self.class.new; end; end;` is this autovivifying as well?
[03:32:20] cagmz: ah, so is `{ |h,k| h[k] = Hash.new(&h.default_proc) }` the default proc?
[03:32:37] cagmz: nice, thanks
[03:38:17] cagmz: is this `Benchmark`? https://github.com/baweaver/qo/blob/master/performance_report.txt
[03:38:59] cagmz: ah ok. higher `i/s` is better, right?
[03:40:00] cagmz: what's the main bottleneck? or better yet, how do you find bottlenecks in the first place?
[03:41:46] cagmz: are any branches up with your ideas?
[03:42:06] cagmz: ah nice!!
[03:45:53] cagmz: was the strict equality check before everything a way to "short circuit" something?
[03:48:13] cagmz: whoa. `-> a { a > 5 } === 6`. is the proc being called with 6?
[15:31:10] cagmz: the_drow, how did you spawn it?
[15:39:37] cagmz: if I call `super` from in method :name in Person < User, will the call return to the Person class after calling `name` in User?
[19:00:31] cagmz: Posted this in #programming but thought I'd throw it in here (Rails app)
[19:00:38] cagmz: I've been trying to find the cause of a DB deadlock for the past few days and am close to losing it. it looks like the same DB transaction block is being hit by concurrent requests. The DB transaction issues 2 `UPDATE` SQL statements, but somehow, concurrent transactions are updating the rows in different orders. Is this even possible?

2018-03-22

[04:11:59] cagmz: Quit: Leaving

2018-03-21

[14:26:09] cagmz: has joined #ruby
[14:26:09] cagmz: has joined #RubyOnRails
[14:27:44] cagmz: Read error: Connection reset by peer
[14:28:04] cagmz: has joined #ruby
[14:28:04] cagmz: has joined #RubyOnRails

2018-03-10

[06:39:36] cagmz: Quit: Leaving

2018-03-09

[15:24:58] cagmz: has joined #ruby
[15:24:58] cagmz: has joined #RubyOnRails

2018-02-26

[04:44:35] cagmz: Quit: Leaving

2018-02-25

[06:27:22] cagmz: Quit: Leaving
[15:58:28] cagmz: has joined #ruby
[15:58:28] cagmz: has joined #RubyOnRails

2018-02-24

[02:56:11] cagmz: has joined #ruby
[02:56:11] cagmz: has joined #RubyOnRails
[05:37:35] cagmz: Quit: Leaving
[21:19:52] cagmz: has joined #ruby
[21:19:52] cagmz: has joined #RubyOnRails

2018-02-21

[06:21:10] cagmz: Quit: Leaving

2018-02-18

[22:32:00] cagmz: has joined #ruby
[22:32:00] cagmz: has joined #RubyOnRails

2018-01-28

[16:04:47] cagmz: has joined #ruby
[16:04:47] cagmz: has joined #RubyOnRails
[16:17:25] cagmz: what does this do? `[:a, :b, :c].try(:[], 1)`?
[16:31:20] cagmz: wnd, is it trying to index into the array, `[]` being a method?
[16:58:34] cagmz: is there an online REPL with Rails?
[17:10:42] cagmz: apparently, `try` is part of activesupport . so I was trying to find a way to include it

2018-01-22

[22:00:05] cagmz: Ping timeout: 260 seconds

2018-01-21

[20:56:43] cagmz: has joined #ruby
[20:56:43] cagmz: has joined #RubyOnRails

2017-12-11

[16:03:52] cagmz: has joined #ruby
[21:56:26] cagmz: *.net *.split

2017-12-07

[06:10:39] cagmz: Read error: Connection reset by peer

2017-12-06

[15:48:15] cagmz: has joined #ruby
[15:48:15] cagmz: has joined #RubyOnRails

2017-11-15

[05:30:12] cagmz: Read error: Connection reset by peer

2017-11-03

[03:43:08] cagmz: has joined #RubyOnRails
[03:43:09] cagmz: has joined #ruby
[03:45:26] cagmz: is there a way to send a link via email and check whether a user has clicked it once they return to my app? Maybe by setting a cookie somehow?
[03:47:31] cagmz: tfitts, ah, like have my app generate a link like... app.com/page?uuid=foo . then my app can check for uuid?
[03:48:31] cagmz: I would need to store these UUID's in a DB, right?
[03:49:24] cagmz: btw, is there a name for this pattern/paradigm? I need to do some research
[03:51:52] cagmz: ok, thanks! this is a good starting point

2017-10-17

[03:20:22] cagmz: Ping timeout: 260 seconds

2017-10-14

[03:20:10] cagmz: has joined #ruby
[03:20:10] cagmz: has joined #RubyOnRails
[03:29:57] cagmz: Ping timeout: 240 seconds
[14:31:06] cagmz: has joined #ruby
[14:31:06] cagmz: has joined #RubyOnRails
[14:33:32] cagmz: what's the difference between these 2 Ruby methods? I don't understand why you would make this change. https://hastebin.com/tisapukoju.rb
[14:38:21] cagmz: matthewd, so in `foo`, `get_bar()` may return nil and assign it to @bar? where as in `other_foo`, once we get a non-nil value from `get_bar()` and assign it to `@bar`, we "protect it" by returning early if it is defined?
[14:39:37] cagmz: actually, that still doesn't make sense. in `foo`, we can get a non-nil value from `get_bar()` and on the second call, @bar would not be redefined by `get_bar()`
[14:40:27] cagmz: because it is already defined? I thought ||= only redefines a variable if the variable is falsey
[14:41:36] cagmz: on the first call to `foo`, `@bar` can be assigned a non-nil value by `get_bar()`. then on the second call, since `@bar` is already defined, `get_bar()` would not be called again. as far as I understand, anyways

2017-10-05

[01:13:18] cagmz: Quit: Leaving

2017-10-04

[13:21:22] cagmz: has joined #RubyOnRails
[13:21:22] cagmz: has joined #ruby
[13:26:49] cagmz: Ping timeout: 258 seconds
[19:39:40] cagmz: has joined #RubyOnRails
[19:39:40] cagmz: has joined #ruby

2017-10-01

[00:21:53] cagmz: Ping timeout: 248 seconds

2017-09-30

[21:46:40] cagmz: has joined #ruby
[21:46:40] cagmz: has joined #RubyOnRails

2017-09-28

[11:40:10] cagmz: Ping timeout: 240 seconds
[13:29:27] cagmz: has joined #ruby
[13:29:27] cagmz: has joined #RubyOnRails
[15:08:05] cagmz: Ping timeout: 240 seconds

2017-09-24

[20:50:09] cagmz: has joined #RubyOnRails
[20:50:10] cagmz: has joined #ruby

2017-09-23

[02:23:29] cagmz: Ping timeout: 248 seconds

2017-09-21

[13:21:32] cagmz: has joined #ruby
[13:21:32] cagmz: has joined #RubyOnRails

2017-08-14

[03:51:24] cagmz: Quit: Leaving

2017-08-13

[13:38:30] cagmz: has joined #ruby
[13:38:30] cagmz: has joined #RubyOnRails

2017-07-29

[20:09:25] cagmz: has joined #ruby
[20:09:25] cagmz: has joined #RubyOnRails
[21:13:32] cagmz: Ping timeout: 260 seconds

2017-07-25

[13:35:00] cagmz: Read error: Connection reset by peer

2017-07-23

[15:54:56] cagmz: has joined #ruby
[15:54:56] cagmz: has joined #RubyOnRails

2017-07-14

[14:02:35] cagmz: Quit: Leaving

2017-07-13

[13:03:33] cagmz: has joined #ruby
[13:03:33] cagmz: has joined #RubyOnRails

2017-06-23

[19:04:06] cagmz: Read error: Connection reset by peer

2017-06-22

[16:30:02] cagmz: has joined #ruby
[16:30:02] cagmz: has joined #RubyOnRails

2017-06-21

[15:20:54] cagmz: has joined #ruby
[16:34:27] cagmz: Ping timeout: 240 seconds

2017-06-20

[00:17:03] cagmz: *.net *.split
[00:22:35] cagmz: has joined #RubyOnRails
[00:22:51] cagmz: has joined #ruby
[05:53:32] cagmz: Read error: Connection reset by peer
[16:07:44] cagmz: has joined #ruby
[16:07:44] cagmz: has joined #RubyOnRails
[23:01:00] cagmz: Read error: Connection reset by peer

2017-06-19

[23:53:59] cagmz: has joined #ruby
[23:53:59] cagmz: has joined #RubyOnRails

2017-05-22

[05:20:42] cagmz: Read error: Connection reset by peer

2017-05-21

[16:40:01] cagmz: has joined #ruby
[16:40:01] cagmz: has joined #RubyOnRails

2017-04-19

[06:00:08] cagmz: Read error: Connection reset by peer

2017-04-18

[16:14:07] cagmz: has joined #ruby
[16:14:07] cagmz: has joined #RubyOnRails

2017-04-16

[16:09:02] cagmz: has joined #ruby
[16:09:02] cagmz: has joined #RubyOnRails
[17:20:11] cagmz: Ping timeout: 240 seconds

2017-04-09

[04:07:21] cagmz: Quit: Leaving

2017-04-08

[15:29:10] cagmz: has joined #ruby
[15:29:10] cagmz: has joined #RubyOnRails

2017-04-03

[00:24:19] cagmz: Quit: Leaving

2017-04-02

[17:20:39] cagmz: has joined #ruby
[17:20:39] cagmz: has joined #RubyOnRails

2017-03-20

[00:22:50] cagmz: Quit: Leaving

2017-03-19

[19:53:28] cagmz: has joined #ruby
[19:53:28] cagmz: has joined #RubyOnRails

2017-03-11

[04:25:15] cagmz: Quit: Leaving

2017-03-10

[15:16:49] cagmz: has joined #ruby
[15:16:49] cagmz: has joined #RubyOnRails
[16:22:16] cagmz: what does this do? ary1 = %i[a b]

2016-05-03

[00:04:24] cagmz: has joined #RubyOnRails
[00:05:29] cagmz: I have a view that passes a keywords variable to my controller. I need to search a database for firstname, lastname, or email matches. how can i do this? I have first name working: https://bpaste.net/show/23ddcb83d717
[00:11:37] cagmz: Remote host closed the connection

2015-11-18

[06:22:43] cagmz: has joined #ruby
[06:24:54] cagmz: anyone know why my jekyll install is failing? maybe its my ruby install? anyone know why my install is failing? https://bpaste.net/show/31aca15438cc
[06:27:31] cagmz: Radar, yes it's installed already, so is ruby-dev
[06:28:07] cagmz: i just want to be cool and use ruby :(
[06:41:34] cagmz: Mon_Ouie, yes, they are installed
[06:41:44] cagmz: Reading state information... Done libffi-dev is already the newest version. libffi6 is already the newest version.
[07:08:38] cagmz: Read error: Connection reset by peer