siaw23

Activity Graph

Page 1 of 4 | Next »

2018-11-01

[00:56:30] siaw23: Quit: siaw23
[01:20:54] siaw23: has joined #ruby
[01:58:15] siaw23: Quit: siaw23
[02:22:31] siaw23: has joined #ruby
[02:22:34] siaw23: Client Quit

2018-10-31

[22:28:20] siaw23: has joined #ruby
[22:29:51] siaw23: hello fine people. so i have something like this https://gist.github.com/siaw23/9b316a26ec85b858ac91387a9bed5a7b and i understand Ruby’s has a new feature to simplify this (with #yield_self or #then) can anyone help me with this?
[22:30:41] siaw23: i know i can do that Radar :D
[22:30:51] siaw23: can i use #then for this?
[22:31:12] siaw23: i just want to learn about its usage
[22:31:37] siaw23: maybe this is not the best use case for it then i’d undersand :)
[22:32:27] siaw23: thanks a lot :)

2018-10-23

[17:47:50] siaw23: has joined #ruby
[17:48:55] siaw23: good eve everyone! what’s be the easiest way to grab the second string. eg: “some cat”
[17:49:00] siaw23: i want to grab “cat” only
[17:49:05] siaw23: currently i’m using
[17:49:14] siaw23: string[] which i don’t want to
[17:49:22] siaw23: will there be an easier way?
[17:50:19] siaw23: so the way i’m doing it is like string[first_string.length + 1, string.length - first_string + 1]
[17:50:32] siaw23: which is too long and i feel there’s an easier way
[17:53:49] siaw23: woodruffw: sounds like a good idea
[17:59:14] siaw23: yeah got it
[18:41:36] siaw23: Quit: siaw23
[18:43:32] siaw23: has joined #ruby
[18:43:44] siaw23: has left #ruby: ()

2018-09-19

[01:15:47] siaw23: Quit: siaw23

2018-09-18

[19:39:10] siaw23: has joined #ruby
[19:40:17] siaw23: hi i have an array like this [1, 4, 3, 5, 7, 10] is there a way i can iterate it in pairs like so [1,4], [4,3], [3,5], [5,7], [7,10]
[19:43:54] siaw23: yeah each_cons is what i was looking for!!!
[19:43:58] siaw23: havenwood: thank you!!!
[19:44:30] siaw23: al2o3-cr: each_slice is too easy :P trie working with that but knew there was something better
[19:44:39] siaw23: thanks guys
[19:48:10] siaw23: havenwood is like one of those guys that have the whole ruby doc inscribed on their brain

2018-09-13

[05:47:58] siaw23: has joined #ruby
[06:11:58] siaw23: Quit: siaw23

2018-09-12

[15:27:06] siaw23: has joined #ruby
[15:27:14] siaw23: hi i have a hash that looks like this
[15:27:25] siaw23: {:hostname=>”siaw23’s-MacBook-Pro.local", :cpu_avg=>"1.49%", :disk_usage=>"26.93%", :mem_usage=>"644", :check_time=>"12-09-2018 17:58"}
[15:27:33] siaw23: and an array that looks like this
[15:27:39] siaw23: ["hostname", "disk_usage"]
[15:28:10] siaw23: is there a way i can get a hash back but only of the keys in the array?
[15:28:36] siaw23: in other words how do i get a hash back that looks like
[15:28:57] siaw23: {:hostname=>”siaw23’s-MacBook-Pro.local", :disk_usage=>"26.93%”}
[15:31:01] siaw23: canton7: i had done that exactly
[15:31:09] siaw23: but i looks it didn’t work
[15:31:11] siaw23: now i know the reason
[15:31:24] siaw23: i had to convert the array of strings to symbols for it to work :D
[15:33:14] siaw23: canton7: yep. that should work thanks )
[15:51:06] siaw23: Ping timeout: 252 seconds
[15:54:50] siaw23: has joined #ruby
[16:16:57] siaw23: I have something like this YAML.load_file('some_file.yml')
[16:17:16] siaw23: this loads the file once, is there way i can load the file on demand?
[16:17:26] siaw23: something similar to Rails’ ‘load’ method
[16:17:49] siaw23: im’ using this in a sinatra app and i want to be able to load the file without starting the sinatra server
[16:18:40] siaw23: i tried using a proc and calling it each time i needed but doesn’t work, any ideas that’d work?
[16:44:52] siaw23: apeiros: well in my simple sinatra app, a yaml file with {“foo” => “bar} is load when i start the sinatra server, while the server is on, change to {“foo” => “foo”} doesn’t reflect the change until the server is restarted
[16:44:55] siaw23: this is what i meant
[16:51:55] siaw23: Quit: siaw23
[16:57:13] siaw23: has joined #ruby
[16:59:55] siaw23: havenwood: i can share the repo :)
[20:28:12] siaw23: Quit: siaw23
[20:40:15] siaw23: has joined #ruby
[22:12:38] siaw23: Quit: siaw23

