Posts

Showing posts from February, 2013

apk get package 명

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class APKAnalyzer {
private static int bufferSize = 4096;
public static void main(String[] args) throws Exception {
System.out.println( findPackageNameFromAPK("c:/sample/1.apk") );
}

private static String findPackageName( String str )
{
int index1 = str.indexOf("manifest") + "manifest".length();
int index2 = str.indexOf("application");

if( index1 == -1 || index2 == -1 ) return null;

boolean isStart = false, isFinish = false;
for( int i = index1 ; i < index2 ; i++ )
{
isFinish = true;
char d = str.charAt(i);
//패턴은 되도록 쓰지말라는 권고에 따라서 아스키값으로 비교
if( 46 <= d && d <= 122 )
{
isStart = true;
isFinish = false;
}

if( isStart == false ) index1++;
if( isStart && isFinish) {
index2 = i;
break;
}
}
return str.substring(index1, index2);
}

public static String findPackageNameFromAPK( String path …

TextArea height auto grow

https://github.com/jerryluk/jquery.autogrow

this is really awesome

open ssl install

http://dimdim.tistory.com/entry/openssl%EC%9D%84-%EC%9D%B4%EC%9A%A9%ED%95%9C-Tomcat-HTTPS-%EC%84%A4%EC%A0%95-PKCS12-%ED%8F%AC%EB%A7%B7

1.  access webSite

http://www.openssl.org/source/

2. use wget in linux and download

3. unzip gz file
  - gzip -d xxxx.tar.gz

4. tar
 tar -xvf xxxx.tar

5. ./config shared --prefix=/the folder to be installed/

6. make

7. make install



want to know if it exists

Singleton_3

/* Singleton with Private Members, step 3. */
MyNamespace.Singleton = (function() {
// Private members.
var privateAttribute1 = false;
var privateAttribute2 = [1, 2, 3];
function privateMethod1() {
...
}
function privateMethod2(args) {
...
}
return { // Public members.
publicAttribute1: true,
publicAttribute2: 10,
publicMethod1: function() {

},
publicMethod2: function(args) {
...
}
};
})();

Singleton_2

/* Singleton with Private Members, step 1. */
MyNamespace.Singleton = (function() {
return {};
})();

Singleton_1

/* Singleton as an Object Literal. */
MyNamespace.Singleton = {};

You will now use a function, executed immediately, to provide the same thing:

/* Singleton with Private Members, step 1. */
MyNamespace.Singleton = function() {
    return {};
}();


how to analyze table index

analyze table document compute statistics ex) DOCUMENT Table 만 Analyze analyze index xpkdocbox compute statistics ex) XPKDOCBOX Index 만 Analyze



select 'analyze table ' || table_name || ' estimate statistics;' from user_tables



select 'analyze index || index_name || estimate statistics;' from user_indexes


Make static class

function foo() {
  var a = 10;
  function bar() {
 a *= 2;
}
bar();
return a;
}
In this example, a is defined in the function foo, but the function bar can access it because
bar is also defined within foo. When bar is executed, it sets a to a times 2. It makes sense that bar
can access a when it is executed within foo, but what if you could execute bar outside of foo?
function foo() {
var a = 10;
function bar() {
a *= 2;
return a;
}
return bar;
}