File catalinaBase = new File( System.getProperty( "catalina.base" ) ).getAbsoluteFile(); // get tomcat root
可參考 自行 Google catalina.base
$.ajaxSetup({ cache: false });
$("#XXX").GridUnload();
ServiceEx install
如
ServiceEx install mem
android:theme="@android:style/Theme.Holo.NoActionBar">
參考:
Using the Action Bar , android api
/**
* Copyright (c) 2008 Greg Whalin
* All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the BSD license
*
* This library is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
*
* You should have received a copy of the BSD License along with this
* library.
*
* @author Greg Whalin
*/
package com.meetup.memcached.test;
import cht.batchevent.show.EventList;
import com.meetup.memcached.*;
import java.util.*;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.BasicConfigurator;
/*
*
*
*
*/
public class MemcachedBench2 {
// logger
private static Logger log =
Logger.getLogger( MemcachedBench2.class.getName() );
public static void main(String[] args) {
BasicConfigurator.configure();
org.apache.log4j.Logger.getRootLogger().setLevel( Level.OFF );
int runs = Integer.parseInt(args[0]);
int start = Integer.parseInt(args[1]);
//伺服器位址清單
String[] serverlist = { "127.0.0.1:9999" };
// initialize the pool for memcache servers
SockIOPool pool = SockIOPool.getInstance( "test" );
pool.setServers(serverlist);
pool.setInitConn( 100 );
pool.setMinConn( 100 );
pool.setMaxConn( 500 );
pool.setMaintSleep( 20 );
pool.setNagle( false );
pool.initialize();
// get client instance
MemcachedClient mc = new MemcachedClient( "test" ); // 要和pool 的名稱一樣
mc.setCompressEnable( false );
String keyBase = "testKey";
//String object = "This is a test of an object blah blah es, serialization does not seem to slow things down so much. The gzip compression is horrible horrible performance, so we only use it for very large objects. I have not done any heavy benchmarking recently";
long begin = System.currentTimeMillis();
long end = System.currentTimeMillis();
long time = end - begin;
begin = System.currentTimeMillis();
for (int i = start; i < start+runs; i++) {
String str = (String) mc.get(keyBase + i);
// 沒有資料時和資料庫要資料, 取得後放入 memcatch
if(str == null){
System.out.println(i+" is null ");
OBJ_obj = new OBJ();
StringBuffer _theobj = new StringBuffer();
_theobj = _obj.getDataFromDB();
String object =_theobj .toString();
mc.set(keyBase + i, object);
}
System.out.println(i+" : " + str);
}
end = System.currentTimeMillis();
time = end - begin;
System.out.println(runs + " gets: " + time + "ms");
// 取得多筆
String[] keys = new String[ runs ];
int j = 0;
for (int i = start; i < start+runs; i++) {
keys[ j ] = keyBase + i;
j++;
}
begin = System.currentTimeMillis();
Map vals = mc.getMulti( keys );
end = System.currentTimeMillis();
time = end - begin;
System.out.println(runs + " getMulti: " + time + "ms");
/*
* //刪除的語法
* begin = System.currentTimeMillis();
for (int i = start; i < start+runs; i++) {
mc.delete( keyBase + i );
}
end = System.currentTimeMillis();
time = end - begin;
System.out.println(runs + " deletes: " + time + "ms");*/
SockIOPool.getInstance( "test" ).shutDown();
}
}