Tag:Video tutorial

  • Rust programming video tutorial (Advanced) – 004_ 5 example of life cycle

    Time:2021-11-10

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Explanation content Combining generic parameters, trait boundaries, and lifecycle use std::fmt::Display; fn longest_with_an_announcement<‘a, T>(x: &’a str, y: &’a str, ann: T) -> &’a str where T: Display { println!(“Announcement! {}”, ann); if x.len() > y.len() { x } else { y } } fn main() { let s1 = […]

  • Rust programming video tutorial (Advanced) – 003_ 3 custom iterator

    Time:2021-11-7

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Explanation content 1. Implement iterator trait to create custom iteratorsexample: struct Counter { count: u32, } impl Counter { fn new() -> Counter { Counter { count: 0 } } } //Implement custom iterators impl Iterator for Counter { type Item = u32; fn next(&mut self) -> Option<Self::Item> { […]

  • Rust programming video tutorial corresponding explanation content – Option

    Time:2021-11-6

    Video address Headline address:https://www.ixigua.com/i676544267458235648…Station B address:https://www.bilibili.com/video/av78062009?…Netease cloud classroom address:https://study.163.com/course/introduction…. Explanation content 1. Option is an enumeration defined by the standard library. enum Option<T> { Some(T), None, } 2. Use examples let some_number = Some(5); let some_string = Some(“a string”); let absent_number: Option<i32> = None; let x: i8 = 5; let y: Option<i8> = Some(5); let […]

  • Rust programming video tutorial (Advanced) – 005_ 2 use closures with generics and FN trait

    Time:2021-11-4

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Explanation content Example: / / implement a cache, process the first incoming value and save it struct Cacher<T> Where t: FN (U32) – > U32 // generics and FN trait { Calculation: T, // T is a closure value: Option<u32>, } impl<T> Cacher<T> where T: Fn(u32) -> u32 { […]

  • Rust programming video tutorial (Advanced) – 007_ Release and withdrawal of 4crate

    Time:2021-10-31

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Explanation content Release and withdrawal of crate (this part has not been actually operated)(1) Create crites.io account: register through GitHub account and register through cargo login**Come and log in(2) Before publishing, you need to add a description in cargo.toml: [package] name = “package_name” version = “0.1.0” License = “MIT” […]

  • Rust programming video tutorial (Advanced) – 007_ 1 review using external package examples

    Time:2021-10-29

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Explanation content You can share code with others by publishing packages. Crites.io is used to distribute the source code of the contract, so it mainly hosts open source code. reviewWhen we used trust crypto earlier, we directly added the following in cargo.toml: [dependencies] rust-crypto = “0.2” Use someone else’s […]

  • 15 best websites for learning angularjs

    Time:2021-10-25

    Angularjs is an excellent front-end JS development framework, which can help you quickly prompt your abilities and simplify the code when you develop applications. Mastering angularjs can help you prompt the usability of your application and realize other functions that are considered impossible in the scientific and technological community. We are not unfamiliar with the […]

  • Rust programming video tutorial (Advanced) – 011_ 2. Custom box

    Time:2021-10-22

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Source address GitHub address:https://github.com/anonymousGiga/learn_rus… Explanation content Custom smart pointer mybox: implement deref trait//+++++++Error code+++++++++++++++++ struct MyBox<T>(T); impl<T> MyBox<T> { fn new(x: T) -> MyBox<T> { MyBox(x) } } fn main() { let x = 5; let y = MyBox::new(x); assert_eq!(5, x); assert_eq!(5, *y); } //+++++++++Correct code++++++++++++++++ //Implement deref train […]

  • Rust programming video tutorial corresponding explanation content – Test

    Time:2021-10-20

    Video address Headline address:https://www.ixigua.com/i676544267458235648…Station B address:https://www.bilibili.com/video/av78062009?…Netease cloud classroom address:https://study.163.com/course/introduction…. Explanation content 1. Write test #[cfg(test)] mod tests { #[test] fn it_works() { assert_eq!(2 + 2, 4); } } 2. Run test cargo test 3. Using the assert macro std::assert! std::assert_eq! std::assert_ne! rust Video tutorial Trust programming language This work adoptsCC agreement, reprint must indicate the […]

  • Rust programming video tutorial (Advanced) – 012_ 2 call drop in advance.

    Time:2021-10-18

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Source address GitHub address:https://github.com/anonymousGiga/learn_rus… Explanation content Discard the value early through STD:: MEM:: drop. When cleaning in advance is required, instead of directly calling the drop method, the STD:: MEM:: drop method is called, for example: struct Dog { name: String, } //The following is a drop trait implementation […]

  • Rust programming video tutorial (Advanced) – 015_ 2 weak reference

    Time:2021-10-12

    Video address Headline address:https://www.ixigua.com/i677586170644791348…Station B address:https://www.bilibili.com/video/av81202308/ Source address GitHub address:https://github.com/anonymousGiga/learn_rus… Explanation content Creating tree data structure with weak(1) Define structure use std::rc::{Rc, Weak}; use std::cell::RefCell; #[derive(Debug)] struct Node { value: i32, parent: RefCell<Weak<Node>>, children: RefCell<Vec<Rc<Node>>>, } (2) Use example fn main() { let leaf = Rc::new(Node { value: 3, parent: RefCell::new(Weak::new()), children: RefCell::new(vec![]), }); println!(“leaf […]

  • The symfony5 video tutorial recorded by yourself can be shared for free.

    Time:2021-10-7

    As a symfony developer, there are too few symfony Chinese materials in China. You can only read English documents and English tutorials.Across the steep learning curve of symfony (mainly because there are few Chinese materials and learning is troublesome), I have a deeper understanding of symfony framework.I have recorded a set of symfony video tutorials. […]