iOS(一):Swift纯代码模式iOS开发入门教程

news2024/9/20 20:46:00

Swift纯代码模式iOS开发入门教程

    • 项目初始化(修改为纯代码项目)
    • 安装第三方库(以`SnapKit`库为例)
    • 桥接OC库(QMUIKit)
    • 封装视图并进行导航跳转
    • 示例:使用 `TangramKit` 第三方UI布局库
    • 应用国际化
    • 添加 `R.swift` 框架
    • 颜色统一管理(图片相同)
    • 网络请求 `Moya`
    • 网络请求 `Moya/RxSwift`
    • 解析 `json`

项目初始化(修改为纯代码项目)

1.修改 AppDelegate.swiftViewController.swift 文件

在这里插入图片描述

2.删除 SceneDelegate.swiftMain.storyboard 文件

3.修改如图所示项

在这里插入图片描述

在这里插入图片描述

安装第三方库(以SnapKit库为例)

安装CocoaPods

$ gem install cocoapods

初始化项目(添加Podfile配置文件)

$ pod init

修改Podfile文件

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'ExDemoApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ExDemoApp
  
  pod 'SnapKit'

end

安装

$ pod install

打开ExDemoApp.xcworkspace项目并向ViewController.swift添加示例代码

//
//  ViewController.swift
//  ExDemoApp
//
//  Created by ProsperLee on 2023/2/20.
//

import UIKit
import SnapKit

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.backgroundColor = .white
        
        let label: UILabel = UILabel()
        view.addSubview(label)
        label.text = "Hello"
        label.textColor = .red
        label.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.centerY.equalToSuperview()
        }
    }
    
}

运行效果

在这里插入图片描述

桥接OC库(QMUIKit)

安装QMUIKit

# Podfile 文件

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'ExDemoApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for ExDemoApp
  
  pod 'SnapKit'
  
  pod 'QMUIKit'

end
$ pod install

方式一:触发xcode自动创建桥接文件机制

在这里插入图片描述

方式二:手动创建xcode桥接文件

在这里插入图片描述

在这里插入图片描述

测试桥接是否成功

在这里插入图片描述

//
//  ViewController.swift
//  ExDemoApp
//
//  Created by ProsperLee on 2023/2/20.
//

import UIKit
import SnapKit

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.backgroundColor = .white
        
        let button = QMUIButton()
        button.adjustsButtonWhenHighlighted = true
        button.setTitle("按钮", for: .normal)
        button.setTitleColor(.white, for: .normal)
        button.backgroundColor = UIColor.tintColor;
        button.highlightedBackgroundColor = UIColor.tintColor;
        button.layer.cornerRadius = 4
        view.addSubview(button)
        button.snp.makeConstraints { make in
            make.width.equalTo(200)
            make.height.equalTo(40)
            make.centerX.equalToSuperview()
            make.centerY.equalToSuperview()
        }
        button.addTarget(self, action: #selector(buttonClick), for: UIControl.Event.touchUpInside)
        
    }
    
    @objc func buttonClick(){
        print("点击了")
    }
    
}

封装视图并进行导航跳转

效果

在这里插入图片描述

项目目录结构

在这里插入图片描述

配置导航跳转

//
//  AppDelegate.swift
//  ExDemoApp
//

import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        
        let controller = ViewController()
        
        window = UIWindow(frame: UIScreen.main.bounds)
        
        // 包装一层导航控制器用于在视图间跳转
        window!.rootViewController = UINavigationController(rootViewController: controller)
        
        window?.makeKeyAndVisible()
        
        return true
    }

}

创建要跳转到的Controller

//
//  SettingController.swift
//  设置界面
//

import UIKit

class SettingController: UIViewController {
    override func viewDidLoad() {

        super.viewDidLoad()
        
        title = "设置界面"
        
        view.backgroundColor = UIColor(red: 250 / 255, green:  250 / 255, blue:  250 / 255, alpha: 1)
    }
}

