domgetter

Activity Graph

Page 1 of 5 | Next »

2019-01-01

[04:01:07] domgetter: has joined #ruby
[04:01:54] domgetter: Is there a way to pipe to irb? e.g. echo -e "hello\nworld" | irb
[04:02:34] domgetter: If I have to do it with something like ruby -r irb -e "require 'irb'" or the like, that's fine too, I just couldn't find any working examples online
[11:11:12] domgetter: Quit: http://www.kiwiirc.com/ - A hand crafted IRC client

2017-08-07

2017-08-05

[01:17:48] domgetter: has joined #ruby
[07:32:40] domgetter: Ping timeout: 276 seconds
[11:41:09] domgetter: has joined #ruby

2017-08-04

[03:14:03] domgetter: has joined #ruby
[03:15:10] domgetter: reduction duction, what's your function?
[03:15:41] domgetter: baweaver I just call it a "running total"
[03:18:55] domgetter: hays__ every method can receive one block in Ruby
[03:40:36] domgetter: Ping timeout: 260 seconds
[10:00:35] domgetter: has joined #ruby
[20:33:34] domgetter: Ping timeout: 276 seconds

2017-08-03

[01:07:37] domgetter: Ping timeout: 246 seconds
[07:55:34] domgetter: has joined #ruby
[19:33:16] domgetter: Ping timeout: 258 seconds

2017-08-02

[09:04:12] domgetter: Ping timeout: 260 seconds
[11:07:27] domgetter: has joined #ruby
[11:41:42] domgetter: Ping timeout: 260 seconds
[14:12:17] domgetter: has joined #ruby

2017-08-01

[03:11:02] domgetter: has joined #ruby
[05:57:17] domgetter: Ping timeout: 260 seconds
[10:43:05] domgetter: has joined #ruby
[16:59:08] domgetter: Ping timeout: 260 seconds
[23:46:18] domgetter: has joined #ruby

2017-07-31

[05:49:27] domgetter: Ping timeout: 260 seconds
[11:04:51] domgetter: has joined #ruby
[15:50:24] domgetter: Ping timeout: 260 seconds

2017-07-29

[06:28:44] domgetter: Ping timeout: 260 seconds
[11:55:09] domgetter: has joined #ruby
[14:05:08] domgetter: Ping timeout: 260 seconds
[16:47:44] domgetter: has joined #ruby
[18:42:48] domgetter: Ping timeout: 260 seconds
[22:37:49] domgetter: has joined #ruby

2017-07-28

[03:43:28] domgetter: Ping timeout: 240 seconds
[07:52:05] domgetter: has joined #ruby
[11:24:42] domgetter: Ping timeout: 260 seconds
[20:22:39] domgetter: has joined #ruby

2017-07-27

[09:09:34] domgetter: Ping timeout: 246 seconds
[20:44:02] domgetter: has joined #ruby

2017-07-26

[09:04:52] domgetter: Ping timeout: 276 seconds
[20:54:34] domgetter: has joined #ruby

2017-07-25

[19:12:51] domgetter: has joined #ruby

2017-07-02

[03:19:14] domgetter: has joined #ruby
[03:57:53] domgetter: Ping timeout: 248 seconds
[05:19:13] domgetter: has joined #ruby
[08:45:05] domgetter: Ping timeout: 240 seconds
[18:33:39] domgetter: has joined #ruby
[23:11:37] domgetter: Ping timeout: 260 seconds

2017-07-01

[00:23:20] domgetter: Ping timeout: 240 seconds
[03:09:47] domgetter: has joined #ruby
[04:50:44] domgetter: Ping timeout: 260 seconds
[08:20:49] domgetter: has joined #ruby
[12:55:08] domgetter: Ping timeout: 260 seconds

2017-06-30

[05:21:31] domgetter: has joined #ruby
[10:25:27] domgetter: Ping timeout: 268 seconds
[20:16:58] domgetter: has joined #ruby

2017-06-29

[04:52:18] domgetter: has joined #ruby
[08:13:25] domgetter: Ping timeout: 255 seconds
[18:24:15] domgetter: has joined #ruby
[22:52:12] domgetter: Ping timeout: 260 seconds

2017-04-21

[05:51:30] domgetter: has joined #ruby
[14:03:40] domgetter: Ping timeout: 240 seconds
[17:05:49] domgetter: has joined #ruby

