`
kanpiaoxue
  • 浏览: 1745911 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论
文章列表
  参考资料:https://stackoverflow.com/questions/29910217/homebrew-installation-on-mac-os-x-failed-to-connect-to-raw-githubusercontent-com   The accepted Answer is outdated now. But based on the answer I solved the problem by: open the home page of brew https://brew.sh/ copy the URL from the instal ...
  使用wget下载文件夹的功能和python快速启动HTTP服务器的功能配合,可以方便高效的从一台服务器传输数据到另一台服务器。   python启动httpserver的命令行: #python2.x python -m SimpleHTTPServer 8000 #python3.x python3 -m http.server 8000     使用wget下载指定的文件夹 # 各个参数的含义: # -r : 遍历所有子目录 # -np : 不到上一层子目录去 # -nH : 不要将文件保存到主机名文件夹 # -R "index.html*& ...

单例模式

  参考资料: https://dzone.com/articles/singleton-design-pattern-1?edition=647305&utm_medium=email&utm_source=dzone&utm_content=2021%20Trends%20and%20Predictions&utm_campaign=       The Singleton Pattern The singleton pattern is one of the simplest design patterns in Java. This desi ...
    from datetime import datetime from datetime import timedelta # strptime: 将字符串解析为事件对象。 和 strftime 互为逆操作。 to parse a string to datetime and time objects respectively # strftime: 将时间格式化为字符串。 和 strptime 互为逆操作。 # timedelta:用于计算时间差。 object represents a duration, the difference between two da ...
    import org.apache.commons.collections.CollectionUtils; import org.joda.time.DateTime; import org.joda.time.DateTimeConstants; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com. ...
  参考文章: https://www.cnblogs.com/chenssy/p/3366632.html   public static void main(String[] args) { BigDecimal d = new BigDecimal(100000); //存款 BigDecimal r = new BigDecimal(0.001875*3); //利息 BigDecimal i = d.multiply(r).setScale(2,RoundingMode.HALF_EVEN); //使用 ...
  /** * 存储单位工具类 * @ClassName: StorageUnit * @author kanpiaoxue * @version 1.0 * @CreateTime: 2020/12/25 17:25:12 * @Description: * 来自于:https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/StorageUnit.java */ import ja ...
    // 计算字符串MD5 String stringMD5 = Hashing.md5().hashString("helloWorld").toString(); // 计算文件MD5 File file = new File("hello.txt"); String fileMD5 = Files.asByteSource(file).hash(Hashing.md5()).toString();   参考guava的hash public class HashTest { private static final ...
    点击 Preferences –> Install/Update –> Available Software Sites  在这个界面,将默认网站修改为国内镜像站:即把所有的http://download.eclipse.org 改为 http://mirrors.ustc.edu.cn/eclipse  
  Mapped Diagnostic Context (MDC) 针对 MDC功能,目前只有logback 以及 log4j 支持。 相关文章: https://www.baeldung.com/mdc-in-log4j-2-logback http://logback.qos.ch/manual/mdc.html https://www.jianshu.com/p/3fa7e7726fbb https://ketao1989.github.io/2015/04/29/LogBack-Implemention-And-Slf4j-Mdc/     Let's now ...
      import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.Result; import org.slf4j.Logger; import org.slf4j.LoggerFacto ...
  两篇不错的文章: http://hbasefly.com/2016/06/11/hbase-client-2 https://www.sohu.com/a/331844681_315839    
  从JDK8开始,PermSize的配置被废弃,改为Metaspace,如下:   -XX:MetaspaceSize=200m -XX:MaxMetaspaceSize=200m  
1、查找被占用的端口: netstat -tln |grep port 2、查看端口被哪个进程占用 lsof -i :port 3、通过PID查找被占用的java进程 jps -lv|grep PID  4、如果是非java进程占用,可用查找进程 ps -ef|grep PID
  得到list指定元素前面一个位置的元素 public static <T> Optional<T> findPrevious(List<T> list, T e) { Preconditions.checkNotNull(list, "list is null"); Preconditions.checkNotNull(e, "element is null"); if (CollectionUtils.isEmpty(list)) { ...
Global site tag (gtag.js) - Google Analytics