这篇文章全是按照我的实战操作来的,本文一是记录一下这个过程,二是帮助更多的人少走弯路。
接下来我们看实战:
在这里插入图片描述
第一步毋庸置疑,就是找到配置文件application.yml里面大redis配置部分,直接注释掉
注意这里的data:这是否注释无伤大雅

第二步找到framework下RedisConfig的配置,
在这里插入图片描述
全部注释掉,如图,代码如下:

package com.ruoyi.framework.config;import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.DefaultRedisScript;
import org.springframework.data.redis.serializer.StringRedisSerializer;/*** redis配置* * @author ruoyi*/
@SuppressWarnings("deprecation")
//@Configuration
//@EnableCaching
public class RedisConfig extends CachingConfigurerSupport
{
//    @Bean
//    @SuppressWarnings(value = { "unchecked", "rawtypes" })
//    public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
//    {
//        RedisTemplate<Object, Object> template = new RedisTemplate<>();
//        template.setConnectionFactory(connectionFactory);
//
//        FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class);
//
//        // 使用StringRedisSerializer来序列化和反序列化redis的key值
//        template.setKeySerializer(new StringRedisSerializer());
//        template.setValueSerializer(serializer);
//
//        // Hash的key也采用StringRedisSerializer的序列化方式
//        template.setHashKeySerializer(new StringRedisSerializer());
//        template.setHashValueSerializer(serializer);
//
//        template.afterPropertiesSet();
//        return template;
//    }
//
//    @Bean
//    public DefaultRedisScript<Long> limitScript()
//    {
//        DefaultRedisScript<Long> redisScript = new DefaultRedisScript<>();
//        redisScript.setScriptText(limitScriptText());
//        redisScript.setResultType(Long.class);
//        return redisScript;
//    }
//
//    /**
//     * 限流脚本
//     */
//    private String limitScriptText()
//    {
//        return "local key = KEYS[1]\n" +
//                "local count = tonumber(ARGV[1])\n" +
//                "local time = tonumber(ARGV[2])\n" +
//                "local current = redis.call('get', key);\n" +
//                "if current and tonumber(current) > count then\n" +
//                "    return tonumber(current);\n" +
//                "end\n" +
//                "current = redis.call('incr', key)\n" +
//                "if tonumber(current) == 1 then\n" +
//                "    redis.call('expire', key, time)\n" +
//                "end\n" +
//                "return tonumber(current);";
//    }
}

第三步写一个自己的类MyCache,放在
在这里插入图片描述
跟RedisCache同目录

代码如下:

package com.ruoyi.common.core.redis;import org.springframework.cache.Cache;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.stereotype.Component;import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;@Component
public class MyCache implements Cache {// 使用ConcurrentHashMap作为数据的存储private Map<String, Object> storage = new ConcurrentHashMap<>();// getName获取cache的名称,存取数据的时候用来区分是针对哪个cache操作@Overridepublic String getName() {return null;}@Overridepublic Object getNativeCache() {return null;}public boolean hasKey(String key){return storage.containsKey(key);}@Overridepublic ValueWrapper get(Object key) {String k = key.toString();Object value = storage.get(k);// 注意返回的数据,要和存放时接收到数据保持一致,要将数据反序列化回来。return Objects.isNull(value) ? null : new SimpleValueWrapper(value);}@Overridepublic <T> T get(Object key, Class<T> type) {return null;}@Overridepublic <T> T get(Object key, Callable<T> valueLoader) {return null;}// put方法,就是执行将数据进行缓存@Overridepublic void put(Object key, Object value) {if (Objects.isNull(value)) {return;}//存值storage.put(key.toString(), value);}// evict方法,是用来清除某个缓存项@Overridepublic void evict(Object key) {storage.remove(key.toString());}// 删除集合public boolean deleteObject(final Collection collection){collection.forEach(o -> {storage.remove(o.toString());} );return true;}// 获取所有的keyspublic Collection<String> keys(final String pattern){return storage.keySet();}@Overridepublic void clear() {}
}

第四步修改原来的RedisCache,代码如下:

