Activity Graph

Page 1 of 2 | Next »


[18:54:42] Norrin: I have an API that will accept a POST, then kick off a background worker to do some processing.
[18:55:02] Norrin: I only want an account to be able to have one POST processes
[18:55:18] Norrin: otherwise the endpoint would give an error
[18:55:31] Norrin: so I'm thinking the api would create a lock on the account
[18:55:57] Norrin: my dilemma is, how do I then pass the lock to resque, so that the background job can release the lock?
[18:56:21] Norrin: or can a lock be backed to any other process or to a db so that something else can unlock it?
[18:57:31] Norrin: havenwood ^
[19:00:32] Norrin: NL3limin4t0r_afk ^
[19:11:31] Norrin: first impression: I'm novice to the ruby world; sounds daunting
[19:11:50] Norrin: I'll check the article
[19:11:56] Norrin: was hoping for a gem lol
[19:12:24] Norrin: if objc or swift I'd be less concerned
[19:13:48] Norrin: 🕵🏾‍♂️
[19:14:19] Norrin: ease of use + reliability?
[19:14:36] Norrin: havenwood I'll be back in about 40 minutes
[19:14:39] Norrin: thanks so much!
[19:14:46] Norrin: got called to a team lunch right now...
[19:57:41] Norrin: ok cool. 1 more 30 minute meeting then I'll be back


[09:48:17] Norrin: has joined #ruby
[16:15:41] Norrin: has joined #ruby
[16:15:41] Norrin: Changing host
[16:15:52] Norrin: has joined #RubyOnRails


[20:50:32] Norrin: how do folks feel about resque?


[08:00:07] Norrin: ReD-BoY_ hey


[05:05:01] Norrin: has joined #ruby
[05:05:17] Norrin: has joined #ruby
[05:05:17] Norrin: Changing host
[05:05:53] Norrin: has joined #RubyOnRails



[20:47:09] Norrin: sounds like homework
[20:47:26] Norrin: or an interview question


[05:25:28] Norrin: Ping timeout: 258 seconds
[05:47:43] Norrin: has joined #ruby
[17:29:52] Norrin: has joined #ruby
[17:29:52] Norrin: Changing host
[22:55:28] Norrin: has joined #RubyOnRails
[22:58:29] Norrin: any way to, from unix shell, give some code for pry to run, it run it, and it exits immediately?
[23:00:37] Norrin: ok, but i want Pry because it'll attach to the web app that i have running


[20:38:53] Norrin: what's the & do on that line?


[04:12:45] Norrin: I feel like my team is trying to do something silly. They want to make a string column with UUIDs in it instead of using the default id primary key
[04:13:34] Norrin: they think it makes sense in case tables ever move, the UUIDs will be the same but the default id column would not?
[04:14:07] Norrin: what does that mean? dgs
[04:14:21] Norrin: a UUID is meaningful?
[04:15:04] Norrin: I'm sure. they're not unique i would assume
[04:16:34] Norrin: ok. I'd say that UUIDs fit that description. meaningless other than them being unique
[04:18:12] Norrin: I agree about the performance concern
[04:18:30] Norrin: for some reason this company has a culture of not caring about performance
[04:18:39] Norrin: so their fear is that default id's might change if some records were deleted or the table moved & altered in some way. Does that sound realistic?
[04:19:33] Norrin: default AR ID
[04:19:57] Norrin: ok, thanks
[04:20:08] Norrin: don't know where the teach lead is getting this bs...
[04:20:22] Norrin: i just rolled on. imma look this guy up
[04:20:38] Norrin: s/teach/tech/
[09:30:24] Norrin: this guide is saying that db constraints on uniqueness cannot be done on multi column indexes.
[09:30:38] Norrin: but SO has posts that show how to do it. can the guide be updated?
[09:30:48] Norrin:
[12:47:31] Norrin: on there is a phrase that reads: "Rails will not create foreign key columns for you. You need to explicitly define them as part of your migrations."
[12:48:23] Norrin: It's rather confusing. It's kind of not true. if you list a reference in a migration it does create the column for you....
[13:15:52] Norrin: how can be updated so that it mentions that the hash passed to foreign_key is forwarded to add_foreign_key, and therefore that the hash documentation is listed under add_foreign_key ?
[13:43:57] Norrin: how do you add a database contraint on uniqueness that is scoped?