2017-04-20

[04:29:17] domgetter: has joined #ruby
[20:43:09] domgetter: Ping timeout: 240 seconds

2017-04-19

[20:08:39] domgetter: Ping timeout: 268 seconds

2017-04-18

[02:55:14] domgetter: has joined #ruby
[09:52:10] domgetter: Ping timeout: 240 seconds
[13:38:18] domgetter: has joined #ruby

2017-04-17

[09:40:46] domgetter: Ping timeout: 258 seconds
[14:26:19] domgetter: has joined #ruby
[17:50:35] domgetter: Ping timeout: 240 seconds

2017-04-16

[01:50:34] domgetter: has joined #ruby
[16:16:11] domgetter: Ping timeout: 240 seconds
[23:46:04] domgetter: has joined #ruby

2017-04-15

[10:46:41] domgetter: Ping timeout: 240 seconds
[18:35:21] domgetter: has joined #ruby
[19:00:18] domgetter: Ping timeout: 260 seconds

2017-04-14

[00:03:54] domgetter: has joined #ruby
[14:50:44] domgetter: Ping timeout: 252 seconds
[20:58:34] domgetter: has joined #ruby

2017-04-13

[05:53:00] domgetter: Ping timeout: 260 seconds
[08:29:26] domgetter: has joined #ruby
[16:15:22] domgetter: Ping timeout: 255 seconds

2017-04-12

[07:05:01] domgetter: Ping timeout: 255 seconds
[07:59:41] domgetter: has joined #ruby
[08:04:21] domgetter: Ping timeout: 245 seconds
[08:27:39] domgetter: has joined #ruby
[08:39:48] domgetter: Ping timeout: 268 seconds
[08:50:08] domgetter: has joined #ruby
[13:13:07] domgetter: Ping timeout: 260 seconds
[21:55:13] domgetter: has joined #ruby

2017-04-11

[05:25:50] domgetter: has joined #ruby
[14:50:11] domgetter: Ping timeout: 240 seconds
[23:53:33] domgetter: has joined #ruby

2017-03-19

[00:24:47] domgetter: has joined #ruby
[10:24:11] domgetter: Ping timeout: 268 seconds

2016-07-27

[03:04:32] domgetter: has joined #ruby
[09:15:09] domgetter: Ping timeout: 260 seconds
[14:37:46] domgetter: has joined #ruby
[14:38:23] domgetter: Client Quit

2016-07-18

[22:36:36] domgetter: has joined #ruby
[22:37:05] domgetter: Is there any way to return a non-array from #to_a without modifying Ruby source?
[22:40:22] domgetter: class Array; def to_a; "sure"; end; end; puts(*[]) # I should have clarified for the purpose of the splat operator
[22:40:40] domgetter: It works if you call to_a yourself, but not when you use the splat
[22:59:02] domgetter: eam: https://eval.in/607359 Here's an example of trying to use splat with Regexp
[23:08:45] domgetter: Quit: http://www.kiwiirc.com/ - A hand crafted IRC client

2016-06-09

[17:26:05] domgetter: has joined #ruby
[17:26:08] domgetter: Client Quit

2016-06-08

[01:54:12] domgetter: Ping timeout: 250 seconds

2016-06-07

[14:13:35] domgetter: has joined #ruby

2016-06-06

[00:25:42] domgetter: What is ruby-install?
[01:31:02] domgetter: wolffles are you having trouble getting it installed, or are you having trouble getting it to post?
[01:34:40] domgetter: Could be that Craigslist changed something in the last 2 years which broke this. No idea
[01:38:44] domgetter: What's the error?
[01:40:06] domgetter: wolffles in the future, use gist.github.com to post several lines at once
[01:42:02] domgetter: Well, what I would do next is use pry to find out where the code stops doing what I expect, and follow the calls through the gem
[01:42:26] domgetter: since the gem is installed as source code, you can just keep dropping binding.pry throughout it
[02:02:46] domgetter: pilne Ruby has concurrency. Did you mean parallelism?
[02:04:18] domgetter: pilne here is the tweet you may be looking for: https://twitter.com/yukihiro_matz/status/495219763883163648
[02:41:05] domgetter: pilne: remember: concurrency is when two people have to share a pencil. Parallelism is when there are two pencils
[06:31:39] domgetter: Ping timeout: 250 seconds
[12:17:42] domgetter: has joined #ruby
[12:32:02] domgetter: But hanmac, it was an activerecord question, not a rubyonrails question! /s
[12:35:15] domgetter: Concerns Considered Concerning
[12:45:13] domgetter: I know what an assignee is in contract law, but not in Ruby. Do you have a resource I can read up on? I just grepped for it in Metaprogramming Ruby and nothing came up.
[13:12:06] domgetter: norc: class Fixnum; alias :oldsum :+; def +(o); if rand < 0.001; 0; else; self.oldsum(o); end; end; end #not evil at all, I promise
[17:55:04] domgetter: Ping timeout: 264 seconds