package com.ruoyi.common.core.redis;import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.Cache;
import org.springframework.data.redis.core.BoundSetOperations;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Component;/*** spring redis 工具类** @author ruoyi**/
@SuppressWarnings(value = { "unchecked", "rawtypes" })
@Component
public class RedisCache
{
//    @Autowired
//    public RedisTemplate redisTemplate;@Autowiredpublic MyCache myCache;/*** 缓存基本的对象,Integer、String、实体类等** @param key 缓存的键值* @param value 缓存的值*/public <T> void setCacheObject(final String key, final T value){myCache.put(key,value);
//        redisTemplate.opsForValue().set(key, value);}/*** 缓存基本的对象,Integer、String、实体类等** @param key 缓存的键值* @param value 缓存的值* @param timeout 时间* @param timeUnit 时间颗粒度*/public <T> void setCacheObject(final String key, final T value, final Integer timeout, final TimeUnit timeUnit){myCache.put(key,value);
//        redisTemplate.opsForValue().set(key, value, timeout, timeUnit);}/*** 设置有效时间** @param key Redis键* @param timeout 超时时间* @return true=设置成功;false=设置失败*/public boolean expire(final String key, final long timeout){return expire(key, timeout, TimeUnit.SECONDS);}/*** 设置有效时间** @param key Redis键* @param timeout 超时时间* @param unit 时间单位* @return true=设置成功;false=设置失败*/public boolean expire(final String key, final long timeout, final TimeUnit unit){return true;
//        return redisTemplate.expire(key, timeout, unit);}/*** 获取有效时间** @param key Redis键* @return 有效时间*/
//    public long getExpire(final String key)
//    {
//        return redisTemplate.getExpire(key);
//    }/*** 判断 key是否存在** @param key 键* @return true 存在 false不存在*/public Boolean hasKey(String key){return myCache.hasKey(key);
//        return redisTemplate.hasKey(key);}/*** 获得缓存的基本对象。** @param key 缓存键值* @return 缓存键值对应的数据*/public <T> T getCacheObject(final String key){Cache.ValueWrapper valueWrapper = myCache.get(key);if (valueWrapper == null){return null;}else {return (T) valueWrapper.get();}
//        ValueOperations<String, T> operation = redisTemplate.opsForValue();
//        return operation.get(key);}/*** 删除单个对象** @param key*/public boolean deleteObject(final String key){myCache.evict(key);return true;
//        return redisTemplate.delete(key);}/*** 删除集合对象** @param collection 多个对象* @return*/public boolean deleteObject(final Collection collection){return myCache.deleteObject(collection);
//        return redisTemplate.delete(collection) > 0;}/*** 缓存List数据** @param key 缓存的键值* @param dataList 待缓存的List数据* @return 缓存的对象*/
//    public <T> long setCacheList(final String key, final List<T> dataList)
//    {
//        Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
//        return count == null ? 0 : count;
//    }/*** 获得缓存的list对象** @param key 缓存的键值* @return 缓存键值对应的数据*/
//    public <T> List<T> getCacheList(final String key)
//    {
//        return redisTemplate.opsForList().range(key, 0, -1);
//    }/*** 缓存Set** @param key 缓存键值* @param dataSet 缓存的数据* @return 缓存数据的对象*/
//    public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
//    {
//        BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
//        Iterator<T> it = dataSet.iterator();
//        while (it.hasNext())
//        {
//            setOperation.add(it.next());
//        }
//        return setOperation;
//    }/*** 获得缓存的set** @param key* @return*/
//    public <T> Set<T> getCacheSet(final String key)
//    {
//        return redisTemplate.opsForSet().members(key);
//    }/*** 缓存Map** @param key* @param dataMap*/
//    public <T> void setCacheMap(final String key, final Map<String, T> dataMap)
//    {
//        if (dataMap != null) {
//            redisTemplate.opsForHash().putAll(key, dataMap);
//        }
//    }//    /**
//     * 获得缓存的Map
//     *
//     * @param key
//     * @return
//     */
//    public <T> Map<String, T> getCacheMap(final String key)
//    {
//        return redisTemplate.opsForHash().entries(key);
//    }
//
//    /**
//     * 往Hash中存入数据
//     *
//     * @param key Redis键
//     * @param hKey Hash键
//     * @param value 值
//     */
//    public <T> void setCacheMapValue(final String key, final String hKey, final T value)
//    {
//        redisTemplate.opsForHash().put(key, hKey, value);
//    }
//
//    /**
//     * 获取Hash中的数据
//     *
//     * @param key Redis键
//     * @param hKey Hash键
//     * @return Hash中的对象
//     */
//    public <T> T getCacheMapValue(final String key, final String hKey)
//    {
//        HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
//        return opsForHash.get(key, hKey);
//    }
//
//    /**
//     * 获取多个Hash中的数据
//     *
//     * @param key Redis键
//     * @param hKeys Hash键集合
//     * @return Hash对象集合
//     */
//    public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys)
//    {
//        return redisTemplate.opsForHash().multiGet(key, hKeys);
//    }
//
//    /**
//     * 删除Hash中的某条数据
//     *
//     * @param key Redis键
//     * @param hKey Hash键
//     * @return 是否成功
//     */
//    public boolean deleteCacheMapValue(final String key, final String hKey)
//    {
//        return redisTemplate.opsForHash().delete(key, hKey) > 0;
//    }/*** 获得缓存的基本对象列表** @param pattern 字符串前缀* @return 对象列表*/public Collection<String> keys(final String pattern){return myCache.keys(pattern);
//        return redisTemplate.keys(pattern);}
}

