cahoots

Activity Graph

Page 1 of 2 | Next »

2019-02-04

[20:17:42] cahoots: has joined #ruby
[20:39:31] cahoots: hi, i was curious, is there any ruby compiler that produces a fully-linked executable?
[20:42:27] cahoots: havenwood: interesting! i'm curious, why isn't this more popular? is JIT really faster than AOT + PGO?
[20:52:32] cahoots: havenwood: i see. but i'm still curious about AOT vs. JIT, because truffleruby again seems to have a VM. could a good AOT compiler for ruby be faster than truffleruby?
[21:00:26] cahoots: havenwood: i see, yeah it looks like truffleruby can compile to standalone binary like packer. it's interesting that it says peak performance can be lower with native vs. jvm, but the fastest languages in the computer language benchmarks game are all compiled to native
[21:01:20] cahoots: i'm concerned with performance in terms of reducing server cost and working on large datasets
[21:07:47] cahoots: havenwood: i could see that, it looks like it crushes other ruby compilers/interpreters at the very least. i do wonder though why java isn't on par with C/C++/Rust, e.g. https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/java-gpp.html
[21:08:56] cahoots: havenwood: so you're saying that perhaps the JITs used in the game are just not the latest and greatest
[21:09:24] cahoots: as in, that the performance decrease can possibly be explained by them not being the latest and greatest
[21:10:03] cahoots: no worries
[21:16:37] cahoots: but i am curious why java isn't more commonly compiled to native, if it would improve performance in a benchmark like this
[21:20:55] cahoots: i see, i'm just curious why compilation to native seems like an afterthought for so many languages, like ruby and java. e.g. why did it take so long for a popular compiler like truffleruby to come into existence
[21:21:20] cahoots: like, once you build the compiler, you get the benefits of native without having to rewrite stuff in C/C++, right? seems zero-cost for application devs
[21:21:51] cahoots: well, maybe not C performance, since ruby is dynamic, but some benefits
[21:27:17] cahoots: i'm more thinking about creating a compiler for ruby for those that are concerned with performance
[21:33:34] cahoots: i think the creation of truffleruby, crystal, etc. suggests that this is still an open problem
[22:12:01] cahoots: Ping timeout: 256 seconds

2018-12-19

[23:00:30] cahoots: has joined #ruby
[23:22:02] cahoots: hi, i want to get a base 2 number (as a string of 1's and 0's) approximating a decimal number (e.g. 0.1), with as many bits as i want. what's the easiest way to do this?
[23:58:34] cahoots: Ping timeout: 246 seconds

2018-11-13

[01:22:07] cahoots: Ping timeout: 240 seconds

2018-11-12

[18:21:40] cahoots: has joined #ruby

2018-02-10

[00:16:02] cahoots: has joined #ruby
[00:16:48] cahoots: hi, i'm working on a ruby project deployed to a few machines, and on one of them, even though i set the GEM_HOME and GEM_PATH env vars, it still doesn't use them as the gem home and path
[00:16:54] cahoots: any ideas how to fix this?
[00:40:18] cahoots: Ping timeout: 256 seconds
[00:55:41] cahoots: has joined #ruby
[00:57:00] cahoots: qyliss, rasterick, the issue appears to be solved by running "ENV['GEM_PATH'] = ..." at global scope instead of within a function o.O
[00:59:03] cahoots: nm it's that i call "if ENV[...] ; ..." before. so i guess i have to run a getter on ENV before a setter? o.O
[01:00:02] cahoots: the other way around... i *can't* run any getters before i run a setter
[01:00:17] cahoots: is that a thing? lol
[01:01:43] cahoots: touche, ruby
[01:01:47] cahoots: thanks all
[01:04:41] cahoots: i want to thank the homeless people arguing loudly outside my office
[01:06:22] cahoots: i want to thank the enumerable module
[01:07:06] cahoots: i think they need a few less
[01:12:12] cahoots: nope, they're arguing about 15 dollars
[01:16:19] cahoots: Quit: leaving

2017-12-29