进行跳转

//
//  ViewController.swift
//  ExDemoApp
//

import UIKit
import SnapKit

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let button = QMUIButton()
        button.setTitle("进入设置页面", for: .normal)
        view.addSubview(button)
        button.addTarget(self, action: #selector(goto(_:)), for: .touchUpInside)
        button.snp.makeConstraints{make in
            make.center.equalToSuperview()
        }
    }
    
    @objc func goto(_ sender: QMUIButton){
        print(sender.titleLabel!.text!)
        let target = SettingController()
        navigationController?.pushViewController(target, animated: true)
    }
}

封装视图组件

//
//  CellView.swift
//  ExDemoApp
//

import UIKit
import SnapKit

class CellView: UIView {
    
    /// 左侧图标
    lazy var leftIcon: UIImageView = {
        let v = UIImageView();
        v.image = UIImage(named: "Setting")
        return v;
    }()
    
    /// 单元格标题
    lazy var title: UILabel = {
        let v = UILabel();
        v.text = "Setting"
        return v;
    }()
    
    /// 右侧图标
    lazy var rightIcon: UIImageView = {
        let v = UIImageView();
        v.image = UIImage(named: "More")
        return v;
    }()
    
    // 初始化组件
    init() {
        super.init(frame: CGRect.zero)
        innerInit()
    }
    
    // 从数据中初始化一个视图(必需)
    required init?(coder: NSCoder) {
        super.init(coder: coder)
        innerInit()
    }
    
    // 组件UIView初始化
    func innerInit(){
        backgroundColor = .white
        
        addSubview(leftIcon)
        addSubview(title)
        addSubview(rightIcon)
        
    }
    
    // 当view被首次添加进父级视图的时候调用
    override func didMoveToSuperview() {
        super.didMoveToSuperview()
        
        leftIcon.snp.makeConstraints{make in
            make.width.equalTo(32)
            make.height.equalTo(32)
            make.centerY.equalToSuperview()
            make.left.equalToSuperview().offset(16)
        }
        
        title.snp.makeConstraints{make in
            make.centerY.equalToSuperview()
            make.left.equalTo(leftIcon.snp.right).offset(10)
        }
        
        rightIcon.snp.makeConstraints{make in
            make.width.equalTo(20)
            make.height.equalTo(20)
            make.centerY.equalToSuperview()
            make.right.equalToSuperview().offset(-16)
        }
        
    }
    
}

使用组件并配置点击事件

//
//  SettingController.swift
//  设置界面
//

import UIKit

class SettingController: UIViewController {
    
    // 懒加载单元格并配置相关属性
    lazy var cellView: CellView = {
        let v = CellView();
        v.leftIcon.image = UIImage(named: "Setting")
        v.title.text = "设置"
        // 单元格整体添加点击事件
        v.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(onSettingClick(recognizer:))))
        return v;
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "设置界面"
        
        view.backgroundColor = UIColor(red: 250 / 255, green:  250 / 255, blue:  250 / 255, alpha: 1)
        
        view.addSubview(cellView)
        
        cellView.snp.makeConstraints{make in
            make.height.equalTo(40)
            make.top.equalTo(view.safeAreaLayoutGuide.snp.top);
            make.left.equalToSuperview()
            make.right.equalToSuperview()
        }
    }
    
    // 点击事件
    @objc func onSettingClick (recognizer:UITapGestureRecognizer){
        print(recognizer)
        cellView.title.text = "点击了!"
    }
    
}

示例:使用 TangramKit 第三方UI布局库

在这里插入图片描述

pod 'TangramKit'
let horzLayout = TGLinearLayout(.horz)
horzLayout.tg_gravity = TGGravity.horz.fill  // 所有子视图水平宽度充满布局,这样就不需要分别设置每个子视图的宽度了。
horzLayout.backgroundColor = UIColor.white
horzLayout.tg_width.equal(.fill)   // 高度填充父布局的所有剩余空间。
horzLayout.tg_height.equal(60)
horzLayout.tg_bottom.equal(TGLayoutPos.tg_safeAreaMargin)
view.addSubview(horzLayout)

