42 Matching Annotations
  1. Last 7 days
    1. In a large code base, this will result in moving imports randomly around until stuff just happens to work. Which is often only temporary, as a small refactoring or change in import statements in the future can subtly adjust the module loading order, reintroducing the problem.
  2. Oct 2020
    1. Looks like the problem is that debounce defaults to waiting for 0 ms ... which is completely useless!

      It would be (and is) way to easy to omit the 2nd parameter to https://lodash.com/docs/4.17.15#debounce.

      Why is that an optional param with a default value?? It should be required!

      There must be some application where a delay of 0 is useless. https://www.geeksforgeeks.org/lodash-_-debounce-method/ alludes to / implies there may be a use:

      When the wait time is 0 and the leading option is false, then the func call is deferred until to the next tick.

      But I don't know what that use case is. For the use case / application of debouncing user input (where each character of input is delayed by at least 10 ms -- probably > 100 ms -- a delay of 0 seems utterly useless.

    2. It looks like you accidentally passed resolve() (immediately invoking the function) directly to setTimeout rather than passing a function to invoke it. So it was being resolved immediately instead of after a 1000 ms delay as intended.

      I guess this is the "immediately invoked function" problem.

      Not to be confused with: immediately invoked function expression. (Since it is a regular named function and not a function expression.)

    3. You should not create a new debounce function on every render with: return new Promise(resolve => { debounce(() => resolve(this.getIsNameUnique(name)), 2000); }); Instead you should just wrap your whole function isNameUnique with the debounce (see my sandbox). By creating a new debounce function on every hit, it cannot 'remember' that is was called or that is will be called again. This will prevent the debouncing.
    1. _.debounce creates a function that debounces the function that's passed into it. What your s.search function is doing is calling _.debounce all over again every time s.search is called. This creates a whole new function every time, so there's nothing to debounce.
    2. I run s.search() by typing into an input box, and if I type gibberish very quickly, the console prints out "making search request" on every key press, so many times per second -- indicating that it hasn't been debounced at all.
    3. they're not invoking the function that _.debounce returns
    1. When using React hooks there is no concept of onMount because the idea of only running some code on mount leads to writing non-resilient components, components that do one thing when they mount, and then don’t take prop changes into account.
  3. Sep 2020
    1. Just throwing in <div class="{$$props.class || ''} otherChildClass"></div> seems the easiest, and it'll avoid undefined classes. I feel like many aren't noticing the undefined values getting inserted in their classes.
  4. Aug 2020
    1. my point is that using "into" in such a case is just as incorrect as using "inas" would be. The fact that people make mistakes doesn't change this.

      "Log in" is the only correct way to spell the verb, and the only way to be consistent with 1000s of other phrasal verbs that are spelled with a space in them.

      We don't need nor want an exception to the general rule just for "login" just because so many people have made that mistake.

  5. Jul 2020
  6. May 2020
    1. except, as anticipated a little earlier, any custom services

      This seems like it might not be the correct way to use "anticipated". Seems like it is meaning "as mentioned earlier". Certainly an uncommon usage, anyway.

  7. Apr 2020
    1. Remember to call super in any subclasses that override teardown.

      And yet the Rails core chose not to use RSpec, citing how it would be too easy to write subject == expected on accident?

    1. ∈Ck

      this sum was over all points in the training set in the previous step, and now it's over all points ?

      Just think of the case where the partition C_i is made up of singletons, one for each possible point. Then, the robustness would be zero, but the generalizatoin error bound doesn't seem right then.

      This made me suspect there may be something wrong, and I think it could be at this step. If we kept the sum to be over training sets, now we can;t upper bound the result by the max in the next two lines, I think!

  8. Feb 2020
    1. assume that the average class in a district has 252525 students

      Assume that average student-to-teacher ratio in a district is 25 students. In regression model our dependent variable is student to teacher ratio not the size of the class. That's why, when we want to make a prediction we should take correct value for our explanatory variable.

      P.S. what is written would be correct if every class has one and only one teacher.

  9. Jan 2020
    1. Please do not make the mistake of trying to reduce the HAVING clause with a little false relational algebra to: 1 HAVING COUNT(PS1.plane_name) = COUNT(H1.plane_name) because it does not work; it will tell you that the hangar has (n) planes in it and the pilot_name is certified for (n) planes, but not that those two sets of planes are equal to each other.
    1. Anti-Features

      I don't think this is what Anti-Features means. Here he's listing things that this tool lacks, some of them being good things, like the "Does not require updating every time a new Ruby version comes out". That's a feature, not an anti-feature!

      Check out how F-Droid uses the term. Anti-feature means things that are present that aren't wanted. Undesirable "features" that are present.

  10. Nov 2019
    1. Because they're more integrated and try to serialize an incomplete system (e.g. one with some kind of side effects: from browser/library/runtime versions to environment to database/API changes), they will tend to have high false-negatives (failing test for which the production code is actually fine and the test just needs to be changed). False negatives quickly erode the team's trust in a test to actually find bugs and instead come to be seen as a chore on a checklist they need to satisfy before they can move on to the next thing.
  11. May 2019
    1. If we’re speaking of garden-variety errors, the most common error I’ve observed that manages to get past any number of sets of expert eyes and wind up printed in books is the use of “lead” where “led” is meant—that is, the past tense of the verb “to lead.”
    2. They mistake the apostrophe for a piece of punctuation when it is a spelling issue. 
  12. Oct 2018
  13. Mar 2018
  14. Feb 2018
  15. Jul 2017
    1. Over the period in which the US has reduced public funding per student, the pattern has entrenched itself. It’s too early in Great Britain’s experiment with tuition-based university funding to see the divergence - but under the current model it will happen. The real difference between the US and British systems is that Great Britain can still easily fix its higher education mistake.

      So, no way out for the US at this point...

  16. May 2016
    1. 12All power and its use is but so much recognition and understanding of the use of My Will.Your will and all your powers are only phases of My Will, which I supply to suit your capacityto use it.Were I to entrust you with the full power of My Will, before you know how consciously to useit, it would annihilate your body utterly.To test your strength and more often to show you what the misuse of My Power does to you, I attimes allow you to commit a sin, so-called, or to make a mistake. I even permit you to becomeinflated with the sense of My Presence within you, when It manifests as a consciousness of MyPower, My Intelligence, My Love; and I let you take these and use them for your own personalpurposes. But not for long -- for, not being strong enough to control them, they soon take the bitin their teeth, run away with you, throw you down in the mire, and disappear from yourconsciousness for the time being.

      "All power and its use is but so much recognition and understanding of the use of My Will.Your will and all your powers are only phases of My Will, which I supply to suit your capacity to use it."

      "Were I to entrust you with the full power of My Will, before you know how consciously to use it, it would annihilate your body utterly."

      I need to surrender fully and consciously Be the Impersonal Self so as Gods Love, the power of God can flow through this vessel unimpeded.........

      So called sins and mistakes are only my learning, fashioning to build true strength in this body mind so as to allow the the power and Love of God to flow through matter.....

      There is only the Will of God..