Cork

Activity Graph

Page 1 of 13 | Next »

2019-04-13

[16:50:13] Cork: *.net *.split

2019-04-10

[11:55:11] Cork: anyone know if there is a way to get redcarpet to offset the header level?
[11:55:23] Cork: i would want to have it start at h3 instead of the default h1
[12:38:55] Cork: ryouba: is x of that class?
[12:39:12] Cork: cause if it is it should work just fine
[12:40:56] Cork: Tuor: you mean what the result is or what it does deeper down?
[12:41:37] Cork: Tuor: cause the result is a class (struct) with an accessor name that you can give values
[12:44:09] Cork: Tuor: new takes a list of values, and it returns a new instance with those names defined as accessor
[12:44:26] Cork: this means you can take the result.name or result.<what ever you called it that is a valid format name>
[12:44:48] Cork: struct isn't much more then that, it is basically a hash
[12:46:26] Cork: no it should be the value of the struct field name
[12:46:34] Cork: optoons should be a struct class
[13:25:25] Cork: Tuor: that is the internal part i talked about before, i THINK Struct just use the generic Class.new to create a dynamic class under the hood, but not sure

2019-03-29

[09:20:13] Cork: the core net/http causes "warning: Object#timeout is deprecated, use Timeout.timeout instead." warnings, anyone know if there is an issue somewhere about handling this?

2019-03-21

[12:49:56] Cork: is it possible to get activerecord to use stable names for dynamicly joined tables?

2019-03-20

[08:28:26] Cork: is it possible to do new/build on a has_many through relation and have the middle tables link it set correctly?
[08:42:44] Cork: davK: its a has_many and a belongs_to but ya
[08:43:26] Cork: the problem is if i created it from that direction i will have to use nested resource for the belongs_to and that becomes incompatible with the call i have today
[08:47:24] Cork: i can get everything working but i seam to have to override the initialize method to set the relation id correctly...
[08:47:35] Cork: thoughy i don't have a clue where that happens normalt >_<
[10:06:32] Cork: guyzmo: you do have self.class.reflect_on_all_associations
[10:06:41] Cork: it might give you what you want
[10:16:37] Cork: public_send(assoc).reset should work
[10:17:02] Cork: you might want a check if self.public_send(alloc).blank?
[10:17:15] Cork: (so you don't try it on an association that doens't exist)
[10:21:16] Cork: has_ones = server.class.reflect_on_all_associations(:has_one).select {|association| !association.through_reflection? }.map(&:name)
[10:21:33] Cork: opps s/server/self/
[10:21:55] Cork: i've actually needed the exact same thing so :)
[10:22:01] Cork: well not for reset but...
[11:01:04] Cork: is it possible to alias a private method?
[12:03:54] Cork: dionysus69: most likely cause of floating point in the decimal column
[12:05:20] Cork: phaul: hmm interesting... i get method undefined when i try
[12:05:26] Cork: ACTION digs deeper...
[13:47:52] Cork: dionysus69: the database most likely stores the data as a floating point
[13:47:58] Cork: causing floating point errors
[13:49:23] Cork: dionysus69: it does, (kinda) but it isn't bigdecimal cuasing the erorr
[13:49:38] Cork: databases has floating points too
[13:49:58] Cork: so depending on the column type you use, and the accuracy of that type you can get errors from there too
[13:51:48] Cork: dionysus69: you might want to have a read at this https://dev.mysql.com/doc/refman/5.7/en/precision-math-decimal-characteristics.html
[13:52:01] Cork: posgress has a similar page if you use that
[14:06:36] Cork: 0.1 is a floating value in ruby
[14:06:41] Cork: so you get the floating point error
[14:06:46] Cork: "0.1" isn't
[14:07:16] Cork: so ya, you never want a dot value that isn't a tring given to BigDecimal

2019-03-13

[06:49:46] Cork: is there a way to tell activeRecrod to create a belongs_to record before trying to save the current one?
[07:05:33] Cork: tbuehlmann: https://paste.debian.net/1072950/
[07:05:48] Cork: this crashes with ActiveRecord::NotNullViolation (Mysql2::Error: Field 'network_id' doesn't have a default value: ...
[07:06:25] Cork: i suspect it means it tries to save the PrivateNetwork and then Network there by failing the PrivateNetworks constraint for network_id
[07:16:25] Cork: tbuehlmann: the function needs to clam a row in another table so if i run it before_validate i need to have a way to clean up if it fails validation
[07:34:40] Cork: tbuehlmann: no, the network table is not exposed in the ui so the model needs to handle it
[07:35:32] Cork: interesting about the transaction, haven't actually checked that it doesn't revert that on it's own >_<
[07:36:34] Cork: heh you're correct
[07:36:42] Cork: man talk about over working a none problem -_-'
[07:36:52] Cork: tbuehlmann: thx for kicking me in the correct direction >_>

2019-02-18

[07:54:11] Cork: i'm creating a class for a http api and would like to group its function. api.user.list, api.user.create, api.contact.list ... instead of api.user_list api.user_create...
[07:54:21] Cork: is there a sain way to do this in ruby?
[07:56:40] Cork: (also i would like api.user.methods to list those methods and not the contact ones and so on)
[08:02:07] Cork: tbuehlmann: hmm opps missed to point one think out i have a class variable in api i need it to access
[08:02:14] Cork: would i have to copy it over?
[08:04:02] Cork: sounds like i should just stick with _ :)
[08:06:03] Cork: interesting
[08:06:16] Cork: didn't even know it existed

