« first day (959 days earlier)      last day (2296 days later) » 

00:19
There is only one time that I will use actual code in interpolation is if I have a string that I want printed if some condition
I'd probably do p 'whatever' if thing
Anonymous
00:45
Hi everyone
Anonymous
Today I finished direct messaging in my slack clone, and started user auth/accounts
Anonymous
I will work on it more tomorrow in my free time
@Cereal What if you need a conditional in a string, e.g. "The thing does#{" not" unless thing.works} work"
@thesecretmaster I'd just put one print whereever it broke
I don't usually debug with output for working things
I'm not sure, I've never run into a situation where I've ever wanted to do that.
Anonymous
When I debug, I do puts "STEVENS - " something
Anonymous
00:50
then in another window I do: tail -f log/development.log | grep --line-buffered "STEVENS"
@Cereal I think I've actually used that syntax maybe two times ever and only for debugging, so generally I agree that there should be no code there, but there are a few cases where it makes sense.
Anonymous
@WayneConrad Misread "other" as "otter"
user4710450
02:31
Hi, anybody here?
user4710450
Could you please take a look at this question? stackoverflow.com/questions/39157434/…
 
1 hour later…
10:23
Hi @Ehsan! It looks like that question was deleted by it's author. Do you still need help with anything?
11:53
good morning, fine people
12:40
morning all!
@Marc-Andre mornin'
Any Friday rituals in here?
The JS room has one, but I don't want to take it to here
Actually...
13:03
thanks; so, I guess the Friday song isn't a tradition in here
It isn't. And don't you dare to bring it in ;-)
mind couldn't process a negative :p
I've never really heard that song so it can't get stuck in my head.
Good morning!
13:21
Wassup homeslices
mornin' thesecretmaster Jared
13:49
A fairly lengthy but 'fun' read about Objects/Functions in Ruby Rubinus takes the fun out of Ruby
@onebree Good morning, otters and others
@Queen k
> It’s fairly well known that every Rails application contains a poorly-specified, buggy, slow implementation of most of the Fibonacci function, which explains the prevalence of benchmarks comparing fib() performance.
Haha!
14:40
Today is new bike day, after about a year of planning and research
Barely able to sit still
Actually, checking that number, it's more like two years :p
@meagar Outstanding! There will be pictures?
A friday and new bike day ! This will be a great day for you :D
So many pictures
I've shifted gears from excited to outraged though. How do people keep giving money to crowd-funding scams?
Indigogo is willfully supporting scams at this point. You'd think they would have some conscience and warn people that this product is impossible
But no, non-tech-savvy people stumble across this thing, believe it's going to be this amazing thing, and throw $300 at it
All of its ridiculous claims aside, I feel like I shouldn't have to point out that a non-resizable ring that helps you lose weight is a terrible idea. Your ring size changes roughly every 10 lbs of weight you gain or lose.
$300 on a device that you can only wear while you're +/-10lbs of your current weight seems like a horrible investment.
Anyways. Good morning Rubyists.
14:54
But like most ring, you can resize it even if it should be non-resizable right ? /s
15:07
golfing pro-tip: you can often save a pair of parentheses if you use % instead of ;
hi all
@WayneConrad what are your thoughts on the imposter book btw?
is it worth the purchase?
@JanDvorak I'm not sure I follow
You mean when packing multiple statements onto a single line?
I mean, after a string
cond&&(foo;bar) => cond&&foo%bar
... Is that Ruby?
15:23
what is this?
cond&&(foo;bar)
actually, this example would only work if foo returns a string
you mean:
cond && (foo;bar)
irb(main):039:0> true&&""%puts

=> ""
irb(main):040:0> false&&""%puts
=> false
irb(main):041:0> false&&"";puts

=> nil
@Nima same thing
I have when /.../ then (rename $1, $2; puts "ok"). I've realised I could instead do puts "ok" % rename($1, %2)
Your golf-fu is strong
:-D
It was funnier with the typo ;-)
Is the second option less readable than the first?
 
1 hour later…
16:32
Got that old computer to boot, but DIMM_A1 doesn't seem to work
Thoguht it was because the cooler was pushing on the stick, but I removed the plastic aesthetics off it and same thing
@Nima Yes. It's a very good and somewhat dense overview of many important topics that the self-taught programmer may have missed out on. It's a crash course, and like all crash courses, many of the topics are going to really be starting points for your own google searches/reading/etc., but it's excellent.
@WayneConrad thanks!
@meagar That's... inconceivable
The only thing that ring measures automatically is gullibility.
17:10
def speak
   assert_not lurker?
