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

微信小程序开发之投票管理及小程序UI的使用

目录

一、小程序UI

1.讲述

2. 介绍vantWeapp

3. 使用vantWeapp

安装

构建

依赖

引用

二、后端

1. 后端实体对象

2. 后端接口

3. 实现类

4. 请求处理类

三、前端

1. 定义路径

2. 页面引用

3. 页面

4. 页面美化

5. 数据

6. 效果展示


一、小程序UI

1.讲述

小程序UI(User Interface)是指小程序的用户界面,包括小程序的整体布局、样式、交互等方面的设计。小程序UI的设计目的是为了提供用户友好的界面,使用户能够方便地使用小程序的功能。

小程序UI的设计原则通常包括以下几点:

    1. 简洁明了:小程序的界面设计应该简洁明了,避免过多的视觉干扰和复杂的布局。用户可以通过一目了然的界面结构快速找到所需的功能。

    2. 一致性:小程序的不同页面之间应该保持一致的界面设计,包括颜色、字体、按钮等方面的统一。这样可以提高用户的学习和使用效率,减少用户的困惑。

    3. 易用性:小程序的界面设计应该考虑用户的使用习惯和心理需求,尽量减少用户的操作步骤和思考负担。例如,常用的功能应该放在显眼的位置,操作按钮应该易于点击等。

    4. 可访问性:小程序的界面设计应该考虑到不同用户的特殊需求,例如视力障碍者、听力障碍者等。设计师应该通过合适的颜色对比度、字体大小等方式来提高小程序的可访问性。

    5. 反馈机制:小程序的界面设计应该提供即时的反馈机制,告知用户他们的操作是否成功或失败。例如,可以通过动画、弹窗等方式来提示用户操作的结果。

小程序UI的设计通常由UI设计师负责,他们需要根据小程序的功能和定位进行界面设计,包括页面的布局、颜色的选择、图标的设计等。同时,他们还需要与开发人员密切合作,确保设计的界面能够被准确地实现。

2. 介绍vantWeapp

vantWeapp是一个基于微信小程序的组件库,是Vant组件库的小程序版本。它包括了常用的UI组件、业务组件和功能组件,可以帮助开发者快速构建出优秀的小程序页面。

vantWeapp的主要作用包括:

1. 提供常用UI组件:vantWeapp提供了丰富的UI组件,包括按钮、表单、列表、卡片、标签、导航、弹窗等,可以帮助开发者快速构建出美观、易用的小程序页面。

2. 提高开发效率:vantWeapp的组件具有可复用性,可以减少开发者的重复工作,提高开发效率。

3. 提供业务组件:vantWeapp还提供了一些常用的业务组件,例如地址选择器、城市选择器、日期选择器等,可以帮助开发者快速实现一些常用的业务需求。

4. 提供功能组件:vantWeapp还提供了一些功能组件,例如图片预览、下拉刷新、上拉加载等,可以帮助开发者实现一些常用的功能需求。

总之,vantWeapp是一个非常实用的小程序组件库,可以帮助开发者快速构建出美观、易用、功能丰富的小程序页面,提高开发效率,降低开发成本。

3. 使用vantWeapp

我们进入 vantWeapp 的官网进行快速上手 :   https://vant-contrib.gitee.io/vant-weapp/0.x/#/quickstarticon-default.png?t=N7T8https://vant-contrib.gitee.io/vant-weapp/0.x/#/quickstart

安装

在前端项目的跟路径中,打开CMD窗口,输入以下命令安装npm。

npm i vant-weapp -S --production

如图 : 

构建

打开微信开发者工具,点击 工具 -> 构建 npm,并勾选 使用 npm 模块 选项,构建完成后,即可引入组件

如图 : 

注 : 有些版本的开发工具是不需要勾选使用 npm 模块 选项的

依赖

在前端项目的跟路径中,打开CMD窗口,输入以下命令安装项目依赖。

npm install

如图 : 

引用

以 Button 组件为例,只需要在app.jsonindex.json中配置 Button 对应的路径即可。如果你是通过下载源代码的方式使用 vant-weapp,请将路径修改为项目中 vant-weapp 所在的目录。

例如 : 

{"navigationBarTitleText": "投票管理","usingComponents": {"tabs":"/components/tabs/tabs","van-button": "vant-weapp/button",}
}

引入组件后,可以在 wxml 中直接使用组件,如以下代码 :

