34 Matching Annotations
  1. Sep 2023
    1. Prefixing the variable name with an underscore -- seems unintuitive, way too subtle for another reader to catch

    1. Is the len() function in the list example an acceptable pattern? It's written as a recursive function, which goes arbitrarily deep. Is this optimized and idiomatically correct? Or is this just for demonstration? In which case, is such a list much harder to do properly without enums?

    2. Seems the comment in len() is important (re:self or *self, and possibly messy.

    1. From the article, the meaning of &[][..] is not clear:

      // Example of empty slice &[]:

      let empty_array: [u32; 0] = [];

      assert_eq!(&empty_array, &[]);

      assert_eq!(&empty_array, &[][..]); // Same but more verbose

    1. new container type which is not generic

      not clear about the implications of this re: generics. Can a generic instantiation of a type implement Display()? What are the other limitations, and their solutions?

    2. Add fixme for println!("What does Point2D look like in binary: {:b}?", point)

    1. Frozen data can't be modified until the immutable binding goes out of scope:

      Is there a significant use case for this, or is it just demonstrating a special case of the concept of shadowing?

    1. Does shadowing a variable by repeatedly binding the same name in the same scope, have the effect of just using a mutable variable?

    1. A possibly mutable variable with 'static lifetime. The static lifetime is inferred and does not have to be specified. Accessing or modifying a mutable static variable is unsafe.

      This is good to know, and also quirky/potentially overly complex.

  2. Jul 2023
  3. Jun 2023
  4. May 2023
    1. 5. If you could magically make one change to all keyboards in the world, what would it be? "Eliminate the need for a keyboard. It’s really a pretty archaic means as an interface. The very origin of the QWERTY layout is inefficiency. It was designed so that the operator could not out-run the typewriter and cross up the type levers. How about an entry system that reads the mind. Voice is nearly there, but it’s hard to have a quiet environment."
    1. We cannot use objects to calculate and perform analysis here. We must convert the type object to float64 (float64 is a number with a decimal in Python).

      That's because you didn't clean the data in this example. In the following code, astype() didn't "convert objects to floats." You called dropna(), which eliminated the "objects" because those rows also happened to have blank columns.

    1. the project is now officially supported by Google.

      No it isn't! As of January 2022, per their website.

  5. Apr 2023
    1. Internet is for everyone, but it won't be unless WE make it so. Vint Cerf, 7. April 1999
    1. Responsive Image Gallery How to use CSS media queries to create a responsive image gallery that will look good on desktops, tablets and smart phones.
    1. Three in 10 Black adults and one in five Hispanic adults said they had personally witnessed someone being shot, according to the study. A little more than one in five (22%) of Hispanic adults said they had seen someone being shot.

      :-0

    2. More than one-third of Black adults said they had a family member who was killed by a gun, compared with 17% of White respondents and 18% of Hispanic adults who participated in the study.

      😥

    3. 1 in 5 U.S. adults say they've had a family member killed by a gun

      👀