## Posts

Showing posts from April, 2015

### Long Division for Repunit

This is about a month from last I post blog.

I have to continuously to post something about programming or mathmatics but these days I more concentrate on solving project euler problems and spending my whole time to think about how to solve it.
I solved it about 130 problems. solving 200 problems is my first plan.
Anyway
Today I want to post about long division. when we use computer language we just use division or remainder (/, %) so we don't have to know about how~ this is doing ...
when solving Project euler 129 I needed to long division. Question is Below~
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111. Given that n is a positive integer and GCD(n, 10) = 1, it can be shown that there always exists a value, k, for which R(k) is divisible byn, and let A(n) be the least such value of k; for example, A(7) = 6 and A(41) = 5. The least value of n for which A(n) first exceeds ten is 17. Find the …

### requestDisallowInterceptTouchEvent in android

https://developer.android.com/training/gestures/viewgroup.html

The onInterceptTouchEvent() method is called whenever a touch event is detected on the surface of a ViewGroup, including on the surface of its children. If onInterceptTouchEvent() returns true, the MotionEvent is intercepted, meaning it will be not be passed on to the child, but rather to the onTouchEvent() method of the parent.

onInterceptTouchEvetn 순서 부모 -> 자식

onInterceptTouchEvent이거는 자신 또는 자식의 터치가 발견되었을때 호출된다. onInterceptTouchEvent true = 지금 위치에 스크롤을 사용하겠다.                             false = 하위의 스크롤을 사용하겠다.

http://developer.android.com/reference/android/view/ViewParent.html public abstract void (boolean disallowIntercept)
Added in API level 1 Called when a child does not want this parent and its ancestors to intercept touch events with onInterceptTouchEvent(MotionEvent).
This parent should pass this call onto its parents. This parent must obey this request for the duration of the touch (that is, only clear the flag after this …