kotlin 编写一个简单的天气预报app (七)使用material design

一、优化思路

对之前的天气预报的app进行了优化,原先的天气预报程序逻辑是这样的。
使用text和button组合了一个输入城市,并请求openweathermap对应数据,并显示的功能。

但是搜索城市的时候,可能会有错误,比如大小写,比如拼写之类的,所以打算给他升级一下。

目标:

  1. 在搜索的时候需要更够显示搜索的结果,然后在搜索的结果中显示符合的城市列表
  2. 需要有全球的城市数据,搜索结果过滤后,显示符合的城市
  3. 在符合搜索结果的内容中,可以点击需要的城市,并把城市的天气显示在主界面里。

二、准备城市的资料

获取城市的json压缩包
网址:https://bulk.openweathermap.org/sample/
下载链接:https://bulk.openweathermap.org/sample/city.list.json.gz

把下载文件加入进项目里,可以有两个位置一个是res/assert,一个是res/raw,它们的主要区别在于:

  1. res/raw
    • res/raw 目录用于存储原始文件,这些文件不会被 Android 资源编译器进行处理或修改。
    • 您可以在这个目录下放置各种类型的原始文件,例如音频文件、视频文件、文本文件等。
    • 资源文件放置在 res/raw 目录下会保持原始状态,不会被修改。
  2. res/assert
    • res/assert 目录也用于存储原始文件,但其中的文件会被 Android 资源编译器进行压缩和优化处理。
    • 通常用于存放一些较小的非常规资源文件,例如 JSON 文件、XML 文件等。
    • 资源文件放置在 res/assert 目录下会被压缩和优化,这可能会使得访问这些资源稍微快一些。
      如果希望保持资源文件的原始状态,不经过任何修改或处理,可以将它们放置在 res/raw 目录下。
      如果资源文件较小且希望进行优化处理,可以考虑放置在 res/assert 目录下。

这里我们把它放在res/raw目录下,因为它是一个gz的压缩文件。

三、解压城市的gz文件

为这个文件编写代码,让软件在启动时检查是否有解压文件,如果没有解压文件就解压到files目录下。

files 文件夹通常用于存储应用的私有文件。这些文件是应用专用的,其他应用无法访问。以下是关于 files 文件夹的一些主要特点:

  1. 私有性:files 文件夹中的文件只能被创建它们的应用访问,其他应用无法直接访问这些文件。
  2. 持久性:与 cache 目录不同,files 文件夹中的文件不会因为系统资源不足而被清除。这些文件会持久保存,直到应用被卸载或明确删除。
  3. 文件访问:可以通过 Context 对象提供的方法,如 openFileOutput() 和 openFileInput(),来访问 files 文件夹中的文件。
  4. 存储位置:files 文件夹通常位于应用的私有数据目录中。具体路径通常为 /data/data/包名/files/
  5. 用途:files 文件夹适用于存储各种类型的应用数据,如用户配置、日志文件、缓存数据等。

创建一个CityListDataManager的类,并在init时判断文件是否存在,如果不存在就把gz文件解压到files目录下:

class CityListDataManager(private val context: Context) {
    private val tag = "CityListDataManager"
    private val jsonFileName = "city.list.json"
    private val cityListJsonFile : File = File(context.filesDir, jsonFileName)
    private lateinit var cityDataList : Array<CityData>
    init {
        CoroutineScope(Dispatchers.IO).launch {		//使用线程执行,避免阻塞主线程
            if(!isExistCityListJsonFile()) {		//判断文件是否存在
                unzipGzFile(context)				//如果不存在就解压
            }
        }
    }

    private fun isExistCityListJsonFile() : Boolean {
        val isExisted = cityListJsonFile.exists()		
        Log.d(tag, "city list json file is existed:$isExisted")
        return isExisted
    }

    private suspend fun unzipGzFile(context: Context) {
        withContext(Dispatchers.IO) {
            try {
                context.resources.openRawResource(			//使用openRawResource打开raw目录下的文件
                    com.example.myweather.R.raw.city_list_json).use { rawIn ->
                    GZIPInputStream(rawIn).use { gzipIn ->		//使用GZIP来读取gz文件
                        FileOutputStream(cityListJsonFile).use { fileOut ->		//使用FileOutputStream读取文件内容
                            gzipIn.copyTo(fileOut)		//把文件解压到files目录下
                        }
                    }
                }
            } catch (ex: Exception) {
                ex.printStackTrace()
            }
        }
    }
}