[14:03:20] Norrin: So I'm trying to learn how to navigate the documentation.... in the guides you see "t.references" & etc... how do you know where to find the documentation for t.references? I would have never known to look under "ConnectionAdapters", nor "SchemeStatements", nor under "add_reference". Is there something to shows where to find params of methods that you see mentioned in guides? NL3limin4t0r
[14:17:57] Norrin: NL3limin4t0r the first result is this...
[14:18:33] Norrin: it looks correct b/c it basically says 'instance methods' of TableDefinition but where's the content?
[14:18:55] Norrin: "(*args, **options)" where does it actually give the args and the options?
[14:22:59] Norrin: ok. can click the superclass to get the definition...
[14:24:06] Norrin: one problem i have is the add_reference doc has a different form. its first argument is table_name, which td.references is not going to accept
[14:27:02] Norrin: I have a couple of questions about the syntax in this method definition --
[14:27:38] Norrin: 1) when it says **options, is that like variable arguments? casting everything remaining into an "options" hash?
[14:28:49] Norrin: 2) the keys to the hash are symbols? `add_reference(:products, :user, type: :string)` passing "type" as a symbol?
[14:31:31] Norrin: Thanks, that helps NL3limin4t0r
[14:44:08] Norrin: thanks! NL3limin4t0r
[15:52:44] Norrin: NL3limin4t0r, interesting. why do the keys have to be symbols?
[16:07:20] Norrin: 😫 how array captured hashes and keyword arguments look the same at the call site
[16:10:36] Norrin: &>> def test(*options, a: something); p something; end; a=22; test(1,2,3, a: "a string")
[16:12:00] Norrin: &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a: "a string")
[16:14:24] Norrin: &>> def test(*options); p options; end; a=22; test(1,2,3, a: "a string")
[16:15:20] Norrin: &>> def test(*options); p options; end; a=22; test(1,2,3, 22: "a string")
[16:15:52] Norrin: &>> def test(*options); p options; end; a="test"; test(1,2,3, a: "a string")
[16:16:34] Norrin: keys to hashes have to be symbols?
[16:17:07] Norrin: &>> def test(*options); p options; end; a="test"; test(1,2,3, "string_key": "a string")
[16:19:07] Norrin: ok. so seems the a: b format dictates that it's a symbol
[16:19:20] Norrin: => will allow a different type
[16:21:20] Norrin: &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string")
[16:24:13] Norrin: &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string")
[16:24:35] Norrin: maybe rubydoc is as confused by this as I am
[16:26:04] Norrin: &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string", a: "different string")
[16:26:29] Norrin: &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a: "different string")
[16:27:20] Norrin: &>> p "you're not blocked"
[16:44:00] Norrin: hmm, had some strange characters there. it's invisible on my screen, except for whitespace
[16:44:13] Norrin: &>> def test(*options, a: nil); p a; end; a=22; test(1,2,3, a => "a string")
[16:45:20] Norrin: &>> def test(*options, a: nil); p options,a; end; a=22; test(1,2,3, a => "a string")
[16:46:35] Norrin: hmm so array capture will capture a hash even when the method accepts keyword arguments, as long as it's in the a => b form instead of the a: b form
[16:53:51] Norrin: NL3limin4t0r interesting. seems like it glued the two together into one hash
[16:56:02] Norrin: havenwood interesting
[17:36:47] Norrin: havenwood what feature was removed?
[17:37:33] Norrin: all i can see if an enhancement, distinguishing the hash from the keyword arg
[17:38:25] Norrin: node is backend
[17:38:36] Norrin: it's often used to host front-end files
[17:39:06] Norrin: i've often had a hard time describing the node project I worked on.... "back-end for a front-end" lol
[17:39:37] Norrin: basically system eng for the front-end, all in the same repo and same deployment
[17:43:53] Norrin: bretzel you're talking about Rails or the Ruby ecosystem?
[17:44:14] Norrin: I see "Rails" but seems like you're talking about Ruby.
[17:44:30] Norrin: I disagree Re: Ruby. Just have to learn how it works
[17:45:04] Norrin: getting rid of duplicate versions helps regarding getting gems to work
[21:10:02] Norrin: NL3limin4t0r_afk the linux kernel is written using OOP in C...
[21:13:28] Norrin: can't get the foreign_key: {to_table: :something} to work NL3limin4t0r_afk
[21:13:57] Norrin: I have the hardest time figure what what foregign_key and primary_key do
[21:14:23] Norrin: they're used in associations. the problem is, an association has two sides. which side do foreign_key and primary_key describe?
[21:14:57] Norrin: hardest time figuring* out* what foreign_key and primary_key do
[21:15:40] Norrin: god these docs drive me up a wall also
[21:16:15] Norrin: primary_key is not even mentioned on


[11:56:01] Norrin: *.net *.split
[12:01:27] Norrin: has joined #RubyOnRails
[12:01:32] Norrin: has joined #ruby
[18:37:57] Norrin: NL3limin4t0r_afk that's nice about `foreign_key: {to_table: :segment}`. Where do you find documentation for that?


