« Back to channel list

#ruby - 17 July 2018

« Back 1 day Forward 1 day »
[00:12:23] bga57: has joined #ruby
[00:20:36] chkilroy: has joined #ruby
[00:25:56] akaiiro: has joined #ruby
[00:25:58] s2013: has joined #ruby
[00:49:57] openstruct: has joined #ruby
[00:52:12] openstruct: Been debugging a stack level too deep error for the past few days and am out of debugging ideas. I've got a service object that works perfectly when run via the console, but raises the stack error when delayed with sidekiq. In particular, it works with #perform but not with #perform_async.
[00:53:44] openstruct: AFAIK sidekiq uses a normal ruby process, but I can't determine why that process can't handle the work.
[00:56:02] openstruct: Hmm might be related to celluloid.
[00:59:25] jottr_: has joined #ruby
[00:59:54] fmcgeough: has joined #ruby
[01:00:18] mistergibson: openstruct: do you use celluloid and fibers at the same time?
[01:01:25] openstruct: mistergibson: Not intentionally, but the sidekiq version I have does. Upgrading to the latest sidekiq again to see if that's the case.
[01:02:00] mistergibson: openstruct: can you keep it from using fibers - the celluloid guide warns of using them.
[01:02:01] s2013: has joined #ruby
[01:02:22] juiko: has joined #ruby
[01:02:34] openstruct: mistergibson: Just upgraded to the latest version that no longer users celluloid, but alas the error remains.
[01:02:59] mistergibson: openstruct: odd that - ok, I dunno then
[01:03:20] openstruct: Thanks for the suggestion though!
[01:04:20] mistergibson: openstruct: np
[01:06:36] subroot: has joined #ruby
[01:19:51] jaequery: has joined #ruby
[01:42:35] Tempesta: has joined #ruby
[01:43:34] juiko: has joined #ruby
[01:53:43] jottr_: has joined #ruby
[01:58:23] SeepingN: has joined #ruby
[01:59:20] bonhoeffer: has joined #ruby
[01:59:29] karapetyan: has joined #ruby
[02:05:36] kapil___: has joined #ruby
[02:21:18] wilbert: has joined #ruby
[02:22:39] cadillac_: has joined #ruby
[02:24:04] nOgAnOo_: has joined #ruby
[02:34:17] bonhoeffer: has joined #ruby
[02:48:06] giraffe: has joined #ruby
[02:49:06] tpendragon: has joined #ruby
[02:49:46] bak1an: has joined #ruby
[02:51:21] jottr_: has joined #ruby
[02:56:57] juiko: has joined #ruby
[02:58:07] bmurt: has joined #ruby
[03:02:05] redlegion: has joined #ruby
[03:09:05] c0ncealed2: has joined #ruby
[03:09:32] potatoe: has joined #ruby
[03:10:00] potatoe: Hello, I'm trying to use this gem which provides a CLI interface: https://github.com/strongself/fabricio/ but it doesnt actually have the executable, they recommend adding a bin wrapper: https://github.com/strongself/fabricio/issues/53 but how do I do that?
[03:10:07] potatoe: I'm not familiar with Ruby, apologies. thanks!
[03:10:13] braincrash: has joined #ruby
[03:10:48] darkhanb: has joined #ruby
[03:16:55] icantc: My understanding of a bin-wrapper is not language specific. It is just a shell script which is added to the bin and runs the program.
[03:17:40] r29v: has joined #ruby
[03:18:34] potatoe: icantc right, but idk what to run
[03:18:38] potatoe: for this specific gem
[03:22:24] icantc: bearing in mind that i have no idea myself, i would guess something like: https://pastebin.com/raw/EgQVCb4j
[03:22:24] ruby[bot]: icantc: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[03:24:03] icantc: bearing in mind that i have no idea myself, i would guess something like: https://paste.ee/p/gWZeY
[03:24:23] jottr_: has joined #ruby
[03:25:26] potatoe: that doesnt help sadly
[03:25:55] potatoe: I'd contribtue if I knew ruby but why dont the dev just provide a bin wrapper or atleast mention hojw to do it in the tutorial :/
[03:26:00] potatoe: contribute*
[03:26:53] icantc: okay i see it now
[03:27:26] icantc: you just need to add a file to your bin (or path if wind) which calls this guy https://github.com/strongself/fabricio/blob/develop/bin/fabricio
[03:31:02] kryptoz: has joined #ruby
[03:31:33] jaequery: has joined #ruby
[03:42:57] potatoe: icantc thanks a lot!
[03:53:24] gix: has joined #ruby
[03:55:45] BaroMeter: has joined #ruby
[03:57:00] sauvin: has joined #ruby
[04:08:11] sidntrivedi012[m: Hey everyone, just wanted to ask that can a course completion certificate generator be made using Ruby? I mean is there any way?
[04:08:47] sidntrivedi012[m: It will be like the participant will enter his name and a certificate will be generated.
[04:08:56] sidntrivedi012[m: Either in ruby/rails
[04:28:02] alfiemax: has joined #ruby
[04:29:09] baweaver: sidntrivedi012[m: There's a way, sure, but yes and no
[04:30:02] baweaver: Can you do it: yes. Is it really all Ruby or Rails on it? No. It'd mostly be HTML / CSS with print stylesheets
[04:30:56] openstruct: Might be able to use pdftk to fill out PDF that has form elements. I think there's a ruby wrapper for it out there.
[04:33:11] podlech: has joined #ruby
[04:36:46] sagax: has joined #ruby
[04:36:58] redlegion: has joined #ruby
[05:09:00] r29v: has joined #ruby
[05:17:02] fsmauri21: has joined #ruby
[05:19:46] lomex: has joined #ruby
[05:25:14] jottr_: has joined #ruby
[05:25:38] aupadhye: has joined #ruby
[05:32:51] kapil___: has joined #ruby
[05:38:28] tdy: has joined #ruby
[05:52:37] mohsen_1: has joined #ruby
[05:52:55] yqrashawn: has joined #ruby
[05:54:50] User458764: has joined #ruby
[06:02:37] anisha: has joined #ruby
[06:05:38] yqrashawn: has joined #ruby
[06:07:22] maiz: has joined #ruby
[06:10:11] biberu: has joined #ruby
[06:14:33] Nicmavr: has joined #ruby
[06:14:50] RougeR: has joined #ruby
[06:14:50] RougeR: has joined #ruby
[06:20:12] crankharder: has joined #ruby
[06:28:54] DTZUZO: has joined #ruby
[06:41:42] konsolebox: has joined #ruby
[06:49:16] maiz: has joined #ruby
[06:50:57] schleppel: has joined #ruby
[07:04:37] conta: has joined #ruby
[07:05:26] badeball: I have a lazy enumerator and want to partition it and do something / iterate over both partitions in a lazy way. is there a way to do this without invoking the base, lazy enumerator twice? (is my question at all making sense?)
[07:07:17] badeball: while retaining the lazy property all the way
[07:09:37] nic0x819: has joined #ruby
[07:11:02] clemens3: has joined #ruby
[07:11:58] badeball: I have a vague idea that I can achieve this using fibers
[07:13:48] Guest39745: has joined #ruby
[07:21:08] amar_: has joined #ruby
[07:26:06] jottr_: has joined #ruby
[07:27:58] dionysus69: has joined #ruby
[07:30:34] alem0lars: has joined #ruby
[07:30:54] schneider: has joined #ruby
[07:39:47] dbugger_: has joined #ruby
[07:41:42] yohji: has joined #ruby
[07:43:34] sysvalve: has joined #ruby
[07:47:55] suukim: has joined #ruby
[07:53:58] ged: has joined #ruby
[07:59:45] alex``: has joined #ruby
[08:02:10] andikr: has joined #ruby
[08:02:29] mikecmpbll: has joined #ruby
[08:07:27] mikecmpbll: has joined #ruby
[08:09:01] sphenxes: has joined #ruby
[08:09:39] jalcine: has joined #ruby
[08:10:28] shoogz: has joined #ruby
[08:17:26] venmx: has joined #ruby
[08:17:38] Map: has joined #ruby
[08:21:36] amar_: has joined #ruby
[08:21:36] subroot: has joined #ruby
[08:21:51] amar_: has joined #ruby
[08:23:20] guille-moe: has joined #ruby
[08:23:22] alex``: has joined #ruby
[08:27:22] anisha: has joined #ruby
[08:27:28] shinnya: has joined #ruby
[08:28:59] lucasr: hi, with sinatra, is there a nice way to always ensure that there's a newline at the end of the server response? it's not there by default and makes things a bit ugly when debugging with curl
[08:38:30] kliq: has joined #ruby
[08:39:55] pistachio: has joined #ruby
[08:42:50] canton7: lucas_, some suggestions on how to get curl to introduce that newline: https://stackoverflow.com/questions/12849584/automatically-add-newline-at-end-of-curl-response-body
[08:44:31] ellcs: has joined #ruby
[08:44:46] Biappi: has left #ruby: ()
[08:46:44] lucasr: canton7: thanks
[08:49:58] jottr_: has joined #ruby
[08:54:11] Beams: has joined #ruby
[08:59:50] User458764: has joined #ruby
[09:02:21] TomyLobo: has joined #ruby
[09:05:44] blackmesa: has joined #ruby
[09:05:58] maiz: has joined #ruby
[09:06:49] jraavis: has joined #ruby
[09:06:56] phaul: has joined #ruby
[09:10:25] phaul: hi, can someone shed some light on https://gist.github.com/phaul/b4e9d7c18257f2e98a4102203411b285 ? In short Set#& relation to eql? ...
[09:10:25] phaul: I expect & to use Object#eql? thus returning a Set with an instance rather than empty set
[09:11:20] canton7: he didn't hang around for long...
[09:11:56] _phaul: has joined #ruby
[09:12:25] canton7: _phaul, objects which are equal MUST have equal hash codes
[09:12:26] _phaul: sorry, my connection is very bad...
[09:13:15] _aeris_: has joined #ruby
[09:16:06] _phaul: canton7: am I right then that for instance 2 instances of a Struct at different memory locations with same attributes would have the same hashes? Ie, does Struct ovverride #hash?
[09:17:00] canton7: _phaul, https://ruby-doc.org/core-2.2.0/Struct.html#method-i-hash, mouseover and click ("click to toggle source")
[09:17:15] canton7: and the doc: "Returns a hash value based on this struct's contents"
[09:17:54] _phaul: ok, explains a lot :) thank you canton7
[09:18:36] canton7: (things like Set and Hash start off using the object's hash code, and if two objects have the same hash code they check #eql? to see if they're actually equal
[09:19:22] pistachio: has joined #ruby
[09:20:16] _phaul: I am sure I had been in this same culprit in the past.. probably asking the same here.. few month off coding, and Im asking the same questions again :) what does that tell you about ruby .. ;)
[09:20:29] _phaul: or about me :)
[09:21:27] _phaul: anyways. thanks again I got to go
[09:25:00] venmx: has joined #ruby
[09:26:35] gray_-_wolf: when I start ruby from C (ruby_init, ..., rb_funcall2), start new thread in the called function and return back to C, the new thread seems to stop (it does not do anything). My assumption is that that's GVL in action, correct?
[09:27:40] jottr_: has joined #ruby
[09:27:47] maiz: has joined #ruby
[09:30:56] TinkerT: has joined #ruby
[09:32:34] jrm: has joined #ruby
[09:34:10] badeball: regarding lazy partition, I kind of got something working with http://ix.io/1hs5, however if one were to EG. accidentally not iterate over both partitions, nothing would happen and no warnings emitted
[09:35:02] Beams: has joined #ruby
[09:35:49] yohji: has joined #ruby
[09:52:03] amar: has joined #ruby
[09:54:01] mohsen_1: has joined #ruby
[09:54:12] venmx: has joined #ruby
[10:00:03] AnomalyXII: has joined #ruby
[10:00:06] aufi: has joined #ruby
[10:03:47] ur5us: has joined #ruby
[10:03:58] amar: has joined #ruby
[10:08:38] apeiros: has joined #ruby
[10:10:08] redlegion: has joined #ruby
[10:10:08] SanguineAnomaly: has joined #ruby
[10:13:38] karapetyan: has joined #ruby
[10:15:18] schneider: has joined #ruby
[10:17:48] karapety_: has joined #ruby
[10:25:09] alfiemax: has joined #ruby
[10:28:08] karapetyan: has joined #ruby
[10:38:05] ciscam: has joined #ruby
[10:38:10] cyberg: has joined #ruby
[10:39:48] blackmesa1: has joined #ruby
[10:42:04] amar_: has joined #ruby
[10:43:44] amarks: has joined #ruby
[10:44:10] cyberg: has left #ruby: ("Leaving")
[10:50:05] gigetoo: has joined #ruby
[10:50:28] blackmesa: has joined #ruby
[10:53:04] arekushi: has joined #ruby
[10:53:53] jrafanie: has joined #ruby
[10:56:05] maiz: has joined #ruby
[10:56:15] AJA4350: has joined #ruby
[10:59:13] Zaab1t: has joined #ruby
[11:03:32] lele: has joined #ruby
[11:05:26] alex``: has joined #ruby
[11:06:34] pistachio: has joined #ruby
[11:09:39] alfiemax: has joined #ruby
[11:10:21] maiz: has joined #ruby
[11:15:36] andikr: has joined #ruby
[11:25:33] alfiemax_: has joined #ruby
[11:28:17] ldnunes: has joined #ruby
[11:28:33] jottr_: has joined #ruby
[11:36:27] hays: has joined #ruby
[11:39:19] maiz: has joined #ruby
[11:39:49] andikr: has joined #ruby
[11:42:55] schneider: has joined #ruby
[11:47:18] hays_: has joined #ruby
[11:48:52] x0F: has joined #ruby
[11:56:35] karapetyan: has joined #ruby
[11:59:55] cmandr: has joined #ruby
[12:00:04] tvw: has joined #ruby
[12:03:47] dionysus69: has joined #ruby
[12:07:58] synthroid: has joined #ruby
[12:11:11] quobo: has joined #ruby
[12:12:35] bak1an: has joined #ruby
[12:13:27] InfinityFye: has joined #ruby
[12:16:07] wget: has joined #ruby
[12:16:07] wget: has joined #ruby
[12:16:41] wget: has joined #ruby
[12:16:41] wget: has joined #ruby
[12:22:26] schneider: has joined #ruby
[12:22:37] maiz: has joined #ruby
[12:27:51] anisha: has joined #ruby
[12:30:36] alfiemax: has joined #ruby
[12:37:48] graphene: has joined #ruby
[12:38:18] jtdowney: has joined #ruby
[12:39:37] fmcgeough: has joined #ruby
[12:46:06] schneider: has joined #ruby
[12:49:43] alfiemax_: has joined #ruby
[12:50:16] jokke1: has joined #ruby
[12:54:56] vonfry: has joined #ruby
[12:59:30] amar_: has joined #ruby
[13:00:42] InfinityFye: has joined #ruby
[13:00:45] amar_: has joined #ruby
[13:02:50] crankharder: has joined #ruby
[13:08:16] crankhar1er: has joined #ruby
[13:14:41] synthroid: has joined #ruby
[13:16:41] maiz: has joined #ruby
[13:18:58] Raybih: has joined #ruby
[13:26:03] Alina-malina: has joined #ruby
[13:28:59] crankharder: has joined #ruby
[13:29:14] graphene: has joined #ruby
[13:29:25] jottr_: has joined #ruby
[13:30:56] crankharder: Thunderbird regularly triggers OSX alerts for emails that came in yesterday up to a week ago. I would think notifications should be reserved for *new* emails. Can that be configured somehow?
[13:33:45] rsh: has joined #ruby
[13:35:02] synthroid: has joined #ruby
[13:41:02] bmurt: has joined #ruby
[13:41:23] alfiemax: has joined #ruby
[13:45:19] mohsen_1: has left #ruby: ()
[13:49:42] canton7: crankharder, wrong channel?
[13:49:50] t-richards: has joined #ruby
[13:51:37] Alec: canton7: hexchat clearly shows you the currently viewed channel
[13:51:39] Alec: Check the title bar
[13:51:42] Alec: If that fails
[13:51:51] alfiemax: has joined #ruby
[13:52:11] canton7: I'm sorry? I'm asking crankharder whether he posted in the wrong channel by mistake, as his message doesn't appear to have anything to do with ruby
[13:52:15] canton7: I know I'm in #ruby :P
[13:52:21] augcesar: has joined #ruby
[13:52:31] Alec: Now you do yes, you're welcome.
[13:52:54] canton7: ACTION is very confused
[13:53:27] white_lilies: has joined #ruby
[13:53:51] amar_: has joined #ruby
[13:54:41] quobo: has joined #ruby
[13:55:22] amar_: has joined #ruby
[13:56:30] alfiemax: has joined #ruby
[13:57:34] crankharder: in my head, I'm wherever I need to be
[13:59:32] Rapture: has joined #ruby
[14:00:11] blackmesa: has joined #ruby
[14:00:13] Alec: badeball: you seriously trying to summon ops to deal with a spaz who doesn't know notifications are generated when mail is detected for the first time (which may happen twice if thunderbird doesn't commit that it saw them) interrupting (briefly with one post half an hour ago) and someone else not knowing what channel it was?
[14:00:37] bmurt: has joined #ruby
[14:01:02] yokel: has joined #ruby
[14:02:26] gnufied: has joined #ruby
[14:04:36] jrafanie: has joined #ruby
[14:04:41] canton7: and a third person who seems to be fixated on the idea that the person who pointed out what channel this is doesn't know which channel this is...
[14:05:08] Alec: Right, and a third person that talks giberish in the third person, what he said!
[14:11:47] gray_-_wolf: when I think ticket is stalled for way too long (I understand all the Japanese devs are busy people) and would like at least quick clarification and docs update, what's the best place to raise the issue? comment on existing ticket, create new ticket, ruby-talk or ruby-core?
[14:16:22] InfinityFye: has left #ruby: ("Leaving")
[14:19:17] Alec: gray_-_wolf: mailing list probs
[14:19:57] Alec: badeball: topic
[14:21:04] Alec: gray_-_wolf: if you have a suggestion or a handful of cases the answer could be say something like "it should say this: " or "this: "
[14:21:08] Alec: Make it easy to help you
[14:27:10] nic0x819: has joined #ruby
[14:27:31] gray_-_wolf: will ping ruby-talk then, thx :)
[14:27:41] graphene: has joined #ruby
[14:29:41] graphene: has joined #ruby
[14:32:56] User458764: has joined #ruby
[14:33:04] apeiros: badeball: it's !ops. what's up?
[14:35:07] karapetyan: has joined #ruby
[14:35:17] badeball: apeiros: I meant ops as in «whops, I accidentally topic when I wanted /topic»
[14:36:02] apeiros: I think oops works as well
[14:36:03] deadblackclover: has joined #ruby
[14:37:23] Alec: ACTION gives badeball a nod of respect.
[14:38:25] venmx: has joined #ruby
[14:38:40] _aeris_: has joined #ruby
[14:38:49] graphene: has joined #ruby
[14:44:35] mikecmpb_: has joined #ruby
[14:46:35] t-richards_: has joined #ruby
[14:47:36] Inline: has joined #ruby
[14:48:46] za1b1tsu: has joined #ruby
[14:48:50] deadblackclover: has left #ruby: ("Konversation terminated!")
[14:58:31] _aeris_: has joined #ruby
[15:01:03] Bish: anyone has a cool way to extract the domain out of a url
[15:01:15] Bish: since there is no intrinsic way to get a TLD from a domain
[15:01:44] Bish: yah googling "list of tlds" and "regex all tlds" for 10 minutes now an i am lost
[15:01:59] alfiemax: has joined #ruby
[15:02:24] gray_-_wolf: URI.parse(url).host.downcase
[15:02:25] Alec: IIRC (<--- code for, no fucking idea where I found this out, good luck) - all new domains which are words (the majority, others will be clearly noted) will not be multipart
[15:02:38] Alec: That is no more ".co.uk" TLDs
[15:03:11] reber: has joined #ruby
[15:03:39] Bish: the lone wulf
[15:06:19] Megatroyd: has joined #ruby
[15:12:23] alfiemax_: has joined #ruby
[15:13:16] catphish: has joined #ruby
[15:14:19] catphish: is there likely to be any way i can store an integer variable directly in a mmap'd file with ruby?
[15:15:11] catphish: i guess i can make a wrapper that at least makes it look like that's what's happening but uses pack/unpack behind the scenes
[15:17:31] alem0lars: has joined #ruby
[15:20:06] TomyLobo2: has joined #ruby
[15:20:17] konsolebox: catphish: also check serialization formats like msgpack
[15:20:48] t-richards__: has joined #ruby
[15:23:42] catphish: actually even mmap itself isn't marvellously implemented, i'll go back to normal file operations, will check out msgpack
[15:24:02] catphish: all i want to do is keep a (constantly changing) number in a file
[15:25:43] Alec: catphish: I can't see the benefits of mmap really working if you can't access memory via pointers (an array of bytes isn't really in the "spirit" of mmap)
[15:26:18] catphish: everything is an array of bytes though!
[15:26:19] Alec: Keep in mind that mmap is used by the runtime loader, it literally mmaps our executables and libraries in and links 'em all up - so they can run as the IP drifts onto them without issue
[15:26:24] Alec: Deep stuff bro.
[15:26:51] synthroid: has joined #ruby
[15:27:09] troys: has joined #ruby
[15:27:12] Alec: catphish: do you care about durable writes?
[15:27:46] tcopeland: has joined #ruby
[15:27:50] catphish: that's kind of the point of using a file
[15:27:51] Alec: That is (AT LEAST) say you do two writes A *then* B is your software okay with the chance of running later (after crash or whatever) and B being written but not A?
[15:27:58] Alec: Not if you're mmapping
[15:28:17] catphish: a later question i have is when i actually want to sync the data to disk
[15:28:18] Alec: It can only tell if a page is dirty, not what was changed in what order.
[15:28:42] Alec: write(2) gives you read-after-write consistency - but not durability.
[15:29:01] Alec: even O_DIRECT and O_SYNC don't give you durability. It's the bane of my life.
[15:29:03] Alec: ACTION is alwayss chasing that D!
[15:29:24] Alec: What's funny?
[15:29:55] Alec: Got my eye on you.
[15:29:55] catphish: the first question was really just how to constantly synchronize a number from ruby-land into a file
[15:30:15] catphish: probably no harm in having a value=(n) method that does a pack, seek, write
[15:30:21] jottr_: has joined #ruby
[15:30:28] catphish: but i was trying to be cool
[15:30:31] elomatreb: You could also look into something like pstore to get transactional security
[15:31:04] r29v: has joined #ruby
[15:31:22] ule: This channel is usually more active then Rails. If you don't mind asking here, do you know what's the difference between 5.0.7, 5.1.6, 5.2.0 in terms of stability? Is the Long Terms Support related with these numbers? I just upgraded from 4.2.10 to 5.0.7, so now I'm trying to figure out if it worth upgrading to 5.1 or 5.2. I'm not sure which version makes more sense though. Any thoughts?
[15:31:32] catphish: the use case of this is to store a pointer to a location in another file, and i just realised it might not be necessary at all... i know where i am in the other file because i'm always at the end of it
[15:31:38] Alec: Good luck
[15:31:45] ule: sorry in advance, I know this is a #ruby channel, but anyways.. :)
[15:31:57] konsolebox: rails used to be more active than this channel
[15:32:06] jaequery: has joined #ruby
[15:32:13] apeiros: slack killed it, I guess
[15:32:15] Alec: You also used to be able to buy people.
[15:33:02] catphish: the UNHRC outlawed that
[15:33:35] havenwood: ule: Personally, I'd prefer to be on 5.2 at the moment. I think it's absolutely worth updating to 5.1 immediately. It should be fairly painless and it's always easier to move forward incrementally rather than ossify and get stuck.
[15:34:38] sonOfRa: has joined #ruby
[15:36:01] ule: havenwood: I just read here: http://guides.rubyonrails.org/maintenance_policy.html
[15:36:03] havenwood: ule: There's no semantic meaning to even or odd version numbers.
[15:36:16] ule: that there is only security fixes to 5.2 and 5.1
[15:36:30] ule: havenwood: ok, thank you very much
[15:37:16] Alec: Hey havenwood
[15:37:26] havenwood: catphish: You could use PStore in the stdlib. Is it a number you increment or an arbitrary number?
[15:38:08] Alec: Oh I see! It could be that
[15:38:13] Alec: catphish: use a pipe!
[15:38:49] Alec: There's a guaranteed atomic operation with a pipe (provided you have it so it's non-blocking so it can fail) it's guaranteed to be AT LEAST 512 bytes - even in the presence of many writers.
[15:39:04] synthroid: has joined #ruby
[15:40:28] havenwood: MessagePack.pack 256 #=> "\xCD\x01\x00"
[15:41:25] havenwood: "a value of an Integer object is limited from -(2^63) upto (2^64)-1"
[15:41:26] Alec: man 7 shm_overview
[15:41:30] catphish: havenwood: mostly incremented by 1
[15:41:40] havenwood: catphish: How big might it get?
[15:41:50] konsolebox: and messagepack still has no bigint/dec support
[15:42:52] catphish: havenwood: i was gonna go with 128 bit because why not, it's going to consume a whole disk block anyway :)
[15:42:56] havenwood: Alec: No manual entry for shm_overview in section 7
[15:43:01] Alec: The last caveat there might be btw is the write ordering, say program 1 writes some data then increments this number - there's no guarantee (unless both using read/write on the same fd) that another program will satisfy "if it sees the increment then it will see the data"
[15:43:20] apeiros: havenwood: interesting range, is that upper bound no mistake?
[15:43:30] catphish: but after some thought i'm worried about syncing the pointer file and the data at the same time
[15:43:49] Alec: Dunno what to say, as usual with RTFMing I checked it was there first - pretty sure even the BSDs have that so wtf you using havenwood?
[15:44:13] setient: has joined #ruby
[15:44:17] catphish: since i always write the end of the data file, its probably better to calculate the sequence number simply by seeking to the end of the data file
[15:44:21] havenwood: apeiros: no mistake, but i haven't looked into the "why"
[15:44:23] havenwood: apeiros: https://github.com/msgpack/msgpack/blob/master/spec.md#limitation
[15:44:34] havenwood: https://github.com/msgpack/msgpack/blob/master/spec.md#int-format-family
[15:44:41] Alec: O_APPEND is slightly different to just writing at the end of the file
[15:44:49] Alec: It gives a slightly stronger guarantee
[15:44:57] catphish: interesting
[15:45:11] havenwood: Alec: I was on Fedora, but same on macOS
[15:45:47] Alec: havenwood: is it "embedded" or something silly like that?
[15:45:51] Alec: try man -k shm
[15:46:03] catphish: the goal here is to collect some data, simultaneously write it to a journal file, and sent it to network clients along with a location integer, if a client connection is lost, it can reconnect and resume from the last location it received
[15:46:11] Alec: Also do you have /dev/shm (should be a directory)
[15:46:16] apeiros: havenwood: separate types for signed / unsigned. I see.
[15:46:56] tty: has joined #ruby
[15:46:59] Alec: Oh man catphish you have totally underestimated the state of the world.
[15:47:02] catphish: so i think i can just open the file at startup with O_APPEND, check the seek location, divide it by my block size, and that's my sequence number
[15:47:14] apeiros: I wonder why they didn't an arbitrarily sized int type.
[15:47:34] Alec: I would love to bitch about this but I've really got to work sorry. apeiros probably because that can't be used in a structure and may not be a POD data-type
[15:47:58] Alec: You have uint64_t[] for really long values
[15:48:17] catphish: 64 is pretty long, but not as long as an ip address :(
[15:49:03] catphish: we need 128 bit CPUs immediately :)
[15:49:39] catphish: Alec: maybe i just don't like the state of the world, but what imply you?
[15:51:01] Alec: That you're very unlikely to get a durable / consistent journal from this [it wont happen, but you may not notice due to reliability and luck]
[15:51:52] Alec: If you actually care I'll show you my 6-fsync theorem and that depends on fsync doing its job (most FSs dont)
[15:52:02] catphish: i had assumed that if i sync'd every write before i transmitted it i'd be good :(
[15:52:23] Alec: I'd kill for that.
[15:52:44] catphish: but in all honesty, it doesn't matter, in the case of a crash, data's being lost constantly because it's not being collected at all, so a few missed items in the journal is meh
[15:53:23] Alec: As long as you can guarantee your guarantees you can tell the users to fuck off :)
[15:53:30] catphish: the aim is more to allow clients to come and go at will and catch up, when they come back
[15:53:47] Alec: I leave the clients in your hands
[15:53:50] catphish: if the server crashes, data is guarenteed lost
[15:54:40] catphish: also, seriously, what's the point in having sync if it doesn't block until the data hits the physical disk?
[15:55:01] catphish: or at least some hardware that acks the write like a BBWC
[15:55:06] Alec: I was like you once.
[15:55:14] SeepingN: has joined #ruby
[15:55:19] Alec: RTFM - it'll turn you into a cynical d-chasing bastard like me.
[15:55:20] catphish: ACTION cries
[15:55:33] catphish: i'm not sure D means what you think it means
[15:56:37] alfiemax: has joined #ruby
[15:57:32] karapetyan: has joined #ruby
[16:00:35] catphish: thanks Alec and all for being mighty fine rubber ducks <3
[16:02:51] Alec: In Ruby if I have a class with two methods x and y (whatever arguments) and I'm writing a method z, how can I call x or y?
[16:02:59] Alec: or do I have to use self.x or something?
[16:03:16] apeiros: just x. self.x will work too as long as the method isn't private.
[16:03:31] Alec: is the dot a part of that?
[16:03:44] bmurt: has joined #ruby
[16:03:46] apeiros: dot is end of phrase, not part of the syntax.
[16:04:10] Alec: Also wtf is <=>? I've seen = used for setters, are operators overloadable or is it something else
[16:04:11] apeiros: and if you have a local variable that takes precedence, so to invoke a method of the same name you need to either x() or self.x
[16:04:16] Alec: context: def <=>...
[16:04:24] apeiros: <=> is order comparison (bigger/equal/smaller)
[16:04:44] apeiros: define <=>, include Comparable, get <, <=, ==, >, >=, between? for free.
[16:05:08] Alec: Oh so it is operator overloading
[16:05:25] apeiros: no, you can't overload in ruby. that'd require typed variables.
[16:05:34] Alec: What operators can I have? Call? mathematical?
[16:05:41] Alec: That's not what operator overloading is.
[16:05:44] apeiros: but most things that are operators in other languages are just fancy methods in ruby.
[16:05:50] Alec: That's signature overloading
[16:05:59] apeiros: you may want to reread upon the definition of overloading.
[16:06:07] Alec: operator overloading is exposing a way for arbitrary types to define meaning to say a*b
[16:06:20] Alec: Trust me man I wrote one of the 4 main books in this area.
[16:06:31] Alec: See Python for example, no types, operator overloading
[16:06:36] Alec: Proof by contradiction.
[16:06:47] apeiros: whatever you say, pal.
[16:06:53] Alec: __mul__ ect
[16:07:28] yokel: has joined #ruby
[16:11:48] bsamorim: has joined #ruby
[16:12:09] User458764: has joined #ruby
[16:12:22] garyserj: has joined #ruby
[16:12:50] dviola: has joined #ruby
[16:13:41] bsamorim: Hi, folks! Does ruby have macros? I mean, can I code in ruby something like "assign(hash[:key], "val")" so that, before the expression is evaluated, it gets substituted for 'hash[:key] = "val"'?
[16:14:36] r29v: has joined #ruby
[16:15:04] biberu: has joined #ruby
[16:15:38] dionysus69: has joined #ruby
[16:17:34] Zarthus: not that I know of, though a method is essentially a macro without the substitution ;D
[16:17:36] maiz: can one set the gem environment?
[16:17:49] maiz: `gem environment gemdir/gempath'
[16:17:54] maiz: are those settable somehow?
[16:17:56] Zarthus: macros are only common in compiled languages afaik
[16:18:18] rsh: has joined #ruby
[16:20:07] jcarl43: has joined #ruby
[16:20:21] Alec: bsamorim: you could fake it maybe? file_in.r include file.r in your code, and swap out how you invoke it for a script that does "make; ./invoke "$@";"
[16:20:25] Alec: the makefile something like:
[16:20:35] Alec: file.r: file_in.r
[16:20:46] bsamorim: Alec: yeah, sure, that'd be great...like C's preprocessor
[16:20:46] Alec: do_macro_processing -o file.r file_in.r
[16:21:05] bsamorim: that's a great idea
[16:21:31] Alec: bsamorim: the trick is now tht you swapped how you invoke the program! So you new way checks it's up to date first (make does, if it's not up to date it'll remake file.r) THEN does the invoker passing arguments
[16:21:59] Alec: Otherwise you could have weird bugs where you're like "but it shoudn't be doing this!" because file.r hasn't been remade to account for changes in file_in.r
[16:22:08] Alec: With the above that can't happen (without errors anyway)
[16:22:13] elomatreb: I feel like we should report this as a crime against *something*
[16:22:27] bsamorim: Yeah, of course, you can just let "make" manage that for u
[16:22:55] Alec: elomatreb: sometimes it's REALLY worth it, but I agree the cost is high.
[16:23:11] elomatreb: Honest advice: A preprocessor is most certainly not the solution you're looking for
[16:23:25] Alec: It depends really - I submit flex/bison for example
[16:23:41] Alec: And other tools that generate code no human should lay his eyes upon.
[16:23:42] elomatreb: Post the actual problem you want to solve, and we can help (now it seems like you decided on a solution and want to know how to realize it)
[16:23:56] elomatreb: Alec: In the context of Ruby, I meant
[16:24:10] Alec: bsamorim: I trust you to know what you want ;)
[16:24:43] Alec: bsamorim: also +1 for knowing make! It's great! I use make to "do" all the papers and my thesis and stuff, like say a file generating graphics changes, it automatically remakes all that is needed :)
[16:24:50] Alec: Undervalued software.
[16:24:52] AJA4350: has joined #ruby
[16:24:58] jmcgnh: has joined #ruby
[16:25:16] bsamorim: elomatreb: that use case is quite plausible, i think
[16:25:26] bsamorim: Basically, side-stepping the lack of pointers in ruby
[16:25:38] bsamorim: I can't have a reference to hash[:key]
[16:25:44] Alec: elomatreb: I do agree BTW that this should not be used lightly, but it works and is hard to fuck up - you could even add some code to check the modified time on file_in.r is before the modified time of file.r just to be safe.
[16:27:26] jasmith: has joined #ruby
[16:27:51] Guest39745: has joined #ruby
[16:29:02] Alec: Also elomatreb I have seem some sexy uses of the C-preprocessor. I sometimes wonder why so few languages shun having one, it can't recurse which means it always halts (except recursion by inclusion)
[16:29:32] Mrgoose: has joined #ruby
[16:29:54] Alec: And that does not mean "nasty brittle cludges" - I'm not a Perl guy, where obscurity earns prestige :P
[16:30:01] elomatreb: If we're talking code generation a proper, safe macro system is the way to go IMO, e.g. like Rust has
[16:30:29] Alec: ACTION judges and shakes his head
[16:31:16] Alec: I've found operator [] support!
[16:32:59] Guest39745: has joined #ruby
[16:35:47] darkhanb: has joined #ruby
[16:37:42] Alec: Seems it does https://www.tutorialspoint.com/ruby/ruby_operators.htm right at the bottom!
[16:41:13] gr33n7007h: has joined #ruby
[16:42:01] leap: has joined #ruby
[16:45:51] User458764: has joined #ruby
[16:47:23] orbyt_: has joined #ruby
[16:50:13] maiz: how do I set the PATH that ruby searches for libraries?
[16:50:39] Alec: Probably an environmental variable.
[16:51:06] maiz: which one is what i wanna know ;)
[16:51:20] mikecmpbll: has joined #ruby
[16:51:48] Alec: maiz: did you actually try to find an answer/
[16:52:12] Alec: Because I'd use a search engine to find out - and I want you to tell me if I'll have no luck please.
[16:52:32] maiz: oh yeah I tried
[16:52:49] maiz: but I think I finally found an answer
[16:52:52] maiz: I'm gonna try
[16:52:58] maiz: RUBYLIB btw
[16:53:02] maiz: is supposed to be the answer
[16:53:15] Alec: did you printenv or echo $RUBYLIB ?
[16:54:15] maiz: no I found the answer in a stackoverflow post
[16:54:33] maiz: apparently the environment variable RUBYLIB is prepended to the LOAD_PATH ruby variable
[16:54:35] maiz: when set
[16:54:41] maiz: so export RUBYLIB=/test
[16:54:43] Nicmavr: has joined #ruby
[16:54:51] maiz: and doing something like puts $LOAD_PATH in ruby
[16:54:56] maiz: should demonstrate it
[16:56:10] Alec: maiz: I can't see it using load path - maybe a ruby var called that but not an env
[16:56:12] Alec: Too generic of a name
[16:57:29] Alec: AFK for a sec sorry GL maiz will be back later if you're still stuck
[17:00:09] amar_: has joined #ruby
[17:00:40] wilbert: has joined #ruby
[17:01:09] jaequery: has joined #ruby
[17:02:41] User458764: has joined #ruby
[17:08:23] ellcs: has joined #ruby
[17:08:23] GodFather: has joined #ruby
[17:12:21] alem0lars: has joined #ruby
[17:16:47] mahlon__: has joined #ruby
[17:18:56] synthroid: has joined #ruby
[17:23:41] Guest39745: has joined #ruby
[17:27:36] dviola: has joined #ruby
[17:30:38] clemens3: has joined #ruby
[17:31:10] jottr_: has joined #ruby
[17:32:06] alex``: has joined #ruby
[17:33:22] amar_: has joined #ruby
[17:33:34] GodFather: has joined #ruby
[17:37:06] amar_: has joined #ruby
[17:42:12] noizex: has joined #ruby
[17:43:15] minimal_life: has joined #ruby
[17:43:36] tuxillo: has joined #ruby
[17:48:15] eckhardt_: has joined #ruby
[17:50:49] jidar: has joined #ruby
[17:50:55] Lyfe: has joined #ruby
[17:51:12] jasmith: has joined #ruby
[17:51:44] Eiam: has joined #ruby
[17:52:13] mr_rich101: has joined #ruby
[17:55:38] shinnya: has joined #ruby
[17:57:40] tff^: has joined #ruby
[17:58:22] spiette: has joined #ruby
[17:59:40] apeiros_: has joined #ruby
[18:00:17] synthroid: has joined #ruby
[18:01:07] alfiemax: has joined #ruby
[18:02:53] Alec: I've seen the terms "continuations" mentioned in Ruby, this could mean a few things but does it mean there are "co-routines" in Ruby?
[18:03:15] Alec: I saw "Fiber" (or correctly: "Fibre") somewhere (think thread, fibre ect)
[18:03:51] mistergibson: Alec: Fibers are co-routines
[18:04:22] Alec: Oh good :)
[18:04:24] mistergibson: Alec: you can pause/resume them
[18:05:02] Alec: WTF? You sure
[18:05:16] Alec: Coroutines is usually coroutine.resume() (OR SOMETHING) <--- it must voluntarily "yield" to allow something else to run.
[18:05:45] Alec: You shouldn't be able to pause one unless it is actually running (but this would be a thread pause,as the thread would not have something else to execute)
[18:06:49] mistergibson: I believe there is a call like current.fiber()
[18:07:08] mistergibson: lets you grasp and manipulate the fiber you're running in
[18:07:42] claudiuinberlin: has joined #ruby
[18:08:12] mistergibson: Alec: Here is the reference for it: https://ruby-doc.org/core-2.5.1/Fiber.html
[18:08:29] mistergibson: note the current and pause methods
[18:08:42] mistergibson: as well as yield
[18:09:10] mistergibson: not pause - sorry, : resume
[18:09:36] Alec: Ah that makes sense
[18:10:11] Alec: mistergibson: sorry for being very pedantic there - just coroutines are supposed to be able to represent a thread that can be run but also yield (unlike a thread, which can only yield in the OS-scheduler sense)
[18:10:44] mistergibson: Alec: yeah, it is the closest thing to a co-routine ruby offers me thinks
[18:11:12] mistergibson: Alec: I've found the combo of threads and fibers to be very powerful and flexible
[18:11:25] Alec: eg x.doABit(); y(); x.doSomeMore(); <---in the same "execution context" - first x does something, yields or is forcibly removed, and control enters y then back to x. Allowing you to have code who's control flow is normal, but can be applied as needed
[18:11:45] GodFather: has joined #ruby
[18:12:05] Alec: a good example is a state machine (or something with even more state) matching network commands, suppose a command is COMMAND and COM has come in, the coroutine runs on this then yields once it's done COM - when more comes in it can be run exactly where it was left off.
[18:12:09] mikecmpbll: has joined #ruby
[18:13:02] Alec: The only other use case really is providing feedback on tasks (like updating progress bars and not blocking the ui) - if you count what I just said as covering "Parsers"
[18:13:02] mistergibson: Alec: right, I wrote into my event management a scheme where you could pause(<seconds>) a fiber running
[18:13:10] Alec: eg GLR (any "generalised" parser) needs it
[18:13:51] clemens3: has joined #ruby
[18:15:01] Alec: Oh and generators/things-that-yield are a "kind" of coroutine - it's rare for a language to have one but not the other (unless the thing yielding values is a class, then the state is in the class and it's calling a method)
[18:21:19] Alec: mistergibson: coroutines have a natural "isomorphism" with a form of recursion. Using the example above suppose we have GetByte, WouldBlock for network and DoOther - the "parser" could do for(;;) { if(WouldBlock()) { DoOther(); } else { GetByte() /*parsing here*/} }
[18:21:59] Alec: DoOther would at some point see if there's any incomin data and call the parser, so you get a stack like: doOther() -> Parser() -> doOther() -> Parser() -> doOther() -> Parser() .... -> ....
[18:23:10] Alec: Static analysis is basically useless in such "unbounded" situations because even in this simple example there's no easy way to group cases, streams could go on forever, but if you split it into coroutines and yield instead, it "flattens" the callstack and becomes managable.
[18:24:15] Alec: You've probably encountered something like this in your event system (something with a main loop) - especially if you allowed things to yield() (call an iteration of the event loop)
[18:24:22] Alec: Not yield like coroutines
[18:30:19] lomex: has joined #ruby
[18:32:55] schneider: has joined #ruby
[18:33:29] alem0lars: has joined #ruby
[18:35:33] GodFather: has joined #ruby
[18:37:01] gix: has joined #ruby
[18:40:41] sepp2k: has joined #ruby
[18:40:42] gix-: has joined #ruby
[18:40:51] dionysus70: has joined #ruby
[18:44:15] samosaphile: has joined #ruby
[18:49:27] Cthulu201: has joined #ruby
[18:50:21] lomex: has joined #ruby
[18:55:30] bak1an: has joined #ruby
[18:58:10] nielsk: has joined #ruby
[18:59:06] maiz: has joined #ruby
[19:00:58] zachk: has joined #ruby
[19:01:32] alfiemax: has joined #ruby
[19:01:40] zachk: has joined #ruby
[19:08:03] graphene: has joined #ruby
[19:08:33] sameerynho: has joined #ruby
[19:09:39] quobo: has joined #ruby
[19:15:29] tty: has joined #ruby
[19:21:39] jamesaxl: has joined #ruby
[19:24:19] DTZUZO: has joined #ruby
[19:24:40] jamesaxl: has joined #ruby
[19:25:35] sphenxes: has joined #ruby
[19:26:42] anisha: has joined #ruby
[19:27:55] pebble2016: has joined #ruby
[19:32:45] AJA4351: has joined #ruby
[19:33:52] Asher: has joined #ruby
[19:37:26] DTZUZO: has joined #ruby
[19:37:36] Guest39745: has joined #ruby
[19:39:38] deathwishdave: has joined #ruby
[19:42:07] agent_white: has joined #ruby
[19:43:20] grilix: has joined #ruby
[19:45:03] blackmesa: has joined #ruby
[19:46:17] claudiuinberlin: has joined #ruby
[19:48:28] karapetyan: has joined #ruby
[19:48:49] GodFather: has joined #ruby
[19:52:22] SeepingN: has joined #ruby
[19:54:09] deathwishdave: has joined #ruby
[19:55:12] AJA4351: has joined #ruby
[19:58:07] Guest39745: has joined #ruby
[19:58:37] whiteline: has joined #ruby
[20:00:23] Asher: has joined #ruby
[20:01:15] deathwishdave: has joined #ruby
[20:12:56] Guest61993: has joined #ruby
[20:15:57] ellcs: has joined #ruby
[20:28:11] AJA4351: has joined #ruby
[20:33:54] guacamole: has joined #ruby
[20:33:54] guacamole: has joined #ruby
[20:35:57] cozachk: has joined #ruby
[20:36:46] AJA4350: has joined #ruby
[20:37:24] Megamos: has joined #ruby
[20:41:09] bsamorim: has joined #ruby
[20:43:21] amar_: has joined #ruby
[20:43:57] AJA4351: has joined #ruby
[20:49:34] whiteline: has joined #ruby
[20:51:24] ur5us: has joined #ruby
[20:52:46] alfiemax: has joined #ruby
[20:54:12] AJA4351: has joined #ruby
[20:55:20] ur5us: has joined #ruby
[20:55:29] akaiiro: has joined #ruby
[20:57:50] kliq: has joined #ruby
[20:58:27] Asher: has joined #ruby
[21:00:02] blackmesa1: has joined #ruby
[21:05:41] Guest408: has joined #ruby
[21:13:18] jenrzzz: has joined #ruby
[21:13:19] jenrzzz: has joined #ruby
[21:17:11] ur5us: has joined #ruby
[21:18:54] Azure: has joined #ruby
[21:23:12] LightStalker: has joined #ruby
[21:32:53] jottr_: has joined #ruby
[21:35:02] DTZUZO: has joined #ruby
[21:35:44] ebye: has left #ruby: ()
[21:36:18] fredlinhares: has joined #ruby
[21:37:37] karapetyan: has joined #ruby
[21:38:45] LightStalker: has joined #ruby
[21:38:56] Zaab1t: has joined #ruby
[21:40:38] Asher: has joined #ruby
[21:46:13] karapetyan: has joined #ruby
[21:46:45] nicesignal: has joined #ruby
[21:57:33] blackmesa1: has joined #ruby
[22:00:16] jenrzzz: has joined #ruby
[22:00:16] jenrzzz: has joined #ruby
[22:01:09] grilix: has joined #ruby
[22:02:20] FernandoBasso: has joined #ruby
[22:02:51] jaequery: has joined #ruby
[22:05:50] jaequery: has joined #ruby
[22:06:38] GodFather: has joined #ruby
[22:11:32] karapetyan: has joined #ruby
[22:17:48] blackmesa1: has joined #ruby
[22:22:31] fredlinhares: has joined #ruby
[22:26:11] beowuff: has joined #ruby
[22:26:44] Asher: has joined #ruby
[22:30:40] gyant: has joined #ruby
[22:31:37] Guest1: has joined #ruby
[22:32:41] alfiemax: has joined #ruby
[22:33:41] Guest39745: has joined #ruby
[22:36:33] Sembei: has joined #ruby
[22:40:02] wilbert: has joined #ruby
[22:43:46] wilbert_: has joined #ruby
[22:46:12] AJA4351: has joined #ruby
[22:47:21] nickjj_: has joined #ruby
[22:53:52] graphene: has joined #ruby
[22:58:16] jenrzzz: has joined #ruby
[22:58:16] jenrzzz: has joined #ruby
[22:59:07] wilbert: has joined #ruby
[22:59:33] gr33n7007h: has joined #ruby
[23:01:27] jrafanie: has joined #ruby
[23:03:07] zlogan2003: has joined #ruby
[23:08:20] darkhanb: has joined #ruby
[23:08:25] ogres: has joined #ruby
[23:08:53] mozzarella: has joined #ruby
[23:09:20] DarthGandalf: has joined #ruby
[23:10:39] AJA4350: has joined #ruby
[23:11:15] white_lilies: has joined #ruby
[23:12:21] nicesignal: has joined #ruby
[23:18:39] duckpuppy: has joined #ruby
[23:18:42] Raboo: has joined #ruby
[23:21:02] jrafanie: has joined #ruby
[23:33:46] jottr_: has joined #ruby
[23:37:22] alfiemax: has joined #ruby
[23:41:19] karapetyan: has joined #ruby
[23:47:18] jidar: https://gist.github.com/334536be2da5215864fe89b5b490a14a can somebody help me understand why L26 doesn't have the scope to put name?
[23:47:58] Radar: jidar: name is set within the scope of the case statement. You could fix this by setting the variables to nil before the case .
[23:48:10] FernandoBasso: has joined #ruby
[23:48:22] jidar: Radar: case creates it's own scope?
[23:48:29] jidar: similar to class?
[23:48:29] mynameisdebian: has joined #ruby
[23:48:32] jidar: ACTION boggles
[23:49:02] Radar: Oops, sorry it's not the case it's the block of the option parsing.
[23:49:11] Radar: The local variable is local _to that block_, not the case. It's early here.
[23:50:37] jidar: I guess I figured assigning it to a new var would pull it out of the blocks scope