- Understand model relationships in MongoDB
- Understand One-to-Many relationships
This file contains hidden or 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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "Data Seeding Schema", | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"model": { "type": "string" }, | |
"rows": { | |
"type": "array", |
This file contains hidden or 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
error[E0277]: the trait bound `fn(teloxide::Bot, teloxide::prelude::Dialogue<State, InMemStorage<State>>, Arc<std::sync::RwLock<context::Context>>, teloxide::prelude::Message) -> impl std::future::Future<Output = Result<(), Box<(dyn StdError + Send + Sync + 'static)>>> {start}: Injectable<_, _, _>` is not satisfied | |
--> src/chatbot/mod.rs:118:58 | |
| | |
118 | .branch(dptree::case![State::Start].endpoint(start)) | |
| -------- ^^^^^ the trait `Injectable<_, _, _>` is not implemented for fn item `fn(teloxide::Bot, teloxide::prelude::Dialogue<State, InMemStorage<State>>, Arc<std::sync::RwLock<context::Context>>, teloxide::prelude::Message) -> impl std::future::Future<Output = Result<(), Box<(dyn StdError + Send + Sync + 'static)>>> {start}` | |
| | | |
| required by a bound introduced by this call | |
| | |
= help: the following other types implement trait `I |
This file contains hidden or 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
{ | |
"status": "success", | |
"code": 200, | |
"message": "success", | |
"data": { | |
"rooms": [ | |
{ | |
"id": 631, | |
"icon": "no_icon", | |
"is_root": true, |
This file contains hidden or 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
package main | |
import "fmt" | |
//define the download() function | |
func download(value int, ch chan int) { | |
sum :=0 | |
for i:=0; i <= value; i++ { | |
sum +=i | |
} |
This file contains hidden or 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
package main | |
import "fmt" | |
func main() { | |
var lastResult string | |
var sum int | |
fmt.Scanln(&lastResult) | |
results := []string{"w", "l", "w", "d", "w", "l", "l", "l", "d", "d", "w", "l", "w", "d"} | |
for _, val := range append(results, lastResult) { |
This file contains hidden or 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
package main | |
import "fmt" | |
type Timer struct { | |
id string | |
value int | |
} | |
func (t *Timer) tick() { | |
t.value +=1 |
This file contains hidden or 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
package main | |
import "fmt" | |
func mars_age(age int) int { | |
return age * 365/687 | |
} | |
func main() { | |
var age int | |
fmt.Scanln(&age) |
This file contains hidden or 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
package main | |
import "fmt" | |
func getUserInput(input interface{}) (int, error) { | |
var err error | |
switch t := input.(type) { | |
case *int: | |
_, err = fmt.Scanf("%d", input) | |
case *string: |
This file contains hidden or 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
REMIX EXAMPLE PROJECT | |
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
It contains 3 directories: | |
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
SCRIPTS |
NewerOlder