Android Studio 实现飞机大战游戏App

🍅文章末尾有获取完整项目源码方式🍅

目录

前言

一、运行演示

二、开发环境

三、完成步骤

步骤 1:创建项目

步骤 2:创建包名

步骤 3:实现启动页

步骤 5:实现用户注册

步骤 6:实现用户登录

步骤 7:实现主页面编写

步骤 8:排行榜页面编写

步骤 9:关于游戏页面编写

步骤10:游戏页面的编写

四、获取源码


前言

        通过自定义View实现Android飞机大战小游戏,游戏玩法很简单,可以锻炼玩家的反应能力。开启背景音乐进行新的游戏,控制飞机移动来消灭敌机获取更多的分数,在移动过程中避免与敌机发生碰撞。主界面可以查看自己的历史战绩和游戏规则,详细规则如下:

  1. 飞机一直发射子弹,用手指滑动可以改变飞机的位置
  2. 不同的敌机抗击打能力不同,当敌机被击中一定子弹数量时会爆炸,爆炸有动画效果
  3. 每隔一段时间都会有双发子弹或炸弹等道具奖励
  4. 获得双发子弹之后,子弹变为双发
  5. 获得炸弹道具之后,可以通过双击将屏幕内的所有敌机炸毁

一、运行演示

我们先来看下运行演示效果

Android Studio 实现飞机大战游戏

二、开发环境

        我的开发环境如下,大家的AS版本不需要和我相同,只要是近两年从官网下载的版本,都是比4.0.0 (2020)高的,是可以满足运行和开发要求的。

三、完成步骤

步骤 1:创建项目

        打开 Android studio 开发工具后,进行项目创建,左上角 File—>New Project、填写后点击 Finish 完成创建!

步骤 2:创建包名

        选中com.example.note包 名 右 键 New — >package 并按需求依次 activity(存放各类 Activity)、adapter(存放各类适配器) 等包名,后续代码将按对应包名去创建,并将 MainActivity.java 移动到 activity包 下

步骤 3:实现启动页

        在 activity包上右键创建 New—>Activity—>Empty Activity 选项创建 Activity 后弹 出对话框,输入相关信息,即可创建 Activity.

启动页页面布局背景放置一张自己喜欢的logo即可

这里我们直接看java部分代码:

package com.example.planewars.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;

import androidx.appcompat.app.AppCompatActivity;

import com.example.planewars.R;

public class StartActivity extends AppCompatActivity {
    private Handler handler = new Handler();
    private Runnable runnable = new Runnable() {
        @Override
        public void run() {
            tomainActive();
        }
    };

    // 进入主页面
    private void tomainActive() {
        startActivity(new Intent(this, LoginActivity.class));
        // 跳转完成后注销
        finish();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
       
    }

}

步骤 5:实现用户注册

        在 activity包上右键创建 New—>Activity—>Empty Activity 选项创建 Activity 后弹 出对话框,输入相关信息,即可创建 Activity.

用户注册页面布局代码如下所示:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#fff"
    tools:context=".activity.RegisterActivity">

    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:orientation="vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.41"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView">

        <EditText
            android:id="@+id/username_edittext"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:hint="请输入账号" />

        <EditText
            android:id="@+id/password_edittext"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:hint="请输入密码"
            android:inputType="textPassword" />

        <EditText
            android:id="@+id/repeat"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:ems="10"
            android:hint="再次输入您的密码"
            android:inputType="textPassword" />

        <TextView
            android:id="@+id/tv_login"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:gravity="center|right"
            android:text="已有账号?立即登录" />

    </LinearLayout>

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="0dp"
        android:layout_height="200dp"
        android:src="@drawable/logo"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/register_button"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:background="@drawable/btn_style"
        android:text="立 即 注 册"
        android:textColor="@color/white"
        android:textSize="20sp"
        app:layout_constraintEnd_toEndOf="@+id/linearLayout2"
        app:layout_constraintStart_toStartOf="@+id/linearLayout2"
        app:layout_constraintTop_toBottomOf="@+id/linearLayout2" />
</androidx.constraintlayout.widget.ConstraintLayout>

编写 RegisterActivity.java 的代码为:

package com.example.planewars.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.example.planewars.Data.DatabaseHelper;
import com.example.planewars.R;

