mistnim

Activity Graph

Page 1 of 1

2017-12-12

[12:15:01] mistnim: has joined #ruby
[12:15:33] mistnim: how do I rename Digest::MD5.hexdigest(astr) to md5(astr)?
[12:25:29] mistnim: havenwood: really? isn't there something like "require as"?
[18:26:33] mistnim: Quit: WeeChat 1.9.1

2017-11-19

[14:46:49] mistnim: has joined #ruby
[14:48:08] mistnim: how do I debug an unexpected end of input, excpetcted keyboard end (with line number the end of a long file?) indenting with my editor doesn't show any problem
[14:49:45] mistnim: apeiros, yes, but where it is?
[14:49:59] mistnim: the auto-indentation is fine
[14:50:35] mistnim: it's 1000 lines of code
[14:58:49] mistnim: guys, it's not else if, it's elsif.
[15:02:45] mistnim: also, run your thing frequently while you code
[15:23:41] mistnim: Quit: Leaving

2017-09-17

[04:22:39] mistnim: has joined #ruby
[04:57:22] mistnim: Ping timeout: 264 seconds
[04:58:36] mistnim: has joined #ruby
[05:32:49] mistnim: Ping timeout: 248 seconds
[05:44:23] mistnim: has joined #ruby
[06:33:35] mistnim: Ping timeout: 248 seconds
[08:53:34] mistnim: has joined #ruby
[09:04:53] mistnim: Ping timeout: 240 seconds
[09:08:03] mistnim: has joined #ruby
[09:13:03] mistnim: Ping timeout: 248 seconds
[09:17:03] mistnim: has joined #ruby
[09:27:55] mistnim: Remote host closed the connection
[09:28:18] mistnim: has joined #ruby
[09:39:22] mistnim: Ping timeout: 264 seconds
[10:51:35] mistnim: has joined #ruby
[11:06:53] mistnim: Ping timeout: 240 seconds

2017-09-16

[11:36:54] mistnim: has joined #ruby
[11:37:37] mistnim: how do I run a system command so that if my ruby script exits it will continue to run?
[11:42:42] mistnim: Salmonidae, what do you mean collect zombies? Even if the forked process ends?
[11:54:07] mistnim: Ping timeout: 260 seconds
[16:38:56] mistnim: has joined #ruby
[17:28:33] mistnim: Ping timeout: 248 seconds
[17:29:03] mistnim: has joined #ruby
[17:33:02] mistnim: Remote host closed the connection
[17:33:27] mistnim: has joined #ruby
[17:38:27] mistnim: Ping timeout: 252 seconds
[18:27:33] mistnim: has joined #ruby
[18:38:46] mistnim: Ping timeout: 264 seconds
[18:41:26] mistnim: has joined #ruby
[19:31:53] mistnim: Ping timeout: 240 seconds

2017-06-16

[06:15:26] mistnim: has joined #ruby
[06:15:46] mistnim: >> __dir__
[06:16:24] mistnim: did anything change about what __dir__ mean lately?
[06:17:04] mistnim: it seemed to point to the dir where the code is. Now from where you are launching it?
[06:18:25] mistnim: Abhijit, raise an error by checking the version?
[06:20:13] mistnim: can I ask you what __dir__ gives you? The dir of the file where the code is or the dir from where you are launching that file?
[06:27:36] mistnim: this is really bad, if you use binding.pry __dir__ becomes ".", that's the opposite of useful for debugging
[06:29:37] mistnim: dminuoso, if I have a function that uses __dir__ than it will fail if launched from pry
[06:30:29] mistnim: then I have to investigate the problem and it was just pry being tricky
[06:36:28] mistnim: in any case, I'm going with DIR = __dir__ on top, and then use DIR instead of __dir__
[06:44:45] mistnim: lol, I really have a troubled relationship with pry. Calling a function play is a bad idea
[06:56:26] mistnim: Remote host closed the connection

2017-06-08

