当前位置: 首页 > news >正文

Android : 篮球记分器app _简单应用

示例图:

1.导包 在build.gradle 中 加入

    // 使用androidx版本库implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03'

2. 开启dataBinding

android{...// 步骤1.开启data bindingdataBinding {enabled = true}...}

3.写个类继承 ViewModel

package com.example.mydatabindingtest;import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;public class MyViewModel extends ViewModel {private MutableLiveData<Integer> redNumb;private MutableLiveData<Integer> greenNumb;//回滚 用于记录前面一次的值private int redBack,greenBack;public MutableLiveData<Integer> getRedNumb() {if (redNumb == null) {redNumb = new MutableLiveData<>();redNumb.setValue(0);}return redNumb;}public MutableLiveData<Integer> getGreenNumb() {if (greenNumb == null) {greenNumb = new MutableLiveData<>();greenNumb.setValue(0);}return greenNumb;}public void redAdd(int num) {//添加之前保留之前的值 都记录下redBack = redNumb.getValue();greenBack = greenNumb.getValue();redNumb.setValue(getRedNumb().getValue() + num);}public void greenAdd(int num) {//添加之前保留之前的值 都记录下redBack = redNumb.getValue();greenBack = greenNumb.getValue();greenNumb.setValue(getGreenNumb().getValue() + num);}//重置public void reset(){//添加之前保留之前的值greenBack = greenNumb.getValue();redBack = redNumb.getValue();redNumb.setValue(0);greenNumb.setValue(0);}//撤销一次public void rollBack(){//把记录的值设置到变量中redNumb.setValue(redBack);greenNumb.setValue(greenBack);}
}

4.更改布局 activity_main.xml

<?xml version="1.0" encoding="utf-8"?><!-- 步骤2. 点击小灯泡生成新的xml 或者自己更改 -->
<layout 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"><data><variablename="data"type="com.example.mydatabindingtest.MyViewModel" /></data><androidx.constraintlayout.widget.ConstraintLayoutandroid:id="@+id/btn_add1"android:layout_width="match_parent"android:layout_height="match_parent"><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline22"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"app:layout_constraintGuide_percent="0.45" /><Buttonandroid:id="@+id/btn_green_add3"style="@style/Widget.AppCompat.Button"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#00FFE7"android:onClick="@{() -> data.greenAdd(3)}"android:scrollbarThumbHorizontal="@null"android:scrollbarThumbVertical="@null"android:text="@string/text_add3"android:textColor="#0288D1"android:textColorHighlight="@null"android:textColorHint="@null"android:textColorLink="@null"android:textSize="30sp"android:textStyle="bold"app:layout_constraintBottom_toTopOf="@+id/guideline16"app:layout_constraintEnd_toStartOf="@+id/guideline19"app:layout_constraintStart_toStartOf="@+id/guideline9"app:layout_constraintTop_toTopOf="@+id/guideline15"tools:ignore="DuplicateSpeakableTextCheck,VisualLintButtonSize" /><Buttonandroid:id="@+id/btn_red_add1"style="@style/Widget.AppCompat.Button"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#FFff0000"android:onClick="@{() -> data.redAdd(1)}"android:scrollbarThumbHorizontal="@null"android:scrollbarThumbVertical="@null"android:text="@string/text_add1"android:textColor="@color/white"android:textColorHighlight="@null"android:textColorHint="@null"android:textColorLink="@null"android:textSize="30sp"android:textStyle="bold"app:layout_constraintBottom_toTopOf="@+id/guideline14"app:layout_constraintEnd_toStartOf="@+id/guideline22"app:layout_constraintStart_toStartOf="@+id/guideline18"app:layout_constraintTop_toTopOf="@+id/guideline13"app:layout_constraintVertical_bias="0.52"tools:ignore="DuplicateSpeakableTextCheck,VisualLintButtonSize" /><Buttonandroid:id="@+id/btn_green_add1"style="@style/Widget.AppCompat.Button"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#00FFE7"android:onClick="@{() -> data.greenAdd(1)}"android:scrollbarThumbHorizontal="@null"android:scrollbarThumbVertical="@null"android:text="@string/text_add1"android:textColor="#0288D1"android:textColorHighlight="@null"android:textColorHint="@null"android:textColorLink="@null"android:textSize="30sp"android:textStyle="bold"app:layout_constraintBottom_toTopOf="@+id/guideline14"app:layout_constraintEnd_toStartOf="@+id/guideline19"app:layout_constraintStart_toStartOf="@+id/guideline9"app:layout_constraintTop_toTopOf="@+id/guideline13"tools:ignore="VisualLintButtonSize" /><Buttonandroid:id="@+id/btn_green_add2"style="@style/Widget.AppCompat.Button"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#00FFE7"android:onClick="@{() -> data.greenAdd(2)}"android:scrollbarThumbHorizontal="@null"android:scrollbarThumbVertical="@null"android:text="@string/text_add2"android:textColor="#0288D1"android:textColorHighlight="@null"android:textColorHint="@null"android:textColorLink="@null"android:textSize="30sp"android:textStyle="bold"app:layout_constraintBottom_toTopOf="@+id/guideline15"app:layout_constraintEnd_toStartOf="@+id/guideline19"app:layout_constraintStart_toStartOf="@+id/guideline9"app:layout_constraintTop_toTopOf="@+id/guideline14"tools:ignore="DuplicateSpeakableTextCheck,VisualLintButtonSize" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline9"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"app:layout_constraintGuide_percent="0.55" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline10"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"app:layout_constraintGuide_percent="0.05" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline11"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"app:layout_constraintGuide_percent="0.1504788" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline13"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"app:layout_constraintGuide_percent="0.35" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline14"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"app:layout_constraintGuide_percent="0.45" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline15"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"app:layout_constraintGuide_percent="0.55" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline16"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"app:layout_constraintGuide_percent="0.65" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline17"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="horizontal"app:layout_constraintGuide_percent="0.75" /><TextViewandroid:textColor="@color/white"android:gravity="center"android:id="@+id/textView"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#FFff0000"android:text="@string/text_A"android:textSize="20sp"app:layout_constraintBottom_toTopOf="@+id/guideline11"app:layout_constraintEnd_toStartOf="@+id/guideline22"app:layout_constraintStart_toStartOf="@+id/guideline18"app:layout_constraintTop_toTopOf="@+id/guideline10" /><TextViewandroid:id="@+id/textView2"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#00FFE7"android:gravity="center"android:text="@string/text_B"android:textColor="#0288D1"android:textSize="20sp"app:layout_constraintBottom_toTopOf="@+id/guideline11"app:layout_constraintEnd_toStartOf="@+id/guideline19"app:layout_constraintStart_toStartOf="@+id/guideline9"app:layout_constraintTop_toTopOf="@+id/guideline10" /><TextViewandroid:id="@+id/text_red"android:layout_width="0dp"android:layout_height="wrap_content"android:gravity="center"android:text="@{String.valueOf(data.redNumb)}"android:textColor="@color/btn_bg"android:textSize="50sp"app:layout_constraintBottom_toTopOf="@+id/guideline13"app:layout_constraintEnd_toStartOf="@+id/guideline22"app:layout_constraintStart_toStartOf="@+id/guideline18"app:layout_constraintTop_toTopOf="@+id/guideline11"app:layout_constraintVertical_bias="0.526" /><TextViewandroid:id="@+id/text_green"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_marginTop="4dp"android:gravity="center"android:text="@{String.valueOf(data.greenNumb)}"android:textColor="#0288D1"android:textColorHighlight="@null"android:textColorHint="@null"android:textColorLink="@null"android:textSize="50sp"app:layout_constraintBottom_toTopOf="@+id/guideline13"app:layout_constraintEnd_toStartOf="@+id/guideline19"app:layout_constraintHorizontal_bias="1.0"app:layout_constraintStart_toStartOf="@+id/guideline9"app:layout_constraintTop_toTopOf="@+id/guideline11" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline18"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"app:layout_constraintGuide_percent="0.05" /><androidx.constraintlayout.widget.Guidelineandroid:id="@+id/guideline19"android:layout_width="wrap_content"android:layout_height="wrap_content"android:orientation="vertical"app:layout_constraintGuide_percent="0.95" /><ImageViewandroid:id="@+id/img_rollback"android:layout_width="wrap_content"android:layout_height="wrap_content"android:contentDescription="@string/img_rollback_alt"android:onClick="@{() -> data.rollBack()}"app:layout_constraintBottom_toTopOf="@+id/guideline17"app:layout_constraintEnd_toStartOf="@+id/guideline9"app:layout_constraintHorizontal_bias="0.38"app:layout_constraintStart_toStartOf="@+id/guideline18"app:layout_constraintTop_toTopOf="@+id/guideline16"app:layout_constraintVertical_bias="0.166"app:srcCompat="@drawable/baseline_reply" /><ImageViewandroid:id="@+id/img_reset"android:layout_width="wrap_content"android:layout_height="wrap_content"android:contentDescription="@string/img_reset_alt"android:onClick="@{() -> data.reset()}"app:layout_constraintBottom_toTopOf="@+id/guideline17"app:layout_constraintEnd_toStartOf="@+id/guideline19"app:layout_constraintHorizontal_bias="0.521"app:layout_constraintStart_toStartOf="@+id/guideline9"app:layout_constraintTop_toTopOf="@+id/guideline16"app:layout_constraintVertical_bias="0.166"app:srcCompat="@drawable/baseline_cached_24" /><Buttonandroid:id="@+id/btn_red_add2"style="@style/Widget.AppCompat.Button"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#FFff0000"android:onClick="@{() -> data.redAdd(2)}"android:scrollbarThumbHorizontal="@null"android:scrollbarThumbVertical="@null"android:text="@string/text_add2"android:textColor="@color/white"android:textColorHighlight="@null"android:textColorHint="@null"android:textColorLink="@null"android:textSize="30sp"android:textStyle="bold"app:layout_constraintBottom_toTopOf="@+id/guideline15"app:layout_constraintEnd_toStartOf="@+id/guideline22"app:layout_constraintHorizontal_bias="0.0"app:layout_constraintStart_toStartOf="@+id/guideline18"app:layout_constraintTop_toTopOf="@+id/guideline14"app:layout_constraintVertical_bias="0.48"tools:ignore="VisualLintButtonSize" /><Buttonandroid:id="@+id/btn_red_add3"style="@style/Widget.AppCompat.Button"android:layout_width="0dp"android:layout_height="wrap_content"android:background="#FFff0000"android:onClick="@{() -> data.redAdd(3)}"android:scrollbarThumbHorizontal="@null"android:scrollbarThumbVertical="@null"android:text="@string/text_add3"android:textColor="@color/white"android:textColorHighlight="@null"android:textColorHint="@null"android:textColorLink="@null"android:textSize="30sp"android:textStyle="bold"app:layout_constraintBottom_toTopOf="@+id/guideline16"app:layout_constraintEnd_toStartOf="@+id/guideline22"app:layout_constraintStart_toStartOf="@+id/guideline18"app:layout_constraintTop_toTopOf="@+id/guideline15"app:layout_constraintVertical_bias="0.56"tools:ignore="VisualLintButtonSize" /></androidx.constraintlayout.widget.ConstraintLayout>
</layout>

5.MainActivity.java

package com.example.mydatabindingtest;import androidx.appcompat.app.AppCompatActivity;import android.os.Bundle;
import android.widget.Toast;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProviders;
import com.example.mydatabindingtest.databinding.ActivityMainBinding;public class MainActivity extends AppCompatActivity {MyViewModel myViewModel;ActivityMainBinding binding;private long exitTime;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);binding = DataBindingUtil.setContentView(this,R.layout.activity_main);myViewModel = ViewModelProviders.of(this).get(MyViewModel.class);binding.setData(myViewModel);binding.setLifecycleOwner(this);}//返回@Overridepublic void onBackPressed() {if ((System.currentTimeMillis() - exitTime) > 2000) {Toast.makeText(getApplicationContext(), "再按一次退出程序",Toast.LENGTH_SHORT).show();exitTime = System.currentTimeMillis();} else {super.onBackPressed();}}}

