Skip to content

Instantly share code, notes, and snippets.

@jecyhw
jecyhw / JFreeChartExample.java
Last active May 13, 2017 07:07
JFreeChart时间序列图绘制
//关于乱码解决,将相应的字体文件拷贝到$JAVA_HOME/jre/lib/fonts/fallback文件夹下即可
static private Font font = new Font("宋体", Font.PLAIN, 12);
public byte[] jFreeChartExample(String day) {
try {
Date end = DateUtils.parseDate(day, TableHelper.YYYY_MM_DD);
Date start = DateUtils.addDays(end, -29);
TimeSeriesCollection collTransfer = new TimeSeriesCollection();
TimeSeriesCollection collWaitTime = new TimeSeriesCollection();
TimeSeries seriesTransfer = new TimeSeries("平均转接次数");
@jecyhw
jecyhw / PoiExcelExample.java
Last active May 16, 2017 07:24
poi创建excel示例
public void exportProj(HttpServletResponse response) {
HSSFWorkbook workbook = new HSSFWorkbook();
final List<String> headers = new ArrayList<>();
headers.add("列1");
headers.add("列2");
headers.add("列3");
headers.add("列4");
Map<Integer, JSONArray> map;
for (Integer cityId : map.keySet()) {
@jecyhw
jecyhw / stop-hadoop-all.sh
Last active November 27, 2017 01:45
stop-dfs.shstop-yarn.shmr-jobhistory-daemon.sh stop historyserver
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@jecyhw
jecyhw / start-hadoop-all.sh
Created November 27, 2017 01:44
start-dfs.sh start-yarn.sh mr-jobhistory-daemon.sh start historyserver
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@jecyhw
jecyhw / TracingScript.java
Last active March 3, 2019 09:52
btrace示例
import com.sun.btrace.annotations.*;
import static com.sun.btrace.BTraceUtils.*;
@BTrace
public class TracingScript {
@OnMethod(
clazz="java.net.Socket",
method="setImpl",
location=@Location(Kind.RETURN)