四、读取所以城市数据

当我们解压了gz文件后,解压出来的文件是json格式的。包含了所有的城市数据。
这时候我需要选择解析json格式的工具,我搜索了相关的内容发现有两种方式,一种是JsonObject另一种是Gson。
我觉得Gson更简单,就选了这个

引入Gson库:


dependencies {

    implementation(libs.androidx.core.ktx)
    implementation(libs.androidx.appcompat)
    implementation(libs.material)
    implementation(libs.androidx.activity)
    implementation(libs.androidx.constraintlayout)
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.junit)
    androidTestImplementation(libs.androidx.espresso.core)
    //network
    implementation(libs.com.squareup.retrofit2)
    implementation(libs.com.squareup.retrofit2.converterGson)
    implementation(libs.org.greenrobot.eventbus)
    implementation(libs.androidx.recyclerview)
    implementation(libs.com.google.code.gson)
}

对应的libs.versions.toml内容:

constraintlayout = "2.1.4"
retrofit = "2.9.0"
converter-gson = "2.9.0"
eventBus = "3.2.0"
recyclerview = "1.3.2"
gson = "2.10.1"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
androidx-activity = { group = "androidx.activity", name = "activity", version.ref = "activity" }
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
com-squareup-retrofit2 = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
com-squareup-retrofit2-converterGson = { group = "com.squareup.retrofit2", name = "converter-gson", version.ref = "converter-gson" }
org-greenrobot-eventbus = { group = "org.greenrobot", name = "eventbus", version.ref = "eventBus" }
androidx-recyclerview = { group = "androidx.recyclerview", name = "recyclerview", version.ref = "recyclerview" }
com-google-code-gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

为Json内容创建对应的类,两个数据类:CoordCityDataCoord 类表示地理坐标,包含经度 (lon) 和纬度 (lat)。CityData 类表示城市数据,包含城市的ID (id)、名称 (name)、州/省 (state)、国家 (country) 以及该城市的地理坐标 (coord)。这也对应json文件的数据格式

data class Coord (
    val lon: Double,
    val lat: Double
)
data class CityData(
    val id: Int,
    val name: String,
    val state: String?=null,
    val country: String,
    val coord: Coord
)

读取json格式函数,用于逐行读取文件内容并将其解析为 CityData 对象列表。这里使用了 Gson 库来解析 JSON 数据。具体步骤如下:

  1. 创建 Gson 实例。
  2. 打开应用的文件目录,并指定要读取的文件名。
  3. 使用 FileInputStream 打开文件,并创建 BufferedReader 来逐行读取文件内容。
  4. 使用 StringBuilder 来构建完整的文件内容。
  5. 在 while 循环中,逐行读取文件内容,并将每行添加到 StringBuilder 中。
  6. 读取完成后,将 StringBuilder 中的内容转换为字符串。
  7. 使用 Gson 的 fromJson 方法将 JSON 字符串转换为 CityData 对象数组。
  8. 将解析后的 CityData 对象数组发送到事件总线(EventBus)中。
    如果发生 IO 异常,将打印异常堆栈跟踪信息。
private fun readContentOneByOne(context: Context) = try {
    val gson = Gson()
    val file = File(context.filesDir, jsonFileName)
    val fis = FileInputStream(file)
    val reader = BufferedReader(InputStreamReader(fis))
    val stringBuilder = StringBuilder()
    var line : String?
    while (reader.readLine().also { line = it } != null) {
        stringBuilder.append(line).append("\n")
    }
    val fileContent = stringBuilder.toString()
    cityDataList = gson.fromJson(fileContent, Array<CityData>::class.java)

    Log.d(tag, "get city data list done and send event bus")
    EventBus.getDefault().post(CityDataListReadyEvent(cityDataList.toList()))

} catch (e: IOException) {
    e.printStackTrace()
}

CityListDataManagerinit中调用它

    init {
        CoroutineScope(Dispatchers.IO).launch {
            if(!isExistCityListJsonFile()) {
                unzipGzFile(context)
            }
            readContentOneByOne(context)
        }
    }

