56 Matching Annotations
  1. Apr 2024
    1. I invite you to checkout The Odin Project (theodinproject.com). It has an identical curriculum, provides help via Discord, and it's free.

    1. For React 18 onwards, this library have been deprecated and should be replaced with @testing-library/react.

  2. Jan 2024
    1. You should take care, however, to make sure that your individual objects can stand alone as much as possible. Tightly coupled objects are objects that rely so heavily on each other that removing or changing one will mean that you have to completely change another one - a real bummer.

      Isn't there a conflict between this principle and code reusability?

    1. With the introduction of ES6 Modules, the module pattern (IIFEs) is not needed anymore, though you might still encounter them in the wild.
    1. Any constructor that can be called with new and has the prototype property can be the candidate for the parent class.

      Classes declared with class and functions with constructor and an assigned prototype.

  3. Dec 2023
    1. We can use the call() method to copy over properties from one constructor into another constructor. Let’s create a Warrior and a Healer constructor.
    2. It is important to note that .__proto__ is a legacy feature and should not be used in production code, and it is not present in every modern browser. However, we can use it throughout this article for demonstrative purposes.
    1. Solution: Instead of taking notes to use as direct references, make notes that can serve as prompts for further research. It is important to get comfortable with reading documentation, which essentially acts as pre-existing notes made by someone else.

      It is also a good idea to create a developer journal with your different questions, insights, and reasonings that you bump into during your journey. It will also serve you in your career.

    1. Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.

      In reality, It is a mix between these two attitudes. Programming is being good at telling the computer what to do, in the most efficient way. This whole process requires a good amount of knowledge, design, and thinking. But coding, just the part where you're writing code, should be focused on readability because humans are the ones that interact with the text, not computers.

    1. I think this is one of those situations where it's easy to confuse “familiar” with “simple”. You're probably much more comfortable with min-width than flex-shrink, but that doesn't mean flex-shrink is more complicated!
  4. Nov 2023
    1. Validations allow us to set specific constraints or rules that determine what data users can enter into an input. When a user enters data that breaks the rules, a message will appear, providing feedback on what was wrong with the entered data and how to fix it.

      HTML forms have an internal validation mechanism.

    1. Las acciones que se pueden realizar dentro de un formulario son definidas como form controls. El número de acciones es bastante grande y vale la pena revisar todas las posibilidades.

    1. In addition to that issue, too many new developers also jump into learning frameworks too early in their education; the prospect of not having to practice writing vanilla CSS is very tempting. As a result, many developers do not get enough CSS practice under their belts to solidify the fundamentals of this very important language.
    1. I’m sure you can imagine, the ability to shift an element around based on its regular position is pretty useful. I find myself using this to line up form elements many times that have a tendency to not want to line up how I want them to.
    1. It’s become very popular to use viewport units for responsive typography – establishing font-sizes that grow and shrink depending on the current viewport size. Using simple viewport units for font-size has an interesting (dangerous) effect. As you can see, fonts scale very quickly – adjusting from unreadably small to extra large in a very small range.

      No es conveniente utilizar viewport units para tipografía, ya que genera un efecto escala distorcionado.

      Para evitar este efecto y seguir utilizando viewport units, debes primero colocar una unidad absoluta base (e.g. 16px) y luego utilizar una función como calc para multiplicarlos. Téngase por ejemplo: calc(16px + 0.5vw).

    1. So to reiterate my conclusion: I definitely prefer using relative units to define font-size so that you can respect the user’s settings, but I don’t personally think it’s a big deal if your layout is complex enough that you cannot support it. If you’re using rem for fonts, then I slightly prefer using pixels for elements such as margin and padding, but there is nothing wrong with using rem for that, if you prefer that scaling effect.

      Utilizar rem en elementos como margin and padding produce un efecto escala similar al zoom. Si no quieres que las cosas se agranden mucho, sino solo lo necesario, es mejor utilizar px.

    1. I don't particularly recommend that you just use this in its unaltered state in your own projects. It should be tweaked, edited, extended, and otherwise tuned to match your specific reset baseline.

      Aún cuando se trata de un reseteo completo de estilo CSS, proponentes de este método como es the Meyer's Reset recomiendan sobreescribir partes del reseteo con las preferencias personales del diseñador. Esto quiere decir que un reseteo no debe ser un reseteo en blanco, sino un reseteo hacia el estándar o base que el diseñador prefiera.

    1. To counter this, many developers start their projects with a “CSS Reset”; a file that undoes browser defaults, so that every element behaves the same in every browser.

      Para lidear de manera fulminante con las diferencias entre los navegadores con respecto al estilo, los diseñadores aplican un CSS Reset, lo cual elimina cualquier personalización que esté por defecto. Esta solución es radical y no estrictamente necesaria, ya que el diseñador tendra que reescribir muchas de las configuraciones que han sido borradas.

    2. The problem with this is that there is no guarantee that different browsers will style everything the same. In general, inconsistencies are going to be pretty minor, but they DO exist.

      Aunque existen diversas similitudes, todos los navegadores tienen defaults distintos respecto del CSS de los principales elementos HTML. Esto es algo a tener en cuenta al momento de tratar de dar una experiencia uniforme al usuario porque vas a tener que sobreescribir las diferencias entre navegadores y establecer tu propio estándar.

    1. Hay una serie de buenas prácticas en la fabricación de tablas que permiten una interacción más eficiente entre el usuario y la data que se busca comunicar. Una buena experiencia entre el usuario y las tablas dentro de una página web dependen en suma del diseño establecido. La fabricación de buenas tablas en la web solo requieren de conocimientos de HTML y CSS.

    1. To give you some interesting examples, in the case of a long table you could make the table header and footer repeat on every printed page, and you could make the table body display on a single page and have the contents available by scrolling up and down.

      Las etiquetas <thead>, <tbody>, and <tfoot> proveen a las tablas HTML una fuerte capacidad de personalización a través de selectores CSS.

  5. Aug 2023
    1. External coaching is different by the coaching you can get from co-workers in some decisive ways. For example, an external coach is rarely effective on hard technical skills, because 1) they have little context into your work, and 2) because you only talk/work with them e.g. once every two weeks.What a coach brings, instead, is an external perspective backed by their extensive experience in the industry.

      A coach can't give you specific advice on how to do your job, except if you're hiring specialized coaching solution on technical skills. In that case what you're hiring if most probably a mentor, not a coach. A coach give an outsider perspective based on generalizable ideas.

  6. Jul 2023
    1. The parameter by specifies the columns, and ascending takes a list to define the sorting direction per each column. In this case, we're sorting by Country name in descending order first (in lexicographical order), and by number of Employees in ascending order second.

      Pandas DataFrame allows for multiple sorting

    1. Last but certainly not least: to unlock your computer, type your user’s password and press Enter.

      Read this before locking up your computer.

    1. Btrfs appears to have an emphasis in security and data-integrity. It its safer when gradual changes in your system are performed. Instead, ext4 appears to lean more to reliability and speed. Backups and deduplication are harder in ext4 Also, btrfs has the ability to create links for duplicate files automatically, liberating disk space.

    1. As you can see, it has sliced along axis 0, the first axis. A slice, therefore, selects a range of elements along an axis. It can be helpful to read the expression arr2d[:2] as "select the first two rows of arr2d."

      Slices follow a similar logic than indexing in NumPy array's. array[:2] selects a range of elements along a single axis,, but array[:2, 1:] does it along two axis.

    1. Bollinger bands are just a simple visualization/analysis technique that creates two bands, one "roof" and one "floor" of some "support" for a given time series. The reasoning is that, if the time series is "below" the "floor", it's a historic low, and if it's "above" the "roof", it's a historic high. In terms of stock prices and other financial instruments, when the price crosses a band, it's said to be too cheap or too expensive.

      How to display Bollinger bands with Pandas.

    1. You might want to suppress only ValueError, since a TypeError (the input was not a string or numeric value) might indicate a legitimate bug in your program. To do that, write the exception type after except: def attempt_float(x): try: return float(x) except ValueError: return x
    2. Since generators produce output one element at a time versus an entire list all at once, it can help your program use less memory.
    3. It is not until you request elements from the generator that it begins executing its code:

      A generator is a function-like iterator object.

    4. A generator is a convenient way, similar to writing a normal function, to construct a new iterable object. Whereas normal functions execute and return a single result at a time, generators can return a sequence of multiple values by pausing and resuming execution each time the generator is used. To create a generator, use the yield keyword instead of return in a function:
    5. In this case, return_value would be a 3-tuple with the three returned variables. A potentially attractive alternative to returning multiple values like before might be to return a dictionary instead:

      Returning multiple values in Python is expressed as a tuple by default and each value is correspondingly assigned. Optionally, you can return a dictionary if specified.

    6. The for parts of the list comprehension are arranged according to the order of nesting, and any filter condition is put at the end as before.

      Nested list comprehensions follow the same logic as nested for loops. The difference strives that in list comprehensions the filtered variable is mentioned twice.

    1. Code for processing data samples can get messy and hard to maintain; we ideally want our dataset code to be decoupled from our model training code for better readability and modularity.

      Code for data processing and model training should be separated as different modules.

    1. Tensors on the CPU and NumPy arrays can share their underlying memory locations, and changing one will change the other.

      PyTorch tensors and NumPy arrays share memory locations. This means that changes in one reflect in both.

  7. Feb 2023
    1. Triggers of women’s jealousy and mate guarding, as a consequence, should focus heavily on signals of these kinds of losses, such as a man becom-ing emotionally involved with another woman. Emo-tional involvement is a signal of the long-term com-mitment of resources to the partner with whom one is involved [15]. Sexual and emotional infi delity in a partner, of course, are correlated in nature [16]. People tend to become emotionally involved with those with whom they have sex. And people often become sexually involved with those they are emotionally close to.

      Emotional involvement is a good predictor for infidelity. Sex and emotional involvement are intertwined in opposite-sex relationships.

    2. Sexual jealousy is hypothesized to become activated whenever there is a perceived threat to a mating relationship. The threats can come from a variety of sources – the presence of poachers, cues to infi delity, or even subtle signals that suggest that a partner might be dissatisfi ed with the current relationship. Once activated, a variety of psy-chological processes are hypothesized to be set into motion, such as evaluation of the nature and magni-tude of the threat and evaluation of potential courses of action. Eventually, these processes usually lead to behavioral output designed to deal with the threat –actions that can range from vigilance to violence.

      Sexual jealousy is the psychological response to intrasexual threats. This lead to a bast array of behavioral outputs.

    3. For men, a single failure at mate guarding could result in genetic cuckoldry, as happens when man’s wife becomes fertilized by a rival man’s sperm. In addition to the direct loss of opportunity for reproduction, the husband risks investing years or decades of his own effort in a rival’s child in the mis-taken believe that the child is his own. To compound these reproductive losses, his wife’s maternal efforts now benefi t his rival’s child rather than his own. Fur-thermore, if the lapse becomes public, the cuckolded man risks damage to his social reputation, which could bring about a decrement in mate value, a loss of sta-tus, and an increased future vulnerability to other mate poachers. Finally, the cuckolded man suffers opportu-nity costs – matings that he could have pursued as alter-natives had he not engaged in this particular mateship. Large are the potential reproductive costs of a single lapse of mate guarding.

      In humans, costs of failure at mate guarding are higher in males. I believe costs in females have been higher in the past, but current laws on child-support have reduced female costs considerable (except for the ability to attract new partners)

    4. One common strategy is the concealment of mates from intrasexual competitors [4]. Concealment is usually accomplished through one of three means –removing the mate from the vicinity of rivals, produc-ing signals that mask the attractant signals of the mate, and muting the conspicuousness of courting and copu-lation to evade detection by rivals.

      The most common strategy is concealing a mate from rivals. Is this the standard strategy for the partner with lower sexual market value?

    5. All these confl icts occur because the deploy-ment of a successful reproductive strategy by one individual can interfere at multiple points with the reproductive strategy pursued by the other – a phenomenon called “strategic interference” [2].

      Differences in reproductive strategies between the sexes create an environment for infidelity, mate poaching, and other conflicts.

    1. I don't believe it was addressed in this piece, but the general desire of women for men the same age or older is also relevant. I've read elsewhere that the supply and demand dynamics on Tinder and other dating sites become so unbalanced for moderately successful men (even nerdy types) in their early-30s that there are dozens of women trying to "catch" them. This makes it even less likely that they settle down just when their options are increasing. And attractive, smart, caring women who want to get married arrive at age 30 and find that the 40:60 ratio from college has turned into 10:90 when an "eligible" man means 30+, still single, educated, high salary, tall, etc.

      It is confirmed by anecdotal experience that men are more desirable after their 30s when they have achieved success or wealth accumulation. Women have it harder at this age to find a qualified partner.

  8. Jan 2023
  9. discovery.ucl.ac.uk discovery.ucl.ac.uk
    1. For example, someone who is the main wage earner ina household may feel a failure because of their belief that they should always be able to provide fortheir family. In contrast, according to the femininity script, someone who aspires to a happy familylife more than a happy work life may lose their job but still find fulfillment in the home.

      It is true that males derive more satisfaction from their success at work and females from their success at building family.

    2. As hypothesized, men scored significantly higher onthe overall male script than women. However, there was almost no difference between men andwomen’s scores on the overall female script.

      Men have more gender pressure than women. It can be argued that men have more social pressure in general.