2019年 01月 22日 - 命令终端下bc计算器

    终端下开启计算器

    $ bc
    bc 1.06
    Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
    This is free software with ABSOLUTELY NO WARRANTY.
    For details type `warranty'.
    

    设置精度

    通过scale=2可以设置为2位小数

    2019年 01月 17日 - Spring使用RedisTemplate事务的问题处理

    关闭redis开启事务支持

     <bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
        <property name="connectionFactory" ref="jedisConnectionFactory" />
        <!-- 开启事务 -->
        <property name="enableTransactionSupport" value="false"></property>
    </bean>
    

    或者

     @Bean
     public StringRedisTemplate redisTransactionTemplate() {
        StringRedisTemplate template = new StringRedisTemplate(redisConnectionFactory());
        template.setEnableTransactionSupport(true);
        return template;
      }
    

    2019年 01月 14日 - junit单元测试中多线程的问题

    当单元测试中存在线程等待情况的处理

    使用join()进行处理

    2019年 01月 14日 - InterruptedException的处理

    InterruptedException的处理

    使用Thread.currentThread().interrupt();