This file contains hidden or 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
/** | |
* Created by searover on 3/29/15. | |
*/ | |
public class CustomTitleView extends View { | |
/** | |
* 文本 | |
*/ | |
private String mTitleText; |
This file contains hidden or 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
public boolean isOnline() { | |
ConnectivityManager connMgr = (ConnectivityManager) | |
getSystemService(Context.CONNECTIVITY_SERVICE); | |
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); | |
return (networkInfo != null && networkInfo.isConnected()); | |
} |
This file contains hidden or 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
TypedArray array = context.getTheme().obtainStyledAttributes(attrs, | |
R.styleable.PieChart,0,0); | |
try { | |
mShowText = array.getBoolean(R.styleable.PieChart_showText,false); | |
mTextPos = array.getInteger(R.styleable.PieChart_labelPosition,0); | |
}finally { | |
array.recycle(); | |
} |
This file contains hidden or 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
public TypedArray obtainStyledAttributes(AttributeSet set, | |
int[] attrs, int defStyleAttr, int defStyleRes) { | |
final int len = attrs.length; | |
final TypedArray array = TypedArray.obtain(Resources.this, len); | |
// other code ..... | |
return array; | |
} |
This file contains hidden or 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
/** | |
* Container for an array of values that were retrieved with | |
* {@link Resources.Theme#obtainStyledAttributes(AttributeSet, int[], int, int)} | |
* or {@link Resources#obtainAttributes}. Be | |
* sure to call {@link #recycle} when done with them. | |
* | |
* The indices used to retrieve values from this structure correspond to | |
* the positions of the attributes given to obtainStyledAttributes. | |
*/ | |
public class TypedArray { |
This file contains hidden or 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.anchnet.ddos.report.utils; | |
import com.anchnet.ddos.report.beans.MessagePack; | |
import org.apache.commons.httpclient.HttpClient; | |
import org.apache.commons.httpclient.HttpMethod; | |
import org.apache.commons.httpclient.NameValuePair; | |
import org.apache.commons.httpclient.methods.GetMethod; | |
import org.apache.commons.httpclient.methods.PostMethod; | |
import java.io.IOException; |
This file contains hidden or 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.searover.hctest; | |
import org.apache.commons.lang.time.StopWatch; | |
import org.apache.http.HttpEntity; | |
import org.apache.http.client.ClientProtocolException; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.methods.CloseableHttpResponse; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.impl.client.CloseableHttpClient; | |
import org.apache.http.impl.client.DefaultHttpClient; |
This file contains hidden or 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 soundsystem; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.aspectj.lang.annotation.Aspect; | |
import org.aspectj.lang.annotation.Before; | |
import org.aspectj.lang.annotation.Pointcut; | |
@Aspect | |
public class TrackCounter{ |
This file contains hidden or 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
public class LinkedStack<T> { | |
private static class Node<U> { | |
U item; | |
Node<U> next; | |
Node(){ | |
item = null; | |
next = null; | |
} | |
Node(U item, Node<U> next){ | |
this.item = item; |
This file contains hidden or 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 VolatileExample { | |
int x = 0; | |
volatile boolean v = false; | |
void writer() { | |
x = 42; | |
v = true; | |
} | |
void reader() { |
OlderNewer