Cork

Activity Graph

Page 1 of 13 | Next »

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:27:49] Cork: has joined #ruby
[15:30:01] Cork: Excess Flood
[15:30:01] Cork: has joined #RubyOnRails
[15:32:26] Cork: has joined #ruby
[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

2018-07-23

[19:42:21] Cork: Ping timeout: 265 seconds

2018-07-20

[00:07:17] Cork: *.net *.split
[00:15:26] Cork: has joined #RubyOnRails
[00:15:38] Cork: has joined #ruby

2018-07-16

[19:20:21] Cork: Ping timeout: 240 seconds
[19:42:53] Cork: has joined #ruby
[19:44:13] Cork: has joined #RubyOnRails

2018-07-09

[17:11:14] Cork: Ping timeout: 265 seconds
[17:38:11] Cork: has joined #ruby
[17:39:16] Cork: has joined #RubyOnRails
[18:57:47] Cork: has joined #RubyOnRails
[18:58:42] Cork: has joined #ruby

2018-07-04

[11:11:21] Cork: Ping timeout: 240 seconds
[11:58:01] Cork: has joined #ruby
[11:59:07] Cork: has joined #RubyOnRails

2018-07-03

[15:11:24] Cork: is it possible to get sprintf("%{base}-%03{serial}", {base: "abc", serial: 1}) to generate "abc-001"?
[15:12:13] Cork: i can't find a way to instruct it to print it as a digit (and it appears like that is needed for leading zeros)

2018-06-29

[16:09:46] Cork: *.net *.split
[16:14:17] Cork: has joined #ruby
[16:14:18] Cork: has joined #RubyOnRails

2018-06-27

[05:45:52] Cork: is there a way to "unmark" a record from destruction?

2018-06-26

[09:41:50] Cork: do ruby when have a way to write additional conditions or is nested ifs the only way?
[09:42:41] Cork: something like case variable; when "something" and other_var == 2
[11:44:45] Cork: is there a hook for modifying values given to .where() ?
[11:45:10] Cork: (before the sql query is generated)

2018-06-12

[17:10:56] Cork: has joined #RubyOnRails
[17:13:56] Cork: has joined #ruby

2018-06-01

[05:55:52] Cork: hmm in rails 5.2 errors.added?() doesn't match the message added to a validates_*_of line
[05:58:01] Cork: validates_format_of :email, with: /.../, message: :bad_format
[05:58:11] Cork: becomes .errors.details = {:email=>[{:error=>:invalid}]}

2018-05-31

[14:31:43] Cork: where do one find Arel.sql?
[14:32:06] Cork: i expected it to be somewhere like ActiveRecord::Base::Arel or something but i can't find it
[14:34:26] Cork: gah... na, NOW i see what it was.. i typoed Arel... >_<
[14:34:27] Cork: thx anyway
[14:34:42] Cork: Ariel != Arel XD

2018-05-29

[02:47:06] Cork: *.net *.split
[02:47:49] Cork: has joined #RubyOnRails
[02:48:12] Cork: has joined #ruby

2018-05-11

[12:37:29] Cork: drale2k_: you need to validate that the assosiation exists if you don't want it to be optional
[12:43:35] Cork: pause_: the object should contain the new values by default
[12:44:39] Cork: what method are you calling?
[12:45:09] Cork: Model.create!().id should be the id
[12:45:45] Cork: weird...
[12:45:50] Cork: it shouldn't
[12:49:01] Cork: depends on the database engine

2018-05-07

[14:56:31] Cork: zxq2: i question if you should use a lib that doesn't have a stable structure for there exceptions...
[14:56:43] Cork: exceptions shouldn't change more then rarely in a project...
[15:09:01] Cork: zxq2: ya, exceptions in openssl is special :)

2018-05-03

[11:54:23] Cork: i have a string output with a bunch of "<U+200B><U+200B><U+200B>" in them; can i convert that back to a "normal" string again?
[11:59:15] Cork: the raw unicode string
[12:02:25] Cork: .gsub(/\<U\+200B>/, ["0x200B".to_i(16)].pack("U")) does the job so i'm going to go with that

2018-04-25

[12:25:44] Cork: *.net *.split
[12:27:20] Cork: has joined #ruby
[12:27:34] Cork: has joined #RubyOnRails
[15:01:14] Cork: *.net *.split
[15:03:04] Cork: has joined #RubyOnRails
[15:03:16] Cork: has joined #ruby

2018-04-24

[06:23:30] Cork: i'm trying to use a c lib through fiddle but i get stuck at trying to handle a "typedef const char* knot_ctl_data_t[KNOT_CTL_IDX__COUNT];" in ruby
[06:23:46] Cork: how would one correctly handle an array of char pointers in ruby??
[08:44:49] Cork: how would one set the pointer in a Fiddle struct?
[08:50:15] Cork: dminuoso: i have Data = struct ["int op", "char* data[12]"] and want to try to set the data pointers
[08:50:54] Cork: but arg = Data.malloc; arg.data.first = "test".pack("p*") gives me error first has no setter
[08:52:42] Cork: dminuoso: http://ruby-doc.org/stdlib-2.5.0/libdoc/fiddle/rdoc/Fiddle/Importer.html#method-i-struct
[08:54:45] Cork: arg.data.first is a Fiddle::Pointer
[08:56:07] Cork: dminuoso: what do you mean?
[08:57:23] Cork: so loop the string and copy the characters
[08:59:01] Cork: if i set it with [] i start to get weird exceptions afterwards
[08:59:12] Cork: NoMethodError (undefined method `[]' for nil:NilClass)
[08:59:12] Cork: 1: from /usr/lib/ruby/2.5.0/fiddle/struct.rb:157:in `[]'
[08:59:26] Cork: everytime i start to try to access arg.data
[09:01:35] Cork: start to wonder if it wouldn't just be simpler to write to the socket directly instead of through this damn lib...

2018-04-23

[13:36:40] Cork: how would one import an enum with fiddle::importer?
[13:37:06] Cork: a c typedef
[13:37:32] Cork: fiddle is for importing libs from c in ruby
[13:38:59] Cork: that would explain why i fail XD
[13:39:06] Cork: ok so just create it as a new struct then
[13:39:29] Cork: arne: thx
[13:39:38] Cork: ya, this isn't meant to be for debug :)

2018-04-09

[22:04:02] Cork: has joined #ruby
[22:09:57] Cork: has joined #RubyOnRails

2018-04-05

[08:21:35] Cork: has joined #RubyOnRails
[08:22:35] Cork: has joined #ruby
[08:28:03] Cork: Ping timeout: 248 seconds
[08:32:03] Cork: has joined #RubyOnRails
[08:34:03] Cork: has joined #ruby
[13:57:27] Cork: you would have to exclude text nodes inside an a element