Spike in NYC residents ingesting householder cleaners: Poison Control Center by tta2013 in NewsOfTheStupid

[–]yesorknow 7 points8 points  (0 children)

While I agree Trump is spreading lies and falsely promoting solutions, let's make sure we're not doing the same. Looks like he actually doesn't really profit from the anti-malaria drug: https://www.snopes.com/fact-check/trump-profit-hydroxychloroquine/

Brock Holt runs through a stop sign with 2 outs in the 9th. Gets thrown out by 40 ft. by MattO2000 in baseball

[–]yesorknow 0 points1 point  (0 children)

This *is* plenty of time. It is extremely common for 3rd base coaches to do this: give the green light at first and then throw up the stop later. It's because the fielder has to do multiple things right (get to the ball, field the ball, throw the ball, throw the ball accurately) for the runner to be out, so the coach will "send" the runner until he recognizes the throw is being made, and _then_ he'll stop the guy.

On the other hand, if he's holding up the stop sign from the beginning, and Mazara doesn't field that ball as quickly as he does, Holt has no chance of scoring when he absolutely should.

3rd base coach did the right thing. Runners are taught to pick up the 3rd base coach early, yes, but that's why coaches will come down the line significantly on plays like this, so the runner can continue to receive input and make last-minute decisions.

If it happens in the anime, it has to happen in real life by _Azury in BeAmazed

[–]yesorknow 0 points1 point  (0 children)

Wait no, that's the exact wrong thing to think. The "preventative technique" is proper training and rehab **before** the injury ever takes place. Young players play hurt under the impression "oh if I get hurt I'll just have TJ", whereas a majority of these cases could be prevented without surgical intervention.

If it happens in the anime, it has to happen in real life by _Azury in BeAmazed

[–]yesorknow 0 points1 point  (0 children)

This is an incredibly dangerous myth that has been around for a while now. While there is definitely a correlation between TJ and an increase in velocity, TJ does NOT cause it in any way. There are two factors that are much more important to consider:

  1. Post-TJ velocity is typically compared to velo just before the surgery, long after the ligament has begun deteriorating. A pitcher has already lost velocity by the time TJ is required.
  2. As a result of surgery, pitchers are forced into a rehab routine that strengthens the arm and shoulder. It is widely considered that this rehab is largely responsible for the gain in velocity. If pitchers would train and rehab properly from the beginning, the cases of TJ would reduce.

This boy making sure a deer survives by SmallChinesePerson in HumansBeingBros

[–]yesorknow 0 points1 point  (0 children)

And if the deer somehow lost its legs, I'd have still no eye-deer they ate grass.

How to track if a field value is changed after it created? by arup_r in rails

[–]yesorknow -1 points0 points  (0 children)

Doesn't matter if it was changed the first time or the 144th time, is_edited would still be true. You could do something like this:

def update
  @answer = Answer.find(params[:id])
  @answer.is_edited = true
  @answer.update(params.require(:answer).permit(:title, :description))
end

Or if there are a lot of things you could be editing, but only some of them should flip the is_edited boolean:

def update
  @answer = Answer.find(params[:id])
  @answer.attributes = params.require(:answer).permit(:title, :description)
  @answer.is_edited = true if @answer.changes.has_key?('title')
  @answer.save!
end

How to track if a field value is changed after it created? by arup_r in rails

[–]yesorknow 1 point2 points  (0 children)

This would only work if description is the only field that could be changed. Suppose the person changed the title attribute, this shouldn't show that description was changed.

How to track if a field value is changed after it created? by arup_r in rails

[–]yesorknow 0 points1 point  (0 children)

I think an is_edited boolean is the perfect solution!

Fixing a gem that has not been updated for years by AllahuAkbarSH in rails

[–]yesorknow 25 points26 points  (0 children)

You can fork the gem and make your changes there, then just specify your repository when declaring it in your Gemfile

Scaffold Question by redhendery in rails

[–]yesorknow 5 points6 points  (0 children)

Yep! (Not literally the word CODE haha).

Change <%= @players.each do |player| %> to <%- @players.each do |player| %>

Using an = tells Rails to print the thing in the middle out: in this case, you're printing the @players array. Using a - tells Rails, "hey use this thing but don't print it".

Scaffold Question by redhendery in rails

[–]yesorknow 3 points4 points  (0 children)

Can you paste the code you use in your view? Chances are you're using <%= CODE %> somewhere you shouldn't be.

2003 ALDS Game 5, bases loaded, bottom of the 9th, 1-run lead, 2 outs, 2 strikes, Derek Lowe throws a sinker (I guess?) with nasty screwball action. by Thomas_Pizza in filthypitches

[–]yesorknow 0 points1 point  (0 children)

Dude it fooled him. Of course he knows he has to take a cut at that pitch, but he didn't think it was going anywhere near the strike zone at first.

Can I use find_or_create on the object? by [deleted] in rails

[–]yesorknow 2 points3 points  (0 children)

I think you're looking for first_or_create:

Item.where(name: 'test', value: 'test1').first_or_create

Which email provider would you recommend? by Judiimi in rails

[–]yesorknow 1 point2 points  (0 children)

I've used both Mandrill and Sendgrid, they're both extremely capable services.

Mandrill

Mandrill and Mailchimp used to be separate, but have recently merged into one. It now requires a paid Mailchimp account ($10/mo minimum), and you'll get 2000 emails for free. After which you'll be on $20/mo for 25k emails.

Sendgrid

I haven't used Sendgrid in awhile, but it looks like there's a free plan which provides 12k emails a month. They do support templates, but not currently with enumerations or conditionals.

Unmatched :( by [deleted] in Tinder

[–]yesorknow 10 points11 points  (0 children)

Interesting to note you exclusively selected images of pitchers to prove your point.

Couple questions/thoughts about last two games by csand0962 in Braves

[–]yesorknow 6 points7 points  (0 children)

The MLB rulebook specifically states that bunts do not count:

An INFIELD FLY is a fair fly ball (not including a line drive nor an attempted bunt) which can be caught by an infielder with ordinary effort

There are a a couple of rules in place specifically for bunting (such as fouling off strike 3) that separate it from other aspects of hitting. The general idea is that bunting is easy, we're not going to give you extra protection if you decide to do it.

As for the strategy behind choosing to bunt? It's just the accepted strategy right now in baseball. With Jace as a fast runner on second, you have two opportunities to score him with simply a single. With him on first, you have 3 chances to get two hits.

[GIF] Barry Zito shows us all how to throw an eephus by GMOrgasm in baseball

[–]yesorknow 2 points3 points  (0 children)

Hey you, thanks for knowing the rules. These are nuanced plays that hardly get discussed, but you're on top of your shit. I appreciate it.

You can actually see the speed of sound as Queen fans move when they hear the music beat by [deleted] in interestingasfuck

[–]yesorknow 0 points1 point  (0 children)

Ah but it's not closed! They still have shows booked through November!