<van-button type="default">默认按钮</van-button>
<van-button type="primary">主要按钮</van-button>
<van-button type="info">信息按钮</van-button>
<van-button type="warning">警告按钮</van-button>
<van-button type="danger">危险按钮</van-button>

效果图  :

二、后端

以下后端代码都是使用SpringMVCmybatis的技术学习,还有前后端分离的技术应用,在我博客中也信息的学习及技术,通过这些来完成后端的代码及功能的实现。如有不懂可以在我博客中自行学习,你肯定是技术大牛。

1.  后端实体对象

Vote : 投票

package com.CloudJun.ssm.model;import lombok.Data;@Data
public class Vote {private Integer id;private Integer meetingId;private String name;private String remark;private Integer state;private String images;public Vote(Integer id, Integer meetingId, String name, String remark, Integer state, String images) {this.id = id;this.meetingId = meetingId;this.name = name;this.remark = remark;this.state = state;this.images = images;}@Overridepublic String toString() {return "Vote{" +"id=" + id +", meetingId=" + meetingId +", name='" + name + '\'' +", remark='" + remark + '\'' +", state=" + state +", images='" + images + '\'' +'}';}
}

2. 后端接口

VoteMapper : 自动生成的对象接口

package com.CloudJun.ssm.mapper;import com.CloudJun.ssm.model.Vote;import java.util.List;public interface VoteMapper {int deleteByPrimaryKey(Integer id);int insert(Vote record);int insertSelective(Vote record);Vote selectByPrimaryKey(Integer id);int updateByPrimaryKeySelective(Vote record);int updateByPrimaryKey(Vote record);List<Vote> selectByList(Integer state);
}

VoteService : 自己为了实现方法创建的接口

package com.CloudJun.ssm.service;import com.CloudJun.ssm.model.Vote;import java.util.List;/*** @author CloudJun* @create  2023-10-24 14:41*/
public interface VoteService {int deleteByPrimaryKey(Integer id);int insert(Vote record);int insertSelective(Vote record);Vote selectByPrimaryKey(Integer id);int updateByPrimaryKeySelective(Vote record);int updateByPrimaryKey(Vote record);List<Vote> selectByList(Integer state);}

3. 实现类

VoteServiceimpl : 实现调用方法功能而创建的实现类

package com.CloudJun.ssm.service.impl;import com.CloudJun.ssm.mapper.VoteMapper;
import com.CloudJun.ssm.model.Vote;
import com.CloudJun.ssm.service.VoteService;
import org.springframework.beans.factory.annotation.Autowired;import java.util.List;/*** @author CloudJun* @create  2023-10-24 14:42*/
public class VoteServiceimpl implements VoteService {@Autowiredprivate VoteMapper voteMapper;@Overridepublic int deleteByPrimaryKey(Integer id) {return voteMapper.deleteByPrimaryKey(id);}@Overridepublic int insert(Vote record) {return voteMapper.insert(record);}@Overridepublic int insertSelective(Vote record) {return voteMapper.insertSelective(record);}@Overridepublic Vote selectByPrimaryKey(Integer id) {return voteMapper.selectByPrimaryKey(id);}@Overridepublic int updateByPrimaryKeySelective(Vote record) {return 0;}@Overridepublic int updateByPrimaryKey(Vote record) {return 0;}@Overridepublic List<Vote> selectByList(Integer state) {return voteMapper.selectByList(state);}
}

4. 请求处理类

VoteController : 处理前端发送的请求及处理数据,并且给予回馈数据到前端

package com.CloudJun.ssm.wxcontroller;import com.CloudJun.ssm.mapper.VoteMapper;
import com.CloudJun.ssm.model.Info;
import com.CloudJun.ssm.model.Vote;
import com.CloudJun.ssm.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.HashMap;
import java.util.List;
import java.util.Map;/*** @author CloudJun* @create  2023-10-24 14:24*/
@RestController
@RequestMapping("/wx/vote")
public class VoteController {@Autowiredprivate VoteMapper voteMapper;@RequestMapping("/add")public Object Add (Vote vote){int i = voteMapper.insertSelective(vote);return ResponseUtil.ok();}@RequestMapping("/list")public Object list (Integer state){List<Vote> votes = voteMapper.selectByList(state);return ResponseUtil.ok(votes);}@RequestMapping("/update")public Object update (Vote vote){int i = voteMapper.updateByPrimaryKey(vote);return ResponseUtil.ok();}}