五、创建Material Search Bar

根据最新的Material Design的Search说明文档,可以在MainActivity里套用它的模版来使用:

<androidx.coordinatorlayout.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

  <!-- NestedScrollingChild goes here (NestedScrollView, RecyclerView, etc.). -->
  <androidx.core.widget.NestedScrollView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:layout_behavior="@string/searchbar_scrolling_view_behavior">
    <!-- Screen content goes here. 这里放显示的主内容 -->
  </androidx.core.widget.NestedScrollView>

  <com.google.android.material.appbar.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content">
    <com.google.android.material.search.SearchBar
        android:id="@+id/search_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/searchbar_hint" />
  </com.google.android.material.appbar.AppBarLayout>

  <com.google.android.material.search.SearchView
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:hint="@string/searchbar_hint"
      app:layout_anchor="@id/search_bar">
    <!-- Search suggestions/results go here (ScrollView, RecyclerView, etc.). 这里是放搜索结果 -->
  </com.google.android.material.search.SearchView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

遇到的问题:
我之前的项目并不是用Android Material Design设计的,只是一个简单的TextView和Button组合的搜索结果。
当我想要使用Material Design相关的控件时,发现引用相关的库后调用SerachBar和需要配置说明文档里不存在的一些属性,否则就会崩溃。
当我为SearchBar设置了属性后,SearchView加入后,仍然还是会崩溃。我搜索了各种问题都无法解决,最后我新建了一个项目,把代码重新拷贝进去后,问题消失了。
分析:可能是我之前建的工程版本较低导致的,我通过对比gradle文件发现,不会崩溃的版本sdk更高。具体我也说不上来为什么,就只能这么用了。

六、使用SearchBar和SearchView对接

当我插入上面的模版后,发现点击SearchBar并不会跳转显示SerachView。
不断尝试后发现可以这样做,让点击SearchBar后出现SearchView

		binding.searchBar.apply {
            setOnClickListener { binding.searchView.show() }
        }

而在SearchView中输入了内容,点击确认进行搜索的方式是这样的:

        binding.searchView.editText.setOnEditorActionListener { v, _, _ ->
            val filterText = v.editableText.toString()
            Toast.makeText(v.context, "the text: $filterText", Toast.LENGTH_SHORT).show()
            return@setOnEditorActionListener false
        }

这样我们一个基本的搜索框架就搭建好了,还需要把结果数据显示出来

七、用recycleview显示搜索结果

在SearchView中添加recycleview控件:

    <com.google.android.material.search.SearchView
        android:id="@+id/search_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:hint="@string/editTextCityHint">
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/cityDataRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
    </com.google.android.material.search.SearchView>

创建一个对应的CityDataAdapter类,这里我们需要添加一个itemClick事件,当有一项被点击时,可以触发一个消息:

package com.example.myweather.cityListUtils

import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.myweather.R


class CityDataAdapter(private val originCityDataList: List<CityData>) :
    RecyclerView.Adapter<CityDataAdapter.ViewHolder>() {

    private var filterCityDataList : MutableList<CityData> = originCityDataList.toMutableList()
    var onItemClick: ((CityData) -> Unit)? = null

    inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
        init {
            view.setOnClickListener {
                if(absoluteAdapterPosition != RecyclerView.NO_POSITION)
                    onItemClick?.invoke(filterCityDataList[absoluteAdapterPosition])
            }
        }
        val cityDataId : TextView = view.findViewById<TextView>(R.id.city_data_id)
        val cityDataName : TextView = view.findViewById<TextView>(R.id.city_data_name)
        val cityDataCountry : TextView = view.findViewById<TextView>(R.id.city_data_country)
        val cityDataCoordinate: TextView = view.findViewById<TextView>(R.id.city_data_coordinate)
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
        val view = LayoutInflater.from(parent.context).inflate(
            R.layout.city_data_item, parent, false)
        return ViewHolder(view)
    }

    override fun onBindViewHolder(holder: ViewHolder, position: Int) {
        val cityData = filterCityDataList[position]
        holder.cityDataId.text = cityData.id.toString()
        holder.cityDataName.text = cityData.name
        holder.cityDataCountry.text = cityData.country
        holder.cityDataCoordinate.text = buildString {
            append(String.format("%.1f", cityData.coord.lon))
            append(",")
            append(String.format("%.1f", cityData.coord.lat))
        }
    }
    override fun getItemCount() = filterCityDataList.size

    @SuppressLint("NotifyDataSetChanged")
    fun setFilter(filterText: String) {
        if(filterText.isEmpty()) {
            filterCityDataList.clear()
            filterCityDataList.addAll(originCityDataList)
        } else {
            filterCityDataList.clear()
            for (item in originCityDataList) {
                if (item.name.lowercase().contains(filterText.lowercase())) {
                    filterCityDataList.add(item)
                }
            }
        }
        notifyDataSetChanged()
    }
}

