krakenr

Activity Graph

Page 1 of 1

2016-07-09

[00:53:43] krakenr: Is there any way to do this in one line?
[00:53:44] krakenr: https://gist.github.com/KrakenHH/8c7d24dc1b8954d101b87aa6e9b7fe45
[00:55:43] krakenr: can you return a break value
[01:04:40] krakenr: Looks good to me
[01:07:03] krakenr: lupine, in a similar vein, is there any way to do THIS in one line https://gist.github.com/KrakenHH/e110b5502eabb4a09e4036455b28b9af?
[01:08:19] krakenr: I'm trying to keep my methods under 6 lines
[01:08:52] krakenr: I suppose that's true
[01:09:05] krakenr: What exactly is an expression
[05:15:32] krakenr: Quit: Leaving

2016-07-03

[06:44:12] krakenr: is there any way for a case statement to have a case for "bob" or "cat"
[06:44:25] krakenr: I can't just do case "bob" || "cat"
[06:50:15] krakenr: shevy was right
[06:50:19] krakenr: I just didnt know the syntax
[06:57:12] krakenr: Quit: Leaving

2016-07-02

[06:11:25] krakenr: can you store a lambda or a block in a hash?
[06:33:51] krakenr: is there any way to yield a piece of code to a block?
[07:46:42] krakenr: Alright, so It think I've finally figured blocks out. A block calls a method, and supplies a method at the end of it {} (which can take arguments) that the method it calls can use to help it's final return statement
[07:47:07] krakenr: A block basically sends a message with a method attached for the receiver to use
[08:00:06] krakenr: Quit: Leaving

2016-07-01

[18:26:31] krakenr: Alright, I'm creating a chess game, and I have classes for each piece. How do I require_relative all of these classes in one of my other classes without having to write it out for each piece?
[22:27:42] krakenr: Quit: Leaving
[22:57:12] krakenr: if I ahve an array arr = [3,2,1,43,4], and I want to assign arr[0] and arr[3] the same variable, is there any way to do this in one line?
[22:59:14] krakenr: looks great to me
[22:59:37] krakenr: I guess they would both point to the exact same object though wouldn't they
[23:12:34] krakenr: is there any way anyone would recommend cleaning up this extremely long method? https://gist.github.com/KrakenHH/9eb28fba3a6afadd19081e5c32c015a4
[23:20:16] krakenr: makes sense

2016-06-25

[01:16:09] krakenr: Alright, I'm really trying to understand object oriented design, and I was told to, instead of creating an array or values, create an array of objects that contain the values? What is the benefit of this? I cannot wrap my head around it. It just seems like an extra step!
[01:16:59] krakenr: adam12, It's just an array of string values
[01:17:12] krakenr: adam12, I was to to make it an array of object containing string values
[01:17:20] krakenr: via readers
[01:22:27] krakenr: adam12, thnanks for the suggestions, I've seen it mentioned many times
[02:01:25] krakenr: Quit: Leaving
[04:02:19] krakenr: Hey has anyone read POODR by Sandi Metz? Can someone please explain what she means by the word 'messages', as in when she says that she prefers messages over data, and that object send 'messages' to one another
[04:05:25] krakenr: hk238, I'm jsut having a harder time trudging through than I thought. For instance, she recommends wrapping an instance variable in a method, and passing it as a 'message'. So is what a method returns a messages?
[04:06:14] krakenr: hmm I see what you're saying with the absolute value
[04:09:40] krakenr: pilne, what do you mean by 'send a message'
[04:15:32] krakenr: I see what you mean
[04:15:41] krakenr: That makes sense
[04:16:12] krakenr: so instead of direct access to the variable, you wrap them into a message and send it off
[05:44:32] krakenr: can anyone think of a better way to refactor this to make it more succinct? https://gist.github.com/KrakenHH/bcb3c924c53fdd22f453470057b14ca6
[05:45:59] krakenr: much appreciated
[05:47:39] krakenr: jesus that's beautiful
[05:52:17] krakenr: baweaver, what do the *'s do? [*0..3, *7..10, *14..17].map { |n| flat_grid[x + n * 7] }
[06:17:03] krakenr: Quit: Leaving

2016-06-18

[04:49:12] krakenr: Quit: Leaving

2016-06-17

[19:14:26] krakenr: If I'm in a method in ruby, and in a loop, will a return statement break out of the loop and end the method, returning whatever I return, or will if simply break out the loop?
[19:16:57] krakenr: awesome, thank you
[23:43:35] krakenr: This is driving me crazy: I'm building a binary tree, and I'm retrieving a node using the depth first search, and it appears that I'm retrieving the right node based on the value, but the object id's are different. Is this due to something I'm messing up, or is it a functino of ruby?
[23:43:42] krakenr: https://gist.github.com/KrakenHH/22114411ee1116507acfdb7de5508c88

