This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.campusapp.community.controller.interceptor; | |
import com.alibaba.druid.util.StringUtils; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.context.annotation.Lazy; | |
import org.springframework.core.MethodParameter; | |
import org.springframework.stereotype.Component; | |
import org.springframework.web.bind.support.WebDataBinderFactory; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test{ | |
public boolean handleMessage(Message msg) { | |
StatService.onEvent(MainActivity.this.getApplicationContext(), | |
"handleMessage", "msg.what", msg.what); | |
// 根据发送过来的结果进行不同的处理 | |
Log.d(TAG, "Message.what:" + msg.what); | |
String message = Constant.UNKNOWN_STATUS_TEXT; | |
oper = Constant.Operation.ING; | |
switch (msg.what) { | |
case Constant.INIT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in html | |
//============================ | |
seajs.config({ | |
alias:{ | |
'jquery': 'gallery/jquery/1.8.2/jquery', | |
'base': './assets/base/src/base', | |
'dust': './assets/dust/src/dust.js' | |
}, | |
preload:['seajs/plugin-less', 'seajs/plugin-text', 'seajs/plugin-coffee',] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;this.seajs={_seajs:this.seajs};seajs.version="1.2.0-dev";seajs._data={config:{debug:"",preload:[]},memoizedMods:{},packageMods:[]};seajs._util={};seajs._fn={}; | |
(function(a){var c=Object.prototype.toString,b=Array.prototype;a.isString=function(a){return"[object String]"===c.call(a)};a.isObject=function(a){return a===Object(a)};a.isFunction=function(a){return"[object Function]"===c.call(a)};a.isArray=Array.isArray||function(a){return"[object Array]"===c.call(a)};a.indexOf=b.indexOf?function(a,d){return a.indexOf(d)}:function(a,d){for(var h=0,c=a.length;h<c;h++)if(a[h]===d)return h;return-1};var e=a.forEach=b.forEach?function(a,d){a.forEach(d)}:function(a, | |
d){for(var c=0,b=a.length;c<b;c++)d(a[c],c,a)};a.map=b.map?function(a,d){return a.map(d)}:function(a,d){var c=[];e(a,function(a,b,f){c.push(d(a,b,f))});return c};a.filter=b.filter?function(a,c){return a.filter(c)}:function(a,c){var b=[];e(a,function(a,j,f){c(a,j,f)&&b.push(a)});return b};a.unique=function(a){var c=[],b={};e(a,function(a){b[a]=1});if(Object.ke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedInputStream; | |
import java.io.InputStream; | |
public class CharsetUtil { | |
public static String charset(InputStream inputStream) { | |
String charset = "GBK"; | |
byte[] first3Bytes = new byte[3]; | |
try { | |
boolean checked = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Tester("BufferedReader count lines") { | |
@Override | |
public void test() throws IOException { | |
BufferedReader br = new BufferedReader( | |
new InputStreamReader(new FileInputStream(path))); | |
int count = 0; | |
while (br.ready()) { | |
String l = br.readLine(); | |
count += countLine(l); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: io/UsingBuffers.java | |
import java.nio.*; | |
import static net.mindview.util.Print.*; | |
public class UsingBuffers { | |
private static void symmetricScramble(CharBuffer buffer){ | |
while(buffer.hasRemaining()) { | |
buffer.mark(); | |
char c1 = buffer.get(); | |
char c2 = buffer.get(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: io/BufferToText.java | |
// Converting text to and from ByteBuffers | |
import java.nio.*; | |
import java.nio.channels.*; | |
import java.nio.charset.*; | |
import java.io.*; | |
public class BufferToText { | |
private static final int BSIZE = 1024; | |
public static void main(String[] args) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: io/GetChannel.java | |
// Getting channels from streams | |
import java.nio.*; | |
import java.nio.channels.*; | |
import java.io.*; | |
public class GetChannel { | |
private static final int BSIZE = 1024; | |
public static void main(String[] args) throws Exception { | |
// Write a file: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: net/mindview/util/Directory.java | |
// Produce a sequence of File objects that match a | |
// regular expression in either a local directory, | |
// or by walking a directory tree. | |
package net.mindview.util; | |
import java.util.regex.*; | |
import java.io.*; | |
import java.util.*; |
NewerOlder