end
Greeting folks
@JudahMeek :) Hello, welcome. Pull up a chair and make yourself comfortable.
Well, I've already got the chair part covered. Working on the comfortable. :3
@Queen k
@JudahMeek I'm glad you've come. How long have you been using Ruby?
About 9 months. :S Mainly focused on Rails & web development. Still got a lot of things to learn. Joined here because the rubyonrails-link slack group only seems to have one active expert.
17:24
Hopefully we can help. If nothing else, you can describe your problem and one of can say "quack" from time to time. :)
No major issues atm. Just working on translating some minitests into rspec examples, which at the moment means figuring out how to take an integration minitest and split it up into a rspec request example and a capybara feature example.
I'll be not_lurking for a while to get a sense of the community here. Like I said, rubyonrails.link only seems to have one active expert wink, wink. nudge, nudge, and while he's a great guy (and I have no idea how he responds as quickly as he does), he doesn't know everything.
Lots of other professionals there, but they don't seem to assist much, just ask questions.
The amount of expertise here varies depending upon who's here. I know Ruby very well, and ActiveRecord some, but only a little Rails.
I'm impressed that you're going from minitest to respec and Capybara in one leap. That'a a lot of "new" at once.
17:40
Class.new.new
Today I have used foo.each{|h| send *h}. Is it bad?
Well, I haven't done any capybara yet since there hasn't been the need for it yet. In fact, I'm working to determine whether exactly when capybara is necessary as opposed to a simple view spec.
I think the hardest lesson to learn as a newb is when a gem/plugin/library is truly necessary.
@JanDvorak Yes. No. Maybe. I know you wouldn't assign data from a POST request to foo and do that, so it's probably not bad. But it is interesting. What are you doing there?
@JudahMeek You may be right. The ecosystem is big and confusing at first.
My idea of storing the state of my application is to log its RNG seed and the sequence of commands that has been used. The log is expected to be 1 MB uncompressed and highly compressible.
Its runtime memory footprint sans the log is about the same size as the log.
...[:pop,[]],[:pop,[]],[:pop,[]],[:pop,[]],...
(gzipped, ofc)
@JanDvorak That's one of the patterns in the GoF book, I think.
I don't see anything awful in what you're doing, but I'm a sucker for clever tricks :)
@JudahMeek What are your first impressions of rspec vs minitest? Which do you like better so far?
18:16
Minitest is much simpler while Rspec forces better separation of concerns.
With Rspec, there are certain tests that you can only do with certain spec types. Minitest doesn't have any limitations like that.
I think I see what you are saying. You are testing a Rails project, and with Rails, rspec is sort of specialized for each type of component (model, controller, etc.).
(I use rspec for non-Rails projects whether there's no such customization of rspec, so I was having trouble figuring out what you mean)
Hmmm... You know, I would have to track down some examples to make sure I'm actually right on that.

It might only be variable scope that's particular to various spec types, which I think minitest does as well (but explicitly through the test inheriting from whatever model/controller you're testing).
Right now, I'm trying to figure out if an rspec-rails request spec is that same as a minitest integration test (which inherits from ActionDispatch::IntegrationTest). I had thought that they weren't due to issues like the integration test combining what looks like expectations for views as well as expectations for models, but looking at relishapp.com/rspec/rspec-rails/v/3-5/docs/request-specs/…, it would seem that request specs can do the same thing.
Here's the specific integration test example I'm working on:
test "following page" do
get following_user_path(@user)
assert_not @user.following.empty?
assert_match @user.following.count.to_s, response.body
@user.following.each do |user|
assert_select "a[href=?]", user_path(user)
end
end
/me sighs
I'm obviously going to have to work on my fixed font skillz
18:35
I think you can only fixed font an entire post... the markup is a little weak in chat.
I did that, but because what I pasted had tabs, the indentation was off and I broke things trying to fix that. xD
@JudahMeek You don't use 2 spaces for Ruby indentation ?
I do, but I didn't write the minitest examples. I'm just translating them into specs.
19:05
seriously, stackoverflow has to fix code formatting in chat
slack does this really well, i dont know why in the chatrooms the code formatting is so ugly
Because the chat it's not a service important for them ?
it seems like a trivial fix
but then again everything seems trivial in programming until you actually do it.. lol
Ahahah yeah and this is time that will not be spent on something else that may be more important (relative to them)
What do you mean?
both of you
Well what I meant is : Stakc Overflow doesn't consider chat important enough to give it more love.
19:13
I think Marc is talking about the opportunity cost of working on chat--that it keeps them from working on other things that may be of more importance to the generation of revenue.
Yeah and it's really not important enough. For them, I feel like it's "worse" than comment. Let me find a quote about that... I sure remember an employee said something about that.
I still have no idea what you mean about "broken code formatting"
learn to format properly
the only thing that needs fixed is the help
I guess having code syntax highlight in chat or something similar
There's a userscript for that
I'd like block code markup to be mixable with non-code:

here is some code, as far as markdown is concerned
but not as far a chat is concerned.
19:18
true - but you can still send it as multiple messages in a single monologue
userscript is fine, but I think direct support would be better.
There are indeed workarounds for most of the things I perceive as deficiencies. That doesn't magically make them into non-deficiencies.
Chat bots have been a thing since the days of IRC
How do chat bots figure into it?
What language should code be highlighted in?
Bots know, chat doesn't
19:22
We could use the same thing as on the main site <--! language !-->
Or could be a setting of the room.
Make a FR
@JanDvorak you clearly haven't seen the code formatting on slack channels. it does better indentation, with a subtle background color to make it easier to read
I'm surprised there is no FR for this
"subtle background color" is easy to fix with a userstyle
19:29
Oh, Feature Request. YKAYA (You Kids And Your Acronyms)!
@JanDvorak the thing is stackoverflow already does this pretty well in questions
i dont know why in the chat it looks awful
feel free to suggest a background.
@Nima POB
POB?
lol
Yep. So please stop using strong words as if your opinions were anything more than that.
@JanDvorak You seem rather defensive about SO chat. Why is that?
19:33
which strong word are you referring to exactly? also i am free to express my opinion
"awful"
Please let me remind the room to keep things civil. Discuss the ideas, not the people.
I don't like opinions presented as facts
You don't get to decide how other people talk, provided they are being civil and respectful.
Was this respectful though?
19:37
Yes :)
how is "is awful" respectful?
I just assume most statements by people implicitly have "imho" appended.
3
Also, I read your smiley as meaning that I should have known this. I wouldn't have asked if I did.
I suck at human conversation. Can you help me?
No, that's not what it meant. I was just an attempt to dial down the intensity of the conversation.
apologies then
19:40
I apologize for my own poor ability to communicate.
Back to topic - I don't think it's respectful to call something awful if it isn't
Back to sub-topic: What does POB stand for ?
The term "awful" is completely subjective, however.
@Marc-Andre primarily opinion based
Therefore, any use of the term "awful" should be considered to be an opinion.
19:42
One of the five top-level close reasons on SE
Oh thanks ! My google search was not showing good result!
Yes. Thanks for explaining that. Google wasn't helping me either. :)
... oh. I may have misread Nima's question, too
But then again, his laugh tells me it wasn't meant as a clarification request
Back to the original topic: I'd say it's quite common to modify sites with userscripts and userstyles. The SE chat is no exception.
But before that, let me apologise for the original drama. I should have read that as an opinion.
It's all good.
@JanDvorak Which is great and one of the thing I like about the web. But at work, I would like to keep my browser environment as vanilla as possible. So if chat would have better support for code, I would be really happy. But I'll probably do a feature request!
19:53
Why vanilla?
Another thing would be if you were forced to use a specific configuration, but that's bad for multiple reasons
The ability to mix code with non-code might be nice indeed.
I prefer it that way. Less trouble for me and I like to keep home separated from work. It does take effort to setup something like this, so I don't want to double it. But as I said, this is my problem and I'll do a feature request but I don't really hope anything out of it!
Yet another issue is the poor userscript support on mobile browsers, but I try to never use my cellphone for web browsing
But just out-of-curiosity what are you using for chat (userscript) speaking ?
SO time lines, from the SE tavern productions (but I don't really care about those), and my own script to colorize the chat by user
The color thing by user is an interesting idea!
 
2 hours later…
21:48
So today I started using rubocop, and it told be to use to_s instead of self.to_s when getting the name of the current class as a string. I feel like self.to_s is more readable, but I just wanted to get some opinions.
I agree with Robocop in this case. Avoid redundant uses of explicit self receivers.
There are a few times where you need explicit self. -- such as when calling your own class's assignment method:
class Foo
  attr_writer :bar
  def baz
    bar = 123           # assigns to local variable bar
    self.bar = 123      # calls bar=, which assigns to @bar
  end
end
Yeah, I understand that it's unnecessary, but it looks a little strange to me to see to_s not appended to anything. But if you think that it is still readable, I'll do that.
def new class; class.new; end
^ breaks inside classes
Sometimes I also call new without an explicit receiver; typically in factory methods.
class Foo
  def self.create
    new(...)
  end
end
@JanDvorak Doesn't that break anywhere? Because class is a reserved word...
oops, sorry
21:58
@thesecretmaster Yes, I think it's very readable.

« first day (959 days earlier)      last day (2296 days later) »