public class RegisterActivity extends AppCompatActivity {

    private EditText mUserNameEditText;
    private EditText mPasswordEditText;
    private DatabaseHelper mDatabaseHelper;
    private EditText repeat;
    private TextView tvLogin;
    private Button registerButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        initView();
        button();
        login();
    }
    // 返回到登陆页面
    private void login() {
        tvLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    private void button() {
        // 点击注册按钮进行验证
        registerButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 获取三个输入框的内容
                String username = mUserNameEditText.getText().toString().trim();
                String password = mPasswordEditText.getText().toString().trim();
                String passwordrepeat = repeat.getText().toString().trim();
                // 判断是否输入内容
                if (username.isEmpty() || password.isEmpty()) {
                    Toast.makeText(getApplicationContext(), "请输入账号或密码", Toast.LENGTH_SHORT).show();
                    return;
                }
                // 判断两次密码是否一致
                if (passwordrepeat.equals(password) && password.equals(passwordrepeat)) {
                    boolean result = mDatabaseHelper.insertData(username, password);
                    if (result) {
                        Toast.makeText(getApplicationContext(), "注册成功", Toast.LENGTH_SHORT).show();
                        Intent intent = new Intent(RegisterActivity.this, LoginActivity.class);
                        startActivity(intent);
                        finish();
                    } else {
                        Toast.makeText(getApplicationContext(), "注册失败", Toast.LENGTH_SHORT).show();
                    }
                } else {
                    Toast.makeText(getApplicationContext(), "两次密码不同,请检查!", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
    private void initView() {
        mUserNameEditText = findViewById(R.id.username_edittext);
        mPasswordEditText = findViewById(R.id.password_edittext);
        mDatabaseHelper = new DatabaseHelper(this);
        repeat = (EditText) findViewById(R.id.repeat);
        tvLogin = (TextView) findViewById(R.id.tv_login);
        registerButton = findViewById(R.id.register_button);
    }
}

步骤 6:实现用户登录

        在 activity包上右键创建 New—>Activity—>Empty Activity 选项的对话框下输入 LoginActivity 创建,同时会在 res-layout 生成 activity_login.xml 文件.

activity_login.xml页面代码如下所示L:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    tools:context=".activity.LoginActivity">

    <LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginTop="20dp"
        android:layout_marginEnd="24dp"
        android:orientation="vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView2">

        <EditText
            android:id="@+id/username_edittext"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="请输入账号" />

        <EditText
            android:id="@+id/password_edittext"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:hint="请输入密码"
            android:inputType="textPassword" />

        <TextView
            android:id="@+id/register_button"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:gravity="center|right"
            android:text="还没有账号?立即注册!" />

    </LinearLayout>

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="0dp"
        android:layout_height="200dp"
        android:layout_marginTop="24dp"
        android:src="@drawable/logo"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/login_button"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:background="@drawable/btn_style"
        android:text="立 即 登 录"
        android:textColor="@color/white"
        android:textSize="20sp"
        app:layout_constraintEnd_toEndOf="@+id/linearLayout"
        app:layout_constraintStart_toStartOf="@+id/linearLayout"
        app:layout_constraintTop_toBottomOf="@+id/linearLayout" />
</androidx.constraintlayout.widget.ConstraintLayout>

对应的Java页面代码如下所示:

package com.example.planewars.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.example.planewars.Data.DatabaseHelper;
import com.example.planewars.R;

public class LoginActivity extends AppCompatActivity {

    private EditText mUserNameEditText;
    private EditText mPasswordEditText;
    private Button mLoginButton;
    private TextView rEgisterButton;
    private DatabaseHelper mDatabaseHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        mUserNameEditText = findViewById(R.id.username_edittext);
        mPasswordEditText = findViewById(R.id.password_edittext);
        mLoginButton = findViewById(R.id.login_button);
        rEgisterButton = findViewById(R.id.register_button);
        mDatabaseHelper = new DatabaseHelper(this);
        rEgisterButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);
                startActivity(intent);
            }
        });
        mLoginButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String username = mUserNameEditText.getText().toString().trim();
                String password = mPasswordEditText.getText().toString().trim();

                if (username.isEmpty() || password.isEmpty()) {
                    Toast.makeText(getApplicationContext(), "请输入账号或密码", Toast.LENGTH_SHORT).show();
                    return;
                }

                boolean result = mDatabaseHelper.checkUser(username, password);
                if (result) {
                    Toast.makeText(getApplicationContext(), "登陆成功", Toast.LENGTH_SHORT).show();
                    Intent intent = new Intent(LoginActivity.this, MainActivity.class);
                    startActivity(intent);
                } else {
                    Toast.makeText(getApplicationContext(), "账号或密码错误", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}

       

        编译代码启动 App,在登录页面(LoginActivity)的注册按钮中点击跳转注册 页面(RegisterActivity)进行注册,注册成功后自动返回登录页面进行登录 操作,登录成功之后正常跳转主页面(MainActivity)。

步骤 7:实现主页面编写

        我们先来看activity_main.xml代码,详情布局代码如下所示:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#E8E8E8"
    android:gravity="center"
    android:orientation="vertical">

    <Button
        android:id="@+id/startGame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginBottom="20dp"
        android:background="@drawable/btn_style"
        android:text="@string/startGame"
        android:textColor="@color/white"
        android:textSize="20sp" />

    <Button
        android:id="@+id/historyScore"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginBottom="20dp"
        android:background="@drawable/btn_style"
        android:text="@string/historyScore"
        android:textColor="@color/white"
        android:textSize="20sp" />

    <Button
        android:id="@+id/bgMusic"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginBottom="20dp"
        android:background="@drawable/btn_style"
        android:text="@string/bg_music_close"
        android:textColor="@color/white"
        android:textSize="20sp" />

    <Button
        android:id="@+id/aboutGame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginBottom="20dp"
        android:background="@drawable/btn_style"
        android:text="@string/aboutGame"
        android:textColor="@color/white"
        android:textSize="20sp" />

    <Button
        android:id="@+id/exitGame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginBottom="20dp"
        android:background="@drawable/btn_style"
        android:text="@string/exitGame"
        android:textColor="@color/white"
        android:textSize="20sp" />

</LinearLayout>

        接下来我们看逻辑代码,这里我们实现的是页面跳转功能,详情代码如下所示:

package com.example.planewars.activity;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.view.View;
import android.widget.Button;

import com.example.planewars.R;
import com.example.planewars.service.MusicService;


public class MainActivity extends Activity implements View.OnClickListener {
    // 定义全局意图
    private Intent musicIntent;
    // 定义全局变量
    private Button startGame, bgMusic, aboutGame, exitGame, historyScore;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        startGame = findViewById(R.id.startGame);
        historyScore = findViewById(R.id.historyScore);
        bgMusic = findViewById(R.id.bgMusic);
        aboutGame = findViewById(R.id.aboutGame);
        exitGame = findViewById(R.id.exitGame);
        startGame.setOnClickListener(this);
        historyScore.setOnClickListener(this);
        bgMusic.setOnClickListener(this);
        aboutGame.setOnClickListener(this);
        exitGame.setOnClickListener(this);
        musicIntent = new Intent(this, MusicService.class);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.startGame:
                startGame();
                break;
            case R.id.historyScore:
                historyScore();
                break;
            case R.id.aboutGame:
                aboutGame();
                break;
            case R.id.exitGame:
                finish();
                break;
        }
    }

    private void historyScore() {
        Intent intent = new Intent(this, HistoryActivity.class);
        startActivity(intent);
    }

    public void startGame() {
        Intent intent = new Intent(this, GameActivity.class);
        startActivity(intent);
    }
    

    public void aboutGame() {
        Intent intent = new Intent(this, AboutActivity.class);
        startActivity(intent);
    }



}