[03:07:42] cahoots: has joined #ruby
[04:56:01] cahoots: Ping timeout: 248 seconds
[17:09:20] cahoots: has joined #ruby
[17:21:35] cahoots: Quit: leaving

2017-11-23

[00:49:31] cahoots: has joined #ruby
[01:27:42] cahoots: Ping timeout: 260 seconds
[01:31:41] cahoots: has joined #ruby
[01:32:26] cahoots: Client Quit

2017-11-22

[19:09:00] cahoots: has joined #ruby
[19:09:21] cahoots: hi, i want to use mechanize to log in at https://www.fabric.io/login, but mechanize seems unable to find the form. any ideas how to solve this?
[19:15:23] cahoots: RickHull, when i open up the source code, i see a form with class .sdk-form
[19:16:00] cahoots: perhaps some js is adding it dynamically and mechanize only picks up on the initial html download?
[19:16:17] cahoots: RickHull, inspect one of the form fields
[19:16:30] cahoots: then in that source code view, you'll see the form
[19:24:59] cahoots: Ping timeout: 268 seconds
[21:06:10] cahoots: has joined #ruby
[21:42:05] cahoots: Ping timeout: 240 seconds

2017-11-03

[00:07:28] cahoots: Ping timeout: 248 seconds
[01:24:57] cahoots: has joined #ruby
[01:29:06] cahoots: Client Quit

2017-11-02

[21:55:01] cahoots: has joined #ruby
[21:55:35] cahoots: hi, when i use the Hash#to_json and JSON#pretty_generate methods, it gives me fat arrows instead of colons in the hashes. what might be the issue?
[21:56:47] cahoots: ohhh lol it's because i was using hashes as keys in the hash... which json doesn't support
[21:56:55] cahoots: seems like that should raise an exception...
[22:06:57] cahoots: Ping timeout: 248 seconds
[22:11:07] cahoots: has joined #ruby
[22:31:59] cahoots: Ping timeout: 252 seconds
[22:32:57] cahoots: has joined #ruby
[22:37:21] cahoots: Ping timeout: 240 seconds
[22:43:35] cahoots: has joined #ruby

2017-10-21

[00:06:19] cahoots: yeah, makes sense
[00:06:24] cahoots: intellij idea handles this for java
[00:07:21] cahoots: again, you would have false positives for metaprogramming. but metaprogramming is very rare for many projects, or in limited scopes within projects
[00:08:55] cahoots: you're saying that because it's a monkeypatch, it wouldn't work? that's incorrect. objc, e.g. handles monkeypatching, i.e. categories
[00:10:02] cahoots: i see. sure, that's a pretty rare case, and probably a bug
[00:10:09] cahoots: even if it works at runtime
[00:11:53] cahoots: hehe yeah i haven't worked on too large a variety of projects
[00:14:24] cahoots: zenspider, that's a different case, but yeah that's a nice static check to have
[00:15:45] cahoots: different from trying to call a method on a variable that doesn't exist. perhaps i mistyped earlier
[00:56:50] cahoots: Ping timeout: 252 seconds
[01:12:19] cahoots: has joined #ruby
[01:28:02] cahoots: Quit: leaving

2017-10-20

[23:40:22] cahoots: has joined #ruby
[23:41:28] cahoots: hi, is there any static code checker that finds things like the use of uninitialized variables? there are certainly cases where it would find false positives, e.g. where you really on method_missing, but it would be good to have a checker that assumes you're not doing that and shows you issues
[23:43:36] cahoots: RickHull, let's say i rename a variable but i don't update all usages of it
[23:44:12] cahoots: static checking of this is done in compiled languages...
[23:45:39] cahoots: what you're saying is, you're not aware of a static checker that does this
[23:48:45] cahoots: elomatreb, metaprogramming is pretty uncommon in one-off scripts
[23:50:43] cahoots: RickHull, running a program can take a while, and may not go through every code path on every run. static tests aren't bad, but this provides another layer off checking
[23:51:42] cahoots: i don't think you're understanding my point RickHull
[23:52:03] cahoots: that's fair elomatreb, it may have to be more limited in scope, e.g. local variables would still be valid to check
[23:55:17] cahoots: elomatreb, dependencies can still be checked statically, it just requires the sort of complex indexing that good ides do
[23:59:36] cahoots: yes, i agree
[23:59:48] cahoots: makes sense, thanks

