« Back to channel list

#ruby - 03 October 2017

« Back 1 day Forward 1 day »
[00:00:21] Keytap: has joined #ruby
[00:00:21] havenwood: neachdainn: You don't need rake for any reason I can think of. Usually the `gem` command is used to build and install the gem but there's nothing specific to C-extensions I can think of.
[00:00:25] havenwood: neachdainn: http://www.rubyinside.com/how-to-create-a-ruby-extension-in-c-in-under-5-minutes-100.html
[00:01:12] jrabe: has joined #ruby
[00:01:15] neachdainn: I'll try that one out. Thanks!
[00:01:16] havenwood: neachdainn: A more recent, but very active project lets you write Rust extensions.
[00:01:20] havenwood: neachdainn: https://usehelix.com
[00:01:56] neachdainn: havenwood: I saw that, and asked if I could do it in Rust, but the requirement is a C extension
[00:02:06] neachdainn: I'm excited to try out Helix in the future, though
[00:02:19] havenwood: I wrote a crystal extension that embedded mruby for a gem, because... yeah.
[00:02:38] havenwood: Really easy to embed mruby in crystal.
[00:02:47] spt0: has joined #ruby
[00:02:59] havenwood: neachdainn: ah, nice
[00:03:21] havenwood: neachdainn: Are you writing the C or wrapping an existing library?
[00:03:28] havenwood: Sounds like writing it
[00:03:56] neachdainn: It's just a simple fixed-sized array to demonstrate the performance difference between C and Ruby
[00:04:06] neachdainn: I don't question these things, I just do what I'm told. Hahah
[00:05:14] habs: has joined #ruby
[00:06:24] havenwood: neachdainn: tangentially, here's an interesting paper: http://chrisseaton.com/rubytruffle/modularity15/rubyextensions.pdf
[00:06:28] __Yiota: has joined #ruby
[00:07:30] neachdainn: I will look that over
[00:07:36] xco: has joined #ruby
[00:08:06] havenwood: https://www.youtube.com/watch?v=TQMKPRc6cbE
[00:08:26] xco: has joined #ruby
[00:09:06] xco: has joined #ruby
[00:09:54] xco: has joined #ruby
[00:10:44] xco: has joined #ruby
[00:11:29] xco: has joined #ruby
[00:12:16] xco: has joined #ruby
[00:15:54] MrBusiness: has joined #ruby
[00:16:42] neachdainn: So I'm getting the extension to compile, but I can't load it in irb
[00:17:18] habs: hi -- I'm having trouble understanding Ruby classes. why will this short example not work? https://gist.github.com/hpr/4d9d86a59cd28aac2ddb5a1b944739fa If I have to keep 'other_method' the same, how can I modify the rest of the code to give me the desired result?
[00:17:29] mtkd: has joined #ruby
[00:18:10] bmurt: has joined #ruby
[00:19:39] Zarthus: habs: you can use @index in other_method
[00:20:34] habs: Zarthus: ok -- but what if I have to keep other_method the same? What does it mean when I do ExampleClassName.example_variable within a class -- is that even valid Ruby?
[00:20:48] Zarthus: why does other_method have to be the same?
[00:21:16] Zarthus: right now your code does nothing because you're not showing us how you're interacting with your class.
[00:21:48] Zarthus: if the logic in other_method is wrong, it makes no sense to modify something else
[00:23:56] havenwood: habs: The way you're using it isn't right, but if you'd defined a class method that would work. The idiomatic way is to use `self` inside Test where `self == Test #=> true`.
[00:24:35] havenwood: habs: You should set your instance methods inside an #initialize method with a class.
[00:25:17] havenwood: habs: your #index method is an appropriate getter (you can define the same thing shorthand with `attr_getter :index` but #other_method isn't an appropriate setter.
[00:25:29] habs: Zarthus: it has to be the same because it's code that was provided to me under the assumption that it was correct. i'm trying to provide a minimal working example, to help debug
[00:26:44] havenwood: habs: I commented on your gist.
[00:27:12] leah2: has joined #ruby
[00:28:33] havenwood: habs: test = Test.new; test.test_method; test.test_method; test.index #=> 98
[00:29:27] habs: havenwood: Thank you -- I agree that I should have used the 'initialize' method. but what if I 'needed' to use Test.index as in ClassName.example_variable syntax within the class -- without using class variables (which I understand are frowned upon)? what does that syntax mean and is it valid?
[00:30:04] eckhardt: has joined #ruby
[00:30:09] s3nd1v0g1us: has joined #ruby
[00:30:20] havenwood: habs: You have a instance method Test#index not a class method Test.index.
[00:30:31] spt0: has joined #ruby
[00:30:38] havenwood: habs: Test.index correctly calls the class method, but you haven't defined one.
[00:31:21] havenwood: habs: You'll see that actually written `self.index` rather than `Test.index` inside Test, because `self` is `Test` inside and that way you can rename it and not have to change it everywhere.
[00:31:54] havenwood: habs: Try: class Test; def self.meaning; 42 end end; Test.meaning
[00:32:18] Zarthus: i thought we had a clever ruby[bot] for that
[00:32:23] havenwood: habs: You could call that class method inside Test with `Test.meaning` but the idiomatic way inside the class is `self.meaning`.
[00:32:42] havenwood: Zarthus: I'd have to paste the working code before using it though.
[00:33:13] habs: havenwood: Ah, thank you, realizing that that was called a 'class method' helped a lot
[00:34:05] eb0t: has joined #ruby
[00:35:35] habs: havenwood: Only problem is now I get NoMethodError: undefined method `-' for nil:NilClass? what does this mean and how can it be fixed?
[00:36:41] havenwood: habs: Show the code you get that error with?
[00:36:52] havenwood: habs: It means you're doing: nil - ...
[00:36:53] habs: (this is with keeping the old other_method, but having a new class method "def self.index; @index; end") OK yes I'll pase it
[00:39:44] habs: havenwood: here is the updated gist, thank you: https://gist.github.com/4d9d86a59cd28aac2ddb5a1b944739fa
[00:39:47] bmurt: has joined #ruby
[00:40:28] havenwood: habs: It's problematic to expose an instances state to the class itself.
[00:40:38] havenwood: instance's*
[00:41:13] havenwood: habs: Use a class if you have more than one instance of state. That way each class instance represents one instance of state.
[00:41:54] havenwood: habs: Use a module if you don't have any instances of state.
[00:42:00] havenwood: habs: Use a singleton class if you have just one instance of state.
[00:42:35] habs: havenwood: sorry, i'm just having trouble understanding what you mean by 'instance of state' in this example. isn't all of the state contained per instance of the class?
[00:42:42] havenwood: habs: You'll never expose an instance's state via a class method, because that class method isn't specific to one instance.
[00:43:11] havenwood: habs: Your example doesn't call for class methods. You can use them but it doesn't make sense.
[00:43:30] habs: Ah, I see. So what if this is intended to be a singleton class then? I think that would make sense
[00:43:34] havenwood: habs: I'd suggest pretending that class methods don't exist.
[00:43:59] havenwood: habs: Use a singleton class if there's only one instance of state. Like there can't be two of these things, ever.
[00:45:14] havenwood: habs: I think you'll usually find you have either no instance of state or many, most often. Singleton is there if you really have one, which happens, but less often.
[00:45:54] havenwood: &ri Singleton
[00:45:54] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/singleton/rdoc/Singleton.html
[00:46:17] habs: havenwood: Yes, that singleton may apply to this case I think. What I know is that 'other_method' is given to me as written, so I'd like to do whatever I have to in the other methods to make that compile
[00:46:19] milardovich: has joined #ruby
[00:46:46] enko_: has joined #ruby
[00:46:56] havenwood: habs: I don't understand what you're trying to do, but if you show what you have and what you want I bet someone can help.
[00:47:27] havenwood: Show real code if you can.
[00:47:53] havenwood: habs: Or if you're just trying to learn, feel free to ask questions.
[00:49:46] pr0ton: has joined #ruby
[00:49:52] habs: havenwood: what I want is, with the code provided, to be able to do this: test = Test.new; test.test_method; test.test_method; test.index #=> 98
[00:49:54] havenwood: habs: A frequently-recommended book on object oriented design in Ruby is Sandi Metz' Practical Object-Oriented Design in Ruby.
[00:49:54] habs: With the restriction, that the 'other_method' code is provided to me as a 'black box' if you will
[00:50:18] havenwood: habs: If my comment to the gist doesn't work, show why?
[00:50:26] havenwood: What's happening that's wrong?
[00:50:42] havenwood: Is the black box returning a value you need to use?
[00:50:55] havenwood: If it doesn't return anything, how are you supposed to do something?
[00:50:56] habs: havenwood: Your comment 'works' but it changes the definition of other_method, which I have to keep the same as it was -- I can change any other method or part of the class though
[00:51:15] havenwood: Are you relying on a side effect or return value?
[00:51:30] havenwood: What does the black box do?
[00:51:44] habs: Maybe black box was the wrong term, what I meant is that the code is provided and I know that the code is exactly def other_method; @index -= 1; end -- but I can't change that
[00:51:58] havenwood: Then the code will work.
[00:52:25] habs: Sorry, typo, meant to say the code is exactly def other_method; Test.index -= 1; end
[00:52:35] enko_: Are there any free editors like sublime text?
[00:52:39] havenwood: enko_: Atom
[00:52:48] habs: I think, 'index' is meant to be shared amongst all instances of Test?
[00:52:55] havenwood: habs: seems like it
[00:52:55] enko_: does it have that scrolling side bar to see all your code havenwood ?
[00:53:11] havenwood: habs: so in that case, you're actually on the right track with Singleton
[00:53:56] enko_: great, thank you havenwood for the suggestion, I will check it out.
[00:54:07] Cohedrin_: has joined #ruby
[00:54:22] havenwood: enko_: After installing atom: apm install minimap-plus
[00:54:30] havenwood: enko_: That plugin is like the sublime map.
[00:54:41] habs: havenwood: OK, but using singleton would be an issue of best practice and not a requirement, right? Just to understand, how could I make that work without using singleton? as in, how can I get it to function as desired but not get "undefined method `-' for nil:NilClass"?
[00:54:46] havenwood: enko_: https://atom.io
[00:56:51] paradisaeidae: has joined #ruby
[00:56:54] paradisaeidae_: has joined #ruby
[01:01:59] havenwood: habs: I commented on your gist one more time with a solution. I'm tired so that's the end of my free consulting. ;-)
[01:02:22] habs: havenwood: OK, I will check it out but thank you so much for your help regardless
[01:02:23] havenwood: habs: A Singleton seems to make sense in your circumstance.
[01:02:32] havenwood: habs: You're welcome!
[01:02:55] Cohedrin_: has joined #ruby
[01:04:54] nankyokusei: has joined #ruby
[01:04:55] enko_: havenwood, this is great!
[01:05:17] nofxx: has joined #ruby
[01:05:27] enko_: syntax highlghting is different than what I am used to :P but I am a beginner
[01:06:50] habs: havenwood: The example works -- but I still wonder how I could do that (however inadvised it may be) without requiring the 'singleton' module.
[01:15:11] _whitelogger: has joined #ruby
[01:16:50] eb0t: has joined #ruby
[01:16:55] amirite: has joined #ruby
[01:17:29] zautomata: has joined #ruby
[01:17:50] webguynow: has joined #ruby
[01:20:43] guardianx: has joined #ruby
[01:22:19] d^sh: has joined #ruby
[01:23:57] leah2: has joined #ruby
[01:24:15] Keytap: has joined #ruby
[01:26:54] habs: can someone please help me understand why this code https://gist.github.com/4d9d86a59cd28aac2ddb5a1b944739fa doesn't work? I expect it to return #=> 99, but instead I get NoMethodError: undefined method `-' for nil:NilClass
[01:31:46] mim1k: has joined #ruby
[01:33:09] habs: In other words -- how can I set up a variable that is shared among all instances of a class, and that I can add to and subtract from within that class? I don't want to use 'class variables' though
[01:37:35] amirite: has joined #ruby
[01:39:00] TheRealMattM: has joined #ruby
[01:44:10] neachdainn: Working with the C api, how do I allocate an array of VALUEs? Are they safe to just ALLOC?
[01:46:19] jinie: has joined #ruby
[01:51:28] gusrub: has joined #ruby
[01:54:49] enko_: is it wrong to want to use ruby for web development as well as standard desktop apps?
[01:55:01] xco: has joined #ruby
[01:57:03] bmurt: has joined #ruby
[01:58:08] amirite: has joined #ruby
[01:58:20] gizmore|2: has joined #ruby
[01:58:20] __Yiota: has joined #ruby
[01:59:11] bastilian: has joined #ruby
[02:01:34] __Yiota: has joined #ruby
[02:01:50] naprimer: has joined #ruby
[02:03:32] bastilian: has joined #ruby
[02:04:06] __Yiota: has joined #ruby
[02:04:53] Cohedrin_: has joined #ruby
[02:14:21] kapil___: has joined #ruby
[02:18:13] bronson: has joined #ruby
[02:18:24] tamouse__: has joined #ruby
[02:18:58] r3kz: has left #ruby: ()
[02:18:59] tvw: has joined #ruby
[02:21:33] orbyt_: has joined #ruby
[02:21:47] ledestin: has joined #ruby
[02:23:43] bastilian: has joined #ruby
[02:23:51] enterprisey: has joined #ruby
[02:24:08] Defenestrate: has joined #ruby
[02:28:28] bastilian: has joined #ruby
[02:29:36] bmurt: has joined #ruby
[02:31:55] rrichardsr3: has joined #ruby
[02:33:33] bastilian: has joined #ruby
[02:35:23] s3nd1v0g1us: has joined #ruby
[02:35:49] tamouse__: has joined #ruby
[02:35:58] leah2: has joined #ruby
[02:37:22] marcux: has joined #ruby
[02:38:49] guardianx: has joined #ruby
[02:38:54] ramfjord: has joined #ruby
[02:38:56] bastilian: has joined #ruby
[02:40:34] Alina-malina: has joined #ruby
[02:46:02] eb0t: has joined #ruby
[02:47:50] habs: Why do I get "undefined method `+' for nil:NilClass" when I do "TestClass.variable += 1"? I have "def self.variable= value; @variable = value; end" and "def self.variable; @variable; end" so shouldn't that work?
[02:48:15] bmurt: has joined #ruby
[02:53:16] jenrzzz: has joined #ruby
[02:53:16] jenrzzz: has joined #ruby
[02:53:33] bastilian: has joined #ruby
[02:56:48] whippythellama: has joined #ruby
[02:58:48] bastilian: has joined #ruby
[02:59:37] bmurt: has joined #ruby
[02:59:59] havenwood: >> @variable # habs
[03:00:00] ruby[bot]: havenwood: # => nil (https://eval.in/872459)
[03:00:08] cadillac_: has joined #ruby
[03:00:14] havenwood: >> @variable + 1 # habs
[03:00:15] ruby[bot]: havenwood: # => undefined method `+' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/872460)
[03:00:22] Radar: ?gist habs next time please
[03:00:22] ruby[bot]: habs: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[03:00:29] Radar: Oh you did, sorry.
[03:00:48] Radar: habs: also havenwood commented on your Gist.
[03:06:04] habs: Radar: havenwood: Yes I saw that comment, thanks. I essentially want the same as this comment https://gist.github.com/4d9d86a59cd28aac2ddb5a1b944739fa#gistcomment-2218948, but I don't want to use the 'singleton' library/module. How can I do that?
[03:07:16] Radar: habs: But why?
[03:07:23] Radar: why do you want to have a class behave in this way?
[03:07:43] Radar: Consider that if you're fighting Ruby to achieve your goal that perhaps Ruby is telling you that you shouldn't do it that way?
[03:07:52] habs: havenwood: re: rubybot, I get that, but I already have @variable defined to 100 (or whatever) in the initialize function
[03:08:36] bmurt: has joined #ruby
[03:08:49] habs: Radar: It's for help with a Ruby assignment, that requires me to work around code that has the "Test.index -= 1" code. So I think there should be a reasonable way to do this in Ruby
[03:09:11] Radar: habs: what does the requirement say exactly?
[03:10:44] habs: Radar: 'other_method' is provided as a helper method for me that I must use. When I call Test.index, I want a number that ultimately represents, say, 100 minus the number of Test instances created
[03:11:22] Radar: Requirements are still unclear to me.
[03:11:44] habs: Radar: In other words, I want that number to start at 100, but decrease when I call other_method from any instance of Test. sorry for the lack of clarity, does that make it better?
[03:11:59] Radar: habs: So decrement the value directly before you call other_method?
[03:12:19] Keytap: has joined #ruby
[03:12:44] habs: Radar: No -- I want to leave other_method as it is, but I want the rest of the class to not give me runtime errors
[03:13:31] Radar: https://gist.github.com/hpr/4d9d86a59cd28aac2ddb5a1b944739fa#file-gistfile1-txt-L15-L17
[03:13:37] Radar: Can't decrement it before calling other_method here?
[03:14:22] habs: Radar: I could, but then I would still get "undefined method `+' for nil:NilClass" error
[03:14:22] leah2: has joined #ruby
[03:14:38] habs: From executing the other_method code subsequently
[03:15:05] Radar: https://gist.github.com/hpr/4d9d86a59cd28aac2ddb5a1b944739fa#file-gistfile1-txt-L3-L9
[03:15:09] Radar: These two @index variables are not the same.
[03:15:16] Radar: One is an instance variable, one is a class instance variable.
[03:16:03] Radar: Give me a moment to tinker.
[03:16:45] habs: Radar: OK -- is the word 'class instance variable' different from 'class variable' or do those mean the same thing?
[03:16:57] Radar: https://gist.github.com/radar/d80b2324fba0cdcf98c2efc15c1bdbd7
[03:16:58] Radar: This works for me.
[03:17:36] Radar: habs: class variables use @@, class instance variables use @
[03:18:11] gizmore: is it possible that activerecord is too slow for backing a db driven mud?
[03:18:17] bronson: has joined #ruby
[03:18:24] gizmore: with lots of dynamic relations?
[03:18:25] ruby[bot]: Radar: I don't know anything about 8ball
[03:18:37] gizmore: sounds about right, thx :)
[03:18:53] Radar: gizmore: "it depends" is the best answer I can give.
[03:19:06] Radar: Usually you can speed up AR by actually spending time optimising queries on your database.
[03:19:27] Radar: AR itself can be slow if you're needlessly initializing a ton of objects.
[03:19:51] gizmore: i havent coded ruby in a while... is there type hinting added to the language sooner or later?
[03:20:27] gizmore: i got back to php, because of type hinting and ok toolchain.... but ruby is more elegant.... if it had type-hinting... oh man
[03:21:23] gizmore: php type hinting turned out really cool for code completion in eclipse... dont miss the ruby elegance in favor of that
[03:22:16] gizmore: still i am thinking of how to connect models of the client (html5) with the backend (???) ... like write once, deploy on both
[03:22:35] gizmore: but i dont like typescript and whatnot :/
[03:24:21] Radar: gizmore: sounds like you're wanting a language like elm :P
[03:24:38] gizmore: as long as it doesnt turn out like java primefaces
[03:25:16] gizmore: there isnt one size fits all... never.... for example i wanted to recode shufflepuck caffee as html5 app .... websockets
[03:25:39] gizmore: the problem was to have the same physics on client and on server
[03:25:51] gizmore: else i would have to use an udp fire orgy
[03:25:56] gizmore: (or lots of packets)
[03:26:04] gizmore: and render physics only on server
[03:26:30] gizmore: javascript really is promising
[03:26:40] gizmore: as it maybe moves to html5 components
[03:26:54] gizmore: and there are transpilers for c=>js .... llvm=>js
[03:27:00] gizmore: typescript...
[03:27:16] gizmore: but meh.... i hate typescript... although it is similiar to ruby ^^
[03:27:31] gizmore: but ruby is soo.... quickening refreshing elegant
[03:27:42] gizmore: maybe a ruby => js transpiler ... when ruby has type hinting :D
[03:28:00] gix: has joined #ruby
[03:30:18] zacts: tamouse__: is opal stable and practical?
[03:32:18] mim1k: has joined #ruby
[03:32:26] jenrzzz: has joined #ruby
[03:32:40] gizmore: ruby surely has a crazy syntax.... you can do such beautiful things in it
[03:33:11] nankyoku_: has joined #ruby
[03:33:12] gizmore: some class def can be hardly/only tricky transpiled correctly maybe
[03:33:46] gizmore: (depending on the target language)
[03:34:46] gizmore: btw.... i came from php... did really nice ruby hackery.... went back to php... and implemented my kinda own active record (take 3)
[03:34:57] gizmore: and i think... mine is better than AR now :p
[03:35:06] gizmore: even though its php
[03:35:26] tamouse__: no friggin idea, zacts; i know someone who's been working with it, but he's the only one
[03:35:26] nankyoku_: has joined #ruby
[03:38:26] pr0ton: has joined #ruby
[03:40:02] jenrzzz: has joined #ruby
[03:42:25] leah2: has joined #ruby
[03:47:04] pilne: has joined #ruby
[03:48:03] kies: has joined #ruby
[03:50:25] moei: has joined #ruby
[03:52:33] rrichardsr3: has joined #ruby
[03:54:49] marcux: has joined #ruby
[03:54:49] pr0ton: has joined #ruby
[03:56:48] zacts: heh, that's ok
[04:01:29] ozcanesen: has joined #ruby
[04:02:37] marcux: has joined #ruby
[04:02:40] milardovich: has joined #ruby
[04:04:57] marcux: has joined #ruby
[04:14:44] motstgo: has joined #ruby
[04:15:25] leah2: has joined #ruby
[04:15:34] govg: has joined #ruby
[04:26:48] biberu: has joined #ruby
[04:30:41] mim1k: has joined #ruby
[04:31:29] danguita: has joined #ruby
[04:32:01] jenrzzz: has joined #ruby
[04:32:01] jenrzzz: has joined #ruby
[04:33:24] uZiel: has joined #ruby
[04:34:32] milardovich: has joined #ruby
[04:36:03] harfangk: has joined #ruby
[04:39:03] ramfjord: has joined #ruby
[04:43:19] leah2: has joined #ruby
[04:57:14] pawnbox: has joined #ruby
[04:57:39] Alina-malina: has joined #ruby
[04:58:49] Cohedrin_: has joined #ruby
[04:59:37] d^sh: has joined #ruby
[05:00:29] Keytap: has joined #ruby
[05:01:31] cpruitt: has joined #ruby
[05:08:25] uneeb: has joined #ruby
[05:12:11] _whitelogger: has joined #ruby
[05:12:14] Xiti: has joined #ruby
[05:15:53] pawnbox: has joined #ruby
[05:17:14] reber: has joined #ruby
[05:17:54] alfiemax: has joined #ruby
[05:18:41] Tempesta: has joined #ruby
[05:19:18] bronson: has joined #ruby
[05:21:12] reber: has joined #ruby
[05:21:19] reber_: has joined #ruby
[05:23:51] moei: has joined #ruby
[05:28:09] uneeb_: has joined #ruby
[05:29:05] eputnam: has joined #ruby
[05:29:18] moei: has joined #ruby
[05:30:44] deduped: has joined #ruby
[05:30:44] nunchuck: has joined #ruby
[05:31:52] FiendKing04: has joined #ruby
[05:33:11] bmn: has joined #ruby
[05:34:40] Alina-malina: has joined #ruby
[05:34:41] Alina-malina: has joined #ruby
[05:44:02] ElDoggo: has joined #ruby
[05:47:33] aupadhye: has joined #ruby
[05:49:49] jenrzzz: has joined #ruby
[05:49:49] jenrzzz: has joined #ruby
[05:50:58] ldepandis: has joined #ruby
[05:52:39] anisha: has joined #ruby
[06:03:23] ramfjord: has joined #ruby
[06:05:13] aupadhye: has joined #ruby
[06:05:42] cgfbee: has joined #ruby
[06:15:15] spt0: has joined #ruby
[06:15:44] leah2: has joined #ruby
[06:18:19] pawnbox: has joined #ruby
[06:20:40] naprimer2: has joined #ruby
[06:22:37] jenrzzz: has joined #ruby
[06:22:37] jenrzzz: has joined #ruby
[06:22:39] webnanners: has joined #ruby
[06:25:03] pawnbox: has joined #ruby
[06:26:26] huyderman: has joined #ruby
[06:28:55] Mortomes|Work: has joined #ruby
[06:29:20] enterprisey: has joined #ruby
[06:30:49] ur5us: has joined #ruby
[06:35:49] ramfjord: has joined #ruby
[06:36:21] oetjenj: has joined #ruby
[06:36:36] phaul: has joined #ruby
[06:38:51] techsethi: has joined #ruby
[06:40:18] leah2: has joined #ruby
[06:43:27] huyderman: has joined #ruby
[06:45:52] chippy: has joined #ruby
[06:47:58] conta: has joined #ruby
[06:49:01] Keytap: has joined #ruby
[06:50:52] Dimik: has joined #ruby
[06:50:56] milardov_: has joined #ruby
[06:51:16] ramfjord: has joined #ruby
[06:53:51] Silthias: has joined #ruby
[06:57:31] milardovich: has joined #ruby
[06:57:51] Mon_Ouie: has joined #ruby
[07:00:25] mjolnird: has joined #ruby
[07:00:56] mjolnird: has joined #ruby
[07:08:59] shime: has joined #ruby
[07:09:55] ldepandis: has joined #ruby
[07:13:44] mathys: has joined #ruby
[07:15:05] sysvalve: has joined #ruby
[07:16:40] rabajaj: has joined #ruby
[07:17:01] ta: has joined #ruby
[07:17:10] someuser: has joined #ruby
[07:20:06] bronson: has joined #ruby
[07:22:52] xco: has left #ruby: ()
[07:24:04] snickers: has joined #ruby
[07:27:19] leah2: has joined #ruby
[07:28:09] mark_66: has joined #ruby
[07:31:06] webnanners: has joined #ruby
[07:32:41] dionysus69: has joined #ruby
[07:34:52] pawnbox: has joined #ruby
[07:36:08] pawnbox: has joined #ruby
[07:36:29] milardovich: has joined #ruby
[07:39:23] alex``: has joined #ruby
[07:43:13] quobo: has joined #ruby
[07:47:18] alnet: has joined #ruby
[07:47:59] alnet: is it okay to assign variables at the start of a function
[07:48:11] aufi: has joined #ruby
[07:50:15] al2o3-cr: would the fastest way of creating uuid's be wrapping libuuid?
[07:50:22] lexruee: has joined #ruby
[07:50:49] al2o3-cr: alnet: it's ok yes.
[07:55:22] jaruga: has joined #ruby
[07:58:57] alfiemax: has joined #ruby
[07:59:32] ElDoggo: has joined #ruby
[07:59:52] ams__: has joined #ruby
[08:03:28] shime: has joined #ruby
[08:04:57] milardovich: has joined #ruby
[08:05:26] mikecmpbll: has joined #ruby
[08:05:31] leah2: has joined #ruby
[08:06:00] dionysus69: has joined #ruby
[08:09:23] simmaniac: has joined #ruby
[08:09:42] hs366: has joined #ruby
[08:11:04] agimenez: has joined #ruby
[08:11:07] burgestrand: has joined #ruby
[08:14:09] InfinityFye: has joined #ruby
[08:16:02] simmaniac: has joined #ruby
[08:17:20] pawnbox: has joined #ruby
[08:17:27] frojnd: Hi there.
[08:20:25] Cohedrin_: has joined #ruby
[08:21:17] blackmesa: has joined #ruby
[08:21:18] webnanners: has joined #ruby
[08:23:27] cadillac_: has joined #ruby
[08:23:38] al2o3-cr: am i testing this properly? https://gist.github.com/gr33n7007h/1ce133512270129752de944a2e5c39f8
[08:24:30] al2o3-cr: surely libuuid gotta be faster, this is without unparsing.
[08:25:55] ur5us: has joined #ruby
[08:27:18] al2o3-cr: gist updated.
[08:27:48] jphase: has joined #ruby
[08:28:26] ur5us: has joined #ruby
[08:32:48] jphase: has joined #ruby
[08:34:52] bruno-: has joined #ruby
[08:37:16] Keytap: has joined #ruby
[08:40:17] charliesome: has joined #ruby
[08:40:58] dionysus69: has joined #ruby
[08:43:46] lxsameer: has joined #ruby
[08:44:18] InfinityFye: has joined #ruby
[08:48:30] bruno-: has joined #ruby
[08:50:36] marr: has joined #ruby
[08:51:29] ramfjord: has joined #ruby
[08:52:44] jenrzzz: has joined #ruby
[09:01:02] guardianx: has joined #ruby
[09:14:57] Silthias1: has joined #ruby
[09:17:02] paranoicsan: has joined #ruby
[09:19:24] charliesome: has joined #ruby
[09:21:20] bronson: has joined #ruby
[09:24:04] Serpent7776: has joined #ruby
[09:26:43] greenbagels: has joined #ruby
[09:27:42] milardovich: has joined #ruby
[09:30:15] dionysus69: has joined #ruby
[09:31:20] workmad3: has joined #ruby
[09:31:54] dhollinger: has joined #ruby
[09:33:07] simmaniac: has joined #ruby
[09:34:12] anisha: has joined #ruby
[09:39:33] burgestrand: has joined #ruby
[09:39:35] roshanavand: has joined #ruby
[09:47:34] blackmesa: has joined #ruby
[09:48:51] anisha: has joined #ruby
[09:52:31] pawnbox: has joined #ruby
[09:52:41] Stan: has joined #ruby
[09:53:33] anisha_: has joined #ruby
[09:58:36] burgestrand: has joined #ruby
[10:03:48] anisha: has joined #ruby
[10:04:05] simmaniac: has joined #ruby
[10:04:17] alnet: has joined #ruby
[10:04:35] gizmore: has joined #ruby
[10:08:34] charliesome: has joined #ruby
[10:11:18] jenrzzz: has joined #ruby
[10:12:48] gnufied: has joined #ruby
[10:12:49] Silthias: has joined #ruby
[10:15:35] agimenez: has joined #ruby
[10:17:00] harfangk: has joined #ruby
[10:17:13] daumie: has joined #ruby
[10:19:10] pmden: has joined #ruby
[10:20:33] uneeb: has joined #ruby
[10:20:42] mim1k: has joined #ruby
[10:20:57] webnanners: has joined #ruby
[10:23:56] vondruch: has joined #ruby
[10:24:53] Bhootrk_: has joined #ruby
[10:27:02] pmden: has left #ruby: ("Leaving")
[10:27:22] shinnya: has joined #ruby
[10:28:27] vondruch: has joined #ruby
[10:29:09] anisha: has joined #ruby
[10:31:45] minimalism: has joined #ruby
[10:32:38] pawnbox: has joined #ruby
[10:38:23] pawnbox: has joined #ruby
[10:43:00] webnanners: has joined #ruby
[10:48:33] leah2: has joined #ruby
[10:51:39] ramfjord: has joined #ruby
[10:54:53] Mon_Ouie: has joined #ruby
[10:55:55] alfiemax_: has joined #ruby
[10:56:02] charliesome: has joined #ruby
[10:56:41] charliesome_: has joined #ruby
[10:58:34] charliesome__: has joined #ruby
[11:00:13] CharlieSu: has joined #ruby
[11:06:26] anisha: has joined #ruby
[11:06:41] GodFather: has joined #ruby
[11:08:28] webnanners: has joined #ruby
[11:10:34] rahul_bajaj: has joined #ruby
[11:12:07] ramfjord: has joined #ruby
[11:13:15] jenrzzz: has joined #ruby
[11:13:15] jenrzzz: has joined #ruby
[11:13:40] ldepandis: has joined #ruby
[11:13:54] unreal: has joined #ruby
[11:14:06] leah2: has joined #ruby
[11:18:40] anisha: has joined #ruby
[11:20:18] halt: has joined #ruby
[11:20:33] matcouto: has joined #ruby
[11:22:25] bronson: has joined #ruby
[11:30:05] troulouliou_dev: has joined #ruby
[11:33:36] __Yiota: has joined #ruby
[11:33:52] tcopeland: has joined #ruby
[11:34:55] greenbagels: has joined #ruby
[11:39:16] rahul_bajaj: has joined #ruby
[11:40:09] rabajaj: has joined #ruby
[11:42:00] ldnunes: has joined #ruby
[11:45:20] soulisson: has joined #ruby
[11:48:14] ramfjord: has joined #ruby
[11:48:15] alfiemax: has joined #ruby
[11:48:52] soulisson: Hi, I'm learning by my self and I'm trying to have a good definition of what a data structure is. So far, I've 1 - a collection of data organized in a certain fashion. 2 - Something that contains data organized in some fashion. Which one is the more appropriate?
[11:48:59] jinie: has joined #ruby
[11:51:01] ShalokShalom: has joined #ruby
[11:51:14] tobiasvl: what's the difference between the two?
[11:51:56] tobiasvl: in other words: how would you explain the semantic difference between the two definitions?
[11:52:07] tobiasvl: (I'm not sure there is a discernable difference)
[11:52:43] tobiasvl: I guess a structure is more a collection than a container, but the structure surely does contain data
[11:53:34] sysvalve: has joined #ruby
[11:54:02] soulisson: tobiasvl, thanks very much.
[11:54:12] elomatreb: It's a flexible term, can mean a lot of different stuff depending on context
[11:54:20] soulisson: I'm just struggling with the definitions
[11:54:22] matthewd: Is a sentence a collection of words, or a thing that contains words?
[11:54:28] elomatreb: E.g. when talking close-to-metal development it probably means a C-struct
[11:54:47] soulisson: matthewd, I would say both?
[11:54:58] tobiasvl: soulisson: how did you arrive at those two very similar definitions then? surely there are other options for definitions that are different from those in more semantic ways
[11:55:10] tobiasvl: soulisson: exactly, that was my point earlier too
[11:55:36] simmaniac: has joined #ruby
[11:55:43] soulisson: tobiasvl, probably, I just used the various data structures, and I was looking for a broad definition.
[11:56:01] tobiasvl: an array is a data structure, it's a collection, and a container. a linked list is probably a collection, but is it a container?
[11:56:01] soulisson: I guess they're stupid.
[11:56:43] soulisson: tobiasvl, it contains nodes, but can I call it a container, I don't know
[11:56:46] elomatreb: Depending on where you're talking there may not be a big difference between a linked list and an array, which makes this a difficult discussion
[11:58:17] gnufied: has joined #ruby
[11:58:42] matthewd: soulisson: I would say both, but also neither -- it's more than just its parts combined, but nor does it really 'contain' them
[11:59:04] elomatreb: This is getting philosophical - Can you even have data not contained in a structure?
[11:59:15] tobiasvl: what's data?
[11:59:23] soulisson: really sorry about this, I'm just struggling with this. I know I'm not smart, but I thought I would ask. Thanks for your help.
[11:59:26] Jameser: has joined #ruby
[11:59:45] tobiasvl: soulisson: no problem dude
[11:59:54] tobiasvl: but what are you trying to achieve with such a nebulous definition
[12:01:29] soulisson: tobiasvl, I thought about having a broad definition of data structure, I know this is not really helpful in programming but I come from a mathematics background and before using something the concepts must be well understood
[12:02:05] elomatreb: Don't be surprised if you're having trouble with that in CS, it's a lot less rigorous
[12:02:13] deduped: has joined #ruby
[12:02:14] nunchuck: has joined #ruby
[12:05:20] soulisson: elomatreb, yes, indeed I struggle, I spent plenty of time to learn but seems I have difficulties to really understand things. I'm seriously thinking about giving up.
[12:06:09] elomatreb: Don't be discouraged, if your goal is to actually program these fine distinctions are not really required despite being "fundamentals"
[12:06:23] soulisson: I really appreciate your help all. Thanks very much.
[12:06:39] tobiasvl: yeah, just learn ruby fundamentals first, the other concepts will come
[12:08:26] soulisson: tobiasvl, I'm ok writing basic stuff but seems my mind is stuck in a loop with definitions :)
[12:09:22] ElDoggo: has joined #ruby
[12:10:28] milardovich: has joined #ruby
[12:12:21] greenbagels: has joined #ruby
[12:12:57] Keytap: has joined #ruby
[12:14:33] jenrzzz: has joined #ruby
[12:15:27] fmcgeough: has joined #ruby
[12:15:57] pawnbox: has joined #ruby
[12:17:32] lel: has joined #ruby
[12:20:43] john__: has joined #ruby
[12:22:33] pawnbox: has joined #ruby
[12:23:50] webnanners: has joined #ruby
[12:24:50] alfiemax: has joined #ruby
[12:30:23] alfiemax_: has joined #ruby
[12:31:59] matcouto: has joined #ruby
[12:32:48] Jameser: has joined #ruby
[12:36:02] pawnbox: has joined #ruby
[12:38:47] dionysus69: has joined #ruby
[12:39:48] Silthias: has joined #ruby
[12:41:19] chouhoulis: has joined #ruby
[12:44:32] f3ttX]: has joined #ruby
[12:44:51] Todiann: has joined #ruby
[12:47:16] jphase: has joined #ruby
[12:47:47] ShalokShalom_: has joined #ruby
[12:48:48] mson: has joined #ruby
[12:49:11] aufi: has joined #ruby
[12:50:46] webnanners: has joined #ruby
[12:54:05] uZiel: has joined #ruby
[12:55:23] bmurt: has joined #ruby
[12:57:44] jphase: has joined #ruby
[13:00:38] rwb: has joined #ruby
[13:02:50] rfoust: has joined #ruby
[13:03:48] joast: has joined #ruby
[13:04:03] nicesignal: has joined #ruby
[13:04:29] cdg: has joined #ruby
[13:07:08] alnet: has joined #ruby
[13:12:37] agimenez: has joined #ruby
[13:13:23] rfoust: has joined #ruby
[13:18:30] GodFather: has joined #ruby
[13:21:09] workmad3: has joined #ruby
[13:22:06] johno84: has joined #ruby
[13:23:09] leah2: has joined #ruby
[13:23:18] uneeb: has joined #ruby
[13:23:20] bronson: has joined #ruby
[13:24:18] Ishido: has joined #ruby
[13:25:42] zenspider: has joined #ruby
[13:26:37] aufi: has joined #ruby
[13:27:08] __Yiota: has joined #ruby
[13:29:41] apparition: has joined #ruby
[13:33:11] matcouto: has joined #ruby
[13:33:26] sysvalve: has joined #ruby
[13:33:54] Axy: has joined #ruby
[13:36:43] DLSteve: has joined #ruby
[13:37:13] fefe: has joined #ruby
[13:37:27] erlend: has joined #ruby
[13:38:28] simmaniac: has joined #ruby
[13:44:21] cdg: has joined #ruby
[13:49:44] d10n-work: has joined #ruby
[13:51:29] spt0: has joined #ruby
[13:52:26] mostlybadfly: has joined #ruby
[13:53:31] machinewar: has joined #ruby
[13:53:34] milardovich: has joined #ruby
[13:55:23] pawnbox: has joined #ruby
[13:56:42] Keytap: has joined #ruby
[13:57:22] __Yiota: has joined #ruby
[13:58:13] pawnbox: has joined #ruby
[13:58:49] __Yiota: has joined #ruby
[14:01:55] eb0t: has joined #ruby
[14:04:48] Rapture: has joined #ruby
[14:05:02] bmurt: has joined #ruby
[14:06:30] bruno-: has joined #ruby
[14:07:55] eblip: has joined #ruby
[14:08:45] greenbagels: has joined #ruby
[14:11:01] adlerdias: has joined #ruby
[14:12:19] sysvalve: has joined #ruby
[14:12:47] __Yiota: has joined #ruby
[14:16:23] jenrzzz: has joined #ruby
[14:19:52] orbyt_: has joined #ruby
[14:22:14] spt0: has joined #ruby
[14:22:16] blackmesa: has joined #ruby
[14:22:20] milardovich: has joined #ruby
[14:22:23] pawnbox: has joined #ruby
[14:23:06] __Yiota: has joined #ruby
[14:28:42] milardovich: has joined #ruby
[14:30:59] matcouto: has joined #ruby
[14:32:06] paranoicsan: has joined #ruby
[14:34:31] mikecmpbll: has joined #ruby
[14:35:04] theunraveler: has joined #ruby
[14:36:22] FastJack: has joined #ruby
[14:45:40] kculpis: has joined #ruby
[14:47:00] webnanners: has joined #ruby
[14:47:07] marr: has joined #ruby
[14:48:02] alnet: has joined #ruby
[14:49:24] Pisuke: has joined #ruby
[14:50:04] emulator3: has joined #ruby
[14:50:32] johno84: has joined #ruby
[14:51:42] matcouto: has joined #ruby
[14:59:38] milardovich: has joined #ruby
[15:01:13] cadillac_: has joined #ruby
[15:01:14] Archrover: has joined #ruby
[15:01:30] invalidusrname: has joined #ruby
[15:01:51] sepp2k: has joined #ruby
[15:03:46] robnester: has joined #ruby
[15:08:58] webnanners: has joined #ruby
[15:13:29] ldepandis: has joined #ruby
[15:13:32] ElDoggo: has joined #ruby
[15:19:48] enko: has joined #ruby
[15:23:53] tamouse__: has joined #ruby
[15:24:13] bronson: has joined #ruby
[15:25:48] mikecmpbll: has joined #ruby
[15:25:49] polishdub: has joined #ruby
[15:27:23] uZiel: has joined #ruby
[15:27:23] matcouto: has joined #ruby
[15:29:04] govg: has joined #ruby
[15:29:33] soulisson: has joined #ruby
[15:29:53] soulisson: has joined #ruby
[15:34:18] cdg: has joined #ruby
[15:34:30] soulisson_: has joined #ruby
[15:34:43] cdg: has joined #ruby
[15:35:07] soulisson_: has joined #ruby
[15:35:58] cdg_: has joined #ruby
[15:36:13] cagomez: has joined #ruby
[15:36:50] webnanners: has joined #ruby
[15:37:38] robnester: has joined #ruby
[15:42:31] spt0: has joined #ruby
[15:45:33] __Yiota: has joined #ruby
[15:49:40] kapil___: has joined #ruby
[15:51:11] gusrub: has joined #ruby
[15:52:21] nb_bez_______: has joined #ruby
[15:52:37] __Yiota: has joined #ruby
[15:54:08] rippa: has joined #ruby
[15:55:24] [Butch]: has joined #ruby
[15:56:34] soyeomul: has joined #ruby
[15:57:12] centrx: has joined #ruby
[15:57:12] centrx: has joined #ruby
[16:00:04] soyeomul: in ruby 1.8.7, i got some error "readlines: cannot convert string"
[16:01:00] centrx: soyeomul: Need more info, but first of all Ruby 1.8 is extremely old
[16:01:12] centrx: Handled Unicode differently among other things
[16:02:06] havenwood: soyeomul: If you can, use Ruby 2.4 or 2.3.
[16:02:29] uZiel: has joined #ruby
[16:03:08] soyeomul: https://raw.githubusercontent.com/soyeomul/Gnus/MaGnus/thanks-tm.rb.gnus <-- i wrote a few hours ago, but i did fail to run with ruby 1.8.7 (Ubuntu 12.04)
[16:04:57] jrafanie: has joined #ruby
[16:05:36] cdg: has joined #ruby
[16:07:34] uZiel: has joined #ruby
[16:07:43] cdg_: has joined #ruby
[16:07:54] orbyt_: has joined #ruby
[16:08:34] bastilian: has joined #ruby
[16:10:35] soyeomul: Yes ruby 2.0 is success. hmm... i am not heavy user for ruby
[16:12:09] soyeomul: thanks, centrx, heavenwood~ i go to bed, here Korea. zzz
[16:12:17] centrx: soyeomul: Ruby 1.8.7 was released 2008, crazy to use it
[16:13:01] bastilian: has joined #ruby
[16:14:03] adam12: Wow - 2008. How time flies.
[16:15:50] soyeomul: centrx, yes thank you for advice about ruby 1.8.7 i consider tomorrow
[16:15:54] soyeomul: thanks again
[16:16:24] dionysus69: has joined #ruby
[16:18:09] jenrzzz: has joined #ruby
[16:18:09] jenrzzz: has joined #ruby
[16:24:07] __Yiota: has joined #ruby
[16:29:04] marcux: has joined #ruby
[16:31:23] uneeb: has joined #ruby
[16:31:57] webnanners: has joined #ruby
[16:33:01] cdg: has joined #ruby
[16:38:11] ycyclist: has joined #ruby
[16:39:39] polishdub: has joined #ruby
[16:43:08] spt0: has joined #ruby
[16:43:17] troys: has joined #ruby
[16:51:14] cagomez: has joined #ruby
[16:54:49] [Butch]: has joined #ruby
[17:00:00] mark_66: has joined #ruby
[17:01:36] pr0ton: has joined #ruby
[17:05:09] amirite: has joined #ruby
[17:05:11] pr0ton: has joined #ruby
[17:07:24] jrafanie: has joined #ruby
[17:07:30] greenbagels: has joined #ruby
[17:08:08] hahuang65: has joined #ruby
[17:08:58] [Butch]: has joined #ruby
[17:11:01] elitekmbrz: has joined #ruby
[17:17:27] webnanners: has joined #ruby
[17:18:26] adam12: amirite: o/
[17:18:53] SeepingN: has joined #ruby
[17:19:37] amirite: ACTION gives adam12 a cake
[17:19:44] amirite: how do I emoji on irc
[17:20:02] adam12: use the ascii, luke
[17:20:42] elomatreb: Or just paste emojis, if the encoding works they just work
[17:20:42] amirite: ok, this is cake -- ~=[]
[17:21:19] marcux: has joined #ruby
[17:21:34] amirite: ACTION gives adam12 some gift money [̲̅$̲̅(̲̅ιοο̲̅)̲̅$̲̅]
[17:21:41] adam12: oh fancy.
[17:21:48] amirite: (-(-_(-_-)_-)-)
[17:21:59] amirite: ok back to work
[17:22:04] baweaver: ACTION wanders in
[17:22:34] adam12: baweaver: o/
[17:24:48] moei: has joined #ruby
[17:26:05] bronson: has joined #ruby
[17:26:24] amirite: has joined #ruby
[17:26:53] jamesaxl: has joined #ruby
[17:26:53] amirite: has joined #ruby
[17:27:33] amirite: what's a good REPL to use? in python there is an excellent one called 'ptpython' if anyone is familiar with it. Something more useful then IRB
[17:28:10] eckhardt: has joined #ruby
[17:29:45] cagomez: has joined #ruby
[17:29:49] RickHull: has joined #ruby
[17:30:22] opekktar: has joined #ruby
[17:30:56] leah2: has joined #ruby
[17:32:05] herbmillerjr: has joined #ruby
[17:32:28] cdg: has joined #ruby
[17:33:23] cdg: has joined #ruby
[17:34:23] truenito: has joined #ruby
[17:36:02] opekktar: has left #ruby: ()
[17:36:06] rob_: pry is nice
[17:40:11] mson: has joined #ruby
[17:43:37] voiceftp: has joined #ruby
[17:45:23] rrichardsr3: has joined #ruby
[17:46:36] conta1: has joined #ruby
[17:48:12] brent__: has joined #ruby
[17:49:30] amirite: pry doesn't save blocks
[17:49:36] amirite: i.e. if i hit up to cycle through my history
[17:49:49] amirite: i have to hit enter for each line of a block that i want to re-define
[17:50:24] baweaver: https://github.com/pry/pry - commits welcome :)
[17:50:35] brent__: has joined #ruby
[17:50:43] baweaver: (that said, that's a tempting feature to add now that you mention it.)
[17:51:08] baweaver: havenwood: that'd be fun right?
[17:51:48] RickHull: i think hitting up is a convenience feature that synchs well with a line-based discipline
[17:51:52] govg: has joined #ruby
[17:51:59] havenwood: baweaver: wheee
[17:52:09] RickHull: you might rather prefer a command like "cd .." to recall a multiline block
[17:52:14] baweaver: I should start committing more to Pry...
[17:52:16] orbyt_: has joined #ruby
[17:52:18] blackmesa: has joined #ruby
[17:53:00] cagomez: has joined #ruby
[17:53:19] RickHull: or perhaps multiline blocks could be collapsed to a single line with semicolons based on a config flag?
[17:53:46] postmodern: has joined #ruby
[17:53:59] baweaver: Basically steal from Chrome Debugger.
[17:54:07] shime: has joined #ruby
[17:54:10] baweaver: multilines show up as one block and up goes through each line until it hits top then next history line
[17:55:02] RickHull: where does this functionality live in the codebase?
[17:55:23] chouhoulis: has joined #ruby
[17:56:04] baweaver: That question is precisely why I'm not currently trying to add it :P
[17:56:06] RickHull: is it based on the readline lib?
[17:56:09] matthewd: How do you insert newlines in the middle of the edited block? How can you wrap previous code in a new context?
[17:56:31] matthewd: RickHull: I imagine so
[17:57:06] gchristensen: has joined #ruby
[17:57:32] alnet: has joined #ruby
[17:57:32] RickHull: yes, looks like it https://github.com/pry/pry/blob/67c0b7fcd7ee81dede7d50d028afbb592ab83cbe/lib/pry/history.rb
[17:58:01] mjolnird: has joined #ruby
[17:58:07] sameerynho: has joined #ruby
[17:58:33] cdg: has joined #ruby
[17:58:46] gchristensen: hi, I'm seing with json's pretty_generate it is outputting data in an essentially random order, for example it might output { "foo": "bar", "baz": "tux" } one time and { "baz": "tux", "foo": "bar" } the next. is there a way to make this output stable between dumps?
[17:58:51] RickHull: whoops, not sure how that branch got selected: https://github.com/pry/pry/blob/master/lib/pry/history.rb
[17:59:37] RickHull: gchristensen: a pasted code example would help. use gist or equivalent
[18:00:01] mjolnird: has joined #ruby
[18:00:14] baweaver: gchristensen: also noted that hashes aren't explicitly ordered (or rather shouldn't be)
[18:00:25] RickHull: >> require 'json'; JSON.pretty_generate(foo: 'foo', bar: 'bar')
[18:00:26] ruby[bot]: RickHull: # => "{\n \"foo\": \"foo\",\n \"bar\": \"bar\"\n}" (https://eval.in/873073)
[18:00:34] RickHull: I get the same output on repeated calls
[18:00:43] RickHull: also I think Ruby has ordered hashes now, since like 2.2 maybe?
[18:00:51] havenwood: RickHull: Since 1.9.
[18:01:00] gchristensen: yeah I know they're not usually, it just making a bit of a mess of a service since every time it writes differently, it restarts a service
[18:01:12] gchristensen: oy, I'm using ancient ruby, 1.8.x or something for Puppet 2 :'(
[18:01:38] Cohedrin_: has joined #ruby
[18:02:10] havenwood: gchristensen: The implementation of Hashes changed from 1.8 to 1.9 to become a doubly-circularly linked list: https://www.igvita.com/2009/02/04/ruby-19-internals-ordered-hash/
[18:02:17] RickHull: gchristensen: 1.8 would explain it
[18:02:19] havenwood: So it got an order.
[18:02:57] mikecmpbll: has joined #ruby
[18:03:34] havenwood: Then the Ruby 2.4 changes and Ruby 2.5 is already using siphash13: https://bugs.ruby-lang.org/issues/13017
[18:03:50] FahmeF: has joined #ruby
[18:04:11] baweaver: 2.5 has all the new fun doesn't it?
[18:04:22] havenwood: yield_self(&:itself) # wheee
[18:04:43] baweaver: ACTION still thinks that method is too long
[18:04:48] havenwood: I love all these little performance patches though. They add up!
[18:04:56] havenwood: Or subtract down.
[18:05:10] ramfjord: has joined #ruby
[18:05:17] havenwood: baweaver: Yeah, the name isn't ideal. I like |> like in F# and Elixir.
[18:05:42] havenwood: I'd love to get |> pipes in Ruby 3.
[18:05:43] eam: has joined #ruby
[18:06:04] gchristensen: IIRC there is a proposal in for PHP to get it too :)
[18:07:21] snickers: has joined #ruby
[18:09:56] matthewd: Even on a new-enough ruby to have an ordered hash, it seems unwise to assume the order will be retained by JSON, which is AFAIK explicitly unordered because of the "JS" part
[18:11:54] havenwood: In Postgres for example, a JSON data type will stay ordered but JSONB will not.
[18:12:03] havenwood: ¯\_(ツ)_/¯
[18:13:22] RickHull: yep, to generate JSON is to generate a string (which maintains order). The concern would be cycling, whereby that string is parsed into a data structure and emitted in some form
[18:14:07] leah2: has joined #ruby
[18:15:27] matthewd: RickHull: But we're talking about Hash->String. Once it's in a string it'll stay put [unless/until manipulated]... but I'm noting that despite the hash having a defined ordering of its keys, there's no true guarantee the string contents will appear in that same order.
[18:16:05] RickHull: I think the generate methods respect the hash ordering by default
[18:16:10] eckhardt: has joined #ruby
[18:16:24] RickHull: so, perhaps not a contractual guarantee
[18:17:28] RickHull: I agree that there is a pitfall here, whereby one assumes all hashes everywhere respect key ordering just because Ruby hashes do
[18:17:47] RickHull: (speaking of PHP, back in the Ruby 1.8 days)
[18:17:59] tamouse__: has joined #ruby
[18:18:19] FahmeF_: has joined #ruby
[18:18:22] matthewd: I imagine so too, because it's the most obvious implementation. But arguably there'd be advantages to explicitly sorting the keys, for example... so assuming it won't change in a future version feels avoidably risky.
[18:19:08] RickHull: agreed, it is cleaner and purer to assume a pure Hash impl, which does not maintain key order
[18:20:06] RickHull: ... key *insertion order* ...
[18:21:14] matthewd: Also, every time I make an assumption based on implemented-but-not-specified behaviour, someone later turns up to point out some way in which JRuby diverges :P
[18:21:51] RickHull: yep, good point
[18:24:31] zachk: has joined #ruby
[18:24:57] alex``: has joined #ruby
[18:29:08] dinfuehr: has joined #ruby
[18:30:10] d5sx43: has joined #ruby
[18:31:01] orbyt_: has joined #ruby
[18:32:24] dionysus70: has joined #ruby
[18:32:55] alfiemax: has joined #ruby
[18:33:50] ta: has joined #ruby
[18:33:50] RickHull: speaking of lib/pry/history.rb -- loader, pusher, clearer, saver -- these are instances of the Command pattern, right?
[18:34:31] RickHull: broadly similar it seems, if not to the letter. was just refreshing my memory of this pattern last night
[18:34:59] wald0: has joined #ruby
[18:35:03] Miron: has joined #ruby
[18:35:39] RickHull: I wonder if it is preferable to more explicitly declare and invoke the pattern, even at the cost of some additional LoC
[18:36:09] pr0ton: has joined #ruby
[18:37:43] tcopeland: has joined #ruby
[18:38:57] alnet: has joined #ruby
[18:41:04] RickHull: counterpoint is that many GoF patterns are needed in languages like Java. in more expressive languages, we just write code that does the thing
[18:41:36] gchristensen: has left #ruby: ("WeeChat 1.9")
[18:42:02] baweaver: Some hardcore FP folks argue that they don't need patterns and that patterns are just missing language features
[18:42:05] anisha: has joined #ruby
[18:42:29] RickHull: yeah, that's the sentiment. it carries some weight with me
[18:42:31] baweaver: I'd say they're horribly mistaken, and FP has its own patterns that are very clearly defined
[18:42:36] baweaver: They just don't want to admit that
[18:43:01] RickHull: perhaps the milder version refers to the classic GoF patterns, not the entire universe of patterns
[18:44:09] ur5us: has joined #ruby
[18:44:27] milardovich: has joined #ruby
[18:44:32] baweaver: Moreso that different patterns emerge at different levels of abstraction
[18:45:04] RickHull: it's patterns all the way down, in some sense :)
[18:45:11] RickHull: what distinguishes a pattern from an idiom?
[18:45:30] baweaver: semantics mostly
[18:45:59] baweaver: or codification into reserved keywords I suppose.
[18:46:00] baweaver: or standard library
[18:46:10] baweaver: Such that Monads and Category Theory are effectively patterns of FP
[18:46:51] mtkd: has joined #ruby
[18:47:25] RickHull: it seems to me that both patterns and idioms are generally outside/above the language features like keywords. they may interact with keywords and stdlib modules, but are generally in the programmer's hands and not the language designer's
[18:47:26] rrichardsr3: has joined #ruby
[18:49:45] imode: has joined #ruby
[18:51:26] greenbagels: has joined #ruby
[18:55:55] leah2: has joined #ruby
[18:56:37] jenrzzz: has joined #ruby
[18:56:37] jenrzzz: has joined #ruby
[18:57:36] mtkd: has joined #ruby
[19:03:19] pr0ton: has joined #ruby
[19:05:50] madhatter: has joined #ruby
[19:06:10] naprimer: has joined #ruby
[19:07:24] clemens3: has joined #ruby
[19:12:13] webnanners: has joined #ruby
[19:15:08] machinewar: has joined #ruby
[19:15:10] nicolai86: has joined #ruby
[19:25:56] amirite: has joined #ruby
[19:26:53] bronson: has joined #ruby
[19:31:10] troulouliou_dev: has joined #ruby
[19:35:11] milardovich: has joined #ruby
[19:36:07] gr33n7007h: has joined #ruby
[19:36:39] orbyt_: has joined #ruby
[19:40:23] ta: has joined #ruby
[19:40:48] ta: has joined #ruby
[19:41:31] jinie: has joined #ruby
[19:44:49] Trynemjoel: has joined #ruby
[19:50:17] gusrub: has joined #ruby
[19:50:42] SuperL4g: has joined #ruby
[19:51:30] alnet: has joined #ruby
[19:53:36] p0p0pr37_: has joined #ruby
[19:53:37] p0p0pr37_: has joined #ruby
[19:54:44] ur5us: has joined #ruby
[19:54:50] selim: has joined #ruby
[19:55:53] cpruitt: has joined #ruby
[19:57:23] jenrzzz: has joined #ruby
[19:57:30] charliesome: has joined #ruby
[20:01:38] AxelAlex: has joined #ruby
[20:02:07] eckhardt: has joined #ruby
[20:02:51] orbyt_: has joined #ruby
[20:03:41] webnanners: has joined #ruby
[20:05:18] cdg: has joined #ruby
[20:16:47] spt0: has joined #ruby
[20:18:08] enterprisey: has joined #ruby
[20:21:25] AxelAlex: has joined #ruby
[20:21:48] dinfuehr: has joined #ruby
[20:25:41] cadillac_: has joined #ruby
[20:27:01] cagomez: has joined #ruby
[20:27:24] sagax: has joined #ruby
[20:28:09] pr0ton: has joined #ruby
[20:28:22] HalfSailorHalfPi: has joined #ruby
[20:28:41] jenrzzz: has joined #ruby
[20:28:41] jenrzzz: has joined #ruby
[20:29:45] enterprisey_: has joined #ruby
[20:30:22] ndrst: has joined #ruby
[20:33:46] blackmesa1: has joined #ruby
[20:34:42] ThomasQM: has joined #ruby
[20:34:53] milardovich: has joined #ruby
[20:35:23] daumie: has joined #ruby
[20:38:49] AxelAlex: has joined #ruby
[20:39:35] ThomasQM: has joined #ruby
[20:40:25] ThomasQM: has joined #ruby
[20:41:07] Pierreb|home: it only captures the 2 first words, if i have test1 test2 test3 test4 only first 2 will be captured. I want test2 test3 test4 to be within "" when sent off to bash
[20:41:08] Pierreb|home: %x[bash /pathtoscript/Scripts/shscript.sh "#{_text1}" "#{_text2}"]
[20:41:41] teatime: that can't be your entire question
[20:41:49] AxelAlex: has joined #ruby
[20:41:50] Pierreb|home: anyone know how to do this? ive been playing around with it but cant find a way to run it
[20:41:55] elomatreb: \-escape the quotes?
[20:42:18] redondos: has joined #ruby
[20:42:30] CPngN: shouldn't have to with %x
[20:43:05] elomatreb: Oh, I misread, nevermind
[20:43:27] Pierreb|home: it just wont send " " to the terminal, if i run the script in the terminal with " " it works
[20:45:06] Pierreb|home: figured it out finally
[20:46:00] CPngN: (please fill us in)
[20:46:12] mtkd: has joined #ruby
[20:46:30] Pierreb|home: meh so i thought, it looked fine but was not :-/
[20:47:17] eckhardt: has joined #ruby
[20:50:13] eam: oop, good afternoon everyone
[20:50:50] hahuang65: has joined #ruby
[20:56:34] Isa_: has joined #ruby
[20:57:04] Isa_: has joined #ruby
[20:59:50] dar123: has joined #ruby
[21:05:52] jamesaxl: has joined #ruby
[21:07:54] pr0ton: has joined #ruby
[21:10:34] zarubin: has joined #ruby
[21:12:23] Nahra: has joined #ruby
[21:17:31] AndBobsYourUncle: has joined #ruby
[21:17:33] matcouto: has joined #ruby
[21:18:03] Pierreb|home: for anyone that was interested, it was just working all fine. was the damn regexp ontop that captured all except last word...
[21:18:08] Guest08178: has joined #ruby
[21:18:19] Pierreb|home: had (.+) (.+) when i should have had (\+\d+) (.+)
[21:21:02] mtkd: has joined #ruby
[21:22:27] enterprisey: has joined #ruby
[21:27:55] bronson: has joined #ruby
[21:31:28] bmurt: has joined #ruby
[21:31:55] rwb: has joined #ruby
[21:36:45] webnanners: has joined #ruby
[21:37:22] eckhardt: has joined #ruby
[21:38:11] SteenJobs: has joined #ruby
[21:38:54] mtkd: has joined #ruby
[21:41:04] ecksit: has joined #ruby
[21:43:25] bmurt: has joined #ruby
[21:50:19] justache: has joined #ruby
[21:51:04] darix: Pierreb|home: imho use named match groups
[21:51:12] greenbagels: has joined #ruby
[21:51:23] darix: (?<othervar>\+\d+) (?<somevar>.+)
[21:52:04] spt0: has joined #ruby
[21:53:04] alnet: has joined #ruby
[21:53:14] bastilian_: has joined #ruby
[21:53:28] daumie: has joined #ruby
[21:53:30] darix: Pierreb|home: https://gist.github.com/anonymous/b952e8014b77a167c9c251b6b151534f
[21:54:06] phaul: has joined #ruby
[21:58:18] orbyt_: has joined #ruby
[21:58:34] bmurt: has joined #ruby
[22:02:02] oetjenj: has joined #ruby
[22:02:17] cagomez: has joined #ruby
[22:03:58] oetjenj: has joined #ruby
[22:05:18] alfiemax_: has joined #ruby
[22:05:36] phaul: has joined #ruby
[22:05:42] milardovich: has joined #ruby
[22:07:07] oetjenj_: has joined #ruby
[22:11:01] lxsameer: has joined #ruby
[22:11:50] chouhoul_: has joined #ruby
[22:14:25] ycyclist: has joined #ruby
[22:14:37] ycyclist: Any flexmock experts?
[22:15:28] bmurt: has joined #ruby
[22:15:56] jenrzzz: has joined #ruby
[22:15:56] jenrzzz: has joined #ruby
[22:16:49] daumie: has joined #ruby
[22:18:05] motstgo: has joined #ruby
[22:20:43] __Yiota: has joined #ruby
[22:20:47] mim1k: has joined #ruby
[22:20:54] marr: has joined #ruby
[22:21:16] bmurt: has joined #ruby
[22:22:54] FahmeF: has joined #ruby
[22:23:47] ramfjord: has joined #ruby
[22:26:17] jenrzzz: has joined #ruby
[22:30:31] Alina-malina: has joined #ruby
[22:30:48] phaul: has joined #ruby
[22:35:27] ResidentBiscuit: has joined #ruby
[22:36:36] eckhardt: has joined #ruby
[22:36:54] greenbagels: has joined #ruby
[22:38:07] GodFather: has joined #ruby
[22:40:41] hfp_work: has joined #ruby
[22:43:20] pilne: has joined #ruby
[22:44:15] jinie: has joined #ruby
[22:50:50] jenrzzz: has joined #ruby
[22:51:58] Alina-malina: has joined #ruby
[22:56:40] skarlso: has joined #ruby
[22:57:46] greenbagels: has joined #ruby
[23:03:12] chouhoulis: has joined #ruby
[23:03:33] Guest82765: has joined #ruby
[23:04:00] Zimsky: has joined #ruby
[23:04:26] bathtub_shark: has joined #ruby
[23:04:52] milardovich: has joined #ruby
[23:05:00] JoL1hAHN: has joined #ruby
[23:06:31] chouhoul_: has joined #ruby
[23:07:58] thinkpad: has joined #ruby
[23:09:24] cagomez: has joined #ruby
[23:12:48] AxelAlex: has joined #ruby
[23:14:04] bronson: has joined #ruby
[23:14:13] daumie: has joined #ruby
[23:19:22] PaulCapestany: has joined #ruby
[23:22:05] cagomez: has joined #ruby
[23:28:13] skarlso: has joined #ruby
[23:30:53] Guest82765: has joined #ruby
[23:32:25] coderphive: has joined #ruby
[23:34:24] jinie_: has joined #ruby
[23:34:42] Phage: has joined #ruby
[23:34:42] Phage: has joined #ruby
[23:34:46] yitsushi: has joined #ruby
[23:34:49] Morrolan: has joined #ruby
[23:41:26] cdg: has joined #ruby
[23:44:28] ahrs: has joined #ruby
[23:46:07] yitsushi: has joined #ruby
[23:49:48] Zarthus: has joined #ruby
[23:50:25] God: has joined #ruby
[23:51:02] bathtub_shark: has joined #ruby
[23:53:11] Silthias: has joined #ruby
[23:54:04] webnanners: has joined #ruby
[23:56:26] swills: has joined #ruby
[23:56:46] swills_: has joined #ruby
[23:57:49] Map: has joined #ruby