« Back to channel list

#ruby - 16 February 2018

Forward 1 day »
[06:41:55] helpa: has joined #ruby
[06:42:54] pelegreno: has joined #ruby
[06:43:55] kies: has joined #ruby
[06:46:55] helpa: has joined #ruby
[06:51:10] alex``: has joined #ruby
[06:54:58] clemens3: has joined #ruby
[06:57:22] n008f4g_: has joined #ruby
[06:57:50] darkhanb: has joined #ruby
[07:02:08] apeiros_: has joined #ruby
[07:02:42] hairui: has joined #ruby
[07:07:19] konsolebox: has joined #ruby
[07:08:31] bigblind: has joined #ruby
[07:09:55] mtkd: has joined #ruby
[07:09:57] workmad3: has joined #ruby
[07:09:58] darkhanb: has joined #ruby
[07:14:32] claudiuinberlin: has joined #ruby
[07:16:18] konsolebox: has joined #ruby
[07:18:19] dionysus69: has joined #ruby
[07:24:46] konsolebox: has joined #ruby
[07:26:29] snickers: has joined #ruby
[07:29:46] aufi: has joined #ruby
[07:32:16] vutral|kali: has joined #ruby
[07:32:17] vutral|kali: has joined #ruby
[07:37:06] vyorkin: has joined #ruby
[07:38:10] hairui: has joined #ruby
[07:39:39] anisha__: has joined #ruby
[07:43:07] Matthew1: has joined #ruby
[07:43:47] Matthew1: has joined #ruby
[07:44:19] conta: has joined #ruby
[07:46:43] anisha_: has joined #ruby
[07:51:39] imtryingtolearn: has joined #ruby
[07:57:01] apeiros_: has joined #ruby
[07:59:28] roonsauce: has joined #ruby
[08:05:07] hairui: has joined #ruby
[08:13:47] aupadhye: has joined #ruby
[08:16:42] hairui: has joined #ruby
[08:17:01] TomyWork: has joined #ruby
[08:17:30] clemens3: has joined #ruby
[08:17:36] konsolebox: has joined #ruby
[08:21:21] mello: has joined #ruby
[08:22:57] vondruch: has joined #ruby
[08:28:33] schneide_: has joined #ruby
[08:31:39] jackrandom: has joined #ruby
[08:31:58] ramfjord: has joined #ruby
[08:36:20] Bish: IT'S SO QUIET IN HERE
[08:36:53] apeiros_: THAT'S NO REAON TO START SHOUTING!
[08:37:10] konsolebox: has joined #ruby
[08:37:41] Bish: BUT I AM BORED I WANT TO SEE DISCUSSIONS ABOUT RUBY
[08:38:04] apeiros: THEN BE THE CHANGE YOU'RE LOOKING FOR!
[08:38:28] Bish: GIL sucks, agree?
[08:38:37] schneide_: has joined #ruby
[08:39:54] apeiros: I'd prefer it to be gone, but I'm not sure how that can be achieved without major breaks.
[08:39:57] Bish: there is the part that sucks, being global, and the part that doesn't it mutexes
[08:40:34] Bish: well, for example? except native gems?
[08:40:35] apeiros: then again, jruby doesn't have gil. so maybe ruby should just jump in the cold water with a long enough preparation time
[08:40:44] cajone: has joined #ruby
[08:40:45] alex``: has joined #ruby
[08:40:53] Bish: jruby isn't ruby too me, ỳou'll always end up having stupid gems you need
[08:40:56] Bish: which don't work on jruby
[08:40:57] apeiros: I think native gems are the only reason
[08:41:10] cajone: has left #ruby: ()
[08:41:16] apeiros: which is why jruby can get rid of GIL
[08:41:26] apeiros: (since does gems don't work with it anyway)
[08:41:47] Bish: i always figured the GIL was implementation specific
[08:41:47] apeiros: well, if you really want, there's ways to have native C gems in jruby.
[08:42:03] apeiros: I think that's a correct statement
[08:42:27] Bish: i always thought the GIL wasn't in jruby because jvm already has mutexes and stuff
[08:42:36] Bish: btw, i never got jruby to work
[08:43:38] apeiros: `rvm install jruby; rvm use jruby; ruby -v # yay`
[08:43:54] Silthias1: has joined #ruby
[08:43:55] Bish: i try to go around these things
[08:43:59] Bish: rvm,chruby
[08:44:00] apeiros: I'd assume that to be similarly easy for other ruby version managers
[08:44:09] Bish: they always lead me to more problems than solutions
[08:44:13] apeiros: oh, well, your loss I guess?
[08:44:19] Bish: not really, really
[08:44:23] apeiros: hm, can't confirm
[08:44:32] apeiros: I've used rvm for years
[08:44:51] apeiros: and the only issue I remember having was related to how it one day started to automatically do `bundle exec` for you
[08:44:53] Bish: i spent hours multiple times, figuring out what went wrong with some gem installed somewhere else
[08:45:11] Bish: or when switching users environment changed
[08:45:35] Bish: a.e. wanted to have a ruby script has a e-mail-bouncer for postfix
[08:45:47] Bish: and no matter what i did, postfix wouldn't call the rvm ruby
[08:45:58] Bish: ended up doing something likee
[08:46:08] Bish: bash -c "chruby && ruby somescript.rb"
[08:46:08] apeiros: rvm uses wrappers for that
[08:46:09] Bish: so stupid
[08:46:20] Bish: apeiros: yeah ORR you just install it the right way
[08:46:42] apeiros: which fails for jruby? :)
[08:46:45] Bish: i never get surprised when having ruby installed by a package manager
[08:46:52] Bish: that might be me, i might be too stupid for java
[08:47:01] roshanavand: has joined #ruby
[08:47:09] Bish: jruby isn't in gentoo as a package (i think)
[08:47:15] Bish: and i never ran it manually
[08:48:10] Bish: i gave up really quick, most of the times, too
[08:48:27] Bish: the fact not having native gems will fuck me up, too
[08:49:12] Silthias1: has left #ruby: ()
[08:49:20] apeiros: I actually don't use many native gems. and those I do have a jruby pendant
[08:49:35] Bish: i love sequel, sequel loves postgresql
[08:49:42] Terens: has joined #ruby
[08:49:46] Bish: sequel needs "pg" to work fast and have some features for postgresql
[08:49:50] Bish: => i would already be mad
[08:49:58] Bish: if i couldn't use LISTEN on postgresql
[08:50:14] Terens: I want to run multiple tools concurrently. Is IO.popen good for ths?
[08:50:29] Terens: open3 fires a new thread too I dont want that
[08:50:52] Bish: terens: do you also dislike fork?
[08:51:10] Terens: popen forks i think
[08:51:33] Bish: then i guess, if it does what you want
[08:51:41] Bish: you'll be fine?
[08:51:54] Terens: I dont know which is better to do (or maybe use something else)
[08:53:55] Bish: it sounds like it's the reason popen exists(+ ipc between processesk
[08:54:58] Bish: uhh matz himself worked on pg
[08:55:14] apeiros: terens: depends on what you want to do. IO.popen works fine, but has some limits. If those limits are a problem for you, then Kernel#spawn is the swiss army knife of invoking other processes.
[08:55:48] apeiros: (or Process.spawn, if you don't like the global nature of Kernel#spawn)
[08:56:13] Bish: what would those limits be?
[08:56:57] apeiros: Bish: no pid, stdout & stderr mixed. probably some others. look through spawn's docs, there might be some things popen can't do.
[08:57:14] Bish: ohshit that's horrible
[08:57:27] apeiros: no pid is particularly problematic if you want to Process.wait on the subprocess.
[08:57:44] apeiros: (or any variant of wait, iirc I usually use wait2)
[08:58:21] Bish: man i wish ruby was fast and concurrent
[08:58:36] Bish: would make my life 10% better, i know that's sad, but it is
[09:02:20] ianfleeton: has joined #ruby
[09:03:50] Terens: I am thinking trying IO.popen and IO.select though
[09:04:20] Terens: something like this
[09:04:20] Terens: https://gist.github.com/chrisn/7450808
[09:04:40] bigblind: has joined #ruby
[09:04:55] Terens: but this uses open3
[09:05:46] apeiros: terens: `if ready` will always be true
[09:05:56] apeiros: for IO.select to return nil you have to provide a timeout
[09:07:51] vutral|kali: i thought ruby is concurrent
[09:08:08] beauby: has joined #ruby
[09:08:34] dminuoso: vutral|kali: What do you mean by "concurrent"
[09:08:35] apeiros: vutral|kali: it is
[09:08:40] apeiros: it's just not parallel
[09:08:41] marr: has joined #ruby
[09:08:54] apeiros: or rather, mri/cruby is mostly not parallel
[09:09:35] tvw: has joined #ruby
[09:09:53] dminuoso: At least not the interpreter itself. You can still benefit from parallelism if threads spend time in blocking IO.
[09:09:58] dminuoso: (Or more generally blocking syscalls)
[09:10:39] dminuoso: apeiros: Is it wrong to call it "interpreter" when in fact we have YARV?
[09:10:44] apeiros: native gems can have parallelism too. I think that's rarely used, though.
[09:10:44] dminuoso: ACTION is pondering about his mistakes
[09:10:56] apeiros: dminuoso: meh, colloquialisms are fine IMO?
[09:12:09] apeiros: also people use terms like "transpilers" when the term "compiler" fits just fine too, so whatevs 😂
[09:13:02] RougeR: has joined #ruby
[09:13:03] RougeR: has joined #ruby
[09:14:10] dminuoso: apeiros: https://ro-che.info/ccc/20
[09:14:34] mtkd: has joined #ruby
[09:15:01] apeiros: though I think JS as a compilation target will soon be replaced by webasm.
[09:15:38] apeiros: and honestly I burn to take up that old pet language of mine again and finally write a compiler, and webasm seems like a fine target.
[09:15:57] apeiros: but alas, too many other things to do :(
[09:17:24] Bish: are you talking about ruby?
[09:17:39] Bish: ruby webasm would be so awesome
[09:17:44] dminuoso: No it would not.
[09:17:48] dminuoso: Most certainly not.
[09:17:50] Bish: sure it would
[09:17:53] apeiros: no, I wasn't. and yes, it ouwld be.
[09:17:57] govg: has joined #ruby
[09:18:04] apeiros: (sorry dminuoso, there we go again, we disagree :D)
[09:18:06] milardovich: has joined #ruby
[09:18:07] Bish: i played around with ruby react bindungs
[09:18:15] Bish: it was awesome.. like superawesome
[09:18:20] Bish: but load times destroyed the idea for me
[09:18:30] Bish: and code size
[09:18:31] dminuoso: Bish: You mean react-rails?
[09:18:35] dminuoso: It's horror.
[09:18:41] Bish: no, i wrote my own
[09:18:43] apeiros: I'd love to replace those stupid javascript files in my websites & -apps with ruby
[09:19:08] Bish: i had a little framework, where you had models which get synchronized via websockets, where you write react-components with ruby
[09:19:09] apeiros: I could use opal, but I'm not sure I want that.
[09:19:10] dminuoso: apeiros: Im preparing myself to dive into PureScript. :-P
[09:19:21] Bish: and it had hot reloading
[09:19:36] zleap: i seem to get a lot of errors on sites saying this script has stopped, or i get that in e-mails as i think people have this idea e-mail needs some sort of scripting
[09:19:37] Bish: developing in it was superawesome.. but as i said.. helloworld was 2mb.js or something
[09:19:37] elomatreb: ACTION *boooooooooh, I am the ghost of CoffeeScript that haunts the asset pipeline*
[09:19:52] Bish: dminuoso: why not write something like that with haskell
[09:19:53] dminuoso: ACTION shoots elomatreb
[09:19:56] Bish: that would be as awesome
[09:20:09] Bish: FRP in the browser, where model client ⇔ model_server
[09:20:17] Bish: im dreaming about this ever since i first thought about it
[09:20:25] dminuoso: Bish: Most React people dont even know what real FRP is about.
[09:20:30] dminuoso: And Im not talking about this fake discrete FRP.
[09:20:46] Bish: yeah that's why something like reflex(in good) would be awesome
[09:21:03] Bish: in completition with a model framework with communicates with the server
[09:21:10] Bish: one language for everything
[09:21:26] dminuoso: Bish: Im seriously craving for denotational semantics.
[09:21:27] Bish: as i said, i did this in ruby, it was awesome, but slow and big
[09:21:35] dminuoso: Dunno if there's any good FRP solution around yet that has denotational semantic.
[09:21:58] Bish: it would be more awesome in pure FP, but also harder
[09:22:35] ramfjord: has joined #ruby
[09:22:49] dminuoso: Bish: At any rate, Im still young in Haskell, so that topic still lies ahead of me.
[09:22:50] Bish: dminuoso: and yeah react-rails is horrible, but the idea behind that is good
[09:22:56] Bish: i think reactrb or hyperloop how it's called now
[09:23:03] dminuoso: Bish: Well the problem is webpack is.. a piece of. Ah well.
[09:23:06] Bish: dminuoso: that topic is young for everyone since none did that
[09:23:13] Bish: dminuoso: nobody who has the right mind does webpack
[09:23:23] Bish: i used some code of hyperloop & combined it with jspm
[09:23:25] ltem: has joined #ruby
[09:23:28] Bish: it worked like it was meant to do that
[09:24:16] Bish: i could write react components with ruby, and when i pressed "save" it reloaded on the page instantly with state preserved
[09:24:48] Bish: that what ruby-webasm would make possible
[09:24:51] soniya29: has joined #ruby
[09:25:59] Bish: maybe i should create that :o
[09:26:23] apeiros: go for it!
[09:26:31] Bish: webasm does not have threads yet, so does ruby :>
[09:26:47] Bish: in a sense, where they suck
[09:26:57] apeiros: yeah, webasm doesn't have threads, but ruby does?
[09:27:07] konsolebox_: has joined #ruby
[09:27:08] Bish: like only for IO
[09:27:15] apeiros: I think ruby without threads is an acceptable subset
[09:27:16] Bish: beause GIL comes like always
[09:27:22] zleap: webasm sounds like it uses assembler language
[09:27:41] Bish: zleap: it kinda is.. webasm acts like a CPU, kinda-ish
[09:27:43] Bish: bytecode
[09:27:48] apeiros: Bish: uh, you're wrong. threads != parallely executed threads. concurrent is already good.
[09:28:06] Bish: but for everything non-deterministic you will need to talk to the outside with javascript callbacks
[09:28:14] Bish: like web cryptominers, lolol
[09:28:15] apeiros: Bish: and until just a couple years ago, most computers didn't have multiple cores either. so no true parallelism was possible anyway.
[09:28:24] apeiros: and nowadays many VMs will only provide you one core too
[09:28:41] milardovich: has joined #ruby
[09:28:56] Bish: apeiros: i would do that ruby-webasm thing instantly if ruby compiled anywhere
[09:29:05] Bish: but as it is right now with MRI i would have to bring ruby to asm
[09:29:15] Bish: and then start code, which would be weird
[09:29:40] apeiros: macruby did have a compiler
[09:29:52] apeiros: it's not impossible. just difficult ;-)
[09:30:04] Bish: hm, yeah but is this stuff then compatible with gemsh
[09:30:30] Bish: and i don't know if ruby needs threads internally
[09:30:31] milardov_: has joined #ruby
[09:30:52] Bish: nah this idea is bullshit as long as ruby doesn't compile to something
[09:31:07] devil_tux: has joined #ruby
[09:31:34] apeiros: webasm-ruby is necessarily a subset of ruby
[09:31:47] claudiuinberlin: has joined #ruby
[09:31:49] Bish: well i don't want a language that looks like ruby
[09:31:52] Bish: this would be bs aswell
[09:32:00] Bish: i want to have a model ont he server side
[09:32:02] apeiros: and as said, ruby has been compiled "to something" before
[09:32:11] Bish: that works on the client side, just like it wasn't
[09:32:21] apeiros: and arguably even cruby compiles, after all, it does use an IL
[09:32:21] Bish: apeiros: as long as we don't have gems, that won't happen
[09:32:40] soniya29_: has joined #ruby
[09:32:46] apeiros: I have a differing opinion.
[09:32:54] Bish: that is not an opinion
[09:33:03] apeiros: being able to replace javascript with ruby is a lot of value on its own, even without gems.
[09:33:03] Bish: if your model has a gem, and it does not work in the client
[09:33:07] Bish: you will be frustrated
[09:33:23] apeiros: yeah, so? will you be less frustrated when you translated it all to js?
[09:33:26] Bish: you've gained nothing, you have a language in the browser, which is not the language on the server
[09:33:37] Bish: just like js
[09:33:41] apeiros: you've gained a lot. and yes, that's just an opinion of yours :-p
[09:33:45] Bish: and opal already does that, to be honest
[09:33:50] Bish: it's very good
[09:34:07] Bish: probably better than everything i could do the way i described
[09:34:22] dminuoso: apeiros: cruby compiles to something that wont run directly on webasm.
[09:34:24] apeiros: I haven't yet taken my time to truly look at opal. does it support the full scope of ruby regex? or does it just use JS' regex engine?
[09:34:29] Bish: if ruby compiled to LVM-IR && could use gems in progress
[09:34:41] dminuoso: If you targeted webasm, you basically have to run YARV on webasm to simulate the ruby object model
[09:34:53] Bish: apeiros: if it doesn't support ruby-regex, it would certainly warn you
[09:35:02] Bish: it really does surprise not often
[09:35:09] Bish: only surprising about opal is, that it works so well
[09:35:17] apeiros: dminuoso: yes. bishs' point was that ruby isn't compiled, so making it compile would be difficult. but it is compiled. you'd need a different compiler, though.
[09:35:51] dminuoso: apeiros: I guess the relevant distinction is that you cant trivially compile Ruby to machine code (unless that just meant YARV with your program glued in)
[09:35:53] apeiros: or well, yes, actually you could also write a yarv vm on top of webasm. but not sure that'd be a good idea.
[09:36:15] dminuoso: apeiros: Crystal would be far better suited for the task.
[09:36:30] Bish: they also do not have threads :> great choice
[09:36:41] amatas_: has joined #ruby
[09:36:50] StarSeed0000: has joined #ruby
[09:36:58] Bish: yeah thought about crystal, too, it would be great for this use case
[09:36:59] apeiros: you could probably implement concurrency on webasm. just not parallelism.
[09:37:04] Bish: but i want a language for everything
[09:37:19] Bish: i forgot the professional term for that
[09:37:35] apeiros: ACTION is currently learning rust for that purpose
[09:37:49] dminuoso: apeiros: I heard some news, Rust will get HKT in the near future. =)
[09:37:50] apeiros: and rust does compile to webasm :D
[09:37:54] dminuoso: Which means. I should learn Rust.
[09:37:59] Terens: So then if you need to run several things would you use popen or open3 ? I mean open3 creates a thread too which seems waste to me.
[09:38:08] dminuoso: Bish: higher kinded types
[09:38:12] apeiros: you totally should. so I can see crazy things in rust, not just ruby.
[09:38:18] Bish: terens: use open3
[09:38:30] Terens: I may need to run at the same time 50 tools
[09:38:46] dminuoso: Bish: we have higher order functions (because you can pass functions themselves as values). type systems allow the same thing: type functions, and you can pass them around as "type values".
[09:38:48] Bish: 50 is not a huge number to a kernel/computer/whatever
[09:39:03] Bish: and.. considerung you're worried about 50 threads that do NOTHING
[09:39:09] Bish: these 50 tools.. might spawn threads, ey
[09:39:11] Terens: but it would be 50 threads vs 1
[09:39:11] Bish: atleast 1.
[09:39:18] Bish: no, it would be 100 vs 50+
[09:39:29] Bish: because each tool you run has a thread, too
[09:39:31] Bish: might have 10
[09:40:13] Bish: and the threads of these tools might even do something, like your popen3 threads just route IO
[09:40:20] Bish: s/like/while
[09:40:47] soniya29: has joined #ruby
[09:41:21] Bish: and routing IO is not a hard task even for ruby, since the kernel does all the work
[09:42:05] hairui: has joined #ruby
[09:42:20] Bish: dminuoso: sounds weird
[09:42:56] dminuoso: Bish: Are you familiar with C++?
[09:43:49] Bish: no inheritance in rust
[09:43:51] Bish: that's good.
[09:44:12] dminuoso: Bish: Imagine you have things of the shape: template<typename T> struct container{ ... };
[09:44:16] apeiros: terens: honestly, the switching of 50 threads will almost certainly be the least of your problems (performance-wise)
[09:44:17] Bish: "traits" are like ruby include?
[09:44:49] dminuoso: Bish: So you can abstract over T right?
[09:45:09] dminuoso: Bish: Alright. So what if.. you wanted to abstract over templates that takes one typename. Any of the,
[09:45:18] dminuoso: Bish: *any of them.
[09:45:21] jenrzzz_: has joined #ruby
[09:45:23] dminuoso: Anything that has the shape T<M>
[09:46:01] Bish: i really have no example in mind for that use case :D
[09:46:24] Bish: oy, rust looks really neat
[09:46:27] Bish: i understand the hype
[09:46:34] Bish: does it use llvm?
[09:46:35] dminuoso: Bish: Are you familiar with template template params?
[09:46:52] Bish: dminuoso: don't think so, not sure?
[09:47:49] dminuoso: Bish: Okay the idea is this: You have some: template <template <typename> class T> struct Monad { template<typename M> static T<M> mreturn(const T&); };
[09:47:58] Bish: yeah i figured something like that
[09:48:01] dminuoso: Bish: See how you have a polymorphic.. template T?
[09:48:11] dminuoso: Bish: That's higher kinded types.
[09:48:33] roonsauce: has joined #ruby
[09:48:34] Bish: and rust allows you to have that chain of types endlessly long
[09:48:38] Bish: bcause you can work with them in runtime
[09:48:39] Bish: amiright?
[09:50:01] dminuoso: Bish: Basically the core idea is that you want to talk about T, but you dont care about M. Especially with containers this is extremely useful.
[09:50:13] dminuoso: i.e. you want to talk about std::vector<T> without caring whatever T is
[09:50:32] dminuoso: but make it polymorphic, so it could be std::vector<T>, std::array<T> or anything
[09:52:13] dminuoso: Bish: And C++ allows any order. So you could do template<template<template<class> class> Q> ...
[09:52:26] dminuoso: The syntax is just freaking horrid.
[09:53:30] morenoh149: has joined #ruby
[09:54:13] Bish: i see, thanks
[09:54:27] Bish: aways considered rust the new hipster language
[09:54:32] Bish: but it really looks mature and well designed
[09:54:37] Bish: borrowing the right features
[09:56:21] joshua75: has joined #ruby
[09:56:54] Bish: redox-os looks fun
[09:57:07] dminuoso: Bish: Rust is C++ done right. ;0
[09:57:13] dminuoso: Without the C baggage.
[09:57:16] hairui: has joined #ruby
[09:57:36] Bish: i think this "garbage collection" feature is weird though
[09:57:55] Bish: it's actually a feature to have objects flying around in memory
[09:57:57] Terens: apeiros the question is if I use open3, in order to avoid blocking to use non block form?
[09:58:07] Bish: otherwise people would have gc in c++ already
[09:58:15] dminuoso: Bish: C++ allows for GC.
[09:58:28] dminuoso: Bish: It's just implementors that chose not to use them.
[09:58:41] Bish: ? what are you talking about
[09:58:45] Bish: delete and creation on stack?
[09:58:51] Bish: and yes, it's what i said
[09:59:01] Bish: they didn't choose them, for a reason (which might be a stupid reason, but they didn't)
[09:59:38] Han: has left #ruby: ()
[10:00:04] dminuoso: Bish: C++ very carefully uses the model of an abstract machine, and gives a blanket as-if rule.
[10:00:23] dminuoso: Bish: As long as there's no observable semantical difference, there's absolutely nothing in the C++ standard that prevents from memory being GC managed.
[10:00:26] Terens: Bish, how would you use then open3 if you needed to stream output for 50 subprocesses the same time ?
[10:00:49] Serpent7776: has joined #ruby
[10:00:52] Bish: sorry, i don't remember how open3 worked
[10:01:27] Bish: but even if it blocks, to start processes
[10:01:29] Bish: i would just
[10:01:34] Pisuke: has joined #ruby
[10:01:55] Bish: Thread.new { Open3.popen3(...) loop { some communication with @queues}}
[10:02:34] Bish: that's like the only use ruby threads have anyways
[10:02:46] Bish: (i did rant enough about that already, but it's kinda true)
[10:03:38] jaruga: has joined #ruby
[10:05:17] milardovich: has joined #ruby
[10:05:38] Bish: ACTION searches the video driver in redox kernel for 5 minutes
[10:05:54] Bish: ACTION reads over the word microkernel and driver in userspace for 20 times
[10:06:22] ams__: has joined #ruby
[10:06:27] hairui: has joined #ruby
[10:08:19] Stan: has left #ruby: ("bye")
[10:13:31] yohji: has joined #ruby
[10:14:46] tomphp: has joined #ruby
[10:22:32] sameerynho: has joined #ruby
[10:24:47] guardianx: has joined #ruby
[10:27:05] hairui: has joined #ruby
[10:28:14] armando1: has joined #ruby
[10:34:45] ldnunes: has joined #ruby
[10:36:02] aguestuser: has joined #ruby
[10:36:18] dminuoso: what will the thribers be called?
[10:36:28] dminuoso: friber maybe?
[10:36:33] dminuoso: havenwood surely knows.
[10:36:47] dminuoso: I vote for HonestThread
[10:38:37] ramfjord: has joined #ruby
[10:40:50] Bish: in a language that has lonely operators?
[10:41:11] tomphp: has joined #ruby
[10:41:30] workmad3: has joined #ruby
[10:44:39] konsolebox: has joined #ruby
[10:46:37] milardov_: has joined #ruby
[10:51:16] cliq: has joined #ruby
[11:10:51] luna_x: has joined #ruby
[11:11:22] hairui: has joined #ruby
[11:15:09] vyorkin: has joined #ruby
[11:18:59] morenoh149: has joined #ruby
[11:19:41] mtkd: has joined #ruby
[11:20:10] drewmcmillan: has joined #ruby
[11:20:50] aguestuser: has joined #ruby
[11:27:55] milardovich: has joined #ruby
[11:33:20] bijan_: has joined #ruby
[11:33:23] hairui: has joined #ruby
[11:33:24] aguestuser: has joined #ruby
[11:34:54] apeiros_: has joined #ruby
[11:34:59] deadnull: has joined #ruby
[11:37:49] goatish: has joined #ruby
[11:38:44] apparition: has joined #ruby
[11:39:07] AJA4350: has joined #ruby
[11:39:28] tomlukeywood: has joined #ruby
[11:40:06] tomlukeywood: Is their somthing similair to schemes filter function in ruby?
[11:41:34] dminuoso: tomlukeywood: it's just called .select
[11:41:38] dminuoso: &ri Enumerable#select
[11:41:39] `derpy: http://ruby-doc.org/core-2.4.1/Enumerable.html#method-i-select
[11:41:46] tomlukeywood: dminuoso: ah thanks
[11:42:00] dminuoso: tomlukeywood: For what its worth, I constantly screw up and try to use .filter since I started with Haskell. ;-)
[11:42:38] despai: has joined #ruby
[11:42:47] dminuoso: tomlukeywood: Also just for completeness sake, you can think of reject as `not .: filter`
[11:43:35] hairui: has joined #ruby
[11:44:39] yohji: has joined #ruby
[11:49:24] John_Ivan: has joined #ruby
[11:49:24] John_Ivan: has joined #ruby
[11:49:37] RougeR: has joined #ruby
[11:51:44] SecretNINJA: has joined #ruby
[11:52:59] hairui: has joined #ruby
[11:57:45] konsolebox: has joined #ruby
[12:01:15] truenito: has joined #ruby
[12:02:47] hairui: has joined #ruby
[12:03:43] SynSynack: has joined #ruby
[12:08:12] damasceno: has joined #ruby
[12:09:29] damasceno: Hello. Does anyone know how to get the nginx logs from 70 minutes ago? I'm trying to do that with File.open(log).grep(/#{pattern}/) but it shows exactly the pattern, I need to read the log file from 70 minutes ago until now.
[12:11:08] apeiros_: damasceno: you want each line containing the pattern?
[12:11:56] damasceno: apeiros: I actually need to get the logs from 70 minutes ago and only then search for the pattern
[12:12:12] damasceno: I know how to search for the pattern but I don't know how to get the logs from XX minutes ago
[12:12:54] apeiros: that is entirely depending on your log format
[12:13:00] jhass: if you want to do that to speed it up, that won't help since there's no way to tell without reading the entire file
[12:13:02] morenoh149: has joined #ruby
[12:13:06] hairui: has joined #ruby
[12:13:13] damasceno: apeiros: nginx
[12:13:28] aguestuser: has joined #ruby
[12:13:33] damasceno: ex: IP URL [16/Feb/2018:10:57:34 +0100] POST
[12:13:34] apeiros: damasceno: that's not descriptive.
[12:13:38] apeiros: that's better
[12:14:25] apeiros: grep for /\[16\/Feb\/2018:(?:09|10)/
[12:14:59] apeiros: and then if you truly need exactly 70 minutes, parse the timestamp for the returned lines and find the index of the first occurrence within 70min
[12:16:11] apeiros: jhass: one could read from the end and perform a quadratic+binary search, but it adds a shitton of complexity
[12:16:29] tomphp: has joined #ruby
[12:16:50] jhass: good luck seeking to the beginning of a line without wasting any time gained by that
[12:17:01] apeiros: no luck needed
[12:17:18] apeiros: in any substantial file, the time gained by this method is huge
[12:17:31] apeiros: I know because I've done a half-measure of that already.
[12:18:06] apeiros: you seek from the end, read a chunk which has a reasonable expectation of containing 2 newlines. if it doesn't, you buffer up. that part is not too complex.
[12:22:54] hairui: has joined #ruby
[12:23:22] konsolebox: has joined #ruby
[12:23:24] banisterfiend: has joined #ruby
[12:24:22] apeiros: I f.ex. used 1KB reads. average line was iirc <200bytes, and longest line <1KB. reading until you get 2 newlines doesn't take that much time. you parse that single line, process it and then either expand your boundary (quadratic search) or limit it again (start of the binary search)
[12:26:38] shinnya: has joined #ruby
[12:26:46] apeiros: (I know it was <1KB since out of curiosity I added a count of how many additional reads had to be performed to get 2 newlines, and there was none)
[12:27:34] apeiros: thinking about this again, I'd say you could even drop the quadratic part and just do a binary search with this method. on average, you'd probably do the same number of reads.
[12:28:04] hairui: has joined #ruby
[12:28:09] apeiros: damn you jhass, now I ponder on working out whether the quadratic search was worth it, lol
[12:28:18] dminuoso: ACTION waves the "Hi apeiros" flag around
[12:28:25] apeiros: hi dminuoso
[12:28:39] dminuoso: ACTION then picks up the "HAI jhass"
[12:28:41] apeiros: hey, hey, you're our maths guy here dminuoso, can you work this out for me please?
[12:28:58] dminuoso: We have to first talk about SI.
[12:29:08] dminuoso: What is KB?
[12:29:26] dminuoso: Either it should be kB or KiB
[12:29:30] apeiros: assume 1GiB log, 1KiB reads always getting 2 newlines. needle always in the last 50MiB
[12:30:02] jhass: I see I'm done here :P
[12:31:00] apeiros: jhass: hm? the "complexity" of seeking to the beginning of the line is the same. whether you start from the end or not.
[12:32:01] drewmcmillan: has joined #ruby
[12:34:02] apeiros: anyway, unless I'm mistaken, at the size of 1GiB and result being always in 50 last MiB, I'd say you save yourself an average of 4.3 comparisons. So quadratic search part was absolutely not worth it :D
[12:34:18] apeiros: it was fun to write, though :<
[12:37:21] hairui: has joined #ruby
[12:38:50] ramfjord: has joined #ruby
[12:39:56] banisterfiend: has joined #ruby
[12:48:35] anisha: has joined #ruby
[12:49:07] konsolebox: has joined #ruby
[12:50:32] hairui: has joined #ruby
[12:51:31] despai: has joined #ruby
[12:52:28] bigblind: has joined #ruby
[12:53:55] valeth: has joined #ruby
[12:58:20] vondruch: has joined #ruby
[12:58:38] schneide_: has joined #ruby
[13:01:53] jcalla: has joined #ruby
[13:06:42] nadir: has joined #ruby
[13:07:09] morenoh149: has joined #ruby
[13:07:50] hairui: has joined #ruby
[13:08:08] synthroid: has joined #ruby
[13:10:33] rf: has joined #ruby
[13:12:57] hairui: has joined #ruby
[13:13:47] damasceno: apeiros: just got back. Thanks, I'll try that
[13:17:58] aguestuser: has joined #ruby
[13:18:22] hairui: has joined #ruby
[13:19:44] tomphp: has joined #ruby
[13:22:38] tcopeland: has joined #ruby
[13:24:54] mtkd: has joined #ruby
[13:26:29] envex: has joined #ruby
[13:28:01] jeffreylevesque: has joined #ruby
[13:29:28] tomphp: has joined #ruby
[13:37:57] minimalism: has joined #ruby
[13:38:09] riotjones: has joined #ruby
[13:41:22] jeffreylevesque_: has joined #ruby
[13:41:52] ogres: has joined #ruby
[13:44:22] mcr1: has joined #ruby
[13:44:47] hairui: has joined #ruby
[13:48:08] apparition: has joined #ruby
[13:49:48] hairui: has joined #ruby
[13:49:57] konsolebox: has joined #ruby
[13:50:33] aguestuser: has joined #ruby
[13:57:28] konsolebox: has joined #ruby
[13:59:09] hairui: has joined #ruby
[14:01:33] morenoh149: has joined #ruby
[14:03:28] vutral|kali: has joined #ruby
[14:03:28] vutral|kali: has joined #ruby
[14:04:40] synthroid: has joined #ruby
[14:06:03] konsolebox: has joined #ruby
[14:07:37] jnollette: has joined #ruby
[14:09:14] mcr1: has joined #ruby
[14:12:13] hairui: has joined #ruby
[14:12:31] jamiejackson: has joined #ruby
[14:14:21] joast: has joined #ruby
[14:16:32] yohji: has joined #ruby
[14:17:07] rwb: has joined #ruby
[14:21:12] riotjones: has joined #ruby
[14:22:30] gr33n7007h: has joined #ruby
[14:23:20] bmurt: has joined #ruby
[14:23:39] mtkd: has joined #ruby
[14:24:20] phenom: has joined #ruby
[14:26:45] vyorkin: has joined #ruby
[14:26:56] konsolebox: has joined #ruby
[14:31:37] hairui: has joined #ruby
[14:32:22] GodFather: has joined #ruby
[14:34:10] ianfleeton: has joined #ruby
[14:36:55] aScottishBoat: has joined #ruby
[14:36:55] hairui: has joined #ruby
[14:37:03] morenoh149: has joined #ruby
[14:38:42] ramfjord: has joined #ruby
[14:42:58] netherwolfe: has joined #ruby
[14:43:41] Trel: has left #ruby: ()
[14:49:15] bigblind: has joined #ruby
[14:57:32] apeiros: damasceno: found my old code for rails logs, if you're interested
[14:59:45] apeiros: jhass: did a little perf test on a 500MB log file. extract 1 day from the log = 1.6ms on this machine :D (that's tons faster than grepping for the date - and by tons I mean >6000x faster ^^)
[15:01:12] netherwolfe: has joined #ruby
[15:01:37] blood|work: has joined #ruby
[15:02:31] blood|work: https://gist.github.com/anonymous/53645596a37c2c359b21184ed404a150, For some reason the cmd being executed within this rb script isn't working properly. If I execute the command manually, it works fine. How can I get more debug output to see what is wrong? the current log it generates tells me nothing
[15:03:02] dinfuehr: has joined #ruby
[15:03:14] apeiros: blood|work: is there any particular reason for your code wildly containing empty lines? o0
[15:03:57] apeiros: blood|work: common reason for shellouts to not work the same as doing it manually is usually a different env (login shell vs non-login shell). don't know enough about windows to help with this, though.
[15:04:03] morenoh149: has joined #ruby
[15:04:24] banisterfiend: has joined #ruby
[15:04:51] damasceno: apeiros: of course :D could you please share it?
[15:05:01] apeiros: sure, preparing a little gist right now
[15:07:21] apeiros: https://gist.github.com/apeiros/e5252a391d5ae6de90bc9b3f06496417
[15:09:28] apeiros: and I actually see things I could improve, lol
[15:13:53] pastorinni: has joined #ruby
[15:14:22] shadeslayer: has joined #ruby
[15:14:23] chouhoulis: has joined #ruby
[15:15:15] jgpawletko: has joined #ruby
[15:16:14] Rapture: has joined #ruby
[15:17:21] damasceno: has joined #ruby
[15:17:27] damasceno: thanks apeiros!
[15:17:32] damasceno: I'll check it later today
[15:17:34] hairui: has joined #ruby
[15:20:07] apeiros: damasceno: I'll be offline in ~1h from now
[15:20:22] apeiros: so if you've got questions, either before then, or in ~3.5h again :)
[15:22:37] hairui: has joined #ruby
[15:24:26] blood|work: apeiros: This is a delivered script from oracle
[15:24:29] blood|work: I didn't write it
[15:24:54] blood|work: well not delivered, gets generated when you run a setup
[15:26:14] k0mpa: has joined #ruby
[15:27:03] tvw: has joined #ruby
[15:27:46] hairui: has joined #ruby
[15:28:35] bmurt: has joined #ruby
[15:29:11] rippa: has joined #ruby
[15:35:01] roonsauce: has joined #ruby
[15:35:55] damasceno: sure apeiros, thanks again
[15:36:24] apeiros: blood|work: I meant "run" as in "run away from wherever you are, oracle isn't worth it" ;-)
[15:39:14] ianfleeton: has joined #ruby
[15:40:30] Cavallari: has joined #ruby
[15:41:42] apeiros: damasceno: updated it and added a bit of comments
[15:42:15] blood|work: apieros: wish it were that easy :P
[15:42:37] apeiros: ?tabnick blood|work
[15:42:38] ruby[bot]: blood|work: pro-tip - use tab completion for nicks. avoids typos in nicks.
[15:42:48] apeiros: ACTION should really automate this
[15:43:29] apeiros: blood|work: it is. you just don't to live with the consequences 😂
[15:43:59] apeiros: (I can empathize, got to use oracle at work too)
[15:54:15] Mia: has joined #ruby
[15:54:16] Mia: has joined #ruby
[15:57:43] hairui: has joined #ruby
[15:58:20] DLSteve_: has joined #ruby
[16:00:27] bmurt: has joined #ruby
[16:00:42] bijan_: has joined #ruby
[16:01:57] blood|work: apeiros: Can I alter the logging level for the rb script? If so, how would I change it to debug?
[16:02:15] apeiros: ruby -w iirc
[16:02:26] blood|work: k let me try that
[16:02:42] apeiros: but I'd have to read ruby's manpage myself, so I'd suggest to just read that ;-)
[16:04:30] blood|work: really odd, the only output i see in the log file is Received stop signal at: 2018-02-16 10:01:21 -0500 followed by 0-9 numbers printed on separate lines
[16:05:48] blood|work: ah I see in the rb file it loops 10 times and logs it during service init.
[16:08:47] ShekharReddy: has joined #ruby
[16:12:13] synthroid: has joined #ruby
[16:12:44] snickers: has joined #ruby
[16:13:01] minimalism: has joined #ruby
[16:13:17] banisterfiend: has joined #ruby
[16:14:17] goatish: has joined #ruby
[16:15:31] hairui: has joined #ruby
[16:25:58] zsoc: has joined #ruby
[16:31:00] yohji: has joined #ruby
[16:35:58] lupine: has joined #ruby
[16:38:00] raynold: has joined #ruby
[16:38:51] Cavallari1: has joined #ruby
[16:38:57] aspiers: has joined #ruby
[16:47:08] hairui: has joined #ruby
[16:47:37] nowhere_man: has joined #ruby
[16:51:09] jerikl: has joined #ruby
[16:56:48] hairui: has joined #ruby
[16:59:06] snickers: has joined #ruby
[16:59:22] cagomez: has joined #ruby
[16:59:25] cliq: has joined #ruby
[17:00:31] KeyJoo: has joined #ruby
[17:00:38] troys: has joined #ruby
[17:04:30] despai_: has joined #ruby
[17:11:02] Dbugger: has joined #ruby
[17:11:05] Dbugger: hi everyone
[17:11:29] havenwood: Dbugger: hi
[17:12:08] Dbugger: small question. This line "a ||= b if c" is executed as "(a ||= b) if c" or "a ||= (b if c)"?
[17:13:56] jcarl43: has joined #ruby
[17:17:18] RougeR: has joined #ruby
[17:18:49] d10n-work: has joined #ruby
[17:18:51] hairui: has joined #ruby
[17:20:05] havenwood: Dbugger: a || a = b
[17:21:44] havenwood: Dbugger: http://www.rubyinside.com/what-rubys-double-pipe-or-equals-really-does-5488.html
[17:21:51] Dbugger: no yeah, i was asking if it is first the ||= or the "if"
[17:22:08] Dbugger: I know what ||= means :)
[17:22:17] Dbugger: It was more about the priority of operators
[17:22:23] havenwood: Dbugger: gotcha, precedence
[17:22:38] havenwood: https://ruby-doc.org/core/doc/syntax/precedence_rdoc.html
[17:22:51] guacamole: has joined #ruby
[17:22:51] guacamole: has joined #ruby
[17:23:05] havenwood: Dbugger: It can be fun to use Ripper to get answers to questions like that.
[17:23:05] Dbugger: funny, "||=" is not listed
[17:23:14] Dbugger: What is Ripper?
[17:23:22] giraffe: has joined #ruby
[17:23:53] havenwood: >> require 'ripper'; Ripper.sexp 'a ||= b if c'
[17:23:54] ruby[bot]: havenwood: # => [:program, [[:if_mod, [:vcall, [:@ident, "c", [1, 11]]], [:opassign, [:var_field, [:@ident, "a", [1, ...check link for more (https://eval.in/957617)
[17:24:16] SeepingN: has joined #ruby
[17:24:23] tpendragon: has joined #ruby
[17:24:47] havenwood: Dbugger: It's a tool in the stdlib.
[17:25:15] Dbugger: holy f. The syntax is really different
[17:26:22] havenwood: Dbugger: Or you can look at the YARV instruction sequence:
[17:26:23] havenwood: >> RubyVM::InstructionSequence.compile('a ||= b if c').to_a.last
[17:26:25] ruby[bot]: havenwood: # => [1, [:trace, 1], [:putself], [:opt_send_without_block, {:mid=>:c, :flag=>28, :orig_argc=>0}, false], ...check link for more (https://eval.in/957618)
[17:26:35] Dbugger: Not sure also what YARV is.... :D
[17:26:37] havenwood: >> puts RubyVM::InstructionSequence.compile('a ||= b if c').disasm
[17:26:38] ruby[bot]: havenwood: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/957620)
[17:26:44] havenwood: Dbugger: Yet Another Virtual Machine
[17:26:48] havenwood: Dbugger: The CRuby VM.
[17:26:52] Dbugger: ok, I think I am biting again more than I can chew...
[17:27:17] havenwood: Dbugger: look at precedence of `=` and `if`
[17:27:35] dionysus69: has joined #ruby
[17:27:37] Dbugger: well, it is not "=" but "||=", but maybe it is the same
[17:27:40] kapil___: has joined #ruby
[17:29:06] havenwood: Dbugger: TL;DR: `if c` is first
[17:29:14] morenoh149: has joined #ruby
[17:29:18] hairui: has joined #ruby
[17:29:20] havenwood: >> require 'ripper'; Ripper.sexp('a ||= b if c').last.first
[17:29:21] ruby[bot]: havenwood: # => [:if_mod, [:vcall, [:@ident, "c", [1, 11]]], [:opassign, [:var_field, [:@ident, "a", [1, 0]]], [:@op ...check link for more (https://eval.in/957626)
[17:29:28] havenwood: Dbugger: You can see it there ^
[17:30:47] darkhanb: has joined #ruby
[17:31:07] roonsauce: has joined #ruby
[17:31:09] havenwood: Dbugger: If you want to see why it's first, the --yydebug flag lets you see how the parse.y grammar rules are being applied: ruby --yydebug -e 'a ||= b if c'
[17:31:49] havenwood: Dbugger: But that's more interesting than useful.
[17:31:50] havenwood: At least I've never actually used it productively. ;-P
[17:36:33] snath: has joined #ruby
[17:36:53] drewmcmillan: has joined #ruby
[17:38:22] troys: has joined #ruby
[17:47:04] ianfleeton: has joined #ruby
[17:49:37] banisterfiend: has joined #ruby
[17:50:01] Dbugger: oh well, i guess i do not want to go that deep into the rabbit hole
[17:52:15] n008f4g_: has joined #ruby
[17:53:24] guacamole: has joined #ruby
[17:53:24] guacamole: has joined #ruby
[17:54:16] biberu: has joined #ruby
[17:57:04] eckhardt: has joined #ruby
[17:57:44] workmad3: has joined #ruby
[17:57:51] hairui: has joined #ruby
[17:58:33] dviola: has joined #ruby
[18:00:11] gix: has joined #ruby
[18:02:20] goatish: has joined #ruby
[18:04:11] roonsauce: has joined #ruby
[18:06:22] kaspergrubbe: has joined #ruby
[18:06:48] alex``: has joined #ruby
[18:09:51] desperek: has joined #ruby
[18:09:52] desperek: has joined #ruby
[18:11:08] nowhere_man: has joined #ruby
[18:11:13] za1b1tsu: has joined #ruby
[18:11:44] suhdood: has joined #ruby
[18:12:54] bigblind: has joined #ruby
[18:14:39] claudiuinberlin: has joined #ruby
[18:15:28] NL3limin4t0r: has joined #ruby
[18:19:47] kaspergrubbe: has joined #ruby
[18:23:20] morenoh149: has joined #ruby
[18:27:02] jerikl: has joined #ruby
[18:27:10] banisterfiend: has joined #ruby
[18:35:24] hairui: has joined #ruby
[18:36:11] mcr1: has joined #ruby
[18:39:40] tomlukeywood: has joined #ruby
[18:40:24] nogic: has joined #ruby
[18:42:44] schneide_: has joined #ruby
[18:45:11] guacamole: has joined #ruby
[18:45:11] guacamole: has joined #ruby
[18:49:56] ramfjord: has joined #ruby
[18:51:21] ldnunes: has joined #ruby
[18:51:27] claudiuinberlin: has joined #ruby
[18:55:27] type1team: has joined #ruby
[18:55:55] type1team: Hello, i have a question...
[18:55:58] type1team: Any can help me?
[18:56:06] eam: type1team: don't ask to ask, just ask!
[18:56:27] type1team: What RoR CMS do you recommend for blogs like websites.
[18:56:35] type1team: It is important to be optimized with the conversions for SEO and Schema.
[18:56:47] eam: type1team: for rails, you might want to ask in #rails
[18:56:51] bougyman: that's really a matter of opinion.
[18:56:58] bougyman: I would recommend: none.
[18:57:16] bougyman: #anythingbutrails is my hashtag
[18:57:55] miah: for blogs i always go as static as possible and just use something like disqus for conversation =)
[18:58:19] bougyman: simple solutions for simple problems.
[18:58:25] bougyman: Not everything has to be a kitchen sink
[18:58:40] type1team: I am looking to build a PBN at least 10 niche sites. I use WP but it is very vulnerable to attacks. Exploits.
[18:58:50] havenwood: https://medium.com/@k0kubun/the-method-jit-compiler-for-ruby-2-6-388ee0989c13
[18:58:53] eam: I used jekyll once for that kind of thing and enjoyed it
[18:59:02] miah: Peanut Butter Ninja?
[18:59:05] eam: I'm with miah and bougyman
[18:59:17] roonsauce: has joined #ruby
[18:59:22] Mike11: has joined #ruby
[18:59:27] type1team: private blog networks (PBNs)
[19:00:03] miah: sounds cool but i think im more interested in a peanut butter ninja at this point
[19:00:48] eam: I've developed a late night snack habit of a spoonful of peanut butter and a spoonful of jelly mixed in a bowl, with crackers to dip
[19:00:55] miah: i mean the thing with blogs, websites.. there are a infinite number of CMS frameworks
[19:00:57] type1team: Is there a gem for SEO and Schema for RoR that optimizes the ranking of the sites?
[19:01:03] havenwood: type1team: Jekyll and Middleman are the usual go-to static site generators in Ruby. Hugo is a nice (ahem, Go-lang) static site generator as well: https://gohugo.io/
[19:01:28] havenwood: type1team: https://middlemanapp.com/
[19:01:56] roonsauce: has joined #ruby
[19:02:25] type1team: but my concerns about the subject of SEO and Schema. That meet the convensiones for site positioning and metadata.
[19:04:08] miah: do you mean like a database schema?
[19:05:23] type1team: Structured Data in Markup (Schema.org) - SEO Tactics for Ranking in Search Engine.
[19:05:40] miah: the term seo just makes my eyes gloss over and i imagine im somewhere else
[19:05:52] miah: so i cant help you there =)
[19:06:36] SeepingN: How to target old Google algorithms, volume 483
[19:06:47] SeepingN: oh woops, 484
[19:07:29] type1team: Google use: Deep Learning
[19:09:38] type1team: Some place where you can investigate if there are SEO Gems, Schema in general positioning and rank sites in the search engines?
[19:09:50] hairui: has joined #ruby
[19:10:20] sameerynho: has joined #ruby
[19:11:11] rubycoder38: here is my current script and I'd like to start writing tests with minitest and refactor after that, however, I'd like to start with the output method, the output method only outputs json: https://gist.github.com/anonymous/505ebdf94d1cb48b27c13b928e51f907 -- how am I supposed to test my output method if it only outputs some specific json output?
[19:11:19] rubycoder38: I'm a bit confused and yes I'm new with testing
[19:12:08] bougyman: type1team: if you're looking for an easy way to accomplish SEO, you're searching for a unicorn.
[19:13:56] type1team: LOL, but must exister some gem that helps.
[19:16:07] bmurt: has joined #ruby
[19:16:25] riotjones: has joined #ruby
[19:17:24] morenoh149: has joined #ruby
[19:17:43] miah: maybe google can help better with that answer? (assuming the gem has good seo)
[19:20:07] al2o3-cr: has joined #ruby
[19:20:28] type1team: No, someone here should have the answer, I will be patient.
[19:22:03] synthroid: has joined #ruby
[19:22:12] yqt: has joined #ruby
[19:26:19] rubycoder38: any ideas please?
[19:28:25] haylon: has joined #ruby
[19:28:53] dtzuzu: has joined #ruby
[19:30:35] apeiros_: has joined #ruby
[19:32:55] suhdood_: has joined #ruby
[19:35:33] mtkd: has joined #ruby
[19:39:10] suhdood: has joined #ruby
[19:47:03] hairui: has joined #ruby
[19:52:35] al2o3-cr: has joined #ruby
[19:52:55] marr: has joined #ruby
[19:56:12] tvw: has joined #ruby
[19:57:00] jerikl: has joined #ruby
[19:57:33] jenrzzz: has joined #ruby
[19:57:33] jenrzzz: has joined #ruby
[20:00:20] claudiuinberlin: has joined #ruby
[20:01:51] workmad3: has joined #ruby
[20:07:17] nowhere_man: has joined #ruby
[20:11:12] Dimik: has joined #ruby
[20:11:27] banisterfiend: has joined #ruby
[20:14:34] shadeslayer: has joined #ruby
[20:17:27] hairui: has joined #ruby
[20:20:13] kaspergrubbe: has joined #ruby
[20:23:52] bmurt: has joined #ruby
[20:27:28] ltem: has joined #ruby
[20:33:39] sanscoeur: has joined #ruby
[20:37:47] sagax: has joined #ruby
[20:41:20] hfp_work: has joined #ruby
[20:41:36] TvL2386_: has joined #ruby
[20:43:30] drewmcmillan: has joined #ruby
[20:44:04] clemens3: has joined #ruby
[20:48:47] despai: has joined #ruby
[20:50:12] hairui: has joined #ruby
[20:51:05] shinnya: has joined #ruby
[20:51:58] xelkarin: has joined #ruby
[20:55:51] morenoh149: has joined #ruby
[20:56:01] ramfjord: has joined #ruby
[21:02:40] cagomez: has joined #ruby
[21:03:43] guacamole: has joined #ruby
[21:03:44] guacamole: has joined #ruby
[21:06:51] hfp_work: has joined #ruby
[21:10:43] zautomata1: has joined #ruby
[21:13:13] zautomata2: has joined #ruby
[21:15:09] goatish: has joined #ruby
[21:16:08] tvw: has joined #ruby
[21:17:46] workmad3: has joined #ruby
[21:23:40] hairui: has joined #ruby
[21:24:49] eckhardt: has joined #ruby
[21:24:53] hfp_work: has joined #ruby
[21:25:19] cagomez: has joined #ruby
[21:31:10] sammi`: has joined #ruby
[21:31:42] dionysus69: has joined #ruby
[21:37:41] al2o3-cr: has joined #ruby
[21:41:20] rwb: has joined #ruby
[21:42:41] mtkd: has joined #ruby
[21:43:23] jnollette: has joined #ruby
[21:48:17] jordanm: has joined #ruby
[21:49:33] ramfjord: has joined #ruby
[21:51:22] nowhere_man: has joined #ruby
[21:53:16] mint: has joined #ruby
[21:53:52] jeffreylevesque: has joined #ruby
[21:54:28] hairui: has joined #ruby
[21:59:37] ltem: has joined #ruby
[21:59:39] WA9ACE: has joined #ruby
[22:01:26] tcopeland: type1team: FWIW there’s the sitemap_generator gem
[22:02:58] Prutheus: has joined #ruby
[22:03:27] druonysus: has joined #ruby
[22:03:39] Prutheus: Hello. Can someone explain me how this line `entries = entries.values_at(*(0...entries.length).step(2))` selects only 1,3,5,7th element and so on? I dont know what the * is doing and how that works
[22:06:34] jenrzzz: has joined #ruby
[22:06:34] jenrzzz: has joined #ruby
[22:07:40] bmurt: has joined #ruby
[22:08:08] tomlukeywood: has joined #ruby
[22:08:48] pastorinni: has joined #ruby
[22:10:19] weaksauce: prutheus * is the splat operator that unpacks and passes in the values to that function
[22:10:36] ramfjord: has joined #ruby
[22:11:28] weaksauce: 0...entries.length is the range from 0 up to the last entry and step picks every second element
[22:11:38] suhdood: has joined #ruby
[22:12:12] Prutheus: okay. i still do not understand * ... ;(
[22:13:08] weaksauce: so (0...10) is a range of everything from 0-9
[22:13:12] apeiros_: prutheus: basically, foo(*[1,2,3]) is expanded to foo(1,2,3)
[22:13:28] weaksauce: that's more succinct
[22:13:40] apeiros: obviously useful if you have args in an array, like: args = [1,2,3]; foo(*args)
[22:14:24] weaksauce: you can also create a function with it def foo(*args) that is an array of all the arguments passed into the function
[22:14:43] apeiros: s/function/method/ ;-)
[22:14:46] Prutheus: so it is like a .each loop?
[22:15:30] apeiros: no. you can't construct a method call with multiple arguments using any form of loop.
[22:16:35] ramfjord: has joined #ruby
[22:19:32] druonysus: has joined #ruby
[22:20:28] banisterfiend: has joined #ruby
[22:22:35] ramfjord: has joined #ruby
[22:25:59] druonysus: has joined #ruby
[22:26:31] hairui: has joined #ruby
[22:30:23] druonysus: has joined #ruby
[22:30:23] druonysus: has joined #ruby
[22:30:58] druonysus: has joined #ruby
[22:30:59] druonysus: has joined #ruby
[22:31:14] ramfjord: has joined #ruby
[22:32:49] hairui: has joined #ruby
[22:37:12] ramfjord: has joined #ruby
[22:40:54] tvw: has joined #ruby
[22:42:01] tAn: has joined #ruby
[22:43:08] ramfjord: has joined #ruby
[22:46:19] pastorinni: has joined #ruby
[22:49:01] suhdood_: has joined #ruby
[22:50:56] eckhardt: has joined #ruby
[22:57:01] pastorinni: has joined #ruby
[22:57:36] schneide_: has joined #ruby
[22:59:56] bronson: has joined #ruby
[23:00:37] eckhardt: has joined #ruby
[23:01:02] hairui: has joined #ruby
[23:02:52] bmurt: has joined #ruby
[23:04:37] kspencer: if someone who has used thor more than me, is there a way to prompt a user to pick between subcommands when they only give the parent command e.g. they gave 'script parent' instead of 'script parent child', the no_commands block doesn't seem to be working in that way nor does adding it as a default command as far as i've seen
[23:05:52] ramfjord: has joined #ruby
[23:08:27] tefa: has joined #ruby
[23:08:59] tefa: can someone explain me this error? (i think it has to be on how you declare the function..) https://gist.github.com/tefanga/e33eb29d09b5b772813e92a7bd7bab6c
[23:09:29] eckhardt: has joined #ruby
[23:10:08] jnyw: has joined #ruby
[23:10:56] apeiros: tefa: wrong channel?
[23:11:05] Paraxial: has joined #ruby
[23:11:14] bmurt: has joined #ruby
[23:11:21] NL3limin4t0r: tefa: Seems like Haskell code to me.
[23:11:37] apeiros: NL3limin4t0r: the .hs in the error would support that :D
[23:12:03] NL3limin4t0r: apeiros: So why post in the Ruby irc?
[23:12:16] chouhoul_: has joined #ruby
[23:12:29] apeiros: NL3limin4t0r: if you look one message above, you'll notice that I asked that very question
[23:13:04] vutral|kali: has joined #ruby
[23:13:05] vutral|kali: has joined #ruby
[23:14:52] NL3limin4t0r: apeiros: Ah, thought you where tefa for a sec. Didn't check the name.
[23:15:19] kspencer: yeah so tefa, try #haskell
[23:15:48] schneide_: has joined #ruby
[23:15:50] apeiros: no reaction from tefa anyway. can't have been too important.
[23:16:56] kspencer: ACTION waits for an answer to his question, though its kinda scrolled up so I'll post it again
[23:17:35] kspencer: if someone who has used thor more than me has an idea, is there a way to prompt a user to pick between subcommands when they only give the parent command e.g. they gave 'script parent' instead of 'script parent child', the no_commands block doesn't seem to be working in that way nor does adding it as a default command as far as i've seen
[23:19:17] tefa: sorry guys! hahaha im on the wrong channel! (i usually code on ruby... thats why i automatically got in here xd)
[23:22:41] tAn: has joined #ruby
[23:23:45] agent_white: has joined #ruby
[23:24:52] jnollette: has joined #ruby
[23:25:19] kspencer: also somehow answered my own question, idk why but before it wasn't showing the help, but now it does, i remembered it is supposed to output help if there is no default command
[23:28:37] goatish: has joined #ruby
[23:28:57] bronson: has joined #ruby
[23:34:04] hairui: has joined #ruby
[23:34:59] jenrzzz: has joined #ruby
[23:34:59] jenrzzz: has joined #ruby
[23:39:59] jenrzzz: has joined #ruby
[23:39:59] jenrzzz: has joined #ruby
[23:43:31] rubycoder38: can you guys help me refactor this piece of code? https://gist.github.com/anonymous/c13956a8750d2936b6b87c3c90f7f564
[23:43:44] AndBobsYourUncle: has joined #ruby
[23:43:56] rubycoder38: I'd like to move the transactions from the transfer method to another method/class, it's not very DRY this way
[23:44:31] rubycoder38: the problem is the first one expects the currency variable and the other one needs target_currency
[23:45:09] rubycoder38: how can I undry this?
[23:45:12] kspencer: use method(arguments)?
[23:46:11] kspencer: eg def update_wallet(currency, target_currency) ... end
[23:47:20] mtkd: has joined #ruby
[23:47:20] rubycoder38: yes, that's what I thought, but look at the line 27 and 34
[23:47:27] tcopeland: has joined #ruby
[23:48:47] kspencer: then I'd probably have it send a hash that you put {target: x, primary: y}
[23:49:08] kspencer: or something similar
[23:49:27] kspencer: I'm basically brainstorming along with you
[23:50:10] rubycoder38: yes, sounds like that could work also
[23:51:48] kspencer: and basically run some if ... elsif ... else ... end to check if both were given, none were given (would most likely error out), and one or the other were given
[23:52:45] kspencer: and validation if need be
[23:53:15] kspencer: although you can kinda build that into else
[23:58:16] deadnull: has joined #ruby
[23:58:48] railswebdev: has joined #ruby
[23:59:20] Sifrael: has joined #ruby