Notes, summaries, assignments, exams, and problems

Sort by
Subject
Level

React Hooks & Redux: Essential Concepts for Developers

Posted by Anonymous and classified in Computers

Written on in English with a size of 10.31 KB

React Hooks and Essential Libraries

useState Hook

Purpose

Purpose: Adds state to functional components.

Import

import { useState } from 'react';

Syntax

const [state, setState] = useState(initialValue);

Update Methods

  • setState(newValue);
  • setState(prevState => ...); (for updates based on previous state)

Example

import React, { useState } from 'react';

function Counter() {
  const [count, setCount] = useState(0);

  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>Increment</button>
    </div>
  );
}

useEffect Hook

Purpose

Purpose: Performs side effects such as data fetching, subscriptions, or direct DOM manipulations.

Import

import { useEffect } from 'react';

Syntax

useEffect(
... Continue reading "React Hooks & Redux: Essential Concepts for Developers" »

Verb to Be, Family, Clothes, and More in English

Classified in Spanish

Written on in English with a size of 3.47 KB

Verb To Be: Present Simple

The verb "to be" is fundamental in English. Here's its present simple form:

Personal PronounVerb To Be (+)Short Form (+)Verb To Be (-)Short Form (-)Interrogative
IamI'mam not-Am I?
YouareYou'reare notAren'tAre you?
HeisHe'sis notIsn'tIs he?
SheisShe'sis notIsn'tIs she?
ItisIt'sis notIsn'tIs it?
WeareWe'reare notAren'tAre we?
YouareYou'reare notAren'tAre you?
TheyareThey'reare notAren'tAre they?

Adverbs of Frequency

These words describe how often something happens:

  • 0%: Never
  • 20%: Rarely
  • 50%: Sometimes
  • 70%: Often
  • 90%: Usually
  • 100%: Always

Family Members

Here are some common family words in English and Spanish:

  • Aunt - Tía
  • Brother - Hermano
  • Children - Niño (Note: "Children" is plural. The singular is "Child")
  • Cousin - Primo/a
  • Daughter - Hija
  • Father
... Continue reading "Verb to Be, Family, Clothes, and More in English" »

C++ Code Examples: Essential Algorithms & Programs

Classified in Computers

Written on in English with a size of 5.54 KB

C++ Code Examples: Essential Algorithms & Programs

Here are some fundamental C++ code examples covering various algorithms and programming concepts:

Factorial Calculation

#include <iostream>
using namespace std;

long factorial(int x) {
 int i, f = 1;
 for (i = 1; i <= x; i++) {
 f = f * i;
 }
 return f;
}

int main() {
 int n;
 cout << "Enter the number: ";
 cin >> n;
 if (n < 0) {
 cout << "Factorial is not defined for negative numbers";
 } else {
 cout << "Factorial = " << factorial(n);
 }
 return 0;
}

String Length Finder

#include <iostream>
using namespace std;

int main() {
 int length = 0, i;
 char s[20];
 cout << "Enter the string: ";
 cin.getline(s, 20);
 for (i = 0; s[i] != '\0'
... Continue reading "C++ Code Examples: Essential Algorithms & Programs" »

Synthesis and Sources of Aromatic Hydrocarbons

Classified in Chemistry

Written on in English with a size of 3.14 KB

Preparation of Naphthalene

Naphthalene is a fused-ring aromatic hydrocarbon with two benzene rings. It can be prepared via the following methods:

  • From Coal Tar: Coal tar, a by-product of coal processing, is a major source of naphthalene. It is extracted and purified using distillation followed by crystallization.
  • Synthesis from Benzene: Benzene undergoes a series of reactions to form naphthalene:
    • Alkylation: Benzene reacts with alkyl halides (like methyl chloride) to form methylbenzene (toluene).
    • Cyclization: Toluene undergoes further reaction with chlorine and heat to form naphthalene.

Preparation of Anthracene

Anthracene is a tricyclic aromatic hydrocarbon consisting of three fused benzene rings. It is mainly obtained from coal tar but can also... Continue reading "Synthesis and Sources of Aromatic Hydrocarbons" »

Insect Biology: Adaptations, Behaviors, and Ecology

Classified in Biology

Written on in English with a size of 5.34 KB

Insect Defenses Against Predators

Three Plant Mechanisms to Defend Against Insects

  • Physical: Thick walls
  • Chemical: Phytochemicals that kill insects
  • Entrapment: Pitcher plants

How Insects Overcome Physical Defenses

  • Specialized mandibles
  • Evolution
  • Immunity to phytochemicals
  • Specialization to survive the digestive liquid of pitcher plants

Insect Parasitism

Endoparasites

Approximately 20% of insect orders include endoparasites. Some orders that include endoparasites are:

  • Hymenoptera
  • Diptera
  • Strepsiptera

Ectoparasites

Some orders that include ectoparasites are:

  • Anoplura
  • Mallophaga
  • Siphonaptera

Three Challenges Faced by Endoparasites

  • Respiration
  • Excretion/getting rid of toxic nitrogenous waste without killing the host
  • Avoiding the host's endocrine system

Insect Social Behavior

Subsocial

... Continue reading "Insect Biology: Adaptations, Behaviors, and Ecology" »

Mastering English: Connectors, Grammar, and Prepositions

Classified in Other languages

Written on in English with a size of 6.69 KB

Essential English Connectors and Their Meanings

Here's a list of common English connectors with their Spanish translations:

  • First of all - En primer lugar
  • In my opinion - En mi opinión
  • Personally - Personalmente
  • As far as I am concerned - Por lo que a mí respecta
  • From my point of view - Bajo mi punto de vista
  • To begin with - Para empezar
  • Firstly - Primeramente
  • Secondly - En segundo lugar
  • That's why - Esto es por lo que
  • Therefore - Por lo tanto
  • As a result of - Como resultado
  • Consequently - En consecuencia
  • As - Como
  • So - Así que
  • Whereas - Mientras que
  • So...that... - Tan...que...
  • Such a...that... - Tan...que...
  • On the one hand - Por una parte
  • However/Nevertheless - Sin embargo
  • Anyhow - De todas formas
  • Anyway - De cualquier manera
  • In spite of/Despite - A pesar de
  • On
... Continue reading "Mastering English: Connectors, Grammar, and Prepositions" »

Thriller Night: A Song of Horror and Suspense

Classified in English

Written on in English with a size of 3.8 KB

Thriller Night

It's Close to Midnight

It's close to midnight and something evil's lurking in the dark.

Under the moonlight, you see a sight that almost stops your heart.

You try to scream but terror takes the sound before you make it.

You start to freeze as horror looks you right between the eyes.

You're paralyzed.

Thriller Night Begins

'Cause this is thriller, thriller night.

And no one's gonna save you from the beast about to strike.

You know it's thriller, thriller night.

You're fighting for your life inside a killer, thriller tonight.

You hear the door slam and realize there's nowhere left to run.

You feel the cold hand and wonder if you'll ever see the sun.

You close your eyes and hope that this is just imagination.

But all the while you hear the creature... Continue reading "Thriller Night: A Song of Horror and Suspense" »

English Modal Verbs: Ability, Possibility, Obligation, and More

Classified in Other languages

Written on in English with a size of 3.55 KB

Ability

Expressing ability with modal verbs:

  • Can (present ability): Can you speak French?
  • Will be able to (future ability): She will be able to speak French in two months.
  • Could (past ability, unrealized potential): I could have gone to university when I was younger.
  • Be able to (general ability): She is able to speak Chinese.
  • Was/were able to (past ability, achieved action): We were able to escape the fire.
  • Couldn't/were not able to (negative past ability): We couldn't/were not able to finish the project.

Possibility

Expressing degrees of possibility:

  • May (higher probability): He may be in his office.
  • Might (lower probability): She might be 30 years old.

Certainty

Expressing certainty or impossibility:

  • Must (certainty): He must be over 70.
  • Can't (impossibility)
... Continue reading "English Modal Verbs: Ability, Possibility, Obligation, and More" »

Medios alternativos en la solucion de conficto

Classified in History

Written on in English with a size of 2.27 KB

diga la naturalez ade lps medios alternativos de solucion de conflictos
son contrahegemonicos porque nacieron , en lo moderno en rusia para oponerse al poder opresor del estado
carasteristicas de los medios alternativos de solucion de conflictos
si son voluntarios , si son formales ,
la mediacion y la negociacion son informales
el arbitraje y la mediacion son formales

que limita al poder hegemonico de los gobiernos
lo alternativo o segunda opcion y posibilidad de resolver los problemas , sin la intervencion del poder opresor y hegemonico del estado
A YEGAR A UN ACUERDO


explique los principales procesos alternativos
transaccion o negociacion , mediacion, arbitraje y conciliacion
cricis que atraviesa ell poder judicial
el congestionamiento... Continue reading "Medios alternativos en la solucion de conficto" »

Centos 5.5

Classified in Technology

Written on in English with a size of 5.39 KB

#useradd nombredeusuario :: para crear usuarios

#passwd :: nombredelusuario

#groupadd :: nombredelgrupo :: (forma normal)

#groupadd -g 600 nombredelgrupo :: (guid sobre 650)

#userdel nombredelusuario :: para deletear usuarios

#groupdelnombredelgrupo :: borrar el grupo

#usermod -G nombredelgrupo nombredeusuario :: para asignar usuario a grupo.

opcion 2: editar archivo /etc/group -> grupo:x:600:usuarioqueseagregara

#nano /etc/shadow :: para poder ver los usuarios y poder bloquearlos

#passwd -l nombredeusuario :: para bloquear usuario

#passwd -u nombredeusuario :: para desbloquear usuario

#sudo passwd :: para cambiar la contraseña de root

# tail /etc/passwd :: paraver informacion de usuarios

#su nombredelotrousuario :: para iniciar sesion como el usuario... Continue reading "Centos 5.5" »