相关文章:

Android : 篮球记分器app _简单应用

示例图&#xff1a; 1.导包 在build.gradle 中 加入 // 使用androidx版本库implementation androidx.lifecycle:lifecycle-extensions:2.1.0-alpha03 2. 开启dataBinding android{...// 步骤1.开启data bindingdataBinding {enabled true}...} 3.写个类继承 ViewModel pac…...

音视频之旅 - 基础知识

图像基础知识 像素 像素是图像的基本单元&#xff0c;一个个像素就组成了图像。你可以认为像素就是图像中的一个点。在下面这张图中&#xff0c;你可以看到一个个方块&#xff0c;这些方块就是像素 分辨率 图像&#xff08;或视频&#xff09;的分辨率是指图像的大小或尺寸。…...

分类预测 | SSA-HKELM-Adaboost麻雀算法优化混合核极限学习机的数据分类预测

分类预测 | SSA-HKELM-Adaboost麻雀算法优化混合核极限学习机的数据分类预测 目录 分类预测 | SSA-HKELM-Adaboost麻雀算法优化混合核极限学习机的数据分类预测分类效果基本描述程序设计参考资料 分类效果 基本描述 1.SSA-HKELM-Adaboost麻雀算法优化混合核极限学习机的数据分类…...

如何使用 Zotero 导出所选条目的 PDF 文件

