forked from root/public
Compare commits
3 Commits
master
...
update-que
Author | SHA1 | Date |
---|---|---|
davidrobert99 | c827abed4c | 2 years ago |
davidrobert99 | 4fcef1eed3 | 2 years ago |
davidrobert99 | 8a8cb9e482 | 2 years ago |
273 changed files with 2792 additions and 3977 deletions
@ -1,25 +1,12 @@
|
||||
# Server requirements (Minimum) |
||||
# Server requirements |
||||
|
||||
Features required: |
||||
|
||||
- Dedicated hardware components (kept in **data centre** conditions) |
||||
- Compatibility with **Linux (Debian x64)** |
||||
- Dedicated hardware |
||||
- Linux compatible |
||||
|
||||
| Component | Specification | |
||||
| --------- | ---------------------------------------------------------------------------------- | |
||||
| Processor | 8 threads x86-64 (64 bits), [2200 single thread performance](https://www.cpubenchmark.net/singleThread.html) / [1000 single-core score](https://browser.geekbench.com/processor-benchmarks) | |
||||
| Memory | 16 GB DDR4 | |
||||
| Storage | 2 x 500 GB SSD (`RAID 1` for _redundancy_ or `RAID 0` for _performance/capacity_) | |
||||
|
||||
# Server requirements (Recommended) |
||||
|
||||
Features required: |
||||
|
||||
- Dedicated hardware components (kept in **data centre** environment) |
||||
- Compatibility with **Linux (Debian x64)** |
||||
|
||||
| Component | Specification | |
||||
| --------- | ---------------------------------------------------------------------------------- | |
||||
| Processor | 10 threads x86-64 (64 bits), [2600 single thread performance](https://www.cpubenchmark.net/singleThread.html) / [1200 single-core score](https://browser.geekbench.com/processor-benchmarks) | |
||||
| Memory | 32 GB ECC DDR4 | |
||||
| Storage | 2 x 500 GB SSD (`RAID 1` for _redundancy_ or `RAID 0` for _performance/capacity_) | |
||||
| Component | Minimum specifications | |
||||
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
||||
| Processor | 8 threads x86-64 (64 bits), [2200 single thread performance](https://www.cpubenchmark.net/singleThread.html) / [1000 single-core score](https://browser.geekbench.com/processor-benchmarks) | |
||||
| Memory | 16 GB DDR4 | |
||||
| Disk | 2 \* 500 GB SSD | |
||||
|
@ -1,43 +0,0 @@
|
||||
## add-if-positive |
||||
|
||||
### Instructions |
||||
Write a function that takes two numbers and adds them together if they are both positive. |
||||
- If either number is negative or one of them is negative and the other is positive return `0`. |
||||
|
||||
### Expected function |
||||
```go |
||||
func AddIfPositive(a int, b int) int { |
||||
// your code here |
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import "fmt" |
||||
|
||||
func main() { |
||||
fmt.Println(AddIfPositive(1, 2)) |
||||
fmt.Println(AddIfPositive(1, -2)) |
||||
fmt.Println(AddIfPositive(-1, 2)) |
||||
fmt.Println(AddIfPositive(-1, -2)) |
||||
fmt.Println(AddIfPositive(10,20)) |
||||
fmt.Println(AddIfPositive(0,20)) |
||||
} |
||||
``` |
||||
|
||||
and the output should be: |
||||
|
||||
```console |
||||
$ go run . |
||||
3 |
||||
0 |
||||
0 |
||||
0 |
||||
30 |
||||
20 |
||||
``` |
@ -1,46 +0,0 @@
|
||||
## alpha-position |
||||
|
||||
### Instructions |
||||
|
||||
Write a function named `AlphaPosition` that takes an alphabetical character as a parameter and returns the position of the letter in the alphabet. |
||||
- If the character is not in the alphabet, return -1 |
||||
- If the character is in the alphabet, return the position of the letter in the alphabet |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func AlphaPosition(c rune) int { |
||||
// your code goes here |
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import "fmt" |
||||
|
||||
func main(){ |
||||
fmt.Println(AlphaPosition('a')) |
||||
fmt.Println(AlphaPosition('z')) |
||||
fmt.Println(AlphaPosition('B')) |
||||
fmt.Println(AlphaPosition('Z')) |
||||
fmt.Println(AlphaPosition('0')) |
||||
fmt.Println(AlphaPosition(' ')) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```console |
||||
$ go run . | cat -e |
||||
1$ |
||||
26$ |
||||
2$ |
||||
26$ |
||||
-1$ |
||||
-1$ |
||||
``` |
@ -1,43 +0,0 @@
|
||||
## array-sum |
||||
|
||||
### Instructions |
||||
|
||||
Write a function that takes an array of numbers and returns the sum of all the numbers in the array. |
||||
- If the array is empty, the function should return 0. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func SumArray(numbers []int) int { |
||||
// your code here |
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
) |
||||
|
||||
func main(){ |
||||
fmt.Println(SumArray([]int{1,2,3,4,5})) |
||||
fmt.Println(SumArray([]int{})) |
||||
fmt.Println(SumArray([]int{-1,-2,-3,-4,-5})) |
||||
fmt.Println(SumArray([]int{-1,2,3,4,-5})) |
||||
} |
||||
``` |
||||
|
||||
and the output should be: |
||||
|
||||
```console |
||||
$ go run . |
||||
15 |
||||
0 |
||||
-15 |
||||
3 |
||||
``` |
@ -1,38 +0,0 @@
|
||||
## ascii |
||||
|
||||
### Instructions |
||||
|
||||
Write a function that receives a string and returns a slice with the ASCII values of its characters. If the string is empty it should return an empty slice. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func Ascii(str string) []byte { |
||||
|
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"piscine" |
||||
"fmt" |
||||
) |
||||
|
||||
func main() { |
||||
l := piscine.Ascii("Hello") |
||||
fmt.Println(l) |
||||
} |
||||
``` |
||||
|
||||
And its output: |
||||
|
||||
```console |
||||
$ go run . |
||||
[104 101 108 108 111] |
||||
``` |
@ -1,46 +0,0 @@
|
||||
## between-us |
||||
|
||||
### Instructions |
||||
|
||||
Write a function named `BetweenUs` that takes 3 paramters and return : |
||||
- If the first paramter is between the second and third paramters, return **true** else return **false** |
||||
- If the second parameter is bigger than the third return **false** |
||||
|
||||
### Expected function |
||||
```go |
||||
func BetweenUs(num, min, max int) bool { |
||||
// Your code here |
||||
} |
||||
``` |
||||
|
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import "fmt" |
||||
|
||||
func main(){ |
||||
fmt.Println(BetweenUs(1, 2, 3)) |
||||
fmt.Println(BetweenUs(1, 1, 3)) |
||||
fmt.Println(BetweenUs(1, 3, 3)) |
||||
fmt.Println(BetweenUs(1, 1, 1)) |
||||
fmt.Println(BetweenUs(1, 2, 1)) |
||||
fmt.Println(BetweenUs(-1, -10, 0)) |
||||
} |
||||
``` |
||||
|
||||
and the output should be: |
||||
|
||||
```console |
||||
$ go run . |
||||
false |
||||
true |
||||
false |
||||
true |
||||
false |
||||
true |
||||
``` |
@ -1,47 +0,0 @@
|
||||
## binary-addition |
||||
|
||||
### Instructions |
||||
|
||||
Write a function named `BinaryAddition(int,int)` that takes two integers and returns the sum of the two in binary in an array of `int`. |
||||
- If one of the integers is negative return `nil` |
||||
- Convert the argument to binary then add the two binary numbers together |
||||
|
||||
### Expected function |
||||
```go |
||||
func BinaryAddition(a int, b int) []int { |
||||
// your code here |
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import "fmt" |
||||
|
||||
|
||||
func main(){ |
||||
fmt.Println(BinaryAddition(1, 1)) |
||||
fmt.Println(BinaryAddition(1, 2)) |
||||
fmt.Println(BinaryAddition(1, 3)) |
||||
fmt.Println(BinaryAddition(2, 1)) |
||||
fmt.Println(BinaryAddition(2, 2)) |
||||
fmt.Println(BinaryAddition(1, 16)) |
||||
} |
||||
``` |
||||
|
||||
and the output should be: |
||||
|
||||
```console |
||||
$ go run . |
||||
[1 0] |
||||
[1 1] |
||||
[1 0 0] |
||||
[1 1] |
||||
[1 0 0] |
||||
[1 0 1] |
||||
[1 0 0 0 1] |
||||
``` |
@ -1,8 +1,14 @@
|
||||
## Bloody Sunday |
||||
|
||||
### Instructions |
||||
Let's get rid of Sundays, by removing them from the calendar. So now a week is only 6 days in length, from `"Monday"` to `"Saturday"`. |
||||
|
||||
Create a function named `bloodySunday` which accepts a `Date`, and returns teh weekday as a `string`. |
||||
You were missioned to make the world more productive. |
||||
Your solution ? no more sundays, |
||||
you are ask to remove them from the existing calendar. |
||||
|
||||
> 01/01/0001 is a Monday. |
||||
So now, a week is 6 days from monday to saturday. |
||||
|
||||
To prove your point, create a `bloodySunday` function |
||||
that return what week day the given date is. |
||||
|
||||
> note that the 01/01/0001 is still a monday. |
||||
|
@ -1,49 +1,29 @@
|
||||
#### Functional |
||||
|
||||
##### Run the program using `cargo run`. |
||||
##### Run the program using `cargo run` |
||||
|
||||
###### Does it compile and run without warnings? |
||||
###### Does it compile and run without any warnings? |
||||
|
||||
##### Left click on the canvas to set one or more control points. |
||||
##### Left click in three different positions in the canvas |
||||
|
||||
###### Does the program allow you to mark these control points? |
||||
###### Does the program draw a small circle surrounding the area where you clicked? |
||||
|
||||
###### Can you confirm that the program draws a small circle around the control points in order to identify them? |
||||
##### Press `Return` |
||||
|
||||
##### Left click on the canvas to set three or more control points and press `Enter`. |
||||
###### Does the animation of the Chaikin's algorithm starts? |
||||
|
||||
###### Does the animation of the Chaikin's algorithm start? |
||||
###### Does the animations the animation completes 7 steps before starting again? |
||||
|
||||
##### Press `Escape` to exit the program. |
||||
##### Press `Escape` |
||||
|
||||
###### Does the program exit without errors? |
||||
|
||||
##### Start the program and left click on the canvas to set just one control point and press `Enter`. |
||||
##### Run the program again and this time press `Return` without selecting any points |
||||
|
||||
###### Can you confirm that only the control point is shown and nothing changes? |
||||
|
||||
##### Restart the program and left click on the canvas to set just two control points and press `Enter`. |
||||
|
||||
###### Can you confirm that only a straight line was drawn? |
||||
|
||||
##### Restart the program and left click on the canvas to set three or more control points and press `Enter`. |
||||
|
||||
###### Does the animation complete 7 steps before restarting? |
||||
|
||||
##### Restart the program and left click on the canvas to set three or more control points and press `Enter`. Then press `Escape` to exit the program. |
||||
|
||||
###### Does the program exit without errors? |
||||
|
||||
##### Start the program and press `Enter` without selecting any points. |
||||
|
||||
###### Does the program continue without errors? |
||||
|
||||
###### After you pressed `Enter` before selecting points, is it possible to place points without needing to kill the program? |
||||
###### Is the program still running? |
||||
|
||||
##### Bonus |
||||
|
||||
###### +When you pressed `Enter` without drawing any points, was a message displayed to inform you that you forgot to draw any points? |
||||
|
||||
###### +Is it possible to clear the screen and add new control points without killing and relaunching the program? |
||||
###### +Are you able to clear the screen and add new control points without killing and relaunching the program? |
||||
|
||||
###### +Is it possible to drag the control points in real time and get a new curve? |
||||
###### +Are you able to drag the control points in real time and get a new curve? |
||||
|
@ -1,30 +1,35 @@
|
||||
## clonernews |
||||
|
||||
### Objectives |
||||
Technology is a rapidly evolving sector. As a programmer, it is not always easy to keep up to date with every new advancement. |
||||
|
||||
Tech news (like Hacker News) is a really great way to keep up to date with the exponential evolution of technology, as well as tech jobs and much more. Some websites do not offer very appealing propositions to consume their media. |
||||
Technology nowadays continue to evolve. As a programmer or developer you must be updated with this exponential evolution of technology. |
||||
|
||||
So your objective for this raid is to create an UI for the [HackerNews API](https://github.com/HackerNews/API). |
||||
This is where tech news shines, just like Hacker News where you can see all about new technology, jobs and much more, but some websites do not perform very well or their are not so appealing. |
||||
|
||||
So your objective for this raid is to create an UI for [`HackerNewsAPI`](https://github.com/HackerNews/API). |
||||
|
||||
You must handle at least: |
||||
- Posts: including: |
||||
|
||||
- Posts, this includes : |
||||
- [stories](https://github.com/HackerNews/API#ask-show-and-job-stories) |
||||
- [jobs](https://github.com/HackerNews/API#ask-show-and-job-stories) |
||||
- [polls](https://github.com/HackerNews/API#items) |
||||
- [comments](https://github.com/HackerNews/API#items): each comment must have the proper post parent. |
||||
- [comments](https://github.com/HackerNews/API#items), each comment must have the proper post parent. |
||||
|
||||
Post and comments must be ordered by newest post to oldest. |
||||
You must not load all posts at once, so that you only load posts once the users need to see more posts. This can be done with the help of [events](https://developer.mozilla.org/en-US/docs/Web/Events). |
||||
You must not load all posts at once. You must be able to load posts when ever the users need to see more posts. This can be done with the help of [event](https://developer.mozilla.org/en-US/docs/Web/Events). |
||||
|
||||
[Live Data](https://github.com/HackerNews/API#live-data) : is one of the features from this Hacker News API, you can handle requests so that the news you provide are updated. |
||||
|
||||
- You must have a section that present the newest information. You will have to notify the user at least every 5 seconds, whenever the live data is updated. In other words, after every 5 seconds if a change was made in the live data, you have to notify the user. |
||||
|
||||
The point of the project is to keep users updated, so we'll need to inform our users of changes to the data using [Live Data](https://github.com/HackerNews/API#live-data). Create a section that presents the newest information. You'll need to notify the user at least every 5 seconds, whenever the live data is updated. |
||||
Currently this API does not present [rate limit](https://en.wikipedia.org/wiki/Rate_limiting). But that does not mean you should abuse/overload the API!!! |
||||
|
||||
Currently this API does not present a [rate limit](https://en.wikipedia.org/wiki/Rate_limiting), but that does not mean that you should abuse or overload the API. |
||||
Best ways you can avoid rate limiting : |
||||
|
||||
Best ways you can avoid rate limiting: |
||||
- optimize your code to eliminate any unnecessary requests |
||||
- usage of a throttling/debouncing function to regulate the number of requests, |
||||
- usage of throttling/debouncing function to regulates the amount of requests |
||||
|
||||
### Optional |
||||
|
||||
You can handle sub-comments for stories, jobs and polls, by implementing nested comments. |
||||
You can handle sub-comments for each stories, jobs and polls this meaning nested comments |
||||
|
@ -1,40 +0,0 @@
|
||||
## count-negative |
||||
|
||||
### Instructions |
||||
|
||||
Write a function that takes an array of integers and returns the number of negative numbers in the array. |
||||
- If the array is empty, the function should return `0`. |
||||
|
||||
### Expected function |
||||
```go |
||||
func CountNegative(numbers []int) int { |
||||
// your code here |
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import "fmt" |
||||
|
||||
func main(){ |
||||
fmt.Println(CountNegative([]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10})) |
||||
fmt.Println(CountNegative([]int{-1, -2, -3, -4, -5, -6, -7, -8, -9, -10})) |
||||
fmt.Println(CountNegative([]int{})) |
||||
fmt.Println(CountNegative([]int{-1,2,0,-3})) |
||||
} |
||||
``` |
||||
|
||||
and the output should be: |
||||
|
||||
```console |
||||
$ go run . |
||||
0 |
||||
10 |
||||
0 |
||||
2 |
||||
``` |
@ -1,41 +0,0 @@
|
||||
## Devisor |
||||
|
||||
### Instructions |
||||
|
||||
Write a function that takes a positive integer and returns the number of it's devisors. |
||||
- If the the number a is negative return 0. |
||||
- Test numbers from 0 to 99999999 . |
||||
|
||||
### Expected function |
||||
```go |
||||
func Divisors(n int) int { |
||||
... |
||||
} |
||||
``` |
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
"piscine" |
||||
) |
||||
|
||||
func main() { |
||||
fmt.Println(piscine.Divisors(4))// 4 can be divided by 1 and 2 and 4 |
||||
fmt.Println(piscine.Divisors(5))//5 can be divided by 1 and 5 |
||||
} |
||||
|
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
|
||||
```console |
||||
$ go run . |
||||
3 |
||||
2 |
||||
``` |
Before Width: | Height: | Size: 146 KiB |
Some files were not shown because too many files changed in this diff diff.show_more
Loading…
Reference in new issue