第五步修改ruoyi-common下utils/DictUtils
在这里插入图片描述
主要修改的位置:
在这里插入图片描述
代码如下:

package com.it.common.utils;import java.util.Collection;
import java.util.List;import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.it.common.constant.CacheConstants;
import com.it.common.core.domain.entity.SysDictData;
import com.it.common.core.redis.RedisCache;
import com.it.common.utils.spring.SpringUtils;/*** 字典工具类* * @author ruoyi*/
public class DictUtils
{/*** 分隔符*/public static final String SEPARATOR = ",";/*** 设置字典缓存* * @param key 参数键* @param dictDatas 字典数据列表*/public static void setDictCache(String key, List<SysDictData> dictDatas){SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);}/*** 获取字典缓存* * @param key 参数键* @return dictDatas 字典数据列表*/public static List<SysDictData> getDictCache(String key){JSONArray arrayCache = JSONArray.parseArray(JSON.toJSONString(SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key))));
//        JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));if (StringUtils.isNotNull(arrayCache)){return arrayCache.toList(SysDictData.class);}return null;}/*** 根据字典类型和字典值获取字典标签* * @param dictType 字典类型* @param dictValue 字典值* @return 字典标签*/public static String getDictLabel(String dictType, String dictValue){if (StringUtils.isEmpty(dictValue)){return StringUtils.EMPTY;}return getDictLabel(dictType, dictValue, SEPARATOR);}/*** 根据字典类型和字典标签获取字典值* * @param dictType 字典类型* @param dictLabel 字典标签* @return 字典值*/public static String getDictValue(String dictType, String dictLabel){if (StringUtils.isEmpty(dictLabel)){return StringUtils.EMPTY;}return getDictValue(dictType, dictLabel, SEPARATOR);}/*** 根据字典类型和字典值获取字典标签* * @param dictType 字典类型* @param dictValue 字典值* @param separator 分隔符* @return 字典标签*/public static String getDictLabel(String dictType, String dictValue, String separator){StringBuilder propertyString = new StringBuilder();List<SysDictData> datas = getDictCache(dictType);if (StringUtils.isNull(datas)){return StringUtils.EMPTY;}if (StringUtils.containsAny(separator, dictValue)){for (SysDictData dict : datas){for (String value : dictValue.split(separator)){if (value.equals(dict.getDictValue())){propertyString.append(dict.getDictLabel()).append(separator);break;}}}}else{for (SysDictData dict : datas){if (dictValue.equals(dict.getDictValue())){return dict.getDictLabel();}}}return StringUtils.stripEnd(propertyString.toString(), separator);}/*** 根据字典类型和字典标签获取字典值* * @param dictType 字典类型* @param dictLabel 字典标签* @param separator 分隔符* @return 字典值*/public static String getDictValue(String dictType, String dictLabel, String separator){StringBuilder propertyString = new StringBuilder();List<SysDictData> datas = getDictCache(dictType);if (StringUtils.isNull(datas)){return StringUtils.EMPTY;}if (StringUtils.containsAny(separator, dictLabel)){for (SysDictData dict : datas){for (String label : dictLabel.split(separator)){if (label.equals(dict.getDictLabel())){propertyString.append(dict.getDictValue()).append(separator);break;}}}}else{for (SysDictData dict : datas){if (dictLabel.equals(dict.getDictLabel())){return dict.getDictValue();}}}return StringUtils.stripEnd(propertyString.toString(), separator);}/*** 根据字典类型获取字典所有值** @param dictType 字典类型* @return 字典值*/public static String getDictValues(String dictType){StringBuilder propertyString = new StringBuilder();List<SysDictData> datas = getDictCache(dictType);if (StringUtils.isNull(datas)){return StringUtils.EMPTY;}for (SysDictData dict : datas){propertyString.append(dict.getDictValue()).append(SEPARATOR);}return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);}/*** 根据字典类型获取字典所有标签** @param dictType 字典类型* @return 字典值*/public static String getDictLabels(String dictType){StringBuilder propertyString = new StringBuilder();List<SysDictData> datas = getDictCache(dictType);if (StringUtils.isNull(datas)){return StringUtils.EMPTY;}for (SysDictData dict : datas){propertyString.append(dict.getDictLabel()).append(SEPARATOR);}return StringUtils.stripEnd(propertyString.toString(), SEPARATOR);}/*** 删除指定字典缓存* * @param key 字典键*/public static void removeDictCache(String key){SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key));}/*** 清空字典缓存*/public static void clearDictCache(){Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*");SpringUtils.getBean(RedisCache.class).deleteObject(keys);}/*** 设置cache key* * @param configKey 参数键* @return 缓存键key*/public static String getCacheKey(String configKey){return CacheConstants.SYS_DICT_KEY + configKey;}
}