如何使用 Zotero 导出所选条目的 PDF 文件 Zotero 是一款强大的参考文献管理工具&#xff0c;但它并不直接提供将整个文件夹导出为 PDF 的选项。不过&#xff0c;您可以使用以下步骤来导出您所选的 Zotero 条目中的 PDF 文件&#xff0c;无需额外的插件。 选择所需的 Zotero 条…...

minio的k8s的单机部署

minio的k8s的单机部署 apiVersion: apps/v1 kind: Deployment metadata:name: minionamespace: itshare spec:replicas: 1selector:matchLabels:app: miniotemplate:metadata:labels:app: miniospec:containers:- name: minioimage: minio/minio:RELEASE.2022-10-15T19-57-03Z…...

Git 更改remote repo 地址

Git 更改remote repo 地址 我们想更换远程 repo 地址, 因为我们仓库更换了名称. git remote rename origin 查看现在的 romote 地址 # 查看 remote 地址 git remote -v origin gitgitee.com:changyubiao/attrdict.git (fetch) origin gitgitee.com:changyubiao/attrdict.gi…...

24、文件上传漏洞——Apache文件解析漏洞

文章目录 一、环境简介一、Apache与php三种结合方法二、Apache解析文件的方法三、Apache解析php的方法四、漏洞原理五、修复方法 一、环境简介 Apache文件解析漏洞与用户配置有密切关系。严格来说&#xff0c;属于用户配置问题&#xff0c;这里使用ubantu的docker来复现漏洞&am…...