let v1 = QMUIButton();
v1.setTitle("v1", for: .normal)
v1.backgroundColor = .red
v1.tg_height.equal(.fill)
horzLayout.addSubview(v1)

let v2 = QMUIButton();
v2.setTitle("v2", for: .normal)
v2.backgroundColor = .green
v2.tg_height.equal(.fill)
horzLayout.addSubview(v2)

let v3 = QMUIButton();
v3.setTitle("v3", for: .normal)
v3.backgroundColor = .blue
v3.tg_height.equal(.fill)
horzLayout.addSubview(v3)

应用国际化

引用公共字符串

在这里插入图片描述

在这里插入图片描述

/* 
  Localizable.strings
  ExDemoApp
*/


HomeMenuText = "首页";
//
//  ViewController.swift
//  ExDemoApp
//

import UIKit
import TangramKit

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view.backgroundColor = UIColor(red: 250 / 255, green: 250 / 255, blue: 250 / 255, alpha: 1)
        
        let horzLayout = TGLinearLayout(.horz)
        horzLayout.tg_gravity = TGGravity.horz.fill
        horzLayout.backgroundColor = UIColor.orange
        horzLayout.tg_width.equal(.fill)
        horzLayout.tg_height.equal(60)
        horzLayout.tg_bottom.equal(TGLayoutPos.tg_safeAreaMargin)
        view.addSubview(horzLayout)
        
        let v1 = QMUILabel();
        v1.text = NSLocalizedString("HomeMenuText", comment: "") // 引用公共字符串
        v1.backgroundColor = .red
        v1.textAlignment = .center;
        v1.tg_width.equal(.fill)
        v1.tg_height.equal(.fill)
        horzLayout.addSubview(v1)
        
        let v2 = QMUILabel();
        v2.text = "v2"
        v2.backgroundColor = .green
        v2.textAlignment = .center;
        v2.tg_width.equal(.fill)
        v2.tg_height.equal(.fill)
        horzLayout.addSubview(v2)
        
        let v3 = QMUILabel();
        v3.text = "v3"
        v3.backgroundColor = .blue
        v3.textAlignment = .center;
        v3.tg_width.equal(.fill)
        v3.tg_height.equal(.fill)
        horzLayout.addSubview(v3)
    }

}

启用国际化(修改系统语言查看效果)

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

应用名称国际化(修改系统语言查看效果)

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

添加 R.swift 框架

用于优化资源获取访问的方式,如图像、字体等

1.添加依赖

pod 'R.swift'

2.创建运行脚本

在这里插入图片描述

在这里插入图片描述

"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift"
$SRCROOT/R.generated.swift

在这里插入图片描述

3.执行编译生成 R.generated.swift 文件,并将其添加到项目根目录

在这里插入图片描述

4.使用

/* 
  Localizable.strings
  ExDemoApp
*/

HomeMenuText = "%@, 首页";
//
//  ViewController.swift
//  ExDemoApp
//

let v1 = QMUILabel();
v1.text = NSLocalizedString(R.string.localizable.homeMenuText("你好"), comment: "")
v1.backgroundColor = .red
v1.textAlignment = .center;
v1.tg_width.equal(.fill)
v1.tg_height.equal(.fill)
horzLayout.addSubview(v1)

在这里插入图片描述

颜色统一管理(图片相同)

在这里插入图片描述

引入动态颜色生成库

pod 'DynamicColor'

实现

//
//  SuperUIColorExtension.swift
//  ExDemoApp
//
//  扩展系统颜色
//

import Foundation
import DynamicColor

extension UIColor {
    /// 背景颜色 (浅色)
    static var bgLightColor: UIColor{return DynamicColor(hex: 0xfafafa)}
    /// 背景颜色 (深色)
    static var bgDarkColor: UIColor{return DynamicColor(hex: 0x000000)}
    /// 背景颜色
    static var bgColor: UIColor{
        return .initColor(normal: bgLightColor, dark: bgDarkColor)
    }
    
