« first day (957 days earlier)      last day (2298 days later) » 

How do you link a question or answer like that?
For SO questions and answers, just paste the bare link in and the room will take care of making it all fancy.
Otherwise, just use markup like this: [text goes here](http://url.goes.here)
The chat support a lot of this kind of link being showed in a special format
00:44
-4
Q: Running a Ruby website on localhost

BobdabiulderAfter looking at other similar posts, I still need help. My friend sent me a 1.3gb .zip file with a bunch of folders and scripts. He says it's using Ruby. I am completely clueless about Ruby, I know Java and HTML though. How can I run this on my computer to test out the website?

^ I couldn't help but answer that. I think there's a place in the world for this question and its answer. That place may not be on SO...
1.3 gigs is pretty big, even for a rails project right?
@Marc-Andre Here is gitlab v bitbucket according to gitlab
@thesecretmaster That seems pretty big to me.
@WayneConrad This should be a comment on some tutorial on the web that explain how to run a rails project. This question does not fit SO at all. If that question would have pop up in chat maybe but there on SO, not a fan at all
:32454721 Hi!
@thesecretmaster Thanks
@WayneConrad In the question the rails project is 1.3gb zipped
@Marc-Andre I know that :) That's why I said "I couldn't help myself" when I answered it. I know it doesn't really belong on SO.
00:55
I feel like answering it is a bad idea. It should have been closed by now...
@thesecretmaster I imagine it has a database dump within it, or a pile of images, or something like that. No way can that be all code.
I really need to participate a bit more on SO. I miss having privileges.
You can get privileges pretty easily these days by gaming the documentation experiment.
@Marc-Andre What do you mean you "miss" privileges? Did you have more rep at one point?
@thesecretmaster I have 5k on Code Review
@WayneConrad Which will most probably be fixed at some point in time, and even though it would not fell honest to me.
00:59
I hope they do fix it soon.
@WayneConrad How do you do the special star with only an outline? What does it mean?
That's a "pin". It's like a star but stays around a bit longer. You have to be a room owner to do that.
Tonight's game is Oblivion, the game that came before the venerable Skyrim. Oblivion is pretty fun. It's less polished than Skyrim, but it loads way faster, and so far it's challenging.
Nice I played a little bit on cracked version but it was fun. I would probably need to grab it one day
hey fellas
@the_islander Hello, welcome.
Or.. that's welcome back, isn't it? I think you've been here before. Please forgive my poor memory.
01:06
haha no worries , more like welcome back, haven't been here for some time now
just completed my first month as a junior dev, most of the time is spent googling what I should do so haven't been around :(
When you're a senior dev, you'll still be googling everything. You'll just be googling harder stuff. ;)
The stuff you don't need to google is stuff you googled before
Ohh boyy can't wait lol
but I've been experiencing something, maybe you guys with experience can share your 2 cents
since I've been hired I haven't look at my personal projects in weeks, I come home and have no motivation to look at code, just watch tv and relax
That's pretty normal for me.
where as while I was unemployed I had ideas and started projects almost weekly, is that feeling normal and do you eventually get over it
01:15
Indeed I had the same thing happened. The thing I do is set small task to do if I want to work on a project.
Thanks for the reassurance @WayneConrad :) and definitely sounds like a plan @Marc-Andre, one step at a time
"Small tasks" is good advice.
Alright. The boss just tossed a spell at me, which hit one of the zombies that was also chasing me and killed it dead. Yay! Now let's see if I can survive the boss.
xD
Been reading up on impostor syndrome in the CS field and I definitely feel that way sometimes
01:42
Ugh I've been trying to debug 1 test that keeps failing with no good error message for the last half hour.
01:56
@thesecretmaster What is its behavior?
@the_islander I know the feeling.
I know the test should be passing because when I try the thing I'm testing in a real app, it works, but the test still fails. It's a rack test get request, get("/").body.should eq("Hello World Get")
How does it fail?
02:11
undefined method `[]' for nil:NilClass. It's from the call method. I know what is going wrong, it's that an instance variable is getting magically unset somewhere, but for the life of me I can't find where.
Why doesn't ruby have setters and getters for class variables?
class Foo
  class << self
    attr_accessor :bar
  end
end

Foo.bar = 2
Why does that work?
class << self opens up the eigenclass (aka singleton class), the place where class methods live. attr_accessor then adds a reader and writer to the eigenclass.
02:31
Can you explain this to me?
class A
	@@test = {}
	class << self
		attr_accessor :test
	end
end
puts A.test #=> nil
A.test = Hash.new
puts A.test #=> {}
Oh, those variables. Don't use 'em (mostly). They cause pain.
105
A: Difference between class variables and class instance variables?

Wayne ConradA class variable (@@) is shared among the class and all of its descendants. A class instance variable (@) is not shared by the class's descendants. Class variable (@@) Let's have a class Foo with a class variable @@i, and accessors for reading and writing @@i: class Foo @@i = 1 def se...

Yeah, I understand how they work, but I do need a variable constant across different instances of a class.
But why can't you set them as in my example?
Because @@ variables are special, confounding, and probably not what you want.
So I should save that variable elsewhere?
02:36
A class instance variable is good for that.
Example in a second...
class Foo

  class << self
    attr_accessor :bar
  end

  def set_bar
    self.class.bar = 2
  end

  def print_bar
    puts self.class.bar
  end

end

foo1 = Foo.new
foo2 = Foo.new
foo1.set_bar
foo2.print_bar    # => 2
I dunno, it just feels to complicated for what I'm trying to do. I'm using that for now until I find something better.
03:01
Fair enough
@thesecretmaster cant you use a constant? .. i guess you want a shared variable across instances but want to also modify it?
Aren't constants... Constant? I need to modify it.
yea that was my question .. well actually you CAN in ruby.. you get a warning though
I think that I'm going to just store it elsewhere in the app. Seems like less hacky and easier to maintain.
But thank you both for your help!
03:18
@thesecretmaster BTW if you want a quick and dirty in memory kinda database. ruby has PStore
http://ruby-doc.org/stdlib-2.3.0/libdoc/pstore/rdoc/PStore.html
I prefer clean solutions when possible, but pstore is a good thing to know about
Since I started using rspec, I've developed a new least favorite color: red
sharing global state between instances can lead to nasty bugs btw
im guessing you already know that though :)
Yeah... How I got into the mess in the first place. I'm now using the global variables as defaults and copying them into instance vars in initialize
what exactly are you trying to accomplish ? can you elaborate? im just curious
03:34
The idea is that there is a master class (template) and that instances of the master class have the same variables as the master, but can be tweaked.
I have an arry of template classes already, so now I'm just adding the default variables to that instead of to the master class directly.
 something like this? :

class Master
  attr_accessor :name
  def name
    @name || "Default Name"
  end
end

class Slave < Master
end

slave = Slave.new
slave.name => "Default Name"
slave.name = "bar"
slave.name => "Default Name"
@thesecretmaster
oops.. last output is

slave.name => "bar"
04:35
Hi all! Looking for a better way to write up an ActiveRecord query statement. Anyone have a few minutes? :)
Say I have a User model. That User model `has_many` update_logs and also contains an attribute `my_events` which happens to be an Array. I would like to find Users that have an event ID (`1` in this example) AND their most recent `update_log` contains a matching team name.
So far, I was able to figure out the statement to find the event ID in their `my_events` attribute. The trouble I have is no adding the extra layer of search. I'm thinking I can just do a `.select` on the results of the first outcome, but was curious if there was a simpler way to run that
 
6 hours later…
10:27
@Nima yeah, similar
 
1 hour later…
 
2 hours later…
13:21
@ManBearPixel Are you using an SQL Database? If so, and the array is something you want to search on, then it might be better to store the array as rows in a separate table. This can make it possible to use regular SQL (through ActiveRecord) to let the DB server do the search.
13:46
good morning, fine people in here
Goooood morning
I've had a terribly unproductive week. I've only doing liek 2 hours of work
@Kneel-Before-ZOD Hello, good to see you.
@Cereal Why so unproductive?
@WayneConrad Cobol
I don't mind working in cobol, it's getting my bearings for each new ticket. I just don't wanna
@Cereal Watch your language! ;)
Wow, Cobol, for real?
13:59
Yup, yup!
I don't know, I'd almost find it interesting to be forced to learn it at this point
Then you get to say for the rest of your career that you've actually worked in Cobol :p
The language is strange and unusual
It's like it was written with the intention of it reading like english
And then no one wrote it that way
Also the 80 column width or whatever it is infuriates me
That's because the idea (of making it read like English) is just flawed.
I do like it more than visual basic though, so there's that
@ManBearPixel .. did you try Arel? github.com/rails/arel
14:31
@WayneConrad thanks! You guys had some productive discussions this morning
The room is very enjoyable when discussions like that happen. We've had some smart new Rubyists join the room, which is always delightful.
14:46
especially the ones about not wanting to touch any code after work and the impostor syndrome
Those were good ones, yes.
how's your banjo practice progressing?
Very well, thank you. I've come up with an arrangement for a song I really like, Green Rocky Road. I've been playing that over and over trying to make it perfect.
That's it being played on the guitar. It works out a little different for the banjo. I've been working on it for about a month, including asking my teacher for ideas.
how long have you been playing (or practising)?
Three years.
15:00
nice......what got you into it?
Dad challenged me to learn and gave me his banjo. An amazing gift--I couldn't turn that down.
15:11
wonder what might have happened if he had challenged you to rule the world (reference to Smallville's Lionel-Lex relationship) :).
I started out with bluegrass style banjo, because that's what dad likes. But then I saw clawhammer style on youtube and switched to that style.
do you know what type Buffett play?
I don't know who that is.
it seems he plays ukelele
I love the Uke. I'll learn to play it some day.
@Kneel-Before-ZOD Do you play anything?
15:24
I assumed Jimmy Buffett
not really. tried guitar a while back, then, life took over
And thought "Oh, I didn't know he played ukelele"
I used to bang on drums growing up though, but I think every kid does that when they see a drum
@meagar Warren Buffett;
Yeah, got it now :)
finally switched to iterm2
couldnt be happier!
15:29
googles iterm
downloads iterm
lol and you can spend hours picking themes.. http://iterm2colorschemes.com/
@thesecretmaster
lol
wow....that sounds cool
I'm gonna try it out tonight
i wasted my morning changing themes and configuring stuff lol
Mania over themes mystifies me.
Probably because I'm old :)
lol @WayneConrad
15:33
@WayneConrad do you do front end development (UI stuff) ?
No, all back end.
ah.....lucky! I like front end development if someone already has all the graphics figured out. If I have to pick out the colors and locations and how the presentation should work best, that'll take eternity
@Nima I waste so much time on colors, I spent a whole day configuring terminal themes. There are ~5 options.
yup.. now enjoy Iterm 2 colors
There goes my week
15:36
:)
If I were a manager of a developer who took more than 5 minutes to pick a theme, I'd be making the "wtf face" at them. You know, the one Spock makes with the one raised eyebrow.
It's not just colors. I wasted a morning messing around with cowsay
managers dont care as long as there is a terminal window open lol
I have to admit, cowsay is pretty funny.
15:38
ill just tell em im running the tests..
Parse rspec --color and ouput to cowsay?
Yeah I mean, if you're on OSX and not using iTerm2, you absolutely should be
awesome feature of iterm 2 for rails.
in rails logs, hold down CMD and you can navigate links..
16:16
which one do you guys think is the better design?

class Page
  def initialize(pool)
    @pool = pool
  end

  def goto_dashboard
    pool.do_something
  end
end


class Page
  def goto_dashboard(pool)
    pool.do_something
  end
end
i guess this is the OO vs FF paradigm
Is pool an attribute of Page?
Couldn't you just call pool.do_something?
I mean, logically... does every page have a pool, and that pool can be different for different pages?
yea every page has a pool
my question is more general.. when should you pass something to a method and when should you have it in the initializer
in FF its easy.. always pass it to the function
My question is one way to decide. If pool is an attribute of page, then give it to the ctor. If it's not an attribute of page, but just an object that page sometimes works with, then pass it into the method that needs it.
("ctor" is C++-speak for "constructor", which is what the #initialize method is)
16:23
do all the method in the class have to interact with whatever you pass to the constructor ?
i guess thats what cohesion is about
@Nima No, but that's another way to decide.
@WayneConrad thanks.....I was about to google that
@WayneConrad thank you
Apparently the abbreviation "ctor" has escaped C++ and is now in general use for OOP languages.
In class-based object-oriented programming, a constructor (abbreviation: ctor) in a class is a special type of subroutine called to create an object. It prepares the new object for use, often accepting arguments that the constructor uses to set required member variables. A constructor resembles an instance method, but it differs from a method in that it has no explicit return type, it is not implicitly inherited and it usually has different rules for scope modifiers. Constructors often have the same name as the declaring class. They have the task of initializing the object's data members and of...
16:49
I've never heard that before
I learned the term from the way that C++ constructs names... you'd write a constructor, then single-stepping the generated code would lead you to something with "ctor" in the name.
@WayneConrad No but thank you
@taco Isn't that a good looking taco in that image? Makes me want to use the site even more.
I love a good tortilla. The tortilla makes or breaks the taco. That's a delicious looking taco
17:04
True... hard shell tacos can't hold a candle to fresh, soft, and warm tortillas
My mom makes the best flour and ground corn tortillas
17:17
Yes, that tortilla looks right... it's not one of those awful rubber things you get from the grocery store here.
There is a brand of flour tortilla sold here that is sold uncooked... you give them a few turns in a hot pan and they are delicious. But the pre-cooked tortillas are awful bland things.
@Queen k
I've got a lunch date on the other side of town. Talk to y'all later.
17:43
@WayneConrad Wow, I wouldn't mind trying those. The pre-cooked flour tortillas have some sort of preservative that makes them nasty
this book looks really great! impostershandbook.com
 
1 hour later…
19:00
@Nima I get a 404 on that url
19:25
@taco I've used this brand before, and they're good: uncooked flour tortillas. Most of the grocery stores here in Phoenix carry them.
oh its without www
@thesecretmaster
OK, thanks
or the direct link to it bigmachine.io/imposter
That does look good.
yea
19:39
'132 hand drawn illustrations'. sold
The excerpts--teasers--on the page are wonderful. I think I have to own this book. I know a lot of it, but not all, and I've also forgotten much. If nothing else, it would be good reading to prepare for a job interview, to remind me of the proper terms for things that I know but no longer remember the name of.
Aaaaaand there goes 30 clams.
lol
i am gonna buy it as well
What is the use of rubys .pack and .unpack methods?
That's for use with file encodings isn't it?
19:49
They are most commonly used for creating or using binary data.
@Marc-Andre I saw that, but I'm just wondering why you would ever need it.
I had to use it a bunch recently - I was reading in a file and reading the headers were all packed integers and whatnot
I don't remember the details, I rambled here about it a bit. It was months ago
Oh, ok. Makes sense now.
20:26
Usually you need pack/unpack when working directly with a binary protocol or file.
The drawings in this book are great. I love 'em.
Recommend that book for someone currently going through uni?
Hmm. I don't know. I didn't go through uni, so I'm sort of who this book is aimed at.
Ah, okay.
I'm actually in the middle of trying to get prior learning experience credits at my university for everything I've learned on my own at work
I think you'll want to ask someone who's read the book and gone through uni. I'll let you know what I think of it when I've read more. I like it so far--it might be a good way to introduce yourself to a topic that the uni is about to teach you.
The first chapter is on Linux. This is something I think I know well, so it'll be fun to see where the holes are in my knowledge.
There was a ruby book I've seen you recommend here a couple of times, I don't suppose you'd know what that was off hand. I seem to remember something about it being a must read
20:32
Uhhhhhh. There are a few like that. Do you remember anything about it?
Oh man, uhhh. Something about the intricacies of ruby maybe? I really have no idea
Oh well, I'm sure it'll come up again
@cereal It may be one of these: Metaprogramming Ruby. Programming Ruby. Confident Ruby. Practical Object Oriented Design in Ruby. 99 Bottles of Oop. Refactoring Ruby. Ruby Best Practices.
4
99 bottles of oop sounds fun
I'll look these all up, thanks
Meta Programming?
99 bottles of OOP is awesome. Sandi just released another chapter of it. There's one more chapter to go, then it's done.
20:42
@WayneConrad Err, yeah that
I've seen you recommend Metaprogramming Ruby a few times
It's a good book. I recommend reading it, then writing one or two hobby projects before going back to professional coding. Because: You'll abuse the meta for the next program or two before you settle back down to writing code that people can actually understand.
If you're like me, that is.
I'll wait for 99 bottles of oop to actually be out - I bought an in progress book for js once, and kept losing the link for it ._.
hm, I need to find my ereader for confident ruby
20:59
Confident Ruby introduced some very good changes in my Ruby style. That book was a big one for me.
Looks like I've already bought confident ruby - My memory is just terrible apparently
I bought it twice before I noticed, grumble
Ouch. Maybe they'll refund you for one of them.
I just found this line of code I wrote some time ago, which made me smile because of how much it makes Ruby look like Perl: @progress = ->(_) {}
I sent off an email, but I doubt it. Once you get the zip, you already have the zip, right?
Curse my distracted mind
21:11
I would think/hope they have a record of you buying the same thing twice. Or maybe you have an old email confirmation/receipt.
Yeah, couldn't find the receipt in my email
21:57
@thesecretmaster I found a use of String#unpack in one of my programs:
    def ipv6_dual_stack?
      v6only = @socket.getsockopt(Socket::IPPROTO_IPV6,
                                  Socket::IPV6_V6ONLY).unpack('i')
      v6only == [0]
    end
The getsockopt method returns binary data in the form of a String, with every character of the string representing one byte of binary data. Here, the data is a single signed integer in binary format; I use unpack to turn that into an array holding a single Ruby integer.
22:28
I found the project I use it in
Not sure it's a very good example of ruby code
header_size = data.read(512).unpack('s>*')[18]
Other fun methods
  private
  def decode_comp_3(str)
    raw_num = str.unpack('H*').first
    sign = raw_num[-1]
    raw_num = raw_num.to_i
    raw_num = raw_num / (10.0 ** @decimal_location) if @decimal_location
    raw_num *= -1 if sign.downcase == 'd'
    raw_num.to_f
  end

  def decode_comp_2(str)
    raw_num = str.unpack('d').first
    raw_num = raw_num.to_i
    raw_num = raw_num / (10.00 ** @decimal_location) if @decimal_location
    raw_num.to_f
  end

  def decode_comp_1(str)
    str.unpack('s>').first
  end
This was a program that took cobol indexed files and translated them into a csv I think
class HeaderParser
  def self.parse(str)
    unpacking_method = str.length.even? ? 's*' : 's>*'
    vals = str.unpack unpacking_method
    Header.new *vals.reject(&:zero?).take(2)
  end
end
22:44
I remember you talking about that project. That was a tough one, if I recall.
22:57
Never finished it. Turns out you can use one section of memory in the file for more than once thing and it ruined everything
For example, you could have
01 SOME_DATA.
  05 NAME PIC X(10).

01 SOME_OTHER_DATA REDEFINES SOME_DATA.
  05 TITLE PIC X(10).
And some_other_data would use the same data as some_data, but only sometimes
It wasn't very clear
That reminds me of C unions, which are sometimes used for varying data within a binary file.
23:29
Given some more time I'm sure I would have worked it out, but my supervisor came back and told me to do it in straight cobol - which was souldraining
Easy, since it can read the files, but still souldraining
I've been playing Oblivion and Skyrim a lot lately, so when you say "souldraining" I imagined Cobol as a boss draining your life with some terrible (but beautifully animated) spell.
I always like to do the quest in Skyrim where you get drunk with a Demon and you have to figure out what you did!
That one is funny.
I played oblivion a lot - not so much skyrim
Good games, though
Starcraft II continues to run my life gaming wise
World of Warcraft is the game that I keep going to.

« first day (957 days earlier)      last day (2298 days later) »