-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into js_reportError
- Loading branch information
Showing
32 changed files
with
1,972 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
content/go/concepts/data-types/data-types.md | ||
content/react/concepts/components/components.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
Title: 'sizeof()' | ||
Description: 'Determines the memory size (in bytes) of a given data type or variable and returns it as an integer.' | ||
Subjects: | ||
- 'Code Foundations' | ||
- 'Computer Science' | ||
Tags: | ||
- 'Arithmetic' | ||
- 'Operators' | ||
- 'Data Types' | ||
- 'Variables' | ||
CatalogContent: | ||
- 'learn-c' | ||
- 'paths/computer-science' | ||
--- | ||
|
||
In C, the **`sizeof()`** operator returns an integer representing the memory size of a [data type](https://www.codecademy.com/resources/docs/c/data-types) or [variable](https://www.codecademy.com/resources/docs/c/variables) in bytes. | ||
|
||
## Syntax | ||
|
||
```pseudo | ||
sizeof(input) | ||
``` | ||
|
||
- `input`: The data type or variable whose memory size is to be calculated. | ||
|
||
## Example | ||
|
||
The following example demonstrates the usage of the `sizeof()` operator: | ||
|
||
```c | ||
#include <stdio.h> | ||
|
||
int main() { | ||
// Calculate the memory size of the 'int' data type | ||
int res = sizeof(int); | ||
|
||
// Print the result | ||
printf("Size of int: %d bytes\n", res); | ||
|
||
return 0; | ||
} | ||
``` | ||
|
||
The above code produces the following output: | ||
|
||
```shell | ||
Size of int: 4 bytes | ||
``` |
71 changes: 71 additions & 0 deletions
71
content/c/concepts/pointers/terms/double-pointer/double-pointer.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
Title: 'Double Pointer' | ||
Description: 'Holds the memory address of a pointer.' | ||
Subjects: | ||
- 'Code Foundations' | ||
- 'Computer Science' | ||
Tags: | ||
- 'Pointers' | ||
- 'Memory' | ||
- 'Variables' | ||
- 'Arrays' | ||
CatalogContent: | ||
- 'learn-c' | ||
- 'paths/computer-science' | ||
--- | ||
|
||
In C, a **double pointer** is a [pointer](https://www.codecademy.com/resources/docs/c/concepts/pointers/terms/pointer/pointer) that holds the memory address of another pointer. It allows indirect access to the value of a variable. | ||
|
||
## Syntax | ||
|
||
A double pointer is declared using two asterisks (`**`) before the pointer variable name: | ||
|
||
```pseudo | ||
type **name | ||
``` | ||
|
||
- `type`: The type of data the double pointer will point to (e.g., `int`, `char`, etc.). | ||
- `name`: The identifier for the double pointer. | ||
|
||
## Example | ||
|
||
The following example demonstrates how a double pointer is declared and used: | ||
|
||
```c | ||
# include <stdio.h> | ||
|
||
int main() { | ||
int value = 35; | ||
int *pointer = &value; // Pointer to an integer (stores the address of 'value') | ||
int **doublePointer = &pointer; // Double pointer to an integer pointer (stores the address of 'pointer') | ||
|
||
// Printing the values | ||
printf("Value of value: %d\n", value); // Direct access to value | ||
printf("Value of *pointer: %d\n", *pointer); // Dereferencing pointer to access value | ||
printf("Value of **doublePointer: %d\n", **doublePointer); // Dereferencing double pointer twice to access value | ||
|
||
// Printing the addresses | ||
printf("Address of value: %p\n", (void*)&value); // Address of the variable 'value' | ||
printf("Address of pointer: %p\n", (void*)&pointer); // Address of the pointer 'pointer' | ||
printf("Address of doublePointer: %p\n", (void*)&doublePointer); // Address of the double pointer 'doublePointer' | ||
|
||
return 0; | ||
} | ||
``` | ||
|
||
The above code will give the following output: | ||
|
||
```shell | ||
Value of value: 35 | ||
Value of *pointer: 35 | ||
Value of **doublePointer: 35 | ||
Address of value: 0x7ffcbffdcc14 | ||
Address of pointer: 0x7ffcbffdcc18 | ||
Address of doublePointer: 0x7ffcbffdcc20 | ||
``` | ||
|
||
In the example: | ||
|
||
- `value` is an integer variable. | ||
- `pointer` is a pointer tha stores the address of `value`. | ||
- `doublePointer` is a double pointer that stores the address of the pointer. |
65 changes: 65 additions & 0 deletions
65
content/data-science/concepts/hypothesis-testing/hypothesis-testing.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
Title: 'Hypothesis Testing' | ||
Description: 'Hypothesis testing is a statistical method to determine if an observed effect is significant or due to chance, using p-values and test statistics.' | ||
Subjects: | ||
- 'Data Science' | ||
- 'Data Visualization' | ||
- 'Machine Learning' | ||
Tags: | ||
- 'Data Science' | ||
- 'Deep Learning' | ||
CatalogContent: | ||
- 'learn-python-3' | ||
- 'paths/data-science' | ||
--- | ||
|
||
**Hypothesis testing** is a fundamental statistical method used in data science to make inferences about a population based on sample data. It helps in determining whether an observed effect is statistically significant or if it occurred by random chance. | ||
|
||
## Key Concepts | ||
|
||
### Null and Alternative Hypotheses | ||
|
||
- **Null Hypothesis (H₀)**: A statement that assumes no effect or no difference exists. It represents the default assumption. | ||
- **Alternative Hypothesis (H₁ or Ha)**: A statement that contradicts the null hypothesis, suggesting an effect or a difference exists. | ||
|
||
### Significance Level (α) | ||
|
||
- The probability threshold for rejecting the null hypothesis, commonly set at 0.05 (5%). | ||
|
||
### P-Value | ||
|
||
- A measure of the probability that the observed data would occur if the null hypothesis were true. A small p-value (≤ α) suggests strong evidence against H₀, leading to its rejection. | ||
|
||
### Test Statistics | ||
|
||
- A numerical value calculated from sample data used to determine whether to reject H₀. | ||
- Common test statistics, calculated from hypothesis tests, include: | ||
- **Z-score**: Used when population variance is known. | ||
- **T-score**: Used when population variance is unknown and the sample size is small. | ||
- **Chi-square statistic**: Used for categorical data. | ||
- **F-statistic**: Used in variance analysis (ANOVA). | ||
|
||
## Type I and Type II Errors | ||
|
||
- **Type I Error (False Positive)**: Rejecting H₀ when it is actually true. | ||
- **Type II Error (False Negative)**: Failing to reject H₀ when it is actually false. | ||
|
||
## Steps in Hypothesis Testing | ||
|
||
1. **State the Hypotheses**: The first step is to define the null hypothesis (H₀) and the alternative hypothesis (H₁) clearly. | ||
2. **Choose the Significance Level (α)**: Determine the threshold probability (commonly 0.05) for rejecting the null hypothesis. | ||
3. **Select the Appropriate Test**: Choose the statistical test that best suits the data and research question, such as a T-test, Chi-square test, or ANOVA. | ||
4. **Compute the Test Statistic and P-value**: Perform the statistical test to calculate the test statistic and corresponding p-value. | ||
5. **Compare P-value with α**: If the p-value is less than or equal to α, reject H₀, indicating significant evidence for H₁. Otherwise, fail to reject H₀, suggesting insufficient evidence against it. | ||
6. **Draw a Conclusion**: Based on the results, interpret whether there is enough evidence to support the alternative hypothesis. | ||
|
||
## Common Hypothesis Tests | ||
|
||
1. **Z-Test**: Used when the sample size is large (n > 30) and population variance is known. | ||
2. **T-Test**: Used when the sample size is small (n ≤ 30) and population variance is unknown. Common variants of T-test include: | ||
- **One-sample T-test**: Compares sample mean to a known population mean. | ||
- **Two-sample T-test**: Compares means of two independent groups. | ||
- **Paired T-test**: Compares means of two related groups. | ||
3. **Chi-Square Test**: Used for categorical data to test the independence or goodness of fit. | ||
4. **ANOVA (Analysis of Variance)**: Typically used when comparing three or more group means. | ||
5. **Mann-Whitney U Test**: A non-parametric alternative to the T-test for comparing two independent groups. |
33 changes: 33 additions & 0 deletions
33
content/general/concepts/artificial-intelligence/artificial-intelligence.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
Title: 'Artificial Intelligence' | ||
Description: 'Simulates human intelligence in computers, enabling learning, reasoning, and problem-solving to provide solutions across various tasks.' | ||
Subjects: | ||
- 'AI' | ||
- 'Computer Science' | ||
Tags: | ||
- 'AI' | ||
- 'Algorithms' | ||
- 'Automation' | ||
CatalogContent: | ||
- 'paths/computer-science' | ||
- 'paths/data-science' | ||
--- | ||
|
||
**Artificial Intelligence (AI)** is described as the simulation of human intelligence in computer systems. AI technology can perform learning, reasoning, and problem-solving tasks, enabling solutions to a variety of complex problems. AI systems can range from simple algorithms, such as those making product recommendations based on purchase history, to complex systems that power self-driving cars, planning routes, and avoiding obstacles without human intervention. The demand for AI-powered solutions is growing rapidly and intersecting almost every aspect of our daily lives. | ||
|
||
## Types of AI | ||
|
||
- **Reactive Machines AI**: These are the most basic AI systems. They do not have memory or use past data to form decisions or factor into solutions. They react to specific inputs with specific outputs. | ||
- **Limited Memory AI**: These systems can use memory and stored data to make future decisions. However, they only have temporary memory, which is stored briefly. | ||
- **Theory of Mind AI**: These advanced AI systems involve machines that can understand emotions, behaviors, and interactions, making them more human-like in their ability to interact with humans. | ||
- **Self-Aware AI**: This would be the most advanced type of AI system and is currently hypothetical. In this type of system, a machine would have a defined consciousness and be self-aware. It would be able to make decisions, feel emotions, and act on them based on its own intentions and desires. | ||
|
||
## Applications of AI | ||
|
||
Artificial Intelligence plays a significant role in various fields of computer science and programming. The most popular applications include: | ||
|
||
- **Business**: AI is playing an increasingly important role in businesses. AI-powered tools help collect, analyze, and visualize data efficiently, leading to improved decision-making, productivity, and cost reduction. | ||
- **Healthcare**: AI assists doctors in diagnosing diseases, developing treatments, and providing personalized care to patients. | ||
- **Education**: AI can personalize learning, enhance student engagement, and automate administrative tasks for schools and organizations. | ||
- **Finance**: AI aids financial institutions by personalizing services and products, managing risk and fraud, ensuring compliance, and automating operations to reduce costs. | ||
- **Manufacturing**: AI is used in manufacturing including automating tasks, such as assembly and inspection, optimizing production processes, and can be used to detect defects and improve quality control. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
Title: 'GraphQL' | ||
Description: 'A flexible, efficient API query language that allows clients to request precisely the data they need.' | ||
Subjects: | ||
- 'Computer Science' | ||
- 'Web Development' | ||
Tags: | ||
- 'APIs' | ||
- 'Developer Tools' | ||
- 'Dependency' | ||
- 'Interface' | ||
CatalogContent: | ||
- 'paths/computer-science' | ||
- 'paths/front-end-engineer-career-path' | ||
--- | ||
|
||
**GraphQL** is a modern query language and runtime for [APIs](https://www.codecademy.com/resources/docs/general/api), developed by Facebook in 2012. It provides a more flexible, powerful alternative to traditional [REST](https://www.codecademy.com/resources/docs/general/rest) APIs by enabling clients to define exactly what data they want to retrieve. | ||
|
||
## History | ||
|
||
- Developed internally at Facebook in 2012 to address limitations in mobile application data fetching. | ||
- Open-sourced in 2015, gaining rapid adoption in web and mobile development. | ||
- Created to solve inefficiencies in data retrieval and provide more precise data manipulation. | ||
|
||
## Working | ||
|
||
GraphQL operates through a single endpoint where clients can: | ||
|
||
- Define precise data requirements using a strongly typed schema. | ||
- Request multiple resources in a single query. | ||
- Retrieve exactly the data needed, reducing over-fetching and under-fetching. | ||
- Provide a contract between client and server about data capabilities. | ||
|
||
## GraphQL vs. REST | ||
|
||
| Feature | GraphQL | REST | | ||
| ---------------------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | | ||
| **Data Fetching** | Clients specify the exact data they need | Server defines fixed endpoints returning predefined data | | ||
| **Over-fetching & Under-fetching** | Avoids both by allowing precise queries | Over-fetching (getting more data than needed) and under-fetching (making multiple requests) can occur | | ||
| **Endpoints** | Single endpoint (`/graphql`) for all queries | Multiple endpoints for different resources (`/users`, `/posts`, etc.) | | ||
| **Performance** | Efficient as only required data is fetched | Can be inefficient due to multiple round trips | | ||
| **Flexibility** | Highly flexible; clients control response structure | Less flexible; fixed responses based on server design | | ||
| **Versioning** | No versioning needed; schema evolves dynamically | Often requires versioning (`/v1/users`, `/v2/users`) | | ||
| **Batch Requests** | Can retrieve multiple resources in one request | Requires multiple requests for multiple resources | | ||
| **Real-time Support** | Built-in support via subscriptions | Requires WebSockets or polling for real-time data | | ||
| **Ease of Use** | Requires learning a query language (GraphQL) | Familiar, follows standard HTTP methods (GET, POST, PUT, DELETE) | | ||
| **Error Handling** | Centralized error handling with structured responses | Error handling varies by endpoint and implementation | | ||
| **Caching** | More complex; requires custom caching strategies | Easily cached using HTTP caching mechanisms | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
Title: 'Linux' | ||
Description: 'Free and open-source operating system kernel that forms the foundation of numerous operating systems (distributions).' | ||
Subjects: | ||
- 'Computer Science' | ||
- 'Code Foundations' | ||
Tags: | ||
- 'Developer Tools' | ||
- 'Linux' | ||
- 'Operating Systems' | ||
- 'Unix' | ||
CatalogContent: | ||
- 'paths/computer-science' | ||
- 'paths/code-foundations' | ||
--- | ||
|
||
**Linux** was created by Linus Torvalds in 1991 as an alternative to proprietary Unix systems. It has since grown into a powerful, secure, and highly customizable operating system that powers everything from personal computers to servers, smartphones (Android), and supercomputers. The Linux ecosystem is supported by a vast community of developers and users who contribute to its continuous development and improvement. | ||
|
||
## Working | ||
|
||
Linux operates on a kernel-based architecture, where the kernel manages hardware resources and provides essential services to higher-level software. It supports a multi-user, multi-tasking environment, allowing processes to run concurrently while securely sharing system resources among users. The system follows a hierarchical file structure, starting from the root directory (`/`), where all devices and resources are represented as files. | ||
|
||
## Architecture of Linux | ||
|
||
 | ||
|
||
- Hardware Layer (Core) | ||
|
||
- Contains physical components like CPU, memory, and storage devices | ||
- Forms the base layer, interfacing directly with hardware | ||
|
||
- Kernel Layer | ||
|
||
- Core of the Linux operating system | ||
- Manages hardware resources, memory, and processes | ||
- Provides essential services and hardware abstraction | ||
- Handles system calls and device drivers | ||
|
||
- Shell Layer | ||
|
||
- A command-line interpreter that bridges the user and kernel | ||
- Processes user commands and scripts | ||
- Examples include Bash, Zsh, and Fish | ||
|
||
- Application Layer (Outermost) | ||
- Includes user applications, GUI interfaces, and system utilities | ||
- Supports third-party applications and system tools | ||
|
||
This layered architecture follows a hierarchical structure where each layer communicates with adjacent layers, with the kernel serving as the critical intermediary between hardware and software components. Each outer layer depends on the services provided by the inner layers, creating a robust and modular system design. | ||
|
||
## Linux Commands | ||
|
||
| Command | Description | Example Usage | | ||
| --------- | ---------------------------------------- | ----------------------------- | | ||
| `ls` | List files and directories | `ls -l` | | ||
| `cd` | Changes the current directory | `cd /home/user` | | ||
| `pwd` | Displays the current directory path | `pwd` | | ||
| `mkdir` | Creates a new directory | `mkdir new_folder` | | ||
| `rm` | Deletes files or directories | `rm file.txt` | | ||
| `rmdir` | Removes empty directories | `rmdir empty_folder` | | ||
| `cp` | Copies files or directories | `cp source.txt destination/` | | ||
| `mv` | Moves or rename files and directories | `mv old.txt new.txt` | | ||
| `cat` | Displays file contents | `cat file.txt` | | ||
| `nano` | Edits a file using the nano editor | `nano file.txt` | | ||
| `vim` | Edits a file using the Vim editor | `vim file.txt` | | ||
| `touch` | Creates an empty file | `touch newfile.txt` | | ||
| `chmod` | Modifies file permissions | `chmod 755 script.sh` | | ||
| `chown` | Changes file ownership | `chown user:group file.txt` | | ||
| `find` | Searches for files in a directory | `find /home -name "*.txt"` | | ||
| `grep` | Searches for a pattern inside files | `grep "error" logfile.log` | | ||
| `ps` | Displays running processes | `ps aux` | | ||
| `kill` | Terminates a process by its ID | `kill 1234` | | ||
| `top` | Shows system resource usage in real time | `top` | | ||
| `df` | Shows disk space usage | `df -h` | | ||
| `du` | Shows directory size | `du -sh folder/` | | ||
| `tar` | Archives multiple files | `tar -cvf archive.tar files/` | | ||
| `unzip` | Extracts files from a ZIP archive | `unzip archive.zip` | | ||
| `wget` | Downloads a file from the internet | `wget https://example.com` | | ||
| `curl` | Fetches data from a URL | `curl -O https://example.com` | | ||
| `echo` | Prints text to the terminal | `echo "Hello, World!"` | | ||
| `whoami` | Displays the current logged-in user | `whoami` | | ||
| `uptime` | Shows system uptime | `uptime` | | ||
| `history` | Displays command history | `history` | | ||
| `clear` | Clears the terminal screen | `clear` | |
Oops, something went wrong.