2016-06-15

[03:43:58] krakenr: In terms of finding a job after a while of doing this stuff, does a guy with only a minor in computer science, instead of a major, have a realistic chance?
[04:18:18] krakenr: Quit: Leaving

2016-06-12

[03:01:40] krakenr: Quit: Leaving
[04:14:12] krakenr: has joined #ruby
[07:23:39] krakenr: So when I'm using JSON with ruby, and I serialize a hash into json, then I deserialize it back into an object, the symbol keys will be string keys isntead? I guess there's no way around this?
[07:27:32] krakenr: symbolize_names
[07:28:03] krakenr: no kidding
[08:04:13] krakenr: Remote host closed the connection

2016-06-11

[18:40:41] krakenr: Can someone please tell me what I'm doing wrong here. I've simplified my server and 'browser' as much as possible, and it's not working https://gist.github.com/KrakenHH/d155aab17ab5f618848760ebcbf5be4c
[18:41:20] krakenr: Why is the bottom part not reading from the top part?
[18:44:01] krakenr: it works until I send a request
[18:48:10] krakenr: Sorry, here https://gist.github.com/KrakenHH/0ab4f8e518aeba3bbfc80b56fe97f88f
[19:03:38] krakenr: Yea, I just get unlimited blinking cursors
[19:10:24] krakenr: jhass: I think I understand it. The server never gets and eof? because it's never sent, but I'm trying to figure out how to send one without closing the socket on the client side because I need to read the response
[19:14:08] krakenr: jhass, thank you

2016-06-10

[20:17:32] krakenr: Hey, what is the difference between :: and . ? I don't get whats happening when for instance Net::HTTP is called, what is the :: doing?
[20:18:56] krakenr: So it's bassically saying that Net is the module, HTTP is the class within it?
[20:19:54] krakenr: So for instances, Net::HTTP::Get.new is this: Net module, calling the HTTP class within this module calling the Get class within this class, calling the .new method within the Get class?
[20:22:03] krakenr: So, correct me if I'm wrong, but :: is just used to access a class within a class
[20:22:32] krakenr: Got i ljarvis
[20:22:37] krakenr: I'm going to check that out
[20:22:40] krakenr: thanks all
[20:22:51] krakenr: I think I'm on the right track now
[20:37:07] krakenr: Quit: Leaving

2016-06-09

