This file contains 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
qemu-system-x86_64 \ | |
-kernel bzImage--5.15.96+git0+509f4b9d68_001e2930e6-r0-qemux86-64-20230327112333.bin \ | |
-enable-kvm \ | |
-machine q35,accel=hvf \ | |
-device virtio-net-pci,netdev=net0 \ | |
-netdev user,id=net0,hostfwd=tcp::5555-:22,net=192.168.7.0/24,host=192.168.7.1,dhcpstart=192.168.7.2 \ | |
-drive file=core-image-minimal-qemux86-64-20230327162556.rootfs.ext4,if=virtio,format=raw \ | |
-append "root=/dev/vda console=ttyS0 ip=dhcp" \ | |
-serial stdio \ | |
-m 2048M |
This file contains 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
# | |
# Instructions for the video https://www.youtube.com/watch?v=tPs1uRqOnlk excluding setting up the env ( e.g. installing Rust and llvm) | |
# | |
# | |
# Kernel | |
# | |
$ git clone --depth=1 https://github.com/Rust-for-Linux/linux.git |
This file contains 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
class Obj { | |
... | |
//move constructor | |
Obj(const Obj&& other){ | |
.. | |
} | |
//move assignment operator | |
Obj& operator= (const Obj&& other){ | |
.. | |
} |
This file contains 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
class Obj { | |
//default constructor | |
Obj(int size){ | |
.. | |
} | |
//copy constructor | |
Obj(const Obj& other){ | |
.. | |
} | |
//assignment operator |
This file contains 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
string getName() { | |
string str = "medium"; | |
return s; | |
} | |
// getName() returns an rvalue | |
string&& name = getName(); |
This file contains 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
string str = "medium"; |
This file contains 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
def modify(arg): | |
arg += [1] | |
l = [2] | |
modify(l) | |
print(l) # >> [2, 1] |
This file contains 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
def modify(arg): | |
arg = 'hard' | |
str = 'medium' | |
modify(str) | |
print(str) # >> medium |
This file contains 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
str = 'medium' |