[17:20:58] Norrin: NL3limin4t0r thanks for getting back to me
[17:21:18] Norrin: i'm wrestling with macro/method definitions a bit on activerecord
[17:21:50] Norrin: tabledefintion.references for example doesn't seem to mention the class_name: option
[17:21:55] Norrin: for example
[18:04:36] Norrin: NL3limin4t0r like a self join table
[18:04:50] Norrin: a model that can reference itself


[05:45:07] Norrin: amazed at how little chat happens where
[05:45:16] Norrin: is there some other rails channel that is bigger?
[09:59:22] Norrin: kurly that's fine but there's very little rails discussion happening. maybe you haven't seen how IRC has been in the past before


[03:54:14] Norrin: I'm having a hard time understanding when belongs_to and has_and_belongs_to_many are needed
[03:54:49] Norrin: does every usage of has_one or has_many require a matching usage of belongs_to or has_and_belongs_to_many?
[04:20:31] Norrin: interesting
[04:20:56] Norrin: so if you don't use belongs_to nor has_and_belongs_to_many, where does the reference column go?
[04:21:06] Norrin: on the owner or the ownee?
[04:21:49] Norrin: so you're saying that if you have neither, then you can't look up the association?
[04:22:06] Norrin: so basically you have no association then.... ?
[04:22:34] Norrin: so basically the lonely has_one / has_many accomplishes nothing?
[04:23:46] Norrin: w/o the methods you've basically accomplished nothing by using has_one or has_many alone, right?
[04:25:01] Norrin: if you don't have the methods, nor the reference column, what do you get out of it?
[04:25:42] Norrin: i read that belongs_to and has_and_belongs_to_many create the reference column in that model's db
[04:27:35] Norrin: i got the impression the reference column is only made on the db of the model that has belongs_to or has_and_belongs_to_many
[04:28:15] Norrin: "in an case you need the reference column to get either association" -- it sounds like you're saying that belong_to or has_and_belongs_to_many is required...
[04:28:54] Norrin: you add the reference column how?
[04:29:19] Norrin: a db migration that contains what?
[04:31:30] Norrin: ok. might have read some bad info somewhere
[04:32:20] Norrin: so you can create an association without being able to reference it?
[05:46:08] Norrin: Geez this article is really not being clear about the difference has_one and belongs_to
[05:48:52] Norrin: thanks SO for finally telling me that there's no difference
[16:21:38] Norrin: NL3limin4t0r thanks
[16:21:49] Norrin: yeah what shocked me is there's no difference in the DB
[16:22:15] Norrin: once i got further down in the article, it became more obvious that the differences are the helper functions
[16:23:16] Norrin: secondly, my mind would jump to the conclusion that belongs_to would mean the reference column would go into the owner class's db
[16:23:37] Norrin: but being kind of new to DBs, I guess it's the other way around for reasons that I don't know about
[16:25:13] Norrin: maybe enumerating multiple IDs into a single db cell is bad performance. seems like it'd be fast lookup over traversing the entire comments db though
[16:27:05] Norrin: wmoxam what's what db indexes are for?
[16:29:12] Norrin: if comment belongs_to post, doesn't the method post.comments have to traverse the entire comments db in order to find all of the post_id rows that contain post's id? wmoxam
[16:29:50] Norrin: ok. what's a db index?
[16:31:10] Norrin: ok fine. so sort the comments db ahead of time in the interest of post.comments lookups.... but why do that instead of just putting the comment references into the Post db? wmoxam
[16:32:02] Norrin: ah. didn't know what the index: true meant
[16:34:03] Norrin: ACTION goes read 
[16:45:40] Norrin: makes sense. just didn't realize that was used in this case
[16:46:03] Norrin: if index: true was described in what I read, I missed it
[16:48:40] Norrin: Atomic columns 👀
[16:53:41] Norrin: wmoxam so ActiveRecord is which level of normalized?
[16:54:02] Norrin: form rather
[16:54:18] Norrin: Caio NL3limin4t0r_afk
[23:50:26] Norrin: wmoxam NL3limin4t0r_afk I just searched through and although it has index: true through about 20 of the examples, it never once takes the time to explain what that does
[23:50:56] Norrin: with that said, thanks for explaining it to me. b/c the db design was annoying me w/o knowing an index table would be created


[04:54:41] Norrin: wow i remember when this channel averaged between 1000 and 2000 users
[05:02:07] Norrin: geez even like dalnet /
[05:02:26] Norrin: haven't been on those in like 1.5 decade....
[05:02:55] Norrin: i guess undernet was big for a while