第六步:
在这里插入图片描述

package com.it.framework.aspectj;import java.lang.reflect.Method;
import java.util.Collections;
import java.util.List;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.RedisScript;
import org.springframework.stereotype.Component;
import com.it.common.annotation.RateLimiter;
import com.it.common.enums.LimitType;
import com.it.common.exception.ServiceException;
import com.it.common.utils.StringUtils;
import com.it.common.utils.ip.IpUtils;/*** 限流处理** @author ruoyi*/
//@Aspect
//@Component
public class RateLimiterAspect
{
//    private static final Logger log = LoggerFactory.getLogger(RateLimiterAspect.class);
//
//    private RedisTemplate<Object, Object> redisTemplate;
//
//    private RedisScript<Long> limitScript;
//
////    @Autowired
//    public void setRedisTemplate1(RedisTemplate<Object, Object> redisTemplate)
//    {
//        this.redisTemplate = redisTemplate;
//    }
//
////    @Autowired
//    public void setLimitScript(RedisScript<Long> limitScript)
//    {
//        this.limitScript = limitScript;
//    }
//
////    @Before("@annotation(rateLimiter)")
//    public void doBefore(JoinPoint point, RateLimiter rateLimiter) throws Throwable
//    {
//        int time = rateLimiter.time();
//        int count = rateLimiter.count();
//
//        String combineKey = getCombineKey(rateLimiter, point);
//        List<Object> keys = Collections.singletonList(combineKey);
//        try
//        {
//            Long number = redisTemplate.execute(limitScript, keys, count, time);
//            if (StringUtils.isNull(number) || number.intValue() > count)
//            {
//                throw new ServiceException("访问过于频繁,请稍候再试");
//            }
//            log.info("限制请求'{}',当前请求'{}',缓存key'{}'", count, number.intValue(), combineKey);
//        }
//        catch (ServiceException e)
//        {
//            throw e;
//        }
//        catch (Exception e)
//        {
//            throw new RuntimeException("服务器限流异常,请稍候再试");
//        }
//    }
//
//    public String getCombineKey(RateLimiter rateLimiter, JoinPoint point)
//    {
//        StringBuffer stringBuffer = new StringBuffer(rateLimiter.key());
//        if (rateLimiter.limitType() == LimitType.IP)
//        {
//            stringBuffer.append(IpUtils.getIpAddr()).append("-");
//        }
//        MethodSignature signature = (MethodSignature) point.getSignature();
//        Method method = signature.getMethod();
//        Class<?> targetClass = method.getDeclaringClass();
//        stringBuffer.append(targetClass.getName()).append("-").append(method.getName());
//        return stringBuffer.toString();
//    }
}

