Page 1 of 1
[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
[11:37:37] mistnim: how do I run a system command so that if my ruby script exits it will continue to run?
[06:17:04] mistnim: it seemed to point to the dir where the code is. Now from where you are launching it?
[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: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
[07:13:17] mistnim: is there a consistent way, know its class, to recreate an object from it's JSON.dump string
[07:15:09] mistnim: herwin: no, the string they generates for the single object are more or less the same
[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:26:08] mistnim: zenspider: I save a Time object to yaml, I load it and it's just a string not a Time Object
[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."
[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
[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
[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: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: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.
[13:39:00] mistnim: can you explain why when returning a private variable from a class method there is no = function?
[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
[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: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:55:33] mistnim: btw, server has 8000 open, and that doesn't require root, I can write my little app, thanks all :)
[15:53:36] mistnim: wow, I have to say, debugging with ruby is amazing, I would have gone crazy in c++ recompiling everytime
[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
[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: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: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: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
[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)"