在MainActivity里,添加处理解析完城市json格式的所有城市数据:
在主线程中接收城市数据列表准备就绪的事件,并调用 updateCityDataList 方法更新城市数据列表。

    @Subscribe(threadMode = ThreadMode.MAIN)
    fun onReceiveCityDataListReadyEvent(event: CityDataListReadyEvent) {
        Log.d(tag, "on received city data list ready event ${event.cityDataList.size}")
        updateCityDataList(event.cityDataList)
    }

当CityDataAdapter的某一项被点击时,调用OnItemClick事件来处理。需要在注册的时候就绑定相关的消息:

  1. 创建了一个 CityDataAdapter 的实例,并传入城市数据列表作为参数。
  2. 为 CityDataAdapter 设置了点击事件的回调函数 onItemClick,在点击城市数据项时执行以下操作:
    • 获取点击的城市名称 cityName。
    • 使用 RetrofitClient 获取该城市的天气信息和预报信息。
    • 创建一个包含点击项名称的提示消息 message。
    • 隐藏搜索视图(可能是搜索框之类的)。
    • 弹出一个短暂的 Toast 消息显示 message。
  3. 将适配器设置到城市数据的 RecyclerView 中,用于显示城市数据列表。
    private fun updateCityDataList(cityDataList: List<CityData>) {
        val adapter = CityDataAdapter(cityDataList)
        adapter.onItemClick = { cityData ->
            val cityName = cityData.name
            RetrofitClient.getWeatherByCityName(cityName)
            RetrofitClient.getForecastByCityName(cityName)
            val message = "Click item name: $cityName"
            binding.searchView.hide()
            Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
        }
        binding.cityDataRecyclerView.adapter = adapter
    }

最终的效果图:

在这里插入图片描述
在这里插入图片描述

最后遇到的奔溃问题

由于json文件解析需要一点时间,如果软件启动时,就去搜索,因为adapter是空的,所以软件会崩溃。
最后我在初始化的时候先创建了一个空的队列,避免崩溃:

    private fun initView() {
        supportFragmentManager.beginTransaction()
            .replace(R.id.fragment_container, CityWeatherFragment())
            .commit()

        binding.forecastRecyclerView.layoutManager = LinearLayoutManager(this)
        binding.cityDataRecyclerView.layoutManager = LinearLayoutManager(this)
        binding.cityDataRecyclerView.adapter = CityDataAdapter(emptyList<CityData>())
        binding.searchBar.apply {
            setOnClickListener { binding.searchView.show() }
        }
        binding.searchView.editText.setOnEditorActionListener { v, _, _ ->
            val filterText = v.editableText.toString()
            Toast.makeText(v.context, "the text: $filterText", Toast.LENGTH_SHORT).show()
            val cityDataAdapter : CityDataAdapter= binding.cityDataRecyclerView.adapter as CityDataAdapter
            cityDataAdapter.setFilter(filterText)
            return@setOnEditorActionListener false
        }
    }
  1. 使用 supportFragmentManager 开始一个事务,并将一个 CityWeatherFragment 替换到 ID 为 fragment_container 的容器中。
  2. 设置 forecastRecyclerView 和 cityDataRecyclerView 的布局管理器为 LinearLayoutManager,以确保它们的布局是线性的。
  3. 为 cityDataRecyclerView 设置一个空的城市数据列表适配器 CityDataAdapter,以便后续更新城市数据。
  4. 为搜索栏 searchBar 设置点击事件监听器,点击时显示搜索视图 searchView。
  5. 为搜索视图的编辑文本框设置编辑动作监听器,当用户执行编辑动作时(比如按下回车键)执行以下操作:
    • 获取编辑框中的文本内容。
    • 弹出一个短暂的 Toast 消息,显示文本内容。
    • 从 cityDataRecyclerView 的适配器中获取 CityDataAdapter 实例,并调用其 setFilter 方法,传入文本内容作为过滤条件。

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

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

