Page 1 of 11 | Next »
[16:57:01] xco: so how do i get Ruby to tell me “noël” is 4 characters? why can’t Ruby know the encoding and count correct?
[16:59:56] xco: Elixir conveniently provides byte_size(str) and String.length(str) so i thought there’d be something similar in Ruby
[17:02:23] xco: and Ruby’s community is big enough to have it too. if no one does it i’ll fix this! :P
[17:06:08] xco: all this while i thought Date/Time was the most complicated, i’m adding Strings to that list
[17:08:01] xco: interesting thread here https://stackoverflow.com/questions/13003287/encodingundefinedconversionerror
[17:14:17] xco: to the eye this is very confusing to someone who doesn’t know what’s going on under cover https://gyazo.com/cfe70707fe809fe51bbd9df8f7d79eb8
[10:44:46] xco: hi, i’m sort of benchmarking or trying to at least how much memory allocations a method uses. what tool can i use for that if this is possible at all
[20:53:44] xco: i have an instance variable set like say @example = “something”. and would like to pass a bunch of of these to a method. how do i get the instance variable inside the method when the names of the instance variables change, so like how so i get to pass these instance vars into a method when i have to work with another instance var called @example1?
[03:20:46] xco: i want to make some steps to create my first ruby gem. but need some thougts. is it a good idea for a gem to make an api call to some other service? are there gems like that already
[03:21:35] xco: the gem i want to make will require an API secret key which if you’er using rails you’d put the key in your initializers folder but i’m not sure if this is a good idea
[04:07:30] xco: havenwood: thanks for the response. reason i asked was i thought if i created a gem like that it’d be “odd” since i haven’t personally used a gem that makes an API call
[04:08:30] xco: yeah and ENV variable would work too, good idea i’ll keep that option in my thoughts
[04:11:27] xco: yeah prolly a private gem right? i’m yet to see a public OS gem that makes use of keys like that
[11:56:23] xco: i’m fetching data from a table to display in a paginated table in the view. what’s a good approach, with performance in mind to cache data from the database? Ideally i’d like to have just one query to the DB so i don’t have to reload the data from the DB on each navigation with the pagination. This is what i have done so far but doubt it’s the best way to go around this https://gist.github.com/xcobar/7238284eecc52efa766b7ad67330c8fd
[11:22:30] xco: i’m not interested in loading all the columns as it’ll be slow. so how do i select, say learner.name and question.expiry_date for instance?
[12:37:49] xco: shenghi: thanks. this gives me this https://gist.github.com/xcobar/977aa688df3ee173559d49690383bf83 but the problem is getting the nested columns in
[15:39:18] xco: can i do this in Ruby if i want both methods to be peformed? https://gist.github.com/xcobar/7d8f2772d806fe8dc166301a33bc411d
[15:42:36] xco: so in this case if i want to peform both methods i can do just this instead https://gist.github.com/xcobar/7d8f2772d806fe8dc166301a33bc411d
[16:08:44] xco: Hi, I have something like this in my controller https://gist.github.com/xcobar/641a85d7590ea5715951b4b8b3fcfa5b
[02:26:56] xco: is there a Rails method that can convert times in different time zones? Example given the current time in New York, it tells me what the local time in Berlin is?
[00:32:46] xco: al2o3-cr: want to review my what i was wriing? please? if you have time and willingness?
[00:56:01] xco: al2o3-cr: there’s a whole folder, runnable version here: https://www.dropbox.com/s/r63x6x2nm1xjh3u/cli.zip?dl=0
[01:01:29] xco: this makes me happy because this is the part where i write quickly to get tests to pass
[01:01:58] xco: after getting some sleeping i’ll looking into making it better/refactoring that’s why a clear pair of eyes and advise will be nice
[11:26:40] xco: so Loco would better be a module than a class right? is this for best practice or it has something to do with performance, which side that this lean towards more?
[14:18:22] xco: just to confirm, you can’t test modules with minitest right? i haven’t found any link on google concerning this, i only see “testing modules with rspec” will i be right to assume minitest can’t test modules, only classes?