Skip to content

Instantly share code, notes, and snippets.

View aucker's full-sized avatar
🎯
Focusing

Aucker aucker

🎯
Focusing
View GitHub Profile
@aucker
aucker / markdown.md
Last active March 14, 2023 02:39
this is a markdown file

this is a markdown file

and you can use the

it is easy to use markdown to make some word bold or make other word italic. You can even link to Google!

Basics

Unordered lists

  • Item 1
  • Item 2
    • Item 2a
  • Item 2b
总而言之,我们以后的作战计划是宣传我们的新信仰,是宣传我们的新人生观(我所谓“人生观”,依唐擘黄先生的界说,包括吴稚晖先生所谓“宇宙观”)。
这个新人生观的大旨,吴稚晖先生已宣布过了。我们总括他的大意,加上一点扩充和补充,在这里再提出这个新人生观的轮廓:
一、 根据于天文学和物理学的知识,叫人知道空间的无穷之大。
二、 根据于地质学及古生物学的知识,叫人知道时间的无穷之长。
三、 根据一切科学,叫人知道宇宙及其中万物的运行变迁皆是自然的,自己如此的,————正用不着什么超自然的主宰或造物者。
四、 根据于生物的科学的知识,叫人知道生物界的生存竞争的浪费与惨酷,————因此,叫人更可以明白那“有好生之德”的主宰的假设是不能成立的。
五、 根据于生物学,生理学,心理学的知识,叫人知道人不过是动物的一种,他和别的动物只有程度的差异,并无种类的区别。
六、 根据于生物的科学及人类学,人种学,社会学的知识,叫人知道生物及人类社会演进的历史和演进的原因。
七、 根据于生物的及心理的科学,叫人知道一切心理的现象都是有因的。
八、 根据于生物学及社会学的知识,叫人知道道德礼教是变迁的,而变迁的原因都是可以用科学方法寻求出来的。
@aucker
aucker / 空指针.md
Created March 30, 2022 02:11
RUST区别于其他语言的空指针问题

特殊指针(引用),代表指向对象为‘空’,如null, nil, None, Nothing, nullptr等。Tony Hoare。 仅仅因为容易实现。

问题:违背了类型系统的初衷。

Type is a classification identifying one of various types of data, that detemines the possible values for that type, the oprations that can be done on values of that type, the meaning of the data, and the way values of that type can be stored.

类型规定了数据可能的取值范围,规定了在这些值上可能的操作,也规定了这些数据代表的含义,还规定了这些数据的存储方式。

Hi there 👋

🚀

struct Portfolio;

impl Portfolio {
    const NAME: &'static str = "aucker";
    const LOCATION: &'static str = "Harbin, China";
    const PROFILE: &'static str = "MSc.";
 const EXPERIENCE: &'static str = "5+ years";
fn main() {
    for arg in std::env::args().skip(1) {
        respond(arg);
    }
}

fn respond(arg: &str) {
    match arg {
        "hi" => println!("Hello there!"),

The Rust macro learning: A Methodical Introduction

There are four types of macros in rust.

macro_rules!

As noted previously, macro_rules! is itself a syntax extension, meaning it is technically not part of the Rust Syntax. It uses the following forms:

Macro_rules! $name {
    $rule0 ;
    $rule1 ;
 // ...
@aucker
aucker / Rust type.md
Created April 22, 2022 14:56
some type convert

Converting a &str to a String

There are several ways to convert.

  • to_string()
fn main() {
    let new_string = "hello".to_string();
}

to_string() turns a &str to String.

  • to_owned()

Is Rust OOP? If not, what is it oriented to?

The answer is yes, Rust is OOP. However, Rust is not completely OOP. Rust has three features:

  • OOP
  • Functional
  • Trait oriented

And Rust is mostly Trait oriented.

@aucker
aucker / manjaro.md
Last active June 2, 2022 12:45
things to do after install manjaro

Manjaro(XFCE) Installation:rocket:

Get the ISO files

From Manjaro website, choose one desktop environment as you like (don't recommand gnome cause I can't configure it well:smiling_face_with_tear:), you can even use i3!

Flash the Image into USB device

On Windows, just download the Rufus and flash. On macOS, use this commands: (Attention before copy: replace the /dev/disk* with you USB partition on the macOS)

diskutil list