[05:48:46] mistnim: has joined #ruby
[05:49:51] mistnim: what is an easy way to save some small information accross a program restart?
[05:54:50] mistnim: synstack: something like YAML.dump, but I don't like yaml very much
[05:55:18] mistnim: synstack: but there is no JSON.dump
[05:55:36] mistnim: ops there is
[07:01:09] mistnim: Quit: Page closed
[07:12:06] mistnim: has joined #ruby
[07:13:17] mistnim: is there a consistent way, know its class, to recreate an object from it's JSON.dump string
[07:14:03] mistnim: class.new is not good, because numbers don't have new method
[07:15:09] mistnim: herwin: no, the string they generates for the single object are more or less the same
[07:15:35] mistnim: if not exactly the same
[07:15:59] mistnim: let me try
[07:17:35] mistnim: zenspider: what should I use?
[07:19:01] mistnim: zenspider: ok but I have the same problem with yaml, It won't generate back the object often, but its string represantation
[07:19:38] mistnim: so I need a consisten way to get the object back
[07:20:10] mistnim: zenspider: I might possibly
[07:20:22] mistnim: but just on read on the other end
[07:20:50] mistnim: it's very likely that I will in the future
[07:26:08] mistnim: zenspider: I save a Time object to yaml, I load it and it's just a string not a Time Object
[07:27:21] mistnim: >>> require "yaml"; YAML.load(YAML.dump(Time.now))
[07:27:29] mistnim: >> require "yaml"; YAML.load(YAML.dump(Time.now))
[07:27:57] mistnim: >> require "yaml"; YAML.load(YAML.dump(Time.now)).class
[07:28:19] mistnim: interesting
[07:30:25] mistnim: yeah, sorry, I was sure it didn't work last time I tried
[08:04:23] mistnim: Quit: Page closed

2016-01-21

[17:37:23] mistnim: has joined #ruby
[17:47:54] mistnim: what does this mean? "Exceptions [in ruby] work in a similar manner [to C++], though the keyword names have been changed to protect the innocent."
[17:49:14] mistnim: ProofTechnique: yes I figured, but I don't get the joke
[17:50:55] mistnim: ProofTechnique: thanks
[19:52:58] mistnim: I am the only one who just can't stand python style colon blocks, and loves ruby syntax?
[19:57:03] mistnim: I think it's a matter of symmetry, my brain feels the need for a closing statement, balance
[19:59:40] mistnim: hxegon: that's even worse, the abrupt ravine that there would be in python terrifies me
[20:01:00] mistnim: hxegon: yes, but mine is just a psychological/emotional issue
[20:01:19] mistnim: I'm not saying python is bad
[21:33:42] mistnim: Ping timeout: 252 seconds

2015-12-21

[18:40:22] mistnim: has joined #ruby
[19:14:46] mistnim: is there any field other than webdevelopment where ruby is relevant?
[19:15:47] mistnim: wolffles: always web related?
[19:17:28] mistnim: it's still completely overshadowed by python outside web fields
[19:19:01] mistnim: I just wish it was the most popular scripting language in general, I like ruby more than python
[19:20:17] mistnim: bougyman: I do because if there is a field I'm going to be interested in the future, and there are no tools for ruby, than I will be forced to use python or something else
[22:10:52] mistnim: Quit: WeeChat 1.3

2015-12-20

[14:25:06] mistnim: has joined #ruby
[15:04:30] mistnim: Quit: WeeChat 1.3

2015-09-20

[13:35:58] mistnim: has joined #ruby
[13:38:58] mistnim: >> a = [[0,0,0]*3]; a[0][0] = 1; p a
[13:39:34] mistnim: >> a = [[0,0,0]]*3; a[0][0] = 1; p a
[13:39:53] mistnim: why does the 1 gets assigned to all the rows?
[13:42:26] mistnim: arup_r: what is that & for?
[13:46:56] mistnim: arup_r: thanks
[13:48:48] mistnim: Ox0dea: I guess I made an array with the same object three times
[14:00:46] mistnim: thanks arup_r, btw I'm reading a beginner ruby book explaining the syntax of exceptions, but I still don't understand where to use them, where not to use them, and how to use them in geneal. Can you point me to something more in depth?
[14:02:46] mistnim: thanks arup_r, I'll look into it
[17:12:48] mistnim: Remote host closed the connection

2015-09-07