2019-02-15

[12:41:21] Cork: is there a way to get DS record data (doesn't have to be parsed) with Resolv::DNS ?
[13:28:52] Cork: darix: TypeError: "DS" is not a class/module
[13:29:18] Cork: also https://ruby-doc.org/stdlib-2.0.0/libdoc/resolv/rdoc/Resolv/DNS.html#method-i-getresource list a limited list of what you can enter there
[13:32:34] Cork: only way to do it that i've found currently is to use the gem dnsruby, but it feels kinda weird that the built in one can't do it

2019-01-21

[07:49:17] Cork: is there anywhere one can find max/min ruby requirements for core rails?
[07:50:38] Cork: sevenseacat: thx, you know about max?
[09:33:32] Cork: fox_mulder_cp: as far as i can tell you can't use latest ruby
[09:33:54] Cork: ruby 2.6 breaks quite badly
[09:34:32] Cork: fox_mulder_cp: the problem is that ruby 2.6 smeams to have fiddled with irb so rails c fails
[09:36:29] Cork: hmm i use pry too but i get "`require': cannot load such file -- irb" with 2.6
[09:36:58] Cork: fox_mulder_cp: i can't even start it
[09:37:14] Cork: meaning i can start irb, but not rails c
[09:37:23] Cork: also i can start pry directly
[09:38:28] Cork: fox_mulder_cp: i rm -Rf vendor/bundle bundle install --path=vendor/bundle
[09:38:43] Cork: so i don't think that should be the problem
[09:40:24] Cork: mixed a bit depending on system, but on this maching it is the archlinux package
[09:43:28] Cork: uh, no i don't use rails from repo
[09:43:30] Cork: only ruby
[09:44:00] Cork: and it is 2.6.0 so my problem is actually normally that it is a bit too new :)
[09:44:37] Cork: for rails and all other gems i use builder
[09:47:24] Cork: ya, will have to wait though haven't ever used rbenv
[09:50:06] Cork: fox_mulder_cp: cool

2018-12-18

[00:05:18] Cork: Ping timeout: 246 seconds
[00:11:38] Cork: has joined #ruby
[00:13:32] Cork: has joined #RubyOnRails

2018-12-04

[00:23:28] Cork: Ping timeout: 252 seconds
[01:18:49] Cork: has joined #RubyOnRails
[01:23:03] Cork: has joined #ruby

2018-11-30

[09:35:24] Cork: i'm a bit curious, why is change_table .remove mapped to remove_columns and not remove_colunn?
[09:35:37] Cork: the current mapping means you can't reversably remove a column in change_table
[09:48:52] Cork: also https://github.com/rails/rails/blob/96dee0e7e5a8dd6ce42999b13d0bd0623073e229/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L607
[09:51:18] Cork: if you add and remove multiple columns on a table it is cleaner to use change_table then multiple add_column and remove_column
[09:54:07] Cork: yes, but you don't need to fedine the table multiple times
[09:54:55] Cork: i know how the none change_table commands work, i just wonder why explicitly t.remove* can't be (as all the other change_table can)

2018-11-15

[16:20:07] Cork: has joined #ruby
[16:21:14] Cork: has joined #RubyOnRails
[16:49:57] Cork: has joined #ruby
[16:51:04] Cork: has joined #RubyOnRails

2018-11-09