2017-09-16

[01:23:11] cahoots: Ping timeout: 248 seconds
[01:43:28] cahoots: has joined #ruby
[01:51:14] cahoots: Quit: leaving

2017-09-15

[17:56:31] cahoots: has joined #ruby
[21:36:09] cahoots: Ping timeout: 252 seconds
[21:40:29] cahoots: has joined #ruby
[22:01:06] cahoots: Ping timeout: 246 seconds
[22:20:42] cahoots: has joined #ruby

2017-08-16

[01:17:27] cahoots: Ping timeout: 240 seconds
[01:58:36] cahoots: has joined #ruby
[04:29:38] cahoots: Ping timeout: 246 seconds
[06:25:46] cahoots: has joined #ruby
[06:30:51] cahoots: Ping timeout: 255 seconds
[08:26:35] cahoots: has joined #ruby
[08:31:10] cahoots: Ping timeout: 240 seconds
[10:27:27] cahoots: has joined #ruby
[10:32:28] cahoots: Ping timeout: 240 seconds
[12:28:23] cahoots: has joined #ruby
[12:32:57] cahoots: Ping timeout: 240 seconds
[14:29:12] cahoots: has joined #ruby
[14:34:22] cahoots: Ping timeout: 260 seconds
[15:10:26] cahoots: has joined #ruby
[15:14:43] cahoots: Client Quit

2017-08-15

[17:56:00] cahoots: has joined #ruby
[19:12:58] cahoots: hi, i see that gems like https://rubygems.org/gems/method_source/versions/0.8.2 don't have any license. does that mean that you can't even download them, because they're protected by copyright law?
[19:56:17] cahoots: havenwood, ah i see, thanks
[19:56:30] cahoots: can you believe anyone uses gpl?
[20:11:21] cahoots: let's say i have a gem with a dependency with a version like "~> 1.1", and i want to restrict it to using a specific version, say, 1.1.1. how can i do this?
[20:12:44] cahoots: roboncloud, so would i add that i want the dependency explicitly and give it a specific version in the same file as i specify the gem with that dependency?
[20:16:16] cahoots: hopefully there's an easier way than doing real code
[20:16:23] cahoots: i was thinking i could do it in the dsl of a Gemfile
[20:36:23] cahoots: matthewd, just keeping versions constant because our legal team requires all open-source stuff to be approved by them. so if i leave the version open-ended, technically they could release a new version with a different license
[20:36:55] cahoots: the way i'm specifying the dependency version is by just listing out that dependency as a separate gem, and it seems to work. is there a better way?
[20:37:23] cahoots: so i should edit the Gemfile.lock with s/~> /=/ ?
[20:37:52] cahoots: the issue is that ~> doesn't restrict it to a single version
[20:38:54] cahoots: even when i list out my dependencies in the Gemfile, the Gemfile.lock still shows "~>". but in practice it seems to download the gem i want
[20:39:23] cahoots: https://gist.github.com/michaeleiselsc/323a3fc0912121c5ec81acf171897d95
[20:40:24] cahoots: matthewd, it lists the exact version of the gem, but not the exact version of its dependencies necessarily
[21:04:57] cahoots: Ping timeout: 260 seconds
[21:10:53] cahoots: has joined #ruby
[22:21:27] cahoots: Ping timeout: 240 seconds
[22:26:15] cahoots: has joined #ruby

2017-08-05

[00:37:48] cahoots: Ping timeout: 260 seconds
[03:14:27] cahoots: has joined #ruby
[03:40:35] cahoots: Quit: leaving

2017-08-04