2018-08-31

[09:28:34] siaw23: has joined #ruby
[09:29:26] siaw23: hi, has Ruby got some inbuilt libary that can tell free space left on disk/cpu usage/ram usage?
[09:29:42] siaw23: if not, what’s the be external library for such things?
[10:01:54] siaw23: has left #ruby: ()

2018-08-04

[00:06:44] siaw23: has left #RubyOnRails: ()
[00:06:44] siaw23: has left #ruby: ()

2018-08-03

[22:28:10] siaw23: has joined #ruby
[22:28:49] siaw23: has joined #RubyOnRails
[22:30:01] siaw23: Hi, is there a way I can open the Array class on my machine, check all array objects and perform #freeze on them?
[22:30:35] siaw23: i mean i know how to open the Array class, i’m not sure how to assign array objects and freeez/unfreeze them
[22:35:06] siaw23: actually i just want to unfreeze arrays
[22:35:36] siaw23: i’m working with a gem that gives me this error:
[22:35:37] siaw23: FrozenError:
[22:35:38] siaw23: can't modify frozen Array
[22:35:51] siaw23: so i want to unfreeze them temporily
[22:35:57] siaw23: to help me debug what’s going on
[22:36:23] siaw23: just to see if it cleas the FrozenError, then i can know what to do

2018-06-11

[17:40:52] siaw23: has joined #RubyOnRails
[17:42:24] siaw23: Client Quit
[17:43:07] siaw23: has joined #RubyOnRails
[18:18:41] siaw23: Quit: siaw23

2017-04-08

[17:35:25] siaw23: has joined #ruby
[17:36:24] siaw23: why am i getting “no block given” error here: https://i.gyazo.com/cfc019fb5b3f026b4f190ce1cda2308b.png
[17:42:29] siaw23: havenwood: works. the block_given would in my case be my_method do …. right?
[17:43:20] siaw23: i thought yield will always find the block itself provided the name of the block and method match
[17:45:14] siaw23: elomatreb: thank you
[17:45:29] siaw23: matthewd: got it
[20:00:14] siaw23: Quit: siaw23
[20:01:00] siaw23: has joined #ruby
[20:01:04] siaw23: Client Quit

2017-03-16

[04:47:04] siaw23: has joined #RubyOnRails
[04:47:31] siaw23: hi, need some guidance. trying to run a migration. but I don’t know why it’s failing with this: https://gist.github.com/siaw23/80ee957fe9642bf410eb71fa87339ef1#file-migrate-txt-L8
[04:48:54] siaw23: why is trying to find an Event with an ‘id’? and looking for an id that’s a path some rails file?
[04:52:42] siaw23: itsgokul: if i were you i’d create a new migration file with up/down methods and run that instead
[04:54:11] siaw23: itsgokul: generate a migration file
[04:54:16] siaw23: and run it
[04:54:58] siaw23: itsgokul: http://stackoverflow.com/questions/4834809/adding-a-column-to-an-existing-table-in-a-rails-migration
[06:09:11] siaw23: Quit: siaw23

2016-07-30

[15:16:27] siaw23: has joined #RubyOnRails
[15:31:04] siaw23: Quit: siaw23
[19:07:51] siaw23: has joined #RubyOnRails
[19:43:29] siaw23: Read error: Connection reset by peer
[20:59:40] siaw23: has left #RubyOnRails: ()

2016-07-29