2016-06-05

[09:39:52] domgetter: has joined #ruby
[10:47:05] domgetter: Everything happens somewhen else
[12:48:22] domgetter: arif__ so you'd want "a the b the c the d the e the f the g the h the i the j the k" to become "a the b the c d the e the f g the h the i j the k" ?
[13:07:48] domgetter: I was gonna help them, but they ran off...
[16:19:40] domgetter: Ping timeout: 264 seconds
[20:28:16] domgetter: has joined #ruby
[21:08:22] domgetter: jokke are you looking for Ruby solutions or tools that people generally use? I've seen a lot of htop usage for unix systems
[22:16:35] domgetter: Remote host closed the connection
[22:16:54] domgetter: has joined #ruby

2016-06-04

[02:15:25] domgetter: has joined #ruby
[02:46:41] domgetter: Ping timeout: 244 seconds
[04:31:36] domgetter: has joined #ruby
[06:17:37] domgetter: Ping timeout: 260 seconds
[12:21:44] domgetter: has joined #ruby
[13:51:17] domgetter: hanmac: Rails is the reason: http://apidock.com/rails/Enumerable/sum
[13:52:40] domgetter: hanmac: ? http://ruby-doc.org/core-2.3.1/Array.html#method-i-sort_by-21
[13:53:18] domgetter: Is it on master?
[13:56:36] domgetter: hanmac: Is that a recent change? Both my rubies return the value, not an array containing the value
[13:56:56] domgetter: ooh, "create" an array
[13:57:13] domgetter: you meant that it doesn't create an intermediate one
[14:00:19] domgetter: Did we solve the "Sufficiently smart interpreter" problem??
[14:15:10] domgetter: I still think we should make Numeric#to_f return the number in Fahrenheit
[23:58:40] domgetter: Ping timeout: 264 seconds

2016-06-03

