生而为人

程序员的自我修养

0%

建表注意:
数据大小,选择int bigint
索引:
1. mysql可以随意新增还好
2. doris需要在建表时就明确好可用的索引,并且注意索引最多36个字符,并且会被string类型截断,即最多能到第一个string类型的字段,且string类型最多截取前20字符

主题分类

  1. 商户
  2. 用户
  3. 活动
  4. 订单
  5. 营销
  6. 流量
  7. 商品

noclassdeffounderror 解决

ClassNotFoundException和NoClassDefFoundError的区别

实习杂记(27):如何解决Java.lang.NoClassDefFoundError

system.currenttimemillis() 耗时

System.currentTimeMillis的性能真有如此不堪吗?

缓慢的System.currentTimeMillis() - 疑问号

关于时间格式 2016-08-9T10:01:54.123Z 20160809100154.123Z 处理方法

编码

Base64.getMimeDecoder().decode(data)
Base64.getDecoder().decode(data);
区别

Base64 Encoding: Illegal base64 character 3c

疑问

  1. URLDecoder.decode作用
  2. 为什么不允许使用java静态构造函数

1
2
3
val array = Array("a", "b", "c")
print(array.mkString)
print(array.mkString(""))

1
2
3
import scala.jdk.CollectionConverters._

import scala.collection.JavaConverters._ //如果scala SDK version <= 2.12
1
2
import scala.collection.mutable
import scala.collection.immutable

List

底层实现是单向链表,所以慎用通过index的遍历方式,因为每次都要从头节点开始查。IndexedSeq可以使用

1
2
3
for (i until nums.lenght) {
println(nums(i))
}

如果需要遍历List,又同时需要获取到index,可以改用迭代或zipWithIndex

1
2
3
4
5
6
7
// 迭代


// zipWithIndex
for ((value, index) <- nums.zipWithIndex) {
...
}

IndexedSeq 的实现主要包括:

Array

1
2
3
import scala.collection.JavaConversions._

for()
1
2
3
4
5
6
val failingBids = ArrayBuffer[BidRecord]()
val failingBids = ArrayBuffer[BidRecord]

区别?
前者可以用
failingBids += new BidRecord(bid)

udf 的类型只能是class, 可以使object,至于为什么之前不行,还不清楚

scala使用java 的List需要添加前缀 util.List