[14:26:12] mistnim: has joined #ruby
[14:29:17] mistnim: hello, let's say that at some spot in my program I need to check multiples if the objects in an array are all the same. Should I make a method (all_same? array) or extend Enumerable with that method? What is reccomended?
[14:30:35] mistnim: pontiki all? needs a block
[14:31:07] mistnim: pontiki yes that I would use in the method
[14:31:30] mistnim: ok, but should the method be in Enumerable or by itself?
[14:32:18] mistnim: just Array
[14:37:27] mistnim: I have some problems to figure out how to organize a program. Where should I put the code to extend Array? It's just required by a class
[14:39:50] mistnim: shevy, but still that extension is going to be avialable to all the program after it's loaded right?
[14:42:24] mistnim: well it's not needed, but I guess it won't hurt, I suppose there is no way to isolate it only for the class in any case
[14:52:35] mistnim: in any case if a class needs a simple generic method, that is clearly not part of the class itself, I can put it on the class.rb file, or require it from there. But I still don't like it that these methods leaks through other parts of the program.
[14:54:47] mistnim: centrx, ok, I didn't know, I'll check that out
[15:00:12] mistnim: centrx, it says you can use them only at the top-level, not in classes
[15:00:48] mistnim: izzol i *= 10?
[21:31:38] mistnim: Remote host closed the connection

2015-08-12

[13:37:54] mistnim: has joined #ruby
[13:39:00] mistnim: can you explain why when returning a private variable from a class method there is no = function?
[13:39:55] mistnim: apeiros: I mean a variable like @variable
[13:40:50] mistnim: apeiros: you can't use =
[13:46:10] mistnim: apeiros https://gist.github.com/mistnim/1230352653ce31d3c4bd
[13:49:20] mistnim: apeiros: ok, but why can't you use normal assignment syntax to it?
[13:51:34] mistnim: apeiros: ok ok, but I don't get why you wouldn't allow that
[13:56:36] mistnim: apeirons: ok I guess I understand, thanks
[14:18:29] mistnim: ok so you use a attr_reader because you don't want your ivar to be changed externally, but isn't it pointless when there are some ivar methods, like map!, that can actually change its value?
[14:36:26] mistnim: well, ok I have studied some basic c++ before ruby, and I am accustomed to the idea that when using only a getter, whatever you do with what you get won't influence the object state
[15:22:55] mistnim: has left #ruby: ("ERC Version 5.3 (IRC client for Emacs)")

2015-07-24

[19:34:55] mistnim: has joined #RubyOnRails
[19:35:49] mistnim: hello, how does form_for knows if it has to create or update?
[21:11:18] mistnim: Ping timeout: 256 seconds

2015-06-26

[14:00:01] mistnim: has joined #ruby
[14:00:40] mistnim: can I somehow use python libraries in ruby?
[16:06:53] mistnim: Remote host closed the connection

2015-06-21

[13:52:14] mistnim: has joined #ruby
[16:40:01] mistnim: Ping timeout: 264 seconds

2015-06-17

[18:46:34] mistnim: has joined #ruby
[19:11:55] mistnim: Remote host closed the connection

2015-06-14

[11:53:17] mistnim: has joined #ruby
[11:54:57] mistnim: Remote host closed the connection
[12:27:05] mistnim: has joined #ruby
[12:27:58] mistnim: Remote host closed the connection
[12:30:11] mistnim: has joined #ruby
[12:33:38] mistnim: Remote host closed the connection
[12:36:10] mistnim: has joined #ruby
[12:38:44] mistnim: Remote host closed the connection
[12:38:59] mistnim: has joined #ruby
[12:42:24] mistnim: Remote host closed the connection

2015-06-12

[13:27:16] mistnim: has joined #ruby
[13:29:24] mistnim: hello, is there a very simple ruby http server, I can use for a fast thing?
[13:30:13] mistnim: jhass: it need to return just a string
[13:30:58] mistnim: jhass: is read from file
[13:31:27] mistnim: jhass the https user is just me, just for one time
[13:34:27] mistnim: well to explain, let's say I just want to send the temperature value of my cpu and I can read it from my phone everywhere
[13:36:20] mistnim: I don't know sinatra, I know just basic ruby for now
[13:37:21] mistnim: Darkwater: does it work as an http server too?
[13:37:31] mistnim: ok I try thanks
[13:41:24] mistnim: jhass yes I just made that simple context to get an answer, what I need is actually a bit more complicated, but longer to explain
[13:44:42] mistnim: Darkwater: it works! but i need it on port 80
[13:46:06] mistnim: Darkwater: add -p 80 where?
[13:46:18] mistnim: ljarvis: no
[13:47:22] mistnim: jhass: connect from my phone
[13:48:05] mistnim: ops, I actually the server has only some open ports
[13:49:28] mistnim: not my server, I can't change open ports
[13:50:08] mistnim: jhass yes, it's, how do you call it? Virtual server
[13:55:33] mistnim: btw, server has 8000 open, and that doesn't require root, I can write my little app, thanks all :)
[14:46:51] mistnim: Ping timeout: 265 seconds
[19:49:06] mistnim: has joined #ruby
[19:49:35] mistnim: is it normal that pry takes a lot to load? Like 2 seconds for me?
[20:01:59] mistnim: rubysts use emacs?
[20:06:02] mistnim: do you think following Odin is good to learn ruby?
[20:07:31] mistnim: *.net *.split
[20:07:44] mistnim: has joined #ruby
[20:09:05] mistnim: it teaches you rspec from the very beginning
[20:13:07] mistnim: north dakota
[20:15:01] mistnim: why not alaska?
[20:26:02] mistnim: do you really need to learn rspec to do web development?
[21:26:20] mistnim: Remote host closed the connection