[09:32:34] Cork: when on is defining a method_missing; is it possible when calling super (cause it isn't handled) to have the stacktrace show the original location?

2018-11-08

[10:11:56] Cork: is it possible to pack to alphanumeric? [0, 10, "TI00021"] => "0010TI00021 "
[10:12:05] Cork: i know the last part pack("? ? A12") but what about the first two values?
[10:35:35] Cork: hmm pitty; will have to mangle the array before hand then; thx!

2018-11-07

[10:46:36] Cork: is it possible to get ActionMailer#deliver_later to do a deliver_now in testing?

2018-11-06

[00:19:24] Cork: Ping timeout: 252 seconds
[01:03:15] Cork: has joined #ruby
[01:04:26] Cork: has joined #RubyOnRails
[02:29:00] Cork: Ping timeout: 252 seconds
[03:35:52] Cork: has joined #ruby
[03:36:59] Cork: has joined #RubyOnRails

2018-11-01

[07:00:25] Cork: is there any way to get the post string in an encoding honnoring the charset header value?
[07:00:39] Cork: or is it expected to always be ASCII-8BIT?

2018-10-31

[12:49:04] Cork: anyone know if there is a way to "unmark_for_destruction" a related active record object?
[12:49:22] Cork: i can only find mark_for_destruction and marked_for_destruction? but i need to reset the state
[12:55:30] Cork: dachi: that would reset the complete state of the object
[12:55:44] Cork: i just want to not remove it :)
[12:56:25] Cork: very hackish but... obj.instance_variable_set("@marked_for_destruction", false) "works", though i would love to have an exposed api...
[13:01:22] Cork: dachi: follow jhass recommendation
[13:10:40] Cork: jhass: it happens as an action of the user on the parent object
[13:11:02] Cork: you saw the first line
[13:11:18] Cork: it was 22 mins ago :)
[13:11:49] Cork: freenode doesn't keep logs
[13:15:11] Cork: jhass: ya, but it states so it need to be able to go in both directions
[13:15:29] Cork: else you can toggle the parent object and then toggle it back and get the wrong result
[13:16:04] Cork: sure i can say "if you toggle this and want to restore it you have to reload the entire object relation"
[13:16:14] Cork: but i would prefer to not have to make sure everyone knows that
[13:16:20] Cork: (and remembers)
[13:16:45] Cork: ya, but the problem is we have things hooked into the after_commit hook that needs to get the correct data
[13:16:58] Cork: so mark_for_destruction action is important to trigger correctly on .save
[13:18:53] Cork: jhass: ya, but it is a kinda silly big relation, we have extended active_record quite heavily (it is a relly old project, we hopefully will replace it in about a year)

2018-10-30

[00:45:16] Cork: yes, solved it! :D
[00:46:07] Cork: if anyone else needs to create an ecdsa key from its private part. https://github.com/ruby/openssl/blob/master/test/test_pkey_ec.rb#L120
[08:34:30] Cork: anyone know how to make a GOST R 34.11-94 digest in ruby?

2018-10-29

[23:38:17] Cork: if i have an OpenSSL::BN object (OpenSSL::PKey::EC#private_key), is there a way to recreate the full OpenSSL::PKey::EC object?

2018-10-25

[06:40:53] Cork: anyone know if it is possible to create a OpenSSL::PKey::EC from a OpenSSL::BN instance?

2018-10-24

[14:44:13] Cork: anyone know how to convert the integer 257 to [1,1] in ruby? (bytes in an array)
[14:47:56] Cork: well as one byte can't be more then 256 the rest ends up in the next byte
[14:48:06] Cork: but ya divmod might be a solution
[14:48:39] Cork: but ya, cool that is exactly what i needed! thx!
[15:42:34] Cork: anybody know how to parse a OpenSSL::PKey::EC key from a byte string?
[15:42:52] Cork: OpenSSL::PKey::EC.new doesn't seam capable of parsing

2018-10-05

[11:13:16] Cork: Ping timeout: 246 seconds
[13:37:49] Cork: has joined #ruby
[13:39:14] Cork: has joined #RubyOnRails
[15:27:28] Cork: Ping timeout: 268 seconds
[16:29:50] Cork: has joined #ruby
[16:30:59] Cork: has joined #RubyOnRails
[17:33:39] Cork: Ping timeout: 252 seconds
[17:42:46] Cork: has joined #ruby
[17:43:54] Cork: has joined #RubyOnRails
[19:24:19] Cork: Ping timeout: 246 seconds

2018-09-19

[01:08:49] Cork: has joined #RubyOnRails
[01:09:50] Cork: has joined #ruby
[05:32:24] Cork: has joined #ruby
[05:33:54] Cork: has joined #RubyOnRails
[11:13:22] Cork: is there a way to revert mark_for_destruction on a model in a model relation?
[15:23:56] Cork: has joined #ruby
[15:27:29] Cork: Excess Flood
[15:27:29] Cork: has joined #RubyOnRails
[15:29:22] Cork: has joined #ruby
[15:31:52] Cork: has joined #RubyOnRails

2018-09-18

[14:08:18] Cork: Ping timeout: 264 seconds

2018-09-14

[10:10:13] Cork: Ping timeout: 250 seconds
[11:21:29] Cork: has joined #ruby
[11:22:37] Cork: has joined #RubyOnRails
[12:13:39] Cork: Ping timeout: 252 seconds
[12:15:24] Cork: has joined #ruby
[12:16:54] Cork: has joined #RubyOnRails

2018-09-07

[09:48:46] Cork: Ping timeout: 260 seconds

2018-09-06

[15:10:18] Cork: Remote host closed the connection
[16:51:09] Cork: has joined #ruby
[16:52:59] Cork: has joined #RubyOnRails

2018-09-04

[00:11:07] Cork: Ping timeout: 240 seconds
[00:24:02] Cork: has joined #ruby
[00:25:11] Cork: has joined #RubyOnRails
[00:33:34] Cork: Ping timeout: 240 seconds
[00:39:58] Cork: has joined #ruby
[00:41:20] Cork: has joined #RubyOnRails
[01:00:46] Cork: Ping timeout: 256 seconds

2018-08-31

[09:28:02] Cork: Ping timeout: 255 seconds
[09:43:51] Cork: has joined #ruby
[09:45:55] Cork: has joined #RubyOnRails

2018-08-29

[06:56:52] Cork: is there a way to get the rails built in action xml parser to keep the attribute for tags?
[06:57:38] Cork: i get <Document><Amt Ccy="EUR">10</Amt></Document> => {"Document" => { "Amt" => "10" }}
[06:58:32] Cork: Radar: the built in rails requrest parser
[06:58:42] Cork: the data ends up in params in the action method
[06:59:44] Cork: Radar: curl -k -i -H "content-type: application/xml" -X POST -d ' <Document><Amt Ccy="EUR">10</Amt></Document>' "https://localhost:8080/endpoint"
[06:59:54] Cork: and params has what i showed up there
[07:01:15] Cork: Radar: it _MIGHT_ be actionpack-xml_parser, i wans't the one setting up this part of the project
[07:05:35] Cork: baweaver: will try, though i don't control the poster
[07:06:01] Cork: i hate xml
[07:07:29] Cork: Radar: was afraid of that, you happen to know of a parser that can handle attributes and doesn't require a full dom and walking?
[07:07:50] Cork: ya, that is the dom and walking i was thinking of :)
[07:09:25] Cork: Radar: ya, this is just a one tag of the 50+ * transactions xml i will be getting
[07:10:03] Cork: (this is bank payments the bank pushed to the service)
[07:10:33] Cork: sevenseacat: ya
[07:11:28] Cork: Radar: ya, on it thx
[07:13:44] Cork: interesting actionpack-xm_parser uses Hash.from_xml and... https://github.com/rails/rails/issues/588
[07:13:48] Cork: oh well... :)
[07:17:34] Cork: hmm you have a point there actually, i could use nokogiri to parse out the Ccy attributes and store them separately
[07:17:50] Cork: would be double parsing but it wouldn't be too uggly...