使用Go快速开发TCP公共服务

使用Go快速开发TCP公共服务 文章目录 使用Go快速开发TCP公共服务一、前言二、实现思路三、源码四、测试使用五、最后 一、前言 之前使用的公共TCP服务无法使用了&#xff0c;想了一下整个实现原理不是很复杂&#xff0c;就利用Go快速开发了一个&#xff0c;利用公网服务器可以…...

QEMU环境调试方法

目录 1.如何查看makefile构建过程执行的命令&#xff1f; 2.如何使用GCC生成C程序的宏展开文件&#xff1f; 3.如何在qemu中执行特定的可执行程序&#xff1f; 4.如何在qemu中直接运行可执行程序&#xff1f; 5.如何在qemu中调试某个可执行程序&#xff1f; 本文从调试的角…...

京东数据运营(京东API接口):10月投影仪店铺数据分析

鲸参谋监测的京东平台10月份投影仪市场销售数据已出炉&#xff01; 10月份&#xff0c;环同比来看&#xff0c;投影仪市场销售均上涨。鲸参谋数据显示&#xff0c;今年10月&#xff0c;京东平台投影仪的销量为16万&#xff0c;环比增长约22%&#xff0c;同比增长约8%&#xff1…...

Aloha 机械臂的学习记录2——AWE:AWE + ACT

