zoukankan      html  css  js  c++  java
  • 各种方法

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

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

    2.HTML 图片自适应大小

     img{
      auto;  
      height:auto;  
      max-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);

  • 相关阅读:
    js正则 转载
    asp.net中打开新窗口的多种方法(转载)
    ajax有两种提交数据的方式,分别为get和post(转)
    DropDownList 绑定(转载)
    CentOS网络配置
    Java内存区域-- 运行时数据区域
    Spring Ioc--Bean装配
    Spring--Spring容器
    java正则表达式 --简单认识
    Leetcode 402:移除K个数字
  • 原文地址:https://www.cnblogs.com/mlocvery/p/12627568.html
Copyright © 2011-2022 走看看