[00:28:21] siaw23: has joined #RubyOnRails
[01:10:02] siaw23: Quit: siaw23
[08:03:55] siaw23: has joined #RubyOnRails
[08:04:12] siaw23: good morning
[08:04:17] siaw23: if someone can help: http://stackoverflow.com/questions/38648105/model-attribute-not-being-serialized-with-activemodelserializer
[08:23:42] siaw23: universa1: i don’t fully understand serializers. but i don’t know why it’s not showing the attributes i want anyway.
[09:39:38] siaw23: the serializer is fired when a request to a model instance is made? no?
[09:40:20] siaw23: universa1: it’s at this point the serializer is supposed to add the attributes to the model, it’s not doing that
[09:45:52] siaw23: when new items are being posted
[09:45:56] siaw23: new models
[09:47:51] siaw23: when a request is made for json data of a model
[09:47:59] siaw23: get request in this case
[09:49:07] siaw23: now i see that it doesn't
[09:50:22] siaw23: but i still don’t know why the serializer won’t show parameters that were set in a model
[09:51:56] siaw23: universa1: on it
[09:56:38] siaw23: universa1: https://gist.github.com/siaw23/bb2c28fb66a63433d4d91540c56a0522
[09:57:59] siaw23: universa1: failing test is on https://gist.github.com/siaw23/bb2c28fb66a63433d4d91540c56a0522#file-api_notice_search_spec-rb-L216 and some info from pry showing the empty array that i don’t expect to be empty https://gist.github.com/siaw23/bb2c28fb66a63433d4d91540c56a0522#file-pry-txt
[09:59:15] siaw23: yes it’s empty
[10:00:30] siaw23: universa1: let me check that one
[10:02:58] siaw23: it’s NOT empty! :o
[10:03:09] siaw23: pry(#<RSpec::ExampleGroups::SearchingForNoticesViaTheAPI::CourtOrder>)> instance.regulation_list
[10:03:10] siaw23: => ["Foo bar 21", "Baz blee 22"]
[10:04:43] siaw23: i’m not sure how to use pry here
[10:04:58] siaw23: yes i know that. but how to run it to see the result
[10:05:49] siaw23: right. checking
[10:08:09] siaw23: universa1: that is empty https://i.gyazo.com/502ff6667124f7ccebd01dab26f7d5ad.png
[10:08:32] siaw23: and i have absolutely NO clue why it empty
[10:10:14] siaw23: universa1: https://i.gyazo.com/eacf9f85b497bd0f14f4832cbaa1f4f2.png it’s not even shoing the attribute i’m looking for
[10:12:53] siaw23: universa1: https://i.gyazo.com/b255ddb133094db7ec17390e73201133.png not there
[10:14:48] siaw23: universa1: https://gyazo.com/9c3c6360e0518777f02c2e0419331eaf
[10:15:45] siaw23: universa1: no. it’s not there. i thought there’s a way to choose which attributes to serialize
[10:16:07] siaw23: does that mean i have to have a regulation_list column?
[10:17:57] siaw23: but maybe i don’t necessary need a column in the db? what if i could use “virtual” attributes
[10:20:57] siaw23: universa1: from forms
[10:24:10] siaw23: universa1: i’d look for court_order with idea 1053, check what attributes are serialized and return them
[10:25:47] siaw23: ummm a virtual attribute won’t be saved in the db as far as i understand
[10:27:05] siaw23: universa1: now i get the whole point! :D :D
[15:02:21] siaw23: Quit: siaw23
[16:23:05] siaw23: has joined #RubyOnRails
[20:04:17] siaw23: Quit: siaw23

2016-07-28

[20:50:14] siaw23: has joined #RubyOnRails
[20:51:44] siaw23: i don’t really know how model serializers work in details but i’m expecting some items to be add in an array abut the array turns up empty https://gist.github.com/siaw23/2337f03777476b48c79ebe9fb37dac62#file-api_notice_spec-rb-L18 any help? all related files are here: https://gist.github.com/siaw23/2337f03777476b48c79ebe9fb37dac62
[21:08:20] siaw23: i don’t really know how model serializers work in details but i’m expecting some items to be add in an array abut the array turns up empty https://gist.github.com/siaw23/2337f03777476b48c79ebe9fb37dac62#file-api_notice_spec-rb-L18 any help? all related files are here: https://gist.github.com/siaw23/2337f03777476b48c79ebe9fb37dac62
[23:01:59] siaw23: if someone can help: http://stackoverflow.com/questions/38648105/model-attribute-not-being-serialized-with-activemodelserializer
[23:02:12] siaw23: or knows someone who can, please share with him. thanks :)
[23:18:49] siaw23: Quit: siaw23