相关文章

Java设计模式 _结构型模式_过滤器模式

一、过滤器模式 1、过滤器模式 过滤器模式&#xff08;Filter Pattern&#xff09;是这一种结构型设计模式。过滤器&#xff0c;顾名思义&#xff0c;就是对一组数据进行过滤&#xff0c;从而最终获取到我们预期的数据。 2、实现思路 &#xff08;1&#xff09;、定义过滤器的…

解决问题:Canal客户端覆盖服务端Subscribe,只有TRANSACTIONBEGIN和TRANSACTIONEND日志,没有ROWDATA日志的问题

一&#xff0c;背景 在整合canal和Spring时&#xff0c;本地使用canal的subscribe方法订阅了需要监听的表&#xff0c;但是获得只有transactionbegin和transactionend两种eventType的日志&#xff0c; 没有rowdata类型的日志&#xff0c;导致无法完成监听数据库数据更新的需求…

提示词优化的自动化探索:Automated Prompt Engineering

编者按&#xff1a; 作者在尝试教授母亲使用 LLM 完成工作任务时&#xff0c;意识到提示词的优化并不像想象中简单。提示词的自动优化对于经验并不丰富的提示词撰写者很有价值&#xff0c;他们没有足够的经验去调整和改进提供给模型的提示词&#xff0c;这引发了对自动化提示词…

C++—DAY2

定义一个矩形类Rec&#xff0c;包含私有属性length&#xff0c;width&#xff0c;有以下成员函数: void set length(int l);//设置长度 void set width(int w); //设置宽度 int get length(); //获取长度 int get_width(); //获取宽度 void show(); //输出…

可见水印去除算法简介

去水印技术简介 进入二十一世纪以来&#xff0c;随着互联网技术和电子技术的飞速发展和进步&#xff0c;电子设备比如智能手机、iPad、个人计算机和智能穿戴设备等的大规模普及使用&#xff0c;各种文字、图像、视频及音频等数据信息借助于互联网实现了人们之间远距离的信息传…

kernel32.dll文件丢失的原因以及相对应的解决办法分享

kernel32.dll丢失是电脑中一个重要的文件&#xff0c;其实想要修复kernel32.dll文件的方法比较简单&#xff0c;今天就和大家说说如何去修复kernel32.dll文件。导致kernel32.dll文件丢失的原因又是什么&#xff1f;一起开看看吧。 kernel32.dll的作用 kernel32.dll是一个重要的…

IntelliJ IDEA 如何启用 JDK 预览特性

IntelliJ IDEA 也可以启用 JDK 的预览特性。 针对项目&#xff0c;选择项目结构。 配置是在语言结构上。 单击语言结构上的 SDK 默认&#xff0c;往下拉&#xff0c;就可以看到针对新版本的选项。 同时还可以看到那些版本是支持新特性预览的&#xff0c;那些版本是不支持新特…

Oracle 19c OCM考试难度如何?

许多人对 Oracle 19c OCM 的考试规则并不熟悉&#xff0c;本文将详细介绍考证所需条件以及具体要求&#xff0c;以帮助大家更顺利地完成考试流程。 首先&#xff0c;考生需具备相匹配的同级别 OCP 证书&#xff0c;如已获得 10g/11g/12c 证书者&#xff0c;则须先完成 083 升级…

UE5 GAS开发P41-43 永久效果,去除永久效果,伤害区域,EnumClass,开始重叠与结束重叠事件

这一部分学习了怎么创建一个伤害性的地形(火焰地形,毒沼泽等都可以用这个方式创建) AuraEffectActor.h // Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h" #include "GameplayEffect.h&q…

【navicat】oracle library is not loaded 问题复现和解决方案

问题原因&#xff1a;客户端oci版本安装错误&#xff0c;navicat需要64位的oci,但是使用32位的oci。 解决方案&#xff1a;官网下载64位oci进行配置。本次演示的解决多了splplus&#xff0c;其实不必要安装也能运行。 首先判断是否数据库已经打开 尝试使用splplus连接数据库 1…