[03:49:35] cahoots: Ping timeout: 240 seconds
[04:29:35] cahoots: has joined #ruby
[04:33:57] cahoots: Ping timeout: 240 seconds
[15:25:12] cahoots: has joined #ruby
[15:42:22] cahoots: Ping timeout: 276 seconds
[16:42:59] cahoots: has joined #ruby
[16:43:05] cahoots: Client Quit
[23:27:33] cahoots: has joined #ruby
[23:28:41] cahoots: i'm running into a case frequently where i have a method does same lifting, let's call it "params()", and then i want to store that to a local variable to reuse efficiently. but i can't name it "params" because that would be weird... so would you call it "get_params()"? "fetch_params()"?
[23:28:46] cahoots: let's get pedantic
[23:30:52] cahoots: yorickpeterse, yes, that's what i'd end up with
[23:31:05] cahoots: the method is just split out to keep each method smal
[23:48:48] cahoots: yorickpeterse, i guess one thing i'm wondering is, is it considered bad form to name a local var the same as a method? does the interpreter get confused sometimes?

2017-08-03

[02:13:33] cahoots: has joined #ruby
[02:25:21] cahoots: hi, i'm having a strange issue. if a gem, mygem, isn't installed, and i run `gem install mygem` and then 'gem "mygem", "=1.0"' immediately after, it tells me that it can't find the gem. but then on subsequent runs, where the gem has been installed, that call to the gem function works. how can i fix this?
[02:25:33] cahoots: is gem install starting some async task that i need to wait for?
[02:32:14] cahoots: meh, looks like this fixed more elegantly anyways by using Gem::Commands::InstallCommand
[02:38:56] cahoots: Radar, this is a script that will run on a remote CI machine. so i want to only install gems within the directory of the script, and then i want to delete all untracked files on a fresh run
[02:43:02] cahoots: Radar, but then i still have to install the bundle gem, no?
[02:44:27] cahoots: also, if i went the bundle route, i would need to remember to run "bundle exec ruby" instead of "ruby" every time, correct?
[02:50:35] cahoots: nofxxxx, how does that work, because i put "#!/usr/bin/env ruby" at the top which would make it just run /usr/bin/ruby, right? how does bundle get involved?
[02:56:18] cahoots: nofxxxx, i'm confused, can you rephrase what you're talking about?
[03:04:17] cahoots: nofxxxx, so you'd have like, script.sh which calls bundle exec on script.rb?
[03:18:58] cahoots: nofxxxx and Radar, thanks, i'll keep messing with bundler
[03:50:52] cahoots: Ping timeout: 276 seconds
[16:53:40] cahoots: has joined #ruby
[16:58:40] cahoots: Ping timeout: 276 seconds
[16:59:02] cahoots: has joined #ruby

2017-07-30

[14:16:54] cahoots: has joined #ruby
[14:25:56] cahoots: Quit: leaving

2017-07-29

[00:06:32] cahoots: Ping timeout: 260 seconds
[00:08:14] cahoots: has joined #ruby
[00:12:19] cahoots: Ping timeout: 240 seconds
[10:37:11] cahoots: has joined #ruby
[10:41:40] cahoots: Ping timeout: 260 seconds

2017-07-28

[01:08:50] cahoots: Ping timeout: 240 seconds
[02:37:37] cahoots: has joined #ruby
[02:43:48] cahoots: Ping timeout: 240 seconds
[19:47:39] cahoots: has joined #ruby

2017-07-27

[01:13:05] cahoots: Ping timeout: 248 seconds
[11:35:00] cahoots: has joined #ruby
[13:15:10] cahoots: Ping timeout: 258 seconds
[13:17:38] cahoots: has joined #ruby
[13:48:42] cahoots: Ping timeout: 255 seconds
[14:05:01] cahoots: has joined #ruby
[14:10:42] cahoots: Ping timeout: 260 seconds
[16:07:22] cahoots: has joined #ruby
[16:11:50] cahoots: Ping timeout: 240 seconds
[17:24:29] cahoots: has joined #ruby
[20:35:05] cahoots: Ping timeout: 240 seconds
[21:41:17] cahoots: has joined #ruby
[22:39:43] cahoots: Ping timeout: 255 seconds
[23:12:30] cahoots: has joined #ruby

2017-07-26

