« Back to channel list

#ruby - 17 April 2017

« Back 1 day Forward 1 day »
[00:03:04] xenops: has joined #ruby
[00:03:57] xenops: has joined #ruby
[00:04:40] xenops: has joined #ruby
[00:05:21] hotpancakes: has joined #ruby
[00:05:23] Pumukel: has joined #ruby
[00:05:33] xenops: has joined #ruby
[00:06:23] xenops: has joined #ruby
[00:06:52] chefuser: has joined #ruby
[00:06:59] hutch34_: has joined #ruby
[00:07:01] skweek: has joined #ruby
[00:07:03] chefuser: i hate to ask a noob question. I am trying to use https://github.com/NoRedInk/rspec-retry. however their example is only with it. how would I use this with something like 'its(:content)'
[00:07:56] bonhoeffer: has joined #ruby
[00:15:35] patr0clus: has joined #ruby
[00:15:43] esObe: has joined #ruby
[00:18:21] hotpancakes: has joined #ruby
[00:18:50] chefuser: i hate to ask a noob question. I am trying to use https://github.com/NoRedInk/rspec-retry. however their example is only with it. how would I use this with something like 'its(:content)'
[00:20:22] KnownSyntax: has joined #ruby
[00:21:21] bkxd: has joined #ruby
[00:29:15] ghornet_: has joined #ruby
[00:33:29] ghornet__: has joined #ruby
[00:35:41] jdawgaz: has joined #ruby
[00:40:35] al2o3-cr: is there a reason for Socket#nread doesn't work in a block?
[00:44:21] houhoulis: has joined #ruby
[00:44:41] mwlang: has joined #ruby
[00:45:54] mwlang: what are folks using for natural language processing in Ruby these days? the stanford-core-nlp and treat gems seem like they saw better days and are proving difficult for me to get fully configured.
[00:46:07] mzo: al2o3-cr: u wot
[00:46:40] al2o3-cr: mzo: https://gist.github.com/gr33n7007h/d7182bed610c61a3f21d3bb06abf77c7
[00:51:16] Fasort: has joined #ruby
[00:52:36] mzo: al2o3-cr: what is nread
[00:52:42] mzo: i don't see it https://docs.ruby-lang.org/en/2.4.0/Socket.html
[00:52:57] al2o3-cr: &ri Socket#nread
[00:52:57] `derpy: http://ruby-doc.org/stdlib-2.4.0/libdoc/io/wait/rdoc/IO.html#method-i-nread
[00:53:37] mzo: oh it's on IO
[00:54:40] mzo: there's a race condition
[00:54:48] mzo: i think that qualifies as a race condition
[00:55:15] mzo: you're calling nread before the server got your message and replied
[00:55:24] mzo: it worked in the repl because you had to type the line
[00:56:54] bonhoeffer: has joined #ruby
[00:58:24] al2o3-cr: mzo: yep, correct +1 thanks!
[01:01:05] al2o3-cr: so i should use Socket.select?
[01:01:08] hotpancakes: has joined #ruby
[01:02:41] mzo: al2o3-cr: well what are you trying to do?
[01:03:04] al2o3-cr: so something like read = Socket.select([sock], nil, nil, 1); if sock.first ...
[01:03:27] mzo: select on one file descriptor means you're doing something wrong
[01:05:07] raul782: has joined #ruby
[01:05:55] mzo: just use #read imo
[01:07:28] mzo: { sock.send "socket test...", 0; sock.read }
[01:07:43] al2o3-cr: that will just hang no?
[01:07:57] mzo: i'm assuming the server closes the connection after handling a single message
[01:08:26] mzo: or does #read on a socket just return as soon as some data becomes available? i don't know tbh
[01:08:53] mzo: the read system call on a socket returns as soon as data is available, and this is meant to mirror that
[01:09:10] mzo: completely different behavior when you omit the buffer size would be strange
[01:10:37] mzo: i don't really get why BasicSocket#recv *needs* a maxlen argument
[01:11:16] mzo: it's only a thing in C because *you* provide the buffer
[01:11:28] mzo: it should just wait for data to be available and then give you everything if you call it without maxlen
[01:14:05] al2o3-cr: i suppose select works, but that is bad idea :(
[01:14:40] Pumukel: has joined #ruby
[01:17:56] claudevandort: has joined #ruby
[01:19:57] __Yiota: has joined #ruby
[01:20:26] Pumukel: has joined #ruby
[01:20:53] jdawgaz: has joined #ruby
[01:23:13] hotpancakes: has joined #ruby
[01:23:28] Guest96: has joined #ruby
[01:23:40] al2o3-cr: mzo: why do you say using select on one fd is bad?
[01:24:12] raul782: has joined #ruby
[01:27:43] hotpancakes: has joined #ruby
[01:28:42] al2o3-cr: ah, i found IO#ready?
[01:31:16] jrafanie: has joined #ruby
[01:34:42] mwlang: has joined #ruby
[01:38:22] ledestin: has joined #ruby
[01:39:04] StoneCypher: aha! getBoundingClientRect();
[01:42:07] ghornet: has joined #ruby
[01:45:49] Cohedrin: has joined #ruby
[01:46:04] ghornet: has left #ruby: ("ruby")
[01:46:14] hotpancakes: has joined #ruby
[01:47:48] mzo: al2o3-cr: why are you so focused on all of this non-blocking stuff?
[01:47:52] mzo: al2o3-cr: just use a blocking read...
[01:48:12] al2o3-cr: mzo: because it hangs
[01:48:25] mzo: select is for when you have several file descriptors and you want to read from the first one that is ready
[01:48:43] mzo: al2o3-cr: what do you mean it hangs?
[01:49:01] pabs: has joined #ruby
[01:49:05] mzo: it will only hang if the server never sends anything, in which case using a non-blocking read won't help
[01:49:59] al2o3-cr: https://gist.github.com/gr33n7007h/f8035e7fb5bf0d7ccbc49cdd97f78806
[01:50:12] Jameser: has joined #ruby
[01:50:54] al2o3-cr: is this ok?
[01:52:43] mzo: al2o3-cr: nope
[01:53:05] mzo: that's literally just a blocking read except it will throttle your CPU for absolutely no reason
[01:53:55] al2o3-cr: mzo: so what to do?
[01:54:26] mzo: al2o3-cr: ......
[01:54:31] mzo: use a blocking read
[01:55:19] connor_goodwolf: has joined #ruby
[01:56:37] al2o3-cr: mzo: it hangs for some weird reason
[01:56:44] al2o3-cr: if i use a blocking read
[01:56:44] mzo: show me the program that hangs
[01:57:25] al2o3-cr: mzo: basically what you suggested; { sock.send "socket test...", 0; sock.read }
[01:58:04] mzo: try sock.read 500
[01:59:19] jrafanie: has joined #ruby
[02:00:47] al2o3-cr: sock.read works when it's 120 bytes anything over that hangs
[02:02:01] mzo: that is senseless
[02:03:09] al2o3-cr: mzo: try it
[02:03:11] al2o3-cr: Addrinfo.tcp(url, port).connect(timeout: 1) { |s| s.puts "socket test..."; s.read 120 }
[02:03:17] al2o3-cr: then change to 121
[02:03:58] al2o3-cr: url = "tcpst.net"; port = 7777
[02:04:43] al2o3-cr: i'm slowly losing my sanity :(
[02:05:10] hutch34_: has joined #ruby
[02:05:23] libastral: has joined #ruby
[02:06:02] raul782: has joined #ruby
[02:06:49] mzo: al2o3-cr: i believe you, i'm just saying that doesn't mirror the way read() actually works
[02:07:36] al2o3-cr: read works like fread in C yep?
[02:08:17] mzo: well it's hard to compare
[02:08:35] al2o3-cr: well it's stated in the docs
[02:08:42] mzo: i suppose so
[02:09:17] ghornet: has joined #ruby
[02:09:19] mzo: it's uncommon to use stdio with sockets though
[02:10:11] mzo: fread works on 'FILE *'
[02:11:12] mzo: socket(2) returns a file descriptor. usually you'd just use that, with read/recv
[02:12:28] __Yiota: has joined #ruby
[02:12:30] Jameser: has joined #ruby
[02:12:42] al2o3-cr: mzo: so why does it block then?
[02:13:45] mzo: because when you call sock.read 500, it will only return when: 1) it has read 500 bytes, or 2) the connection is closed
[02:14:25] al2o3-cr: that's why i was using recv
[02:14:26] mzo: but in C, if you call read(sock, buf, 500) it will return as soon as *any* data is ready, even if it's less than 500 bytes
[02:14:51] mzo: does sock.recv 500 work?
[02:14:54] al2o3-cr: ah, so use sysread
[02:15:27] al2o3-cr: mzo: no 500 doesn't work because its 120 bytes
[02:15:36] ghornet: has left #ruby: ("ruby")
[02:15:37] al2o3-cr: sysread works
[02:15:44] __Yiota: has joined #ruby
[02:15:46] mzo: i wouldn't use sysread
[02:15:53] mzo: there's got to be a more idiomatic way to do it
[02:16:34] al2o3-cr: well, i'm all out of ideas then
[02:17:06] esObe: has joined #ruby
[02:17:28] patr0clu1: has joined #ruby
[02:19:30] hutch34_: has joined #ruby
[02:19:40] al2o3-cr: it says if you want the behavior of single read(2) use readpartial, read_nonblock, sysread
[02:20:42] ujjain: has joined #ruby
[02:20:42] ujjain: has joined #ruby
[02:20:47] beermouse: has joined #ruby
[02:21:37] al2o3-cr: anyway, thanks for the help mzo you've been great!
[02:23:21] mzo: np al2o3-cr
[02:25:17] Guest96: has joined #ruby
[02:26:15] mooser: has joined #ruby
[02:34:04] mim1k: has joined #ruby
[02:34:36] nertzy: has joined #ruby
[02:46:16] preyalone: has joined #ruby
[02:50:08] enterprisey: has joined #ruby
[02:52:39] statelesscode: has joined #ruby
[03:09:36] cfec0b8d: has joined #ruby
[03:12:59] Jameser: has joined #ruby
[03:13:18] astrobunny: has joined #ruby
[03:13:44] KnownSyntax: has joined #ruby
[03:13:44] KnownSyntax: has joined #ruby
[03:16:32] harfangk: has joined #ruby
[03:23:11] mazeinmaze_: has joined #ruby
[03:24:56] Tempesta: has joined #ruby
[03:27:05] charliesome: has joined #ruby
[03:31:48] minimalism: has joined #ruby
[03:32:23] Guest36187: has joined #ruby
[03:33:08] armyriad: has joined #ruby
[03:34:17] jdawgaz: has joined #ruby
[03:49:58] cfec0b8d: has joined #ruby
[03:52:47] astrobunny: has joined #ruby
[03:55:40] Cohedrin: has joined #ruby
[03:58:22] hndk: has joined #ruby
[03:59:36] spicerack: has joined #ruby
[04:00:56] gix: has joined #ruby
[04:01:34] rakm: has joined #ruby
[04:07:11] anisha: has joined #ruby
[04:08:45] xenops: has joined #ruby
[04:09:36] Jameser: has joined #ruby
[04:12:50] jdm: has left #ruby: ("Leaving")
[04:18:20] esObe: has joined #ruby
[04:19:37] jdawgaz: has joined #ruby
[04:19:57] mazeinmaze_: has joined #ruby
[04:20:27] jdawgaz: has joined #ruby
[04:21:17] jdawgaz: has joined #ruby
[04:22:03] jdawgaz: has joined #ruby
[04:23:38] astrobunny: has joined #ruby
[04:28:43] cerulean: >> eval s=%q($><<"eval s=%q(#{s})\n")
[04:28:46] cerulean: << eval s=%q($><<"eval s=%q(#{s})\n")
[04:28:46] ruby[bot]: cerulean: # => eval s=%q($><<"eval s=%q(#{s})\n") ...check link for more (https://eval.in/777387)
[04:30:20] wiuefhw: has joined #ruby
[04:34:33] mim1k: has joined #ruby
[04:37:32] jakkn: has joined #ruby
[04:43:42] __Yiota: has joined #ruby
[04:43:54] mooser: has joined #ruby
[04:46:40] balazs: has joined #ruby
[04:46:52] etehtsea: has joined #ruby
[04:52:12] enterprisey: has joined #ruby
[05:07:12] pytuger: has joined #ruby
[05:07:13] pytuger: has joined #ruby
[05:09:03] jane_booty_doe: has joined #ruby
[05:12:39] mooser: has joined #ruby
[05:18:29] bkxd: has joined #ruby
[05:25:26] mooser: has joined #ruby
[05:47:41] djbkd: has joined #ruby
[05:47:56] djbkd: has joined #ruby
[05:57:24] jgt1: has joined #ruby
[05:59:38] anisha: has joined #ruby
[06:07:34] Jameser: has joined #ruby
[06:16:34] dev2: has joined #ruby
[06:19:06] Cohedrin: has joined #ruby
[06:20:30] esObe: has joined #ruby
[06:23:18] ddffg: has joined #ruby
[06:32:05] Guest96: has joined #ruby
[06:34:15] govg: has joined #ruby
[06:34:48] jamesaxl: has joined #ruby
[06:34:58] mim1k: has joined #ruby
[06:40:26] Jameser: has joined #ruby
[06:41:47] freedrul1: has joined #ruby
[06:54:20] TomyLobo2: has joined #ruby
[07:09:48] etehtsea: has joined #ruby
[07:10:32] ffi_merlin: has joined #ruby
[07:10:48] auzty: has joined #ruby
[07:10:51] jgnagy: has joined #ruby
[07:13:05] bkxd: has joined #ruby
[07:14:04] dminuoso: ffi_merlin: instance variables are bad!
[07:35:13] bkxd: has joined #ruby
[07:38:56] dminuoso: ast>> foo.to be true
[07:38:58] ruby[bot]: dminuoso: I have parsed your code, the result is at https://eval.in/777475
[07:39:00] dminuoso: ast>> foo.to be(true)
[07:39:01] ruby[bot]: dminuoso: I have parsed your code, the result is at https://eval.in/777476
[07:50:58] lxsameer: has joined #ruby
[07:52:38] leah2: has joined #ruby
[07:53:06] KnownSyntax: has joined #ruby
[07:53:06] KnownSyntax: has joined #ruby
[07:53:45] naprimer_2: has joined #ruby
[07:54:38] nofxxx: has joined #ruby
[07:56:06] esObe: has joined #ruby
[08:01:00] tohuw: has joined #ruby
[08:01:27] naprimer_2: has joined #ruby
[08:03:47] AcidRain: has joined #ruby
[08:03:57] tohuw: I've a .rb script I'm working on which has a require statement that references a gem. I want to work on a local copy of this script and its dependent gemfiles which live in a subfolder. The folder structure in my PWD is like this: foo.rb foodeps/bar.rb foodeps/yum.rb How do I change the statement "require foodeps/bar" correctly?
[08:04:24] dminuoso: tohuw: Use bundler.
[08:04:28] AcidRain: hey, im trying to find the single word "message" that occures on a new line between the strings "symbols" and "end" which will also occur on their own line.
[08:04:46] AcidRain: docs says this should work /symbols(message)end/m
[08:05:09] dminuoso: AcidRain: No. That would leave nothing in between.
[08:05:28] dminuoso: AcidRain: Oh well, I suppose it could work.
[08:05:50] dminuoso: >> !!("a\nb" =~ /ab/m)
[08:05:51] ruby[bot]: dminuoso: # => false (https://eval.in/777486)
[08:06:07] dminuoso: >> !!("a\nb" =~ /a\nb/m)
[08:06:08] ruby[bot]: dminuoso: # => true (https://eval.in/777487)
[08:06:10] mooser: has joined #ruby
[08:06:14] dminuoso: >> !!("a\nb" =~ /a$b/m)
[08:06:15] ruby[bot]: dminuoso: # => false (https://eval.in/777488)
[08:06:35] AcidRain: dminuoso, no it doesnt work
[08:07:29] dminuoso: AcidRain: My second example does.
[08:07:35] dminuoso: Apparently.
[08:07:41] dminuoso: But Im pretty clueless about regex.
[08:08:57] pppktz: has joined #ruby
[08:13:20] Qchmqs: has joined #ruby
[08:14:57] StoneCypher: has joined #ruby
[08:19:11] ltem: has joined #ruby
[08:20:18] tohuw: dminuoso: oh cool... I've been using bundler, but didn't really know about :path. Thanks!
[08:21:48] leah2: has joined #ruby
[08:22:21] dminuoso: tohuw: Great. :)
[08:23:36] naprimer_2: has joined #ruby
[08:25:19] bkxd: has joined #ruby
[08:35:27] mim1k: has joined #ruby
[08:35:36] djbkd: has joined #ruby
[08:38:02] manjaro-kde5: has joined #ruby
[08:39:27] djbkd_: has joined #ruby
[08:44:02] kassav__: has joined #ruby
[08:44:03] ltem: has left #ruby: ("Leaving")
[08:47:48] tynamite: has joined #ruby
[08:48:17] tynamite: Is there a ruby server I can use on my windows laptop for development?
[08:48:35] dminuoso: tynamite: What is a "ruby server" ?
[08:48:41] dminuoso: tynamite: Ruby works fine on Windows.
[08:48:46] dminuoso: Mostly anyway.
[08:48:57] tynamite: a way i can run ruby websites
[08:49:19] dminuoso: tynamite: What are your requirements? Do you just need something minimalistic? sinatra is your friend.
[08:49:25] tynamite: I'm using the Ramaze framework and it wants me to run the app on port 3000
[08:49:32] tynamite: http://ramaze.net
[08:50:15] tynamite: But what if I want to run a simple standalone ruby file as a web page? Or if I want to run multiple ramaze apps on the same port?
[08:50:48] dminuoso: What does either of these things even mean?
[08:50:56] tynamite: I'll try to explain.
[08:51:40] tynamite: I've made a website with the Ramaze framework and to run it on my Windows computer, it wants me to go to command prompt, enter "ramaze start" then the ramaze app runs on port 3000.
[08:51:48] apeiros: tynamite: ramaze afaik uses rack in the backend by now. there's multiple webservers which can run it
[08:51:50] tynamite: I am not happy with this setup.
[08:51:57] apeiros: tynamite: and the port is almost certainly configurable
[08:52:37] apeiros: try `ramaze -h`, it'll probably show the options you can pass in
[08:52:43] tynamite: i'll try that
[08:55:34] apeiros: tynamite: re "run single ruby files", might take a look at https://github.com/migrs/rack-server-pages
[08:58:22] tynamite: I've entered "ramaze -h" and there's 6 commands I can choose from.
[08:59:11] tynamite: I'm looking for a way for a ruby server that I can just go to the file manager to add ruby files and folders in, and run those subfolders in the web browser.
[09:00:17] dminuoso: What does "running those subfolders in the web browser" mean.. exactly?
[09:00:42] dminuoso: How do you run a subfolder in a web browser?
[09:00:55] apeiros: tynamite: look at the above link
[09:01:04] apeiros: dminuoso: I think they're thinking about it like e.g. with .php
[09:01:06] tynamite: i'll try to explain
[09:01:10] tynamite: Like how php works.
[09:01:23] apeiros: so yeah, above link
[09:01:41] tynamite: When I install wampserver or xampp to my windows computer, I place everything inside www/ or htdocs/ whatever I want, go to the appropriate url and it just runs.
[09:01:48] apeiros: we've evolved away from that, but nothing prevents you from doing it that way. hence somebody came up with a way.
[09:02:01] dminuoso: Devolution is still a thing it seems.
[09:02:18] dminuoso: tynamite: Just use sinatra.
[09:02:24] dminuoso: Like everybody else.
[09:02:24] apeiros: pre-evolution things tend to have the air of being "simpler"
[09:02:40] dminuoso: apeiros: That's the thing. Sinatra is not really that complicated.
[09:02:46] adaedra: you can't form a generation of php developpers telling it the way it's done is the right way® and hope there are no side effects.
[09:03:13] dminuoso: adaedra: But you can put those PHP developers into a rocket for an educational (one way) trip to the moon.
[09:03:15] tynamite: I might have to look into sinatra instead of ramaze.
[09:03:37] dminuoso: tynamite: If you're already comfortable with ramaze you might as well stick to it. They are not too terribly different.
[09:03:39] jamesaxl: has joined #ruby
[09:03:56] adaedra: dminuoso: did you not hear? Moon is so last century. It's all about mars now.
[09:04:10] dminuoso: adaedra: That's why I want them to stay on the Moon.
[09:04:35] tynamite: I'll look into rack server pages and see if it solves my problem.
[09:04:57] tynamite: Why did ruby have to evolve away from that apeiros, that's what stopped ruby from being more popular ;)
[09:05:13] adaedra: tynamite: trolling aside, the PHP way of having a .php file for each subpage is not a very good way, especially because of shared code and things that should stay between calls
[09:05:32] apeiros: tynamite: uh, that claim is rather flawed
[09:05:54] adaedra: Ruby became popular thanks to Rails, so that's kinda the opposite
[09:06:21] apeiros: tynamite: we evolved away from that way because it has a tons of issues
[09:06:35] apeiros: tynamite: and if you've done any reasonably big project with php, you'd know that
[09:06:48] tynamite: But there's certain websites that have to work in that fashion.
[09:07:03] apeiros: it's why there are things like apc and other caching solutions in the php world
[09:07:05] dminuoso: tynamite: Anything you want can be trivially done with sinatra/ramaze.
[09:07:21] apeiros: tynamite: no, there is no website which *has* to work in that fashion
[09:07:27] mooser: has joined #ruby
[09:07:29] dminuoso: tynamite: The concept of multiple sites is solved by routing logic, not by files.
[09:07:40] apeiros: but yes, there are websites where it's nicer if you can start out that way
[09:07:46] tynamite: maybe i'm confused here
[09:07:51] apeiros: and again, nothing stops you from doing it that way.
[09:08:22] dminuoso: tynamite: A ramaze or sinatra do what you want out of the box. They can run some code and render a response to a request.
[09:08:42] apeiros: most of my projects in rails start out with a single "Pages" controller which just evaluates a view from its directory. but that's for "sketching", or "mocking".
[09:08:43] adaedra: Well you're used to working some way, so it's not that easy to move to another way, it's normal
[09:09:19] tynamite: Can I run multiple ruby apps on the same port and have different apps in different subfolders, all running, if I use phusion passenger?
[09:09:22] esObe: has joined #ruby
[09:10:02] tynamite: good, it's a shame passenger isn't compatible with windows
[09:10:27] tynamite: I tried to install vagrant but it doesn't work on my windows laptop
[09:10:31] adaedra: or use the linux subsystem
[09:10:41] ljarvis: nginx has a windows version
[09:10:46] esObe: has joined #ruby
[09:12:53] manveru: https://caddyserver.com/ is pretty damn good too and works on all platforms
[09:13:11] ljarvis: yeah caddy is great
[09:13:17] adaedra: also, for development, you don't need passenger, just use webrick
[09:13:22] mikecmpbll: has joined #ruby
[09:13:58] tynamite: noob question, does caddy work with ruby?
[09:14:11] apeiros: manveru: got woken up by "ramaze"? :D
[09:14:29] adaedra: If it can proxy to another HTTP server then yes
[09:14:31] ljarvis: tynamite: it's a web server, so it has nothing to do with ruby. you forward requests from caddy to your own ruby web processes
[09:14:34] tynamite: Ramaze hasn't been updated in years.
[09:14:36] ljarvis: so it's just a proxy
[09:14:45] manveru: apeiros: yeah
[09:14:51] manveru: tynamite: exactly, so use something else
[09:15:47] StoneCypher: has joined #ruby
[09:17:16] bkxd: has joined #ruby
[09:17:42] dminuoso: ljarvis | get a vm
[09:17:46] dminuoso: Did I just hear "get docker" ?
[09:18:10] ljarvis: it was more polite than "get away from windows"
[09:21:26] astrobunny: has joined #ruby
[09:21:39] tynamite: This makes me feel like buying a mac so I can run passenger on the mac
[09:21:56] ljarvis: no dont do that
[09:22:18] ljarvis: what do you need passenger for?
[09:22:22] adaedra: You don't *need* passenger
[09:23:05] tynamite: I might be making a client's site in ruby, so they'll need passenger hosting to run the site instead of a regular php web host, and I would like passenger on my computer for safekeeping so I can duplicate the site on my laptop
[09:24:03] lenwood: has joined #ruby
[09:25:23] ledestin: has joined #ruby
[09:34:37] mim1k: has joined #ruby
[09:36:11] AcidRain: has left #ruby: ("Leaving")
[09:38:23] tynamite: thank you for the advice!
[09:40:54] dminuoso: tynamite: Use docker.
[09:41:01] lenwood: has joined #ruby
[09:41:29] ljarvis: "they'll need passenger hosting" but why? :/
[09:42:54] tynamite: I'm downloading it now.
[09:43:40] dminuoso: ACTION pokes ljarvis with a Ruby 1.9.3 stick
[09:43:45] tynamite: I pay $85 a year to mellowhost for hosting and I asked them to install phusion passenger so I can run ruby there and they refused so now I need to look for a good passenger web host.
[09:44:08] dminuoso: See, I just avoid passenger.
[09:44:17] tynamite: dreamhost sounds good, they believe in freedom of speech, they refused to stop hosting muhammed cartoons
[09:44:25] hutch34_: has joined #ruby
[09:44:28] tynamite: dreamhost uses passenger
[09:44:39] cerulean: nginx + puma + 2.4 !!!!!!!
[09:45:14] dminuoso: For once I agree with cerulean.
[09:45:29] dminuoso: And that's where agreement stops again.
[09:45:33] tynamite: I'm looking into puma right now
[09:45:37] cerulean: what host dminuoso
[09:45:43] cerulean: i like my linode.
[09:45:46] dminuoso: cerulean: I work at an internet service provider.
[09:45:50] cerulean: oh i see haha
[09:46:16] cerulean: i switched from passenger to the stack i just said and never looked back
[09:46:25] cerulean: full websockets support, full concurrency
[09:47:07] kassav__: has joined #ruby
[09:47:14] dminuoso: tynamite: puma is just simpler in that you need no weird nginx or apache plugins.
[09:47:43] dminuoso: And it can be seamlessly integrated into nginx/apache too.
[09:48:34] cerulean: yes, but use nginx
[09:49:27] ruby[bot]: -bb $a:jennyrgb$#ruby-banned jennyrgb!*@*$#ruby-banned
[09:50:12] hutch34_: has joined #ruby
[09:55:23] kassav_: has joined #ruby
[09:55:26] esObe: has joined #ruby
[09:58:22] vuoto: has joined #ruby
[10:01:35] ddffg: how can i use chruby with sublime?
[10:02:03] dminuoso: ddffg: Say what?
[10:02:22] GodFather: has joined #ruby
[10:02:28] dminuoso: ddffg: What do you want Sublime to do?
[10:02:39] dminuoso: ddffg: https://github.com/postmodern/chruby/wiki/Sublime-Text this perhaps?
[10:02:47] ddffg: i need exec chruby within sublime
[10:03:06] dminuoso: ddffg: Yeah that ^- then
[10:06:13] rgtk: has joined #ruby
[10:06:32] ddffg: https://stackoverflow.com/questions/22983190/how-to-change-a-build-version-in-sublime-text-3
[10:06:45] ddffg: chruby: command not found
[10:07:12] ddffg: link above is wrong paste
[10:07:24] GodFather: has joined #ruby
[10:07:47] Sembei: has joined #ruby
[10:08:50] mooser: has joined #ruby
[10:10:58] sepp2k: has joined #ruby
[10:13:48] tynamite: I'm running my ramaze app with puma, and it's running on tcp:// instead of http://
[10:25:35] t-recx: has joined #ruby
[10:28:54] jane_booty_doe: has joined #ruby
[10:29:10] Hanmac: has joined #ruby
[10:33:39] ytti: apologies for venting, i don't get why python is popular, feels such a dirty language, littered with built-in functions, no way for developer to make educated guess if it's method you want or function
[10:33:44] nebiros: has joined #ruby
[10:34:14] ytti: list comprehensions are really poor for readability
[10:34:30] Fysicus: has joined #ruby
[10:34:33] ytti: no way to clearly specify what is internal and what is external api of a c class
[10:34:58] ytti: i wonder what i'd coplain about ruby, if i had first develope in python then ruby
[10:35:49] ytti: right now it seems to me unfathomable how someone could prefer python or ruby, considering how much cleaner and consistent ruby is
[10:36:05] ytti: but surely that is just my own expectations
[10:37:45] Fysicus: I still think C++ is more consistent. ;-)
[10:38:57] ytti: i have nothing against C++
[10:39:10] ytti: but i do have destain for C/C++
[10:39:17] ytti: people who use that notation
[10:39:20] ytti: like what
[10:39:30] ytti: they're entirely different things, knowing one does not imply you know one
[10:39:42] ytti: and those are probably the people who never program in C++, even when they compile in C++
[10:40:18] ytti: (I have large distain for C though, i don't think anything should be written in it)
[10:40:30] Fysicus: And why is that?
[10:40:35] ytti: i suspect it is major reason why computer security is largely a joke
[10:40:51] ytti: i don't think humans, on average, are capable of writing working code in C
[10:41:29] Fysicus: No, that's more a consequence of lazy programmers and compromises.
[10:41:36] Azure: has joined #ruby
[10:41:55] ytti: i don't think either view can be proven, and i'm very hesitent to change my mind
[10:42:18] ytti: i don't like blaming people, because we should expect people to perform poorly
[10:42:20] Fysicus: I'm not asking you to change your mind :-)
[10:42:31] Fysicus: I'm also not blaming people.
[10:42:53] ytti: if your method of fixing problem is telling people to do better, you're probably not going to get that problem fixed
[10:43:15] ytti: i suspect if programmer of same skill and motivation writes same program in rust
[10:43:19] Fysicus: It's just a simple fact most software problems are caused by people cutting corners
[10:43:24] ytti: the outcome is higher quality program
[10:43:54] ytti: i'm not arguying it's physically impossible to write good C
[10:44:10] ytti: i'm aruying, people on average won't do it, no matter how much we educate, ask and beg them to
[10:44:21] ytti: so we either change people or we change the tools
[10:44:53] Fysicus: Software development has always been more of an art than a skill.
[10:45:05] Fysicus: Some people have the knack, others don't.
[10:45:30] Fysicus: And of course, a lot of people have different ideas on what clean code looks like.
[10:46:25] ytti: i think only relevant question is, can choice of language produce better quality code, when all other things remain same
[10:46:39] ytti: if answer is yes, then we should use the tool which helps us produce higher quality code
[10:49:14] ixti: has joined #ruby
[10:50:53] toretore: it's incredibly difficult to write correct programs, and very easy to write incorrect ones; a concept that eliminates whole classes of incorrectness without too much of an investment should be welcomed
[10:51:45] toretore: needing 10 years of experience just to be able to write a program that doesn't have security flaws and other critical bugs is a laughable idea
[10:52:15] ytti: when it comes to C, we all the time find catastrophic bugs in well understood code
[10:52:22] ytti: reviewed by best people again and again
[10:52:31] ytti: like the linux udp.c just last week
[10:52:50] ytti: blaming people for this is cop out
[10:52:53] toretore: c should probably die (i don't actually know it, but i know *of* it)
[10:53:18] ytti: humans will always be humans, and we should expect humans to behave like humans and work around that problem
[10:53:25] ytti: instead of telling them to stop being humans
[10:53:44] ytti: i couldn't agree more
[10:54:00] binaryplease: has joined #ruby
[10:54:20] Fysicus: As a big C & C++ fan, I hope it won't die
[10:54:25] toretore: i think most sane people are starting to realize this by now
[10:54:31] ytti: i don't include C++ in this bucket at all
[10:54:44] ytti: I think C++ is fine, if person knowns C++ and writes idiomatic C++
[10:54:48] ytti: (i don't, but i know some do)
[10:54:50] Fysicus: I would even say it'll probably outlive ruby and most of the other modern languages
[10:55:16] foxxx0: imho the main problem of C is, that is so extremely flexible and there is unified build and test framework, that would help to better test the code and automatically find buffer overflows and off-by-one errors
[10:55:22] toretore: of course it will, but it doesn't mean it's a good thing
[10:55:30] foxxx0: it can be done, but it's far from easy
[10:55:47] toretore: why bother when there are better alternatives?
[10:55:59] Fysicus: I think it is... What you think as a major problem is one of its strengths
[10:56:04] foxxx0: if the tooling around C was easier, like tooling around ruby, it would be easier to write good code
[10:56:08] ytti: data would be good
[10:56:15] ytti: i wish rust experts would look have CVE's
[10:56:19] ytti: and write article about them
[10:56:27] ytti: with conclusion if or not it would have happened in rust code
[10:56:37] ytti: so that we would have data we can offer managers and decision makers
[10:56:50] ytti: 'x percentage of our security problems would be gone, if we change from C to rust'
[10:57:04] ytti: now i just assume rust produces inherently less buggy code, but i might be wrong
[10:58:53] toretore: i don't even think you can make the argument that c is easier or faster to write, like you can with ruby vs various other langs
[11:00:37] ytti: rust is definitely harder to write than c
[11:00:44] ytti: rust is probaby like c++ level complexity
[11:00:48] ytti: i.e. quite high
[11:01:00] ytti: you don't have to understand anything to write seemingly working C
[11:01:04] ytti: you can just start writing
[11:01:15] ytti: but it's pretty hard to brute force your way through idiomatic rust or C++
[11:01:23] toretore: harder to *learn* definitely, but i'm not sure that means harder to write
[11:01:31] ytti: you will end up fighting compiler for long time
[11:01:39] ytti: without educating yourself on the language
[11:02:15] ytti: but i hope/assume once you've invested that time, the code will be inheretnly better quality
[11:02:27] ytti: because some classes of errors are guaranteed by compiler not to happen
[11:03:14] toretore: tbf rust seems to be a really complex language
[11:03:43] Fysicus: has joined #ruby
[11:06:28] Drakx: has joined #ruby
[11:08:40] toretore: i think a good analogy is writing concurrent programs with mutable vs immutable state: the language with mutable state is likely to be much more forgiving and less strict, but now you have to understand and always have in mind all the complexities of mutating state concurrently, which is incredibly hard. with the immutable state, all of that just goes away. it may require you to think a little differently, but that's not an inherent
[11:09:06] toretore: *all = most
[11:10:14] Drakx: has left #ruby: ()
[11:10:18] ytti: i love writing idiomatic OO programs
[11:10:26] ytti: but i hae no intuitive idea of my state
[11:10:39] ytti: so if i run into some memory leaks, very hard to fix
[11:11:15] ytti: i'm kind of hand-waving the problem and just opting not to write long lived processes in OO
[11:14:38] Akuma: has joined #ruby
[11:17:01] StoneCypher: has joined #ruby
[11:18:05] rgtk: has joined #ruby
[11:22:08] tynamite: has joined #ruby
[11:22:47] tynamite: hello I'm typing in “ruby script/server” on the command line and a webrick server isn't starting
[11:23:15] mooser: has joined #ruby
[11:26:21] toretore: give more info
[11:29:49] draxxxeus: has joined #ruby
[11:31:03] draxxxeus: Hi, I have a ruby project and i used to use ruby-pkg-tools on Ubuntu 12.04 to build debian out of it. Now in Ubuntu 14.04, the package ruby-pkg-tools is unavailable. What is the correct way to build a debian from a Ruby project now?
[11:32:50] tynamite: https://arjunghosh.wordpress.com/2007/09/06/starting-webrick-server-manualy-from-the-command-line/
[11:34:09] Akuma: has joined #ruby
[11:35:38] toretore: ?rails tynamite
[11:35:38] ruby[bot]: tynamite: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[11:35:58] pickle_: has joined #ruby
[11:36:24] tynamite: What is the command for starting webrick?
[11:36:30] tynamite: is there one?
[11:37:05] toretore: tynamite: before you go there, understand that you have to provide more information in order to get any useful response: your code, exactly what happens when you "type ruby script/server"
[11:37:17] charliesome: has joined #ruby
[11:37:36] adaedra: tynamite: I suggest you forget everything you know about web servers and whatnot and just look at a sinatra tutorial with a fresh mind.
[11:37:56] adaedra: it may make things easier than trying to adapt things you search for based on what you know
[11:38:39] toretore: i'm guessing it's someone who downloaded some monster rails app and is trying to run it
[11:38:49] pickle_: has joined #ruby
[11:39:09] adaedra: they were asking how to write ruby apps in the old php way
[11:39:39] toretore: i must have missed that
[11:40:20] adaedra: that was more than 2h ago
[11:42:04] centrx: has joined #ruby
[11:42:04] centrx: has joined #ruby
[11:47:08] Jameser: has joined #ruby
[11:50:43] millerti: has joined #ruby
[11:50:48] al2o3-cr: has joined #ruby
[11:54:43] Pumukel: has joined #ruby
[11:55:30] Pumukel: has joined #ruby
[11:56:18] Pumukel: has joined #ruby
[11:56:33] esObe: has joined #ruby
[11:57:06] Pumukel: has joined #ruby
[11:57:54] Pumukel: has joined #ruby
[12:00:18] jdawgaz: has joined #ruby
[12:00:21] dasher^0_o: has joined #ruby
[12:00:48] synthroid: has joined #ruby
[12:02:06] milardovich: has joined #ruby
[12:05:38] ldnunes: has joined #ruby
[12:10:15] pickle_: has joined #ruby
[12:11:05] bkxd: has joined #ruby
[12:12:44] biberu: has joined #ruby
[12:13:34] biberu: has joined #ruby
[12:15:10] al2o3-cr: has joined #ruby
[12:17:08] joelwallis: has joined #ruby
[12:19:30] arquebus: has joined #ruby
[12:20:36] epochwolf: has joined #ruby
[12:22:39] pupsicle: has joined #ruby
[12:25:07] gnufied: has joined #ruby
[12:25:12] DoubleMalt: has joined #ruby
[12:25:32] latemus: has joined #ruby
[12:26:49] latemus: i did codecademy's ruby program, and i have done some scripting in ruby since. i want to buy one book which will provide me the opportunity to gain advanced ruby skills. which ruby book should i get
[12:33:46] shynoob: has joined #ruby
[12:35:35] bkxd: has joined #ruby
[12:35:51] shynoob: hey guys, I want to start learning the ways of Ruby, thereby preparing myself to play with Rails Framework for web development stuff.. I am complete newbie... please suggest where do I start?:)
[12:36:25] ruby[bot]: http://ruby-community.com/pages/links
[12:37:12] gnufied: has joined #ruby
[12:37:20] shynoob: and yah some do's and don't's which ruby professionals over here think.. I should be aware of ... if at all
[12:37:21] adaedra: Lots of things here for Ruby, for Rails I suggest to see with #RubyOnRails
[12:37:36] adaedra: Do: practice and have fun
[12:38:25] shynoob: but someone suggested me before.. that learning programming in general with Ruby before getting acquainted with Rails would be much better!
[12:42:27] ruby[bot]: -b AlienElite_!*@*$#ruby-banned
[12:44:39] centrx: Ruby Monk is not on that list?
[12:49:02] adaedra: Looks not.
[12:49:56] adaedra: If you want to add a link, make a PR in https://github.com/ruby-community/ruby-community
[12:52:30] xenops: has joined #ruby
[12:57:26] SCHAPiE: has joined #ruby
[12:57:56] esObe: has joined #ruby
[13:02:55] Xiti: has joined #ruby
[13:03:45] Derperperd: has joined #ruby
[13:07:09] Fasort: has joined #ruby
[13:09:49] acalycine: has joined #ruby
[13:10:30] saslam: has joined #ruby
[13:12:34] jdawgaz: has joined #ruby
[13:12:50] jrafanie: has joined #ruby
[13:13:13] ben_h: has joined #ruby
[13:14:38] jrafanie: has joined #ruby
[13:16:14] _bet0n: has joined #ruby
[13:16:41] saslam: has joined #ruby
[13:17:41] StoneCypher: has joined #ruby
[13:17:43] Jameser: has joined #ruby
[13:19:57] FastJack: has joined #ruby
[13:20:29] anotherpi: has joined #ruby
[13:21:40] anotherpi: do you know the seeing_is_believing gem?
[13:22:06] anotherpi: it's very nice (don't know if it's useful in real life…)
[13:22:28] anotherpi: i am searching for an equivalent for JS
[13:23:15] adaedra: looks like what Xcode has for Swift playgrounds
[13:24:26] sepp2k1: has joined #ruby
[13:24:31] mooser: has joined #ruby
[13:24:32] anotherpi: yep, but centered on Ruby, not on a text editor or IDE
[13:26:39] bkxd: has joined #ruby
[13:27:09] cpruitt: has joined #ruby
[13:27:13] Qommand0r: has joined #ruby
[13:27:46] pavelz: erm do ppl know ruby eventmachine here? everywhere it talks about multithreaded multicore support which is sketchy with ruby at best,but nothing said about using eventmachine and em-* gems to create a single listening socket and share it among forked processes. apache style.
[13:27:52] pavelz: old apache
[13:29:57] pavelz: oh nm. reactor
[13:29:57] yeticry: has joined #ruby
[13:31:41] cpruitt: has joined #ruby
[13:34:54] dlitvak: has joined #ruby
[13:36:56] patarr: has joined #ruby
[13:36:58] jgt1: has joined #ruby
[13:40:59] saslam: has joined #ruby
[13:44:07] DLSteve: has joined #ruby
[13:47:27] shinnya: has joined #ruby
[13:49:19] millerti: has joined #ruby
[13:51:34] nicesignal: has joined #ruby
[13:52:02] esObe: has joined #ruby
[13:54:59] jdawgaz: has joined #ruby
[13:55:28] houhoulis: has joined #ruby
[13:55:54] chouhoulis: has joined #ruby
[13:56:19] saslam: has joined #ruby
[13:58:16] solocshaw: has joined #ruby
[13:59:24] saslam: has joined #ruby
[13:59:45] govg: has joined #ruby
[13:59:47] DLSteve: has joined #ruby
[14:05:13] jamesaxl: has joined #ruby
[14:05:34] ElDoggo: has joined #ruby
[14:06:08] saslam: has joined #ruby
[14:06:27] coatezy: has joined #ruby
[14:07:04] joneshf-laptop: has joined #ruby
[14:09:10] DLSteve: has joined #ruby
[14:12:14] tjvc_: has left #ruby: ("Leaving")
[14:13:53] cdg: has joined #ruby
[14:19:31] ResidentBiscuit: has joined #ruby
[14:20:14] ski7777: has joined #ruby
[14:20:19] milardovich: has joined #ruby
[14:26:19] domgetter: has joined #ruby
[14:27:10] naprimer_2: has joined #ruby
[14:31:08] tjvc: has joined #ruby
[14:31:37] mooser: has joined #ruby
[14:32:08] mim1k: has joined #ruby
[14:32:54] tjvc: has left #ruby: ("Quit: Leaving")
[14:34:23] hinbody-mobile: has joined #ruby
[14:35:05] charliesome: has joined #ruby
[14:35:13] hinbody-mobile: has joined #ruby
[14:35:45] hinbody_: has joined #ruby
[14:36:30] narval: has joined #ruby
[14:40:28] Xiti: has joined #ruby
[14:40:42] hinbody: has joined #ruby
[14:43:22] Fasort: has joined #ruby
[14:43:46] hotpancakes: has joined #ruby
[14:44:07] saslam: has joined #ruby
[14:44:11] __Yiota: has joined #ruby
[14:45:03] al2o3-cr: has joined #ruby
[14:45:41] saslam: has joined #ruby
[14:45:59] oded: How can I convert a BigDecimal to string without leading zeroes (I don't want to round it though)
[14:46:36] mooser: has joined #ruby
[14:46:48] oded: BigDecimal("30").something => "30" & BigDecimal("30.5").something => "30.5"
[14:48:29] oded: did not expect it to be so hard
[14:48:36] saslam: has joined #ruby
[14:49:54] havenwood: oded: #to_f and #to_i or #truncate
[14:50:15] oded: havenwood: I don't want to round it, and to_f doesn't remove the leading zero
[14:50:36] havenwood: oded: Oh, i see what you want, gotcha.
[14:50:55] oded: I don't even understand why it put it there
[14:50:57] ljarvis: >> require "bigdecimal"; BigDecimal("30.5").to_s("F")
[14:50:59] ruby[bot]: ljarvis: # => "30.5" (https://eval.in/777744)
[14:51:03] nankyokusei: has joined #ruby
[14:51:20] oded: it's like a special case because nothing would be added to it if it wasn't a round number
[14:52:00] rippa: has joined #ruby
[14:53:01] d10n-work: has joined #ruby
[14:55:22] pwnd_nsfw: has joined #ruby
[14:55:27] oded: ljarvis: that has failed
[14:55:47] ljarvis: oded: do you have a better example of your input than you suggested?
[14:56:12] oded: ljarvis: why do you need a better example?
[14:56:19] oded: require "bigdecimal"; BigDecimal("30").to_s("F")
[14:56:25] ljarvis: you're talking about leading zeroes
[14:56:40] ljarvis: do you mean trailing zeroes?
[14:56:46] oded: >> require "bigdecimal"; BigDecimal("30.5").to_s("F")
[14:56:47] ruby[bot]: oded: # => "30.5" (https://eval.in/777754)
[14:56:50] oded: >> require "bigdecimal"; BigDecimal("30").to_s("F")
[14:56:51] ruby[bot]: oded: # => "30.0" (https://eval.in/777755)
[14:56:57] ljarvis: so you dont mean leading zeroes, ok
[14:56:58] oded: yes, trailing :)
[14:57:05] oded: sorry about that
[14:57:08] ljarvis: well, you either want floating point notation or you dont
[14:57:15] ljarvis: so.. .chomp(".0") ;P
[14:57:20] oded: I don't if it's a round number
[14:57:36] oded: right, did that with a sub but that looks better :)
[14:58:09] ljarvis: but yeah, if you dont want to do math, just chomp the trailing zero
[14:58:25] havenwood: >> require "bigdecimal"; BigDecimal("30").to_s("F").chomp(".0")
[14:58:26] ruby[bot]: havenwood: # => "30" (https://eval.in/777758)
[14:58:28] snickers: has joined #ruby
[15:04:17] oded: thanks people
[15:04:23] jespada: has joined #ruby
[15:08:44] andmount: has joined #ruby
[15:09:00] jgnagy: has joined #ruby
[15:09:37] esObe__: has joined #ruby
[15:12:24] esObe: has joined #ruby
[15:14:04] doublemalt_: has joined #ruby
[15:14:55] bigkevmcd: has joined #ruby
[15:16:09] ElDoggo: has joined #ruby
[15:17:34] rgtk: has joined #ruby
[15:18:31] StoneCypher: has joined #ruby
[15:20:05] polishdub: has joined #ruby
[15:23:01] obzidian: has joined #ruby
[15:26:05] hotpancakes: has joined #ruby
[15:27:46] ForeignBiscuit: has joined #ruby
[15:28:10] mooser: has joined #ruby
[15:28:14] ForeignBiscuit: has joined #ruby
[15:30:22] saslam: has joined #ruby
[15:33:20] hotpancakes: has joined #ruby
[15:35:00] mzo: has joined #ruby
[15:36:25] saslam: has joined #ruby
[15:37:03] jrafanie: has joined #ruby
[15:39:22] jgt1: has joined #ruby
[15:41:22] milardovich: has joined #ruby
[15:42:50] ytti: i wonder why this isn't being developed - https://github.com/sconover/wrong/
[15:42:57] ytti: seems like really nice way to test
[15:44:00] esObe__: has joined #ruby
[15:44:56] esObe: has joined #ruby
[15:45:17] havenwood: ytti: That is nice indeed. It reminds me of testing in Elixir.
[15:45:33] machinew_: has joined #ruby
[15:46:51] stupidsenpai: has joined #ruby
[15:49:40] ytti: havenwood, i'd like to use that, but dunno if i dare to depend on something with so little traction and ~nothing in 3 years
[15:51:26] StoneCypher: has joined #ruby
[15:52:18] baweaver: Like most of the Net::* libs?
[15:54:42] amclain: has joined #ruby
[15:56:04] mzo: ytti: fork it
[15:56:16] lmc: has joined #ruby
[15:56:26] mikecmpbll: has joined #ruby
[15:57:51] ljarvis: I don't see how it's that much different from minitest? assert foo == bar, assert { foo == bar }
[15:58:11] ljarvis: sure the error messages suck unless you use the other helpers like assert_equal, but still
[15:58:15] s2013: has joined #ruby
[15:58:40] ytti: yeah, i guess that's the whole selling point, quality of error messages
[15:58:48] ytti: you can use it with minitest
[15:59:49] mzo: things like assert_equal are the ugliest thing i've ever seen
[16:00:04] ljarvis: surely that's a bit hyperbole :)
[16:00:14] mzo: when you need dozens of assert_* variants you know your testing framework is terminally broken
[16:00:31] adaedra: that's syntaxic sugar
[16:00:39] mzo: no it's not
[16:00:43] ljarvis: it's not, unfortunately
[16:00:50] adaedra: yeah, it's an override
[16:01:05] synthroid: has joined #ruby
[16:01:10] adaedra: but it's just to have a better message, but `assert a == b` works as well
[16:01:21] adaedra: so if you don't want to use them, you don't have too
[16:01:30] mzo: yes, but you should get a good message with `assert a == b`
[16:01:41] ljarvis: right, but if you want the messages you do (when don't you want those?) I think that's the argument
[16:01:50] mzo: telling the user to pick the correct assert_* variant is just lazy
[16:02:15] synthroid: has joined #ruby
[16:02:26] adaedra: you can't really have an assert() which differentiate between a == b or other boolean returns
[16:02:37] adaedra: without hacking deep in the language, can you
[16:03:00] marxarelli: has joined #ruby
[16:03:09] ljarvis: yeah it would require monkeypatching
[16:03:17] mzo: why can't my test framework get the location of my assertion in the source code, load and parse the code, and then match the AST against various patterns
[16:03:40] ljarvis: I would argue something else is broken if you have to do that
[16:03:44] baweaver: you want your specs to take 20x longer?
[16:03:45] adaedra: make it read your mind while you're at it
[16:03:50] ljarvis: especially in a slow language like.. well you know
[16:04:00] marxarelli: has joined #ruby
[16:04:11] baweaver: adaedra: y'mean like https://github.com/baweaver/clairvoyant ?
[16:04:12] mzo: if it comes down to it, i'd rather just accept the generic message and use plain `assert` everywhere
[16:04:25] ljarvis: i've done that in places
[16:04:27] mzo: having the user choose from all of the assert_* variants feels incredibly wrong
[16:04:36] ljarvis: i mean, if it fails you gotta open up the code any way
[16:04:40] ljarvis: ya lazy hot dog
[16:04:59] andmount: has joined #ruby
[16:05:09] ljarvis: then again most projects at work (all i think, actually) use rspec
[16:05:12] ljarvis: so *shrug*
[16:05:34] adaedra: so you have to choose between all `to *` instead of all `assert_*` :D
[16:05:51] jgt1: has joined #ruby
[16:06:11] ljarvis: yeah but it just infers question? methods, e.g. expect(foo).to include("bar")
[16:06:22] jrafanie: has joined #ruby
[16:06:48] spicerack: has joined #ruby
[16:07:39] baweaver: There's always a price to be paid when magic is involved
[16:07:40] adaedra: The simple methods (assert_*) approach is nice to me, as it doesn't pollute the namespace too much (all methods have the same prefix) and are not done by heavilly monkey-patching everything
[16:08:09] ljarvis: tbh i use elixir a lot and really love that just using assert works perfectly, so i do feel spoiled a bit
[16:08:46] govg: has joined #ruby
[16:08:55] adaedra: Go do your fancy languages in their respective channels
[16:09:09] adaedra: THIS IS #RUBY
[16:09:16] outreachdan: has joined #ruby
[16:09:32] adaedra: If you mod heard you
[16:09:34] baweaver: https://github.com/mwotton/Hubris
[16:09:37] ljarvis: i heard me
[16:09:48] ljarvis: *raises shield*
[16:09:50] baweaver: Mod fight :D
[16:09:52] stupidsenpai: Is there a way for ruby to know which photo is which?
[16:10:00] frant: has joined #ruby
[16:10:01] ljarvis: stupidsenpai: pardon?
[16:10:06] baweaver: stupidsenpai: que?
[16:10:08] adaedra: “between love and bondage” lovely
[16:10:13] stupidsenpai: Like I'm trying to create a smart image finder
[16:10:29] frant: hi guys, what is the path i should use in my templates to link a css file?
[16:10:31] stupidsenpai: You type in a search result and it gives you accurate results
[16:10:32] hxegon: stupidsenpai: what criteria are you trying to classify the images by?
[16:10:34] ljarvis: oh.. that's.. not a simple challenge to solve, stupidsenpai
[16:10:43] ljarvis: fran_: rails?
[16:10:49] ljarvis: ?rails fran_
[16:10:49] hxegon: search terms?
[16:10:49] ruby[bot]: fran_: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[16:11:00] baweaver: Just use tagging
[16:11:09] hxegon: stupidsenpai: ^
[16:11:14] baweaver: anything more in-depth is going to require a doctorate in CS and a lab
[16:11:15] stupidsenpai: Well, I'm searching for naked otters in google images and it's including hairy and hairless otters when I just want hairless otters to show up
[16:11:19] stupidsenpai: I don't want to use tagging
[16:11:26] ljarvis: better get a lab then
[16:11:30] ljarvis: and a lab coat so you fit in
[16:11:40] ljarvis: naked otters
[16:11:40] baweaver: ACTION wants a lab coat now
[16:11:53] baweaver: I think we're otterly offtopic now.
[16:12:10] ljarvis: stupidsenpai: you want something in ruby that can read an image and differentiate between haired and hairless otters?
[16:12:20] stupidsenpai: But also different words
[16:12:25] ljarvis: ok someone reboot the internet
[16:12:27] ljarvis: it's broken
[16:12:36] hxegon: stupidsenpai: It's a really difficult topic, but you should google 'computer vision' and 'image classification' if you want to look into it
[16:12:36] stupidsenpai: Like certain words match with other words
[16:12:54] nitric: has joined #ruby
[16:13:00] ljarvis: stupidsenpai: this is a really tough thing to solve I'm afraid, do you have ~2 years to work on this?
[16:13:07] baweaver: https://xkcd.com/1425/
[16:13:49] hxegon: baweaver: ah, beat me to it
[16:14:12] stupidsenpai: Will people like it if I create something like that
[16:14:22] saslam: has joined #ruby
[16:14:53] hxegon: If by "create" you mean "improve the state of research on" and by "like" you mean "give you lots of high paying job offers" then yes
[16:15:04] ljarvis: yep, my otter pics are all mixed together and it drives me mad
[16:15:09] stupidsenpai: No I mean find it useful
[16:15:24] ljarvis: absolutely
[16:15:25] hxegon: yes, absolutely. Google photos does something similar
[16:15:51] ljarvis: remind me in 5 or so years, by that time my image library will be out of control
[16:16:12] baweaver: ....did epochwolf get to you too ljarvis?
[16:16:43] ljarvis: what's a epochwolf
[16:16:53] ncthom91: has joined #ruby
[16:17:00] baweaver: best you don't know
[16:17:37] stupidsenpai: I'm going to try to implement a simple one and I hope that people will improve on it
[16:18:01] hxegon: as someone with a history of cringey handles, it sounds like a cringey handle.
[16:18:36] stupidsenpai: This sounds like something a a phd student would do
[16:18:56] petruff: has joined #ruby
[16:18:58] stupidsenpai: But I think it'll be fun to do without credit
[16:19:13] Ishido: has joined #ruby
[16:19:16] ljarvis: you think?
[16:20:29] stupidsenpai: I think but I'm not so sure
[16:20:55] stupidsenpai: If I knows the answers to such questions I would be already using it
[16:20:59] hxegon: I'd definitely take credit if I were to sink any significant amount of time into it
[16:21:16] hotpanca_: has joined #ruby
[16:21:35] hxegon: I'd encourage you to try it out and see if you enjoy the problem. Good to challenge yourself, and that kind of thing looks great on a resume
[16:21:46] jaywhawk: has joined #ruby
[16:22:28] saslam: has joined #ruby
[16:22:48] negatifze: has joined #ruby
[16:23:36] stupidsenpai: I don't know if I'd ever want to work for a company
[16:23:47] stupidsenpai: I enjoy having my own
[16:24:02] lmc: has joined #ruby
[16:24:54] negatifze: So... I'm having the damnedest time trying to find my problem here, could someone please help? The error says I am missing keyword end, but I don't see where. https://pastebin.com/0fLbfVx0
[16:24:56] ruby[bot]: negatifze: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/755455b57eaeb857de2ae462788677b3
[16:24:57] ruby[bot]: negatifze: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[16:26:28] saslam: has joined #ruby
[16:26:31] baweaver: Whitespace is free, use it liberally
[16:27:25] negatifze: Ugh, Christ. Sorry guys, disregard my earlier question
[16:27:37] negatifze: Error was in a different fucking file
[16:27:41] baweaver: Also there's some ways to clean up that code.
[16:28:37] baweaver: like: next if line[0] == '#'
[16:29:24] baweaver: and: current, data = line.split(':'); next unless data
[16:29:33] negatifze: baweaver: Thanks. Actuallym that wouldn't work, since comments can appear at the end of a line also
[16:29:36] baweaver: allows you to unfold from the conditional.
[16:29:58] strontor: has joined #ruby
[16:30:00] baweaver: Then switch it back to the regex and it'll still work
[16:30:07] baweaver: next is handy for skipping an iteration of a loop
[16:30:17] negatifze: baweaver: Thank you though for taking a look. I think I solved my problem
[16:30:30] baweaver: use it to break out early instead of wrapping things in conditionals, it leads to a lot deeper indentation
[16:30:40] adaedra: if not -> unless
[16:30:50] negatifze: baweaver: Spent 45 minutes looking for the missing { or end, the error was in a different file... Doh
[16:31:04] baweaver: you can blame monday too
[16:31:18] baweaver: adaedra: in that case just `if data`
[16:31:50] adaedra: That's what I was thinking too, but technically you're changing behavior for false.
[16:32:14] adaedra: which shouldn't happen in this code tho.
[16:32:37] baweaver: Also line 22 will break negatifze
[16:32:38] petruff: has joined #ruby
[16:32:46] baweaver: $current is different than current
[16:32:51] tristanp: has joined #ruby
[16:33:03] negatifze: baeaver: Yeah, I caught that. Was originally using a global, changed it to local
[16:33:15] adaedra: "#{...}" is uneeded
[16:33:21] baweaver: that, and return on line 41 is unneeded
[16:33:38] adaedra: 33: delta[dat[0].strip] = dat[1].strip
[16:33:49] lmc: has joined #ruby
[16:33:54] negatifze: Good points guys. Good points.
[16:34:14] negatifze: However I'll leave the return.
[16:34:34] adaedra: You're testing twice for presence of :
[16:34:37] negatifze: Doing a project, doubt the grader is familiar with ruby, so I'll leave that for clarity
[16:35:05] baweaver: Also the case can be gotten rid of
[16:35:36] adaedra: l.14, since you are inside `if a.include? ':'`, you will have something in line_array[1]
[16:35:46] baweaver: if you take most of those collections and demote them into a hash....
[16:35:50] baweaver: actually, you have a sample input file?
[16:36:16] adaedra: also, be careful that if you have more than one : in a line, everything starting at the second : will be thrown out
[16:37:02] negatifze: :) Sorry guys, not concerned at the moment with the most concise code or perfect input validation. Can assume for the time being that all inputs will be correct
[16:37:24] baweaver: but we want to live vicariously through your assignments D:
[16:38:04] baweaver: If you do want an idea of the concise version though, let us know.
[16:38:14] baweaver: I have a bad habit of doing that
[16:39:08] negatifze: baweaver: Yeah, I used Ruby quite a bit at an internship awhile back, and everyone was obsessed with "The Ruby Way", Sandi Metz, etc.
[16:39:23] negatifze: Haven't touched the language for awhile, but this project is a good fit for it
[16:39:28] baweaver: ....you're not from Missouri are you?
[16:39:38] negatifze: baweaver : Nope
[16:39:58] baweaver: I knew a few companies with Ruby internships there, one was super religious about it.
[16:40:11] negatifze: I think "the ruby way" and Sandi Metz are common elements with ruby shops
[16:40:32] negatifze: Personally I think it doesn't really matter, but... whatever
[16:40:35] adaedra: never heard of that.
[16:40:38] baweaver: The Ruby Way is a bit of a tome honestly
[16:40:47] baweaver: Eloquent Ruby is a bit more concise.
[16:41:21] baweaver: Metz has some good points across the board, but noted in one of her talks that the 5-line method rule was more of a harsh set for a particularly bad company
[16:41:37] baweaver: See also the book list in the channel topic.
[16:42:13] negatifze: Oh, from what I've read she has some great ideas
[16:42:31] ramfjord: has joined #ruby
[16:43:06] negatifze: I think some people can be a little to anal about conforming to her practices
[16:43:25] Guest96: has joined #ruby
[16:43:26] baweaver: just wait until you discover style guides.
[16:43:27] agent_white: has joined #ruby
[16:44:11] baweaver: tip: code reviewers who have nothing to add but style comments are typically seen as very junior
[16:44:28] mooser: has joined #ruby
[16:45:02] obzidian: i think sometimes people lose focus on what style guides and best practices recommendations are meant for
[16:45:24] obzidian: Metz did mention that the rules laid out are kind of a guideline to avoid straying off the beaten path
[16:45:40] obzidian: however when you're experienced enough, you tend to develop that instinct for knowing when and when not to stray
[16:46:42] negatifze: in general I think the best practices are great, and should be adhered to... But at this place, my impression was that the code base was absurdly over-complicated, with layers and layers of abstractions to dig through. And you're about THIS? :)
[16:46:46] baweaver: just make the linter break the build, and that fixes most everything.
[16:46:56] agent_white: Mornin' folks
[16:48:21] baweaver: 'Any fool can make something complicated. It takes a genius to make it simple.'
[16:48:29] obzidian: negatifze: in general best practices became best because they fit 90% of the requirements for a project
[16:49:13] obzidian: baweaver: is that in refernce to making things unnecessarily abstracted?
[16:49:25] obzidian: lol glad i'm not alone
[16:49:29] baweaver: premature abstraction is the root of all evil
[16:49:45] obzidian: i've always found abstraction for the sake of abstraction to be a main cause for code becoming messy and easy to break in the first place
[16:49:58] baweaver: or: Too DRY makes things BRITTLE: Badly refactored into tiny things lacking expressiveness
[16:50:00] obzidian: too much abstraction = not so friendly to change (most of the times)
[16:50:17] negatifze: baweaver:That's great :) Never heard of BRITTLE
[16:50:24] davidmichaelkarr: has joined #ruby
[16:50:25] negatifze: I'll use that
[16:50:25] baweaver: I made it a few years back
[16:50:35] baweaver: because acronyms and fun
[16:51:05] baweaver: somewhere forever ago on Twitter under keystonelemur
[16:51:21] Xiti: has joined #ruby
[16:51:56] baweaver: because baweaver there is some sorority girl who's very confused about tech recruiters wanting her number
[16:56:05] pilne: has joined #ruby
[16:58:02] synthroid: has joined #ruby
[16:58:30] petruff: has joined #ruby
[17:00:45] patarr1: has joined #ruby
[17:00:48] shinnya: has joined #ruby
[17:01:14] saslam: has joined #ruby
[17:02:56] rakm: has joined #ruby
[17:04:06] hxegon: that's one strategy to avoid them :)
[17:06:37] saslam: has joined #ruby
[17:06:39] stupidsenpai: has joined #ruby
[17:06:41] __Yiota: has joined #ruby
[17:06:42] cerulean: i fucking hate cybercoders
[17:06:57] chouhoulis: has joined #ruby
[17:08:57] Fasort: has joined #ruby
[17:09:57] baweaver: cerulean: offtopic?
[17:11:48] saslam: has joined #ruby
[17:15:07] patarr: has joined #ruby
[17:20:20] howdoi: has joined #ruby
[17:22:42] __Yiota: has joined #ruby
[17:25:27] FoX_77: has joined #ruby
[17:27:07] patarr: has joined #ruby
[17:27:11] milardovich: has joined #ruby
[17:29:56] duderonomy: has joined #ruby
[17:30:27] cerulean: baweaver: sorry. saw recruiters mentioned
[17:30:33] cerulean: got triggered
[17:31:52] Cohedrin: has joined #ruby
[17:34:57] saslam_: has joined #ruby
[17:40:33] phoo1234567: has joined #ruby
[17:41:50] govg: has joined #ruby
[17:42:43] __Yiota: has joined #ruby
[17:47:51] cfec0b8d: has joined #ruby
[17:55:54] hkdsun: has joined #ruby
[18:01:00] ElDoggo: has joined #ruby
[18:01:12] planigan: has joined #ruby
[18:01:30] ElDoggo: has joined #ruby
[18:02:54] bungoman_: has joined #ruby
[18:04:00] kies: has joined #ruby
[18:05:31] naprimer_2: has joined #ruby
[18:12:31] mooser: has joined #ruby
[18:12:51] esObe: has joined #ruby
[18:14:32] j2k: has joined #ruby
[18:14:49] mim1k: has joined #ruby
[18:14:51] Guest96_: has joined #ruby
[18:17:22] _main_: has joined #ruby
[18:20:50] bsartek: has joined #ruby
[18:21:26] xall: has joined #ruby
[18:22:13] chouhoul_: has joined #ruby
[18:22:23] petruff: has joined #ruby
[18:35:30] chouhoulis: has joined #ruby
[18:39:38] hkdsun: has joined #ruby
[18:42:13] solocshaw: has joined #ruby
[18:48:05] ltem: has joined #ruby
[18:48:12] ltem: has left #ruby: ()
[18:51:31] jusa: has joined #ruby
[18:55:20] lyy: has joined #ruby
[18:55:43] lyy: I got an error message
[18:57:24] bheesham: has joined #ruby
[18:58:29] lyy: I've tried to install new version of ruby. After, I installed it.
[18:58:57] lyy: ruby -v ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
[18:59:23] lyy: It wasn't updated to the latest version. what should I do
[18:59:32] jakkn: has joined #ruby
[19:02:13] lyy: I've tried to set up rails on my Macbook Air
[19:02:39] ledestin: has joined #ruby
[19:03:57] Fasort: has joined #ruby
[19:04:08] swills: has joined #ruby
[19:04:28] xMopxShell: has joined #ruby
[19:06:20] lmc: has joined #ruby
[19:06:25] ptx0: has joined #ruby
[19:08:11] Rodya_: has joined #ruby
[19:14:16] lmc: has joined #ruby
[19:14:21] baweaver: lyy: http://ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you
[19:14:34] Arpanet69: has joined #ruby
[19:17:03] mooser: has joined #ruby
[19:17:37] cerulean: thank you for linking my liege
[19:18:07] outreachdan: has joined #ruby
[19:22:22] ferr: has joined #ruby
[19:22:28] hutch34_: has joined #ruby
[19:22:33] chouhoulis: has joined #ruby
[19:34:11] milardovich: has joined #ruby
[19:34:32] KnownSyntax: has joined #ruby
[19:34:33] KnownSyntax: has joined #ruby
[19:35:30] __Yiota: has joined #ruby
[19:43:41] dasher^0_o: has joined #ruby
[19:45:01] cr3: has joined #ruby
[19:46:40] cr3: if I have "module Foo" contain "extend Bar" and then I set "Foo::VAR = 1" and it seems that the methods defined in Bar can't see VAR, is there a way for Bar to see VAR somehow?
[19:48:33] mim1k: has joined #ruby
[19:49:39] jgt2: has joined #ruby
[19:52:01] ahrs: has joined #ruby
[19:55:16] machinewar: has joined #ruby
[19:58:34] KnownSyntax: has joined #ruby
[19:58:38] cerulean: Radar: you should fork ceruversion and change the name and the divident to 1000 and call it ryanversion and make it free for open source users (it already is but stipulate this so they will use it)
[19:59:05] cerulean: that way rails will have a reasonable version number, like 35.6
[20:01:32] marcdel: has joined #ruby
[20:05:17] baweaver: cerulean: completely off topic.
[20:05:30] baweaver: having a hard time not seeing you as a troll
[20:06:05] jdawgaz: has joined #ruby
[20:12:43] jakkn: has left #ruby: ()
[20:14:21] govg: has joined #ruby
[20:17:02] patr0clus: has joined #ruby
[20:17:04] milardovich: has joined #ruby
[20:19:57] mooser: has joined #ruby
[20:23:24] yqt: has joined #ruby
[20:24:43] jrafanie: has joined #ruby
[20:25:03] Xiti: has joined #ruby
[20:26:08] jud^: has joined #ruby
[20:32:06] ryan_notabot: has joined #ruby
[20:32:10] Lucky_ABA: has joined #ruby
[20:32:38] haylon: has joined #ruby
[20:32:56] ryan_notabot: has joined #ruby
[20:33:53] Verity: has joined #ruby
[20:33:56] Verity: still loving ruby
[20:35:22] jnj: has joined #ruby
[20:36:35] jnj: Hey y'all, does anyone have any tips for printing out the root to leaf paths of a non-binary tree? The structure of my nodes is basically a variable for data and an array that represents the children of that node.
[20:37:05] milardovich: has joined #ruby
[20:37:23] chouhoul_: has joined #ruby
[20:37:27] Verity: data structrues hw in ruby? awesome
[20:37:51] Verity: so you represent your tree in an array?
[20:38:45] ResidentBiscuit: has joined #ruby
[20:38:49] jnj: Nah not data structures hw in ruby, just doing some programming questions ( I would love if my data structures class was in ruby )
[20:39:06] Verity: mine was c++ :)
[20:39:39] Verity: so is this really a tree you have?
[20:39:40] jnj: My tree is represented via Nodes. Nodes have node.data, and node.children, where node.children is just an array of nodes. So to add a child to a parent node I do node.children << Node.new
[20:40:26] Verity: but traversing this tree is proving problematic?
[20:40:32] jnj: My code works perfectly in building up my tree, I'm just messing up on printing out that tree.
[20:40:46] jnj: Traversing it isn't actually that hard, I'm just missing out on reprinting parents
[20:41:26] enterprisey: has joined #ruby
[20:41:32] jnj: Here's an example structure (root -> a -> b -> c), (root -> d -> e -> f) (d -> g -> h)
[20:41:58] jnj: And I'd want it to print out: a b c, d e f, d g h, but it'll do a b c, d e f, g h (so missing printing d a second time)
[20:46:08] jgt2: has joined #ruby
[20:47:30] al2o3-cr: jnj: i'd try and help but i've had to many zubr :(
[20:47:46] jnj: alzo3-cr: zubr?
[20:48:00] al2o3-cr: jnj: might be worth gisting your code
[20:48:40] jnj: al203-cr: Is using something else besides gist alright? I don't like gist that much
[20:48:48] t-recx: has joined #ruby
[20:49:00] al2o3-cr: jnj: i suppose so yeah
[20:49:31] al2o3-cr: try not to use pastebin.com though
[20:49:40] jnj: al203-cr: Word, Ill probably post in a little bit I want to spend more time on this problem. What's wrong with pastebin?
[20:49:52] jnj: al203-cr: Also, is passing blocks beneficial for recursion?
[20:50:12] jnj: I don't know a lot about blocks but I saw someones print for a tree online using blocks
[20:50:19] al2o3-cr: jnj: tab complete my nick
[20:50:42] al2o3-cr: also, blocks is a whole different thing
[20:51:00] al2o3-cr: jnj: you learning ruby?
[20:51:04] jnj: al2o3-cr, thanks I dind't know I can do tab complete for nicknames
[20:51:14] al2o3-cr: jnj: that quite alright
[20:51:42] jnj: al2o3-cr, I know a bunch of ruby, I've been working on a rails app thats going into prod, I just don't know much about yield and using & with passing blocks
[20:52:51] al2o3-cr: jnj: you need to learn ruby first (to the best of your ability)
[20:53:06] al2o3-cr: before jumping on rails
[20:53:56] al2o3-cr: it's a fundemental building block
[20:54:04] solocshaw: has joined #ruby
[20:54:08] Verity: hes already written a rails app that is gooing into prod.
[20:54:14] Verity: no need to learn ruby now =P
[20:54:20] baweaver: See the topic for a book list, but Eloquent Ruby is a good read
[20:54:24] baweaver: Verity: ...
[20:54:36] jnj: al2o3-cr, I'd say I know ruby fairly well, I've read large portions of eloquent ruby and well-grounded rubyist, and have coded data structures and algs using ruby. I've read about blocks a ton of times, I;m just not sure how they work
[20:54:38] Verity: my point is, very often we see this in reverse
[20:54:47] jnj: baweaver: eloquent ruby is goat
[20:55:15] jnj: Verity: I learned ruby first before jumping into rails. I initially wanted to learn ruby just for rails, but then I just fell in love with ruby because its a dope progamming langauge
[20:55:18] baweaver: As far as Ruby blocks, search around Google for a bit for detailed tutorials. There are a few good ones out there. I think RubyMonk had a few.
[20:55:37] baweaver: see if I can find a good one or two
[20:55:43] baweaver: if not I'll just write one.
[20:56:41] al2o3-cr: just amazes me how one can deploy a rails app for production and not fully understanding the magic which is blocks
[20:57:18] al2o3-cr: jnj: not slagging you off or anything :)
[20:57:46] jnj: al2o3-cr, haha no I got you. I know that blocks are super important within the structure of rails
[20:57:51] baweaver: https://mixandgo.com/blog/mastering-ruby-blocks-in-less-than-5-minutes - This reads fairly well
[20:58:04] jnj: al2o3-cr, and i believe singleton methods too, i think?
[20:58:09] baweaver: jnj: what other languages have you done?
[20:58:16] baweaver: / worked with
[20:58:33] mooser: has joined #ruby
[20:59:16] al2o3-cr: jnj: singleton methods are just instance methods upon the class definition
[20:59:21] baweaver: because if Javascript is in there then: [1,2,3].map { |v| v * 2 } ~ [1,2,3].map(function (v) { return v * 2; }) ~ [1,2,3].map(v => v * 2)
[20:59:49] jnj: baweaver: I've done java, php, I'm real bad with javascript haha. I only use it when I need to move divs around
[20:59:56] al2o3-cr: baweaver: you forgot the semicolon :P
[21:00:14] Guest96: has joined #ruby
[21:00:21] baweaver: There's one in there, the other two are taken care of with ASI
[21:00:24] al2o3-cr: no you didn't (my eyes)
[21:00:52] cdg: has joined #ruby
[21:00:58] Guest96: has joined #ruby
[21:01:06] Rodya_: has joined #ruby
[21:01:30] hutch34_: has joined #ruby
[21:02:15] jnj: But anyway basically I'm trying to print out a tree like structure using the logic here: http://www.geeksforgeeks.org/given-a-binary-tree-print-out-all-of-its-root-to-leaf-paths-one-per-line/. So far it's working well, except instead of printing out (and with each one on a new line) [a, b, c][d, e, f][d, e, g] it just keeps on adding the the array, so the output becomes [a, b, c][a, b, c, d, e, f][a, b, c, d, e, f, g, h]
[21:03:22] jnj: But I think my understanding of the problem is wrong
[21:03:27] Verity: is it really a tree?
[21:03:47] baweaver: where was your code on that?
[21:03:57] jnj: I can post my code
[21:04:06] baweaver: yeah, throw it in a gist or something
[21:04:16] baweaver: probably you're mutating the array in an odd way.
[21:04:32] chouhoulis: has joined #ruby
[21:06:46] Rodya_: has joined #ruby
[21:07:23] jnj: Is pastebin alright or nah? I dislike gist
[21:07:38] baweaver: the bot will nag you
[21:08:50] bsartek: has joined #ruby
[21:10:39] jnj: whoops, I just realized i gotta meet with someone so I can't really work on this now :(
[21:10:43] jnj: I'll probably show up later tho
[21:10:49] jnj: thanks for all of your help y'all
[21:11:08] jgt: has joined #ruby
[21:13:00] __Yiota: has joined #ruby
[21:16:03] zcrawfor: has joined #ruby
[21:16:18] al2o3-cr: why does `ObjectSpace::InternalObjectWrapper.new/allocate` seg fault?
[21:16:33] rgtk: has joined #ruby
[21:16:37] DLSteve: has joined #ruby
[21:17:19] al2o3-cr: on ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
[21:18:07] baweaver: ACTION does not have the requisite C knowledge to know
[21:19:03] enterprisey: has joined #ruby
[21:22:57] jamesaxl: has joined #ruby
[21:25:03] agent_white: has joined #ruby
[21:25:26] al2o3-cr: Pointer[Pointer[dlwrap ObjectSpace.reachable_objects_from(Array)[7]].ref[0,4].unpack1('l')].to_value # this shouldn't happen
[21:27:35] al2o3-cr: why that segfaults is beyond me
[21:29:36] KnownSyntax: has joined #ruby
[21:29:56] jdawgaz: has joined #ruby
[21:38:49] cdg: has joined #ruby
[21:39:01] jusa: has joined #ruby
[21:39:41] ozcanesen: has joined #ruby
[21:41:57] ColeHub: has joined #ruby
[21:41:58] al2o3-cr: >> require 'fiddle'; require 'objspace'; include Fiddle; Pointer[Pointer[dlwrap ObjectSpace.reachable_objects_from(Array)[7]].ref[0,4].unpack('l')[0]].to_value
[21:41:59] ruby[bot]: al2o3-cr: # => #<InternalObject:0x41683620 T_IMEMO> (https://eval.in/777998)
[21:42:23] Fasort: has joined #ruby
[21:42:29] al2o3-cr: hmm, strange
[21:42:32] ytti: seeing require 'objspace' in code is much like friend popping uninvited with bottle of vodka
[21:42:38] ytti: you know you're headed for an adventure
[21:43:02] al2o3-cr: ytti: that is expected results though
[21:43:07] al2o3-cr: >> RUBY_VERSION
[21:43:08] ruby[bot]: al2o3-cr: # => "2.3.0" (https://eval.in/777999)
[21:43:20] al2o3-cr: on 2.4.0p0 it segfaults
[21:46:44] marr: has joined #ruby
[21:47:42] antgel: has joined #ruby
[21:51:00] elifoster: has joined #ruby
[21:56:39] EXCHGR: has joined #ruby
[21:57:08] Azure: has joined #ruby
[21:58:55] millerti: has joined #ruby
[22:03:32] br0d1n: has joined #ruby
[22:09:07] HoierM: has joined #ruby
[22:11:05] HoierM: has joined #ruby
[22:15:21] postmodern: has joined #ruby
[22:18:20] jdawgaz: has joined #ruby
[22:23:08] cerulean: sorry you can't take my zany insane somewhat math and programming based weirdo humor baweaver
[22:24:20] cerulean: i'm very curious about what makes a non-integer, high version number so unappealing tho
[22:24:54] cerulean: i make a very good argument for how rails is version 36.5
[22:25:32] patr0clus: has joined #ruby
[22:33:18] al2o3-cr: cerulean: hey?
[22:33:41] cerulean: hey whats up al2o3-cr
[22:34:12] al2o3-cr: cerulean: just wondering what you are talking about tia
[22:34:19] skweek: has joined #ruby
[22:34:33] cerulean: https://github.com/mixflame/ceruversion
[22:34:39] cerulean: a very bad versioning program i wrote in crystal
[22:35:09] cerulean: it is very bad and sinful. but not evil. to add more insult to injury, it's a far ass 2mb program that's like probably not much more than 25 lines of code
[22:35:21] cerulean: ceruversion: YOU WHALE !!!!
[22:35:32] cerulean: ask crystal designers to make llvm compilation slim as fuck
[22:36:47] al2o3-cr: i was gonna diddle in crystal but never persued
[22:37:11] _bet0n: has joined #ruby
[22:39:52] cerulean: www.crystal-lang.org
[22:39:56] cerulean: use the force, luke
[22:40:06] _bet0n: Hello folks! :) I have a question. How can I properly replace a regexp match with variable value?
[22:40:06] _bet0n: For example there is a string containing a substring like 6000K for which I should use /\d{4}K as a regular expression if I understand it correctly.
[22:40:06] _bet0n: I tried the regexp on Rubular and it worked flawlessly
[22:40:30] _bet0n: Is it that simple?
[22:40:33] cerulean: i said wrong
[22:40:53] cerulean: "foo".gsub(/(o+)/, '\1\1\1')
[22:40:57] cerulean: gsub will do it
[22:41:12] cerulean: i see your question now
[22:41:20] cerulean: ruby version might be wrong. try setting ruby version on rubular
[22:41:20] cdg_: has joined #ruby
[22:42:04] _bet0n: I am using the highest version available there. 2.1.5
[22:42:45] jcao219: has joined #ruby
[22:42:50] cerulean: ruby 2.4 is the latest ruby. so their expressions might be too old and not work anymore
[22:42:59] Radar: _bet0n: What is your input and expected output?
[22:43:01] al2o3-cr: _bet0n: use parens
[22:43:09] cerulean: best idea is to use 2.4 regex manual ... and irb. and listen to radar ;)
[22:43:16] cerulean: ACTION exits stage left
[22:45:14] _bet0n: Radar: so input is for example "LED Bulb E17 4W A60 6000K" and expected output is "LED Buld E17 4W A60 Cold White"
[22:45:33] Radar: _bet0n: Right. Thanks. Give me a moment.
[22:45:48] _bet0n: Radar: String "Cold White" is stored in a light_color variable
[22:46:07] Radar: >> light_color = "Cold White"; "LED Bulb E17 4W A60 6000K".gsub("6000K", light_color)
[22:46:08] ruby[bot]: Radar: # => "LED Bulb E17 4W A60 Cold White" (https://eval.in/778035)
[22:46:13] ruby[bot]: Radar: I don't know anything about next
[22:46:18] Radar: ruby[bot]: oh my god.
[22:47:09] al2o3-cr: i was thinking something totally diff
[22:47:36] _bet0n: Radar: Yeah but I am trying to use regexp because they both change with product. The value in Kelvins in the string and light colour as well
[22:48:02] _bet0n: Value is always 4 digits ending with capital K
[22:48:36] baweaver: Look at the block form of gsub
[22:48:41] `derpy: http://ruby-doc.org/core-2.4.1/Kernel.html#method-i-gsub
[22:48:56] al2o3-cr: _bet0n: yeah use \d{4} then
[22:49:30] rakm: has joined #ruby
[22:53:19] _bet0n: Thank you. Let me have a look. I have to find a solution :D
[22:53:41] al2o3-cr: use sub if you don't want to globally substitute
[22:54:22] ryan_notabot: has joined #ruby
[22:54:26] jgnagy_: has joined #ruby
[22:54:33] al2o3-cr: meaning every occurence in the string
[22:56:51] Fasort: has joined #ruby
[22:57:20] mooser: has joined #ruby
[22:57:26] sumobob: has joined #ruby
[23:00:05] _bet0n: Ok. Thank you for help guys. As usual it was all my fault. I just forgot to use proper escaping in regular expression and I used gsub! instead of gsub :D Now it works flawlessly :)
[23:00:19] _bet0n: title.gsub(/\d{4}K/, light_color).to_s does the trick :)
[23:00:53] _bet0n: Anyway. Thank you all I appreciate your kindness :)
[23:01:06] al2o3-cr: _bet0n: why .to_s?
[23:01:42] esObe: has joined #ruby
[23:02:00] _bet0n: It might be because it is a nokogiri node I am working with
[23:02:08] _bet0n: So Ruby asks for method
[23:02:38] al2o3-cr: _bet0n: gsub only works on strings and returns a string
[23:03:26] _bet0n: I don't know then. Now it works without the method specified
[23:03:27] al2o3-cr: well unless you use the block form, but ...
[23:03:39] _bet0n: I am not using the block form.
[23:04:37] elifoster: has joined #ruby
[23:04:39] _bet0n: Just try to understand me. I am still in process of learning Ruby :) Sometimes I get lost :)
[23:04:54] plujon: has joined #ruby
[23:05:22] al2o3-cr: _bet0n: yeah, no worries :)
[23:05:45] jrm: Newbie questions: Is https://ruby.github.io/openssl/ part of ruby itself or is it a separate gem that needs to be installed? If it is part of ruby, why does the ostatu2 gem list it as a runtime dependency?
[23:06:42] username1: has joined #ruby
[23:08:11] coatezy: has joined #ruby
[23:12:07] r3m: has joined #ruby
[23:13:17] havenwood: jrm: OpenSSL is part of the stdlib but has been gemified so it can be updated separately from Ruby releases.
[23:13:42] jrm: havenwood: Great. Thanks. :)
[23:13:44] havenwood: ACTION jrm: https://bugs.ruby-lang.org/issues/9612
[23:13:46] havenwood: jrm: https://github.com/ruby/openssl
[23:13:48] al2o3-cr: jrm: it's a seperate gem now; the default is what is packaged with ruby
[23:14:58] havenwood: ACTION al2o3-cr: The difference is that tk was gemified and removed from the stdlib: https://bugs.ruby-lang.org/issues/8539
[23:16:39] al2o3-cr: havenwood: ah, TIL
[23:17:52] al2o3-cr: it was so simple to gui though :(
[23:18:26] havenwood: it's a gem: gem install tk
[23:18:32] havenwood: same 'ole tk
[23:20:13] al2o3-cr: of course :)
[23:21:35] al2o3-cr: what does everyone else get; `gem list --local | wc -l` # 91
[23:22:33] al2o3-cr: gotta be a > 999
[23:24:30] al2o3-cr: well `printf $(($(gem list --local | wc -l) - 3))`
[23:25:23] Ziarkaen: has joined #ruby
[23:26:50] r3m: has joined #ruby
[23:30:36] TinkerTyper: has joined #ruby
[23:36:07] Jameser: has joined #ruby
[23:38:03] GodFather: has joined #ruby
[23:40:51] millerti: has joined #ruby
[23:42:09] jcao219: has joined #ruby
[23:44:57] al2o3-cr: why different results `Socket.gethostbyname('ipinfo.io') == TCPSocket.gethostbyname('ipinfo.io')`
[23:46:01] al2o3-cr: one gives dotted oct notation other the actual sock binary string
[23:47:24] KI6ESH: has joined #ruby
[23:48:26] KI6ESH: has left #ruby: ()
[23:50:04] Guest16109: has joined #ruby
[23:52:00] KI6ESH: has joined #ruby
[23:55:43] mooser: has joined #ruby
[23:56:50] KI6ESH: has left #ruby: ()
[23:57:18] CloCkWeRX: has joined #ruby
[23:59:32] Lucky_ABA: has joined #ruby