Skip to content

Instantly share code, notes, and snippets.

import matplotlib.pyplot as plt
from pylab import rcParams
input = [
16.7952,16.7697,16.7076,16.7884,16.7884,16.8884,16.8811,16.6042,16.5514,16.3016,16.2257,16.2257,16.3053,16.3841,16.2822,16.2322,16.2859,16.2952,16.2952,16.1036,16.0794,16.1378,15.8408,15.8193,15.8541,15.8541,15.876,15.8632,15.9046,16.0742,15.459,15.6387,15.6387,15.2758,15.4072,15.4489,15.442,15.419,15.382,15.382,15.38,15.281,14.972,15.079,14.979,14.997,14.997,15.295,15.517,15.606,15.785,15.81,15.747,15.747,15.74,15.852,15.901,15.876,15.883,15.851,15.851,15.873,15.614,15.824,15.715,15.521,15.352,15.352,15.387,15.261,15.221,15.21,15.233,15.281,15.281,15.351,15.313,15.222,15.236,15.313,15.248,15.248,15.196,15.033,15.149,15.11,15.047,15.045,15.045,15.072,15.037,15.031,15.064,15.018,15.244,15.244,15.29,15.304,15.458,15.511,15.439,15.546,15.546,15.45,15.451,15.213,15.237,15.377,15.384,15.384,15.226,15.282,15.38,15.29,15.238,15.309,15.309,15.226,15.244,15.087,15.061,15.1,15.129,15.129,15.04,15.025,15.062,15.193,15.16,15.171,15.171,15.17,15.35,15.3
@risyomei
risyomei / karabiner.json
Created August 27, 2019 02:00
Karabiner Keyboard Setting
{
"global": {
"check_for_updates_on_startup": false,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@risyomei
risyomei / karabiner.json
Created August 27, 2019 02:00
Karabiner Keyboard Setting
{
"global": {
"check_for_updates_on_startup": false,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
FILENAME=test.txt
MSG=$((ls $FILENAME) 2>&1);
ret=$?
re="name=(.*)"
if [ $ret -ne 0 ]; then
# 文件没有找到
echo $MSG >> err.log
echo "Error message written in err.log"
else
(base) sri@MBP-15UAX-030:~/projects/hadoop-mirror(HDFS-15507○) » mvn process-sources javadoc:javadoc-no-fork -pl hadoop-hdfs-project/hadoop-hdfs-client
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.15
[INFO] os.detected.version.major: 10
(base) sri@MBP-15UAX-030:~/projects/hadoop-mirror(HDFS-15506○) » mvn process-sources javadoc:javadoc-no-fork -pl hadoop-hdfs-project/hadoop-hdfs
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.15
[INFO] os.detected.version.major: 10
let timeBox = document.getElementsByClassName('c-timestamp');
let i = 0;
while(i < timeBox.length) {
    var date = new Date( timeBox[i].getAttribute('data-ts') * 1000);
    var dateFormate = date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate();
    dateFormate = dateFormate + '-' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();   
    var currentText = timeBox[i].getElementsByClassName('c-timestamp__label')[0].innerHTML;
    if (! currentText.includes(dateFormate)){
 timeBox[i].getElementsByClassName('c-timestamp__label')[0].innerHTML = currentText + ' (' + dateFormate + ')';
@risyomei
risyomei / SparkPairedRDD.scala
Last active February 23, 2022 18:24
Dataframe Join
import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.functions._
object SparkPairedRDD {
def main(args: Array[String]) {
val spark = SparkSession
.builder()
.appName("Spark Paired")
$ export MVN_OPT="-Dmaven.javadoc.skip=true -Drat.skip=true -Dscalastyle.skip=true -Dspotless.check.skip -Dorg.slf4j.simpleLogger.defaultLogLevel=info -Pjdbc-shaded -Dmaven.plugin.download.cache.path=/tmp/engine-archives"
$ ./build/mvn clean install ${MVN_OPT} -pl kyuubi-server -Pspark-3.2 -Dsuites=org.apache.kyuubi.operation.KyuubiOperationPerUserSuite > ~/mvn.log
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< org.apache.kyuubi:kyuubi-server_2.12 >----------------
[INFO] Building Kyuubi Project Server 1.8.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) @ kyuubi-server_2.12 ---

现在想做到的事,在主线程中使用 com.xli.Target version 1.0 在子线程中使用 com.xli.Target version 1.1

已知条件:

  1. CLASSPATH 里的 com.xli.Target 是版本1.0
  2. 有一个自定义的 classloader 用于加载 com.xli.Target 版本1.1
  • 继承自URLClassloader
  • 会优先加载自己URL里的path
URL url = new URL("file:///tmp/TargetClass-1.1.jar");