[20:17:25] cahoots: has joined #ruby
[20:18:13] cahoots: hi, if i run a command with `<command>` and then on the next line call $?.exitstatus, is it guaranteed to return the exit status of that command? or could it be overridden by some command running in parallel?
[20:19:48] cahoots: yorickpeterse, thanks :)

2017-07-14

[03:29:59] cahoots: has joined #ruby
[03:34:33] cahoots: Ping timeout: 260 seconds

2017-07-13

[19:29:09] cahoots: has joined #ruby
[19:33:35] cahoots: Ping timeout: 240 seconds

2017-07-08

[00:00:33] cahoots: Ping timeout: 248 seconds
[00:42:35] cahoots: has joined #ruby
[00:49:42] cahoots: Ping timeout: 240 seconds
[12:46:54] cahoots: has joined #ruby
[12:51:12] cahoots: Ping timeout: 240 seconds

2017-07-07

[23:17:31] cahoots: has joined #ruby
[23:18:00] cahoots: hi, why does "^#define\\s+\\w+\\s*\\w*$".gsub("+", "\\+") return "^#define\\s\\w\\s*\\w*$" ?
[23:19:09] cahoots: dang, the gsub escapes it after it substitutes for some reason
[23:19:13] cahoots: so i need "\\\\+"
[23:29:13] cahoots: idk why they'd couple a cpu with a monitor for high-end stuff
[23:29:29] cahoots: like if i want a data center of macs, i don't want a bunch of monitors along with
[23:31:56] cahoots: they can just by a separate monitor though
[23:34:24] cahoots: sure, but they have more customers than just you

2017-05-18

[04:11:03] cahoots: has joined #ruby
[04:11:36] cahoots: hi, is there a library that will sample the code every so often and just show me what it's doing? like, every second it prints out what the script is doing at that moment
[04:11:53] cahoots: i just need to very broadly understand what the bottlenecks
[04:13:41] cahoots: baweaver, it would just be more convenient to attach something. it can also be a decently large file where many bottlenecks may arise
[04:16:37] cahoots: yeah it looks like ruby-prof will work, thanks :)
[04:49:37] cahoots: Ping timeout: 246 seconds
[16:38:26] cahoots: has joined #ruby
[16:40:25] cahoots: Client Quit
[16:56:32] cahoots: has joined #ruby
[16:58:07] cahoots: hi, i'm working with a compile command that includes a file path i want to extract, and that file path may have escaped spaces. if it didn't have spaces, i could just do ([^\s]+) to get it, but since it does how can i easily get it out?
[17:22:35] cahoots: al2o3-cr, so i have a string like "gcc -o file path/to/with\ spaces/file.c -more -flags"
[17:22:49] cahoots: and i want to extract that whole path
[17:23:26] cahoots: in fact, i want to split up the entire string by non-escaped spaces into tokens
[17:29:49] cahoots: shellsplit, nice. thanks!
[18:16:16] cahoots: Quit: leaving

2017-05-17

[00:38:48] cahoots: Ping timeout: 240 seconds
[00:39:50] cahoots: has joined #ruby
[00:44:53] cahoots: Ping timeout: 260 seconds
[01:19:36] cahoots: has joined #ruby
[01:28:08] cahoots: Ping timeout: 246 seconds
[13:25:25] cahoots: has joined #ruby
[13:30:12] cahoots: Ping timeout: 260 seconds

2017-05-16

[15:02:17] cahoots: it seems like properness is correlated with verboseness
[15:03:47] cahoots: it doesn't matter if my project adopts a consistent structure
[15:04:37] cahoots: dminuoso, i don't think any third-party libs care which directory is current. even if i didn't change dir from within the script, it's inherited from the shell
[15:06:00] cahoots: the great thing about ruby is you can do it lots of ways, so i'll stick with mine
[15:10:04] cahoots: yeah i'll check it out
[15:10:10] cahoots: thanks for the advice dminuoso elomatreb
[17:35:38] cahoots: Ping timeout: 246 seconds
[22:05:48] cahoots: has joined #ruby