43 Matching Annotations
  1. Jul 2022
    1. the := operator is a shortcut for declaring and initializing a variable in one line (Go uses the value on the right to determine the variable's type). Taking the long way, you might have written this as: var message string message = fmt.Sprintf("Hi, %v. Welcome!", name)

      declare and initialize a vairable in one line. 声明和初始化一个变量

  2. Apr 2022
    1. You can close the single quotes before starting the double quotes and do the reverse at the end of that inner section to achieve what you want:

      This is how to use variable in single quotes. It works well also for tcsh.

  3. Feb 2022
    1. To manage a variable-size stack frame, x86-64 code uses register %rbp to serveas a frame pointer

      frame pointer 什么情况下会使用?

    2. At times, however, local data mustbe stored in memory. Common cases of this include these:.There are not enough registers to hold all of the local data..The address operator ‘&’ is applied to a local variable, and hence we must beable to generate an address for it..Some of the local variables are arrays or structures and hence must be accessedby array or structure references.

      什么时候 local data 必须要被存放在 memory 里面?

  4. Jan 2022
    1. We cannot make the above statement reactive because we touch tmpCopyAsTemplates.
    2. It works if you always want b to be the value deriving from a. However in the example above, we want the value of b to be temporarily out of sync of a.
    3. My mental model has always been that a reactive declaration like $: b = a * 2 defines b in it's entirety ("Here's my recipe for b and all the ingredients, please Svelte make b always up to date"). And outside of this declaration b is immutable.
    4. For me there is a distinct difference between these two scripts: let a = 1; $: b = a * 2; let a = 1; let b; $: { b = a * 2 }; The first example defines a "recipe" for how to create b and b is completely defined by that declaration. Outside of that it is immutable, data flows only into a single sink. The second example declares a variable b and then uses a reactive statement to update it. But it also allows you to do with b whatever you want. If someone wants to go that route (definitely not me), they are free to do so at their own risk of ensuring consistency.
    5. First of all, here is what I meant by updating reactive declared variable
    6. The intention of the issue #2444 was to propagate the changes of the reactive declared variables back to its dependencies. in the context of this example, would meant, updating b should update a as well.
    7. The intended behavior for the code snippet above is to reactively update b when a changes allows b temporarily go "out-of-sync" of a when calling update, setting b to 42 in this case, b is not always a * 2 however, if a changes again, b will be updated back to a * 2, instead of staying at 42
  5. Nov 2021
  6. Oct 2021
  7. Sep 2021
  8. Jun 2021
    1. I've seen (and fixed) Ruby code that needed to be refactored for the client objects to use the accessor rather than the underlying mechanism, even though instance variables aren't directly visible. The underlying mechanism isn't always an instance variable - it can be delegations to or manipulations of a class you're hiding behind a facade, or a session store with a particular format, or all kinds. And it can change. 'Self-encapsulation' can help if you need to swap a technology, a library, an object specification, etc.
    2. a principle I use is: If you have an accessor, use the accessor rather than the raw variable or mechanism it's hiding. The raw variable is the implementation, the accessor is the interface. Should I ignore the interface because I'm internal to the instance? I wouldn't if it was an attr_accessor.
    3. I have been wrapping instance variables in accessor methods whenever I can though.
    4. Also, Sandi Metz mentions this in POODR. As I recall, she also advocates wrapping bare instance variables in methods, even when they're only used internally. It helps avoid mad refactoring later.
  9. May 2021
  10. Mar 2021
  11. Feb 2021
    1. Local variables can even be declared with the same name as a global variable. If this happens, there are actually two different variables with the same name: one local and one global. This helps ensure that an author writing a local variable doesn’t accidentally change the value of a global variable they aren’t even aware of.
  12. Dec 2020
  13. Nov 2020
    1. Thirty-nine right-handed (Snyder&Harris, 1993) healthy adults

      Participants: 39 adults (no children as plasticity would be highly varied; adults are known for lower plasticity); being right-handed is an interesting note, but means that all adults are left-brain dominant. Researchers' attempt to keep variation low and the experimental group uniform.

  14. Oct 2020
  15. Sep 2020
    1. Otherwise, please take the time to read about declarations hoisting (MDN, Adequately Good) and variable shadowing, as these concepts are key to fully understanding TDZ.
  16. Aug 2020
  17. Jul 2020
  18. Jun 2020
  19. May 2020
  20. Dec 2019
    1. PHP variables begin with the dollar symbol $ and PHP variable names adhere to the following rules:• Names are case sensitive• Names may contain letters, numbers, and the underscore character• Names may not begin with a number
  21. Jul 2019
    1. However, the gain ratio is the most important metric here, ranged from 0 to 1, with higher being better.
    2. en: entropy measured in bits mi: mutual information ig: information gain gr: gain ratio
    1. Feature predictive power will be calculated for all features contained in a dataset along with the outcome feature. Works for binary classification, multi-class classification and regression problems. Can also be used when exploring a feature of interest to determine correlations of independent features with the outcome feature. When the outcome feature is continuous of nature or is a regression problem, correlation calculations are performed. When the outcome feature is categorical of nature or is a classification problem, the Kolmogorov Smirnov distance measure is used to determine predictive power. For multi-class classification outcomes, a one vs all approach is taken which is then averaged to arrive at the mean KS distance measure. The predictive power is sensitive towards the manner in which the data has been prepared and will differ should the manner in which the data has been prepared changes.
    1. Mutual information is one of many quantities that measures how much one random variables tells us about another. It is a dimensionless quantity with (generally) units of bits, and can be thought of as the reduction in uncertainty about one random variable given knowledge of another. High mutual information indicates a large reduction in uncertainty; low mutual information indicates a small reduction; and zero mutual information between two random variables means the variables are independent.