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
/** | |
* @return String with special XML characters escaped. | |
*/ | |
public static String escapeXml(String s) { | |
StringBuilder sb = new StringBuilder(); | |
for (int i = 0, len = s.length(); i < len; ++i) { | |
char c = s.charAt(i); | |
switch (c) { | |
case '<': sb.append("<"); break; | |
case '>': sb.append(">"); break; |
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
private static String getMethodName(String fildeName){ | |
byte[] items = fildeName.getBytes(); | |
items[0] = (byte)((char)items[0]-'a'+'A');; | |
return new String(items); | |
} |
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
/** | |
* 将毫秒时间转换成时分秒 | |
* @param totalTime | |
* @return | |
*/ | |
public String formatTime(int totalTime){ | |
int hour = 0; | |
int minute = 0; | |
int second = 0; | |
second = totalTime / 1000; |
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
/** | |
* | |
* @param v 需要处理的textview | |
* @param content 要处理的类容 | |
* @param show_len 需要显示的长度 | |
* @return | |
*/ | |
public static String dealDetailString(TextView v,String content,float show_len){ | |
TextPaint tpaint =v.getPaint(); | |
String temp=""; |
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
context.getResources().getConfiguration().locale.getLanguage() |
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.example.xmlparse; | |
import java.io.InputStream; | |
import java.util.ArrayList; | |
import java.util.List; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import org.w3c.dom.Document; |
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
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
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.wits.practice; | |
/** | |
* 找出数组中唯一的重复元素 | |
* @author dzwillpower | |
* 2013-2-21下午08:27:56 | |
*/ | |
public class FindOnlyRepeat { | |
public static void main(String[] args) { | |
int[] array =new int[]{1,2,3,4,4,5,6,7,8,9,10,11}; | |
System.out.println("repeat num: "+findRepeat(array)); |
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
// Please write an sequence list implements the interface with the required | |
// time complexity described in the comments. The users can add the same | |
// element as many times as they want, but it doesn't support the null item. | |
// You can use any types in .NET BCL but cannot use any 3rd party libraries. | |
// PS: You don't need to consider the multi-threaded environment. | |
interface IMyList<T> : IEnumerable<T> | |
{ | |
// O(1) | |
// Add an item at the beginning of the list. | |
void AddFirst(T item); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace LaozhaoQ | |
{ | |
// Please write an sequence list implements the interface with the required | |
// time complexity described in the comments. The users can add the same | |
// element as many times as they want, but it doesn't support the null item. |
OlderNewer