[04:20:23] Norrin: yeah, test for an absolute difference instead of an exact match
[04:20:41] Norrin: exact time values like that will never match up for a unit test exactly
[04:21:02] Norrin: assert two conditions instead of ==
[04:21:07] Norrin: >= and <=
[04:24:27] Norrin: print the time in unix time instead of georgian
[04:24:46] Norrin: then it'll be just a decimal (a number that you won't have to convert to string)
[04:25:24] Norrin: that's fine... but how are you comparing?
[04:25:35] Norrin: there's all types of non-numeric characters in there....
[04:27:30] Norrin: shouldn't
[04:27:39] Norrin: a users' time zone isn't static
[04:27:44] Norrin: I've seen apps do that and hated it
[04:28:58] Norrin: should just send unix time and let the local client convert to the current time zone
[04:32:11] Norrin: not at all
[04:32:27] Norrin: all client should have some function that converts unix time to local time
[04:33:50] Norrin: naw, servers need consistency. the server is going to have a time zone hard coded
[04:34:04] Norrin: otherwise logs will be impossible to parse
[04:36:50] Norrin: also, a server has no reason to convert out of unix time. just leave it that way
[04:37:48] Norrin: well.... nvm... for server side rendering, use the timezone on the request object to convert to


[22:34:18] Norrin: has joined #ruby
[22:34:49] Norrin: has joined #RubyOnRails


[17:03:48] Norrin: has left #ruby: ("Dueces")


[16:30:07] Norrin: Max SendQ exceeded
[16:33:20] Norrin: has joined #ruby


[15:33:18] Norrin: Ping timeout: 248 seconds
[15:39:38] Norrin: has joined #ruby


[04:35:16] Norrin: Ping timeout: 264 seconds
[05:24:57] Norrin: has joined #ruby


[08:18:29] Norrin: has joined #ruby


[15:07:44] Norrin: has left #ruby: ("Dueces")
[15:53:33] Norrin: has left #RubyOnRails: ("Dueces")


[13:39:33] Norrin: has joined #RubyOnRails
[13:39:33] Norrin: has joined #ruby
[15:48:34] Norrin: has left #RubyOnRails: ("Dueces")
[15:48:43] Norrin: has left #ruby: ("Dueces")
[23:13:43] Norrin: has joined #RubyOnRails
[23:13:43] Norrin: has joined #ruby


[20:02:00] Norrin: has left #ruby: ("Dueces")
[20:02:02] Norrin: has left #RubyOnRails: ("Dueces")


[10:51:10] Norrin: has joined #RubyOnRails


[17:08:28] Norrin: has left #ruby: ("Dueces")
[18:16:24] Norrin: has joined #ruby
[20:43:15] Norrin: has left #RubyOnRails: ("Dueces")


[17:27:49] Norrin: wow roubyconf is cheap
[17:27:53] Norrin: rubyconf*
[17:31:33] Norrin: funny to me, one article seemed to think ruby becoming more statically typed would improve code reuseability
[17:33:35] Norrin: actually i guess it could. you can require types on parameters and ensure more safety, causing errors that would be caught earlier on in development
[17:33:56] Norrin: i've always found ruby very hard to read. not sure its due to types though
[17:35:12] Norrin: the fact that parenthesizes can be excluded from parameter lists, blocks, and in-line hashes i think are the main reasons
[17:35:49] Norrin: and symbols and hashes look too similar when hashes have no parens
[17:57:28] Norrin: shevy, that doesn't change what others do
[17:57:37] Norrin: that's why what the lang allows is so critical
[17:58:32] Norrin: same thing with the auto agruments like $0 and etc. $_ and stuff. there's more isoteric ones... i actually know what those two mean. but perl and ruby have gone that route to dislike of many
[17:58:39] Norrin: even swift has some stuff like that though
[17:58:49] Norrin: auto agruments that give no hint as to what they mean
[17:59:11] Norrin: shevy, the rules of a language can greatly enhance readability
[17:59:28] Norrin: convention plays a major part also
[17:59:57] Norrin: shevy, what 'alternatives'?
[18:01:12] Norrin: shevy, lol... you mean a modified version of python?
[18:01:26] Norrin: yeah a cool core tenant of python is 'there's only 1 way to do things'.
[18:02:15] Norrin: shevy, i'm not sure what you're trying to say
[18:03:50] Norrin: i didn't bring up possibilities until just recently. i do like the python opinion of possibilities.
[18:04:16] Norrin: you brought up python and i can't understand what your message is there
[18:05:01] Norrin: but anyway, yes you can write crap code in any language. but lang syntax and convention play a huge part in how easy it is to read the language on average
[18:06:35] Norrin: my parens statement wasnt about possibilities. simply put, the parens are easy to run. its got nothing to do with whether there's a choice or not
[18:06:42] Norrin: easy to read*
[18:08:55] Norrin: i really prefer it with parens, because without them, if :tree was some variable instead, you can't tell that its an argument
[18:09:49] Norrin: i know. that's why i said if it was a variable identifier instead
[18:09:57] Norrin: it can get confusing