GDPU 算法分析与设计 天码行空5

一、【实验目的】 &#xff08;1&#xff09;熟悉动态规划算法的基本思想. &#xff08;2&#xff09;理解动态规划算法中子问题的划分和递推方程设计的基本方法. &#xff08;3&#xff09;熟悉矩阵链乘法的基本思想并编程实现。 二、【实验内容】 输入:矩阵链Ai…j的输入为…

美国站群服务器的国际网络环境在全球的影响力?

美国站群服务器的国际网络环境在全球的影响力? 美国站群服务器如何通过其技术优势和网络基础设施&#xff0c;塑造国际网络环境并对全球产生影响力? 在当今数字化时代&#xff0c;美国站群服务器在国际网络环境中扮演着至关重要的角色。作为全球互联网发展的领导者之一&…

在Windows 11中NotePad3的安装和配置详细教程

&#x1f4dd; 在Windows 11中NotePad3的安装和配置详细教程 文章目录 &#x1f4dd; 在Windows 11中NotePad3的安装和配置详细教程摘要引言正文1. NotePad3简介 &#x1f4d8;2. 安装前的准备工作 &#x1f6e0;️ 我已经给大家准备了一份安装包&#xff0c;微信搜索公众号&am…

K8S 部署和访问 Kubernetes 仪表板(Dashboard)

文章目录 部署 Dashboard UI浏览器访问登陆系统 Dashboard 是基于网页的 Kubernetes 用户界面。 你可以使用 Dashboard 将容器应用部署到 Kubernetes 集群中&#xff0c;也可以对容器应用排错&#xff0c;还能管理集群资源。 你可以使用 Dashboard 获取运行在集群中的应用的概览…

推荐一款国内超级好用的低代码平台+商业开源低代码MES

一、低代码平台是什么&#xff1f; 低代码平台是一种应用程序&#xff0c;它为编程提供图形用户界面&#xff0c;从而以极快的速度开发代码&#xff0c;减少传统编程工作。 这些工具有助于快速开发代码&#xff0c;最大限度地减少手工编码的工作量。这些平台不仅有助于编码&a…

网络通信安全

一、网络通信安全基础 TCP/IP协议简介 TCP/IP体系结构、以太网、Internet地址、端口 TCP/IP协议简介如下&#xff1a;&#xff08;from文心一言&#xff09; TCP/IP&#xff08;Transmission Control Protocol/Internet Protocol&#xff0c;传输控制协议/网际协议&#xff0…

基础环境:wsl2安装Ubuntu22.04 + miniconda

服务器相关信息&#xff1a; Thinkpad p1 gen5 64G 2T 3080ti&#xff0c;自带的有nvidia-smi显卡驱动。使用wsl2安装Ubuntu22.04 miniconda目标&#xff1a;安装gpu版本的PyTorch2.1.2&#xff08;torch2.1.2/cu117 torchvision0.16.2/cu117&#xff09; 处理器 12th Gen I…

【Linux-进程状态】

文章目录 1.进程状态1.运行状态2.阻塞状态3.挂起 2.Linux系统中的进程状态1.前台进程和后台进程深度睡眠 2.停止状态3.僵尸状态和死亡状态&#xff08;孤儿进程&#xff09; 1.进程状态 想要理解进程状态&#xff0c;我们要先看看课本中的进程有哪些状态。 进程状态用大白话说…

云渲染一张图多少钱

使用云渲染渲染一张效果图的价格没法确定多少钱一张&#xff0c;云渲染一张图的价格会受到多个因素的影响&#xff0c;如云渲染平台的定价策略、所选的渲染配置、优惠政策以及你提交的场景任务等。因此&#xff0c;无法给出确切的单一价格。 不同的云渲染平台会有不同的定价模…

《苍穹外卖》Day11部分知识点记录(数据统计——图像报表)

一、Apache ECharts 介绍 Apache ECharts是一款基于javascript的数据可视化图标库&#xff0c;提供直观、生动、可交互、可个性化定制的数据可视化图表。 官网地址&#xff1a;https://echarts.apache.org/zh/index.html 效果展示 柱形图饼图折线图 入门案例 1. 在 echart…
最新文章