Skip to content

Commit 01f1792

Browse files
authored
Merge branch 'main' into log2
2 parents 41e8de6 + 123a5ee commit 01f1792

File tree

36 files changed

+2787
-18
lines changed

36 files changed

+2787
-18
lines changed

CONTRIBUTING.md

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@ To link your Codecademy user profile to GitHub:
133133
- Typos/bugs
134134
- Plagiarism
135135

136-
## What is the policy for using generative AI?
137-
138-
We will not accept entries that were exclusively generated through an AI tool. We have this policy because:
139-
140-
- AI-generated content is often confidently incorrect, leading to the spread of inaccurate or misleading information.
141-
- We provide authorship credit for submissions, and to submit AI-generated work under one's own name would be a violation of our plagiarism policy.
142-
- Docs is an educational space for people to learn how to write effective technical documentation. Using generative AI, at this point, negatively impacts that desired learning goal.
143-
144136
## How do we update a PR branch?
145137

146138
To keep your PR branch up to date, navigate to the branch on your fork. Then press `Fetch upstream` and `Fetch and merge`.
@@ -158,10 +150,60 @@ git rebase upstream main
158150
git push
159151
```
160152

161-
## Additional Resources
153+
## Can I use AI tools when contributing?
154+
155+
Yes! You can use AI tools to help create our Docs entries. [Codecademy Docs](https://github.com/Codecademy/docs) is an open-source project designed to help you learn how to contribute to open source, collaborate with the community, and use GitHub. It’s not meant to test whether you can write perfect technical content on your own.
156+
157+
AI can assist you with drafting, rewriting, or structuring content. However, you are responsible for ensuring your work meets Codecademy’s quality and [style standards](https://github.com/Codecademy/docs/blob/main/documentation/content-standards.md). AI is a tool to help you, but it doesn't replace the standards we expect.
158+
159+
You're accountable for all AI-assisted content.
160+
161+
You may use AI to generate drafts or refine your writing, but you must personally review and improve all AI-assisted content before submitting. Every entry must follow:
162+
163+
- [The Docs entry template](https://github.com/Codecademy/docs/blob/main/documentation/term-entry-template.md)
164+
- [Our content standards](https://github.com/Codecademy/docs/blob/main/documentation/content-standards.md)
165+
- [Our style guidelines](https://github.com/Codecademy/docs/blob/main/documentation/style-guide.md)
166+
167+
> **Note:** If we detect plagiarism in your entry, you will be banned from contributing to Docs.
168+
169+
## What you need to verify
170+
171+
Even if AI produced the initial version of the entry, you must ensure that:
172+
173+
- The content is accurate, technically correct, and fact-checked.
174+
- All explanations are clear and aligned with Codecademy Docs writing style.
175+
- Code examples compile or run correctly when required.
176+
- The text is not plagiarized or copied from external sources.
177+
- The final entry sounds intentional, not generic, or filled with filler text.
178+
- The formatting follows the Docs template exactly.
179+
180+
AI output often contains vague definitions, hallucinated details, or inconsistent explanations. You must correct and refine these issues before submitting a pull request.
181+
182+
## Quality standards apply to all entries
183+
184+
Regardless of how you created the content, every entry must:
185+
186+
- Use original wording.
187+
- Include accurate definitions and examples.
188+
- Follow the required structure, headings, and formatting.
189+
- Maintain a simple, educational, and neutral tone.
190+
- Avoid unnecessary complexity or overly broad explanations.
191+
- Fit the scope of a Docs reference entry.
192+
193+
> **Note:** If your submission doesn't meet these standards, we'll ask you to revise it.
194+
195+
## What happens during review?
196+
197+
Maintainers (Codecademy’s content team who reviews all contributions) may request edits on any AI-assisted entry if it:
198+
199+
- Does not follow our template.
200+
- Contains unclear, generic, or contradictory information.
201+
- Includes mistakes or technical inaccuracies.
202+
- Appears copied.
203+
- Lacks the clarity expected from Docs entries.
162204

163-
- [How to Contribute to Docs](https://dev.to/codecademy/how-to-contribute-to-codecademy-docs-1a77) article
205+
You're expected to respond to feedback and make the requested improvements within 1 week, or your PR will be closed due to inactivity.
164206

165-
Remember, if you ever have any questions at all, we're always here to help in the [Codecademy Forums](https://discuss.codecademy.com/c/community/community-docs/2205) and [Codecademy Discord](https://discord.com/invite/codecademy).
207+
Remember, if you ever have any questions at all, we're always here to help in the [Codecademy Forums](https://community.codecademy.com/).
166208

167209
If you find any bugs or errors in the content, feel free to file an issue [here](https://github.com/Codecademy/docs/issues/new?assignees=Name+here&labels=bug&template=bug_reports.yml&title=%5BBug%2FError%5D+Subject%3A+Entry+Name)! 🖖

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Here's how you can contribute to Codecademy Docs:
5656
- Submit your work:
5757
- Submit a Pull Request of your entry for your assigned Issue.
5858
- Collaborate and provide feedback:
59-
- Reply to the thread on [Possible Content Discussion](https://discuss.codecademy.com/t/find-a-starting-point-possible-content-discussion/745868) to share ideas and collaborate with other contributors, maintainers, or super users to determine good future issues.
59+
- Reply to the thread on [Possible Content Discussion](https://community.codecademy.com/) to share ideas and collaborate with other contributors, maintainers, or super users to determine good future issues.
6060
- Share your thoughts in this [Docs feedback form](https://codecademyready.typeform.com/to/hzVIWDgz) to tell us how we can improve Docs!
6161

6262
Whether you are a code newbie or a seasoned hacker, there's something for you!

bin/concept-of-the-week.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
content/kotlin/concepts/operators/operators.md
1+
content/uiux/concepts/quantitative-research/quantitative-research.md

content/c-sharp/concepts/math-functions/terms/abs/abs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
Title: 'Abs()'
2+
Title: '.Abs()'
33
Description: 'Returns the absolute value of a specified number.'
44
Subjects:
55
- 'Computer Science'
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
Title: 'Acosh()'
3+
Description: 'Returns the inverse hyperbolic cosine of a specified number.'
4+
Subjects:
5+
- 'Computer Science'
6+
- 'Web Development'
7+
Tags:
8+
- 'Functions'
9+
- 'Math'
10+
- 'Methods'
11+
- 'Numbers'
12+
CatalogContent:
13+
- 'learn-c-sharp'
14+
- 'paths/computer-science'
15+
---
16+
17+
The **`Math.Acosh()`** method returns the inverse hyperbolic cosine (also known as hyperbolic arccosine) of a specified number. It computes the value whose hyperbolic cosine equals the given number.
18+
19+
## Syntax
20+
21+
```pseudo
22+
Math.Acosh(number);
23+
```
24+
25+
**Parameters:**
26+
27+
- `number`: A double-precision floating-point value greater than or equal to `1`, for which to compute the inverse hyperbolic cosine.
28+
29+
**Return value:**
30+
31+
- The inverse hyperbolic cosine of the specified number in radians as a `double`.
32+
- `NaN` if the input is less than `1` or `NaN`.
33+
34+
## Example: Basic Usage of `Math.Acosh()`
35+
36+
This example calculates the inverse hyperbolic cosine of a number using `Math.Acosh()` and displays the result in radians:
37+
38+
```cs
39+
using System;
40+
41+
public class Example
42+
{
43+
public static void Main()
44+
{
45+
double number = 1.5;
46+
double result = Math.Acosh(number);
47+
Console.WriteLine($"Math.Acosh({number}) = {result} radians");
48+
}
49+
}
50+
```
51+
52+
This example outputs the following:
53+
54+
```shell
55+
Math.Acosh(1.5) = 0.9624236501192069 radians
56+
```
57+
58+
## Codebyte Example
59+
60+
In this example, the `Math.Acosh()` method is used to calculate the inverse hyperbolic cosine of a specified number in radians and degrees:
61+
62+
```codebyte/csharp
63+
using System;
64+
65+
public class Example {
66+
public static void Main() {
67+
double number = 100.0;
68+
69+
// Calculate Acosh in radians
70+
double resultRadians = Math.Acosh(number);
71+
72+
// Convert radians to degrees
73+
double resultDegrees = resultRadians * (180.0 / Math.PI);
74+
75+
// Display results
76+
Console.WriteLine($"Math.Acosh({number}) = {resultRadians} radians");
77+
Console.WriteLine($"Math.Acosh({number}) = {resultDegrees} degrees");
78+
}
79+
}
80+
```
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
Title: 'Atanh()'
3+
Description: 'Returns the inverse hyperbolic tangent of a number.'
4+
Subjects:
5+
- 'Computer Science'
6+
- 'Code Foundations'
7+
Tags:
8+
- 'Arithmetic'
9+
- 'Methods'
10+
- 'Numbers'
11+
CatalogContent:
12+
- 'learn-c-sharp'
13+
- 'paths/computer-science'
14+
---
15+
16+
The **`Math.Atanh()`** method returns the inverse hyperbolic tangent (hyperbolic arctangent) of a specified number. The inverse hyperbolic tangent is the value whose hyperbolic tangent is the input number.
17+
18+
## Syntax
19+
20+
```pseudo
21+
Math.Atanh(value);
22+
```
23+
24+
**Parameters:**
25+
26+
- `value`: A double-precision floating-point number in the range `-1` to `1`, representing the hyperbolic tangent value.
27+
28+
**Return value:**
29+
30+
The `Math.Atanh()` method returns the inverse hyperbolic tangent of the given `value` as a `double`.
31+
32+
It returns:
33+
34+
- `NaN` (Not a Number) if the `value` is less than `-1` or greater than `1`.
35+
- `NegativeInfinity` if the `value` is exactly `-1`.
36+
- `PositiveInfinity` if the `value` is exactly `1`.
37+
38+
## Example: Basic Usage of `Math.Atanh()`
39+
40+
The following example demonstrates the basic usage of `Math.Atanh()`:
41+
42+
```cs
43+
using System;
44+
45+
class Program
46+
{
47+
static void Main()
48+
{
49+
double value = 0.5;
50+
double result = Math.Atanh(value);
51+
Console.WriteLine($"Atanh({value}) = {result}");
52+
}
53+
}
54+
```
55+
56+
This will output:
57+
58+
```shell
59+
Atanh(0.5) = 0.5493061443340548
60+
```
61+
62+
## Codebyte Example
63+
64+
In this example, different values are passed to `Math.Atanh()` to observe how the result changes:
65+
66+
```codebyte/csharp
67+
using System;
68+
69+
class Program
70+
{
71+
static void Main()
72+
{
73+
double[] testValues = { 0.25, 0.5, 0.75, 0.9, -0.5 };
74+
75+
foreach (double value in testValues)
76+
{
77+
double result = Math.Atanh(value);
78+
Console.WriteLine($"Atanh({value}) = {result:F4}");
79+
}
80+
}
81+
}
82+
```
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
Title: '.BigMul()'
3+
Description: 'Multiplies two integer values and returns the full extended result to prevent overflow.'
4+
Subjects:
5+
- 'Computer Science'
6+
- 'Code Foundations'
7+
Tags:
8+
- 'Methods'
9+
- 'Numbers'
10+
- 'Arithmetic'
11+
CatalogContent:
12+
- 'learn-c-sharp'
13+
- 'paths/computer-science'
14+
---
15+
16+
The **`Math.BigMul()`** method multiplies two integer values and returns the full extended result to avoid overflow. It ensures that the product fits within a larger data type when the operands are 32-bit or 64-bit integers.
17+
18+
## Syntax
19+
20+
```pseudo
21+
Math.BigMul(x, y);
22+
```
23+
24+
**Parameters:**
25+
26+
- `x`, `y`: The integers to be multiplied. These can be of type `int`, `uint`, `long`, or `ulong`.
27+
28+
**Return value:**
29+
30+
Returns the full product of `x` and `y` as a single 64-bit or 128-bit integer, depending on the input type:
31+
32+
- If `x` and `y` are of type `int` or `uint`, the return type is `long` and `ulong`, respectively.
33+
- If `x` and `y` are of type `long` or `ulong`, the return type is `Int128` and `UInt128`, respectively.
34+
35+
> **Note:** The `Int128` and `UInt128` types were introduced in .NET 7. In earlier versions, `Math.BigMul(long, long, out long high)` can be used to obtain the high and low 64-bit parts of the product.
36+
37+
## Example: Basic Usage
38+
39+
In this example, the full product of two `int` values is calculated without overflow:
40+
41+
```cs
42+
using System;
43+
44+
public class Example {
45+
public static void Main() {
46+
// Integer values (32-bit)
47+
int intX = 100000;
48+
int intY = 500000;
49+
50+
// Compute the product safely
51+
long intResult = Math.BigMul(intX, intY);
52+
53+
Console.WriteLine($"Math.BigMul({intX}, {intY}) = {intResult}");
54+
}
55+
}
56+
```
57+
58+
This example outputs the following:
59+
60+
```shell
61+
Math.BigMul(100000, 500000) = 50000000000
62+
```
63+
64+
## Codebyte Example
65+
66+
The following example demonstrates the use of `Math.BigMul()` to calculate the product of two integers that would normally cause an overflow with standard multiplication:
67+
68+
```codebyte/csharp
69+
using System;
70+
71+
public class Example {
72+
public static void Main (string[] args) {
73+
int x = 200000;
74+
int y = 300000;
75+
76+
// Normal multiplication (overflow)
77+
int normalResult = x * y;
78+
79+
// Math.BigMul() (no overflow)
80+
long bigMulResult = Math.BigMul(x, y);
81+
82+
Console.WriteLine($"Normal multiplication (overflow): {normalResult}");
83+
Console.WriteLine($"BigMul (no overflow): {bigMulResult}");
84+
}
85+
}
86+
```

0 commit comments

Comments
 (0)