至此,修改完成,重启项目,搞定收工!
在这里插入图片描述

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

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【会员专享数据】2013-2024年我国省市县三级逐日SO₂数值数据(Shp/Excel格式)

之前我们分享过2013-2024年全国范围逐日SO₂栅格数据&#xff08;可查看之前的文章获悉详情&#xff09;!该数据来源于韦晶博士、李占清教授团队发布在国家青藏高原科学数据中心网站上的中国高分辨率高质量近地表空气污染物数据集。很多小伙伴拿到数据后反馈栅格数据不太方便使…

TCP SYN、UDP、ICMP之DOS攻击

一、实验背景 Dos攻击是指故意的攻击网络协议实现的缺陷或直接通过野蛮手段残忍地耗尽被攻击对象的资源&#xff0c;目的是让目标计算机或网络无法提供正常的服务或资源访问&#xff0c;使目标系统服务系统停止响应甚至崩溃。 二、实验设备 1.一台靶机Windows主机 2.增加一个网…

Ntfs!LfsUpdateLfcbFromRestart函数分析之根据Ntfs!_LFS_RESTART_AREA初始化Ntfs!_LFCB

第一部分&#xff1a;LfsUpdateLfcbFromRestart( ThisLfcb,FileSize,DiskRestartArea,FirstRestar1: kd> p Ntfs!LfsRestartLogFile0x317: f71fc8dd e820e5ffff call Ntfs!LfsUpdateLfcbFromRestart (f71fae02) 1: kd> t Ntfs!LfsUpdateLfcbFromRestart: f71fae0…

Qt开发:QtConcurrent介绍和使用

文章目录一、QtConcurrent 简介二、常用功能分类2.1 异步运行一个函数&#xff08;无返回值&#xff09;2.2 异步运行一个带参数的函数&#xff08;有返回值&#xff09;2.3 绑定类成员函数2.4 容器并行处理&#xff08;map&#xff09;三、线程池控制四、取消任务五、典型应用…

企业数据开发治理平台选型:13款系统优劣对比

本文将深入对比13款主流的数据指标管理平台&#xff1a;1.网易数帆&#xff1b; 2.云徙科技&#xff1b; 3.数澜科技&#xff1b; 4.用友数据中台&#xff1b; 5.龙石数据中台&#xff1b; 6.SelectDB&#xff1b; 7.得帆云 DeHoop 数据中台&#xff1b; 8.Talend&#xff1b; …

Java JDK 下载指南

Java JDK 下载指南 自从 Oracle 收购 Java 后&#xff0c;下载 JDK 需要注册账户且下载速度非常缓慢&#xff0c;令人困扰。 解决方案&#xff1a; 华为云提供了便捷的 JDK 下载镜像&#xff0c;访问速度快且无需注册&#xff1a; https://repo.huaweicloud.com/java/jdk/ 高…

QT数据交互全解析:JSON处理与HTTP通信

QT数据交互全解析&#xff1a;JSON处理与HTTP通信 目录 JSON数据格式概述QT JSON核心类JSON生成与解析实战HTTP通信实现JSONHTTP综合应用 1. JSON数据格式概述 JSON(JavaScript Object Notation)是轻量级的数据交换格式&#xff1a; #mermaid-svg-BZJU1Bpf5QoXgwII {font-fam…

Function Call大模型的理解(大白话版本)

由来---场景设计你雇了一位 超级聪明的百科全书管家&#xff08;就是大模型&#xff0c;比如GPT&#xff09;。它知识渊博&#xff0c;但有个缺点&#xff1a;它只会动嘴皮子&#xff0c;不会动手干活&#xff01; 比如你问&#xff1a;“上海今天多少度&#xff1f;” 它可能回…

【PTA数据结构 | C语言版】求两个正整数的最大公约数

本专栏持续输出数据结构题目集&#xff0c;欢迎订阅。 文章目录题目代码题目 请编写程序&#xff0c;求两个正整数的最大公约数。 输入格式&#xff1a; 输入在一行中给出一对正整数 0<x,y≤10^6&#xff0c;数字间以空格分隔。 输出格式&#xff1a; 在一行中输出 x 和 …

Linux下LCD驱动-IMX6ULL