继续下一个阶段&#xff1a; Train policy python act/imitate_episodes.py \ --task_name [TASK] \ --ckpt_dir data/outputs/act_ckpt/[TASK]_waypoint \ --policy_class ACT --kl_weight 10 --chunk_size 50 --hidden_dim 512 --batch_size 8 --dim_feedforward 3200 \ --n…...

Spring Boot 项目的创建、配置文件、日志

文章目录 Spring Boot 优点创建 Spring Boot 项目创建项目认识目录网页创建&#xff08;了解&#xff09; 约定大于配置Spring Boot 配置文件配置文件格式读取配置项properties 配置文件yml 配置文件基本语法进阶语法配置对象配置集合yml 设置不同环境的配置文件 Spring Boot 日…...

MySQL:drop、delete与truncate区别

一、用法不同 1、drop(丢弃数据): drop table 表名 &#xff0c;直接将表都删除掉&#xff0c;在删除表的时候使用。 2、truncate (清空数据) : truncate table 表名 &#xff0c;只删除表中的数据&#xff0c;再插入数据的时候自增长 id 又从 1 开始&#xff0c;在清空表中数…...

2024年顶级的9个 Android 数据恢复工具(免费和付费)

不同的事情可能会损坏您的Android手机并导致您丢失数据。但大多数时候&#xff0c;您可以使用取证工具恢复部分或全部文件。 问题可能来自手机的物理损坏、磁盘的逻辑故障、完整的系统擦除&#xff0c;或者只是简单的粗心大意。 但是&#xff0c;无论数据丢失的原因是什么&am…...

c# Aspose.Cells 导出Excel表格 使用随记

/// <summary>/// 导出Excel表格/// </summary>/// <param name"list">数据集合</param>/// <param name"header">数据表头</param>/// <param name"sumColumn">求和列</param>/// <param n…...

SAP UI5 walkthrough step3 Controls

在上一步&#xff0c;我们是直接用index.html 中的body 里面的DIVision去输出 hello world&#xff0c; 在这个章节&#xff0c;我们将用SAP UI5 的标准控件 sap/m/Text 首先&#xff0c;我们去修改 webapp/index.html <!DOCTYPE html> <html> <head><…...

【分布式微服务专题】从单体到分布式(一、SpringCloud项目初步升级)

目录 前言阅读对象阅读导航前置知识笔记正文一、单体服务介绍二、服务拆分三、分布式微服务升级前的思考3.1 关于SpringBoot/SpringCloud的思考【有点门槛】 四、SpringCloud升级整合4.1 新建父子项目 学习总结感谢 前言 从本节课开始&#xff0c;我将自己手写一个基于SpringC…...

python安装与工具PyCharm

摘要&#xff1a; 周末闲来无事学习一下python&#xff01;不是你菜鸡&#xff0c;只不过是对手太强了&#xff01;所以你要不断努力&#xff0c;去追求更高的未来&#xff01;下面先了解python与环境的安装与工具的配置&#xff01; python安装&#xff1a; 官网 进入官网下载…...

