Skip to content

Commit 70e716c

Browse files
committed
Merge branch 'main' into feature/search
2 parents 4d2eb70 + 36b129a commit 70e716c

File tree

7 files changed

+76
-3
lines changed

7 files changed

+76
-3
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Here’s an example for JavaScript:
117117
title: Format Date
118118
description: Formats a date in 'YYYY-MM-DD' format.
119119
author: dostonnabotov
120-
tags: javascript,date,format
120+
tags: date,format
121121
---
122122

123123
```js

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Here's an example for JavaScript:
6363
title: Format Date
6464
description: Formats a date in 'YYYY-MM-DD' format.
6565
author: dostonnabotov
66-
tags: javascript,date,format
66+
tags: date,format
6767
---
6868

6969
```js
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Linear Mapping
3+
description: remaps a value from one range to another
4+
author: JasimAlrawie
5+
tags: math,number-theory,algebra
6+
---
7+
8+
```c
9+
float linearMapping(float value, float minIn, float maxIn, float minOut, float maxOut) {
10+
return (value - minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut;
11+
}
12+
13+
14+
// Usage:
15+
linearMapping(value, 0, 1, 0, 255); // remaps the value from (0,1) to (0,255)
16+
linearMapping(value, 0, PI*2, 0, 360); // remaps the value from rad to deg
17+
linearMapping(value, -1, 1, 1, 8); // remaps the value from (-1,1) to (1,8)
18+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Remove duplicates
3+
description: Removes duplicate elements from an list
4+
author: Mcbencrafter
5+
tags: list,duplicates,unique
6+
---
7+
8+
```java
9+
import java.util.List;
10+
import java.util.stream.Collectors;
11+
12+
public static <T> List<T> removeDuplicates(List<T> list) {
13+
return list.stream()
14+
.distinct()
15+
.collect(Collectors.toList());
16+
}
17+
18+
// Usage:
19+
List<Integer> list = List.of(1, 2, 3, 4, 5, 1, 2, 3, 4, 5);
20+
List<Integer> result = removeDuplicates(list);
21+
System.out.println("List with duplicates removed: " + result); // [1, 2, 3, 4, 5]
22+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Linear Mapping
3+
description: remaps a value from one range to another
4+
author: JasimAlrawie
5+
tags: math,number-theory,algebra
6+
---
7+
8+
```js
9+
function linearMapping(value, minIn, maxIn, minOut, maxOut) {
10+
return (value - minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut
11+
}
12+
13+
// Usage:
14+
linearMapping(value, 0, 1, 0, 255) // remaps the value from (0,1) to (0,255)
15+
linearMapping(value, 0, PI*2, 0, 360) // remaps the value from rad to deg
16+
linearMapping(value, -1, 1, 1, 8) // remaps the value from (-1,1) to (1,8)
17+
```

snippets/python/math-and-numbers/calculate-compound-interest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Calculate Compound Interest
33
description: Calculates compound interest for a given principal amount, rate, and time period.
44
author: axorax
5-
tags: python,math,compound interest,finance
5+
tags: math,compound interest,finance
66
---
77

88
```py
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Linear Mapping
3+
description: remaps a value from one range to another
4+
author: JasimAlrawie
5+
tags: math,number-theory,algebra
6+
---
7+
8+
```py
9+
def linear_mapping(value, min_in, max_in, min_out, max_out):
10+
return (value - min_in) * (max_out - min_out) / (max_in - min_in) + min_out
11+
12+
#Usage:
13+
linear_mapping(value, 0, 1, 0, 255) # remaps the value from (0,1) to (0,255)
14+
linear_mapping(value, 0, PI*2, 0, 360) # remaps the value from rad to deg
15+
linear_mapping(value, -1, 1, 1, 8) # remaps the value from (-1,1) to (1,8)
16+
```

0 commit comments

Comments
 (0)