    /// 红色
    static var red: UIColor{return DynamicColor(hex: 0xff0000)}
    /// 绿色
    static var green: UIColor{return DynamicColor(hex: 0x00ff00)}
    /// 蓝色
    static var blue: UIColor{return DynamicColor(hex: 0x00ffff)}
    
    
    /// 深浅颜色随系统切换
    static func initColor(normal: UIColor, dark: UIColor) -> UIColor{
        if #available(iOS 13.0, *) {
            return UIColor{ traitCollection -> UIColor in
                return traitCollection.userInterfaceStyle == .dark ? dark : normal
            }
        }else{
            return normal
        }
    }
    
}
//
//  ViewController.swift
//  ExDemoApp
//

import UIKit
import TangramKit
import DynamicColor

class ViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .bgColor
        
        let horzLayout = TGLinearLayout(.horz)
        horzLayout.tg_gravity = TGGravity.horz.fill
        horzLayout.backgroundColor = .gray
        horzLayout.tg_width.equal(.fill)
        horzLayout.tg_height.equal(60)
        horzLayout.tg_bottom.equal(TGLayoutPos.tg_safeAreaMargin)
        view.addSubview(horzLayout)
        
        let v1 = QMUIButton()
        v1.setTitle("v1", for: .normal)
        v1.setTitleColor(.red, for: .normal)
        v1.tg_width.equal(.fill)
        v1.tg_height.equal(.fill)
        horzLayout.addSubview(v1)
        
        let v2 = QMUIButton()
        v2.setTitle("v2", for: .normal)
        v2.setTitleColor(.green, for: .normal)
        v2.tg_width.equal(.fill)
        v2.tg_height.equal(.fill)
        horzLayout.addSubview(v2)
        
        let v3 = QMUIButton()
        v3.setTitle("v3", for: .normal)
        v3.setTitleColor(.blue, for: .normal)
        v3.tg_width.equal(.fill)
        v3.tg_height.equal(.fill)
        horzLayout.addSubview(v3)
    }
    
}

网络请求 Moya

允许http请求

在这里插入图片描述

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>
</dict>
</plist>

配置请求地址

//
//  Config.swift
//  ExDemoApp
//

import Foundation

class Config{
    /// 接口地址
    static let API_URL = "http://127.0.0.1:8080/";
}

引入网络请求框架

pod 'Moya'

使用请求

在这里插入图片描述

// 服务端
let http = require('http');

http.createServer((req, res) => {
    res.writeHead(200, { 'Content-type': 'application/json' });
    if (req.url === '/api/getUserInfo' && req.method === 'POST') {
        let data = '';
        req.on('data', (chunk) => {
            data += chunk;
        });
        req.on('end', () => {
            console.log(JSON.stringify({code: 200, id: Math.random(), ...JSON.parse(data)}));
            res.end(JSON.stringify({code: 200, id: Math.random(), ...JSON.parse(data)}));
        });
    }
}).listen(8080);

console.log('http://127.0.0.1:8080/');
//
//  ViewController.swift
//  ExDemoApp
//

import UIKit
import TangramKit
import DynamicColor
import Moya

class ViewController: UIViewController {
    
    var label: QMUILabel = QMUILabel()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        view = TGRelativeLayout()
        view.backgroundColor = .bgColor
        
        let button = QMUIButton()
        button.setTitle("请求", for: .normal)
        button.tg_width.equal(.wrap)
        button.tg_height.equal(.wrap)
        button.tg_centerX.equal(0)
        button.tg_centerY.equal(0)
        button.addTarget(self, action: #selector(handleClick(_ :)), for: .touchUpInside)
        view.addSubview(button)
        
        label.text = "暂无数据!"
        label.tg_width.equal(.wrap)
        label.tg_height.equal(.wrap)
        label.tg_centerX.equal(0)
        label.tg_centerY.equal(30)
        view.addSubview(label)
    }
    
