:doodle{ @size: 100vm 98vmin; } position: fixed; top: @r(1%, 100%); left: @r(1%, 100%); width: 2px; height: 2px; background: #04033e; border-radius: 50%; z-index:-999; background: hsl(@r(90, 120, 3), @r(90%, 100%), @r(30%, 40%)); zoom: @rn(.1, 5, 3); transform: rotate(@r(360deg)) translate(@r(-50, 50)vmin, @r(-50, 50)vmin); animation: move @r(20, 40)s infinite @r(-10, 0)s @p(linear, ease-in, ease-in-out) alternate; box-shadow: 0 0 1px hsl(@r(90, 120, 3), @r(90%, 100%), @r(30%, 40%)), 0 0 3px hsl(@r(90, 120, 3), @r(90%, 100%), @r(30%, 40%)); @keyframes move { 0% { transform: rotate(0) translate(0, 0); } 100% { transform: rotate(720) translate(-90, -90); } } @keyframes starMove{ from { } to { } } @keyframes weiba{ 100%{ box-shadow: 0 0 100px #fff, 0 0 300px #fff; } }

各种方法

1.对数组元素进行条件判断,并获取符合条件的元素index

 itemIndex = tempArray.findIndex((value, index, arr) => {
       return value._id == 1;
    });

2.HTML 图片自适应大小

 img{
  width:auto;  
  height:auto;  
  max-width:100%;  
  max-height:100%;
 }

3.H5 使用自定义字体 / 使用下载的字体

@font-face{
    font-family:'自定义字体别名';
    src:url('自定义字体路径');
}

body{
  font-family:'自定义字体别名';
}

4.MySQL 创建存储过程


DELIMITER ;;
DROP PROCEDURE IF EXISTS schema_change;
CREATE PROCEDURE schema_change()
BEGIN

select 1;

END;
CALL schema_change();
DROP PROCEDURE IF EXISTS schema_change;
;;
DELIMITER ;

5.Java 多线程开启

        CountDownLatch latch = new CountDownLatch(10);
        ExecutorService ex = Executors.newFixedThreadPool(10);
        for (int k = 0; k < 10; k++) {
            ex.execute(() -> youmethod());
        }

        try {
            latch.await();
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            ex.shutdown();
        }

6.Java Spring项目中,获取当前Request请求

HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();

7.MySql find_in_set(columnName,valueStr)

代替where in ('xx','xx1','xx2');

select * from table where id in ('1','2','2');

select * from table where find_in_set(id,'1,2,3') ;

8.Java List 过滤

cultureList.removeIf(redisLanguagePairCulture::contains);

9.Mysql 游标

DROP PROCEDURE IF EXISTS procedureName;
   

CREATE PROCEDURE procedureName(in param1 varchar(40),in param2 varchar(100)...)
BEGIN
 
DECLARE param3 varchar(40);

-- 声明游标结束标记
DECLARE done int DEFAULT FALSE;
-- 声明游标
DECLARE testCur cursor for SELECT * FROM table1;
-- 声明当游标查不到数据时,将done更新为true;
DECLARE CONTINUE HANDLER FOR NOT found SET done = TRUE;
-- 声明事务隔离级别,避免死锁
set transaction_isolation='read-committed';




OPEN testCur;
myLoop: LOOP
   
    --  按条获取游标中的数据
    FETCH testCur INTO param3;
      
    -- 没有数据时 结束循环
    IF done THEN
        LEAVE myLoop;
    END IF;
      
		-- 这里写业务逻辑
		select * from table1 limit 10;
		-- 业务逻辑结束
	 
END LOOP myLoop;
  
   
END;
posted @ 2020-04-17 13:06  先小减个20斤  阅读(158)  评论(0编辑  收藏  举报
xxxx