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
public class Test extends Activity implements SensorEventListener | |
{ | |
TextView mOriX, mOriY, mOriZ; // 방향 센서 3축값 | |
TextView mMagX, mMagY, mMagZ; // 지자기 센서 3축값 | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) | |
{ | |
super.onCreate(savedInstanceState); |
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
var go = {}; | |
// 밑 x, 지수 n | |
go.x = 2; | |
go.n = 10000; | |
// 정수 x의 자릿수를 구함 (공식 : log10(x) + 1) | |
// log10 함수가 제공되지 않으므로 밑변환 공식 사용 | |
// log10(x) = log(x) / log(10) |
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
function insertClosureStack(obj, name, variable) { | |
var old = obj[name]; | |
obj[name] = function (n) { | |
if ( typeof n == 'number' ) { // 인자가 있는 경우 검색 시작 | |
if ( variable == n ) { // 클로저 꼭대기 환경변수 variable 값과 주어진 인자를 비교 | |
console.log('found ' + variable); // 맞으면 출력 | |
} else { // 아니면 | |
if ( typeof old == 'function' ) { // 직전 환경을 갖고있는 클로저(function)가 정의되어 있는지 확인 후 | |
old(n); // 있으면 호출하며 양파껍질 하나를 벗김 |