    @objc func handleClick (_ sender: QMUIButton){
        let provider = MoyaProvider<DefaultService>()
        provider.request(.getUserInfo(firstName: "Lee", lastName: "Prosper")) { result in
            switch result {
            case let .success(moyaResponse):
                if moyaResponse.statusCode == 200 {
                    let data: String = String(data: moyaResponse.data, encoding: .utf8)!
                    self.label.text = data
                    print(data)
                }
            case let .failure(error):
                print(error)
            }
        }
    }
    
}

/// 默认服务
enum DefaultService {
    case getUserInfo(firstName: String, lastName: String)
}

extension DefaultService: TargetType {
    
    /// 请求地址
    var baseURL: URL { return URL(string: Config.API_URL)! }
    
    /// 接口地址
    var path: String {
        switch self {
        case .getUserInfo:
            return "/api/getUserInfo"
        }
    }
    
    /// 请求方式
    var method: Moya.Method {
        switch self {
        case .getUserInfo:
            return .post
        }
    }
    
    /// 请求参数
    var task: Task {
        switch self {
        case let .getUserInfo(firstName, lastName):
            return .requestParameters(parameters: ["first_name": firstName, "last_name": lastName], encoding: JSONEncoding.default)
        }
    }
    
    /// 请求头
    var headers: [String: String]? {
        let headers: Dictionary<String, String> = [:]
        return headers
    }
}

网络请求 Moya/RxSwift

Moya/RxSwift 响应式编程,可以对数据在请求前做一些处理,如:provider.rx.request(.xxx()).filter{... in ...}.subscribe { ... }

引入RxSwift

# pod 'Moya'
pod 'Moya/RxSwift'

pod 'NSObject+Rx'

使用

//  ViewController.swift

import RxSwift
import NSObject_Rx


@objc func handleClick (_ sender: QMUIButton){
    let provider = MoyaProvider<DefaultService>()
    provider.rx.request(.getUserInfo(firstName: "Lee", lastName: "Prosper"))
        .subscribe { event in
            switch event {
            case let .success(response):
                if response.statusCode == 200 {
                    let data: String = String(data: response.data, encoding: .utf8)!
                    self.label.text = data
                    print(data)
                }
            case let .failure(error):
                print(error)
            }
        }
        .disposed(by: rx.disposeBag) // 用于释放subscribe资源
    
}

解析 json

在这里插入图片描述

pod 'HandyJSON'
//  ViewController.swift

import Moya
import RxSwift
import NSObject_Rx
import HandyJSON


class UserInfo: HandyJSON {
    var code: Int!              // 不允许空
    var id: Double!             // 不允许空
    var first_name: String?     // 允许空
    var last_name: String?      // 允许空
    
    required init() {}
}


let provider = MoyaProvider<DefaultService>()
provider.rx.request(.getUserInfo(firstName: "Lee", lastName: "Prosper"))
    .subscribe { event in
        switch event {
        case let .success(response):
            if response.statusCode == 200 {
                let data: String = String(data: response.data, encoding: .utf8)!
                if let object = UserInfo.deserialize(from: data) {
                    self.label.text = "\(object.code!) \n \(object.id!) \n \(object.first_name!) \n \(object.last_name!)"
                    print(object.toJSONString(prettyPrint: true)!) // 转json字符串 - {"id":0.86519265844265569,"last_name":"Prosper","code":200,"first_name":"Lee"}
                }
            }
        case let .failure(error):
            print(error)
        }
    }
    .disposed(by: rx.disposeBag) // 用于释放subscribe资源

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/391737.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

NICEGUI---ROS开发之中常用的GUI工具

0. 简介 对于ROS来说&#xff0c;如果不具备一定知识的人员来使用这些我们写的算法&#xff0c;如果说没有交互&#xff0c;这会让用户使用困难&#xff0c;所以我们需要使用GUI来完成友善的数据交互&#xff0c;传统的GUI方法一般有PYQT这类GUI方法&#xff0c;但是这类GUI工…