[07:58:34] domgetter: has joined #ruby
[08:00:16] domgetter: I only parse strings that speak American!
[13:17:45] domgetter: Ping timeout: 276 seconds
[15:34:15] domgetter: has joined #ruby
[15:53:56] domgetter: ironcamel: that's a very old version of Ruby
[15:56:11] domgetter: You can't petition for an upgrade? You could point out that Ruby 1.8 is EOL, Ruby 1.9 is EOL, and that 2.0 will be EOL soon, and that you need Ruby 2.1+, but be prepared for them saying that other itnernal products depend on that version of Ruby
[16:00:22] domgetter: ironcamel I don't know much about RedHat, but aren't there packages you can use or something? This list has more modern versions of Ruby available: https://access.redhat.com/products/Red_Hat_Enterprise_Linux/Developer/#dev-page=5
[16:04:30] domgetter: shevy I dunno, I think Herd is the slowest. HEYOOOO
[16:12:22] domgetter: crst: What do you mean by "unix server friendly"?
[16:17:00] domgetter: >> " - instead of whitespaces, removal of strange characters like à ä ñ".gsub(/ /, "-").gsub(/[^a-zA-Z0-9,-]/, '')
[16:17:33] domgetter: Of course, you'd want to specify all the characters you want to keep around
[16:23:40] domgetter: crst: "I just broke the function with a `/`" I don't know what you mean by this. "any possible bad character" Ruby doesn't know every possible bad character for every possible situation, since any character can be made to be bad
[16:24:03] domgetter: Bish: Rubinius and JRuby have no GIL
[16:25:12] domgetter: Bish I didn't say Rubinius was faster :)
[16:26:30] domgetter: Bish: No, I/O just doesn't use the computation resources of your computer to their fullest extent
[16:26:43] domgetter: since the threads are waiting around for more information from the network or drive
[16:27:23] domgetter: Bish: If you're on MRI, you won't peg your cores
[16:27:45] domgetter: Because Ruby has a GIL
[16:28:09] domgetter: more specifically, because MRI has a GIL
[16:32:32] domgetter: norc: I'm going to have to disagree with you. I have a 4 core machine, and just ran 4.times { threads << Thread.new { loop { 1+1 } } }; threads.first.join and it only used 25% of my processor
[16:35:07] domgetter: norc: what are you talking about? They fork the process. I was talking about why threading won't peg cpus
[16:37:18] domgetter: norc: https://github.com/typhoeus/typhoeus/blob/d9e6dce92a04754a2276c94393dad0f3a5c06bdd/spec/support/localhost_server.rb#L60
[16:39:17] domgetter: norc: I have provided proof that Threads cannot peg a multi-core cpu on multiple modern versions of Ruby. Do you have a code snippit that proves otherwise?
[16:40:56] domgetter: I'm also open to my methodology being shown insufficient. Perhaps I didn't use Thread correctly, or I didn't set an environment variable or configuration setting somewhere
[16:44:47] domgetter: I always liked how the php docs had lots of examples
[16:45:38] domgetter: norc: ah, okay. So is there something else I can run in those threads that won't "hit the GIL"?
[16:46:05] domgetter: fair enough
[16:47:36] domgetter: Bish: not necessarily. Math operations are dealt with slightly differently than other method calls for efficiency, if I remember correctly. So it's possible they interact with the GIL differntly as well
[16:53:04] domgetter: norc: I just ran that, and it only pegged one core again. Did I do something wrong?
[16:55:13] domgetter: norc: so even on your system it's not pegging the cpu's?
[16:56:36] domgetter: norc: My claim is that because of the GIL, it is impossible to use MRI/YARV and ruby Threads to use all cores as much as possible on a machine
[16:58:00] domgetter: norc: I think we're talking past each other.
[16:58:39] domgetter: There is no test you can provide in which Ruby will peg all the cpus using only one ruby process and Threads
[16:58:50] domgetter: (unless you only have one core)
[16:59:30] domgetter: bougyman: yes
[17:00:32] domgetter: I'm on Win7 with Ruby 2.2.3 and 4 cores, and a VPS with Centos7, Ruby 2.3.1 and 2 cores. On neither machine am I able to utilize 100% of all cores at once using a single Ruby process and Ruby Threads
[17:04:27] domgetter: norc: and I'm claiming that that's irrelevant to what I'm saying. YARV's GIL is the culprit here. That's why the test failed on my CentOS box.
[17:04:47] domgetter: no, by your own words, the test failed
[17:05:00] domgetter: You said that you were only using 50% of your 2-core machine's cpu usage
[17:14:48] domgetter: norc: that did cause my laptop (Linux Mint w/ 2.3.1 and 4 cores) to use 60-70% of my total cpu, so that does prove my claim wrong.
[17:15:16] domgetter: is it because of the amount of resulting system calls that the kernel can make outside of ruby?
[17:17:32] domgetter: Bish: calling the "+" method on a Ruby object isn't the same as writing 1 + 1 in C
[17:20:59] domgetter: Bish: it worked in the sense that it used more than one core of your machine
[17:23:50] domgetter: norc: I still contend that the reason your example uses more than one core is because of the system calls which the kernel does outside of the Ruby process
[17:24:01] domgetter: But I coule be wrong
[17:26:58] domgetter: wtiger: I do. I like rvm. Others like rbenv or chruby
[17:27:51] domgetter: wtiger it relieves a lot of headache involved with installing Ruby, and it provides safe ways to hop between different versions of gems as well
[17:31:20] domgetter: nroc: aren't there times where a thread just made a syscall, and then a different thread gets loaded, but the original syscall can continue on?
[17:37:45] domgetter: wtiger: but the answer to your question "should I use a ruby version manager" is definitely yes, regardless of which one you choose
[18:44:29] domgetter: bruce_lee: File#stat
[18:55:12] domgetter: dunpeal: a call to `ruby` will be whichever one is set to be the one used by rvm at that time. do `rvm list` to see which one is current, and which one is default
[18:58:20] domgetter: dunpeal: This StackOverflow answer says it's possible you're loading rvm twice, so you can check for that: http://stackoverflow.com/a/5605028
[18:59:14] domgetter: Try the other answers in there too, perhaps
[19:00:48] domgetter: dunpeal did you put in that echo to see if it's being loaded twice?
[19:02:56] domgetter: dunpeal If it were me, I'd try the echo thing as a sanity check
[19:03:45] domgetter: right, and if that's true, then the echo would only appear once. but I don't know if it only appears once, because you didn't try it yet
[19:05:14] domgetter: oh okay. hmm... you said you're using screen. what shell?
[19:06:08] domgetter: echo $SHELL will show you if you're not sure
[19:06:52] domgetter: boboc: for rails questions, try ##rubyonrails
[19:25:23] domgetter: dunpeal: yea, I'm not sure. Is there a reason you're loading rvm in an unusual way?
[19:31:20] domgetter: shevy No risk, no reward!
[22:53:45] domgetter: Read error: Connection reset by peer
[22:54:08] domgetter: has joined #ruby
[23:30:42] domgetter: Ping timeout: 276 seconds