三、前端

以下的前端代码基于我博客中的进行扩写 : 微信小程序之微信授权登入及授权的流程讲解icon-default.png?t=N7T8https://blog.csdn.net/SAME_LOVE/article/details/133963879?spm=1001.2014.3001.5501

1 . 定义路径

在项目中的  api.js 文件里,配置后端请求数据的请求地址。

// 以下是业务服务器API地址// 本机开发API地址
var WxApiRoot = 'http://localhost:8080/oapro/wx/';
// 测试环境部署api地址
// var WxApiRoot = 'http://192.168.191.1:8080/oapro/wx/';
// 线上平台api地址
//var WxApiRoot = 'https://www.oa-mini.com/demo/wx/';module.exports = {IndexUrl: WxApiRoot + 'home/index', //首页数据接口SwiperImgs: WxApiRoot+'swiperImgs',MettingInfos: WxApiRoot+'meeting/list',MettingVote : WxApiRoot+'info/list',MettingVoteAdd : WxApiRoot+'vote/add',//增加投票MettingVoteList : WxApiRoot+'vote/list',//获取投票信息MettingVoteupdate : WxApiRoot+'vote/update',//确认投票AuthLoginByWeixin: WxApiRoot + 'auth/login_by_weixin', //微信登录UserIndex: WxApiRoot + 'user/index', //个人页面用户相关信息AuthLogout: WxApiRoot + 'auth/logout', //账号登出AuthBindPhone: WxApiRoot + 'auth/bindPhone' //绑定微信手机号
};

2. 页面引用

在项目的投票管理页面中配置引用的组件及自定义组件,在.JSON文件中编写 :

list.json

{"navigationBarTitleText": "投票管理","usingComponents": {"tabs":"/components/tabs/tabs","van-button": "vant-weapp/button","van-notice-bar": "vant-weapp/notice-bar/index","van-toast": "vant-weapp/toast/index"}
}

3. 页面

在项目的投票管理页面中,进行编写页面标签,对数据进行显示,在.wxml文件中

list.wxml