步骤 8:排行榜页面编写

        我们先来看activity_history.xml代码,这里我们用到了RecylerView列表来显示,详情代码如下所示:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:background="@drawable/history"
    android:orientation="vertical">

    <View
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:background="@color/white" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ellipsize="end"
            android:gravity="center"
            android:padding="5dp"
            android:singleLine="true"
            android:text="@string/rank"
            android:textColor="@color/white"
            android:textSize="18sp"
            android:textStyle="bold"
            android:typeface="serif" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            android:ellipsize="end"
            android:gravity="center"
            android:padding="5dp"
            android:singleLine="true"
            android:text="@string/score"
            android:textColor="@color/white"
            android:textSize="18sp"
            android:textStyle="bold"
            android:typeface="serif" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="3"
            android:ellipsize="end"
            android:gravity="center"
            android:padding="5dp"
            android:singleLine="true"
            android:text="@string/date"
            android:textColor="@color/white"
            android:textSize="18sp"
            android:textStyle="bold"
            android:typeface="serif" />
    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:background="@color/white" />
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rc_history"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
</LinearLayout>

然后我们进行逻辑代码的编写,实现成绩从高到低的显示功能

package com.example.planewars.activity;

import android.app.Activity;
import android.os.Bundle;

import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.planewars.R;
import com.example.planewars.adapter.GradeAdapter;
import com.example.planewars.database.DataBaseHelper;
import com.example.planewars.database.Grade;