2016-06-02

[03:32:41] domgetter: has joined #ruby
[08:14:36] domgetter: Ping timeout: 246 seconds
[13:26:36] domgetter: has joined #ruby
[15:37:11] domgetter: jokke I use bash. Mostly out of laziness, though. Also, I don't really know enough about the differences to switch
[15:47:04] domgetter: smathy like posix non-compliance? :P
[15:50:45] domgetter: goeast: on line 36, you refer to @artist, but since you never stored anything in that instance variable, it comes up as nil, and so nil points to your song in the hash
[15:51:47] domgetter: goeast: add_song probably needs to be send both the artist and the song, so that you can add the song to the list of songs for that artist.
[15:51:53] domgetter: needs to be sent*
[15:56:17] domgetter: goeast: on line 36, you want @artist to just be artist. artist is what you put in the parameter list on line 35, so artist is what you want on line 36
[15:59:28] domgetter: goeast: when there's an @ sign in front of a variable name, it's a different variable than if it doesn't have the @ sign in front of it. so @my_number and my_number are two different variables
[16:02:11] domgetter: goeast: no problem, we're all at different places on the path :)
[16:23:16] domgetter: Ping timeout: 244 seconds

2016-06-01

[06:19:39] domgetter: Ping timeout: 276 seconds
[09:52:21] domgetter: has joined #ruby
[10:51:47] domgetter: Does YARV have a certain amount of RAM it will use by default? Like the JVM at 4gb? If so, can I tell it to use more?
[16:49:19] domgetter: Ping timeout: 252 seconds

2016-05-31

[09:27:41] domgetter: acosonic_ the first two answers in that thread have the right idea that it's silly to sanitize a string in ways you don't need to.
[09:28:24] domgetter: depesz_ not really. Ruby's type system is dynamic, so symbols are resolved at runtime
[09:29:19] domgetter: depesz_: it's possible for an undefined variable to get defined by the time it's used
[09:39:05] domgetter: "No package cowsay available." Seriously CentOS??
[11:39:05] domgetter: Hopping back between Ruby and a C/C++ library can cost more than doing the whole thing in Ruby
[11:39:26] domgetter: It's best to have a bunch of work for C/C++ to do, and have it do it all at once
[11:44:35] domgetter: norc: I don't think that's true. You have to use FFI or Fiddle to bolt the C functions to a method
[11:46:13] domgetter: Calling the method incurs a cost at the call site, does it not?
[11:47:24] domgetter: Consider a C function that just does 1 + 1. I submit that using FFI or Fiddle to bolt that to an add_1_and_1 method and then calling that method 10000000 times would take longer than just calling 1 + 1 10000000 times in Ruby
[11:50:29] domgetter: I ahven't tried it with native extensions. It may be the case that the overhead is the same as any other method call
[11:51:18] domgetter: I do agree that if the C function adds 1 + 1 a million times, that *that* will be faster than adding 1 + 1 a million times in Ruby
[16:00:09] domgetter: Ping timeout: 244 seconds
[23:43:22] domgetter: has joined #ruby