<!--pages/vote/list/list.wxml-->
<tabs tabList="{{tabs}}"  bindtabsItemChange="tabsItemChange">
</tabs>
<view style="height: 100rpx;"></view><view class="{{componentStatus[0] ? '' : 'hidden'}}">
<!-- 发起投票版块 -->
<view class="publish"><form bindsubmit='votesubmit'><view class="img">
<view class="img_left" >
<image class="imgs"  src="{{imageUrl=='' ? '/static/persons/15.gif':imageUrl }}" mode="aspectFit" bindtap="handleUploadImage"></image>
<input hidden="true"  type="text" name="images" value="{{imageUrl}}" />
</view>
</view><view class="meeting_id"><view class="meeting_title">所属会议 : </view><picker bindchange="meetingChange" name="meetingId" value="{{array[meeting_id].id}}"    range-key="title" range="{{array}}"><view class="meeting_text" >{{array[meeting_id].title==null?'请选择会议':array[meeting_id].title}}</view></picker>
</view>
<view class="meeting_id" id="meeting_id"><view class="meeting_title">投票标题 : </view><input class="vote_text" placeholder="请输入标题" type="text" name="name" />
</view>
<view class="textarea" id="vote_text"><view class="meeting_textarea">投票说明 : </view><textarea class="vote_textarea"  name="remark"  type="text" ></textarea>
</view>
<view class="vote_button"><button class="vote_button_empty" type="default" formType="reset"  plain="true">清空内容</button><view style="width: 70rpx;"></view><button class="vote_button_submit" type="primary" formType="submit" plain="true">确认发起</button>
</view>
</form>
</view></view><view class="{{componentStatus[1] ? '' : 'hidden'}}"><van-notice-barleft-icon="flower-o"mode="closeable"color="#6d9d9e"delay="100"backgroundColor="#e4ecec"text="无论我们能活多久,我们能够享受的只有无法分割的此刻,不会回头,离弦的箭、逝去的生活和失去的机会。此外别无其他。"
/>
<!-- 已参与投票 -->
<block wx:for-items="{{engage}}" wx:for-item="item" wx:key="item.id">
<view class="vote_carryout">
<image class="vote_carryout_img" src="{{item.images}}"></image>
<view class="vote_carryout_text">
<view style="width: 450rpx;display: flex;flex-direction:column;">
<text class="vote_carryout_text_f" >{{item.name}}</text>
<text class="vote_carryout_text_t">{{item.remark}}</text>
</view>
<button class="vote_carryout_text_btn" bindtap="voteparticipate"  data-item="{{item.id}}"  size="mini">参与</button>
</view>
</view>
</block></view><view class="{{componentStatus[2] ? '' : 'hidden'}}"><van-notice-barleft-icon="flower-o"mode="closeable"color="#6d9d9e"delay="100"backgroundColor="#e4ecec"text="无论我们能活多久,我们能够享受的只有无法分割的此刻,不会回头,离弦的箭、逝去的生活和失去的机会。此外别无其他。"
/>
<!-- 未参与投票 -->
<block wx:for-items="{{not}}" wx:for-item="item" wx:key="item.id">
<view class="vote_carryout">
<image class="vote_carryout_img" src="{{item.images==null?'/static/persons/15.gif':item.images}}"></image>
<view class="vote_carryout_text">
<view style="width: 450rpx;display: flex;flex-direction:column;">
<text class="vote_carryout_text_f" >{{item.name}}</text>
<text class="vote_carryout_text_t">{{item.remark}}</text>
</view>
<button class="vote_carryout_text_btn" bindtap="Votenotbtn"  size="mini">已参与</button>
</view>
</view>
</block></view><view class="{{componentStatus[3] ? '' : 'hidden'}}"><van-notice-barleft-icon="flower-o"mode="closeable"color="#6d9d9e"delay="100"backgroundColor="#e4ecec"text="无论我们能活多久,我们能够享受的只有无法分割的此刻,不会回头,离弦的箭、逝去的生活和失去的机会。此外别无其他。"
/>
<!-- 未参与投票 -->
<block wx:for-items="{{lists}}" wx:for-item="item" wx:key="item.id">
<view class="vote_carryout">
<image class="vote_carryout_img" src="{{item.images==null?'/static/persons/15.gif':item.images}}"></image>
<view class="vote_carryout_text">
<view style="width: 450rpx;display: flex;flex-direction:column;">
<text class="vote_carryout_text_f" >{{item.name}}</text>
<text class="vote_carryout_text_t">{{item.remark}}</text>
</view>
<button class="vote_carryout_text_btn"  size="mini">{{item.state==0?'未参与':'已参与'}}</button>
</view>
</view>
</block></view>

4. 页面美化

在项目的投票管理页面中,编写标签样式,对页面的美化,在.wxss文件中编写

list.wxss

/* pages/vote/list/list.wxss */
.hidden {display: none;
}.img {height: 450rpx;/* display: flex; *//* border-radius: 6px; *//* align-items: center; */
}.imgs {height: 420rpx;width: 419rpx;margin-left: 105rpx;box-shadow: 0 0 20px rgb(117, 241, 241);border-radius: 10rpx;
}.img_left {margin-top: 28rpx;height: 450rpx;width: 600rpx;margin-left: 57rpx;/* border-radius: 23rpx; *//* background-color: deeppink; */
}.publish {width: 100%;
}.meeting_id {height: 100rpx;background-color: rgb(230, 243, 243);display: flex;/* border-radius: 6px; */align-items: center;
}.meeting_title {margin-left: 20rpx;
}.meeting_text {/* background-color: aqua; */margin-left: 20rpx;margin-top: 10rpx;padding-left: 20rpx;font-size: 14px;height: 50rpx;width: 520rpx;
}#meeting_id {border-top: 2px solid #fafafa;
}#vote_text {display: flex;align-items: center;
}.vote_text {margin-left: 35rpx;
}.meeting_textarea {margin-left: 20rpx;width: 440rpx;
}.vote_textarea {height: 160rpx;width: 490px;padding-right: 10rpx;padding-top: 10rpx;padding-left: 10rpx;border: 2px solid #c0f0f1;border-radius: 20rpx;
}.textarea {border-top: 2px solid #fafafa;background-color: rgb(238, 247, 247);
}.vote_button {border-top: 4px solid #fafafa;display: flex;width: 80%;align-items: center;margin-left: 73rpx;
}
.vote_carryout{background-color: rgba(150, 250, 250, 0.315);box-shadow: 0 0 20px rgb(117, 241, 241);margin: 20rpx 30rpx 0rpx 70rpx;border-radius: 20rpx;height: 460rpx;width: 620rpx;
}
.vote_carryout_img{ height: 350rpx;width: 620rpx;border-radius: 20rpx;
}
.vote_carryout_text{
display: flex;
height: 100rpx;
border-radius: 20rpx;
}
.vote_carryout_text_f{margin-left: 50rpx;height: 40rpx;font-size: 12px;
}
.vote_carryout_text_t{margin-left: 50rpx;height: 40rpx;color: rgba(116, 114, 114, 0.89);font-size: 12px;
}
.vote_carryout_text_btn{margin-top: 10rpx;height: 80rpx;font-size: 12px;size: 12px;background-color: rgb(174, 249, 252);
}