2018-08-20

[10:10:42] Cork: image-url() keeps not adding the sprocket generated url for a file (it keeps using the source path)
[10:10:52] Cork: anyone know what might cause that?
[10:11:09] Cork: this is for one specific file only (and it works find on another machine)
[10:12:47] Cork: Radar: 5.2.0 and it is a file in app/assets/images
[10:13:45] Cork: app/assets/stylesheets/overrides/desktop.scss
[10:14:02] Cork: i have the path added in assets.rb in initialize
[10:14:53] Cork: Rails.application.config.assets.precompile << /(?:\/|\\|\A)overrides\/.+\/(?:login\/)?(?:desktop|mobile)\.css$/
[10:15:24] Cork: and this works in production mode on one machine, but not another
[10:15:48] Cork: cause it is separately included
[10:15:57] Cork: as a separate css file (conditionally)
[10:16:41] Cork: there are more and some of them works it is just this one that doesn't modify the url
[10:17:32] Cork: and gets a 404 as a result
[10:17:59] Cork: i've tried wiping the entire /public/assets
[10:18:08] Cork: no the file is generated
[10:18:18] Cork: it is used in another scss file and is correct there :/
[10:19:00] Cork: 564 files
[10:19:58] Cork: as i have wiped it (rm -Rf *) no
[10:20:07] Cork: precompiled is a new after
[10:22:44] Cork: Radar: https://paste.debian.net/plain/1038576
[10:22:58] Cork: desktop.scss works login/desktop.scss doesn't
[10:23:38] Cork: and i have ~70 other of these and those works in both cases...
[10:24:04] Cork: ya, me neither...
[10:27:40] Cork: thx, i think i will need it...

2018-08-17

[08:45:37] Cork: Ping timeout: 265 seconds
[10:12:08] Cork: has joined #ruby
[10:13:14] Cork: has joined #RubyOnRails

2018-08-10

[08:23:21] Cork: Ping timeout: 240 seconds

2018-07-31

[09:36:54] Cork: has joined #RubyOnRails
[09:37:10] Cork: has joined #ruby

2018-07-30

[15:35:20] Cork: has joined #RubyOnRails
[15:50:46] Cork: has joined #ruby
[15:51:51] Cork: has joined #RubyOnRails
[20:03:58] Cork: Ping timeout: 268 seconds