2016-07-27

[03:16:34] siaw23: has joined #RubyOnRails
[13:30:37] siaw23: Quit: siaw23

2016-07-26

[14:44:36] siaw23: has joined #RubyOnRails
[14:44:52] siaw23: how can i make a rails model respong to #size?
[16:59:48] siaw23: Ping timeout: 276 seconds

2016-07-22

[12:59:20] siaw23: has joined #RubyOnRails
[12:59:53] siaw23: maybe someone knows rails and react and wants to help? http://stackoverflow.com/questions/38411542/submitting-a-form-to-rails-with-reactjs
[15:43:35] siaw23: has left #RubyOnRails: ()

2016-07-21

[00:05:35] siaw23: Quit: siaw23
[07:40:00] siaw23: has joined #RubyOnRails
[08:07:56] siaw23: sure how to fix it. i want to get rid of this failure: https://gist.github.com/siaw23/81df4e42be649380dc780daf5daf9e5a#file-failure-txt
[08:07:56] siaw23: morning, in the console when i do something like notice.title (for a model where “notice” is a Notice object) i get a title. but my test is failing with “undefined method `title' for nil:NilClass” https://gist.github.com/siaw23/81df4e42be649380dc780daf5daf9e5a i need some help i believe the error is on this line https://gist.github.com/siaw23/81df4e42be649380dc780daf5daf9e5a#file-spec-rb-L37 where 'notice' is nil. but I am not
[08:12:09] siaw23: and @youtube_otherlegal_notice as well
[08:12:25] siaw23: hahaha i want to know how to fix it. i need help :p
[08:12:33] siaw23: i don’t know how to
[08:24:54] siaw23: is my use of binding.pry correct? https://gist.github.com/siaw23/54130345db8d1b9b98c5a4648e873ff7#file-pry-rb-L38 because i’m not getting a return value, it’s just showing a section of my test file. nothing more. https://gist.github.com/siaw23/54130345db8d1b9b98c5a4648e873ff7#file-pry-rb-L38
[08:33:23] siaw23: i placed it here now https://gist.github.com/siaw23/54130345db8d1b9b98c5a4648e873ff7#file-pry-rb-L31 and then did this: https://gist.github.com/siaw23/54130345db8d1b9b98c5a4648e873ff7#file-console-txt and i see my @youtube_counterfeit_notice is nil
[08:36:36] siaw23: tbuehlmann: oops. again? how do i know a good place to put it?
[08:40:47] siaw23: tbuehlmann: i place it here: https://gist.github.com/siaw23/54130345db8d1b9b98c5a4648e873ff7#file-pry-rb-L25 and i get and empty array when i do Trademark.order(:id)
[08:44:29] siaw23: tbuehlmann: can you please give me a clue? on why it’s returning [], which i don’t expect?
[08:45:37] siaw23: sevenseacat: nope. i want help
[08:47:05] siaw23: tbuehlmann: i expect it to return an instance of a Notice model
[08:47:42] siaw23: sevenseacat: because down in the test there’s “notice.title”. “title” is an attribute on a Notice model
[08:48:02] siaw23: which i can call and have a title (string) returned in rails console
[08:50:58] siaw23: sevenseacat: with “down in the test” i meant a line like https://gist.github.com/siaw23/54130345db8d1b9b98c5a4648e873ff7#file-pry-rb-L43
[10:41:59] siaw23: has left #RubyOnRails: ()

2016-07-20

[22:43:30] siaw23: has joined #RubyOnRails
[22:44:56] siaw23: in the console when i do something like notice.title (for a model where “notice” is a Notice object) i get a title. but my test is failing with “undefined method `title' for nil:NilClass” https://gist.github.com/siaw23/81df4e42be649380dc780daf5daf9e5a i need some help
[22:54:36] siaw23: jhass: no where else
[22:55:14] siaw23: jhass: @youtube_otherlegal_notice is only in that spec
[22:57:00] siaw23: how should it be written? and why do you think that’s the cause of the #title method on Notice object not being defined?
[22:58:37] siaw23: yeap i know i have nil
[23:00:01] siaw23: i was looking for where “notice” is instantiated instead
[23:00:09] siaw23: since it’s returning nil
[23:02:59] siaw23: jhass: i’m lost :(
[23:03:29] siaw23: the error says: NoMethodError:
[23:03:30] siaw23: undefined method `title' for nil:NilClass
[23:03:52] siaw23: and the only place #title is called is on notice.title
[23:04:24] siaw23: meaning i have to make @youtube_otherlegal_notice an instance of Notice
[23:06:24] siaw23: jhass: i see this being created https://gist.github.com/siaw23/81df4e42be649380dc780daf5daf9e5a#file-spec-rb-L21

2016-07-15

[04:49:04] siaw23: has joined #RubyOnRails
[04:49:14] siaw23: if someone can help http://stackoverflow.com/questions/38388028/component-rendering-with-react-in-rails-not-working
[04:57:24] siaw23: i got that line from the example the gem gives on github
[04:57:59] siaw23: Radar: from here: https://github.com/reactjs/react-rails#rendering-components-instead-of-views
[05:01:33] siaw23: matthewd: from the server https://gist.github.com/siaw23/3423aa1ca8e83c03557d62ada77ee7ea
[05:08:43] siaw23: but if i remove therubyracer gem i’m getting this: https://gist.github.com/siaw23/3423aa1ca8e83c03557d62ada77ee7ea
[06:10:38] siaw23: Quit: siaw23
[07:20:25] siaw23: has joined #RubyOnRails
[08:18:39] siaw23: has left #RubyOnRails: ()
[12:36:04] siaw23: has joined #RubyOnRails
[12:37:23] siaw23: : i’m using react with reails can someone tell me why i’m getting this: https://gyazo.com/7130fdab2bd4c691f7d9ab479de40b55
[12:37:31] siaw23: my files are here (that answer fixes old problem) http://stackoverflow.com/questions/38388028/component-rendering-with-react-in-rails-not-working
[13:51:03] siaw23: has left #RubyOnRails: ()

2016-07-14

[16:39:38] siaw23: has joined #RubyOnRails
[16:41:40] siaw23: i’m starting to play with rails and json/api stuff. can someone explain why this URL returns an array instead of a “PURE” json object? https://gyazo.com/52be77c321c022a0f7677d2b5b350ebb
[17:57:24] siaw23: has left #RubyOnRails: ()

2016-07-10

[21:07:38] siaw23: has joined #RubyOnRails
[21:08:44] siaw23: Client Quit
[21:09:11] siaw23: has joined #RubyOnRails
[21:12:54] siaw23: Client Quit

2016-07-08

[02:38:39] siaw23: has joined #RubyOnRails
[02:38:40] siaw23: Client Quit

2016-07-07

[10:34:33] siaw23: can anyone help me get rid of these deprecation messages? https://gist.github.com/siaw23/58167615059f2930a47d7e9616d7fdb7
[10:37:53] siaw23: dminuoso: https://gist.github.com/siaw23/58167615059f2930a47d7e9616d7fdb7
[10:48:01] siaw23: got this in my gemfile lock shoulda-matchers (3.1.1)
[10:48:49] siaw23: yes i know this is a hard one. i have spent weeks on this
[18:59:49] siaw23: Quit: siaw23

2016-07-06

[07:08:03] siaw23: Quit: siaw23
[07:08:40] siaw23: has joined #RubyOnRails
[22:22:28] siaw23: Quit: siaw23
[23:41:56] siaw23: has joined #RubyOnRails
[23:42:40] siaw23: hello how do i get rid of these deprecation warnings? https://gist.github.com/siaw23/58167615059f2930a47d7e9616d7fdb7

2016-07-05

[05:31:53] siaw23: has joined #RubyOnRails
[19:19:36] siaw23: Quit: siaw23
[22:33:42] siaw23: has joined #RubyOnRails
[23:28:11] siaw23: Quit: siaw23
[23:29:09] siaw23: has joined #RubyOnRails

2016-07-04

[17:29:10] siaw23: Quit: siaw23
[17:49:54] siaw23: has joined #RubyOnRails
[22:50:03] siaw23: Quit: siaw23