import java.util.ArrayList;
import java.util.List;


/**
 * 历史成绩
 */
public class HistoryActivity extends Activity {
    private List<Grade> gradeList = new ArrayList<>();
    private DataBaseHelper dataBaseHelper;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_history);
        dataBaseHelper = new DataBaseHelper(this);
        initData();
        initView();
    }

  
        //选择排序,降序排序
        for (int i = 0; i < gradeList.size() - 1; i++) {
            int maxIndex = i;
            for (int j = i + 1; j < gradeList.size(); j++) {
                int curNum = Integer.parseInt(gradeList.get(j).getScore());
                int maxNum = Integer.parseInt(gradeList.get(maxIndex).getScore());
                         }
            if (i != maxIndex) {
                Grade temp = gradeList.get(i);
                gradeList.set(i, gradeList.get(maxIndex));
                gradeList.set(maxIndex, temp);
            }
        }
    }

    private void initView() {
        GradeAdapter gradeAdapter = new GradeAdapter(gradeList);
        // 列表加载适配器
        rcHistory.setAdapter(gradeAdapter);
        gradeAdapter.notifyDataSetChanged();
    }
}

步骤 9:关于游戏页面编写

        这里直接使用TextView文本编写:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="10dp"
    android:background="@drawable/bg_about">

    <TextView
        android:id="@+id/about_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:textSize="20sp"
        android:textColor="@color/white"
        android:typeface="monospace"
        android:layout_margin="25dp"
        android:text="1. 飞机一直发射子弹,用手指滑动可以改变飞机的位置。\n\n2. 不同的敌机抗击打能力不同,当敌机被击中一定子弹数量时会爆炸,爆炸有动画效果。\n\n3. 每隔一段时间都会有双发子弹或炸弹等道具奖励。\n\n4. 获得双发子弹之后,子弹变为双发。\n\n5. 获得炸弹道具之后,可以通过双击将屏幕内的所有敌机炸毁。"/>
</LinearLayout>

步骤10:游戏页面的编写

        在onCreate方法中,初始化了界面并获取了GameView的实例,然后载入了游戏所需的图片资源,并调用了GameView的start方法来启动游戏。

        在GameView中,通过不断地绘制游戏画面来实现游戏的运行。此外,还定义了一个静态的Handler,在handleMessage方法中处理了一个消息,当收到标识为66的消息时,会将得分和当前时间保存到数据库中。

        在onPause方法中,暂停了游戏的运行,而在onDestroy方法中,销毁了游戏界面并释放相关资源。整体来说,这段代码实现了游戏界面的初始化和销毁,以及处理得分信息并保存到数据库中。

页面布局代码如下所示:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activity.MainActivity">

    <com.example.planewars.game.GameView
        android:id="@+id/gameView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/bg"/>

</RelativeLayout>

        至此,完整的飞机大战游戏项目就创建完成了。

四、获取源码

关注公众号《编程乐学》,后台回复:24010401

👇🏻👇🏻👇🏻快捷获取方式👇🏻👇🏻👇🏻

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

逃离支原体又陷入流感 | 揭秘呼吸道感染与肠道菌群的隐秘关联

谷禾健康 成人每年大约会患上两到三次普通感冒&#xff0c;儿童每年可能会患上多达八次。而今年尤为显著&#xff0c;各大医院的儿科还是爆满状态&#xff0c;甚至是一号难求。 肺炎支原体感染还没彻底过去&#xff0c;紧接着流感和其他呼吸道病原体感染又跟来了&#xff0c;医…