[03:16:15] krakenr: if I have an array that contains this: #<Person:0x000000020e61e8 @name="bob", @gender="male">
[03:16:18] krakenr: What is that?
[03:16:31] krakenr: is it an object? What does #<foo> signifiy?
[03:17:10] krakenr: nvm I got it :{
[03:34:05] krakenr: Quit: Leaving
[05:09:18] krakenr: If I'm loading from a YAML file that contains multiple store objects, and I store YAML::load(yaml_string) in a variable, then that variable is only containing the first object in the yaml file. What am I doing wrong here? Should it contains an array of the objects?
[05:13:35] krakenr: Figured it out, I used YAML.load_stream instead of YAML.load
[05:30:57] krakenr: Quit: Leaving
[06:46:51] krakenr: What does :: mean? For instance in Net::HTTP.start
[06:50:38] krakenr: al2o3-cr, so it's accessing the HTTP constant in the Net class?
[06:54:43] krakenr: Quit: Leaving

2016-06-08

[08:24:40] krakenr: is it looked down upon to use for loops in ruby? It just makes more sense to me when working with arrays instead of each loops
[08:26:35] krakenr: I think it's a matter of habit, and I'm replacing specific elements in an array at specfic points and I'm scared of using the each method for that
[08:27:03] krakenr: I'm going to write a few lines of code
[08:27:08] krakenr: givve me a couple minutes
[08:27:20] krakenr: Then can you let me know if it could be done better?
[08:28:31] krakenr: I'm using for loops with ranges such as for i in 0...nums.size
[08:29:17] krakenr: I think the ... discludes nums.size
[08:29:29] krakenr: .. would leave wonkiness, right?
[08:29:57] krakenr: I guess my code isn't very rubyist :(
[08:33:43] krakenr: that's true
[08:35:15] krakenr: I'm going to post a code block in a sec
[08:35:32] krakenr: Oh I like 0.upto
[08:38:05] krakenr: Alright, so I'm guessing this is not a very ruby way of doing things:
[08:38:06] krakenr: https://gist.github.com/KrakenHH/b00ef184cf2330f926c017da0b273af4
[08:39:00] krakenr: it was initialized a while back
[08:39:16] krakenr: @answer_array = []; @secret_word_letters.size.times { @answer_array << "_" }
[08:40:04] krakenr: It's hangman!
[08:41:15] krakenr: oh I just realized I did this wrong
[08:41:25] krakenr: user input letters is litterally 1 letter
[08:42:02] krakenr: it works but this is superfluous as hell
[08:43:23] krakenr: I like that
[08:43:41] krakenr: thanks jhass
[08:44:23] krakenr: Because it's 4 am and I need to go to bed :(
[08:44:53] krakenr: It's definitely not
[08:45:12] krakenr: That will be python
[08:45:17] krakenr: I wish I got ruby homework
[08:45:53] krakenr: Are any colleges teaching ruby these days? UT likes hitting me with python
[08:47:01] krakenr: I like it alot jhass , very succinct
[08:47:11] krakenr: I'm going to bed now
[08:47:25] krakenr: Quit: Leaving

2016-06-07

[01:12:43] krakenr: Isn't there a method which returns whether or not a certain object has a method?
[01:19:12] krakenr: What are your guys' thought on 30 line methods :( ?
[03:43:52] krakenr: Quit: Leaving
[06:16:12] krakenr: alright, this may sound dumb, and I'm not even sure I get what I'm asking, but are classes objects in ruby?
[06:24:16] krakenr: Christ now I'm confused
[06:24:39] krakenr: An Array doesn't
[06:24:54] krakenr: I just don't get how a class can be an instance of an object
[06:25:16] krakenr: I get how an instance of an array can inherit from object
[06:25:57] krakenr: I don't think it pragmatically matter much
[06:26:15] krakenr: interesting
[06:26:45] krakenr: Thanks aperios
[06:27:11] krakenr: what are nicks?
[06:27:25] krakenr: thank apeiros
[06:27:55] krakenr: checking it out null__
[06:30:52] krakenr: Quit: Leaving

2016-06-06

[22:54:04] krakenr: is [1, 3 ,4] or [ 1, 3, 4 ] proper styling?
[23:38:07] krakenr: Quit: Leaving

2016-06-05

[02:05:10] krakenr: is it more convention to call "hi".upcase or "hi".upcase()
[02:05:24] krakenr: conventional*
[03:16:35] krakenr: Hey guys, ruby noob here having a tough time. I have two files that are in the same directory, a board.rb file and a player.rb file, and I'm trying to create a player object within the board file, but I can't. Don't I need to ((( require 'player' ))) at the top of my Board class? I've already done this and I'm getting "cannot load such file --- player"
[03:17:52] krakenr: Alright I just fixed it with require './player'
[03:17:58] krakenr: not sure why I needed the './'
[03:19:10] krakenr: I though ./ would mean one directory down
[03:21:14] krakenr: Radar: huh? When I $cd .. it brings me one directory up
[03:23:40] krakenr: True that!
[07:43:43] krakenr: Quit: Leaving
[18:24:29] krakenr: is there a string method for identifying whether a string contains a regex?
[18:25:27] krakenr: a = "apple"
[18:25:39] krakenr: I want to check whether or not a contains p, l, or e
[18:27:26] krakenr: Hm I never knew about the =~ method
[18:28:03] krakenr: ohhh it returns the index and nil if it's not in there
[18:35:04] krakenr: Quit: Leaving

2016-06-03

[05:31:02] krakenr: Quit: Leaving
[06:08:57] krakenr: What's the point of a Struct when I could just use a hash? Are there any advantages?
[07:18:35] krakenr: Quit: Leaving

2016-06-02

[02:49:52] krakenr: When do you guys use a double space and when do you guys use tabs? Do you use double space for methods and tabs for conditionals and for loops?
[02:53:13] krakenr: ah so 2 spacse
[02:55:29] krakenr: Quit: Leaving
[21:58:37] krakenr: if (class A) inherits from (class B), and (class B) inherits from (class C), does (class A) inherit from (class C)?

2016-05-31

[07:18:33] krakenr: Jesus Chirst being able to write methods which take code blocks as arguments makes my head spin with all the different possibilites
[07:19:14] krakenr: so much potential for abstraction
[07:20:22] krakenr: I feel like its a 'with great power comes great responsibility' thing. I feel like there are so many high level ways of doing things now, and I have to think of them
[07:22:38] krakenr: <jhass>: Give me one word on what is to come
[07:26:32] krakenr: quick question, so is a code block and object?
[07:26:43] krakenr: what isn't an object in ruby besides nil?
[07:28:29] krakenr: When you pass a block into a method, you can .call it, so does that mean it becomes an object once you pass it into a method?
[07:28:38] krakenr: but not before?
[07:29:29] krakenr: thanks you!
[07:29:32] krakenr: thank you*
[07:32:52] krakenr: goodnight all
[07:32:56] krakenr: Quit: Leaving

2013-12-25

[02:43:58] krakenr: so I've got a question on open uri. Is there anyone who could help me out?