激光炸弹(前缀和)

地图上有 N 个目标&#xff0c;用整数 Xi,Yi 表示目标在地图上的位置&#xff0c;每个目标都有一个价值 Wi。注意&#xff1a;不同目标可能在同一位置。现在有一种新型的激光炸弹&#xff0c;可以摧毁一个包含 RR 个位置的正方形内的所有目标。激光炸弹的投放是通过卫星定位的&…

顺序表以及链表的应用及区别(包含OJ讲解)

前面我已经发过怎么实现链表以及顺序表&#xff0c;今天大概的总结一下。 顺序表&#xff1a; 1.能够随时的存取&#xff0c;比较方便。 2.插入删除时&#xff0c;需要挪动数据&#xff0c;比较麻烦&#xff0c;因为是连续存储。 3.存储密度相对于链表来说是比较高的&#…

C++类的组合

C类的组合什么是类的组合初始化参数列表使用类的组合案例分析组合构造和析构顺序问题this指针基本用法和作用什么是类的组合 类的组合就是以另一个对象为数据成员&#xff0c;这种情况称为类的组合 1.优先使用类的组合&#xff0c;而不是继承 2.组合表达式的含义 一部分关系 初…

用户登录请求100w/每天, JVM如何调优

用户登录请求100w/每天, JVM如何调优 大概可以分为以下8个步骤。 Step1&#xff1a;新系统上线如何规划容量&#xff1f; 1.套路总结 任何新的业务系统在上线以前都需要去估算服务器配置和JVM的内存参数&#xff0c;这个容量与资源规划并不仅仅是系统架构师的随意估算的&am…

springboot启动过程加载数据笔记(springboot3)

