Skip to content

Instantly share code, notes, and snippets.

@yongchun
yongchun / panelhtml.js
Created October 8, 2013 09:13
extjs如何操作panel中的html属性,既改变html的值
{
title : "Variable",
id : "Variable",
region : "center",
layout : "border",
bodyStyle : 'background-color:#FFFFFF',// 设置tabPanel的背景颜色
html:'',
listeners : {
activate : function(tab) {
Ext.Ajax.request({
@yongchun
yongchun / blog.txt
Created November 5, 2013 09:03
d3.js svg 多点固定
http://bl.ocks.org/mbostock/3750558
@yongchun
yongchun / topView.jsp
Created November 6, 2013 08:31
d3.js 多点固定
function dragstart(d) {
d.fixed = true;
d3.select(this).classed("fixed", true);
}
@yongchun
yongchun / d3_mouseover.js
Created November 18, 2013 09:54
d3的mouseover鼠标事件
var node = svg.selectAll(".node")
.data(graph.nodes)
.enter().append("g")
.attr("class", "node")
.on("click",function(d){Ext.Msg.alert("businessID",d.nodes[0].businessId);})
.on("mouseover", function(d) {
var g = d3.select(this); // The node
var info = g.append('text')
.classed('info', true)
.attr('x', d.x+6)
@yongchun
yongchun / LogSource.java
Created November 22, 2013 06:02
Commons-Loggin日志门面查找日志框架的过程
/*
* 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
*
@yongchun
yongchun / LoggerFactory.java
Created November 22, 2013 06:54
org.slf4j.LoggerFactory slf4j查找日志配置文件过程一
/**
* Copyright (c) 2004-2011 QOS.ch
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
@yongchun
yongchun / StaticLoggerBinder.java
Created November 22, 2013 06:57
org.slf4j.impl.StaticLoggerBinder slf4j查找日志配置文件过程二
/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2013, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
@yongchun
yongchun / ContextInitializer.java
Created November 22, 2013 06:58
ch.qos.logback.classic.util.ContextInitializer slf4j查找日志配置文件过程三
/**
* Logback: the reliable, generic, fast and flexible logging framework.
* Copyright (C) 1999-2013, QOS.ch. All rights reserved.
*
* This program and the accompanying materials are dual-licensed under
* either the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation
*
* or (per the licensee's choosing)
*
@yongchun
yongchun / IDCViewAction.java
Created November 28, 2013 08:23
JSP页面到处excel解决中文名乱码
HSSFWorkbook wb = getExcelData(ippes);
response.setContentType("application/octet-stream");
if(StringUtils.isNotEmpty(timeSession)){
startTimeStr = new Date(new Date().getTime()-24*60*60*1000);
endTimeStr = new Date();
}
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("IP端口流量-from-" + sdf.format(startTimeStr) + "-to-" + sdf.format(endTimeStr) + ".xls","UTF-8") );
wb.write(response.getOutputStream());
response.getOutputStream().flush();
response.getOutputStream().close();
@yongchun
yongchun / HttpMethodRetryHandler.java
Created November 28, 2013 09:14
HttpClient处理失败的时候重试
HttpClient client = new HttpClient();
HttpMethodRetryHandler myretryhandler = new HttpMethodRetryHandler() {
public boolean retryMethod(
final HttpMethod method,
final IOException exception,
int executionCount) {
if (executionCount >= 5) {
// Do not retry if over max retry count
return false;