2015-06-04

[15:43:48] mistnim: has joined #ruby
[15:44:29] mistnim: hello, how can I use a case statment for switching between class types?
[15:45:04] mistnim: "case object.class ... when ClassName" doesn't work
[15:48:53] mistnim: thanks hanmac1
[15:53:36] mistnim: wow, I have to say, debugging with ruby is amazing, I would have gone crazy in c++ recompiling everytime
[16:12:12] mistnim: Ping timeout: 246 seconds

2015-06-02

[14:55:38] mistnim: has joined #ruby
[14:56:09] mistnim: hello, one file for each class or not? what is the standard in ruby?
[15:47:06] mistnim: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")

2015-05-17

[10:09:13] mistnim: toretore: https://gist.github.com/anonymous/11e4757c042160ad0599
[10:11:33] mistnim: toretore: this is for an opengl app, it calculates the time difference between two draw calls, so that it can make camera movements smooth
[10:18:24] mistnim: toretore: Is it ok the way I do it? Is there a better way?
[10:19:16] mistnim: toretore: because you asked me, some days ago
[10:19:41] mistnim: (you asked me to see the code)
[10:22:10] mistnim: ok toretore thanks

2015-05-13

[11:17:52] mistnim: hello, can you explain me this behaviour? http://paste.debian.net/176246/
[11:20:22] mistnim: adaedra: what does ||= mean?
[11:21:02] mistnim: I want t to be = 3
[11:22:21] mistnim: adaedra: got it, why that code doesn't work though?
[11:28:17] mistnim: adaedra: btw there is a problem with t ||= 3, t will get assigned every time to 3, not just when it's not defined
[11:29:40] mistnim: toretore: how does it work?
[11:30:16] mistnim: I missed it
[11:32:49] mistnim: toretore: define a global variable in a function and the next time it is called it should still exist but the value shouldn't be changed
[11:33:46] mistnim: but yeah, it's probably not a good practice, and it's better to define the variable outside of the method
[11:35:30] mistnim: toretore: there is no code, it's just an idea
[11:37:20] mistnim: toretore: keeping the definition of the global variable close to where it is used (in the method)
[11:38:32] mistnim: toretore: let's say I want to keep track of how many time the methods was called
[11:39:25] mistnim: hanmac1 what if I'm not in a class
[11:40:46] mistnim: hanmac even a method in the topmost level?
[11:43:54] mistnim: toretore: how would you track how many times a method is called? (a method defined outside a class)
[11:48:02] mistnim: toretore: I understand what you mean, it depends on the context, I'll try to come up with a real situation you might want it
[11:49:49] mistnim: now I have to go, thanks though

2015-05-12

[16:23:17] mistnim: hello, can you tell me what is this: ?\e
[16:24:26] mistnim: havenwood: what you don't need to put in quotes?
[16:24:50] mistnim: this fucks emacs indentation
[16:25:58] mistnim: thanks havenwood, nobody knows why it mess with emacs indentation?
[16:28:16] mistnim: >> ?\n.ord
[18:57:37] mistnim: why is '\e' != "\e"?
[18:57:47] mistnim: >> '\e' != "\e"

2015-02-15

[14:44:24] mistnim: hello, I'm on fedora21, I do ruby install jekyll, it does install it, ok, than I go to install another package, and now "ruby install any_package" always gives me "/usr/bin/ruby-mri: No such file or directory -- install (LoadError)"
[14:46:21] mistnim: but is it ok to install packages without root?