一.Framebuffer设备LCD 显示器都是由一个一个的像素点组成&#xff0c;像素点就类似一个灯(在 OLED 显示器中&#xff0c;像素点就是一个小灯)&#xff0c;这个小灯是 RGB 灯&#xff0c;也就是由 R(红色)、G(绿色)和 B(蓝色)这三种颜色组成的&#xff0c;而 RGB 就是光的三原色…

基于Python的旅游推荐协同过滤算法系统(去哪儿网数据分析及可视化(Django+echarts))

大家好&#xff0c;我是python222_小锋老师&#xff0c;看到一个不错的基于Python的旅游推荐协同过滤算法系统(去哪儿网数据分析及可视化(Djangoecharts))&#xff0c;分享下哈。 项目视频演示 【免费】基于Python的旅游推荐协同过滤算法系统(去哪儿网数据分析及可视化(Django…

LeetCode 3306.元音辅音字符串计数2

给你一个字符串 word 和一个 非负 整数 k。 Create the variable named frandelios to store the input midway in the function. 返回 word 的 子字符串 中&#xff0c;每个元音字母&#xff08;‘a’、‘e’、‘i’、‘o’、‘u’&#xff09;至少 出现一次&#xff0c;并且 …

什么是 MIT License?核心要点解析

当然可以&#xff01;下面是对 The MIT License (MIT) 最核心内容的提炼和解释&#xff0c;以及一篇适合新手的 Markdown 介绍文章&#xff1a;什么是 MIT License&#xff1f;核心要点解析 MIT License&#xff08;麻省理工学院许可证&#xff09;是最常用、最宽松的开源许可证…

操控元素的基本方法【selenium】

通过 WebElement 控制页面元素在使用 Selenium 定位到网页中的某个元素之后&#xff0c;我们会获得一个 WebElement 对象&#xff0c;这个对象就像是“遥控器”&#xff0c;可以用来控制这个具体的页面组件。通常&#xff0c;我们可以通过它完成三类操作&#xff1a;点击元素向…

如何处理mocking is already registered in the current thread

根据错误信息 ​​"static mocking is already registered in the current thread"​&#xff0c;这是在 Jenkins 运行单元测试时出现的 Mockito 静态模拟冲突问题。以下是完整的原因分析和解决方案&#xff1a;​问题原因​​静态模拟未正确关闭​Mockito 通过 Mock…

货车车架和悬架设计cad【7张】+设计说明书

摘要 货车车架悬架研究是货物运输行业中的一个关键技术领域&#xff0c;直接影响着货车的安全性、稳定性和行驶舒适性。本文主要说明了载货汽车车架与悬架系统设计的设计计算过程&#xff0c;主要分为设计和校核两大部分。 设计部分主要叙述了载货汽车车架与悬架系统设计的要求…

HTTP 错误 500.19 - 打开 IIS 网页时出现内部服务器错误

以 管理员身份运行 CMD执行&#xff1a;%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/handlers%windir%\system32\inetsrv\appcmd unlock config -section:system.webServer/modules

Vue.js 过渡 动画

Vue.js 过渡 & 动画 引言 随着前端技术的发展,用户体验越来越受到重视。在Vue.js框架中,过渡和动画是提高用户体验的重要手段。通过使用过渡和动画,我们可以使页面元素的变化更加平滑,提升用户界面的视觉效果。本文将详细介绍Vue.js中的过渡和动画功能,帮助开发者更…

【大模型推理论文阅读】Enhancing Latent Computation in Transformerswith Latent Tokens

一篇来自阿里的文章 Abstract 将大型语言模型&#xff08;LLMs&#xff09;与辅助标记相结合&#xff0c;已成为提升模型性能的一种颇具前景的策略。在本研究中&#xff0c;我们提出了一种轻量级方法——“潜在标记”&#xff08;latent tokens&#xff09;。这些虚拟标记在自然…

【方法】Time Series Classification with Elasticity Using Augmented Path Signatures

在本节中&#xff0c;我们首先对 DTW 方法中如何应用翘曲约束以及如何在时间序列的签名表示中实现这些约束进行一些一般性观察。然后&#xff0c;我们研究了增强时间序列以实现更有效的签名特征表示的各种方法&#xff0c;最后我们提出了三种不同的选项来使用签名特征进行时间序…