23 Matching Annotations
  1. Jun 2021
    1. Thanks, this was just what I was looking for! This is a perfect appropriate use of instance_eval. I do not understand the nay-sayers. If you already have your array in a variable, then sure, a.reduce(:+) / a.size.to_f is pretty reasonable. But if you want to "in line" find the mean of an array literal or an array that is returned from a function/expression — without duplicating the entire expression ([0,4,8].reduce(:+) / [0,4,8].length.to_f, for example, is abhorrent) or being required to assign to a local, then instance_eval option is a beautiful, elegant, idiomatic solution!!
  2. May 2021
    1. That's what's supported, and is all that is EVER likely to be supported... and even then be DAMNED sure you send multipart with a plaintext copy or a great many mail servers will flat out reject it on the assumption that no legitimate e-mail has any damned business even having HTML in it in the first place!
  3. Apr 2021
    1. However, it can be extremely frustrating placing the tiles. Very commonly there will be no position to place a tile in and it will be put to one side. Perhaps someone new to tile-laying games wouldn't find this so odd, but to anyone with experience of Carcassonne it will seem very limiting. In Carcassonne you can pretty much always place a tile, with several choices of position available. Every player I've introduced this game to has looked at me as if to say, "We must be doing something wrong." But no, that game is designed that way. Sometimes it feels like the map builds itself - there is often only one viable placement, so it starts to feel like a jigsaw, searching for that available position. Surely placing a single tile shouldn't be this difficult!

      I don't think I'd find it frustrating. I think I would enjoy the puzzle part of it.

      But indirectly I see that difficulty in placing tiles impacting my enjoyment: because it means that there are no/few meaningful decisions to be had in terms of where to place your tile (because there's often only 1 place you can put it, and it may sometimes benefit your opponent more than yourself) or which tile to place (because you don't get any choice -- unless you can't play the first one, and then you can play a previously unplayable one or draw blind).

  4. Feb 2021
  5. www.metacritic.com www.metacritic.com
    1. Please, do not buy this. I am really tired of "games" that are given critical praise because its cool to praise or because its political correct to do. I will break up my review in points so its clear why I dislike this "game" : 1) This is not a game. This is a short story, like an interactive book. 2) This game is so short, that I completed it in a 3 hour bus ride. It was boring. 3) Its a story of a girl that have to take the reigns of her life after divorce. WOMAN EMPOWERMENT. Now you know why this game is rated so highly 4) This is a MOBILE GAME. I paid $3 to play on an iphone (after watching a gaming channel give it GOTY contender. Needless to say, I never watched that gaming channel again). I FELT I WAS ROBBED OF TIME AND $3. Imagine how much I hated this game to feel like I was robbed even though it costed me only $3. 5) This game costs $7 on the eshop. You could buy CELESTE for $9 on sale on the Eshop. That is a great game. I recently bought Hollow Knight for $7 on Playstation. This interactive novel should not be sold as a game. Period. It is a waste of time and money.

      Nothing wrong with interactive novels being sold in the same store as games... as long as it's clear what it is (no false advertising).

      Somewhat agree with some of the other points...

    1. with ActiveForm-Rails, validations is the responsability of the form and not of the models. There is no need to synchronize errors from the form to the models and vice versa.

      But if you intend to save to a model after the form validates, then you can't escape the models' validations:

      either you check that the models pass their own validations ahead of time (like I want to do, and I think @mattheworiordan was wanting to do), or you have to accept that one of the following outcomes is possible/inevitable if the models' own validations fail:

      1. if you use object.save then it may silently fail to save
      2. if you use object.save then it will fail to save and raise an error

      Are either of those outcomes acceptable to you? To me, they seem not to be. Hence we must also check for / handle the models' validations. Hence we need a way to aggregate errors from both the form object (context-specific validations) and from the models (unconditional/invariant validations that should always be checked by the model), and present them to the user.

      What do you guys find to be the best way to accomplish that?

      I am interested to know what best practices you use / still use today after all these years. I keep finding myself running into this same problem/need, which is how I ended up looking for what the current options are for form objects today...

    1. Popup - You don't need to deal with these messages right away, yet at some point you will need to take action since these won't go away until explicitly say say you don't want them around anymore.
  6. Jan 2021
    1. However, one of the drawbacks of this property is that the line intersects descenders of the characters.

      I think it actually looks great/better because it intersects descenders of the characters.

  7. Nov 2020
    1. This definition is actually a strict subset of the first definition: as the same script must (by definition) run inside both a server/Node.js context, but also a browser DOM context
    1. Text links are a very simple button type.

      Eh? I didn't know links were considered buttons. I'm not sure I totally agree understand, but it's not outrageous either...

      Update: Okay, I guess when you put an outline around it (like they directly below this paragraph), and even more if you put an icon with it (like they did further down; https://hyp.is/DZTZzi6fEeuu65uvQJ9W1Q/uxdesign.cc/ui-cheat-sheets-buttons-7329ed9d6112), the link looks like more like a button.

      But (and I think this is their point) it is what it is because of how it's used and not how it's styled: it should be the same thing (a button) whether or not it has an outline.

  8. Oct 2020
    1. Please don't copy answers to multiple questions; this is the same as your answer to a similar question

      Why on earth not? There's nothing wrong with reusing the same answer if it can work for multiple questions. That's called being efficient. It would be stupid to write a new answer from scratch when you already have one that can work very well and fits the question very well.

    1. Without elegant ways of expressing loops/iterators (like angular does with directives), the primary way to keep JSX readable thus becomes copying and pasting.

      I'm not quite sure I understand this (so until I do, I'm not sure I agree)...

      Why does he think copying and pasting is the only way to make it readable? Like he pointed out, you can extract JSX snippets and use loops within JSX. But maybe he means (his previous point), that people often don't do that. Hmm. 

  9. Jul 2020
  10. Jun 2020
    1. This means you no longer have to declare inverse_of on two associations which have good names.

      ... which have good names.

      This implies that those names where the inverse_of cannot automatically be inferred are bad names. I disagree that a "good name" is at all related/dependent on that ability.

      What they should say here instead is:

      ... which have names that allow the relationship to be easily inferred.

      Or refer to these names as the "default" or "Rails conventional" names for these associations.

      But it is not necessarily a better name. A better name is, quite often, one that is more descriptive and specific.

      For example, just because by default if you use rails generate with a User model, it might (I don't remember; can it even generate associations?) create a belongs_to :user association doesn't mean that's the best name for it. belongs_to :author or belongs_to :owner, for example, being more specific, are likely better names. The model still needs a generic name like User because it may be used in various relationships, but the relationships themselves should pretty much never be called user because there's almost always a more specific name that better reveals/describes the relationship.

    1. I know you acknowledged your response was late and you're just trying to help but please don't resurrect very old threads.

      This is better than creating a duplicate new thread.

      There is no better place to respond to an existing topic than in the existing thread for that topic.

    1. This is a poor solution

      What's so bad about this solution? If it works, it works. And it only requires wrapping in 1 additional block. Pretty simple.

  11. May 2020
    1. A real-world example of this would be an e-commerce site that allows users to “hold” items in their cart while they’re using the site or for the duration of a session. In this scenario, the technical cookies are both necessary for the functioning of the purchasing service and are explicitly requested by the user when they indicate that they would like to add the item to the cart. Do note, however, that these session-based technical cookies are not tracking cookies.

      I'm not sure I agree with this:

      [the technical cookies] are explicitly requested by the user when they indicate that they would like to add the item to the cart.

      The only thing they requested was that the item be held in a cart for them. They didn't explicitly request that cookies be used to store information about items in the cart. They most likely don't understand all of the options for how to store data like this, and certainly wouldn't know or expect specifically that cookies be used for this.

      In fact, localStorage could be used instead. If it's a single-page app, then even that would be necessary; it could all be kept in page-local variables until they checked out (all on the same page); such that reloading the page would cause the cart data held in those variables to be lost.

    1. Motion Picture Association of America Chairman Chris Dodd stated that the coordinated shutdown was "an abuse of power given the freedoms these companies enjoy in the marketplace today."

      It's not an abuse of power. It's free speech. It's protesting against an awful proposed law.

  12. Mar 2020
    1. Instead of re-opening Ruby classes like that (I get involuntary twitches), for our little exercise we are going to invent another name

      IMHO, re-opening classes is okay. Certainly better than duplicating an entire core Ruby class and giving it a silly, less-meaningful name. (Though I'm not sure he actually intended people to use Lax instead of Lazy. I think he was just showing how easy it is to implement Lazy from scratch in Ruby.)