ffmpeg写YUV420文件碰到阶梯型横线或者条纹状画面的原因和解决办法

版权声明&#xff1a;本文为CSDN博主「文三~」的原创文章&#xff0c;遵循CC 4.0 BY-SA版权协议&#xff0c;转载请附上原文出处链接及本声明。 原文链接&#xff1a;https://blog.csdn.net/asdasfdgdhh/article/details/112831581 留作备份 阶梯型横线&#xff1a; 条纹状画面…

vue前端开发自学,父子组件之间的数据传递demo

vue前端开发自学,父子组件之间的数据传递demo!下面为大家展示的是&#xff0c;vue开发中常见的&#xff0c;父子级别关系的&#xff0c;数据 传递案例。先给大家看一下&#xff0c;源码&#xff0c;然后讲解一下里面的注意事项。 <template><h3>Parent</h3>…

耐高压达林顿输出光隔离器TLP187(TPL,E(O 功能介绍及其应用

TLP187(TPL,E(O 是一款达林顿晶体管耦合器&#xff0c;它因采用了 SO6封装而实现了外形的小巧化&#xff0c;也可以保证高温运转的可行性 &#xff08;Ta110degG最大值)。TLP187可以取代其前一代产品&#xff0c;即现有的TIP127型号。该产品的的焊盘尺寸与现有的MFSOP时装参考尺…

ajax+axios——统一设置请求头参数——添加请求头入参——基础积累

最近在写后台管理系统&#xff08;我怎么一直都只写管理系统啊啊啊啊啊啊啊&#xff09;&#xff0c;遇到一个需求&#xff0c;就是要在原有系统的基础上&#xff0c;添加一个仓库的切换&#xff0c;并且需要把选中仓库对应的id以请求头参数的形式传递到每一个接口当中。。。 …

启动redis出现Creating Server TCP listening socket 127.0.0.1:6379: bind: No error异常

1.进入redis安装目录&#xff0c;地址栏输入cmd 2.输入命令 redis-server.exe redis.windows.conf redis启动失败 解决&#xff0c;输入命令 #第一步 redis-cli.exe#第二步 shutdown#第三步 exit第四步 redis-server.exe redis.windows.conf 显示以下图标即成功

【论文阅读】Deep Graph Infomax

目录 0、基本信息1、研究动机2、创新点2.1、核心思想&#xff1a;2.2、思想推导&#xff1a; 3、准备3.1、符号3.2、互信息3.3、JS散度3.4、Deep InfoMax方法3.5、判别器&#xff1a;f-GAN估计散度 4、具体实现4.1、局部-全局互信息最大化4.2、理论动机 5、实验设置5.1、直推式…

Linux第25步_在虚拟机中备份“ST官方的TF-A源码”

TF-A是ARM公司提供的&#xff0c;ST公司通过修改它&#xff0c;做了一个自己的TF-A代码。因为在后期开发中&#xff0c;若硬件被改变了&#xff0c;我们需要通过修改"ST官方的TF-A源码"就可以自己的TF-A代码了。为了防止源文件被误改了&#xff0c;我们需要将"S…

Linux安装MongoDB教程

下载MongoDB安装包 1、官网地址; 下载链接 选择版本 下载好了之后上传到服务器开始安装。 解压 解压 mongodb-linux-x86_64-rhel70-4.2.23.tgz 文件&#xff1a; 解压文件必须进入到压缩包所在的目录&#xff1a; cd /usr/local tar -zxvf mongodb-linux-x86_64-rhel70-4…

HDFS读写数据流程、NameNode与DataNode工作机制

文章目录 HDFS 写数据流程HDFS 读数据流程HDFS 节点距离计算HDFS 机架感知HDFS NN和2NN工作机制HDFS FsImage镜像文件HDFS Edits编辑日志HDFS 检查点CheckPoint时间设置HDFS 退役旧数据节点HDFS DataNode多目录配置HDFS DataNode工作机制HDFS 数据完整性HDFS 掉线时限参数设置 …

在线HMAC计算工具

HMAC在线加密 - BTool在线工具软件&#xff0c;为开发者提供方便。HMAC是密钥相关的哈希运算消息认证码&#xff08;Hash-based Message Authentication Code&#xff09;的缩写&#xff0c;由H.Krawezyk&#xff0c;M.Bellare&#xff0c;R.Canetti于1996年提出的一种基于Hash…

NATURE子刊 | IF:9.8,中科院2区水刊,审稿速度快!接收领域广!

【SciencePub学术】本期&#xff0c;小编给大家推荐的是一本影响因子为9.0的中科院2区Nature子刊。其详情如下&#xff1a; 期刊简介 SCIENTIFIC DATA ISSN&#xff1a;2052-4463 E-ISSN&#xff1a;—— IF&#xff08;2022&#xff09;&#xff1a;9.8 自引率&#…

【EI会议征稿通知】第五届机电一体化技术与智能制造国际学术会议(ICMTIM 2024)

第五届机电一体化技术与智能制造国际学术会议&#xff08;ICMTIM 2024&#xff09; 2024 5th International Conference on Mechatronics Technology and Intelligent Manufacturing 第五届机电一体化技术与智能制造国际学术会议&#xff08;ICMTIM 2024&#xff09;将于2024…

单极子天线

当双极子天线的一个臂演变为无限大地平面时就形成了一个单极子天线&#xff0c;依据单极子天线形状的不同可以将单极子划分为不同的种类&#xff0c;例如三角锥形、圆锥形、袖形等&#xff0c;这里只关注普通的垂直接地细直单极子天线。 依据镜像原理&#xff0c;单极子天线模型…

ubuntu 挂载新硬盘

1、检测新硬盘 新增加硬盘&#xff0c;检测硬盘识别情况。 命令检查&#xff1a;sudo fdisk -l 3、格式化磁盘 格式化&#xff1a;sudo mkfs.ext4 /dev/sdb 其中&#xff0c;/dev/sdb是新分区的设备文件名&#xff0c;ext4是要使用的文件系统类型。 4、挂载新分区 sudo mk…

学习华为企业无线网络,有这篇文章就够了(二)

学习华为企业无线网络&#xff0c;有这篇文章就够了&#xff08;一&#xff09;https://xmws-it.blog.csdn.net/article/details/135385614 WLAN的基础配置命令 - 配置AP上线 (1) •命令&#xff1a;optioncode [ sub-optionsub-code ] { asciiascii-string | hex hex-string |…

gseaplot3修改一下clusterProfiler默认绘图函数

直接使用clusterProfiler::gseaplot2绘图会出现下边的结果&#xff0c;导致四周显示不全&#xff0c;线的粗细也没办法调整&#xff0c;因为返回的是一个aplot包中的gglist对象&#xff0c;没太多研究。 p1 <- clusterProfiler::gseaplot2(gsea_result, gsea_result$ID, pv…

MySQL修炼手册4:分组与聚合:GROUP BY与HAVING的应用

写在开头 MySQL数据库的强大功能为我们提供了丰富的数据处理工具&#xff0c;其中GROUP BY与HAVING的应用使得数据的分组与聚合变得更加灵活和高效。在本篇博客中&#xff0c;我们将深入研究GROUP BY与HAVING的基础知识&#xff0c;并通过实际案例&#xff0c;展示它们在数据分…

【网络安全】【密码学】【北京航空航天大学】实验二、数论基础(中)【C语言和Java实现】

实验二、数论基础&#xff08;中&#xff09; 一、实验内容 1、扩展欧几里得算法&#xff08;Extended Euclid’s Algorithm&#xff09; &#xff08;1&#xff09;、算法原理 已知整数 a , b ,扩展的欧几里得算法可以在求得 a , b 的最大公约数的同时&#xff0c;找到一对…

群发邮件被判定为垃圾邮件的原因有哪些呢?

群发邮件被判定为垃圾邮件如何处理&#xff1f;邮件群发时怎么避免成为垃圾邮件&#xff1f; 群发邮件一直以来都是一种高效的信息传递方式&#xff0c;然而&#xff0c;随着网络垃圾邮件的激增&#xff0c;越来越多的群发邮件被系统判定为垃圾邮件。蜂邮EDM将深入探讨群发邮件…
最新文章