5. 数据

在项目的投票管理页面中,编写后台请求的数据进行回应到前端,在.js文件中

list.js

// pages/vote/list/list.js
var app = getApp();
const api = require('../../../config/api');
const util = require('../../../utils/util.js');
Page({/*** 页面的初始数据*/data: {tabs: ['发起投票', '未参与', '已参与', '全部投票'],//顶部导航栏componentStatus: [true, false, false, false],//用于处理内容显示array: ['美国', '中国', '巴西', '日本'],engage:[],//未参与的投票not:[],//已参与的投票lists:[],//全部投票信息meeting_id: '请选择会议',imageUrl: '',//图片路径votename: '123'},//选择所属会议的事件meetingChange(e) {// console.log(e.detail.value) this.setData({meeting_id: e.detail.value})},//初始会议信息meetingini() {util.request(api.MettingVote).then(res => {this.setData({array: res.data.infoList})}).catch(res => {console.log('服器没有开启,使用模拟数据!')})},//初始化未参与的投票Voteiniengage() {util.request(api.MettingVoteList,{state:0}).then(res => {// console.log(res);this.setData({engage: res.data})}).catch(res => {console.log('服器没有开启,使用模拟数据!')})},//初始化已参与的投票Voteininot() {util.request(api.MettingVoteList,{state:1}).then(res => {// console.log(res);this.setData({not: res.data})}).catch(res => {console.log('服器没有开启,使用模拟数据!')})},//初始化全部投票信息VoteiniList() {util.request(api.MettingVoteList).then(res => {// console.log(res);this.setData({lists: res.data})}).catch(res => {console.log('服器没有开启,使用模拟数据!')})},//参与投票的点击事件voteparticipate(id){// console.log(id.target.dataset.item)wx.showModal({title: '提示',content: '你是否要贡献出你宝贵的一票?',success: function (res) {if (res.confirm) {//这里是点击了确定以后util.request(api.MettingVoteupdate, {id:id.target.dataset.item}).then(res => {// console.log(res)if (res.errno == 0) {wx.showToast({title: '成功投票!!',icon: 'none',duration: 1000//持续的时间})}}).catch(res => {console.log('服器没有开启,发布失败')})} else {//这里是点击了取消以后console.log('用户点击取消')}}})},//发起投票的事件votesubmit(data) {console.log(data.detail.value)wx.showModal({title: '提示',content: '确定发起该投票吗?',success: function (res) {if (res.confirm) {//这里是点击了确定以后util.request(api.MettingVoteAdd, data.detail.value).then(res => {// console.log(res)if (res.errno == 0) {wx.showToast({title: '发布投票成功',icon: 'none',duration: 1500//持续的时间})}}).catch(res => {console.log('服器没有开启,发布失败')})} else {//这里是点击了取消以后console.log('用户点击取消')}}})},//已参与按钮的点击事件Votenotbtn() {wx.showToast({title: '已进行投票,不可再投',icon: 'none',duration: 1000//持续的时间})},//图片选择器handleUploadImage() {wx.chooseImage({count: 1,success: (res) => {const imagePath = res.tempFilePaths[0];// 处理选择的图片路径// console.log('选择的图片路径:', imagePath);this.setData({imageUrl: imagePath // 更新图片路径,触发重新渲染});}});},/*** 生命周期函数--监听页面加载*/onLoad(options) {this.meetingini();this.Voteiniengage();this.Voteininot();this.VoteiniList();},/*** 生命周期函数--监听页面初次渲染完成*/onReady() {},/*** 生命周期函数--监听页面显示*/onShow() {},/*** 生命周期函数--监听页面隐藏*/onHide() {},/*** 生命周期函数--监听页面卸载*/onUnload() {},/*** 页面相关事件处理函数--监听用户下拉动作*/onPullDownRefresh() {},/*** 页面上拉触底事件的处理函数*/onReachBottom() {},/*** 用户点击右上角分享*/onShareAppMessage() {},//点击导航栏进行切换下方内容tabsItemChange(e) {let index = e.detail.index;//全部的组件赋值为falseconst lists = [false, false, false, false];//将所点击的组件赋值为truelists[index] = true;this.setData({componentStatus: lists // 更新 data 中的 componentStatus 属性值});},// tabsItemChange(e){//     let index = e.detail.index;//     console.log('vote.index='+index)//     if(index==1 || index==2){//         if (app.globalData.hasLogin) {//         }else{//             wx.navigateTo({//               url: '/pages/auth/login/login',//             })//         }//     }// }
})

6. 效果展示

发起投票

参与投票

查看所有投票

相关文章:

微信小程序开发之投票管理及小程序UI的使用

目录 一、小程序UI 1.讲述 2. 介绍vantWeapp 3. 使用vantWeapp 安装 构建 依赖 引用 二、后端 1. 后端实体对象 2. 后端接口 3. 实现类 4. 请求处理类 三、前端 1. 定义路径 2. 页面引用 3. 页面 4. 页面美化 5. 数据 6. 效果展示 一、小程序UI 1.讲述 小…...

EPB功能开发与测试(基于ModelBase实现)

ModelBase是经纬恒润开发的车辆仿真软件&#xff0c;包含两个大版本&#xff1a;动力学版本、智能驾驶版本。动力学版包含高精度动力学模型&#xff0c;能很好地复现车辆在实际道路中运行的各种状态变化&#xff0c;可用于乘用车、商用车动力底盘系统算法开发、控制器仿真测试&…...

微信小程序:点击按钮出现右侧弹窗

效果 代码 wxml <!-- 弹窗信息 --> <view class"popup-container" wx:if"{{showPopup}}"><view class"popup-content"><!-- 弹窗内容 --><text>这是一个右侧弹窗</text></view> </view> <…...

EEG脑电信号的具体采集过程

脑电图&#xff08;EEG&#xff09;是一种记录大脑活动的非侵入性方法。下面是EEG脑电信号的典型采集过程&#xff1a; 准备&#xff1a;在进行EEG采集之前&#xff0c;需要准备好以下设备和材料&#xff1a; EEG采集设备&#xff1a;包括EEG电极、放大器和记录设备。电极帽或电…...

SYS/BIOS 开发教程: 创建自定义平台

目录 SYS/BIOS 开发教程: 创建自定义平台创建自定义平台新建工程并指定自定义平台修改现有工程使用自定义平台 参考: TI SYS/BIOS v6.35 Real-time Operating System User’s Guide 6.2节 本示例基于 EVMC6678L 开发板, 创建自定义平台, 并将代码段的位置指定到C6678器件内部的…...

【Qt样式(qss)-5】qss局部渲染混乱,错乱,不生效的一种原因

前言&#xff1a; 之前写过一些关于qss的文章&#xff1a; 【Qt样式&#xff08;qss&#xff09;-1】手册小结&#xff08;附例&#xff1a;软件深色模式&#xff09;_深蓝色主题qss表-CSDN博客 【Qt样式&#xff08;qss&#xff09;-2】使用小结&#xff08;软件换肤&#…...

最新基于机器学习模型单图换脸离线版软件包及使用方法,本地离线版本模型一键运行(免费下载)

最新基于机器学习模型单图换脸离线版软件包及使用方法,本地离线版本模型一键运行(免费下载)。 “单图换脸”离线一键运行版来了。Roop发布几十个小时后,马不停蹄地搞了Colab在线版。其实这东西都挺好的,又快又方便,几乎没有任何硬件要求,点一点就可以搞定了。但是它有…...

通过VScode连接远程 Linux 服务器修改vue代码

1先在Linux环境安装node&#xff0c;官网下载的node安装包放在自己新建文件夹 2解压 tar -zxvf node-v18.18.0-linux-x64.tar.xz 3新建代码路径&#xff0c; 下载代码 4安装 OpenSSH OpenSSH 可以让你在终端使用 ssh 命令&#xff0c;Windows10 一般自带。 可以通过以下方式…...

Pytorch实现深度学习常见问题

RuntimeError: stack expects each tensor to be equal size, but got [3, 300, 300] at entry 0 and [3, 301, 301] at entry 24 这里的问题出现的原因肯定是在数据预处理处&#xff0c;如下图&#xff0c;当数据使用不同的transforms处理方式时&#xff0c;会导致数据的尺寸大…...

ICMP权限许可和访问控制漏洞处理(CVE-1999-0524)

一、问题描述 某次例行安全扫描&#xff0c;发现&#xff1a;ICMP权限许可和访问控制漏洞&#xff0c;编号&#xff1a;CVE-1999-0524&#xff0c;危险级别&#xff1a;低风险。利用该漏洞&#xff0c;远程主机会回复ICMP_TIMESTAMP查询并返回它们系统的当前时间&#xff0c;I…...

Java生成优惠券兑换码并确保唯一性最终添加到数据库

1.使用随机数生成器或其他生成唯一标识符的算法来生成兑换码。 2.创建一个 HashSet 或其他适合存储兑换码的数据结构来确保唯一性。每次生成一个兑换码时&#xff0c;先检查它是否已经存在于 HashSet 中&#xff0c;如果存在则重新生成直到生成一个新的唯一兑换码。 3.循环调…...

【Linux/脚本/芯片学习】Perl学习

Title&#xff1a;Perl学习 个人学习策略 主用python. 看懂perl 和 tcl 即可。 之前的存货 开始搬砖后&#xff0c;整理 ”网络发布版笔记“ 的心思寡淡了好多&#xff0c;可能就是被工作榨干的原因8… 但今天至少得赶个1024节日… (&#xffe3;▽&#xffe3;)"~ 1 介…...

嵌入式实时操作系统的设计与开发(信号量学习)

信号量 除了临界点机制、互斥量机制可实现临界资源的互斥访问外&#xff0c;信号量&#xff08;Semaphore&#xff09;是另一选择。 信号量与互斥量的区别 对于互斥量来说&#xff0c;主要应用于临界资源的互斥访问&#xff0c;并且能够有效地避免优先级反转问题。对于信号量…...

python环境安装教程

Python是一种流行的高级编程语言&#xff0c;它简单易学、功能强大&#xff0c;适用于各种应用领域&#xff0c;从Web开发到数据科学和人工智能。在本教程中&#xff0c;我将向您介绍如何安装Python并设置您的开发环境。请注意&#xff0c;以下步骤适用于Windows操作系统。 步…...

【学习笔记】CF1784F Minimums or Medians

首先让 n n n乘上 2 2 2。 考虑枚举最终被删除的位置有哪些。 a i 0 a_i0 ai​0表示这个位置被删除&#xff0c; a i 1 a_i1 ai​1表示这个位置被保留&#xff0c;设满足 a i 0 a_i0 ai​0的前缀长度为 l l l&#xff08; l l l是偶数&#xff09;&#xff0c; p r e i pre…...

如何系列 如何玩转远程调用之OpenFegin+SpringBoot(非Cloud)

文章目录 简介原生Fegin示例基础契约日志重试编码器/解码器自定义解码器 请求拦截器响应拦截器表单文件上传支持错误解码器断路器指标metrics客户端 配合SpringBoot&#xff08;阶段一&#xff09;配合SpringBoot&#xff08;阶段二&#xff09;1.EnableLakerFeignClients2.Lak…...

Python学习第2天-安装pycharm

文章目录 前言一、下载二、安装1.选择安装目录2.安装配置 总结 前言 好用的工具可以极大地提高生产力&#xff0c;开发Python推荐使用jetbrains全家桶的pycharm。 一、下载 通过官网下载安装包。 二、安装 1.选择安装目录 2.安装配置 一路Next&#xff0c;安装完成 总结 …...

等电位连接器行业应用综合方案

等电位连接器的原理 等电位连接器的原理是利用气体放电管或压敏电阻等非线性元件&#xff0c;当连接器两端的电位差大于所限峰值电压时&#xff0c;连接器导通&#xff0c;迫使连接器两端不同接地体电位基本相等&#xff0c;消除接地体间放电现象&#xff0c;从而避免了由于地…...

内裤洗衣机有用吗?最好用的四款内衣洗衣机测评

相信很多小伙伴往往会因为懒而不想洗内衣&#xff0c;又或者洗内衣时经常会洗不干净&#xff01;这时就很有必要入手一台内衣洗衣机了&#xff0c;当我们洗完澡时&#xff0c;顺手把内衣放入洗衣机内&#xff0c;一键启动即可把我们的内衣洗得干干净净&#xff01;同时还可以为…...

足底筋膜炎能自愈吗

什么是足底筋膜炎 足底筋膜炎是足底的肌腱或者筋膜发生无菌性炎症所致。最常见症状是脚跟的疼痛与不适&#xff0c;压痛点常在足底近足跟处&#xff0c;有时压痛较剧烈&#xff0c;且持续存在。晨起时疼痛感觉明显&#xff0c;行走过度时疼痛感加剧&#xff0c;严重患者甚至站…...

UE5 学习系列(二)用户操作界面及介绍

这篇博客是 UE5 学习系列博客的第二篇&#xff0c;在第一篇的基础上展开这篇内容。博客参考的 B 站视频资料和第一篇的链接如下&#xff1a; 【Note】&#xff1a;如果你已经完成安装等操作&#xff0c;可以只执行第一篇博客中 2. 新建一个空白游戏项目 章节操作&#xff0c;重…...

eNSP-Cloud(实现本地电脑与eNSP内设备之间通信)

说明&#xff1a; 想象一下&#xff0c;你正在用eNSP搭建一个虚拟的网络世界&#xff0c;里面有虚拟的路由器、交换机、电脑&#xff08;PC&#xff09;等等。这些设备都在你的电脑里面“运行”&#xff0c;它们之间可以互相通信&#xff0c;就像一个封闭的小王国。 但是&#…...

MongoDB学习和应用(高效的非关系型数据库)

一丶 MongoDB简介 对于社交类软件的功能&#xff0c;我们需要对它的功能特点进行分析&#xff1a; 数据量会随着用户数增大而增大读多写少价值较低非好友看不到其动态信息地理位置的查询… 针对以上特点进行分析各大存储工具&#xff1a; mysql&#xff1a;关系型数据库&am…...

蓝桥杯 2024 15届国赛 A组 儿童节快乐

P10576 [蓝桥杯 2024 国 A] 儿童节快乐 题目描述 五彩斑斓的气球在蓝天下悠然飘荡&#xff0c;轻快的音乐在耳边持续回荡&#xff0c;小朋友们手牵着手一同畅快欢笑。在这样一片安乐祥和的氛围下&#xff0c;六一来了。 今天是六一儿童节&#xff0c;小蓝老师为了让大家在节…...

dedecms 织梦自定义表单留言增加ajax验证码功能

增加ajax功能模块&#xff0c;用户不点击提交按钮&#xff0c;只要输入框失去焦点&#xff0c;就会提前提示验证码是否正确。 一&#xff0c;模板上增加验证码 <input name"vdcode"id"vdcode" placeholder"请输入验证码" type"text&quo…...

(转)什么是DockerCompose?它有什么作用?

一、什么是DockerCompose? DockerCompose可以基于Compose文件帮我们快速的部署分布式应用&#xff0c;而无需手动一个个创建和运行容器。 Compose文件是一个文本文件&#xff0c;通过指令定义集群中的每个容器如何运行。 DockerCompose就是把DockerFile转换成指令去运行。 …...

大数据学习(132)-HIve数据分析

​​​​&#x1f34b;&#x1f34b;大数据学习&#x1f34b;&#x1f34b; &#x1f525;系列专栏&#xff1a; &#x1f451;哲学语录: 用力所能及&#xff0c;改变世界。 &#x1f496;如果觉得博主的文章还不错的话&#xff0c;请点赞&#x1f44d;收藏⭐️留言&#x1f4…...

AspectJ 在 Android 中的完整使用指南

一、环境配置&#xff08;Gradle 7.0 适配&#xff09; 1. 项目级 build.gradle // 注意&#xff1a;沪江插件已停更&#xff0c;推荐官方兼容方案 buildscript {dependencies {classpath org.aspectj:aspectjtools:1.9.9.1 // AspectJ 工具} } 2. 模块级 build.gradle plu…...

Reasoning over Uncertain Text by Generative Large Language Models

https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...

【 java 虚拟机知识 第一篇 】

目录 1.内存模型 1.1.JVM内存模型的介绍 1.2.堆和栈的区别 1.3.栈的存储细节 1.4.堆的部分 1.5.程序计数器的作用 1.6.方法区的内容 1.7.字符串池 1.8.引用类型 1.9.内存泄漏与内存溢出 1.10.会出现内存溢出的结构 1.内存模型 1.1.JVM内存模型的介绍 内存模型主要分…...