#ruby - 15 March 2019
« Back 1 day Forward 1 day »
[00:01:22] elcontrastador: Why the startup latency when executing from gem compared to running script as argument to ruby? See timings below each example. https://gist.github.com/elcontrastador/44f6beed60246296616f610c5025990a
[00:07:04] elcontrastador: This is similar startup latency on the linux server this is deployed to, as well.
[00:08:18] elcontrastador: aws-sdk gemset is huge....only using aws-sdk-s3 but will have to look at all that pulls in or references
[00:08:24] zenspider: might depend on too many things that I won't speculate on. depends on what log2s3.rb is doing, how it loads its dependencies, etc.
[00:09:46] zenspider: `ruby -d` prints out ALL exceptions, even if they're handled... so don't freak out at the noise
[00:12:35] zenspider: might be something really stupid tho... run it locally, it might load locally. who knows. you're gonna have to dig in an dread
[00:13:33] elcontrastador: yeah... first pass groking thru outputs look similar/identical....will get into it
[05:23:26] havenwood: In traditional font size names Pearl is 5 points, Ruby is 5.5 and Nonpareil is 6.
[05:24:10] havenwood: Or just skip to 28 points, Double English. I speak English, and program in Double English.
[13:08:51] TomyWork: # require 'date'; DateTime.parse('2019-03-15 13:01:11 UTC').strftime('%F %T') # How can I make this display times in the local time zone?
[13:09:44] TomyWork: local time zone = the system's configured time zone, basically whatever the "date" bash command shows
[13:58:14] kke: is there some neat way to "cyclically" (rolling?) get an item from an array? like let's say i have KEY = [1, 2, 3, 4, 5]. something clever to make something like KEY.cyclical(5) point to KEY, KEY.cyclical(6) to KEY, KEY.cyclical(11) to KEY
[13:58:47] kke: well that method shouldn't be that difficult. i'm just thinking there's probably some trick i can't think of how this could be done with science.
[14:02:43] TomyWork: >> require 'date'; DateTime.parse('2019-03-15 13:01:11 UTC').strftime('%F %T') # How can I make this display times in the local time zone?
[15:10:37] ngw: does anybody have any idea how to solve this? https://stackoverflow.com/questions/55168878/decrypting-keys-from-aws-kms-in-ruby
[17:04:13] rubydoc: stderr: -e:2:in `<main>': uninitialized constant Hacker (NameError) (https://carc.in/#/r/6i6o)
[18:21:46] phaul: I'm doing a bulk import of 'stuff about 200_000_000 of them in a loop.. I think it's a good candidate for it
[20:27:49] DWSR: Hey all, I'm trying to build a Docker container for my company's Rails 22.214.171.124 app. I'm trying to precompile assets in the container build (rather than before), but I'm running into some issues with initializers that are reaching out to things like MySQL or Redis which is not ideal. I noticed that 'initialize_on_precompile' was removed in Rails 4.1. What's the recommended way to deal with this situation?
[20:29:41] za1b1tsu: so regarding irb, there is this option:--single-irb Share self with sub-irb. Does anyone know what this is about, an example? Can't find anything on google
[20:39:05] leftylink: za1b1tsu: in irb, I do `a = 5`, then I do `irb`, that is a sub-irb. In the sub-irb, what happens if I ask for `a` ? Without flag, it is not defined, NameError. With flag, it is defined (it is 5)
[20:42:15] leftylink: I hope it was clear. if not, maybe a quick log of my session will help, https://dpaste.de/PHbz/raw
[20:46:49] za1b1tsu: leftylink, wow ok, I never knew I could start irb within irb, what's the usecase? how could it be useful to start irb in irb?
[20:47:36] zenspider: za1b1tsu: it's like starting a subshell... not terribly useful imo, but sometimes it is nice to have a stack to push/pop
[20:48:39] zenspider: and I guess... the single-irb flag means that it is NOT like a subshell, and more like a dynamically scoped (Or non-scoped?) language.
[20:58:47] zenspider: dar123: doesn't matter if you update the OS if your app has gaping holes in it
[20:59:46] debajit: I'm looking for a data structure / entity that will let me share some state across multiple threads. It looks like I could use Concurrent::Map or an Concurrent::Atom for this. Both reads and writes will be frequent. What is the best Concurrent Ruby solution I could use for this problem?
[21:04:48] zenspider: if you need to pipeline workers, for example, then queue is perfectly sufficient. If you need some sort of shared mutable state object (which always feels like a bad idea to me), then you'll need something else. Even just a proxy wrapper with a mutex could work, but ... this way madness yadda yadda
[21:36:16] robotcars: i am trying to iterate over a folder of yml files that contain intelligent guess of csv data, and update the columns in the yml (c0,c1,c3) with the headers of a csv template
[21:36:35] ruby[bot]: robotcars: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[21:50:07] ruby[bot]: robotcars: How to ask the right questions to get you the right answer: https://www.mikeash.com/getting_answers.html
[21:58:23] leftylink: note that as we can see from https://ruby-doc.org/core-2.5.0/File.html#method-c-open , the file is passed to the block. no other assumptions are made about the block. if the block needs to do something to the file, then it is obligated to do so by using the appropriate operations on the file
[22:13:38] zenspider: meh... I'm simply not patient enough to help out in this case. not while I still have a new gem release to do
[22:38:12] zenspider: ruby_parser-legacy 1.0.0 released... finally. I'm so glad to get that off my plate
[23:16:13] physikoi: hello #ruby , I'm suddenly getting a bunch of "make" errors. Even after wiping my gems, I get errors like this: "... make: *** No rule to make target ...". Thoughts? ty
[23:43:19] miah: is there a Makefile in your directory? make isn't really related to ruby in any way.
[23:46:33] physikoi: hey miah : full error: "make: *** No rule to make target `/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `ruby_http_parser.o'. Stop."
[23:48:23] miah: (as it looks like you're using the system ruby and its going to rely on the xcode dev kit stuff)
[23:50:38] physikoi: yeah, i do. did that stuff a while ago because I use macports for most stuff. any other possibilities spring to mind?