/**
* 泛型集合排序,根据实体类对象的某个属性排序
* @author admin
*
* @param
*/
public class SortList {
public void Sort(List list, final String method, final String sort) {...
分类:
编程语言 时间:
2015-08-05 12:59:26
阅读次数:
136
论两个数的交换的重要性
讨论交换两个数的方法对某些人来说无聊,但某些人很乐意探究,甚至某些面试官喜欢用这个做文章。刚出来找工作笔试的时候我也碰到与之相关的问题。
常见的两个数交换的方法
边赋值边运算
加减减交换
用中间变量交换
异或交换
下面是代码
public class Test {
public static void main(String[] args) {...
分类:
编程语言 时间:
2015-08-05 12:54:20
阅读次数:
137
1. 自定义NavigationController:@interface CustomNavigationController : UINavigationController2. 重写Push方法, 拦截Push进来的控制器:- (void)pushViewController:(UIViewC...
分类:
移动开发 时间:
2015-08-05 12:45:58
阅读次数:
173
多线程死锁: 死锁的常见情形之一:同步的嵌套。public class DeadLock { public static void main(String[] args) throws InterruptedException { Customer cus =...
分类:
编程语言 时间:
2015-08-05 12:43:47
阅读次数:
149
public class GetData extends AsyncTask { DataDownloadListener dataDownloadListener; public GetData() { } public void setDataDownlo...
分类:
其他好文 时间:
2015-08-05 12:28:50
阅读次数:
102
在C++中,有四种方法产生一个对象。第一种方法是在堆栈(stack)之中产生:void MyFunc(){ CFoo foo;//在堆栈(stack)中产生foo对象}第二种方法是在堆(heap)中产生它:void MyFunc(){ CFoo* pFoo=new CFoo();//在堆(heap)...
分类:
编程语言 时间:
2015-08-05 12:16:24
阅读次数:
125
1.定义自己的过滤器,Myfilter 实现Filter接口public class MyFilter implements Filter { FilterConfig filterConfig = null; public void init(FilterConfig filterConfig) ...
分类:
其他好文 时间:
2015-08-05 12:02:32
阅读次数:
106
前台界面
后台代码
//按钮事件
void saveButton_Click(object sender, RoutedEventArgs e)
{
if (userName.Text.Trim() == string.Empty)
{
errMessage.Foreground = new SolidColorBrush(Colors.Red);
...
分类:
Web程序 时间:
2015-08-05 10:38:29
阅读次数:
154
#include
#include
#include
#include
using namespace std;
int n, m, flag;
int a[11000], b[11000];
int cmp(int a, int b){
return a > b;
}
void dfs(int pos , int ans, int sum){
if(sum == n){
fl...
分类:
其他好文 时间:
2015-08-05 10:36:46
阅读次数:
102
private void Form1_Load(object sender, EventArgs e) { try { //程序运行位置 string R_startPath = Application.ExecutablePath; //对应于HKEY_LOCAL_MACHINE主键 Regis....