Translate

c++ / python 函数参数传递的不同

c++:

    值传递,不会改变参数

    如果传递的是指针,会改变参数,因为传递的是地址


python:

    和c++不同,根据实参的类型决定会不会改变。如果是不可变类型,不会修改实参;如果是可变类型,会修改实参。

    不可变类型:

  • 整型
  • 浮点型
  • 布尔型
  • 复数
  • 字符串
  • 元组

    

    可变类型:

  • 列表
  • 集合
  • 字典
  • 其他迭代器


link: https://blog.csdn.net/weixin_39861267/article/details/123753036




Swift: How to integrate UIView and UIViewController to SwiftUI View

1. Integrate UIView to SwiftUI View:

class UIViewExample: UIView {

}

struct SwiftView: UIViewRepresentable {
// update方法使我们能够将UIView和SwiftUI状态更新保持同步
func updateUIView(_ uiView: UIViewExample, context: Context) {
}

// make方法返回初始视图
func makeUIView(context: Context) -> UIViewExample {
}
}


2. Integrate UIViewController to SwiftUI View:

class UIViewControllerExample: UIViewController {

}

struct SwiftView : UIViewControllerRepresentable {
// Init your ViewController
func makeUIViewController(context: Context) -> some
    UIViewController {
let controller = UIViewControllerExample()
return controller
}
// No idea what to do here
func updateUIViewController(_ uiViewController:
    UIViewControllerType, context: Context) {

}
}







Zephyr - Study: CUDA Programming (1)

1. Introduction

    1. GPU 和 CPU 是用 PCIe 连接的
    2. GPU 不是独立的计算平台,需要 CPU 协作,在说 GPU 并行计算的时候,是指基于CPU+GPU的异构计算架构
    3. GPU 做稠密矩阵向量计算,可以快十倍以上
    4. GPU 适合做数据并行的计算密集型任务:大型矩阵运算
        CPU 可以实现复杂的逻辑运算,适合控制密集型任务
    5. CPU 线程是重量级 上下文切换开销大
        GPU 线程是轻量级

2. 

Solution to harddisk is full due to VLC

Issue:

    Ubuntu: /var/log is too large

    (due to VLC)


Solution:

    su
    cat /dev/null > /var/log/syslog.1
    cat /dev/null > /var/log/syslog
    cat /dev/null > /var/log/journal



Deep Learning model papers

The following papers I have read:

    Image generation:

    1. Stable diffusion


    2. Taiyi model

    3. CLIP (FLIP)

    4. Fooocus

    5. ControlNet

    6. T2I Adaptor

    7. BDM

    8. Laion 5B dataset

    9. Dalle 2 / Dalle 3

    10. Imagen




    NLP:

    1. Transformer

    2. BERT

    3. GPT / GPT2 / GPT3


    CV:

    1. ResNet

    2. ViT