SpringApplication AbstractApplicationContext PostProcessorRegistrationDelegate ConfigurationClassPostProcessor ConfigurationClassParser 一堆循环和调用 ComponentScanAnnotationParser扫描 processConfigurationClass.doProcessConfigurationClass(configClass, so…

网络编程(二)

6. TCP 三次握手四次挥手 HTTP 协议是 Hype Transfer Protocol&#xff08;超文本传输协议&#xff09;的缩写&#xff0c;是用于从万维网&#xff08;WWW&#xff1a;World Wide Web&#xff09;服务器&#xff08;sever&#xff09;传输超文本到客户端&#xff08;本地浏览器…

小众但意外觉得蛮好用的剪辑软件!纯良心分享

爱剪辑 有开屏广告&#xff0c;一共3个界面&#xff1a;首页、剪同款、我的。 剪辑、配乐、字幕、滤镜、加速、贴纸、配音等主流功能都有。 特色功能有剪裁视频、倒放视频、视频旋转、视频转换GIF、转场、提取音频、画中画等。 还可以拼接视频&#xff0c;不过不支持FLV等小众文…

人员摔倒识别预警系统 人员跌倒检测算法 yolov7

人员摔倒识别预警系统 人员跌倒检测算法基于yolov7网络模型计算机识别技术&#xff0c;人员摔倒识别预警系统 人员跌倒检测算法对画面中人员摔倒进行实时检测识别抓拍告警。YOLOv7 的策略是使用组卷积来扩展计算块的通道和基数。研究者将对计算层的所有计算块应用相同的组参数和…

buuctf-pwn write-ups (11)

文章目录buu083-x_ctf_b0verfl0wbuu084-picoctf_2018_leak_mebuu085-inndy_echobuu086-hitcontraining_unlinkbuu087-ciscn_2019_final_3buu088-axb_2019_fmt64buu089-wustctf2020_name_your_catbuu090-pwnme1buu091-axb_2019_brop64buu092-[极客大挑战 2019]Not Badbuu083-x_c…

JAVA开发运维(nginx工作原理)

nginx源码目录结构&#xff1a; . ├── auto 自动检测系统环境以及编译相关的脚本 │ ├── cc 关于编译器相关的编译选项的检测脚本 │ ├── lib nginx编译所需要的一些库的检测脚本 │ ├── os 与平台相关的一些系统参数…

2023-03-06 debian11 最小安装记录

1.镜像准备&#xff0c;根据个人需求下载debian 版本Debian -- 获取 Debian2.上传到VSAN 内容库我这边是在vm里面安装的&#xff0c;就直接上传到内容库备用&#xff08;根据个人需求存放&#xff09;3.分配虚拟主机配置根据个人需要配置4.开始最小安装1.在界面中选择Install&a…

Packet Tracer--配置帧中继

Packet Tracer--配置帧中继 拓扑图&#xff1a; 设备参数: 设备 接口 DLCI R1 S0/2 102,103 R2 S0/2 201 R3 S0/2 301 R1---R2 Se1&#xff1a;102-----Se2&#xff1a;201 R1---R3 Se1&#xff1a;103-----Se3&#xff1a;301 IP参数 设备 接口 IP地址…

CFNet: Cascade Fusion Network for Dense Prediction

论文名称&#xff1a;CFNet: Cascade Fusion Network for Dense Prediction 论文下载&#xff1a;https://arxiv.org/pdf/2302.06052.pdf 论文代码&#xff1a;GitHub - zhanggang001/CFNet: CFNet: Cascade Fusion Network for Dense Prediction 摘要&#xff1a; 在密集预…

十四届蓝桥选拔赛Scratch-2023.02.12 试题解析

十四届蓝桥选拔赛Scratch-2023.02.12 试题解析 单选题: 1. 运行以下程序,小猫和小企鹅谁能到达舞台右侧边缘? ( B ) *选择题严禁使用程序验证,选择题不答和答错不扣分 A. 小企鹅 B. 小猫 C. 都能到达 D. 都不能到达 2. 运行以下程序(小象仅有两个造型),小象的造型是…

最简单的SpringBoot+MyBatis多数据源实现

最简单的SpringBootMyBatis多数据源实现1.数据库准备2.环境准备3.代码部分3.1多数据源配置2.测试随着应用用户数量的增加&#xff0c;相应的并发请求的数量也会跟着不断增加&#xff0c;慢慢地&#xff0c;单个数据库已经没有办法满足频繁的数据库操作请求了&#xff0c;在某些…

【JeecgBoot-Vue3】第4节 目录结构与常用组件介绍

一、项目的目录结构讲解 1. src/api/ 存放API相关信息 src/api/存放的是调用后台api接口相关信息src/api/commonapi.tsapi接口信息2. src/assets 静态资源 src/assets静态资源 src/assets/icons 图标 src/assets/images 图片 src/assets/less 样式src/assets/svgsvg图像3. s…

函数编程:强大的 Stream API

函数编程&#xff1a;强大的 Stream API 每博一文案 只要有人的地方&#xff0c;世界就不会是冰冷的&#xff0c;我们可以平凡&#xff0c;但绝对不可以平庸。—————— 《平凡的世界》人活着&#xff0c;就得随时准备经受磨难。他已经看过一些书&#xff0c;知道不论是普通…

Python API教程:API入门

什么是API&#xff1f; 一个API&#xff0c;或被称为应用程序接口&#xff0c;是一个服务器为你提供一个接收或发送数据的代码。API通常用来接收数据。 本文就集中焦点在此话题中。 当我们想从一个API中接收数据&#xff0c;我们需要开始请求。请求可以包含整个Web。例如&am…

Vue基础18之github案例、vue-resource

Vue基础18github案例静态页面第三方样式引入&#xff08;以bootstrap举例&#xff09;App.vueSearch.vueList.vue列表展示接口地址使用全局事件总线进行兄弟间组件通信Search.vueList.vue完善案例List.vueSearch.vue补充知识点&#xff1a;{...this.info,...this.dataObj}效果呈…