Sunday, August 28, 2016

Monday, August 8, 2016

Today I Read: How to use Servlets and Ajax

 How to use Servlets and Ajax
 http://stackoverflow.com/questions/4112686/how-to-use-servlets-and-ajax/

Friday, August 5, 2016

MemcacheService, BigInteger, and Byte Array

MemcacheService syncCache = MemcacheServiceFactory.getMemcacheService();
IdentifiableValue oldValue = syncCache.getIdentifiable(key);
BigInteger.valueOf(0).toByteArray()
byte[] newValue = increment((byte[]) oldValue.getValue());
new BigInteger(newValue).intValue()
syncCache.putIfUntouched(key, oldValue, newValue)
break;
Thread.sleep(delayMs);

private byte[] increment(byte[] oldValue) {
    long val = new BigInteger(oldValue).intValue();
    val++;
    return BigInteger.valueOf(val).toByteArray();
}

Thursday, August 4, 2016

Oracle decode() and sign() functions and count(*) - count(COLUMN_NAME)

decode(sign(count(*) - count(COLUMN_NAME)), 1, 'Y', 'N')

1) count(*) - count(COLUMN_NAME): returns a count of non-null records, used with group by
2) sign(NUMBER): returns sign of NUMBER
    If NUMBER < 0, then sign returns -1
    If NUMBER = 0, then sign returns 0
    If NUMBER > 0, then sign returns 1
3) decode(sign(NUMBER), 1, 'Y', 'N'): if NUMBER is greater than 0, then returns 'Y', otherwise returns 'N'