Baumer工业相机堡盟工业相机如何通过BGAPISDK将相机图像高速保存到电脑内存(C#)

Baumer工业相机堡盟工业相机如何通过BGAPISDK将相机图像高速保存到电脑内存&#xff08;C#&#xff09; Baumer工业相机Baumer工业相机图像保存到电脑内存的技术背景代码分析注册SDK回调函数BufferEvent声明可以存储相机图像的内存序列和名称在图像回调函数中将图像保存在内存序…...

iOS 防截屏方法(一)

利用UITextField的安全输入secureTextEntry来实现防截屏效果&#xff0c;上代码&#xff1a; // 将 textField 添加到父视图UITextField *textField [[UITextField alloc] init];textField.backgroundColor [UIColor whiteColor];textField.secureTextEntry YES;[self.view …...

三维GIS开发cesium智慧地铁教程(5)Cesium相机控制

一、环境搭建 <script src"../cesium1.99/Build/Cesium/Cesium.js"></script> <link rel"stylesheet" href"../cesium1.99/Build/Cesium/Widgets/widgets.css"> 关键配置点&#xff1a; 路径验证&#xff1a;确保相对路径.…...

令牌桶 滑动窗口->限流 分布式信号量->限并发的原理 lua脚本分析介绍

文章目录 前言限流限制并发的实际理解限流令牌桶代码实现结果分析令牌桶lua的模拟实现原理总结&#xff1a; 滑动窗口代码实现结果分析lua脚本原理解析 限并发分布式信号量代码实现结果分析lua脚本实现原理 双注解去实现限流 并发结果分析&#xff1a; 实际业务去理解体会统一注…...

unix/linux,sudo,其发展历程详细时间线、由来、历史背景

sudo 的诞生和演化,本身就是一部 Unix/Linux 系统管理哲学变迁的微缩史。来,让我们拨开时间的迷雾,一同探寻 sudo 那波澜壮阔(也颇为实用主义)的发展历程。 历史背景:su的时代与困境 ( 20 世纪 70 年代 - 80 年代初) 在 sudo 出现之前,Unix 系统管理员和需要特权操作的…...

嵌入式学习笔记DAY33(网络编程——TCP)

一、网络架构 C/S &#xff08;client/server 客户端/服务器&#xff09;&#xff1a;由客户端和服务器端两个部分组成。客户端通常是用户使用的应用程序&#xff0c;负责提供用户界面和交互逻辑 &#xff0c;接收用户输入&#xff0c;向服务器发送请求&#xff0c;并展示服务…...

[论文阅读]TrustRAG: Enhancing Robustness and Trustworthiness in RAG

TrustRAG: Enhancing Robustness and Trustworthiness in RAG [2501.00879] TrustRAG: Enhancing Robustness and Trustworthiness in Retrieval-Augmented Generation 代码&#xff1a;HuichiZhou/TrustRAG: Code for "TrustRAG: Enhancing Robustness and Trustworthin…...

Vue 3 + WebSocket 实战:公司通知实时推送功能详解

&#x1f4e2; Vue 3 WebSocket 实战&#xff1a;公司通知实时推送功能详解 &#x1f4cc; 收藏 点赞 关注&#xff0c;项目中要用到推送功能时就不怕找不到了&#xff01; 实时通知是企业系统中常见的功能&#xff0c;比如&#xff1a;管理员发布通知后&#xff0c;所有用户…...

pgsql:还原数据库后出现重复序列导致“more than one owned sequence found“报错问题的解决

问题&#xff1a; pgsql数据库通过备份数据库文件进行还原时&#xff0c;如果表中有自增序列&#xff0c;还原后可能会出现重复的序列&#xff0c;此时若向表中插入新行时会出现“more than one owned sequence found”的报错提示。 点击菜单“其它”-》“序列”&#xff0c;…...

【51单片机】4. 模块化编程与LCD1602Debug

1. 什么是模块化编程 传统编程会将所有函数放在main.c中&#xff0c;如果使用的模块多&#xff0c;一个文件内会有很多代码&#xff0c;不利于组织和管理 模块化编程则是将各个模块的代码放在不同的.c文件里&#xff0c;在.h文件里提供外部可调用函数声明&#xff0c;其他.c文…...

从实验室到产业:IndexTTS 在六大核心场景的落地实践

一、内容创作&#xff1a;重构数字内容生产范式 在短视频创作领域&#xff0c;IndexTTS 的语音克隆技术彻底改变了配音流程。B 站 UP 主通过 5 秒参考音频即可克隆出郭老师音色&#xff0c;生成的 “各位吴彦祖们大家好” 语音相似度达 97%&#xff0c;单条视频播放量突破百万…...

【大模型】RankRAG:基于大模型的上下文排序与检索增强生成的统一框架

文章目录 A 论文出处B 背景B.1 背景介绍B.2 问题提出B.3 创新点 C 模型结构C.1 指令微调阶段C.2 排名与生成的总和指令微调阶段C.3 RankRAG推理&#xff1a;检索-重排-生成 D 实验设计E 个人总结 A 论文出处 论文题目&#xff1a;RankRAG&#xff1a;Unifying Context Ranking…...